daisy-ui-kit 5.0.3 → 5.0.5

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 (158) hide show
  1. package/README.md +1 -1
  2. package/dist/index.css +1 -0
  3. package/dist/index.d.ts +4652 -0
  4. package/dist/index.js +5279 -0
  5. package/nuxt.js +161 -14
  6. package/package.json +11 -21
  7. package/app/components/Accordion.vue +0 -29
  8. package/app/components/Alert.vue +0 -36
  9. package/app/components/Avatar.vue +0 -131
  10. package/app/components/AvatarGroup.vue +0 -22
  11. package/app/components/Badge.vue +0 -72
  12. package/app/components/Breadcrumbs.vue +0 -7
  13. package/app/components/Button.vue +0 -140
  14. package/app/components/Calendar.vue +0 -175
  15. package/app/components/CalendarInput.vue +0 -275
  16. package/app/components/CalendarSkeleton.vue +0 -87
  17. package/app/components/Card.vue +0 -51
  18. package/app/components/CardActions.vue +0 -13
  19. package/app/components/CardBody.vue +0 -13
  20. package/app/components/CardTitle.vue +0 -11
  21. package/app/components/Carousel.vue +0 -24
  22. package/app/components/CarouselItem.vue +0 -5
  23. package/app/components/Chat.vue +0 -26
  24. package/app/components/ChatBubble.vue +0 -31
  25. package/app/components/ChatFooter.vue +0 -5
  26. package/app/components/ChatHeader.vue +0 -5
  27. package/app/components/ChatImage.vue +0 -5
  28. package/app/components/Checkbox.vue +0 -51
  29. package/app/components/Collapse.vue +0 -76
  30. package/app/components/CollapseContent.vue +0 -5
  31. package/app/components/CollapseTitle.vue +0 -15
  32. package/app/components/Countdown.vue +0 -15
  33. package/app/components/CountdownTimers.vue +0 -69
  34. package/app/components/Counter.vue +0 -21
  35. package/app/components/Crumb.vue +0 -5
  36. package/app/components/DaisyLink.vue +0 -56
  37. package/app/components/Diff.vue +0 -11
  38. package/app/components/Divider.vue +0 -43
  39. package/app/components/Dock.vue +0 -57
  40. package/app/components/DockItem.vue +0 -27
  41. package/app/components/DockLabel.vue +0 -5
  42. package/app/components/Drawer.vue +0 -50
  43. package/app/components/DrawerContent.vue +0 -20
  44. package/app/components/DrawerSide.vue +0 -21
  45. package/app/components/Dropdown.vue +0 -106
  46. package/app/components/DropdownButton.vue +0 -23
  47. package/app/components/DropdownContent.vue +0 -127
  48. package/app/components/DropdownTarget.vue +0 -21
  49. package/app/components/Fab.vue +0 -16
  50. package/app/components/FabClose.vue +0 -18
  51. package/app/components/FabMainAction.vue +0 -5
  52. package/app/components/FabTrigger.vue +0 -117
  53. package/app/components/Fieldset.vue +0 -20
  54. package/app/components/FileInput.vue +0 -53
  55. package/app/components/Filter.vue +0 -129
  56. package/app/components/Flex.vue +0 -89
  57. package/app/components/FlexItem.vue +0 -62
  58. package/app/components/Footer.vue +0 -31
  59. package/app/components/FooterTitle.vue +0 -18
  60. package/app/components/FormControl.vue +0 -5
  61. package/app/components/Hero.vue +0 -18
  62. package/app/components/HeroContent.vue +0 -18
  63. package/app/components/HeroOverlay.vue +0 -5
  64. package/app/components/Hover3D.vue +0 -22
  65. package/app/components/HoverGallery.vue +0 -11
  66. package/app/components/Indicator.vue +0 -20
  67. package/app/components/IndicatorItem.vue +0 -43
  68. package/app/components/Input.vue +0 -116
  69. package/app/components/Join.vue +0 -5
  70. package/app/components/Kbd.vue +0 -25
  71. package/app/components/Label.vue +0 -100
  72. package/app/components/List.vue +0 -5
  73. package/app/components/ListColGrow.vue +0 -5
  74. package/app/components/ListColWrap.vue +0 -5
  75. package/app/components/ListRow.vue +0 -5
  76. package/app/components/LoadingBall.vue +0 -42
  77. package/app/components/LoadingBars.vue +0 -42
  78. package/app/components/LoadingDots.vue +0 -42
  79. package/app/components/LoadingInfinity.vue +0 -42
  80. package/app/components/LoadingRing.vue +0 -42
  81. package/app/components/LoadingSpinner.vue +0 -42
  82. package/app/components/Mask.vue +0 -49
  83. package/app/components/Menu.vue +0 -30
  84. package/app/components/MenuExpand.vue +0 -92
  85. package/app/components/MenuExpandToggle.vue +0 -20
  86. package/app/components/MenuItem.vue +0 -39
  87. package/app/components/MenuTitle.vue +0 -5
  88. package/app/components/MockupBrowser.vue +0 -5
  89. package/app/components/MockupBrowserToolbar.vue +0 -5
  90. package/app/components/MockupCode.vue +0 -4
  91. package/app/components/MockupPhone.vue +0 -14
  92. package/app/components/MockupWindow.vue +0 -5
  93. package/app/components/Modal.vue +0 -63
  94. package/app/components/ModalAction.vue +0 -5
  95. package/app/components/ModalBox.vue +0 -5
  96. package/app/components/NavButton.vue +0 -12
  97. package/app/components/Navbar.vue +0 -12
  98. package/app/components/NavbarCenter.vue +0 -11
  99. package/app/components/NavbarEnd.vue +0 -11
  100. package/app/components/NavbarStart.vue +0 -11
  101. package/app/components/Progress.vue +0 -46
  102. package/app/components/Prose.vue +0 -37
  103. package/app/components/RadialProgress.vue +0 -36
  104. package/app/components/Radio.vue +0 -69
  105. package/app/components/RadioGroup.vue +0 -47
  106. package/app/components/Range.vue +0 -201
  107. package/app/components/RangeMeasure.vue +0 -87
  108. package/app/components/RangeMeasureTick.vue +0 -69
  109. package/app/components/Rating.vue +0 -197
  110. package/app/components/Select.vue +0 -101
  111. package/app/components/Skeleton.vue +0 -5
  112. package/app/components/SkeletonText.vue +0 -11
  113. package/app/components/Stack.vue +0 -30
  114. package/app/components/Stat.vue +0 -19
  115. package/app/components/StatActions.vue +0 -5
  116. package/app/components/StatDesc.vue +0 -5
  117. package/app/components/StatFigure.vue +0 -5
  118. package/app/components/StatTitle.vue +0 -5
  119. package/app/components/StatValue.vue +0 -5
  120. package/app/components/Stats.vue +0 -5
  121. package/app/components/Status.vue +0 -43
  122. package/app/components/Step.vue +0 -34
  123. package/app/components/StepIcon.vue +0 -5
  124. package/app/components/Steps.vue +0 -23
  125. package/app/components/Swap.vue +0 -56
  126. package/app/components/Tab.vue +0 -56
  127. package/app/components/TabContent.vue +0 -29
  128. package/app/components/Table.vue +0 -32
  129. package/app/components/Tabs.vue +0 -53
  130. package/app/components/Text.vue +0 -166
  131. package/app/components/TextArea.vue +0 -106
  132. package/app/components/TextRotate.vue +0 -24
  133. package/app/components/ThemeController.vue +0 -45
  134. package/app/components/ThemeProvider.vue +0 -302
  135. package/app/components/ThemeTile.vue +0 -50
  136. package/app/components/Timeline.vue +0 -22
  137. package/app/components/TimelineEnd.vue +0 -14
  138. package/app/components/TimelineItem.vue +0 -5
  139. package/app/components/TimelineLine.vue +0 -29
  140. package/app/components/TimelineMiddle.vue +0 -5
  141. package/app/components/TimelineStart.vue +0 -14
  142. package/app/components/Toast.vue +0 -67
  143. package/app/components/Toggle.vue +0 -60
  144. package/app/components/Tooltip.vue +0 -137
  145. package/app/components/TooltipContent.vue +0 -283
  146. package/app/components/TooltipTarget.vue +0 -20
  147. package/app/components/ValidatorHint.vue +0 -5
  148. package/app/composables/__tests__/use-calendar.test.ts +0 -239
  149. package/app/composables/use-calendar.ts +0 -288
  150. package/app/composables/use-daisy-theme.ts +0 -140
  151. package/app/composables/use-toast.ts +0 -345
  152. package/app/composables/useSearch.ts +0 -22
  153. package/app/utils/drawer-utils.ts +0 -34
  154. package/app/utils/position-area.ts +0 -40
  155. package/components.d.ts +0 -145
  156. package/components.js +0 -141
  157. package/index.d.ts +0 -157
  158. package/index.js +0 -145
package/nuxt.js CHANGED
@@ -1,4 +1,155 @@
1
- import { addImports, createResolver, defineNuxtModule } from '@nuxt/kit'
1
+ import { addComponent, addImports, defineNuxtModule } from '@nuxt/kit'
2
+
3
+ const components = [
4
+ 'Accordion',
5
+ 'Alert',
6
+ 'Avatar',
7
+ 'AvatarGroup',
8
+ 'Badge',
9
+ 'Breadcrumbs',
10
+ 'Button',
11
+ 'Calendar',
12
+ 'CalendarInput',
13
+ 'CalendarSkeleton',
14
+ 'Card',
15
+ 'CardActions',
16
+ 'CardBody',
17
+ 'CardTitle',
18
+ 'Carousel',
19
+ 'CarouselItem',
20
+ 'Chat',
21
+ 'ChatBubble',
22
+ 'ChatFooter',
23
+ 'ChatHeader',
24
+ 'ChatImage',
25
+ 'Checkbox',
26
+ 'Collapse',
27
+ 'CollapseContent',
28
+ 'CollapseTitle',
29
+ 'Countdown',
30
+ 'CountdownTimers',
31
+ 'Counter',
32
+ 'Crumb',
33
+ 'DaisyLink',
34
+ 'Diff',
35
+ 'Divider',
36
+ 'Dock',
37
+ 'DockItem',
38
+ 'DockLabel',
39
+ 'Drawer',
40
+ 'DrawerContent',
41
+ 'DrawerSide',
42
+ 'Dropdown',
43
+ 'DropdownButton',
44
+ 'DropdownContent',
45
+ 'DropdownTarget',
46
+ 'Fab',
47
+ 'FabClose',
48
+ 'FabMainAction',
49
+ 'FabTrigger',
50
+ 'Fieldset',
51
+ 'FileInput',
52
+ 'Filter',
53
+ 'Flex',
54
+ 'FlexItem',
55
+ 'Footer',
56
+ 'FooterTitle',
57
+ 'FormControl',
58
+ 'Hero',
59
+ 'HeroContent',
60
+ 'HeroOverlay',
61
+ 'Hover3D',
62
+ 'HoverGallery',
63
+ 'Indicator',
64
+ 'IndicatorItem',
65
+ 'Input',
66
+ 'Join',
67
+ 'Kbd',
68
+ 'Label',
69
+ 'List',
70
+ 'ListColGrow',
71
+ 'ListColWrap',
72
+ 'ListRow',
73
+ 'LoadingBall',
74
+ 'LoadingBars',
75
+ 'LoadingDots',
76
+ 'LoadingInfinity',
77
+ 'LoadingRing',
78
+ 'LoadingSpinner',
79
+ 'Mask',
80
+ 'Menu',
81
+ 'MenuExpand',
82
+ 'MenuExpandToggle',
83
+ 'MenuItem',
84
+ 'MenuTitle',
85
+ 'MockupBrowser',
86
+ 'MockupBrowserToolbar',
87
+ 'MockupCode',
88
+ 'MockupPhone',
89
+ 'MockupWindow',
90
+ 'Modal',
91
+ 'ModalAction',
92
+ 'ModalBox',
93
+ 'NavButton',
94
+ 'Navbar',
95
+ 'NavbarCenter',
96
+ 'NavbarEnd',
97
+ 'NavbarStart',
98
+ 'Progress',
99
+ 'Prose',
100
+ 'RadialProgress',
101
+ 'Radio',
102
+ 'RadioGroup',
103
+ 'RangeMeasure',
104
+ 'RangeMeasureTick',
105
+ 'Rating',
106
+ 'Select',
107
+ 'Skeleton',
108
+ 'SkeletonText',
109
+ 'Stack',
110
+ 'Stat',
111
+ 'StatActions',
112
+ 'StatDesc',
113
+ 'StatFigure',
114
+ 'StatTitle',
115
+ 'StatValue',
116
+ 'Stats',
117
+ 'Status',
118
+ 'Step',
119
+ 'StepIcon',
120
+ 'Steps',
121
+ 'Swap',
122
+ 'Tab',
123
+ 'TabContent',
124
+ 'Table',
125
+ 'Tabs',
126
+ 'TextArea',
127
+ 'TextRotate',
128
+ 'ThemeController',
129
+ 'ThemeProvider',
130
+ 'ThemeTile',
131
+ 'Timeline',
132
+ 'TimelineEnd',
133
+ 'TimelineItem',
134
+ 'TimelineLine',
135
+ 'TimelineMiddle',
136
+ 'TimelineStart',
137
+ 'Toast',
138
+ 'Toggle',
139
+ 'Tooltip',
140
+ 'TooltipContent',
141
+ 'TooltipTarget',
142
+ 'ValidatorHint',
143
+ ]
144
+
145
+ const composables = [
146
+ 'createDrawerState',
147
+ 'getPositionArea',
148
+ 'getPositionFallbacks',
149
+ 'useCalendar',
150
+ 'useDaisyTheme',
151
+ 'useToast',
152
+ ]
2
153
 
3
154
  export default defineNuxtModule({
4
155
  meta: {
@@ -11,21 +162,17 @@ export default defineNuxtModule({
11
162
  defaults: {
12
163
  prefix: '',
13
164
  },
14
- setup(moduleOptions, nuxt) {
15
- const { prefix } = moduleOptions
16
- const { resolve } = createResolver(import.meta.url)
165
+ setup(options) {
166
+ const prefix = options.prefix || ''
17
167
 
18
- nuxt.hook('components:dirs', dirs => {
19
- dirs.push({
20
- path: resolve('./app/components'),
21
- prefix,
168
+ for (const name of components) {
169
+ addComponent({
170
+ name: prefix + name,
171
+ export: name,
172
+ filePath: 'daisy-ui-kit',
22
173
  })
23
- })
174
+ }
24
175
 
25
- addImports([
26
- { name: 'useCalendar', from: resolve('./app/composables/use-calendar') },
27
- { name: 'useDaisyTheme', from: resolve('./app/composables/use-daisy-theme') },
28
- { name: 'useToast', from: resolve('./app/composables/use-toast') },
29
- ])
176
+ addImports(composables.map(name => ({ name, from: 'daisy-ui-kit' })))
30
177
  },
31
178
  })
package/package.json CHANGED
@@ -4,43 +4,31 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "5.0.3",
7
+ "version": "5.0.5",
8
8
  "packageManager": "pnpm@10.10.0",
9
9
  "author": "feathers.dev",
10
10
  "exports": {
11
11
  ".": {
12
- "types": "./index.d.ts",
13
- "import": "./index.js"
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
14
  },
15
15
  "./nuxt": {
16
16
  "types": "./nuxt.d.ts",
17
17
  "import": "./nuxt.js"
18
- },
19
- "./components": {
20
- "types": "./components.d.ts",
21
- "import": "./components.js"
22
- },
23
- "./components/*": "./app/components/*",
24
- "./composables/*": "./app/composables/*",
25
- "./utils/*": "./app/utils/*"
18
+ }
26
19
  },
27
- "main": "./index.js",
28
- "module": "./index.js",
29
- "types": "./index.d.ts",
20
+ "main": "./dist/index.js",
21
+ "module": "./dist/index.js",
22
+ "types": "./dist/index.d.ts",
30
23
  "files": [
31
- "app/components/*.vue",
32
- "app/composables/*",
33
- "app/utils/*",
34
- "index.js",
35
- "index.d.ts",
24
+ "dist",
36
25
  "nuxt.js",
37
26
  "nuxt.d.ts",
38
- "components.js",
39
- "components.d.ts",
40
27
  "README.md"
41
28
  ],
42
29
  "scripts": {
43
30
  "import-d1-dumps": "./import-d1-dumps.sh",
31
+ "build:lib": "vite build --config vite.lib.config.ts",
44
32
  "prebuild": "cp CHANGELOG.md content/docs/changelog.md",
45
33
  "build": "NODE_OPTIONS='--max-old-space-size=7168' nuxt build",
46
34
  "predev": "cp CHANGELOG.md content/docs/changelog.md",
@@ -95,6 +83,8 @@
95
83
  "eslint-plugin-vue": "^10.5.1",
96
84
  "happy-dom": "^20.0.11",
97
85
  "tailwindcss": "^4.1.5",
86
+ "vite": "^7.3.1",
87
+ "vite-plugin-dts": "^4.5.4",
98
88
  "vitest": "^4.0.16"
99
89
  }
100
90
  }
@@ -1,29 +0,0 @@
1
- <script setup lang="ts">
2
- import { provide, ref, watch } from 'vue'
3
-
4
- const props = defineProps<{
5
- modelValue?: string | number
6
- }>()
7
- const emit = defineEmits(['update:modelValue'])
8
-
9
- const value = ref(props.modelValue)
10
- watch(
11
- () => props.modelValue,
12
- val => {
13
- value.value = val
14
- },
15
- )
16
- watch(value, val => {
17
- if (props.modelValue !== val) {
18
- emit('update:modelValue', val)
19
- }
20
- })
21
-
22
- provide('accordion-value', value)
23
- </script>
24
-
25
- <template>
26
- <div class="daisy-ui-kit-accordion">
27
- <slot />
28
- </div>
29
- </template>
@@ -1,36 +0,0 @@
1
- <script setup lang="ts">
2
- const props = defineProps<{
3
- outline?: boolean
4
- dash?: boolean
5
- soft?: boolean
6
- type?: 'info' | 'success' | 'warning' | 'error'
7
- info?: boolean
8
- success?: boolean
9
- warning?: boolean
10
- error?: boolean
11
- orientation?: 'vertical' | 'horizontal'
12
- vertical?: boolean
13
- horizontal?: boolean
14
- }>()
15
- </script>
16
-
17
- <template>
18
- <div
19
- class="alert"
20
- :class="{
21
- 'alert-outline': props.outline,
22
- 'alert-dash': props.dash,
23
- 'alert-soft': props.soft,
24
-
25
- 'alert-info': props.info || props.type === 'info',
26
- 'alert-success': props.success || props.type === 'success',
27
- 'alert-warning': props.warning || props.type === 'warning',
28
- 'alert-error': props.error || props.type === 'error',
29
-
30
- 'alert-vertical': props.vertical || props.orientation === 'vertical',
31
- 'alert-horizontal': props.horizontal || props.orientation === 'horizontal',
32
- }"
33
- >
34
- <slot />
35
- </div>
36
- </template>
@@ -1,131 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from 'vue'
3
- import Mask from './Mask.vue'
4
-
5
- const props = defineProps({
6
- backgroundColor: { type: String, default: '#BBB' },
7
- maskClasses: String,
8
- showStatus: Boolean,
9
- // Presence props
10
- presence: String,
11
- online: Boolean,
12
- offline: Boolean,
13
- // Mask shape props (self-contained, no Mask.config.ts dependency)
14
- shape: String,
15
- squircle: Boolean,
16
- heart: Boolean,
17
- hexagon: Boolean,
18
- hexagon2: Boolean,
19
- decagon: Boolean,
20
- pentagon: Boolean,
21
- diamond: Boolean,
22
- square: Boolean,
23
- circle: Boolean,
24
- star: Boolean,
25
- star2: Boolean,
26
- triangle: Boolean,
27
- triangle2: Boolean,
28
- triangle3: Boolean,
29
- triangle4: Boolean,
30
- half1: Boolean,
31
- half2: Boolean,
32
- })
33
-
34
- const maskShapeKeys = [
35
- 'mask-squircle',
36
- 'mask-heart',
37
- 'mask-hexagon',
38
- 'mask-hexagon-2',
39
- 'mask-decagon',
40
- 'mask-pentagon',
41
- 'mask-diamond',
42
- 'mask-square',
43
- 'mask-circle',
44
- 'mask-star',
45
- 'mask-star-2',
46
- 'mask-triangle',
47
- 'mask-triangle-2',
48
- 'mask-triangle-3',
49
- 'mask-triangle-4',
50
- 'mask-half-1',
51
- 'mask-half-2',
52
- ] as const
53
-
54
- type AvatarClassKey = (typeof maskShapeKeys)[number] | 'rounded-box' | 'avatar-online' | 'avatar-offline'
55
-
56
- const avatarClasses = computed<Record<AvatarClassKey, boolean>>(() => {
57
- const mask: Record<AvatarClassKey, boolean> = {
58
- 'mask-squircle': props.squircle || props.shape === 'squircle',
59
- 'mask-heart': props.heart || props.shape === 'heart',
60
- 'mask-hexagon': props.hexagon || props.shape === 'hexagon',
61
- 'mask-hexagon-2': props.hexagon2 || props.shape === 'hexagon-2',
62
- 'mask-decagon': props.decagon || props.shape === 'decagon',
63
- 'mask-pentagon': props.pentagon || props.shape === 'pentagon',
64
- 'mask-diamond': props.diamond || props.shape === 'diamond',
65
- 'mask-square': props.square || props.shape === 'square',
66
- 'mask-circle': props.circle || props.shape === 'circle',
67
- 'mask-star': props.star || props.shape === 'star',
68
- 'mask-star-2': props.star2 || props.shape === 'star-2',
69
- 'mask-triangle': props.triangle || props.shape === 'triangle',
70
- 'mask-triangle-2': props.triangle2 || props.shape === 'triangle-2',
71
- 'mask-triangle-3': props.triangle3 || props.shape === 'triangle-3',
72
- 'mask-triangle-4': props.triangle4 || props.shape === 'triangle-4',
73
- 'mask-half-1': props.half1 || props.shape === 'half-1',
74
- 'mask-half-2': props.half2 || props.shape === 'half-2',
75
- 'rounded-box': false,
76
- 'avatar-online': props.presence === 'online' || props.online,
77
- 'avatar-offline': props.presence === 'offline' || props.offline,
78
- }
79
- const hasMask = maskShapeKeys.some(k => mask[k])
80
- mask['rounded-box'] = !hasMask
81
- return mask
82
- })
83
-
84
- const color = computed(() => {
85
- return `#${contrastingColor(props.backgroundColor.replace('#', ''))}`
86
- })
87
-
88
- function contrastingColor(color: any) {
89
- return luma(color) >= 155 ? '000' : 'fff'
90
- }
91
- // color can be a hx string or an array of RGB values 0-255
92
- function luma(color: any) {
93
- const rgb = typeof color === 'string' ? hexToRGBArray(color) : color
94
- return 0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2] // SMPTE C, Rec. 709 weightings
95
- }
96
- function hexToRGBArray(color: any) {
97
- if (color.length === 3) {
98
- color = color.charAt(0) + color.charAt(0) + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2)
99
- } else if (color.length !== 6) {
100
- throw new Error(`Invalid hex color: ${color}`)
101
- }
102
- const rgb = []
103
- for (let i = 0; i <= 2; i++) {
104
- rgb[i] = Number.parseInt(color.substr(i * 2, 2), 16)
105
- }
106
- return rgb
107
- }
108
- </script>
109
-
110
- <template>
111
- <div class="avatar">
112
- <Mask
113
- :style="{ backgroundColor, color }"
114
- class="w-full h-full avatar-mask aspect-square"
115
- :class="[avatarClasses, maskClasses]"
116
- >
117
- <slot />
118
- </Mask>
119
- </div>
120
- </template>
121
-
122
- <style lang="postcss">
123
- .avatar-mask > * {
124
- aspect-ratio: 1/1;
125
- width: 100%;
126
- height: 100%;
127
- display: flex;
128
- align-items: center;
129
- justify-content: center;
130
- }
131
- </style>
@@ -1,22 +0,0 @@
1
- <script setup lang="ts">
2
- const props = defineProps<{
3
- orientation: string
4
- horizontal: boolean
5
- vertical: boolean
6
- }>()
7
- </script>
8
-
9
- <template>
10
- <div
11
- class="avatar-group"
12
- :class="{
13
- 'flex-row':
14
- props.orientation === 'horizontal' ||
15
- props.horizontal ||
16
- (!props.orientation && !props.vertical && !props.horizontal),
17
- 'flex-col': props.orientation === 'vertical' || props.vertical,
18
- }"
19
- >
20
- <slot />
21
- </div>
22
- </template>
@@ -1,72 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, resolveComponent } from 'vue'
3
-
4
- defineOptions({
5
- inheritAttrs: false,
6
- })
7
-
8
- const { is = 'div', ...props } = defineProps<{
9
- is?: string
10
- outline?: boolean
11
- soft?: boolean
12
- dash?: boolean
13
- ghost?: boolean
14
-
15
- size?: string
16
- xl?: boolean
17
- lg?: boolean
18
- md?: boolean
19
- sm?: boolean
20
- xs?: boolean
21
-
22
- color?: string
23
- neutral?: boolean
24
- primary?: boolean
25
- secondary?: boolean
26
- accent?: boolean
27
- info?: boolean
28
- success?: boolean
29
- warning?: boolean
30
- error?: boolean
31
- }>()
32
-
33
- const NuxtLink = resolveComponent('NuxtLink')
34
- const RouterLink = resolveComponent('RouterLink')
35
-
36
- const resolvedComponent = computed(() => {
37
- if (is === 'NuxtLink') return NuxtLink
38
- if (is === 'RouterLink') return RouterLink
39
- return is
40
- })
41
- </script>
42
-
43
- <template>
44
- <component
45
- :is="resolvedComponent"
46
- v-bind="$attrs"
47
- class="badge"
48
- :class="{
49
- 'badge-outline': props.outline,
50
- 'badge-ghost': props.ghost,
51
- 'badge-soft': props.soft,
52
- 'badge-dash': props.dash,
53
-
54
- 'badge-xl': props.xl || props.size === 'xl',
55
- 'badge-lg': props.lg || props.size === 'lg',
56
- 'badge-md': props.md || props.size === 'md',
57
- 'badge-sm': props.sm || props.size === 'sm',
58
- 'badge-xs': props.xs || props.size === 'xs',
59
-
60
- 'badge-neutral': props.neutral || props.color === 'neutral',
61
- 'badge-primary': props.primary || props.color === 'primary',
62
- 'badge-secondary': props.secondary || props.color === 'secondary',
63
- 'badge-accent': props.accent || props.color === 'accent',
64
- 'badge-info': props.info || props.color === 'info',
65
- 'badge-success': props.success || props.color === 'success',
66
- 'badge-warning': props.warning || props.color === 'warning',
67
- 'badge-error': props.error || props.color === 'error',
68
- }"
69
- >
70
- <slot />
71
- </component>
72
- </template>
@@ -1,7 +0,0 @@
1
- <template>
2
- <div class="breadcrumbs">
3
- <ul>
4
- <slot />
5
- </ul>
6
- </div>
7
- </template>
@@ -1,140 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, resolveComponent } from 'vue'
3
-
4
- defineOptions({
5
- inheritAttrs: false,
6
- })
7
-
8
- const props = withDefaults(
9
- defineProps<{
10
- is?: string
11
- join?: 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
- link?: boolean
25
- glass?: boolean
26
- outline?: boolean
27
- dash?: boolean
28
- soft?: boolean
29
- disabled?: boolean
30
-
31
- shape?: 'circle' | 'square' | 'wide' | 'block'
32
- circle?: boolean
33
- square?: boolean
34
- wide?: boolean
35
- block?: boolean
36
-
37
- noAnimation?: boolean
38
- active?: boolean
39
-
40
- size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
41
- xl?: boolean
42
- lg?: boolean
43
- md?: boolean
44
- sm?: boolean
45
- xs?: boolean
46
-
47
- type?: 'button' | 'submit' | 'reset'
48
- }>(),
49
- {
50
- type: 'button',
51
- },
52
- )
53
- const NuxtLink = resolveComponent('NuxtLink')
54
- const RouterLink = resolveComponent('RouterLink')
55
-
56
- // Accessibility: Determine if rendering a native button
57
- const isButton = computed(() => (props.is || 'button') === 'button')
58
-
59
- // Resolve the component to render
60
- const resolvedComponent = computed(() => {
61
- if (!props.is || props.is === 'button' || props.is === 'a') {
62
- return props.is || 'button'
63
- }
64
- if (props.is === 'NuxtLink') return NuxtLink
65
- if (props.is === 'RouterLink') return RouterLink
66
- return props.is
67
- })
68
-
69
- // Accessibility: Keyboard event handler for custom elements
70
- function onKeydown(e: KeyboardEvent) {
71
- if (props.disabled) {
72
- return
73
- }
74
- if (e.code === 'Space' || e.code === 'Enter' || e.key === ' ' || e.key === 'Enter') {
75
- e.preventDefault()
76
- // @ts-expect-error: $el may not exist yet
77
- e.currentTarget?.click?.()
78
- }
79
- }
80
- </script>
81
-
82
- <template>
83
- <component
84
- :is="resolvedComponent"
85
- v-bind="$attrs"
86
- :type="isButton ? type : undefined"
87
- :disabled="isButton && disabled ? true : undefined"
88
- :aria-disabled="!isButton && disabled ? true : undefined"
89
- :tabindex="!isButton ? (disabled ? -1 : 0) : undefined"
90
- :role="!isButton ? 'button' : undefined"
91
- class="btn"
92
- :class="{
93
- 'join-item': join,
94
-
95
- 'btn-neutral': !disabled && (neutral || color === 'neutral'),
96
- 'btn-primary': !disabled && (primary || color === 'primary'),
97
- 'btn-secondary': !disabled && (secondary || color === 'secondary'),
98
- 'btn-accent': !disabled && (accent || color === 'accent'),
99
- 'btn-info': !disabled && (info || color === 'info'),
100
- 'btn-success': !disabled && (success || color === 'success'),
101
- 'btn-warning': !disabled && (warning || color === 'warning'),
102
- 'btn-error': !disabled && (error || color === 'error'),
103
-
104
- 'text-primary': !disabled && (primary || color === 'primary') && link,
105
- 'text-secondary': !disabled && (secondary || color === 'secondary') && link,
106
- 'text-neutral': !disabled && (neutral || color === 'neutral') && link,
107
- 'text-accent': !disabled && (accent || color === 'accent') && link,
108
- 'text-info': !disabled && (info || color === 'info') && link,
109
- 'text-success': !disabled && (success || color === 'success') && link,
110
- 'text-warning': !disabled && (warning || color === 'warning') && link,
111
- 'text-error': !disabled && (error || color === 'error') && link,
112
-
113
- glass: !disabled && glass,
114
-
115
- 'btn-circle': circle || shape === 'circle',
116
- 'btn-square': square || shape === 'square',
117
- 'btn-wide': wide || shape === 'wide',
118
- 'btn-block': block || shape === 'block',
119
-
120
- 'btn-xl': xl || size === 'xl',
121
- 'btn-lg': lg || size === 'lg',
122
- 'btn-md': md || size === 'md',
123
- 'btn-sm': sm || size === 'sm',
124
- 'btn-xs': xs || size === 'xs',
125
-
126
- 'btn-outline': !disabled && outline,
127
- 'btn-dash': !disabled && dash,
128
- 'btn-ghost': !disabled && ghost,
129
- 'btn-soft': !disabled && soft,
130
- 'btn-link': !disabled && link,
131
- 'btn-disabled': disabled,
132
-
133
- 'no-animation': noAnimation,
134
- 'btn-active': !disabled && active,
135
- }"
136
- @keydown="!isButton ? onKeydown : undefined"
137
- >
138
- <slot />
139
- </component>
140
- </template>