daisy-ui-kit 0.4.4
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.
- package/README.md +80 -0
- package/components/-utils.ts +41 -0
- package/components/.DS_Store +0 -0
- package/components/Alert.vue +27 -0
- package/components/Artboard.vue +33 -0
- package/components/Avatar.vue +85 -0
- package/components/AvatarGroup.vue +19 -0
- package/components/Badge.vue +45 -0
- package/components/BottomNav.vue +27 -0
- package/components/Breadcrumbs.vue +7 -0
- package/components/Button.config.ts +26 -0
- package/components/Button.vue +112 -0
- package/components/ButtonGroup.vue +5 -0
- package/components/Card.vue +31 -0
- package/components/CardActions.vue +16 -0
- package/components/CardBody.vue +16 -0
- package/components/CardTitle.vue +16 -0
- package/components/Carousel.vue +26 -0
- package/components/CarouselItem.vue +5 -0
- package/components/Checkbox.vue +47 -0
- package/components/Code.vue +91 -0
- package/components/CodePreview.vue +28 -0
- package/components/CodeWrapper.vue +10 -0
- package/components/Collapse.vue +33 -0
- package/components/CollapseContent.vue +5 -0
- package/components/CollapseTitle.vue +5 -0
- package/components/Countdown.vue +16 -0
- package/components/CountdownTimers.vue +66 -0
- package/components/Counter.vue +15 -0
- package/components/Crumb.vue +5 -0
- package/components/DarkToggle.vue +11 -0
- package/components/DemoElement.vue +32 -0
- package/components/DemoExample.vue +23 -0
- package/components/Divider.vue +25 -0
- package/components/Drawer.vue +19 -0
- package/components/DrawerLayout.vue +35 -0
- package/components/DrawerLayoutContent.vue +11 -0
- package/components/Dropdown.vue +30 -0
- package/components/DropdownContent.vue +3 -0
- package/components/Flex.vue +146 -0
- package/components/FlexItem.vue +146 -0
- package/components/Footer.vue +25 -0
- package/components/FooterTitle.vue +17 -0
- package/components/FormControl.vue +5 -0
- package/components/Hero.vue +17 -0
- package/components/HeroContent.vue +17 -0
- package/components/HeroOverlay.vue +5 -0
- package/components/Home/AlternatingFeatureSections.vue +217 -0
- package/components/Home/CTA.vue +27 -0
- package/components/Home/Footer.vue +210 -0
- package/components/Home/GradientFeatureSections.vue +98 -0
- package/components/Home/Header.vue +174 -0
- package/components/Home/Hero.vue +52 -0
- package/components/Home/LogoCloud.vue +49 -0
- package/components/Home/StatsSection.vue +51 -0
- package/components/Home/Testimonial.vue +23 -0
- package/components/Indicator.vue +16 -0
- package/components/IndicatorItem.vue +37 -0
- package/components/InputGroup.vue +33 -0
- package/components/Kbd.vue +26 -0
- package/components/Label.vue +17 -0
- package/components/LabelText.vue +17 -0
- package/components/LabelTextAlt.vue +17 -0
- package/components/Link.vue +32 -0
- package/components/Logo.vue +8 -0
- package/components/Mask.config.ts +77 -0
- package/components/Mask.vue +15 -0
- package/components/Menu.vue +26 -0
- package/components/MenuItem.vue +17 -0
- package/components/MenuTitle.vue +14 -0
- package/components/MobileSidebar.vue +92 -0
- package/components/MockupCode.vue +4 -0
- package/components/Modal.vue +16 -0
- package/components/ModalAction.vue +5 -0
- package/components/ModalBox.vue +5 -0
- package/components/ModalWrapper.vue +32 -0
- package/components/NavButton.vue +22 -0
- package/components/Navbar.vue +17 -0
- package/components/NavbarCenter.vue +16 -0
- package/components/NavbarEnd.vue +16 -0
- package/components/NavbarStart.vue +16 -0
- package/components/Phone.vue +8 -0
- package/components/Progress.vue +44 -0
- package/components/Prose.vue +36 -0
- package/components/RadialProgress.vue +42 -0
- package/components/Radio.vue +63 -0
- package/components/RadioGroup.vue +41 -0
- package/components/Range.vue +49 -0
- package/components/RangeMeasure.vue +71 -0
- package/components/RangeMeasureTick.vue +62 -0
- package/components/Rating.vue +152 -0
- package/components/Select.vue +104 -0
- package/components/Sidebar.vue +89 -0
- package/components/SidebarMenuSection.vue +35 -0
- package/components/SigninForm.vue +47 -0
- package/components/Stack.vue +16 -0
- package/components/Stat.vue +5 -0
- package/components/StatActions.vue +5 -0
- package/components/StatDesc.vue +5 -0
- package/components/StatFigure.vue +5 -0
- package/components/StatTitle.vue +5 -0
- package/components/StatValue.vue +5 -0
- package/components/Stats.vue +5 -0
- package/components/Step.vue +36 -0
- package/components/Steps.vue +22 -0
- package/components/Swap.vue +60 -0
- package/components/Tab.vue +49 -0
- package/components/TabContent.vue +28 -0
- package/components/Tabs.vue +71 -0
- package/components/TabsManager.vue +37 -0
- package/components/Text.vue +179 -0
- package/components/TextArea.vue +53 -0
- package/components/TextInput.vue +64 -0
- package/components/Toast.vue +33 -0
- package/components/Toggle.vue +48 -0
- package/components/Tooltip.vue +49 -0
- package/components/UserMenu.vue +62 -0
- package/components/Window.vue +5 -0
- package/components/fixtures.ts +62 -0
- package/components/theme/Builder.vue +284 -0
- package/components/theme/Output.vue +70 -0
- package/components/theme/Picker.vue +39 -0
- package/components/theme/Preview.vue +1684 -0
- package/components/theme/Provider.vue +43 -0
- package/components/theme/Snooper.vue +41 -0
- package/components/theme/Swatch.vue +47 -0
- package/components/theme/custom-themes.ts +34 -0
- package/components/theme/theme-utils.ts +164 -0
- package/components/types.ts +7 -0
- package/index.ts +96 -0
- package/package.json +55 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Prism from 'prismjs'
|
|
3
|
+
import 'prismjs/themes/prism-okaidia.css'
|
|
4
|
+
import { useClipboard } from '@vueuse/core'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: 'Code',
|
|
9
|
+
props: {
|
|
10
|
+
language: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'javascript',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
setup(props, context) {
|
|
16
|
+
const nuxtApp = useNuxtApp()
|
|
17
|
+
|
|
18
|
+
const source = ref(null)
|
|
19
|
+
const lang = computed(() => {
|
|
20
|
+
if (props.language === 'vue') return 'html'
|
|
21
|
+
else return props.language
|
|
22
|
+
})
|
|
23
|
+
const languageClass = computed(() => `language-${lang.value}`)
|
|
24
|
+
const { text, copy, copied, isSupported } = useClipboard({ source })
|
|
25
|
+
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
if (!nuxtApp.ssrContext) {
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
Prism.highlightAllUnder(source.value)
|
|
30
|
+
}, 0)
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
onBeforeUpdate(() => {
|
|
34
|
+
if (typeof context.slots.default[0] === 'string') {
|
|
35
|
+
const newText = context.slots.default[0].replace(
|
|
36
|
+
/^[\r\n\s]*|[\r\n\s]*$/g,
|
|
37
|
+
'',
|
|
38
|
+
)
|
|
39
|
+
context.el.querySelector('code').textContent = newText
|
|
40
|
+
Prism.highlightAllUnder(source.value)
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const doCopy = () => {
|
|
45
|
+
copy(source.value.innerText)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return { source, languageClass, text, copy, copied, isSupported, doCopy }
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div class="relative mockup-code">
|
|
55
|
+
<div class="absolute flex flex-row items-center top-1 right-1">
|
|
56
|
+
<div v-if="copied" class="pr-2 text-sm">
|
|
57
|
+
copied
|
|
58
|
+
</div>
|
|
59
|
+
<Button sm @click="doCopy">
|
|
60
|
+
copy
|
|
61
|
+
</Button>
|
|
62
|
+
</div>
|
|
63
|
+
<ClientOnly>
|
|
64
|
+
<pre
|
|
65
|
+
ref="source"
|
|
66
|
+
class="whitespace-pre-wrap daisy-code-highlight"
|
|
67
|
+
:class="languageClass"
|
|
68
|
+
><code><slot /></code></pre>
|
|
69
|
+
|
|
70
|
+
<template #fallback>
|
|
71
|
+
<pre
|
|
72
|
+
class="whitespace-pre-wrap daisy-code-highlight"
|
|
73
|
+
><code><slot /></code></pre>
|
|
74
|
+
</template>
|
|
75
|
+
</ClientOnly>
|
|
76
|
+
</div>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<style>
|
|
80
|
+
.mockup-code .daisy-code-highlight {
|
|
81
|
+
margin-left: 0 !important;
|
|
82
|
+
background: none;
|
|
83
|
+
border: none;
|
|
84
|
+
box-shadow: none;
|
|
85
|
+
padding-top: 0;
|
|
86
|
+
padding-bottom: 0;
|
|
87
|
+
}
|
|
88
|
+
.mockup-code pre.daisy-code-highlight:before {
|
|
89
|
+
margin: 0 !important;
|
|
90
|
+
}
|
|
91
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const slotWrapper = ref(null)
|
|
5
|
+
const innerHtml = computed(() => {
|
|
6
|
+
if (slotWrapper.value)
|
|
7
|
+
return slotWrapper.value.innerHtml
|
|
8
|
+
else
|
|
9
|
+
return ''
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
onMounted(() => {
|
|
13
|
+
if (!import.meta.env.SSR)
|
|
14
|
+
(window as any).innerHtml = innerHtml
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<div>
|
|
20
|
+
<div v-html="innerHtml" />
|
|
21
|
+
|
|
22
|
+
<div class="hidden">
|
|
23
|
+
<div ref="slotWrapper">
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
style?: 'arrow' | 'plus'
|
|
6
|
+
arrow?: boolean
|
|
7
|
+
plus?: boolean
|
|
8
|
+
|
|
9
|
+
open?: boolean
|
|
10
|
+
closed?: boolean
|
|
11
|
+
|
|
12
|
+
toggle?: boolean
|
|
13
|
+
}
|
|
14
|
+
const props = defineProps<Props>()
|
|
15
|
+
|
|
16
|
+
const classes = computed(() => {
|
|
17
|
+
const { style, arrow, plus, open, closed } = props
|
|
18
|
+
return {
|
|
19
|
+
'collapse-arrow': arrow || style === 'arrow',
|
|
20
|
+
'carousel-plus': plus || style === 'plus',
|
|
21
|
+
'carousel-open': open && !closed,
|
|
22
|
+
'carousel-closed': closed,
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div tabindex="0" class="collapse" :class="classes">
|
|
29
|
+
<input v-if="toggle" type="checkbox">
|
|
30
|
+
|
|
31
|
+
<slot />
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
is?: string | Function | Object
|
|
6
|
+
}
|
|
7
|
+
const props = defineProps<Props>()
|
|
8
|
+
|
|
9
|
+
const tag = computed(() => props.is || 'span')
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<component :is="tag" class="countdown">
|
|
14
|
+
<slot />
|
|
15
|
+
</component>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useIntervalFn } from '@vueuse/core'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
durationInSeconds?: number
|
|
7
|
+
untilDate?: Date
|
|
8
|
+
interval?: number
|
|
9
|
+
}
|
|
10
|
+
const props = defineProps<Props>()
|
|
11
|
+
|
|
12
|
+
const calculateDate = () => props.untilDate || new Date(Date.now() + props.durationInSeconds * 1000)
|
|
13
|
+
const targetDate = ref<Date>(calculateDate())
|
|
14
|
+
watch(
|
|
15
|
+
() => props.durationInSeconds,
|
|
16
|
+
() => {
|
|
17
|
+
targetDate.value = calculateDate()
|
|
18
|
+
},
|
|
19
|
+
{ immediate: true },
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
// The target date
|
|
23
|
+
const calcTimeLeft = () => {
|
|
24
|
+
const remaining = targetDate.value.getTime() - Date.now()
|
|
25
|
+
return remaining < 0 ? 0 : remaining
|
|
26
|
+
}
|
|
27
|
+
const timeLeft = ref(calcTimeLeft())
|
|
28
|
+
useIntervalFn(() => {
|
|
29
|
+
timeLeft.value = calcTimeLeft()
|
|
30
|
+
}, 1000)
|
|
31
|
+
|
|
32
|
+
const totalSeconds = computed(() => Math.round(timeLeft.value / 1000))
|
|
33
|
+
const totalMinutes = computed(() => Math.floor(timeLeft.value / 1000 / 60))
|
|
34
|
+
const totalHours = computed(() => Math.floor(timeLeft.value / 1000 / 60 / 60))
|
|
35
|
+
const totalDays = computed(() => Math.floor(timeLeft.value / 1000 / 60 / 60 / 24))
|
|
36
|
+
const totalWeeks = computed(() => Math.floor(timeLeft.value / 1000 / 60 / 60 / 24 / 7))
|
|
37
|
+
const totalMonths = computed(() => {
|
|
38
|
+
const today = new Date()
|
|
39
|
+
let diffMonths = (targetDate.value.getFullYear() - today.getFullYear()) * 12
|
|
40
|
+
diffMonths -= targetDate.value.getMonth()
|
|
41
|
+
diffMonths += today.getMonth()
|
|
42
|
+
return diffMonths
|
|
43
|
+
})
|
|
44
|
+
const split = computed(() => {
|
|
45
|
+
const days = totalDays.value
|
|
46
|
+
const hours = totalHours.value - days * 24
|
|
47
|
+
const minutes = totalMinutes.value - hours * 60
|
|
48
|
+
const seconds = totalSeconds.value - totalMinutes.value * 60
|
|
49
|
+
return { days, hours, minutes, seconds }
|
|
50
|
+
})
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<slot
|
|
55
|
+
v-bind="{
|
|
56
|
+
totalSeconds,
|
|
57
|
+
totalMinutes,
|
|
58
|
+
totalHours,
|
|
59
|
+
totalDays,
|
|
60
|
+
totalWeeks,
|
|
61
|
+
totalMonths,
|
|
62
|
+
targetDate,
|
|
63
|
+
split,
|
|
64
|
+
}"
|
|
65
|
+
/>
|
|
66
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
value: number
|
|
6
|
+
is?: string | Function
|
|
7
|
+
}
|
|
8
|
+
const props = defineProps<Props>()
|
|
9
|
+
|
|
10
|
+
const tag = computed(() => props.is || 'span')
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<component :is="tag" v-bind="$attrs" :style="`--value:${value};`" />
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
const isDark = useDark()
|
|
3
|
+
const toggleDark = useToggle(isDark)
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<button class="!outline-none" @click="toggleDark()">
|
|
8
|
+
<div v-if="isDark" class="i-carbon-moon" />
|
|
9
|
+
<div v-else class="i-carbon-sun" />
|
|
10
|
+
</button>
|
|
11
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
tag: String,
|
|
6
|
+
props: Object,
|
|
7
|
+
multiline: Boolean,
|
|
8
|
+
})
|
|
9
|
+
const propsString = computed(() => {
|
|
10
|
+
const string = Object.keys(props.props).reduce((propString: string, key: string, index: number) => {
|
|
11
|
+
const value = props.props[key]
|
|
12
|
+
const betweenPropSpacing = props.multiline ? '' : ' '
|
|
13
|
+
let append = `${props.multiline ? '\n ' : ''}`
|
|
14
|
+
if (value === true) append += `${betweenPropSpacing}${key}`
|
|
15
|
+
else if (value === false) append += `${betweenPropSpacing}:${key}="false"`
|
|
16
|
+
return propString += append
|
|
17
|
+
}, '')
|
|
18
|
+
return `${string}${props.multiline ? '\n' : ''}`
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="font-mono">
|
|
24
|
+
<<span class="text-accent">{{ tag }}</span><span class="span-pre">{{ propsString }}</span>><slot /></<span class="text-accent">{{ tag }}</span>>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.span-pre {
|
|
30
|
+
white-space: pre-wrap;
|
|
31
|
+
}
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
noPadding: Boolean,
|
|
6
|
+
allowProse: Boolean,
|
|
7
|
+
})
|
|
8
|
+
const classes = computed(() => {
|
|
9
|
+
return {
|
|
10
|
+
'p-12': !props.noPadding,
|
|
11
|
+
'not-prose': !props.allowProse,
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div
|
|
18
|
+
class="flex flex-row flex-wrap items-center mt-4 border-4 demo-example rounded-t-xl border-base-200 xl:max-w-3/4"
|
|
19
|
+
:class="classes"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineProps, withDefaults } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
horizontal?: boolean
|
|
6
|
+
vertical?: boolean
|
|
7
|
+
}
|
|
8
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
9
|
+
horizontal: false,
|
|
10
|
+
vertical: false,
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const classes = computed(() => {
|
|
14
|
+
return {
|
|
15
|
+
'divider-horizontal': props.horizontal,
|
|
16
|
+
'divider-vertical': props.vertical,
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="divider" :class="classes">
|
|
23
|
+
<slot />
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface DrawerState {
|
|
5
|
+
isDrawerOpen: boolean
|
|
6
|
+
openDrawer: Function
|
|
7
|
+
closeDrawer: Function
|
|
8
|
+
toggleDrawer: Function
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const drawerState: DrawerState = inject('drawerState')
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="drawer-side">
|
|
16
|
+
<div class="drawer-overlay" @click="() => drawerState.closeDrawer()" />
|
|
17
|
+
<slot v-bind="drawerState" />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineProps, reactive } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
right: Boolean,
|
|
6
|
+
mobile: Boolean,
|
|
7
|
+
})
|
|
8
|
+
const drawerState = reactive({
|
|
9
|
+
isDrawerOpen: false,
|
|
10
|
+
openDrawer() {
|
|
11
|
+
drawerState.isDrawerOpen = true
|
|
12
|
+
},
|
|
13
|
+
closeDrawer() {
|
|
14
|
+
drawerState.isDrawerOpen = false
|
|
15
|
+
},
|
|
16
|
+
toggleDrawer() {
|
|
17
|
+
drawerState.isDrawerOpen = !drawerState.isDrawerOpen
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
provide('drawerState', drawerState)
|
|
21
|
+
|
|
22
|
+
const classes = computed(() => {
|
|
23
|
+
return {
|
|
24
|
+
'drawer-end': props.right,
|
|
25
|
+
'drawer-mobile': props.mobile,
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div class="drawer" :class="classes">
|
|
32
|
+
<input v-model="drawerState.isDrawerOpen" type="checkbox" class="drawer-toggle">
|
|
33
|
+
<slot v-bind="drawerState" />
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineProps } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
top?: boolean
|
|
6
|
+
right?: boolean
|
|
7
|
+
left?: boolean
|
|
8
|
+
end?: boolean
|
|
9
|
+
hover?: boolean
|
|
10
|
+
open?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const props = defineProps<Props>()
|
|
14
|
+
const classes = computed(() => {
|
|
15
|
+
return {
|
|
16
|
+
'dropdown-top': props.top,
|
|
17
|
+
'dropdown-left': props.left,
|
|
18
|
+
'dropdown-right': props.right,
|
|
19
|
+
'dropdown-end': props.end,
|
|
20
|
+
'dropdown-hover': props.hover,
|
|
21
|
+
'dropdown-open': props.open,
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div class="dropdown" :class="classes">
|
|
28
|
+
<slot />
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineProps } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
is?: string | Object | Function
|
|
6
|
+
|
|
7
|
+
// https://tailwindcss.com/docs/flex
|
|
8
|
+
flex?: boolean
|
|
9
|
+
|
|
10
|
+
flex1?: boolean
|
|
11
|
+
flexAuto?: boolean
|
|
12
|
+
flexInitial?: boolean
|
|
13
|
+
none?: boolean
|
|
14
|
+
|
|
15
|
+
grow?: boolean
|
|
16
|
+
|
|
17
|
+
// https://tailwindcss.com/docs/flex-direction
|
|
18
|
+
direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse'
|
|
19
|
+
row?: boolean
|
|
20
|
+
col?: boolean
|
|
21
|
+
reverse?: boolean
|
|
22
|
+
|
|
23
|
+
// https://tailwindcss.com/docs/flex-wrap
|
|
24
|
+
wrap?: boolean
|
|
25
|
+
nowrap?: boolean
|
|
26
|
+
wrapReverse?: boolean
|
|
27
|
+
|
|
28
|
+
// https://tailwindcss.com/docs/align-items
|
|
29
|
+
alignItems?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'
|
|
30
|
+
itemsStart?: boolean
|
|
31
|
+
itemsEnd?: boolean
|
|
32
|
+
itemsCenter?: boolean
|
|
33
|
+
itemsBaseline?: boolean
|
|
34
|
+
itemsStretch?: boolean
|
|
35
|
+
|
|
36
|
+
// https://tailwindcss.com/docs/align-content
|
|
37
|
+
alignContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'
|
|
38
|
+
contentStart?: boolean
|
|
39
|
+
contentEnd?: boolean
|
|
40
|
+
contentCenter?: boolean
|
|
41
|
+
contentBetween?: boolean
|
|
42
|
+
contentAround?: boolean
|
|
43
|
+
contentEvenly?: boolean
|
|
44
|
+
|
|
45
|
+
// https://tailwindcss.com/docs/align-self
|
|
46
|
+
alignSelf?: 'auto' | 'start' | 'end' | 'center' | 'stretch' | 'baseline'
|
|
47
|
+
selfAuto?: boolean
|
|
48
|
+
selfStart?: boolean
|
|
49
|
+
selfEnd?: boolean
|
|
50
|
+
selfCenter?: boolean
|
|
51
|
+
selfStretch?: boolean
|
|
52
|
+
selfBaseline?: boolean
|
|
53
|
+
|
|
54
|
+
// https://tailwindcss.com/docs/justify-content
|
|
55
|
+
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'
|
|
56
|
+
justifyStart?: boolean
|
|
57
|
+
justifyEnd?: boolean
|
|
58
|
+
justifyCenter?: boolean
|
|
59
|
+
justifyBetween?: boolean
|
|
60
|
+
justifyAround?: boolean
|
|
61
|
+
justifyEvenly?: boolean
|
|
62
|
+
|
|
63
|
+
// https://tailwindcss.com/docs/justify-items
|
|
64
|
+
justifyItems?: 'start' | 'end' | 'center' | 'stretch'
|
|
65
|
+
justifyItemsStart?: boolean
|
|
66
|
+
justifyItemsEnd?: boolean
|
|
67
|
+
justifyItemsCenter?: boolean
|
|
68
|
+
justifyItemsStretch?: boolean
|
|
69
|
+
|
|
70
|
+
// https://tailwindcss.com/docs/justify-self
|
|
71
|
+
justifySelf?: 'auto' | 'start' | 'end' | 'center' | 'stretch'
|
|
72
|
+
justifySelfAuto?: boolean
|
|
73
|
+
justifySelfStart?: boolean
|
|
74
|
+
justifySelfEnd?: boolean
|
|
75
|
+
justifySelfCenter?: boolean
|
|
76
|
+
justifySelfStretch?: boolean
|
|
77
|
+
}
|
|
78
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
79
|
+
is: 'div',
|
|
80
|
+
flex: true,
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
const classes = computed(() => {
|
|
84
|
+
return {
|
|
85
|
+
'flex-1': props.flex1,
|
|
86
|
+
'flex-auto': props.flexAuto,
|
|
87
|
+
'flex-initial': props.flexInitial,
|
|
88
|
+
'flex-none': props.none,
|
|
89
|
+
|
|
90
|
+
'flex-grow': props.grow,
|
|
91
|
+
|
|
92
|
+
'flex-row': props.direction === 'row' || props.row,
|
|
93
|
+
'flex-col': props.direction === 'col' || props.col,
|
|
94
|
+
'flex-row-reverse': props.direction === 'row-reverse' || (props.row && props.reverse),
|
|
95
|
+
'flex-col-reverse': props.direction === 'col-reverse' || (props.col && props.reverse),
|
|
96
|
+
|
|
97
|
+
'flex-wrap': props.wrap,
|
|
98
|
+
'flex-wrap-reverse': props.wrapReverse,
|
|
99
|
+
'flex-nowrap': props.nowrap,
|
|
100
|
+
|
|
101
|
+
'content-start': props.alignContent === 'start' || props.contentStart,
|
|
102
|
+
'content-end': props.alignContent === 'end' || props.contentEnd,
|
|
103
|
+
'content-center': props.alignContent === 'center' || props.contentCenter,
|
|
104
|
+
'content-between': props.alignContent === 'between' || props.contentBetween,
|
|
105
|
+
'content-around': props.alignContent === 'around' || props.contentAround,
|
|
106
|
+
'content-evenly': props.alignContent === 'evenly' || props.contentEvenly,
|
|
107
|
+
|
|
108
|
+
'items-start': props.alignItems === 'start' || props.itemsStart,
|
|
109
|
+
'items-end': props.alignItems === 'end' || props.itemsEnd,
|
|
110
|
+
'items-center': props.alignItems === 'center' || props.itemsCenter,
|
|
111
|
+
'items-baseline': props.alignItems === 'baseline' || props.itemsBaseline,
|
|
112
|
+
'items-stretch': props.alignItems === 'stretch' || props.itemsStretch,
|
|
113
|
+
|
|
114
|
+
'self-auto': props.alignSelf === 'auto' || props.selfAuto,
|
|
115
|
+
'self-start': props.alignSelf === 'start' || props.selfStart,
|
|
116
|
+
'self-end': props.alignSelf === 'end' || props.selfEnd,
|
|
117
|
+
'self-center': props.alignSelf === 'center' || props.selfCenter,
|
|
118
|
+
'self-stretch': props.alignSelf === 'stretch' || props.selfStretch,
|
|
119
|
+
'self-baseline': props.alignSelf === 'baseline' || props.selfBaseline,
|
|
120
|
+
|
|
121
|
+
'justify-start': props.justify === 'start' || props.justifyStart,
|
|
122
|
+
'justify-end': props.justify === 'end' || props.justifyEnd,
|
|
123
|
+
'justify-center': props.justify === 'center' || props.justifyCenter,
|
|
124
|
+
'justify-between': props.justify === 'between' || props.justifyBetween,
|
|
125
|
+
'justify-around': props.justify === 'around' || props.justifyAround,
|
|
126
|
+
'justify-evenly': props.justify === 'evenly' || props.justifyEvenly,
|
|
127
|
+
|
|
128
|
+
'justify-items-start': props.justifyItems === 'start' || props.justifyItemsStart,
|
|
129
|
+
'justify-items-end': props.justifyItems === 'end' || props.justifyItemsEnd,
|
|
130
|
+
'justify-items-center': props.justifyItems === 'center' || props.justifyItemsCenter,
|
|
131
|
+
'justify-items-stretch': props.justifyItems === 'stretch' || props.justifyItemsStretch,
|
|
132
|
+
|
|
133
|
+
'justify-self-auto': props.justifySelf === 'auto' || props.justifySelfAuto,
|
|
134
|
+
'justify-self-start': props.justifySelf === 'start' || props.justifySelfStart,
|
|
135
|
+
'justify-self-end': props.justifySelf === 'end' || props.justifySelfEnd,
|
|
136
|
+
'justify-self-center': props.justifySelf === 'center' || props.justifySelfCenter,
|
|
137
|
+
'justify-self-stretch': props.justifySelf === 'stretch' || props.justifySelfStretch,
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
</script>
|
|
141
|
+
|
|
142
|
+
<template>
|
|
143
|
+
<component :is="is" class="flex" :class="classes">
|
|
144
|
+
<slot />
|
|
145
|
+
</component>
|
|
146
|
+
</template>
|