@eslamdevui/ui 3.2.0-beta.1 → 3.2.0-beta.2
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/.nuxt/ui/alert.ts +5 -0
- package/.nuxt/ui/badge.ts +5 -0
- package/.nuxt/ui/button-group.ts +13 -0
- package/.nuxt/ui/button.ts +5 -0
- package/.nuxt/ui/carousel.ts +5 -0
- package/.nuxt/ui/content/content-navigation.ts +339 -0
- package/.nuxt/ui/content/content-search-button.ts +6 -0
- package/.nuxt/ui/content/content-search.ts +6 -0
- package/.nuxt/ui/content/content-surround.ts +39 -0
- package/.nuxt/ui/content/content-toc.ts +150 -0
- package/.nuxt/ui/content/index.ts +5 -0
- package/.nuxt/ui/content-surround.ts +5 -0
- package/.nuxt/ui/content-toc.ts +6 -6
- package/.nuxt/ui/dashboard-navbar.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-collapse.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar-toggle.ts +5 -0
- package/.nuxt/ui/dashboard-sidebar.ts +10 -0
- package/.nuxt/ui/error.ts +9 -0
- package/.nuxt/ui/index.ts +48 -1
- package/.nuxt/ui/input-menu.ts +9 -0
- package/.nuxt/ui/input-number.ts +5 -0
- package/.nuxt/ui/input-tags.ts +9 -0
- package/.nuxt/ui/input.ts +9 -0
- package/.nuxt/ui/prose/a.ts +6 -0
- package/.nuxt/ui/prose/accordion-item.ts +3 -0
- package/.nuxt/ui/prose/accordion.ts +6 -0
- package/.nuxt/ui/prose/badge.ts +3 -0
- package/.nuxt/ui/prose/blockquote.ts +3 -0
- package/.nuxt/ui/prose/callout.ts +129 -0
- package/.nuxt/ui/prose/card-group.ts +3 -0
- package/.nuxt/ui/prose/card.ts +119 -0
- package/.nuxt/ui/prose/code-collapse.ts +19 -0
- package/.nuxt/ui/prose/code-group.ts +13 -0
- package/.nuxt/ui/prose/code-icon.ts +66 -0
- package/.nuxt/ui/prose/code-preview.ts +14 -0
- package/.nuxt/ui/prose/code-tree.ts +28 -0
- package/.nuxt/ui/prose/code.ts +27 -0
- package/.nuxt/ui/prose/collapsible.ts +12 -0
- package/.nuxt/ui/prose/em.ts +3 -0
- package/.nuxt/ui/prose/field-group.ts +3 -0
- package/.nuxt/ui/prose/field.ts +11 -0
- package/.nuxt/ui/prose/h1.ts +6 -0
- package/.nuxt/ui/prose/h2.ts +14 -0
- package/.nuxt/ui/prose/h3.ts +14 -0
- package/.nuxt/ui/prose/h4.ts +6 -0
- package/.nuxt/ui/prose/hr.ts +3 -0
- package/.nuxt/ui/prose/icon.ts +3 -0
- package/.nuxt/ui/prose/img.ts +3 -0
- package/.nuxt/ui/prose/index.ts +41 -0
- package/.nuxt/ui/prose/kbd.ts +3 -0
- package/.nuxt/ui/prose/li.ts +3 -0
- package/.nuxt/ui/prose/ol.ts +3 -0
- package/.nuxt/ui/prose/p.ts +3 -0
- package/.nuxt/ui/prose/pre.ts +17 -0
- package/.nuxt/ui/prose/steps.ts +19 -0
- package/.nuxt/ui/prose/strong.ts +3 -0
- package/.nuxt/ui/prose/table.ts +6 -0
- package/.nuxt/ui/prose/tabs-item.ts +3 -0
- package/.nuxt/ui/prose/tabs.ts +5 -0
- package/.nuxt/ui/prose/tbody.ts +3 -0
- package/.nuxt/ui/prose/td.ts +3 -0
- package/.nuxt/ui/prose/th.ts +3 -0
- package/.nuxt/ui/prose/thead.ts +3 -0
- package/.nuxt/ui/prose/tr.ts +3 -0
- package/.nuxt/ui/prose/ul.ts +3 -0
- package/.nuxt/ui/select-menu.ts +9 -0
- package/.nuxt/ui/select.ts +9 -0
- package/.nuxt/ui/textarea.ts +9 -0
- package/.nuxt/ui/toast.ts +5 -0
- package/LICENSE.md +9 -9
- package/README.md +147 -147
- package/cli/commands/make/component.mjs +95 -95
- package/cli/commands/make/index.mjs +14 -14
- package/cli/commands/make/locale.mjs +64 -64
- package/cli/index.mjs +15 -15
- package/cli/package.json +13 -13
- package/cli/templates.mjs +236 -228
- package/cli/utils.mjs +31 -31
- package/dist/module.json +1 -1
- package/dist/module.mjs +18 -13
- package/dist/runtime/components/Accordion.vue +36 -36
- package/dist/runtime/components/Alert.vue +46 -46
- package/dist/runtime/components/App.vue +10 -10
- package/dist/runtime/components/Avatar.vue +27 -27
- package/dist/runtime/components/AvatarGroup.vue +4 -4
- package/dist/runtime/components/Badge.vue +16 -16
- package/dist/runtime/components/Breadcrumb.vue +32 -32
- package/dist/runtime/components/Button.vue +28 -28
- package/dist/runtime/components/ButtonGroup.vue +3 -3
- package/dist/runtime/components/Calendar.vue +74 -74
- package/dist/runtime/components/Card.vue +13 -13
- package/dist/runtime/components/Carousel.vue +58 -58
- package/dist/runtime/components/ChatMessage.vue +35 -35
- package/dist/runtime/components/ChatMessages.vue +71 -71
- package/dist/runtime/components/ChatMessages.vue.d.ts +1 -2
- package/dist/runtime/components/ChatPrompt.vue +30 -31
- package/dist/runtime/components/ChatPrompt.vue.d.ts +4 -4
- package/dist/runtime/components/ChatPromptSubmit.vue +10 -10
- package/dist/runtime/components/Checkbox.vue +33 -33
- package/dist/runtime/components/CheckboxGroup.vue +32 -32
- package/dist/runtime/components/Chip.vue +11 -11
- package/dist/runtime/components/Collapsible.vue +9 -9
- package/dist/runtime/components/ColorPicker.vue +30 -30
- package/dist/runtime/components/CommandPalette.vue +117 -117
- package/dist/runtime/components/Container.vue +3 -3
- package/dist/runtime/components/ContextMenu.vue +22 -22
- package/dist/runtime/components/ContextMenuContent.vue +105 -105
- package/dist/runtime/components/DashboardGroup.vue +3 -3
- package/dist/runtime/components/DashboardNavbar.vue +41 -41
- package/dist/runtime/components/DashboardNavbar.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardPanel.vue +29 -29
- package/dist/runtime/components/DashboardPanel.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardResizeHandle.vue +7 -7
- package/dist/runtime/components/DashboardSearch.vue +24 -25
- package/dist/runtime/components/DashboardSearch.vue.d.ts +3 -3
- package/dist/runtime/components/DashboardSearchButton.vue +63 -41
- package/dist/runtime/components/DashboardSearchButton.vue.d.ts +7 -1
- package/dist/runtime/components/DashboardSidebar.vue +77 -77
- package/dist/runtime/components/DashboardSidebarCollapse.vue +7 -7
- package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
- package/dist/runtime/components/DashboardSidebarToggle.vue +14 -17
- package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +4 -6
- package/dist/runtime/components/Drawer.vue +55 -55
- package/dist/runtime/components/DropdownMenu.vue +24 -24
- package/dist/runtime/components/DropdownMenuContent.vue +107 -107
- package/dist/runtime/components/Error.vue +57 -0
- package/dist/runtime/components/Error.vue.d.ts +52 -0
- package/dist/runtime/components/Form.vue +8 -8
- package/dist/runtime/components/Form.vue.d.ts +1 -1
- package/dist/runtime/components/FormField.vue +37 -37
- package/dist/runtime/components/Icon.vue +1 -1
- package/dist/runtime/components/Input.vue +34 -34
- package/dist/runtime/components/InputMenu.vue +163 -163
- package/dist/runtime/components/InputNumber.vue +49 -49
- package/dist/runtime/components/InputTags.vue +55 -55
- package/dist/runtime/components/Kbd.vue +5 -5
- package/dist/runtime/components/Link.vue +14 -14
- package/dist/runtime/components/LinkBase.vue +8 -8
- package/dist/runtime/components/Modal.vue +69 -69
- package/dist/runtime/components/NavigationMenu.vue +166 -166
- package/dist/runtime/components/OverlayProvider.vue +9 -9
- package/dist/runtime/components/Pagination.vue +47 -47
- package/dist/runtime/components/PinInput.vue +20 -20
- package/dist/runtime/components/Popover.vue +17 -17
- package/dist/runtime/components/Progress.vue +19 -19
- package/dist/runtime/components/RadioGroup.vue +43 -43
- package/dist/runtime/components/Select.vue +96 -96
- package/dist/runtime/components/SelectMenu.vue +130 -130
- package/dist/runtime/components/Separator.vue +15 -15
- package/dist/runtime/components/Skeleton.vue +10 -10
- package/dist/runtime/components/Slideover.vue +76 -76
- package/dist/runtime/components/Slider.vue +27 -27
- package/dist/runtime/components/Stepper.vue +51 -51
- package/dist/runtime/components/Switch.vue +33 -33
- package/dist/runtime/components/Table.vue +77 -77
- package/dist/runtime/components/Tabs.vue +37 -37
- package/dist/runtime/components/Textarea.vue +33 -33
- package/dist/runtime/components/Timeline.vue +38 -38
- package/dist/runtime/components/Toast.vue +69 -69
- package/dist/runtime/components/Toaster.vue +28 -28
- package/dist/runtime/components/Tooltip.vue +19 -19
- package/dist/runtime/components/Tree.vue +60 -60
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeAvatar.vue.d.ts +2 -2
- package/dist/runtime/components/color-mode/ColorModeButton.vue +16 -16
- package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +3 -3
- package/dist/runtime/components/color-mode/ColorModeImage.vue +2 -2
- package/dist/runtime/components/color-mode/ColorModeSelect.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSelect.vue.d.ts +1 -1
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue +19 -19
- package/dist/runtime/components/color-mode/ColorModeSwitch.vue.d.ts +1 -1
- package/dist/runtime/components/content/ContentNavigation.vue +175 -0
- package/dist/runtime/components/content/ContentNavigation.vue.d.ts +53 -0
- package/dist/runtime/components/content/ContentSearch.vue +184 -0
- package/dist/runtime/components/content/ContentSearch.vue.d.ts +111 -0
- package/dist/runtime/components/content/ContentSearchButton.vue +95 -0
- package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +12 -0
- package/dist/runtime/components/content/ContentSurround.vue +61 -0
- package/dist/runtime/components/content/ContentSurround.vue.d.ts +59 -0
- package/dist/runtime/components/content/ContentToc.vue +146 -0
- package/dist/runtime/components/content/ContentToc.vue.d.ts +88 -0
- package/dist/runtime/components/locale/LocaleSelect.vue +20 -20
- package/dist/runtime/components/locale/LocaleSelect.vue.d.ts +1 -1
- package/dist/runtime/components/prose/A.vue +24 -0
- package/dist/runtime/components/prose/A.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Accordion.vue +43 -0
- package/dist/runtime/components/prose/Accordion.vue.d.ts +16 -0
- package/dist/runtime/components/prose/AccordionItem.vue +25 -0
- package/dist/runtime/components/prose/AccordionItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Badge.vue +21 -0
- package/dist/runtime/components/prose/Badge.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Blockquote.vue +21 -0
- package/dist/runtime/components/prose/Blockquote.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Callout.vue +60 -0
- package/dist/runtime/components/prose/Callout.vue.d.ts +26 -0
- package/dist/runtime/components/prose/Card.vue +83 -0
- package/dist/runtime/components/prose/Card.vue.d.ts +30 -0
- package/dist/runtime/components/prose/CardGroup.vue +21 -0
- package/dist/runtime/components/prose/CardGroup.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Code.vue +23 -0
- package/dist/runtime/components/prose/Code.vue.d.ts +22 -0
- package/dist/runtime/components/prose/CodeCollapse.vue +44 -0
- package/dist/runtime/components/prose/CodeCollapse.vue.d.ts +46 -0
- package/dist/runtime/components/prose/CodeGroup.vue +70 -0
- package/dist/runtime/components/prose/CodeGroup.vue.d.ts +37 -0
- package/dist/runtime/components/prose/CodeIcon.vue +28 -0
- package/dist/runtime/components/prose/CodeIcon.vue.d.ts +24 -0
- package/dist/runtime/components/prose/CodePreview.vue +28 -0
- package/dist/runtime/components/prose/CodePreview.vue.d.ts +19 -0
- package/dist/runtime/components/prose/CodeTree.vue +160 -0
- package/dist/runtime/components/prose/CodeTree.vue.d.ts +30 -0
- package/dist/runtime/components/prose/Collapsible.vue +41 -0
- package/dist/runtime/components/prose/Collapsible.vue.d.ts +38 -0
- package/dist/runtime/components/prose/Em.vue +19 -0
- package/dist/runtime/components/prose/Em.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Field.vue +48 -0
- package/dist/runtime/components/prose/Field.vue.d.ts +39 -0
- package/dist/runtime/components/prose/FieldGroup.vue +23 -0
- package/dist/runtime/components/prose/FieldGroup.vue.d.ts +18 -0
- package/dist/runtime/components/prose/H1.vue +28 -0
- package/dist/runtime/components/prose/H1.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H2.vue +32 -0
- package/dist/runtime/components/prose/H2.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H3.vue +32 -0
- package/dist/runtime/components/prose/H3.vue.d.ts +19 -0
- package/dist/runtime/components/prose/H4.vue +28 -0
- package/dist/runtime/components/prose/H4.vue.d.ts +19 -0
- package/dist/runtime/components/prose/Hr.vue +18 -0
- package/dist/runtime/components/prose/Hr.vue.d.ts +5 -0
- package/dist/runtime/components/prose/Icon.vue +19 -0
- package/dist/runtime/components/prose/Icon.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Img.vue +40 -0
- package/dist/runtime/components/prose/Img.vue.d.ts +9 -0
- package/dist/runtime/components/prose/Kbd.vue +19 -0
- package/dist/runtime/components/prose/Kbd.vue.d.ts +6 -0
- package/dist/runtime/components/prose/Li.vue +21 -0
- package/dist/runtime/components/prose/Li.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ol.vue +21 -0
- package/dist/runtime/components/prose/Ol.vue.d.ts +13 -0
- package/dist/runtime/components/prose/P.vue +21 -0
- package/dist/runtime/components/prose/P.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Pre.vue +63 -0
- package/dist/runtime/components/prose/Pre.vue.d.ts +25 -0
- package/dist/runtime/components/prose/Script.vue +12 -0
- package/dist/runtime/components/prose/Script.vue.d.ts +12 -0
- package/dist/runtime/components/prose/Steps.vue +22 -0
- package/dist/runtime/components/prose/Steps.vue.d.ts +22 -0
- package/dist/runtime/components/prose/Strong.vue +21 -0
- package/dist/runtime/components/prose/Strong.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Table.vue +24 -0
- package/dist/runtime/components/prose/Table.vue.d.ts +18 -0
- package/dist/runtime/components/prose/Tabs.vue +78 -0
- package/dist/runtime/components/prose/Tabs.vue.d.ts +36 -0
- package/dist/runtime/components/prose/TabsItem.vue +25 -0
- package/dist/runtime/components/prose/TabsItem.vue.d.ts +15 -0
- package/dist/runtime/components/prose/Tbody.vue +21 -0
- package/dist/runtime/components/prose/Tbody.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Td.vue +21 -0
- package/dist/runtime/components/prose/Td.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Th.vue +21 -0
- package/dist/runtime/components/prose/Th.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Thead.vue +21 -0
- package/dist/runtime/components/prose/Thead.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Tr.vue +21 -0
- package/dist/runtime/components/prose/Tr.vue.d.ts +13 -0
- package/dist/runtime/components/prose/Ul.vue +21 -0
- package/dist/runtime/components/prose/Ul.vue.d.ts +13 -0
- package/dist/runtime/components/prose/callout/Caution.vue +11 -0
- package/dist/runtime/components/prose/callout/Caution.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Note.vue +11 -0
- package/dist/runtime/components/prose/callout/Note.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Tip.vue +11 -0
- package/dist/runtime/components/prose/callout/Tip.vue.d.ts +14 -0
- package/dist/runtime/components/prose/callout/Warning.vue +11 -0
- package/dist/runtime/components/prose/callout/Warning.vue.d.ts +14 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFormField.d.ts +2 -2
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/composables/useResizable.d.ts +1 -1
- package/dist/runtime/inertia/components/Link.vue +12 -12
- package/dist/runtime/inertia/components/LinkBase.vue +15 -15
- package/dist/runtime/types/app.config.d.ts +6 -6
- package/dist/runtime/types/content.d.ts +4 -1
- package/dist/runtime/types/content.js +4 -0
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/prose.d.ts +42 -1
- package/dist/runtime/types/prose.js +42 -0
- package/dist/runtime/types/tv.d.ts +2 -2
- package/dist/runtime/utils/index.d.ts +1 -1
- package/dist/runtime/utils/index.js +13 -4
- package/dist/runtime/vue/components/Icon.vue +1 -1
- package/dist/runtime/vue/components/Link.vue +31 -31
- package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSelect.vue +7 -7
- package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +7 -7
- package/dist/shared/{ui.BcVNrqyb.mjs → ui.DQZ75GCP.mjs} +183 -180
- package/dist/unplugin.mjs +9 -9
- package/dist/vite.mjs +1 -1
- package/package.json +8 -9
- package/vue-plugin.d.ts +5 -5
package/cli/templates.mjs
CHANGED
|
@@ -1,228 +1,236 @@
|
|
|
1
|
-
import { splitByCase, upperFirst, camelCase, kebabCase } from 'scule'
|
|
2
|
-
|
|
3
|
-
const playground = ({ name }) => {
|
|
4
|
-
const upperName = splitByCase(name)
|
|
5
|
-
.map(p => upperFirst(p))
|
|
6
|
-
.join('')
|
|
7
|
-
const kebabName = kebabCase(name)
|
|
8
|
-
|
|
9
|
-
return {
|
|
10
|
-
filename: `playground/app/pages/components/${kebabName}.vue`,
|
|
11
|
-
contents:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
import type {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
import {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
import
|
|
82
|
-
import type {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
import {
|
|
101
|
-
import {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
['with
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
})
|
|
168
|
-
})
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
###
|
|
212
|
-
|
|
213
|
-
:component-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
:component-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
1
|
+
import { splitByCase, upperFirst, camelCase, kebabCase } from 'scule'
|
|
2
|
+
|
|
3
|
+
const playground = ({ name, pro }) => {
|
|
4
|
+
const upperName = splitByCase(name)
|
|
5
|
+
.map(p => upperFirst(p))
|
|
6
|
+
.join('')
|
|
7
|
+
const kebabName = kebabCase(name)
|
|
8
|
+
|
|
9
|
+
return {
|
|
10
|
+
filename: `playground/app/pages/components/${kebabName}.vue`,
|
|
11
|
+
contents: pro
|
|
12
|
+
? undefined
|
|
13
|
+
: `
|
|
14
|
+
<template>
|
|
15
|
+
<div>
|
|
16
|
+
<U${upperName} />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
`
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const component = ({ name, primitive, pro, prose, content }) => {
|
|
24
|
+
const upperName = splitByCase(name)
|
|
25
|
+
.map(p => upperFirst(p))
|
|
26
|
+
.join('')
|
|
27
|
+
const camelName = camelCase(name)
|
|
28
|
+
const kebabName = kebabCase(name)
|
|
29
|
+
const key = pro ? 'uiPro' : 'ui'
|
|
30
|
+
const path = pro ? 'ui-pro' : 'ui'
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
filename: `src/runtime/components/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${upperName}.vue`,
|
|
34
|
+
contents: primitive
|
|
35
|
+
? `
|
|
36
|
+
<script lang="ts">
|
|
37
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
38
|
+
${pro ? `import type { ComponentConfig } from '@eslamdevui/ui'` : ''}
|
|
39
|
+
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
|
|
40
|
+
${!pro ? `import type { ComponentConfig } from '../types/utils'` : ''}
|
|
41
|
+
|
|
42
|
+
type ${upperName} = ComponentConfig<typeof theme, AppConfig, ${upperName}${pro ? `, '${key}'` : ''}>
|
|
43
|
+
|
|
44
|
+
export interface ${upperName}Props {
|
|
45
|
+
/**
|
|
46
|
+
* The element or component this component should render as.
|
|
47
|
+
* @defaultValue 'div'
|
|
48
|
+
*/
|
|
49
|
+
as?: any
|
|
50
|
+
class?: any
|
|
51
|
+
ui?: ${upperName}['slots']
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ${upperName}Slots {
|
|
55
|
+
default(props?: {}): any
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<script setup lang="ts">
|
|
60
|
+
import { computed } from 'vue'
|
|
61
|
+
import { Primitive } from 'reka-ui'
|
|
62
|
+
import { useAppConfig } from '#imports'
|
|
63
|
+
import { tv } from '../utils/tv'
|
|
64
|
+
|
|
65
|
+
const props = defineProps<${upperName}Props>()
|
|
66
|
+
defineSlots<${upperName}Slots>()
|
|
67
|
+
|
|
68
|
+
const appConfig = useAppConfig() as ${upperName}['AppConfig']
|
|
69
|
+
|
|
70
|
+
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.${pro ? 'uiPro' : 'ui'}?.${camelName} || {}) })())
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
|
|
75
|
+
<slot />
|
|
76
|
+
</Primitive>
|
|
77
|
+
</template>
|
|
78
|
+
`
|
|
79
|
+
: `
|
|
80
|
+
<script lang="ts">
|
|
81
|
+
import type { ${upperName}RootProps, ${upperName}RootEmits } from 'reka-ui'
|
|
82
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
83
|
+
${pro ? `import type { ComponentConfig } from '@eslamdevui/ui'` : ''}
|
|
84
|
+
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
|
|
85
|
+
${!pro ? `import type { ComponentConfig } from '../types/utils'` : ''}
|
|
86
|
+
|
|
87
|
+
type ${upperName} = ComponentConfig<typeof theme, AppConfig, ${upperName}${pro ? `, '${key}'` : ''}>
|
|
88
|
+
|
|
89
|
+
export interface ${upperName}Props extends Pick<${upperName}RootProps> {
|
|
90
|
+
class?: any
|
|
91
|
+
ui?: ${upperName}['slots']
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface ${upperName}Emits extends ${upperName}RootEmits {}
|
|
95
|
+
|
|
96
|
+
export interface ${upperName}Slots {}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<script setup lang="ts">
|
|
100
|
+
import { computed } from 'vue'
|
|
101
|
+
import { ${upperName}Root, useForwardPropsEmits } from 'reka-ui'
|
|
102
|
+
import { reactivePick } from '@vueuse/core'
|
|
103
|
+
import { useAppConfig } from '#imports'
|
|
104
|
+
import { tv } from '../utils/tv'
|
|
105
|
+
|
|
106
|
+
const props = defineProps<${upperName}Props>()
|
|
107
|
+
const emits = defineEmits<${upperName}Emits>()
|
|
108
|
+
const slots = defineSlots<${upperName}Slots>()
|
|
109
|
+
|
|
110
|
+
const appConfig = useAppConfig() as ${upperName}['AppConfig']
|
|
111
|
+
|
|
112
|
+
const rootProps = useForwardPropsEmits(reactivePick(props), emits)
|
|
113
|
+
|
|
114
|
+
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.${pro ? 'uiPro' : 'ui'}?.${camelName} || {}) })())
|
|
115
|
+
</script>
|
|
116
|
+
|
|
117
|
+
<template>
|
|
118
|
+
<${upperName}Root v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })" />
|
|
119
|
+
</template>
|
|
120
|
+
`
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const theme = ({ name, prose, content }) => {
|
|
125
|
+
const kebabName = kebabCase(name)
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
filename: `src/theme/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}.ts`,
|
|
129
|
+
contents: prose
|
|
130
|
+
? `
|
|
131
|
+
export default {
|
|
132
|
+
base: ''
|
|
133
|
+
}
|
|
134
|
+
`
|
|
135
|
+
: `
|
|
136
|
+
export default {
|
|
137
|
+
slots: {
|
|
138
|
+
root: ''
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
`
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const test = ({ name, prose, content }) => {
|
|
146
|
+
const upperName = splitByCase(name)
|
|
147
|
+
.map(p => upperFirst(p))
|
|
148
|
+
.join('')
|
|
149
|
+
|
|
150
|
+
return {
|
|
151
|
+
filename: `test/components/${content ? 'content/' : ''}${upperName}.spec.ts`,
|
|
152
|
+
contents: prose
|
|
153
|
+
? undefined
|
|
154
|
+
: `
|
|
155
|
+
import { describe, it, expect } from 'vitest'
|
|
156
|
+
import ${upperName}, { type ${upperName}Props, type ${upperName}Slots } from '../../${content ? '../' : ''}src/runtime/components/${content ? 'content/' : ''}${upperName}.vue'
|
|
157
|
+
import ComponentRender from '../${content ? '../' : ''}component-render'
|
|
158
|
+
|
|
159
|
+
describe('${upperName}', () => {
|
|
160
|
+
it.each([
|
|
161
|
+
// Props
|
|
162
|
+
['with as', { props: { as: 'section' } }],
|
|
163
|
+
['with class', { props: { class: '' } }],
|
|
164
|
+
['with ui', { props: { ui: {} } }],
|
|
165
|
+
// Slots
|
|
166
|
+
['with default slot', { slots: { default: () => 'Default slot' } }]
|
|
167
|
+
])('renders %s correctly', async (nameOrHtml: string, options: { props?: ${upperName}Props, slots?: Partial<${upperName}Slots> }) => {
|
|
168
|
+
const html = await ComponentRender(nameOrHtml, options, ${upperName})
|
|
169
|
+
expect(html).toMatchSnapshot()
|
|
170
|
+
})
|
|
171
|
+
})
|
|
172
|
+
`
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const docs = ({ name, pro, primitive }) => {
|
|
177
|
+
const kebabName = kebabCase(name)
|
|
178
|
+
const upperName = splitByCase(name)
|
|
179
|
+
.map(p => upperFirst(p))
|
|
180
|
+
.join('')
|
|
181
|
+
|
|
182
|
+
return {
|
|
183
|
+
filename: `docs/content/3.components/${kebabName}.md`,
|
|
184
|
+
contents: `---
|
|
185
|
+
title: ${upperName}
|
|
186
|
+
description: ''${
|
|
187
|
+
pro
|
|
188
|
+
? `
|
|
189
|
+
module: ui-pro`
|
|
190
|
+
: ''
|
|
191
|
+
}
|
|
192
|
+
links:${
|
|
193
|
+
primitive
|
|
194
|
+
? ''
|
|
195
|
+
: `
|
|
196
|
+
- label: ${upperName}
|
|
197
|
+
icon: i-custom-reka-ui
|
|
198
|
+
to: https://reka-ui.com/docs/components/${kebabName}`
|
|
199
|
+
}
|
|
200
|
+
- label: GitHub
|
|
201
|
+
icon: i-simple-icons-github
|
|
202
|
+
to: https://github.com/MohamedEslam04/${pro ? 'ui-pro' : 'ui'}/tree/v3/src/runtime/components/${upperName}.vue
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Usage
|
|
206
|
+
|
|
207
|
+
## Examples
|
|
208
|
+
|
|
209
|
+
## API
|
|
210
|
+
|
|
211
|
+
### Props
|
|
212
|
+
|
|
213
|
+
:component-props${pro ? '{pro}' : ''}
|
|
214
|
+
|
|
215
|
+
### Slots
|
|
216
|
+
|
|
217
|
+
:component-slots${pro ? '{pro}' : ''}
|
|
218
|
+
|
|
219
|
+
### Emits
|
|
220
|
+
|
|
221
|
+
:component-emits${pro ? '{pro}' : ''}
|
|
222
|
+
|
|
223
|
+
## Theme
|
|
224
|
+
|
|
225
|
+
:component-theme${pro ? '{pro}' : ''}
|
|
226
|
+
`
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export default {
|
|
231
|
+
playground,
|
|
232
|
+
component,
|
|
233
|
+
theme,
|
|
234
|
+
test,
|
|
235
|
+
docs
|
|
236
|
+
}
|
package/cli/utils.mjs
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { promises as fsp } from 'node:fs'
|
|
2
|
-
|
|
3
|
-
export async function sortFile(path) {
|
|
4
|
-
const file = await fsp.readFile(path, 'utf-8')
|
|
5
|
-
|
|
6
|
-
const lines = file.trim().split('\n').sort()
|
|
7
|
-
|
|
8
|
-
await fsp.writeFile(path, lines.join('\n') + '\n')
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export async function appendFile(path, contents) {
|
|
12
|
-
const file = await fsp.readFile(path, 'utf-8')
|
|
13
|
-
|
|
14
|
-
if (!file.includes(contents)) {
|
|
15
|
-
await fsp.writeFile(path, file.trim() + '\n' + contents + '\n')
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function normalizeLocale(locale) {
|
|
20
|
-
if (!locale) {
|
|
21
|
-
return ''
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (locale.includes('_')) {
|
|
25
|
-
return locale.split('_')
|
|
26
|
-
.map((part, index) => index === 0 ? part.toLowerCase() : part.toUpperCase())
|
|
27
|
-
.join('-')
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return locale.toLowerCase()
|
|
31
|
-
}
|
|
1
|
+
import { promises as fsp } from 'node:fs'
|
|
2
|
+
|
|
3
|
+
export async function sortFile(path) {
|
|
4
|
+
const file = await fsp.readFile(path, 'utf-8')
|
|
5
|
+
|
|
6
|
+
const lines = file.trim().split('\n').sort()
|
|
7
|
+
|
|
8
|
+
await fsp.writeFile(path, lines.join('\n') + '\n')
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function appendFile(path, contents) {
|
|
12
|
+
const file = await fsp.readFile(path, 'utf-8')
|
|
13
|
+
|
|
14
|
+
if (!file.includes(contents)) {
|
|
15
|
+
await fsp.writeFile(path, file.trim() + '\n' + contents + '\n')
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function normalizeLocale(locale) {
|
|
20
|
+
if (!locale) {
|
|
21
|
+
return ''
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (locale.includes('_')) {
|
|
25
|
+
return locale.split('_')
|
|
26
|
+
.map((part, index) => index === 0 ? part.toLowerCase() : part.toUpperCase())
|
|
27
|
+
.join('-')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return locale.toLowerCase()
|
|
31
|
+
}
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from 'defu';
|
|
2
2
|
import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, installModule } from '@nuxt/kit';
|
|
3
|
-
import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.
|
|
3
|
+
import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.DQZ75GCP.mjs';
|
|
4
4
|
import '../dist/runtime/utils/index.js';
|
|
5
5
|
import 'node:url';
|
|
6
6
|
import 'scule';
|
|
@@ -8,7 +8,7 @@ import 'tailwindcss/colors';
|
|
|
8
8
|
import 'knitwork';
|
|
9
9
|
|
|
10
10
|
const name = "@eslamdevui/ui";
|
|
11
|
-
const version = "3.2.0-beta.
|
|
11
|
+
const version = "3.2.0-beta.2";
|
|
12
12
|
|
|
13
13
|
const module = defineNuxtModule({
|
|
14
14
|
meta: {
|
|
@@ -27,9 +27,15 @@ const module = defineNuxtModule({
|
|
|
27
27
|
options.theme.colors = resolveColors(options.theme.colors);
|
|
28
28
|
nuxt.options.ui = options;
|
|
29
29
|
nuxt.options.alias["#ui"] = resolve("./runtime");
|
|
30
|
-
nuxt.options.appConfig.ui = defu(
|
|
30
|
+
nuxt.options.appConfig.ui = defu(
|
|
31
|
+
nuxt.options.appConfig.ui || {},
|
|
32
|
+
getDefaultUiConfig(options.theme.colors)
|
|
33
|
+
);
|
|
31
34
|
nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {};
|
|
32
|
-
nuxt.options.app.rootAttrs.class = [
|
|
35
|
+
nuxt.options.app.rootAttrs.class = [
|
|
36
|
+
nuxt.options.app.rootAttrs.class,
|
|
37
|
+
"isolate"
|
|
38
|
+
].filter(Boolean).join(" ");
|
|
33
39
|
if (nuxt.options.builder === "@nuxt/vite-builder") {
|
|
34
40
|
const plugin = await import('@tailwindcss/vite').then((r) => r.default);
|
|
35
41
|
addVitePlugin(plugin());
|
|
@@ -59,10 +65,9 @@ const module = defineNuxtModule({
|
|
|
59
65
|
disableTransition: true
|
|
60
66
|
});
|
|
61
67
|
}
|
|
62
|
-
await registerModule("@nuxt/content", "content", {});
|
|
63
68
|
addPlugin({ src: resolve("./runtime/plugins/colors") });
|
|
64
|
-
if (hasNuxtModule("@nuxtjs/mdc") || options.mdc ||
|
|
65
|
-
nuxt.options.mdc = defu(
|
|
69
|
+
if (hasNuxtModule("@nuxtjs/mdc") || options.mdc || hasNuxtModule("@nuxt/content") || options.content) {
|
|
70
|
+
nuxt.options.mdc = defu(options.mdc, {
|
|
66
71
|
highlight: {
|
|
67
72
|
theme: {
|
|
68
73
|
light: "material-theme-lighter",
|
|
@@ -98,13 +103,13 @@ const module = defineNuxtModule({
|
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
105
|
});
|
|
101
|
-
addComponentsDir({
|
|
102
|
-
path: resolve("./runtime/components/prose"),
|
|
103
|
-
prefix: "Prose",
|
|
104
|
-
pathPrefix: false,
|
|
105
|
-
global: true
|
|
106
|
-
});
|
|
107
106
|
}
|
|
107
|
+
addComponentsDir({
|
|
108
|
+
path: resolve("./runtime/components/prose"),
|
|
109
|
+
prefix: "Prose",
|
|
110
|
+
pathPrefix: false,
|
|
111
|
+
global: true
|
|
112
|
+
});
|
|
108
113
|
if (hasNuxtModule("@nuxt/content") || options.content) {
|
|
109
114
|
addComponentsDir({
|
|
110
115
|
path: resolve("./runtime/components/content"),
|