@c2n/rate 0.0.12 → 0.0.14

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/rate.ts","declarations":[{"kind":"class","description":"Accessible star rating control with pointer preview, keyboard adjustment and optional half-star values.","name":"Rate","cssProperties":[{"type":{"text":"pixel"},"name":"--c2-rate__icon--size","default":"24px"},{"type":{"text":"pixel"},"name":"--c2-rate__container--gap","default":"4px"},{"type":{"text":"color"},"name":"--c2-rate__icon--color","default":"#e4e4e7"},{"type":{"text":"color"},"name":"--c2-rate__icon__filled--color","default":"#facc15"},{"type":{"text":"color"},"name":"--c2-rate__icon__preview--color","default":"#fbbf24"},{"type":{"text":"number"},"name":"--c2-rate__icon__hover--scale","default":"1.12"},{"type":{"text":"duration"},"name":"--c2-rate__icon--transition-duration","default":"150ms"},{"type":{"text":"outline"},"name":"--c2-rate__container__focus--outline","default":"2px solid rgba(2, 101, 220, 0.4)"},{"type":{"text":"pixel"},"name":"--c2-rate__container__focus--outline-offset","default":"3px"},{"type":{"text":"border-radius"},"name":"--c2-rate__container--border-radius","default":"4px"},{"type":{"text":"opacity"},"name":"--c2-rate__container__disabled--opacity","default":"0.38"}],"members":[{"kind":"field","name":"formAssociated","type":{"text":"boolean"},"static":true,"default":"true"},{"kind":"field","name":"shadowRootOptions","type":{"text":"object"},"static":true,"default":"{ ...LitElement.shadowRootOptions, delegatesFocus: true }"},{"kind":"field","name":"internals","privacy":"private","readonly":true},{"kind":"field","name":"defaultValue","type":{"text":"number"},"privacy":"private","default":"0"},{"kind":"field","name":"defaultValueCaptured","type":{"text":"boolean"},"privacy":"private","default":"false"},{"kind":"field","name":"customValidityMessage","type":{"text":"string"},"privacy":"private","default":"''"},{"kind":"field","name":"previewValue","type":{"text":"number | null"},"privacy":"private","default":"null"},{"kind":"field","name":"disabledByForm","type":{"text":"boolean"},"privacy":"private","default":"false"},{"kind":"field","name":"value","type":{"text":"number"},"default":"0","description":"Current rating and submitted form value.","attribute":"value","reflects":true},{"kind":"field","name":"max","type":{"text":"number"},"default":"5","description":"Number of rating icons.","attribute":"max","reflects":true},{"kind":"field","name":"allowHalf","type":{"text":"boolean"},"default":"false","description":"Allow values in half-star steps.","attribute":"allow-half","reflects":true},{"kind":"field","name":"clearable","type":{"text":"boolean"},"default":"false","description":"Clicking the committed rating again clears it to zero.","attribute":"clearable","reflects":true},{"kind":"field","name":"readonly","type":{"text":"boolean"},"default":"false","description":"Prevents changes while keeping the rating visually available.","attribute":"readonly","reflects":true},{"kind":"field","name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables interaction and form submission.","attribute":"disabled","reflects":true},{"kind":"field","name":"required","type":{"text":"boolean"},"default":"false","description":"Requires a rating greater than zero for native form validation.","attribute":"required","reflects":true},{"kind":"field","name":"name","type":{"text":"string"},"default":"''","description":"Name used when the rating participates in a form.","attribute":"name"},{"kind":"field","name":"ariaLabel","type":{"text":"string | null"},"default":"null","description":"Accessible name of the rating control.","attribute":"aria-label"},{"kind":"field","name":"form","readonly":true},{"kind":"field","name":"labels","readonly":true},{"kind":"field","name":"validity","readonly":true},{"kind":"field","name":"validationMessage","readonly":true},{"kind":"field","name":"willValidate","readonly":true},{"kind":"method","name":"formResetCallback","return":{"type":{"text":"void"}}},{"kind":"method","name":"formDisabledCallback","return":{"type":{"text":"void"}},"parameters":[{"name":"disabled","type":{"text":"boolean"}}]},{"kind":"method","name":"formStateRestoreCallback","return":{"type":{"text":"void"}},"parameters":[{"name":"state","type":{"text":"string | File | FormData | null"}}]},{"kind":"method","name":"checkValidity","return":{"type":{"text":"boolean"}}},{"kind":"method","name":"reportValidity","return":{"type":{"text":"boolean"}}},{"kind":"method","name":"setCustomValidity","return":{"type":{"text":"void"}},"parameters":[{"name":"message","type":{"text":"string"}}]},{"kind":"field","name":"effectiveDisabled","type":{"text":"boolean"},"privacy":"private","readonly":true},{"kind":"field","name":"step","type":{"text":"number"},"privacy":"private","readonly":true},{"kind":"method","name":"normalizeValue","privacy":"private","return":{"type":{"text":"number"}},"parameters":[{"name":"value","type":{"text":"number"}}]},{"kind":"method","name":"valueFromPointer","privacy":"private","return":{"type":{"text":"number"}},"parameters":[{"name":"event","type":{"text":"PointerEvent"}},{"name":"index","type":{"text":"number"}}]},{"kind":"method","name":"handlePointerMove","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"PointerEvent"}},{"name":"index","type":{"text":"number"}}]},{"kind":"method","name":"handleClick","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"PointerEvent"}},{"name":"index","type":{"text":"number"}}]},{"kind":"method","name":"handleKeydown","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"event","type":{"text":"KeyboardEvent"}}]},{"kind":"method","name":"commit","privacy":"private","return":{"type":{"text":"void"}},"parameters":[{"name":"value","type":{"text":"number"}}]},{"kind":"method","name":"syncFormState","privacy":"private","return":{"type":{"text":"void"}}},{"kind":"method","name":"fillFor","privacy":"private","return":{"type":{"text":"number"}},"parameters":[{"name":"index","type":{"text":"number"}}]},{"kind":"method","name":"renderStar","privacy":"private","parameters":[{"name":"className","type":{"text":"string"}}]}],"events":[{"name":"rate-change","type":{"text":"CustomEvent<RateChangeEventDetail>"},"description":"Fired after the user commits a rating. `detail.value` is the new value."},{"name":"input","type":{"text":"Event"},"description":"Fired with `rate-change` for form and framework bindings."},{"name":"change","type":{"text":"Event"},"description":"Fired with `rate-change` after the value is committed."}],"attributes":[{"name":"value","type":{"text":"number"},"default":"0","description":"Current rating and submitted form value.","fieldName":"value"},{"name":"max","type":{"text":"number"},"default":"5","description":"Number of rating icons.","fieldName":"max"},{"name":"allow-half","type":{"text":"boolean"},"default":"false","description":"Allow values in half-star steps.","fieldName":"allowHalf"},{"name":"clearable","type":{"text":"boolean"},"default":"false","description":"Clicking the committed rating again clears it to zero.","fieldName":"clearable"},{"name":"readonly","type":{"text":"boolean"},"default":"false","description":"Prevents changes while keeping the rating visually available.","fieldName":"readonly"},{"name":"disabled","type":{"text":"boolean"},"default":"false","description":"Disables interaction and form submission.","fieldName":"disabled"},{"name":"required","type":{"text":"boolean"},"default":"false","description":"Requires a rating greater than zero for native form validation.","fieldName":"required"},{"name":"name","type":{"text":"string"},"default":"''","description":"Name used when the rating participates in a form.","fieldName":"name"},{"name":"aria-label","type":{"text":"string | null"},"default":"null","description":"Accessible name of the rating control.","fieldName":"ariaLabel"}],"superclass":{"name":"LitElement","package":"lit"},"tagName":"c2-rate","customElement":true}],"exports":[{"kind":"js","name":"Rate","declaration":{"name":"Rate","module":"src/rate.ts"}},{"kind":"custom-element-definition","name":"c2-rate","declaration":{"name":"Rate","module":"src/rate.ts"}}]}]}
package/dist/rate.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { LitElement, html, unsafeCSS } from "lit";
2
- import { property, state } from "lit/decorators.js";
2
+ import { state } from "lit/decorators.js";
3
+ import { property } from "@c2n/core/lit-helper.js";
3
4
  import { styleMap } from "lit/directives/style-map.js";
4
5
  import { customElement } from "@c2n/core/element-helper.js";
5
6
  //#region src/rate.scss?inline
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c2n/rate",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "main": "dist/rate.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.12",
66
+ "@c2n/core": "0.0.14",
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": "43e38b42ac221ffeef99a773c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