daisy-ui-kit 1.0.8 → 2.0.0
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/components/Accordion.vue +16 -0
- package/components/Alert.vue +6 -8
- package/components/Artboard.vue +1 -1
- package/components/Avatar.vue +8 -23
- package/components/Badge.vue +5 -0
- package/components/BottomNav.vue +2 -4
- package/components/Button.vue +12 -4
- package/components/Card.vue +1 -1
- package/components/Chat.vue +27 -0
- package/components/ChatBubble.vue +34 -0
- package/components/ChatFooter.vue +5 -0
- package/components/ChatHeader.vue +5 -0
- package/components/ChatImage.vue +5 -0
- package/components/Checkbox.vue +12 -4
- package/components/Code.vue +2 -1
- package/components/CodeWrapper.vue +2 -2
- package/components/Collapse.vue +30 -8
- package/components/CountdownTimers.vue +8 -3
- package/components/Divider.vue +1 -1
- package/components/Drawer.vue +35 -11
- package/components/DrawerContent.vue +15 -0
- package/components/DrawerSide.vue +16 -0
- package/components/Dropdown.vue +56 -7
- package/components/DropdownContent.vue +3 -1
- package/components/DropdownTarget.vue +5 -0
- package/components/FileInput.vue +60 -0
- package/components/Flex.vue +3 -89
- package/components/FlexItem.vue +4 -90
- package/components/Footer.vue +1 -1
- package/components/FooterTitle.vue +1 -2
- package/components/Home/AlternatingFeatureSections.vue +10 -12
- package/components/Home/BitoviConsulting.vue +1 -1
- package/components/Home/BitoviOpenSource.vue +5 -5
- package/components/Home/Footer.vue +7 -6
- package/components/Home/GradientFeatureSections.vue +9 -9
- package/components/Home/Header.vue +10 -16
- package/components/Home/Hero.vue +4 -4
- package/components/Home/Testimonial.vue +1 -1
- package/components/{ButtonGroup.vue → Join.vue} +1 -1
- package/components/Link.vue +13 -6
- package/components/LoadingBall.vue +41 -0
- package/components/LoadingBars.vue +41 -0
- package/components/LoadingDots.vue +41 -0
- package/components/LoadingInfinity.vue +41 -0
- package/components/LoadingRing.vue +41 -0
- package/components/LoadingSpinner.vue +41 -0
- package/components/Mask.config.ts +2 -2
- package/components/Menu.vue +14 -6
- package/components/MenuItem.vue +11 -3
- package/components/MenuTitle.vue +1 -10
- package/components/Modal.vue +28 -7
- package/components/Progress.vue +1 -2
- package/components/Prose.vue +6 -8
- package/components/Radio.vue +14 -2
- package/components/RadioGroup.vue +5 -0
- package/components/Range.vue +14 -2
- package/components/RangeMeasure.vue +23 -11
- package/components/RangeMeasureTick.vue +19 -7
- package/components/Rating.vue +52 -36
- package/components/Select.vue +14 -14
- package/components/Step.vue +2 -2
- package/components/Tab.vue +3 -4
- package/components/TabContent.vue +1 -1
- package/components/Tabs.vue +2 -2
- package/components/Text.vue +4 -1
- package/components/TextArea.vue +13 -1
- package/components/TextInput.vue +5 -2
- package/components/Toggle.vue +13 -1
- package/components/content/Badge.ts +3 -0
- package/components/content/ColorBadge.vue +24 -0
- package/components/{DemoExample.vue → content/DemoExample.vue} +1 -1
- package/components/content/DemoExampleResponsive.vue +59 -0
- package/components/content/IframeRenderer.ts +53 -0
- package/components/content/Indent.vue +3 -0
- package/components/content/LocalLinks.vue +31 -0
- package/components/content/NotFound.vue +42 -0
- package/components/content/PageNext.vue +24 -0
- package/components/content/PagePrevious.vue +24 -0
- package/components/content/PrevNext.vue +40 -0
- package/components/content/ProseA.vue +19 -0
- package/components/content/ProseAlert.vue +11 -0
- package/components/content/ProseBlockquote.vue +5 -0
- package/components/content/ProseCode.vue +62 -0
- package/components/content/ProseCodeInline.vue +3 -0
- package/components/content/ProseEm.vue +5 -0
- package/components/content/ProseH1.vue +16 -0
- package/components/content/ProseH2.vue +16 -0
- package/components/content/ProseH3.vue +16 -0
- package/components/content/ProseH4.vue +16 -0
- package/components/content/ProseH5.vue +16 -0
- package/components/content/ProseH6.vue +16 -0
- package/components/content/ProseHr.vue +3 -0
- package/components/content/ProseImg.vue +34 -0
- package/components/content/ProseLi.vue +3 -0
- package/components/content/ProseOl.vue +5 -0
- package/components/content/ProseP.vue +3 -0
- package/components/content/ProseStrong.vue +5 -0
- package/components/content/ProseTable.vue +7 -0
- package/components/content/ProseTbody.vue +5 -0
- package/components/content/ProseTd.vue +5 -0
- package/components/content/ProseTh.vue +5 -0
- package/components/content/ProseThead.vue +5 -0
- package/components/content/ProseTr.vue +5 -0
- package/components/content/ProseUl.vue +5 -0
- package/components/content/Search.vue +160 -0
- package/components/content/Sidebar.vue +65 -0
- package/components/{SidebarMenuSection.vue → content/SidebarMenuSection.vue} +11 -6
- package/components/content/TableOfContents.vue +80 -0
- package/components/content/TypeBadge.vue +17 -0
- package/components/theme/Picker.vue +2 -2
- package/components/theme/Preview.vue +1 -1
- package/components/theme/theme-utils.ts +15 -4
- package/index.ts +105 -96
- package/package.json +27 -24
- package/components/-utils.ts +0 -41
- package/components/Button.config.ts +0 -26
- package/components/DemoElement.vue +0 -32
- package/components/DrawerLayout.vue +0 -37
- package/components/DrawerLayoutContent.vue +0 -19
- package/components/InputGroup.vue +0 -33
- package/components/MobileSidebar.vue +0 -88
- package/components/ModalWrapper.vue +0 -32
- package/components/Sidebar.vue +0 -89
- package/components/drawer-utils.ts +0 -10
- package/components/fixtures.ts +0 -62
- package/components/types.ts +0 -7
- /package/components/{CodePreview.vue → content/CodePreview.vue} +0 -0
- /package/components/{SigninForm.vue → content/SigninForm.vue} +0 -0
- /package/components/{UserMenu.vue → content/UserMenu.vue} +0 -0
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
|
+
modelValue?: number | string
|
|
6
6
|
min?: number | string
|
|
7
7
|
max?: number | string
|
|
8
8
|
step?: number | string
|
|
9
|
-
modelValue?: number | string
|
|
10
9
|
|
|
10
|
+
numbered?: boolean
|
|
11
11
|
asButtons?: boolean
|
|
12
|
+
disabled?: boolean
|
|
12
13
|
|
|
13
14
|
color?: string
|
|
15
|
+
neutral?: boolean
|
|
14
16
|
primary?: boolean
|
|
15
17
|
secondary?: boolean
|
|
16
18
|
accent?: boolean
|
|
19
|
+
success?: boolean
|
|
20
|
+
warning?: boolean
|
|
21
|
+
info?: boolean
|
|
22
|
+
error?: boolean
|
|
17
23
|
|
|
18
24
|
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
19
25
|
lg?: boolean
|
|
20
26
|
md?: boolean
|
|
21
27
|
sm?: boolean
|
|
22
28
|
xs?: boolean
|
|
23
|
-
}
|
|
24
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
29
|
+
}>(), {
|
|
25
30
|
min: 0,
|
|
26
31
|
max: 100,
|
|
27
32
|
step: 1,
|
|
@@ -29,28 +34,34 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
29
34
|
defineEmits(['update:modelValue'])
|
|
30
35
|
|
|
31
36
|
const classes = computed(() => {
|
|
32
|
-
const { color, primary, secondary, accent, size, lg, md, sm, xs,
|
|
37
|
+
const { color, neutral, primary, secondary, accent, success, info, warning, error, size, lg, md, sm, xs, disabled } = props
|
|
33
38
|
return {
|
|
39
|
+
'text-neutral': neutral || color === 'neutral',
|
|
34
40
|
'text-primary': primary || color === 'primary',
|
|
35
41
|
'text-secondary': secondary || color === 'secondary',
|
|
36
42
|
'text-accent': accent || color === 'accent',
|
|
43
|
+
'text-success': success || color === 'success',
|
|
44
|
+
'text-info': info || color === 'info',
|
|
45
|
+
'text-warning': warning || color === 'warning',
|
|
46
|
+
'text-error': error || color === 'error',
|
|
37
47
|
'text-lg': lg || size === 'lg',
|
|
38
48
|
'text-md': md || size === 'md',
|
|
39
49
|
'text-sm': sm || size === 'sm',
|
|
40
50
|
'text-xs': xs || size === 'xs',
|
|
51
|
+
'opacity-50': disabled,
|
|
41
52
|
}
|
|
42
53
|
})
|
|
43
54
|
const values = computed(() => {
|
|
44
55
|
const vals = []
|
|
45
|
-
for (let index = parseInt(props.min as string); index < parseInt(props.max as string) + 1; index++) {
|
|
56
|
+
for (let index = Number.parseInt(props.min as string); index < Number.parseInt(props.max as string) + 1; index++) {
|
|
46
57
|
vals.push({
|
|
47
58
|
value: index,
|
|
48
|
-
isVisible: index % parseInt(props.step as string) === 0,
|
|
59
|
+
isVisible: index % Number.parseInt(props.step as string) === 0,
|
|
49
60
|
})
|
|
50
61
|
}
|
|
51
62
|
return vals
|
|
52
63
|
})
|
|
53
|
-
const count = computed(() => parseInt(props.max as string) - parseInt(props.min as string))
|
|
64
|
+
// const count = computed(() => Number.parseInt(props.max as string) - Number.parseInt(props.min as string))
|
|
54
65
|
</script>
|
|
55
66
|
|
|
56
67
|
<template>
|
|
@@ -63,7 +74,8 @@ const count = computed(() => parseInt(props.max as string) - parseInt(props.min
|
|
|
63
74
|
:numbered="numbered"
|
|
64
75
|
:as-button="asButtons"
|
|
65
76
|
:is-hidden="!tick.isVisible"
|
|
66
|
-
|
|
77
|
+
:disabled="disabled"
|
|
78
|
+
@update:model-value="(val) => !disabled && $emit('update:modelValue', val)"
|
|
67
79
|
>
|
|
68
80
|
{{ numbered ? tick : '|' }}
|
|
69
81
|
</RangeMeasureTick>
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { useTimeoutFn } from '@vueuse/core'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const props = defineProps<{
|
|
6
6
|
tick: number
|
|
7
7
|
modelValue?: number | string
|
|
8
8
|
numbered?: boolean
|
|
9
9
|
asButton?: boolean
|
|
10
10
|
isHidden?: boolean
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
}>()
|
|
13
13
|
defineEmits(['update:modelValue'])
|
|
14
14
|
|
|
15
15
|
const hasChanged = ref(false)
|
|
@@ -35,13 +35,21 @@ const isCurrent = computed(() => props.modelValue == props.tick)
|
|
|
35
35
|
const classes = computed(() => {
|
|
36
36
|
return {
|
|
37
37
|
'font-bold': isCurrent.value,
|
|
38
|
+
'opacity-50': props.disabled,
|
|
39
|
+
'cursor-pointer': !props.disabled,
|
|
40
|
+
'cursor-not-allowed': props.disabled,
|
|
38
41
|
}
|
|
39
42
|
})
|
|
40
43
|
</script>
|
|
41
44
|
|
|
42
45
|
<template>
|
|
43
46
|
<Button
|
|
44
|
-
v-if="asButton && !isHidden"
|
|
47
|
+
v-if="asButton && !isHidden"
|
|
48
|
+
xs
|
|
49
|
+
:ghost="!isCurrent"
|
|
50
|
+
circle
|
|
51
|
+
:class="classes"
|
|
52
|
+
:disabled="disabled"
|
|
45
53
|
@click="$emit('update:modelValue', tick)"
|
|
46
54
|
>
|
|
47
55
|
{{ numbered ? tick : '|' }}
|
|
@@ -49,10 +57,14 @@ const classes = computed(() => {
|
|
|
49
57
|
<Tooltip
|
|
50
58
|
v-else
|
|
51
59
|
:tip="tick"
|
|
52
|
-
:open="hasChanged && isCurrent"
|
|
60
|
+
:open="hasChanged && isCurrent && !disabled"
|
|
53
61
|
position="bottom"
|
|
54
|
-
class="
|
|
55
|
-
|
|
62
|
+
:class="{
|
|
63
|
+
'px-[2px]': !asButton,
|
|
64
|
+
'opacity-50': disabled,
|
|
65
|
+
'cursor-pointer': !disabled,
|
|
66
|
+
'cursor-not-allowed': disabled,
|
|
67
|
+
}"
|
|
56
68
|
@click="$emit('update:modelValue', tick)"
|
|
57
69
|
>
|
|
58
70
|
<Text v-if="!isHidden" :black="isCurrent">
|
package/components/Rating.vue
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
modelValue?: number | string
|
|
6
6
|
count?: number | string
|
|
7
7
|
half?: boolean
|
|
8
8
|
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
|
|
9
11
|
color?: string
|
|
10
12
|
neutral?: boolean
|
|
11
13
|
primary?: boolean
|
|
@@ -48,7 +50,7 @@ interface Props {
|
|
|
48
50
|
const props = withDefaults(defineProps<Props>(), {
|
|
49
51
|
count: 5,
|
|
50
52
|
})
|
|
51
|
-
defineEmits(['update:modelValue'])
|
|
53
|
+
const emit = defineEmits(['update:modelValue'])
|
|
52
54
|
|
|
53
55
|
const shapes = [
|
|
54
56
|
'squircle',
|
|
@@ -84,40 +86,54 @@ const ratingClasses = computed(() => {
|
|
|
84
86
|
|
|
85
87
|
const maskClasses = computed(() => {
|
|
86
88
|
const hasShape = shapes.reduce((acc, current) => {
|
|
87
|
-
return acc || props.shape || props[current]
|
|
89
|
+
return acc || props.shape || (props as any)[current]
|
|
88
90
|
}, false)
|
|
91
|
+
const { color, shape, disabled } = props
|
|
89
92
|
return {
|
|
90
|
-
'bg-neutral': props.neutral ||
|
|
91
|
-
'bg-primary': props.primary ||
|
|
92
|
-
'bg-secondary': props.secondary ||
|
|
93
|
-
'bg-accent': props.accent ||
|
|
94
|
-
'bg-info': props.info ||
|
|
95
|
-
'bg-success': props.success ||
|
|
96
|
-
'bg-warning': props.warning ||
|
|
97
|
-
'bg-error': props.error ||
|
|
93
|
+
'bg-neutral': props.neutral || color === 'neutral',
|
|
94
|
+
'bg-primary': props.primary || color === 'primary',
|
|
95
|
+
'bg-secondary': props.secondary || color === 'secondary',
|
|
96
|
+
'bg-accent': props.accent || color === 'accent',
|
|
97
|
+
'bg-info': props.info || color === 'info',
|
|
98
|
+
'bg-success': props.success || color === 'success',
|
|
99
|
+
'bg-warning': props.warning || color === 'warning',
|
|
100
|
+
'bg-error': props.error || color === 'error',
|
|
101
|
+
|
|
102
|
+
'cursor-not-allowed': disabled,
|
|
103
|
+
'opacity-50': disabled,
|
|
98
104
|
|
|
99
|
-
'mask-squircle': props.squircle ||
|
|
100
|
-
'mask-heart': props.heart ||
|
|
101
|
-
'mask-hexagon': props.hexagon ||
|
|
102
|
-
'mask-hexagon-2': props.hexagon2 ||
|
|
103
|
-
'mask-decagon': props.decagon ||
|
|
104
|
-
'mask-pentagon': props.pentagon ||
|
|
105
|
-
'mask-diamond': props.diamond ||
|
|
106
|
-
'mask-square': props.square ||
|
|
107
|
-
'mask-circle': props.circle ||
|
|
108
|
-
'mask-parallelogram': props.parallelogram ||
|
|
109
|
-
'mask-parallelogram-2': props.parallelogram2 ||
|
|
110
|
-
'mask-parallelogram-3': props.parallelogram3 ||
|
|
111
|
-
'mask-parallelogram-4': props.parallelogram4 ||
|
|
112
|
-
'mask-star': props.star ||
|
|
113
|
-
'mask-star-2': props.star2 ||
|
|
114
|
-
'mask-triangle': props.triangle ||
|
|
115
|
-
'mask-triangle-2': props.triangle2 ||
|
|
116
|
-
'mask-triangle-3': props.triangle3 ||
|
|
117
|
-
'mask-triangle-4': props.triangle4 ||
|
|
105
|
+
'mask-squircle': props.squircle || shape === 'squircle',
|
|
106
|
+
'mask-heart': props.heart || shape === 'heart',
|
|
107
|
+
'mask-hexagon': props.hexagon || shape === 'hexagon',
|
|
108
|
+
'mask-hexagon-2': props.hexagon2 || shape === 'hexagon-2',
|
|
109
|
+
'mask-decagon': props.decagon || shape === 'decagon',
|
|
110
|
+
'mask-pentagon': props.pentagon || shape === 'pentagon',
|
|
111
|
+
'mask-diamond': props.diamond || shape === 'diamond',
|
|
112
|
+
'mask-square': props.square || shape === 'square',
|
|
113
|
+
'mask-circle': props.circle || shape === 'circle',
|
|
114
|
+
'mask-parallelogram': props.parallelogram || shape === 'parallelogram',
|
|
115
|
+
'mask-parallelogram-2': props.parallelogram2 || shape === 'parallelogram-2',
|
|
116
|
+
'mask-parallelogram-3': props.parallelogram3 || shape === 'parallelogram-3',
|
|
117
|
+
'mask-parallelogram-4': props.parallelogram4 || shape === 'parallelogram-4',
|
|
118
|
+
'mask-star': props.star || shape === 'star',
|
|
119
|
+
'mask-star-2': props.star2 || shape === 'star-2' || !hasShape,
|
|
120
|
+
'mask-triangle': props.triangle || shape === 'triangle',
|
|
121
|
+
'mask-triangle-2': props.triangle2 || shape === 'triangle-2',
|
|
122
|
+
'mask-triangle-3': props.triangle3 || shape === 'triangle-3',
|
|
123
|
+
'mask-triangle-4': props.triangle4 || shape === 'triangle-4',
|
|
118
124
|
}
|
|
119
125
|
})
|
|
120
|
-
const max = computed(() => parseInt(props.count as string))
|
|
126
|
+
const max = computed(() => Number.parseInt(props.count as string))
|
|
127
|
+
|
|
128
|
+
function handleValue(digit: number, half = false) {
|
|
129
|
+
if (props.disabled)
|
|
130
|
+
return
|
|
131
|
+
|
|
132
|
+
if (props.half)
|
|
133
|
+
return emit('update:modelValue', half ? digit - 0.5 : digit)
|
|
134
|
+
|
|
135
|
+
return emit('update:modelValue', digit)
|
|
136
|
+
}
|
|
121
137
|
</script>
|
|
122
138
|
|
|
123
139
|
<template>
|
|
@@ -134,9 +150,9 @@ const max = computed(() => parseInt(props.count as string))
|
|
|
134
150
|
type="radio"
|
|
135
151
|
:value="half ? digit - 0.5 : digit"
|
|
136
152
|
class="mask"
|
|
137
|
-
:class="[maskClasses, { 'mask-half-1': half }
|
|
138
|
-
:checked="half ? modelValue
|
|
139
|
-
@change="
|
|
153
|
+
:class="[maskClasses, bg, { 'mask-half-1': half }]"
|
|
154
|
+
:checked="half ? modelValue === digit - 0.5 : modelValue === digit"
|
|
155
|
+
@change="() => handleValue(digit, true)"
|
|
140
156
|
>
|
|
141
157
|
<input
|
|
142
158
|
v-if="half"
|
|
@@ -144,8 +160,8 @@ const max = computed(() => parseInt(props.count as string))
|
|
|
144
160
|
:value="digit"
|
|
145
161
|
class="mask mask-half-2"
|
|
146
162
|
:class="[maskClasses, bg]"
|
|
147
|
-
:checked="modelValue
|
|
148
|
-
@change="
|
|
163
|
+
:checked="modelValue === digit"
|
|
164
|
+
@change="() => handleValue(digit)"
|
|
149
165
|
>
|
|
150
166
|
</template>
|
|
151
167
|
</div>
|
package/components/Select.vue
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, withDefaults } from 'vue'
|
|
3
|
-
|
|
4
|
-
type Value = string | Record<string, any>
|
|
5
2
|
type Color =
|
|
6
3
|
| 'primary'
|
|
7
4
|
| 'secondary'
|
|
@@ -10,15 +7,18 @@ type Color =
|
|
|
10
7
|
| 'success'
|
|
11
8
|
| 'warning'
|
|
12
9
|
| 'error'
|
|
13
|
-
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
14
12
|
modelValue: any
|
|
15
13
|
options: Record<string, any>[] | any[]
|
|
16
|
-
value?:
|
|
17
|
-
label?:
|
|
14
|
+
value?: (val: any) => any
|
|
15
|
+
label?: (val: any) => any
|
|
18
16
|
resultAsObject?: boolean
|
|
17
|
+
join?: boolean
|
|
19
18
|
|
|
20
19
|
bordered?: boolean
|
|
21
20
|
ghost?: boolean
|
|
21
|
+
disabled?: boolean
|
|
22
22
|
|
|
23
23
|
color?: Color
|
|
24
24
|
primary?: boolean
|
|
@@ -34,21 +34,19 @@ interface Props {
|
|
|
34
34
|
md?: boolean
|
|
35
35
|
sm?: boolean
|
|
36
36
|
xs?: boolean
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
40
|
-
value: <T extends Value>(val: T) => {
|
|
37
|
+
}>(), {
|
|
38
|
+
value: (val: any) => {
|
|
41
39
|
if (!val)
|
|
42
40
|
return null
|
|
43
41
|
|
|
44
42
|
return typeof val === 'string'
|
|
45
43
|
? (val as string)
|
|
46
|
-
: val?.value || val?.id || val?._id
|
|
44
|
+
: (val?.value || val?.id || val?._id || val)
|
|
47
45
|
},
|
|
48
|
-
label:
|
|
46
|
+
label: (val: any) =>
|
|
49
47
|
typeof val === 'string'
|
|
50
48
|
? (val as string)
|
|
51
|
-
: val.label || val.name || val.title,
|
|
49
|
+
: (val.label || val.name || val.title),
|
|
52
50
|
resultAsObject: false,
|
|
53
51
|
})
|
|
54
52
|
const emit = defineEmits(['update:modelValue'])
|
|
@@ -72,6 +70,8 @@ const computedVModel = computed({
|
|
|
72
70
|
|
|
73
71
|
const classes = computed(() => {
|
|
74
72
|
return {
|
|
73
|
+
'join-item': props.join,
|
|
74
|
+
|
|
75
75
|
'select-primary': props.primary || props.color === 'primary',
|
|
76
76
|
'select-secondary': props.secondary || props.color === 'secondary',
|
|
77
77
|
'select-accent': props.accent || props.color === 'accent',
|
|
@@ -92,7 +92,7 @@ const classes = computed(() => {
|
|
|
92
92
|
</script>
|
|
93
93
|
|
|
94
94
|
<template>
|
|
95
|
-
<select v-model="computedVModel" class="select" :class="classes">
|
|
95
|
+
<select v-model="computedVModel" class="select" :class="classes" :disabled="disabled">
|
|
96
96
|
<option
|
|
97
97
|
v-for="option in options"
|
|
98
98
|
:key="value(option)"
|
package/components/Step.vue
CHANGED
|
@@ -5,10 +5,10 @@ const props = defineProps<{
|
|
|
5
5
|
glyph?: string
|
|
6
6
|
|
|
7
7
|
color?: string
|
|
8
|
+
neutral?: boolean
|
|
8
9
|
primary?: boolean
|
|
9
10
|
secondary?: boolean
|
|
10
11
|
accent?: boolean
|
|
11
|
-
neutral?: boolean
|
|
12
12
|
info?: boolean
|
|
13
13
|
success?: boolean
|
|
14
14
|
warning?: boolean
|
|
@@ -17,10 +17,10 @@ const props = defineProps<{
|
|
|
17
17
|
|
|
18
18
|
const classes = computed(() => {
|
|
19
19
|
return {
|
|
20
|
+
'step-neutral': props.neutral || props.color === 'neutral',
|
|
20
21
|
'step-primary': props.primary || props.color === 'primary',
|
|
21
22
|
'step-secondary': props.secondary || props.color === 'secondary',
|
|
22
23
|
'step-accent': props.accent || props.color === 'accent',
|
|
23
|
-
'step-neutral': props.neutral || props.color === 'neutral',
|
|
24
24
|
'step-info': props.info || props.color === 'info',
|
|
25
25
|
'step-success': props.success || props.color === 'success',
|
|
26
26
|
'step-warning': props.warning || props.color === 'warning',
|
package/components/Tab.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, inject
|
|
2
|
+
import { computed, inject } from 'vue'
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const props = withDefaults(defineProps<{
|
|
5
5
|
is?: string | Object | Function
|
|
6
6
|
name?: string
|
|
7
7
|
active?: boolean
|
|
@@ -15,8 +15,7 @@ interface Props {
|
|
|
15
15
|
md?: boolean
|
|
16
16
|
sm?: boolean
|
|
17
17
|
xs?: boolean
|
|
18
|
-
}
|
|
19
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
18
|
+
}>(), {
|
|
20
19
|
is: 'a',
|
|
21
20
|
})
|
|
22
21
|
|
package/components/Tabs.vue
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed, inject
|
|
2
|
+
import { computed, inject } from 'vue'
|
|
3
3
|
import Tab from './Tab.vue'
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
is?: string | Object | Function
|
|
7
|
-
tabs
|
|
7
|
+
tabs?: string[]
|
|
8
8
|
|
|
9
9
|
variant?: 'bordered' | 'lifted' | 'boxed' | 'inline-boxed'
|
|
10
10
|
bordered?: boolean
|
package/components/Text.vue
CHANGED
|
@@ -3,15 +3,16 @@ import { computed } from 'vue'
|
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
is?: string
|
|
6
|
+
join?: boolean
|
|
6
7
|
|
|
7
8
|
block?: boolean
|
|
8
9
|
inline?: boolean
|
|
9
10
|
inlineBlock?: boolean
|
|
10
11
|
|
|
11
12
|
color?:
|
|
13
|
+
| 'neutral'
|
|
12
14
|
| 'primary'
|
|
13
15
|
| 'secondary'
|
|
14
|
-
| 'neutral'
|
|
15
16
|
| 'accent'
|
|
16
17
|
| 'info'
|
|
17
18
|
| 'success'
|
|
@@ -104,6 +105,8 @@ const props = defineProps<Props>()
|
|
|
104
105
|
|
|
105
106
|
const classes = computed(() => {
|
|
106
107
|
return {
|
|
108
|
+
'join-item': props.join,
|
|
109
|
+
|
|
107
110
|
'block': props.block,
|
|
108
111
|
'inline': props.inline,
|
|
109
112
|
'inline-block': props.inlineBlock,
|
package/components/TextArea.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
modelValue?: string
|
|
@@ -18,6 +18,12 @@ interface Props {
|
|
|
18
18
|
bordered?: boolean
|
|
19
19
|
ghost?: boolean
|
|
20
20
|
disabled?: boolean
|
|
21
|
+
|
|
22
|
+
size?: 'lg' | 'md' | 'sm' | 'xs'
|
|
23
|
+
lg?: boolean
|
|
24
|
+
md?: boolean
|
|
25
|
+
sm?: boolean
|
|
26
|
+
xs?: boolean
|
|
21
27
|
}
|
|
22
28
|
const props = withDefaults(defineProps<Props>(), {
|
|
23
29
|
type: 'text',
|
|
@@ -36,6 +42,12 @@ const classes = computed(() => {
|
|
|
36
42
|
|
|
37
43
|
'textarea-bordered': props.bordered,
|
|
38
44
|
'textarea-ghost': props.ghost,
|
|
45
|
+
|
|
46
|
+
'textarea-lg': props.lg || props.size === 'lg',
|
|
47
|
+
'textarea-md': props.md || props.size === 'md',
|
|
48
|
+
'textarea-sm': props.sm || props.size === 'sm',
|
|
49
|
+
'textarea-xs': props.xs || props.size === 'xs',
|
|
50
|
+
|
|
39
51
|
}
|
|
40
52
|
})
|
|
41
53
|
</script>
|
package/components/TextInput.vue
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
modelValue?: string | number
|
|
6
6
|
placeholder?: string
|
|
7
|
-
type?: 'text' | 'phone' | 'email' | 'search' | 'password'
|
|
7
|
+
type?: 'text' | 'phone' | 'email' | 'search' | 'password' | 'number'
|
|
8
|
+
join?: boolean
|
|
8
9
|
|
|
9
10
|
color?: string
|
|
10
11
|
primary?: boolean
|
|
@@ -32,6 +33,8 @@ defineEmits(['update:modelValue'])
|
|
|
32
33
|
|
|
33
34
|
const classes = computed(() => {
|
|
34
35
|
return {
|
|
36
|
+
'join-item': props.join,
|
|
37
|
+
|
|
35
38
|
'input-primary': props.primary || props.color === 'primary',
|
|
36
39
|
'input-secondary': props.secondary || props.color === 'secondary',
|
|
37
40
|
'input-accent': props.accent || props.color === 'accent',
|
package/components/Toggle.vue
CHANGED
|
@@ -3,11 +3,17 @@ import { computed } from 'vue'
|
|
|
3
3
|
|
|
4
4
|
interface Props {
|
|
5
5
|
modelValue?: any
|
|
6
|
+
disabled?: boolean
|
|
6
7
|
|
|
7
8
|
color?: string
|
|
9
|
+
neutral?: boolean
|
|
8
10
|
primary?: boolean
|
|
9
11
|
secondary?: boolean
|
|
10
12
|
accent?: boolean
|
|
13
|
+
success?: boolean
|
|
14
|
+
info?: boolean
|
|
15
|
+
warning?: boolean
|
|
16
|
+
error?: boolean
|
|
11
17
|
|
|
12
18
|
size?: string
|
|
13
19
|
xs?: boolean
|
|
@@ -19,11 +25,16 @@ const props = defineProps<Props>()
|
|
|
19
25
|
const emit = defineEmits(['update:modelValue'])
|
|
20
26
|
|
|
21
27
|
const classes = computed(() => {
|
|
22
|
-
const { color, primary, secondary, accent, size, xs, sm, md, lg } = props
|
|
28
|
+
const { color, neutral, primary, secondary, accent, success, info, warning, error, size, xs, sm, md, lg } = props
|
|
23
29
|
return {
|
|
30
|
+
'toggle-neutral': neutral || color === 'neutral',
|
|
24
31
|
'toggle-primary': primary || color === 'primary',
|
|
25
32
|
'toggle-secondary': secondary || color === 'secondary',
|
|
26
33
|
'toggle-accent': accent || color === 'accent',
|
|
34
|
+
'toggle-success': success || color === 'success',
|
|
35
|
+
'toggle-info': info || color === 'info',
|
|
36
|
+
'toggle-warning': warning || color === 'warning',
|
|
37
|
+
'toggle-error': error || color === 'error',
|
|
27
38
|
'toggle-xs': xs || size === 'xs',
|
|
28
39
|
'toggle-sm': sm || size === 'sm',
|
|
29
40
|
'toggle-md': md || size === 'md',
|
|
@@ -43,6 +54,7 @@ const currentValue = computed({
|
|
|
43
54
|
type="checkbox"
|
|
44
55
|
v-bind="$attrs"
|
|
45
56
|
class="toggle"
|
|
57
|
+
:disabled="disabled"
|
|
46
58
|
:class="classes"
|
|
47
59
|
>
|
|
48
60
|
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const props = defineProps<{
|
|
3
|
+
color: string
|
|
4
|
+
}>()
|
|
5
|
+
|
|
6
|
+
const classes = computed(() => {
|
|
7
|
+
return {
|
|
8
|
+
'bg-primary-content text-primary': props.color === 'primary-content',
|
|
9
|
+
'bg-secondary-content text-secondary': props.color === 'secondary-content',
|
|
10
|
+
'bg-neutral-content text-neutral': props.color === 'neutral-content',
|
|
11
|
+
'bg-accent-content text-accent': props.color === 'accent-content',
|
|
12
|
+
'bg-info-content text-info': props.color === 'info-content',
|
|
13
|
+
'bg-success-content text-success': props.color === 'success-content',
|
|
14
|
+
'bg-warning-content text-warning': props.color === 'warning-content',
|
|
15
|
+
'bg-error-content text-error': props.color === 'error-content',
|
|
16
|
+
}
|
|
17
|
+
})
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<Badge :color="color" class="whitespace-nowrap rounded-[0.375rem] px-1 h-[1.5rem] font-mono" :class="classes">
|
|
22
|
+
{{ color }}
|
|
23
|
+
</Badge>
|
|
24
|
+
</template>
|
|
@@ -15,7 +15,7 @@ const classes = computed(() => {
|
|
|
15
15
|
|
|
16
16
|
<template>
|
|
17
17
|
<div
|
|
18
|
-
class="flex flex-row
|
|
18
|
+
class="demo-example flex flex-row items-start mt-4 border-4 rounded-t-xl border-base-200 lg:max-w-[calc(100vw-390px)]"
|
|
19
19
|
:class="classes"
|
|
20
20
|
>
|
|
21
21
|
<slot />
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
iframeClasses: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: '',
|
|
8
|
+
},
|
|
9
|
+
allowProse: Boolean,
|
|
10
|
+
})
|
|
11
|
+
const { theme } = useTheme()
|
|
12
|
+
|
|
13
|
+
const iframe = ref()
|
|
14
|
+
const { pressed } = useMousePressed()
|
|
15
|
+
const { x: mouseX } = useMouse()
|
|
16
|
+
const { width } = useElementBounding(iframe)
|
|
17
|
+
|
|
18
|
+
const referenceX = ref(0)
|
|
19
|
+
const _width = ref('100%')
|
|
20
|
+
|
|
21
|
+
watch(pressed, (val) => {
|
|
22
|
+
if (val)
|
|
23
|
+
referenceX.value = mouseX.value
|
|
24
|
+
})
|
|
25
|
+
watch(mouseX, (val) => {
|
|
26
|
+
if (pressed.value) {
|
|
27
|
+
const delta = val - referenceX.value
|
|
28
|
+
referenceX.value = mouseX.value
|
|
29
|
+
_width.value = `${width.value + (delta * 1.2)}px`
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
const classes = computed(() => {
|
|
34
|
+
return `${props.iframeClasses} not-prose ${pressed ? 'pointer-events-none' : ''}`
|
|
35
|
+
})
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<div
|
|
40
|
+
class="flex flex-row flex-wrap items-center mt-4 border-4 rounded-t-xl border-base-200 overflow-hidden"
|
|
41
|
+
:class="classes"
|
|
42
|
+
>
|
|
43
|
+
<div class="flex flex-row w-full bg-black/50">
|
|
44
|
+
<IframeRenderer
|
|
45
|
+
ref="iframe"
|
|
46
|
+
:style="{ width: _width }"
|
|
47
|
+
class="w-full min-h-full"
|
|
48
|
+
:classes="classes"
|
|
49
|
+
:iframe-classes="iframeClasses"
|
|
50
|
+
:theme="theme"
|
|
51
|
+
>
|
|
52
|
+
<slot />
|
|
53
|
+
</IframeRenderer>
|
|
54
|
+
<Tooltip draggable primary tip="Drag to Resize" left class="flex items-center justify-center bg-primary cursor-move">
|
|
55
|
+
<Icon name="radix-icons:drag-handle-vertical" class="text-primary-content" />
|
|
56
|
+
</Tooltip>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|