@rcarls/rc-card 0.4.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.
- package/README.md +14 -0
- package/dist/custom-elements.json +572 -0
- package/dist/rc-card-DeNYLO0D.js +256 -0
- package/dist/rc-card-DeNYLO0D.js.map +1 -0
- package/dist/rc-card-define.js +6 -0
- package/dist/rc-card-define.js.map +1 -0
- package/dist/rc-card.js +5 -0
- package/dist/rc-card.js.map +1 -0
- package/dist/types/packages/rc-card/src/define.d.ts +1 -0
- package/dist/types/packages/rc-card/src/index.d.ts +1 -0
- package/dist/types/packages/rc-card/src/rc-card.d.ts +113 -0
- package/dist/types/packages/rc-card/src/rc-card.styles.d.ts +2 -0
- package/dist/types/packages/rc-card/src/rc-card.test.d.ts +0 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @rcarls/rc-card
|
|
2
|
+
|
|
3
|
+
Design-system-neutral card shell with structural slots and parts.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<rc-card interactive action-target="recipe-link">
|
|
7
|
+
<img slot="media" src="recipe.jpg" alt="" />
|
|
8
|
+
<a id="recipe-link" slot="title" href="/recipes/pie">Apple pie</a>
|
|
9
|
+
<p>Flaky crust, bright apples.</p>
|
|
10
|
+
</rc-card>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The host owns structure and layout, including one `rem` of default body padding.
|
|
14
|
+
Authors provide native anchors or buttons for semantics and keyboard access.
|
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/define.ts",
|
|
8
|
+
"declarations": [],
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "custom-element-definition",
|
|
12
|
+
"name": "rc-card",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "RCCard",
|
|
15
|
+
"module": "/src/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "*",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "*",
|
|
23
|
+
"module": "src/index.js"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"kind": "javascript-module",
|
|
30
|
+
"path": "src/index.ts",
|
|
31
|
+
"declarations": [],
|
|
32
|
+
"exports": [
|
|
33
|
+
{
|
|
34
|
+
"kind": "js",
|
|
35
|
+
"name": "*",
|
|
36
|
+
"declaration": {
|
|
37
|
+
"name": "*",
|
|
38
|
+
"module": "src/rc-card.js"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"kind": "javascript-module",
|
|
45
|
+
"path": "src/rc-card.ts",
|
|
46
|
+
"declarations": [
|
|
47
|
+
{
|
|
48
|
+
"kind": "class",
|
|
49
|
+
"description": "Design-system-neutral card shell with first-class structural parts and\noptional pointer delegation to an author-provided anchor or button.",
|
|
50
|
+
"name": "RCCard",
|
|
51
|
+
"cssProperties": [
|
|
52
|
+
{
|
|
53
|
+
"description": "Grid template rows for the host's structural regions.",
|
|
54
|
+
"name": "--rc-card-grid-template-rows",
|
|
55
|
+
"default": "auto auto auto 1fr auto auto"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"description": "Card border.",
|
|
59
|
+
"name": "--rc-card-border",
|
|
60
|
+
"default": "0"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"description": "Card border radius.",
|
|
64
|
+
"name": "--rc-card-radius",
|
|
65
|
+
"default": "0"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"description": "Card background.",
|
|
69
|
+
"name": "--rc-card-bg",
|
|
70
|
+
"default": "Canvas"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"description": "Card text color.",
|
|
74
|
+
"name": "--rc-card-color",
|
|
75
|
+
"default": "CanvasText"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"description": "Card box shadow.",
|
|
79
|
+
"name": "--rc-card-shadow",
|
|
80
|
+
"default": "none"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"description": "Background of the non-interactive container overlay.",
|
|
84
|
+
"name": "--rc-card-container-bg",
|
|
85
|
+
"default": "transparent"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"description": "State-layer overlay color.",
|
|
89
|
+
"name": "--rc-card-state-layer-bg",
|
|
90
|
+
"default": "currentColor"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"description": "State-layer opacity transition duration.",
|
|
94
|
+
"name": "--rc-card-state-layer-duration",
|
|
95
|
+
"default": "150ms"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"description": "State-layer opacity transition easing.",
|
|
99
|
+
"name": "--rc-card-state-layer-easing",
|
|
100
|
+
"default": "ease"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"description": "State-layer opacity on hover (interactive cards only).",
|
|
104
|
+
"name": "--rc-card-hover-state-layer-opacity",
|
|
105
|
+
"default": "0"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"description": "State-layer opacity on active press (interactive cards only).",
|
|
109
|
+
"name": "--rc-card-pressed-state-layer-opacity",
|
|
110
|
+
"default": "0"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"description": "Shared block-axis padding fallback for regions that don't set their own `*-padding-block` property. Defers to each region's own default (0 for header/title/subtitle/actions/footer, 1rem for body) when unset.",
|
|
114
|
+
"name": "--rc-card-padding-block"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"description": "Shared inline-axis padding fallback for regions that don't set their own `*-padding-inline` property. Defers to each region's own default (0 for header/title/subtitle/actions/footer, 1rem for body) when unset.",
|
|
118
|
+
"name": "--rc-card-padding-inline"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"description": "Grid row for the media region.",
|
|
122
|
+
"name": "--rc-card-media-grid-row",
|
|
123
|
+
"default": "auto"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"description": "Grid row for the header region.",
|
|
127
|
+
"name": "--rc-card-header-grid-row",
|
|
128
|
+
"default": "auto"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"description": "Header block-axis padding.",
|
|
132
|
+
"name": "--rc-card-header-padding-block",
|
|
133
|
+
"default": "var(--rc-card-padding-block, 0) 0"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"description": "Header inline-axis padding.",
|
|
137
|
+
"name": "--rc-card-header-padding-inline",
|
|
138
|
+
"default": "var(--rc-card-padding-inline, 0)"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"description": "Grid row for the title region.",
|
|
142
|
+
"name": "--rc-card-title-grid-row",
|
|
143
|
+
"default": "auto"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"description": "Title block-axis padding.",
|
|
147
|
+
"name": "--rc-card-title-padding-block",
|
|
148
|
+
"default": "var(--rc-card-padding-block, 0) 0"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"description": "Title inline-axis padding.",
|
|
152
|
+
"name": "--rc-card-title-padding-inline",
|
|
153
|
+
"default": "var(--rc-card-padding-inline, 0)"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"description": "Title text color.",
|
|
157
|
+
"name": "--rc-card-title-color",
|
|
158
|
+
"default": "inherit"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"description": "Title font shorthand.",
|
|
162
|
+
"name": "--rc-card-title-font",
|
|
163
|
+
"default": "inherit"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"description": "Grid row for the subtitle region.",
|
|
167
|
+
"name": "--rc-card-subtitle-grid-row",
|
|
168
|
+
"default": "auto"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"description": "Subtitle block-axis padding.",
|
|
172
|
+
"name": "--rc-card-subtitle-padding-block",
|
|
173
|
+
"default": "0"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"description": "Subtitle inline-axis padding.",
|
|
177
|
+
"name": "--rc-card-subtitle-padding-inline",
|
|
178
|
+
"default": "var(--rc-card-padding-inline, 0)"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"description": "Subtitle text color.",
|
|
182
|
+
"name": "--rc-card-subtitle-color",
|
|
183
|
+
"default": "inherit"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"description": "Subtitle font shorthand.",
|
|
187
|
+
"name": "--rc-card-subtitle-font",
|
|
188
|
+
"default": "inherit"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"description": "Grid row for the body region.",
|
|
192
|
+
"name": "--rc-card-body-grid-row",
|
|
193
|
+
"default": "auto"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"description": "Body block-axis padding.",
|
|
197
|
+
"name": "--rc-card-body-padding-block",
|
|
198
|
+
"default": "var(--rc-card-padding-block, 1rem)"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"description": "Body inline-axis padding.",
|
|
202
|
+
"name": "--rc-card-body-padding-inline",
|
|
203
|
+
"default": "var(--rc-card-padding-inline, 1rem)"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"description": "Grid row for the actions region.",
|
|
207
|
+
"name": "--rc-card-actions-grid-row",
|
|
208
|
+
"default": "auto"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"description": "Justify-content for the actions row.",
|
|
212
|
+
"name": "--rc-card-actions-justify",
|
|
213
|
+
"default": "flex-end"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"description": "Gap between action items.",
|
|
217
|
+
"name": "--rc-card-actions-gap",
|
|
218
|
+
"default": "0"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"description": "Actions block-axis padding.",
|
|
222
|
+
"name": "--rc-card-actions-padding-block",
|
|
223
|
+
"default": "0 var(--rc-card-padding-block, 0)"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"description": "Actions inline-axis padding.",
|
|
227
|
+
"name": "--rc-card-actions-padding-inline",
|
|
228
|
+
"default": "var(--rc-card-padding-inline, 0)"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"description": "Grid row for the footer region.",
|
|
232
|
+
"name": "--rc-card-footer-grid-row",
|
|
233
|
+
"default": "auto"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"description": "Footer block-axis padding.",
|
|
237
|
+
"name": "--rc-card-footer-padding-block",
|
|
238
|
+
"default": "0 var(--rc-card-padding-block, 0)"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"description": "Footer inline-axis padding.",
|
|
242
|
+
"name": "--rc-card-footer-padding-inline",
|
|
243
|
+
"default": "var(--rc-card-padding-inline, 0)"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"cssParts": [
|
|
247
|
+
{
|
|
248
|
+
"description": "Non-interactive visual container overlay.",
|
|
249
|
+
"name": "container"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"description": "Media region wrapper.",
|
|
253
|
+
"name": "media"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"description": "Header region wrapper.",
|
|
257
|
+
"name": "header"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"description": "Title region wrapper.",
|
|
261
|
+
"name": "title"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"description": "Subtitle region wrapper.",
|
|
265
|
+
"name": "subtitle"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"description": "Body region wrapper.",
|
|
269
|
+
"name": "body"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"description": "Actions region wrapper.",
|
|
273
|
+
"name": "actions"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"description": "Footer region wrapper.",
|
|
277
|
+
"name": "footer"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"description": "Non-interactive overlay for hover/pressed/ripple effects.",
|
|
281
|
+
"name": "state-layer"
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
"slots": [
|
|
285
|
+
{
|
|
286
|
+
"description": "Media region, typically an image or figure.",
|
|
287
|
+
"name": "media"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"description": "Header content above title/body.",
|
|
291
|
+
"name": "header"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"description": "Primary card title.",
|
|
295
|
+
"name": "title"
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"description": "Secondary title or metadata.",
|
|
299
|
+
"name": "subtitle"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"description": "Body content.",
|
|
303
|
+
"name": ""
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"description": "Action row.",
|
|
307
|
+
"name": "actions"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"description": "Footer content.",
|
|
311
|
+
"name": "footer"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"members": [
|
|
315
|
+
{
|
|
316
|
+
"kind": "field",
|
|
317
|
+
"name": "selected",
|
|
318
|
+
"type": {
|
|
319
|
+
"text": "boolean"
|
|
320
|
+
},
|
|
321
|
+
"default": "false",
|
|
322
|
+
"description": "Declarative selected state for theme styling.",
|
|
323
|
+
"attribute": "selected",
|
|
324
|
+
"reflects": true
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"kind": "field",
|
|
328
|
+
"name": "disabled",
|
|
329
|
+
"type": {
|
|
330
|
+
"text": "boolean"
|
|
331
|
+
},
|
|
332
|
+
"default": "false",
|
|
333
|
+
"description": "Declarative disabled state. Disables action-target click forwarding.",
|
|
334
|
+
"attribute": "disabled",
|
|
335
|
+
"reflects": true
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"kind": "field",
|
|
339
|
+
"name": "interactive",
|
|
340
|
+
"type": {
|
|
341
|
+
"text": "boolean"
|
|
342
|
+
},
|
|
343
|
+
"default": "false",
|
|
344
|
+
"description": "Visual affordance for cards with an author-provided action target.",
|
|
345
|
+
"attribute": "interactive",
|
|
346
|
+
"reflects": true
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"kind": "field",
|
|
350
|
+
"name": "actionTarget",
|
|
351
|
+
"type": {
|
|
352
|
+
"text": "string"
|
|
353
|
+
},
|
|
354
|
+
"default": "''",
|
|
355
|
+
"description": "ID of a same-root anchor or button that receives forwarded surface clicks.",
|
|
356
|
+
"attribute": "action-target"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"kind": "field",
|
|
360
|
+
"name": "_$media",
|
|
361
|
+
"type": {
|
|
362
|
+
"text": "Element[]"
|
|
363
|
+
},
|
|
364
|
+
"privacy": "private"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"kind": "field",
|
|
368
|
+
"name": "_$header",
|
|
369
|
+
"type": {
|
|
370
|
+
"text": "Element[]"
|
|
371
|
+
},
|
|
372
|
+
"privacy": "private"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"kind": "field",
|
|
376
|
+
"name": "_$title",
|
|
377
|
+
"type": {
|
|
378
|
+
"text": "Element[]"
|
|
379
|
+
},
|
|
380
|
+
"privacy": "private"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"kind": "field",
|
|
384
|
+
"name": "_$subtitle",
|
|
385
|
+
"type": {
|
|
386
|
+
"text": "Element[]"
|
|
387
|
+
},
|
|
388
|
+
"privacy": "private"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"kind": "field",
|
|
392
|
+
"name": "_$actions",
|
|
393
|
+
"type": {
|
|
394
|
+
"text": "Element[]"
|
|
395
|
+
},
|
|
396
|
+
"privacy": "private"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"kind": "field",
|
|
400
|
+
"name": "_$footer",
|
|
401
|
+
"type": {
|
|
402
|
+
"text": "Element[]"
|
|
403
|
+
},
|
|
404
|
+
"privacy": "private"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"kind": "field",
|
|
408
|
+
"name": "_slotMicrotaskQueued",
|
|
409
|
+
"type": {
|
|
410
|
+
"text": "boolean"
|
|
411
|
+
},
|
|
412
|
+
"privacy": "private",
|
|
413
|
+
"default": "false"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"kind": "method",
|
|
417
|
+
"name": "_handleSlotChange",
|
|
418
|
+
"privacy": "private",
|
|
419
|
+
"return": {
|
|
420
|
+
"type": {
|
|
421
|
+
"text": "void"
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"kind": "method",
|
|
427
|
+
"name": "_syncSlotPresence",
|
|
428
|
+
"privacy": "private",
|
|
429
|
+
"return": {
|
|
430
|
+
"type": {
|
|
431
|
+
"text": "void"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"kind": "method",
|
|
437
|
+
"name": "_resolveActionTarget",
|
|
438
|
+
"privacy": "private",
|
|
439
|
+
"return": {
|
|
440
|
+
"type": {
|
|
441
|
+
"text": "HTMLAnchorElement | HTMLButtonElement | null"
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"kind": "method",
|
|
447
|
+
"name": "_eventStartedInInteractiveDescendant",
|
|
448
|
+
"privacy": "private",
|
|
449
|
+
"return": {
|
|
450
|
+
"type": {
|
|
451
|
+
"text": "boolean"
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
"parameters": [
|
|
455
|
+
{
|
|
456
|
+
"name": "event",
|
|
457
|
+
"type": {
|
|
458
|
+
"text": "Event"
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
]
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"kind": "method",
|
|
465
|
+
"name": "_handleClick",
|
|
466
|
+
"privacy": "private",
|
|
467
|
+
"return": {
|
|
468
|
+
"type": {
|
|
469
|
+
"text": "void"
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
"parameters": [
|
|
473
|
+
{
|
|
474
|
+
"name": "event",
|
|
475
|
+
"type": {
|
|
476
|
+
"text": "MouseEvent"
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
]
|
|
480
|
+
}
|
|
481
|
+
],
|
|
482
|
+
"attributes": [
|
|
483
|
+
{
|
|
484
|
+
"description": "Declarative selected state for theme styling.",
|
|
485
|
+
"name": "selected",
|
|
486
|
+
"type": {
|
|
487
|
+
"text": "boolean"
|
|
488
|
+
},
|
|
489
|
+
"default": "false",
|
|
490
|
+
"fieldName": "selected"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
"description": "Declarative disabled state. Disables action-target click forwarding.",
|
|
494
|
+
"name": "disabled",
|
|
495
|
+
"type": {
|
|
496
|
+
"text": "boolean"
|
|
497
|
+
},
|
|
498
|
+
"default": "false",
|
|
499
|
+
"fieldName": "disabled"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"description": "Visual affordance for cards with an author-provided action target.",
|
|
503
|
+
"name": "interactive",
|
|
504
|
+
"type": {
|
|
505
|
+
"text": "boolean"
|
|
506
|
+
},
|
|
507
|
+
"default": "false",
|
|
508
|
+
"fieldName": "interactive"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"description": "ID of a same-root anchor or button that receives forwarded surface clicks.",
|
|
512
|
+
"name": "action-target",
|
|
513
|
+
"type": {
|
|
514
|
+
"text": "string"
|
|
515
|
+
},
|
|
516
|
+
"default": "''",
|
|
517
|
+
"fieldName": "actionTarget"
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
"description": "Present when the `media` slot has assigned content.",
|
|
521
|
+
"name": "has-media"
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
"description": "Present when the `header` slot has assigned content.",
|
|
525
|
+
"name": "has-header"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
"description": "Present when the `title` slot has assigned content.",
|
|
529
|
+
"name": "has-title"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"description": "Present when the `subtitle` slot has assigned content.",
|
|
533
|
+
"name": "has-subtitle"
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
"description": "Present when the `actions` slot has assigned content.",
|
|
537
|
+
"name": "has-actions"
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
"description": "Present when the `footer` slot has assigned content.",
|
|
541
|
+
"name": "has-footer"
|
|
542
|
+
}
|
|
543
|
+
],
|
|
544
|
+
"superclass": {
|
|
545
|
+
"name": "LitElement",
|
|
546
|
+
"package": "lit"
|
|
547
|
+
},
|
|
548
|
+
"tagName": "rc-card",
|
|
549
|
+
"customElement": true
|
|
550
|
+
}
|
|
551
|
+
],
|
|
552
|
+
"exports": [
|
|
553
|
+
{
|
|
554
|
+
"kind": "js",
|
|
555
|
+
"name": "RCCard",
|
|
556
|
+
"declaration": {
|
|
557
|
+
"name": "RCCard",
|
|
558
|
+
"module": "src/rc-card.ts"
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
"kind": "js",
|
|
563
|
+
"name": "default",
|
|
564
|
+
"declaration": {
|
|
565
|
+
"name": "RCCard",
|
|
566
|
+
"module": "src/rc-card.ts"
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
]
|
|
570
|
+
}
|
|
571
|
+
]
|
|
572
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { css as h, LitElement as g, html as u } from "lit";
|
|
2
|
+
import { property as d, queryAssignedElements as o } from "lit/decorators.js";
|
|
3
|
+
const v = h`
|
|
4
|
+
:host {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-rows: var(--rc-card-grid-template-rows, auto auto auto 1fr auto auto);
|
|
8
|
+
min-inline-size: 0;
|
|
9
|
+
border: var(--rc-card-border, 0);
|
|
10
|
+
border-radius: var(--rc-card-radius, 0);
|
|
11
|
+
background: var(--rc-card-bg, Canvas);
|
|
12
|
+
color: var(--rc-card-color, CanvasText);
|
|
13
|
+
box-shadow: var(--rc-card-shadow, none);
|
|
14
|
+
overflow: clip;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([hidden]) {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([interactive]:not([disabled])) {
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part='container'],
|
|
27
|
+
[part='state-layer'] {
|
|
28
|
+
position: absolute;
|
|
29
|
+
inset: 0;
|
|
30
|
+
border-radius: inherit;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
[part='container'] {
|
|
35
|
+
background: var(--rc-card-container-bg, transparent);
|
|
36
|
+
z-index: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[part='state-layer'] {
|
|
40
|
+
background: var(--rc-card-state-layer-bg, currentColor);
|
|
41
|
+
opacity: 0;
|
|
42
|
+
transition: opacity var(--rc-card-state-layer-duration, 150ms)
|
|
43
|
+
var(--rc-card-state-layer-easing, ease);
|
|
44
|
+
z-index: 1;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([interactive]:not([disabled]):hover) [part='state-layer'] {
|
|
48
|
+
opacity: var(--rc-card-hover-state-layer-opacity, 0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([interactive]:not([disabled]):active) [part='state-layer'] {
|
|
52
|
+
opacity: var(--rc-card-pressed-state-layer-opacity, 0);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
[part='media'],
|
|
56
|
+
[part='header'],
|
|
57
|
+
[part='title'],
|
|
58
|
+
[part='subtitle'],
|
|
59
|
+
[part='body'],
|
|
60
|
+
[part='actions'],
|
|
61
|
+
[part='footer'] {
|
|
62
|
+
position: relative;
|
|
63
|
+
z-index: 2;
|
|
64
|
+
min-inline-size: 0;
|
|
65
|
+
box-sizing: border-box;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
[part='media'] {
|
|
69
|
+
grid-row: var(--rc-card-media-grid-row, auto);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
[part='header'] {
|
|
73
|
+
grid-row: var(--rc-card-header-grid-row, auto);
|
|
74
|
+
padding-block: var(--rc-card-header-padding-block, var(--rc-card-padding-block, 0) 0);
|
|
75
|
+
padding-inline: var(--rc-card-header-padding-inline, var(--rc-card-padding-inline, 0));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[part='title'] {
|
|
79
|
+
grid-row: var(--rc-card-title-grid-row, auto);
|
|
80
|
+
padding-block: var(--rc-card-title-padding-block, var(--rc-card-padding-block, 0) 0);
|
|
81
|
+
padding-inline: var(--rc-card-title-padding-inline, var(--rc-card-padding-inline, 0));
|
|
82
|
+
color: var(--rc-card-title-color, inherit);
|
|
83
|
+
font: var(--rc-card-title-font, inherit);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
[part='subtitle'] {
|
|
87
|
+
grid-row: var(--rc-card-subtitle-grid-row, auto);
|
|
88
|
+
padding-block: var(--rc-card-subtitle-padding-block, 0);
|
|
89
|
+
padding-inline: var(--rc-card-subtitle-padding-inline, var(--rc-card-padding-inline, 0));
|
|
90
|
+
color: var(--rc-card-subtitle-color, inherit);
|
|
91
|
+
font: var(--rc-card-subtitle-font, inherit);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
[part='body'] {
|
|
95
|
+
grid-row: var(--rc-card-body-grid-row, auto);
|
|
96
|
+
min-block-size: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
[part='actions'] {
|
|
100
|
+
grid-row: var(--rc-card-actions-grid-row, auto);
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
justify-content: var(--rc-card-actions-justify, flex-end);
|
|
104
|
+
gap: var(--rc-card-actions-gap, 0);
|
|
105
|
+
padding-block: var(--rc-card-actions-padding-block, 0 var(--rc-card-padding-block, 0));
|
|
106
|
+
padding-inline: var(--rc-card-actions-padding-inline, var(--rc-card-padding-inline, 0));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[part='footer'] {
|
|
110
|
+
grid-row: var(--rc-card-footer-grid-row, auto);
|
|
111
|
+
padding-block: var(--rc-card-footer-padding-block, 0 var(--rc-card-padding-block, 0));
|
|
112
|
+
padding-inline: var(--rc-card-footer-padding-inline, var(--rc-card-padding-inline, 0));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host(:not([has-media])) [part='media'],
|
|
116
|
+
:host(:not([has-header])) [part='header'],
|
|
117
|
+
:host(:not([has-title])) [part='title'],
|
|
118
|
+
:host(:not([has-subtitle])) [part='subtitle'],
|
|
119
|
+
:host(:not([has-actions])) [part='actions'],
|
|
120
|
+
:host(:not([has-footer])) [part='footer'] {
|
|
121
|
+
display: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
::slotted([slot='media']) {
|
|
125
|
+
display: block;
|
|
126
|
+
inline-size: 100%;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
::slotted(:not([slot])) {
|
|
130
|
+
padding-block: var(--rc-card-body-padding-block, var(--rc-card-padding-block, 1rem));
|
|
131
|
+
padding-inline: var(--rc-card-body-padding-inline, var(--rc-card-padding-inline, 1rem));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@media (forced-colors: active) {
|
|
135
|
+
:host {
|
|
136
|
+
border-color: CanvasText;
|
|
137
|
+
background: Canvas;
|
|
138
|
+
color: CanvasText;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
[part='state-layer'] {
|
|
142
|
+
background: Highlight;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
var b = Object.defineProperty, a = (l, t, r, n) => {
|
|
147
|
+
for (var i = void 0, s = l.length - 1, p; s >= 0; s--)
|
|
148
|
+
(p = l[s]) && (i = p(t, r, i) || i);
|
|
149
|
+
return i && b(t, r, i), i;
|
|
150
|
+
};
|
|
151
|
+
const f = [
|
|
152
|
+
"a[href]",
|
|
153
|
+
"button",
|
|
154
|
+
"input",
|
|
155
|
+
"select",
|
|
156
|
+
"textarea",
|
|
157
|
+
"summary",
|
|
158
|
+
'[role="button"]',
|
|
159
|
+
'[role="link"]',
|
|
160
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
161
|
+
].join(","), y = ["media", "header", "title", "subtitle", "actions", "footer"], c = class c extends g {
|
|
162
|
+
constructor() {
|
|
163
|
+
super(), this.selected = !1, this.disabled = !1, this.interactive = !1, this.actionTarget = "", this._slotMicrotaskQueued = !1, this.addEventListener("click", (t) => this._handleClick(t));
|
|
164
|
+
}
|
|
165
|
+
firstUpdated() {
|
|
166
|
+
this._syncSlotPresence();
|
|
167
|
+
}
|
|
168
|
+
render() {
|
|
169
|
+
return u`
|
|
170
|
+
<div part="container" aria-hidden="true"></div>
|
|
171
|
+
<div part="media"><slot name="media" @slotchange=${this._handleSlotChange}></slot></div>
|
|
172
|
+
<div part="header"><slot name="header" @slotchange=${this._handleSlotChange}></slot></div>
|
|
173
|
+
<div part="title"><slot name="title" @slotchange=${this._handleSlotChange}></slot></div>
|
|
174
|
+
<div part="subtitle"><slot name="subtitle" @slotchange=${this._handleSlotChange}></slot></div>
|
|
175
|
+
<div part="body"><slot @slotchange=${this._handleSlotChange}></slot></div>
|
|
176
|
+
<div part="actions"><slot name="actions" @slotchange=${this._handleSlotChange}></slot></div>
|
|
177
|
+
<div part="footer"><slot name="footer" @slotchange=${this._handleSlotChange}></slot></div>
|
|
178
|
+
<div part="state-layer" aria-hidden="true"></div>
|
|
179
|
+
`;
|
|
180
|
+
}
|
|
181
|
+
_handleSlotChange() {
|
|
182
|
+
this._slotMicrotaskQueued || (this._slotMicrotaskQueued = !0, queueMicrotask(() => {
|
|
183
|
+
this._slotMicrotaskQueued = !1, this.isConnected && this._syncSlotPresence();
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
_syncSlotPresence() {
|
|
187
|
+
const t = {
|
|
188
|
+
media: this._$media ?? [],
|
|
189
|
+
header: this._$header ?? [],
|
|
190
|
+
title: this._$title ?? [],
|
|
191
|
+
subtitle: this._$subtitle ?? [],
|
|
192
|
+
actions: this._$actions ?? [],
|
|
193
|
+
footer: this._$footer ?? []
|
|
194
|
+
};
|
|
195
|
+
for (const r of y)
|
|
196
|
+
this.toggleAttribute(`has-${r}`, t[r].length > 0);
|
|
197
|
+
}
|
|
198
|
+
_resolveActionTarget() {
|
|
199
|
+
const t = this.actionTarget.trim();
|
|
200
|
+
if (!t)
|
|
201
|
+
return null;
|
|
202
|
+
const r = this.getRootNode(), n = r instanceof Document || r instanceof ShadowRoot ? r.getElementById(t) : null;
|
|
203
|
+
return n instanceof HTMLAnchorElement || n instanceof HTMLButtonElement ? n : null;
|
|
204
|
+
}
|
|
205
|
+
_eventStartedInInteractiveDescendant(t) {
|
|
206
|
+
for (const r of t.composedPath()) {
|
|
207
|
+
if (r === this)
|
|
208
|
+
return !1;
|
|
209
|
+
if (r instanceof Element && r.matches(f))
|
|
210
|
+
return !0;
|
|
211
|
+
}
|
|
212
|
+
return !1;
|
|
213
|
+
}
|
|
214
|
+
_handleClick(t) {
|
|
215
|
+
if (this.disabled || t.defaultPrevented || t.button !== 0 || this._eventStartedInInteractiveDescendant(t))
|
|
216
|
+
return;
|
|
217
|
+
const r = this._resolveActionTarget();
|
|
218
|
+
r && (t.preventDefault(), r.click());
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
c.styles = v;
|
|
222
|
+
let e = c;
|
|
223
|
+
a([
|
|
224
|
+
d({ type: Boolean, reflect: !0 })
|
|
225
|
+
], e.prototype, "selected");
|
|
226
|
+
a([
|
|
227
|
+
d({ type: Boolean, reflect: !0 })
|
|
228
|
+
], e.prototype, "disabled");
|
|
229
|
+
a([
|
|
230
|
+
d({ type: Boolean, reflect: !0 })
|
|
231
|
+
], e.prototype, "interactive");
|
|
232
|
+
a([
|
|
233
|
+
d({ type: String, attribute: "action-target" })
|
|
234
|
+
], e.prototype, "actionTarget");
|
|
235
|
+
a([
|
|
236
|
+
o({ slot: "media", flatten: !0 })
|
|
237
|
+
], e.prototype, "_$media");
|
|
238
|
+
a([
|
|
239
|
+
o({ slot: "header", flatten: !0 })
|
|
240
|
+
], e.prototype, "_$header");
|
|
241
|
+
a([
|
|
242
|
+
o({ slot: "title", flatten: !0 })
|
|
243
|
+
], e.prototype, "_$title");
|
|
244
|
+
a([
|
|
245
|
+
o({ slot: "subtitle", flatten: !0 })
|
|
246
|
+
], e.prototype, "_$subtitle");
|
|
247
|
+
a([
|
|
248
|
+
o({ slot: "actions", flatten: !0 })
|
|
249
|
+
], e.prototype, "_$actions");
|
|
250
|
+
a([
|
|
251
|
+
o({ slot: "footer", flatten: !0 })
|
|
252
|
+
], e.prototype, "_$footer");
|
|
253
|
+
export {
|
|
254
|
+
e as R
|
|
255
|
+
};
|
|
256
|
+
//# sourceMappingURL=rc-card-DeNYLO0D.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rc-card-DeNYLO0D.js","sources":["../src/rc-card.styles.ts","../src/rc-card.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const cardStyles = css`\n :host {\n position: relative;\n display: grid;\n grid-template-rows: var(--rc-card-grid-template-rows, auto auto auto 1fr auto auto);\n min-inline-size: 0;\n border: var(--rc-card-border, 0);\n border-radius: var(--rc-card-radius, 0);\n background: var(--rc-card-bg, Canvas);\n color: var(--rc-card-color, CanvasText);\n box-shadow: var(--rc-card-shadow, none);\n overflow: clip;\n box-sizing: border-box;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n :host([interactive]:not([disabled])) {\n cursor: pointer;\n }\n\n [part='container'],\n [part='state-layer'] {\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n }\n\n [part='container'] {\n background: var(--rc-card-container-bg, transparent);\n z-index: 0;\n }\n\n [part='state-layer'] {\n background: var(--rc-card-state-layer-bg, currentColor);\n opacity: 0;\n transition: opacity var(--rc-card-state-layer-duration, 150ms)\n var(--rc-card-state-layer-easing, ease);\n z-index: 1;\n }\n\n :host([interactive]:not([disabled]):hover) [part='state-layer'] {\n opacity: var(--rc-card-hover-state-layer-opacity, 0);\n }\n\n :host([interactive]:not([disabled]):active) [part='state-layer'] {\n opacity: var(--rc-card-pressed-state-layer-opacity, 0);\n }\n\n [part='media'],\n [part='header'],\n [part='title'],\n [part='subtitle'],\n [part='body'],\n [part='actions'],\n [part='footer'] {\n position: relative;\n z-index: 2;\n min-inline-size: 0;\n box-sizing: border-box;\n }\n\n [part='media'] {\n grid-row: var(--rc-card-media-grid-row, auto);\n }\n\n [part='header'] {\n grid-row: var(--rc-card-header-grid-row, auto);\n padding-block: var(--rc-card-header-padding-block, var(--rc-card-padding-block, 0) 0);\n padding-inline: var(--rc-card-header-padding-inline, var(--rc-card-padding-inline, 0));\n }\n\n [part='title'] {\n grid-row: var(--rc-card-title-grid-row, auto);\n padding-block: var(--rc-card-title-padding-block, var(--rc-card-padding-block, 0) 0);\n padding-inline: var(--rc-card-title-padding-inline, var(--rc-card-padding-inline, 0));\n color: var(--rc-card-title-color, inherit);\n font: var(--rc-card-title-font, inherit);\n }\n\n [part='subtitle'] {\n grid-row: var(--rc-card-subtitle-grid-row, auto);\n padding-block: var(--rc-card-subtitle-padding-block, 0);\n padding-inline: var(--rc-card-subtitle-padding-inline, var(--rc-card-padding-inline, 0));\n color: var(--rc-card-subtitle-color, inherit);\n font: var(--rc-card-subtitle-font, inherit);\n }\n\n [part='body'] {\n grid-row: var(--rc-card-body-grid-row, auto);\n min-block-size: 0;\n }\n\n [part='actions'] {\n grid-row: var(--rc-card-actions-grid-row, auto);\n display: flex;\n align-items: center;\n justify-content: var(--rc-card-actions-justify, flex-end);\n gap: var(--rc-card-actions-gap, 0);\n padding-block: var(--rc-card-actions-padding-block, 0 var(--rc-card-padding-block, 0));\n padding-inline: var(--rc-card-actions-padding-inline, var(--rc-card-padding-inline, 0));\n }\n\n [part='footer'] {\n grid-row: var(--rc-card-footer-grid-row, auto);\n padding-block: var(--rc-card-footer-padding-block, 0 var(--rc-card-padding-block, 0));\n padding-inline: var(--rc-card-footer-padding-inline, var(--rc-card-padding-inline, 0));\n }\n\n :host(:not([has-media])) [part='media'],\n :host(:not([has-header])) [part='header'],\n :host(:not([has-title])) [part='title'],\n :host(:not([has-subtitle])) [part='subtitle'],\n :host(:not([has-actions])) [part='actions'],\n :host(:not([has-footer])) [part='footer'] {\n display: none;\n }\n\n ::slotted([slot='media']) {\n display: block;\n inline-size: 100%;\n }\n\n ::slotted(:not([slot])) {\n padding-block: var(--rc-card-body-padding-block, var(--rc-card-padding-block, 1rem));\n padding-inline: var(--rc-card-body-padding-inline, var(--rc-card-padding-inline, 1rem));\n }\n\n @media (forced-colors: active) {\n :host {\n border-color: CanvasText;\n background: Canvas;\n color: CanvasText;\n }\n\n [part='state-layer'] {\n background: Highlight;\n }\n }\n`;\n\nexport default cardStyles;\n","import { LitElement, html } from 'lit';\nimport { property, queryAssignedElements } from 'lit/decorators.js';\n\nimport cardStyles from './rc-card.styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'rc-card': RCCard;\n }\n}\n\nconst INTERACTIVE_SELECTOR = [\n 'a[href]',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'summary',\n '[role=\"button\"]',\n '[role=\"link\"]',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\nconst SLOT_NAMES = ['media', 'header', 'title', 'subtitle', 'actions', 'footer'] as const;\n\ntype SlotName = (typeof SLOT_NAMES)[number];\n\n/**\n * Design-system-neutral card shell with first-class structural parts and\n * optional pointer delegation to an author-provided anchor or button.\n *\n * @slot media - Media region, typically an image or figure.\n * @slot header - Header content above title/body.\n * @slot title - Primary card title.\n * @slot subtitle - Secondary title or metadata.\n * @slot - Body content.\n * @slot actions - Action row.\n * @slot footer - Footer content.\n *\n * @csspart container - Non-interactive visual container overlay.\n * @csspart media - Media region wrapper.\n * @csspart header - Header region wrapper.\n * @csspart title - Title region wrapper.\n * @csspart subtitle - Subtitle region wrapper.\n * @csspart body - Body region wrapper.\n * @csspart actions - Actions region wrapper.\n * @csspart footer - Footer region wrapper.\n * @csspart state-layer - Non-interactive overlay for hover/pressed/ripple effects.\n *\n * @attr selected - Declarative selected state for theme styling.\n * @attr disabled - Declarative disabled state. Disables action-target click forwarding.\n * @attr interactive - Visual affordance for cards with an author-provided action target.\n * @attr action-target - ID of a same-root anchor or button that receives forwarded surface clicks.\n * @attr [has-media] - Present when the `media` slot has assigned content.\n * @attr [has-header] - Present when the `header` slot has assigned content.\n * @attr [has-title] - Present when the `title` slot has assigned content.\n * @attr [has-subtitle] - Present when the `subtitle` slot has assigned content.\n * @attr [has-actions] - Present when the `actions` slot has assigned content.\n * @attr [has-footer] - Present when the `footer` slot has assigned content.\n *\n * @cssprop [--rc-card-grid-template-rows=auto auto auto 1fr auto auto] - Grid template rows for\n * the host's structural regions.\n * @cssprop [--rc-card-border=0] - Card border.\n * @cssprop [--rc-card-radius=0] - Card border radius.\n * @cssprop [--rc-card-bg=Canvas] - Card background.\n * @cssprop [--rc-card-color=CanvasText] - Card text color.\n * @cssprop [--rc-card-shadow=none] - Card box shadow.\n * @cssprop [--rc-card-container-bg=transparent] - Background of the non-interactive container overlay.\n * @cssprop [--rc-card-state-layer-bg=currentColor] - State-layer overlay color.\n * @cssprop [--rc-card-state-layer-duration=150ms] - State-layer opacity transition duration.\n * @cssprop [--rc-card-state-layer-easing=ease] - State-layer opacity transition easing.\n * @cssprop [--rc-card-hover-state-layer-opacity=0] - State-layer opacity on hover (interactive\n * cards only).\n * @cssprop [--rc-card-pressed-state-layer-opacity=0] - State-layer opacity on active press\n * (interactive cards only).\n * @cssprop [--rc-card-padding-block] - Shared block-axis padding fallback for regions that don't\n * set their own `*-padding-block` property. Defers to each region's own default (0 for\n * header/title/subtitle/actions/footer, 1rem for body) when unset.\n * @cssprop [--rc-card-padding-inline] - Shared inline-axis padding fallback for regions that\n * don't set their own `*-padding-inline` property. Defers to each region's own default (0 for\n * header/title/subtitle/actions/footer, 1rem for body) when unset.\n * @cssprop [--rc-card-media-grid-row=auto] - Grid row for the media region.\n * @cssprop [--rc-card-header-grid-row=auto] - Grid row for the header region.\n * @cssprop [--rc-card-header-padding-block=var(--rc-card-padding-block, 0) 0] - Header block-axis padding.\n * @cssprop [--rc-card-header-padding-inline=var(--rc-card-padding-inline, 0)] - Header inline-axis padding.\n * @cssprop [--rc-card-title-grid-row=auto] - Grid row for the title region.\n * @cssprop [--rc-card-title-padding-block=var(--rc-card-padding-block, 0) 0] - Title block-axis padding.\n * @cssprop [--rc-card-title-padding-inline=var(--rc-card-padding-inline, 0)] - Title inline-axis padding.\n * @cssprop [--rc-card-title-color=inherit] - Title text color.\n * @cssprop [--rc-card-title-font=inherit] - Title font shorthand.\n * @cssprop [--rc-card-subtitle-grid-row=auto] - Grid row for the subtitle region.\n * @cssprop [--rc-card-subtitle-padding-block=0] - Subtitle block-axis padding.\n * @cssprop [--rc-card-subtitle-padding-inline=var(--rc-card-padding-inline, 0)] - Subtitle inline-axis padding.\n * @cssprop [--rc-card-subtitle-color=inherit] - Subtitle text color.\n * @cssprop [--rc-card-subtitle-font=inherit] - Subtitle font shorthand.\n * @cssprop [--rc-card-body-grid-row=auto] - Grid row for the body region.\n * @cssprop [--rc-card-body-padding-block=var(--rc-card-padding-block, 1rem)] - Body block-axis padding.\n * @cssprop [--rc-card-body-padding-inline=var(--rc-card-padding-inline, 1rem)] - Body inline-axis padding.\n * @cssprop [--rc-card-actions-grid-row=auto] - Grid row for the actions region.\n * @cssprop [--rc-card-actions-justify=flex-end] - Justify-content for the actions row.\n * @cssprop [--rc-card-actions-gap=0] - Gap between action items.\n * @cssprop [--rc-card-actions-padding-block=0 var(--rc-card-padding-block, 0)] - Actions block-axis padding.\n * @cssprop [--rc-card-actions-padding-inline=var(--rc-card-padding-inline, 0)] - Actions inline-axis padding.\n * @cssprop [--rc-card-footer-grid-row=auto] - Grid row for the footer region.\n * @cssprop [--rc-card-footer-padding-block=0 var(--rc-card-padding-block, 0)] - Footer block-axis padding.\n * @cssprop [--rc-card-footer-padding-inline=var(--rc-card-padding-inline, 0)] - Footer inline-axis padding.\n */\nexport class RCCard extends LitElement {\n static override styles = cardStyles;\n\n /** Declarative selected state for theme styling. */\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n /** Declarative disabled state. Disables action-target click forwarding. */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /** Visual affordance for cards with an author-provided action target. */\n @property({ type: Boolean, reflect: true })\n interactive = false;\n\n /** ID of a same-root anchor or button that receives forwarded surface clicks. */\n @property({ type: String, attribute: 'action-target' })\n actionTarget = '';\n\n @queryAssignedElements({ slot: 'media', flatten: true }) private _$media!: Element[];\n @queryAssignedElements({ slot: 'header', flatten: true }) private _$header!: Element[];\n @queryAssignedElements({ slot: 'title', flatten: true }) private _$title!: Element[];\n @queryAssignedElements({ slot: 'subtitle', flatten: true }) private _$subtitle!: Element[];\n @queryAssignedElements({ slot: 'actions', flatten: true }) private _$actions!: Element[];\n @queryAssignedElements({ slot: 'footer', flatten: true }) private _$footer!: Element[];\n\n private _slotMicrotaskQueued = false;\n\n protected override firstUpdated(): void {\n this._syncSlotPresence();\n }\n\n protected override render() {\n return html`\n <div part=\"container\" aria-hidden=\"true\"></div>\n <div part=\"media\"><slot name=\"media\" @slotchange=${this._handleSlotChange}></slot></div>\n <div part=\"header\"><slot name=\"header\" @slotchange=${this._handleSlotChange}></slot></div>\n <div part=\"title\"><slot name=\"title\" @slotchange=${this._handleSlotChange}></slot></div>\n <div part=\"subtitle\"><slot name=\"subtitle\" @slotchange=${this._handleSlotChange}></slot></div>\n <div part=\"body\"><slot @slotchange=${this._handleSlotChange}></slot></div>\n <div part=\"actions\"><slot name=\"actions\" @slotchange=${this._handleSlotChange}></slot></div>\n <div part=\"footer\"><slot name=\"footer\" @slotchange=${this._handleSlotChange}></slot></div>\n <div part=\"state-layer\" aria-hidden=\"true\"></div>\n `;\n }\n\n private _handleSlotChange(): void {\n if (this._slotMicrotaskQueued) {\n return;\n }\n\n this._slotMicrotaskQueued = true;\n\n queueMicrotask(() => {\n this._slotMicrotaskQueued = false;\n\n if (!this.isConnected) {\n return;\n }\n\n this._syncSlotPresence();\n });\n }\n\n private _syncSlotPresence(): void {\n const bySlot: Record<SlotName, Element[]> = {\n media: this._$media ?? [],\n header: this._$header ?? [],\n title: this._$title ?? [],\n subtitle: this._$subtitle ?? [],\n actions: this._$actions ?? [],\n footer: this._$footer ?? [],\n };\n\n for (const slotName of SLOT_NAMES) {\n this.toggleAttribute(`has-${slotName}`, bySlot[slotName].length > 0);\n }\n }\n\n private _resolveActionTarget(): HTMLAnchorElement | HTMLButtonElement | null {\n const id = this.actionTarget.trim();\n\n if (!id) {\n return null;\n }\n\n const root = this.getRootNode();\n const $target =\n root instanceof Document || root instanceof ShadowRoot ? root.getElementById(id) : null;\n\n if ($target instanceof HTMLAnchorElement || $target instanceof HTMLButtonElement) {\n return $target;\n }\n\n if (import.meta.env.DEV) {\n console.warn(`[rc-card] action-target=\"${id}\" must reference a same-root <a> or <button>.`);\n }\n\n return null;\n }\n\n private _eventStartedInInteractiveDescendant(event: Event): boolean {\n for (const entry of event.composedPath()) {\n if (entry === this) {\n return false;\n }\n\n if (entry instanceof Element && entry.matches(INTERACTIVE_SELECTOR)) {\n return true;\n }\n }\n\n return false;\n }\n\n private _handleClick(event: MouseEvent): void {\n if (this.disabled || event.defaultPrevented || event.button !== 0) {\n return;\n }\n\n if (this._eventStartedInInteractiveDescendant(event)) {\n return;\n }\n\n const $target = this._resolveActionTarget();\n\n if (!$target) {\n return;\n }\n\n event.preventDefault();\n $target.click();\n }\n\n constructor() {\n super();\n this.addEventListener('click', (event) => this._handleClick(event as MouseEvent));\n }\n}\n\nexport default RCCard;\n"],"names":["cardStyles","css","INTERACTIVE_SELECTOR","SLOT_NAMES","_RCCard","LitElement","event","html","bySlot","slotName","id","root","$target","entry","RCCard","__decorateClass","property","queryAssignedElements"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rc-card-define.js","sources":["../src/define.ts"],"sourcesContent":["import { RCCard } from './index.js';\n\ncustomElements.get('rc-card') || customElements.define('rc-card', RCCard);\n\nexport * from './index.js';\n"],"names":["RCCard"],"mappings":";AAEA,eAAe,IAAI,SAAS,KAAK,eAAe,OAAO,WAAWA,CAAM;"}
|
package/dist/rc-card.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rc-card.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './rc-card.js';
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'rc-card': RCCard;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Design-system-neutral card shell with first-class structural parts and
|
|
9
|
+
* optional pointer delegation to an author-provided anchor or button.
|
|
10
|
+
*
|
|
11
|
+
* @slot media - Media region, typically an image or figure.
|
|
12
|
+
* @slot header - Header content above title/body.
|
|
13
|
+
* @slot title - Primary card title.
|
|
14
|
+
* @slot subtitle - Secondary title or metadata.
|
|
15
|
+
* @slot - Body content.
|
|
16
|
+
* @slot actions - Action row.
|
|
17
|
+
* @slot footer - Footer content.
|
|
18
|
+
*
|
|
19
|
+
* @csspart container - Non-interactive visual container overlay.
|
|
20
|
+
* @csspart media - Media region wrapper.
|
|
21
|
+
* @csspart header - Header region wrapper.
|
|
22
|
+
* @csspart title - Title region wrapper.
|
|
23
|
+
* @csspart subtitle - Subtitle region wrapper.
|
|
24
|
+
* @csspart body - Body region wrapper.
|
|
25
|
+
* @csspart actions - Actions region wrapper.
|
|
26
|
+
* @csspart footer - Footer region wrapper.
|
|
27
|
+
* @csspart state-layer - Non-interactive overlay for hover/pressed/ripple effects.
|
|
28
|
+
*
|
|
29
|
+
* @attr selected - Declarative selected state for theme styling.
|
|
30
|
+
* @attr disabled - Declarative disabled state. Disables action-target click forwarding.
|
|
31
|
+
* @attr interactive - Visual affordance for cards with an author-provided action target.
|
|
32
|
+
* @attr action-target - ID of a same-root anchor or button that receives forwarded surface clicks.
|
|
33
|
+
* @attr [has-media] - Present when the `media` slot has assigned content.
|
|
34
|
+
* @attr [has-header] - Present when the `header` slot has assigned content.
|
|
35
|
+
* @attr [has-title] - Present when the `title` slot has assigned content.
|
|
36
|
+
* @attr [has-subtitle] - Present when the `subtitle` slot has assigned content.
|
|
37
|
+
* @attr [has-actions] - Present when the `actions` slot has assigned content.
|
|
38
|
+
* @attr [has-footer] - Present when the `footer` slot has assigned content.
|
|
39
|
+
*
|
|
40
|
+
* @cssprop [--rc-card-grid-template-rows=auto auto auto 1fr auto auto] - Grid template rows for
|
|
41
|
+
* the host's structural regions.
|
|
42
|
+
* @cssprop [--rc-card-border=0] - Card border.
|
|
43
|
+
* @cssprop [--rc-card-radius=0] - Card border radius.
|
|
44
|
+
* @cssprop [--rc-card-bg=Canvas] - Card background.
|
|
45
|
+
* @cssprop [--rc-card-color=CanvasText] - Card text color.
|
|
46
|
+
* @cssprop [--rc-card-shadow=none] - Card box shadow.
|
|
47
|
+
* @cssprop [--rc-card-container-bg=transparent] - Background of the non-interactive container overlay.
|
|
48
|
+
* @cssprop [--rc-card-state-layer-bg=currentColor] - State-layer overlay color.
|
|
49
|
+
* @cssprop [--rc-card-state-layer-duration=150ms] - State-layer opacity transition duration.
|
|
50
|
+
* @cssprop [--rc-card-state-layer-easing=ease] - State-layer opacity transition easing.
|
|
51
|
+
* @cssprop [--rc-card-hover-state-layer-opacity=0] - State-layer opacity on hover (interactive
|
|
52
|
+
* cards only).
|
|
53
|
+
* @cssprop [--rc-card-pressed-state-layer-opacity=0] - State-layer opacity on active press
|
|
54
|
+
* (interactive cards only).
|
|
55
|
+
* @cssprop [--rc-card-padding-block] - Shared block-axis padding fallback for regions that don't
|
|
56
|
+
* set their own `*-padding-block` property. Defers to each region's own default (0 for
|
|
57
|
+
* header/title/subtitle/actions/footer, 1rem for body) when unset.
|
|
58
|
+
* @cssprop [--rc-card-padding-inline] - Shared inline-axis padding fallback for regions that
|
|
59
|
+
* don't set their own `*-padding-inline` property. Defers to each region's own default (0 for
|
|
60
|
+
* header/title/subtitle/actions/footer, 1rem for body) when unset.
|
|
61
|
+
* @cssprop [--rc-card-media-grid-row=auto] - Grid row for the media region.
|
|
62
|
+
* @cssprop [--rc-card-header-grid-row=auto] - Grid row for the header region.
|
|
63
|
+
* @cssprop [--rc-card-header-padding-block=var(--rc-card-padding-block, 0) 0] - Header block-axis padding.
|
|
64
|
+
* @cssprop [--rc-card-header-padding-inline=var(--rc-card-padding-inline, 0)] - Header inline-axis padding.
|
|
65
|
+
* @cssprop [--rc-card-title-grid-row=auto] - Grid row for the title region.
|
|
66
|
+
* @cssprop [--rc-card-title-padding-block=var(--rc-card-padding-block, 0) 0] - Title block-axis padding.
|
|
67
|
+
* @cssprop [--rc-card-title-padding-inline=var(--rc-card-padding-inline, 0)] - Title inline-axis padding.
|
|
68
|
+
* @cssprop [--rc-card-title-color=inherit] - Title text color.
|
|
69
|
+
* @cssprop [--rc-card-title-font=inherit] - Title font shorthand.
|
|
70
|
+
* @cssprop [--rc-card-subtitle-grid-row=auto] - Grid row for the subtitle region.
|
|
71
|
+
* @cssprop [--rc-card-subtitle-padding-block=0] - Subtitle block-axis padding.
|
|
72
|
+
* @cssprop [--rc-card-subtitle-padding-inline=var(--rc-card-padding-inline, 0)] - Subtitle inline-axis padding.
|
|
73
|
+
* @cssprop [--rc-card-subtitle-color=inherit] - Subtitle text color.
|
|
74
|
+
* @cssprop [--rc-card-subtitle-font=inherit] - Subtitle font shorthand.
|
|
75
|
+
* @cssprop [--rc-card-body-grid-row=auto] - Grid row for the body region.
|
|
76
|
+
* @cssprop [--rc-card-body-padding-block=var(--rc-card-padding-block, 1rem)] - Body block-axis padding.
|
|
77
|
+
* @cssprop [--rc-card-body-padding-inline=var(--rc-card-padding-inline, 1rem)] - Body inline-axis padding.
|
|
78
|
+
* @cssprop [--rc-card-actions-grid-row=auto] - Grid row for the actions region.
|
|
79
|
+
* @cssprop [--rc-card-actions-justify=flex-end] - Justify-content for the actions row.
|
|
80
|
+
* @cssprop [--rc-card-actions-gap=0] - Gap between action items.
|
|
81
|
+
* @cssprop [--rc-card-actions-padding-block=0 var(--rc-card-padding-block, 0)] - Actions block-axis padding.
|
|
82
|
+
* @cssprop [--rc-card-actions-padding-inline=var(--rc-card-padding-inline, 0)] - Actions inline-axis padding.
|
|
83
|
+
* @cssprop [--rc-card-footer-grid-row=auto] - Grid row for the footer region.
|
|
84
|
+
* @cssprop [--rc-card-footer-padding-block=0 var(--rc-card-padding-block, 0)] - Footer block-axis padding.
|
|
85
|
+
* @cssprop [--rc-card-footer-padding-inline=var(--rc-card-padding-inline, 0)] - Footer inline-axis padding.
|
|
86
|
+
*/
|
|
87
|
+
export declare class RCCard extends LitElement {
|
|
88
|
+
static styles: import('lit').CSSResult;
|
|
89
|
+
/** Declarative selected state for theme styling. */
|
|
90
|
+
selected: boolean;
|
|
91
|
+
/** Declarative disabled state. Disables action-target click forwarding. */
|
|
92
|
+
disabled: boolean;
|
|
93
|
+
/** Visual affordance for cards with an author-provided action target. */
|
|
94
|
+
interactive: boolean;
|
|
95
|
+
/** ID of a same-root anchor or button that receives forwarded surface clicks. */
|
|
96
|
+
actionTarget: string;
|
|
97
|
+
private _$media;
|
|
98
|
+
private _$header;
|
|
99
|
+
private _$title;
|
|
100
|
+
private _$subtitle;
|
|
101
|
+
private _$actions;
|
|
102
|
+
private _$footer;
|
|
103
|
+
private _slotMicrotaskQueued;
|
|
104
|
+
protected firstUpdated(): void;
|
|
105
|
+
protected render(): import('lit').TemplateResult<1>;
|
|
106
|
+
private _handleSlotChange;
|
|
107
|
+
private _syncSlotPresence;
|
|
108
|
+
private _resolveActionTarget;
|
|
109
|
+
private _eventStartedInInteractiveDescendant;
|
|
110
|
+
private _handleClick;
|
|
111
|
+
constructor();
|
|
112
|
+
}
|
|
113
|
+
export default RCCard;
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rcarls/rc-card",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.4.0",
|
|
7
|
+
"description": "Design-system-neutral card shell with structural slots and parts.",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/richardcarls/rc-webcomponents.git",
|
|
11
|
+
"directory": "packages/rc-card"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://richardcarls.github.io/rc-webcomponents/components/rc-card",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"module": "./dist/rc-card.js",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"import": {
|
|
23
|
+
"types": "./dist/types/packages/rc-card/src/index.d.ts",
|
|
24
|
+
"default": "./dist/rc-card.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"./define": {
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/types/packages/rc-card/src/define.d.ts",
|
|
30
|
+
"default": "./dist/rc-card-define.js"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"types": "./dist/types/packages/rc-card/src/index.d.ts",
|
|
35
|
+
"sideEffects": [
|
|
36
|
+
"./dist/rc-card-define.js"
|
|
37
|
+
],
|
|
38
|
+
"customElements": "dist/custom-elements.json",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc && vite build && cem analyze",
|
|
41
|
+
"cem:analyze": "cem analyze",
|
|
42
|
+
"preview": "vite preview",
|
|
43
|
+
"test:browser": "vitest --run",
|
|
44
|
+
"test:browser:chrome": "vitest --run --project=chromium",
|
|
45
|
+
"test:browser:firefox": "vitest --run --project=firefox"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@custom-elements-manifest/analyzer": "0.11.0",
|
|
49
|
+
"@vitest/browser-playwright": "4.1.5",
|
|
50
|
+
"lit": "^3.0.0",
|
|
51
|
+
"playwright": "^1.56.0",
|
|
52
|
+
"rollup": "^4.60.2",
|
|
53
|
+
"typescript": "~5.9.3",
|
|
54
|
+
"vite": "^7.1.7",
|
|
55
|
+
"vite-plugin-dts": "^4.5.4",
|
|
56
|
+
"vitest": "^4.0.6",
|
|
57
|
+
"vitest-browser-lit": "^1.0.1"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"lit": "^3.0.0"
|
|
61
|
+
}
|
|
62
|
+
}
|