@duyluonganduin/acl-web-components 0.0.1 → 0.0.3

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.
Files changed (3) hide show
  1. package/README.md +15 -15
  2. package/dist/react.d.ts +246 -0
  3. package/package.json +7 -4
package/README.md CHANGED
@@ -5,7 +5,7 @@ A native Web Components library built with [Lit](https://lit.dev) and TypeScript
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install acl-web-components
8
+ npm i @duyluonganduin/acl-web-components
9
9
  ```
10
10
 
11
11
  ---
@@ -15,7 +15,7 @@ npm install acl-web-components
15
15
  ### 1. Import the components
16
16
 
17
17
  ```js
18
- import 'acl-web-components'
18
+ import '@duyluonganduin/acl-web-components'
19
19
  ```
20
20
 
21
21
  ### 2. Import design tokens (required)
@@ -23,13 +23,13 @@ import 'acl-web-components'
23
23
  The tokens file sets all CSS custom properties (`--color-*`, `--text-*`, etc.) on `:root`. It must be imported once at your app root.
24
24
 
25
25
  ```css
26
- @import 'acl-web-components/tokens.css';
26
+ @import '@duyluonganduin/acl-web-components/tokens.css';
27
27
  ```
28
28
 
29
29
  Or in JS:
30
30
 
31
31
  ```js
32
- import 'acl-web-components/tokens.css'
32
+ import '@duyluonganduin/acl-web-components/tokens.css'
33
33
  ```
34
34
 
35
35
  ---
@@ -42,7 +42,7 @@ Add the preset to extend your Tailwind theme with all design tokens:
42
42
 
43
43
  ```js
44
44
  // tailwind.config.js
45
- import aclPreset from 'acl-web-components/tailwind-preset'
45
+ import aclPreset from '@duyluonganduin/acl-web-components/tailwind-preset'
46
46
 
47
47
  export default {
48
48
  presets: [aclPreset],
@@ -52,7 +52,7 @@ export default {
52
52
 
53
53
  ```css
54
54
  /* main.css */
55
- @import 'acl-web-components/tokens.css';
55
+ @import '@duyluonganduin/acl-web-components/tokens.css';
56
56
  @tailwind base;
57
57
  @tailwind components;
58
58
  @tailwind utilities;
@@ -65,8 +65,8 @@ Import the CSS theme bridge instead of a config preset:
65
65
  ```css
66
66
  /* main.css */
67
67
  @import "tailwindcss";
68
- @import "acl-web-components/tokens.css";
69
- @import "acl-web-components/tailwind-theme.css";
68
+ @import "@duyluonganduin/acl-web-components/tokens.css";
69
+ @import "@duyluonganduin/acl-web-components/tailwind-theme.css";
70
70
  ```
71
71
 
72
72
  No `tailwind.config.js` changes needed.
@@ -98,8 +98,8 @@ Use components directly in HTML — they work in any framework since they are st
98
98
  **React:**
99
99
 
100
100
  ```jsx
101
- import 'acl-web-components'
102
- import 'acl-web-components/tokens.css'
101
+ import '@duyluonganduin/acl-web-components'
102
+ import '@duyluonganduin/acl-web-components/tokens.css'
103
103
 
104
104
  export default function App() {
105
105
  return (
@@ -115,8 +115,8 @@ export default function App() {
115
115
 
116
116
  ```vue
117
117
  <script setup>
118
- import 'acl-web-components'
119
- import 'acl-web-components/tokens.css'
118
+ import '@duyluonganduin/acl-web-components'
119
+ import '@duyluonganduin/acl-web-components/tokens.css'
120
120
  </script>
121
121
 
122
122
  <template>
@@ -164,9 +164,9 @@ import 'acl-web-components/tokens.css'
164
164
  | Import path | Contents |
165
165
  |---|---|
166
166
  | `acl-web-components` | All component classes (auto-registers custom elements) |
167
- | `acl-web-components/tokens.css` | CSS custom properties for all design tokens |
168
- | `acl-web-components/tailwind-preset` | Tailwind **v3** preset |
169
- | `acl-web-components/tailwind-theme.css` | Tailwind **v4** `@theme inline` bridge |
167
+ | `@duyluonganduin/acl-web-components/tokens.css` | CSS custom properties for all design tokens |
168
+ | `@duyluonganduin/acl-web-components/tailwind-preset` | Tailwind **v3** preset |
169
+ | `@duyluonganduin/acl-web-components/tailwind-theme.css` | Tailwind **v4** `@theme inline` bridge |
170
170
 
171
171
  ---
172
172
 
@@ -0,0 +1,246 @@
1
+ /**
2
+ * React JSX type declarations for @duyluonganduin/acl-web-components.
3
+ *
4
+ * Augments React.JSX.IntrinsicElements so TypeScript accepts custom elements
5
+ * (e.g. <anduin-button>) in .tsx files without errors.
6
+ *
7
+ * Usage — add one of these to your project:
8
+ * // tsconfig.json → "types": ["@duyluonganduin/acl-web-components/react"]
9
+ * // or a .d.ts file → /// <reference types="@duyluonganduin/acl-web-components/react" />
10
+ */
11
+
12
+ import type { HTMLAttributes } from 'react'
13
+
14
+ type Base = HTMLAttributes<HTMLElement>
15
+
16
+ declare module 'react' {
17
+ // eslint-disable-next-line @typescript-eslint/no-namespace
18
+ namespace JSX {
19
+ interface IntrinsicElements {
20
+ // ── anduin-spinner ────────────────────────────────────────────────────
21
+ 'anduin-spinner': Base & {
22
+ /** 'small' | 'medium' | 'large' | 'extraLarge' (default: 'medium') */
23
+ size?: string
24
+ /** 0–1 fill fraction; omit for indeterminate */
25
+ percent?: string
26
+ }
27
+
28
+ // ── anduin-icon ───────────────────────────────────────────────────────
29
+ 'anduin-icon': Base & {
30
+ /** Icon name from the icon set */
31
+ name?: string
32
+ /** Pixel size (default: 16) */
33
+ size?: number | string
34
+ }
35
+
36
+ // ── anduin-badge ──────────────────────────────────────────────────────
37
+ 'anduin-badge': Base & {
38
+ /** 'gray' | 'primary' | 'success' | 'warning' | 'danger'
39
+ * | 'boldGray' | 'boldPrimary' | 'boldSuccess' | 'boldWarning' | 'boldDanger'
40
+ * (default: 'gray') */
41
+ variant?: string
42
+ }
43
+
44
+ // ── anduin-badge-count ────────────────────────────────────────────────
45
+ 'anduin-badge-count': Base & {
46
+ /** Same values as anduin-badge (default: 'gray') */
47
+ variant?: string
48
+ /** Numeric count; hidden when 0, capped at '99+' */
49
+ count?: number | string
50
+ }
51
+
52
+ // ── anduin-button ─────────────────────────────────────────────────────
53
+ 'anduin-button': Base & {
54
+ /** 'filled' | 'outlined' | 'plain' | 'text' (default: 'filled') */
55
+ appearance?: 'filled' | 'outlined' | 'plain' | 'text'
56
+ /** 'gray0' | 'gray9' | 'primary' | 'danger' | 'success' | 'warning' */
57
+ variant?: 'gray0' | 'gray9' | 'primary' | 'danger' | 'success' | 'warning'
58
+ /** 'tiny' | 'extraSmall' | 'small' | 'medium' | 'large' | 'free' (default: 'medium') */
59
+ size?: 'tiny' | 'extraSmall' | 'small' | 'medium' | 'large' | 'free'
60
+ disabled?: boolean | string
61
+ loading?: boolean | string
62
+ 'full-width'?: boolean | string
63
+ pill?: boolean | string
64
+ selected?: boolean | string
65
+ /** Renders an <a> tag when provided */
66
+ href?: string
67
+ 'open-new-tab'?: boolean | string
68
+ download?: string
69
+ /** anduin-icon name placed before the label */
70
+ 'start-icon'?: string
71
+ /** anduin-icon name placed after the label */
72
+ 'end-icon'?: string
73
+ /** aria-label shorthand */
74
+ label?: string
75
+ }
76
+
77
+ // ── anduin-callout ────────────────────────────────────────────────────
78
+ 'anduin-callout': Base & {
79
+ /** 'gray' | 'primary' | 'success' | 'danger' | 'warning' (default: 'gray') */
80
+ variant?: string
81
+ }
82
+
83
+ // ── anduin-divider ────────────────────────────────────────────────────
84
+ 'anduin-divider': Base & {
85
+ /** 'horizontal' | 'vertical' (default: 'horizontal') */
86
+ direction?: 'horizontal' | 'vertical'
87
+ }
88
+
89
+ // ── anduin-dot ────────────────────────────────────────────────────────
90
+ 'anduin-dot': Base & {
91
+ /** 'gray' | 'primary' | 'success' | 'danger' | 'warning' (default: 'gray') */
92
+ variant?: string
93
+ }
94
+
95
+ // ── anduin-progress ───────────────────────────────────────────────────
96
+ 'anduin-progress': Base & {
97
+ /** 0–1 fill fraction; omit for indeterminate */
98
+ percent?: string
99
+ /** 'medium' | 'large' (default: 'medium') */
100
+ height?: string
101
+ }
102
+
103
+ // ── anduin-skeleton ───────────────────────────────────────────────────
104
+ 'anduin-skeleton': Base & {
105
+ /** 'pulse' | 'wave' (default: 'pulse') */
106
+ effect?: string
107
+ /** 'rectangle' | 'rounded' | 'circle' | 'text' (default: 'rectangle') */
108
+ shape?: string
109
+ height?: string
110
+ width?: string
111
+ /** Animation duration in ms (default: 1500) */
112
+ duration?: number | string
113
+ /** CSS font-size for shape='text' */
114
+ 'font-size'?: string
115
+ }
116
+
117
+ // ── anduin-loading-state ──────────────────────────────────────────────
118
+ 'anduin-loading-state': Base & {
119
+ /** CSS height of the container (default: '256px') */
120
+ height?: string
121
+ }
122
+
123
+ // ── anduin-field ──────────────────────────────────────────────────────
124
+ 'anduin-field': Base & {
125
+ /** 'vertical' | 'horizontal' (default: 'vertical') */
126
+ orientation?: 'vertical' | 'horizontal'
127
+ }
128
+
129
+ // ── anduin-field-label ────────────────────────────────────────────────
130
+ 'anduin-field-label': Base & {
131
+ /** id of the associated input (mirrors <label for="…">) */
132
+ htmlfor?: string
133
+ required?: boolean | string
134
+ }
135
+
136
+ // ── anduin-field-description ──────────────────────────────────────────
137
+ 'anduin-field-description': Base
138
+
139
+ // ── anduin-field-error ────────────────────────────────────────────────
140
+ 'anduin-field-error': Base
141
+
142
+ // ── anduin-field-group ────────────────────────────────────────────────
143
+ 'anduin-field-group': Base
144
+
145
+ // ── anduin-checkbox ───────────────────────────────────────────────────
146
+ 'anduin-checkbox': Base & {
147
+ checked?: boolean | string
148
+ disabled?: boolean | string
149
+ indeterminate?: boolean | string
150
+ readonly?: boolean | string
151
+ /** id linking this checkbox to an anduin-field-label */
152
+ inputid?: string
153
+ }
154
+
155
+ // ── anduin-input ──────────────────────────────────────────────────────
156
+ 'anduin-input': Base & {
157
+ value?: string
158
+ /** 'small' | 'default' | 'large' (default: 'default') */
159
+ size?: string
160
+ disabled?: boolean | string
161
+ readonly?: boolean | string
162
+ placeholder?: string
163
+ /** id attribute on the inner <input> */
164
+ inputid?: string
165
+ /** 'valid' | 'invalid' | 'warning' | 'loading' */
166
+ status?: string
167
+ }
168
+
169
+ // ── anduin-textarea ───────────────────────────────────────────────────
170
+ 'anduin-textarea': Base & {
171
+ value?: string
172
+ disabled?: boolean | string
173
+ readonly?: boolean | string
174
+ placeholder?: string
175
+ /** id attribute on the inner <textarea> */
176
+ inputid?: string
177
+ rows?: number | string
178
+ /** 'valid' | 'invalid' | 'warning' | 'loading' */
179
+ status?: string
180
+ }
181
+
182
+ // ── anduin-tabs ───────────────────────────────────────────────────────
183
+ 'anduin-tabs': Base & {
184
+ /** Initially active tab value */
185
+ 'default-value'?: string
186
+ /** Controlled active tab value */
187
+ value?: string
188
+ }
189
+
190
+ // ── anduin-tabs-list ──────────────────────────────────────────────────
191
+ 'anduin-tabs-list': Base & {
192
+ /** 'left' | 'center' | 'right' (default: 'left') */
193
+ alignment?: 'left' | 'center' | 'right'
194
+ }
195
+
196
+ // ── anduin-tab-trigger ────────────────────────────────────────────────
197
+ 'anduin-tab-trigger': Base & {
198
+ /** Must match a corresponding anduin-tab-content value */
199
+ value?: string
200
+ /** anduin-icon name */
201
+ 'start-icon'?: string
202
+ disabled?: boolean | string
203
+ }
204
+
205
+ // ── anduin-tab-content ────────────────────────────────────────────────
206
+ 'anduin-tab-content': Base & {
207
+ /** Must match a corresponding anduin-tab-trigger value */
208
+ value?: string
209
+ }
210
+
211
+ // ── anduin-tag ────────────────────────────────────────────────────────
212
+ 'anduin-tag': Base & {
213
+ /** See TagVariant in anduin-tag.ts for all accepted values (default: 'gray') */
214
+ variant?: string
215
+ /** anduin-icon name shown before the label */
216
+ icon?: string
217
+ disabled?: boolean | string
218
+ }
219
+
220
+ // ── anduin-tag-close ──────────────────────────────────────────────────
221
+ 'anduin-tag-close': Base
222
+
223
+ // ── anduin-tooltip ────────────────────────────────────────────────────
224
+ 'anduin-tooltip': Base & {
225
+ disabled?: boolean | string
226
+ /** e.g. 'top-center' | 'bottom-start' | 'right-end' … (default: 'top-center') */
227
+ placement?: string
228
+ }
229
+
230
+ // ── anduin-tooltip-trigger ────────────────────────────────────────────
231
+ 'anduin-tooltip-trigger': Base
232
+
233
+ // ── anduin-tooltip-content ────────────────────────────────────────────
234
+ 'anduin-tooltip-content': Base
235
+
236
+ // ── anduin-well ───────────────────────────────────────────────────────
237
+ 'anduin-well': Base & {
238
+ /** 'gray' | 'primary' | 'success' | 'danger' | 'warning' (default: 'gray') */
239
+ variant?: string
240
+ }
241
+
242
+ // ── anduin-well-close ─────────────────────────────────────────────────
243
+ 'anduin-well-close': Base
244
+ }
245
+ }
246
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duyluonganduin/acl-web-components",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/acl-web-components.cjs",
6
6
  "module": "./dist/acl-web-components.js",
@@ -21,6 +21,9 @@
21
21
  "./tailwind-theme.css": {
22
22
  "style": "./dist/tailwind-theme.css",
23
23
  "default": "./dist/tailwind-theme.css"
24
+ },
25
+ "./react": {
26
+ "types": "./dist/react.d.ts"
24
27
  }
25
28
  },
26
29
  "files": [
@@ -30,13 +33,13 @@
30
33
  "access": "public"
31
34
  },
32
35
  "scripts": {
33
- "prepare": "tsc -p tsconfig.build.json && vite build && cp src/styles/tokens.css dist/tokens.css && cp src/styles/tailwind-theme.css dist/tailwind-theme.css",
34
- "build": "tsc -p tsconfig.build.json && vite build && cp src/styles/tokens.css dist/tokens.css && cp src/styles/tailwind-theme.css dist/tailwind-theme.css",
36
+ "prepare": "tsc -p tsconfig.build.json && vite build && cp src/styles/tokens.css dist/tokens.css && cp src/styles/tailwind-theme.css dist/tailwind-theme.css && cp src/react.d.ts dist/react.d.ts",
37
+ "build": "tsc -p tsconfig.build.json && vite build && cp src/styles/tokens.css dist/tokens.css && cp src/styles/tailwind-theme.css dist/tailwind-theme.css && cp src/react.d.ts dist/react.d.ts",
35
38
  "storybook": "storybook dev -p 6006",
36
39
  "build-storybook": "storybook build"
37
40
  },
38
41
  "devDependencies": {
39
- "@storybook/addon-essentials": "^8.5.0",
42
+ "@storybook/addon-essentials": "^8.6.17",
40
43
  "@storybook/blocks": "^8.5.0",
41
44
  "@storybook/web-components-vite": "^8.5.0",
42
45
  "lit": "^3.3.2",