@duyluonganduin/acl-web-components 0.0.2 → 0.0.4
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 +71 -33
- package/dist/acl-web-components.cjs +328 -90
- package/dist/acl-web-components.d.ts +36 -0
- package/dist/acl-web-components.js +1060 -711
- package/dist/react.d.ts +246 -0
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -88,9 +88,9 @@ Once set up, you can use token values directly as Tailwind classes:
|
|
|
88
88
|
Use components directly in HTML — they work in any framework since they are standard custom elements.
|
|
89
89
|
|
|
90
90
|
```html
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
<
|
|
91
|
+
<anduin-button appearance="filled" variant="primary">Save</anduin-button>
|
|
92
|
+
<anduin-input placeholder="Search..."></anduin-input>
|
|
93
|
+
<anduin-spinner size="small"></anduin-spinner>
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
### Framework integration
|
|
@@ -104,8 +104,8 @@ import '@duyluonganduin/acl-web-components/tokens.css'
|
|
|
104
104
|
export default function App() {
|
|
105
105
|
return (
|
|
106
106
|
<div>
|
|
107
|
-
<
|
|
108
|
-
<
|
|
107
|
+
<anduin-button appearance="filled" variant="primary">Click me</anduin-button>
|
|
108
|
+
<anduin-input placeholder="Enter text..."></anduin-input>
|
|
109
109
|
</div>
|
|
110
110
|
)
|
|
111
111
|
}
|
|
@@ -120,42 +120,79 @@ import '@duyluonganduin/acl-web-components/tokens.css'
|
|
|
120
120
|
</script>
|
|
121
121
|
|
|
122
122
|
<template>
|
|
123
|
-
<
|
|
124
|
-
<
|
|
123
|
+
<anduin-button appearance="filled" variant="primary">Click me</anduin-button>
|
|
124
|
+
<anduin-input placeholder="Enter text..."></anduin-input>
|
|
125
125
|
</template>
|
|
126
126
|
```
|
|
127
127
|
|
|
128
|
+
### TypeScript + React — JSX types
|
|
129
|
+
|
|
130
|
+
The package ships `dist/react.d.ts` which augments `React.JSX.IntrinsicElements` so TypeScript accepts all `anduin-*` elements in `.tsx` files without errors.
|
|
131
|
+
|
|
132
|
+
Enable it in one of two ways:
|
|
133
|
+
|
|
134
|
+
**Option A — `tsconfig.json`** (recommended, applies project-wide):
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"compilerOptions": {
|
|
139
|
+
"types": ["@duyluonganduin/acl-web-components/react"]
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Option B — reference directive** (per-file or in a global `.d.ts`):
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
/// <reference types="@duyluonganduin/acl-web-components/react" />
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Once enabled, all component props are typed:
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
<anduin-button appearance="filled" variant="primary" disabled>
|
|
154
|
+
Save
|
|
155
|
+
</anduin-button>
|
|
156
|
+
|
|
157
|
+
<anduin-input value={query} placeholder="Search..." status="valid"></anduin-input>
|
|
158
|
+
```
|
|
159
|
+
|
|
128
160
|
---
|
|
129
161
|
|
|
130
162
|
## Component Reference
|
|
131
163
|
|
|
132
164
|
| Component | Tag | Key Attributes |
|
|
133
165
|
|---|---|---|
|
|
134
|
-
| Badge | `<
|
|
135
|
-
| Badge Count | `<
|
|
136
|
-
| Button | `<
|
|
137
|
-
| Callout | `<
|
|
138
|
-
| Checkbox | `<
|
|
139
|
-
| Divider | `<
|
|
140
|
-
| Dot | `<
|
|
141
|
-
| Field | `<
|
|
142
|
-
| Field Label | `<
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
166
|
+
| Badge | `<anduin-badge>` | `variant` |
|
|
167
|
+
| Badge Count | `<anduin-badge-count>` | `variant`, `count` |
|
|
168
|
+
| Button | `<anduin-button>` | `appearance`, `variant` (default: `gray0`), `size`, `disabled`, `loading`, `href`, `pill`, `full-width`, `start-icon`, `end-icon` |
|
|
169
|
+
| Callout | `<anduin-callout>` | `variant` |
|
|
170
|
+
| Checkbox | `<anduin-checkbox>` | `checked`, `disabled`, `indeterminate`, `readonly`, `inputid` |
|
|
171
|
+
| Divider | `<anduin-divider>` | `direction` |
|
|
172
|
+
| Dot | `<anduin-dot>` | `variant` |
|
|
173
|
+
| Field | `<anduin-field>` | `orientation` |
|
|
174
|
+
| Field Label | `<anduin-field-label>` | `htmlfor`, `required` |
|
|
175
|
+
| Field Description | `<anduin-field-description>` | — |
|
|
176
|
+
| Field Error | `<anduin-field-error>` | — |
|
|
177
|
+
| Field Group | `<anduin-field-group>` | — |
|
|
178
|
+
| Icon | `<anduin-icon>` | `name`, `size` (12 small · **16 default** · 20 · 24 large) |
|
|
179
|
+
| Input | `<anduin-input>` | `value`, `size`, `disabled`, `readonly`, `placeholder`, `inputid`, `status` |
|
|
180
|
+
| Loading State | `<anduin-loading-state>` | `height` |
|
|
181
|
+
| Progress | `<anduin-progress>` | `percent`, `height` |
|
|
182
|
+
| Skeleton | `<anduin-skeleton>` | `effect`, `shape`, `height`, `width`, `duration`, `font-size` |
|
|
183
|
+
| Spinner | `<anduin-spinner>` | `size`, `percent` |
|
|
184
|
+
| Tabs | `<anduin-tabs>` | `default-value`, `value` |
|
|
185
|
+
| Tab List | `<anduin-tabs-list>` | `alignment` |
|
|
186
|
+
| Tab Trigger | `<anduin-tab-trigger>` | `value`, `start-icon`, `disabled` |
|
|
187
|
+
| Tab Content | `<anduin-tab-content>` | `value` |
|
|
188
|
+
| Tag | `<anduin-tag>` | `variant`, `icon`, `disabled` |
|
|
189
|
+
| Tag Close | `<anduin-tag-close>` | — |
|
|
190
|
+
| Textarea | `<anduin-textarea>` | `value`, `disabled`, `readonly`, `placeholder`, `inputid`, `rows`, `status` |
|
|
191
|
+
| Tooltip | `<anduin-tooltip>` | `placement`, `disabled` |
|
|
192
|
+
| Tooltip Trigger | `<anduin-tooltip-trigger>` | — |
|
|
193
|
+
| Tooltip Content | `<anduin-tooltip-content>` | — |
|
|
194
|
+
| Well | `<anduin-well>` | `variant` |
|
|
195
|
+
| Well Close | `<anduin-well-close>` | — |
|
|
159
196
|
|
|
160
197
|
---
|
|
161
198
|
|
|
@@ -163,10 +200,11 @@ import '@duyluonganduin/acl-web-components/tokens.css'
|
|
|
163
200
|
|
|
164
201
|
| Import path | Contents |
|
|
165
202
|
|---|---|
|
|
166
|
-
|
|
|
203
|
+
| `@duyluonganduin/acl-web-components` | All component classes (auto-registers custom elements) |
|
|
167
204
|
| `@duyluonganduin/acl-web-components/tokens.css` | CSS custom properties for all design tokens |
|
|
168
205
|
| `@duyluonganduin/acl-web-components/tailwind-preset` | Tailwind **v3** preset |
|
|
169
206
|
| `@duyluonganduin/acl-web-components/tailwind-theme.css` | Tailwind **v4** `@theme inline` bridge |
|
|
207
|
+
| `@duyluonganduin/acl-web-components/react` | React JSX types (`IntrinsicElements` for all `anduin-*` elements) |
|
|
170
208
|
|
|
171
209
|
---
|
|
172
210
|
|