daisy-ui-kit 3.0.12 → 5.0.0-pre.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.
Files changed (213) hide show
  1. package/README.md +62 -14
  2. package/app/components/Accordion.vue +29 -0
  3. package/app/components/Alert.vue +36 -0
  4. package/app/components/Avatar.vue +131 -0
  5. package/app/components/AvatarGroup.vue +22 -0
  6. package/app/components/Badge.vue +67 -0
  7. package/app/components/Button.vue +135 -0
  8. package/app/components/Calendar.vue +89 -0
  9. package/app/components/CalendarInput.vue +174 -0
  10. package/app/components/CalendarSkeleton.vue +87 -0
  11. package/app/components/Card.vue +46 -0
  12. package/{components → app/components}/CardActions.vue +2 -5
  13. package/{components → app/components}/CardBody.vue +2 -5
  14. package/{components → app/components}/CardTitle.vue +1 -6
  15. package/app/components/Carousel.vue +24 -0
  16. package/app/components/Chat.vue +26 -0
  17. package/app/components/ChatBubble.vue +31 -0
  18. package/app/components/Checkbox.vue +51 -0
  19. package/app/components/Collapse.vue +75 -0
  20. package/app/components/CollapseTitle.vue +15 -0
  21. package/{components → app/components}/Countdown.vue +1 -1
  22. package/app/components/CountdownTimers.vue +69 -0
  23. package/app/components/Counter.vue +21 -0
  24. package/app/components/DaisyLink.vue +52 -0
  25. package/app/components/Diff.vue +11 -0
  26. package/app/components/Divider.vue +43 -0
  27. package/app/components/Dock.vue +60 -0
  28. package/app/components/DockItem.vue +26 -0
  29. package/app/components/DockLabel.vue +5 -0
  30. package/{components → app/components}/Drawer.vue +17 -12
  31. package/{components → app/components}/DrawerContent.vue +8 -5
  32. package/{components → app/components}/DrawerSide.vue +8 -5
  33. package/app/components/Dropdown.vue +106 -0
  34. package/app/components/DropdownButton.vue +23 -0
  35. package/app/components/DropdownContent.vue +127 -0
  36. package/{components → app/components}/DropdownTarget.vue +9 -2
  37. package/app/components/Fab.vue +16 -0
  38. package/app/components/FabClose.vue +18 -0
  39. package/app/components/FabMainAction.vue +5 -0
  40. package/app/components/FabTrigger.vue +117 -0
  41. package/app/components/Fieldset.vue +16 -0
  42. package/app/components/FileInput.vue +53 -0
  43. package/app/components/Filter.vue +125 -0
  44. package/app/components/Flex.vue +84 -0
  45. package/{components → app/components}/FlexItem.vue +30 -27
  46. package/app/components/Footer.vue +31 -0
  47. package/{components → app/components}/FooterTitle.vue +8 -5
  48. package/app/components/FormControl.vue +5 -0
  49. package/{components → app/components}/Hero.vue +8 -5
  50. package/{components → app/components}/HeroContent.vue +8 -5
  51. package/app/components/Hover3D.vue +22 -0
  52. package/app/components/HoverGallery.vue +11 -0
  53. package/{components → app/components}/Indicator.vue +8 -5
  54. package/{components → app/components}/IndicatorItem.vue +16 -13
  55. package/app/components/Input.vue +126 -0
  56. package/app/components/Kbd.vue +25 -0
  57. package/app/components/Label.vue +100 -0
  58. package/{components/CollapseTitle.vue → app/components/List.vue} +1 -1
  59. package/{components/FormControl.vue → app/components/ListColGrow.vue} +1 -1
  60. package/app/components/ListColWrap.vue +5 -0
  61. package/{components/Stat.vue → app/components/ListRow.vue} +1 -1
  62. package/app/components/LoadingBall.vue +42 -0
  63. package/app/components/LoadingBars.vue +42 -0
  64. package/app/components/LoadingDots.vue +42 -0
  65. package/app/components/LoadingInfinity.vue +42 -0
  66. package/app/components/LoadingRing.vue +42 -0
  67. package/app/components/LoadingSpinner.vue +42 -0
  68. package/app/components/Mask.vue +49 -0
  69. package/app/components/Menu.vue +30 -0
  70. package/app/components/MenuExpand.vue +94 -0
  71. package/app/components/MenuExpandToggle.vue +20 -0
  72. package/{components → app/components}/MenuItem.vue +7 -6
  73. package/app/components/MockupPhone.vue +14 -0
  74. package/{components → app/components}/Modal.vue +28 -13
  75. package/app/components/NavButton.vue +12 -0
  76. package/{components → app/components}/Navbar.vue +3 -5
  77. package/{components → app/components}/NavbarCenter.vue +3 -5
  78. package/{components → app/components}/NavbarEnd.vue +3 -5
  79. package/{components → app/components}/NavbarStart.vue +3 -5
  80. package/app/components/Progress.vue +46 -0
  81. package/{components → app/components}/Prose.vue +8 -3
  82. package/app/components/RadialProgress.vue +36 -0
  83. package/app/components/Radio.vue +69 -0
  84. package/{components → app/components}/RadioGroup.vue +2 -1
  85. package/app/components/Range.vue +61 -0
  86. package/app/components/RangeMeasure.vue +87 -0
  87. package/{components → app/components}/RangeMeasureTick.vue +9 -14
  88. package/app/components/Rating.vue +197 -0
  89. package/app/components/Select.vue +101 -0
  90. package/app/components/Skeleton.vue +5 -0
  91. package/app/components/SkeletonText.vue +11 -0
  92. package/app/components/Stack.vue +25 -0
  93. package/app/components/Stat.vue +19 -0
  94. package/app/components/Status.vue +43 -0
  95. package/app/components/Step.vue +34 -0
  96. package/app/components/StepIcon.vue +5 -0
  97. package/app/components/Steps.vue +23 -0
  98. package/app/components/Swap.vue +56 -0
  99. package/app/components/Tab.vue +51 -0
  100. package/{components → app/components}/TabContent.vue +10 -10
  101. package/app/components/Table.vue +32 -0
  102. package/app/components/Tabs.vue +53 -0
  103. package/app/components/Text.vue +162 -0
  104. package/app/components/TextArea.vue +64 -0
  105. package/app/components/TextRotate.vue +24 -0
  106. package/app/components/ThemeController.vue +45 -0
  107. package/app/components/ThemeProvider.vue +302 -0
  108. package/app/components/ThemeTile.vue +50 -0
  109. package/app/components/Timeline.vue +22 -0
  110. package/app/components/TimelineEnd.vue +14 -0
  111. package/app/components/TimelineItem.vue +5 -0
  112. package/app/components/TimelineLine.vue +29 -0
  113. package/app/components/TimelineMiddle.vue +5 -0
  114. package/app/components/TimelineStart.vue +14 -0
  115. package/app/components/Toast.vue +67 -0
  116. package/app/components/Toggle.vue +60 -0
  117. package/app/components/Tooltip.vue +48 -0
  118. package/app/components/TooltipContent.vue +5 -0
  119. package/app/components/ValidatorHint.vue +5 -0
  120. package/{utils → app/utils}/drawer-utils.ts +15 -13
  121. package/app/utils/position-area.ts +41 -0
  122. package/nuxt.js +7 -1
  123. package/package.json +60 -61
  124. package/components/Accordion.vue +0 -29
  125. package/components/Alert.vue +0 -25
  126. package/components/Artboard.vue +0 -33
  127. package/components/Avatar.vue +0 -70
  128. package/components/AvatarGroup.vue +0 -19
  129. package/components/Badge.vue +0 -50
  130. package/components/BottomNav.vue +0 -25
  131. package/components/Button.vue +0 -111
  132. package/components/Card.vue +0 -30
  133. package/components/Carousel.vue +0 -25
  134. package/components/Chat.vue +0 -27
  135. package/components/ChatBubble.vue +0 -34
  136. package/components/Checkbox.vue +0 -55
  137. package/components/Code.vue +0 -92
  138. package/components/Collapse.vue +0 -54
  139. package/components/CountdownTimers.vue +0 -70
  140. package/components/Counter.vue +0 -14
  141. package/components/Divider.vue +0 -24
  142. package/components/Dropdown.vue +0 -95
  143. package/components/DropdownButton.vue +0 -16
  144. package/components/DropdownContent.vue +0 -56
  145. package/components/FileInput.vue +0 -59
  146. package/components/Flex.vue +0 -59
  147. package/components/Footer.vue +0 -24
  148. package/components/Kbd.vue +0 -25
  149. package/components/Label.vue +0 -15
  150. package/components/LabelText.vue +0 -15
  151. package/components/LabelTextAlt.vue +0 -15
  152. package/components/Link.vue +0 -40
  153. package/components/LoadingBall.vue +0 -43
  154. package/components/LoadingBars.vue +0 -43
  155. package/components/LoadingDots.vue +0 -43
  156. package/components/LoadingInfinity.vue +0 -43
  157. package/components/LoadingRing.vue +0 -43
  158. package/components/LoadingSpinner.vue +0 -43
  159. package/components/Mask.config.ts +0 -77
  160. package/components/Mask.vue +0 -14
  161. package/components/Menu.vue +0 -35
  162. package/components/MenuExpand.vue +0 -79
  163. package/components/MenuExpandToggle.vue +0 -13
  164. package/components/MockupPhone.vue +0 -8
  165. package/components/NavButton.vue +0 -20
  166. package/components/Progress.vue +0 -42
  167. package/components/RadialProgress.vue +0 -41
  168. package/components/Radio.vue +0 -76
  169. package/components/Range.vue +0 -60
  170. package/components/RangeMeasure.vue +0 -83
  171. package/components/Rating.vue +0 -167
  172. package/components/Select.vue +0 -100
  173. package/components/Stack.vue +0 -13
  174. package/components/Step.vue +0 -36
  175. package/components/Steps.vue +0 -21
  176. package/components/Swap.vue +0 -58
  177. package/components/Tab.vue +0 -48
  178. package/components/Tabs.vue +0 -77
  179. package/components/TabsManager.vue +0 -38
  180. package/components/Text.vue +0 -142
  181. package/components/TextArea.vue +0 -64
  182. package/components/TextInput.vue +0 -66
  183. package/components/Toast.vue +0 -31
  184. package/components/Toggle.vue +0 -59
  185. package/components/Tooltip.vue +0 -47
  186. package/index.ts +0 -108
  187. package/utils/-utils.ts +0 -41
  188. package/utils/Button.config.ts +0 -26
  189. package/utils/fixtures.ts +0 -62
  190. package/utils/types.ts +0 -7
  191. /package/{components → app/components}/Breadcrumbs.vue +0 -0
  192. /package/{components → app/components}/CarouselItem.vue +0 -0
  193. /package/{components → app/components}/ChatFooter.vue +0 -0
  194. /package/{components → app/components}/ChatHeader.vue +0 -0
  195. /package/{components → app/components}/ChatImage.vue +0 -0
  196. /package/{components → app/components}/CollapseContent.vue +0 -0
  197. /package/{components → app/components}/Crumb.vue +0 -0
  198. /package/{components → app/components}/HeroOverlay.vue +0 -0
  199. /package/{components → app/components}/Join.vue +0 -0
  200. /package/{components → app/components}/MenuTitle.vue +0 -0
  201. /package/{components → app/components}/MockupBrowser.vue +0 -0
  202. /package/{components → app/components}/MockupBrowserToolbar.vue +0 -0
  203. /package/{components → app/components}/MockupCode.vue +0 -0
  204. /package/{components → app/components}/MockupWindow.vue +0 -0
  205. /package/{components → app/components}/ModalAction.vue +0 -0
  206. /package/{components → app/components}/ModalBox.vue +0 -0
  207. /package/{components → app/components}/StatActions.vue +0 -0
  208. /package/{components → app/components}/StatDesc.vue +0 -0
  209. /package/{components → app/components}/StatFigure.vue +0 -0
  210. /package/{components → app/components}/StatTitle.vue +0 -0
  211. /package/{components → app/components}/StatValue.vue +0 -0
  212. /package/{components → app/components}/Stats.vue +0 -0
  213. /package/{utils → app/utils}/random-string.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
- import { computed, watch } from 'vue'
3
2
  import { useTimeoutFn } from '@vueuse/core'
3
+ import { computed, ref, watch } from 'vue'
4
4
 
5
5
  const props = defineProps<{
6
6
  tick: number
@@ -18,12 +18,11 @@ const { isPending, start, stop } = useTimeoutFn(() => {
18
18
  }, 1000)
19
19
  watch(
20
20
  () => props.modelValue,
21
- (val) => {
21
+ val => {
22
22
  if (val) {
23
23
  start()
24
24
  hasChanged.value = true
25
- }
26
- else if (!isPending.value) {
25
+ } else if (!isPending.value) {
27
26
  stop()
28
27
  }
29
28
  },
@@ -31,15 +30,6 @@ watch(
31
30
 
32
31
  // eslint-disable-next-line eqeqeq
33
32
  const isCurrent = computed(() => props.modelValue == props.tick)
34
-
35
- const classes = computed(() => {
36
- return {
37
- 'font-bold': isCurrent.value,
38
- 'opacity-50': props.disabled,
39
- 'cursor-pointer': !props.disabled,
40
- 'cursor-not-allowed': props.disabled,
41
- }
42
- })
43
33
  </script>
44
34
 
45
35
  <template>
@@ -48,7 +38,12 @@ const classes = computed(() => {
48
38
  xs
49
39
  :ghost="!isCurrent"
50
40
  circle
51
- :class="classes"
41
+ :class="{
42
+ 'font-bold': isCurrent,
43
+ 'opacity-50': props.disabled,
44
+ 'cursor-pointer': !props.disabled,
45
+ 'cursor-not-allowed': props.disabled,
46
+ }"
52
47
  :disabled="disabled"
53
48
  @click="$emit('update:modelValue', tick)"
54
49
  >
@@ -0,0 +1,197 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+
4
+ const props = withDefaults(
5
+ defineProps<{
6
+ modelValue?: number | string
7
+ count?: number | string
8
+ half?: boolean
9
+
10
+ disabled?: boolean
11
+
12
+ color?: string
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
+
22
+ bg?: string
23
+
24
+ shape?: string
25
+ squircle?: boolean
26
+ heart?: boolean
27
+ hexagon?: boolean
28
+ hexagon2?: boolean
29
+ decagon?: boolean
30
+ pentagon?: boolean
31
+ diamond?: boolean
32
+ square?: boolean
33
+ circle?: boolean
34
+
35
+ star?: boolean
36
+ star2?: boolean
37
+ triangle?: boolean
38
+ triangle2?: boolean
39
+ triangle3?: boolean
40
+ triangle4?: boolean
41
+
42
+ size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
43
+ xl?: boolean
44
+ lg?: boolean
45
+ md?: boolean
46
+ sm?: boolean
47
+ xs?: boolean
48
+ }>(),
49
+ {
50
+ count: 5,
51
+ },
52
+ )
53
+ const emit = defineEmits(['update:modelValue'])
54
+
55
+ const max = computed(() => Number.parseInt(props.count as string))
56
+
57
+ function handleValue(digit: number, half = false) {
58
+ if (props.disabled) {
59
+ return
60
+ }
61
+
62
+ if (props.half) {
63
+ emit('update:modelValue', half ? digit - 0.5 : digit)
64
+ return
65
+ }
66
+
67
+ emit('update:modelValue', digit)
68
+ }
69
+
70
+ // Check if any shape prop is set
71
+ const hasShape = computed(() => {
72
+ return (
73
+ props.shape ||
74
+ props.squircle ||
75
+ props.heart ||
76
+ props.hexagon ||
77
+ props.hexagon2 ||
78
+ props.decagon ||
79
+ props.pentagon ||
80
+ props.diamond ||
81
+ props.square ||
82
+ props.circle ||
83
+ props.star ||
84
+ props.star2 ||
85
+ props.triangle ||
86
+ props.triangle2 ||
87
+ props.triangle3 ||
88
+ props.triangle4
89
+ )
90
+ })
91
+ </script>
92
+
93
+ <template>
94
+ <div
95
+ class="rating"
96
+ :class="{
97
+ 'rating-half': half,
98
+ 'rating-xl': xl || size === 'xl',
99
+ 'rating-lg': lg || size === 'lg',
100
+ 'rating-md': md || size === 'md',
101
+ 'rating-sm': sm || size === 'sm',
102
+ 'rating-xs': xs || size === 'xs',
103
+ 'opacity-60': disabled,
104
+ 'cursor-not-allowed': disabled,
105
+ }"
106
+ >
107
+ <input
108
+ type="radio"
109
+ :value="0"
110
+ class="rating-hidden"
111
+ :checked="modelValue === 0"
112
+ @change="$emit('update:modelValue', 0)"
113
+ />
114
+ <template v-for="digit in max" :key="digit">
115
+ <input
116
+ type="radio"
117
+ :value="half ? digit - 0.5 : digit"
118
+ :disabled="disabled"
119
+ class="mask"
120
+ :class="[
121
+ bg,
122
+ { 'mask-half-1': half },
123
+ { 'cursor-not-allowed opacity-50': disabled },
124
+
125
+ // Color classes
126
+ { 'bg-neutral': neutral || color === 'neutral' },
127
+ { 'bg-primary': primary || color === 'primary' },
128
+ { 'bg-secondary': secondary || color === 'secondary' },
129
+ { 'bg-accent': accent || color === 'accent' },
130
+ { 'bg-info': info || color === 'info' },
131
+ { 'bg-success': success || color === 'success' },
132
+ { 'bg-warning': warning || color === 'warning' },
133
+ { 'bg-error': error || color === 'error' },
134
+
135
+ // Shape classes
136
+ { 'mask-squircle': squircle || shape === 'squircle' },
137
+ { 'mask-heart': heart || shape === 'heart' },
138
+ { 'mask-hexagon': hexagon || shape === 'hexagon' },
139
+ { 'mask-hexagon-2': hexagon2 || shape === 'hexagon-2' },
140
+ { 'mask-decagon': decagon || shape === 'decagon' },
141
+ { 'mask-pentagon': pentagon || shape === 'pentagon' },
142
+ { 'mask-diamond': diamond || shape === 'diamond' },
143
+ { 'mask-square': square || shape === 'square' },
144
+ { 'mask-circle': circle || shape === 'circle' },
145
+ { 'mask-star': star || shape === 'star' },
146
+ { 'mask-star-2': star2 || shape === 'star-2' || !hasShape },
147
+ { 'mask-triangle': triangle || shape === 'triangle' },
148
+ { 'mask-triangle-2': triangle2 || shape === 'triangle-2' },
149
+ { 'mask-triangle-3': triangle3 || shape === 'triangle-3' },
150
+ { 'mask-triangle-4': triangle4 || shape === 'triangle-4' },
151
+ ]"
152
+ :checked="half ? modelValue === digit - 0.5 : modelValue === digit"
153
+ @change="() => handleValue(digit, true)"
154
+ />
155
+ <input
156
+ v-if="half"
157
+ type="radio"
158
+ :value="digit"
159
+ class="mask mask-half-2"
160
+ :disabled="disabled"
161
+ :class="[
162
+ bg,
163
+ { 'cursor-not-allowed opacity-50': disabled },
164
+
165
+ // Color classes
166
+ { 'bg-neutral': neutral || color === 'neutral' },
167
+ { 'bg-primary': primary || color === 'primary' },
168
+ { 'bg-secondary': secondary || color === 'secondary' },
169
+ { 'bg-accent': accent || color === 'accent' },
170
+ { 'bg-info': info || color === 'info' },
171
+ { 'bg-success': success || color === 'success' },
172
+ { 'bg-warning': warning || color === 'warning' },
173
+ { 'bg-error': error || color === 'error' },
174
+
175
+ // Shape classes
176
+ { 'mask-squircle': squircle || shape === 'squircle' },
177
+ { 'mask-heart': heart || shape === 'heart' },
178
+ { 'mask-hexagon': hexagon || shape === 'hexagon' },
179
+ { 'mask-hexagon-2': hexagon2 || shape === 'hexagon-2' },
180
+ { 'mask-decagon': decagon || shape === 'decagon' },
181
+ { 'mask-pentagon': pentagon || shape === 'pentagon' },
182
+ { 'mask-diamond': diamond || shape === 'diamond' },
183
+ { 'mask-square': square || shape === 'square' },
184
+ { 'mask-circle': circle || shape === 'circle' },
185
+ { 'mask-star': star || shape === 'star' },
186
+ { 'mask-star-2': star2 || shape === 'star-2' || !hasShape },
187
+ { 'mask-triangle': triangle || shape === 'triangle' },
188
+ { 'mask-triangle-2': triangle2 || shape === 'triangle-2' },
189
+ { 'mask-triangle-3': triangle3 || shape === 'triangle-3' },
190
+ { 'mask-triangle-4': triangle4 || shape === 'triangle-4' },
191
+ ]"
192
+ :checked="modelValue === digit"
193
+ @change="() => handleValue(digit)"
194
+ />
195
+ </template>
196
+ </div>
197
+ </template>
@@ -0,0 +1,101 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+
4
+ type Color = 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
5
+
6
+ const props = withDefaults(
7
+ defineProps<{
8
+ modelValue: any
9
+ options: Record<string, any>[] | any[]
10
+ value?: (val: any) => any
11
+ label?: (val: any) => any
12
+ resultAsObject?: boolean
13
+ join?: boolean
14
+
15
+ ghost?: boolean
16
+ disabled?: boolean
17
+ validator?: boolean
18
+ native?: boolean
19
+
20
+ color?: Color
21
+ neutral?: boolean
22
+ primary?: boolean
23
+ secondary?: boolean
24
+ accent?: boolean
25
+ info?: boolean
26
+ success?: boolean
27
+ warning?: boolean
28
+ error?: boolean
29
+
30
+ size?: 'xl' | 'lg' | 'md' | 'sm' | 'xs'
31
+ xl?: boolean
32
+ lg?: boolean
33
+ md?: boolean
34
+ sm?: boolean
35
+ xs?: boolean
36
+ }>(),
37
+ {
38
+ value: (val: any) => {
39
+ if (!val) {
40
+ return null
41
+ }
42
+
43
+ return typeof val === 'string' ? (val as string) : val?.value || val?.id || val?._id || val
44
+ },
45
+ label: (val: any) => (typeof val === 'string' ? (val as string) : val.label || val.name || val.title),
46
+ resultAsObject: false,
47
+ },
48
+ )
49
+ const emit = defineEmits(['update:modelValue'])
50
+
51
+ const computedVModel = computed({
52
+ get: () => {
53
+ if (props.resultAsObject && props.modelValue != null) {
54
+ return props.value(props.modelValue)
55
+ }
56
+
57
+ return props.modelValue
58
+ },
59
+ set: val => {
60
+ if (val === undefined) {
61
+ val = null
62
+ }
63
+ if (props.resultAsObject && val != null) {
64
+ val = props.options.find(o => props.value(o) === val)
65
+ }
66
+
67
+ emit('update:modelValue', val)
68
+ },
69
+ })
70
+ </script>
71
+
72
+ <template>
73
+ <select
74
+ v-model="computedVModel"
75
+ class="select"
76
+ :class="{
77
+ 'join-item': props.join,
78
+ validator: props.validator,
79
+ 'select-ghost': props.ghost,
80
+ 'appearance-none': props.native,
81
+ 'select-neutral': props.neutral || props.color === 'neutral',
82
+ 'select-primary': props.primary || props.color === 'primary',
83
+ 'select-secondary': props.secondary || props.color === 'secondary',
84
+ 'select-accent': props.accent || props.color === 'accent',
85
+ 'select-info': props.info || props.color === 'info',
86
+ 'select-success': props.success || props.color === 'success',
87
+ 'select-warning': props.warning || props.color === 'warning',
88
+ 'select-error': props.error || props.color === 'error',
89
+ 'select-xl': props.xl || props.size === 'xl',
90
+ 'select-lg': props.lg || props.size === 'lg',
91
+ 'select-md': props.md || props.size === 'md',
92
+ 'select-sm': props.sm || props.size === 'sm',
93
+ 'select-xs': props.xs || props.size === 'xs',
94
+ }"
95
+ :disabled="disabled"
96
+ >
97
+ <option v-for="option in options" :key="value(option)" :value="value(option)" :disabled="option.disabled">
98
+ {{ label(option) }}
99
+ </option>
100
+ </select>
101
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <div class="skeleton">
3
+ <slot />
4
+ </div>
5
+ </template>
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ is?: any
4
+ }>()
5
+ </script>
6
+
7
+ <template>
8
+ <component :is="props.is || 'span'" class="skeleton skeleton-text">
9
+ <slot />
10
+ </component>
11
+ </template>
@@ -0,0 +1,25 @@
1
+ <script setup lang="ts">
2
+ const { is = 'div' } = defineProps<{
3
+ is?: string
4
+ direction?: 'top' | 'end' | 'bottom' | 'start'
5
+ top?: boolean
6
+ end?: boolean
7
+ bottom?: boolean
8
+ start?: boolean
9
+ }>()
10
+ </script>
11
+
12
+ <template>
13
+ <component
14
+ :is="is"
15
+ class="stack"
16
+ :class="{
17
+ 'stack-top': top || direction === 'top',
18
+ 'stack-end': end || direction === 'end',
19
+ 'stack-bottom': bottom || direction === 'bottom',
20
+ 'stack-start': start || direction === 'start',
21
+ }"
22
+ >
23
+ <slot />
24
+ </component>
25
+ </template>
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ orientation?: 'vertical' | 'horizontal'
4
+ vertical?: boolean
5
+ horizontal?: boolean
6
+ }>()
7
+ </script>
8
+
9
+ <template>
10
+ <div
11
+ class="stat"
12
+ :class="{
13
+ 'stat-vertical': vertical || orientation === 'vertical',
14
+ 'stat-horizontal': horizontal || orientation === 'horizontal',
15
+ }"
16
+ >
17
+ <slot />
18
+ </div>
19
+ </template>
@@ -0,0 +1,43 @@
1
+ <script setup lang="ts">
2
+ defineProps<{
3
+ color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'
4
+ neutral?: boolean
5
+ primary?: boolean
6
+ secondary?: boolean
7
+ accent?: boolean
8
+ info?: boolean
9
+ success?: boolean
10
+ warning?: boolean
11
+ error?: boolean
12
+
13
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
14
+ xs?: boolean
15
+ sm?: boolean
16
+ md?: boolean
17
+ lg?: boolean
18
+ xl?: boolean
19
+ }>()
20
+ </script>
21
+
22
+ <template>
23
+ <span
24
+ class="status"
25
+ :class="[
26
+ neutral || color === 'neutral' ? 'status-neutral' : '',
27
+ primary || color === 'primary' ? 'status-primary' : '',
28
+ secondary || color === 'secondary' ? 'status-secondary' : '',
29
+ accent || color === 'accent' ? 'status-accent' : '',
30
+ info || color === 'info' ? 'status-info' : '',
31
+ success || color === 'success' ? 'status-success' : '',
32
+ warning || color === 'warning' ? 'status-warning' : '',
33
+ error || color === 'error' ? 'status-error' : '',
34
+ xs || size === 'xs' ? 'status-xs' : '',
35
+ sm || size === 'sm' ? 'status-sm' : '',
36
+ md || size === 'md' || (!xs && !sm && !lg && !xl && !size) ? 'status-md' : '',
37
+ lg || size === 'lg' ? 'status-lg' : '',
38
+ xl || size === 'xl' ? 'status-xl' : '',
39
+ ]"
40
+ >
41
+ <slot />
42
+ </span>
43
+ </template>
@@ -0,0 +1,34 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps<{
3
+ glyph?: string
4
+
5
+ color?: string
6
+ neutral?: boolean
7
+ primary?: boolean
8
+ secondary?: boolean
9
+ accent?: boolean
10
+ info?: boolean
11
+ success?: boolean
12
+ warning?: boolean
13
+ error?: boolean
14
+ }>()
15
+ </script>
16
+
17
+ <template>
18
+ <li
19
+ class="step"
20
+ :class="{
21
+ 'step-neutral': props.neutral || props.color === 'neutral',
22
+ 'step-primary': props.primary || props.color === 'primary',
23
+ 'step-secondary': props.secondary || props.color === 'secondary',
24
+ 'step-accent': props.accent || props.color === 'accent',
25
+ 'step-info': props.info || props.color === 'info',
26
+ 'step-success': props.success || props.color === 'success',
27
+ 'step-warning': props.warning || props.color === 'warning',
28
+ 'step-error': props.error || props.color === 'error',
29
+ }"
30
+ :data-content="glyph"
31
+ >
32
+ <slot />
33
+ </li>
34
+ </template>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <span class="step-icon">
3
+ <slot />
4
+ </span>
5
+ </template>
@@ -0,0 +1,23 @@
1
+ <script setup lang="ts">
2
+ const {
3
+ orientation,
4
+ vertical = false,
5
+ horizontal = false,
6
+ } = defineProps<{
7
+ orientation?: 'vertical' | 'horizontal'
8
+ vertical?: boolean
9
+ horizontal?: boolean
10
+ }>()
11
+ </script>
12
+
13
+ <template>
14
+ <ul
15
+ class="steps"
16
+ :class="{
17
+ 'steps-vertical': orientation === 'vertical' || vertical,
18
+ 'steps-horizontal': orientation === 'horizontal' || horizontal,
19
+ }"
20
+ >
21
+ <slot />
22
+ </ul>
23
+ </template>
@@ -0,0 +1,56 @@
1
+ <script setup lang="ts">
2
+ import { nextTick, ref, watch } from 'vue'
3
+
4
+ const props = defineProps<{
5
+ modelValue?: boolean | null
6
+ rotate?: boolean
7
+ flip?: boolean
8
+ }>()
9
+ const emit = defineEmits(['update:modelValue'])
10
+
11
+ const checkbox = ref<HTMLInputElement | null>(null)
12
+
13
+ // Keep the checkbox's indeterminate property in sync with modelValue
14
+ watch(
15
+ () => props.modelValue,
16
+ val => {
17
+ nextTick(() => {
18
+ if (checkbox.value) {
19
+ checkbox.value.indeterminate = val === null
20
+ }
21
+ })
22
+ },
23
+ { immediate: true },
24
+ )
25
+
26
+ function updateValue(event: Event) {
27
+ const input = event.target as HTMLInputElement
28
+ // If indeterminate, toggle to checked
29
+ if (props.modelValue === null) {
30
+ emit('update:modelValue', true)
31
+ } else {
32
+ emit('update:modelValue', input.checked)
33
+ }
34
+ }
35
+ </script>
36
+
37
+ <template>
38
+ <label
39
+ class="swap"
40
+ :class="{
41
+ 'swap-rotate': rotate,
42
+ 'swap-flip': flip,
43
+ }"
44
+ >
45
+ <input ref="checkbox" type="checkbox" :checked="modelValue === true" @change="updateValue" />
46
+ <div class="swap-indeterminate">
47
+ <slot name="indeterminate" />
48
+ </div>
49
+ <div class="swap-on">
50
+ <slot name="swap" />
51
+ </div>
52
+ <div class="swap-off">
53
+ <slot />
54
+ </div>
55
+ </label>
56
+ </template>
@@ -0,0 +1,51 @@
1
+ <script setup lang="ts">
2
+ import { computed, inject } from 'vue'
3
+
4
+ const {
5
+ is = 'label',
6
+ name,
7
+ ...props
8
+ } = defineProps<{
9
+ is?: string
10
+ name?: string
11
+ active?: boolean
12
+ disabled?: boolean
13
+ }>()
14
+
15
+ const NuxtLink = resolveComponent('NuxtLink')
16
+ const RouterLink = resolveComponent('RouterLink')
17
+
18
+ const resolvedComponent = computed(() => {
19
+ if (is === 'NuxtLink') return NuxtLink
20
+ if (is === 'RouterLink') return RouterLink
21
+ return is
22
+ })
23
+
24
+ const tabManager: any = inject('tabManager')
25
+ if (!tabManager.currentTab.value) {
26
+ tabManager.currentTab.value = name
27
+ }
28
+ </script>
29
+
30
+ <template>
31
+ <component
32
+ :is="resolvedComponent"
33
+ class="tab"
34
+ :class="{
35
+ 'tab-active': props.active || tabManager.currentTab.value === name,
36
+ 'tab-disabled': props.disabled,
37
+ }"
38
+ @keypress.enter="() => (tabManager.currentTab.value = name)"
39
+ >
40
+ <input
41
+ type="radio"
42
+ :name="tabManager.name"
43
+ :value="name"
44
+ :checked="tabManager.currentTab.value === name"
45
+ @change="() => (tabManager.currentTab.value = name)"
46
+ />
47
+
48
+ <slot v-if="$slots.default" />
49
+ <span v-else>{{ name }}</span>
50
+ </component>
51
+ </template>
@@ -1,25 +1,25 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, inject } from 'vue'
3
3
 
4
- const props = withDefaults(defineProps<{
4
+ const { is = 'div', name } = defineProps<{
5
5
  is?: any
6
6
  name: string
7
- }>(), {
8
- is: 'div',
9
- })
7
+ }>()
10
8
 
11
9
  const tabManager: any = inject('tabManager')
12
10
 
13
11
  const isCurrentTab = computed(() => {
14
- return tabManager.currentTab === props.name
12
+ return tabManager.currentTab.value === name
15
13
  })
16
14
 
17
- if (!tabManager.currentTab)
18
- tabManager.currentTab = props.name
15
+ if (!tabManager?.currentTab.value) {
16
+ tabManager.currentTab.value = name
17
+ }
19
18
 
20
- const existing = tabManager.tabs.find(t => t === props.name)
21
- if (!existing)
22
- tabManager.tabs.push(props.name)
19
+ const existing = tabManager?.tabs?.find((t: string) => t === name)
20
+ if (!existing) {
21
+ tabManager.tabs.push(name)
22
+ }
23
23
  </script>
24
24
 
25
25
  <template>