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
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://user-images.githubusercontent.com/11247099/140462375-7b7ac4db-35b7-453c-8a05-13d8d20282c4.png" width="600"/>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h2 align="center">
|
|
6
|
+
<a href="https://github.com/antfu/vitesse">Vitesse</a> for Nuxt 3
|
|
7
|
+
</h2><br>
|
|
8
|
+
|
|
9
|
+
<pre align="center">
|
|
10
|
+
🧪 Working in Progress
|
|
11
|
+
</pre>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<br>
|
|
15
|
+
<a href="https://vitesse-nuxt3.netlify.app/">🖥 Online Preview</a>
|
|
16
|
+
<br><br>
|
|
17
|
+
<a href="https://stackblitz.com/github/antfu/vitesse-nuxt3"><img src="https://developer.stackblitz.com/img/open_in_stackblitz.svg" alt=""></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- [💚 Nuxt 3](https://v3.nuxtjs.org) - SSR, ESR, File-based routing, components auto importing, modules, etc.
|
|
23
|
+
|
|
24
|
+
- ⚡️ Vite - Instant HMR
|
|
25
|
+
|
|
26
|
+
- 🎨 [UnoCSS](https://github.com/antfu/unocss) - The instant on-demand atomic CSS engine.
|
|
27
|
+
|
|
28
|
+
- 😃 Use icons from any icon sets in Pure CSS, powered by [UnoCSS](https://github.com/antfu/unocss)
|
|
29
|
+
|
|
30
|
+
- 🔥 The `<script setup>` syntax
|
|
31
|
+
|
|
32
|
+
- 🍍 [State Management via Pinia](https://pinia.esm.dev), see [./composables/user.ts](./composables/user.ts)
|
|
33
|
+
|
|
34
|
+
- 📑 [Layout system](./layouts)
|
|
35
|
+
|
|
36
|
+
- 📥 APIs auto importing - for Composition API, VueUse and custom composables.
|
|
37
|
+
|
|
38
|
+
- 🏎 Zero-config cloud functions and deploy
|
|
39
|
+
|
|
40
|
+
- 🦾 TypeScript, of course
|
|
41
|
+
|
|
42
|
+
## Plugins
|
|
43
|
+
|
|
44
|
+
### Nuxt Modules
|
|
45
|
+
|
|
46
|
+
- [VueUse](https://github.com/vueuse/vueuse) - collection of useful composition APIs.
|
|
47
|
+
- [ColorMode](https://github.com/nuxt-community/color-mode-module) - dark and Light mode with auto detection made easy with Nuxt.
|
|
48
|
+
- [UnoCSS](https://github.com/antfu/unocss) - the instant on-demand atomic CSS engine.
|
|
49
|
+
- [Pinia](https://pinia.esm.dev/) - intuitive, type safe, light and flexible Store for Vue.
|
|
50
|
+
|
|
51
|
+
## IDE
|
|
52
|
+
|
|
53
|
+
We recommend using [VS Code](https://code.visualstudio.com/) with [Volar](https://github.com/johnsoncodehk/volar) to get the best experience (You might want to disable Vetur if you have it).
|
|
54
|
+
|
|
55
|
+
## Variations
|
|
56
|
+
|
|
57
|
+
- [vitesse](https://github.com/antfu/vitesse) - Opinionated Vite Starter Template
|
|
58
|
+
- [vitesse-lite](https://github.com/antfu/vitesse-lite) - Lightweight version of Vitesse
|
|
59
|
+
- [vitesse-nuxt-bridge](https://github.com/antfu/vitesse-nuxt-bridge) - Vitesse for Nuxt 2 with Bridge
|
|
60
|
+
- [vitesse-webext](https://github.com/antfu/vitesse-webext) - WebExtension Vite starter template
|
|
61
|
+
|
|
62
|
+
## Try it now!
|
|
63
|
+
|
|
64
|
+
### Online
|
|
65
|
+
|
|
66
|
+
<a href="https://stackblitz.com/github/antfu/vitesse-nuxt3"><img src="https://developer.stackblitz.com/img/open_in_stackblitz.svg" alt=""></a>
|
|
67
|
+
|
|
68
|
+
### GitHub Template
|
|
69
|
+
|
|
70
|
+
[Create a repo from this template on GitHub](https://github.com/antfu/vitesse-nuxt3/generate).
|
|
71
|
+
|
|
72
|
+
### Clone to local
|
|
73
|
+
|
|
74
|
+
If you prefer to do it manually with the cleaner git history
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx degit antfu/vitesse-nuxt3 my-nuxt3-app
|
|
78
|
+
cd my-nuxt3-app
|
|
79
|
+
pnpm i # If you don't have pnpm installed, run: npm install -g pnpm
|
|
80
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { computed } from 'vue'
|
|
2
|
+
|
|
3
|
+
interface MakeExclusiveClassOptions {
|
|
4
|
+
props: Record<string, any>
|
|
5
|
+
prefix: string
|
|
6
|
+
prop: string
|
|
7
|
+
propList: string[]
|
|
8
|
+
defaultVal?: string
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates a className for the provided `prop` name and checks that multiple are not enabled.
|
|
12
|
+
* @param prefix will be added to all classes that do not begin with `-`. For those that do, the `-` will be stripped.
|
|
13
|
+
* @param prop
|
|
14
|
+
* @param propList
|
|
15
|
+
* @param defaultVal
|
|
16
|
+
*/
|
|
17
|
+
export function makeExclusiveClass({
|
|
18
|
+
props,
|
|
19
|
+
prefix,
|
|
20
|
+
prop,
|
|
21
|
+
propList,
|
|
22
|
+
defaultVal = '',
|
|
23
|
+
}: MakeExclusiveClassOptions) {
|
|
24
|
+
return computed(() => {
|
|
25
|
+
const active = propList.filter((v: string) => props[v.replace('-', '')])
|
|
26
|
+
if (active.length > 1) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
`only one ${prop} can be enabled at a time. Current are ${active}`
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
const current = active[0] || ''
|
|
32
|
+
const _prefix = current.startsWith('-') ? '' : prefix
|
|
33
|
+
return current ? `${_prefix}${current.replace('-', '') || defaultVal}` : ''
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function makeIndividualClass({ props, prefix, prop }) {
|
|
38
|
+
return computed(() => {
|
|
39
|
+
return props[prop] ? `${prefix}${prop}` : ''
|
|
40
|
+
})
|
|
41
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props: any = defineProps<{
|
|
5
|
+
state?: string
|
|
6
|
+
info?: boolean
|
|
7
|
+
success?: boolean
|
|
8
|
+
warning?: boolean
|
|
9
|
+
error?: boolean
|
|
10
|
+
}>()
|
|
11
|
+
const classes = computed(() => {
|
|
12
|
+
return {
|
|
13
|
+
'alert-info': props.info || props.state === 'info',
|
|
14
|
+
'alert-success': props.success || props.state === 'success',
|
|
15
|
+
'alert-warning': props.warning || props.state === 'warning',
|
|
16
|
+
'alert-error': props.error || props.state === 'error',
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="alert" :class="classes">
|
|
23
|
+
<div>
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
size?: string
|
|
6
|
+
demo?: boolean
|
|
7
|
+
horizontal?: boolean
|
|
8
|
+
phone1?: boolean
|
|
9
|
+
phone2?: boolean
|
|
10
|
+
phone3?: boolean
|
|
11
|
+
phone4?: boolean
|
|
12
|
+
phone5?: boolean
|
|
13
|
+
phone6?: boolean
|
|
14
|
+
}>()
|
|
15
|
+
const classes = computed(() => {
|
|
16
|
+
return {
|
|
17
|
+
'artboard-demo': props.demo,
|
|
18
|
+
'horizontal': props.horizontal,
|
|
19
|
+
'phone-1': props.phone1 || props.size === 'phone-1',
|
|
20
|
+
'phone-2': props.phone2 || props.size === 'phone-2',
|
|
21
|
+
'phone-3': props.phone3 || props.size === 'phone-3',
|
|
22
|
+
'phone-4': props.phone4 || props.size === 'phone-4',
|
|
23
|
+
'phone-5': props.phone5 || props.size === 'phone-5',
|
|
24
|
+
'phone-6': props.phone6 || props.size === 'phone-6',
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div class="artboard" :class="classes">
|
|
31
|
+
<slot />
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { makeMaskClasses, maskProps } from './Mask.config'
|
|
4
|
+
import Mask from './Mask.vue'
|
|
5
|
+
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
text: { type: String },
|
|
8
|
+
charCount: { type: Number, default: 1 },
|
|
9
|
+
backgroundColor: { type: String, default: '#BBB' },
|
|
10
|
+
size: { type: [Number, String], default: 6 },
|
|
11
|
+
innerClass: String,
|
|
12
|
+
showStatus: Boolean,
|
|
13
|
+
online: Boolean,
|
|
14
|
+
...maskProps,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const classes = computed(() => {
|
|
18
|
+
return {
|
|
19
|
+
online: props.showStatus && props.online,
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const maskClasses = makeMaskClasses(props)
|
|
24
|
+
const allMaskClasses = computed(() => {
|
|
25
|
+
const classes = maskClasses.value
|
|
26
|
+
const hasMaskClass = Object.values(classes).find(v => v)
|
|
27
|
+
// Enable rounded-btn class only if no mask classes are applied
|
|
28
|
+
Object.assign(classes, { 'rounded-btn': !hasMaskClass })
|
|
29
|
+
return classes
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const initials = computed(() => {
|
|
33
|
+
const parts = (props.text || '').split(' ')
|
|
34
|
+
return parts.reduce((chars: string, part: string) => {
|
|
35
|
+
if (props.charCount === chars.length)
|
|
36
|
+
return chars
|
|
37
|
+
|
|
38
|
+
const char = part.slice(0, 1).toUpperCase()
|
|
39
|
+
|
|
40
|
+
return chars + char
|
|
41
|
+
}, '')
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
const color = computed(() => {
|
|
45
|
+
return `#${contrastingColor(props.backgroundColor.replace('#', ''))}`
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
function contrastingColor(color) {
|
|
49
|
+
return (luma(color) >= 155) ? '000' : 'fff'
|
|
50
|
+
}
|
|
51
|
+
// color can be a hx string or an array of RGB values 0-255
|
|
52
|
+
function luma(color) {
|
|
53
|
+
const rgb = (typeof color === 'string') ? hexToRGBArray(color) : color
|
|
54
|
+
return (0.2126 * rgb[0]) + (0.7152 * rgb[1]) + (0.0722 * rgb[2]) // SMPTE C, Rec. 709 weightings
|
|
55
|
+
}
|
|
56
|
+
function hexToRGBArray(color) {
|
|
57
|
+
if (color.length === 3)
|
|
58
|
+
color = color.charAt(0) + color.charAt(0) + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2)
|
|
59
|
+
else if (color.length !== 6)
|
|
60
|
+
throw new Error(`Invalid hex color: ${color}`)
|
|
61
|
+
const rgb = []
|
|
62
|
+
for (let i = 0; i <= 2; i++)
|
|
63
|
+
rgb[i] = parseInt(color.substr(i * 2, 2), 16)
|
|
64
|
+
return rgb
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<div class="avatar" :class="classes">
|
|
70
|
+
<Mask :style="{ backgroundColor, color }" class="w-full h-full avatar-mask aspect-square" :class="[allMaskClasses, innerClass]">
|
|
71
|
+
<slot />
|
|
72
|
+
</Mask>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<style lang="postcss">
|
|
77
|
+
.avatar-mask > * {
|
|
78
|
+
aspect-ratio: 1/1;
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
vertical: Boolean,
|
|
6
|
+
})
|
|
7
|
+
const classes = computed(() => {
|
|
8
|
+
return {
|
|
9
|
+
'flex-col': props.vertical,
|
|
10
|
+
'flex-row': !props.vertical,
|
|
11
|
+
}
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="avatar-group" :class="classes">
|
|
17
|
+
<slot />
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
outline?: boolean
|
|
6
|
+
|
|
7
|
+
size?: string
|
|
8
|
+
lg?: boolean
|
|
9
|
+
md?: boolean
|
|
10
|
+
sm?: boolean
|
|
11
|
+
xs?: boolean
|
|
12
|
+
|
|
13
|
+
color?: string
|
|
14
|
+
primary?: boolean
|
|
15
|
+
secondary?: boolean
|
|
16
|
+
accent?: boolean
|
|
17
|
+
info?: boolean
|
|
18
|
+
success?: boolean
|
|
19
|
+
warning?: boolean
|
|
20
|
+
error?: boolean
|
|
21
|
+
}>()
|
|
22
|
+
|
|
23
|
+
const classes = computed(() => {
|
|
24
|
+
return {
|
|
25
|
+
'badge-outline': props.outline,
|
|
26
|
+
'badge-lg': props.lg || props.size === 'lg',
|
|
27
|
+
'badge-md': props.md || props.size === 'md',
|
|
28
|
+
'badge-sm': props.sm || props.size === 'sm',
|
|
29
|
+
'badge-xs': props.xs || props.size === 'xs',
|
|
30
|
+
'badge-primary': props.primary || props.color === 'primary',
|
|
31
|
+
'badge-secondary': props.secondary || props.color === 'secondary',
|
|
32
|
+
'badge-accent': props.accent || props.color === 'accent',
|
|
33
|
+
'badge-info': props.info || props.color === 'info',
|
|
34
|
+
'badge-success': props.success || props.color === 'success',
|
|
35
|
+
'badge-warning': props.warning || props.color === 'warning',
|
|
36
|
+
'badge-error': props.error || props.color === 'error',
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="badge" :class="classes">
|
|
43
|
+
<slot />
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineProps } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
size?: string
|
|
6
|
+
lg?: boolean
|
|
7
|
+
md?: boolean
|
|
8
|
+
sm?: boolean
|
|
9
|
+
xs?: boolean
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = defineProps<Props>()
|
|
13
|
+
const classes = computed(() => {
|
|
14
|
+
return {
|
|
15
|
+
'btm-nav-lg': props.lg || props.size === 'lg',
|
|
16
|
+
'btm-nav-md': props.md || props.size === 'md',
|
|
17
|
+
'btm-nav-sm': props.sm || props.size === 'sm',
|
|
18
|
+
'btm-nav-xs': props.xs || props.size === 'xs',
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="btm-nav" :class="classes">
|
|
25
|
+
<slot />
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export * from './-utils'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Converts a list of prop names to an object of Booleans. Can be spread into props.
|
|
5
|
+
* @param propList list of prop names to become booleans
|
|
6
|
+
*/
|
|
7
|
+
export function toProps(propList: string[]): Record<string, boolean> {
|
|
8
|
+
return propList.reduce((all: Record<string, any>, current: string) => {
|
|
9
|
+
all[current.replace('-', '')] = Boolean
|
|
10
|
+
return all
|
|
11
|
+
}, {})
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const directionVariants = ['top', 'bottom', 'left', 'right']
|
|
15
|
+
export const colorVariants = ['neutral', 'primary', 'secondary', 'accent']
|
|
16
|
+
export const stateVariants = ['info', 'success', 'warning', 'error']
|
|
17
|
+
export const allColorVariants = [...colorVariants, ...stateVariants]
|
|
18
|
+
export const variants = [
|
|
19
|
+
...colorVariants,
|
|
20
|
+
...stateVariants,
|
|
21
|
+
'ghost',
|
|
22
|
+
'link',
|
|
23
|
+
'glass',
|
|
24
|
+
]
|
|
25
|
+
export const sizes = ['xs', 'sm', 'md', 'lg']
|
|
26
|
+
export const shapes = ['circle', 'square']
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { makeIndividualClass } from './Button.config'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
is?: string
|
|
7
|
+
|
|
8
|
+
color?: string
|
|
9
|
+
neutral?: boolean
|
|
10
|
+
primary?: boolean
|
|
11
|
+
secondary?: boolean
|
|
12
|
+
accent?: boolean
|
|
13
|
+
info?: boolean
|
|
14
|
+
success?: boolean
|
|
15
|
+
warning?: boolean
|
|
16
|
+
error?: boolean
|
|
17
|
+
|
|
18
|
+
ghost?: boolean
|
|
19
|
+
link?: boolean
|
|
20
|
+
glass?: boolean
|
|
21
|
+
outline?: boolean
|
|
22
|
+
disabled?: boolean
|
|
23
|
+
|
|
24
|
+
shape?: 'circle' | 'square' | 'wide' | 'block'
|
|
25
|
+
circle?: boolean
|
|
26
|
+
square?: boolean
|
|
27
|
+
wide?: boolean
|
|
28
|
+
block?: boolean
|
|
29
|
+
|
|
30
|
+
loading?: boolean
|
|
31
|
+
noAnimation?: boolean
|
|
32
|
+
active?: boolean
|
|
33
|
+
|
|
34
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
35
|
+
xl?: boolean
|
|
36
|
+
lg?: boolean
|
|
37
|
+
md?: boolean
|
|
38
|
+
sm?: boolean
|
|
39
|
+
xs?: boolean
|
|
40
|
+
|
|
41
|
+
type?: 'button' | 'submit' | 'reset'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const props = defineProps<Props>()
|
|
45
|
+
|
|
46
|
+
const classes = computed(() => {
|
|
47
|
+
return {
|
|
48
|
+
'btn-primary': !props.disabled && (props.primary || props.color === 'primary'),
|
|
49
|
+
'btn-secondary': !props.disabled && (props.secondary || props.color === 'secondary'),
|
|
50
|
+
'btn-neutral': !props.disabled && (props.neutral || props.color === 'neutral'),
|
|
51
|
+
'btn-accent': !props.disabled && (props.accent || props.color === 'accent'),
|
|
52
|
+
'btn-info': !props.disabled && (props.info || props.color === 'info'),
|
|
53
|
+
'btn-success': !props.disabled && (props.success || props.color === 'success'),
|
|
54
|
+
'btn-warning': !props.disabled && (props.warning || props.color === 'warning'),
|
|
55
|
+
'btn-error': !props.disabled && (props.error || props.color === 'error'),
|
|
56
|
+
|
|
57
|
+
'glass': !props.disabled && props.glass,
|
|
58
|
+
|
|
59
|
+
'btn-circle': props.circle || props.shape === 'circle',
|
|
60
|
+
'btn-square': props.square || props.shape === 'square',
|
|
61
|
+
'btn-wide': props.wide || props.shape === 'wide',
|
|
62
|
+
'btn-block': props.block || props.shape === 'block',
|
|
63
|
+
|
|
64
|
+
'btn-xl': props.xl || props.size === 'xl',
|
|
65
|
+
'btn-lg': props.lg || props.size === 'lg',
|
|
66
|
+
'btn-md': props.md || props.size === 'md',
|
|
67
|
+
'btn-sm': props.sm || props.size === 'sm',
|
|
68
|
+
'btn-xs': props.xs || props.size === 'xs',
|
|
69
|
+
|
|
70
|
+
'btn-outline': !props.disabled && props.outline,
|
|
71
|
+
'btn-ghost': !props.disabled && props.ghost,
|
|
72
|
+
'btn-link': !props.disabled && props.link,
|
|
73
|
+
'btn-disabled': props.disabled,
|
|
74
|
+
|
|
75
|
+
'loading': props.loading,
|
|
76
|
+
'no-animation': props.noAnimation,
|
|
77
|
+
'btn-active': !props.disabled && props.active,
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
// Accessibility-friendly attributes for disabling the button
|
|
82
|
+
const disabledAttrs = computed(() => {
|
|
83
|
+
if (props.disabled) {
|
|
84
|
+
return {
|
|
85
|
+
'tabindex': -1,
|
|
86
|
+
'role': 'button',
|
|
87
|
+
'aria-disabled': true,
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
return {}
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
const disabledClass = makeIndividualClass({ props, prop: 'disabled', prefix: 'btn-' })
|
|
95
|
+
const wideClass = makeIndividualClass({ props, prop: 'wide', prefix: 'btn-' })
|
|
96
|
+
const blockClass = makeIndividualClass({ props, prop: 'block', prefix: 'btn-' })
|
|
97
|
+
const loadingClass = makeIndividualClass({ props, prop: 'loading', prefix: '' })
|
|
98
|
+
const noAnimationClass = makeIndividualClass({ props, prop: 'no-animation', prefix: '' })
|
|
99
|
+
const activeClass = makeIndividualClass({ props, prop: 'active', prefix: 'btn-' })
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<component
|
|
104
|
+
:is="is || 'button'"
|
|
105
|
+
:type="type"
|
|
106
|
+
class="btn"
|
|
107
|
+
:class="[classes]"
|
|
108
|
+
v-bind="{ ...disabledAttrs, ...$attrs }"
|
|
109
|
+
>
|
|
110
|
+
<slot />
|
|
111
|
+
</component>
|
|
112
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
bordered?: boolean
|
|
6
|
+
is?: string | Object | Function
|
|
7
|
+
compact?: boolean
|
|
8
|
+
side?: boolean
|
|
9
|
+
imageFull?: boolean
|
|
10
|
+
glass?: boolean
|
|
11
|
+
}
|
|
12
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
13
|
+
is: 'div',
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const classes = computed(() => {
|
|
17
|
+
return {
|
|
18
|
+
'card-bordered': props.bordered,
|
|
19
|
+
'card-compact': props.compact,
|
|
20
|
+
'card-side': props.side,
|
|
21
|
+
'image-full': props.imageFull,
|
|
22
|
+
'glass': props.glass,
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<component :is="is" class="card" :class="classes">
|
|
29
|
+
<slot />
|
|
30
|
+
</component>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Text from './Text.vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
is?: string
|
|
6
|
+
}
|
|
7
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
8
|
+
is: 'div',
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<Text :is="is" class="card-actions">
|
|
14
|
+
<slot />
|
|
15
|
+
</Text>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Text from './Text.vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
is?: string
|
|
6
|
+
}
|
|
7
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
8
|
+
is: 'div',
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<Text :is="is" class="card-body">
|
|
14
|
+
<slot />
|
|
15
|
+
</Text>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Text from './Text.vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
is?: string
|
|
6
|
+
}
|
|
7
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
8
|
+
is: 'div',
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<Text :is="is" class="card-title">
|
|
14
|
+
<slot />
|
|
15
|
+
</Text>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
snapTo?: 'center' | 'end'
|
|
6
|
+
center?: boolean
|
|
7
|
+
end?: boolean
|
|
8
|
+
vertical?: boolean
|
|
9
|
+
}
|
|
10
|
+
const props = defineProps<Props>()
|
|
11
|
+
|
|
12
|
+
const classes = computed(() => {
|
|
13
|
+
const { snapTo, center, end, vertical } = props
|
|
14
|
+
return {
|
|
15
|
+
'carousel-center': center || snapTo === 'center',
|
|
16
|
+
'carousel-end': end || snapTo === 'end',
|
|
17
|
+
'carousel-vertical': vertical,
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="carousel" :class="classes">
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
modelValue?: any
|
|
6
|
+
|
|
7
|
+
color?: string
|
|
8
|
+
primary?: boolean
|
|
9
|
+
secondary?: boolean
|
|
10
|
+
accent?: boolean
|
|
11
|
+
|
|
12
|
+
size?: string
|
|
13
|
+
xs?: boolean
|
|
14
|
+
sm?: boolean
|
|
15
|
+
md?: boolean
|
|
16
|
+
lg?: boolean
|
|
17
|
+
}>()
|
|
18
|
+
const emit = defineEmits(['update:modelValue'])
|
|
19
|
+
|
|
20
|
+
const classes = computed(() => {
|
|
21
|
+
const { color, primary, secondary, accent, size, xs, sm, md, lg } = props
|
|
22
|
+
return {
|
|
23
|
+
'checkbox-primary': primary || color === 'primary',
|
|
24
|
+
'checkbox-secondary': secondary || color === 'secondary',
|
|
25
|
+
'checkbox-accent': accent || color === 'accent',
|
|
26
|
+
'checkbox-xs': xs || size === 'xs',
|
|
27
|
+
'checkbox-sm': sm || size === 'sm',
|
|
28
|
+
'checkbox-md': md || size === 'md',
|
|
29
|
+
'checkbox-lg': lg || size === 'lg',
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const currentValue = computed({
|
|
34
|
+
get: () => props.modelValue,
|
|
35
|
+
set: (val: string) => emit('update:modelValue', val),
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<input
|
|
41
|
+
v-model="currentValue"
|
|
42
|
+
type="checkbox"
|
|
43
|
+
v-bind="$attrs"
|
|
44
|
+
class="checkbox"
|
|
45
|
+
:class="classes"
|
|
46
|
+
>
|
|
47
|
+
</template>
|