daisy-ui-kit 5.0.10 → 5.0.11

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.
@@ -1,89 +1,87 @@
1
- <script setup lang="ts">
2
- defineOptions({
3
- inheritAttrs: false,
4
- })
1
+ <script lang="ts">
2
+ import { computed, defineComponent, h } from 'vue'
5
3
 
6
- const { is = 'div', ...props } = defineProps<{
7
- is?: string | object
8
- join?: boolean
4
+ export default defineComponent({
5
+ inheritAttrs: false,
6
+ props: {
7
+ is: { type: [String, Object], default: 'div' },
8
+ join: Boolean,
9
9
 
10
- // https://tailwindcss.com/docs/flex
11
- flex?: boolean
12
- flex1?: boolean
13
- flexAuto?: boolean
14
- flexInitial?: boolean
15
- none?: boolean
10
+ // https://tailwindcss.com/docs/flex
11
+ flex: Boolean,
12
+ flex1: Boolean,
13
+ flexAuto: Boolean,
14
+ flexInitial: Boolean,
15
+ none: Boolean,
16
16
 
17
- // justify
18
- justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'
19
- justifyStart?: boolean
20
- justifyEnd?: boolean
21
- justifyCenter?: boolean
22
- justifyBetween?: boolean
23
- justifyAround?: boolean
24
- justifyEvenly?: boolean
17
+ // justify
18
+ justify: String as () => 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly',
19
+ justifyStart: Boolean,
20
+ justifyEnd: Boolean,
21
+ justifyCenter: Boolean,
22
+ justifyBetween: Boolean,
23
+ justifyAround: Boolean,
24
+ justifyEvenly: Boolean,
25
25
 
26
- // align
27
- items?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'
28
- itemsStart?: boolean
29
- itemsEnd?: boolean
30
- itemsCenter?: boolean
31
- itemsBaseline?: boolean
32
- itemsStretch?: boolean
26
+ // align
27
+ items: String as () => 'start' | 'end' | 'center' | 'baseline' | 'stretch',
28
+ itemsStart: Boolean,
29
+ itemsEnd: Boolean,
30
+ itemsCenter: Boolean,
31
+ itemsBaseline: Boolean,
32
+ itemsStretch: Boolean,
33
33
 
34
- grow?: boolean
34
+ grow: Boolean,
35
35
 
36
- // https://tailwindcss.com/docs/flex-direction
37
- direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse'
38
- row?: boolean
39
- col?: boolean
40
- reverse?: boolean
36
+ // https://tailwindcss.com/docs/flex-direction
37
+ direction: String as () => 'row' | 'col' | 'row-reverse' | 'col-reverse',
38
+ row: Boolean,
39
+ col: Boolean,
40
+ reverse: Boolean,
41
41
 
42
- // https://tailwindcss.com/docs/flex-wrap
43
- wrap?: boolean
44
- nowrap?: boolean
45
- wrapReverse?: boolean
46
- }>()
47
- </script>
42
+ // https://tailwindcss.com/docs/flex-wrap
43
+ wrap: Boolean,
44
+ nowrap: Boolean,
45
+ wrapReverse: Boolean,
46
+ },
47
+ setup(props, { slots, attrs }) {
48
+ const classes = computed(() => [
49
+ 'flex',
50
+ {
51
+ 'join-item': props.join,
48
52
 
49
- <template>
50
- <component
51
- :is="is"
52
- v-bind="$attrs"
53
- class="flex"
54
- :class="{
55
- 'join-item': props.join,
53
+ 'flex-1': props.flex1,
54
+ 'flex-auto': props.flexAuto,
55
+ 'flex-initial': props.flexInitial,
56
+ 'flex-none': props.none,
56
57
 
57
- 'flex-1': props.flex1,
58
- 'flex-auto': props.flexAuto,
59
- 'flex-initial': props.flexInitial,
60
- 'flex-none': props.none,
58
+ 'justify-start': props.justifyStart,
59
+ 'justify-end': props.justifyEnd,
60
+ 'justify-center': props.justifyCenter,
61
+ 'justify-between': props.justifyBetween,
62
+ 'justify-around': props.justifyAround,
63
+ 'justify-evenly': props.justifyEvenly,
61
64
 
62
- 'justify-start': props.justifyStart,
63
- 'justify-end': props.justifyEnd,
64
- 'justify-center': props.justifyCenter,
65
- 'justify-between': props.justifyBetween,
66
- 'justify-around': props.justifyAround,
67
- 'justify-evenly': props.justifyEvenly,
65
+ 'items-start': props.itemsStart,
66
+ 'items-end': props.itemsEnd,
67
+ 'items-center': props.itemsCenter,
68
+ 'items-baseline': props.itemsBaseline,
69
+ 'items-stretch': props.itemsStretch,
68
70
 
69
- 'items-start': props.itemsStart,
70
- 'items-end': props.itemsEnd,
71
- 'items-center': props.itemsCenter,
72
- 'items-baseline': props.itemsBaseline,
73
- 'items-stretch': props.itemsStretch,
71
+ 'flex-grow': props.grow,
74
72
 
75
- 'flex-grow': props.grow,
73
+ 'flex-row': props.direction === 'row' || props.row,
74
+ 'flex-col': props.direction === 'col' || props.col,
75
+ 'flex-row-reverse': props.direction === 'row-reverse' || (props.row && props.reverse),
76
+ 'flex-col-reverse': props.direction === 'col-reverse' || (props.col && props.reverse),
76
77
 
77
- 'flex-row': props.direction === 'row' || props.row,
78
- 'flex-col': props.direction === 'col' || props.col,
79
- 'flex-row-reverse': props.direction === 'row-reverse' || (props.row && props.reverse),
80
- 'flex-col-reverse': props.direction === 'col-reverse' || (props.col && props.reverse),
78
+ 'flex-wrap': props.wrap,
79
+ 'flex-wrap-reverse': props.wrapReverse,
80
+ 'flex-nowrap': props.nowrap,
81
+ },
82
+ ])
81
83
 
82
- 'flex-wrap': props.wrap,
83
- 'flex-wrap-reverse': props.wrapReverse,
84
- 'flex-nowrap': props.nowrap,
85
- }"
86
- >
87
- <slot />
88
- </component>
89
- </template>
84
+ return () => h(props.is as any, { ...attrs, class: classes.value }, slots.default?.())
85
+ },
86
+ })
87
+ </script>
@@ -1,62 +1,56 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
1
+ <script lang="ts">
2
+ import { computed, defineComponent, h } from 'vue'
3
3
 
4
- const props = withDefaults(
5
- defineProps<{
6
- is?: any
7
- join?: boolean
4
+ export default defineComponent({
5
+ props: {
6
+ is: { type: [String, Object], default: 'div' },
7
+ join: Boolean,
8
8
 
9
9
  // https://tailwindcss.com/docs/flex
10
- flex?: boolean
11
- flex1?: boolean
12
- flexAuto?: boolean
13
- flexInitial?: boolean
14
- none?: boolean
10
+ flex: { type: Boolean, default: false },
11
+ flex1: Boolean,
12
+ flexAuto: Boolean,
13
+ flexInitial: Boolean,
14
+ none: Boolean,
15
15
 
16
- grow?: boolean
16
+ grow: Boolean,
17
17
 
18
18
  // https://tailwindcss.com/docs/flex-direction
19
- direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse'
20
- row?: boolean
21
- col?: boolean
22
- reverse?: boolean
19
+ direction: String as () => 'row' | 'col' | 'row-reverse' | 'col-reverse',
20
+ row: Boolean,
21
+ col: Boolean,
22
+ reverse: Boolean,
23
23
 
24
24
  // https://tailwindcss.com/docs/flex-wrap
25
- wrap?: boolean
26
- nowrap?: boolean
27
- wrapReverse?: boolean
28
- }>(),
29
- {
30
- is: 'div',
31
- flex: false,
25
+ wrap: Boolean,
26
+ nowrap: Boolean,
27
+ wrapReverse: Boolean,
28
+ },
29
+ setup(props, { slots }) {
30
+ const classes = computed(() => [
31
+ 'flex',
32
+ {
33
+ 'join-item': props.join,
34
+
35
+ 'flex-1': props.flex1,
36
+ 'flex-auto': props.flexAuto,
37
+ 'flex-initial': props.flexInitial,
38
+ 'flex-none': props.none,
39
+
40
+ 'flex-grow': props.grow,
41
+
42
+ 'flex-row': props.direction === 'row' || props.row,
43
+ 'flex-col': props.direction === 'col' || props.col,
44
+ 'flex-row-reverse': props.direction === 'row-reverse' || (props.row && props.reverse),
45
+ 'flex-col-reverse': props.direction === 'col-reverse' || (props.col && props.reverse),
46
+
47
+ 'flex-wrap': props.wrap,
48
+ 'flex-wrap-reverse': props.wrapReverse,
49
+ 'flex-nowrap': props.nowrap,
50
+ },
51
+ ])
52
+
53
+ return () => h(props.is as any, { class: classes.value }, slots.default?.())
32
54
  },
33
- )
34
-
35
- const classes = computed(() => {
36
- return {
37
- 'join-item': props.join,
38
-
39
- 'flex-1': props.flex1,
40
- 'flex-auto': props.flexAuto,
41
- 'flex-initial': props.flexInitial,
42
- 'flex-none': props.none,
43
-
44
- 'flex-grow': props.grow,
45
-
46
- 'flex-row': props.direction === 'row' || props.row,
47
- 'flex-col': props.direction === 'col' || props.col,
48
- 'flex-row-reverse': props.direction === 'row-reverse' || (props.row && props.reverse),
49
- 'flex-col-reverse': props.direction === 'col-reverse' || (props.col && props.reverse),
50
-
51
- 'flex-wrap': props.wrap,
52
- 'flex-wrap-reverse': props.wrapReverse,
53
- 'flex-nowrap': props.nowrap,
54
- }
55
55
  })
56
56
  </script>
57
-
58
- <template>
59
- <component :is="is" class="flex" :class="classes">
60
- <slot />
61
- </component>
62
- </template>
@@ -1,20 +1,13 @@
1
- <script setup lang="ts">
2
- defineOptions({
3
- inheritAttrs: false,
4
- })
1
+ <script lang="ts">
2
+ import { defineComponent, h } from 'vue'
5
3
 
6
- withDefaults(
7
- defineProps<{
8
- is?: string
9
- }>(),
10
- {
11
- is: 'div',
4
+ export default defineComponent({
5
+ inheritAttrs: false,
6
+ props: {
7
+ is: { type: [String, Object], default: 'div' },
12
8
  },
13
- )
9
+ setup(props, { slots, attrs }) {
10
+ return () => h(props.is as any, { ...attrs, class: 'indicator' }, slots.default?.())
11
+ },
12
+ })
14
13
  </script>
15
-
16
- <template>
17
- <component :is="is" v-bind="$attrs" class="indicator">
18
- <slot />
19
- </component>
20
- </template>
@@ -1,43 +1,36 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
1
+ <script lang="ts">
2
+ import { computed, defineComponent, h } from 'vue'
3
3
 
4
- defineOptions({
4
+ export default defineComponent({
5
5
  inheritAttrs: false,
6
- })
7
-
8
- const props = withDefaults(
9
- defineProps<{
10
- is?: string
6
+ props: {
7
+ is: { type: [String, Object], default: 'div' },
11
8
 
12
- align?: 'start' | 'center' | 'end'
13
- start?: boolean
14
- center?: boolean
15
- end?: boolean
9
+ align: String as () => 'start' | 'center' | 'end',
10
+ start: Boolean,
11
+ center: Boolean,
12
+ end: Boolean,
16
13
 
17
- vAlign?: 'top' | 'middle' | 'bottom'
18
- top?: boolean
19
- middle?: boolean
20
- bottom?: boolean
21
- }>(),
22
- {
23
- is: 'div',
14
+ vAlign: String as () => 'top' | 'middle' | 'bottom',
15
+ top: Boolean,
16
+ middle: Boolean,
17
+ bottom: Boolean,
24
18
  },
25
- )
26
- const classes = computed(() => {
27
- return {
28
- 'indicator-start': props.start || props.align === 'start',
29
- 'indicator-center': props.center || props.align === 'center',
30
- 'indicator-end': props.end || props.align === 'end',
19
+ setup(props, { slots, attrs }) {
20
+ const classes = computed(() => [
21
+ 'indicator-item',
22
+ {
23
+ 'indicator-start': props.start || props.align === 'start',
24
+ 'indicator-center': props.center || props.align === 'center',
25
+ 'indicator-end': props.end || props.align === 'end',
26
+
27
+ 'indicator-top': props.top || props.vAlign === 'top',
28
+ 'indicator-middle': props.middle || props.vAlign === 'middle',
29
+ 'indicator-bottom': props.bottom || props.vAlign === 'bottom',
30
+ },
31
+ ])
31
32
 
32
- 'indicator-top': props.top || props.vAlign === 'top',
33
- 'indicator-middle': props.middle || props.vAlign === 'middle',
34
- 'indicator-bottom': props.bottom || props.vAlign === 'bottom',
35
- }
33
+ return () => h(props.is as any, { ...attrs, class: classes.value }, slots.default?.())
34
+ },
36
35
  })
37
36
  </script>
38
-
39
- <template>
40
- <component :is="is" v-bind="$attrs" class="indicator-item" :class="classes">
41
- <slot />
42
- </component>
43
- </template>
@@ -1,12 +1,13 @@
1
- <script setup lang="ts">
2
- const { is = 'div', glass = false } = defineProps<{
3
- is?: any
4
- glass?: boolean
5
- }>()
6
- </script>
1
+ <script lang="ts">
2
+ import { defineComponent, h } from 'vue'
7
3
 
8
- <template>
9
- <component :is="is" class="navbar" :class="{ glass }">
10
- <slot />
11
- </component>
12
- </template>
4
+ export default defineComponent({
5
+ props: {
6
+ is: { type: [String, Object], default: 'div' },
7
+ glass: { type: Boolean, default: false },
8
+ },
9
+ setup(props, { slots }) {
10
+ return () => h(props.is as any, { class: ['navbar', { glass: props.glass }] }, slots.default?.())
11
+ },
12
+ })
13
+ </script>
@@ -1,11 +1,12 @@
1
- <script setup lang="ts">
2
- const { is = 'div' } = defineProps<{
3
- is?: any
4
- }>()
5
- </script>
1
+ <script lang="ts">
2
+ import { defineComponent, h } from 'vue'
6
3
 
7
- <template>
8
- <component :is="is" class="navbar-center">
9
- <slot />
10
- </component>
11
- </template>
4
+ export default defineComponent({
5
+ props: {
6
+ is: { type: [String, Object], default: 'div' },
7
+ },
8
+ setup(props, { slots }) {
9
+ return () => h(props.is as any, { class: 'navbar-center' }, slots.default?.())
10
+ },
11
+ })
12
+ </script>
@@ -1,11 +1,12 @@
1
- <script setup lang="ts">
2
- const { is = 'div' } = defineProps<{
3
- is?: any
4
- }>()
5
- </script>
1
+ <script lang="ts">
2
+ import { defineComponent, h } from 'vue'
6
3
 
7
- <template>
8
- <component :is="is" class="navbar-end">
9
- <slot />
10
- </component>
11
- </template>
4
+ export default defineComponent({
5
+ props: {
6
+ is: { type: [String, Object], default: 'div' },
7
+ },
8
+ setup(props, { slots }) {
9
+ return () => h(props.is as any, { class: 'navbar-end' }, slots.default?.())
10
+ },
11
+ })
12
+ </script>
@@ -1,11 +1,12 @@
1
- <script setup lang="ts">
2
- const { is = 'div' } = defineProps<{
3
- is?: any
4
- }>()
5
- </script>
1
+ <script lang="ts">
2
+ import { defineComponent, h } from 'vue'
6
3
 
7
- <template>
8
- <component :is="is" class="navbar-start">
9
- <slot />
10
- </component>
11
- </template>
4
+ export default defineComponent({
5
+ props: {
6
+ is: { type: [String, Object], default: 'div' },
7
+ },
8
+ setup(props, { slots }) {
9
+ return () => h(props.is as any, { class: 'navbar-start' }, slots.default?.())
10
+ },
11
+ })
12
+ </script>
@@ -1,11 +1,12 @@
1
- <script setup lang="ts">
2
- const props = defineProps<{
3
- is?: any
4
- }>()
5
- </script>
1
+ <script lang="ts">
2
+ import { defineComponent, h } from 'vue'
6
3
 
7
- <template>
8
- <component :is="props.is || 'span'" class="skeleton skeleton-text">
9
- <slot />
10
- </component>
11
- </template>
4
+ export default defineComponent({
5
+ props: {
6
+ is: { type: [String, Object], default: 'span' },
7
+ },
8
+ setup(props, { slots }) {
9
+ return () => h(props.is as any, { class: 'skeleton skeleton-text' }, slots.default?.())
10
+ },
11
+ })
12
+ </script>
@@ -1,30 +1,28 @@
1
- <script setup lang="ts">
2
- defineOptions({
1
+ <script lang="ts">
2
+ import { computed, defineComponent, h } from 'vue'
3
+
4
+ export default defineComponent({
3
5
  inheritAttrs: false,
4
- })
6
+ props: {
7
+ is: { type: [String, Object], default: 'div' },
8
+ direction: String as () => 'top' | 'end' | 'bottom' | 'start',
9
+ top: Boolean,
10
+ end: Boolean,
11
+ bottom: Boolean,
12
+ start: Boolean,
13
+ },
14
+ setup(props, { slots, attrs }) {
15
+ const classes = computed(() => [
16
+ 'stack',
17
+ {
18
+ 'stack-top': props.top || props.direction === 'top',
19
+ 'stack-end': props.end || props.direction === 'end',
20
+ 'stack-bottom': props.bottom || props.direction === 'bottom',
21
+ 'stack-start': props.start || props.direction === 'start',
22
+ },
23
+ ])
5
24
 
6
- const { is = 'div' } = defineProps<{
7
- is?: string
8
- direction?: 'top' | 'end' | 'bottom' | 'start'
9
- top?: boolean
10
- end?: boolean
11
- bottom?: boolean
12
- start?: boolean
13
- }>()
25
+ return () => h(props.is as any, { ...attrs, class: classes.value }, slots.default?.())
26
+ },
27
+ })
14
28
  </script>
15
-
16
- <template>
17
- <component
18
- :is="is"
19
- v-bind="$attrs"
20
- class="stack"
21
- :class="{
22
- 'stack-top': top || direction === 'top',
23
- 'stack-end': end || direction === 'end',
24
- 'stack-bottom': bottom || direction === 'bottom',
25
- 'stack-start': start || direction === 'start',
26
- }"
27
- >
28
- <slot />
29
- </component>
30
- </template>
@@ -1,52 +1,53 @@
1
- <script setup lang="ts">
2
- import { computed, inject, resolveDynamicComponent } from 'vue'
1
+ <script lang="ts">
2
+ import { computed, defineComponent, h, inject } from 'vue'
3
3
 
4
- defineOptions({
4
+ export default defineComponent({
5
5
  inheritAttrs: false,
6
- })
6
+ props: {
7
+ is: { type: [String, Object], default: 'label' },
8
+ name: String,
9
+ active: Boolean,
10
+ disabled: Boolean,
11
+ },
12
+ setup(props, { slots, attrs }) {
13
+ const tabManager: any = inject('tabManager')
14
+ if (!tabManager.currentTab.value) {
15
+ tabManager.currentTab.value = props.name
16
+ }
7
17
 
8
- const {
9
- is = 'label',
10
- name,
11
- ...props
12
- } = defineProps<{
13
- is?: string
14
- name?: string
15
- active?: boolean
16
- disabled?: boolean
17
- }>()
18
+ const classes = computed(() => [
19
+ 'tab',
20
+ {
21
+ 'tab-active': props.active || tabManager.currentTab.value === props.name,
22
+ 'tab-disabled': props.disabled,
23
+ },
24
+ ])
18
25
 
19
- const resolvedComponent = computed(() => {
20
- if (is === 'label') return 'label'
21
- return resolveDynamicComponent(is)
26
+ return () =>
27
+ h(
28
+ props.is as any,
29
+ {
30
+ ...attrs,
31
+ class: classes.value,
32
+ onKeypress: (e: KeyboardEvent) => {
33
+ if (e.key === 'Enter') {
34
+ tabManager.currentTab.value = props.name
35
+ }
36
+ },
37
+ },
38
+ [
39
+ h('input', {
40
+ type: 'radio',
41
+ name: tabManager.name,
42
+ value: props.name,
43
+ checked: tabManager.currentTab.value === props.name,
44
+ onChange: () => {
45
+ tabManager.currentTab.value = props.name
46
+ },
47
+ }),
48
+ ...(slots.default ? slots.default() : [h('span', props.name)]),
49
+ ],
50
+ )
51
+ },
22
52
  })
23
-
24
- const tabManager: any = inject('tabManager')
25
- if (!tabManager.currentTab.value) {
26
- tabManager.currentTab.value = name
27
- }
28
53
  </script>
29
-
30
- <template>
31
- <component
32
- :is="resolvedComponent"
33
- v-bind="$attrs"
34
- class="tab"
35
- :class="{
36
- 'tab-active': props.active || tabManager.currentTab.value === name,
37
- 'tab-disabled': props.disabled,
38
- }"
39
- @keypress.enter="() => (tabManager.currentTab.value = name)"
40
- >
41
- <input
42
- type="radio"
43
- :name="tabManager.name"
44
- :value="name"
45
- :checked="tabManager.currentTab.value === name"
46
- @change="() => (tabManager.currentTab.value = name)"
47
- />
48
-
49
- <slot v-if="$slots.default" />
50
- <span v-else>{{ name }}</span>
51
- </component>
52
- </template>