@zag-js/progress
Advanced tools
Comparing version 0.0.0-dev-20240123150114 to 0.0.0-dev-20240123160203
@@ -6,6 +6,6 @@ import * as _zag_js_anatomy from '@zag-js/anatomy'; | ||
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "label" | "track" | "range" | "valueText" | "indicator" | "circle" | "circleTrack" | "circleRange">; | ||
declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "label" | "track" | "range" | "valueText" | "view" | "circle" | "circleTrack" | "circleRange">; | ||
type ProgressState = "indeterminate" | "loading" | "complete"; | ||
interface ValueLabelOptions { | ||
interface ValueTranslationDetails { | ||
value: number | null; | ||
@@ -17,3 +17,3 @@ max: number; | ||
interface IntlTranslations { | ||
value(opts: ValueLabelOptions): string; | ||
value(details: ValueTranslationDetails): string; | ||
} | ||
@@ -73,3 +73,3 @@ interface PublicContext extends DirectionProperty, CommonProperties, OrientationProperty { | ||
type Send = StateMachine.Send<StateMachine.AnyEventObject>; | ||
interface IndicatorProps { | ||
interface ViewProps { | ||
state: ProgressState; | ||
@@ -99,3 +99,3 @@ } | ||
rangeProps: T["element"]; | ||
getIndicatorProps(props: IndicatorProps): T["element"]; | ||
getViewProps(props: ViewProps): T["element"]; | ||
circleProps: T["svg"]; | ||
@@ -110,2 +110,2 @@ circleTrackProps: T["circle"]; | ||
export { type MachineApi as Api, type UserDefinedContext as Context, type IndicatorProps, type IntlTranslations, type ValueLabelOptions, anatomy, connect, machine }; | ||
export { type MachineApi as Api, type UserDefinedContext as Context, type IntlTranslations, type ProgressState, type ValueTranslationDetails, type ViewProps, anatomy, connect, machine }; |
@@ -37,3 +37,3 @@ "use strict"; | ||
"valueText", | ||
"indicator", | ||
"view", | ||
"circle", | ||
@@ -142,6 +142,6 @@ "circleTrack", | ||
}), | ||
getIndicatorProps(props) { | ||
getViewProps(props) { | ||
return normalize.element({ | ||
dir: state.context.dir, | ||
...parts.indicator.attrs, | ||
...parts.view.attrs, | ||
"data-state": props.state, | ||
@@ -148,0 +148,0 @@ hidden: props.state !== progressState |
{ | ||
"name": "@zag-js/progress", | ||
"version": "0.0.0-dev-20240123150114", | ||
"version": "0.0.0-dev-20240123160203", | ||
"description": "Core logic for the progress widget implemented as a state machine", | ||
@@ -31,7 +31,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.0.0-dev-20240123150114", | ||
"@zag-js/core": "0.0.0-dev-20240123150114", | ||
"@zag-js/utils": "0.0.0-dev-20240123150114", | ||
"@zag-js/dom-query": "0.0.0-dev-20240123150114", | ||
"@zag-js/types": "0.0.0-dev-20240123150114" | ||
"@zag-js/anatomy": "0.0.0-dev-20240123160203", | ||
"@zag-js/core": "0.0.0-dev-20240123160203", | ||
"@zag-js/dom-query": "0.0.0-dev-20240123160203", | ||
"@zag-js/utils": "0.0.0-dev-20240123160203", | ||
"@zag-js/types": "0.0.0-dev-20240123160203" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
@@ -7,5 +7,6 @@ export { anatomy } from "./progress.anatomy" | ||
UserDefinedContext as Context, | ||
IndicatorProps, | ||
IntlTranslations, | ||
ValueLabelOptions, | ||
ValueTranslationDetails, | ||
ViewProps, | ||
ProgressState, | ||
} from "./progress.types" |
@@ -9,3 +9,3 @@ import { createAnatomy } from "@zag-js/anatomy" | ||
"valueText", | ||
"indicator", | ||
"view", | ||
"circle", | ||
@@ -12,0 +12,0 @@ "circleTrack", |
@@ -107,6 +107,6 @@ import type { NormalizeProps, PropTypes } from "@zag-js/types" | ||
getIndicatorProps(props) { | ||
getViewProps(props) { | ||
return normalize.element({ | ||
dir: state.context.dir, | ||
...parts.indicator.attrs, | ||
...parts.view.attrs, | ||
"data-state": props.state, | ||
@@ -113,0 +113,0 @@ hidden: props.state !== progressState, |
@@ -13,3 +13,3 @@ import type { StateMachine as S } from "@zag-js/core" | ||
export interface ValueLabelOptions { | ||
export interface ValueTranslationDetails { | ||
value: number | null | ||
@@ -22,3 +22,3 @@ max: number | ||
export interface IntlTranslations { | ||
value(opts: ValueLabelOptions): string | ||
value(details: ValueTranslationDetails): string | ||
} | ||
@@ -87,3 +87,3 @@ | ||
export interface IndicatorProps { | ||
export interface ViewProps { | ||
state: ProgressState | ||
@@ -114,3 +114,3 @@ } | ||
rangeProps: T["element"] | ||
getIndicatorProps(props: IndicatorProps): T["element"] | ||
getViewProps(props: ViewProps): T["element"] | ||
circleProps: T["svg"] | ||
@@ -117,0 +117,0 @@ circleTrackProps: T["circle"] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
906
56972
+ Added@zag-js/anatomy@0.0.0-dev-20240123160203(transitive)
+ Added@zag-js/core@0.0.0-dev-20240123160203(transitive)
+ Added@zag-js/dom-query@0.0.0-dev-20240123160203(transitive)
+ Added@zag-js/store@0.0.0-dev-20240123160203(transitive)
+ Added@zag-js/types@0.0.0-dev-20240123160203(transitive)
+ Added@zag-js/utils@0.0.0-dev-20240123160203(transitive)
- Removed@zag-js/anatomy@0.0.0-dev-20240123150114(transitive)
- Removed@zag-js/core@0.0.0-dev-20240123150114(transitive)
- Removed@zag-js/dom-query@0.0.0-dev-20240123150114(transitive)
- Removed@zag-js/store@0.0.0-dev-20240123150114(transitive)
- Removed@zag-js/types@0.0.0-dev-20240123150114(transitive)
- Removed@zag-js/utils@0.0.0-dev-20240123150114(transitive)