@aejkatappaja/phantom-ui 0.1.1 → 0.2.0

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 CHANGED
@@ -7,9 +7,9 @@
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- <a href="https://www.npmjs.com/package/phantom-ui"><img src="https://img.shields.io/npm/v/phantom-ui.svg?style=flat-square" alt="npm version" /></a>
11
- <a href="https://bundlephobia.com/package/phantom-ui"><img src="https://img.shields.io/bundlephobia/minzip/phantom-ui?style=flat-square" alt="bundle size" /></a>
12
- <a href="https://github.com/anthropics/phantom-ui/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/phantom-ui?style=flat-square" alt="license" /></a>
10
+ <a href="https://www.npmjs.com/package/@aejkatappaja/phantom-ui"><img src="https://img.shields.io/npm/v/@aejkatappaja/phantom-ui.svg?style=flat-square" alt="npm version" /></a>
11
+ <img src="https://img.shields.io/badge/minzipped-~8kb-blue?style=flat-square" alt="bundle size" />
12
+ <a href="https://github.com/Aejkatappaja/phantom-ui/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@aejkatappaja/phantom-ui?style=flat-square" alt="license" /></a>
13
13
  </p>
14
14
 
15
15
  ---
@@ -29,16 +29,16 @@ Because it is a standard Web Component (built with Lit), it works in React, Vue,
29
29
  ## Install
30
30
 
31
31
  ```bash
32
- bun add phantom-ui # bun
33
- npm install phantom-ui # npm
34
- pnpm add phantom-ui # pnpm
35
- yarn add phantom-ui # yarn
32
+ bun add @aejkatappaja/phantom-ui # bun
33
+ npm install @aejkatappaja/phantom-ui # npm
34
+ pnpm add @aejkatappaja/phantom-ui # pnpm
35
+ yarn add @aejkatappaja/phantom-ui # yarn
36
36
  ```
37
37
 
38
38
  Or drop in a script tag with no build step:
39
39
 
40
40
  ```html
41
- <script src="https://cdn.jsdelivr.net/npm/phantom-ui/dist/phantom-ui.cdn.js"></script>
41
+ <script src="https://cdn.jsdelivr.net/npm/@aejkatappaja/phantom-ui/dist/phantom-ui.cdn.js"></script>
42
42
  ```
43
43
 
44
44
  ## Quick start
@@ -60,7 +60,7 @@ Set `loading` to show the shimmer. Remove it to reveal the real content.
60
60
  ### React
61
61
 
62
62
  ```tsx
63
- import "phantom-ui";
63
+ import "@aejkatappaja/phantom-ui";
64
64
 
65
65
  function ProfileCard({ user, isLoading }: Props) {
66
66
  return (
@@ -79,7 +79,7 @@ function ProfileCard({ user, isLoading }: Props) {
79
79
 
80
80
  ```vue
81
81
  <script setup lang="ts">
82
- import "phantom-ui";
82
+ import "@aejkatappaja/phantom-ui";
83
83
 
84
84
  const props = defineProps<{ loading: boolean }>();
85
85
  </script>
@@ -99,7 +99,7 @@ const props = defineProps<{ loading: boolean }>();
99
99
 
100
100
  ```svelte
101
101
  <script lang="ts">
102
- import "phantom-ui";
102
+ import "@aejkatappaja/phantom-ui";
103
103
 
104
104
  export let loading = true;
105
105
  </script>
@@ -117,7 +117,7 @@ const props = defineProps<{ loading: boolean }>();
117
117
 
118
118
  ```typescript
119
119
  import { Component, signal, CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
120
- import "phantom-ui";
120
+ import "@aejkatappaja/phantom-ui";
121
121
 
122
122
  @Component({
123
123
  selector: "app-profile",
@@ -141,7 +141,7 @@ export class ProfileComponent {
141
141
 
142
142
  ```tsx
143
143
  import { createSignal } from "solid-js";
144
- import "phantom-ui";
144
+ import "@aejkatappaja/phantom-ui";
145
145
 
146
146
  function ProfileCard() {
147
147
  const [loading, setLoading] = createSignal(true);
@@ -168,7 +168,7 @@ The component needs browser APIs to measure the DOM. Import it client-side only:
168
168
  import { useEffect } from "react";
169
169
 
170
170
  export default function Page() {
171
- useEffect(() => { import("phantom-ui"); }, []);
171
+ useEffect(() => { import("@aejkatappaja/phantom-ui"); }, []);
172
172
  return <phantom-ui loading>...</phantom-ui>;
173
173
  }
174
174
  ```
@@ -176,7 +176,7 @@ export default function Page() {
176
176
  ```vue
177
177
  <!-- Nuxt -->
178
178
  <script setup>
179
- onMounted(() => import("phantom-ui"));
179
+ onMounted(() => import("@aejkatappaja/phantom-ui"));
180
180
  </script>
181
181
 
182
182
  <template>
@@ -190,7 +190,7 @@ onMounted(() => import("phantom-ui"));
190
190
  <!-- SvelteKit -->
191
191
  <script>
192
192
  import { onMount } from "svelte";
193
- onMount(() => import("phantom-ui"));
193
+ onMount(() => import("@aejkatappaja/phantom-ui"));
194
194
  </script>
195
195
  ```
196
196
 
@@ -205,10 +205,10 @@ Vue, Svelte, and Angular work out of the box without any type declaration.
205
205
  If the postinstall did not run (CI, monorepos, `--ignore-scripts`), you can generate it manually:
206
206
 
207
207
  ```bash
208
- npx phantom-ui init # npm
209
- bunx phantom-ui init # bun
210
- pnpx phantom-ui init # pnpm
211
- yarn dlx phantom-ui init # yarn
208
+ npx @aejkatappaja/phantom-ui init # npm
209
+ bunx @aejkatappaja/phantom-ui init # bun
210
+ pnpx @aejkatappaja/phantom-ui init # pnpm
211
+ yarn dlx @aejkatappaja/phantom-ui init # yarn
212
212
  ```
213
213
 
214
214
  <details>
@@ -217,7 +217,7 @@ yarn dlx phantom-ui init # yarn
217
217
  **React**
218
218
 
219
219
  ```typescript
220
- import type { PhantomUiAttributes } from "phantom-ui";
220
+ import type { PhantomUiAttributes } from "@aejkatappaja/phantom-ui";
221
221
 
222
222
  declare module "react/jsx-runtime" {
223
223
  export namespace JSX {
@@ -231,7 +231,7 @@ declare module "react/jsx-runtime" {
231
231
  **Solid**
232
232
 
233
233
  ```typescript
234
- import type { SolidPhantomUiAttributes } from "phantom-ui";
234
+ import type { SolidPhantomUiAttributes } from "@aejkatappaja/phantom-ui";
235
235
 
236
236
  declare module "solid-js" {
237
237
  namespace JSX {
@@ -245,7 +245,7 @@ declare module "solid-js" {
245
245
  **Qwik**
246
246
 
247
247
  ```typescript
248
- import type { PhantomUiAttributes } from "phantom-ui";
248
+ import type { PhantomUiAttributes } from "@aejkatappaja/phantom-ui";
249
249
 
250
250
  declare module "@builder.io/qwik" {
251
251
  namespace QwikJSX {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aejkatappaja/phantom-ui",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Structure-aware shimmer skeleton loader as a universal Web Component built with Lit. Works with React, Vue, Svelte, Angular, Solid, or vanilla JS.",
5
5
  "type": "module",
6
6
  "main": "dist/phantom-ui.js",
@@ -63,8 +63,6 @@
63
63
  },
64
64
  "customElements": "custom-elements.json",
65
65
  "lint-staged": {
66
- "*.{ts,mjs}": [
67
- "biome check --write --no-errors-on-unmatched"
68
- ]
66
+ "*.{ts,mjs}": ["biome check --write --no-errors-on-unmatched"]
69
67
  }
70
68
  }
package/src/cli/init.mjs CHANGED
@@ -6,7 +6,7 @@ import { dirname, join, resolve } from "node:path";
6
6
  const FILENAME = "phantom-ui.d.ts";
7
7
 
8
8
  const templates = {
9
- react: `import type { PhantomUiAttributes } from "phantom-ui";
9
+ react: `import type { PhantomUiAttributes } from "@aejkatappaja/phantom-ui";
10
10
 
11
11
  declare module "react/jsx-runtime" {
12
12
  \texport namespace JSX {
@@ -16,7 +16,7 @@ declare module "react/jsx-runtime" {
16
16
  \t}
17
17
  }
18
18
  `,
19
- solid: `import type { SolidPhantomUiAttributes } from "phantom-ui";
19
+ solid: `import type { SolidPhantomUiAttributes } from "@aejkatappaja/phantom-ui";
20
20
 
21
21
  declare module "solid-js" {
22
22
  \tnamespace JSX {
@@ -26,7 +26,7 @@ declare module "solid-js" {
26
26
  \t}
27
27
  }
28
28
  `,
29
- qwik: `import type { PhantomUiAttributes } from "phantom-ui";
29
+ qwik: `import type { PhantomUiAttributes } from "@aejkatappaja/phantom-ui";
30
30
 
31
31
  declare module "@builder.io/qwik" {
32
32
  \tnamespace QwikJSX {