@byyuurin/ui 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -5
- package/dist/module.json +3 -3
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/runtime/app/injections.d.ts +9323 -3
- package/dist/runtime/app/injections.js +35 -0
- package/dist/runtime/components/Accordion.vue +36 -69
- package/dist/runtime/components/Accordion.vue.d.ts +52 -0
- package/dist/runtime/components/Alert.vue +37 -75
- package/dist/runtime/components/Alert.vue.d.ts +59 -0
- package/dist/runtime/components/App.vue +25 -40
- package/dist/runtime/components/App.vue.d.ts +24 -0
- package/dist/runtime/components/Avatar.vue +31 -51
- package/dist/runtime/components/Avatar.vue.d.ts +25 -0
- package/dist/runtime/components/AvatarGroup.vue +38 -69
- package/dist/runtime/components/AvatarGroup.vue.d.ts +27 -0
- package/dist/runtime/components/Badge.vue +25 -51
- package/dist/runtime/components/Badge.vue.d.ts +44 -0
- package/dist/runtime/components/Breadcrumb.vue +35 -77
- package/dist/runtime/components/Breadcrumb.vue.d.ts +52 -0
- package/dist/runtime/components/Button.vue +62 -51
- package/dist/runtime/components/Button.vue.d.ts +29 -0
- package/dist/runtime/components/ButtonGroup.vue +17 -37
- package/dist/runtime/components/ButtonGroup.vue.d.ts +26 -0
- package/dist/runtime/components/Calendar.vue +75 -101
- package/dist/runtime/components/Calendar.vue.d.ts +75 -0
- package/dist/runtime/components/Card.vue +25 -42
- package/dist/runtime/components/Card.vue.d.ts +30 -0
- package/dist/runtime/components/Carousel.vue +118 -223
- package/dist/runtime/components/Carousel.vue.d.ts +104 -0
- package/dist/runtime/components/Checkbox.vue +49 -71
- package/dist/runtime/components/Checkbox.vue.d.ts +56 -0
- package/dist/runtime/components/Chip.vue +31 -48
- package/dist/runtime/components/Chip.vue.d.ts +30 -0
- package/dist/runtime/components/Collapsible.vue +22 -30
- package/dist/runtime/components/Collapsible.vue.d.ts +26 -0
- package/dist/runtime/components/Drawer.vue +52 -102
- package/dist/runtime/components/Drawer.vue.d.ts +80 -0
- package/dist/runtime/components/DropdownMenu.vue +65 -0
- package/dist/runtime/components/DropdownMenu.vue.d.ts +99 -0
- package/dist/runtime/components/DropdownMenuContent.vue +192 -0
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +39 -0
- package/dist/runtime/components/Form.vue +197 -0
- package/dist/runtime/components/Form.vue.d.ts +78 -0
- package/dist/runtime/components/FormItem.vue +90 -0
- package/dist/runtime/components/FormItem.vue.d.ts +60 -0
- package/dist/runtime/components/Input.vue +93 -115
- package/dist/runtime/components/Input.vue.d.ts +64 -0
- package/dist/runtime/components/InputNumber.vue +81 -116
- package/dist/runtime/components/InputNumber.vue.d.ts +245 -0
- package/dist/runtime/components/Kbd.vue +18 -39
- package/dist/runtime/components/Kbd.vue.d.ts +28 -0
- package/dist/runtime/components/Link.vue +170 -244
- package/dist/runtime/components/Link.vue.d.ts +95 -0
- package/dist/runtime/components/LinkBase.vue +36 -54
- package/dist/runtime/components/LinkBase.vue.d.ts +28 -0
- package/dist/runtime/components/Modal.vue +50 -85
- package/dist/runtime/components/Modal.vue.d.ts +66 -0
- package/dist/runtime/components/OverlayProvider.vue +10 -14
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
- package/dist/runtime/components/Pagination.vue +55 -121
- package/dist/runtime/components/Pagination.vue.d.ts +93 -0
- package/dist/runtime/components/PinInput.vue +57 -57
- package/dist/runtime/components/PinInput.vue.d.ts +35 -0
- package/dist/runtime/components/Popover.vue +39 -68
- package/dist/runtime/components/Popover.vue.d.ts +45 -0
- package/dist/runtime/components/Progress.vue +68 -120
- package/dist/runtime/components/Progress.vue.d.ts +54 -0
- package/dist/runtime/components/RadioGroup.vue +75 -129
- package/dist/runtime/components/RadioGroup.vue.d.ts +74 -0
- package/dist/runtime/components/ScrollArea.vue +31 -31
- package/dist/runtime/components/ScrollArea.vue.d.ts +17 -0
- package/dist/runtime/components/Select.vue +119 -199
- package/dist/runtime/components/Select.vue.d.ts +119 -0
- package/dist/runtime/components/Separator.vue +26 -44
- package/dist/runtime/components/Separator.vue.d.ts +27 -0
- package/dist/runtime/components/Skeleton.vue +12 -21
- package/dist/runtime/components/Skeleton.vue.d.ts +19 -0
- package/dist/runtime/components/Slider.vue +54 -71
- package/dist/runtime/components/Slider.vue.d.ts +36 -0
- package/dist/runtime/components/Switch.vue +54 -68
- package/dist/runtime/components/Switch.vue.d.ts +49 -0
- package/dist/runtime/components/Table.vue +113 -186
- package/dist/runtime/components/Table.vue.d.ts +148 -0
- package/dist/runtime/components/Tabs.vue +35 -79
- package/dist/runtime/components/Tabs.vue.d.ts +65 -0
- package/dist/runtime/components/Textarea.vue +82 -123
- package/dist/runtime/components/Textarea.vue.d.ts +60 -0
- package/dist/runtime/components/Toast.vue +51 -76
- package/dist/runtime/components/Toast.vue.d.ts +131 -0
- package/dist/runtime/components/ToastProvider.vue +65 -101
- package/dist/runtime/components/ToastProvider.vue.d.ts +38 -0
- package/dist/runtime/components/Tooltip.vue +36 -47
- package/dist/runtime/components/Tooltip.vue.d.ts +31 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
- package/dist/runtime/composables/useFormItem.d.ts +27 -0
- package/dist/runtime/composables/useFormItem.js +64 -0
- package/dist/runtime/composables/useKbd.d.ts +1 -1
- package/dist/runtime/composables/useLocale.d.ts +3 -3
- package/dist/runtime/composables/useTheme.d.ts +1 -1
- package/dist/runtime/composables/useTheme.js +2 -1
- package/dist/runtime/composables/useToast.d.ts +1 -1
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.js +3 -0
- package/dist/runtime/locale/en.d.ts +1 -1
- package/dist/runtime/locale/zh-tw.d.ts +1 -1
- package/dist/runtime/theme/accordion.d.ts +45 -51
- package/dist/runtime/theme/accordion.js +1 -1
- package/dist/runtime/theme/alert.d.ts +115 -121
- package/dist/runtime/theme/alert.js +1 -1
- package/dist/runtime/theme/app.d.ts +1 -0
- package/dist/runtime/theme/app.js +2 -1
- package/dist/runtime/theme/avatar-group.d.ts +42 -48
- package/dist/runtime/theme/avatar-group.js +1 -1
- package/dist/runtime/theme/avatar.d.ts +46 -52
- package/dist/runtime/theme/avatar.js +1 -1
- package/dist/runtime/theme/badge.d.ts +63 -93
- package/dist/runtime/theme/badge.js +1 -1
- package/dist/runtime/theme/breadcrumb.d.ts +52 -58
- package/dist/runtime/theme/breadcrumb.js +1 -1
- package/dist/runtime/theme/button-group.d.ts +36 -42
- package/dist/runtime/theme/button.d.ts +165 -117
- package/dist/runtime/theme/button.js +1 -1
- package/dist/runtime/theme/calendar.d.ts +52 -50
- package/dist/runtime/theme/calendar.js +20 -3
- package/dist/runtime/theme/card.d.ts +52 -58
- package/dist/runtime/theme/card.js +1 -1
- package/dist/runtime/theme/carousel.d.ts +98 -104
- package/dist/runtime/theme/carousel.js +1 -1
- package/dist/runtime/theme/checkbox.d.ts +77 -83
- package/dist/runtime/theme/checkbox.js +1 -1
- package/dist/runtime/theme/chip.d.ts +50 -89
- package/dist/runtime/theme/chip.js +1 -1
- package/dist/runtime/theme/collapsible.d.ts +29 -35
- package/dist/runtime/theme/collapsible.js +1 -1
- package/dist/runtime/theme/drawer.d.ts +131 -102
- package/dist/runtime/theme/drawer.js +1 -1
- package/dist/runtime/theme/dropdown-menu.d.ts +65 -0
- package/dist/runtime/theme/dropdown-menu.js +83 -0
- package/dist/runtime/theme/form-item.d.ts +70 -0
- package/dist/runtime/theme/form-item.js +34 -0
- package/dist/runtime/theme/form.d.ts +2 -0
- package/dist/runtime/theme/form.js +7 -0
- package/dist/runtime/theme/index.d.ts +3 -0
- package/dist/runtime/theme/index.js +3 -0
- package/dist/runtime/theme/input-number.d.ts +100 -126
- package/dist/runtime/theme/input-number.js +1 -1
- package/dist/runtime/theme/input.d.ts +153 -131
- package/dist/runtime/theme/input.js +3 -3
- package/dist/runtime/theme/kbd.d.ts +30 -36
- package/dist/runtime/theme/link.d.ts +37 -43
- package/dist/runtime/theme/modal.d.ts +35 -69
- package/dist/runtime/theme/modal.js +1 -1
- package/dist/runtime/theme/pagination.d.ts +71 -77
- package/dist/runtime/theme/pagination.js +1 -1
- package/dist/runtime/theme/pinInput.d.ts +82 -88
- package/dist/runtime/theme/pinInput.js +2 -2
- package/dist/runtime/theme/popover.d.ts +29 -35
- package/dist/runtime/theme/popover.js +1 -1
- package/dist/runtime/theme/progress.d.ts +167 -109
- package/dist/runtime/theme/progress.js +1 -1
- package/dist/runtime/theme/radio-group.d.ts +99 -105
- package/dist/runtime/theme/radio-group.js +1 -1
- package/dist/runtime/theme/scroll-area.d.ts +62 -68
- package/dist/runtime/theme/scroll-area.js +1 -1
- package/dist/runtime/theme/select.d.ts +168 -158
- package/dist/runtime/theme/select.js +3 -2
- package/dist/runtime/theme/separator.d.ts +64 -85
- package/dist/runtime/theme/separator.js +1 -1
- package/dist/runtime/theme/skeleton.d.ts +1 -7
- package/dist/runtime/theme/slider.d.ts +62 -68
- package/dist/runtime/theme/slider.js +1 -1
- package/dist/runtime/theme/switch.d.ts +111 -117
- package/dist/runtime/theme/switch.js +1 -1
- package/dist/runtime/theme/table.d.ts +75 -78
- package/dist/runtime/theme/table.js +3 -2
- package/dist/runtime/theme/tabs.d.ts +116 -139
- package/dist/runtime/theme/tabs.js +1 -1
- package/dist/runtime/theme/textarea.d.ts +78 -90
- package/dist/runtime/theme/textarea.js +2 -2
- package/dist/runtime/theme/toast-provider.d.ts +110 -131
- package/dist/runtime/theme/toast-provider.js +1 -1
- package/dist/runtime/theme/toast.d.ts +74 -80
- package/dist/runtime/theme/toast.js +1 -1
- package/dist/runtime/theme/tooltip.d.ts +35 -41
- package/dist/runtime/theme/tooltip.js +1 -1
- package/dist/runtime/types/components.d.ts +3 -0
- package/dist/runtime/types/form.d.ts +45 -0
- package/dist/runtime/types/form.js +0 -0
- package/dist/runtime/types/index.d.ts +5 -2
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/utils.d.ts +37 -16
- package/dist/runtime/utils/extend-theme.js +15 -4
- package/dist/runtime/utils/form.d.ts +5 -0
- package/dist/runtime/utils/form.js +24 -0
- package/dist/runtime/utils/index.d.ts +2 -0
- package/dist/runtime/utils/index.js +4 -0
- package/dist/runtime/utils/link.d.ts +4 -28
- package/dist/runtime/utils/link.js +10 -3
- package/dist/runtime/utils/styler.d.ts +2 -2
- package/dist/runtime/utils/styler.js +2 -2
- package/dist/shared/ui.D1BTWZFB.mjs +5 -0
- package/dist/shared/ui.D1BTWZFB.mjs.map +1 -0
- package/dist/types.d.mts +1 -1
- package/dist/unocss.mjs +7 -6
- package/dist/unocss.mjs.map +1 -1
- package/dist/unplugin.mjs +1 -1
- package/dist/unplugin.mjs.map +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +78 -74
- package/dist/module.cjs +0 -5
- package/dist/shared/ui.1a1f119c.mjs +0 -5
- package/dist/shared/ui.1a1f119c.mjs.map +0 -1
- package/dist/types.d.ts +0 -1
package/dist/unplugin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.mjs","sources":["../src/_unplugin/auto-import.ts","../src/_unplugin/components.ts","../src/_unplugin/nuxt-environment.ts","../src/unplugin.ts"],"sourcesContent":["import { defu } from 'defu'\nimport { join } from 'pathe'\nimport type { UnpluginContextMeta, UnpluginOptions } from 'unplugin'\nimport AutoImport from 'unplugin-auto-import'\nimport type { Options as AutoImportOptions } from 'unplugin-auto-import/types'\nimport type { UIOptions } from '../unplugin'\nimport { runtimeDir } from '../unplugin'\n\n/** This plugin adds all the UI composables as auto-imports. */\n// ref: https://github.com/nuxt/ui/blob/6c20f8a9ea03273a795c5f88c071830decd54c1e/src/plugins/auto-import.ts\nexport default function AutoImportPlugin(options: UIOptions, meta: UnpluginContextMeta): UnpluginOptions {\n const pluginOptions = defu(options.autoImport, <AutoImportOptions>{\n dts: options.dts ?? true,\n dirs: [join(runtimeDir, 'composables')],\n })\n\n return AutoImport.raw(pluginOptions, meta) as UnpluginOptions\n}\n","import { defu } from 'defu'\r\nimport { join } from 'pathe'\r\nimport { globSync } from 'tinyglobby'\r\nimport type { UnpluginContextMeta, UnpluginOptions } from 'unplugin'\r\nimport AutoImportComponents from 'unplugin-vue-components'\r\nimport type { Options as ComponentsOptions } from 'unplugin-vue-components/types'\r\nimport type { UIOptions } from '../unplugin'\r\nimport { runtimeDir } from '../unplugin'\r\n\r\n/** This plugin adds all the Nuxt UI components as auto-imports. */\r\n// ref: https://github.com/nuxt/ui/tree/6c20f8a9ea03273a795c5f88c071830decd54c1e/src/plugins/components.ts\r\nexport default function ComponentImportPlugin(options: UIOptions, meta: UnpluginContextMeta) {\r\n const { prefix = 'U' } = options\r\n const components = globSync('**/*.vue', { cwd: join(runtimeDir, 'components') })\r\n const componentNames = new Set(components.map((c) => `${prefix}${c.replace(/\\.vue$/, '')}`))\r\n\r\n const pluginOptions = defu(options.components, <ComponentsOptions>{\r\n dts: options.dts ?? true,\r\n resolvers: [\r\n (componentName) => {\r\n if (componentNames.has(componentName))\r\n return { name: 'default', from: join(runtimeDir, 'components', `${componentName.slice(prefix.length)}.vue`) }\r\n },\r\n ],\r\n })\r\n\r\n return AutoImportComponents.raw(pluginOptions, meta) as UnpluginOptions\r\n}\r\n","import MagicString from 'magic-string'\nimport { resolvePathSync } from 'mlly'\nimport { normalize } from 'pathe'\nimport type { UnpluginOptions } from 'unplugin'\nimport { runtimeDir } from '../unplugin'\n\n/**\n * This plugin normalises Nuxt environment (#imports) and `import.meta.client` within the UI components.\n */\n// ref: https://github.com/nuxt/ui/blob/0f99a4cdbcbca3090ef0a58f475be46de4eeb9ff/src/plugins/nuxt-environment.ts\nexport default function NuxtEnvironmentPlugin(): UnpluginOptions {\n const stubPath = resolvePathSync('../runtime/vue/stubs', { extensions: ['.ts', '.mjs', '.js'], url: import.meta.url })\n const name = 'byyuurin:ui'\n const resolveId = '#imports'\n\n return {\n name,\n enforce: 'pre',\n resolveId(id) {\n // this is implemented here rather than in a vite `config` hook for cross-builder support\n if (id === resolveId)\n return stubPath\n },\n transformInclude(id) {\n return normalize(id).includes(runtimeDir)\n },\n transform(code) {\n if (code.includes('import.meta.client')) {\n const s = new MagicString(code)\n s.replaceAll('import.meta.client', 'true')\n\n if (s.hasChanged()) {\n return {\n code: s.toString(),\n map: s.generateMap({ hires: true }),\n }\n }\n }\n },\n }\n}\n","import { fileURLToPath } from 'node:url'\r\nimport { normalize } from 'pathe'\r\nimport type { UnpluginOptions } from 'unplugin'\r\nimport { createUnplugin } from 'unplugin'\r\nimport type { Options as AutoImportOptions } from 'unplugin-auto-import/types'\r\nimport type { Options as ComponentsOptions } from 'unplugin-vue-components/types'\r\nimport AutoImportPlugin from './_unplugin/auto-import'\r\nimport ComponentImportPlugin from './_unplugin/components'\r\nimport NuxtEnvironmentPlugin from './_unplugin/nuxt-environment'\r\nimport { packageName } from './shared'\r\n\r\nexport const runtimeDir = normalize(fileURLToPath(new URL('runtime', import.meta.url)))\r\n\r\nexport interface UIOptions {\r\n /**\r\n * prefix for components used in templates\r\n *\r\n * @default \"U\"\r\n */\r\n prefix?: string\r\n /** Whether to generate declaration files for auto-imported components. */\r\n dts?: boolean\r\n /**\r\n * Override options for `unplugin-auto-import`\r\n */\r\n autoImport?: Partial<AutoImportOptions>\r\n /**\r\n * Override options for `unplugin-vue-components`\r\n */\r\n components?: Partial<ComponentsOptions>\r\n}\r\n\r\nexport const unplugin = createUnplugin<UIOptions | undefined>((options: UIOptions = {}, meta) => {\r\n return [\r\n NuxtEnvironmentPlugin(),\r\n ComponentImportPlugin(options, meta),\r\n AutoImportPlugin(options, meta),\r\n <UnpluginOptions>{\r\n name: 'byyuurin:ui:plugins-duplication-detection',\r\n vite: {\r\n config() {\r\n return {\r\n optimizeDeps: {\r\n include: [`${packageName}/unocss`],\r\n },\r\n }\r\n },\r\n configResolved(config) {\r\n const checkPluginNames = [\r\n 'unplugin-auto-import',\r\n 'unplugin-vue-components',\r\n ]\r\n const plugins = config.plugins || []\r\n\r\n const makeMessage = (pluginName: string) => `[${packageName}] Multiple instances of \\`${pluginName}\\` detected. ${packageName} includes \\`${pluginName}\\` already, and you can configure it using \\`${pluginName}\\` option in ${packageName} module options.`\r\n\r\n for (const pluginName of checkPluginNames) {\r\n if (plugins.filter((i) => i.name === pluginName).length > 1)\r\n throw new Error(makeMessage(pluginName))\r\n }\r\n },\r\n },\r\n },\r\n ]\r\n})\r\n"],"names":["packageName"],"mappings":";;;;;;;;;;;AAUwB,SAAA,gBAAA,CAAiB,SAAoB,IAA4C,EAAA;AACvG,EAAM,MAAA,aAAA,GAAgB,IAAK,CAAA,OAAA,CAAQ,UAA+B,EAAA;AAAA,IAChE,GAAA,EAAK,QAAQ,GAAO,IAAA,IAAA;AAAA,IACpB,IAAM,EAAA,CAAC,IAAK,CAAA,UAAA,EAAY,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"unplugin.mjs","sources":["../src/_unplugin/auto-import.ts","../src/_unplugin/components.ts","../src/_unplugin/nuxt-environment.ts","../src/unplugin.ts"],"sourcesContent":["import { defu } from 'defu'\nimport { join } from 'pathe'\nimport type { UnpluginContextMeta, UnpluginOptions } from 'unplugin'\nimport AutoImport from 'unplugin-auto-import'\nimport type { Options as AutoImportOptions } from 'unplugin-auto-import/types'\nimport type { UIOptions } from '../unplugin'\nimport { runtimeDir } from '../unplugin'\n\n/** This plugin adds all the UI composables as auto-imports. */\n// ref: https://github.com/nuxt/ui/blob/6c20f8a9ea03273a795c5f88c071830decd54c1e/src/plugins/auto-import.ts\nexport default function AutoImportPlugin(options: UIOptions, meta: UnpluginContextMeta): UnpluginOptions {\n const pluginOptions = defu(options.autoImport, <AutoImportOptions>{\n dts: options.dts ?? true,\n dirs: [join(runtimeDir, 'composables')],\n })\n\n return AutoImport.raw(pluginOptions, meta) as UnpluginOptions\n}\n","import { defu } from 'defu'\r\nimport { join } from 'pathe'\r\nimport { globSync } from 'tinyglobby'\r\nimport type { UnpluginContextMeta, UnpluginOptions } from 'unplugin'\r\nimport AutoImportComponents from 'unplugin-vue-components'\r\nimport type { Options as ComponentsOptions } from 'unplugin-vue-components/types'\r\nimport type { UIOptions } from '../unplugin'\r\nimport { runtimeDir } from '../unplugin'\r\n\r\n/** This plugin adds all the Nuxt UI components as auto-imports. */\r\n// ref: https://github.com/nuxt/ui/tree/6c20f8a9ea03273a795c5f88c071830decd54c1e/src/plugins/components.ts\r\nexport default function ComponentImportPlugin(options: UIOptions, meta: UnpluginContextMeta) {\r\n const { prefix = 'U' } = options\r\n const components = globSync('**/*.vue', { cwd: join(runtimeDir, 'components') })\r\n const componentNames = new Set(components.map((c) => `${prefix}${c.replace(/\\.vue$/, '')}`))\r\n\r\n const pluginOptions = defu(options.components, <ComponentsOptions>{\r\n dts: options.dts ?? true,\r\n resolvers: [\r\n (componentName) => {\r\n if (componentNames.has(componentName))\r\n return { name: 'default', from: join(runtimeDir, 'components', `${componentName.slice(prefix.length)}.vue`) }\r\n },\r\n ],\r\n })\r\n\r\n return AutoImportComponents.raw(pluginOptions, meta) as UnpluginOptions\r\n}\r\n","import MagicString from 'magic-string'\nimport { resolvePathSync } from 'mlly'\nimport { normalize } from 'pathe'\nimport type { UnpluginOptions } from 'unplugin'\nimport { runtimeDir } from '../unplugin'\n\n/**\n * This plugin normalises Nuxt environment (#imports) and `import.meta.client` within the UI components.\n */\n// ref: https://github.com/nuxt/ui/blob/0f99a4cdbcbca3090ef0a58f475be46de4eeb9ff/src/plugins/nuxt-environment.ts\nexport default function NuxtEnvironmentPlugin(): UnpluginOptions {\n const stubPath = resolvePathSync('../runtime/vue/stubs', { extensions: ['.ts', '.mjs', '.js'], url: import.meta.url })\n const name = 'byyuurin:ui'\n const resolveId = '#imports'\n\n return {\n name,\n enforce: 'pre',\n resolveId(id) {\n // this is implemented here rather than in a vite `config` hook for cross-builder support\n if (id === resolveId)\n return stubPath\n },\n transformInclude(id) {\n return normalize(id).includes(runtimeDir)\n },\n transform(code) {\n if (code.includes('import.meta.client')) {\n const s = new MagicString(code)\n s.replaceAll('import.meta.client', 'true')\n\n if (s.hasChanged()) {\n return {\n code: s.toString(),\n map: s.generateMap({ hires: true }),\n }\n }\n }\n },\n }\n}\n","import { fileURLToPath } from 'node:url'\r\nimport { normalize } from 'pathe'\r\nimport type { UnpluginOptions } from 'unplugin'\r\nimport { createUnplugin } from 'unplugin'\r\nimport type { Options as AutoImportOptions } from 'unplugin-auto-import/types'\r\nimport type { Options as ComponentsOptions } from 'unplugin-vue-components/types'\r\nimport AutoImportPlugin from './_unplugin/auto-import'\r\nimport ComponentImportPlugin from './_unplugin/components'\r\nimport NuxtEnvironmentPlugin from './_unplugin/nuxt-environment'\r\nimport { packageName } from './shared'\r\n\r\nexport const runtimeDir = normalize(fileURLToPath(new URL('runtime', import.meta.url)))\r\n\r\nexport interface UIOptions {\r\n /**\r\n * prefix for components used in templates\r\n *\r\n * @default \"U\"\r\n */\r\n prefix?: string\r\n /** Whether to generate declaration files for auto-imported components. */\r\n dts?: boolean\r\n /**\r\n * Override options for `unplugin-auto-import`\r\n */\r\n autoImport?: Partial<AutoImportOptions>\r\n /**\r\n * Override options for `unplugin-vue-components`\r\n */\r\n components?: Partial<ComponentsOptions>\r\n}\r\n\r\nexport const unplugin = createUnplugin<UIOptions | undefined>((options: UIOptions = {}, meta) => {\r\n return [\r\n NuxtEnvironmentPlugin(),\r\n ComponentImportPlugin(options, meta),\r\n AutoImportPlugin(options, meta),\r\n <UnpluginOptions>{\r\n name: 'byyuurin:ui:plugins-duplication-detection',\r\n vite: {\r\n config() {\r\n return {\r\n optimizeDeps: {\r\n include: [`${packageName}/unocss`],\r\n },\r\n }\r\n },\r\n configResolved(config) {\r\n const checkPluginNames = [\r\n 'unplugin-auto-import',\r\n 'unplugin-vue-components',\r\n ]\r\n const plugins = config.plugins || []\r\n\r\n const makeMessage = (pluginName: string) => `[${packageName}] Multiple instances of \\`${pluginName}\\` detected. ${packageName} includes \\`${pluginName}\\` already, and you can configure it using \\`${pluginName}\\` option in ${packageName} module options.`\r\n\r\n for (const pluginName of checkPluginNames) {\r\n if (plugins.filter((i) => i.name === pluginName).length > 1)\r\n throw new Error(makeMessage(pluginName))\r\n }\r\n },\r\n },\r\n },\r\n ]\r\n})\r\n"],"names":["packageName"],"mappings":";;;;;;;;;;;AAUwB,SAAA,gBAAA,CAAiB,SAAoB,IAA4C,EAAA;AACvG,EAAM,MAAA,aAAA,GAAgB,IAAK,CAAA,OAAA,CAAQ,UAA+B,EAAA;AAAA,IAChE,GAAA,EAAK,QAAQ,GAAO,IAAA,IAAA;AAAA,IACpB,IAAM,EAAA,CAAC,IAAK,CAAA,UAAA,EAAY,aAAa,CAAC;AAAA,GACvC,CAAA;AAED,EAAO,OAAA,UAAA,CAAW,GAAI,CAAA,aAAA,EAAe,IAAI,CAAA;AAC3C;;ACNwB,SAAA,qBAAA,CAAsB,SAAoB,IAA2B,EAAA;AAC3F,EAAM,MAAA,EAAE,MAAS,GAAA,GAAA,EAAQ,GAAA,OAAA;AACzB,EAAM,MAAA,UAAA,GAAa,SAAS,UAAY,EAAA,EAAE,KAAK,IAAK,CAAA,UAAA,EAAY,YAAY,CAAA,EAAG,CAAA;AAC/E,EAAA,MAAM,iBAAiB,IAAI,GAAA,CAAI,UAAW,CAAA,GAAA,CAAI,CAAC,CAAM,KAAA,CAAA,EAAG,MAAM,CAAA,EAAG,EAAE,OAAQ,CAAA,QAAA,EAAU,EAAE,CAAC,EAAE,CAAC,CAAA;AAE3F,EAAM,MAAA,aAAA,GAAgB,IAAK,CAAA,OAAA,CAAQ,UAA+B,EAAA;AAAA,IAChE,GAAA,EAAK,QAAQ,GAAO,IAAA,IAAA;AAAA,IACpB,SAAW,EAAA;AAAA,MACT,CAAC,aAAkB,KAAA;AACjB,QAAI,IAAA,cAAA,CAAe,IAAI,aAAa,CAAA;AAClC,UAAA,OAAO,EAAE,IAAA,EAAM,SAAW,EAAA,IAAA,EAAM,KAAK,UAAY,EAAA,Y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
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.11",
|
|
5
|
+
"packageManager": "pnpm@10.12.4",
|
|
5
6
|
"description": "",
|
|
6
7
|
"author": "Yuurin <byyuurin@gmail.com>",
|
|
7
8
|
"license": "MIT",
|
|
@@ -19,19 +20,19 @@
|
|
|
19
20
|
"default": "./dist/runtime/index.js"
|
|
20
21
|
},
|
|
21
22
|
"./unplugin": {
|
|
22
|
-
"types": "./dist/unplugin.d.
|
|
23
|
+
"types": "./dist/unplugin.d.mts",
|
|
23
24
|
"default": "./dist/unplugin.mjs"
|
|
24
25
|
},
|
|
25
26
|
"./vite": {
|
|
26
|
-
"types": "./dist/vite.d.
|
|
27
|
+
"types": "./dist/vite.d.mts",
|
|
27
28
|
"default": "./dist/vite.mjs"
|
|
28
29
|
},
|
|
29
30
|
"./nuxt": {
|
|
30
|
-
"types": "./dist/module.d.
|
|
31
|
+
"types": "./dist/module.d.mts",
|
|
31
32
|
"default": "./dist/module.mjs"
|
|
32
33
|
},
|
|
33
34
|
"./unocss": {
|
|
34
|
-
"types": "./dist/unocss.d.
|
|
35
|
+
"types": "./dist/unocss.d.mts",
|
|
35
36
|
"default": "./dist/unocss.mjs"
|
|
36
37
|
},
|
|
37
38
|
"./runtime/index": {
|
|
@@ -55,93 +56,96 @@
|
|
|
55
56
|
"*.d.ts",
|
|
56
57
|
"dist"
|
|
57
58
|
],
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
59
|
+
"scripts": {
|
|
60
|
+
"dev": "nuxi dev playground/nuxt",
|
|
61
|
+
"dev:build": "nuxi build playground/nuxt",
|
|
62
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground/nuxt",
|
|
63
|
+
"dev:vue": "pnpm --filter \"./playground/vue\" run dev",
|
|
64
|
+
"lint": "eslint .",
|
|
65
|
+
"release": "bumpp && pnpm publish",
|
|
66
|
+
"start": "esno src/index.ts",
|
|
67
|
+
"test": "vitest",
|
|
68
|
+
"test:types": "vue-tsc --noEmit && nuxi typecheck playground/nuxt",
|
|
69
|
+
"prepare": "simple-git-hooks",
|
|
70
|
+
"prepack": "nuxt-module-build build"
|
|
62
71
|
},
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"optional": true
|
|
66
|
-
}
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"unocss": "^66.3.2"
|
|
67
74
|
},
|
|
68
75
|
"dependencies": {
|
|
69
|
-
"@byyuurin/ui-kit": "^0.
|
|
70
|
-
"@internationalized/date": "^3.
|
|
71
|
-
"@nuxt/kit": "^3.
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@unocss/
|
|
75
|
-
"@unocss/preset-
|
|
76
|
-
"@
|
|
77
|
-
"@
|
|
76
|
+
"@byyuurin/ui-kit": "^0.6.1",
|
|
77
|
+
"@internationalized/date": "^3.8.2",
|
|
78
|
+
"@nuxt/kit": "^3.17.6",
|
|
79
|
+
"@standard-schema/spec": "^1.0.0",
|
|
80
|
+
"@tanstack/vue-table": "^8.21.3",
|
|
81
|
+
"@unocss/core": "^66.3.2",
|
|
82
|
+
"@unocss/preset-mini": "^66.3.2",
|
|
83
|
+
"@unocss/preset-wind3": "^66.3.2",
|
|
84
|
+
"@vue/shared": "^3.5.17",
|
|
85
|
+
"@vueuse/core": "^13.5.0",
|
|
78
86
|
"defu": "^6.1.4",
|
|
79
|
-
"embla-carousel": "^8.
|
|
80
|
-
"embla-carousel-auto-height": "^8.
|
|
81
|
-
"embla-carousel-auto-scroll": "^8.
|
|
82
|
-
"embla-carousel-autoplay": "^8.
|
|
83
|
-
"embla-carousel-class-names": "^8.
|
|
84
|
-
"embla-carousel-fade": "^8.
|
|
85
|
-
"embla-carousel-vue": "^8.
|
|
86
|
-
"embla-carousel-wheel-gestures": "^8.0.
|
|
87
|
+
"embla-carousel": "^8.6.0",
|
|
88
|
+
"embla-carousel-auto-height": "^8.6.0",
|
|
89
|
+
"embla-carousel-auto-scroll": "^8.6.0",
|
|
90
|
+
"embla-carousel-autoplay": "^8.6.0",
|
|
91
|
+
"embla-carousel-class-names": "^8.6.0",
|
|
92
|
+
"embla-carousel-fade": "^8.6.0",
|
|
93
|
+
"embla-carousel-vue": "^8.6.0",
|
|
94
|
+
"embla-carousel-wheel-gestures": "^8.0.2",
|
|
87
95
|
"magic-string": "^0.30.17",
|
|
88
96
|
"mlly": "^1.7.4",
|
|
89
|
-
"ohash": "^
|
|
97
|
+
"ohash": "^2.0.11",
|
|
90
98
|
"pathe": "^2.0.3",
|
|
91
|
-
"reka-ui": "^2.
|
|
99
|
+
"reka-ui": "^2.3.2",
|
|
92
100
|
"scule": "^1.3.0",
|
|
93
|
-
"tinyglobby": "^0.2.
|
|
94
|
-
"ufo": "^1.
|
|
95
|
-
"unplugin": "^2.
|
|
96
|
-
"unplugin-auto-import": "^19.
|
|
97
|
-
"unplugin-vue-components": "^28.
|
|
98
|
-
"vue-component-type-helpers": "^2.2.
|
|
99
|
-
"vue-router": "^4.5.
|
|
101
|
+
"tinyglobby": "^0.2.14",
|
|
102
|
+
"ufo": "^1.6.1",
|
|
103
|
+
"unplugin": "^2.3.5",
|
|
104
|
+
"unplugin-auto-import": "^19.3.0",
|
|
105
|
+
"unplugin-vue-components": "^28.8.0",
|
|
106
|
+
"vue-component-type-helpers": "^2.2.12",
|
|
107
|
+
"vue-router": "^4.5.1"
|
|
100
108
|
},
|
|
101
109
|
"devDependencies": {
|
|
102
|
-
"@antfu/ni": "^
|
|
103
|
-
"@byyuurin/eslint-config": "^1.8.
|
|
104
|
-
"@nuxt/eslint-config": "^1.2
|
|
105
|
-
"@nuxt/module-builder": "^0.
|
|
106
|
-
"@nuxt/schema": "^3.
|
|
107
|
-
"@nuxt/test-utils": "^3.
|
|
108
|
-
"@types/node": "^22.
|
|
109
|
-
"@unocss/reset": "^
|
|
110
|
-
"@vitejs/plugin-vue": "^
|
|
111
|
-
"bumpp": "^10.
|
|
112
|
-
"eslint": "^9.
|
|
110
|
+
"@antfu/ni": "^25.0.0",
|
|
111
|
+
"@byyuurin/eslint-config": "^1.8.2",
|
|
112
|
+
"@nuxt/eslint-config": "^1.5.2",
|
|
113
|
+
"@nuxt/module-builder": "^1.0.1",
|
|
114
|
+
"@nuxt/schema": "^3.17.6",
|
|
115
|
+
"@nuxt/test-utils": "^3.19.2",
|
|
116
|
+
"@types/node": "^22.16.0",
|
|
117
|
+
"@unocss/reset": "^66.3.2",
|
|
118
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
119
|
+
"bumpp": "^10.2.0",
|
|
120
|
+
"eslint": "^9.30.1",
|
|
113
121
|
"eslint-plugin-format": "1.0.1",
|
|
114
122
|
"esno": "^4.8.0",
|
|
115
|
-
"lint-staged": "^
|
|
116
|
-
"nuxt": "^3.
|
|
117
|
-
"simple-git-hooks": "^2.
|
|
118
|
-
"typescript": "
|
|
119
|
-
"unocss": "^
|
|
120
|
-
"vite": "^
|
|
121
|
-
"vite-plugin-inspect": "^11.
|
|
122
|
-
"vitest": "^3.
|
|
123
|
-
"vue": "^3.5.
|
|
124
|
-
"vue-tsc": "^2.2.
|
|
123
|
+
"lint-staged": "^16.1.2",
|
|
124
|
+
"nuxt": "^3.17.6",
|
|
125
|
+
"simple-git-hooks": "^2.13.0",
|
|
126
|
+
"typescript": "^5.8.3",
|
|
127
|
+
"unocss": "^66.3.2",
|
|
128
|
+
"vite": "^7.0.2",
|
|
129
|
+
"vite-plugin-inspect": "^11.3.0",
|
|
130
|
+
"vitest": "^3.2.4",
|
|
131
|
+
"vue": "^3.5.17",
|
|
132
|
+
"vue-tsc": "^2.2.12",
|
|
133
|
+
"zod": "^3.25.72"
|
|
134
|
+
},
|
|
135
|
+
"pnpm": {
|
|
136
|
+
"overrides": {
|
|
137
|
+
"is-core-module": "npm:@nolyfill/is-core-module@^1.0.39",
|
|
138
|
+
"isarray": "npm:@nolyfill/isarray@^1.0.44",
|
|
139
|
+
"safe-buffer": "npm:@nolyfill/safe-buffer@^1.0.44"
|
|
140
|
+
}
|
|
125
141
|
},
|
|
126
142
|
"resolutions": {
|
|
127
|
-
"@byyuurin/ui": "workspace:*"
|
|
128
|
-
"vue-tsc": "2.2.0"
|
|
143
|
+
"@byyuurin/ui": "workspace:*"
|
|
129
144
|
},
|
|
130
145
|
"simple-git-hooks": {
|
|
131
146
|
"pre-commit": "pnpm lint-staged"
|
|
132
147
|
},
|
|
133
148
|
"lint-staged": {
|
|
134
149
|
"*": "eslint --fix"
|
|
135
|
-
},
|
|
136
|
-
"scripts": {
|
|
137
|
-
"dev": "nuxi dev playground/nuxt",
|
|
138
|
-
"dev:build": "nuxi build playground/nuxt",
|
|
139
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground/nuxt",
|
|
140
|
-
"dev:vue": "pnpm --filter \"./playground/vue\" run dev",
|
|
141
|
-
"lint": "eslint .",
|
|
142
|
-
"release": "bumpp && pnpm publish",
|
|
143
|
-
"start": "esno src/index.ts",
|
|
144
|
-
"test": "vitest",
|
|
145
|
-
"test:types": "vue-tsc --noEmit && nuxi typecheck playground/nuxt"
|
|
146
150
|
}
|
|
147
|
-
}
|
|
151
|
+
}
|
package/dist/module.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.1a1f119c.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
package/dist/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type ModuleOptions, default } from './module'
|