@nuxt/ui 3.0.0-alpha.0 → 3.0.0-alpha.10
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/accordion.ts +20 -0
- package/.nuxt/ui/alert.ts +242 -0
- package/.nuxt/ui/avatar-group.ts +40 -0
- package/.nuxt/ui/avatar.ts +42 -0
- package/.nuxt/ui/badge.ts +194 -0
- package/.nuxt/ui/breadcrumb.ts +45 -0
- package/.nuxt/ui/button-group.ts +16 -0
- package/.nuxt/ui/button.ts +344 -0
- package/.nuxt/ui/calendar.ts +85 -0
- package/.nuxt/ui/card.ts +8 -0
- package/.nuxt/ui/carousel.ts +41 -0
- package/.nuxt/ui/checkbox.ts +105 -0
- package/.nuxt/ui/chip.ts +67 -0
- package/.nuxt/ui/collapsible.ts +6 -0
- package/.nuxt/ui/color-picker.ts +39 -0
- package/.nuxt/ui/command-palette.ts +50 -0
- package/.nuxt/ui/container.ts +3 -0
- package/.nuxt/ui/context-menu.ts +198 -0
- package/.nuxt/ui/drawer.ts +55 -0
- package/.nuxt/ui/dropdown-menu.ts +199 -0
- package/.nuxt/ui/form-field.ts +40 -0
- package/.nuxt/ui/form.ts +3 -0
- package/.nuxt/ui/index.ts +48 -0
- package/.nuxt/ui/input-menu.ts +410 -0
- package/.nuxt/ui/input-number.ts +204 -0
- package/.nuxt/ui/input.ts +263 -0
- package/.nuxt/ui/kbd.ts +19 -0
- package/.nuxt/ui/link.ts +15 -0
- package/.nuxt/ui/modal.ts +28 -0
- package/.nuxt/ui/navigation-menu.ts +390 -0
- package/.nuxt/ui/pagination.ts +8 -0
- package/.nuxt/ui/pin-input.ts +145 -0
- package/.nuxt/ui/popover.ts +6 -0
- package/.nuxt/ui/progress.ts +258 -0
- package/.nuxt/ui/radio-group.ts +112 -0
- package/.nuxt/ui/select-menu.ts +316 -0
- package/.nuxt/ui/select.ts +315 -0
- package/.nuxt/ui/separator.ts +143 -0
- package/.nuxt/ui/skeleton.ts +3 -0
- package/.nuxt/ui/slideover.ts +63 -0
- package/.nuxt/ui/slider.ts +148 -0
- package/.nuxt/ui/stepper.ts +180 -0
- package/.nuxt/ui/switch.ts +113 -0
- package/.nuxt/ui/table.ts +129 -0
- package/.nuxt/ui/tabs.ts +227 -0
- package/.nuxt/ui/textarea.ts +263 -0
- package/.nuxt/ui/toast.ts +66 -0
- package/.nuxt/ui/toaster.ts +75 -0
- package/.nuxt/ui/tooltip.ts +9 -0
- package/README.md +75 -54
- package/cli/commands/{init.mjs → make/component.mjs} +5 -5
- package/cli/commands/make/index.mjs +14 -0
- package/cli/commands/make/locale.mjs +64 -0
- package/cli/index.mjs +2 -2
- package/cli/templates.mjs +52 -7
- package/cli/utils.mjs +14 -0
- package/dist/chunks/component-meta.cjs +82802 -0
- package/dist/chunks/component-meta.mjs +82800 -0
- package/dist/client/devtools/200.html +1 -0
- package/dist/client/devtools/404.html +1 -0
- package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKK58UfivUw4aw-SK92LTmKP0.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKy58UfivUw-9uYm8d48E4.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K6z9mXg-VNw7NHvqnp.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6z9mXgjU0-EkYdMs3MAX.woff2 +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-7DW3w-R7n06NbhGy.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDG3w-leGNfkTmsj.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDW3w-ciElMF03ku.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JCm3w-sB722Uoa0f.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JDW3w-PBDI1JDjwV.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8gCm3w-0q1hqVn09O.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9XCm3w-ByvzuLy2fa.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9uCm3w-5TKCIs6EEw.woff +0 -0
- package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat_XDW3w-r2swRDGfn2.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAC5thTQ-ldB60l5U8r.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpthTQ-wbFKGFDrgo.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpxhTQ-LLUBv5jskj.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwARZthTQ-F71RdTRbNg.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwA_JxhTQ-6nh65gZkc0.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJthTQ-aMoWEJLmTt.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAkJxhTQ-WMBvmLOgKm.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAop1hTQ-utGC2hnWq2.woff +0 -0
- package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxhTQ-YpyTieVa5B.woff +0 -0
- package/dist/client/devtools/_nuxt/B1fTd_Rf.js +1 -0
- package/dist/client/devtools/_nuxt/CSUxkedg.js +1 -0
- package/dist/client/devtools/_nuxt/CbRTGpb7.js +1 -0
- package/dist/client/devtools/_nuxt/YQTlxbcT.js +53 -0
- package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
- package/dist/client/devtools/_nuxt/builds/meta/b3465abc-0a92-4ee7-ba6b-e5174891fcc0.json +1 -0
- package/dist/client/devtools/_nuxt/entry.DXXceQev.css +1 -0
- package/dist/client/devtools/_nuxt/error-404.BJpkZFyY.css +1 -0
- package/dist/client/devtools/_nuxt/error-500.D3i9VDlt.css +1 -0
- package/dist/client/devtools/favicon.svg +1 -0
- package/dist/client/devtools/index.html +1 -0
- package/dist/devtools/runtime/DevtoolsRenderer.vue +54 -0
- package/dist/devtools/runtime/examples/AvatarGroupExample.vue +7 -0
- package/dist/devtools/runtime/examples/ButtonGroupExample.vue +8 -0
- package/dist/devtools/runtime/examples/CardExample.vue +13 -0
- package/dist/devtools/runtime/examples/CarouselExample.vue +13 -0
- package/dist/devtools/runtime/examples/ChipExample.vue +5 -0
- package/dist/devtools/runtime/examples/CollapsibleExample.vue +8 -0
- package/dist/devtools/runtime/examples/CommandPaletteExample.vue +29 -0
- package/dist/devtools/runtime/examples/ContainerExample.vue +5 -0
- package/dist/devtools/runtime/examples/ContextMenuExample.vue +5 -0
- package/dist/devtools/runtime/examples/DrawerExample.vue +8 -0
- package/dist/devtools/runtime/examples/DropdownMenuExample.vue +5 -0
- package/dist/devtools/runtime/examples/FormExample.vue +30 -0
- package/dist/devtools/runtime/examples/FormFieldExample.vue +5 -0
- package/dist/devtools/runtime/examples/LinkExample.vue +5 -0
- package/dist/devtools/runtime/examples/ModalExample.vue +8 -0
- package/dist/devtools/runtime/examples/PopoverExample.vue +8 -0
- package/dist/devtools/runtime/examples/SkeletonExample.vue +3 -0
- package/dist/devtools/runtime/examples/SlideoverExample.vue +8 -0
- package/dist/devtools/runtime/examples/StepperExample.vue +44 -0
- package/dist/devtools/runtime/examples/ToasterExample.vue +11 -0
- package/dist/devtools/runtime/examples/TooltipExample.vue +5 -0
- package/dist/module.cjs +223 -4
- package/dist/module.d.cts +54 -0
- package/dist/module.d.mts +38 -7
- package/dist/module.d.ts +38 -7
- package/dist/module.json +4 -3
- package/dist/module.mjs +180 -2617
- package/dist/runtime/components/Accordion.vue +95 -11
- package/dist/runtime/components/Alert.vue +69 -10
- package/dist/runtime/components/App.vue +28 -5
- package/dist/runtime/components/Avatar.vue +57 -12
- package/dist/runtime/components/AvatarGroup.vue +34 -7
- package/dist/runtime/components/Badge.vue +61 -9
- package/dist/runtime/components/Breadcrumb.vue +93 -16
- package/dist/runtime/components/Button.vue +78 -12
- package/dist/runtime/components/ButtonGroup.vue +35 -8
- package/dist/runtime/components/Calendar.vue +190 -0
- package/dist/runtime/components/Card.vue +29 -7
- package/dist/runtime/components/Carousel.vue +322 -0
- package/dist/runtime/components/Checkbox.vue +64 -30
- package/dist/runtime/components/Chip.vue +48 -8
- package/dist/runtime/components/Collapsible.vue +32 -8
- package/dist/runtime/components/ColorPicker.vue +265 -0
- package/dist/runtime/components/CommandPalette.vue +207 -88
- package/dist/runtime/components/Container.vue +26 -7
- package/dist/runtime/components/ContextMenu.vue +150 -11
- package/dist/runtime/components/ContextMenuContent.vue +63 -19
- package/dist/runtime/components/Drawer.vue +68 -15
- package/dist/runtime/components/DropdownMenu.vue +147 -12
- package/dist/runtime/components/DropdownMenuContent.vue +69 -19
- package/dist/runtime/components/Form.vue +80 -42
- package/dist/runtime/components/FormField.vue +58 -21
- package/dist/runtime/components/Icon.vue +13 -3
- package/dist/runtime/components/Input.vue +61 -12
- package/dist/runtime/components/InputMenu.vue +247 -53
- package/dist/runtime/components/InputNumber.vue +192 -0
- package/dist/runtime/components/Kbd.vue +31 -7
- package/dist/runtime/components/Link.vue +148 -21
- package/dist/runtime/components/LinkBase.vue +21 -8
- package/dist/runtime/components/Modal.vue +90 -15
- package/dist/runtime/components/NavigationMenu.vue +234 -69
- package/dist/runtime/components/Pagination.vue +124 -15
- package/dist/runtime/components/PinInput.vue +96 -0
- package/dist/runtime/components/Popover.vue +66 -11
- package/dist/runtime/components/Progress.vue +67 -12
- package/dist/runtime/components/RadioGroup.vue +78 -9
- package/dist/runtime/components/Select.vue +155 -26
- package/dist/runtime/components/SelectMenu.vue +245 -63
- package/dist/runtime/components/Separator.vue +42 -7
- package/dist/runtime/components/Skeleton.vue +22 -7
- package/dist/runtime/components/Slideover.vue +88 -15
- package/dist/runtime/components/Slider.vue +37 -7
- package/dist/runtime/components/Stepper.vue +171 -0
- package/dist/runtime/components/Switch.vue +58 -14
- package/dist/runtime/components/Table.vue +262 -0
- package/dist/runtime/components/Tabs.vue +97 -17
- package/dist/runtime/components/Textarea.vue +55 -9
- package/dist/runtime/components/Toast.vue +66 -9
- package/dist/runtime/components/Toaster.vue +57 -21
- package/dist/runtime/components/Tooltip.vue +49 -10
- package/dist/runtime/composables/defineLocale.d.ts +9 -0
- package/dist/runtime/composables/defineLocale.js +4 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
- package/dist/runtime/composables/defineShortcuts.js +2 -8
- package/dist/runtime/composables/extendDevtoolsMeta.d.ts +7 -0
- package/dist/runtime/composables/extendDevtoolsMeta.js +2 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +2 -2
- package/dist/runtime/composables/useButtonGroup.d.ts +5 -5
- package/dist/runtime/composables/useComponentIcons.d.ts +3 -0
- package/dist/runtime/composables/useFormField.d.ts +13 -6
- package/dist/runtime/composables/useFormField.js +12 -7
- package/dist/runtime/composables/useKbd.d.ts +10 -3
- package/dist/runtime/composables/useKbd.js +14 -8
- package/dist/runtime/composables/useLocale.d.ts +4 -0
- package/dist/runtime/composables/useLocale.js +10 -0
- package/dist/runtime/composables/useModal.d.ts +2 -2
- package/dist/runtime/composables/useSlideover.d.ts +2 -2
- package/dist/runtime/composables/useToast.d.ts +2 -2
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/keyframes.css +1 -0
- package/dist/runtime/locale/ar.d.ts +2 -0
- package/dist/runtime/locale/ar.js +53 -0
- package/dist/runtime/locale/cs.d.ts +2 -0
- package/dist/runtime/locale/cs.js +52 -0
- package/dist/runtime/locale/de.d.ts +2 -0
- package/dist/runtime/locale/de.js +52 -0
- package/dist/runtime/locale/en.d.ts +2 -0
- package/dist/runtime/locale/en.js +52 -0
- package/dist/runtime/locale/es.d.ts +2 -0
- package/dist/runtime/locale/es.js +52 -0
- package/dist/runtime/locale/fa_ir.d.ts +2 -0
- package/dist/runtime/locale/fa_ir.js +53 -0
- package/dist/runtime/locale/fr.d.ts +2 -0
- package/dist/runtime/locale/fr.js +52 -0
- package/dist/runtime/locale/index.d.ts +19 -0
- package/dist/runtime/locale/index.js +19 -0
- package/dist/runtime/locale/it.d.ts +2 -0
- package/dist/runtime/locale/it.js +52 -0
- package/dist/runtime/locale/ja.d.ts +2 -0
- package/dist/runtime/locale/ja.js +52 -0
- package/dist/runtime/locale/ko.d.ts +2 -0
- package/dist/runtime/locale/ko.js +52 -0
- package/dist/runtime/locale/nl.d.ts +2 -0
- package/dist/runtime/locale/nl.js +52 -0
- package/dist/runtime/locale/pl.d.ts +2 -0
- package/dist/runtime/locale/pl.js +52 -0
- package/dist/runtime/locale/pt.d.ts +2 -0
- package/dist/runtime/locale/pt.js +52 -0
- package/dist/runtime/locale/pt_br.d.ts +2 -0
- package/dist/runtime/locale/pt_br.js +52 -0
- package/dist/runtime/locale/ru.d.ts +2 -0
- package/dist/runtime/locale/ru.js +52 -0
- package/dist/runtime/locale/sk.d.ts +2 -0
- package/dist/runtime/locale/sk.js +52 -0
- package/dist/runtime/locale/tr.d.ts +2 -0
- package/dist/runtime/locale/tr.js +52 -0
- package/dist/runtime/locale/zh_hans.d.ts +2 -0
- package/dist/runtime/locale/zh_hans.js +52 -0
- package/dist/runtime/locale/zh_hant.d.ts +2 -0
- package/dist/runtime/locale/zh_hant.js +52 -0
- package/dist/runtime/plugins/colors.d.ts +2 -0
- package/dist/runtime/plugins/colors.js +12 -8
- package/dist/runtime/plugins/modal.d.ts +2 -0
- package/dist/runtime/plugins/slideover.d.ts +2 -0
- package/dist/runtime/types/form.d.ts +10 -4
- package/dist/runtime/types/index.d.ts +50 -42
- package/dist/runtime/types/index.js +8 -0
- package/dist/runtime/types/locale.d.ts +54 -0
- package/dist/runtime/types/utils.d.ts +8 -3
- package/dist/runtime/utils/form.d.ts +7 -5
- package/dist/runtime/utils/form.js +117 -28
- package/dist/runtime/utils/index.d.ts +2 -1
- package/dist/runtime/utils/index.js +16 -0
- package/dist/runtime/utils/link.d.ts +25 -55
- package/dist/runtime/utils/link.js +1 -1
- package/dist/runtime/utils/locale.d.ts +15 -0
- package/dist/runtime/utils/locale.js +25 -0
- package/dist/runtime/vue/components/Icon.vue +15 -0
- package/dist/runtime/vue/components/Link.vue +208 -0
- package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
- package/dist/runtime/vue/plugins/color-mode.js +6 -0
- package/dist/runtime/vue/plugins/head.d.ts +4 -0
- package/dist/runtime/vue/plugins/head.js +6 -0
- package/dist/runtime/vue/stubs.d.ts +15 -0
- package/dist/runtime/vue/stubs.js +27 -0
- package/dist/shared/ui.CwmIkD_Y.cjs +3269 -0
- package/dist/shared/ui.D_93iuwH.mjs +3262 -0
- package/dist/unplugin.cjs +192 -0
- package/dist/unplugin.d.cts +49 -0
- package/dist/unplugin.d.mts +49 -0
- package/dist/unplugin.d.ts +49 -0
- package/dist/unplugin.mjs +181 -0
- package/dist/vite.cjs +22 -0
- package/dist/vite.d.cts +13 -0
- package/dist/vite.d.mts +13 -0
- package/dist/vite.d.ts +13 -0
- package/dist/vite.mjs +20 -0
- package/package.json +103 -37
- package/vue-plugin.d.ts +5 -0
- package/dist/runtime/assets/css/animations.css +0 -1
- package/dist/runtime/components/Accordion.vue.d.ts +0 -492
- package/dist/runtime/components/Alert.vue.d.ts +0 -548
- package/dist/runtime/components/App.vue.d.ts +0 -25
- package/dist/runtime/components/Avatar.vue.d.ts +0 -384
- package/dist/runtime/components/AvatarGroup.vue.d.ts +0 -381
- package/dist/runtime/components/Badge.vue.d.ts +0 -422
- package/dist/runtime/components/Breadcrumb.vue.d.ts +0 -307
- package/dist/runtime/components/Button.vue.d.ts +0 -949
- package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -182
- package/dist/runtime/components/Card.vue.d.ts +0 -191
- package/dist/runtime/components/Checkbox.vue.d.ts +0 -819
- package/dist/runtime/components/Chip.vue.d.ts +0 -590
- package/dist/runtime/components/Collapsible.vue.d.ts +0 -159
- package/dist/runtime/components/CommandPalette.vue.d.ts +0 -684
- package/dist/runtime/components/Container.vue.d.ts +0 -27
- package/dist/runtime/components/ContextMenu.vue.d.ts +0 -796
- package/dist/runtime/components/Drawer.vue.d.ts +0 -343
- package/dist/runtime/components/DropdownMenu.vue.d.ts +0 -815
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -0
- package/dist/runtime/components/Form.vue.d.ts +0 -39
- package/dist/runtime/components/FormField.vue.d.ts +0 -356
- package/dist/runtime/components/Icon.vue.d.ts +0 -17
- package/dist/runtime/components/Input.vue.d.ts +0 -1137
- package/dist/runtime/components/InputMenu.vue.d.ts +0 -2121
- package/dist/runtime/components/Kbd.vue.d.ts +0 -169
- package/dist/runtime/components/Link.vue.d.ts +0 -76
- package/dist/runtime/components/LinkBase.vue.d.ts +0 -49
- package/dist/runtime/components/Modal.vue.d.ts +0 -319
- package/dist/runtime/components/NavigationMenu.vue.d.ts +0 -1789
- package/dist/runtime/components/Pagination.vue.d.ts +0 -295
- package/dist/runtime/components/Popover.vue.d.ts +0 -197
- package/dist/runtime/components/Progress.vue.d.ts +0 -1781
- package/dist/runtime/components/RadioGroup.vue.d.ts +0 -1715
- package/dist/runtime/components/Select.vue.d.ts +0 -1569
- package/dist/runtime/components/SelectMenu.vue.d.ts +0 -1661
- package/dist/runtime/components/Separator.vue.d.ts +0 -0
- package/dist/runtime/components/Skeleton.vue.d.ts +0 -26
- package/dist/runtime/components/Slideover.vue.d.ts +0 -375
- package/dist/runtime/components/Slider.vue.d.ts +0 -0
- package/dist/runtime/components/Switch.vue.d.ts +0 -1676
- package/dist/runtime/components/Tabs.vue.d.ts +0 -934
- package/dist/runtime/components/Textarea.vue.d.ts +0 -1133
- package/dist/runtime/components/Toast.vue.d.ts +0 -0
- package/dist/runtime/components/Toaster.vue.d.ts +0 -362
- package/dist/runtime/components/Tooltip.vue.d.ts +0 -248
- package/dist/runtime/types/component.d.ts +0 -17
- package/dist/runtime/types/component.js +0 -0
- /package/dist/runtime/{components/ContextMenuContent.vue.d.ts → types/locale.js} +0 -0
|
@@ -1,21 +1,55 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { ToastProviderProps } from 'reka-ui'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/toaster'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
8
|
+
|
|
9
|
+
const appConfig = _appConfig as AppConfig & { ui: { toaster: Partial<typeof theme> } }
|
|
10
|
+
|
|
11
|
+
const toaster = tv({ extend: tv(theme), ...(appConfig.ui?.toaster || {}) })
|
|
12
|
+
|
|
13
|
+
type ToasterVariants = VariantProps<typeof toaster>
|
|
14
|
+
|
|
15
|
+
export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'> {
|
|
16
|
+
position?: ToasterVariants['position']
|
|
17
|
+
/**
|
|
18
|
+
* Expand the toasts to show multiple toasts at once.
|
|
19
|
+
* @defaultValue true
|
|
20
|
+
*/
|
|
21
|
+
expand?: boolean
|
|
22
|
+
/**
|
|
23
|
+
* Render the toaster in a portal.
|
|
24
|
+
* @defaultValue true
|
|
25
|
+
*/
|
|
26
|
+
portal?: boolean
|
|
27
|
+
class?: any
|
|
28
|
+
ui?: Partial<typeof toaster.slots>
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ToasterSlots {
|
|
32
|
+
default(props?: {}): any
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default {
|
|
36
|
+
name: 'Toaster'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
extendDevtoolsMeta({ example: 'ToasterExample' })
|
|
7
40
|
</script>
|
|
8
41
|
|
|
9
42
|
<script setup lang="ts">
|
|
10
43
|
import { ref, computed } from 'vue'
|
|
11
|
-
import { ToastProvider, ToastViewport, useForwardProps } from '
|
|
44
|
+
import { ToastProvider, ToastViewport, ToastPortal, useForwardProps } from 'reka-ui'
|
|
12
45
|
import { reactivePick } from '@vueuse/core'
|
|
13
46
|
import { useToast } from '../composables/useToast'
|
|
14
|
-
import UToast from './Toast.vue'
|
|
15
47
|
import { omit } from '../utils'
|
|
48
|
+
import UToast from './Toast.vue'
|
|
16
49
|
|
|
17
50
|
const props = withDefaults(defineProps<ToasterProps>(), {
|
|
18
51
|
expand: true,
|
|
52
|
+
portal: true,
|
|
19
53
|
duration: 5000
|
|
20
54
|
})
|
|
21
55
|
defineSlots<ToasterSlots>()
|
|
@@ -92,18 +126,20 @@ function getOffset(index: number) {
|
|
|
92
126
|
@click="toast.click && toast.click(toast)"
|
|
93
127
|
/>
|
|
94
128
|
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
129
|
+
<ToastPortal :disabled="!portal">
|
|
130
|
+
<ToastViewport
|
|
131
|
+
:data-expanded="expanded"
|
|
132
|
+
:class="ui.viewport({ class: [props.class, props.ui?.viewport] })"
|
|
133
|
+
:style="{
|
|
134
|
+
'--scale-factor': '0.05',
|
|
135
|
+
'--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
|
|
136
|
+
'--gap': position?.startsWith('top') ? '16px' : '-16px',
|
|
137
|
+
'--front-height': `${frontHeight}px`,
|
|
138
|
+
'--height': `${height}px`
|
|
139
|
+
}"
|
|
140
|
+
@mouseenter="hovered = true"
|
|
141
|
+
@mouseleave="hovered = false"
|
|
142
|
+
/>
|
|
143
|
+
</ToastPortal>
|
|
108
144
|
</ToastProvider>
|
|
109
145
|
</template>
|
|
@@ -1,15 +1,54 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv } from 'tailwind-variants'
|
|
3
|
+
import type { TooltipRootProps, TooltipRootEmits, TooltipContentProps, TooltipArrowProps } from 'reka-ui'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/tooltip'
|
|
7
|
+
import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
|
|
8
|
+
import type { KbdProps } from '../types'
|
|
9
|
+
|
|
10
|
+
const appConfig = _appConfig as AppConfig & { ui: { tooltip: Partial<typeof theme> } }
|
|
11
|
+
|
|
12
|
+
const tooltip = tv({ extend: tv(theme), ...(appConfig.ui?.tooltip || {}) })
|
|
13
|
+
|
|
14
|
+
export interface TooltipProps extends TooltipRootProps {
|
|
15
|
+
/** The text content of the tooltip. */
|
|
16
|
+
text?: string
|
|
17
|
+
/** The keyboard keys to display in the tooltip. */
|
|
18
|
+
kbds?: KbdProps['value'][] | KbdProps[]
|
|
19
|
+
/**
|
|
20
|
+
* The content of the tooltip.
|
|
21
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
|
|
22
|
+
*/
|
|
23
|
+
content?: Omit<TooltipContentProps, 'as' | 'asChild'>
|
|
24
|
+
/**
|
|
25
|
+
* Display an arrow alongside the tooltip.
|
|
26
|
+
* @defaultValue false
|
|
27
|
+
*/
|
|
28
|
+
arrow?: boolean | Omit<TooltipArrowProps, 'as' | 'asChild'>
|
|
29
|
+
/**
|
|
30
|
+
* Render the tooltip in a portal.
|
|
31
|
+
* @defaultValue true
|
|
32
|
+
*/
|
|
33
|
+
portal?: boolean
|
|
34
|
+
class?: any
|
|
35
|
+
ui?: Partial<typeof tooltip.slots>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface TooltipEmits extends TooltipRootEmits {}
|
|
39
|
+
|
|
40
|
+
export interface TooltipSlots {
|
|
41
|
+
default(props: { open: boolean }): any
|
|
42
|
+
content(props?: {}): any
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
extendDevtoolsMeta({ example: 'TooltipExample', defaultProps: { text: 'Hello world!' } })
|
|
7
46
|
</script>
|
|
8
47
|
|
|
9
48
|
<script setup lang="ts">
|
|
10
49
|
import { computed, toRef } from 'vue'
|
|
11
50
|
import { defu } from 'defu'
|
|
12
|
-
import { TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent, TooltipArrow, useForwardPropsEmits } from '
|
|
51
|
+
import { TooltipRoot, TooltipTrigger, TooltipPortal, TooltipContent, TooltipArrow, useForwardPropsEmits } from 'reka-ui'
|
|
13
52
|
import { reactivePick } from '@vueuse/core'
|
|
14
53
|
import UKbd from './Kbd.vue'
|
|
15
54
|
|
|
@@ -20,7 +59,7 @@ const emits = defineEmits<TooltipEmits>()
|
|
|
20
59
|
const slots = defineSlots<TooltipSlots>()
|
|
21
60
|
|
|
22
61
|
const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultOpen', 'open', 'delayDuration', 'disableHoverableContent', 'disableClosingTrigger', 'disabled', 'ignoreNonKeyboardFocus'), emits)
|
|
23
|
-
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8 }) as TooltipContentProps)
|
|
62
|
+
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8 }) as TooltipContentProps)
|
|
24
63
|
const arrowProps = toRef(() => props.arrow as TooltipArrowProps)
|
|
25
64
|
|
|
26
65
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
@@ -31,12 +70,12 @@ const ui = computed(() => tooltip({
|
|
|
31
70
|
|
|
32
71
|
<template>
|
|
33
72
|
<TooltipRoot v-slot="{ open }" v-bind="rootProps">
|
|
34
|
-
<TooltipTrigger v-if="!!slots.default" as-child>
|
|
73
|
+
<TooltipTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
35
74
|
<slot :open="open" />
|
|
36
75
|
</TooltipTrigger>
|
|
37
76
|
|
|
38
77
|
<TooltipPortal :disabled="!portal">
|
|
39
|
-
<TooltipContent v-bind="contentProps" :class="ui.content({ class: [props.class, props.ui?.content] })">
|
|
78
|
+
<TooltipContent v-bind="contentProps" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })">
|
|
40
79
|
<slot name="content">
|
|
41
80
|
<span v-if="text" :class="ui.text({ class: props.ui?.text })">{{ text }}</span>
|
|
42
81
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Locale, Direction, Messages } from '../types/locale';
|
|
2
|
+
interface DefineLocaleOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
code: string;
|
|
5
|
+
dir?: Direction;
|
|
6
|
+
messages: Messages;
|
|
7
|
+
}
|
|
8
|
+
export declare function defineLocale(options: DefineLocaleOptions): Locale;
|
|
9
|
+
export {};
|
|
@@ -11,5 +11,5 @@ export interface ShortcutsOptions {
|
|
|
11
11
|
chainDelay?: number;
|
|
12
12
|
}
|
|
13
13
|
export declare function extractShortcuts(items: any[] | any[][]): Record<string, Handler>;
|
|
14
|
-
export declare function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options?: ShortcutsOptions):
|
|
14
|
+
export declare function defineShortcuts(config: MaybeRef<ShortcutsConfig>, options?: ShortcutsOptions): import("@vueuse/core").Fn;
|
|
15
15
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ref, computed, toValue } from "vue";
|
|
2
2
|
import { useEventListener, useActiveElement, useDebounceFn } from "@vueuse/core";
|
|
3
|
-
import { useKbd } from "../composables/useKbd.js";
|
|
4
3
|
const chainedShortcutRegex = /^[^-]+.*-.*[^-]+$/;
|
|
5
4
|
const combinedShortcutRegex = /^[^_]+.*_.*[^_]+$/;
|
|
6
5
|
export function extractShortcuts(items) {
|
|
@@ -9,7 +8,7 @@ export function extractShortcuts(items) {
|
|
|
9
8
|
items2.forEach((item) => {
|
|
10
9
|
if (item.kbds?.length && (item.select || item.click)) {
|
|
11
10
|
const shortcutKey = item.kbds.join("_");
|
|
12
|
-
shortcuts[shortcutKey] = item.
|
|
11
|
+
shortcuts[shortcutKey] = item.onSelect || item.onClick;
|
|
13
12
|
}
|
|
14
13
|
if (item.children) {
|
|
15
14
|
traverse(item.children.flat());
|
|
@@ -28,7 +27,6 @@ export function defineShortcuts(config, options = {}) {
|
|
|
28
27
|
chainedInputs.value.splice(0, chainedInputs.value.length);
|
|
29
28
|
};
|
|
30
29
|
const debouncedClearChainedInput = useDebounceFn(clearChainedInput, options.chainDelay ?? 800);
|
|
31
|
-
const { macOS } = useKbd();
|
|
32
30
|
const activeElement = useActiveElement();
|
|
33
31
|
const onKeyDown = (e) => {
|
|
34
32
|
if (!e.key) {
|
|
@@ -114,10 +112,6 @@ export function defineShortcuts(config, options = {}) {
|
|
|
114
112
|
};
|
|
115
113
|
}
|
|
116
114
|
shortcut.chained = chained;
|
|
117
|
-
if (!macOS.value && shortcut.metaKey && !shortcut.ctrlKey) {
|
|
118
|
-
shortcut.metaKey = false;
|
|
119
|
-
shortcut.ctrlKey = true;
|
|
120
|
-
}
|
|
121
115
|
if (typeof shortcutConfig === "function") {
|
|
122
116
|
shortcut.handler = shortcutConfig;
|
|
123
117
|
} else if (typeof shortcutConfig === "object") {
|
|
@@ -137,5 +131,5 @@ export function defineShortcuts(config, options = {}) {
|
|
|
137
131
|
return shortcut;
|
|
138
132
|
}).filter(Boolean);
|
|
139
133
|
});
|
|
140
|
-
useEventListener("keydown", onKeyDown);
|
|
134
|
+
return useEventListener("keydown", onKeyDown);
|
|
141
135
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type ComputedRef, type InjectionKey } from 'vue';
|
|
2
|
-
import type { AvatarGroupProps } from '../types
|
|
2
|
+
import type { AvatarGroupProps } from '../types';
|
|
3
3
|
export declare const avatarGroupInjectionKey: InjectionKey<ComputedRef<{
|
|
4
4
|
size: AvatarGroupProps['size'];
|
|
5
5
|
}>>;
|
|
6
6
|
export declare function useAvatarGroup(props: {
|
|
7
7
|
size: AvatarGroupProps['size'];
|
|
8
8
|
}): {
|
|
9
|
-
size: ComputedRef<
|
|
9
|
+
size: ComputedRef<any>;
|
|
10
10
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ButtonGroupProps } from '../components/ButtonGroup.vue
|
|
3
|
-
import type { GetObjectField } from '../types/utils
|
|
1
|
+
import type { InjectionKey, ComputedRef } from 'vue';
|
|
2
|
+
import type { ButtonGroupProps } from '../components/ButtonGroup.vue';
|
|
3
|
+
import type { GetObjectField } from '../types/utils';
|
|
4
4
|
export declare const buttonGroupInjectionKey: InjectionKey<ComputedRef<{
|
|
5
5
|
size: ButtonGroupProps['size'];
|
|
6
6
|
orientation: ButtonGroupProps['orientation'];
|
|
@@ -9,7 +9,7 @@ type Props<T> = {
|
|
|
9
9
|
size?: GetObjectField<T, 'size'>;
|
|
10
10
|
};
|
|
11
11
|
export declare function useButtonGroup<T>(props: Props<T>): {
|
|
12
|
-
orientation: ComputedRef<
|
|
13
|
-
size: ComputedRef<
|
|
12
|
+
orientation: ComputedRef<any>;
|
|
13
|
+
size: ComputedRef<any>;
|
|
14
14
|
};
|
|
15
15
|
export {};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { type MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import type { AvatarProps } from '../types';
|
|
2
3
|
export interface UseComponentIconsProps {
|
|
3
4
|
/** Display an icon based on the `leading` and `trailing` props. */
|
|
4
5
|
icon?: string;
|
|
6
|
+
/** Display an avatar on the left side. */
|
|
7
|
+
avatar?: AvatarProps;
|
|
5
8
|
/** When `true`, the icon will be displayed on the left side. */
|
|
6
9
|
leading?: boolean;
|
|
7
10
|
/** Display an icon on the left side. */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type InjectionKey, type Ref, type ComputedRef } from 'vue';
|
|
2
2
|
import { type UseEventBusReturn } from '@vueuse/core';
|
|
3
|
-
import type { FormFieldProps } from '../types
|
|
4
|
-
import type { FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form
|
|
5
|
-
import type { GetObjectField } from '../types/utils
|
|
3
|
+
import type { FormFieldProps } from '../types';
|
|
4
|
+
import type { FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form';
|
|
5
|
+
import type { GetObjectField } from '../types/utils';
|
|
6
6
|
type Props<T> = {
|
|
7
7
|
id?: string;
|
|
8
8
|
name?: string;
|
|
@@ -16,11 +16,18 @@ type Props<T> = {
|
|
|
16
16
|
export declare const formOptionsInjectionKey: InjectionKey<ComputedRef<FormInjectedOptions>>;
|
|
17
17
|
export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent, string>>;
|
|
18
18
|
export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>>;
|
|
19
|
-
export declare const
|
|
20
|
-
export declare
|
|
19
|
+
export declare const inputIdInjectionKey: InjectionKey<Ref<string | undefined>>;
|
|
20
|
+
export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, {
|
|
21
|
+
id?: string;
|
|
22
|
+
pattern?: RegExp;
|
|
23
|
+
}>>>;
|
|
24
|
+
export declare const formLoadingInjectionKey: InjectionKey<Readonly<Ref<boolean>>>;
|
|
25
|
+
export declare function useFormField<T>(props?: Props<T>, opts?: {
|
|
26
|
+
bind?: boolean;
|
|
27
|
+
}): {
|
|
21
28
|
id: ComputedRef<string | undefined>;
|
|
22
29
|
name: ComputedRef<string | undefined>;
|
|
23
|
-
size: ComputedRef<
|
|
30
|
+
size: ComputedRef<any>;
|
|
24
31
|
color: ComputedRef<"error" | GetObjectField<T, "color"> | undefined>;
|
|
25
32
|
highlight: ComputedRef<boolean | undefined>;
|
|
26
33
|
disabled: ComputedRef<boolean | undefined>;
|
|
@@ -3,18 +3,23 @@ import { useDebounceFn } from "@vueuse/core";
|
|
|
3
3
|
export const formOptionsInjectionKey = Symbol("nuxt-ui.form-options");
|
|
4
4
|
export const formBusInjectionKey = Symbol("nuxt-ui.form-events");
|
|
5
5
|
export const formFieldInjectionKey = Symbol("nuxt-ui.form-field");
|
|
6
|
+
export const inputIdInjectionKey = Symbol("nuxt-ui.input-id");
|
|
6
7
|
export const formInputsInjectionKey = Symbol("nuxt-ui.form-inputs");
|
|
7
|
-
export
|
|
8
|
+
export const formLoadingInjectionKey = Symbol("nuxt-ui.form-loading");
|
|
9
|
+
export function useFormField(props, opts) {
|
|
8
10
|
const formOptions = inject(formOptionsInjectionKey, void 0);
|
|
9
11
|
const formBus = inject(formBusInjectionKey, void 0);
|
|
10
12
|
const formField = inject(formFieldInjectionKey, void 0);
|
|
11
13
|
const formInputs = inject(formInputsInjectionKey, void 0);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
const inputId = inject(inputIdInjectionKey, void 0);
|
|
15
|
+
if (formField && inputId) {
|
|
16
|
+
if (opts?.bind === false || props?.legend) {
|
|
17
|
+
inputId.value = void 0;
|
|
18
|
+
} else if (props?.id) {
|
|
19
|
+
inputId.value = props?.id;
|
|
15
20
|
}
|
|
16
|
-
if (formInputs && formField.value.name) {
|
|
17
|
-
formInputs.value[formField.value.name] = formField.value.
|
|
21
|
+
if (formInputs && formField.value.name && inputId.value) {
|
|
22
|
+
formInputs.value[formField.value.name] = { id: inputId.value, pattern: formField.value.errorPattern };
|
|
18
23
|
}
|
|
19
24
|
}
|
|
20
25
|
const blurred = ref(false);
|
|
@@ -37,7 +42,7 @@ export function useFormField(props) {
|
|
|
37
42
|
formField?.value.validateOnInputDelay ?? formOptions?.value.validateOnInputDelay ?? 0
|
|
38
43
|
);
|
|
39
44
|
return {
|
|
40
|
-
id: computed(() => props?.id ??
|
|
45
|
+
id: computed(() => props?.id ?? inputId?.value),
|
|
41
46
|
name: computed(() => props?.name ?? formField?.value.name),
|
|
42
47
|
size: computed(() => props?.size ?? formField?.value.size),
|
|
43
48
|
color: computed(() => formField?.value.error ? "error" : props?.color),
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
type KbdKeysSpecificMap = {
|
|
2
|
+
meta: string;
|
|
3
|
+
alt: string;
|
|
4
|
+
ctrl: string;
|
|
5
|
+
};
|
|
1
6
|
export declare const kbdKeysMap: {
|
|
2
7
|
meta: string;
|
|
8
|
+
ctrl: string;
|
|
9
|
+
alt: string;
|
|
10
|
+
win: string;
|
|
3
11
|
command: string;
|
|
4
12
|
shift: string;
|
|
5
|
-
ctrl: string;
|
|
6
13
|
option: string;
|
|
7
|
-
alt: string;
|
|
8
14
|
enter: string;
|
|
9
15
|
delete: string;
|
|
10
16
|
backspace: string;
|
|
@@ -21,8 +27,9 @@ export declare const kbdKeysMap: {
|
|
|
21
27
|
end: string;
|
|
22
28
|
};
|
|
23
29
|
export type KbdKey = keyof typeof kbdKeysMap;
|
|
30
|
+
export type KbdKeySpecific = keyof KbdKeysSpecificMap;
|
|
24
31
|
export declare const useKbd: () => {
|
|
25
32
|
macOS: import("vue").ComputedRef<false | "" | RegExpMatchArray | null | undefined>;
|
|
26
|
-
metaSymbol: import("vue").Ref<string, string>;
|
|
27
33
|
getKbdKey: (value?: KbdKey | string) => string | undefined;
|
|
28
34
|
};
|
|
35
|
+
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { reactive, computed, onMounted } from "vue";
|
|
1
2
|
import { createSharedComposable } from "@vueuse/core";
|
|
2
|
-
import { ref, computed, onMounted } from "vue";
|
|
3
3
|
export const kbdKeysMap = {
|
|
4
4
|
meta: "",
|
|
5
|
+
ctrl: "",
|
|
6
|
+
alt: "",
|
|
7
|
+
win: "\u229E",
|
|
5
8
|
command: "\u2318",
|
|
6
9
|
shift: "\u21E7",
|
|
7
|
-
ctrl: "\u2303",
|
|
8
10
|
option: "\u2325",
|
|
9
|
-
alt: "\u2387",
|
|
10
11
|
enter: "\u21B5",
|
|
11
12
|
delete: "\u2326",
|
|
12
13
|
backspace: "\u232B",
|
|
@@ -24,22 +25,27 @@ export const kbdKeysMap = {
|
|
|
24
25
|
};
|
|
25
26
|
const _useKbd = () => {
|
|
26
27
|
const macOS = computed(() => import.meta.client && navigator && navigator.userAgent && navigator.userAgent.match(/Macintosh;/));
|
|
27
|
-
const
|
|
28
|
+
const kbdKeysSpecificMap = reactive({
|
|
29
|
+
meta: " ",
|
|
30
|
+
alt: " ",
|
|
31
|
+
ctrl: " "
|
|
32
|
+
});
|
|
28
33
|
onMounted(() => {
|
|
29
|
-
|
|
34
|
+
kbdKeysSpecificMap.meta = macOS.value ? kbdKeysMap.command : kbdKeysMap.win;
|
|
35
|
+
kbdKeysSpecificMap.alt = macOS.value ? kbdKeysMap.option : "alt";
|
|
36
|
+
kbdKeysSpecificMap.ctrl = macOS.value ? "\u2303" : "ctrl";
|
|
30
37
|
});
|
|
31
38
|
function getKbdKey(value) {
|
|
32
39
|
if (!value) {
|
|
33
40
|
return;
|
|
34
41
|
}
|
|
35
|
-
if (
|
|
36
|
-
return
|
|
42
|
+
if (["meta", "alt", "ctrl"].includes(value)) {
|
|
43
|
+
return kbdKeysSpecificMap[value];
|
|
37
44
|
}
|
|
38
45
|
return kbdKeysMap[value] || value.toUpperCase();
|
|
39
46
|
}
|
|
40
47
|
return {
|
|
41
48
|
macOS,
|
|
42
|
-
metaSymbol,
|
|
43
49
|
getKbdKey
|
|
44
50
|
};
|
|
45
51
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import type { Locale } from '../types/locale';
|
|
3
|
+
export declare const localeContextInjectionKey: InjectionKey<Ref<Locale | undefined>>;
|
|
4
|
+
export declare const useLocale: (localeOverrides?: Ref<Locale | undefined>) => import("../utils/locale").LocaleContext;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { computed, inject, ref } from "vue";
|
|
2
|
+
import { buildLocaleContext } from "../utils/locale.js";
|
|
3
|
+
import en from "../locale/en.js";
|
|
4
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
5
|
+
export const localeContextInjectionKey = Symbol("nuxt-ui.locale-context");
|
|
6
|
+
const _useLocale = (localeOverrides) => {
|
|
7
|
+
const locale = localeOverrides || inject(localeContextInjectionKey, ref());
|
|
8
|
+
return buildLocaleContext(computed(() => locale.value || en));
|
|
9
|
+
};
|
|
10
|
+
export const useLocale = createSharedComposable(_useLocale);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { ComponentProps } from 'vue-component-type-helpers';
|
|
3
|
+
import type { ModalProps } from '../types';
|
|
4
4
|
export interface ModalState {
|
|
5
5
|
component: Component | string;
|
|
6
6
|
props: ModalProps;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ShallowRef, Component, InjectionKey } from 'vue';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { ComponentProps } from 'vue-component-type-helpers';
|
|
3
|
+
import type { SlideoverProps } from '../types';
|
|
4
4
|
export interface SlideoverState {
|
|
5
5
|
component: Component | string;
|
|
6
6
|
props: SlideoverProps;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ToastProps } from '../types
|
|
1
|
+
import type { ToastProps } from '../types';
|
|
2
2
|
export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
|
|
3
3
|
id: string | number;
|
|
4
4
|
click?: (toast: Toast) => void;
|
|
@@ -6,7 +6,7 @@ export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
|
|
|
6
6
|
export declare function useToast(): {
|
|
7
7
|
toasts: import("vue").Ref<Toast[], Toast[]>;
|
|
8
8
|
add: (toast: Partial<Toast>) => Toast;
|
|
9
|
-
update: (id: string | number, toast: Partial<Toast>) => void;
|
|
9
|
+
update: (id: string | number, toast: Omit<Partial<Toast>, "id">) => void;
|
|
10
10
|
remove: (id: string | number) => void;
|
|
11
11
|
clear: () => void;
|
|
12
12
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./keyframes.css";@variant dark (&:where(.dark, .dark *));@layer base{body{@apply antialiased text-[var(--ui-text)] bg-[var(--ui-bg)] scheme-light dark:scheme-dark}:root{--ui-text-dimmed:var(--ui-color-neutral-400);--ui-text-muted:var(--ui-color-neutral-500);--ui-text-toned:var(--ui-color-neutral-600);--ui-text:var(--ui-color-neutral-700);--ui-text-highlighted:var(--ui-color-neutral-900);--ui-bg:var(--color-white);--ui-bg-muted:var(--ui-color-neutral-50);--ui-bg-elevated:var(--ui-color-neutral-100);--ui-bg-accented:var(--ui-color-neutral-200);--ui-bg-inverted:var(--ui-color-neutral-900);--ui-border:var(--ui-color-neutral-200);--ui-border-muted:var(--ui-color-neutral-200);--ui-border-accented:var(--ui-color-neutral-300);--ui-border-inverted:var(--ui-color-neutral-900);--ui-radius:var(--radius-sm);--ui-container:var(--container-7xl)}.dark{--ui-text-dimmed:var(--ui-color-neutral-500);--ui-text-muted:var(--ui-color-neutral-400);--ui-text-toned:var(--ui-color-neutral-300);--ui-text:var(--ui-color-neutral-200);--ui-text-highlighted:var(--color-white);--ui-bg:var(--ui-color-neutral-900);--ui-bg-muted:var(--ui-color-neutral-800);--ui-bg-elevated:var(--ui-color-neutral-800);--ui-bg-accented:var(--ui-color-neutral-700);--ui-bg-inverted:var(--color-white);--ui-border:var(--ui-color-neutral-800);--ui-border-muted:var(--ui-color-neutral-700);--ui-border-accented:var(--ui-color-neutral-700);--ui-border-inverted:var(--color-white)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@keyframes accordion-up{0%{height:var(--reka-accordion-content-height)}to{height:0}}@keyframes accordion-down{0%{height:0}to{height:var(--reka-accordion-content-height)}}@keyframes collapsible-up{0%{height:var(--reka-collapsible-content-height)}to{height:0}}@keyframes collapsible-down{0%{height:0}to{height:var(--reka-collapsible-content-height)}}@keyframes toast-collapsed-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--before) - var(--height))*var(--gap))) scale(var(--scale))}}@keyframes toast-closed{0%{transform:var(--transform)}to{transform:translateY(calc((var(--offset) - var(--height))*var(--translate-factor)))}}@keyframes toast-slide-left{0%{transform:translateX(0) translateY(var(--translate))}to{transform:translateX(-100%) translateY(var(--translate))}}@keyframes toast-slide-right{0%{transform:translateX(0) translateY(var(--translate))}to{transform:translateX(100%) translateY(var(--translate))}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}@keyframes scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes scale-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.95)}}@keyframes slide-in-from-top{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slide-out-to-top{0%{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes slide-in-from-right{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slide-out-to-right{0%{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slide-in-from-bottom{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slide-out-to-bottom{0%{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slide-in-from-left{0%{transform:translateX(-100%)}to{transform:translateX(0)}}@keyframes slide-out-to-left{0%{transform:translateX(0)}to{transform:translateX(-100%)}}@keyframes slide-in-from-top-and-fade{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-out-to-top-and-fade{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes slide-in-from-right-and-fade{0%{opacity:0;transform:translateX(4px)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out-to-right-and-fade{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(4px)}}@keyframes slide-in-from-bottom-and-fade{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes slide-out-to-bottom-and-fade{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}@keyframes slide-in-from-left-and-fade{0%{opacity:0;transform:translateX(-4px)}to{opacity:1;transform:translateX(0)}}@keyframes slide-out-to-left-and-fade{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-4px)}}@keyframes enter-from-right{0%{opacity:0;transform:translateX(200px)}to{opacity:1;transform:translateX(0)}}@keyframes enter-from-left{0%{opacity:0;transform:translateX(-200px)}to{opacity:1;transform:translateX(0)}}@keyframes exit-to-right{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(200px)}}@keyframes exit-to-left{0%{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-200px)}}@keyframes carousel{0%,to{width:50%}0%{transform:translateX(-100%)}to{transform:translateX(200%)}}@keyframes carousel-rtl{0%,to{width:50%}0%{transform:translateX(100%)}to{transform:translateX(-200%)}}@keyframes carousel-vertical{0%,to{height:50%}0%{transform:translateY(-100%)}to{transform:translateY(200%)}}@keyframes carousel-inverse{0%,to{width:50%}0%{transform:translateX(200%)}to{transform:translateX(-100%)}}@keyframes carousel-inverse-rtl{0%,to{width:50%}0%{transform:translateX(-200%)}to{transform:translateX(100%)}}@keyframes carousel-inverse-vertical{0%,to{height:50%}0%{transform:translateY(200%)}to{transform:translateY(-100%)}}@keyframes swing{0%,to{width:50%}0%,to{transform:translateX(-25%)}50%{transform:translateX(125%)}}@keyframes swing-vertical{0%,to{height:50%}0%,to{transform:translateY(-25%)}50%{transform:translateY(125%)}}@keyframes elastic{0%,to{margin-left:25%;width:50%}50%{margin-left:5%;width:90%}}@keyframes elastic-vertical{0%,to{height:50%;margin-top:25%}50%{height:90%;margin-top:5%}}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineLocale } from "../composables/defineLocale.js";
|
|
2
|
+
export default defineLocale({
|
|
3
|
+
name: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629",
|
|
4
|
+
code: "ar",
|
|
5
|
+
dir: "rtl",
|
|
6
|
+
messages: {
|
|
7
|
+
inputMenu: {
|
|
8
|
+
noMatch: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C \u0645\u0637\u0627\u0628\u0642\u0629",
|
|
9
|
+
noData: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A",
|
|
10
|
+
create: '\u0625\u0646\u0634\u0627\u0621 "{label}"'
|
|
11
|
+
},
|
|
12
|
+
calendar: {
|
|
13
|
+
prevYear: "\u0627\u0644\u0633\u0646\u0629 \u0627\u0644\u0633\u0627\u0628\u0642\u0629",
|
|
14
|
+
nextYear: "\u0627\u0644\u0633\u0646\u0629 \u0627\u0644\u0645\u0642\u0628\u0644\u0629",
|
|
15
|
+
prevMonth: "\u0627\u0644\u0634\u0647\u0631 \u0627\u0644\u0633\u0627\u0628\u0642",
|
|
16
|
+
nextMonth: "\u0627\u0644\u0634\u0647\u0631 \u0627\u0644\u0645\u0642\u0628\u0644"
|
|
17
|
+
},
|
|
18
|
+
inputNumber: {
|
|
19
|
+
increment: "\u0632\u064A\u0627\u062F\u0629",
|
|
20
|
+
decrement: "\u062A\u0642\u0644\u064A\u0644"
|
|
21
|
+
},
|
|
22
|
+
commandPalette: {
|
|
23
|
+
noMatch: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C \u0645\u0637\u0627\u0628\u0642\u0629",
|
|
24
|
+
noData: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A",
|
|
25
|
+
close: "\u0625\u063A\u0644\u0627\u0642"
|
|
26
|
+
},
|
|
27
|
+
selectMenu: {
|
|
28
|
+
noMatch: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0646\u062A\u0627\u0626\u062C \u0645\u0637\u0627\u0628\u0642\u0629",
|
|
29
|
+
noData: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A",
|
|
30
|
+
create: '\u0625\u0646\u0634\u0627\u0621 "{label}"'
|
|
31
|
+
},
|
|
32
|
+
toast: {
|
|
33
|
+
close: "\u0625\u063A\u0644\u0627\u0642"
|
|
34
|
+
},
|
|
35
|
+
carousel: {
|
|
36
|
+
prev: "\u0627\u0644\u0633\u0627\u0628\u0642",
|
|
37
|
+
next: "\u0627\u0644\u062A\u0627\u0644\u064A",
|
|
38
|
+
goto: "\u0627\u0644\u0630\u0647\u0627\u0628 \u0625\u0644\u064A \u0634\u0631\u064A\u062D\u0629 {slide}"
|
|
39
|
+
},
|
|
40
|
+
modal: {
|
|
41
|
+
close: "\u0625\u063A\u0644\u0627\u0642"
|
|
42
|
+
},
|
|
43
|
+
slideover: {
|
|
44
|
+
close: "\u0625\u063A\u0644\u0627\u0642"
|
|
45
|
+
},
|
|
46
|
+
alert: {
|
|
47
|
+
close: "\u0625\u063A\u0644\u0627\u0642"
|
|
48
|
+
},
|
|
49
|
+
table: {
|
|
50
|
+
noData: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0628\u064A\u0627\u0646\u0627\u062A"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|