@c2n/list-item 0.0.12 → 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/list-item.ts","declarations":[{"kind":"class","description":"A selectable row. On its own it is a toggle: click, Enter or Space flips `selected`. Inside a `c2-list` (and\ntherefore inside a `c2-select`) the list drives the selected state through context, handles the keyboard and the row\nonly reports clicks. The default slot is the primary text, `description` a second, muted line, `prefix-icon` and\n`suffix-icon` take an inline SVG, a `c2-feather-*` icon or a `c2-mat-icon` and are sized by\n`--c2-list-item__icon--size` — anything else in them, a shortcut hint or a badge, keeps its own size.\nWith `href` the row is a link. In a multiple-selection list, adjacent selected rows lose the corner radius between\nthem (the list marks them `joined-before` / `joined-after`) so a run of selected rows reads as one block.\n\nAccessibility: standalone rows are `role=\"button\"` with `aria-pressed`; rows in a list are `role=\"option\"` with\n`aria-selected` and a roving `tabindex` managed by the list. Set your own `role` to override.","name":"ListItem","cssProperties":[{"type":{"text":"pixel"},"name":"--c2-list-item--min-height","default":"36px"},{"type":{"text":"pixel"},"description":"Space between the icons and the content.","name":"--c2-list-item--gap","default":"8px"},{"type":{"text":"border-radius"},"name":"--c2-list-item--border-top-left-radius","default":"6px"},{"type":{"text":"border-radius"},"name":"--c2-list-item--border-top-right-radius","default":"6px"},{"type":{"text":"border-radius"},"name":"--c2-list-item--border-bottom-left-radius","default":"6px"},{"type":{"text":"border-radius"},"name":"--c2-list-item--border-bottom-right-radius","default":"6px"},{"type":{"text":"padding"},"name":"--c2-list-item--padding-top","default":"6px"},{"type":{"text":"padding"},"name":"--c2-list-item--padding-right","default":"10px"},{"type":{"text":"padding"},"name":"--c2-list-item--padding-bottom","default":"6px"},{"type":{"text":"padding"},"name":"--c2-list-item--padding-left","default":"10px"},{"type":{"text":"font-size"},"name":"--c2-list-item--font-size","default":"14px"},{"type":{"text":"font-weight"},"name":"--c2-list-item--font-weight"},{"type":{"text":"font-style"},"name":"--c2-list-item--font-style"},{"type":{"text":"font-family"},"name":"--c2-list-item--font-family"},{"type":{"text":"pixel"},"name":"--c2-list-item--line-height","default":"20px"},{"type":{"text":"border"},"name":"--c2-list-item--border-top"},{"type":{"text":"border"},"name":"--c2-list-item--border-bottom"},{"type":{"text":"border"},"name":"--c2-list-item--border-right"},{"type":{"text":"border"},"name":"--c2-list-item--border-left"},{"type":{"text":"color"},"name":"--c2-list-item--color","default":"#18181b"},{"type":{"text":"color"},"name":"--c2-list-item--background","default":"transparent"},{"type":{"text":"color"},"name":"--c2-list-item__description--color","default":"#71717a"},{"type":{"text":"font-size"},"name":"--c2-list-item__description--font-size","default":"12px"},{"type":{"text":"pixel"},"name":"--c2-list-item__description--line-height","default":"16px"},{"type":{"text":"pixel"},"name":"--c2-list-item__description--margin-top","default":"1px"},{"type":{"text":"border"},"name":"--c2-list-item__hover--border-top"},{"type":{"text":"border"},"name":"--c2-list-item__hover--border-bottom"},{"type":{"text":"border"},"name":"--c2-list-item__hover--border-right"},{"type":{"text":"border"},"name":"--c2-list-item__hover--border-left"},{"type":{"text":"color"},"name":"--c2-list-item__hover--color"},{"type":{"text":"color"},"name":"--c2-list-item__hover--background","default":"#f4f4f5"},{"type":{"text":"border"},"name":"--c2-list-item__selected--border-top"},{"type":{"text":"border"},"name":"--c2-list-item__selected--border-bottom"},{"type":{"text":"border"},"name":"--c2-list-item__selected--border-right"},{"type":{"text":"border"},"name":"--c2-list-item__selected--border-left"},{"type":{"text":"color"},"name":"--c2-list-item__selected--color","default":"#2f56e6"},{"type":{"text":"color"},"name":"--c2-list-item__selected--background","default":"#edf1fe"},{"type":{"text":"color"},"name":"--c2-list-item__selected__hover--background","default":"#e2e9fd"},{"type":{"text":"color"},"description":"Defaults to the description colour.","name":"--c2-list-item__selected__description--color"},{"type":{"text":"outline"},"name":"--c2-list-item__focus--outline","default":"2px solid rgba(2, 101, 220, 0.4)"},{"type":{"text":"pixel"},"name":"--c2-list-item__focus--outline-offset","default":"-2px"},{"type":{"text":"opacity"},"name":"--c2-list-item__disabled--opacity","default":"0.38"},{"type":{"text":"pixel"},"name":"--c2-list-item__icon--size","default":"16px"},{"type":{"text":"color"},"description":"Defaults to the row text colour.","name":"--c2-list-item__icon--color"}],"slots":[{"description":"The row content. Falls back to `label`, then `value`, when empty.","name":"default"},{"description":"Secondary line under the content (muted, smaller).","name":"description"},{"description":"Icon (or avatar, badge, …) shown before the content.","name":"prefix-icon"},{"description":"Icon shown after the content, e.g. a check mark or shortcut hint.","name":"suffix-icon"}],"members":[{"kind":"field","name":"contextConsumer","privacy":"private","default":"new ContextConsumer(this, { context: selectedItemValueContext, subscribe: true, callback: (value) => { this.selected = value ? value.includes(this.value) : false }, })"},{"kind":"field","name":"selected","type":{"text":"boolean"},"default":"false","description":"Whether the row is selected. Toggled by a click on a standalone row; controlled by the list otherwise.","attribute":"selected","reflects":true},{"kind":"field","name":"disabled","type":{"text":"boolean"},"default":"false","description":"Dims the row and ignores clicks and keyboard.","attribute":"disabled","reflects":true},{"kind":"field","name":"value","type":{"text":"string"},"default":"''","description":"The value reported to the parent list / select.","attribute":"value","reflects":true},{"kind":"field","name":"label","type":{"text":"string | undefined"},"description":"Text shown by the parent select for this row instead of the slotted content. Also the fallback content of the\ndefault slot when it is empty. Use it when the row content is rich (icons, two lines) but the trigger should show a\nshort label.","attribute":"label","reflects":true},{"kind":"field","name":"href","type":{"text":"string | undefined"},"default":"undefined","description":"Makes the row a link. Selection still works when the row sits in a list.","attribute":"href"},{"kind":"field","name":"target","type":{"text":"string | undefined"},"default":"undefined","description":"Browsing context used when `href` is set, such as `_blank`.","attribute":"target"},{"kind":"field","name":"data","type":{"text":"unknown | undefined"},"description":"Arbitrary payload returned alongside `value` in the list's `selection-change` event. Not an attribute."},{"kind":"field","name":"applyContext","type":{"text":"boolean"},"default":"false","description":"Private property, it will use context value to setup selected state of component."},{"kind":"field","name":"hasDescription","type":{"text":"boolean"},"privacy":"private","default":"false"},{"kind":"field","name":"contentSlot","type":{"text":"HTMLSlotElement"},"privacy":"private"},{"kind":"field","name":"authorRole","type":{"text":"string | null"},"privacy":"private","default":"null","description":"`role` written by the author, kept over the automatic one."},{"kind":"field","name":"displayText","type":{"text":"string"},"description":"The text a `c2-select` shows for this row: `label` when set, otherwise the text content of the default slot.","readonly":true},{"kind":"field","name":"blockDisabledClick","privacy":"private"},{"kind":"method","name":"activate","description":"Behaves like a click: dispatches `click` on the row and, for a standalone row, toggles `selected`."},{"kind":"field","name":"handleClick","privacy":"private"},{"kind":"field","name":"handleKeydown","privacy":"private"},{"kind":"method","name":"handleDescriptionSlotChange","privacy":"private","parameters":[{"name":"event","type":{"text":"Event"}}]},{"kind":"method","name":"updateDescription","privacy":"private","parameters":[{"name":"slot","type":{"text":"HTMLSlotElement"}}]},{"kind":"method","name":"syncAria","privacy":"private"},{"kind":"method","name":"renderInner","privacy":"private"}],"events":[{"name":"click","type":{"text":"MouseEvent"},"description":"Fired when an enabled row is activated; a row with `href` also navigates."},{"name":"selected-change","type":{"text":"CustomEvent<{ selected: boolean; value: string }>"},"description":"Fired after `selected` changes, whether from a click or from the parent list."}],"attributes":[{"name":"selected","type":{"text":"boolean"},"default":"false","description":"Whether the row is selected. Toggled by a click on a standalone row; controlled by the list otherwise.","fieldName":"selected"},{"name":"disabled","type":{"text":"boolean"},"default":"false","description":"Dims the row and ignores clicks and keyboard.","fieldName":"disabled"},{"name":"value","type":{"text":"string"},"default":"''","description":"The value reported to the parent list / select.","fieldName":"value"},{"name":"label","type":{"text":"string | undefined"},"description":"Text shown by the parent select for this row instead of the slotted content. Also the fallback content of the\ndefault slot when it is empty. Use it when the row content is rich (icons, two lines) but the trigger should show a\nshort label.","fieldName":"label"},{"name":"href","type":{"text":"string | undefined"},"default":"undefined","description":"Makes the row a link. Selection still works when the row sits in a list.","fieldName":"href"},{"name":"target","type":{"text":"string | undefined"},"default":"undefined","description":"Browsing context used when `href` is set, such as `_blank`.","fieldName":"target"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"c2-list-item","customElement":true}],"exports":[{"kind":"js","name":"ListItem","declaration":{"name":"ListItem","module":"src/list-item.ts"}},{"kind":"custom-element-definition","name":"c2-list-item","declaration":{"name":"ListItem","module":"src/list-item.ts"}}]}]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c2n/list-item",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "main": "dist/list-item.js",
6
6
  "exports": {
@@ -25,6 +25,7 @@
25
25
  "files": [
26
26
  "dist",
27
27
  "types",
28
+ "custom-elements.json",
28
29
  "react.d.ts",
29
30
  "react.js",
30
31
  "vue.d.ts",
@@ -64,7 +65,7 @@
64
65
  }
65
66
  },
66
67
  "dependencies": {
67
- "@c2n/core": "0.0.12",
68
+ "@c2n/core": "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": "43e38b42ac221ffeef99a773c42dd3356961d26a"
76
+ "gitHead": "aa19b641f64fbc54c36b7649a8171d7a686abbdd"
76
77
  }