Socket
Socket
Sign inDemoInstall

@zag-js/rating

Package Overview
Dependencies
Maintainers
1
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zag-js/rating - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

6

dist/index.d.ts

@@ -33,2 +33,6 @@ import { RequiredBy, DirectionProperty, CommonProperties, Context, PropTypes, NormalizeProps } from '@zag-js/types';

/**
* The associate form of the underlying input element.
*/
form?: string;
/**
* The current rating value.

@@ -40,3 +44,3 @@ */

*/
readonly?: boolean;
readOnly?: boolean;
/**

@@ -43,0 +47,0 @@ * Whether the rating is disabled.

46

dist/index.js

@@ -240,2 +240,17 @@ "use strict";

}
function trackFormControl(el, options) {
if (!el)
return;
const { onFieldsetDisabled, onFormReset } = options;
const cleanups = [
trackFormReset(el, onFormReset),
trackFieldsetDisabled(el, (disabled) => {
if (disabled)
onFieldsetDisabled();
})
];
return () => {
cleanups.forEach((cleanup) => cleanup == null ? void 0 : cleanup());
};
}

@@ -312,2 +327,3 @@ // src/rating.dom.ts

name: state.context.name,
form: state.context.form,
type: "text",

@@ -329,3 +345,3 @@ hidden: true,

"aria-labelledby": dom.getLabelId(state.context),
tabIndex: state.context.readonly ? 0 : -1,
tabIndex: state.context.readOnly ? 0 : -1,
"data-disabled": dataAttr(isDisabled),

@@ -355,4 +371,4 @@ onPointerMove(event) {

"data-disabled": dataAttr(isDisabled),
"aria-readonly": ariaAttr(state.context.readonly),
"data-readonly": dataAttr(state.context.readonly),
"aria-readonly": ariaAttr(state.context.readOnly),
"data-readonly": dataAttr(state.context.readOnly),
"aria-setsize": state.context.max,

@@ -451,3 +467,3 @@ "aria-checked": isChecked,

disabled: false,
readonly: false,
readOnly: false,
...ctx,

@@ -465,6 +481,6 @@ translations: {

computed: {
isInteractive: (ctx2) => !(ctx2.disabled || ctx2.readonly),
isInteractive: (ctx2) => !(ctx2.disabled || ctx2.readOnly),
isHovering: (ctx2) => ctx2.hoveredValue > -1
},
activities: ["trackFormReset", "trackFieldsetDisabled"],
activities: ["trackFormControlState"],
states: {

@@ -544,3 +560,3 @@ unknown: {

guards: {
isInteractive: (ctx2) => !(ctx2.disabled || ctx2.readonly),
isInteractive: (ctx2) => !(ctx2.disabled || ctx2.readOnly),
isHoveredValueEmpty: (ctx2) => ctx2.hoveredValue === -1,

@@ -554,13 +570,11 @@ isValueEmpty: (ctx2) => ctx2.value <= 0,

activities: {
trackFieldsetDisabled(ctx2) {
return trackFieldsetDisabled(dom.getRootEl(ctx2), (disabled) => {
if (disabled) {
ctx2.disabled = disabled;
trackFormControlState(ctx2) {
return trackFormControl(dom.getInputEl(ctx2), {
onFieldsetDisabled() {
ctx2.disabled = true;
},
onFormReset() {
ctx2.value = ctx2.initialValue;
}
});
},
trackFormReset(ctx2) {
return trackFormReset(dom.getInputEl(ctx2), () => {
ctx2.value = ctx2.initialValue;
});
}

@@ -567,0 +581,0 @@ },

{
"name": "@zag-js/rating",
"version": "0.2.2",
"version": "0.2.3",
"description": "Core logic for the rating widget implemented as a state machine",

@@ -37,3 +37,3 @@ "main": "dist/index.js",

"@zag-js/dom-utils": "0.2.1",
"@zag-js/form-utils": "0.2.1",
"@zag-js/form-utils": "0.2.2",
"@zag-js/utils": "0.3.1"

@@ -40,0 +40,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc