daisy-ui-kit 3.0.12 → 5.0.0-pre.10
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 +62 -14
- package/{components → app/components}/Accordion.vue +7 -10
- 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/Button.vue +120 -0
- package/app/components/Calendar.vue +66 -0
- package/app/components/CalendarInput.vue +174 -0
- package/app/components/CalendarSkeleton.vue +46 -0
- package/app/components/Card.vue +33 -0
- package/{components → app/components}/CardActions.vue +3 -6
- package/{components → app/components}/CardBody.vue +3 -6
- package/{components → app/components}/CardTitle.vue +2 -7
- package/app/components/Carousel.vue +23 -0
- package/app/components/Chat.vue +21 -0
- package/app/components/ChatBubble.vue +31 -0
- package/app/components/Checkbox.vue +51 -0
- package/app/components/Collapse.vue +43 -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/DaisyLink.vue +38 -0
- package/app/components/Diff.vue +11 -0
- package/app/components/Divider.vue +43 -0
- package/app/components/Dock.vue +60 -0
- package/app/components/DockItem.vue +26 -0
- package/app/components/DockLabel.vue +5 -0
- package/{components → app/components}/Drawer.vue +6 -4
- package/{components → app/components}/DrawerContent.vue +1 -1
- package/{components → app/components}/DrawerSide.vue +1 -1
- package/{components → app/components}/Dropdown.vue +2 -2
- package/{components → app/components}/DropdownContent.vue +3 -3
- 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/{components → app/components}/FlexItem.vue +1 -1
- package/app/components/Footer.vue +27 -0
- package/app/components/FormControl.vue +5 -0
- package/{components → app/components}/Hero.vue +1 -1
- package/{components → app/components}/HeroContent.vue +1 -1
- package/app/components/Input.vue +119 -0
- package/app/components/Kbd.vue +24 -0
- package/app/components/Label.vue +97 -0
- package/app/components/List.vue +5 -0
- package/{components/FormControl.vue → app/components/ListColGrow.vue} +1 -1
- package/app/components/ListColWrap.vue +5 -0
- package/{components/Stat.vue → app/components/ListRow.vue} +1 -1
- 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/{components → app/components}/MenuExpandToggle.vue +5 -4
- package/{components → app/components}/MenuItem.vue +3 -4
- package/app/components/MockupPhone.vue +14 -0
- package/{components → app/components}/Modal.vue +14 -5
- package/app/components/NavButton.vue +12 -0
- package/{components → app/components}/Navbar.vue +3 -5
- package/{components → app/components}/NavbarCenter.vue +3 -5
- package/{components → app/components}/NavbarEnd.vue +3 -5
- package/{components → app/components}/NavbarStart.vue +3 -5
- package/app/components/Progress.vue +34 -0
- package/{components → app/components}/Prose.vue +1 -1
- package/app/components/RadialProgress.vue +36 -0
- package/app/components/Radio.vue +69 -0
- package/{components → app/components}/RadioGroup.vue +2 -1
- package/app/components/Range.vue +61 -0
- package/{components → app/components}/RangeMeasure.vue +22 -21
- package/{components → app/components}/RangeMeasureTick.vue +9 -14
- package/app/components/Rating.vue +180 -0
- package/{components → app/components}/Select.vue +33 -29
- package/app/components/Skeleton.vue +5 -0
- package/app/components/Stack.vue +25 -0
- package/app/components/Stat.vue +19 -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/{components → app/components}/TabContent.vue +10 -10
- 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/ThemeController.vue +46 -0
- package/app/components/ThemeProvider.vue +287 -0
- package/app/components/ThemeTile.vue +50 -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 +72 -0
- package/app/components/Toggle.vue +60 -0
- package/app/components/Tooltip.vue +47 -0
- package/app/components/TooltipContent.vue +5 -0
- package/app/components/ValidatorHint.vue +5 -0
- package/nuxt.js +7 -1
- package/package.json +58 -61
- package/components/Alert.vue +0 -25
- package/components/Artboard.vue +0 -33
- package/components/Avatar.vue +0 -70
- package/components/AvatarGroup.vue +0 -19
- package/components/Badge.vue +0 -50
- package/components/BottomNav.vue +0 -25
- package/components/Button.vue +0 -111
- package/components/Card.vue +0 -30
- package/components/Carousel.vue +0 -25
- package/components/Chat.vue +0 -27
- package/components/ChatBubble.vue +0 -34
- package/components/Checkbox.vue +0 -55
- package/components/Code.vue +0 -92
- package/components/Collapse.vue +0 -54
- package/components/Countdown.vue +0 -15
- package/components/CountdownTimers.vue +0 -70
- package/components/Counter.vue +0 -14
- package/components/Divider.vue +0 -24
- package/components/FileInput.vue +0 -59
- package/components/Flex.vue +0 -59
- package/components/Footer.vue +0 -24
- package/components/Kbd.vue +0 -25
- package/components/Label.vue +0 -15
- package/components/LabelText.vue +0 -15
- package/components/LabelTextAlt.vue +0 -15
- package/components/Link.vue +0 -40
- package/components/LoadingBall.vue +0 -43
- package/components/LoadingBars.vue +0 -43
- package/components/LoadingDots.vue +0 -43
- package/components/LoadingInfinity.vue +0 -43
- package/components/LoadingRing.vue +0 -43
- package/components/LoadingSpinner.vue +0 -43
- package/components/Mask.config.ts +0 -77
- package/components/Mask.vue +0 -14
- package/components/Menu.vue +0 -35
- package/components/MenuExpand.vue +0 -79
- package/components/MockupPhone.vue +0 -8
- package/components/NavButton.vue +0 -20
- package/components/Progress.vue +0 -42
- package/components/RadialProgress.vue +0 -41
- package/components/Radio.vue +0 -76
- package/components/Range.vue +0 -60
- package/components/Rating.vue +0 -167
- package/components/Stack.vue +0 -13
- package/components/Step.vue +0 -36
- package/components/Steps.vue +0 -21
- package/components/Swap.vue +0 -58
- package/components/Tab.vue +0 -48
- package/components/Tabs.vue +0 -77
- package/components/TabsManager.vue +0 -38
- package/components/Text.vue +0 -142
- package/components/TextArea.vue +0 -64
- package/components/TextInput.vue +0 -66
- package/components/Toast.vue +0 -31
- package/components/Toggle.vue +0 -59
- package/components/Tooltip.vue +0 -47
- package/index.ts +0 -108
- package/utils/-utils.ts +0 -41
- package/utils/Button.config.ts +0 -26
- package/utils/fixtures.ts +0 -62
- package/utils/types.ts +0 -7
- /package/{components → app/components}/Breadcrumbs.vue +0 -0
- /package/{components → app/components}/CarouselItem.vue +0 -0
- /package/{components → app/components}/ChatFooter.vue +0 -0
- /package/{components → app/components}/ChatHeader.vue +0 -0
- /package/{components → app/components}/ChatImage.vue +0 -0
- /package/{components → app/components}/CollapseContent.vue +0 -0
- /package/{components → app/components}/CollapseTitle.vue +0 -0
- /package/{components → app/components}/Crumb.vue +0 -0
- /package/{components → app/components}/DropdownButton.vue +0 -0
- /package/{components → app/components}/DropdownTarget.vue +0 -0
- /package/{components → app/components}/FooterTitle.vue +0 -0
- /package/{components → app/components}/HeroOverlay.vue +0 -0
- /package/{components → app/components}/Indicator.vue +0 -0
- /package/{components → app/components}/IndicatorItem.vue +0 -0
- /package/{components → app/components}/Join.vue +0 -0
- /package/{components → app/components}/MenuTitle.vue +0 -0
- /package/{components → app/components}/MockupBrowser.vue +0 -0
- /package/{components → app/components}/MockupBrowserToolbar.vue +0 -0
- /package/{components → app/components}/MockupCode.vue +0 -0
- /package/{components → app/components}/MockupWindow.vue +0 -0
- /package/{components → app/components}/ModalAction.vue +0 -0
- /package/{components → app/components}/ModalBox.vue +0 -0
- /package/{components → app/components}/StatActions.vue +0 -0
- /package/{components → app/components}/StatDesc.vue +0 -0
- /package/{components → app/components}/StatFigure.vue +0 -0
- /package/{components → app/components}/StatTitle.vue +0 -0
- /package/{components → app/components}/StatValue.vue +0 -0
- /package/{components → app/components}/Stats.vue +0 -0
- /package/{utils → app/utils}/drawer-utils.ts +0 -0
- /package/{utils → app/utils}/random-string.ts +0 -0
package/components/Rating.vue
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
modelValue?: number | string
|
|
6
|
-
count?: number | string
|
|
7
|
-
half?: boolean
|
|
8
|
-
|
|
9
|
-
disabled?: boolean
|
|
10
|
-
|
|
11
|
-
color?: string
|
|
12
|
-
neutral?: boolean
|
|
13
|
-
primary?: boolean
|
|
14
|
-
secondary?: boolean
|
|
15
|
-
accent?: boolean
|
|
16
|
-
info?: boolean
|
|
17
|
-
success?: boolean
|
|
18
|
-
warning?: boolean
|
|
19
|
-
error?: boolean
|
|
20
|
-
|
|
21
|
-
bg?: string
|
|
22
|
-
|
|
23
|
-
shape?: string
|
|
24
|
-
squircle?: boolean
|
|
25
|
-
heart?: boolean
|
|
26
|
-
hexagon?: boolean
|
|
27
|
-
hexagon2?: boolean
|
|
28
|
-
decagon?: boolean
|
|
29
|
-
pentagon?: boolean
|
|
30
|
-
diamond?: boolean
|
|
31
|
-
square?: boolean
|
|
32
|
-
circle?: boolean
|
|
33
|
-
parallelogram?: boolean
|
|
34
|
-
parallelogram2?: boolean
|
|
35
|
-
parallelogram3?: boolean
|
|
36
|
-
parallelogram4?: boolean
|
|
37
|
-
star?: boolean
|
|
38
|
-
star2?: boolean
|
|
39
|
-
triangle?: boolean
|
|
40
|
-
triangle2?: boolean
|
|
41
|
-
triangle3?: boolean
|
|
42
|
-
triangle4?: boolean
|
|
43
|
-
|
|
44
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
45
|
-
lg?: boolean
|
|
46
|
-
md?: boolean
|
|
47
|
-
sm?: boolean
|
|
48
|
-
xs?: boolean
|
|
49
|
-
}>(), {
|
|
50
|
-
count: 5,
|
|
51
|
-
})
|
|
52
|
-
const emit = defineEmits(['update:modelValue'])
|
|
53
|
-
|
|
54
|
-
const shapes = [
|
|
55
|
-
'squircle',
|
|
56
|
-
'heart',
|
|
57
|
-
'hexagon',
|
|
58
|
-
'hexagon2',
|
|
59
|
-
'decagon',
|
|
60
|
-
'pentagon',
|
|
61
|
-
'diamond',
|
|
62
|
-
'square',
|
|
63
|
-
'circle',
|
|
64
|
-
'parallelogram',
|
|
65
|
-
'parallelogram2',
|
|
66
|
-
'parallelogram3',
|
|
67
|
-
'parallelogram4',
|
|
68
|
-
'star',
|
|
69
|
-
'star2',
|
|
70
|
-
'triangle',
|
|
71
|
-
'triangle2',
|
|
72
|
-
'triangle3',
|
|
73
|
-
'triangle4',
|
|
74
|
-
]
|
|
75
|
-
|
|
76
|
-
const ratingClasses = computed(() => {
|
|
77
|
-
return {
|
|
78
|
-
'rating-half': props.half,
|
|
79
|
-
'rating-lg': props.lg || props.size === 'lg',
|
|
80
|
-
'rating-md': props.md || props.size === 'md',
|
|
81
|
-
'rating-sm': props.sm || props.size === 'sm',
|
|
82
|
-
'rating-xs': props.xs || props.size === 'xs',
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
const maskClasses = computed(() => {
|
|
87
|
-
const hasShape = shapes.reduce((acc, current) => {
|
|
88
|
-
return acc || props.shape || (props as any)[current]
|
|
89
|
-
}, false)
|
|
90
|
-
const { color, shape, disabled } = props
|
|
91
|
-
return {
|
|
92
|
-
'bg-neutral': props.neutral || color === 'neutral',
|
|
93
|
-
'bg-primary': props.primary || color === 'primary',
|
|
94
|
-
'bg-secondary': props.secondary || color === 'secondary',
|
|
95
|
-
'bg-accent': props.accent || color === 'accent',
|
|
96
|
-
'bg-info': props.info || color === 'info',
|
|
97
|
-
'bg-success': props.success || color === 'success',
|
|
98
|
-
'bg-warning': props.warning || color === 'warning',
|
|
99
|
-
'bg-error': props.error || color === 'error',
|
|
100
|
-
|
|
101
|
-
'cursor-not-allowed': disabled,
|
|
102
|
-
'opacity-50': disabled,
|
|
103
|
-
|
|
104
|
-
'mask-squircle': props.squircle || shape === 'squircle',
|
|
105
|
-
'mask-heart': props.heart || shape === 'heart',
|
|
106
|
-
'mask-hexagon': props.hexagon || shape === 'hexagon',
|
|
107
|
-
'mask-hexagon-2': props.hexagon2 || shape === 'hexagon-2',
|
|
108
|
-
'mask-decagon': props.decagon || shape === 'decagon',
|
|
109
|
-
'mask-pentagon': props.pentagon || shape === 'pentagon',
|
|
110
|
-
'mask-diamond': props.diamond || shape === 'diamond',
|
|
111
|
-
'mask-square': props.square || shape === 'square',
|
|
112
|
-
'mask-circle': props.circle || shape === 'circle',
|
|
113
|
-
'mask-parallelogram': props.parallelogram || shape === 'parallelogram',
|
|
114
|
-
'mask-parallelogram-2': props.parallelogram2 || shape === 'parallelogram-2',
|
|
115
|
-
'mask-parallelogram-3': props.parallelogram3 || shape === 'parallelogram-3',
|
|
116
|
-
'mask-parallelogram-4': props.parallelogram4 || shape === 'parallelogram-4',
|
|
117
|
-
'mask-star': props.star || shape === 'star',
|
|
118
|
-
'mask-star-2': props.star2 || shape === 'star-2' || !hasShape,
|
|
119
|
-
'mask-triangle': props.triangle || shape === 'triangle',
|
|
120
|
-
'mask-triangle-2': props.triangle2 || shape === 'triangle-2',
|
|
121
|
-
'mask-triangle-3': props.triangle3 || shape === 'triangle-3',
|
|
122
|
-
'mask-triangle-4': props.triangle4 || shape === 'triangle-4',
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
const max = computed(() => Number.parseInt(props.count as string))
|
|
126
|
-
|
|
127
|
-
function handleValue(digit: number, half = false) {
|
|
128
|
-
if (props.disabled)
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
if (props.half)
|
|
132
|
-
return emit('update:modelValue', half ? digit - 0.5 : digit)
|
|
133
|
-
|
|
134
|
-
return emit('update:modelValue', digit)
|
|
135
|
-
}
|
|
136
|
-
</script>
|
|
137
|
-
|
|
138
|
-
<template>
|
|
139
|
-
<div class="rating" :class="ratingClasses">
|
|
140
|
-
<input
|
|
141
|
-
type="radio"
|
|
142
|
-
:value="0"
|
|
143
|
-
class="rating-hidden"
|
|
144
|
-
:checked="modelValue === 0"
|
|
145
|
-
@change="$emit('update:modelValue', 0)"
|
|
146
|
-
>
|
|
147
|
-
<template v-for="digit in max" :key="digit">
|
|
148
|
-
<input
|
|
149
|
-
type="radio"
|
|
150
|
-
:value="half ? digit - 0.5 : digit"
|
|
151
|
-
class="mask"
|
|
152
|
-
:class="[maskClasses, bg, { 'mask-half-1': half }]"
|
|
153
|
-
:checked="half ? modelValue === digit - 0.5 : modelValue === digit"
|
|
154
|
-
@change="() => handleValue(digit, true)"
|
|
155
|
-
>
|
|
156
|
-
<input
|
|
157
|
-
v-if="half"
|
|
158
|
-
type="radio"
|
|
159
|
-
:value="digit"
|
|
160
|
-
class="mask mask-half-2"
|
|
161
|
-
:class="[maskClasses, bg]"
|
|
162
|
-
:checked="modelValue === digit"
|
|
163
|
-
@change="() => handleValue(digit)"
|
|
164
|
-
>
|
|
165
|
-
</template>
|
|
166
|
-
</div>
|
|
167
|
-
</template>
|
package/components/Stack.vue
DELETED
package/components/Step.vue
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
glyph?: string
|
|
6
|
-
|
|
7
|
-
color?: string
|
|
8
|
-
neutral?: boolean
|
|
9
|
-
primary?: boolean
|
|
10
|
-
secondary?: boolean
|
|
11
|
-
accent?: boolean
|
|
12
|
-
info?: boolean
|
|
13
|
-
success?: boolean
|
|
14
|
-
warning?: boolean
|
|
15
|
-
error?: boolean
|
|
16
|
-
}>()
|
|
17
|
-
|
|
18
|
-
const classes = computed(() => {
|
|
19
|
-
return {
|
|
20
|
-
'step-neutral': props.neutral || props.color === 'neutral',
|
|
21
|
-
'step-primary': props.primary || props.color === 'primary',
|
|
22
|
-
'step-secondary': props.secondary || props.color === 'secondary',
|
|
23
|
-
'step-accent': props.accent || props.color === 'accent',
|
|
24
|
-
'step-info': props.info || props.color === 'info',
|
|
25
|
-
'step-success': props.success || props.color === 'success',
|
|
26
|
-
'step-warning': props.warning || props.color === 'warning',
|
|
27
|
-
'step-error': props.error || props.color === 'error',
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<template>
|
|
33
|
-
<li class="step" :class="classes" :data-content="glyph">
|
|
34
|
-
<slot />
|
|
35
|
-
</li>
|
|
36
|
-
</template>
|
package/components/Steps.vue
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
vertical?: boolean
|
|
6
|
-
horizontal?: boolean
|
|
7
|
-
}>()
|
|
8
|
-
|
|
9
|
-
const classes = computed(() => {
|
|
10
|
-
return {
|
|
11
|
-
'steps-vertical': props.vertical,
|
|
12
|
-
'steps-horizontal': props.horizontal,
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<template>
|
|
18
|
-
<ul class="steps" :class="classes">
|
|
19
|
-
<slot />
|
|
20
|
-
</ul>
|
|
21
|
-
</template>
|
package/components/Swap.vue
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, nextTick, ref, watch } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
modelValue?: boolean | null
|
|
6
|
-
indeterminate?: boolean
|
|
7
|
-
rotate?: boolean
|
|
8
|
-
flip?: boolean
|
|
9
|
-
}>()
|
|
10
|
-
const emit = defineEmits(['update:modelValue'])
|
|
11
|
-
const classes = computed(() => {
|
|
12
|
-
return {
|
|
13
|
-
'swap-rotate': props.rotate,
|
|
14
|
-
'swap-flip': props.flip,
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
const checkbox = ref(null)
|
|
19
|
-
|
|
20
|
-
// Allow internal or external control
|
|
21
|
-
const isChecked = ref<any>(props.modelValue)
|
|
22
|
-
watch(isChecked, val => emit('update:modelValue', val))
|
|
23
|
-
watch(
|
|
24
|
-
() => props.modelValue,
|
|
25
|
-
(val) => {
|
|
26
|
-
if (isChecked.value !== val)
|
|
27
|
-
isChecked.value = val
|
|
28
|
-
},
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
// When the indeterminate prop updates, manually update the checkbox element.
|
|
32
|
-
watch(
|
|
33
|
-
() => [props.indeterminate, checkbox.value],
|
|
34
|
-
([val]) => {
|
|
35
|
-
nextTick(() => {
|
|
36
|
-
if (checkbox.value != null)
|
|
37
|
-
(checkbox.value as any).indeterminate = val
|
|
38
|
-
isChecked.value = null
|
|
39
|
-
})
|
|
40
|
-
},
|
|
41
|
-
{ immediate: true },
|
|
42
|
-
)
|
|
43
|
-
</script>
|
|
44
|
-
|
|
45
|
-
<template>
|
|
46
|
-
<label class="swap" :class="classes">
|
|
47
|
-
<input ref="checkbox" v-model="isChecked" type="checkbox">
|
|
48
|
-
<div class="swap-off">
|
|
49
|
-
<slot />
|
|
50
|
-
</div>
|
|
51
|
-
<div class="swap-on">
|
|
52
|
-
<slot name="swap" />
|
|
53
|
-
</div>
|
|
54
|
-
<div v-if="indeterminate" class="swap-indeterminate">
|
|
55
|
-
<slot name="indeterminate" />
|
|
56
|
-
</div>
|
|
57
|
-
</label>
|
|
58
|
-
</template>
|
package/components/Tab.vue
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, inject } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
is?: string | Object | Function
|
|
6
|
-
name?: string
|
|
7
|
-
active?: boolean
|
|
8
|
-
|
|
9
|
-
variant?: 'bordered' | 'lifted'
|
|
10
|
-
bordered?: boolean
|
|
11
|
-
lifted?: boolean
|
|
12
|
-
|
|
13
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
14
|
-
lg?: boolean
|
|
15
|
-
md?: boolean
|
|
16
|
-
sm?: boolean
|
|
17
|
-
xs?: boolean
|
|
18
|
-
}>(), {
|
|
19
|
-
is: 'a',
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
const manager: any = inject('tabManager')
|
|
23
|
-
|
|
24
|
-
const classes = computed(() => {
|
|
25
|
-
return {
|
|
26
|
-
'tab-active': props.active || manager.currentTab === props.name,
|
|
27
|
-
|
|
28
|
-
'tab-lg': props.size === 'lg' || props.lg,
|
|
29
|
-
'tab-md': props.size === 'md' || props.md,
|
|
30
|
-
'tab-sm': props.size === 'sm' || props.sm,
|
|
31
|
-
'tab-xs': props.size === 'xs' || props.xs,
|
|
32
|
-
|
|
33
|
-
'tab-bordered': props.variant === 'bordered' || props.bordered,
|
|
34
|
-
'tab-lifted': props.variant === 'lifted' || props.lifted,
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<template>
|
|
40
|
-
<component
|
|
41
|
-
:is="is" class="tab" :class="classes" tabindex="0"
|
|
42
|
-
@click="() => (manager.currentTab = name)"
|
|
43
|
-
@keypress.enter="() => (manager.currentTab = name)"
|
|
44
|
-
>
|
|
45
|
-
<slot v-if="$slots.default" />
|
|
46
|
-
<span v-else>{{ name }}</span>
|
|
47
|
-
</component>
|
|
48
|
-
</template>
|
package/components/Tabs.vue
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, inject } from 'vue'
|
|
3
|
-
import Tab from './Tab.vue'
|
|
4
|
-
|
|
5
|
-
const props = withDefaults(defineProps<{
|
|
6
|
-
is?: string | Object | Function
|
|
7
|
-
tabs?: string[]
|
|
8
|
-
|
|
9
|
-
variant?: 'bordered' | 'lifted' | 'boxed' | 'inline-boxed'
|
|
10
|
-
bordered?: boolean
|
|
11
|
-
lifted?: boolean
|
|
12
|
-
boxed?: boolean
|
|
13
|
-
inlineBoxed?: boolean
|
|
14
|
-
|
|
15
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
16
|
-
lg?: boolean
|
|
17
|
-
md?: boolean
|
|
18
|
-
sm?: boolean
|
|
19
|
-
xs?: boolean
|
|
20
|
-
}>(), {
|
|
21
|
-
is: 'a',
|
|
22
|
-
tabs: [] as any,
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const tabManager: any = inject('tabManager')
|
|
26
|
-
|
|
27
|
-
const _variant = computed(() => {
|
|
28
|
-
if (props.bordered || props.variant === 'bordered')
|
|
29
|
-
return 'bordered'
|
|
30
|
-
if (props.lifted || props.variant === 'lifted')
|
|
31
|
-
return 'lifted'
|
|
32
|
-
return undefined
|
|
33
|
-
})
|
|
34
|
-
const _size = computed(() => {
|
|
35
|
-
if (props.size)
|
|
36
|
-
return props.size
|
|
37
|
-
if (props.lg)
|
|
38
|
-
return 'lg'
|
|
39
|
-
if (props.md)
|
|
40
|
-
return 'md'
|
|
41
|
-
if (props.sm)
|
|
42
|
-
return 'sm'
|
|
43
|
-
if (props.xs)
|
|
44
|
-
return 'xs'
|
|
45
|
-
return 'md'
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const classes = computed(() => {
|
|
49
|
-
return {
|
|
50
|
-
'tabs-boxed':
|
|
51
|
-
props.variant === 'boxed'
|
|
52
|
-
|| props.variant === 'inline-boxed'
|
|
53
|
-
|| props.boxed
|
|
54
|
-
|| props.inlineBoxed,
|
|
55
|
-
'inline-block': props.variant === 'inline-boxed' || props.inlineBoxed,
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
<template>
|
|
61
|
-
<div class="tabs" :class="classes">
|
|
62
|
-
<slot v-if="$slots.default" />
|
|
63
|
-
<template v-for="tabName in tabs" v-else :key="tabName">
|
|
64
|
-
<Tab
|
|
65
|
-
:is="is"
|
|
66
|
-
:name="tabName"
|
|
67
|
-
:variant="_variant"
|
|
68
|
-
:size="_size"
|
|
69
|
-
:active="tabManager.currentTab === tabName"
|
|
70
|
-
@click="() => (tabManager.currentTab = tabName)"
|
|
71
|
-
>
|
|
72
|
-
{{ tabName }}
|
|
73
|
-
</Tab>
|
|
74
|
-
</template>
|
|
75
|
-
<div v-if="variant === 'lifted' || lifted" class="flex-1 cursor-default tab tab-lifted" />
|
|
76
|
-
</div>
|
|
77
|
-
</template>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { provide, reactive, watch } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
tab?: string
|
|
6
|
-
}>()
|
|
7
|
-
const emit = defineEmits(['update:tab'])
|
|
8
|
-
|
|
9
|
-
const manager = reactive({
|
|
10
|
-
currentTab: props.tab,
|
|
11
|
-
tabs: [],
|
|
12
|
-
})
|
|
13
|
-
provide('tabManager', manager)
|
|
14
|
-
|
|
15
|
-
// If the tab changes from outside, update the internal value.
|
|
16
|
-
watch(
|
|
17
|
-
() => props.tab,
|
|
18
|
-
(val) => {
|
|
19
|
-
if (val !== manager.currentTab)
|
|
20
|
-
manager.currentTab = val
|
|
21
|
-
},
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
// If the internal tab value changes, update the tab
|
|
25
|
-
watch(
|
|
26
|
-
() => manager.currentTab,
|
|
27
|
-
(val) => {
|
|
28
|
-
if (val !== props.tab)
|
|
29
|
-
emit('update:tab', val)
|
|
30
|
-
},
|
|
31
|
-
)
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<template>
|
|
35
|
-
<div class="tabs-manager">
|
|
36
|
-
<slot />
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
package/components/Text.vue
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps<{
|
|
5
|
-
is?: string
|
|
6
|
-
join?: boolean
|
|
7
|
-
|
|
8
|
-
block?: boolean
|
|
9
|
-
inline?: boolean
|
|
10
|
-
inlineBlock?: boolean
|
|
11
|
-
|
|
12
|
-
color?: | 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'primary-content' | 'secondary-content' | 'neutral-content' | 'accent-content' | 'info-content' | 'success-content' | 'warning-content' | 'error-content'
|
|
13
|
-
neutral?: boolean
|
|
14
|
-
primary?: boolean
|
|
15
|
-
secondary?: boolean
|
|
16
|
-
accent?: boolean
|
|
17
|
-
info?: boolean
|
|
18
|
-
success?: boolean
|
|
19
|
-
warning?: boolean
|
|
20
|
-
error?: boolean
|
|
21
|
-
neutralContent?: boolean
|
|
22
|
-
primaryContent?: boolean
|
|
23
|
-
secondaryContent?: boolean
|
|
24
|
-
accentContent?: boolean
|
|
25
|
-
infoContent?: boolean
|
|
26
|
-
successContent?: boolean
|
|
27
|
-
warningContent?: boolean
|
|
28
|
-
errorContent?: boolean
|
|
29
|
-
|
|
30
|
-
size?: | '9xl' | '8xl' | '7xl' | '6xl' | '5xl' | '4xl' | '3xl' | '2xl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs'
|
|
31
|
-
xl?: boolean
|
|
32
|
-
lg?: boolean
|
|
33
|
-
md?: boolean
|
|
34
|
-
sm?: boolean
|
|
35
|
-
xs?: boolean
|
|
36
|
-
|
|
37
|
-
align?: 'left' | 'center' | 'right' | 'justify'
|
|
38
|
-
left?: boolean
|
|
39
|
-
center?: boolean
|
|
40
|
-
right?: boolean
|
|
41
|
-
justify?: boolean
|
|
42
|
-
|
|
43
|
-
case?: 'upper' | 'lower' | 'capitalize' | 'normal'
|
|
44
|
-
uppercase?: boolean
|
|
45
|
-
lowercase?: boolean
|
|
46
|
-
capitalize?: boolean
|
|
47
|
-
normalCase?: boolean
|
|
48
|
-
|
|
49
|
-
font?: 'sans' | 'serif' | 'mono'
|
|
50
|
-
sans?: boolean
|
|
51
|
-
serif?: boolean
|
|
52
|
-
mono?: boolean
|
|
53
|
-
|
|
54
|
-
weight?: | 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black'
|
|
55
|
-
thin?: boolean
|
|
56
|
-
extralight?: boolean
|
|
57
|
-
light?: boolean
|
|
58
|
-
normal?: boolean
|
|
59
|
-
medium?: boolean
|
|
60
|
-
semibold?: boolean
|
|
61
|
-
bold?: boolean
|
|
62
|
-
extrabold?: boolean
|
|
63
|
-
black?: boolean
|
|
64
|
-
}>()
|
|
65
|
-
|
|
66
|
-
const classes = computed(() => {
|
|
67
|
-
return {
|
|
68
|
-
'join-item': props.join,
|
|
69
|
-
|
|
70
|
-
'block': props.block,
|
|
71
|
-
'inline': props.inline,
|
|
72
|
-
'inline-block': props.inlineBlock,
|
|
73
|
-
|
|
74
|
-
'text-primary': props.primary || props.color === 'primary',
|
|
75
|
-
'text-primary-content':
|
|
76
|
-
props.primaryContent || props.color === 'primary-content',
|
|
77
|
-
'text-secondary': props.secondary || props.color === 'secondary',
|
|
78
|
-
'text-secondary-content':
|
|
79
|
-
props.secondaryContent || props.color === 'secondary-content',
|
|
80
|
-
'text-neutral': props.neutral || props.color === 'neutral',
|
|
81
|
-
'text-neutral-content':
|
|
82
|
-
props.neutralContent || props.color === 'neutral-content',
|
|
83
|
-
'text-accent': props.accent || props.color === 'accent',
|
|
84
|
-
'text-accent-content':
|
|
85
|
-
props.accentContent || props.color === 'accent-content',
|
|
86
|
-
'text-info': props.info || props.color === 'info',
|
|
87
|
-
'text-info-content': props.infoContent || props.color === 'info-content',
|
|
88
|
-
'text-success': props.success || props.color === 'success',
|
|
89
|
-
'text-success-content':
|
|
90
|
-
props.successContent || props.color === 'success-content',
|
|
91
|
-
'text-warning': props.warning || props.color === 'warning',
|
|
92
|
-
'text-warning-content':
|
|
93
|
-
props.warningContent || props.color === 'warning-content',
|
|
94
|
-
'text-error': props.error || props.color === 'error',
|
|
95
|
-
'text-error-content': props.errorContent || props.color === 'error-content',
|
|
96
|
-
|
|
97
|
-
'text-9xl': props.size === '9xl',
|
|
98
|
-
'text-8xl': props.size === '8xl',
|
|
99
|
-
'text-7xl': props.size === '7xl',
|
|
100
|
-
'text-6xl': props.size === '6xl',
|
|
101
|
-
'text-5xl': props.size === '5xl',
|
|
102
|
-
'text-4xl': props.size === '4xl',
|
|
103
|
-
'text-3xl': props.size === '3xl',
|
|
104
|
-
'text-2xl': props.size === '2xl',
|
|
105
|
-
'text-xl': props.xl || props.size === 'xl',
|
|
106
|
-
'text-lg': props.lg || props.size === 'lg',
|
|
107
|
-
'text-md': props.md || props.size === 'md',
|
|
108
|
-
'text-sm': props.sm || props.size === 'sm',
|
|
109
|
-
'text-xs': props.xs || props.size === 'xs',
|
|
110
|
-
|
|
111
|
-
'text-left': props.left || props.align === 'left',
|
|
112
|
-
'text-center': props.center || props.align === 'center',
|
|
113
|
-
'text-right': props.right || props.align === 'right',
|
|
114
|
-
'text-justify': props.justify || props.align === 'justify',
|
|
115
|
-
|
|
116
|
-
'uppercase': props.uppercase || props.case === 'upper',
|
|
117
|
-
'lowercase': props.lowercase || props.case === 'lower',
|
|
118
|
-
'capitalize': props.capitalize || props.case === 'capitalize',
|
|
119
|
-
'normal-case': props.normalCase || props.case === 'normal',
|
|
120
|
-
|
|
121
|
-
'font-sans': props.sans || props.font === 'sans',
|
|
122
|
-
'font-serif': props.serif || props.font === 'serif',
|
|
123
|
-
'font-mono': props.mono || props.font === 'mono',
|
|
124
|
-
|
|
125
|
-
'font-thin': props.thin || props.weight === 'thin',
|
|
126
|
-
'font-extralight': props.extralight || props.weight === 'extralight',
|
|
127
|
-
'font-light': props.light || props.weight === 'light',
|
|
128
|
-
'font-normal': props.normal || props.weight === 'normal',
|
|
129
|
-
'font-medium': props.medium || props.weight === 'medium',
|
|
130
|
-
'font-semibold': props.semibold || props.weight === 'semibold',
|
|
131
|
-
'font-bold': props.bold || props.weight === 'bold',
|
|
132
|
-
'font-extrabold': props.extrabold || props.weight === 'extrabold',
|
|
133
|
-
'font-black': props.black || props.weight === 'black',
|
|
134
|
-
}
|
|
135
|
-
})
|
|
136
|
-
</script>
|
|
137
|
-
|
|
138
|
-
<template>
|
|
139
|
-
<component :is="is || 'span'" :class="[classes]">
|
|
140
|
-
<slot />
|
|
141
|
-
</component>
|
|
142
|
-
</template>
|
package/components/TextArea.vue
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
modelValue?: string
|
|
6
|
-
placeholder?: string
|
|
7
|
-
type?: 'text' | 'phone' | 'email' | 'search'
|
|
8
|
-
|
|
9
|
-
color?: string
|
|
10
|
-
primary?: boolean
|
|
11
|
-
secondary?: boolean
|
|
12
|
-
accent?: boolean
|
|
13
|
-
info?: boolean
|
|
14
|
-
success?: boolean
|
|
15
|
-
warning?: boolean
|
|
16
|
-
error?: boolean
|
|
17
|
-
|
|
18
|
-
bordered?: boolean
|
|
19
|
-
ghost?: boolean
|
|
20
|
-
disabled?: boolean
|
|
21
|
-
|
|
22
|
-
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
23
|
-
lg?: boolean
|
|
24
|
-
md?: boolean
|
|
25
|
-
sm?: boolean
|
|
26
|
-
xs?: boolean
|
|
27
|
-
}>(), {
|
|
28
|
-
type: 'text',
|
|
29
|
-
})
|
|
30
|
-
defineEmits(['update:modelValue'])
|
|
31
|
-
|
|
32
|
-
const classes = computed(() => {
|
|
33
|
-
return {
|
|
34
|
-
'textarea-primary': props.primary || props.color === 'primary',
|
|
35
|
-
'textarea-secondary': props.secondary || props.color === 'secondary',
|
|
36
|
-
'textarea-accent': props.accent || props.color === 'accent',
|
|
37
|
-
'textarea-info': props.info || props.color === 'info',
|
|
38
|
-
'textarea-success': props.success || props.color === 'success',
|
|
39
|
-
'textarea-warning': props.warning || props.color === 'warning',
|
|
40
|
-
'textarea-error': props.error || props.color === 'error',
|
|
41
|
-
|
|
42
|
-
'textarea-bordered': props.bordered,
|
|
43
|
-
'textarea-ghost': props.ghost,
|
|
44
|
-
|
|
45
|
-
'textarea-lg': props.lg || props.size === 'lg',
|
|
46
|
-
'textarea-md': props.md || props.size === 'md',
|
|
47
|
-
'textarea-sm': props.sm || props.size === 'sm',
|
|
48
|
-
'textarea-xs': props.xs || props.size === 'xs',
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
</script>
|
|
53
|
-
|
|
54
|
-
<template>
|
|
55
|
-
<textarea
|
|
56
|
-
:value="modelValue"
|
|
57
|
-
:type="type"
|
|
58
|
-
:placeholder="placeholder"
|
|
59
|
-
:disabled="disabled"
|
|
60
|
-
class="textarea"
|
|
61
|
-
:class="classes"
|
|
62
|
-
@input="$emit('update:modelValue', ($event.target as any).value)"
|
|
63
|
-
/>
|
|
64
|
-
</template>
|