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.
- package/README.md +62 -14
- package/app/components/Accordion.vue +29 -0
- package/app/components/Alert.vue +36 -0
- package/app/components/Avatar.vue +131 -0
- package/app/components/AvatarGroup.vue +22 -0
- package/app/components/Badge.vue +67 -0
- package/app/components/Button.vue +135 -0
- package/app/components/Calendar.vue +89 -0
- package/app/components/CalendarInput.vue +174 -0
- package/app/components/CalendarSkeleton.vue +87 -0
- package/app/components/Card.vue +46 -0
- package/{components → app/components}/CardActions.vue +2 -5
- package/{components → app/components}/CardBody.vue +2 -5
- package/{components → app/components}/CardTitle.vue +1 -6
- package/app/components/Carousel.vue +24 -0
- package/app/components/Chat.vue +26 -0
- package/app/components/ChatBubble.vue +31 -0
- package/app/components/Checkbox.vue +51 -0
- package/app/components/Collapse.vue +75 -0
- package/app/components/CollapseTitle.vue +15 -0
- package/{components → app/components}/Countdown.vue +1 -1
- package/app/components/CountdownTimers.vue +69 -0
- package/app/components/Counter.vue +21 -0
- package/app/components/DaisyLink.vue +52 -0
- package/app/components/Diff.vue +11 -0
- package/app/components/Divider.vue +43 -0
- package/app/components/Dock.vue +60 -0
- package/app/components/DockItem.vue +26 -0
- package/app/components/DockLabel.vue +5 -0
- package/{components → app/components}/Drawer.vue +17 -12
- package/{components → app/components}/DrawerContent.vue +8 -5
- package/{components → app/components}/DrawerSide.vue +8 -5
- package/app/components/Dropdown.vue +106 -0
- package/app/components/DropdownButton.vue +23 -0
- package/app/components/DropdownContent.vue +127 -0
- package/{components → app/components}/DropdownTarget.vue +9 -2
- package/app/components/Fab.vue +16 -0
- package/app/components/FabClose.vue +18 -0
- package/app/components/FabMainAction.vue +5 -0
- package/app/components/FabTrigger.vue +117 -0
- package/app/components/Fieldset.vue +16 -0
- package/app/components/FileInput.vue +53 -0
- package/app/components/Filter.vue +125 -0
- package/app/components/Flex.vue +84 -0
- package/{components → app/components}/FlexItem.vue +30 -27
- package/app/components/Footer.vue +31 -0
- package/{components → app/components}/FooterTitle.vue +8 -5
- package/app/components/FormControl.vue +5 -0
- package/{components → app/components}/Hero.vue +8 -5
- package/{components → app/components}/HeroContent.vue +8 -5
- package/app/components/Hover3D.vue +22 -0
- package/app/components/HoverGallery.vue +11 -0
- package/{components → app/components}/Indicator.vue +8 -5
- package/{components → app/components}/IndicatorItem.vue +16 -13
- package/app/components/Input.vue +126 -0
- package/app/components/Kbd.vue +25 -0
- package/app/components/Label.vue +100 -0
- package/{components/CollapseTitle.vue → app/components/List.vue} +1 -1
- package/{components/FormControl.vue → app/components/ListColGrow.vue} +1 -1
- package/app/components/ListColWrap.vue +5 -0
- package/{components/Stat.vue → app/components/ListRow.vue} +1 -1
- package/app/components/LoadingBall.vue +42 -0
- package/app/components/LoadingBars.vue +42 -0
- package/app/components/LoadingDots.vue +42 -0
- package/app/components/LoadingInfinity.vue +42 -0
- package/app/components/LoadingRing.vue +42 -0
- package/app/components/LoadingSpinner.vue +42 -0
- package/app/components/Mask.vue +49 -0
- package/app/components/Menu.vue +30 -0
- package/app/components/MenuExpand.vue +94 -0
- package/app/components/MenuExpandToggle.vue +20 -0
- package/{components → app/components}/MenuItem.vue +7 -6
- package/app/components/MockupPhone.vue +14 -0
- package/{components → app/components}/Modal.vue +28 -13
- package/app/components/NavButton.vue +12 -0
- package/{components → app/components}/Navbar.vue +3 -5
- package/{components → app/components}/NavbarCenter.vue +3 -5
- package/{components → app/components}/NavbarEnd.vue +3 -5
- package/{components → app/components}/NavbarStart.vue +3 -5
- package/app/components/Progress.vue +46 -0
- package/{components → app/components}/Prose.vue +8 -3
- package/app/components/RadialProgress.vue +36 -0
- package/app/components/Radio.vue +69 -0
- package/{components → app/components}/RadioGroup.vue +2 -1
- package/app/components/Range.vue +61 -0
- package/app/components/RangeMeasure.vue +87 -0
- package/{components → app/components}/RangeMeasureTick.vue +9 -14
- package/app/components/Rating.vue +197 -0
- package/app/components/Select.vue +101 -0
- package/app/components/Skeleton.vue +5 -0
- package/app/components/SkeletonText.vue +11 -0
- package/app/components/Stack.vue +25 -0
- package/app/components/Stat.vue +19 -0
- package/app/components/Status.vue +43 -0
- package/app/components/Step.vue +34 -0
- package/app/components/StepIcon.vue +5 -0
- package/app/components/Steps.vue +23 -0
- package/app/components/Swap.vue +56 -0
- package/app/components/Tab.vue +51 -0
- package/{components → app/components}/TabContent.vue +10 -10
- package/app/components/Table.vue +32 -0
- package/app/components/Tabs.vue +53 -0
- package/app/components/Text.vue +162 -0
- package/app/components/TextArea.vue +64 -0
- package/app/components/TextRotate.vue +24 -0
- package/app/components/ThemeController.vue +45 -0
- package/app/components/ThemeProvider.vue +302 -0
- package/app/components/ThemeTile.vue +50 -0
- package/app/components/Timeline.vue +22 -0
- package/app/components/TimelineEnd.vue +14 -0
- package/app/components/TimelineItem.vue +5 -0
- package/app/components/TimelineLine.vue +29 -0
- package/app/components/TimelineMiddle.vue +5 -0
- package/app/components/TimelineStart.vue +14 -0
- package/app/components/Toast.vue +67 -0
- package/app/components/Toggle.vue +60 -0
- package/app/components/Tooltip.vue +48 -0
- package/app/components/TooltipContent.vue +5 -0
- package/app/components/ValidatorHint.vue +5 -0
- package/{utils → app/utils}/drawer-utils.ts +15 -13
- package/app/utils/position-area.ts +41 -0
- package/nuxt.js +7 -1
- package/package.json +60 -61
- package/components/Accordion.vue +0 -29
- package/components/Alert.vue +0 -25
- package/components/Artboard.vue +0 -33
- package/components/Avatar.vue +0 -70
- package/components/AvatarGroup.vue +0 -19
- package/components/Badge.vue +0 -50
- package/components/BottomNav.vue +0 -25
- package/components/Button.vue +0 -111
- package/components/Card.vue +0 -30
- package/components/Carousel.vue +0 -25
- package/components/Chat.vue +0 -27
- package/components/ChatBubble.vue +0 -34
- package/components/Checkbox.vue +0 -55
- package/components/Code.vue +0 -92
- package/components/Collapse.vue +0 -54
- package/components/CountdownTimers.vue +0 -70
- package/components/Counter.vue +0 -14
- package/components/Divider.vue +0 -24
- package/components/Dropdown.vue +0 -95
- package/components/DropdownButton.vue +0 -16
- package/components/DropdownContent.vue +0 -56
- package/components/FileInput.vue +0 -59
- package/components/Flex.vue +0 -59
- package/components/Footer.vue +0 -24
- package/components/Kbd.vue +0 -25
- package/components/Label.vue +0 -15
- package/components/LabelText.vue +0 -15
- package/components/LabelTextAlt.vue +0 -15
- package/components/Link.vue +0 -40
- package/components/LoadingBall.vue +0 -43
- package/components/LoadingBars.vue +0 -43
- package/components/LoadingDots.vue +0 -43
- package/components/LoadingInfinity.vue +0 -43
- package/components/LoadingRing.vue +0 -43
- package/components/LoadingSpinner.vue +0 -43
- package/components/Mask.config.ts +0 -77
- package/components/Mask.vue +0 -14
- package/components/Menu.vue +0 -35
- package/components/MenuExpand.vue +0 -79
- package/components/MenuExpandToggle.vue +0 -13
- package/components/MockupPhone.vue +0 -8
- package/components/NavButton.vue +0 -20
- package/components/Progress.vue +0 -42
- package/components/RadialProgress.vue +0 -41
- package/components/Radio.vue +0 -76
- package/components/Range.vue +0 -60
- package/components/RangeMeasure.vue +0 -83
- package/components/Rating.vue +0 -167
- package/components/Select.vue +0 -100
- package/components/Stack.vue +0 -13
- package/components/Step.vue +0 -36
- package/components/Steps.vue +0 -21
- package/components/Swap.vue +0 -58
- package/components/Tab.vue +0 -48
- package/components/Tabs.vue +0 -77
- package/components/TabsManager.vue +0 -38
- package/components/Text.vue +0 -142
- package/components/TextArea.vue +0 -64
- package/components/TextInput.vue +0 -66
- package/components/Toast.vue +0 -31
- package/components/Toggle.vue +0 -59
- package/components/Tooltip.vue +0 -47
- package/index.ts +0 -108
- package/utils/-utils.ts +0 -41
- package/utils/Button.config.ts +0 -26
- package/utils/fixtures.ts +0 -62
- package/utils/types.ts +0 -7
- /package/{components → app/components}/Breadcrumbs.vue +0 -0
- /package/{components → app/components}/CarouselItem.vue +0 -0
- /package/{components → app/components}/ChatFooter.vue +0 -0
- /package/{components → app/components}/ChatHeader.vue +0 -0
- /package/{components → app/components}/ChatImage.vue +0 -0
- /package/{components → app/components}/CollapseContent.vue +0 -0
- /package/{components → app/components}/Crumb.vue +0 -0
- /package/{components → app/components}/HeroOverlay.vue +0 -0
- /package/{components → app/components}/Join.vue +0 -0
- /package/{components → app/components}/MenuTitle.vue +0 -0
- /package/{components → app/components}/MockupBrowser.vue +0 -0
- /package/{components → app/components}/MockupBrowserToolbar.vue +0 -0
- /package/{components → app/components}/MockupCode.vue +0 -0
- /package/{components → app/components}/MockupWindow.vue +0 -0
- /package/{components → app/components}/ModalAction.vue +0 -0
- /package/{components → app/components}/ModalBox.vue +0 -0
- /package/{components → app/components}/StatActions.vue +0 -0
- /package/{components → app/components}/StatDesc.vue +0 -0
- /package/{components → app/components}/StatFigure.vue +0 -0
- /package/{components → app/components}/StatTitle.vue +0 -0
- /package/{components → app/components}/StatValue.vue +0 -0
- /package/{components → app/components}/Stats.vue +0 -0
- /package/{utils → app/utils}/random-string.ts +0 -0
package/README.md
CHANGED
|
@@ -1,27 +1,75 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Nuxt Minimal Starter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Setup
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Make sure to install dependencies:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```bash
|
|
10
|
+
# npm
|
|
11
|
+
npm install
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
# pnpm
|
|
14
|
+
pnpm install
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
# yarn
|
|
17
|
+
yarn install
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
# bun
|
|
20
|
+
bun install
|
|
21
|
+
```
|
|
16
22
|
|
|
17
|
-
##
|
|
23
|
+
## Development Server
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
Start the development server on `http://localhost:3000`:
|
|
20
26
|
|
|
21
|
-
|
|
27
|
+
```bash
|
|
28
|
+
# npm
|
|
29
|
+
npm run dev
|
|
22
30
|
|
|
23
|
-
|
|
31
|
+
# pnpm
|
|
32
|
+
pnpm dev
|
|
24
33
|
|
|
25
|
-
|
|
34
|
+
# yarn
|
|
35
|
+
yarn dev
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
# bun
|
|
38
|
+
bun run dev
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Production
|
|
42
|
+
|
|
43
|
+
Build the application for production:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# npm
|
|
47
|
+
npm run build
|
|
48
|
+
|
|
49
|
+
# pnpm
|
|
50
|
+
pnpm build
|
|
51
|
+
|
|
52
|
+
# yarn
|
|
53
|
+
yarn build
|
|
54
|
+
|
|
55
|
+
# bun
|
|
56
|
+
bun run build
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Locally preview production build:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# npm
|
|
63
|
+
npm run preview
|
|
64
|
+
|
|
65
|
+
# pnpm
|
|
66
|
+
pnpm preview
|
|
67
|
+
|
|
68
|
+
# yarn
|
|
69
|
+
yarn preview
|
|
70
|
+
|
|
71
|
+
# bun
|
|
72
|
+
bun run preview
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
|
@@ -0,0 +1,29 @@
|
|
|
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>
|
|
@@ -0,0 +1,36 @@
|
|
|
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>
|
|
@@ -0,0 +1,131 @@
|
|
|
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>
|
|
@@ -0,0 +1,22 @@
|
|
|
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>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const { is = 'div', ...props } = defineProps<{
|
|
5
|
+
is?: string
|
|
6
|
+
outline?: boolean
|
|
7
|
+
soft?: boolean
|
|
8
|
+
dash?: boolean
|
|
9
|
+
ghost?: boolean
|
|
10
|
+
|
|
11
|
+
size?: string
|
|
12
|
+
xl?: boolean
|
|
13
|
+
lg?: boolean
|
|
14
|
+
md?: boolean
|
|
15
|
+
sm?: boolean
|
|
16
|
+
xs?: boolean
|
|
17
|
+
|
|
18
|
+
color?: string
|
|
19
|
+
neutral?: boolean
|
|
20
|
+
primary?: boolean
|
|
21
|
+
secondary?: boolean
|
|
22
|
+
accent?: boolean
|
|
23
|
+
info?: boolean
|
|
24
|
+
success?: boolean
|
|
25
|
+
warning?: boolean
|
|
26
|
+
error?: boolean
|
|
27
|
+
}>()
|
|
28
|
+
|
|
29
|
+
const NuxtLink = resolveComponent('NuxtLink')
|
|
30
|
+
const RouterLink = resolveComponent('RouterLink')
|
|
31
|
+
|
|
32
|
+
const resolvedComponent = computed(() => {
|
|
33
|
+
if (is === 'NuxtLink') return NuxtLink
|
|
34
|
+
if (is === 'RouterLink') return RouterLink
|
|
35
|
+
return is
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<component
|
|
41
|
+
:is="resolvedComponent"
|
|
42
|
+
class="badge"
|
|
43
|
+
:class="{
|
|
44
|
+
'badge-outline': props.outline,
|
|
45
|
+
'badge-ghost': props.ghost,
|
|
46
|
+
'badge-soft': props.soft,
|
|
47
|
+
'badge-dash': props.dash,
|
|
48
|
+
|
|
49
|
+
'badge-xl': props.xl || props.size === 'xl',
|
|
50
|
+
'badge-lg': props.lg || props.size === 'lg',
|
|
51
|
+
'badge-md': props.md || props.size === 'md',
|
|
52
|
+
'badge-sm': props.sm || props.size === 'sm',
|
|
53
|
+
'badge-xs': props.xs || props.size === 'xs',
|
|
54
|
+
|
|
55
|
+
'badge-neutral': props.neutral || props.color === 'neutral',
|
|
56
|
+
'badge-primary': props.primary || props.color === 'primary',
|
|
57
|
+
'badge-secondary': props.secondary || props.color === 'secondary',
|
|
58
|
+
'badge-accent': props.accent || props.color === 'accent',
|
|
59
|
+
'badge-info': props.info || props.color === 'info',
|
|
60
|
+
'badge-success': props.success || props.color === 'success',
|
|
61
|
+
'badge-warning': props.warning || props.color === 'warning',
|
|
62
|
+
'badge-error': props.error || props.color === 'error',
|
|
63
|
+
}"
|
|
64
|
+
>
|
|
65
|
+
<slot />
|
|
66
|
+
</component>
|
|
67
|
+
</template>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
is?: string
|
|
7
|
+
join?: boolean
|
|
8
|
+
|
|
9
|
+
color?: string
|
|
10
|
+
neutral?: boolean
|
|
11
|
+
primary?: boolean
|
|
12
|
+
secondary?: boolean
|
|
13
|
+
accent?: boolean
|
|
14
|
+
info?: boolean
|
|
15
|
+
success?: boolean
|
|
16
|
+
warning?: boolean
|
|
17
|
+
error?: boolean
|
|
18
|
+
|
|
19
|
+
ghost?: boolean
|
|
20
|
+
link?: boolean
|
|
21
|
+
glass?: boolean
|
|
22
|
+
outline?: boolean
|
|
23
|
+
dash?: boolean
|
|
24
|
+
soft?: boolean
|
|
25
|
+
disabled?: boolean
|
|
26
|
+
|
|
27
|
+
shape?: 'circle' | 'square' | 'wide' | 'block'
|
|
28
|
+
circle?: boolean
|
|
29
|
+
square?: boolean
|
|
30
|
+
wide?: boolean
|
|
31
|
+
block?: boolean
|
|
32
|
+
|
|
33
|
+
noAnimation?: boolean
|
|
34
|
+
active?: boolean
|
|
35
|
+
|
|
36
|
+
size?: 'lg' | 'md' | 'sm' | 'xs' | 'xl'
|
|
37
|
+
xl?: boolean
|
|
38
|
+
lg?: boolean
|
|
39
|
+
md?: boolean
|
|
40
|
+
sm?: boolean
|
|
41
|
+
xs?: boolean
|
|
42
|
+
|
|
43
|
+
type?: 'button' | 'submit' | 'reset'
|
|
44
|
+
}>(),
|
|
45
|
+
{
|
|
46
|
+
type: 'button',
|
|
47
|
+
},
|
|
48
|
+
)
|
|
49
|
+
const NuxtLink = resolveComponent('NuxtLink')
|
|
50
|
+
const RouterLink = resolveComponent('RouterLink')
|
|
51
|
+
|
|
52
|
+
// Accessibility: Determine if rendering a native button
|
|
53
|
+
const isButton = computed(() => (props.is || 'button') === 'button')
|
|
54
|
+
|
|
55
|
+
// Resolve the component to render
|
|
56
|
+
const resolvedComponent = computed(() => {
|
|
57
|
+
if (!props.is || props.is === 'button' || props.is === 'a') {
|
|
58
|
+
return props.is || 'button'
|
|
59
|
+
}
|
|
60
|
+
if (props.is === 'NuxtLink') return NuxtLink
|
|
61
|
+
if (props.is === 'RouterLink') return RouterLink
|
|
62
|
+
return props.is
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
// Accessibility: Keyboard event handler for custom elements
|
|
66
|
+
function onKeydown(e: KeyboardEvent) {
|
|
67
|
+
if (props.disabled) {
|
|
68
|
+
return
|
|
69
|
+
}
|
|
70
|
+
if (e.code === 'Space' || e.code === 'Enter' || e.key === ' ' || e.key === 'Enter') {
|
|
71
|
+
e.preventDefault()
|
|
72
|
+
// @ts-expect-error: $el may not exist yet
|
|
73
|
+
e.currentTarget?.click?.()
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<template>
|
|
79
|
+
<component
|
|
80
|
+
:is="resolvedComponent"
|
|
81
|
+
:type="isButton ? type : undefined"
|
|
82
|
+
:disabled="isButton && disabled ? true : undefined"
|
|
83
|
+
:aria-disabled="!isButton && disabled ? true : undefined"
|
|
84
|
+
:tabindex="!isButton ? (disabled ? -1 : 0) : undefined"
|
|
85
|
+
:role="!isButton ? 'button' : undefined"
|
|
86
|
+
class="btn"
|
|
87
|
+
:class="{
|
|
88
|
+
'join-item': join,
|
|
89
|
+
|
|
90
|
+
'btn-neutral': !disabled && (neutral || color === 'neutral'),
|
|
91
|
+
'btn-primary': !disabled && (primary || color === 'primary'),
|
|
92
|
+
'btn-secondary': !disabled && (secondary || color === 'secondary'),
|
|
93
|
+
'btn-accent': !disabled && (accent || color === 'accent'),
|
|
94
|
+
'btn-info': !disabled && (info || color === 'info'),
|
|
95
|
+
'btn-success': !disabled && (success || color === 'success'),
|
|
96
|
+
'btn-warning': !disabled && (warning || color === 'warning'),
|
|
97
|
+
'btn-error': !disabled && (error || color === 'error'),
|
|
98
|
+
|
|
99
|
+
'text-primary': !disabled && (primary || color === 'primary') && link,
|
|
100
|
+
'text-secondary': !disabled && (secondary || color === 'secondary') && link,
|
|
101
|
+
'text-neutral': !disabled && (neutral || color === 'neutral') && link,
|
|
102
|
+
'text-accent': !disabled && (accent || color === 'accent') && link,
|
|
103
|
+
'text-info': !disabled && (info || color === 'info') && link,
|
|
104
|
+
'text-success': !disabled && (success || color === 'success') && link,
|
|
105
|
+
'text-warning': !disabled && (warning || color === 'warning') && link,
|
|
106
|
+
'text-error': !disabled && (error || color === 'error') && link,
|
|
107
|
+
|
|
108
|
+
glass: !disabled && glass,
|
|
109
|
+
|
|
110
|
+
'btn-circle': circle || shape === 'circle',
|
|
111
|
+
'btn-square': square || shape === 'square',
|
|
112
|
+
'btn-wide': wide || shape === 'wide',
|
|
113
|
+
'btn-block': block || shape === 'block',
|
|
114
|
+
|
|
115
|
+
'btn-xl': xl || size === 'xl',
|
|
116
|
+
'btn-lg': lg || size === 'lg',
|
|
117
|
+
'btn-md': md || size === 'md',
|
|
118
|
+
'btn-sm': sm || size === 'sm',
|
|
119
|
+
'btn-xs': xs || size === 'xs',
|
|
120
|
+
|
|
121
|
+
'btn-outline': !disabled && outline,
|
|
122
|
+
'btn-dash': !disabled && dash,
|
|
123
|
+
'btn-ghost': !disabled && ghost,
|
|
124
|
+
'btn-soft': !disabled && soft,
|
|
125
|
+
'btn-link': !disabled && link,
|
|
126
|
+
'btn-disabled': disabled,
|
|
127
|
+
|
|
128
|
+
'no-animation': noAnimation,
|
|
129
|
+
'btn-active': !disabled && active,
|
|
130
|
+
}"
|
|
131
|
+
@keydown="!isButton ? onKeydown : undefined"
|
|
132
|
+
>
|
|
133
|
+
<slot />
|
|
134
|
+
</component>
|
|
135
|
+
</template>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PikadayOptions } from 'pikaday'
|
|
3
|
+
import { onMounted, ref } from 'vue'
|
|
4
|
+
import { usePikaday } from '~/composables/use-pikaday'
|
|
5
|
+
import CalendarSkeleton from './CalendarSkeleton.vue'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
/** Bound value: Date object or ISO string or null */
|
|
9
|
+
modelValue: Date | string | null
|
|
10
|
+
/** All Pikaday options (except `container` and `bound`) */
|
|
11
|
+
options?: Omit<PikadayOptions, 'container' | 'bound'>
|
|
12
|
+
/** If true, default to today when no value provided */
|
|
13
|
+
autoDefault?: boolean
|
|
14
|
+
}>()
|
|
15
|
+
const emit = defineEmits<{
|
|
16
|
+
(e: 'update:modelValue', v: Date | null): void
|
|
17
|
+
}>()
|
|
18
|
+
|
|
19
|
+
const containerRef = ref<HTMLElement | null>(null)
|
|
20
|
+
const loading = ref(true)
|
|
21
|
+
|
|
22
|
+
const defaultOptions: Partial<PikadayOptions> = {
|
|
23
|
+
format: 'D MMM YYYY',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Determine the date to use for the skeleton
|
|
27
|
+
const skeletonDate = computed(() => {
|
|
28
|
+
// Try to use modelValue if it's a Date
|
|
29
|
+
if (props.modelValue instanceof Date) {
|
|
30
|
+
return props.modelValue
|
|
31
|
+
}
|
|
32
|
+
// Try to parse modelValue if it's a string
|
|
33
|
+
if (typeof props.modelValue === 'string') {
|
|
34
|
+
return new Date(props.modelValue)
|
|
35
|
+
}
|
|
36
|
+
// Use defaultDate from options if provided
|
|
37
|
+
if (props.options?.defaultDate instanceof Date) {
|
|
38
|
+
return props.options.defaultDate
|
|
39
|
+
}
|
|
40
|
+
// Fall back to today
|
|
41
|
+
return new Date()
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
function handleSelect(date: Date) {
|
|
45
|
+
emit('update:modelValue', date)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const { createPicker } = usePikaday(
|
|
49
|
+
{
|
|
50
|
+
...defaultOptions,
|
|
51
|
+
...props.options,
|
|
52
|
+
bound: false,
|
|
53
|
+
},
|
|
54
|
+
handleSelect,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
onMounted(async () => {
|
|
58
|
+
if (containerRef.value) {
|
|
59
|
+
const picker = await createPicker(containerRef.value)
|
|
60
|
+
if (picker && picker.el && !containerRef.value.contains(picker.el)) {
|
|
61
|
+
containerRef.value.appendChild(picker.el)
|
|
62
|
+
}
|
|
63
|
+
loading.value = false
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<div class="relative w-[270px] h-[270px]">
|
|
70
|
+
<div class="absolute inset-0">
|
|
71
|
+
<CalendarSkeleton
|
|
72
|
+
:number-of-months="options?.numberOfMonths ?? 1"
|
|
73
|
+
:date="skeletonDate"
|
|
74
|
+
:first-day="options?.firstDay"
|
|
75
|
+
:class="loading ? '' : 'opacity-0 pointer-events-none transition-opacity duration-300'"
|
|
76
|
+
/>
|
|
77
|
+
</div>
|
|
78
|
+
<div ref="containerRef" class="absolute inset-0 inline-block w-full h-full" />
|
|
79
|
+
<span class="pika-single hidden" />
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<style>
|
|
84
|
+
.has-event {
|
|
85
|
+
.pika-button {
|
|
86
|
+
color: var(--color-primary);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
</style>
|