@personizely/ui 0.0.42

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 (221) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +1 -0
  3. package/dist/personizely-ui.css +6 -0
  4. package/dist/personizely-ui.js +26854 -0
  5. package/dist/personizely-ui.umd.cjs +111 -0
  6. package/package.json +117 -0
  7. package/src/assets/index.css +136 -0
  8. package/src/components/ui/accordion/Accordion.vue +19 -0
  9. package/src/components/ui/accordion/AccordionContent.vue +24 -0
  10. package/src/components/ui/accordion/AccordionItem.vue +37 -0
  11. package/src/components/ui/accordion/AccordionTrigger.vue +39 -0
  12. package/src/components/ui/accordion/index.ts +2 -0
  13. package/src/components/ui/alert/Alert.vue +68 -0
  14. package/src/components/ui/alert/index.ts +22 -0
  15. package/src/components/ui/alert-dialog/AlertDialog.vue +66 -0
  16. package/src/components/ui/alert-dialog/AlertDialogContent.vue +44 -0
  17. package/src/components/ui/alert-dialog/AlertDialogProvider.vue +27 -0
  18. package/src/components/ui/alert-dialog/AlertDialogTrigger.vue +11 -0
  19. package/src/components/ui/alert-dialog/index.ts +3 -0
  20. package/src/components/ui/alert-dialog/useAlertDialog.ts +19 -0
  21. package/src/components/ui/autocomplete/Autocomplete.vue +170 -0
  22. package/src/components/ui/autocomplete/AutocompleteContent.vue +27 -0
  23. package/src/components/ui/autocomplete/AutocompleteEmpty.vue +20 -0
  24. package/src/components/ui/autocomplete/AutocompleteGroup.vue +29 -0
  25. package/src/components/ui/autocomplete/AutocompleteItem.vue +26 -0
  26. package/src/components/ui/autocomplete/AutocompleteRoot.vue +31 -0
  27. package/src/components/ui/autocomplete/AutocompleteSeparator.vue +23 -0
  28. package/src/components/ui/autocomplete/index.ts +1 -0
  29. package/src/components/ui/avatar/Avatar.vue +31 -0
  30. package/src/components/ui/avatar/AvatarFallback.vue +11 -0
  31. package/src/components/ui/avatar/AvatarImage.vue +9 -0
  32. package/src/components/ui/avatar/index.ts +19 -0
  33. package/src/components/ui/badge/Badge.vue +16 -0
  34. package/src/components/ui/badge/index.ts +22 -0
  35. package/src/components/ui/button/Button.vue +123 -0
  36. package/src/components/ui/button/index.ts +78 -0
  37. package/src/components/ui/calendar/Calendar.vue +76 -0
  38. package/src/components/ui/calendar/CalendarCell.vue +24 -0
  39. package/src/components/ui/calendar/CalendarCellTrigger.vue +38 -0
  40. package/src/components/ui/calendar/CalendarGrid.vue +24 -0
  41. package/src/components/ui/calendar/CalendarGridBody.vue +11 -0
  42. package/src/components/ui/calendar/CalendarGridHead.vue +11 -0
  43. package/src/components/ui/calendar/CalendarGridRow.vue +21 -0
  44. package/src/components/ui/calendar/CalendarHeadCell.vue +21 -0
  45. package/src/components/ui/calendar/CalendarHeader.vue +21 -0
  46. package/src/components/ui/calendar/CalendarHeading.vue +27 -0
  47. package/src/components/ui/calendar/CalendarNextButton.vue +32 -0
  48. package/src/components/ui/calendar/CalendarPrevButton.vue +32 -0
  49. package/src/components/ui/calendar/index.ts +1 -0
  50. package/src/components/ui/card/Card.vue +57 -0
  51. package/src/components/ui/card/CardContent.vue +14 -0
  52. package/src/components/ui/card/CardDescription.vue +14 -0
  53. package/src/components/ui/card/CardFooter.vue +14 -0
  54. package/src/components/ui/card/CardHeader.vue +14 -0
  55. package/src/components/ui/card/CardTitle.vue +18 -0
  56. package/src/components/ui/card/CardTray.vue +14 -0
  57. package/src/components/ui/card/index.ts +1 -0
  58. package/src/components/ui/checkbox/Checkbox.vue +63 -0
  59. package/src/components/ui/checkbox/CheckboxBase.vue +39 -0
  60. package/src/components/ui/checkbox/index.ts +1 -0
  61. package/src/components/ui/checkbox-group/CheckboxGroup.vue +65 -0
  62. package/src/components/ui/checkbox-group/index.ts +15 -0
  63. package/src/components/ui/color-picker/Alpha.vue +63 -0
  64. package/src/components/ui/color-picker/Angle.vue +145 -0
  65. package/src/components/ui/color-picker/Checkboard.vue +43 -0
  66. package/src/components/ui/color-picker/Color.vue +255 -0
  67. package/src/components/ui/color-picker/ColorPicker.vue +25 -0
  68. package/src/components/ui/color-picker/Gradient.vue +172 -0
  69. package/src/components/ui/color-picker/Handle.vue +19 -0
  70. package/src/components/ui/color-picker/Hue.vue +80 -0
  71. package/src/components/ui/color-picker/LabelInput.vue +16 -0
  72. package/src/components/ui/color-picker/Rail.vue +100 -0
  73. package/src/components/ui/color-picker/Saturation.vue +142 -0
  74. package/src/components/ui/color-picker/index.ts +4 -0
  75. package/src/components/ui/combobox/Combobox.vue +202 -0
  76. package/src/components/ui/combobox/ComboboxContent.vue +27 -0
  77. package/src/components/ui/combobox/ComboboxEmpty.vue +20 -0
  78. package/src/components/ui/combobox/ComboboxGroup.vue +29 -0
  79. package/src/components/ui/combobox/ComboboxInput.vue +52 -0
  80. package/src/components/ui/combobox/ComboboxItem.vue +26 -0
  81. package/src/components/ui/combobox/ComboboxRoot.vue +31 -0
  82. package/src/components/ui/combobox/ComboboxSeparator.vue +23 -0
  83. package/src/components/ui/combobox/index.ts +1 -0
  84. package/src/components/ui/date-picker/DatePicker.vue +55 -0
  85. package/src/components/ui/date-picker/index.ts +1 -0
  86. package/src/components/ui/date-range-picker/DateRangePicker.vue +137 -0
  87. package/src/components/ui/date-range-picker/index.ts +1 -0
  88. package/src/components/ui/dialog/Dialog.vue +78 -0
  89. package/src/components/ui/dialog/DialogContent.vue +46 -0
  90. package/src/components/ui/dialog/DialogDescription.vue +24 -0
  91. package/src/components/ui/dialog/DialogFooter.vue +19 -0
  92. package/src/components/ui/dialog/DialogHeader.vue +16 -0
  93. package/src/components/ui/dialog/DialogTitle.vue +29 -0
  94. package/src/components/ui/dialog/DialogTrigger.vue +11 -0
  95. package/src/components/ui/dialog/index.ts +1 -0
  96. package/src/components/ui/drawer/Drawer.vue +88 -0
  97. package/src/components/ui/drawer/DrawerContent.vue +57 -0
  98. package/src/components/ui/drawer/DrawerDescription.vue +22 -0
  99. package/src/components/ui/drawer/DrawerFooter.vue +19 -0
  100. package/src/components/ui/drawer/DrawerHeader.vue +16 -0
  101. package/src/components/ui/drawer/DrawerTitle.vue +22 -0
  102. package/src/components/ui/drawer/DrawerTrigger.vue +11 -0
  103. package/src/components/ui/drawer/index.ts +21 -0
  104. package/src/components/ui/dropdown-menu/DropdownCheckboxGroupMenu.vue +87 -0
  105. package/src/components/ui/dropdown-menu/DropdownMenu.vue +72 -0
  106. package/src/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +40 -0
  107. package/src/components/ui/dropdown-menu/DropdownMenuContent.vue +37 -0
  108. package/src/components/ui/dropdown-menu/DropdownMenuGroup.vue +11 -0
  109. package/src/components/ui/dropdown-menu/DropdownMenuHelp.vue +14 -0
  110. package/src/components/ui/dropdown-menu/DropdownMenuItem.vue +28 -0
  111. package/src/components/ui/dropdown-menu/DropdownMenuLabel.vue +24 -0
  112. package/src/components/ui/dropdown-menu/DropdownMenuPart.vue +64 -0
  113. package/src/components/ui/dropdown-menu/DropdownMenuPartItem.vue +76 -0
  114. package/src/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +19 -0
  115. package/src/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +41 -0
  116. package/src/components/ui/dropdown-menu/DropdownMenuSeparator.vue +22 -0
  117. package/src/components/ui/dropdown-menu/DropdownMenuShortcut.vue +14 -0
  118. package/src/components/ui/dropdown-menu/DropdownMenuSub.vue +19 -0
  119. package/src/components/ui/dropdown-menu/DropdownMenuSubContent.vue +30 -0
  120. package/src/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +33 -0
  121. package/src/components/ui/dropdown-menu/DropdownMenuTrigger.vue +13 -0
  122. package/src/components/ui/dropdown-menu/DropdownRadioGroupMenu.vue +75 -0
  123. package/src/components/ui/dropdown-menu/index.ts +36 -0
  124. package/src/components/ui/file-upload-button/FileUploadButton.vue +55 -0
  125. package/src/components/ui/file-upload-button/index.ts +1 -0
  126. package/src/components/ui/form/Form.vue +13 -0
  127. package/src/components/ui/form/FormControl.vue +16 -0
  128. package/src/components/ui/form/FormDescription.vue +20 -0
  129. package/src/components/ui/form/FormField.vue +61 -0
  130. package/src/components/ui/form/FormLabel.vue +23 -0
  131. package/src/components/ui/form/FormMessage.vue +16 -0
  132. package/src/components/ui/form/index.ts +2 -0
  133. package/src/components/ui/form/useFormField.ts +30 -0
  134. package/src/components/ui/icon/Icon.vue +16 -0
  135. package/src/components/ui/icon/index.ts +1 -0
  136. package/src/components/ui/input/Input.vue +51 -0
  137. package/src/components/ui/input/InputBase.vue +18 -0
  138. package/src/components/ui/input/index.ts +1 -0
  139. package/src/components/ui/label/Label.vue +27 -0
  140. package/src/components/ui/label/index.ts +1 -0
  141. package/src/components/ui/pagination/Pagination.vue +50 -0
  142. package/src/components/ui/pagination/PaginationContent.vue +21 -0
  143. package/src/components/ui/pagination/PaginationEllipsis.vue +24 -0
  144. package/src/components/ui/pagination/PaginationFirst.vue +32 -0
  145. package/src/components/ui/pagination/PaginationItem.vue +32 -0
  146. package/src/components/ui/pagination/PaginationLast.vue +32 -0
  147. package/src/components/ui/pagination/PaginationNext.vue +32 -0
  148. package/src/components/ui/pagination/PaginationPrevious.vue +32 -0
  149. package/src/components/ui/pagination/index.ts +1 -0
  150. package/src/components/ui/popover/Popover.vue +57 -0
  151. package/src/components/ui/popover/PopoverTrigger.vue +15 -0
  152. package/src/components/ui/popover/index.ts +1 -0
  153. package/src/components/ui/progress/Progress.vue +35 -0
  154. package/src/components/ui/progress/ProgressIndicator.vue +19 -0
  155. package/src/components/ui/progress/index.ts +2 -0
  156. package/src/components/ui/progress-circular/ProgressCircular.vue +85 -0
  157. package/src/components/ui/progress-circular/index.ts +1 -0
  158. package/src/components/ui/radio-group/RadioGroup.vue +81 -0
  159. package/src/components/ui/radio-group/RadioGroupItem.vue +39 -0
  160. package/src/components/ui/radio-group/index.ts +15 -0
  161. package/src/components/ui/range-calendar/RangeCalendar.vue +71 -0
  162. package/src/components/ui/range-calendar/RangeCalendarCell.vue +28 -0
  163. package/src/components/ui/range-calendar/RangeCalendarCellTrigger.vue +40 -0
  164. package/src/components/ui/range-calendar/RangeCalendarGrid.vue +24 -0
  165. package/src/components/ui/range-calendar/RangeCalendarGridBody.vue +11 -0
  166. package/src/components/ui/range-calendar/RangeCalendarGridHead.vue +11 -0
  167. package/src/components/ui/range-calendar/RangeCalendarGridRow.vue +21 -0
  168. package/src/components/ui/range-calendar/RangeCalendarHeadCell.vue +21 -0
  169. package/src/components/ui/range-calendar/RangeCalendarHeader.vue +21 -0
  170. package/src/components/ui/range-calendar/RangeCalendarHeading.vue +27 -0
  171. package/src/components/ui/range-calendar/RangeCalendarNextButton.vue +32 -0
  172. package/src/components/ui/range-calendar/RangeCalendarPrevButton.vue +32 -0
  173. package/src/components/ui/range-calendar/index.ts +1 -0
  174. package/src/components/ui/select/Select.vue +120 -0
  175. package/src/components/ui/select/SelectContent.vue +45 -0
  176. package/src/components/ui/select/SelectGroup.vue +19 -0
  177. package/src/components/ui/select/SelectItem.vue +43 -0
  178. package/src/components/ui/select/SelectLabel.vue +13 -0
  179. package/src/components/ui/select/SelectSeparator.vue +17 -0
  180. package/src/components/ui/select/SelectTrigger.vue +31 -0
  181. package/src/components/ui/select/SelectValue.vue +11 -0
  182. package/src/components/ui/select/index.ts +1 -0
  183. package/src/components/ui/slider/Slider.vue +100 -0
  184. package/src/components/ui/slider/index.ts +1 -0
  185. package/src/components/ui/switch/Switch.vue +40 -0
  186. package/src/components/ui/switch/SwitchBase.vue +36 -0
  187. package/src/components/ui/switch/index.ts +1 -0
  188. package/src/components/ui/tabs/Tabs.vue +63 -0
  189. package/src/components/ui/tabs/TabsContent.vue +26 -0
  190. package/src/components/ui/tabs/TabsTrigger.vue +27 -0
  191. package/src/components/ui/tabs/index.ts +28 -0
  192. package/src/components/ui/textarea/Textarea.vue +13 -0
  193. package/src/components/ui/textarea/index.ts +1 -0
  194. package/src/components/ui/toast/Toast.vue +28 -0
  195. package/src/components/ui/toast/ToastAction.vue +26 -0
  196. package/src/components/ui/toast/ToastClose.vue +29 -0
  197. package/src/components/ui/toast/ToastDescription.vue +19 -0
  198. package/src/components/ui/toast/ToastProvider.vue +11 -0
  199. package/src/components/ui/toast/ToastTitle.vue +19 -0
  200. package/src/components/ui/toast/ToastViewport.vue +17 -0
  201. package/src/components/ui/toast/Toaster.vue +30 -0
  202. package/src/components/ui/toast/index.ts +34 -0
  203. package/src/components/ui/toast/useToast.ts +163 -0
  204. package/src/components/ui/toggle/Toggle.vue +51 -0
  205. package/src/components/ui/toggle/index.ts +71 -0
  206. package/src/components/ui/toggle-group/ToggleGroup.vue +58 -0
  207. package/src/components/ui/toggle-group/ToggleGroupItem.vue +54 -0
  208. package/src/components/ui/toggle-group/index.ts +1 -0
  209. package/src/components/ui/tooltip/Tooltip.vue +42 -0
  210. package/src/components/ui/tooltip/TooltipProvider.vue +11 -0
  211. package/src/components/ui/tooltip/index.ts +2 -0
  212. package/src/composables/delegated-props.ts +6 -0
  213. package/src/composables/emits-as-props.ts +17 -0
  214. package/src/composables/forward-props-emits.ts +11 -0
  215. package/src/directives/autofocus.ts +7 -0
  216. package/src/index.ts +159 -0
  217. package/src/options-provider.ts +19 -0
  218. package/src/utils/gradient.ts +158 -0
  219. package/src/utils/options.ts +40 -0
  220. package/src/utils/tailwind.ts +14 -0
  221. package/web-types.json +10560 -0
package/package.json ADDED
@@ -0,0 +1,117 @@
1
+ {
2
+ "name": "@personizely/ui",
3
+ "web-types": "./web-types.json",
4
+ "version": "0.0.42",
5
+ "description": "Personizely UI is a Vue.js UI library with a simple API, based on Reka UI, inspired by shadcn-vue and Keen UI.",
6
+ "type": "module",
7
+ "main": "./dist/personizely-ui.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/personizely-ui.js",
11
+ "require": "./dist/personizely-ui.umd.cjs"
12
+ },
13
+ "./assets/personizely-ui.css": "./dist/personizely-ui.css"
14
+ },
15
+ "scripts": {
16
+ "build": "vite build --config vite.config.ts",
17
+ "build:types": "vue-tsc --project tsconfig.json --declaration --emitDeclarationOnly --outDir dist/types",
18
+ "build:web-types": "node scripts/generate.js",
19
+ "clean": "rimraf ./dist",
20
+ "lint": "eslint .",
21
+ "lint:fix": "eslint . --fix",
22
+ "docs:dev": "vitepress dev docs",
23
+ "docs:build": "vitepress build docs",
24
+ "docs:preview": "vitepress preview docs",
25
+ "postinstall": "patch-package",
26
+ "vue-typecheck": "vue-tsc --noEmit"
27
+ },
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/kilobyte2007/personizely-ui"
31
+ },
32
+ "keywords": [
33
+ "vue",
34
+ "vuejs",
35
+ "personizely",
36
+ "reka-ui",
37
+ "components",
38
+ "ui"
39
+ ],
40
+ "files": [
41
+ "dist",
42
+ "src",
43
+ "LICENSE.md",
44
+ "README.md",
45
+ "web-types.json",
46
+ "package-lock.json"
47
+ ],
48
+ "author": {
49
+ "name": "Sergiu Cazac"
50
+ },
51
+ "license": "MIT",
52
+ "bugs": {
53
+ "url": "https://github.com/kilobyte2007/personizely-ui/issues"
54
+ },
55
+ "homepage": "https://ui.personizely.dev/",
56
+ "dependencies": {
57
+ "@ctrl/tinycolor": "^4.1.0",
58
+ "@stylistic/eslint-plugin": "^2.12.1",
59
+ "@types/chroma-js": "^2.4.5",
60
+ "@types/lodash": "^4.17.0",
61
+ "@vueuse/core": "^10.11.1",
62
+ "autosize": "^3.0.20",
63
+ "chroma-js": "^3.1.2",
64
+ "class-variance-authority": "^0.7.0",
65
+ "clsx": "^2.1.0",
66
+ "deepmerge": "^2.0.1",
67
+ "lodash": "^4.17.21",
68
+ "lodash.debounce": "^4.0.8",
69
+ "lucide-vue-next": "^0.364.0",
70
+ "patch-package": "^8.0.0",
71
+ "reka-ui": "^2.3.2",
72
+ "tailwind-merge": "^2.5.5",
73
+ "tailwindcss-animate": "^1.0.7",
74
+ "vue-component-meta": "^2.1.2",
75
+ "zod": "^3.23.5"
76
+ },
77
+ "devDependencies": {
78
+ "@eslint/js": "^9.17.0",
79
+ "@iconify/vue": "^4.2.0",
80
+ "@tailwindcss/postcss": "^4.0.0-beta.8",
81
+ "@tailwindcss/vite": "^4.0.0-beta.8",
82
+ "@vee-validate/rules": "^4.14.7",
83
+ "@vee-validate/zod": "^4.14.7",
84
+ "@vitejs/plugin-vue": "5.2.1",
85
+ "@vue/tsconfig": "^0.7.0",
86
+ "cross-env": "^7.0.3",
87
+ "eslint": "^9.17.0",
88
+ "eslint-plugin-import": "^2.31.0",
89
+ "eslint-plugin-node": "^11.1.0",
90
+ "eslint-plugin-promise": "^6.6.0",
91
+ "eslint-plugin-standard": "^5.0.0",
92
+ "eslint-plugin-vue": "^9.32.0",
93
+ "globals": "^15.14.0",
94
+ "rimraf": "^2.7.1",
95
+ "tailwindcss": "^4.0.0-beta.8",
96
+ "ts-node": "^10.9.2",
97
+ "tsx": "^4.19.2",
98
+ "typescript": "^5.7.2",
99
+ "typescript-eslint": "^8.18.1",
100
+ "vee-validate": "^4.14.7",
101
+ "vite": "6.0.9",
102
+ "vite-plugin-banner": "^0.8.0",
103
+ "vitepress": "^1.5.0",
104
+ "vue": "^3.5.13",
105
+ "vue-docgen-api": "^4.79.2",
106
+ "vue-docgen-web-types": "^0.1.8",
107
+ "vue-tsc": "^2.1.10"
108
+ },
109
+ "peerDependencies": {
110
+ "vee-validate": "^4.14.7"
111
+ },
112
+ "overrides": {
113
+ "tailwindcss-animate": {
114
+ "tailwindcss": "^4.0.0-beta.8"
115
+ }
116
+ }
117
+ }
@@ -0,0 +1,136 @@
1
+ @import 'tailwindcss' source(none);
2
+ @config '../../tailwind.config.ts';
3
+
4
+ @variant dark (&:where(.dark, .dark *));
5
+ @source '../../src/**/*.{js,ts,vue}';
6
+
7
+ @theme {
8
+ @keyframes accordion-up {
9
+ 0% {
10
+ height: var(--reka-accordion-content-height);
11
+ overflow: hidden;
12
+ }
13
+ 100% {
14
+ height: 0;
15
+ overflow: hidden;
16
+ }
17
+ }
18
+
19
+ @keyframes accordion-down {
20
+ 0% {
21
+ height: 0;
22
+ overflow: hidden;
23
+ }
24
+ 100% {
25
+ height: var(--reka-accordion-content-height);
26
+ overflow: hidden;
27
+ }
28
+ }
29
+
30
+ --animate-accordion-up: accordion-up 0.2s ease-out;
31
+ --animate-accordion-down: accordion-down 0.2s ease-out;
32
+
33
+ --radius: 0.5rem;
34
+ --radius-sm: calc(var(--radius) - 4px);
35
+ --radius-md: calc(var(--radius) - 2px);
36
+ --radius-lg: calc(var(--radius) + 2px);
37
+ --radius-xl: calc(var(--radius) + 4px);
38
+
39
+ --text-2xs: 0.65rem;
40
+
41
+ --color-background: hsl(0 0% 100%);
42
+ --color-foreground: hsl(222.2 84% 4.9%);
43
+
44
+ --color-muted: hsl(210 40% 96.1%);
45
+ --color-muted-foreground: hsl(215.4 16.3% 46.9%);
46
+
47
+ --color-popover: hsl(0 0% 100%);
48
+ --color-popover-foreground: hsl(222.2 84% 4.9%);
49
+
50
+ --color-card: hsl(0 0% 100%);
51
+ --color-card-foreground: hsl(222.2 84% 4.9%);
52
+
53
+ --color-border: hsl(214.3 31.8% 91.4%);
54
+ --color-input: hsl(214.3 31.8% 91.4%);
55
+
56
+ --color-primary: hsl(222.2 47.4% 11.2%);
57
+ --color-primary-foreground: hsl(210 40% 98%);
58
+
59
+ --color-secondary: hsl(210 40% 96.1%);
60
+ --color-secondary-foreground: hsl(222.2 47.4% 11.2%);
61
+
62
+ --color-accent: hsl(210 40% 96.1%);
63
+ --color-accent-foreground: hsl(222.2 47.4% 11.2%);
64
+
65
+ --color-destructive: hsl(0 84.2% 60.2%);
66
+ --color-destructive-foreground: hsl(210 40% 98%);
67
+
68
+ --color-error: hsl(var(--color-destructive));
69
+ --color-error-foreground: hsl(var(--color-destructive-foreground));
70
+
71
+ --color-warning: hsl(35.76 100% 50%);
72
+ --color-warning-foreground: hsl(210 40% 98%);
73
+
74
+ --color-success: hsl(122 39% 49%);
75
+ --color-success-foreground: hsl(210 40% 98%);
76
+
77
+ --color-ring: hsl(240 5% 64.9%);
78
+ }
79
+
80
+ @layer themes {
81
+ .dark {
82
+ --color-background: hsl(222.2 84% 4.9%);
83
+ --color-foreground: hsl(210 40% 98%);
84
+
85
+ --color-muted: hsl(217.2 32.6% 17.5%);
86
+ --color-muted-foreground: hsl(215 20.2% 65.1%);
87
+
88
+ --color-popover: hsl(222.2 84% 4.9%);
89
+ --color-popover-foreground: hsl(210 40% 98%);
90
+
91
+ --color-card: hsl(222.2 84% 4.9%);
92
+ --color-card-foreground: hsl(210 40% 98%);
93
+
94
+ --color-border: hsl(217.2 32.6% 17.5%);
95
+ --color-input: hsl(217.2 32.6% 17.5%);
96
+
97
+ --color-primary: hsl(210 40% 98%);
98
+ --color-primary-foreground: hsl(222.2 47.4% 11.2%);
99
+
100
+ --color-secondary: hsl(217.2 32.6% 17.5%);
101
+ --color-secondary-foreground: hsl(210 40% 98%);
102
+
103
+ --color-accent: hsl(217.2 32.6% 17.5%);
104
+ --color-accent-foreground: hsl(210 40% 98%);
105
+
106
+ --color-destructive: hsl(0 62.8% 30.6%);
107
+ --color-destructive-foreground: hsl(210 40% 98%);
108
+
109
+ --color-error: hsl(var(--color-destructive));
110
+ --color-error-foreground: hsl(var(--color-destructive-foreground));
111
+
112
+ --color-warning: hsl(0 84.2% 60.2%);
113
+ --color-warning-foreground: hsl(210 40% 98%);
114
+
115
+ --color-success: hsl(122 39% 49%);
116
+ --color-success-foreground: hsl(210 40% 98%);
117
+
118
+ --color-ring: hsl(212.7 26.8% 83.9%);
119
+ }
120
+ }
121
+
122
+ @layer base {
123
+ *,
124
+ ::after,
125
+ ::before,
126
+ ::backdrop,
127
+ ::file-selector-button {
128
+ border-color: var(--color-border, currentColor);
129
+ }
130
+
131
+ [role="button"],
132
+ button {
133
+ user-select: none;
134
+ cursor: pointer;
135
+ }
136
+ }
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <AccordionRoot v-bind="forwarded">
3
+ <slot />
4
+ </AccordionRoot>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import {
9
+ AccordionRoot,
10
+ type AccordionRootEmits,
11
+ type AccordionRootProps,
12
+ useForwardPropsEmits
13
+ } from 'reka-ui'
14
+
15
+ const props = defineProps<AccordionRootProps>()
16
+ const emits = defineEmits<AccordionRootEmits>()
17
+
18
+ const forwarded = useForwardPropsEmits(props, emits)
19
+ </script>
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <AccordionContent
3
+ v-bind="delegatedProps"
4
+ class="text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
5
+ >
6
+ <div :class="cn('pb-4 pt-0', props.class)">
7
+ <slot />
8
+ </div>
9
+ </AccordionContent>
10
+ </template>
11
+
12
+ <script setup lang="ts">
13
+ import { type HTMLAttributes, computed } from 'vue'
14
+ import { AccordionContent, type AccordionContentProps } from 'reka-ui'
15
+ import { cn } from '@/utils/tailwind'
16
+
17
+ const props = defineProps<AccordionContentProps & { class?: HTMLAttributes['class'] }>()
18
+
19
+ const delegatedProps = computed(() => {
20
+ const { class: _, ...delegated } = props
21
+
22
+ return delegated
23
+ })
24
+ </script>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <AccordionItem
3
+ v-bind="omit(forwardedProps, ['title'])"
4
+ :class="cn('not-last:border-b', props.class)"
5
+ >
6
+ <AccordionTrigger>
7
+ <slot name="title">
8
+ {{ title }}
9
+ </slot>
10
+ </AccordionTrigger>
11
+ <AccordionContent>
12
+ <slot />
13
+ </AccordionContent>
14
+ </AccordionItem>
15
+ </template>
16
+
17
+ <script setup lang="ts">
18
+ import { type HTMLAttributes, computed } from 'vue'
19
+ import { AccordionItem, type AccordionItemProps, useForwardProps } from 'reka-ui'
20
+ import { cn } from '@/utils/tailwind'
21
+ import AccordionContent from './AccordionContent.vue'
22
+ import AccordionTrigger from './AccordionTrigger.vue'
23
+ import omit from 'lodash/omit'
24
+
25
+ const props = defineProps<AccordionItemProps & {
26
+ class?: HTMLAttributes['class'],
27
+ title?: string
28
+ }>()
29
+
30
+ const delegatedProps = computed(() => {
31
+ const { class: _, ...delegated } = props
32
+
33
+ return delegated
34
+ })
35
+
36
+ const forwardedProps = useForwardProps(delegatedProps)
37
+ </script>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <AccordionHeader class="flex">
3
+ <AccordionTrigger
4
+ v-bind="delegatedProps"
5
+ :class="
6
+ cn(
7
+ 'flex flex-1 items-center rounded-sm text-sm justify-between py-4 font-medium transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 [&[data-state=open]>svg]:rotate-180',
8
+ props.class,
9
+ )
10
+ "
11
+ >
12
+ <slot />
13
+ <slot name="icon">
14
+ <ChevronDown
15
+ class="size-3 shrink-0 transition-transform duration-200"
16
+ />
17
+ </slot>
18
+ </AccordionTrigger>
19
+ </AccordionHeader>
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import { type HTMLAttributes, computed } from 'vue'
24
+ import {
25
+ AccordionHeader,
26
+ AccordionTrigger,
27
+ type AccordionTriggerProps
28
+ } from 'reka-ui'
29
+ import { ChevronDown } from 'lucide-vue-next'
30
+ import { cn } from '@/utils/tailwind'
31
+
32
+ const props = defineProps<AccordionTriggerProps & { class?: HTMLAttributes['class'] }>()
33
+
34
+ const delegatedProps = computed(() => {
35
+ const { class: _, ...delegated } = props
36
+
37
+ return delegated
38
+ })
39
+ </script>
@@ -0,0 +1,2 @@
1
+ export { default as Accordion } from './Accordion.vue'
2
+ export { default as AccordionItem } from './AccordionItem.vue'
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <div v-if="visible" :class="cn(alertVariants({ type }), dismissible ? 'pr-12' : '', props.class)" role="alert">
3
+ <slot name="icon">
4
+ <component
5
+ :is="icon"
6
+ v-if="!removeIcon"
7
+ class="w-4 h-4 absolute left-3.5 top-3.5"
8
+ />
9
+ </slot>
10
+ <h5 v-if="title || $slots.title" class="font-medium leading-tight tracking-tight" :class="!removeIcon ? 'pl-7' : ''">
11
+ <slot name="title">
12
+ {{ title }}
13
+ </slot>
14
+ </h5>
15
+ <div :class="!removeIcon ? 'pl-7' : ''" class="text-sm leading-normal">
16
+ <slot />
17
+ </div>
18
+ <Button
19
+ v-if="dismissible"
20
+ icon="x"
21
+ variant="ghost"
22
+ size="2xs"
23
+ class="absolute right-2 top-2"
24
+ type="button"
25
+ @click="dismiss"
26
+ />
27
+ </div>
28
+ </template>
29
+
30
+ <script setup lang="ts">
31
+ import { computed } from 'vue'
32
+ import { Button } from '@/components/ui/button'
33
+ import { Info, TriangleAlert, CircleCheck, CircleAlert } from 'lucide-vue-next'
34
+ import type { HTMLAttributes } from 'vue'
35
+ import { type AlertVariants, alertVariants } from '.'
36
+ import { cn } from '@/utils/tailwind'
37
+
38
+ const emit = defineEmits(['update:visible', 'dismiss'])
39
+
40
+ const props = withDefaults(defineProps<{
41
+ type?: AlertVariants['type'],
42
+ class?: HTMLAttributes['class'],
43
+ removeIcon?: boolean,
44
+ title?: string,
45
+ dismissible?: boolean,
46
+ visible?: boolean
47
+ }>(), {
48
+ type: 'info',
49
+ removeIcon: false,
50
+ dismissible: true,
51
+ visible: true
52
+ })
53
+
54
+ const icon = computed(() => {
55
+ return {
56
+ info: Info,
57
+ warning: TriangleAlert,
58
+ success: CircleCheck,
59
+ error: CircleAlert
60
+ }[props.type!]
61
+ })
62
+
63
+ const dismiss = () => {
64
+ emit('update:visible', false)
65
+ emit('dismiss')
66
+ }
67
+ </script>
68
+
@@ -0,0 +1,22 @@
1
+ import { type VariantProps, cva } from 'class-variance-authority'
2
+
3
+ export { default as Alert } from './Alert.vue'
4
+
5
+ export const alertVariants = cva('relative w-full rounded-lg border p-3', {
6
+ variants: {
7
+ type: {
8
+ info: 'bg-background text-foreground',
9
+ error:
10
+ 'border-error/50 text-error dark:border-destructive',
11
+ warning:
12
+ 'border-warning/50 text-warning dark:border-warning',
13
+ success:
14
+ 'border-success/50 text-success dark:border-success'
15
+ }
16
+ },
17
+ defaultVariants: {
18
+ type: 'info'
19
+ }
20
+ })
21
+
22
+ export type AlertVariants = VariantProps<typeof alertVariants>
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <AlertDialogRoot v-bind="forwarded">
3
+ <AlertDialogTrigger as-child>
4
+ <slot name="trigger" />
5
+ </AlertDialogTrigger>
6
+ <AlertDialogContent :class="props.class">
7
+ <div class="flex flex-col gap-y-2 text-center sm:text-left">
8
+ <AlertDialogTitle class="text-lg font-medium">
9
+ <slot name="title">
10
+ {{ title }}
11
+ </slot>
12
+ </AlertDialogTitle>
13
+ <AlertDialogDescription class="text-sm text-muted-foreground">
14
+ <slot name="description">
15
+ {{ description }}
16
+ </slot>
17
+ </AlertDialogDescription>
18
+ </div>
19
+ <div class="flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2">
20
+ <AlertDialogCancel as-child @click="$emit('cancel')">
21
+ <Button variant="outline">
22
+ Cancel
23
+ </Button>
24
+ </AlertDialogCancel>
25
+ <AlertDialogAction as-child @click="$emit('confirm')">
26
+ <Button variant="default">
27
+ Confirm
28
+ </Button>
29
+ </AlertDialogAction>
30
+ </div>
31
+ </AlertDialogContent>
32
+ </AlertDialogRoot>
33
+ </template>
34
+
35
+ <script setup lang="ts">
36
+ import {
37
+ type AlertDialogEmits,
38
+ type AlertDialogProps,
39
+ AlertDialogRoot,
40
+ AlertDialogAction,
41
+ AlertDialogCancel,
42
+ AlertDialogDescription,
43
+ AlertDialogTitle,
44
+ AlertDialogTrigger
45
+ } from 'reka-ui'
46
+ import AlertDialogContent from './AlertDialogContent.vue'
47
+ import { Button } from '@/components/ui/button'
48
+ import { useDelegatedProps } from '@/composables/delegated-props'
49
+ import { useEmitAsProps } from '@/composables/emits-as-props'
50
+ import { useForwardPropsEmits } from '@/composables/forward-props-emits'
51
+ import type { HTMLAttributes } from 'vue'
52
+
53
+ const props = defineProps<AlertDialogProps & {
54
+ class?: HTMLAttributes['class'],
55
+ title: string
56
+ description?: string
57
+ }>()
58
+ const emits = defineEmits<AlertDialogEmits & {
59
+ confirm: []
60
+ cancel: []
61
+ }>()
62
+
63
+ const delegatedProps = useDelegatedProps(props, ['class', 'title', 'description'])
64
+ const delegatedEmits = useEmitAsProps(emits, ['confirm', 'cancel'])
65
+ const forwarded = useForwardPropsEmits(delegatedProps, delegatedEmits)
66
+ </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <AlertDialogPortal :to="options.portalTo">
3
+ <AlertDialogOverlay
4
+ class="fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
5
+ />
6
+ <AlertDialogContent
7
+ v-bind="forwarded"
8
+ :class="
9
+ cn(
10
+ 'fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg',
11
+ props.class,
12
+ )
13
+ "
14
+ >
15
+ <slot />
16
+ </AlertDialogContent>
17
+ </AlertDialogPortal>
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ import { type HTMLAttributes, computed } from 'vue'
22
+ import {
23
+ AlertDialogContent,
24
+ AlertDialogOverlay,
25
+ AlertDialogPortal,
26
+ type AlertDialogContentEmits,
27
+ type AlertDialogContentProps,
28
+ useForwardPropsEmits
29
+ } from 'reka-ui'
30
+ import { cn } from '@/utils/tailwind'
31
+ import { getOptions } from '@/options-provider'
32
+
33
+ const props = defineProps<AlertDialogContentProps & { class?: HTMLAttributes['class'] }>()
34
+ const emits = defineEmits<AlertDialogContentEmits>()
35
+
36
+ const delegatedProps = computed(() => {
37
+ const { class: _, ...delegated } = props
38
+
39
+ return delegated
40
+ })
41
+
42
+ const forwarded = useForwardPropsEmits(delegatedProps, emits)
43
+ const options = getOptions()
44
+ </script>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <AlertDialog
3
+ v-for="(item, index) in items"
4
+ :key="index"
5
+ :title="item.title"
6
+ :description="item.description"
7
+ :default-open="true"
8
+ @confirm="confirm(item)"
9
+ @cancel="cancel(item)"
10
+ />
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import AlertDialog from '@/components/ui/alert-dialog/AlertDialog.vue'
15
+ import { useAlertDialog, type Item } from '@/components/ui/alert-dialog/useAlertDialog'
16
+
17
+ const { items } = useAlertDialog()
18
+
19
+ const confirm = async (item: Item) => {
20
+ await item.onConfirm()
21
+ items.splice(items.indexOf(item), 1)
22
+ }
23
+ const cancel = (item: Item) => {
24
+ item.onCancel?.()
25
+ items.splice(items.indexOf(item), 1)
26
+ }
27
+ </script>
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <AlertDialogTrigger v-bind="props">
3
+ <slot />
4
+ </AlertDialogTrigger>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { AlertDialogTrigger, type AlertDialogTriggerProps } from 'reka-ui'
9
+
10
+ const props = defineProps<AlertDialogTriggerProps>()
11
+ </script>
@@ -0,0 +1,3 @@
1
+ export { default as AlertDialog } from './AlertDialog.vue'
2
+ export { default as AlertDialogProvider } from './AlertDialogProvider.vue'
3
+ export { useAlertDialog } from './useAlertDialog'
@@ -0,0 +1,19 @@
1
+ import { reactive } from 'vue'
2
+
3
+ export interface Item {
4
+ title: string
5
+ description?: string
6
+ onConfirm: () => any
7
+ onCancel?: () => any
8
+ }
9
+
10
+ const items = reactive<Item[]>([])
11
+
12
+ export const useAlertDialog = () => {
13
+ return {
14
+ confirm (item: Item) {
15
+ items.push(item)
16
+ },
17
+ items
18
+ }
19
+ }