@jobber/components 8.24.1 → 8.24.2-visual-reg-d5e3ec5.19
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/ProgressIndicator.d.ts +1 -0
- package/{DescriptionList.js → ProgressIndicator.js} +3 -3
- package/dist/AtlantisThemeContext/AtlantisThemeContext.d.ts +1 -1
- package/dist/AtlantisThemeContext/index.cjs +1 -2
- package/dist/AtlantisThemeContext/index.mjs +1 -2
- package/dist/AtlantisThemeContext/themeStore.d.ts +11 -0
- package/dist/AtlantisThemeContext/types.d.ts +14 -0
- package/dist/AtlantisThemeContext/updateTheme.d.ts +1 -1
- package/dist/AtlantisThemeContext-cjs.js +58 -17
- package/dist/AtlantisThemeContext-es.js +60 -20
- package/dist/BottomSheet-cjs.js +8 -7
- package/dist/BottomSheet-es.js +9 -8
- package/dist/ComboboxChipRemove-es.js +2 -2
- package/dist/DatePicker-es.js +1 -1
- package/dist/Dialog/Dialog.d.ts +47 -3
- package/dist/Dialog/Dialog.types.d.ts +1 -15
- package/dist/Dialog/DialogBottomSheet.d.ts +12 -13
- package/dist/Dialog/DialogModal.d.ts +11 -11
- package/dist/Dialog/dialogComposableShared.d.ts +13 -3
- package/dist/DrawerDescription-cjs.js +4 -97
- package/dist/DrawerDescription-es.js +6 -98
- package/dist/InputNumberExperimental-cjs.js +21 -25
- package/dist/InputNumberExperimental-es.js +22 -26
- package/dist/MenuSubmenuTrigger-es.js +3 -3
- package/dist/Modal/index.cjs +12 -2
- package/dist/Modal/index.mjs +13 -3
- package/dist/ProgressBar/ProgressBar.d.ts +7 -0
- package/dist/ProgressBar-cjs.js +4 -0
- package/dist/ProgressBar-es.js +4 -0
- package/dist/ProgressIndicator/ProgressIndicator.d.ts +60 -0
- package/dist/ProgressIndicator/index.cjs +9 -0
- package/dist/ProgressIndicator/index.d.ts +1 -0
- package/dist/ProgressIndicator/index.mjs +3 -0
- package/dist/ProgressIndicator-cjs.js +43 -0
- package/dist/ProgressIndicator-es.js +41 -0
- package/dist/ScrollAreaViewport-cjs.js +2122 -12
- package/dist/ScrollAreaViewport-es.js +2118 -13
- package/dist/dialogReturnFocus-cjs.js +64 -35
- package/dist/dialogReturnFocus-es.js +66 -37
- package/dist/docs/AtlantisThemeContext/AtlantisThemeContext.md +41 -0
- package/dist/docs/DataTable/DataTable.md +0 -4
- package/dist/docs/Dialog/Dialog.md +1006 -0
- package/dist/docs/Icon/Icon.md +60 -53
- package/dist/docs/InputNumberExperimental/InputNumberExperimental.md +578 -0
- package/dist/docs/ProgressBar/ProgressBar.md +9 -0
- package/dist/docs/ProgressIndicator/ProgressIndicator.md +105 -0
- package/dist/docs/Table/Table.md +1 -3
- package/dist/docs/index.md +3 -1
- package/dist/index.cjs +3 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2 -3
- package/dist/isTypedArray-es.js +1 -1
- package/dist/primitives/InputNumberExperimental/InputNumberExperimental.d.ts +31 -15
- package/dist/primitives/InputNumberExperimental/types.d.ts +0 -1
- package/dist/styles.css +172 -51
- package/dist/unstyledPrimitives/index.cjs +218 -2230
- package/dist/unstyledPrimitives/index.mjs +224 -2236
- package/dist/useButton-es.js +1 -1
- package/dist/useScrollLock-es.js +2 -2
- package/dist/useScrollToActive-es.js +1 -1
- package/dist/utils/meta/meta.json +1 -1
- package/package.json +7 -7
- package/DescriptionList.d.ts +0 -1
- package/dist/DescriptionList/DescriptionList.d.ts +0 -11
- package/dist/DescriptionList/index.cjs +0 -10
- package/dist/DescriptionList/index.d.ts +0 -1
- package/dist/DescriptionList/index.mjs +0 -4
- package/dist/DescriptionList-cjs.js +0 -14
- package/dist/DescriptionList-es.js +0 -12
- package/dist/docs/DescriptionList/DescriptionList.md +0 -25
- package/dist/updateTheme-cjs.js +0 -20
- package/dist/updateTheme-es.js +0 -18
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CSSProperties } from "react";
|
|
3
|
+
export interface ProgressIndicatorProps {
|
|
4
|
+
/**
|
|
5
|
+
* Current progress. Expected to be in the range `0..max` inclusive.
|
|
6
|
+
*/
|
|
7
|
+
readonly value: number;
|
|
8
|
+
/**
|
|
9
|
+
* Maximum value. Pass `max={4}` with `value={2}` for "2 of 4 steps"; pass
|
|
10
|
+
* `value={75}` for "75%".
|
|
11
|
+
*
|
|
12
|
+
* @default 100
|
|
13
|
+
*/
|
|
14
|
+
readonly max?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Visual variation:
|
|
17
|
+
* - `continuous` renders a single fill bar driven by `value / max`.
|
|
18
|
+
* - `stepped` renders `max` segments, the first `value` of which are filled.
|
|
19
|
+
*
|
|
20
|
+
* @default "continuous"
|
|
21
|
+
*/
|
|
22
|
+
readonly variation?: "continuous" | "stepped";
|
|
23
|
+
/**
|
|
24
|
+
* Visual size. `smaller` renders at 4px tall, `small` at 8px, `base` at 16px.
|
|
25
|
+
*
|
|
26
|
+
* @default "base"
|
|
27
|
+
*/
|
|
28
|
+
readonly size?: "smaller" | "small" | "base";
|
|
29
|
+
/**
|
|
30
|
+
* Accessible label exposed via `aria-label` on the root element. When
|
|
31
|
+
* omitted, defaults to `"{value}%"` when `max === 100` (or `max` is
|
|
32
|
+
* omitted), and `"{value} / {max}"` otherwise.
|
|
33
|
+
*
|
|
34
|
+
* Override to localize or to describe the specific activity (e.g.
|
|
35
|
+
* `"Uploading file"`).
|
|
36
|
+
*/
|
|
37
|
+
readonly ariaLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Custom class name merged onto the root element alongside the component's
|
|
40
|
+
* own classes.
|
|
41
|
+
*/
|
|
42
|
+
readonly className?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Custom inline styles applied to the root element.
|
|
45
|
+
*/
|
|
46
|
+
readonly style?: CSSProperties;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* `ProgressIndicator` communicates **determinate** progress — a known fraction
|
|
50
|
+
* of a task that has been completed. Use it when you can express progress as
|
|
51
|
+
* `value / max`, such as a multi-step setup wizard or a file upload with a
|
|
52
|
+
* known total size.
|
|
53
|
+
*
|
|
54
|
+
* For indeterminate activity (loading time or fraction unknown), use
|
|
55
|
+
* `ActivityIndicator` instead.
|
|
56
|
+
*
|
|
57
|
+
* For now, the legacy `ProgressBar` component also remains available; new code
|
|
58
|
+
* should prefer `ProgressIndicator`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ProgressIndicator({ value, max, variation, size, ariaLabel, className, style, }: ProgressIndicatorProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressIndicator } from "./ProgressIndicator";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var classnames = require('classnames');
|
|
5
|
+
|
|
6
|
+
var styles = {"indicator":"-TBRV1VUsfc-","smaller":"MStgN8AhV3s-","small":"iAlYWHjs6JQ-","base":"WWEzA1-OjSM-","continuous":"r9ShSj58V6w-","fill":"Hsuq8zT-KzY-","stepped":"FB1e9bL90tI-","segment":"bpLIiDGlsCs-","filled":"_0FxmImvY-04-","spinning":"_2aJghEPvl14-"};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* `ProgressIndicator` communicates **determinate** progress — a known fraction
|
|
10
|
+
* of a task that has been completed. Use it when you can express progress as
|
|
11
|
+
* `value / max`, such as a multi-step setup wizard or a file upload with a
|
|
12
|
+
* known total size.
|
|
13
|
+
*
|
|
14
|
+
* For indeterminate activity (loading time or fraction unknown), use
|
|
15
|
+
* `ActivityIndicator` instead.
|
|
16
|
+
*
|
|
17
|
+
* For now, the legacy `ProgressBar` component also remains available; new code
|
|
18
|
+
* should prefer `ProgressIndicator`.
|
|
19
|
+
*/
|
|
20
|
+
function ProgressIndicator({ value, max = 100, variation = "continuous", size = "base", ariaLabel, className, style, }) {
|
|
21
|
+
const clampedValue = Math.min(value, max);
|
|
22
|
+
const resolvedAriaLabel = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : defaultAriaLabel(clampedValue, max);
|
|
23
|
+
return (React.createElement("div", { role: "progressbar", "aria-valuenow": clampedValue, "aria-valuemin": 0, "aria-valuemax": max, "aria-label": resolvedAriaLabel, className: classnames(styles.indicator, styles[size], variation === "stepped" ? styles.stepped : styles.continuous, className), style: style }, variation === "stepped"
|
|
24
|
+
? SteppedSegments({ value: clampedValue, max })
|
|
25
|
+
: ContinuousFill({ value: clampedValue, max })));
|
|
26
|
+
}
|
|
27
|
+
function ContinuousFill({ value, max, }) {
|
|
28
|
+
const percentage = max === 0 ? 0 : (value / max) * 100;
|
|
29
|
+
return (React.createElement("div", { className: styles.fill, style: { "--progress-indicator--fill-amount": percentage } }));
|
|
30
|
+
}
|
|
31
|
+
function SteppedSegments({ value, max, }) {
|
|
32
|
+
return (React.createElement(React.Fragment, null, Array.from({ length: max }).map((_, index) => {
|
|
33
|
+
const step = index + 1;
|
|
34
|
+
return (React.createElement("div", { key: step, className: classnames(styles.segment, step <= value && styles.filled) }));
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
function defaultAriaLabel(value, max) {
|
|
38
|
+
if (max === 100)
|
|
39
|
+
return `${value}%`;
|
|
40
|
+
return `${value} / ${max}`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
exports.ProgressIndicator = ProgressIndicator;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import classnames from 'classnames';
|
|
3
|
+
|
|
4
|
+
var styles = {"indicator":"-TBRV1VUsfc-","smaller":"MStgN8AhV3s-","small":"iAlYWHjs6JQ-","base":"WWEzA1-OjSM-","continuous":"r9ShSj58V6w-","fill":"Hsuq8zT-KzY-","stepped":"FB1e9bL90tI-","segment":"bpLIiDGlsCs-","filled":"_0FxmImvY-04-","spinning":"_2aJghEPvl14-"};
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `ProgressIndicator` communicates **determinate** progress — a known fraction
|
|
8
|
+
* of a task that has been completed. Use it when you can express progress as
|
|
9
|
+
* `value / max`, such as a multi-step setup wizard or a file upload with a
|
|
10
|
+
* known total size.
|
|
11
|
+
*
|
|
12
|
+
* For indeterminate activity (loading time or fraction unknown), use
|
|
13
|
+
* `ActivityIndicator` instead.
|
|
14
|
+
*
|
|
15
|
+
* For now, the legacy `ProgressBar` component also remains available; new code
|
|
16
|
+
* should prefer `ProgressIndicator`.
|
|
17
|
+
*/
|
|
18
|
+
function ProgressIndicator({ value, max = 100, variation = "continuous", size = "base", ariaLabel, className, style, }) {
|
|
19
|
+
const clampedValue = Math.min(value, max);
|
|
20
|
+
const resolvedAriaLabel = ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : defaultAriaLabel(clampedValue, max);
|
|
21
|
+
return (React__default.createElement("div", { role: "progressbar", "aria-valuenow": clampedValue, "aria-valuemin": 0, "aria-valuemax": max, "aria-label": resolvedAriaLabel, className: classnames(styles.indicator, styles[size], variation === "stepped" ? styles.stepped : styles.continuous, className), style: style }, variation === "stepped"
|
|
22
|
+
? SteppedSegments({ value: clampedValue, max })
|
|
23
|
+
: ContinuousFill({ value: clampedValue, max })));
|
|
24
|
+
}
|
|
25
|
+
function ContinuousFill({ value, max, }) {
|
|
26
|
+
const percentage = max === 0 ? 0 : (value / max) * 100;
|
|
27
|
+
return (React__default.createElement("div", { className: styles.fill, style: { "--progress-indicator--fill-amount": percentage } }));
|
|
28
|
+
}
|
|
29
|
+
function SteppedSegments({ value, max, }) {
|
|
30
|
+
return (React__default.createElement(React__default.Fragment, null, Array.from({ length: max }).map((_, index) => {
|
|
31
|
+
const step = index + 1;
|
|
32
|
+
return (React__default.createElement("div", { key: step, className: classnames(styles.segment, step <= value && styles.filled) }));
|
|
33
|
+
})));
|
|
34
|
+
}
|
|
35
|
+
function defaultAriaLabel(value, max) {
|
|
36
|
+
if (max === 100)
|
|
37
|
+
return `${value}%`;
|
|
38
|
+
return `${value} / ${max}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { ProgressIndicator as P };
|