@mhmo91/schmancy 0.2.193 → 0.2.194
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/ai/area.md +125 -0
- package/ai/autocomplete.md +135 -0
- package/ai/avatar.md +178 -0
- package/ai/badge.md +100 -0
- package/ai/busy.md +195 -0
- package/ai/button.md +112 -0
- package/ai/card.md +155 -0
- package/ai/checkbox.md +108 -0
- package/ai/chips.md +180 -0
- package/ai/component-relationships.md +93 -0
- package/ai/dialog.md +109 -0
- package/ai/dropdown.md +238 -0
- package/ai/form.md +148 -0
- package/ai/icons.md +147 -0
- package/ai/index.md +71 -0
- package/ai/input.md +167 -0
- package/ai/layout.md +166 -0
- package/ai/list.md +145 -0
- package/ai/menu.md +217 -0
- package/ai/notification.md +93 -0
- package/ai/radio-group.md +176 -0
- package/ai/select.md +174 -0
- package/ai/sheet.md +122 -0
- package/ai/store.md +235 -0
- package/ai/surface.md +221 -0
- package/ai/table.md +236 -0
- package/ai/tabs.md +71 -0
- package/ai/template.md +144 -0
- package/ai/textarea.md +147 -0
- package/ai/tooltip.md +149 -0
- package/ai/tree.md +279 -0
- package/ai/typography.md +170 -0
- package/dist/ai/area.md +125 -0
- package/dist/ai/autocomplete.md +135 -0
- package/dist/ai/avatar.md +178 -0
- package/dist/ai/badge.md +100 -0
- package/dist/ai/busy.md +195 -0
- package/dist/ai/button.md +112 -0
- package/dist/ai/card.md +155 -0
- package/dist/ai/checkbox.md +108 -0
- package/dist/ai/chips.md +180 -0
- package/dist/ai/component-relationships.md +93 -0
- package/dist/ai/dialog.md +109 -0
- package/dist/ai/dropdown.md +238 -0
- package/dist/ai/form.md +148 -0
- package/dist/ai/icons.md +147 -0
- package/dist/ai/index.md +71 -0
- package/dist/ai/input.md +167 -0
- package/dist/ai/layout.md +166 -0
- package/dist/ai/list.md +145 -0
- package/dist/ai/menu.md +217 -0
- package/dist/ai/notification.md +93 -0
- package/dist/ai/radio-group.md +176 -0
- package/dist/ai/select.md +174 -0
- package/dist/ai/sheet.md +122 -0
- package/dist/ai/store.md +235 -0
- package/dist/ai/surface.md +221 -0
- package/dist/ai/table.md +236 -0
- package/dist/ai/tabs.md +71 -0
- package/dist/ai/template.md +144 -0
- package/dist/ai/textarea.md +147 -0
- package/dist/ai/tooltip.md +149 -0
- package/dist/ai/tree.md +279 -0
- package/dist/ai/typography.md +170 -0
- package/dist/area.cjs +1 -1
- package/dist/area.component-CzFJM7Y4.js +143 -0
- package/dist/area.component-CzFJM7Y4.js.map +1 -0
- package/dist/area.component-WxccFh1z.cjs +8 -0
- package/dist/area.component-WxccFh1z.cjs.map +1 -0
- package/dist/area.js +1 -1
- package/dist/{avatar-s-2jSsaH.cjs → avatar-Bmg5TXj9.cjs} +2 -2
- package/dist/{avatar-s-2jSsaH.cjs.map → avatar-Bmg5TXj9.cjs.map} +1 -1
- package/dist/{avatar-WAIlaNJg.js → avatar-CgP1tBZq.js} +2 -2
- package/dist/{avatar-WAIlaNJg.js.map → avatar-CgP1tBZq.js.map} +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/package.json +2 -1
- package/types/src/area/area.service.d.ts +53 -4
- package/types/src/area/router.types.d.ts +41 -2
- package/dist/area.component-CZELEuMj.js +0 -107
- package/dist/area.component-CZELEuMj.js.map +0 -1
- package/dist/area.component-grRkXEse.cjs +0 -8
- package/dist/area.component-grRkXEse.cjs.map +0 -1
package/ai/surface.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Schmancy Surface - AI Reference
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
// Basic Surface
|
|
5
|
+
<schmancy-surface
|
|
6
|
+
elevation="0|1|2|3|4|5"
|
|
7
|
+
rounded="none|sm|md|lg|xl|full"
|
|
8
|
+
padding="none|xs|sm|md|lg|xl">
|
|
9
|
+
Surface content goes here
|
|
10
|
+
</schmancy-surface>
|
|
11
|
+
|
|
12
|
+
// Surface with color
|
|
13
|
+
<schmancy-surface
|
|
14
|
+
color="primary|secondary|tertiary|surface|background|error"
|
|
15
|
+
theme="light|dark">
|
|
16
|
+
Colored surface content
|
|
17
|
+
</schmancy-surface>
|
|
18
|
+
|
|
19
|
+
// Interactive surface
|
|
20
|
+
<schmancy-surface
|
|
21
|
+
interactive
|
|
22
|
+
@click=${handleClick}>
|
|
23
|
+
Click me!
|
|
24
|
+
</schmancy-surface>
|
|
25
|
+
|
|
26
|
+
// Surface with border
|
|
27
|
+
<schmancy-surface
|
|
28
|
+
bordered
|
|
29
|
+
border-color="primary|secondary|tertiary|divider|error"
|
|
30
|
+
border-width="thin|medium|thick"
|
|
31
|
+
border-style="solid|dashed|dotted">
|
|
32
|
+
Surface with border
|
|
33
|
+
</schmancy-surface>
|
|
34
|
+
|
|
35
|
+
// Surface with dimensions
|
|
36
|
+
<schmancy-surface
|
|
37
|
+
width="300px"
|
|
38
|
+
height="200px"
|
|
39
|
+
min-width="200px"
|
|
40
|
+
max-width="500px"
|
|
41
|
+
min-height="100px"
|
|
42
|
+
max-height="300px">
|
|
43
|
+
Fixed size surface
|
|
44
|
+
</schmancy-surface>
|
|
45
|
+
|
|
46
|
+
// Surface Properties
|
|
47
|
+
elevation: number|string // Shadow elevation (0-5)
|
|
48
|
+
rounded: string // Border radius: "none", "sm", "md", "lg", "xl", "full"
|
|
49
|
+
padding: string // Padding: "none", "xs", "sm", "md", "lg", "xl"
|
|
50
|
+
margin: string // Margin: "none", "xs", "sm", "md", "lg", "xl"
|
|
51
|
+
color: string // Background color (theme color or CSS value)
|
|
52
|
+
theme: string // Theme: "light", "dark"
|
|
53
|
+
interactive: boolean // Enable hover and active states
|
|
54
|
+
bordered: boolean // Show border
|
|
55
|
+
borderColor: string // Border color
|
|
56
|
+
borderWidth: string // Border width: "thin", "medium", "thick"
|
|
57
|
+
borderStyle: string // Border style: "solid", "dashed", "dotted"
|
|
58
|
+
width: string // Width
|
|
59
|
+
height: string // Height
|
|
60
|
+
minWidth: string // Minimum width
|
|
61
|
+
maxWidth: string // Maximum width
|
|
62
|
+
minHeight: string // Minimum height
|
|
63
|
+
maxHeight: string // Maximum height
|
|
64
|
+
fullWidth: boolean // Take full width of parent
|
|
65
|
+
fullHeight: boolean // Take full height of parent
|
|
66
|
+
|
|
67
|
+
// Surface Context
|
|
68
|
+
// For theme-aware surfaces and consistent styling
|
|
69
|
+
import { SurfaceContext } from 'schmancy/surface';
|
|
70
|
+
|
|
71
|
+
const surfaceContext = new SurfaceContext({
|
|
72
|
+
elevation: 1,
|
|
73
|
+
rounded: 'md',
|
|
74
|
+
padding: 'md',
|
|
75
|
+
theme: 'light'
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
// Examples
|
|
79
|
+
// Basic card-like surface
|
|
80
|
+
<schmancy-surface
|
|
81
|
+
elevation="2"
|
|
82
|
+
rounded="lg"
|
|
83
|
+
padding="lg">
|
|
84
|
+
<h3>Card Title</h3>
|
|
85
|
+
<p>This is a basic card surface with elevation, rounded corners, and padding.</p>
|
|
86
|
+
</schmancy-surface>
|
|
87
|
+
|
|
88
|
+
// Interactive card
|
|
89
|
+
<schmancy-surface
|
|
90
|
+
elevation="1"
|
|
91
|
+
rounded="md"
|
|
92
|
+
padding="md"
|
|
93
|
+
interactive
|
|
94
|
+
@click=${navigateToDetails}>
|
|
95
|
+
<div style="display: flex; align-items: center; gap: 16px;">
|
|
96
|
+
<schmancy-avatar
|
|
97
|
+
src="path/to/avatar.jpg"
|
|
98
|
+
size="large">
|
|
99
|
+
</schmancy-avatar>
|
|
100
|
+
|
|
101
|
+
<div>
|
|
102
|
+
<h3>John Doe</h3>
|
|
103
|
+
<p>Software Engineer</p>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<schmancy-icon
|
|
107
|
+
icon="chevron-right"
|
|
108
|
+
style="margin-left: auto;">
|
|
109
|
+
</schmancy-icon>
|
|
110
|
+
</div>
|
|
111
|
+
</schmancy-surface>
|
|
112
|
+
|
|
113
|
+
// Alert surfaces
|
|
114
|
+
<schmancy-surface
|
|
115
|
+
color="primary"
|
|
116
|
+
rounded="md"
|
|
117
|
+
padding="md"
|
|
118
|
+
bordered
|
|
119
|
+
border-color="primary"
|
|
120
|
+
style="--surface-color-opacity: 0.1;">
|
|
121
|
+
<div style="display: flex; align-items: center; gap: 16px;">
|
|
122
|
+
<schmancy-icon icon="info" color="primary"></schmancy-icon>
|
|
123
|
+
<div>
|
|
124
|
+
<h4>Information</h4>
|
|
125
|
+
<p>This is an informational message.</p>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</schmancy-surface>
|
|
129
|
+
|
|
130
|
+
<schmancy-surface
|
|
131
|
+
color="error"
|
|
132
|
+
rounded="md"
|
|
133
|
+
padding="md"
|
|
134
|
+
bordered
|
|
135
|
+
border-color="error"
|
|
136
|
+
style="--surface-color-opacity: 0.1;">
|
|
137
|
+
<div style="display: flex; align-items: center; gap: 16px;">
|
|
138
|
+
<schmancy-icon icon="alert-triangle" color="error"></schmancy-icon>
|
|
139
|
+
<div>
|
|
140
|
+
<h4>Error</h4>
|
|
141
|
+
<p>Something went wrong. Please try again.</p>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</schmancy-surface>
|
|
145
|
+
|
|
146
|
+
// Surface grid layout
|
|
147
|
+
<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;">
|
|
148
|
+
<schmancy-surface
|
|
149
|
+
elevation="1"
|
|
150
|
+
rounded="md"
|
|
151
|
+
padding="md">
|
|
152
|
+
<h3>Card 1</h3>
|
|
153
|
+
<p>Content for card 1.</p>
|
|
154
|
+
</schmancy-surface>
|
|
155
|
+
|
|
156
|
+
<schmancy-surface
|
|
157
|
+
elevation="1"
|
|
158
|
+
rounded="md"
|
|
159
|
+
padding="md">
|
|
160
|
+
<h3>Card 2</h3>
|
|
161
|
+
<p>Content for card 2.</p>
|
|
162
|
+
</schmancy-surface>
|
|
163
|
+
|
|
164
|
+
<schmancy-surface
|
|
165
|
+
elevation="1"
|
|
166
|
+
rounded="md"
|
|
167
|
+
padding="md">
|
|
168
|
+
<h3>Card 3</h3>
|
|
169
|
+
<p>Content for card 3.</p>
|
|
170
|
+
</schmancy-surface>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
// Dashboard panel
|
|
174
|
+
<schmancy-surface
|
|
175
|
+
elevation="2"
|
|
176
|
+
rounded="lg"
|
|
177
|
+
padding="lg"
|
|
178
|
+
height="300px">
|
|
179
|
+
<div style="display: flex; flex-direction: column; height: 100%;">
|
|
180
|
+
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;">
|
|
181
|
+
<h3>Sales Overview</h3>
|
|
182
|
+
<schmancy-dropdown>
|
|
183
|
+
<schmancy-button slot="trigger" variant="tertiary" size="small">
|
|
184
|
+
<span>This Week</span>
|
|
185
|
+
<schmancy-icon slot="suffix" icon="chevron-down"></schmancy-icon>
|
|
186
|
+
</schmancy-button>
|
|
187
|
+
|
|
188
|
+
<schmancy-menu slot="content">
|
|
189
|
+
<schmancy-menu-item value="day">Today</schmancy-menu-item>
|
|
190
|
+
<schmancy-menu-item value="week">This Week</schmancy-menu-item>
|
|
191
|
+
<schmancy-menu-item value="month">This Month</schmancy-menu-item>
|
|
192
|
+
<schmancy-menu-item value="year">This Year</schmancy-menu-item>
|
|
193
|
+
</schmancy-menu>
|
|
194
|
+
</schmancy-dropdown>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<div style="flex: 1; display: flex; align-items: center; justify-content: center;">
|
|
198
|
+
<!-- Chart or content would go here -->
|
|
199
|
+
<p>Chart placeholder</p>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</schmancy-surface>
|
|
203
|
+
|
|
204
|
+
// Using surface context
|
|
205
|
+
<div .context=${surfaceContext}>
|
|
206
|
+
<schmancy-surface>
|
|
207
|
+
<h3>First Panel</h3>
|
|
208
|
+
<p>This surface inherits settings from the context.</p>
|
|
209
|
+
</schmancy-surface>
|
|
210
|
+
|
|
211
|
+
<schmancy-surface>
|
|
212
|
+
<h3>Second Panel</h3>
|
|
213
|
+
<p>This surface also inherits settings from the context.</p>
|
|
214
|
+
</schmancy-surface>
|
|
215
|
+
|
|
216
|
+
<schmancy-surface elevation="3" rounded="xl">
|
|
217
|
+
<h3>Custom Panel</h3>
|
|
218
|
+
<p>This surface overrides some context settings.</p>
|
|
219
|
+
</schmancy-surface>
|
|
220
|
+
</div>
|
|
221
|
+
```
|
package/ai/table.md
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Schmancy Table - AI Reference
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
// Basic Table
|
|
5
|
+
<schmancy-table>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>Name</th>
|
|
9
|
+
<th>Email</th>
|
|
10
|
+
<th>Role</th>
|
|
11
|
+
</tr>
|
|
12
|
+
</thead>
|
|
13
|
+
<tbody>
|
|
14
|
+
<tr>
|
|
15
|
+
<td>John Doe</td>
|
|
16
|
+
<td>john@example.com</td>
|
|
17
|
+
<td>Admin</td>
|
|
18
|
+
</tr>
|
|
19
|
+
<tr>
|
|
20
|
+
<td>Jane Smith</td>
|
|
21
|
+
<td>jane@example.com</td>
|
|
22
|
+
<td>User</td>
|
|
23
|
+
</tr>
|
|
24
|
+
</tbody>
|
|
25
|
+
</schmancy-table>
|
|
26
|
+
|
|
27
|
+
// Table with custom row component
|
|
28
|
+
<schmancy-table>
|
|
29
|
+
<thead>
|
|
30
|
+
<tr>
|
|
31
|
+
<th>Name</th>
|
|
32
|
+
<th>Email</th>
|
|
33
|
+
<th>Role</th>
|
|
34
|
+
<th>Actions</th>
|
|
35
|
+
</tr>
|
|
36
|
+
</thead>
|
|
37
|
+
<tbody>
|
|
38
|
+
<schmancy-row
|
|
39
|
+
.data=${{ name: 'John Doe', email: 'john@example.com', role: 'Admin' }}
|
|
40
|
+
@click=${handleRowClick}>
|
|
41
|
+
<td>${data.name}</td>
|
|
42
|
+
<td>${data.email}</td>
|
|
43
|
+
<td>${data.role}</td>
|
|
44
|
+
<td>
|
|
45
|
+
<schmancy-button kind="tertiary" size="small">Edit</schmancy-button>
|
|
46
|
+
<schmancy-button kind="danger" size="small">Delete</schmancy-button>
|
|
47
|
+
</td>
|
|
48
|
+
</schmancy-row>
|
|
49
|
+
<!-- More rows -->
|
|
50
|
+
</tbody>
|
|
51
|
+
</schmancy-table>
|
|
52
|
+
|
|
53
|
+
// Table Properties
|
|
54
|
+
striped: boolean // Apply alternating row colors
|
|
55
|
+
bordered: boolean // Add borders to cells
|
|
56
|
+
compact: boolean // Reduce cell padding
|
|
57
|
+
hover: boolean // Highlight rows on hover
|
|
58
|
+
responsive: boolean // Make table horizontally scrollable on small screens
|
|
59
|
+
sortable: boolean // Enable column sorting
|
|
60
|
+
selectable: boolean // Enable row selection
|
|
61
|
+
loading: boolean // Show loading state
|
|
62
|
+
|
|
63
|
+
// Row Properties
|
|
64
|
+
selected: boolean // Whether the row is selected
|
|
65
|
+
data: object // Data object for the row
|
|
66
|
+
|
|
67
|
+
// Table Events
|
|
68
|
+
@sort // Fires when a sortable column is clicked, with { detail: { column, direction } }
|
|
69
|
+
@selection // Fires when row selection changes, with { detail: { selected } }
|
|
70
|
+
|
|
71
|
+
// Examples
|
|
72
|
+
// Basic responsive table
|
|
73
|
+
<schmancy-table
|
|
74
|
+
responsive
|
|
75
|
+
striped
|
|
76
|
+
hover>
|
|
77
|
+
<thead>
|
|
78
|
+
<tr>
|
|
79
|
+
<th>ID</th>
|
|
80
|
+
<th>Name</th>
|
|
81
|
+
<th>Email</th>
|
|
82
|
+
<th>Created</th>
|
|
83
|
+
<th>Status</th>
|
|
84
|
+
</tr>
|
|
85
|
+
</thead>
|
|
86
|
+
<tbody>
|
|
87
|
+
<tr>
|
|
88
|
+
<td>1</td>
|
|
89
|
+
<td>John Doe</td>
|
|
90
|
+
<td>john@example.com</td>
|
|
91
|
+
<td>2023-04-12</td>
|
|
92
|
+
<td>
|
|
93
|
+
<schmancy-badge variant="success">Active</schmancy-badge>
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
96
|
+
<tr>
|
|
97
|
+
<td>2</td>
|
|
98
|
+
<td>Jane Smith</td>
|
|
99
|
+
<td>jane@example.com</td>
|
|
100
|
+
<td>2023-04-15</td>
|
|
101
|
+
<td>
|
|
102
|
+
<schmancy-badge variant="warning">Pending</schmancy-badge>
|
|
103
|
+
</td>
|
|
104
|
+
</tr>
|
|
105
|
+
</tbody>
|
|
106
|
+
</schmancy-table>
|
|
107
|
+
|
|
108
|
+
// Sortable table
|
|
109
|
+
<schmancy-table
|
|
110
|
+
sortable
|
|
111
|
+
@sort=${(e) => sortData(e.detail.column, e.detail.direction)}>
|
|
112
|
+
<thead>
|
|
113
|
+
<tr>
|
|
114
|
+
<th data-sort="id">ID</th>
|
|
115
|
+
<th data-sort="name">Name</th>
|
|
116
|
+
<th data-sort="email">Email</th>
|
|
117
|
+
<th data-sort="created">Created</th>
|
|
118
|
+
<th>Actions</th>
|
|
119
|
+
</tr>
|
|
120
|
+
</thead>
|
|
121
|
+
<tbody>
|
|
122
|
+
${sortedData.map(item => html`
|
|
123
|
+
<tr>
|
|
124
|
+
<td>${item.id}</td>
|
|
125
|
+
<td>${item.name}</td>
|
|
126
|
+
<td>${item.email}</td>
|
|
127
|
+
<td>${formatDate(item.created)}</td>
|
|
128
|
+
<td>
|
|
129
|
+
<schmancy-icon-button
|
|
130
|
+
icon="edit"
|
|
131
|
+
variant="tertiary"
|
|
132
|
+
@click=${() => editItem(item)}>
|
|
133
|
+
</schmancy-icon-button>
|
|
134
|
+
<schmancy-icon-button
|
|
135
|
+
icon="delete"
|
|
136
|
+
variant="danger"
|
|
137
|
+
@click=${() => deleteItem(item)}>
|
|
138
|
+
</schmancy-icon-button>
|
|
139
|
+
</td>
|
|
140
|
+
</tr>
|
|
141
|
+
`)}
|
|
142
|
+
</tbody>
|
|
143
|
+
</schmancy-table>
|
|
144
|
+
|
|
145
|
+
// Selectable table
|
|
146
|
+
<schmancy-table
|
|
147
|
+
selectable
|
|
148
|
+
@selection=${(e) => handleSelectedRows(e.detail.selected)}>
|
|
149
|
+
<thead>
|
|
150
|
+
<tr>
|
|
151
|
+
<th>
|
|
152
|
+
<schmancy-checkbox
|
|
153
|
+
.checked=${allSelected}
|
|
154
|
+
.indeterminate=${someSelected && !allSelected}
|
|
155
|
+
@change=${toggleAllSelection}>
|
|
156
|
+
</schmancy-checkbox>
|
|
157
|
+
</th>
|
|
158
|
+
<th>Name</th>
|
|
159
|
+
<th>Email</th>
|
|
160
|
+
<th>Role</th>
|
|
161
|
+
</tr>
|
|
162
|
+
</thead>
|
|
163
|
+
<tbody>
|
|
164
|
+
${data.map(item => html`
|
|
165
|
+
<schmancy-row
|
|
166
|
+
.data=${item}
|
|
167
|
+
.selected=${selectedRows.includes(item.id)}>
|
|
168
|
+
<td>
|
|
169
|
+
<schmancy-checkbox
|
|
170
|
+
.checked=${selectedRows.includes(item.id)}
|
|
171
|
+
@change=${(e) => toggleRowSelection(item.id, e.target.checked)}>
|
|
172
|
+
</schmancy-checkbox>
|
|
173
|
+
</td>
|
|
174
|
+
<td>${item.name}</td>
|
|
175
|
+
<td>${item.email}</td>
|
|
176
|
+
<td>${item.role}</td>
|
|
177
|
+
</schmancy-row>
|
|
178
|
+
`)}
|
|
179
|
+
</tbody>
|
|
180
|
+
</schmancy-table>
|
|
181
|
+
|
|
182
|
+
// Loading state
|
|
183
|
+
<schmancy-table loading>
|
|
184
|
+
<thead>
|
|
185
|
+
<tr>
|
|
186
|
+
<th>Name</th>
|
|
187
|
+
<th>Email</th>
|
|
188
|
+
<th>Role</th>
|
|
189
|
+
</tr>
|
|
190
|
+
</thead>
|
|
191
|
+
<tbody>
|
|
192
|
+
<!-- Content will be dimmed and a loading indicator shown -->
|
|
193
|
+
</tbody>
|
|
194
|
+
</schmancy-table>
|
|
195
|
+
|
|
196
|
+
// Pagination (with external component)
|
|
197
|
+
<div>
|
|
198
|
+
<schmancy-table>
|
|
199
|
+
<!-- Table content -->
|
|
200
|
+
</schmancy-table>
|
|
201
|
+
|
|
202
|
+
<div style="display: flex; justify-content: space-between; margin-top: 16px;">
|
|
203
|
+
<div>
|
|
204
|
+
Showing ${startIndex + 1} to ${Math.min(endIndex, totalItems)} of ${totalItems} items
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<div>
|
|
208
|
+
<schmancy-button
|
|
209
|
+
variant="tertiary"
|
|
210
|
+
size="small"
|
|
211
|
+
?disabled=${page === 1}
|
|
212
|
+
@click=${() => setPage(page - 1)}>
|
|
213
|
+
Previous
|
|
214
|
+
</schmancy-button>
|
|
215
|
+
|
|
216
|
+
<!-- Page numbers -->
|
|
217
|
+
${generatePageNumbers(page, totalPages).map(p => html`
|
|
218
|
+
<schmancy-button
|
|
219
|
+
variant=${p === page ? "primary" : "tertiary"}
|
|
220
|
+
size="small"
|
|
221
|
+
@click=${() => setPage(p)}>
|
|
222
|
+
${p}
|
|
223
|
+
</schmancy-button>
|
|
224
|
+
`)}
|
|
225
|
+
|
|
226
|
+
<schmancy-button
|
|
227
|
+
variant="tertiary"
|
|
228
|
+
size="small"
|
|
229
|
+
?disabled=${page === totalPages}
|
|
230
|
+
@click=${() => setPage(page + 1)}>
|
|
231
|
+
Next
|
|
232
|
+
</schmancy-button>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
```
|
package/ai/tabs.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Schmancy Tabs - AI Reference
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
// Basic Tabs
|
|
5
|
+
<schmancy-tabs value="tab1">
|
|
6
|
+
<schmancy-tab value="tab1" label="Tab 1"></schmancy-tab>
|
|
7
|
+
<schmancy-tab value="tab2" label="Tab 2"></schmancy-tab>
|
|
8
|
+
<schmancy-tab value="tab3" label="Tab 3"></schmancy-tab>
|
|
9
|
+
|
|
10
|
+
<div slot="panel" data-tab="tab1">Content for Tab 1</div>
|
|
11
|
+
<div slot="panel" data-tab="tab2">Content for Tab 2</div>
|
|
12
|
+
<div slot="panel" data-tab="tab3">Content for Tab 3</div>
|
|
13
|
+
</schmancy-tabs>
|
|
14
|
+
|
|
15
|
+
// Tabs with Scrolling
|
|
16
|
+
<schmancy-tabs value="tab1" scrollable>
|
|
17
|
+
<!-- Tab definitions -->
|
|
18
|
+
</schmancy-tabs>
|
|
19
|
+
|
|
20
|
+
// Tabs Groups (for complex tab structures)
|
|
21
|
+
<schmancy-tabs-group value="tab1" @change=${handleTabChange}>
|
|
22
|
+
<schmancy-tab value="tab1" label="Tab 1"></schmancy-tab>
|
|
23
|
+
<schmancy-tab value="tab2" label="Tab 2"></schmancy-tab>
|
|
24
|
+
<schmancy-tab value="tab3" label="Tab 3"></schmancy-tab>
|
|
25
|
+
|
|
26
|
+
<div data-tab="tab1">Content for Tab 1</div>
|
|
27
|
+
<div data-tab="tab2">Content for Tab 2</div>
|
|
28
|
+
<div data-tab="tab3">Content for Tab 3</div>
|
|
29
|
+
</schmancy-tabs-group>
|
|
30
|
+
|
|
31
|
+
// Tabs with Icons
|
|
32
|
+
<schmancy-tabs value="tab1">
|
|
33
|
+
<schmancy-tab value="tab1">
|
|
34
|
+
<schmancy-icon icon="home"></schmancy-icon>
|
|
35
|
+
<span>Home</span>
|
|
36
|
+
</schmancy-tab>
|
|
37
|
+
<schmancy-tab value="tab2">
|
|
38
|
+
<schmancy-icon icon="settings"></schmancy-icon>
|
|
39
|
+
<span>Settings</span>
|
|
40
|
+
</schmancy-tab>
|
|
41
|
+
</schmancy-tabs>
|
|
42
|
+
|
|
43
|
+
// Tab Attributes
|
|
44
|
+
value="tab-id" // Unique identifier for the tab
|
|
45
|
+
label="Tab Label" // Text label (optional if using custom content)
|
|
46
|
+
disabled? // Disabled state
|
|
47
|
+
icon="icon-name" // Icon to display (alternative to using schmancy-icon in content)
|
|
48
|
+
|
|
49
|
+
// Tab Methods and Events
|
|
50
|
+
tabs.select(value) -> void // Programmatically select a tab
|
|
51
|
+
@change // Fires when tab selection changes with { detail: { value } }
|
|
52
|
+
|
|
53
|
+
// Examples
|
|
54
|
+
// Basic usage
|
|
55
|
+
<schmancy-tabs value="tab1" @change=${(e) => console.log('Selected tab:', e.detail.value)}>
|
|
56
|
+
<schmancy-tab value="tab1" label="Info"></schmancy-tab>
|
|
57
|
+
<schmancy-tab value="tab2" label="Settings"></schmancy-tab>
|
|
58
|
+
|
|
59
|
+
<div slot="panel" data-tab="tab1">Information content here</div>
|
|
60
|
+
<div slot="panel" data-tab="tab2">Settings content here</div>
|
|
61
|
+
</schmancy-tabs>
|
|
62
|
+
|
|
63
|
+
// Dynamic tabs from data
|
|
64
|
+
${tabData.map(tab => html`
|
|
65
|
+
<schmancy-tab value=${tab.id} label=${tab.label}></schmancy-tab>
|
|
66
|
+
`)}
|
|
67
|
+
|
|
68
|
+
${tabData.map(tab => html`
|
|
69
|
+
<div slot="panel" data-tab=${tab.id}>${tab.content}</div>
|
|
70
|
+
`)}
|
|
71
|
+
```
|
package/ai/template.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Schmancy AI Documentation Guidelines
|
|
2
|
+
|
|
3
|
+
This document provides a template and guidelines for creating consistent AI-friendly documentation for Schmancy components.
|
|
4
|
+
|
|
5
|
+
## Documentation Format
|
|
6
|
+
|
|
7
|
+
Each component's documentation should follow this structure:
|
|
8
|
+
|
|
9
|
+
1. **Component Title**: `# Schmancy [Component] - AI Reference`
|
|
10
|
+
2. **Code Block**: Main syntax reference with component usage patterns
|
|
11
|
+
3. **Related Components**: List of related components with links and relationship descriptions
|
|
12
|
+
4. **Technical Details**: Interfaces, types, CSS custom properties, etc.
|
|
13
|
+
5. **Common Use Cases**: Practical examples with explanations
|
|
14
|
+
|
|
15
|
+
## Code Block Template
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
// Component Tag
|
|
19
|
+
<schmancy-[component]
|
|
20
|
+
[primary-attribute]="value"
|
|
21
|
+
[boolean-attribute]?
|
|
22
|
+
@[event-name]=${handler}>
|
|
23
|
+
<!-- Content/children if applicable -->
|
|
24
|
+
</schmancy-[component]>
|
|
25
|
+
|
|
26
|
+
// Component Variations (if applicable)
|
|
27
|
+
<schmancy-[component]
|
|
28
|
+
variant="[variant]"
|
|
29
|
+
size="small|medium|large">
|
|
30
|
+
</schmancy-[component]>
|
|
31
|
+
|
|
32
|
+
// Component Methods
|
|
33
|
+
component.method() -> returnType
|
|
34
|
+
component.property = value
|
|
35
|
+
|
|
36
|
+
// Event details
|
|
37
|
+
@event-name // { detail: { relevantData } }
|
|
38
|
+
|
|
39
|
+
// Examples (always number examples for clarity)
|
|
40
|
+
// 1. Basic example
|
|
41
|
+
<schmancy-[component] [primary-attribute]="value">
|
|
42
|
+
Content
|
|
43
|
+
</schmancy-[component]>
|
|
44
|
+
|
|
45
|
+
// 2. Advanced example
|
|
46
|
+
<schmancy-[component]
|
|
47
|
+
[attribute]="value"
|
|
48
|
+
@[event]=${() => handleEvent()}>
|
|
49
|
+
<!-- Structured content -->
|
|
50
|
+
</schmancy-[component]>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Related Components Section
|
|
54
|
+
|
|
55
|
+
Always include a "Related Components" section that links to other relevant components:
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
## Related Components
|
|
59
|
+
- **[Related-1](./related-1.md)**: Brief description of relationship
|
|
60
|
+
- **[Related-2](./related-2.md)**: Brief description of relationship
|
|
61
|
+
- **[Related-3](./related-3.md)**: Brief description of relationship
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Technical Details Section
|
|
65
|
+
|
|
66
|
+
Include relevant technical information:
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
## Technical Details
|
|
70
|
+
|
|
71
|
+
### Interfaces
|
|
72
|
+
```typescript
|
|
73
|
+
interface ComponentProps {
|
|
74
|
+
property: type;
|
|
75
|
+
optionalProperty?: type;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### CSS Custom Properties (if applicable)
|
|
80
|
+
```css
|
|
81
|
+
--schmancy-component-color: /* Controls the component color */
|
|
82
|
+
--schmancy-component-spacing: /* Controls internal spacing */
|
|
83
|
+
```
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Common Use Cases Section
|
|
87
|
+
|
|
88
|
+
Provide 2-4 practical use cases with code examples:
|
|
89
|
+
|
|
90
|
+
```markdown
|
|
91
|
+
### Common Use Cases
|
|
92
|
+
|
|
93
|
+
1. **Use Case 1**: Brief description
|
|
94
|
+
```html
|
|
95
|
+
<schmancy-[component] specific-attribute="value"></schmancy-[component]>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
2. **Use Case 2**: Brief description
|
|
99
|
+
```html
|
|
100
|
+
<schmancy-[component] with="specific-configuration"></schmancy-[component]>
|
|
101
|
+
```
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Style Guide
|
|
105
|
+
|
|
106
|
+
1. **Code Examples**:
|
|
107
|
+
- Number all examples sequentially (e.g., `// 1. Basic example`)
|
|
108
|
+
- Include descriptive comments
|
|
109
|
+
- Ensure examples are realistic and complete
|
|
110
|
+
|
|
111
|
+
2. **Component Descriptions**:
|
|
112
|
+
- Focus on functionality and API usage
|
|
113
|
+
- Avoid marketing language
|
|
114
|
+
- Provide context for when and why to use the component
|
|
115
|
+
|
|
116
|
+
3. **Cross-Referencing**:
|
|
117
|
+
- Always link to related components
|
|
118
|
+
- Explain the relationship (e.g., "Used within", "Alternative to", "Extends")
|
|
119
|
+
|
|
120
|
+
4. **Formatting**:
|
|
121
|
+
- Use backticks for inline code references
|
|
122
|
+
- Use proper markdown headers for sections
|
|
123
|
+
- Use TypeScript for type definitions
|
|
124
|
+
|
|
125
|
+
## Component Categories
|
|
126
|
+
|
|
127
|
+
Organize components according to these categories for better cross-referencing:
|
|
128
|
+
|
|
129
|
+
1. **Core Infrastructure**: Area, Store, Teleport, RxJS Utils
|
|
130
|
+
2. **Layout Components**: Layout, Surface, Card, Divider
|
|
131
|
+
3. **Navigation & Structure**: Tabs, Menu, Nav-Drawer, Content-Drawer, Sheet, Dialog
|
|
132
|
+
4. **Form Controls**: Form, Input, Textarea, Select, Autocomplete, Checkbox, Radio-Group, Option
|
|
133
|
+
5. **Interactive Elements**: Button, Dropdown, Chips, List, Tree, Table
|
|
134
|
+
6. **Feedback & Status**: Notification, Tooltip, Badge, Busy, Avatar
|
|
135
|
+
7. **Typography & Visual**: Typography, Icons, Animated-Text, Typewriter
|
|
136
|
+
8. **Utilities**: Directives, Theme, Theme-Button, Utils, Types, Delay, Date-Range, Steps
|
|
137
|
+
|
|
138
|
+
## Examples
|
|
139
|
+
|
|
140
|
+
See these files for examples of well-formatted component documentation:
|
|
141
|
+
- [area.md](./area.md): Complex service component
|
|
142
|
+
- [form.md](./form.md): Container component
|
|
143
|
+
- [input.md](./input.md): Form field component
|
|
144
|
+
- [store.md](./store.md): State management
|