@c2n/accordion 0.0.11 → 0.0.13
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/custom-elements.json +1 -0
- package/package.json +5 -4
- package/react.d.ts +6 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0.0","readme":"","modules":[{"kind":"javascript-module","path":"src/accordion.ts","declarations":[{"kind":"class","description":"A connected disclosure surface with shared borders, outside corners and animated panels.\nOpening a panel closes its siblings unless `multiple` is set.","name":"Accordion","cssProperties":[{"type":{"text":"pixel"},"description":"Space between panels. Zero joins their borders and corners; a positive gap separates them into cards.","name":"--c2-accordion--gap","default":"0px"},{"type":{"text":"pixel"},"description":"Width of the outer frame and shared panel dividers.","name":"--c2-accordion--border-width","default":"1px"},{"type":{"text":"color"},"description":"Color of the outer frame and shared panel dividers.","name":"--c2-accordion--border-color","default":"#d5d5d5"},{"type":{"text":"border-radius"},"description":"Outside corner radius. With a positive gap, applies to every panel.","name":"--c2-accordion--border-radius","default":"8px"},{"type":{"text":"time"},"description":"Panel and chevron animation duration. Set to 0ms for instant toggling; respects reduced motion.","name":"--c2-accordion--transition-duration","default":"300ms"}],"slots":[{"description":"Direct `c2-details` children to coordinate.","name":""}],"members":[{"kind":"field","name":"multiple","type":{"text":"boolean"},"default":"false","description":"Allows several panels to remain expanded. All panels may be closed in either mode.","attribute":"multiple","reflects":true},{"kind":"field","name":"accordion","type":{"text":"AccordionContext"},"privacy":"protected","default":"{ expandedChanged: (panel) => { if (this.isConnected && this.panels.includes(panel) && panel.expanded) this.closeOthers(panel) }, }"},{"kind":"field","name":"panels","type":{"text":"Details[]"},"privacy":"private","readonly":true},{"kind":"method","name":"syncPanels","privacy":"private"},{"kind":"method","name":"closeOthers","privacy":"private","parameters":[{"name":"expandedPanel","optional":true,"type":{"text":"Details"}}]}],"attributes":[{"name":"multiple","type":{"text":"boolean"},"default":"false","description":"Allows several panels to remain expanded. All panels may be closed in either mode.","fieldName":"multiple"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"c2-accordion","customElement":true,"slotComponents":["c2-details"]}],"exports":[{"kind":"js","name":"Accordion","declaration":{"name":"Accordion","module":"src/accordion.ts"}},{"kind":"custom-element-definition","name":"c2-accordion","declaration":{"name":"Accordion","module":"src/accordion.ts"}}]}]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c2n/accordion",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/accordion.js",
|
|
6
6
|
"exports": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
23
23
|
"types",
|
|
24
|
+
"custom-elements.json",
|
|
24
25
|
"react.d.ts",
|
|
25
26
|
"react.js",
|
|
26
27
|
"vue.d.ts",
|
|
@@ -63,8 +64,8 @@
|
|
|
63
64
|
}
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
|
-
"@c2n/core": "0.0.
|
|
67
|
-
"@c2n/details": "0.0.
|
|
67
|
+
"@c2n/core": "0.0.13",
|
|
68
|
+
"@c2n/details": "0.0.13",
|
|
68
69
|
"@lit/context": "1.1.6",
|
|
69
70
|
"lit": "3.3.3"
|
|
70
71
|
},
|
|
@@ -72,5 +73,5 @@
|
|
|
72
73
|
"@c2n/config": "*"
|
|
73
74
|
},
|
|
74
75
|
"customElements": "custom-elements.json",
|
|
75
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "aa19b641f64fbc54c36b7649a8171d7a686abbdd"
|
|
76
77
|
}
|
package/react.d.ts
CHANGED
|
@@ -6,12 +6,18 @@
|
|
|
6
6
|
//
|
|
7
7
|
// Register the elements at module scope before React renders, or React writes an object prop as an
|
|
8
8
|
// attribute and it stringifies.
|
|
9
|
+
//
|
|
10
|
+
// On a server-rendered page (Next.js, React Router SSR) write a camelCase property by its kebab-case attribute
|
|
11
|
+
// name ('row-key', not rowKey): the server emits props verbatim, HTML lowercases them, and hydration does not
|
|
12
|
+
// set properties. Those names are listed next to the properties below.
|
|
9
13
|
|
|
10
14
|
import type { DetailedHTMLProps, HTMLAttributes } from 'react'
|
|
11
15
|
import type { Accordion } from '@c2n/accordion'
|
|
12
16
|
|
|
13
17
|
/** Standard React host-element attributes plus the element's own public properties. */
|
|
14
18
|
type C2Props<T> = DetailedHTMLProps<HTMLAttributes<T>, T> & Partial<Omit<T, keyof HTMLElement>>
|
|
19
|
+
/** What React writes to a custom element's attribute: true becomes the empty string, false removes it. */
|
|
20
|
+
type Attribute = string | number | boolean
|
|
15
21
|
|
|
16
22
|
declare module 'react' {
|
|
17
23
|
namespace JSX {
|