@navikt/ds-react 6.6.1 → 6.7.0
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/cjs/index.d.ts +1 -0
- package/cjs/index.js +4 -2
- package/cjs/index.js.map +1 -1
- package/cjs/progress-bar/ProgressBar.d.ts +60 -0
- package/cjs/progress-bar/ProgressBar.js +76 -0
- package/cjs/progress-bar/ProgressBar.js.map +1 -0
- package/cjs/progress-bar/index.d.ts +1 -0
- package/cjs/progress-bar/index.js +10 -0
- package/cjs/progress-bar/index.js.map +1 -0
- package/cjs/typography/BodyLong.d.ts +7 -7
- package/cjs/typography/BodyLong.js +5 -5
- package/cjs/typography/BodyShort.d.ts +5 -5
- package/cjs/typography/BodyShort.js +3 -3
- package/cjs/typography/Detail.d.ts +5 -5
- package/cjs/typography/Detail.js +3 -3
- package/cjs/typography/ErrorMessage.d.ts +5 -5
- package/cjs/typography/ErrorMessage.js +3 -3
- package/cjs/typography/Heading.d.ts +6 -6
- package/cjs/typography/Heading.js +3 -3
- package/cjs/typography/Label.d.ts +5 -5
- package/cjs/typography/Label.js +3 -3
- package/cjs/typography/types.d.ts +3 -3
- package/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/progress-bar/ProgressBar.d.ts +60 -0
- package/esm/progress-bar/ProgressBar.js +47 -0
- package/esm/progress-bar/ProgressBar.js.map +1 -0
- package/esm/progress-bar/index.d.ts +1 -0
- package/esm/progress-bar/index.js +3 -0
- package/esm/progress-bar/index.js.map +1 -0
- package/esm/typography/BodyLong.d.ts +7 -7
- package/esm/typography/BodyLong.js +5 -5
- package/esm/typography/BodyShort.d.ts +5 -5
- package/esm/typography/BodyShort.js +3 -3
- package/esm/typography/Detail.d.ts +5 -5
- package/esm/typography/Detail.js +3 -3
- package/esm/typography/ErrorMessage.d.ts +5 -5
- package/esm/typography/ErrorMessage.js +3 -3
- package/esm/typography/Heading.d.ts +6 -6
- package/esm/typography/Heading.js +3 -3
- package/esm/typography/Label.d.ts +5 -5
- package/esm/typography/Label.js +3 -3
- package/esm/typography/types.d.ts +3 -3
- package/package.json +13 -3
- package/src/index.ts +1 -0
- package/src/progress-bar/ProgressBar.tsx +124 -0
- package/src/progress-bar/index.ts +2 -0
- package/src/typography/BodyLong.tsx +7 -7
- package/src/typography/BodyShort.tsx +5 -5
- package/src/typography/Detail.tsx +5 -5
- package/src/typography/ErrorMessage.tsx +5 -5
- package/src/typography/Heading.tsx +6 -6
- package/src/typography/Label.tsx +5 -5
- package/src/typography/types.ts +3 -3
package/cjs/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { Modal, type ModalProps } from "./modal";
|
|
|
24
24
|
export { Pagination, type PaginationProps } from "./pagination";
|
|
25
25
|
export { Popover, type PopoverProps } from "./popover";
|
|
26
26
|
export { Portal, type PortalProps } from "./portal";
|
|
27
|
+
export { ProgressBar, type ProgressBarProps } from "./progress-bar";
|
|
27
28
|
export { Provider, type ProviderProps } from "./provider";
|
|
28
29
|
export { ReadMore, type ReadMoreProps } from "./read-more";
|
|
29
30
|
export { Skeleton, type SkeletonProps } from "./skeleton";
|
package/cjs/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
5
|
-
exports.Panel = exports.LinkPanel = exports.TextField = exports.Textarea = exports.Switch = exports.Select = exports.Search = exports.RadioGroup = exports.Radio = exports.FormSummary = exports.UNSAFE_FileUpload = exports.Fieldset = exports.ErrorSummary = exports.ConfirmationPanel = exports.UNSAFE_Combobox = exports.CheckboxGroup = exports.Checkbox = exports.useId = exports.useEventListener = exports.useClientLayoutEffect = exports.omit = exports.debounce = exports.Label = void 0;
|
|
4
|
+
exports.Heading = exports.ErrorMessage = exports.Detail = exports.BodyShort = exports.BodyLong = exports.Tooltip = exports.ToggleGroup = exports.Timeline = exports.Tag = exports.Tabs = exports.Table = exports.Stepper = exports.Skeleton = exports.ReadMore = exports.Provider = exports.ProgressBar = exports.Portal = exports.Popover = exports.Pagination = exports.Modal = exports.Loader = exports.List = exports.Link = exports.VStack = exports.Stack = exports.Spacer = exports.HStack = exports.Show = exports.Hide = exports.Page = exports.HGrid = exports.Box = exports.Bleed = exports.InternalHeader = exports.HelpText = exports.GuidePanelDefaultIllustration = exports.GuidePanel = exports.ExpansionCard = exports.Dropdown = exports.useMonthpicker = exports.MonthPicker = exports.useRangeDatepicker = exports.useDatepicker = exports.DatePicker = exports.CopyButton = exports.Chips = exports.Chat = exports.Button = exports.Alert = exports.Accordion = void 0;
|
|
5
|
+
exports.Panel = exports.LinkPanel = exports.TextField = exports.Textarea = exports.Switch = exports.Select = exports.Search = exports.RadioGroup = exports.Radio = exports.FormSummary = exports.UNSAFE_FileUpload = exports.Fieldset = exports.ErrorSummary = exports.ConfirmationPanel = exports.UNSAFE_Combobox = exports.CheckboxGroup = exports.Checkbox = exports.useId = exports.useEventListener = exports.useClientLayoutEffect = exports.omit = exports.debounce = exports.Label = exports.Ingress = void 0;
|
|
6
6
|
var accordion_1 = require("./accordion");
|
|
7
7
|
Object.defineProperty(exports, "Accordion", { enumerable: true, get: function () { return accordion_1.Accordion; } });
|
|
8
8
|
var alert_1 = require("./alert");
|
|
@@ -63,6 +63,8 @@ var popover_1 = require("./popover");
|
|
|
63
63
|
Object.defineProperty(exports, "Popover", { enumerable: true, get: function () { return popover_1.Popover; } });
|
|
64
64
|
var portal_1 = require("./portal");
|
|
65
65
|
Object.defineProperty(exports, "Portal", { enumerable: true, get: function () { return portal_1.Portal; } });
|
|
66
|
+
var progress_bar_1 = require("./progress-bar");
|
|
67
|
+
Object.defineProperty(exports, "ProgressBar", { enumerable: true, get: function () { return progress_bar_1.ProgressBar; } });
|
|
66
68
|
var provider_1 = require("./provider");
|
|
67
69
|
Object.defineProperty(exports, "Provider", { enumerable: true, get: function () { return provider_1.Provider; } });
|
|
68
70
|
var read_more_1 = require("./read-more");
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;AACb,yCAA6D;AAApD,sGAAA,SAAS,OAAA;AAClB,iCAAiD;AAAxC,8FAAA,KAAK,OAAA;AACd,mCAAoD;AAA3C,gGAAA,MAAM,OAAA;AACf,+BAA8C;AAArC,4FAAA,IAAI,OAAA;AACb,iCAAiD;AAAxC,8FAAA,KAAK,OAAA;AACd,2CAAgE;AAAvD,wGAAA,UAAU,OAAA;AACnB,gDAS2B;AARzB,wGAAA,UAAU,OAAA;AACV,2GAAA,aAAa,OAAA;AACb,gHAAA,kBAAkB,OAAA;AAOpB,kDAM4B;AAL1B,0GAAA,WAAW,OAAA;AACX,6GAAA,cAAc,OAAA;AAKhB,uCAA0D;AAAjD,oGAAA,QAAQ,OAAA;AACjB,mDAA0E;AAAjE,+GAAA,aAAa,OAAA;AACtB,6CAIuB;AAHrB,yGAAA,UAAU,OAAA;AACV,4HAAA,6BAA6B,OAAA;AAG/B,yCAA2D;AAAlD,qGAAA,QAAQ,OAAA;AACjB,qDAO2B;AANzB,iHAAA,cAAc,OAAA;AAOhB,wCAAwD;AAA/C,8FAAA,KAAK,OAAA;AACd,oCAAkD;AAAzC,0FAAA,GAAG,OAAA;AACZ,sCAAuD;AAA9C,6FAAA,KAAK,OAAA;AACd,sCAA0E;AAAjE,4FAAA,IAAI,OAAA;AACb,kDAAuE;AAA9D,kGAAA,IAAI,OAAA;AAAE,kGAAA,IAAI,OAAA;AACnB,wCAQwB;AAPtB,+FAAA,MAAM,OAAA;AACN,+FAAA,MAAM,OAAA;AACN,8FAAA,KAAK,OAAA;AACL,+FAAA,MAAM,OAAA;AAKR,+BAA8C;AAArC,4FAAA,IAAI,OAAA;AACb,+BAA8C;AAArC,4FAAA,IAAI,OAAA;AACb,mCAAoD;AAA3C,gG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6FAAA,KAAK,OAAA;AAGP,4CAKyB;AAJvB,oGAAA,QAAQ,OAAA;AACR,yGAAA,aAAa,OAAA;AAIf,4CAAsE;AAA7D,2GAAA,eAAe,OAAA;AACxB,gEAGmC;AAFjC,uHAAA,iBAAiB,OAAA;AAGnB,sDAA4E;AAAnE,6GAAA,YAAY,OAAA;AACrB,4CAA+D;AAAtD,oGAAA,QAAQ,OAAA;AACjB,kDAa4B;AAZ1B,gHAAA,iBAAiB,OAAA;AAanB,oDAAyE;AAAhE,2GAAA,WAAW,OAAA;AACpB,sCAKsB;AAJpB,8FAAA,KAAK,OAAA;AACL,mGAAA,UAAU,OAAA;AAIZ,wCAAgF;AAAvE,gGAAA,MAAM,OAAA;AACf,wCAAyD;AAAhD,gGAAA,MAAM,OAAA;AACf,wCAAyD;AAAhD,gGAAA,MAAM,OAAA;AACf,4CAA+D;AAAtD,oGAAA,QAAQ,OAAA;AACjB,8CAAkE;AAAzD,sGAAA,SAAS,OAAA;AAElB;;GAEG;AACH,2CAA8D;AAArD,uGAAA,SAAS,OAAA;AAClB,iCAAiD;AAAxC,8FAAA,KAAK,OAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
interface ProgressBarPropsBase extends Omit<HTMLAttributes<HTMLDivElement>, "role"> {
|
|
3
|
+
/**
|
|
4
|
+
* Changes height.
|
|
5
|
+
* @default "medium"
|
|
6
|
+
*/
|
|
7
|
+
size?: "large" | "medium" | "small";
|
|
8
|
+
/**
|
|
9
|
+
* Current progress. When duration is set, value is ignored.
|
|
10
|
+
*/
|
|
11
|
+
value?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum progress.
|
|
14
|
+
* @default 100
|
|
15
|
+
*/
|
|
16
|
+
valueMax?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Expected task duration in seconds.
|
|
19
|
+
* ProgressBar grows with a preset animation for {duration} seconds.
|
|
20
|
+
* After a 4 sec delay, it then shows an indeterminate animation.
|
|
21
|
+
* A duration of 0 will show an indeterminate animation immediately.
|
|
22
|
+
* Temporary removed to avoid conflicts when updating API
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* String ID of the element that labels the progress bar.
|
|
26
|
+
* Not needed if `aria-label` is used.
|
|
27
|
+
*/
|
|
28
|
+
"aria-labelledby"?: string;
|
|
29
|
+
/**
|
|
30
|
+
* String value that labels the progress bar.
|
|
31
|
+
* Not needed if `aria-labelledby` is used.
|
|
32
|
+
*/
|
|
33
|
+
"aria-label"?: string;
|
|
34
|
+
}
|
|
35
|
+
export type ProgressBarProps = ProgressBarPropsBase & ({
|
|
36
|
+
"aria-hidden": string;
|
|
37
|
+
} | {
|
|
38
|
+
"aria-labelledby": string;
|
|
39
|
+
"aria-label"?: never;
|
|
40
|
+
} | {
|
|
41
|
+
"aria-label": string;
|
|
42
|
+
"aria-labelledby"?: never;
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* ProgressBar
|
|
46
|
+
* A component for visualizing progression in a process.
|
|
47
|
+
*
|
|
48
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/progress-bar)
|
|
49
|
+
* @see 🏷️ {@link ProgressBarProps}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // For loading content with an approximate duration in sec.
|
|
53
|
+
* <ProgressBar duration={30} />
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // As a step indicator for forms, questionnaires, etc.
|
|
57
|
+
* <ProgressBar value={2} valueMax={7} />
|
|
58
|
+
*/
|
|
59
|
+
export declare const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.ProgressBar = void 0;
|
|
41
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
42
|
+
const react_1 = __importStar(require("react"));
|
|
43
|
+
/**
|
|
44
|
+
* ProgressBar
|
|
45
|
+
* A component for visualizing progression in a process.
|
|
46
|
+
*
|
|
47
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/progress-bar)
|
|
48
|
+
* @see 🏷️ {@link ProgressBarProps}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // For loading content with an approximate duration in sec.
|
|
52
|
+
* <ProgressBar duration={30} />
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // As a step indicator for forms, questionnaires, etc.
|
|
56
|
+
* <ProgressBar value={2} valueMax={7} />
|
|
57
|
+
*/
|
|
58
|
+
exports.ProgressBar = (0, react_1.forwardRef)((_a, ref) => {
|
|
59
|
+
var { size = "medium", value = 0, valueMax = 100, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, className } = _a, rest = __rest(_a, ["size", "value", "valueMax", "aria-labelledby", "aria-label", "className"]);
|
|
60
|
+
const translate = 100 - (Math.round(value) / valueMax) * 100;
|
|
61
|
+
const duration = undefined;
|
|
62
|
+
return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, clsx_1.default)("navds-progress-bar", `navds-progress-bar--${size}`, className), "aria-valuemax": duration ? 0 : Math.round(valueMax), "aria-valuenow": duration ? 0 : Math.round(value), "aria-valuetext": duration
|
|
63
|
+
? "Fremdrift kan ikke beregnes"
|
|
64
|
+
: `${Math.round(value)} av ${Math.round(valueMax)}`, role: "progressbar", "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel }, rest),
|
|
65
|
+
react_1.default.createElement("div", { className: (0, clsx_1.default)("navds-progress-bar__foreground", {
|
|
66
|
+
"navds-progress-bar__foreground--indeterminate": Number.isInteger(duration),
|
|
67
|
+
}), style: {
|
|
68
|
+
"--__ac-progress-bar-duration": Number.isInteger(duration)
|
|
69
|
+
? `${duration}s`
|
|
70
|
+
: undefined,
|
|
71
|
+
"--__ac-progress-bar-delay": `${duration === 0 ? 0 : 4}s`,
|
|
72
|
+
"--__ac-progress-bar-translate": `-${translate}%`,
|
|
73
|
+
} })));
|
|
74
|
+
});
|
|
75
|
+
exports.default = exports.ProgressBar;
|
|
76
|
+
//# sourceMappingURL=ProgressBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressBar.js","sourceRoot":"","sources":["../../src/progress-bar/ProgressBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAsB;AACtB,+CAA0D;AAqD1D;;;;;;;;;;;;;;GAcG;AACU,QAAA,WAAW,GAAG,IAAA,kBAAU,EACnC,CACE,EAQC,EACD,GAAG,EACH,EAAE;QAVF,EACE,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,CAAC,EACT,QAAQ,GAAG,GAAG,EACd,iBAAiB,EAAE,cAAc,EACjC,YAAY,EAAE,SAAS,EACvB,SAAS,OAEV,EADI,IAAI,cAPT,2EAQC,CADQ;IAIT,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC;IAC7D,MAAM,QAAQ,GAAG,SAAS,CAAC;IAE3B,OAAO,CACL,qDACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAA,cAAE,EACX,oBAAoB,EACpB,uBAAuB,IAAI,EAAE,EAC7B,SAAS,CACV,mBACc,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,mBACnC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,oBAE7C,QAAQ;YACN,CAAC,CAAC,6BAA6B;YAC/B,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,EAEvD,IAAI,EAAC,aAAa,qBACD,cAAc,gBACnB,SAAS,IACjB,IAAI;QAER,uCACE,SAAS,EAAE,IAAA,cAAE,EAAC,gCAAgC,EAAE;gBAC9C,+CAA+C,EAC7C,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;aAC7B,CAAC,EACF,KAAK,EAAE;gBACL,8BAA8B,EAAE,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;oBACxD,CAAC,CAAC,GAAG,QAAQ,GAAG;oBAChB,CAAC,CAAC,SAAS;gBACb,2BAA2B,EAAE,GAAG,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;gBACzD,+BAA+B,EAAE,IAAI,SAAS,GAAG;aAClD,GACD,CACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAe,mBAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ProgressBar, type ProgressBarProps } from "./ProgressBar";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ProgressBar = void 0;
|
|
8
|
+
var ProgressBar_1 = require("./ProgressBar");
|
|
9
|
+
Object.defineProperty(exports, "ProgressBar", { enumerable: true, get: function () { return __importDefault(ProgressBar_1).default; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/progress-bar/index.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;AACb,6CAA8E;AAArE,2HAAA,OAAO,OAAe"}
|
|
@@ -3,12 +3,12 @@ import { OverridableComponent } from "../util/types";
|
|
|
3
3
|
import { TypoProps } from "./types";
|
|
4
4
|
export interface BodyLongProps extends TypoProps, React.HTMLAttributes<HTMLParagraphElement> {
|
|
5
5
|
/**
|
|
6
|
-
* large: 20px, medium: 18px, small: 16px
|
|
6
|
+
* large: 20px, medium: 18px, small: 16px.
|
|
7
7
|
* @default "medium"
|
|
8
8
|
*/
|
|
9
9
|
size?: "large" | "medium" | "small";
|
|
10
10
|
/**
|
|
11
|
-
* Text
|
|
11
|
+
* Text.
|
|
12
12
|
*/
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
}
|
|
@@ -21,11 +21,11 @@ export interface BodyLongProps extends TypoProps, React.HTMLAttributes<HTMLParag
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* <BodyLong>
|
|
25
|
+
* Hvis du ikke bor sammen med begge foreldrene dine,
|
|
26
|
+
* kan du ha rett til barnebidrag fra en eller begge foreldre mens du
|
|
27
|
+
* fullfører videregående skole eller tilsvarende.
|
|
28
|
+
* </BodyLong>
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
export declare const BodyLong: OverridableComponent<BodyLongProps, HTMLParagraphElement>;
|
|
@@ -50,11 +50,11 @@ const util_1 = require("./util");
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```jsx
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
53
|
+
* <BodyLong>
|
|
54
|
+
* Hvis du ikke bor sammen med begge foreldrene dine,
|
|
55
|
+
* kan du ha rett til barnebidrag fra en eller begge foreldre mens du
|
|
56
|
+
* fullfører videregående skole eller tilsvarende.
|
|
57
|
+
* </BodyLong>
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
60
|
exports.BodyLong = (0, react_1.forwardRef)((_a, ref) => {
|
|
@@ -3,12 +3,12 @@ import { OverridableComponent } from "../util/types";
|
|
|
3
3
|
import { TypoProps } from "./types";
|
|
4
4
|
export interface BodyShortProps extends TypoProps, React.HTMLAttributes<HTMLParagraphElement> {
|
|
5
5
|
/**
|
|
6
|
-
* large: 20px, medium: 18px, small: 16px
|
|
6
|
+
* large: 20px, medium: 18px, small: 16px.
|
|
7
7
|
* @default "medium"
|
|
8
8
|
*/
|
|
9
9
|
size?: "large" | "medium" | "small";
|
|
10
10
|
/**
|
|
11
|
-
* Paragraph text
|
|
11
|
+
* Paragraph text.
|
|
12
12
|
*/
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
}
|
|
@@ -21,9 +21,9 @@ export interface BodyShortProps extends TypoProps, React.HTMLAttributes<HTMLPara
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* <BodyShort>
|
|
25
|
+
* Du må gjøre en filtrering for å se brukere i listen.
|
|
26
|
+
* </BodyShort>
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare const BodyShort: OverridableComponent<BodyShortProps, HTMLParagraphElement>;
|
|
@@ -50,9 +50,9 @@ const util_1 = require("./util");
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```jsx
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* <BodyShort>
|
|
54
|
+
* Du må gjøre en filtrering for å se brukere i listen.
|
|
55
|
+
* </BodyShort>
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
exports.BodyShort = (0, react_1.forwardRef)((_a, ref) => {
|
|
@@ -7,11 +7,11 @@ export interface DetailProps extends TypoProps, React.HTMLAttributes<HTMLParagra
|
|
|
7
7
|
*/
|
|
8
8
|
size?: "medium" | "small";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Text.
|
|
11
11
|
*/
|
|
12
12
|
children: React.ReactNode;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* ALL CAPS.
|
|
15
15
|
*/
|
|
16
16
|
uppercase?: boolean;
|
|
17
17
|
}
|
|
@@ -24,9 +24,9 @@ export interface DetailProps extends TypoProps, React.HTMLAttributes<HTMLParagra
|
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```jsx
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* <Detail>
|
|
28
|
+
* Du må gjøre en filtrering for å se brukere i listen.
|
|
29
|
+
* </Detail>
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
export declare const Detail: OverridableComponent<DetailProps, HTMLParagraphElement>;
|
package/cjs/typography/Detail.js
CHANGED
|
@@ -50,9 +50,9 @@ const util_1 = require("./util");
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```jsx
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* <Detail>
|
|
54
|
+
* Du må gjøre en filtrering for å se brukere i listen.
|
|
55
|
+
* </Detail>
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
exports.Detail = (0, react_1.forwardRef)((_a, ref) => {
|
|
@@ -3,12 +3,12 @@ import { OverridableComponent } from "../util/types";
|
|
|
3
3
|
import { TypoProps } from "./types";
|
|
4
4
|
export interface ErrorMessageProps extends Pick<TypoProps, "spacing">, React.HTMLAttributes<HTMLParagraphElement> {
|
|
5
5
|
/**
|
|
6
|
-
* medium: 18px, small: 16px
|
|
6
|
+
* medium: 18px, small: 16px.
|
|
7
7
|
* @default "medium"
|
|
8
8
|
*/
|
|
9
9
|
size?: "medium" | "small";
|
|
10
10
|
/**
|
|
11
|
-
* Error text
|
|
11
|
+
* Error text.
|
|
12
12
|
*/
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
}
|
|
@@ -21,9 +21,9 @@ export interface ErrorMessageProps extends Pick<TypoProps, "spacing">, React.HTM
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* <ErrorMessage>
|
|
25
|
+
* Du må fylle ut: Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
|
|
26
|
+
* </ErrorMessage>
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare const ErrorMessage: OverridableComponent<ErrorMessageProps, HTMLParagraphElement>;
|
|
@@ -50,9 +50,9 @@ const util_1 = require("./util");
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```jsx
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* <ErrorMessage>
|
|
54
|
+
* Du må fylle ut: Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
|
|
55
|
+
* </ErrorMessage>
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
exports.ErrorMessage = (0, react_1.forwardRef)((_a, ref) => {
|
|
@@ -3,16 +3,16 @@ import { OverridableComponent } from "../util/types";
|
|
|
3
3
|
import { TypoProps } from "./types";
|
|
4
4
|
export interface HeadingProps extends Pick<TypoProps, "spacing" | "visuallyHidden" | "align" | "textColor">, React.HTMLAttributes<HTMLHeadingElement> {
|
|
5
5
|
/**
|
|
6
|
-
* Heading level
|
|
6
|
+
* Heading level.
|
|
7
7
|
* @default "1"
|
|
8
8
|
*/
|
|
9
9
|
level?: "1" | "2" | "3" | "4" | "5" | "6";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* xlarge: 40px, large: 32px, medium: 24px, small: 20px, xsmall: 18px.
|
|
12
12
|
*/
|
|
13
13
|
size: "xlarge" | "large" | "medium" | "small" | "xsmall";
|
|
14
14
|
/**
|
|
15
|
-
* Heading text
|
|
15
|
+
* Heading text.
|
|
16
16
|
*/
|
|
17
17
|
children: React.ReactNode;
|
|
18
18
|
}
|
|
@@ -25,9 +25,9 @@ export interface HeadingProps extends Pick<TypoProps, "spacing" | "visuallyHidde
|
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```jsx
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* <Heading level="1" size="xlarge">
|
|
29
|
+
* Hva kan vi hjelpe deg med?
|
|
30
|
+
* </Heading>
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export declare const Heading: OverridableComponent<HeadingProps, HTMLHeadingElement>;
|
|
@@ -50,9 +50,9 @@ const util_1 = require("./util");
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```jsx
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* <Heading level="1" size="xlarge">
|
|
54
|
+
* Hva kan vi hjelpe deg med?
|
|
55
|
+
* </Heading>
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
exports.Heading = (0, react_1.forwardRef)((_a, ref) => {
|
|
@@ -3,12 +3,12 @@ import { OverridableComponent } from "../util/types";
|
|
|
3
3
|
import { TypoProps } from "./types";
|
|
4
4
|
export interface LabelProps extends Omit<TypoProps, "weight" | "align" | "truncate">, React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
5
5
|
/**
|
|
6
|
-
* medium: 18px, small: 16px
|
|
6
|
+
* medium: 18px, small: 16px.
|
|
7
7
|
* @default "medium"
|
|
8
8
|
*/
|
|
9
9
|
size?: "medium" | "small";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Label text.
|
|
12
12
|
*/
|
|
13
13
|
children: React.ReactNode;
|
|
14
14
|
}
|
|
@@ -21,9 +21,9 @@ export interface LabelProps extends Omit<TypoProps, "weight" | "align" | "trunca
|
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```jsx
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
24
|
+
* <Label>
|
|
25
|
+
* Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
|
|
26
|
+
* </Label>
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare const Label: OverridableComponent<LabelProps, HTMLLabelElement>;
|
package/cjs/typography/Label.js
CHANGED
|
@@ -50,9 +50,9 @@ const util_1 = require("./util");
|
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```jsx
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
53
|
+
* <Label>
|
|
54
|
+
* Oppgi årsaken til at du har ventet mer enn 6 måneder med å søke om refusjon
|
|
55
|
+
* </Label>
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
exports.Label = (0, react_1.forwardRef)((_a, ref) => {
|
|
@@ -12,15 +12,15 @@ export type TypoProps = {
|
|
|
12
12
|
*/
|
|
13
13
|
align?: "start" | "center" | "end";
|
|
14
14
|
/**
|
|
15
|
-
* Visually hide text. Text will still be accessible for screenreaders
|
|
15
|
+
* Visually hide text. Text will still be accessible for screenreaders.
|
|
16
16
|
*/
|
|
17
17
|
visuallyHidden?: boolean;
|
|
18
18
|
/**
|
|
19
|
-
* Adds spacing below text
|
|
19
|
+
* Adds spacing below text.
|
|
20
20
|
*/
|
|
21
21
|
spacing?: boolean;
|
|
22
22
|
/**
|
|
23
|
-
* Adjusts color
|
|
23
|
+
* Adjusts color.
|
|
24
24
|
*/
|
|
25
25
|
textColor?: "default" | "subtle";
|
|
26
26
|
};
|
package/esm/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { Modal, type ModalProps } from "./modal/index.js";
|
|
|
24
24
|
export { Pagination, type PaginationProps } from "./pagination/index.js";
|
|
25
25
|
export { Popover, type PopoverProps } from "./popover/index.js";
|
|
26
26
|
export { Portal, type PortalProps } from "./portal/index.js";
|
|
27
|
+
export { ProgressBar, type ProgressBarProps } from "./progress-bar/index.js";
|
|
27
28
|
export { Provider, type ProviderProps } from "./provider/index.js";
|
|
28
29
|
export { ReadMore, type ReadMoreProps } from "./read-more/index.js";
|
|
29
30
|
export { Skeleton, type SkeletonProps } from "./skeleton/index.js";
|
package/esm/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export { Modal } from "./modal/index.js";
|
|
|
25
25
|
export { Pagination } from "./pagination/index.js";
|
|
26
26
|
export { Popover } from "./popover/index.js";
|
|
27
27
|
export { Portal } from "./portal/index.js";
|
|
28
|
+
export { ProgressBar } from "./progress-bar/index.js";
|
|
28
29
|
export { Provider } from "./provider/index.js";
|
|
29
30
|
export { ReadMore } from "./read-more/index.js";
|
|
30
31
|
export { Skeleton } from "./skeleton/index.js";
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,SAAS,EAAuB,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAmB,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,IAAI,EAAkB,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAmB,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAChE,OAAO,EACL,UAAU,EACV,aAAa,EACb,kBAAkB,GAMnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,WAAW,EACX,cAAc,GAIf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAsB,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,aAAa,EAA2B,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,UAAU,EACV,6BAA6B,GA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AAC5B,OAAO,EAAE,WAAW,EAAyB,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACL,KAAK,EACL,UAAU,GAGX,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAA2C,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,MAAM,EAAoB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,MAAM,EAAoB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAsB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAuB,MAAM,kBAAkB,CAAC;AAElE;;GAEG;AACH,OAAO,EAAE,SAAS,EAAuB,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAmB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from "react";
|
|
2
|
+
interface ProgressBarPropsBase extends Omit<HTMLAttributes<HTMLDivElement>, "role"> {
|
|
3
|
+
/**
|
|
4
|
+
* Changes height.
|
|
5
|
+
* @default "medium"
|
|
6
|
+
*/
|
|
7
|
+
size?: "large" | "medium" | "small";
|
|
8
|
+
/**
|
|
9
|
+
* Current progress. When duration is set, value is ignored.
|
|
10
|
+
*/
|
|
11
|
+
value?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Maximum progress.
|
|
14
|
+
* @default 100
|
|
15
|
+
*/
|
|
16
|
+
valueMax?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Expected task duration in seconds.
|
|
19
|
+
* ProgressBar grows with a preset animation for {duration} seconds.
|
|
20
|
+
* After a 4 sec delay, it then shows an indeterminate animation.
|
|
21
|
+
* A duration of 0 will show an indeterminate animation immediately.
|
|
22
|
+
* Temporary removed to avoid conflicts when updating API
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* String ID of the element that labels the progress bar.
|
|
26
|
+
* Not needed if `aria-label` is used.
|
|
27
|
+
*/
|
|
28
|
+
"aria-labelledby"?: string;
|
|
29
|
+
/**
|
|
30
|
+
* String value that labels the progress bar.
|
|
31
|
+
* Not needed if `aria-labelledby` is used.
|
|
32
|
+
*/
|
|
33
|
+
"aria-label"?: string;
|
|
34
|
+
}
|
|
35
|
+
export type ProgressBarProps = ProgressBarPropsBase & ({
|
|
36
|
+
"aria-hidden": string;
|
|
37
|
+
} | {
|
|
38
|
+
"aria-labelledby": string;
|
|
39
|
+
"aria-label"?: never;
|
|
40
|
+
} | {
|
|
41
|
+
"aria-label": string;
|
|
42
|
+
"aria-labelledby"?: never;
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* ProgressBar
|
|
46
|
+
* A component for visualizing progression in a process.
|
|
47
|
+
*
|
|
48
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/progress-bar)
|
|
49
|
+
* @see 🏷️ {@link ProgressBarProps}
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // For loading content with an approximate duration in sec.
|
|
53
|
+
* <ProgressBar duration={30} />
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // As a step indicator for forms, questionnaires, etc.
|
|
57
|
+
* <ProgressBar value={2} valueMax={7} />
|
|
58
|
+
*/
|
|
59
|
+
export declare const ProgressBar: React.ForwardRefExoticComponent<ProgressBarProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export default ProgressBar;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import cl from "clsx";
|
|
13
|
+
import React, { forwardRef } from "react";
|
|
14
|
+
/**
|
|
15
|
+
* ProgressBar
|
|
16
|
+
* A component for visualizing progression in a process.
|
|
17
|
+
*
|
|
18
|
+
* @see [📝 Documentation](https://aksel.nav.no/komponenter/core/progress-bar)
|
|
19
|
+
* @see 🏷️ {@link ProgressBarProps}
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // For loading content with an approximate duration in sec.
|
|
23
|
+
* <ProgressBar duration={30} />
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // As a step indicator for forms, questionnaires, etc.
|
|
27
|
+
* <ProgressBar value={2} valueMax={7} />
|
|
28
|
+
*/
|
|
29
|
+
export const ProgressBar = forwardRef((_a, ref) => {
|
|
30
|
+
var { size = "medium", value = 0, valueMax = 100, "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel, className } = _a, rest = __rest(_a, ["size", "value", "valueMax", "aria-labelledby", "aria-label", "className"]);
|
|
31
|
+
const translate = 100 - (Math.round(value) / valueMax) * 100;
|
|
32
|
+
const duration = undefined;
|
|
33
|
+
return (React.createElement("div", Object.assign({ ref: ref, className: cl("navds-progress-bar", `navds-progress-bar--${size}`, className), "aria-valuemax": duration ? 0 : Math.round(valueMax), "aria-valuenow": duration ? 0 : Math.round(value), "aria-valuetext": duration
|
|
34
|
+
? "Fremdrift kan ikke beregnes"
|
|
35
|
+
: `${Math.round(value)} av ${Math.round(valueMax)}`, role: "progressbar", "aria-labelledby": ariaLabelledBy, "aria-label": ariaLabel }, rest),
|
|
36
|
+
React.createElement("div", { className: cl("navds-progress-bar__foreground", {
|
|
37
|
+
"navds-progress-bar__foreground--indeterminate": Number.isInteger(duration),
|
|
38
|
+
}), style: {
|
|
39
|
+
"--__ac-progress-bar-duration": Number.isInteger(duration)
|
|
40
|
+
? `${duration}s`
|
|
41
|
+
: undefined,
|
|
42
|
+
"--__ac-progress-bar-delay": `${duration === 0 ? 0 : 4}s`,
|
|
43
|
+
"--__ac-progress-bar-translate": `-${translate}%`,
|
|
44
|
+
} })));
|
|
45
|
+
});
|
|
46
|
+
export default ProgressBar;
|
|
47
|
+
//# sourceMappingURL=ProgressBar.js.map
|