@fuf-stack/pixels 0.31.4 → 0.32.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/dist/Accordion/index.cjs +2 -2
- package/dist/Accordion/index.d.cts +3 -3
- package/dist/Accordion/index.d.ts +3 -3
- package/dist/Accordion/index.js +1 -1
- package/dist/{Accordion-CZ0Fqk-P.d.cts → Accordion-rA715N0Z.d.cts} +2 -2
- package/dist/{Accordion-CZ0Fqk-P.d.ts → Accordion-rA715N0Z.d.ts} +2 -2
- package/dist/Alert/index.cjs +121 -0
- package/dist/Alert/index.cjs.map +1 -0
- package/dist/Alert/index.d.cts +231 -0
- package/dist/Alert/index.d.ts +231 -0
- package/dist/Alert/index.js +121 -0
- package/dist/Alert/index.js.map +1 -0
- package/dist/Avatar/index.cjs +2 -2
- package/dist/Avatar/index.d.cts +2 -2
- package/dist/Avatar/index.d.ts +2 -2
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-CbdJWk_J.d.cts → Avatar-CY2AIMsK.d.cts} +1 -1
- package/dist/{Avatar-CbdJWk_J.d.ts → Avatar-CY2AIMsK.d.ts} +1 -1
- package/dist/AvatarGroup/index.cjs +3 -3
- package/dist/AvatarGroup/index.d.cts +3 -3
- package/dist/AvatarGroup/index.d.ts +3 -3
- package/dist/AvatarGroup/index.js +2 -2
- package/dist/{AvatarGroup-BTPgXs_F.d.ts → AvatarGroup-BSEjz5ez.d.ts} +2 -2
- package/dist/{AvatarGroup-DyX3Lj28.d.cts → AvatarGroup-J1yR1Smi.d.cts} +2 -2
- package/dist/Badge/index.cjs +2 -2
- package/dist/Badge/index.d.cts +3 -3
- package/dist/Badge/index.d.ts +3 -3
- package/dist/Badge/index.js +1 -1
- package/dist/{Badge-yzXn5LtZ.d.cts → Badge-CvXzljaJ.d.cts} +2 -2
- package/dist/{Badge-yzXn5LtZ.d.ts → Badge-CvXzljaJ.d.ts} +2 -2
- package/dist/Breadcrumb/index.cjs +2 -2
- package/dist/Breadcrumb/index.d.cts +2 -2
- package/dist/Breadcrumb/index.d.ts +2 -2
- package/dist/Breadcrumb/index.js +1 -1
- package/dist/{Breadcrumb-DHn8XeOY.d.cts → Breadcrumb-1cB54eJk.d.cts} +4 -4
- package/dist/{Breadcrumb-DHn8XeOY.d.ts → Breadcrumb-1cB54eJk.d.ts} +4 -4
- package/dist/Button/index.cjs +2 -2
- package/dist/Button/index.d.cts +4 -4
- package/dist/Button/index.d.ts +4 -4
- package/dist/Button/index.js +1 -1
- package/dist/{ButtonGroup-DIL5WB0f.d.cts → ButtonGroup-g0hk2u-s.d.cts} +6 -6
- package/dist/{ButtonGroup-DIL5WB0f.d.ts → ButtonGroup-g0hk2u-s.d.ts} +6 -6
- package/dist/Card/index.cjs +2 -2
- package/dist/Card/index.d.cts +3 -4
- package/dist/Card/index.d.ts +3 -4
- package/dist/Card/index.js +1 -1
- package/dist/{Card-C8u10Iq0.d.cts → Card-BdciRqJz.d.cts} +4 -6
- package/dist/{Card-C8u10Iq0.d.ts → Card-BdciRqJz.d.ts} +4 -6
- package/dist/Drawer/index.cjs +2 -2
- package/dist/Drawer/index.d.cts +3 -3
- package/dist/Drawer/index.d.ts +3 -3
- package/dist/Drawer/index.js +1 -1
- package/dist/{Drawer-DvEDC3UK.d.cts → Drawer-CifCcX6s.d.cts} +5 -5
- package/dist/{Drawer-DvEDC3UK.d.ts → Drawer-CifCcX6s.d.ts} +5 -5
- package/dist/Json/index.cjs +3 -3
- package/dist/Json/index.js +2 -2
- package/dist/Label/index.cjs +2 -2
- package/dist/Label/index.d.cts +3 -3
- package/dist/Label/index.d.ts +3 -3
- package/dist/Label/index.js +1 -1
- package/dist/{Label--qRYiJs-.d.cts → Label-BH0taC2T.d.cts} +2 -2
- package/dist/{Label--qRYiJs-.d.ts → Label-BH0taC2T.d.ts} +2 -2
- package/dist/Menu/index.cjs +2 -2
- package/dist/Menu/index.d.cts +2 -2
- package/dist/Menu/index.d.ts +2 -2
- package/dist/Menu/index.js +1 -1
- package/dist/{Menu-CG5mVVnv.d.cts → Menu-C7lpY7pY.d.cts} +1 -1
- package/dist/{Menu-CG5mVVnv.d.ts → Menu-C7lpY7pY.d.ts} +1 -1
- package/dist/Modal/index.cjs +2 -2
- package/dist/Modal/index.d.cts +3 -3
- package/dist/Modal/index.d.ts +3 -3
- package/dist/Modal/index.js +1 -1
- package/dist/{Modal-CSOPzGYj.d.cts → Modal-DI5ZdS_3.d.cts} +2 -2
- package/dist/{Modal-CSOPzGYj.d.ts → Modal-DI5ZdS_3.d.ts} +2 -2
- package/dist/Popover/index.cjs +3 -3
- package/dist/Popover/index.d.cts +3 -3
- package/dist/Popover/index.d.ts +3 -3
- package/dist/Popover/index.js +2 -2
- package/dist/{Popover-By7zSUnV.d.cts → Popover-Db9vCWrz.d.cts} +2 -2
- package/dist/{Popover-By7zSUnV.d.ts → Popover-Db9vCWrz.d.ts} +2 -2
- package/dist/Progress/index.cjs +89 -0
- package/dist/Progress/index.cjs.map +1 -0
- package/dist/Progress/index.d.cts +224 -0
- package/dist/Progress/index.d.ts +224 -0
- package/dist/Progress/index.js +89 -0
- package/dist/Progress/index.js.map +1 -0
- package/dist/ScrollShadow/index.cjs +3 -3
- package/dist/ScrollShadow/index.d.cts +1 -1
- package/dist/ScrollShadow/index.d.ts +1 -1
- package/dist/ScrollShadow/index.js +1 -1
- package/dist/Table/index.cjs +2 -3
- package/dist/Table/index.cjs.map +1 -1
- package/dist/Table/index.d.cts +1 -1
- package/dist/Table/index.d.ts +1 -1
- package/dist/Table/index.js +3 -4
- package/dist/Table/index.js.map +1 -1
- package/dist/Tabs/index.cjs +2 -2
- package/dist/Tabs/index.d.cts +2 -2
- package/dist/Tabs/index.d.ts +2 -2
- package/dist/Tabs/index.js +1 -1
- package/dist/{Tabs-CfFvBC99.d.cts → Tabs-XIux-c3p.d.cts} +9 -1
- package/dist/{Tabs-CfFvBC99.d.ts → Tabs-XIux-c3p.d.ts} +9 -1
- package/dist/Tooltip/index.cjs +2 -2
- package/dist/Tooltip/index.d.cts +2 -2
- package/dist/Tooltip/index.d.ts +2 -2
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-DS3pM5Cq.d.cts → Tooltip-Bsq7nJLh.d.cts} +1 -1
- package/dist/{Tooltip-DS3pM5Cq.d.ts → Tooltip-Bsq7nJLh.d.ts} +1 -1
- package/dist/{chunk-Z5OFNBWI.cjs → chunk-2SQEDOXZ.cjs} +4 -3
- package/dist/chunk-2SQEDOXZ.cjs.map +1 -0
- package/dist/{chunk-3QI2ODV2.js → chunk-2WJJS4CZ.js} +3 -3
- package/dist/chunk-2WJJS4CZ.js.map +1 -0
- package/dist/{chunk-ODLZQXBE.js → chunk-3LEUWIY3.js} +3 -3
- package/dist/chunk-3LEUWIY3.js.map +1 -0
- package/dist/{chunk-LPCCBJ2T.js → chunk-5H2LBLSC.js} +3 -3
- package/dist/chunk-5H2LBLSC.js.map +1 -0
- package/dist/{chunk-7TIFKRWY.cjs → chunk-A4FOULHY.cjs} +2 -2
- package/dist/chunk-A4FOULHY.cjs.map +1 -0
- package/dist/{chunk-2WDAJ6ER.cjs → chunk-AJLLRWSE.cjs} +4 -4
- package/dist/chunk-AJLLRWSE.cjs.map +1 -0
- package/dist/{chunk-HVLEV6BG.cjs → chunk-BURI3HTZ.cjs} +2 -2
- package/dist/chunk-BURI3HTZ.cjs.map +1 -0
- package/dist/{chunk-N6YMP2DX.js → chunk-CWCZM3HS.js} +2 -2
- package/dist/chunk-CWCZM3HS.js.map +1 -0
- package/dist/{chunk-U2JEMXXJ.cjs → chunk-D7KXMNEI.cjs} +2 -2
- package/dist/chunk-D7KXMNEI.cjs.map +1 -0
- package/dist/{chunk-BUWMLU3E.js → chunk-EQVC4PJE.js} +2 -2
- package/dist/chunk-EQVC4PJE.js.map +1 -0
- package/dist/{chunk-CQW46JPO.js → chunk-EVAV23ZV.js} +2 -2
- package/dist/chunk-EVAV23ZV.js.map +1 -0
- package/dist/{chunk-OLKLIWBE.cjs → chunk-FFRBORVV.cjs} +3 -3
- package/dist/{chunk-OLKLIWBE.cjs.map → chunk-FFRBORVV.cjs.map} +1 -1
- package/dist/{chunk-XVCKJE3P.js → chunk-FPU6RJSG.js} +3 -3
- package/dist/chunk-FPU6RJSG.js.map +1 -0
- package/dist/{chunk-33DBA7U2.js → chunk-GA54AM2W.js} +2 -2
- package/dist/chunk-GA54AM2W.js.map +1 -0
- package/dist/{chunk-7XJHVFT3.cjs → chunk-HPLU3CHP.cjs} +5 -5
- package/dist/chunk-HPLU3CHP.cjs.map +1 -0
- package/dist/{chunk-OQIMB45E.js → chunk-ITOA7Q42.js} +2 -2
- package/dist/chunk-ITOA7Q42.js.map +1 -0
- package/dist/{chunk-NVNT4PMS.cjs → chunk-OOFJGGRS.cjs} +3 -3
- package/dist/chunk-OOFJGGRS.cjs.map +1 -0
- package/dist/{chunk-LY45VQ2E.cjs → chunk-ORO34I7X.cjs} +3 -3
- package/dist/chunk-ORO34I7X.cjs.map +1 -0
- package/dist/{chunk-NCSINRHM.js → chunk-QSQ5NCIF.js} +4 -3
- package/dist/chunk-QSQ5NCIF.js.map +1 -0
- package/dist/{chunk-VG5A2YZE.cjs → chunk-T7EAVBXL.cjs} +2 -2
- package/dist/chunk-T7EAVBXL.cjs.map +1 -0
- package/dist/{chunk-7LABJBKF.js → chunk-TCL2PX3F.js} +3 -3
- package/dist/chunk-TCL2PX3F.js.map +1 -0
- package/dist/{chunk-BXPBP3PC.cjs → chunk-TX2VP4J7.cjs} +2 -2
- package/dist/chunk-TX2VP4J7.cjs.map +1 -0
- package/dist/{chunk-LCSYN3DI.js → chunk-UZPVE6UB.js} +2 -2
- package/dist/{chunk-7ZJ6LE2P.cjs → chunk-WSM7WMFP.cjs} +2 -2
- package/dist/chunk-WSM7WMFP.cjs.map +1 -0
- package/dist/{chunk-YTQJ6FZK.cjs → chunk-WV3ZDL4J.cjs} +2 -2
- package/dist/chunk-WV3ZDL4J.cjs.map +1 -0
- package/dist/{chunk-RMA57Q6K.cjs → chunk-XNMTAL3J.cjs} +2 -2
- package/dist/chunk-XNMTAL3J.cjs.map +1 -0
- package/dist/{chunk-ZXGEK67F.cjs → chunk-XTR4NKDP.cjs} +2 -2
- package/dist/chunk-XTR4NKDP.cjs.map +1 -0
- package/dist/chunk-XUF52AKP.js +74 -0
- package/dist/chunk-XUF52AKP.js.map +1 -0
- package/dist/{chunk-QTXKWCDV.js → chunk-Z7QNU4XB.js} +2 -2
- package/dist/chunk-Z7QNU4XB.js.map +1 -0
- package/dist/{chunk-MJE4MLZY.js → chunk-ZKCOHRTR.js} +2 -2
- package/dist/chunk-ZKCOHRTR.js.map +1 -0
- package/dist/chunk-ZXN5DNKQ.cjs +74 -0
- package/dist/chunk-ZXN5DNKQ.cjs.map +1 -0
- package/dist/{chunk-7IGL67EH.js → chunk-ZZC6S7D2.js} +2 -2
- package/dist/chunk-ZZC6S7D2.js.map +1 -0
- package/dist/index.cjs +17 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.js +19 -19
- package/package.json +36 -24
- package/dist/chunk-2WDAJ6ER.cjs.map +0 -1
- package/dist/chunk-33DBA7U2.js.map +0 -1
- package/dist/chunk-3QI2ODV2.js.map +0 -1
- package/dist/chunk-7IGL67EH.js.map +0 -1
- package/dist/chunk-7LABJBKF.js.map +0 -1
- package/dist/chunk-7TIFKRWY.cjs.map +0 -1
- package/dist/chunk-7XJHVFT3.cjs.map +0 -1
- package/dist/chunk-7ZJ6LE2P.cjs.map +0 -1
- package/dist/chunk-BUWMLU3E.js.map +0 -1
- package/dist/chunk-BXPBP3PC.cjs.map +0 -1
- package/dist/chunk-CQW46JPO.js.map +0 -1
- package/dist/chunk-DDWFDIXA.cjs +0 -72
- package/dist/chunk-DDWFDIXA.cjs.map +0 -1
- package/dist/chunk-HVLEV6BG.cjs.map +0 -1
- package/dist/chunk-LPCCBJ2T.js.map +0 -1
- package/dist/chunk-LY45VQ2E.cjs.map +0 -1
- package/dist/chunk-MJE4MLZY.js.map +0 -1
- package/dist/chunk-N6YMP2DX.js.map +0 -1
- package/dist/chunk-NCSINRHM.js.map +0 -1
- package/dist/chunk-NVNT4PMS.cjs.map +0 -1
- package/dist/chunk-ODLZQXBE.js.map +0 -1
- package/dist/chunk-OQIMB45E.js.map +0 -1
- package/dist/chunk-PRPGAJKZ.js +0 -72
- package/dist/chunk-PRPGAJKZ.js.map +0 -1
- package/dist/chunk-QTXKWCDV.js.map +0 -1
- package/dist/chunk-RMA57Q6K.cjs.map +0 -1
- package/dist/chunk-U2JEMXXJ.cjs.map +0 -1
- package/dist/chunk-VG5A2YZE.cjs.map +0 -1
- package/dist/chunk-XVCKJE3P.js.map +0 -1
- package/dist/chunk-YTQJ6FZK.cjs.map +0 -1
- package/dist/chunk-Z5OFNBWI.cjs.map +0 -1
- package/dist/chunk-ZXGEK67F.cjs.map +0 -1
- /package/dist/{chunk-LCSYN3DI.js.map → chunk-UZPVE6UB.js.map} +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-D4TLDLEX.cjs');
|
|
2
|
+
|
|
3
|
+
// src/Progress/Progress.tsx
|
|
4
|
+
var _progress = require('@heroui/progress');
|
|
5
|
+
var _pixelutils = require('@fuf-stack/pixel-utils');
|
|
6
|
+
var _jsxruntime = require('react/jsx-runtime');
|
|
7
|
+
var progressVariants = _pixelutils.tv.call(void 0, {
|
|
8
|
+
slots: {
|
|
9
|
+
base: "",
|
|
10
|
+
// wrapper around the whole component
|
|
11
|
+
indicator: "",
|
|
12
|
+
// indicator of the progress (finished part)
|
|
13
|
+
label: "",
|
|
14
|
+
// label at the top left of the progress bar
|
|
15
|
+
labelWrapper: "",
|
|
16
|
+
// wrapper around progress label and label span
|
|
17
|
+
track: "",
|
|
18
|
+
// track of the progress (not finished part)
|
|
19
|
+
value: ""
|
|
20
|
+
// span around the progress value
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
// See: https://github.com/nextui-org/nextui/blob/canary/packages/core/theme/src/components/progress.ts
|
|
24
|
+
color: {
|
|
25
|
+
danger: {
|
|
26
|
+
indicator: "bg-danger"
|
|
27
|
+
},
|
|
28
|
+
default: {
|
|
29
|
+
indicator: "bg-default-400"
|
|
30
|
+
},
|
|
31
|
+
info: {
|
|
32
|
+
indicator: "bg-info"
|
|
33
|
+
},
|
|
34
|
+
primary: {
|
|
35
|
+
indicator: "bg-primary"
|
|
36
|
+
},
|
|
37
|
+
secondary: {
|
|
38
|
+
indicator: "bg-secondary"
|
|
39
|
+
},
|
|
40
|
+
success: {
|
|
41
|
+
indicator: "bg-success"
|
|
42
|
+
},
|
|
43
|
+
warning: {
|
|
44
|
+
indicator: "bg-warning"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var defaultFormat = (percent) => `${percent}%`;
|
|
50
|
+
var Progress = ({
|
|
51
|
+
className = void 0,
|
|
52
|
+
color = "primary",
|
|
53
|
+
format = defaultFormat,
|
|
54
|
+
label = void 0,
|
|
55
|
+
percent,
|
|
56
|
+
showValueLabel = true,
|
|
57
|
+
size = "md",
|
|
58
|
+
successOnComplete = false,
|
|
59
|
+
testId = void 0
|
|
60
|
+
}) => {
|
|
61
|
+
const processedColor = successOnComplete && percent >= 100 ? "success" : color;
|
|
62
|
+
const variants = progressVariants({ color: processedColor });
|
|
63
|
+
const classNames = _pixelutils.variantsToClassNames.call(void 0, variants, className, "base");
|
|
64
|
+
const value = format(percent);
|
|
65
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
66
|
+
_progress.Progress,
|
|
67
|
+
{
|
|
68
|
+
"aria-label": "Loading...",
|
|
69
|
+
classNames,
|
|
70
|
+
"data-testid": testId,
|
|
71
|
+
formatOptions: void 0,
|
|
72
|
+
label,
|
|
73
|
+
showValueLabel,
|
|
74
|
+
size,
|
|
75
|
+
value: percent || 0,
|
|
76
|
+
valueLabel: !!percent && value
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
var Progress_default = Progress;
|
|
81
|
+
|
|
82
|
+
// src/Progress/index.ts
|
|
83
|
+
var Progress_default2 = Progress_default;
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
exports.Progress = Progress_default; exports.default = Progress_default2; exports.progressVariants = progressVariants;
|
|
89
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/Progress/index.cjs","../../src/Progress/Progress.tsx","../../src/Progress/index.ts"],"names":[],"mappings":"AAAA,0GAA8B;AAC9B;AACA;ACCA,4CAAyC;AAEzC,oDAAyC;AAyFrC,+CAAA;AAtFG,IAAM,iBAAA,EAAmB,4BAAA;AAAG,EACjC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,EAAA;AAAA;AAAA,IACN,SAAA,EAAW,EAAA;AAAA;AAAA,IACX,KAAA,EAAO,EAAA;AAAA;AAAA,IACP,YAAA,EAAc,EAAA;AAAA;AAAA,IACd,KAAA,EAAO,EAAA;AAAA;AAAA,IACP,KAAA,EAAO;AAAA;AAAA,EACT,CAAA;AAAA,EACA,QAAA,EAAU;AAAA;AAAA,IAER,KAAA,EAAO;AAAA,MACL,MAAA,EAAQ;AAAA,QACN,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,SAAA,EAAW;AAAA,QACT,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb,CAAA;AAAA,MACA,OAAA,EAAS;AAAA,QACP,SAAA,EAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF,CAAC,CAAA;AA0BD,IAAM,cAAA,EAAgB,CAAC,OAAA,EAAA,GAAoB,CAAA,EAAA;AAKzB;AACJ,EAAA;AACJ,EAAA;AACC,EAAA;AACD,EAAA;AACR,EAAA;AACiB,EAAA;AACV,EAAA;AACa,EAAA;AACX,EAAA;AACU;AAEjB,EAAA;AAEe,EAAA;AACE,EAAA;AAES,EAAA;AAG1B,EAAA;AAAC,IAAA;AAAA,IAAA;AACY,MAAA;AACX,MAAA;AACa,MAAA;AACE,MAAA;AACf,MAAA;AACA,MAAA;AACA,MAAA;AACkB,MAAA;AACO,MAAA;AAAA,IAAA;AAC3B,EAAA;AAEJ;AAEe;AD5BmB;AACA;AE3EnB;AF6EmB;AACA;AACA;AACA;AACA","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/Progress/index.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Progress as NextProgress } from '@heroui/progress';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// progress styling variants\nexport const progressVariants = tv({\n slots: {\n base: '', // wrapper around the whole component\n indicator: '', // indicator of the progress (finished part)\n label: '', // label at the top left of the progress bar\n labelWrapper: '', // wrapper around progress label and label span\n track: '', // track of the progress (not finished part)\n value: '', // span around the progress value\n },\n variants: {\n // See: https://github.com/nextui-org/nextui/blob/canary/packages/core/theme/src/components/progress.ts\n color: {\n danger: {\n indicator: 'bg-danger',\n },\n default: {\n indicator: 'bg-default-400',\n },\n info: {\n indicator: 'bg-info',\n },\n primary: {\n indicator: 'bg-primary',\n },\n secondary: {\n indicator: 'bg-secondary',\n },\n success: {\n indicator: 'bg-success',\n },\n warning: {\n indicator: 'bg-warning',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof progressVariants>;\ntype ClassName = TVClassName<typeof progressVariants>;\n\nexport interface ProgressProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** color of the progress bar */\n color?: VariantProps['color'];\n /** function to format the progress value */\n format?: (percent: number) => ReactNode;\n /** label of the progress bar */\n label?: ReactNode;\n /** percentage/progress of the progress bar */\n percent: number;\n /** whether to show the value label */\n showValueLabel?: boolean;\n /** size of the progress bar */\n size?: 'sm' | 'md' | 'lg';\n /** whether to show success color on complete */\n successOnComplete?: boolean;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst defaultFormat = (percent: number) => `${percent}%`;\n\n/**\n * Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)\n */\nconst Progress = ({\n className = undefined,\n color = 'primary',\n format = defaultFormat,\n label = undefined,\n percent,\n showValueLabel = true,\n size = 'md',\n successOnComplete = false,\n testId = undefined,\n}: ProgressProps) => {\n const processedColor =\n successOnComplete && percent >= 100 ? 'success' : color;\n\n const variants = progressVariants({ color: processedColor });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const value = format(percent);\n\n return (\n <NextProgress\n aria-label=\"Loading...\"\n classNames={classNames}\n data-testid={testId}\n formatOptions={undefined}\n label={label}\n showValueLabel={showValueLabel}\n size={size}\n value={percent || 0}\n valueLabel={!!percent && value}\n />\n );\n};\n\nexport default Progress;\n","import Progress, { progressVariants } from './Progress';\n\nexport type { ProgressProps, VariantProps } from './Progress';\n\nexport { Progress, progressVariants };\n\nexport default Progress;\n"]}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
4
|
+
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
declare const progressVariants: tailwind_variants.TVReturnType<{
|
|
8
|
+
color: {
|
|
9
|
+
danger: {
|
|
10
|
+
indicator: string;
|
|
11
|
+
};
|
|
12
|
+
default: {
|
|
13
|
+
indicator: string;
|
|
14
|
+
};
|
|
15
|
+
info: {
|
|
16
|
+
indicator: string;
|
|
17
|
+
};
|
|
18
|
+
primary: {
|
|
19
|
+
indicator: string;
|
|
20
|
+
};
|
|
21
|
+
secondary: {
|
|
22
|
+
indicator: string;
|
|
23
|
+
};
|
|
24
|
+
success: {
|
|
25
|
+
indicator: string;
|
|
26
|
+
};
|
|
27
|
+
warning: {
|
|
28
|
+
indicator: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}, {
|
|
32
|
+
base: string;
|
|
33
|
+
indicator: string;
|
|
34
|
+
label: string;
|
|
35
|
+
labelWrapper: string;
|
|
36
|
+
track: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
39
|
+
color: {
|
|
40
|
+
danger: {
|
|
41
|
+
indicator: string;
|
|
42
|
+
};
|
|
43
|
+
default: {
|
|
44
|
+
indicator: string;
|
|
45
|
+
};
|
|
46
|
+
info: {
|
|
47
|
+
indicator: string;
|
|
48
|
+
};
|
|
49
|
+
primary: {
|
|
50
|
+
indicator: string;
|
|
51
|
+
};
|
|
52
|
+
secondary: {
|
|
53
|
+
indicator: string;
|
|
54
|
+
};
|
|
55
|
+
success: {
|
|
56
|
+
indicator: string;
|
|
57
|
+
};
|
|
58
|
+
warning: {
|
|
59
|
+
indicator: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
color: {
|
|
64
|
+
danger: {
|
|
65
|
+
indicator: string;
|
|
66
|
+
};
|
|
67
|
+
default: {
|
|
68
|
+
indicator: string;
|
|
69
|
+
};
|
|
70
|
+
info: {
|
|
71
|
+
indicator: string;
|
|
72
|
+
};
|
|
73
|
+
primary: {
|
|
74
|
+
indicator: string;
|
|
75
|
+
};
|
|
76
|
+
secondary: {
|
|
77
|
+
indicator: string;
|
|
78
|
+
};
|
|
79
|
+
success: {
|
|
80
|
+
indicator: string;
|
|
81
|
+
};
|
|
82
|
+
warning: {
|
|
83
|
+
indicator: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}>, {
|
|
87
|
+
color: {
|
|
88
|
+
danger: {
|
|
89
|
+
indicator: string;
|
|
90
|
+
};
|
|
91
|
+
default: {
|
|
92
|
+
indicator: string;
|
|
93
|
+
};
|
|
94
|
+
info: {
|
|
95
|
+
indicator: string;
|
|
96
|
+
};
|
|
97
|
+
primary: {
|
|
98
|
+
indicator: string;
|
|
99
|
+
};
|
|
100
|
+
secondary: {
|
|
101
|
+
indicator: string;
|
|
102
|
+
};
|
|
103
|
+
success: {
|
|
104
|
+
indicator: string;
|
|
105
|
+
};
|
|
106
|
+
warning: {
|
|
107
|
+
indicator: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}, {
|
|
111
|
+
base: string;
|
|
112
|
+
indicator: string;
|
|
113
|
+
label: string;
|
|
114
|
+
labelWrapper: string;
|
|
115
|
+
track: string;
|
|
116
|
+
value: string;
|
|
117
|
+
}, tailwind_variants.TVReturnType<{
|
|
118
|
+
color: {
|
|
119
|
+
danger: {
|
|
120
|
+
indicator: string;
|
|
121
|
+
};
|
|
122
|
+
default: {
|
|
123
|
+
indicator: string;
|
|
124
|
+
};
|
|
125
|
+
info: {
|
|
126
|
+
indicator: string;
|
|
127
|
+
};
|
|
128
|
+
primary: {
|
|
129
|
+
indicator: string;
|
|
130
|
+
};
|
|
131
|
+
secondary: {
|
|
132
|
+
indicator: string;
|
|
133
|
+
};
|
|
134
|
+
success: {
|
|
135
|
+
indicator: string;
|
|
136
|
+
};
|
|
137
|
+
warning: {
|
|
138
|
+
indicator: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
}, {
|
|
142
|
+
base: string;
|
|
143
|
+
indicator: string;
|
|
144
|
+
label: string;
|
|
145
|
+
labelWrapper: string;
|
|
146
|
+
track: string;
|
|
147
|
+
value: string;
|
|
148
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
149
|
+
color: {
|
|
150
|
+
danger: {
|
|
151
|
+
indicator: string;
|
|
152
|
+
};
|
|
153
|
+
default: {
|
|
154
|
+
indicator: string;
|
|
155
|
+
};
|
|
156
|
+
info: {
|
|
157
|
+
indicator: string;
|
|
158
|
+
};
|
|
159
|
+
primary: {
|
|
160
|
+
indicator: string;
|
|
161
|
+
};
|
|
162
|
+
secondary: {
|
|
163
|
+
indicator: string;
|
|
164
|
+
};
|
|
165
|
+
success: {
|
|
166
|
+
indicator: string;
|
|
167
|
+
};
|
|
168
|
+
warning: {
|
|
169
|
+
indicator: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
}, {
|
|
173
|
+
color: {
|
|
174
|
+
danger: {
|
|
175
|
+
indicator: string;
|
|
176
|
+
};
|
|
177
|
+
default: {
|
|
178
|
+
indicator: string;
|
|
179
|
+
};
|
|
180
|
+
info: {
|
|
181
|
+
indicator: string;
|
|
182
|
+
};
|
|
183
|
+
primary: {
|
|
184
|
+
indicator: string;
|
|
185
|
+
};
|
|
186
|
+
secondary: {
|
|
187
|
+
indicator: string;
|
|
188
|
+
};
|
|
189
|
+
success: {
|
|
190
|
+
indicator: string;
|
|
191
|
+
};
|
|
192
|
+
warning: {
|
|
193
|
+
indicator: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
}>, unknown, unknown, undefined>>;
|
|
197
|
+
type VariantProps = TVProps<typeof progressVariants>;
|
|
198
|
+
type ClassName = TVClassName<typeof progressVariants>;
|
|
199
|
+
interface ProgressProps extends VariantProps {
|
|
200
|
+
/** CSS class name */
|
|
201
|
+
className?: ClassName;
|
|
202
|
+
/** color of the progress bar */
|
|
203
|
+
color?: VariantProps['color'];
|
|
204
|
+
/** function to format the progress value */
|
|
205
|
+
format?: (percent: number) => ReactNode;
|
|
206
|
+
/** label of the progress bar */
|
|
207
|
+
label?: ReactNode;
|
|
208
|
+
/** percentage/progress of the progress bar */
|
|
209
|
+
percent: number;
|
|
210
|
+
/** whether to show the value label */
|
|
211
|
+
showValueLabel?: boolean;
|
|
212
|
+
/** size of the progress bar */
|
|
213
|
+
size?: 'sm' | 'md' | 'lg';
|
|
214
|
+
/** whether to show success color on complete */
|
|
215
|
+
successOnComplete?: boolean;
|
|
216
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
217
|
+
testId?: string;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)
|
|
221
|
+
*/
|
|
222
|
+
declare const Progress: ({ className, color, format, label, percent, showValueLabel, size, successOnComplete, testId, }: ProgressProps) => react_jsx_runtime.JSX.Element;
|
|
223
|
+
|
|
224
|
+
export { Progress, type ProgressProps, type VariantProps, Progress as default, progressVariants };
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
4
|
+
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
declare const progressVariants: tailwind_variants.TVReturnType<{
|
|
8
|
+
color: {
|
|
9
|
+
danger: {
|
|
10
|
+
indicator: string;
|
|
11
|
+
};
|
|
12
|
+
default: {
|
|
13
|
+
indicator: string;
|
|
14
|
+
};
|
|
15
|
+
info: {
|
|
16
|
+
indicator: string;
|
|
17
|
+
};
|
|
18
|
+
primary: {
|
|
19
|
+
indicator: string;
|
|
20
|
+
};
|
|
21
|
+
secondary: {
|
|
22
|
+
indicator: string;
|
|
23
|
+
};
|
|
24
|
+
success: {
|
|
25
|
+
indicator: string;
|
|
26
|
+
};
|
|
27
|
+
warning: {
|
|
28
|
+
indicator: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}, {
|
|
32
|
+
base: string;
|
|
33
|
+
indicator: string;
|
|
34
|
+
label: string;
|
|
35
|
+
labelWrapper: string;
|
|
36
|
+
track: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
39
|
+
color: {
|
|
40
|
+
danger: {
|
|
41
|
+
indicator: string;
|
|
42
|
+
};
|
|
43
|
+
default: {
|
|
44
|
+
indicator: string;
|
|
45
|
+
};
|
|
46
|
+
info: {
|
|
47
|
+
indicator: string;
|
|
48
|
+
};
|
|
49
|
+
primary: {
|
|
50
|
+
indicator: string;
|
|
51
|
+
};
|
|
52
|
+
secondary: {
|
|
53
|
+
indicator: string;
|
|
54
|
+
};
|
|
55
|
+
success: {
|
|
56
|
+
indicator: string;
|
|
57
|
+
};
|
|
58
|
+
warning: {
|
|
59
|
+
indicator: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
color: {
|
|
64
|
+
danger: {
|
|
65
|
+
indicator: string;
|
|
66
|
+
};
|
|
67
|
+
default: {
|
|
68
|
+
indicator: string;
|
|
69
|
+
};
|
|
70
|
+
info: {
|
|
71
|
+
indicator: string;
|
|
72
|
+
};
|
|
73
|
+
primary: {
|
|
74
|
+
indicator: string;
|
|
75
|
+
};
|
|
76
|
+
secondary: {
|
|
77
|
+
indicator: string;
|
|
78
|
+
};
|
|
79
|
+
success: {
|
|
80
|
+
indicator: string;
|
|
81
|
+
};
|
|
82
|
+
warning: {
|
|
83
|
+
indicator: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}>, {
|
|
87
|
+
color: {
|
|
88
|
+
danger: {
|
|
89
|
+
indicator: string;
|
|
90
|
+
};
|
|
91
|
+
default: {
|
|
92
|
+
indicator: string;
|
|
93
|
+
};
|
|
94
|
+
info: {
|
|
95
|
+
indicator: string;
|
|
96
|
+
};
|
|
97
|
+
primary: {
|
|
98
|
+
indicator: string;
|
|
99
|
+
};
|
|
100
|
+
secondary: {
|
|
101
|
+
indicator: string;
|
|
102
|
+
};
|
|
103
|
+
success: {
|
|
104
|
+
indicator: string;
|
|
105
|
+
};
|
|
106
|
+
warning: {
|
|
107
|
+
indicator: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}, {
|
|
111
|
+
base: string;
|
|
112
|
+
indicator: string;
|
|
113
|
+
label: string;
|
|
114
|
+
labelWrapper: string;
|
|
115
|
+
track: string;
|
|
116
|
+
value: string;
|
|
117
|
+
}, tailwind_variants.TVReturnType<{
|
|
118
|
+
color: {
|
|
119
|
+
danger: {
|
|
120
|
+
indicator: string;
|
|
121
|
+
};
|
|
122
|
+
default: {
|
|
123
|
+
indicator: string;
|
|
124
|
+
};
|
|
125
|
+
info: {
|
|
126
|
+
indicator: string;
|
|
127
|
+
};
|
|
128
|
+
primary: {
|
|
129
|
+
indicator: string;
|
|
130
|
+
};
|
|
131
|
+
secondary: {
|
|
132
|
+
indicator: string;
|
|
133
|
+
};
|
|
134
|
+
success: {
|
|
135
|
+
indicator: string;
|
|
136
|
+
};
|
|
137
|
+
warning: {
|
|
138
|
+
indicator: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
}, {
|
|
142
|
+
base: string;
|
|
143
|
+
indicator: string;
|
|
144
|
+
label: string;
|
|
145
|
+
labelWrapper: string;
|
|
146
|
+
track: string;
|
|
147
|
+
value: string;
|
|
148
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
149
|
+
color: {
|
|
150
|
+
danger: {
|
|
151
|
+
indicator: string;
|
|
152
|
+
};
|
|
153
|
+
default: {
|
|
154
|
+
indicator: string;
|
|
155
|
+
};
|
|
156
|
+
info: {
|
|
157
|
+
indicator: string;
|
|
158
|
+
};
|
|
159
|
+
primary: {
|
|
160
|
+
indicator: string;
|
|
161
|
+
};
|
|
162
|
+
secondary: {
|
|
163
|
+
indicator: string;
|
|
164
|
+
};
|
|
165
|
+
success: {
|
|
166
|
+
indicator: string;
|
|
167
|
+
};
|
|
168
|
+
warning: {
|
|
169
|
+
indicator: string;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
}, {
|
|
173
|
+
color: {
|
|
174
|
+
danger: {
|
|
175
|
+
indicator: string;
|
|
176
|
+
};
|
|
177
|
+
default: {
|
|
178
|
+
indicator: string;
|
|
179
|
+
};
|
|
180
|
+
info: {
|
|
181
|
+
indicator: string;
|
|
182
|
+
};
|
|
183
|
+
primary: {
|
|
184
|
+
indicator: string;
|
|
185
|
+
};
|
|
186
|
+
secondary: {
|
|
187
|
+
indicator: string;
|
|
188
|
+
};
|
|
189
|
+
success: {
|
|
190
|
+
indicator: string;
|
|
191
|
+
};
|
|
192
|
+
warning: {
|
|
193
|
+
indicator: string;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
}>, unknown, unknown, undefined>>;
|
|
197
|
+
type VariantProps = TVProps<typeof progressVariants>;
|
|
198
|
+
type ClassName = TVClassName<typeof progressVariants>;
|
|
199
|
+
interface ProgressProps extends VariantProps {
|
|
200
|
+
/** CSS class name */
|
|
201
|
+
className?: ClassName;
|
|
202
|
+
/** color of the progress bar */
|
|
203
|
+
color?: VariantProps['color'];
|
|
204
|
+
/** function to format the progress value */
|
|
205
|
+
format?: (percent: number) => ReactNode;
|
|
206
|
+
/** label of the progress bar */
|
|
207
|
+
label?: ReactNode;
|
|
208
|
+
/** percentage/progress of the progress bar */
|
|
209
|
+
percent: number;
|
|
210
|
+
/** whether to show the value label */
|
|
211
|
+
showValueLabel?: boolean;
|
|
212
|
+
/** size of the progress bar */
|
|
213
|
+
size?: 'sm' | 'md' | 'lg';
|
|
214
|
+
/** whether to show success color on complete */
|
|
215
|
+
successOnComplete?: boolean;
|
|
216
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
217
|
+
testId?: string;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)
|
|
221
|
+
*/
|
|
222
|
+
declare const Progress: ({ className, color, format, label, percent, showValueLabel, size, successOnComplete, testId, }: ProgressProps) => react_jsx_runtime.JSX.Element;
|
|
223
|
+
|
|
224
|
+
export { Progress, type ProgressProps, type VariantProps, Progress as default, progressVariants };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import "../chunk-J7N2552D.js";
|
|
2
|
+
|
|
3
|
+
// src/Progress/Progress.tsx
|
|
4
|
+
import { Progress as NextProgress } from "@heroui/progress";
|
|
5
|
+
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var progressVariants = tv({
|
|
8
|
+
slots: {
|
|
9
|
+
base: "",
|
|
10
|
+
// wrapper around the whole component
|
|
11
|
+
indicator: "",
|
|
12
|
+
// indicator of the progress (finished part)
|
|
13
|
+
label: "",
|
|
14
|
+
// label at the top left of the progress bar
|
|
15
|
+
labelWrapper: "",
|
|
16
|
+
// wrapper around progress label and label span
|
|
17
|
+
track: "",
|
|
18
|
+
// track of the progress (not finished part)
|
|
19
|
+
value: ""
|
|
20
|
+
// span around the progress value
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
// See: https://github.com/nextui-org/nextui/blob/canary/packages/core/theme/src/components/progress.ts
|
|
24
|
+
color: {
|
|
25
|
+
danger: {
|
|
26
|
+
indicator: "bg-danger"
|
|
27
|
+
},
|
|
28
|
+
default: {
|
|
29
|
+
indicator: "bg-default-400"
|
|
30
|
+
},
|
|
31
|
+
info: {
|
|
32
|
+
indicator: "bg-info"
|
|
33
|
+
},
|
|
34
|
+
primary: {
|
|
35
|
+
indicator: "bg-primary"
|
|
36
|
+
},
|
|
37
|
+
secondary: {
|
|
38
|
+
indicator: "bg-secondary"
|
|
39
|
+
},
|
|
40
|
+
success: {
|
|
41
|
+
indicator: "bg-success"
|
|
42
|
+
},
|
|
43
|
+
warning: {
|
|
44
|
+
indicator: "bg-warning"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var defaultFormat = (percent) => `${percent}%`;
|
|
50
|
+
var Progress = ({
|
|
51
|
+
className = void 0,
|
|
52
|
+
color = "primary",
|
|
53
|
+
format = defaultFormat,
|
|
54
|
+
label = void 0,
|
|
55
|
+
percent,
|
|
56
|
+
showValueLabel = true,
|
|
57
|
+
size = "md",
|
|
58
|
+
successOnComplete = false,
|
|
59
|
+
testId = void 0
|
|
60
|
+
}) => {
|
|
61
|
+
const processedColor = successOnComplete && percent >= 100 ? "success" : color;
|
|
62
|
+
const variants = progressVariants({ color: processedColor });
|
|
63
|
+
const classNames = variantsToClassNames(variants, className, "base");
|
|
64
|
+
const value = format(percent);
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
NextProgress,
|
|
67
|
+
{
|
|
68
|
+
"aria-label": "Loading...",
|
|
69
|
+
classNames,
|
|
70
|
+
"data-testid": testId,
|
|
71
|
+
formatOptions: void 0,
|
|
72
|
+
label,
|
|
73
|
+
showValueLabel,
|
|
74
|
+
size,
|
|
75
|
+
value: percent || 0,
|
|
76
|
+
valueLabel: !!percent && value
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
var Progress_default = Progress;
|
|
81
|
+
|
|
82
|
+
// src/Progress/index.ts
|
|
83
|
+
var Progress_default2 = Progress_default;
|
|
84
|
+
export {
|
|
85
|
+
Progress_default as Progress,
|
|
86
|
+
Progress_default2 as default,
|
|
87
|
+
progressVariants
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Progress/Progress.tsx","../../src/Progress/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Progress as NextProgress } from '@heroui/progress';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// progress styling variants\nexport const progressVariants = tv({\n slots: {\n base: '', // wrapper around the whole component\n indicator: '', // indicator of the progress (finished part)\n label: '', // label at the top left of the progress bar\n labelWrapper: '', // wrapper around progress label and label span\n track: '', // track of the progress (not finished part)\n value: '', // span around the progress value\n },\n variants: {\n // See: https://github.com/nextui-org/nextui/blob/canary/packages/core/theme/src/components/progress.ts\n color: {\n danger: {\n indicator: 'bg-danger',\n },\n default: {\n indicator: 'bg-default-400',\n },\n info: {\n indicator: 'bg-info',\n },\n primary: {\n indicator: 'bg-primary',\n },\n secondary: {\n indicator: 'bg-secondary',\n },\n success: {\n indicator: 'bg-success',\n },\n warning: {\n indicator: 'bg-warning',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof progressVariants>;\ntype ClassName = TVClassName<typeof progressVariants>;\n\nexport interface ProgressProps extends VariantProps {\n /** CSS class name */\n className?: ClassName;\n /** color of the progress bar */\n color?: VariantProps['color'];\n /** function to format the progress value */\n format?: (percent: number) => ReactNode;\n /** label of the progress bar */\n label?: ReactNode;\n /** percentage/progress of the progress bar */\n percent: number;\n /** whether to show the value label */\n showValueLabel?: boolean;\n /** size of the progress bar */\n size?: 'sm' | 'md' | 'lg';\n /** whether to show success color on complete */\n successOnComplete?: boolean;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst defaultFormat = (percent: number) => `${percent}%`;\n\n/**\n * Progress component based on [HeroUI Progress](https://www.heroui.com//docs/components/progress)\n */\nconst Progress = ({\n className = undefined,\n color = 'primary',\n format = defaultFormat,\n label = undefined,\n percent,\n showValueLabel = true,\n size = 'md',\n successOnComplete = false,\n testId = undefined,\n}: ProgressProps) => {\n const processedColor =\n successOnComplete && percent >= 100 ? 'success' : color;\n\n const variants = progressVariants({ color: processedColor });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const value = format(percent);\n\n return (\n <NextProgress\n aria-label=\"Loading...\"\n classNames={classNames}\n data-testid={testId}\n formatOptions={undefined}\n label={label}\n showValueLabel={showValueLabel}\n size={size}\n value={percent || 0}\n valueLabel={!!percent && value}\n />\n );\n};\n\nexport default Progress;\n","import Progress, { progressVariants } from './Progress';\n\nexport type { ProgressProps, VariantProps } from './Progress';\n\nexport { Progress, progressVariants };\n\nexport default Progress;\n"],"mappings":";;;AAGA,SAAS,YAAY,oBAAoB;AAEzC,SAAS,IAAI,4BAA4B;AAyFrC;AAtFG,IAAM,mBAAmB,GAAG;AAAA,EACjC,OAAO;AAAA,IACL,MAAM;AAAA;AAAA,IACN,WAAW;AAAA;AAAA,IACX,OAAO;AAAA;AAAA,IACP,cAAc;AAAA;AAAA,IACd,OAAO;AAAA;AAAA,IACP,OAAO;AAAA;AAAA,EACT;AAAA,EACA,UAAU;AAAA;AAAA,IAER,OAAO;AAAA,MACL,QAAQ;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,MAAM;AAAA,QACJ,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,WAAW;AAAA,QACT,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,MACA,SAAS;AAAA,QACP,WAAW;AAAA,MACb;AAAA,IACF;AAAA,EACF;AACF,CAAC;AA0BD,IAAM,gBAAgB,CAAC,YAAoB,GAAG,OAAO;AAKrD,IAAM,WAAW,CAAC;AAAA,EAChB,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR;AAAA,EACA,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,oBAAoB;AAAA,EACpB,SAAS;AACX,MAAqB;AACnB,QAAM,iBACJ,qBAAqB,WAAW,MAAM,YAAY;AAEpD,QAAM,WAAW,iBAAiB,EAAE,OAAO,eAAe,CAAC;AAC3D,QAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;AAEnE,QAAM,QAAQ,OAAO,OAAO;AAE5B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX;AAAA,MACA,eAAa;AAAA,MACb,eAAe;AAAA,MACf;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,WAAW;AAAA,MAClB,YAAY,CAAC,CAAC,WAAW;AAAA;AAAA,EAC3B;AAEJ;AAEA,IAAO,mBAAQ;;;ACtGf,IAAOA,oBAAQ;","names":["Progress_default"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkTX2VP4J7cjs = require('../chunk-TX2VP4J7.cjs');
|
|
4
4
|
require('../chunk-D4TLDLEX.cjs');
|
|
5
5
|
|
|
6
6
|
// src/ScrollShadow/index.ts
|
|
7
|
-
var ScrollShadow_default2 =
|
|
7
|
+
var ScrollShadow_default2 = _chunkTX2VP4J7cjs.ScrollShadow_default;
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.ScrollShadow =
|
|
11
|
+
exports.ScrollShadow = _chunkTX2VP4J7cjs.ScrollShadow_default; exports.default = ScrollShadow_default2;
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -10,7 +10,7 @@ interface ScrollShadowProps {
|
|
|
10
10
|
testId?: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Scroll Shadow component based on [
|
|
13
|
+
* Scroll Shadow component based on [HeroUI Scroll Shadow](https://www.heroui.com//docs/components/scroll-shadow)
|
|
14
14
|
*/
|
|
15
15
|
declare const _default: ({ children, className, testId, }: ScrollShadowProps) => react_jsx_runtime.JSX.Element;
|
|
16
16
|
|
|
@@ -10,7 +10,7 @@ interface ScrollShadowProps {
|
|
|
10
10
|
testId?: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
|
-
* Scroll Shadow component based on [
|
|
13
|
+
* Scroll Shadow component based on [HeroUI Scroll Shadow](https://www.heroui.com//docs/components/scroll-shadow)
|
|
14
14
|
*/
|
|
15
15
|
declare const _default: ({ children, className, testId, }: ScrollShadowProps) => react_jsx_runtime.JSX.Element;
|
|
16
16
|
|