fix: update button (#477)
All checks were successful
Build and Deploy / build-and-deploy (push) Has been skipped

This commit is contained in:
Libin YANG 2024-12-18 12:59:50 +08:00 committed by GitHub
parent 3442a94c51
commit ea0a42dffb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 30 additions and 29 deletions

View File

@ -122,10 +122,10 @@ function copy() {
// position translateY // position translateY
.replace(/top:(.*?)em/g, `transform: translateY($1em)`) .replace(/top:(.*?)em/g, `transform: translateY($1em)`)
// //
.replaceAll(`hsl(var(--foreground))`, `#3f3f3f`) .replace(/hsl\(var\(--foreground\)\)/g, `#3f3f3f`)
.replaceAll(`var(--blockquote-background)`, `#f7f7f7`) .replace(/var\(--blockquote-background\)/g, `#f7f7f7`)
.replaceAll(`var(--md-primary-color)`, primaryColor.value) .replace(/var\(--md-primary-color\)/g, primaryColor.value)
.replaceAll(/--md-primary-color:.+?;/g, ``) .replace(/--md-primary-color:.+?;/g, ``)
.replace(/<span class="nodeLabel"([^>]*)><p[^>]*>(.*?)<\/p><\/span>/g, `<span class="nodeLabel"$1>$2</span>`) .replace(/<span class="nodeLabel"([^>]*)><p[^>]*>(.*?)<\/p><\/span>/g, `<span class="nodeLabel"$1>$2</span>`)
clipboardDiv.focus() clipboardDiv.focus()
@ -219,10 +219,10 @@ const formatOptions = ref<Format[]>([`rgb`, `hex`, `hsl`, `hsv`])
<HelpDropdown /> <HelpDropdown />
</Menubar> </Menubar>
<Button v-if="!store.isOpenPostSlider" variant="outline" @click="store.isOpenPostSlider = true" class="mr-2"> <Button v-if="!store.isOpenPostSlider" variant="outline" class="mr-2" @click="store.isOpenPostSlider = true">
<PanelLeftOpen class="size-4" /> <PanelLeftOpen class="size-4" />
</Button> </Button>
<Button v-else variant="outline" @click="store.isOpenPostSlider = false" class="mr-2"> <Button v-else variant="outline" class="mr-2" @click="store.isOpenPostSlider = false">
<PanelLeftClose class="size-4" /> <PanelLeftClose class="size-4" />
</Button> </Button>
<Popover> <Popover>

View File

@ -121,7 +121,7 @@ function delPost() {
:class="{ :class="{
'bg-primary text-primary-foreground': store.currentPostIndex === index, 'bg-primary text-primary-foreground': store.currentPostIndex === index,
}" }"
class="hover:text-primary-foreground hover:bg-primary/90 dark:bg-muted dark:hover:bg-muted h-8 w-full inline-flex items-center justify-start gap-2 whitespace-nowrap rounded px-2 text-sm transition-colors dark:text-white dark:hover:text-white" class="hover:bg-primary/90 hover:text-primary-foreground dark:bg-muted dark:hover:bg-muted h-8 w-full inline-flex items-center justify-start gap-2 whitespace-nowrap rounded px-2 text-sm transition-colors dark:text-white dark:hover:text-white"
@click="store.currentPostIndex = index" @click="store.currentPostIndex = index"
> >
<span class="line-clamp-1">{{ post.title }}</span> <span class="line-clamp-1">{{ post.title }}</span>

View File

@ -691,6 +691,7 @@ function onDrop(e: DragEvent) {
<Button <Button
variant="link" variant="link"
class="p-0" class="p-0"
as="a"
href="https://mpmd.pages.dev/tutorial/" href="https://mpmd.pages.dev/tutorial/"
target="_blank" target="_blank"
> >

View File

@ -10,7 +10,7 @@ const props = defineProps<{
<template> <template>
<div> <div>
<Label class="flex items-center"> <Label class="flex items-center">
<span class="mr-4 w-[150px] text-right font-bold min-h-4 flex-shrink-0" :class="{ required: props.required }"> <span class="mr-4 min-h-4 w-[150px] flex-shrink-0 text-right font-bold" :class="{ required: props.required }">
{{ props.label }} {{ props.label }}
</span> </span>
<slot /> <slot />

View File

@ -4,8 +4,8 @@ import { cn } from '@/lib/utils'
import { type AlertVariants, alertVariants } from '.' import { type AlertVariants, alertVariants } from '.'
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes[`class`]
variant?: AlertVariants['variant'] variant?: AlertVariants[`variant`]
}>() }>()
</script> </script>

View File

@ -3,7 +3,7 @@ import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes[`class`]
}>() }>()
</script> </script>

View File

@ -3,7 +3,7 @@ import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes[`class`]
}>() }>()
</script> </script>

View File

@ -5,17 +5,17 @@ export { default as AlertDescription } from './AlertDescription.vue'
export { default as AlertTitle } from './AlertTitle.vue' export { default as AlertTitle } from './AlertTitle.vue'
export const alertVariants = cva( export const alertVariants = cva(
'relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground', `relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground`,
{ {
variants: { variants: {
variant: { variant: {
default: 'bg-background text-foreground', default: `bg-background text-foreground`,
destructive: destructive:
'border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive', `border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive`,
}, },
}, },
defaultVariants: { defaultVariants: {
variant: 'default', variant: `default`,
}, },
}, },
) )

View File

@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'
import { Label, type LabelProps } from 'radix-vue' import { Label, type LabelProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue' import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<LabelProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<LabelProps & { class?: HTMLAttributes[`class`] }>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props const { class: _, ...delegated } = props

View File

@ -4,7 +4,7 @@ import { cn } from '@/lib/utils'
import { NumberFieldRoot, useForwardPropsEmits } from 'radix-vue' import { NumberFieldRoot, useForwardPropsEmits } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue' import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<NumberFieldRootProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<NumberFieldRootProps & { class?: HTMLAttributes[`class`] }>()
const emits = defineEmits<NumberFieldRootEmits>() const emits = defineEmits<NumberFieldRootEmits>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {

View File

@ -3,7 +3,7 @@ import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes[`class`]
}>() }>()
</script> </script>

View File

@ -5,7 +5,7 @@ import { Minus } from 'lucide-vue-next'
import { NumberFieldDecrement, useForwardProps } from 'radix-vue' import { NumberFieldDecrement, useForwardProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue' import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<NumberFieldDecrementProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<NumberFieldDecrementProps & { class?: HTMLAttributes[`class`] }>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props const { class: _, ...delegated } = props

View File

@ -5,7 +5,7 @@ import { Plus } from 'lucide-vue-next'
import { NumberFieldIncrement, useForwardProps } from 'radix-vue' import { NumberFieldIncrement, useForwardProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue' import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<NumberFieldIncrementProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<NumberFieldIncrementProps & { class?: HTMLAttributes[`class`] }>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props const { class: _, ...delegated } = props

View File

@ -4,7 +4,7 @@ import { cn } from '@/lib/utils'
import { NumberFieldInput } from 'radix-vue' import { NumberFieldInput } from 'radix-vue'
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes[`class`]
}>() }>()
</script> </script>

View File

@ -9,7 +9,7 @@ import {
} from 'radix-vue' } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue' import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<SwitchRootProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<SwitchRootProps & { class?: HTMLAttributes[`class`] }>()
const emits = defineEmits<SwitchRootEmits>() const emits = defineEmits<SwitchRootEmits>()

View File

@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'
import { TabsContent, type TabsContentProps } from 'radix-vue' import { TabsContent, type TabsContentProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue' import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<TabsContentProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<TabsContentProps & { class?: HTMLAttributes[`class`] }>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props const { class: _, ...delegated } = props

View File

@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'
import { TabsList, type TabsListProps } from 'radix-vue' import { TabsList, type TabsListProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue' import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<TabsListProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<TabsListProps & { class?: HTMLAttributes[`class`] }>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props const { class: _, ...delegated } = props

View File

@ -3,7 +3,7 @@ import { cn } from '@/lib/utils'
import { TabsTrigger, type TabsTriggerProps, useForwardProps } from 'radix-vue' import { TabsTrigger, type TabsTriggerProps, useForwardProps } from 'radix-vue'
import { computed, type HTMLAttributes } from 'vue' import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes['class'] }>() const props = defineProps<TabsTriggerProps & { class?: HTMLAttributes[`class`] }>()
const delegatedProps = computed(() => { const delegatedProps = computed(() => {
const { class: _, ...delegated } = props const { class: _, ...delegated } = props

View File

@ -4,16 +4,16 @@ import { cn } from '@/lib/utils'
import { useVModel } from '@vueuse/core' import { useVModel } from '@vueuse/core'
const props = defineProps<{ const props = defineProps<{
class?: HTMLAttributes['class'] class?: HTMLAttributes[`class`]
defaultValue?: string | number defaultValue?: string | number
modelValue?: string | number modelValue?: string | number
}>() }>()
const emits = defineEmits<{ const emits = defineEmits<{
(e: 'update:modelValue', payload: string | number): void (e: `update:modelValue`, payload: string | number): void
}>() }>()
const modelValue = useVModel(props, 'modelValue', emits, { const modelValue = useVModel(props, `modelValue`, emits, {
passive: true, passive: true,
defaultValue: props.defaultValue, defaultValue: props.defaultValue,
}) })