daisy-ui-kit 5.0.0-pre.5 → 5.0.0-pre.6
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/app/components/Accordion.vue +26 -0
- package/app/components/Alert.vue +35 -0
- package/app/components/Avatar.vue +128 -0
- package/app/components/AvatarGroup.vue +18 -0
- package/app/components/Badge.vue +54 -0
- package/app/components/Breadcrumbs.vue +7 -0
- package/app/components/Button.vue +113 -0
- package/app/components/Calendar.vue +66 -0
- package/app/components/CalendarInput.vue +176 -0
- package/app/components/CalendarSkeleton.vue +46 -0
- package/app/components/Card.vue +33 -0
- package/app/components/CardActions.vue +13 -0
- package/app/components/CardBody.vue +13 -0
- package/app/components/CardTitle.vue +11 -0
- package/app/components/Carousel.vue +23 -0
- package/app/components/CarouselItem.vue +5 -0
- package/app/components/Chat.vue +21 -0
- package/app/components/ChatBubble.vue +31 -0
- package/app/components/ChatFooter.vue +5 -0
- package/app/components/ChatHeader.vue +5 -0
- package/app/components/ChatImage.vue +5 -0
- package/app/components/Checkbox.vue +49 -0
- package/app/components/Collapse.vue +43 -0
- package/app/components/CollapseContent.vue +5 -0
- package/app/components/CollapseTitle.vue +5 -0
- package/app/components/Countdown.vue +15 -0
- package/app/components/CountdownTimers.vue +72 -0
- package/app/components/Counter.vue +10 -0
- package/app/components/Crumb.vue +5 -0
- package/app/components/DaisyLink.vue +38 -0
- package/app/components/Diff.vue +11 -0
- package/app/components/Divider.vue +43 -0
- package/app/components/Dock.vue +58 -0
- package/app/components/DockItem.vue +25 -0
- package/app/components/DockLabel.vue +5 -0
- package/app/components/Drawer.vue +47 -0
- package/app/components/DrawerContent.vue +17 -0
- package/app/components/DrawerSide.vue +18 -0
- package/app/components/Dropdown.vue +95 -0
- package/app/components/DropdownButton.vue +16 -0
- package/app/components/DropdownContent.vue +57 -0
- package/app/components/DropdownTarget.vue +14 -0
- package/app/components/Fieldset.vue +19 -0
- package/app/components/FileInput.vue +53 -0
- package/app/components/Filter.vue +122 -0
- package/app/components/Flex.vue +82 -0
- package/app/components/FlexItem.vue +59 -0
- package/app/components/Footer.vue +27 -0
- package/app/components/FooterTitle.vue +15 -0
- package/app/components/FormControl.vue +5 -0
- package/app/components/Hero.vue +15 -0
- package/app/components/HeroContent.vue +15 -0
- package/app/components/HeroOverlay.vue +5 -0
- package/app/components/Indicator.vue +13 -0
- package/app/components/IndicatorItem.vue +36 -0
- package/app/components/Input.vue +102 -0
- package/app/components/Join.vue +5 -0
- package/app/components/Kbd.vue +24 -0
- package/app/components/Label.vue +61 -0
- package/app/components/List.vue +5 -0
- package/app/components/ListColGrow.vue +5 -0
- package/app/components/ListColWrap.vue +5 -0
- package/app/components/ListRow.vue +5 -0
- package/app/components/LoadingBall.vue +42 -0
- package/app/components/LoadingBars.vue +42 -0
- package/app/components/LoadingDots.vue +42 -0
- package/app/components/LoadingInfinity.vue +42 -0
- package/app/components/LoadingRing.vue +42 -0
- package/app/components/LoadingSpinner.vue +42 -0
- package/app/components/Mask.vue +49 -0
- package/app/components/Menu.vue +30 -0
- package/app/components/MenuExpand.vue +100 -0
- package/app/components/MenuExpandToggle.vue +14 -0
- package/app/components/MenuItem.vue +37 -0
- package/app/components/MenuTitle.vue +5 -0
- package/app/components/MockupBrowser.vue +5 -0
- package/app/components/MockupBrowserToolbar.vue +5 -0
- package/app/components/MockupCode.vue +4 -0
- package/app/components/MockupPhone.vue +8 -0
- package/app/components/MockupWindow.vue +5 -0
- package/app/components/Modal.vue +57 -0
- package/app/components/ModalAction.vue +5 -0
- package/app/components/ModalBox.vue +5 -0
- package/app/components/NavButton.vue +12 -0
- package/app/components/Navbar.vue +12 -0
- package/app/components/NavbarCenter.vue +11 -0
- package/app/components/NavbarEnd.vue +11 -0
- package/app/components/NavbarStart.vue +11 -0
- package/app/components/Progress.vue +34 -0
- package/app/components/Prose.vue +32 -0
- package/app/components/RadialProgress.vue +36 -0
- package/app/components/Radio.vue +67 -0
- package/app/components/RadioGroup.vue +47 -0
- package/app/components/Range.vue +61 -0
- package/app/components/RangeMeasure.vue +84 -0
- package/app/components/RangeMeasureTick.vue +70 -0
- package/app/components/Rating.vue +180 -0
- package/app/components/Select.vue +104 -0
- package/app/components/Skeleton.vue +5 -0
- package/app/components/Stack.vue +25 -0
- package/app/components/Stat.vue +19 -0
- package/app/components/StatActions.vue +5 -0
- package/app/components/StatDesc.vue +5 -0
- package/app/components/StatFigure.vue +5 -0
- package/app/components/StatTitle.vue +5 -0
- package/app/components/StatValue.vue +5 -0
- package/app/components/Stats.vue +5 -0
- package/app/components/Status.vue +43 -0
- package/app/components/Step.vue +34 -0
- package/app/components/StepIcon.vue +5 -0
- package/app/components/Steps.vue +18 -0
- package/app/components/Swap.vue +62 -0
- package/app/components/Tab.vue +38 -0
- package/app/components/TabContent.vue +29 -0
- package/app/components/Table.vue +32 -0
- package/app/components/Tabs.vue +53 -0
- package/app/components/Text.vue +142 -0
- package/app/components/TextArea.vue +61 -0
- package/app/components/Timeline.vue +22 -0
- package/app/components/TimelineEnd.vue +14 -0
- package/app/components/TimelineItem.vue +5 -0
- package/app/components/TimelineLine.vue +29 -0
- package/app/components/TimelineMiddle.vue +5 -0
- package/app/components/TimelineStart.vue +13 -0
- package/app/components/Toast.vue +29 -0
- package/app/components/Toggle.vue +58 -0
- package/app/components/Tooltip.vue +47 -0
- package/app/components/TooltipContent.vue +5 -0
- package/app/components/ValidatorHint.vue +5 -0
- package/app/utils/drawer-utils.ts +32 -0
- package/app/utils/random-string.ts +19 -0
- package/package.json +4 -4
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { autoUpdate, useFloating } from '@floating-ui/vue';
|
|
3
|
+
import { onClickOutside, syncRefs, useElementHover } from '@vueuse/core';
|
|
4
|
+
import { onMounted, provide, reactive, ref } from 'vue';
|
|
5
|
+
import { randomString } from '../utils/random-string';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
// allows passing a custom id to the dropdown. Required for SSR hydration.
|
|
9
|
+
randomId?: string
|
|
10
|
+
autoFocus?: boolean
|
|
11
|
+
|
|
12
|
+
placement?: 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end'
|
|
13
|
+
strategy?: 'fixed' | 'absolute'
|
|
14
|
+
|
|
15
|
+
hover?: boolean
|
|
16
|
+
delayEnter?: number
|
|
17
|
+
delayLeave?: number
|
|
18
|
+
closeOnClickOutside?: boolean
|
|
19
|
+
}>(), {
|
|
20
|
+
autoFocus: false,
|
|
21
|
+
placement: 'bottom-start',
|
|
22
|
+
hover: false,
|
|
23
|
+
delayEnter: 0,
|
|
24
|
+
delayLeave: 300,
|
|
25
|
+
closeOnClickOutside: true,
|
|
26
|
+
})
|
|
27
|
+
// Dropdown Visibility
|
|
28
|
+
const isOpen = defineModel('open')
|
|
29
|
+
provide('isDropdownOpen', isOpen)
|
|
30
|
+
|
|
31
|
+
const autoFocus = ref(props.autoFocus)
|
|
32
|
+
provide('dropdownAutoFocus', autoFocus)
|
|
33
|
+
|
|
34
|
+
const randomValue = props.randomId || randomString(12)
|
|
35
|
+
const wrapperId = `dropdown-wrapper-${randomValue}`
|
|
36
|
+
const id = `dropdown-${randomValue}`
|
|
37
|
+
provide('dropdownId', id)
|
|
38
|
+
|
|
39
|
+
// set up the floating ui instance
|
|
40
|
+
const buttonEl = ref(null)
|
|
41
|
+
const contentEl = ref(null)
|
|
42
|
+
const floatingConfig = reactive({
|
|
43
|
+
placement: ref(props.placement),
|
|
44
|
+
strategy: ref(props.strategy),
|
|
45
|
+
whileElementsMounted: autoUpdate,
|
|
46
|
+
})
|
|
47
|
+
const { floatingStyles } = useFloating(buttonEl, contentEl, floatingConfig)
|
|
48
|
+
|
|
49
|
+
provide('buttonEl', buttonEl)
|
|
50
|
+
provide('contentEl', contentEl)
|
|
51
|
+
provide('floatingStyles', floatingStyles)
|
|
52
|
+
|
|
53
|
+
// Visibility Utils
|
|
54
|
+
function toggle() {
|
|
55
|
+
isOpen.value = !isOpen.value
|
|
56
|
+
}
|
|
57
|
+
function open() {
|
|
58
|
+
isOpen.value = true
|
|
59
|
+
}
|
|
60
|
+
function close() {
|
|
61
|
+
isOpen.value = false
|
|
62
|
+
}
|
|
63
|
+
provide('toggleDropdown', toggle)
|
|
64
|
+
provide('openDropdown', open)
|
|
65
|
+
provide('closeDropdown', close)
|
|
66
|
+
|
|
67
|
+
const dropdownWrapper = ref(null)
|
|
68
|
+
|
|
69
|
+
onMounted(() => {
|
|
70
|
+
// Close when clicking outside the element
|
|
71
|
+
// use a slight delay to avoid conflict with the focus trap in the DropdownContent.
|
|
72
|
+
onClickOutside(contentEl, () => {
|
|
73
|
+
if (props.closeOnClickOutside) {
|
|
74
|
+
setTimeout(() => {
|
|
75
|
+
isOpen.value = false
|
|
76
|
+
}, 50)
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
// Sync with top-level isHovered ref. For SSR compatibility.
|
|
81
|
+
if (props.hover) {
|
|
82
|
+
const hover = useElementHover(dropdownWrapper, {
|
|
83
|
+
delayLeave: props.delayLeave,
|
|
84
|
+
delayEnter: props.delayEnter,
|
|
85
|
+
})
|
|
86
|
+
syncRefs(hover, isOpen)
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<div :id="wrapperId" ref="dropdownWrapper" class="relative inline-block floating-dropdown">
|
|
93
|
+
<slot v-bind="{ toggle, open, close }" />
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const id = inject('dropdownId')
|
|
5
|
+
const isOpen = inject('isDropdownOpen')
|
|
6
|
+
const toggleDropdown = inject('toggleDropdown')
|
|
7
|
+
const buttonEl = inject('buttonEl')
|
|
8
|
+
|
|
9
|
+
const toggle = toggleDropdown
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<Button :id="id" ref="buttonEl" :aria-expanded="isOpen" aria-haspopup="menu" class="dropdown-button" @click="toggle">
|
|
14
|
+
<slot />
|
|
15
|
+
</Button>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap'
|
|
3
|
+
import { inject, nextTick, ref, watchEffect } from 'vue'
|
|
4
|
+
|
|
5
|
+
const autoFocus = inject('dropdownAutoFocus')
|
|
6
|
+
const id = inject('dropdownId')
|
|
7
|
+
const isOpen = inject('isDropdownOpen')
|
|
8
|
+
const isOpenDelayed = ref(isOpen.value)
|
|
9
|
+
const contentEl = inject('contentEl')
|
|
10
|
+
const floatingStyles = inject('floatingStyles')
|
|
11
|
+
|
|
12
|
+
// Dropdown Utils
|
|
13
|
+
const toggle = inject('toggleDropdown')
|
|
14
|
+
const open = inject('openDropdown')
|
|
15
|
+
const close = inject('closeDropdown')
|
|
16
|
+
|
|
17
|
+
let activate
|
|
18
|
+
let deactivate
|
|
19
|
+
|
|
20
|
+
if (autoFocus.value) {
|
|
21
|
+
const { activate: _activate, deactivate: _deactivate, hasFocus } = useFocusTrap(contentEl, { immediate: true })
|
|
22
|
+
activate = _activate
|
|
23
|
+
deactivate = _deactivate
|
|
24
|
+
|
|
25
|
+
// hide the dropdown when the focus-trap drops focus (by pressing escape, for example)
|
|
26
|
+
watchEffect(() => {
|
|
27
|
+
if (!hasFocus.value) {
|
|
28
|
+
close()
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
// const { activate, deactivate, hasFocus } = useFocusTrap(contentEl, { immediate: true })
|
|
33
|
+
|
|
34
|
+
// synchronize isOpenDelayed with isOpen
|
|
35
|
+
watchEffect(async () => {
|
|
36
|
+
if (isOpen.value) {
|
|
37
|
+
isOpenDelayed.value = true
|
|
38
|
+
if (autoFocus.value) {
|
|
39
|
+
await nextTick()
|
|
40
|
+
activate()
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (autoFocus.value) {
|
|
45
|
+
deactivate()
|
|
46
|
+
await nextTick()
|
|
47
|
+
}
|
|
48
|
+
isOpenDelayed.value = false
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div v-if="isOpen" ref="contentEl" :style="floatingStyles" :aria-labelledby="id" role="menu">
|
|
55
|
+
<slot v-bind="{ toggle, open, close }" />
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
|
|
4
|
+
const id = inject('dropdownId')
|
|
5
|
+
const isOpen = inject('isDropdownOpen')
|
|
6
|
+
const toggle = inject('toggleDropdown')
|
|
7
|
+
const buttonEl = inject('buttonEl')
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div :id="id" ref="buttonEl" :aria-expanded="isOpen" aria-haspopup="menu" class="dropdown-target" @click="toggle">
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { is = 'fieldset', legend } = defineProps<{
|
|
3
|
+
is?: string
|
|
4
|
+
legend?: string
|
|
5
|
+
}>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<component
|
|
10
|
+
:is="is"
|
|
11
|
+
class="fieldset bg-base-200 border-base-300 rounded-box border p-4"
|
|
12
|
+
>
|
|
13
|
+
<legend v-if="legend" class="fieldset-legend">
|
|
14
|
+
{{ legend }}
|
|
15
|
+
</legend>
|
|
16
|
+
<slot v-else name="legend" />
|
|
17
|
+
<slot />
|
|
18
|
+
</component>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{
|
|
3
|
+
join?: boolean
|
|
4
|
+
|
|
5
|
+
color?: string
|
|
6
|
+
primary?: boolean
|
|
7
|
+
secondary?: boolean
|
|
8
|
+
accent?: boolean
|
|
9
|
+
info?: boolean
|
|
10
|
+
success?: boolean
|
|
11
|
+
warning?: boolean
|
|
12
|
+
error?: boolean
|
|
13
|
+
|
|
14
|
+
ghost?: boolean
|
|
15
|
+
disabled?: boolean
|
|
16
|
+
|
|
17
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
18
|
+
xl?: boolean
|
|
19
|
+
lg?: boolean
|
|
20
|
+
md?: boolean
|
|
21
|
+
sm?: boolean
|
|
22
|
+
xs?: boolean
|
|
23
|
+
}>()
|
|
24
|
+
defineEmits(['files'])
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<input
|
|
29
|
+
type="file"
|
|
30
|
+
:disabled="disabled"
|
|
31
|
+
class="file-input"
|
|
32
|
+
:class="{
|
|
33
|
+
'join-item': join,
|
|
34
|
+
|
|
35
|
+
'file-input-primary': primary || color === 'primary',
|
|
36
|
+
'file-input-secondary': secondary || color === 'secondary',
|
|
37
|
+
'file-input-accent': accent || color === 'accent',
|
|
38
|
+
'file-input-info': info || color === 'info',
|
|
39
|
+
'file-input-success': success || color === 'success',
|
|
40
|
+
'file-input-warning': warning || color === 'warning',
|
|
41
|
+
'file-input-error': error || color === 'error',
|
|
42
|
+
|
|
43
|
+
'file-input-xl': xl || size === 'xl',
|
|
44
|
+
'file-input-lg': lg || size === 'lg',
|
|
45
|
+
'file-input-md': md || size === 'md',
|
|
46
|
+
'file-input-sm': sm || size === 'sm',
|
|
47
|
+
'file-input-xs': xs || size === 'xs',
|
|
48
|
+
|
|
49
|
+
'file-input-ghost': ghost,
|
|
50
|
+
}"
|
|
51
|
+
@input="$emit('files', ($event.target as any).value)"
|
|
52
|
+
>
|
|
53
|
+
</template>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
interface FilterItem {
|
|
5
|
+
label: string
|
|
6
|
+
value: any
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type FilterItemInput = string | FilterItem
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
12
|
+
is?: string
|
|
13
|
+
name: string
|
|
14
|
+
items: FilterItemInput[]
|
|
15
|
+
modelValue?: any
|
|
16
|
+
resetLabel?: string
|
|
17
|
+
position?: 'start' | 'end'
|
|
18
|
+
start?: boolean
|
|
19
|
+
end?: boolean
|
|
20
|
+
|
|
21
|
+
color?: string
|
|
22
|
+
neutral?: boolean
|
|
23
|
+
primary?: boolean
|
|
24
|
+
secondary?: boolean
|
|
25
|
+
accent?: boolean
|
|
26
|
+
info?: boolean
|
|
27
|
+
success?: boolean
|
|
28
|
+
warning?: boolean
|
|
29
|
+
error?: boolean
|
|
30
|
+
|
|
31
|
+
size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
32
|
+
xl?: boolean
|
|
33
|
+
lg?: boolean
|
|
34
|
+
md?: boolean
|
|
35
|
+
sm?: boolean
|
|
36
|
+
xs?: boolean
|
|
37
|
+
}>(), {
|
|
38
|
+
resetLabel: 'All',
|
|
39
|
+
is: 'div',
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const emit = defineEmits(['update:modelValue'])
|
|
43
|
+
|
|
44
|
+
const currentValue = computed({
|
|
45
|
+
get: () => props.modelValue,
|
|
46
|
+
set(val) {
|
|
47
|
+
emit('update:modelValue', val)
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const normalizedItems = computed(() => {
|
|
52
|
+
return props.items.map((item) => {
|
|
53
|
+
if (typeof item === 'string') {
|
|
54
|
+
return { label: item, value: item }
|
|
55
|
+
}
|
|
56
|
+
return item
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<component :is="props.is" class="filter">
|
|
63
|
+
<!-- Reset button at start -->
|
|
64
|
+
<input
|
|
65
|
+
v-if="resetLabel && (start || position === 'start')"
|
|
66
|
+
v-model="currentValue"
|
|
67
|
+
class="btn filter-reset"
|
|
68
|
+
type="radio"
|
|
69
|
+
:class="{
|
|
70
|
+
'btn-xl': size === 'xl' || xl,
|
|
71
|
+
'btn-lg': size === 'lg' || lg,
|
|
72
|
+
'btn-md': size === 'md' || md,
|
|
73
|
+
'btn-sm': size === 'sm' || sm,
|
|
74
|
+
'btn-xs': size === 'xs' || xs,
|
|
75
|
+
}"
|
|
76
|
+
:name="name"
|
|
77
|
+
:aria-label="resetLabel"
|
|
78
|
+
:value="null"
|
|
79
|
+
>
|
|
80
|
+
|
|
81
|
+
<!-- Filter items -->
|
|
82
|
+
<template v-for="(item, index) in normalizedItems" :key="index">
|
|
83
|
+
<input
|
|
84
|
+
v-model="currentValue"
|
|
85
|
+
class="btn"
|
|
86
|
+
:class="{
|
|
87
|
+
'btn-neutral': color === 'neutral' || neutral,
|
|
88
|
+
'btn-primary': color === 'primary' || primary,
|
|
89
|
+
'btn-secondary': color === 'secondary' || secondary,
|
|
90
|
+
'btn-accent': color === 'accent' || accent,
|
|
91
|
+
'btn-info': color === 'info' || info,
|
|
92
|
+
'btn-success': color === 'success' || success,
|
|
93
|
+
'btn-warning': color === 'warning' || warning,
|
|
94
|
+
'btn-error': color === 'error' || error,
|
|
95
|
+
'btn-xl': size === 'xl' || xl,
|
|
96
|
+
'btn-lg': size === 'lg' || lg,
|
|
97
|
+
'btn-md': size === 'md' || md,
|
|
98
|
+
'btn-sm': size === 'sm' || sm,
|
|
99
|
+
'btn-xs': size === 'xs' || xs,
|
|
100
|
+
}"
|
|
101
|
+
type="radio"
|
|
102
|
+
:name="name"
|
|
103
|
+
:aria-label="item.label"
|
|
104
|
+
:value="item.value"
|
|
105
|
+
>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<!-- Reset button at end -->
|
|
109
|
+
<input
|
|
110
|
+
v-if="resetLabel && (end || position === 'end')"
|
|
111
|
+
v-model="currentValue"
|
|
112
|
+
class="btn filter-reset"
|
|
113
|
+
type="radio"
|
|
114
|
+
:name="name"
|
|
115
|
+
:aria-label="resetLabel"
|
|
116
|
+
:value="null"
|
|
117
|
+
>
|
|
118
|
+
|
|
119
|
+
<!-- Optional slot for custom items -->
|
|
120
|
+
<slot />
|
|
121
|
+
</component>
|
|
122
|
+
</template>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const { is = 'div', ...props } = defineProps<{
|
|
3
|
+
is?: string | object
|
|
4
|
+
join?: boolean
|
|
5
|
+
|
|
6
|
+
// https://tailwindcss.com/docs/flex
|
|
7
|
+
flex?: boolean
|
|
8
|
+
flex1?: boolean
|
|
9
|
+
flexAuto?: boolean
|
|
10
|
+
flexInitial?: boolean
|
|
11
|
+
none?: boolean
|
|
12
|
+
|
|
13
|
+
// justify
|
|
14
|
+
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'
|
|
15
|
+
justifyStart?: boolean
|
|
16
|
+
justifyEnd?: boolean
|
|
17
|
+
justifyCenter?: boolean
|
|
18
|
+
justifyBetween?: boolean
|
|
19
|
+
justifyAround?: boolean
|
|
20
|
+
justifyEvenly?: boolean
|
|
21
|
+
|
|
22
|
+
// align
|
|
23
|
+
items?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'
|
|
24
|
+
itemsStart?: boolean
|
|
25
|
+
itemsEnd?: boolean
|
|
26
|
+
itemsCenter?: boolean
|
|
27
|
+
itemsBaseline?: boolean
|
|
28
|
+
itemsStretch?: boolean
|
|
29
|
+
|
|
30
|
+
grow?: boolean
|
|
31
|
+
|
|
32
|
+
// https://tailwindcss.com/docs/flex-direction
|
|
33
|
+
direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse'
|
|
34
|
+
row?: boolean
|
|
35
|
+
col?: boolean
|
|
36
|
+
reverse?: boolean
|
|
37
|
+
|
|
38
|
+
// https://tailwindcss.com/docs/flex-wrap
|
|
39
|
+
wrap?: boolean
|
|
40
|
+
nowrap?: boolean
|
|
41
|
+
wrapReverse?: boolean
|
|
42
|
+
}>()
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<component
|
|
47
|
+
:is="is" class="flex" :class="{
|
|
48
|
+
'join-item': props.join,
|
|
49
|
+
|
|
50
|
+
'flex-1': props.flex1,
|
|
51
|
+
'flex-auto': props.flexAuto,
|
|
52
|
+
'flex-initial': props.flexInitial,
|
|
53
|
+
'flex-none': props.none,
|
|
54
|
+
|
|
55
|
+
'justify-start': props.justifyStart,
|
|
56
|
+
'justify-end': props.justifyEnd,
|
|
57
|
+
'justify-center': props.justifyCenter,
|
|
58
|
+
'justify-between': props.justifyBetween,
|
|
59
|
+
'justify-around': props.justifyAround,
|
|
60
|
+
'justify-evenly': props.justifyEvenly,
|
|
61
|
+
|
|
62
|
+
'items-start': props.itemsStart,
|
|
63
|
+
'items-end': props.itemsEnd,
|
|
64
|
+
'items-center': props.itemsCenter,
|
|
65
|
+
'items-baseline': props.itemsBaseline,
|
|
66
|
+
'items-stretch': props.itemsStretch,
|
|
67
|
+
|
|
68
|
+
'flex-grow': props.grow,
|
|
69
|
+
|
|
70
|
+
'flex-row': props.direction === 'row' || props.row,
|
|
71
|
+
'flex-col': props.direction === 'col' || props.col,
|
|
72
|
+
'flex-row-reverse': props.direction === 'row-reverse' || (props.row && props.reverse),
|
|
73
|
+
'flex-col-reverse': props.direction === 'col-reverse' || (props.col && props.reverse),
|
|
74
|
+
|
|
75
|
+
'flex-wrap': props.wrap,
|
|
76
|
+
'flex-wrap-reverse': props.wrapReverse,
|
|
77
|
+
'flex-nowrap': props.nowrap,
|
|
78
|
+
}"
|
|
79
|
+
>
|
|
80
|
+
<slot />
|
|
81
|
+
</component>
|
|
82
|
+
</template>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
|
+
is?: any
|
|
6
|
+
join?: boolean
|
|
7
|
+
|
|
8
|
+
// https://tailwindcss.com/docs/flex
|
|
9
|
+
flex?: boolean
|
|
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
|
+
is: 'div',
|
|
29
|
+
flex: false,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const classes = computed(() => {
|
|
33
|
+
return {
|
|
34
|
+
'join-item': props.join,
|
|
35
|
+
|
|
36
|
+
'flex-1': props.flex1,
|
|
37
|
+
'flex-auto': props.flexAuto,
|
|
38
|
+
'flex-initial': props.flexInitial,
|
|
39
|
+
'flex-none': props.none,
|
|
40
|
+
|
|
41
|
+
'flex-grow': props.grow,
|
|
42
|
+
|
|
43
|
+
'flex-row': props.direction === 'row' || props.row,
|
|
44
|
+
'flex-col': props.direction === 'col' || props.col,
|
|
45
|
+
'flex-row-reverse': props.direction === 'row-reverse' || (props.row && props.reverse),
|
|
46
|
+
'flex-col-reverse': props.direction === 'col-reverse' || (props.col && props.reverse),
|
|
47
|
+
|
|
48
|
+
'flex-wrap': props.wrap,
|
|
49
|
+
'flex-wrap-reverse': props.wrapReverse,
|
|
50
|
+
'flex-nowrap': props.nowrap,
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<component :is="is" class="flex" :class="classes">
|
|
57
|
+
<slot />
|
|
58
|
+
</component>
|
|
59
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Text from './Text.vue';
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
|
+
center?: boolean
|
|
6
|
+
is?: string
|
|
7
|
+
orientation?: 'horizontal' | 'vertical'
|
|
8
|
+
horizontal?: boolean
|
|
9
|
+
vertical?: boolean
|
|
10
|
+
}>(), {
|
|
11
|
+
center: false,
|
|
12
|
+
is: 'footer',
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<Text
|
|
18
|
+
:is="is" class="footer"
|
|
19
|
+
:class="{
|
|
20
|
+
'divider-center': props.center,
|
|
21
|
+
'divider-horizontal': props.horizontal || props.orientation === 'horizontal',
|
|
22
|
+
'divider-vertical': props.vertical || props.orientation === 'vertical',
|
|
23
|
+
}"
|
|
24
|
+
>
|
|
25
|
+
<slot />
|
|
26
|
+
</Text>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
|
+
is?: string
|
|
6
|
+
|
|
7
|
+
align?: 'start' | 'center' | 'end'
|
|
8
|
+
start?: boolean
|
|
9
|
+
center?: boolean
|
|
10
|
+
end?: boolean
|
|
11
|
+
|
|
12
|
+
vAlign?: 'top' | 'middle' | 'bottom'
|
|
13
|
+
top?: boolean
|
|
14
|
+
middle?: boolean
|
|
15
|
+
bottom?: boolean
|
|
16
|
+
}>(), {
|
|
17
|
+
is: 'div',
|
|
18
|
+
})
|
|
19
|
+
const classes = computed(() => {
|
|
20
|
+
return {
|
|
21
|
+
'indicator-start': props.start || props.align === 'start',
|
|
22
|
+
'indicator-center': props.center || props.align === 'center',
|
|
23
|
+
'indicator-end': props.end || props.align === 'end',
|
|
24
|
+
|
|
25
|
+
'indicator-top': props.top || props.vAlign === 'top',
|
|
26
|
+
'indicator-middle': props.middle || props.vAlign === 'middle',
|
|
27
|
+
'indicator-bottom': props.bottom || props.vAlign === 'bottom',
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<component :is="is" class="indicator-item" :class="classes">
|
|
34
|
+
<slot />
|
|
35
|
+
</component>
|
|
36
|
+
</template>
|