intelliwaketssveltekitv25 1.0.80 → 1.0.82
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/INTEGRATION.md +574 -0
- package/README.md +199 -45
- package/dist/ArrayTable.stories.js +215 -0
- package/dist/ArrayTable.svelte +46 -0
- package/dist/ArrayTable.svelte.d.ts +44 -0
- package/dist/ButtonGroup.stories.js +127 -0
- package/dist/DropDown.stories.d.ts +96 -0
- package/dist/DropDown.stories.js +192 -0
- package/dist/DropDown.svelte +32 -0
- package/dist/DropDown.svelte.d.ts +30 -0
- package/dist/Functions.d.ts +1 -0
- package/dist/Functions.js +3 -2
- package/dist/InputNumber.stories.d.ts +122 -0
- package/dist/InputNumber.stories.js +186 -0
- package/dist/InputNumber.svelte +52 -0
- package/dist/InputNumber.svelte.d.ts +27 -0
- package/dist/Modal.stories.d.ts +114 -0
- package/dist/Modal.stories.js +139 -0
- package/dist/Modal.svelte +34 -3
- package/dist/Modal.svelte.d.ts +35 -3
- package/dist/MultiSelect.stories.js +338 -0
- package/dist/MultiSelect.svelte +81 -0
- package/dist/MultiSelect.svelte.d.ts +38 -0
- package/dist/Switch.stories.d.ts +81 -0
- package/dist/Switch.stories.js +99 -0
- package/dist/Switch.svelte +40 -0
- package/dist/Switch.svelte.d.ts +26 -0
- package/dist/TextArea.stories.d.ts +180 -0
- package/dist/TextArea.stories.js +216 -0
- package/dist/TextArea.svelte +32 -0
- package/dist/TextArea.svelte.d.ts +24 -0
- package/dist/app.css +1 -1
- package/llm.txt +1635 -0
- package/package.json +20 -15
package/INTEGRATION.md
ADDED
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
# IntelliWakeTSSvelteKitV2.5 - Integration Guide
|
|
2
|
+
|
|
3
|
+
This guide helps you integrate the `intelliwaketssveltekitv25` component library into your SvelteKit application and configure AI assistants to use it effectively.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### 1. Install the Package
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Using pnpm (recommended)
|
|
13
|
+
pnpm add intelliwaketssveltekitv25
|
|
14
|
+
|
|
15
|
+
# Using npm
|
|
16
|
+
npm install intelliwaketssveltekitv25
|
|
17
|
+
|
|
18
|
+
# Using yarn
|
|
19
|
+
yarn add intelliwaketssveltekitv25
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Install Peer Dependencies
|
|
23
|
+
|
|
24
|
+
These are required dependencies that must be installed in your project:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm add -D @solidbasisventures/intelliwaketsfoundation @sveltejs/kit svelte
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Required versions:**
|
|
31
|
+
- `@solidbasisventures/intelliwaketsfoundation`: ^5.13.57
|
|
32
|
+
- `@sveltejs/kit`: ^2.49.2
|
|
33
|
+
- `svelte`: ^5.46.1
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## CSS Configuration
|
|
38
|
+
|
|
39
|
+
### Import the Library Styles (Required)
|
|
40
|
+
|
|
41
|
+
Add this import to your root layout file (`src/routes/+layout.svelte`) or your global CSS file:
|
|
42
|
+
|
|
43
|
+
```svelte
|
|
44
|
+
<!-- src/routes/+layout.svelte -->
|
|
45
|
+
<script>
|
|
46
|
+
import 'intelliwaketssveltekitv25/dist/app.css';
|
|
47
|
+
// Your other imports...
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<slot />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Or** in your `src/app.css`:
|
|
54
|
+
|
|
55
|
+
```css
|
|
56
|
+
@import 'intelliwaketssveltekitv25/dist/app.css';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Tailwind CSS Configuration (Required)
|
|
62
|
+
|
|
63
|
+
This library requires custom Tailwind colors and utility classes to be defined in your project.
|
|
64
|
+
|
|
65
|
+
### Add Required Colors
|
|
66
|
+
|
|
67
|
+
Edit your `tailwind.config.js` (or `tailwind.config.ts`):
|
|
68
|
+
|
|
69
|
+
```javascript
|
|
70
|
+
/** @type {import('tailwindcss').Config} */
|
|
71
|
+
export default {
|
|
72
|
+
content: [
|
|
73
|
+
'./src/**/*.{html,js,svelte,ts}',
|
|
74
|
+
// Important: Include library components in Tailwind scan
|
|
75
|
+
'./node_modules/intelliwaketssveltekitv25/**/*.{html,js,svelte,ts}'
|
|
76
|
+
],
|
|
77
|
+
theme: {
|
|
78
|
+
extend: {
|
|
79
|
+
colors: {
|
|
80
|
+
// Required primary colors
|
|
81
|
+
primary: {
|
|
82
|
+
main: '#3b82f6', // Your primary brand color
|
|
83
|
+
face: '#2563eb', // Darker shade for contrast
|
|
84
|
+
hover: '#60a5fa', // Lighter shade for hover states
|
|
85
|
+
light: '#dbeafe', // Very light shade for backgrounds
|
|
86
|
+
selected: '#bfdbfe' // Selected item background
|
|
87
|
+
},
|
|
88
|
+
// Required secondary colors
|
|
89
|
+
secondary: {
|
|
90
|
+
main: '#64748b', // Secondary brand color
|
|
91
|
+
light: '#e2e8f0' // Light secondary shade
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
plugins: []
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Color Guidelines:**
|
|
101
|
+
- Use your own brand colors for these values
|
|
102
|
+
- Ensure sufficient contrast for accessibility
|
|
103
|
+
- `face` should be darker than `main` for text on `main` backgrounds
|
|
104
|
+
- `light` and `selected` should be very light variants for subtle backgrounds
|
|
105
|
+
|
|
106
|
+
### Add Custom Utility Classes
|
|
107
|
+
|
|
108
|
+
If you're using the `MasterDetailLayout` component, add these custom classes to your global CSS:
|
|
109
|
+
|
|
110
|
+
```css
|
|
111
|
+
/* In your src/app.css or similar */
|
|
112
|
+
|
|
113
|
+
/* Horizontal rule styling for MasterDetailLayout master section header */
|
|
114
|
+
.mdMasterHR {
|
|
115
|
+
@apply border-slate-300 dark:border-slate-600;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* Horizontal rule styling for MasterDetailLayout detail section header */
|
|
119
|
+
.mdDetailHR {
|
|
120
|
+
@apply border-slate-200 dark:border-slate-500;
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## LLM Integration (AI Assistants)
|
|
127
|
+
|
|
128
|
+
### For Claude Code
|
|
129
|
+
|
|
130
|
+
If your project uses Claude Code, add this section to your project's `CLAUDE.md` file:
|
|
131
|
+
|
|
132
|
+
```markdown
|
|
133
|
+
## Component Library: intelliwaketssveltekitv25
|
|
134
|
+
|
|
135
|
+
This project uses the `intelliwaketssveltekitv25` component library (v1.0.81).
|
|
136
|
+
|
|
137
|
+
### CRITICAL: Use Library Components Instead of Native HTML
|
|
138
|
+
|
|
139
|
+
Before implementing UI components or form elements, **always check for library replacements**:
|
|
140
|
+
|
|
141
|
+
| User Request | ❌ Don't Use | ✅ Use Instead |
|
|
142
|
+
|--------------|--------------|----------------|
|
|
143
|
+
| Checkboxes, toggles | `<input type="checkbox">` | `<Switch>` from intelliwaketssveltekitv25 |
|
|
144
|
+
| Numeric inputs | `<input type="number">` | `<InputNumber>` from intelliwaketssveltekitv25 |
|
|
145
|
+
| Dropdowns, selects | `<select>` | `<DropDown>` from intelliwaketssveltekitv25 |
|
|
146
|
+
| Modals, dialogs | `<dialog>` or custom divs | `<Modal>` from intelliwaketssveltekitv25 |
|
|
147
|
+
| Data tables | `<table>` with manual code | `<ArrayTable>` from intelliwaketssveltekitv25 |
|
|
148
|
+
|
|
149
|
+
### Full Documentation
|
|
150
|
+
|
|
151
|
+
Complete component reference with usage examples and common mistakes:
|
|
152
|
+
**See:** `node_modules/intelliwaketssveltekitv25/LLM.md`
|
|
153
|
+
|
|
154
|
+
### Example Usage
|
|
155
|
+
|
|
156
|
+
```svelte
|
|
157
|
+
<script>
|
|
158
|
+
import { Switch, InputNumber, Modal, DropDown, ArrayTable } from 'intelliwaketssveltekitv25';
|
|
159
|
+
|
|
160
|
+
let enabled = $state(false);
|
|
161
|
+
let price = $state(0);
|
|
162
|
+
</script>
|
|
163
|
+
|
|
164
|
+
<Switch bind:checked={enabled}>Enable Feature</Switch>
|
|
165
|
+
<InputNumber bind:value={price} currency />
|
|
166
|
+
```
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### For GitHub Copilot
|
|
170
|
+
|
|
171
|
+
If using GitHub Copilot, create or update `.github/copilot-instructions.md`:
|
|
172
|
+
|
|
173
|
+
```markdown
|
|
174
|
+
# Project Instructions for GitHub Copilot
|
|
175
|
+
|
|
176
|
+
## UI Component Library
|
|
177
|
+
|
|
178
|
+
This project uses `intelliwaketssveltekitv25` for UI components.
|
|
179
|
+
|
|
180
|
+
### Important: Always use library components instead of native HTML
|
|
181
|
+
|
|
182
|
+
- For checkboxes/toggles: Use `<Switch>` component, not `<input type="checkbox">`
|
|
183
|
+
- For numeric inputs: Use `<InputNumber>` component, not `<input type="number">`
|
|
184
|
+
- For dropdowns: Use `<DropDown>` component, not `<select>`
|
|
185
|
+
- For modals: Use `<Modal>` component, not `<dialog>`
|
|
186
|
+
- For data tables: Use `<ArrayTable>` component, not manual `<table>`
|
|
187
|
+
|
|
188
|
+
Import from: `intelliwaketssveltekitv25`
|
|
189
|
+
|
|
190
|
+
Full documentation: `node_modules/intelliwaketssveltekitv25/LLM.md`
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### For Other AI Tools (Cursor, Continue, etc.)
|
|
194
|
+
|
|
195
|
+
Most AI coding assistants can read project documentation files. Add a file like `.cursorrules` or `.continue/config.json` with:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"docs": [
|
|
200
|
+
"node_modules/intelliwaketssveltekitv25/LLM.md",
|
|
201
|
+
"node_modules/intelliwaketssveltekitv25/INTEGRATION.md"
|
|
202
|
+
],
|
|
203
|
+
"rules": [
|
|
204
|
+
"Always use Switch component instead of <input type='checkbox'>",
|
|
205
|
+
"Always use InputNumber component instead of <input type='number'>",
|
|
206
|
+
"Always use DropDown component instead of <select>",
|
|
207
|
+
"Always use Modal component instead of <dialog>",
|
|
208
|
+
"Always use ArrayTable component instead of manual tables"
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Usage Examples
|
|
216
|
+
|
|
217
|
+
### Basic Component Import and Usage
|
|
218
|
+
|
|
219
|
+
```svelte
|
|
220
|
+
<script lang="ts">
|
|
221
|
+
import { Switch, InputNumber, Modal } from 'intelliwaketssveltekitv25';
|
|
222
|
+
|
|
223
|
+
// State management with Svelte 5 runes
|
|
224
|
+
let darkMode = $state(false);
|
|
225
|
+
let price = $state(29.99);
|
|
226
|
+
let showModal = $state(false);
|
|
227
|
+
</script>
|
|
228
|
+
|
|
229
|
+
<!-- Toggle Switch -->
|
|
230
|
+
<Switch bind:checked={darkMode}>
|
|
231
|
+
Dark Mode
|
|
232
|
+
</Switch>
|
|
233
|
+
|
|
234
|
+
<!-- Formatted Number Input -->
|
|
235
|
+
<label>
|
|
236
|
+
Price:
|
|
237
|
+
<InputNumber bind:value={price} currency required />
|
|
238
|
+
</label>
|
|
239
|
+
|
|
240
|
+
<!-- Modal Dialog -->
|
|
241
|
+
<button onclick={() => showModal = true}>
|
|
242
|
+
Open Modal
|
|
243
|
+
</button>
|
|
244
|
+
|
|
245
|
+
<Modal
|
|
246
|
+
bind:show={showModal}
|
|
247
|
+
okButton="Save"
|
|
248
|
+
cancelButton="Cancel"
|
|
249
|
+
>
|
|
250
|
+
{#snippet header()}
|
|
251
|
+
Edit Settings
|
|
252
|
+
{/snippet}
|
|
253
|
+
{#snippet body()}
|
|
254
|
+
<p>Modal content goes here...</p>
|
|
255
|
+
{/snippet}
|
|
256
|
+
</Modal>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Type-Safe Data Table
|
|
260
|
+
|
|
261
|
+
```svelte
|
|
262
|
+
<script lang="ts">
|
|
263
|
+
import { ArrayTable, type IArrayStructure } from 'intelliwaketssveltekitv25';
|
|
264
|
+
|
|
265
|
+
interface Product {
|
|
266
|
+
id: number;
|
|
267
|
+
name: string;
|
|
268
|
+
price: number;
|
|
269
|
+
inStock: boolean;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
let products: Product[] = $state([
|
|
273
|
+
{ id: 1, name: 'Widget', price: 19.99, inStock: true },
|
|
274
|
+
{ id: 2, name: 'Gadget', price: 29.99, inStock: false }
|
|
275
|
+
]);
|
|
276
|
+
|
|
277
|
+
const tableStructure: IArrayStructure<Product> = {
|
|
278
|
+
columns: [
|
|
279
|
+
{ fieldName: 'id', title: 'ID', size: 'sm' },
|
|
280
|
+
{ fieldName: 'name', title: 'Product Name' },
|
|
281
|
+
{ fieldName: 'price', title: 'Price', type: 'currency' },
|
|
282
|
+
{
|
|
283
|
+
fieldName: 'inStock',
|
|
284
|
+
title: 'Availability',
|
|
285
|
+
compute: (val) => val ? 'In Stock' : 'Out of Stock'
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
sortable: true,
|
|
289
|
+
defaultSortColumn: 'name'
|
|
290
|
+
};
|
|
291
|
+
</script>
|
|
292
|
+
|
|
293
|
+
<ArrayTable
|
|
294
|
+
arrayData={products}
|
|
295
|
+
arrayStructure={tableStructure}
|
|
296
|
+
bordered
|
|
297
|
+
/>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Version Management
|
|
303
|
+
|
|
304
|
+
### Checking Your Installed Version
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
pnpm list intelliwaketssveltekitv25
|
|
308
|
+
# or
|
|
309
|
+
npm list intelliwaketssveltekitv25
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Updating the Library
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
pnpm update intelliwaketssveltekitv25
|
|
316
|
+
# or
|
|
317
|
+
npm update intelliwaketssveltekitv25
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Version Compatibility
|
|
321
|
+
|
|
322
|
+
This documentation is for version **1.0.81**.
|
|
323
|
+
|
|
324
|
+
When upgrading to a new version:
|
|
325
|
+
1. Read the changelog for breaking changes
|
|
326
|
+
2. Update your `CLAUDE.md` or AI assistant config with the new version number
|
|
327
|
+
3. Test critical components in your application
|
|
328
|
+
4. Update any custom Tailwind colors if required by the new version
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Storybook (Component Examples)
|
|
333
|
+
|
|
334
|
+
The library includes comprehensive Storybook documentation for all components.
|
|
335
|
+
|
|
336
|
+
### View Storybook Locally
|
|
337
|
+
|
|
338
|
+
1. Navigate to the library in `node_modules`:
|
|
339
|
+
```bash
|
|
340
|
+
cd node_modules/intelliwaketssveltekitv25
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
2. Install dependencies (if needed):
|
|
344
|
+
```bash
|
|
345
|
+
pnpm install
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
3. Run Storybook:
|
|
349
|
+
```bash
|
|
350
|
+
pnpm storybook
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
4. Open browser to `http://localhost:6006`
|
|
354
|
+
|
|
355
|
+
**Tip:** Storybook provides interactive examples of all components with editable props.
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## Troubleshooting
|
|
360
|
+
|
|
361
|
+
### Common Issues
|
|
362
|
+
|
|
363
|
+
#### 1. "Module not found" errors
|
|
364
|
+
|
|
365
|
+
**Problem:** `Cannot find module 'intelliwaketssveltekitv25'`
|
|
366
|
+
|
|
367
|
+
**Solution:**
|
|
368
|
+
- Ensure the package is installed: `pnpm list intelliwaketssveltekitv25`
|
|
369
|
+
- Restart your dev server
|
|
370
|
+
- Check that your import path is correct: `import { Switch } from 'intelliwaketssveltekitv25'`
|
|
371
|
+
|
|
372
|
+
#### 2. Components not styled correctly
|
|
373
|
+
|
|
374
|
+
**Problem:** Components render but don't look right
|
|
375
|
+
|
|
376
|
+
**Solution:**
|
|
377
|
+
- Verify you've imported the CSS: `import 'intelliwaketssveltekitv25/dist/app.css'`
|
|
378
|
+
- Check that your Tailwind config includes the library components in the `content` array
|
|
379
|
+
- Ensure you've defined the required primary and secondary colors in Tailwind config
|
|
380
|
+
|
|
381
|
+
#### 3. TypeScript errors about missing types
|
|
382
|
+
|
|
383
|
+
**Problem:** `Cannot find type definitions`
|
|
384
|
+
|
|
385
|
+
**Solution:**
|
|
386
|
+
- The library includes TypeScript definitions automatically
|
|
387
|
+
- Ensure you're using TypeScript 5.x or later
|
|
388
|
+
- Check that your `tsconfig.json` has `"moduleResolution": "bundler"` or `"node16"`
|
|
389
|
+
|
|
390
|
+
#### 4. Tailwind classes not working
|
|
391
|
+
|
|
392
|
+
**Problem:** Custom classes not applying
|
|
393
|
+
|
|
394
|
+
**Solution:**
|
|
395
|
+
- Make sure your `tailwind.config.js` content array includes library files:
|
|
396
|
+
```javascript
|
|
397
|
+
content: [
|
|
398
|
+
'./src/**/*.{html,js,svelte,ts}',
|
|
399
|
+
'./node_modules/intelliwaketssveltekitv25/**/*.{html,js,svelte,ts}'
|
|
400
|
+
]
|
|
401
|
+
```
|
|
402
|
+
- Restart your dev server after changing Tailwind config
|
|
403
|
+
- Run `pnpm exec tailwindcss -i src/app.css -o dist/output.css` to rebuild if needed
|
|
404
|
+
|
|
405
|
+
#### 5. "Cannot find @solidbasisventures/intelliwaketsfoundation"
|
|
406
|
+
|
|
407
|
+
**Problem:** Peer dependency not installed
|
|
408
|
+
|
|
409
|
+
**Solution:**
|
|
410
|
+
```bash
|
|
411
|
+
pnpm add -D @solidbasisventures/intelliwaketsfoundation
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Migration from Native HTML
|
|
417
|
+
|
|
418
|
+
### Checkbox → Switch
|
|
419
|
+
|
|
420
|
+
**Before:**
|
|
421
|
+
```svelte
|
|
422
|
+
<label>
|
|
423
|
+
<input type="checkbox" bind:checked={value} />
|
|
424
|
+
Enable Feature
|
|
425
|
+
</label>
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
**After:**
|
|
429
|
+
```svelte
|
|
430
|
+
<Switch bind:checked={value}>
|
|
431
|
+
Enable Feature
|
|
432
|
+
</Switch>
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Number Input → InputNumber
|
|
436
|
+
|
|
437
|
+
**Before:**
|
|
438
|
+
```svelte
|
|
439
|
+
<input type="number" bind:value={price} step="0.01" />
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**After:**
|
|
443
|
+
```svelte
|
|
444
|
+
<InputNumber bind:value={price} currency />
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### Select → DropDown
|
|
448
|
+
|
|
449
|
+
**Before:**
|
|
450
|
+
```svelte
|
|
451
|
+
<select bind:value={selected}>
|
|
452
|
+
<option value="1">Option 1</option>
|
|
453
|
+
<option value="2">Option 2</option>
|
|
454
|
+
</select>
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
**After:**
|
|
458
|
+
```svelte
|
|
459
|
+
<DropDown
|
|
460
|
+
bind:show={showDropdown}
|
|
461
|
+
buttonTitle={selected}
|
|
462
|
+
ddActions={[
|
|
463
|
+
{ title: 'Option 1', action: () => selected = 'Option 1' },
|
|
464
|
+
{ title: 'Option 2', action: () => selected = 'Option 2' }
|
|
465
|
+
]}
|
|
466
|
+
inputControl
|
|
467
|
+
/>
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
### Dialog → Modal
|
|
471
|
+
|
|
472
|
+
**Before:**
|
|
473
|
+
```svelte
|
|
474
|
+
<dialog bind:this={dialogElement}>
|
|
475
|
+
<h2>Title</h2>
|
|
476
|
+
<p>Content</p>
|
|
477
|
+
<button onclick={() => dialogElement.close()}>Close</button>
|
|
478
|
+
</dialog>
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
**After:**
|
|
482
|
+
```svelte
|
|
483
|
+
<Modal
|
|
484
|
+
bind:show={showModal}
|
|
485
|
+
okButton="OK"
|
|
486
|
+
cancelButton="Close"
|
|
487
|
+
>
|
|
488
|
+
{#snippet header()}
|
|
489
|
+
Title
|
|
490
|
+
{/snippet}
|
|
491
|
+
{#snippet body()}
|
|
492
|
+
<p>Content</p>
|
|
493
|
+
{/snippet}
|
|
494
|
+
</Modal>
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
## Support
|
|
500
|
+
|
|
501
|
+
### Documentation Resources
|
|
502
|
+
|
|
503
|
+
1. **LLM.md** - AI-optimized component reference (in package root)
|
|
504
|
+
2. **CLAUDE.md** - Library development guide (in package root)
|
|
505
|
+
3. **Storybook** - Interactive component examples (`pnpm storybook`)
|
|
506
|
+
4. **README.md** - Quick start guide (in package root)
|
|
507
|
+
|
|
508
|
+
### Getting Help
|
|
509
|
+
|
|
510
|
+
- Check the LLM.md file for detailed component usage and common mistakes
|
|
511
|
+
- Review Storybook examples for your use case
|
|
512
|
+
- Ensure all peer dependencies are installed and up to date
|
|
513
|
+
- Verify Tailwind configuration matches requirements
|
|
514
|
+
|
|
515
|
+
### Reporting Issues
|
|
516
|
+
|
|
517
|
+
If you encounter bugs or have feature requests:
|
|
518
|
+
1. Check that you're using the latest version
|
|
519
|
+
2. Verify your configuration matches this integration guide
|
|
520
|
+
3. Report issues to the library maintainer with:
|
|
521
|
+
- Library version
|
|
522
|
+
- SvelteKit version
|
|
523
|
+
- Minimal reproduction example
|
|
524
|
+
- Error messages or screenshots
|
|
525
|
+
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
## Best Practices
|
|
529
|
+
|
|
530
|
+
### 1. Always Use TypeScript
|
|
531
|
+
|
|
532
|
+
The library is built with TypeScript and provides excellent type safety. Use types for component props:
|
|
533
|
+
|
|
534
|
+
```typescript
|
|
535
|
+
import { type IArrayStructure } from 'intelliwaketssveltekitv25';
|
|
536
|
+
|
|
537
|
+
const structure: IArrayStructure<YourDataType> = { ... };
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
### 2. Prefer $bindable Props
|
|
541
|
+
|
|
542
|
+
Use `bind:` directive for props marked as `$bindable`:
|
|
543
|
+
|
|
544
|
+
```svelte
|
|
545
|
+
<!-- ✅ Good: Two-way binding -->
|
|
546
|
+
<Switch bind:checked={myValue} />
|
|
547
|
+
<InputNumber bind:value={myNumber} />
|
|
548
|
+
|
|
549
|
+
<!-- ❌ Bad: One-way binding (won't update parent) -->
|
|
550
|
+
<Switch checked={myValue} />
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
### 3. Leverage Snippets
|
|
554
|
+
|
|
555
|
+
Use Svelte 5 snippets for flexible content:
|
|
556
|
+
|
|
557
|
+
```svelte
|
|
558
|
+
<Modal bind:show={showModal}>
|
|
559
|
+
{#snippet header()}
|
|
560
|
+
<!-- Custom header content -->
|
|
561
|
+
{/snippet}
|
|
562
|
+
{#snippet body()}
|
|
563
|
+
<!-- Custom body content -->
|
|
564
|
+
{/snippet}
|
|
565
|
+
</Modal>
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### 4. Read LLM.md Common Mistakes
|
|
569
|
+
|
|
570
|
+
Each component in LLM.md has a "Common Mistakes" section. Review these before using a component for the first time.
|
|
571
|
+
|
|
572
|
+
---
|
|
573
|
+
|
|
574
|
+
**Version:** 1.0.81 | **Last Updated:** 2026-01-08
|