@ticatec/uniface-element 0.2.4 → 0.3.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.
Files changed (176) hide show
  1. package/dist/accordion/README.md +169 -0
  2. package/dist/accordion/README_CN.md +176 -0
  3. package/dist/action-bar/README.md +275 -0
  4. package/dist/action-bar/README_CN.md +285 -0
  5. package/dist/app-layout/README.md +374 -0
  6. package/dist/app-layout/README_CN.md +381 -0
  7. package/dist/app-top-bar/README.md +357 -0
  8. package/dist/app-top-bar/README_CN.md +365 -0
  9. package/dist/attachment-files/AttachmentFilesField.svelte +67 -1
  10. package/dist/attachment-files/AttachmentFilesField.svelte.d.ts +8 -1
  11. package/dist/base-calendar/CalendarBase.svelte +0 -3
  12. package/dist/box/README.md +385 -0
  13. package/dist/box/README_CN.md +393 -0
  14. package/dist/breadcrumbs/README.md +442 -0
  15. package/dist/breadcrumbs/README_CN.md +442 -0
  16. package/dist/button/Button.svelte +27 -7
  17. package/dist/button/Button.svelte.d.ts +3 -1
  18. package/dist/button/IconButton.svelte +26 -6
  19. package/dist/button/IconButton.svelte.d.ts +3 -1
  20. package/dist/button/IconButton_README.md +513 -0
  21. package/dist/button/IconButton_README_CN.md +513 -0
  22. package/dist/button/README.md +428 -0
  23. package/dist/button/README_CN.md +428 -0
  24. package/dist/button/TextButton.svelte +26 -6
  25. package/dist/button/TextButton.svelte.d.ts +3 -1
  26. package/dist/button/TextButton_README.md +571 -0
  27. package/dist/button/TextButton_README_CN.md +571 -0
  28. package/dist/card/README.md +666 -0
  29. package/dist/card/README_CN.md +666 -0
  30. package/dist/cascade-options-select/CascadeOptionSelect.svelte +43 -7
  31. package/dist/cascade-options-select/CascadeOptionSelect.svelte.d.ts +3 -4
  32. package/dist/cascade-options-select/README.md +663 -2
  33. package/dist/cascade-options-select/README_CN.md +664 -0
  34. package/dist/checkbox/CheckBox.svelte +20 -6
  35. package/dist/checkbox/CheckBox.svelte.d.ts +4 -2
  36. package/dist/checkbox/README.md +562 -0
  37. package/dist/checkbox/README_CN.md +727 -0
  38. package/dist/common-editor/NumberInput.svelte +39 -26
  39. package/dist/common-editor/NumberInput.svelte.d.ts +5 -1
  40. package/dist/concise-data-table/ConciseListTable.svelte +133 -36
  41. package/dist/concise-data-table/ConciseListTable.svelte.d.ts +8 -1
  42. package/dist/concise-data-table/DataCell.svelte +5 -6
  43. package/dist/concise-data-table/DataRow.svelte +22 -2
  44. package/dist/concise-data-table/DataRow.svelte.d.ts +1 -0
  45. package/dist/concise-data-table/README.md +606 -0
  46. package/dist/concise-data-table/README_CN.md +611 -0
  47. package/dist/context-menu/ContextMenu.svelte +138 -21
  48. package/dist/context-menu/ContextMenu.svelte.d.ts +5 -0
  49. package/dist/context-menu/ContextMenuItem.d.ts +20 -4
  50. package/dist/context-menu/README.md +551 -0
  51. package/dist/context-menu/README_CN.md +551 -0
  52. package/dist/criteria-field/CriteriaField.svelte +3 -5
  53. package/dist/criteria-field/README.md +532 -0
  54. package/dist/criteria-field/README_CN.md +532 -0
  55. package/dist/data-table/README.md +712 -0
  56. package/dist/data-table/README_CN.md +712 -0
  57. package/dist/date-picker/DatePicker.svelte +44 -7
  58. package/dist/date-picker/DatePicker.svelte.d.ts +3 -4
  59. package/dist/date-picker/DateTimePicker.svelte +32 -8
  60. package/dist/date-picker/DateTimePicker.svelte.d.ts +3 -4
  61. package/dist/date-picker/README.md +326 -0
  62. package/dist/date-picker/README_CN.md +316 -0
  63. package/dist/date-picker/ScrollBar.svelte +18 -8
  64. package/dist/date-picker/ScrollBar.svelte.d.ts +1 -1
  65. package/dist/date-picker/TimePanel.svelte +5 -5
  66. package/dist/date-picker/TimePanel.svelte.d.ts +1 -1
  67. package/dist/date-range/README.md +374 -0
  68. package/dist/date-range/README_CN.md +374 -0
  69. package/dist/dialog/README.md +596 -0
  70. package/dist/dialog/README_CN.md +596 -0
  71. package/dist/drawer/README.md +679 -1
  72. package/dist/drawer/README_CN.md +679 -0
  73. package/dist/group-box/group-check-box/GroupCheckBox.svelte +62 -5
  74. package/dist/group-box/group-check-box/GroupCheckBox.svelte.d.ts +7 -2
  75. package/dist/group-box/group-check-box/README.md +749 -0
  76. package/dist/group-box/group-check-box/README_CN.md +750 -0
  77. package/dist/group-box/group-radio-box/GroupRadioBox.svelte +69 -4
  78. package/dist/group-box/group-radio-box/GroupRadioBox.svelte.d.ts +8 -2
  79. package/dist/group-box/group-radio-box/README.md +920 -0
  80. package/dist/group-box/group-radio-box/README_CN.md +920 -0
  81. package/dist/image-files/README.md +1346 -0
  82. package/dist/image-files/README_CN.md +1346 -0
  83. package/dist/input-options-select/InputOptionsSelect.svelte +161 -65
  84. package/dist/input-options-select/InputOptionsSelect.svelte.d.ts +4 -1
  85. package/dist/lib/forwardAllEvents.d.ts +3 -0
  86. package/dist/lib/forwardAllEvents.js +24 -0
  87. package/dist/list-box/README.md +579 -0
  88. package/dist/list-box/README_CN.md +682 -0
  89. package/dist/lookup-editor/LookupEditor.svelte +15 -3
  90. package/dist/lookup-editor/LookupEditor.svelte.d.ts +3 -4
  91. package/dist/lookup-editor/README.md +684 -0
  92. package/dist/lookup-editor/README_CN.md +684 -0
  93. package/dist/memo-editor/MemoEditor.svelte +77 -27
  94. package/dist/memo-editor/MemoEditor.svelte.d.ts +6 -3
  95. package/dist/memo-editor/README.md +819 -0
  96. package/dist/memo-editor/README_CN.md +819 -0
  97. package/dist/message-box/README.md +398 -0
  98. package/dist/message-box/README_CN.md +398 -0
  99. package/dist/number-editor/NumberEditor.svelte +2 -2
  100. package/dist/number-editor/NumberEditor.svelte.d.ts +1 -1
  101. package/dist/number-editor/README.md +353 -22
  102. package/dist/number-editor/README_CN.md +357 -0
  103. package/dist/number-range/README.md +443 -0
  104. package/dist/number-range/README_CN.md +443 -0
  105. package/dist/options-multi-select/OptionsMultiSelect.svelte +87 -12
  106. package/dist/options-multi-select/OptionsMultiSelect.svelte.d.ts +3 -1
  107. package/dist/options-multi-select/README.md +480 -0
  108. package/dist/options-multi-select/README_CN.md +480 -0
  109. package/dist/options-select/OptionsSelect.svelte +36 -5
  110. package/dist/options-select/OptionsSelect.svelte.d.ts +3 -4
  111. package/dist/options-select/README.md +632 -0
  112. package/dist/options-select/README_CN.md +632 -0
  113. package/dist/page/README.md +605 -0
  114. package/dist/page/README_CN.md +605 -0
  115. package/dist/pagination/README.md +946 -0
  116. package/dist/pagination/README_CN.md +946 -0
  117. package/dist/pagination-panel/README.md +1075 -0
  118. package/dist/pagination-panel/README_CN.md +1075 -0
  119. package/dist/popup-hint/README.md +841 -0
  120. package/dist/popup-hint/README_CN.md +840 -0
  121. package/dist/progress-bar/README.md +242 -0
  122. package/dist/progress-bar/README_CN.md +242 -0
  123. package/dist/progress-step-bar/README.md +316 -0
  124. package/dist/progress-step-bar/README_CN.md +316 -0
  125. package/dist/prompts-text-editor/PromptsTextEditor.svelte +6 -3
  126. package/dist/prompts-text-editor/PromptsTextEditor.svelte.d.ts +3 -1
  127. package/dist/prompts-text-editor/README.md +329 -0
  128. package/dist/prompts-text-editor/README_CN.md +329 -0
  129. package/dist/property-editor/README.md +969 -0
  130. package/dist/property-editor/README_CN.md +969 -0
  131. package/dist/radio-button/README.md +372 -0
  132. package/dist/radio-button/README_CN.md +372 -0
  133. package/dist/radio-button/RadioButton.svelte +32 -3
  134. package/dist/radio-button/RadioButton.svelte.d.ts +12 -1
  135. package/dist/search-box/README.md +425 -0
  136. package/dist/search-box/README_CN.md +424 -0
  137. package/dist/search-box/SearchBox.svelte +22 -6
  138. package/dist/search-box/SearchBox.svelte.d.ts +4 -1
  139. package/dist/tabs/README.md +919 -0
  140. package/dist/tabs/README_CN.md +920 -0
  141. package/dist/tag/README.md +922 -0
  142. package/dist/tag/README_CN.md +922 -0
  143. package/dist/text-editor/PasswordEditor.svelte +17 -2
  144. package/dist/text-editor/PasswordEditor.svelte.d.ts +3 -3
  145. package/dist/text-editor/PasswordEditor_README.md +551 -0
  146. package/dist/text-editor/PasswordEditor_README_CN.md +551 -0
  147. package/dist/text-editor/README.md +466 -0
  148. package/dist/text-editor/README_CN.md +466 -0
  149. package/dist/text-editor/TextEditor.svelte +51 -19
  150. package/dist/text-editor/TextEditor.svelte.d.ts +0 -1
  151. package/dist/time-editor/README.md +498 -24
  152. package/dist/time-editor/README_CN.md +498 -0
  153. package/dist/time-editor/TimeEditor.svelte +7 -3
  154. package/dist/time-editor/TimeEditor.svelte.d.ts +3 -1
  155. package/dist/toast/README.md +667 -0
  156. package/dist/toast/README_CN.md +667 -0
  157. package/dist/transfer/README.md +795 -0
  158. package/dist/transfer/Transfer.svelte +6 -4
  159. package/dist/transfer/Transfer.svelte.d.ts +3 -1
  160. package/dist/tree-view/README.md +761 -0
  161. package/dist/tree-view/README_CN.md +761 -0
  162. package/dist/tree-view/TreeView.svelte +5 -3
  163. package/dist/tree-view/TreeView.svelte.d.ts +3 -1
  164. package/dist/unit-number-editor/README.md +546 -20
  165. package/dist/unit-number-editor/README_CN.md +525 -0
  166. package/dist/unit-number-editor/UnitNumberEditor.svelte +62 -8
  167. package/dist/unit-number-editor/UnitNumberEditor.svelte.d.ts +5 -1
  168. package/docs/form-field/cn/README_CN.md +364 -0
  169. package/docs/form-field/en/README.md +364 -0
  170. package/docs/form-panel/flex-form/cn/README_CN.md +586 -0
  171. package/docs/form-panel/flex-form/en/README.md +586 -0
  172. package/docs/form-panel/flex-row-form/cn/README_CN.md +787 -0
  173. package/docs/form-panel/flex-row-form/en/README.md +787 -0
  174. package/docs/form-panel/grid-form/en/README.md +744 -0
  175. package/package.json +1 -1
  176. package/dist/drawer/README-CN.md +0 -1
@@ -0,0 +1,666 @@
1
+ # Card Component
2
+
3
+ A flexible card container component that displays content in a structured format with optional header, action bar, and various styling options. Perfect for displaying structured information, user profiles, product details, and more.
4
+
5
+ ## Features
6
+
7
+ - **Flexible Structure**: Header, content, and action bar sections
8
+ - **Multiple Header Options**: Simple title or custom header content via slots
9
+ - **Action Bar Support**: Built-in action buttons with icons/images and callbacks
10
+ - **Visual Variants**: Plain and 3D shadow variants
11
+ - **Custom Styling**: Flexible style customization
12
+ - **Slot-Based Content**: Rich content support through slots
13
+ - **Interactive Actions**: Click handling with debouncing and hover hints
14
+
15
+ ## Basic Usage
16
+
17
+ ```svelte
18
+ <script>
19
+ import Card from '@ticatec/uniface-element/Card';
20
+
21
+ const cardData = { id: 1, name: 'John Doe' };
22
+ </script>
23
+
24
+ <Card
25
+ title="User Profile"
26
+ data={cardData}
27
+ >
28
+ <p>This is the card content area.</p>
29
+ </Card>
30
+ ```
31
+
32
+ ## Props
33
+
34
+ | Prop | Type | Default | Description |
35
+ |------|------|---------|-------------|
36
+ | `style` | `string` | `''` | Custom CSS styles |
37
+ | `title` | `string` | `null` | Simple header title text |
38
+ | `actions` | `CardAction[]` | `[]` | Array of action buttons |
39
+ | `variant` | `'plain' \| '3d'` | `'plain'` | Card visual variant |
40
+ | `iconColor` | `string \| null` | `null` | Custom color for action icons |
41
+ | `data` | `any` | `null` | Data object passed to action callbacks |
42
+
43
+ ## CardAction Interface
44
+
45
+ ```typescript
46
+ interface CardAction {
47
+ icon?: string; // Icon font class (e.g., FontAwesome)
48
+ img?: string; // Image URL for custom icons
49
+ hint?: string; // Tooltip text on hover
50
+ disabled?: boolean; // Whether the action is disabled
51
+ callback: (data: any) => void; // Action callback function
52
+ }
53
+ ```
54
+
55
+ ## Slots
56
+
57
+ | Slot | Description |
58
+ |------|-------------|
59
+ | `header-bar` | Custom header content (overrides title prop) |
60
+ | `default` | Main card content |
61
+ | `action-bar` | Custom action bar content (when no actions prop) |
62
+
63
+ ## Card Variants
64
+
65
+ ```svelte
66
+ <!-- Plain card (default) -->
67
+ <Card title="Plain Card" variant="plain">
68
+ <p>Simple flat card design</p>
69
+ </Card>
70
+
71
+ <!-- 3D shadow card -->
72
+ <Card title="3D Card" variant="3d">
73
+ <p>Card with shadow effect</p>
74
+ </Card>
75
+ ```
76
+
77
+ ## With Actions
78
+
79
+ ```svelte
80
+ <script>
81
+ import Card, { type CardAction } from '@ticatec/uniface-element/Card';
82
+
83
+ const userData = { id: 1, name: 'John Doe', email: 'john@example.com' };
84
+
85
+ const actions: CardAction[] = [
86
+ {
87
+ icon: 'fas fa-edit',
88
+ hint: 'Edit user',
89
+ callback: (data) => editUser(data)
90
+ },
91
+ {
92
+ icon: 'fas fa-trash',
93
+ hint: 'Delete user',
94
+ callback: (data) => deleteUser(data)
95
+ },
96
+ {
97
+ icon: 'fas fa-share',
98
+ hint: 'Share profile',
99
+ callback: (data) => shareProfile(data)
100
+ }
101
+ ];
102
+
103
+ const editUser = (user) => {
104
+ console.log('Editing user:', user);
105
+ };
106
+
107
+ const deleteUser = (user) => {
108
+ console.log('Deleting user:', user);
109
+ };
110
+
111
+ const shareProfile = (user) => {
112
+ console.log('Sharing profile:', user);
113
+ };
114
+ </script>
115
+
116
+ <Card
117
+ title="User Profile"
118
+ {actions}
119
+ data={userData}
120
+ variant="3d"
121
+ >
122
+ <div class="profile-content">
123
+ <h3>{userData.name}</h3>
124
+ <p>{userData.email}</p>
125
+ </div>
126
+ </Card>
127
+ ```
128
+
129
+ ## Custom Header with Slot
130
+
131
+ ```svelte
132
+ <Card variant="3d">
133
+ <div slot="header-bar" class="custom-header">
134
+ <div class="header-left">
135
+ <img src="/avatar.jpg" alt="User" class="avatar" />
136
+ <h3>John Doe</h3>
137
+ </div>
138
+ <div class="header-right">
139
+ <span class="status online">Online</span>
140
+ </div>
141
+ </div>
142
+
143
+ <div class="profile-details">
144
+ <p>Software Developer</p>
145
+ <p>San Francisco, CA</p>
146
+ </div>
147
+ </Card>
148
+
149
+ <style>
150
+ .custom-header {
151
+ display: flex;
152
+ justify-content: space-between;
153
+ align-items: center;
154
+ padding: 16px;
155
+ }
156
+
157
+ .header-left {
158
+ display: flex;
159
+ align-items: center;
160
+ gap: 12px;
161
+ }
162
+
163
+ .avatar {
164
+ width: 40px;
165
+ height: 40px;
166
+ border-radius: 50%;
167
+ }
168
+
169
+ .status.online {
170
+ color: #22c55e;
171
+ font-weight: 500;
172
+ }
173
+ </style>
174
+ ```
175
+
176
+ ## Custom Action Bar
177
+
178
+ ```svelte
179
+ <Card title="Project Card">
180
+ <div class="project-info">
181
+ <h4>Project Alpha</h4>
182
+ <p>A revolutionary new application</p>
183
+ </div>
184
+
185
+ <div slot="action-bar" class="custom-actions">
186
+ <button class="btn-primary">View Details</button>
187
+ <button class="btn-secondary">Edit</button>
188
+ <button class="btn-danger">Delete</button>
189
+ </div>
190
+ </Card>
191
+ ```
192
+
193
+ ## Advanced Examples
194
+
195
+ ### Product Card
196
+
197
+ ```svelte
198
+ <script>
199
+ const product = {
200
+ id: 101,
201
+ name: 'Wireless Headphones',
202
+ price: 199.99,
203
+ image: '/headphones.jpg'
204
+ };
205
+
206
+ const productActions = [
207
+ {
208
+ icon: 'fas fa-heart',
209
+ hint: 'Add to favorites',
210
+ callback: (data) => addToFavorites(data)
211
+ },
212
+ {
213
+ icon: 'fas fa-shopping-cart',
214
+ hint: 'Add to cart',
215
+ callback: (data) => addToCart(data)
216
+ },
217
+ {
218
+ icon: 'fas fa-share',
219
+ hint: 'Share product',
220
+ callback: (data) => shareProduct(data)
221
+ }
222
+ ];
223
+ </script>
224
+
225
+ <Card
226
+ actions={productActions}
227
+ data={product}
228
+ variant="3d"
229
+ style="max-width: 300px;"
230
+ >
231
+ <div slot="header-bar" class="product-header">
232
+ <img src={product.image} alt={product.name} class="product-image" />
233
+ </div>
234
+
235
+ <div class="product-details">
236
+ <h3>{product.name}</h3>
237
+ <div class="price">${product.price}</div>
238
+ <div class="rating">
239
+ ⭐⭐⭐⭐⭐ (128 reviews)
240
+ </div>
241
+ </div>
242
+ </Card>
243
+ ```
244
+
245
+ ### Dashboard Widget
246
+
247
+ ```svelte
248
+ <script>
249
+ const widgetData = {
250
+ title: 'Sales Overview',
251
+ value: 12345,
252
+ change: '+15.3%'
253
+ };
254
+
255
+ const widgetActions = [
256
+ {
257
+ icon: 'fas fa-refresh',
258
+ hint: 'Refresh data',
259
+ callback: (data) => refreshWidget(data)
260
+ },
261
+ {
262
+ icon: 'fas fa-cog',
263
+ hint: 'Settings',
264
+ callback: (data) => openSettings(data)
265
+ }
266
+ ];
267
+ </script>
268
+
269
+ <Card
270
+ title={widgetData.title}
271
+ actions={widgetActions}
272
+ data={widgetData}
273
+ iconColor="#007acc"
274
+ >
275
+ <div class="widget-content">
276
+ <div class="metric-value">${widgetData.value.toLocaleString()}</div>
277
+ <div class="metric-change positive">{widgetData.change}</div>
278
+ </div>
279
+ </Card>
280
+
281
+ <style>
282
+ .widget-content {
283
+ text-align: center;
284
+ padding: 20px;
285
+ }
286
+
287
+ .metric-value {
288
+ font-size: 2rem;
289
+ font-weight: bold;
290
+ color: #333;
291
+ }
292
+
293
+ .metric-change {
294
+ font-size: 1rem;
295
+ margin-top: 8px;
296
+ }
297
+
298
+ .metric-change.positive {
299
+ color: #22c55e;
300
+ }
301
+ </style>
302
+ ```
303
+
304
+ ### Blog Post Card
305
+
306
+ ```svelte
307
+ <script>
308
+ const post = {
309
+ id: 1,
310
+ title: 'Getting Started with Svelte',
311
+ excerpt: 'Learn the basics of Svelte framework...',
312
+ author: 'Jane Smith',
313
+ date: '2024-03-15',
314
+ tags: ['svelte', 'javascript', 'tutorial']
315
+ };
316
+
317
+ const postActions = [
318
+ {
319
+ icon: 'fas fa-bookmark',
320
+ hint: 'Bookmark post',
321
+ callback: (data) => bookmarkPost(data)
322
+ },
323
+ {
324
+ icon: 'fas fa-share',
325
+ hint: 'Share post',
326
+ callback: (data) => sharePost(data)
327
+ }
328
+ ];
329
+ </script>
330
+
331
+ <Card
332
+ actions={postActions}
333
+ data={post}
334
+ variant="plain"
335
+ >
336
+ <div slot="header-bar" class="post-header">
337
+ <h2 class="post-title">{post.title}</h2>
338
+ <div class="post-meta">
339
+ <span>By {post.author}</span>
340
+ <span>{post.date}</span>
341
+ </div>
342
+ </div>
343
+
344
+ <div class="post-content">
345
+ <p>{post.excerpt}</p>
346
+ <div class="tags">
347
+ {#each post.tags as tag}
348
+ <span class="tag">#{tag}</span>
349
+ {/each}
350
+ </div>
351
+ </div>
352
+ </Card>
353
+ ```
354
+
355
+ ### Contact Card
356
+
357
+ ```svelte
358
+ <script>
359
+ const contact = {
360
+ name: 'Sarah Johnson',
361
+ role: 'Project Manager',
362
+ email: 'sarah@company.com',
363
+ phone: '+1 (555) 123-4567',
364
+ avatar: '/sarah.jpg'
365
+ };
366
+
367
+ const contactActions = [
368
+ {
369
+ icon: 'fas fa-envelope',
370
+ hint: 'Send email',
371
+ callback: (data) => sendEmail(data.email)
372
+ },
373
+ {
374
+ icon: 'fas fa-phone',
375
+ hint: 'Call',
376
+ callback: (data) => makeCall(data.phone)
377
+ },
378
+ {
379
+ icon: 'fas fa-edit',
380
+ hint: 'Edit contact',
381
+ callback: (data) => editContact(data)
382
+ }
383
+ ];
384
+ </script>
385
+
386
+ <Card
387
+ actions={contactActions}
388
+ data={contact}
389
+ variant="3d"
390
+ >
391
+ <div class="contact-card">
392
+ <img src={contact.avatar} alt={contact.name} class="contact-avatar" />
393
+ <h3>{contact.name}</h3>
394
+ <p class="contact-role">{contact.role}</p>
395
+ <div class="contact-info">
396
+ <div class="contact-item">
397
+ <i class="fas fa-envelope"></i>
398
+ <span>{contact.email}</span>
399
+ </div>
400
+ <div class="contact-item">
401
+ <i class="fas fa-phone"></i>
402
+ <span>{contact.phone}</span>
403
+ </div>
404
+ </div>
405
+ </div>
406
+ </Card>
407
+ ```
408
+
409
+ ### Settings Card
410
+
411
+ ```svelte
412
+ <script>
413
+ let notifications = true;
414
+ let darkMode = false;
415
+
416
+ const settingsData = { notifications, darkMode };
417
+
418
+ const saveSettings = (data) => {
419
+ console.log('Saving settings:', data);
420
+ // Save settings logic
421
+ };
422
+
423
+ const resetSettings = (data) => {
424
+ notifications = true;
425
+ darkMode = false;
426
+ };
427
+
428
+ const settingsActions = [
429
+ {
430
+ icon: 'fas fa-save',
431
+ hint: 'Save settings',
432
+ callback: saveSettings
433
+ },
434
+ {
435
+ icon: 'fas fa-undo',
436
+ hint: 'Reset to defaults',
437
+ callback: resetSettings
438
+ }
439
+ ];
440
+ </script>
441
+
442
+ <Card
443
+ title="Preferences"
444
+ actions={settingsActions}
445
+ data={settingsData}
446
+ >
447
+ <div class="settings-form">
448
+ <div class="setting-item">
449
+ <label>
450
+ <input type="checkbox" bind:checked={notifications} />
451
+ Enable notifications
452
+ </label>
453
+ </div>
454
+ <div class="setting-item">
455
+ <label>
456
+ <input type="checkbox" bind:checked={darkMode} />
457
+ Dark mode
458
+ </label>
459
+ </div>
460
+ </div>
461
+ </Card>
462
+ ```
463
+
464
+ ## Action Types
465
+
466
+ ### Icon Actions
467
+
468
+ ```svelte
469
+ <script>
470
+ const iconActions = [
471
+ {
472
+ icon: 'fas fa-star',
473
+ hint: 'Mark as favorite',
474
+ callback: (data) => toggleFavorite(data)
475
+ },
476
+ {
477
+ icon: 'fas fa-download',
478
+ hint: 'Download',
479
+ callback: (data) => downloadFile(data)
480
+ }
481
+ ];
482
+ </script>
483
+ ```
484
+
485
+ ### Image Actions
486
+
487
+ ```svelte
488
+ <script>
489
+ const imageActions = [
490
+ {
491
+ img: '/icons/custom-icon.svg',
492
+ hint: 'Custom action',
493
+ callback: (data) => customAction(data)
494
+ }
495
+ ];
496
+ </script>
497
+ ```
498
+
499
+ ### Disabled Actions
500
+
501
+ ```svelte
502
+ <script>
503
+ const mixedActions = [
504
+ {
505
+ icon: 'fas fa-edit',
506
+ hint: 'Edit (available)',
507
+ callback: (data) => editItem(data)
508
+ },
509
+ {
510
+ icon: 'fas fa-trash',
511
+ hint: 'Delete (not available)',
512
+ disabled: true,
513
+ callback: (data) => deleteItem(data)
514
+ }
515
+ ];
516
+ </script>
517
+ ```
518
+
519
+ ## Styling
520
+
521
+ The component uses the following CSS classes:
522
+
523
+ - `.uniface-card` - Main card container
524
+ - `.shadowBox` - Applied when variant="3d"
525
+ - `.card-header` - Header section container
526
+ - `.card-header.simple` - Simple header with title only
527
+ - `.card-content` - Main content area
528
+ - `.card-action-bar` - Action bar container
529
+ - `.card-action-bar.simple` - Built-in action bar
530
+ - `.action-item` - Individual action button
531
+ - `.action-item.disabled` - Disabled action styling
532
+
533
+ ### Example CSS
534
+
535
+ ```css
536
+ .uniface-card {
537
+ border: 1px solid #e5e7eb;
538
+ border-radius: 8px;
539
+ background: white;
540
+ overflow: hidden;
541
+ }
542
+
543
+ .uniface-card.shadowBox {
544
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
545
+ }
546
+
547
+ .card-header {
548
+ border-bottom: 1px solid #e5e7eb;
549
+ padding: 16px;
550
+ background: #f9fafb;
551
+ }
552
+
553
+ .card-content {
554
+ padding: 16px;
555
+ }
556
+
557
+ .card-action-bar {
558
+ border-top: 1px solid #e5e7eb;
559
+ padding: 8px 16px;
560
+ background: #f9fafb;
561
+ display: flex;
562
+ gap: 12px;
563
+ justify-content: flex-end;
564
+ }
565
+
566
+ .action-item {
567
+ cursor: pointer;
568
+ padding: 8px;
569
+ border-radius: 4px;
570
+ transition: background-color 0.2s;
571
+ }
572
+
573
+ .action-item:hover:not(.disabled) {
574
+ background: rgba(0, 0, 0, 0.05);
575
+ }
576
+
577
+ .action-item.disabled {
578
+ opacity: 0.5;
579
+ cursor: not-allowed;
580
+ }
581
+ ```
582
+
583
+ ## Best Practices
584
+
585
+ 1. **Consistent Data Structure**: Use consistent data objects for similar card types
586
+ 2. **Meaningful Actions**: Provide clear, actionable operations with descriptive hints
587
+ 3. **Appropriate Variants**: Use 3D variant sparingly for emphasis
588
+ 4. **Accessible Content**: Ensure content is readable and actions are clearly labeled
589
+ 5. **Responsive Design**: Consider how cards stack and resize on different screen sizes
590
+ 6. **Loading States**: Show loading indicators for dynamic content
591
+ 7. **Error Handling**: Handle action callback errors gracefully
592
+
593
+ ## Common Patterns
594
+
595
+ ### Card Grid
596
+
597
+ ```svelte
598
+ <div class="card-grid">
599
+ {#each items as item}
600
+ <Card title={item.title} actions={cardActions} data={item}>
601
+ <p>{item.description}</p>
602
+ </Card>
603
+ {/each}
604
+ </div>
605
+
606
+ <style>
607
+ .card-grid {
608
+ display: grid;
609
+ grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
610
+ gap: 16px;
611
+ padding: 16px;
612
+ }
613
+ </style>
614
+ ```
615
+
616
+ ### Card List
617
+
618
+ ```svelte
619
+ <div class="card-list">
620
+ {#each items as item}
621
+ <Card variant="plain" actions={listActions} data={item}>
622
+ <div class="list-item">
623
+ <h4>{item.title}</h4>
624
+ <p>{item.description}</p>
625
+ </div>
626
+ </Card>
627
+ {/each}
628
+ </div>
629
+ ```
630
+
631
+ ### Dashboard Layout
632
+
633
+ ```svelte
634
+ <div class="dashboard">
635
+ <div class="dashboard-row">
636
+ <Card title="Revenue" variant="3d">
637
+ <div class="metric">$45,230</div>
638
+ </Card>
639
+ <Card title="Users" variant="3d">
640
+ <div class="metric">1,234</div>
641
+ </Card>
642
+ </div>
643
+ </div>
644
+ ```
645
+
646
+ ## Accessibility
647
+
648
+ - Use semantic HTML within card content
649
+ - Provide meaningful action hints for screen readers
650
+ - Ensure sufficient color contrast
651
+ - Support keyboard navigation for actions
652
+ - Use appropriate heading levels in card content
653
+
654
+ ## Browser Support
655
+
656
+ The Card component works in all modern browsers that support:
657
+ - ES6+ JavaScript
658
+ - CSS Grid and Flexbox
659
+ - Modern DOM APIs
660
+
661
+ ## Performance
662
+
663
+ - Efficient action handling with built-in debouncing
664
+ - Minimal re-renders with proper key usage
665
+ - Lightweight DOM structure
666
+ - Optional lazy loading for card content