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,70 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import { makeMaskClasses, maskProps } from './Mask.config'
4
- import Mask from './Mask.vue'
5
-
6
- const props = defineProps({
7
- backgroundColor: { type: String, default: '#BBB' },
8
- maskClasses: String,
9
- showStatus: Boolean,
10
- online: Boolean,
11
- ...maskProps,
12
- })
13
-
14
- const classes = computed(() => {
15
- return {
16
- online: props.showStatus && props.online,
17
- }
18
- })
19
-
20
- const internalMaskClasses = makeMaskClasses(props)
21
- const allMaskClasses = computed(() => {
22
- const classes = internalMaskClasses.value
23
- const hasMaskClass = Object.values(classes).find(v => v)
24
- // Enable rounded-btn class only if no mask classes are applied
25
- Object.assign(classes, { 'rounded-btn': !hasMaskClass })
26
- return classes
27
- })
28
-
29
- const color = computed(() => {
30
- return `#${contrastingColor(props.backgroundColor.replace('#', ''))}`
31
- })
32
-
33
- function contrastingColor(color: any) {
34
- return (luma(color) >= 155) ? '000' : 'fff'
35
- }
36
- // color can be a hx string or an array of RGB values 0-255
37
- function luma(color: any) {
38
- const rgb = (typeof color === 'string') ? hexToRGBArray(color) : color
39
- return (0.2126 * rgb[0]) + (0.7152 * rgb[1]) + (0.0722 * rgb[2]) // SMPTE C, Rec. 709 weightings
40
- }
41
- function hexToRGBArray(color: any) {
42
- if (color.length === 3)
43
- color = color.charAt(0) + color.charAt(0) + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2)
44
- else if (color.length !== 6)
45
- throw new Error(`Invalid hex color: ${color}`)
46
- const rgb = []
47
- for (let i = 0; i <= 2; i++)
48
- rgb[i] = Number.parseInt(color.substr(i * 2, 2), 16)
49
- return rgb
50
- }
51
- </script>
52
-
53
- <template>
54
- <div class="avatar" :class="classes">
55
- <Mask :style="{ backgroundColor, color }" class="w-full h-full avatar-mask aspect-square" :class="[allMaskClasses, maskClasses]">
56
- <slot />
57
- </Mask>
58
- </div>
59
- </template>
60
-
61
- <style lang="postcss">
62
- .avatar-mask > * {
63
- aspect-ratio: 1/1;
64
- width: 100%;
65
- height: 100%;
66
- display: flex;
67
- align-items: center;
68
- justify-content: center;
69
- }
70
- </style>
@@ -1,19 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = defineProps({
5
- vertical: Boolean,
6
- })
7
- const classes = computed(() => {
8
- return {
9
- 'flex-col': props.vertical,
10
- 'flex-row': !props.vertical,
11
- }
12
- })
13
- </script>
14
-
15
- <template>
16
- <div class="avatar-group" :class="classes">
17
- <slot />
18
- </div>
19
- </template>
@@ -1,50 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = defineProps<{
5
- outline?: boolean
6
-
7
- size?: string
8
- lg?: boolean
9
- md?: boolean
10
- sm?: boolean
11
- xs?: boolean
12
-
13
- color?: string
14
- neutral?: boolean
15
- primary?: boolean
16
- secondary?: boolean
17
- accent?: boolean
18
- info?: boolean
19
- success?: boolean
20
- warning?: boolean
21
- error?: boolean
22
-
23
- ghost?: boolean
24
- }>()
25
-
26
- const classes = computed(() => {
27
- return {
28
- 'badge-outline': props.outline,
29
- 'badge-ghost': props.ghost,
30
- 'badge-lg': props.lg || props.size === 'lg',
31
- 'badge-md': props.md || props.size === 'md',
32
- 'badge-sm': props.sm || props.size === 'sm',
33
- 'badge-xs': props.xs || props.size === 'xs',
34
- 'badge-neutral': props.neutral || props.color === 'neutral',
35
- 'badge-primary': props.primary || props.color === 'primary',
36
- 'badge-secondary': props.secondary || props.color === 'secondary',
37
- 'badge-accent': props.accent || props.color === 'accent',
38
- 'badge-info': props.info || props.color === 'info',
39
- 'badge-success': props.success || props.color === 'success',
40
- 'badge-warning': props.warning || props.color === 'warning',
41
- 'badge-error': props.error || props.color === 'error',
42
- }
43
- })
44
- </script>
45
-
46
- <template>
47
- <div class="badge" :class="classes">
48
- <slot />
49
- </div>
50
- </template>
@@ -1,25 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = defineProps<{
5
- size?: string
6
- lg?: boolean
7
- md?: boolean
8
- sm?: boolean
9
- xs?: boolean
10
- }>()
11
- const classes = computed(() => {
12
- return {
13
- 'btm-nav-lg': props.lg || props.size === 'lg',
14
- 'btm-nav-md': props.md || props.size === 'md',
15
- 'btm-nav-sm': props.sm || props.size === 'sm',
16
- 'btm-nav-xs': props.xs || props.size === 'xs',
17
- }
18
- })
19
- </script>
20
-
21
- <template>
22
- <div class="btm-nav" :class="classes">
23
- <slot />
24
- </div>
25
- </template>
@@ -1,111 +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
- color?: string
9
- neutral?: boolean
10
- primary?: boolean
11
- secondary?: boolean
12
- accent?: boolean
13
- info?: boolean
14
- success?: boolean
15
- warning?: boolean
16
- error?: boolean
17
-
18
- ghost?: boolean
19
- link?: boolean
20
- glass?: boolean
21
- outline?: boolean
22
- disabled?: boolean
23
-
24
- shape?: 'circle' | 'square' | 'wide' | 'block'
25
- circle?: boolean
26
- square?: boolean
27
- wide?: boolean
28
- block?: boolean
29
-
30
- noAnimation?: boolean
31
- active?: boolean
32
-
33
- size?: 'lg' | 'md' | 'sm' | 'xs'
34
- lg?: boolean
35
- md?: boolean
36
- sm?: boolean
37
- xs?: boolean
38
-
39
- type?: 'button' | 'submit' | 'reset'
40
- }>()
41
-
42
- const classes = computed(() => {
43
- return {
44
- 'join-item': props.join,
45
-
46
- 'btn-primary': !props.disabled && (props.primary || props.color === 'primary'),
47
- 'btn-secondary': !props.disabled && (props.secondary || props.color === 'secondary'),
48
- 'btn-neutral': !props.disabled && (props.neutral || props.color === 'neutral'),
49
- 'btn-accent': !props.disabled && (props.accent || props.color === 'accent'),
50
- 'btn-info': !props.disabled && (props.info || props.color === 'info'),
51
- 'btn-success': !props.disabled && (props.success || props.color === 'success'),
52
- 'btn-warning': !props.disabled && (props.warning || props.color === 'warning'),
53
- 'btn-error': !props.disabled && (props.error || props.color === 'error'),
54
-
55
- 'text-primary': !props.disabled && (props.primary || props.color === 'primary') && props.link,
56
- 'text-secondary': !props.disabled && (props.secondary || props.color === 'secondary') && props.link,
57
- 'text-neutral': !props.disabled && (props.neutral || props.color === 'neutral') && props.link,
58
- 'text-accent': !props.disabled && (props.accent || props.color === 'accent') && props.link,
59
- 'text-info': !props.disabled && (props.info || props.color === 'info') && props.link,
60
- 'text-success': !props.disabled && (props.success || props.color === 'success') && props.link,
61
- 'text-warning': !props.disabled && (props.warning || props.color === 'warning') && props.link,
62
- 'text-error': !props.disabled && (props.error || props.color === 'error') && props.link,
63
-
64
- 'glass': !props.disabled && props.glass,
65
-
66
- 'btn-circle': props.circle || props.shape === 'circle',
67
- 'btn-square': props.square || props.shape === 'square',
68
- 'btn-wide': props.wide || props.shape === 'wide',
69
- 'btn-block': props.block || props.shape === 'block',
70
-
71
- 'btn-lg': props.lg || props.size === 'lg',
72
- 'btn-md': props.md || props.size === 'md',
73
- 'btn-sm': props.sm || props.size === 'sm',
74
- 'btn-xs': props.xs || props.size === 'xs',
75
-
76
- 'btn-outline': !props.disabled && props.outline,
77
- 'btn-ghost': !props.disabled && props.ghost,
78
- 'btn-link': !props.disabled && props.link,
79
- 'btn-disabled': props.disabled,
80
-
81
- 'no-animation': props.noAnimation,
82
- 'btn-active': !props.disabled && props.active,
83
- }
84
- })
85
-
86
- // Accessibility-friendly attributes for disabling the button
87
- const disabledAttrs = computed(() => {
88
- if (props.disabled) {
89
- return {
90
- 'tabindex': -1,
91
- 'role': 'button',
92
- 'aria-disabled': true,
93
- }
94
- }
95
- else {
96
- return {}
97
- }
98
- })
99
- </script>
100
-
101
- <template>
102
- <component
103
- :is="is || 'button'"
104
- :type="type"
105
- class="btn"
106
- :class="[classes]"
107
- v-bind="{ ...disabledAttrs, ...$attrs }"
108
- >
109
- <slot />
110
- </component>
111
- </template>
@@ -1,30 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = withDefaults(defineProps<{
5
- is?: string | Object | Function
6
- bordered?: boolean
7
- compact?: boolean
8
- side?: boolean
9
- imageFull?: boolean
10
- glass?: boolean
11
- }>(), {
12
- is: 'div',
13
- })
14
-
15
- const classes = computed(() => {
16
- return {
17
- 'card-bordered': props.bordered,
18
- 'card-compact': props.compact,
19
- 'card-side': props.side,
20
- 'image-full': props.imageFull,
21
- 'glass': props.glass,
22
- }
23
- })
24
- </script>
25
-
26
- <template>
27
- <component :is="is" class="card" :class="classes">
28
- <slot />
29
- </component>
30
- </template>
@@ -1,25 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = defineProps<{
5
- snapTo?: 'center' | 'end'
6
- center?: boolean
7
- end?: boolean
8
- vertical?: boolean
9
- }>()
10
-
11
- const classes = computed(() => {
12
- const { snapTo, center, end, vertical } = props
13
- return {
14
- 'carousel-center': center || snapTo === 'center',
15
- 'carousel-end': end || snapTo === 'end',
16
- 'carousel-vertical': vertical,
17
- }
18
- })
19
- </script>
20
-
21
- <template>
22
- <div class="carousel" :class="classes">
23
- <slot />
24
- </div>
25
- </template>
@@ -1,27 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = withDefaults(defineProps<{
5
- pre?: boolean
6
- align?: string
7
- start?: boolean
8
- end?: boolean
9
- }>(), {
10
- align: 'start',
11
- })
12
-
13
- const classes = computed(() => {
14
- const { align, start, end } = props
15
- return {
16
- 'chat-start': start || (!end && align === 'start'),
17
- 'chat-end': end || align === 'end',
18
- 'whitespace-pre': props.pre,
19
- }
20
- })
21
- </script>
22
-
23
- <template>
24
- <div class="chat" :class="classes">
25
- <slot />
26
- </div>
27
- </template>
@@ -1,34 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = defineProps<{
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
-
16
- const classes = computed(() => {
17
- return {
18
- 'badge-neutral': props.neutral || props.color === 'neutral',
19
- 'badge-primary': props.primary || props.color === 'primary',
20
- 'badge-secondary': props.secondary || props.color === 'secondary',
21
- 'badge-accent': props.accent || props.color === 'accent',
22
- 'badge-info': props.info || props.color === 'info',
23
- 'badge-success': props.success || props.color === 'success',
24
- 'badge-warning': props.warning || props.color === 'warning',
25
- 'badge-error': props.error || props.color === 'error',
26
- }
27
- })
28
- </script>
29
-
30
- <template>
31
- <div class="chat-bubble" :class="classes">
32
- <slot />
33
- </div>
34
- </template>
@@ -1,55 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = defineProps<{
5
- modelValue?: any
6
-
7
- color?: string
8
- primary?: boolean
9
- secondary?: boolean
10
- accent?: boolean
11
- success?: boolean
12
- warning?: boolean
13
- info?: boolean
14
- error?: boolean
15
-
16
- size?: string
17
- lg?: boolean
18
- md?: boolean
19
- sm?: boolean
20
- xs?: boolean
21
- }>()
22
- const emit = defineEmits(['update:modelValue'])
23
-
24
- const classes = computed(() => {
25
- const { color, primary, secondary, accent, success, warning, info, error, size, xs, sm, md, lg } = props
26
- return {
27
- 'checkbox-primary': primary || color === 'primary',
28
- 'checkbox-secondary': secondary || color === 'secondary',
29
- 'checkbox-accent': accent || color === 'accent',
30
- 'checkbox-success': success || color === 'success',
31
- 'checkbox-warning': warning || color === 'warning',
32
- 'checkbox-info': info || color === 'info',
33
- 'checkbox-error': error || color === 'error',
34
- 'checkbox-xs': xs || size === 'xs',
35
- 'checkbox-sm': sm || size === 'sm',
36
- 'checkbox-md': md || size === 'md',
37
- 'checkbox-lg': lg || size === 'lg',
38
- }
39
- })
40
-
41
- const currentValue = computed({
42
- get: () => props.modelValue,
43
- set: (val: string) => emit('update:modelValue', val),
44
- })
45
- </script>
46
-
47
- <template>
48
- <input
49
- v-model="currentValue"
50
- type="checkbox"
51
- v-bind="$attrs"
52
- class="checkbox"
53
- :class="classes"
54
- >
55
- </template>
@@ -1,92 +0,0 @@
1
- <script>
2
- import { computed, onBeforeUpdate, onMounted, ref } from 'vue'
3
- import Prism from 'prismjs'
4
- import 'prismjs/themes/prism-okaidia.css'
5
- import { useClipboard } from '@vueuse/core'
6
-
7
- export default {
8
- name: 'Code',
9
- props: {
10
- language: {
11
- type: String,
12
- default: 'javascript',
13
- },
14
- },
15
- setup(props, context) {
16
- const nuxtApp = useNuxtApp()
17
-
18
- const source = ref(null)
19
- const lang = computed(() => {
20
- if (props.language === 'vue')
21
- return 'html'
22
- else return props.language
23
- })
24
- const languageClass = computed(() => `language-${lang.value}`)
25
- const { text, copy, copied, isSupported } = useClipboard({ source })
26
-
27
- onMounted(() => {
28
- if (!nuxtApp.ssrContext) {
29
- setTimeout(() => {
30
- Prism.highlightAllUnder(source.value)
31
- }, 0)
32
- }
33
- })
34
- onBeforeUpdate(() => {
35
- if (typeof context.slots.default[0] === 'string') {
36
- const newText = context.slots.default[0].replace(
37
- /^[\r\n\s]*|[\r\n\s]*$/g,
38
- '',
39
- )
40
- context.el.querySelector('code').textContent = newText
41
- Prism.highlightAllUnder(source.value)
42
- }
43
- })
44
-
45
- const doCopy = () => {
46
- copy(source.value.innerText)
47
- }
48
-
49
- return { source, languageClass, text, copy, copied, isSupported, doCopy }
50
- },
51
- }
52
- </script>
53
-
54
- <template>
55
- <div class="relative mockup-code">
56
- <div class="absolute flex flex-row items-center top-1 right-1">
57
- <div v-if="copied" class="pr-2 text-sm">
58
- copied
59
- </div>
60
- <Button sm @click="doCopy">
61
- copy
62
- </Button>
63
- </div>
64
- <ClientOnly>
65
- <pre
66
- ref="source"
67
- class="whitespace-pre-wrap daisy-code-highlight"
68
- :class="languageClass"
69
- ><code><slot /></code></pre>
70
-
71
- <template #fallback>
72
- <pre
73
- class="whitespace-pre-wrap daisy-code-highlight"
74
- ><code><slot /></code></pre>
75
- </template>
76
- </ClientOnly>
77
- </div>
78
- </template>
79
-
80
- <style>
81
- .mockup-code .daisy-code-highlight {
82
- margin-left: 0 !important;
83
- background: none;
84
- border: none;
85
- box-shadow: none;
86
- padding-top: 0;
87
- padding-bottom: 0;
88
- }
89
- .mockup-code pre.daisy-code-highlight:before {
90
- margin: 0 !important;
91
- }
92
- </style>
@@ -1,54 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, inject, ref } from 'vue'
3
-
4
- const props = defineProps<{
5
- style?: 'arrow' | 'plus'
6
- arrow?: boolean
7
- plus?: boolean
8
-
9
- open?: boolean
10
- close?: boolean
11
-
12
- toggle?: boolean
13
-
14
- // for accordion
15
- value?: any
16
- }>()
17
-
18
- const accordionValue: any = inject('accordion-value', ref('no-accordion-value'))
19
- const useAccordion = computed(() => {
20
- return accordionValue.value !== 'no-accordion-value'
21
- })
22
- const isAccordionSelected = computed(
23
- () => {
24
- if (!useAccordion.value)
25
- return false
26
- return accordionValue.value === props.value
27
- })
28
-
29
- function handleClick() {
30
- if (useAccordion.value)
31
- accordionValue.value = props.value
32
- }
33
-
34
- const classes = computed(() => {
35
- const { style, arrow, plus, open, close } = props
36
- return {
37
- 'collapse-arrow': arrow || style === 'arrow',
38
- 'collapse-plus': plus || style === 'plus',
39
- 'collapse-open': (open && !close) || isAccordionSelected.value,
40
- 'collapse-close': close,
41
- }
42
- })
43
- </script>
44
-
45
- <template>
46
- <div tabindex="0" class="collapse" :class="classes" @click="handleClick">
47
- <input
48
- v-if="toggle || useAccordion"
49
- :type="useAccordion ? 'radio' : 'checkbox'"
50
- :checked="isAccordionSelected"
51
- >
52
- <slot />
53
- </div>
54
- </template>
@@ -1,70 +0,0 @@
1
- <script setup lang="ts">
2
- import { useIntervalFn } from '@vueuse/core'
3
- import { computed, watch } from 'vue'
4
-
5
- const props = withDefaults(defineProps<{
6
- durationInSeconds?: number
7
- untilDate?: Date
8
- }>(), { durationInSeconds: 0 })
9
- const emit = defineEmits(['done'])
10
-
11
- const calculateDate = () => props.untilDate || new Date(Date.now() + props.durationInSeconds * 1000)
12
- const targetDate = ref<Date>(calculateDate())
13
- watch(
14
- () => props.durationInSeconds,
15
- () => {
16
- targetDate.value = calculateDate()
17
- },
18
- { immediate: true },
19
- )
20
-
21
- // The target date
22
- function calcTimeLeft() {
23
- const remaining = targetDate.value.getTime() - Date.now()
24
- return remaining < 0 ? 0 : remaining
25
- }
26
- const timeLeft = ref(calcTimeLeft())
27
- useIntervalFn(() => {
28
- timeLeft.value = calcTimeLeft()
29
- }, 1000)
30
-
31
- watch(timeLeft, () => {
32
- if (timeLeft.value === 0)
33
- emit('done')
34
- })
35
-
36
- const totalSeconds = computed(() => Math.round(timeLeft.value / 1000))
37
- const totalMinutes = computed(() => Math.floor(timeLeft.value / 1000 / 60))
38
- const totalHours = computed(() => Math.floor(timeLeft.value / 1000 / 60 / 60))
39
- const totalDays = computed(() => Math.floor(timeLeft.value / 1000 / 60 / 60 / 24))
40
- const totalWeeks = computed(() => Math.floor(timeLeft.value / 1000 / 60 / 60 / 24 / 7))
41
- const totalMonths = computed(() => {
42
- const today = new Date()
43
- let diffMonths = (targetDate.value.getFullYear() - today.getFullYear()) * 12
44
- diffMonths -= targetDate.value.getMonth()
45
- diffMonths += today.getMonth()
46
- return diffMonths
47
- })
48
- const split = computed(() => {
49
- const days = totalDays.value
50
- const hours = totalHours.value - days * 24
51
- const minutes = totalMinutes.value - hours * 60
52
- const seconds = totalSeconds.value - totalMinutes.value * 60
53
- return { days, hours, minutes, seconds }
54
- })
55
- </script>
56
-
57
- <template>
58
- <slot
59
- v-bind="{
60
- totalSeconds,
61
- totalMinutes,
62
- totalHours,
63
- totalDays,
64
- totalWeeks,
65
- totalMonths,
66
- targetDate,
67
- split,
68
- }"
69
- />
70
- </template>
@@ -1,14 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
-
4
- const props = defineProps<{
5
- value: number
6
- is?: string | Function
7
- }>()
8
-
9
- const tag = computed(() => props.is || 'span')
10
- </script>
11
-
12
- <template>
13
- <component :is="tag" v-bind="$attrs" :style="`--value:${value};`" />
14
- </template>