ui-thing 0.1.51 → 0.1.52
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/CHANGELOG.md +16 -0
- package/dist/index.js +163 -49
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/comps.ts +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui-thing",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.52",
|
|
4
4
|
"description": "CLI used to add Nuxt 3 components to a project",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
"@types/figlet": "^1.7.0",
|
|
60
60
|
"@types/fs-extra": "^11.0.4",
|
|
61
61
|
"@types/lodash": "^4.17.15",
|
|
62
|
-
"@types/node": "^22.13.
|
|
62
|
+
"@types/node": "^22.13.1",
|
|
63
63
|
"@types/prompts": "^2.4.9",
|
|
64
|
-
"@vitest/coverage-v8": "^3.0.
|
|
64
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
65
65
|
"magicast": "^0.3.5",
|
|
66
66
|
"tsup": "^8.3.6",
|
|
67
67
|
"typescript": "^5.7.3",
|
|
68
|
-
"vitest": "^3.0.
|
|
68
|
+
"vitest": "^3.0.5"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
package/src/comps.ts
CHANGED
|
@@ -1459,6 +1459,21 @@ export default [
|
|
|
1459
1459
|
composables: [],
|
|
1460
1460
|
plugins: [],
|
|
1461
1461
|
},
|
|
1462
|
+
{
|
|
1463
|
+
name: "Loader",
|
|
1464
|
+
value: "loader",
|
|
1465
|
+
files: [
|
|
1466
|
+
{
|
|
1467
|
+
fileName: "Loader.vue",
|
|
1468
|
+
dirPath: "app/components/Ui",
|
|
1469
|
+
fileContent:
|
|
1470
|
+
'<template>\n <TransitionFade :duration="500" appear tag="template">\n <Teleport v-if="fullPage && open" to="#teleports">\n <div :class="loaderStyles().backdrop({ class: backdropClass, fullPage })">\n <Icon :class="loaderStyles().icon({ class: props.class })" :name="props.icon" />\n <slot :open>{{ text }}</slot>\n </div>\n </Teleport>\n <div\n v-if="!fullPage && open"\n :class="loaderStyles().backdrop({ class: props.backdropClass, fullPage })"\n >\n <Icon :class="loaderStyles().icon({ class: props.class })" :name="props.icon" />\n <slot :open>{{ text }}</slot>\n </div>\n </TransitionFade>\n</template>\n\n<script lang="ts">\n import { useMagicKeys } from "@vueuse/core";\n import { useBodyScrollLock } from "radix-vue";\n import type { PrimitiveProps } from "radix-vue";\n\n export type LoaderProps = PrimitiveProps & {\n /**\n * The icon to display in the loader.\n *\n * @default "svg-spinners:bars-rotate-fade"\n */\n icon?: string;\n /**\n * The class to apply to the loader Icon\n */\n class?: any;\n /**\n * The class to apply to the backdrop\n */\n backdropClass?: any;\n /**\n * Whether the loader should take up the full page.\n *\n * When this is `true`, the loader will be displayed in a fixed position that covers the entire page. You can press the `esc` key to close the loader.\n */\n fullPage?: boolean;\n /**\n * Whether to lock the scroll when the loader is open.\n *\n * @default true\n */\n lockScroll?: boolean;\n /**\n * The role of the component.\n *\n * @default "progressbar"\n */\n role?: string;\n /**\n * The text to display in the loader.\n *\n * This is displayed below the loader icon.\n */\n text?: string;\n /**\n * Whether to close the loader when the `esc` key is pressed.\n *\n * @default true\n */\n closeOnEscape?: boolean;\n };\n\n export const loaderStyles = tv({\n slots: {\n icon: "size-5",\n backdrop: "flex flex-col items-center justify-center gap-3",\n },\n variants: {\n fullPage: {\n true: {\n backdrop:\n "pointer-events-auto fixed inset-0 z-[999] size-full bg-background/80 backdrop-blur-md",\n },\n false: {\n backdrop: "relative",\n },\n },\n },\n });\n</script>\n\n<script lang="ts" setup>\n defineOptions({ inheritAttrs: false });\n const props = withDefaults(defineProps<LoaderProps>(), {\n icon: "svg-spinners:bars-rotate-fade",\n role: "progressbar",\n closeOnEscape: true,\n });\n\n const open = defineModel<boolean>({ default: true });\n const isLocked = useBodyScrollLock();\n\n const { escape } = useMagicKeys();\n\n watchEffect(() => {\n if (props.fullPage && open.value && escape?.value && props.closeOnEscape) {\n open.value = false;\n }\n if (props.lockScroll && !open.value) {\n isLocked.value = false;\n }\n if (props.lockScroll && open.value) {\n isLocked.value = true;\n }\n });\n</script>\n',
|
|
1471
|
+
},
|
|
1472
|
+
],
|
|
1473
|
+
utils: [],
|
|
1474
|
+
composables: [],
|
|
1475
|
+
plugins: [],
|
|
1476
|
+
},
|
|
1462
1477
|
{
|
|
1463
1478
|
name: "Menubar",
|
|
1464
1479
|
value: "menubar",
|