@hanzogui/progress 8.3.0 → 8.3.2
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.
- package/dist/cjs/Progress.js +133 -0
- package/dist/cjs/Progress.js.map +1 -0
- package/dist/cjs/index.js +5 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/Progress.js +128 -0
- package/dist/esm/Progress.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +21 -21
- package/src/index.ts +1 -1
- package/types/Progress.d.ts +11 -11
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/dist/cjs/Progress.cjs +0 -178
- package/dist/cjs/Progress.native.js +0 -185
- package/dist/cjs/Progress.native.js.map +0 -1
- package/dist/cjs/index.cjs +0 -20
- package/dist/cjs/index.native.js +0 -23
- package/dist/cjs/index.native.js.map +0 -1
- package/dist/esm/Progress.mjs +0 -149
- package/dist/esm/Progress.mjs.map +0 -1
- package/dist/esm/Progress.native.js +0 -153
- package/dist/esm/Progress.native.js.map +0 -1
- package/dist/esm/index.mjs +0 -2
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -2
- package/dist/esm/index.native.js.map +0 -1
- package/dist/jsx/Progress.mjs +0 -149
- package/dist/jsx/Progress.mjs.map +0 -1
- package/dist/jsx/Progress.native.js +0 -185
- package/dist/jsx/Progress.native.js.map +0 -1
- package/dist/jsx/index.js +0 -2
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs +0 -2
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/index.native.js +0 -23
- package/dist/jsx/index.native.js.map +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProgressIndicator = exports.Progress = exports.createProgressScope = exports.ProgressFrame = exports.ProgressIndicatorFrame = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const core_1 = require("@hanzogui/core");
|
|
6
|
+
const create_context_1 = require("@hanzogui/create-context");
|
|
7
|
+
const get_token_1 = require("@hanzogui/get-token");
|
|
8
|
+
const helpers_1 = require("@hanzogui/helpers");
|
|
9
|
+
const stacks_1 = require("@hanzogui/stacks");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const PROGRESS_NAME = 'Progress';
|
|
12
|
+
const [createProgressContext, createProgressScope] = (0, create_context_1.createContextScope)(PROGRESS_NAME);
|
|
13
|
+
exports.createProgressScope = createProgressScope;
|
|
14
|
+
const [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);
|
|
15
|
+
/* -------------------------------------------------------------------------------------------------
|
|
16
|
+
* ProgressIndicator
|
|
17
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
18
|
+
const INDICATOR_NAME = 'ProgressIndicator';
|
|
19
|
+
exports.ProgressIndicatorFrame = (0, core_1.styled)(stacks_1.YStack, {
|
|
20
|
+
name: INDICATOR_NAME,
|
|
21
|
+
variants: {
|
|
22
|
+
unstyled: {
|
|
23
|
+
false: {
|
|
24
|
+
height: '100%',
|
|
25
|
+
width: '100%',
|
|
26
|
+
backgroundColor: '$background',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
unstyled: process.env.GUI_HEADLESS === '1',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
const ProgressIndicator = exports.ProgressIndicatorFrame.styleable(function ProgressIndicator(props, forwardedRef) {
|
|
35
|
+
const { __scopeProgress, transition, ...indicatorProps } = props;
|
|
36
|
+
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
37
|
+
const progressRatio = (context.value ?? 0) / context.max;
|
|
38
|
+
// indicator is 2x container width so bouncy animations can overshoot
|
|
39
|
+
// without visually extending past the right edge (parent has overflow:hidden)
|
|
40
|
+
// translateX percentage is relative to element's own width (200% of container)
|
|
41
|
+
// so we divide by 2 to get container-relative positioning:
|
|
42
|
+
// at 0%: x = -100% of element = -200% of container (fully hidden left)
|
|
43
|
+
// at 100%: x = -50% of element = -100% of container (right half visible)
|
|
44
|
+
let x;
|
|
45
|
+
if (core_1.isWeb) {
|
|
46
|
+
// web: use percentage-based translateX for SSR-friendly rendering
|
|
47
|
+
// formula: -100% + (progressRatio * 50%) since translateX % is relative to element width
|
|
48
|
+
x = `${-100 + progressRatio * 50}%`;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// native: use pixel-based transform (RN doesn't support percentage transforms reliably)
|
|
52
|
+
const baseWidth = context.width || 0;
|
|
53
|
+
x = Math.ceil(-baseWidth * (2 - progressRatio));
|
|
54
|
+
}
|
|
55
|
+
return ((0, jsx_runtime_1.jsx)(exports.ProgressIndicatorFrame, { "data-state": getProgressState(context.value, context.max), "data-value": context.value ?? undefined, "data-max": context.max, x: x, width: "200%", ...(!props.unstyled && {
|
|
56
|
+
animateOnly: ['transform'],
|
|
57
|
+
// on native, hide until we have width measurement
|
|
58
|
+
...(!core_1.isWeb && context.width === 0 && { opacity: 0 }),
|
|
59
|
+
}), ...indicatorProps, ref: forwardedRef, transition: !core_1.isWeb && !context.width ? null : transition }));
|
|
60
|
+
});
|
|
61
|
+
exports.ProgressIndicator = ProgressIndicator;
|
|
62
|
+
/* ---------------------------------------------------------------------------------------------- */
|
|
63
|
+
function defaultGetValueLabel(value, max) {
|
|
64
|
+
return `${Math.round((value / max) * 100)}%`;
|
|
65
|
+
}
|
|
66
|
+
function getProgressState(value, maxValue) {
|
|
67
|
+
return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';
|
|
68
|
+
}
|
|
69
|
+
function isNumber(value) {
|
|
70
|
+
return typeof value === 'number';
|
|
71
|
+
}
|
|
72
|
+
function isValidMaxNumber(max) {
|
|
73
|
+
return isNumber(max) && !Number.isNaN(max) && max > 0;
|
|
74
|
+
}
|
|
75
|
+
function isValidValueNumber(value, max) {
|
|
76
|
+
return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
|
|
77
|
+
}
|
|
78
|
+
/* -------------------------------------------------------------------------------------------------
|
|
79
|
+
* Progress
|
|
80
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
81
|
+
const DEFAULT_MAX = 100;
|
|
82
|
+
exports.ProgressFrame = (0, core_1.styled)(stacks_1.YStack, {
|
|
83
|
+
name: 'Progress',
|
|
84
|
+
variants: {
|
|
85
|
+
unstyled: {
|
|
86
|
+
false: {
|
|
87
|
+
borderRadius: 100000,
|
|
88
|
+
overflow: 'hidden',
|
|
89
|
+
backgroundColor: '$background',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
size: {
|
|
93
|
+
'...size': (val) => {
|
|
94
|
+
const size = Math.round((0, core_1.getVariableValue)((0, get_token_1.getSize)(val)) * 0.25);
|
|
95
|
+
return {
|
|
96
|
+
height: size,
|
|
97
|
+
minWidth: (0, core_1.getVariableValue)(size) * 20,
|
|
98
|
+
width: '100%',
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
defaultVariants: {
|
|
104
|
+
unstyled: process.env.GUI_HEADLESS === '1',
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
const Progress = (0, helpers_1.withStaticProperties)(exports.ProgressFrame.styleable(function Progress(props, forwardedRef) {
|
|
108
|
+
const {
|
|
109
|
+
// @ts-expect-error
|
|
110
|
+
__scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = '$true', ...progressProps } = props;
|
|
111
|
+
const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
|
|
112
|
+
const value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;
|
|
113
|
+
const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined;
|
|
114
|
+
// only needed for native where we can't use percentage-based transforms
|
|
115
|
+
const [width, setWidth] = (0, react_1.useState)(0);
|
|
116
|
+
return ((0, jsx_runtime_1.jsx)(ProgressProvider, { scope: __scopeProgress, value: value, max: max, width: width, children: (0, jsx_runtime_1.jsx)(exports.ProgressFrame, { "aria-valuemax": max, "aria-valuemin": 0, "aria-valuenow": isNumber(value) ? value : undefined, "aria-valuetext": valueLabel,
|
|
117
|
+
// @ts-ignore
|
|
118
|
+
role: "progressbar", "data-state": getProgressState(value, max), "data-value": value ?? undefined, "data-max": max, ...(progressProps.unstyled !== true && {
|
|
119
|
+
size,
|
|
120
|
+
}), ...progressProps, ...(!core_1.isWeb && {
|
|
121
|
+
onLayout: (e) => {
|
|
122
|
+
const newWidth = Math.round(e.nativeEvent.layout.width);
|
|
123
|
+
if (newWidth !== width) {
|
|
124
|
+
setWidth(newWidth);
|
|
125
|
+
}
|
|
126
|
+
progressProps.onLayout?.(e);
|
|
127
|
+
},
|
|
128
|
+
}), ref: forwardedRef }) }));
|
|
129
|
+
}), {
|
|
130
|
+
Indicator: ProgressIndicator,
|
|
131
|
+
});
|
|
132
|
+
exports.Progress = Progress;
|
|
133
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../src/Progress.tsx"],"names":[],"mappings":";;;;AAIA,yCAAgE;AAEhE,6DAA6D;AAC7D,mDAA6C;AAC7C,+CAAwD;AACxD,6CAAyC;AACzC,iCAAgC;AAEhC,MAAM,aAAa,GAAG,UAAU,CAAA;AAEhC,MAAM,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,GAAG,IAAA,mCAAkB,EAAC,aAAa,CAAC,CAAA;QAgN7E,mBAAmB;AAxM5B,MAAM,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAC1C,qBAAqB,CAAuB,aAAa,CAAC,CAAA;AAE5D;;oGAEoG;AAEpG,MAAM,cAAc,GAAG,mBAAmB,CAAA;AAE7B,QAAA,sBAAsB,GAAG,IAA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,CACpB,CAAA;AACH,CAAC,CAAC,EACF;IACE,SAAS,EAAE,iBAAiB;CAC7B,CACF,CAAA;QAE6B,QAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "commonjs" }
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getVariableValue, isWeb, styled } from '@hanzogui/core';
|
|
3
|
+
import { createContextScope } from '@hanzogui/create-context';
|
|
4
|
+
import { getSize } from '@hanzogui/get-token';
|
|
5
|
+
import { withStaticProperties } from '@hanzogui/helpers';
|
|
6
|
+
import { YStack } from '@hanzogui/stacks';
|
|
7
|
+
import { useState } from 'react';
|
|
8
|
+
const PROGRESS_NAME = 'Progress';
|
|
9
|
+
const [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);
|
|
10
|
+
const [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);
|
|
11
|
+
/* -------------------------------------------------------------------------------------------------
|
|
12
|
+
* ProgressIndicator
|
|
13
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
14
|
+
const INDICATOR_NAME = 'ProgressIndicator';
|
|
15
|
+
export const ProgressIndicatorFrame = styled(YStack, {
|
|
16
|
+
name: INDICATOR_NAME,
|
|
17
|
+
variants: {
|
|
18
|
+
unstyled: {
|
|
19
|
+
false: {
|
|
20
|
+
height: '100%',
|
|
21
|
+
width: '100%',
|
|
22
|
+
backgroundColor: '$background',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
unstyled: process.env.GUI_HEADLESS === '1',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const ProgressIndicator = ProgressIndicatorFrame.styleable(function ProgressIndicator(props, forwardedRef) {
|
|
31
|
+
const { __scopeProgress, transition, ...indicatorProps } = props;
|
|
32
|
+
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
33
|
+
const progressRatio = (context.value ?? 0) / context.max;
|
|
34
|
+
// indicator is 2x container width so bouncy animations can overshoot
|
|
35
|
+
// without visually extending past the right edge (parent has overflow:hidden)
|
|
36
|
+
// translateX percentage is relative to element's own width (200% of container)
|
|
37
|
+
// so we divide by 2 to get container-relative positioning:
|
|
38
|
+
// at 0%: x = -100% of element = -200% of container (fully hidden left)
|
|
39
|
+
// at 100%: x = -50% of element = -100% of container (right half visible)
|
|
40
|
+
let x;
|
|
41
|
+
if (isWeb) {
|
|
42
|
+
// web: use percentage-based translateX for SSR-friendly rendering
|
|
43
|
+
// formula: -100% + (progressRatio * 50%) since translateX % is relative to element width
|
|
44
|
+
x = `${-100 + progressRatio * 50}%`;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
// native: use pixel-based transform (RN doesn't support percentage transforms reliably)
|
|
48
|
+
const baseWidth = context.width || 0;
|
|
49
|
+
x = Math.ceil(-baseWidth * (2 - progressRatio));
|
|
50
|
+
}
|
|
51
|
+
return (_jsx(ProgressIndicatorFrame, { "data-state": getProgressState(context.value, context.max), "data-value": context.value ?? undefined, "data-max": context.max, x: x, width: "200%", ...(!props.unstyled && {
|
|
52
|
+
animateOnly: ['transform'],
|
|
53
|
+
// on native, hide until we have width measurement
|
|
54
|
+
...(!isWeb && context.width === 0 && { opacity: 0 }),
|
|
55
|
+
}), ...indicatorProps, ref: forwardedRef, transition: !isWeb && !context.width ? null : transition }));
|
|
56
|
+
});
|
|
57
|
+
/* ---------------------------------------------------------------------------------------------- */
|
|
58
|
+
function defaultGetValueLabel(value, max) {
|
|
59
|
+
return `${Math.round((value / max) * 100)}%`;
|
|
60
|
+
}
|
|
61
|
+
function getProgressState(value, maxValue) {
|
|
62
|
+
return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';
|
|
63
|
+
}
|
|
64
|
+
function isNumber(value) {
|
|
65
|
+
return typeof value === 'number';
|
|
66
|
+
}
|
|
67
|
+
function isValidMaxNumber(max) {
|
|
68
|
+
return isNumber(max) && !Number.isNaN(max) && max > 0;
|
|
69
|
+
}
|
|
70
|
+
function isValidValueNumber(value, max) {
|
|
71
|
+
return isNumber(value) && !Number.isNaN(value) && value <= max && value >= 0;
|
|
72
|
+
}
|
|
73
|
+
/* -------------------------------------------------------------------------------------------------
|
|
74
|
+
* Progress
|
|
75
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
76
|
+
const DEFAULT_MAX = 100;
|
|
77
|
+
export const ProgressFrame = styled(YStack, {
|
|
78
|
+
name: 'Progress',
|
|
79
|
+
variants: {
|
|
80
|
+
unstyled: {
|
|
81
|
+
false: {
|
|
82
|
+
borderRadius: 100000,
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
backgroundColor: '$background',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
size: {
|
|
88
|
+
'...size': (val) => {
|
|
89
|
+
const size = Math.round(getVariableValue(getSize(val)) * 0.25);
|
|
90
|
+
return {
|
|
91
|
+
height: size,
|
|
92
|
+
minWidth: getVariableValue(size) * 20,
|
|
93
|
+
width: '100%',
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
defaultVariants: {
|
|
99
|
+
unstyled: process.env.GUI_HEADLESS === '1',
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
const Progress = withStaticProperties(ProgressFrame.styleable(function Progress(props, forwardedRef) {
|
|
103
|
+
const {
|
|
104
|
+
// @ts-expect-error
|
|
105
|
+
__scopeProgress, value: valueProp, max: maxProp, getValueLabel = defaultGetValueLabel, size = '$true', ...progressProps } = props;
|
|
106
|
+
const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;
|
|
107
|
+
const value = isValidValueNumber(valueProp, max) ? Math.round(valueProp) : null;
|
|
108
|
+
const valueLabel = isNumber(value) ? getValueLabel(value, max) : undefined;
|
|
109
|
+
// only needed for native where we can't use percentage-based transforms
|
|
110
|
+
const [width, setWidth] = useState(0);
|
|
111
|
+
return (_jsx(ProgressProvider, { scope: __scopeProgress, value: value, max: max, width: width, children: _jsx(ProgressFrame, { "aria-valuemax": max, "aria-valuemin": 0, "aria-valuenow": isNumber(value) ? value : undefined, "aria-valuetext": valueLabel,
|
|
112
|
+
// @ts-ignore
|
|
113
|
+
role: "progressbar", "data-state": getProgressState(value, max), "data-value": value ?? undefined, "data-max": max, ...(progressProps.unstyled !== true && {
|
|
114
|
+
size,
|
|
115
|
+
}), ...progressProps, ...(!isWeb && {
|
|
116
|
+
onLayout: (e) => {
|
|
117
|
+
const newWidth = Math.round(e.nativeEvent.layout.width);
|
|
118
|
+
if (newWidth !== width) {
|
|
119
|
+
setWidth(newWidth);
|
|
120
|
+
}
|
|
121
|
+
progressProps.onLayout?.(e);
|
|
122
|
+
},
|
|
123
|
+
}), ref: forwardedRef }) }));
|
|
124
|
+
}), {
|
|
125
|
+
Indicator: ProgressIndicator,
|
|
126
|
+
});
|
|
127
|
+
export { createProgressScope, Progress, ProgressIndicator };
|
|
128
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Progress.js","sourceRoot":"","sources":["../../src/Progress.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,MAAM,aAAa,GAAG,UAAU,CAAA;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QAAQ,KAAK,KAAK,EAAE,CAAC;wBACvB,QAAQ,CAAC,QAAQ,CAAC,CAAA;oBACpB,CAAC;oBACD,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;gBAC7B,CAAC;aACF,CAAC,EACF,GAAG,EAAE,YAAY,GACjB,GACe,CACpB,CAAA;AACH,CAAC,CAAC,EACF;IACE,SAAS,EAAE,iBAAiB;CAC7B,CACF,CAAA;AAED,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAA"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from './Progress.js';
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzogui/progress",
|
|
3
|
-
"version": "8.3.
|
|
3
|
+
"version": "8.3.2",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -9,46 +9,46 @@
|
|
|
9
9
|
],
|
|
10
10
|
"type": "module",
|
|
11
11
|
"sideEffects": false,
|
|
12
|
-
"main": "dist/cjs",
|
|
13
|
-
"module": "dist/esm",
|
|
12
|
+
"main": "./dist/cjs/index.js",
|
|
13
|
+
"module": "./dist/esm/index.js",
|
|
14
14
|
"types": "./types/index.d.ts",
|
|
15
15
|
"exports": {
|
|
16
16
|
"./package.json": "./package.json",
|
|
17
17
|
".": {
|
|
18
18
|
"types": "./types/index.d.ts",
|
|
19
|
-
"react-native": "./dist/esm/index.
|
|
20
|
-
"browser": "./dist/esm/index.
|
|
21
|
-
"module": "./dist/esm/index.
|
|
22
|
-
"import": "./dist/esm/index.
|
|
23
|
-
"require": "./dist/cjs/index.
|
|
24
|
-
"default": "./dist/esm/index.
|
|
19
|
+
"react-native": "./dist/esm/index.js",
|
|
20
|
+
"browser": "./dist/esm/index.js",
|
|
21
|
+
"module": "./dist/esm/index.js",
|
|
22
|
+
"import": "./dist/esm/index.js",
|
|
23
|
+
"require": "./dist/cjs/index.js",
|
|
24
|
+
"default": "./dist/esm/index.js"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "hanzogui-build",
|
|
31
|
+
"build": "hanzogui-build --skip-native",
|
|
32
32
|
"watch": "hanzogui-build --watch",
|
|
33
33
|
"clean": "hanzogui-build clean",
|
|
34
34
|
"clean:build": "hanzogui-build clean:build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@hanzogui/compose-refs": "8.3.
|
|
38
|
-
"@hanzogui/core": "8.3.
|
|
39
|
-
"@hanzogui/create-context": "8.3.
|
|
40
|
-
"@hanzogui/get-token": "8.3.
|
|
41
|
-
"@hanzogui/helpers": "8.3.
|
|
42
|
-
"@hanzogui/stacks": "8.3.
|
|
43
|
-
"@hanzogui/web": "8.3.
|
|
37
|
+
"@hanzogui/compose-refs": "8.3.2",
|
|
38
|
+
"@hanzogui/core": "8.3.2",
|
|
39
|
+
"@hanzogui/create-context": "8.3.2",
|
|
40
|
+
"@hanzogui/get-token": "8.3.2",
|
|
41
|
+
"@hanzogui/helpers": "8.3.2",
|
|
42
|
+
"@hanzogui/stacks": "8.3.2",
|
|
43
|
+
"@hanzogui/web": "8.3.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@hanzogui/build": "8.3.
|
|
47
|
-
"react": "
|
|
48
|
-
"react-native": "0.
|
|
46
|
+
"@hanzogui/build": "8.3.2",
|
|
47
|
+
"react": "19.2.8",
|
|
48
|
+
"react-native": "^0.87.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"react": ">=19"
|
|
51
|
+
"react": ">=19.2.8"
|
|
52
52
|
},
|
|
53
53
|
"module:jsx": "dist/jsx",
|
|
54
54
|
"repository": {
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Progress'
|
|
1
|
+
export * from './Progress.tsx'
|
package/types/Progress.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { GetProps } from '@hanzogui/core';
|
|
2
2
|
declare const createProgressScope: import("@hanzogui/create-context").CreateScope;
|
|
3
3
|
export declare const ProgressIndicatorFrame: import("@hanzogui/web").GuiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
4
|
-
unstyled?: boolean | undefined;
|
|
5
4
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
6
5
|
fullscreen?: boolean | undefined;
|
|
6
|
+
unstyled?: boolean | undefined;
|
|
7
7
|
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
8
8
|
export type ProgressIndicatorProps = GetProps<typeof ProgressIndicatorFrame>;
|
|
9
9
|
declare const ProgressIndicator: import("@hanzogui/web").GuiComponent<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
10
|
-
unstyled?: boolean | undefined;
|
|
11
10
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
12
11
|
fullscreen?: boolean | undefined;
|
|
13
|
-
}>, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps & void, import("@hanzogui/web").StackStyleBase, {
|
|
14
12
|
unstyled?: boolean | undefined;
|
|
13
|
+
}>, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps & void, import("@hanzogui/web").StackStyleBase, {
|
|
15
14
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
16
15
|
fullscreen?: boolean | undefined;
|
|
16
|
+
unstyled?: boolean | undefined;
|
|
17
17
|
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
18
18
|
export declare const ProgressFrame: import("@hanzogui/web").GuiComponent<import("@hanzogui/web").TamaDefer, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
19
|
-
unstyled?: boolean | undefined;
|
|
20
19
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
21
20
|
fullscreen?: boolean | undefined;
|
|
22
21
|
size?: import("@hanzogui/web").SizeTokens | undefined;
|
|
22
|
+
unstyled?: boolean | undefined;
|
|
23
23
|
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
24
24
|
export interface ProgressExtraProps {
|
|
25
25
|
value?: number | null | undefined;
|
|
@@ -28,41 +28,41 @@ export interface ProgressExtraProps {
|
|
|
28
28
|
}
|
|
29
29
|
export type ProgressProps = GetProps<typeof ProgressFrame> & ProgressExtraProps;
|
|
30
30
|
declare const Progress: import("react").ForwardRefExoticComponent<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
31
|
-
unstyled?: boolean | undefined;
|
|
32
31
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
33
32
|
fullscreen?: boolean | undefined;
|
|
34
33
|
size?: import("@hanzogui/web").SizeTokens | undefined;
|
|
35
|
-
}>, keyof ProgressExtraProps> & ProgressExtraProps & import("react").RefAttributes<import("@hanzogui/web").GuiElement>> & import("@hanzogui/web").StaticComponentObject<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
36
34
|
unstyled?: boolean | undefined;
|
|
35
|
+
}>, keyof ProgressExtraProps> & ProgressExtraProps & import("react").RefAttributes<import("@hanzogui/web").GuiElement>> & import("@hanzogui/web").StaticComponentObject<Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
37
36
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
38
37
|
fullscreen?: boolean | undefined;
|
|
39
38
|
size?: import("@hanzogui/web").SizeTokens | undefined;
|
|
40
|
-
}>, keyof ProgressExtraProps> & ProgressExtraProps, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps & ProgressExtraProps, import("@hanzogui/web").StackStyleBase, {
|
|
41
39
|
unstyled?: boolean | undefined;
|
|
40
|
+
}>, keyof ProgressExtraProps> & ProgressExtraProps, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps & ProgressExtraProps, import("@hanzogui/web").StackStyleBase, {
|
|
42
41
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
43
42
|
fullscreen?: boolean | undefined;
|
|
44
43
|
size?: import("@hanzogui/web").SizeTokens | undefined;
|
|
44
|
+
unstyled?: boolean | undefined;
|
|
45
45
|
}, import("@hanzogui/web").StaticConfigPublic> & Omit<import("@hanzogui/web").StaticConfigPublic, "staticConfig" | "styleable"> & {
|
|
46
46
|
__tama: [Omit<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
47
|
-
unstyled?: boolean | undefined;
|
|
48
47
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
49
48
|
fullscreen?: boolean | undefined;
|
|
50
49
|
size?: import("@hanzogui/web").SizeTokens | undefined;
|
|
51
|
-
}>, keyof ProgressExtraProps> & ProgressExtraProps, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps & ProgressExtraProps, import("@hanzogui/web").StackStyleBase, {
|
|
52
50
|
unstyled?: boolean | undefined;
|
|
51
|
+
}>, keyof ProgressExtraProps> & ProgressExtraProps, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps & ProgressExtraProps, import("@hanzogui/web").StackStyleBase, {
|
|
53
52
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
54
53
|
fullscreen?: boolean | undefined;
|
|
55
54
|
size?: import("@hanzogui/web").SizeTokens | undefined;
|
|
55
|
+
unstyled?: boolean | undefined;
|
|
56
56
|
}, import("@hanzogui/web").StaticConfigPublic];
|
|
57
57
|
} & {
|
|
58
58
|
Indicator: import("@hanzogui/web").GuiComponent<import("@hanzogui/web").GetFinalProps<import("@hanzogui/core").RNGuiViewNonStyleProps, import("@hanzogui/web").StackStyleBase, {
|
|
59
|
-
unstyled?: boolean | undefined;
|
|
60
59
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
61
60
|
fullscreen?: boolean | undefined;
|
|
62
|
-
}>, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps & void, import("@hanzogui/web").StackStyleBase, {
|
|
63
61
|
unstyled?: boolean | undefined;
|
|
62
|
+
}>, import("@hanzogui/web").GuiElement, import("@hanzogui/core").RNGuiViewNonStyleProps & void, import("@hanzogui/web").StackStyleBase, {
|
|
64
63
|
elevation?: number | import("@hanzogui/web").SizeTokens | undefined;
|
|
65
64
|
fullscreen?: boolean | undefined;
|
|
65
|
+
unstyled?: boolean | undefined;
|
|
66
66
|
}, import("@hanzogui/web").StaticConfigPublic>;
|
|
67
67
|
};
|
|
68
68
|
export { createProgressScope, Progress, ProgressIndicator };
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Progress';
|
|
1
|
+
export * from './Progress.tsx';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|