@thekestongroup/ui 0.0.0-stage → 0.1.1

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 (46) hide show
  1. package/LICENSE +130 -0
  2. package/README.md +55 -2
  3. package/dist/components/Button.vue.d.ts +27 -0
  4. package/dist/components/Checkbox.vue.d.ts +18 -0
  5. package/dist/components/CloseButton.vue.d.ts +6 -0
  6. package/dist/components/Dialog.vue.d.ts +23 -0
  7. package/dist/components/Drawer.vue.d.ts +26 -0
  8. package/dist/components/DropdownMenu.vue.d.ts +21 -0
  9. package/dist/components/DropdownMenuItem.vue.d.ts +19 -0
  10. package/dist/components/DropdownMenuSeparator.vue.d.ts +6 -0
  11. package/dist/components/Input.vue.d.ts +14 -0
  12. package/dist/components/Label.vue.d.ts +16 -0
  13. package/dist/components/Popover.vue.d.ts +23 -0
  14. package/dist/components/Select.vue.d.ts +28 -0
  15. package/dist/components/Separator.vue.d.ts +11 -0
  16. package/dist/components/ToastRenderer.vue.d.ts +3 -0
  17. package/dist/components/Toaster.vue.d.ts +3 -0
  18. package/dist/components/Tooltip.vue.d.ts +23 -0
  19. package/dist/favicon-old.svg +1 -0
  20. package/dist/favicon.svg +1 -0
  21. package/dist/index.d.ts +18 -0
  22. package/dist/keston-ui.cjs +14 -0
  23. package/dist/keston-ui.css +1 -0
  24. package/dist/keston-ui.js +14065 -0
  25. package/dist/lib/cn.d.ts +2 -0
  26. package/dist/lib/toast.d.ts +8 -0
  27. package/package.json +50 -3
  28. package/src/components/Button.vue +54 -0
  29. package/src/components/Checkbox.vue +47 -0
  30. package/src/components/CloseButton.vue +24 -0
  31. package/src/components/Dialog.vue +65 -0
  32. package/src/components/Drawer.vue +200 -0
  33. package/src/components/DropdownMenu.vue +41 -0
  34. package/src/components/DropdownMenuItem.vue +28 -0
  35. package/src/components/DropdownMenuSeparator.vue +12 -0
  36. package/src/components/Input.vue +21 -0
  37. package/src/components/Label.vue +15 -0
  38. package/src/components/Popover.vue +46 -0
  39. package/src/components/Select.vue +97 -0
  40. package/src/components/Separator.vue +30 -0
  41. package/src/components/ToastRenderer.vue +140 -0
  42. package/src/components/Toaster.vue +11 -0
  43. package/src/components/Tooltip.vue +48 -0
  44. package/src/index.ts +23 -0
  45. package/src/lib/cn.ts +6 -0
  46. package/src/lib/toast.ts +19 -0
@@ -0,0 +1,2 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,8 @@
1
+ export declare const toast: {
2
+ add: <T extends any = any>(options: import('reka-ui').ToastAddOptions<T>) => string;
3
+ update: <T extends any = any>(id: string, updates: import('reka-ui').ToastUpdateOptions<T> | ((prevToast: import('reka-ui').ToastObject<T>) => import('reka-ui').ToastUpdateOptions<T>)) => void;
4
+ close: (id?: string) => void;
5
+ promise: <Value, T extends any = any>(promise: Promise<Value>, options: import('reka-ui').ToastPromiseOptions<Value, T>) => Promise<Value>;
6
+ };
7
+ export declare const toastManager: import('reka-ui').GlobalToastManager<any>;
8
+ export type { ToastObject, ToastAddOptions, ToastUpdateOptions, ToastPromiseOptions, } from 'reka-ui';
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@thekestongroup/ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Keston UI — Vue 3 + Reka UI + Tailwind CSS component library",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "type": "module",
7
+ "files": [
8
+ "dist",
9
+ "src"
10
+ ],
11
+ "main": "./dist/keston-ui.cjs",
12
+ "module": "./dist/keston-ui.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/keston-ui.js",
18
+ "require": "./dist/keston-ui.cjs"
19
+ },
20
+ "./style.css": "./dist/keston-ui.css"
21
+ },
22
+ "sideEffects": [
23
+ "*.css"
24
+ ],
25
+ "peerDependencies": {
26
+ "vue": "^3.5.0"
27
+ },
28
+ "devDependencies": {
29
+ "@tailwindcss/vite": "^4.3.3",
30
+ "@types/node": "^24.13.3",
31
+ "@vitejs/plugin-vue": "^6.0.10",
32
+ "@vue/tsconfig": "^0.9.1",
33
+ "clsx": "^2.1.1",
34
+ "reka-ui": "^2.11.0",
35
+ "tailwind-merge": "^3.7.0",
36
+ "tailwindcss": "^4.3.3",
37
+ "typescript": "~6.0.2",
38
+ "vite": "^7.0.0",
39
+ "vite-plugin-dts": "^5.1.2",
40
+ "vue": "^3.5.42",
41
+ "vue-tsc": "^3.3.13"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "registry": "https://registry.npmjs.org/"
46
+ },
47
+ "scripts": {
48
+ "dev": "vite",
49
+ "build": "vite build",
50
+ "typecheck": "vue-tsc -b",
51
+ "preview": "vite preview"
52
+ }
6
53
  }
@@ -0,0 +1,54 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue'
3
+ import { cn } from '../lib/cn'
4
+
5
+ type Variant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'destructive'
6
+ type Size = 'sm' | 'md' | 'lg'
7
+
8
+ const props = withDefaults(
9
+ defineProps<{
10
+ variant?: Variant
11
+ size?: Size
12
+ type?: 'button' | 'submit' | 'reset'
13
+ disabled?: boolean
14
+ class?: string
15
+ }>(),
16
+ {
17
+ variant: 'primary',
18
+ size: 'md',
19
+ type: 'button',
20
+ disabled: false,
21
+ },
22
+ )
23
+
24
+ const variantClasses: Record<Variant, string> = {
25
+ primary: 'bg-blue-600 text-white hover:bg-blue-700 focus-visible:ring-blue-500',
26
+ secondary: 'bg-neutral-100 text-neutral-900 hover:bg-neutral-200 focus-visible:ring-neutral-400',
27
+ outline: 'border border-neutral-300 text-neutral-900 hover:bg-neutral-100 focus-visible:ring-neutral-400',
28
+ ghost: 'text-neutral-700 hover:bg-neutral-100 focus-visible:ring-neutral-400',
29
+ destructive: 'bg-red-600 text-white hover:bg-red-700 focus-visible:ring-red-500',
30
+ }
31
+
32
+ const sizeClasses: Record<Size, string> = {
33
+ sm: 'h-8 px-3 text-sm',
34
+ md: 'h-10 px-4 text-sm',
35
+ lg: 'h-12 px-6 text-base',
36
+ }
37
+
38
+ const classes = computed(() =>
39
+ cn(
40
+ 'inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors',
41
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
42
+ 'disabled:pointer-events-none disabled:opacity-50',
43
+ variantClasses[props.variant],
44
+ sizeClasses[props.size],
45
+ props.class,
46
+ ),
47
+ )
48
+ </script>
49
+
50
+ <template>
51
+ <button :type="type" :disabled="disabled" :class="classes">
52
+ <slot />
53
+ </button>
54
+ </template>
@@ -0,0 +1,47 @@
1
+ <script setup lang="ts">
2
+ import { CheckboxIndicator, CheckboxRoot } from 'reka-ui'
3
+ import { cn } from '../lib/cn'
4
+
5
+ const model = defineModel<boolean>({ default: false })
6
+
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ id?: string
10
+ disabled?: boolean
11
+ class?: string
12
+ }>(),
13
+ {
14
+ disabled: false,
15
+ },
16
+ )
17
+ </script>
18
+
19
+ <template>
20
+ <CheckboxRoot
21
+ :id="props.id"
22
+ v-model="model"
23
+ :disabled="props.disabled"
24
+ :class="
25
+ cn(
26
+ 'peer h-4 w-4 shrink-0 rounded border border-neutral-300 bg-white outline-none data-[state=checked]:border-blue-600 data-[state=checked]:bg-blue-600 focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
27
+ props.class,
28
+ )
29
+ "
30
+ >
31
+ <CheckboxIndicator class="flex h-full w-full items-center justify-center text-white">
32
+ <svg
33
+ class="h-3 w-3"
34
+ viewBox="0 0 15 15"
35
+ fill="none"
36
+ xmlns="http://www.w3.org/2000/svg"
37
+ >
38
+ <path
39
+ d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z"
40
+ fill="currentColor"
41
+ fill-rule="evenodd"
42
+ clip-rule="evenodd"
43
+ />
44
+ </svg>
45
+ </CheckboxIndicator>
46
+ </CheckboxRoot>
47
+ </template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../lib/cn'
3
+
4
+ const props = defineProps<{
5
+ class?: string
6
+ }>()
7
+ </script>
8
+
9
+ <template>
10
+ <svg
11
+ :class="cn('h-4 w-4', props.class)"
12
+ viewBox="0 0 15 15"
13
+ fill="none"
14
+ aria-hidden="true"
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ >
17
+ <path
18
+ d="M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z"
19
+ fill="currentColor"
20
+ fill-rule="evenodd"
21
+ clip-rule="evenodd"
22
+ />
23
+ </svg>
24
+ </template>
@@ -0,0 +1,65 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ DialogClose,
4
+ DialogContent,
5
+ DialogDescription,
6
+ DialogOverlay,
7
+ DialogPortal,
8
+ DialogRoot,
9
+ DialogTitle,
10
+ DialogTrigger,
11
+ VisuallyHidden,
12
+ } from 'reka-ui'
13
+ import { cn } from '../lib/cn'
14
+ import CloseButton from './CloseButton.vue'
15
+
16
+ const props = withDefaults(
17
+ defineProps<{
18
+ title?: string
19
+ description?: string
20
+ class?: string
21
+ }>(),
22
+ {
23
+ title: '',
24
+ description: '',
25
+ },
26
+ )
27
+ </script>
28
+
29
+ <template>
30
+ <DialogRoot>
31
+ <DialogTrigger as-child>
32
+ <slot name="trigger" />
33
+ </DialogTrigger>
34
+ <DialogPortal>
35
+ <DialogOverlay class="fixed inset-0 z-50 bg-black/50" />
36
+ <DialogContent
37
+ :class="
38
+ cn(
39
+ 'fixed left-1/2 top-1/2 z-50 w-[90vw] max-w-md -translate-x-1/2 -translate-y-1/2 rounded-lg bg-white p-6 shadow-lg outline-none',
40
+ props.class,
41
+ )
42
+ "
43
+ >
44
+ <DialogTitle v-if="props.title" class="text-lg font-semibold text-neutral-900">
45
+ {{ props.title }}
46
+ </DialogTitle>
47
+ <DialogTitle v-else>
48
+ <VisuallyHidden>Dialog</VisuallyHidden>
49
+ </DialogTitle>
50
+ <DialogDescription v-if="props.description" class="mt-1 text-sm text-neutral-500">
51
+ {{ props.description }}
52
+ </DialogDescription>
53
+ <div class="mt-4">
54
+ <slot />
55
+ </div>
56
+ <DialogClose
57
+ aria-label="Close"
58
+ class="absolute right-4 top-4 rounded-sm text-neutral-400 outline-none hover:text-neutral-600 focus-visible:ring-2 focus-visible:ring-blue-500"
59
+ >
60
+ <CloseButton />
61
+ </DialogClose>
62
+ </DialogContent>
63
+ </DialogPortal>
64
+ </DialogRoot>
65
+ </template>
@@ -0,0 +1,200 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ DrawerClose,
4
+ DrawerContent,
5
+ DrawerDescription,
6
+ DrawerOverlay,
7
+ DrawerPortal,
8
+ DrawerRoot,
9
+ DrawerTitle,
10
+ DrawerTrigger,
11
+ VisuallyHidden,
12
+ } from 'reka-ui'
13
+ import { computed } from 'vue'
14
+ import { cn } from '../lib/cn'
15
+ import CloseButton from './CloseButton.vue'
16
+
17
+ type Side = 'top' | 'right' | 'bottom' | 'left'
18
+
19
+ const props = withDefaults(
20
+ defineProps<{
21
+ title?: string
22
+ description?: string
23
+ side?: Side
24
+ class?: string
25
+ }>(),
26
+ {
27
+ title: '',
28
+ description: '',
29
+ side: 'right',
30
+ },
31
+ )
32
+
33
+ const swipeDirection = computed(() => {
34
+ switch (props.side) {
35
+ case 'top':
36
+ return 'up'
37
+ case 'bottom':
38
+ return 'down'
39
+ default:
40
+ return props.side
41
+ }
42
+ })
43
+
44
+ const contentClasses = computed(() => {
45
+ const base = 'kui-drawer-content kui-drawer-'
46
+ switch (props.side) {
47
+ case 'top':
48
+ return cn(base + 'top fixed inset-x-0 top-0 z-50 w-full max-h-[85vh] rounded-b-2xl border-b border-neutral-200 bg-white p-6 shadow-lg', props.class)
49
+ case 'bottom':
50
+ return cn(base + 'bottom fixed inset-x-0 bottom-0 z-50 w-full max-h-[85vh] rounded-t-2xl border-t border-neutral-200 bg-white p-6 shadow-lg', props.class)
51
+ case 'left':
52
+ return cn(base + 'left fixed inset-y-0 left-0 z-50 h-full w-full max-w-sm border-r border-neutral-200 bg-white p-6 shadow-lg', props.class)
53
+ case 'right':
54
+ default:
55
+ return cn(base + 'right fixed inset-y-0 right-0 z-50 h-full w-full max-w-sm border-l border-neutral-200 bg-white p-6 shadow-lg', props.class)
56
+ }
57
+ })
58
+ </script>
59
+
60
+ <template>
61
+ <DrawerRoot :swipe-direction="swipeDirection">
62
+ <DrawerTrigger as-child>
63
+ <slot name="trigger" />
64
+ </DrawerTrigger>
65
+ <DrawerPortal>
66
+ <DrawerOverlay class="kui-drawer-overlay fixed inset-0 z-50 bg-black/50" />
67
+ <DrawerContent :class="contentClasses">
68
+ <DrawerTitle v-if="props.title" class="text-lg font-semibold text-neutral-900">
69
+ {{ props.title }}
70
+ </DrawerTitle>
71
+ <DrawerTitle v-else>
72
+ <VisuallyHidden>Drawer</VisuallyHidden>
73
+ </DrawerTitle>
74
+ <DrawerDescription v-if="props.description" class="mt-1 text-sm text-neutral-500">
75
+ {{ props.description }}
76
+ </DrawerDescription>
77
+ <div class="mt-4">
78
+ <slot />
79
+ </div>
80
+ <DrawerClose
81
+ aria-label="Close"
82
+ class="absolute right-4 top-4 rounded-sm text-neutral-400 outline-none hover:text-neutral-600 focus-visible:ring-2 focus-visible:ring-blue-500"
83
+ >
84
+ <CloseButton />
85
+ </DrawerClose>
86
+ </DrawerContent>
87
+ </DrawerPortal>
88
+ </DrawerRoot>
89
+ </template>
90
+
91
+ <style>
92
+ .kui-drawer-content {
93
+ outline: none;
94
+ transition: transform 300ms ease-in-out;
95
+ }
96
+
97
+ .kui-drawer-content[data-swiping] {
98
+ transition-duration: 0ms;
99
+ }
100
+
101
+ .kui-drawer-right,
102
+ .kui-drawer-left {
103
+ transform: translateX(var(--drawer-swipe-movement-x, 0px));
104
+ }
105
+
106
+ .kui-drawer-top,
107
+ .kui-drawer-bottom {
108
+ transform: translateY(var(--drawer-swipe-movement-y, 0px));
109
+ }
110
+
111
+ .kui-drawer-right[data-state='open'] {
112
+ animation: kui-drawer-in-right 300ms ease-in-out;
113
+ }
114
+ .kui-drawer-right[data-state='closed'] {
115
+ animation: kui-drawer-out-right 300ms ease-in-out;
116
+ }
117
+ .kui-drawer-left[data-state='open'] {
118
+ animation: kui-drawer-in-left 300ms ease-in-out;
119
+ }
120
+ .kui-drawer-left[data-state='closed'] {
121
+ animation: kui-drawer-out-left 300ms ease-in-out;
122
+ }
123
+ .kui-drawer-top[data-state='open'] {
124
+ animation: kui-drawer-in-top 300ms ease-in-out;
125
+ }
126
+ .kui-drawer-top[data-state='closed'] {
127
+ animation: kui-drawer-out-top 300ms ease-in-out;
128
+ }
129
+ .kui-drawer-bottom[data-state='open'] {
130
+ animation: kui-drawer-in-bottom 300ms ease-in-out;
131
+ }
132
+ .kui-drawer-bottom[data-state='closed'] {
133
+ animation: kui-drawer-out-bottom 300ms ease-in-out;
134
+ }
135
+
136
+ .kui-drawer-overlay[data-state='open'] {
137
+ animation: kui-drawer-overlay-in 300ms ease-in-out;
138
+ }
139
+ .kui-drawer-overlay[data-state='closed'] {
140
+ animation: kui-drawer-overlay-out 300ms ease-in-out;
141
+ }
142
+
143
+ @keyframes kui-drawer-in-right {
144
+ from {
145
+ translate: 100% 0;
146
+ }
147
+ }
148
+ @keyframes kui-drawer-out-right {
149
+ to {
150
+ translate: 100% 0;
151
+ }
152
+ }
153
+ @keyframes kui-drawer-in-left {
154
+ from {
155
+ translate: -100% 0;
156
+ }
157
+ }
158
+ @keyframes kui-drawer-out-left {
159
+ to {
160
+ translate: -100% 0;
161
+ }
162
+ }
163
+ @keyframes kui-drawer-in-top {
164
+ from {
165
+ translate: 0 -100%;
166
+ }
167
+ }
168
+ @keyframes kui-drawer-out-top {
169
+ to {
170
+ translate: 0 -100%;
171
+ }
172
+ }
173
+ @keyframes kui-drawer-in-bottom {
174
+ from {
175
+ translate: 0 100%;
176
+ }
177
+ }
178
+ @keyframes kui-drawer-out-bottom {
179
+ to {
180
+ translate: 0 100%;
181
+ }
182
+ }
183
+
184
+ @keyframes kui-drawer-overlay-in {
185
+ from {
186
+ opacity: 0;
187
+ }
188
+ to {
189
+ opacity: 1;
190
+ }
191
+ }
192
+ @keyframes kui-drawer-overlay-out {
193
+ from {
194
+ opacity: 1;
195
+ }
196
+ to {
197
+ opacity: 0;
198
+ }
199
+ }
200
+ </style>
@@ -0,0 +1,41 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ DropdownMenuContent,
4
+ DropdownMenuPortal,
5
+ DropdownMenuRoot,
6
+ DropdownMenuTrigger,
7
+ } from 'reka-ui'
8
+ import { cn } from '../lib/cn'
9
+
10
+ const props = withDefaults(
11
+ defineProps<{
12
+ align?: 'start' | 'center' | 'end'
13
+ class?: string
14
+ }>(),
15
+ {
16
+ align: 'center',
17
+ },
18
+ )
19
+ </script>
20
+
21
+ <template>
22
+ <DropdownMenuRoot>
23
+ <DropdownMenuTrigger as-child>
24
+ <slot name="trigger" />
25
+ </DropdownMenuTrigger>
26
+ <DropdownMenuPortal>
27
+ <DropdownMenuContent
28
+ :align="props.align"
29
+ :side-offset="5"
30
+ :class="
31
+ cn(
32
+ 'z-50 min-w-[10rem] rounded-md border border-neutral-200 bg-white p-1 shadow-md outline-none',
33
+ props.class,
34
+ )
35
+ "
36
+ >
37
+ <slot />
38
+ </DropdownMenuContent>
39
+ </DropdownMenuPortal>
40
+ </DropdownMenuRoot>
41
+ </template>
@@ -0,0 +1,28 @@
1
+ <script setup lang="ts">
2
+ import { DropdownMenuItem } from 'reka-ui'
3
+ import { cn } from '../lib/cn'
4
+
5
+ const props = withDefaults(
6
+ defineProps<{
7
+ disabled?: boolean
8
+ class?: string
9
+ }>(),
10
+ {
11
+ disabled: false,
12
+ },
13
+ )
14
+ </script>
15
+
16
+ <template>
17
+ <DropdownMenuItem
18
+ :disabled="props.disabled"
19
+ :class="
20
+ cn(
21
+ 'relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm text-neutral-700 outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-neutral-100 data-[highlighted]:text-neutral-900',
22
+ props.class,
23
+ )
24
+ "
25
+ >
26
+ <slot />
27
+ </DropdownMenuItem>
28
+ </template>
@@ -0,0 +1,12 @@
1
+ <script setup lang="ts">
2
+ import { DropdownMenuSeparator } from 'reka-ui'
3
+ import { cn } from '../lib/cn'
4
+
5
+ const props = defineProps<{
6
+ class?: string
7
+ }>()
8
+ </script>
9
+
10
+ <template>
11
+ <DropdownMenuSeparator :class="cn('my-1 h-px bg-neutral-200', props.class)" />
12
+ </template>
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../lib/cn'
3
+
4
+ const model = defineModel<string>({ default: '' })
5
+
6
+ const props = defineProps<{
7
+ class?: string
8
+ }>()
9
+ </script>
10
+
11
+ <template>
12
+ <input
13
+ v-model="model"
14
+ :class="
15
+ cn(
16
+ 'h-10 w-full rounded-md border border-neutral-300 bg-white px-3 text-sm text-neutral-900 placeholder:text-neutral-400 outline-none transition-colors focus-visible:border-blue-500 focus-visible:ring-2 focus-visible:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-50',
17
+ props.class,
18
+ )
19
+ "
20
+ />
21
+ </template>
@@ -0,0 +1,15 @@
1
+ <script setup lang="ts">
2
+ import { cn } from '../lib/cn'
3
+
4
+ defineOptions({ inheritAttrs: false })
5
+
6
+ const props = defineProps<{
7
+ class?: string
8
+ }>()
9
+ </script>
10
+
11
+ <template>
12
+ <label v-bind="$attrs" :class="cn('text-sm font-medium text-neutral-700', props.class)">
13
+ <slot />
14
+ </label>
15
+ </template>
@@ -0,0 +1,46 @@
1
+ <script setup lang="ts">
2
+ import {
3
+ PopoverArrow,
4
+ PopoverContent,
5
+ PopoverPortal,
6
+ PopoverRoot,
7
+ PopoverTrigger,
8
+ } from 'reka-ui'
9
+ import { cn } from '../lib/cn'
10
+
11
+ const props = withDefaults(
12
+ defineProps<{
13
+ side?: 'top' | 'right' | 'bottom' | 'left'
14
+ align?: 'start' | 'center' | 'end'
15
+ class?: string
16
+ }>(),
17
+ {
18
+ side: 'bottom',
19
+ align: 'center',
20
+ },
21
+ )
22
+ </script>
23
+
24
+ <template>
25
+ <PopoverRoot>
26
+ <PopoverTrigger as-child>
27
+ <slot name="trigger" />
28
+ </PopoverTrigger>
29
+ <PopoverPortal>
30
+ <PopoverContent
31
+ :side="props.side"
32
+ :align="props.align"
33
+ :side-offset="5"
34
+ :class="
35
+ cn(
36
+ 'z-50 w-72 rounded-md border border-neutral-200 bg-white p-4 shadow-md outline-none',
37
+ props.class,
38
+ )
39
+ "
40
+ >
41
+ <slot />
42
+ <PopoverArrow class="fill-white" />
43
+ </PopoverContent>
44
+ </PopoverPortal>
45
+ </PopoverRoot>
46
+ </template>