@c2n/kbd 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 +4 -3
- package/react.d.ts +6 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schemaVersion":"1.0.0","readme":"","modules":[{"kind":"javascript-module","path":"src/kbd.ts","declarations":[{"kind":"class","description":"Displays a keyboard key or shortcut with the semantics of the native `kbd` element. Use one element for a complete\nshortcut (`Ctrl + K`) or place several beside descriptive text. The component is presentational and never enters the\ntab order; when it repeats a shortcut already announced by a surrounding control, set `aria-hidden=\"true\"` on the\nhost.","name":"Kbd","cssProperties":[{"type":{"text":"pixel"},"name":"--c2-kbd--min-width","default":"24px"},{"type":{"text":"pixel"},"name":"--c2-kbd--height","default":"24px"},{"type":{"text":"padding"},"name":"--c2-kbd--padding-left","default":"6px"},{"type":{"text":"padding"},"name":"--c2-kbd--padding-right","default":"6px"},{"type":{"text":"pixel"},"description":"Space between multiple slotted nodes.","name":"--c2-kbd--gap","default":"4px"},{"type":{"text":"color"},"name":"--c2-kbd--background-color","default":"#f4f4f5"},{"type":{"text":"color"},"name":"--c2-kbd--color","default":"#52525b"},{"type":{"text":"border"},"name":"--c2-kbd--border","default":"1px solid #d4d4d8"},{"type":{"text":"border-radius"},"name":"--c2-kbd--border-radius","default":"5px"},{"type":{"text":"box-shadow"},"name":"--c2-kbd--box-shadow","default":"0 1px 0 #a1a1aa"},{"type":{"text":"font-family"},"name":"--c2-kbd--font-family","default":"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},{"type":{"text":"font-size"},"name":"--c2-kbd--font-size","default":"12px"},{"type":{"text":"font-weight"},"name":"--c2-kbd--font-weight","default":"500"},{"type":{"text":"line-height"},"name":"--c2-kbd--line-height","default":"1"},{"type":{"text":"pixel"},"name":"--c2-kbd--letter-spacing","default":"0.01em"},{"type":{"text":"text-transform"},"name":"--c2-kbd--text-transform","default":"none"}],"cssParts":[{"name":"kbd","description":"Shadow DOM styling hook for the kbd element."}],"slots":[{"description":"Key name or shortcut to display.","name":""}],"members":[],"superclass":{"name":"LitElement","package":"lit"},"tagName":"c2-kbd","customElement":true}],"exports":[{"kind":"js","name":"Kbd","declaration":{"name":"Kbd","module":"src/kbd.ts"}},{"kind":"custom-element-definition","name":"c2-kbd","declaration":{"name":"Kbd","module":"src/kbd.ts"}}]}]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c2n/kbd",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/kbd.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",
|
|
@@ -62,12 +63,12 @@
|
|
|
62
63
|
}
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
|
-
"@c2n/core": "0.0.
|
|
66
|
+
"@c2n/core": "0.0.13",
|
|
66
67
|
"lit": "3.3.3"
|
|
67
68
|
},
|
|
68
69
|
"devDependencies": {
|
|
69
70
|
"@c2n/config": "*"
|
|
70
71
|
},
|
|
71
72
|
"customElements": "custom-elements.json",
|
|
72
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "aa19b641f64fbc54c36b7649a8171d7a686abbdd"
|
|
73
74
|
}
|
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 { Kbd } from '@c2n/kbd'
|
|
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 {
|