@duyluonganduin/acl-web-components 0.0.2 → 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 (2) hide show
  1. package/dist/react.d.ts +246 -0
  2. package/package.json +7 -4
@@ -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.2",
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",