@c2n/icon-button 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.
@@ -0,0 +1 @@
1
+ {"schemaVersion":"1.0.0","readme":"","modules":[{"kind":"javascript-module","path":"src/icon-button.ts","declarations":[{"kind":"class","description":"A round, hoverable button that wraps a slotted icon. Renders a real `<button>` (focus is delegated to\nit) so it is keyboard operable; set `aria-label` on the host to name it.","name":"IconButton","cssProperties":[{"type":{"text":"color"},"name":"--c2-icon-button--background-color"},{"type":{"text":"border-radius"},"name":"--c2-icon-button--border-radius","default":"999px"},{"type":{"text":"border"},"name":"--c2-icon-button--border","default":"none"},{"type":{"text":"color"},"name":"--c2-icon-button__hover--background-color","default":"rgb(230, 230, 230)"},{"type":{"text":"outline"},"name":"--c2-icon-button__focus--outline","default":"2px solid rgba(2, 101, 220, 0.4)"},{"type":{"text":"pixel"},"name":"--c2-icon-button__focus--outline-offset","default":"2px"},{"type":{"text":"opacity"},"name":"--c2-icon-button__disabled--opacity","default":"0.38"},{"type":{"text":"color"},"description":"Pressed state of a toggle button (see `selected`).","name":"--c2-icon-button__selected--background-color","default":"rgb(230, 230, 230)"},{"type":{"text":"pixel"},"name":"--c2-icon-button__icon--width","default":"24px"},{"type":{"text":"pixel"},"name":"--c2-icon-button__icon--height","default":"24px"},{"type":{"text":"color"},"name":"--c2-icon-button__icon--color"},{"type":{"text":"color"},"name":"--c2-icon-button__icon__hover--color"},{"type":{"text":"color"},"name":"--c2-icon-button__icon__selected--color"},{"type":{"text":"pixel"},"name":"--c2-icon-button__state-layer--size","default":"48px"}],"cssParts":[{"name":"button","description":"Shadow DOM styling hook for the button element."}],"slots":[{"description":"The icon (an inline `<svg>`, a `c2-feather-*` or a `c2-mat-icon` element).","name":""}],"members":[{"kind":"field","name":"shadowRootOptions","type":{"text":"object"},"static":true,"default":"{ ...LitElement.shadowRootOptions, delegatesFocus: true }"},{"kind":"field","name":"tooltip","type":{"text":"string | undefined"},"default":"undefined","description":"Tooltip text shown after a short delay; also used as the accessible name when `aria-label` is not set.","attribute":"tooltip"},{"kind":"field","name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables the button: no pointer events, no focus, reduced opacity.","attribute":"disabled","reflects":true},{"kind":"field","name":"ariaLabel","type":{"text":"string | null"},"default":"null","description":"Accessible name forwarded to the inner `<button>`.","attribute":"aria-label"},{"kind":"field","name":"selected","type":{"text":"boolean"},"default":"false","description":"Pressed state of a toggle button (`aria-pressed=\"true\"`); styled with the `__selected--*` variables.","attribute":"selected","reflects":true},{"kind":"field","name":"toggle","type":{"text":"boolean"},"default":"false","description":"Declares a toggle button: `aria-pressed` is announced as `false` while not selected. Set by `c2-button-group` in selection modes.","attribute":"toggle","reflects":true}],"attributes":[{"name":"tooltip","type":{"text":"string | undefined"},"default":"undefined","description":"Tooltip text shown after a short delay; also used as the accessible name when `aria-label` is not set.","fieldName":"tooltip"},{"name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables the button: no pointer events, no focus, reduced opacity.","fieldName":"disabled"},{"name":"aria-label","type":{"text":"string | null"},"default":"null","description":"Accessible name forwarded to the inner `<button>`.","fieldName":"ariaLabel"},{"name":"selected","type":{"text":"boolean"},"default":"false","description":"Pressed state of a toggle button (`aria-pressed=\"true\"`); styled with the `__selected--*` variables.","fieldName":"selected"},{"name":"toggle","type":{"text":"boolean"},"default":"false","description":"Declares a toggle button: `aria-pressed` is announced as `false` while not selected. Set by `c2-button-group` in selection modes.","fieldName":"toggle"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"c2-icon-button","customElement":true}],"exports":[{"kind":"js","name":"IconButton","declaration":{"name":"IconButton","module":"src/icon-button.ts"}},{"kind":"custom-element-definition","name":"c2-icon-button","declaration":{"name":"IconButton","module":"src/icon-button.ts"}}]}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c2n/icon-button",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "main": "dist/icon-button.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",
@@ -61,13 +62,13 @@
61
62
  }
62
63
  },
63
64
  "dependencies": {
64
- "@c2n/core": "0.0.11",
65
- "@c2n/tooltip": "0.0.11",
65
+ "@c2n/core": "0.0.13",
66
+ "@c2n/tooltip": "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": "bf962fba5e49a0ac7555a082584e262949d323a5"
73
+ "gitHead": "aa19b641f64fbc54c36b7649a8171d7a686abbdd"
73
74
  }
package/react.d.ts CHANGED
@@ -6,17 +6,25 @@
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 { IconButton } from '@c2n/icon-button'
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 {
18
24
  interface IntrinsicElements {
19
- 'c2-icon-button': C2Props<IconButton>
25
+ 'c2-icon-button': C2Props<IconButton> & {
26
+ 'aria-label'?: Attribute
27
+ }
20
28
  }
21
29
  }
22
30
  }