@consumidor-positivo/aurora 0.0.116 → 0.0.118
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/components/ProgressBar/index.d.ts +9 -0
- package/dist/components/ProgressBar/index.es.js +45 -0
- package/dist/components/ProgressBar/index.es.js.map +1 -0
- package/dist/components/ProgressBar/styles.css +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.es.js +2 -0
- package/dist/main.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Conditional } from "../Conditional/index.es.js";
|
|
3
|
+
import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
4
|
+
import { Text } from "../Text/index.es.js";
|
|
5
|
+
import './styles.css';const ProgressBar = ({
|
|
6
|
+
percentageMode = false,
|
|
7
|
+
stepName,
|
|
8
|
+
currentStep,
|
|
9
|
+
totalSteps
|
|
10
|
+
}) => {
|
|
11
|
+
const safeCurrentStep = Math.max(1, Math.min(currentStep, totalSteps));
|
|
12
|
+
const percentageWidth = safeCurrentStep / totalSteps * 100;
|
|
13
|
+
const progressText = percentageMode ? `${Math.round(percentageWidth)}%` : `${safeCurrentStep} de ${totalSteps}`;
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", { className: "au-progress-bar", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
Conditional,
|
|
17
|
+
{
|
|
18
|
+
condition: !!percentageMode,
|
|
19
|
+
renderIf: /* @__PURE__ */ jsx("div", { className: "au-progress-bar__bar", children: /* @__PURE__ */ jsx(
|
|
20
|
+
"div",
|
|
21
|
+
{
|
|
22
|
+
style: { width: `${percentageWidth}%` },
|
|
23
|
+
className: "au-progress-bar__bar-filled"
|
|
24
|
+
}
|
|
25
|
+
) }),
|
|
26
|
+
renderElse: /* @__PURE__ */ jsx("div", { className: "au-progress-bar__steps", children: Array.from({ length: totalSteps }).map((_, index) => /* @__PURE__ */ jsx("div", { className: "au-progress-bar__step-container", children: /* @__PURE__ */ jsx(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
className: classNames("au-progress-bar__step-filled", {
|
|
30
|
+
"au-progress-bar__step-filled--is-active": index < safeCurrentStep
|
|
31
|
+
})
|
|
32
|
+
}
|
|
33
|
+
) }, index)) })
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ jsxs("div", { className: "au-progress-bar__text", children: [
|
|
37
|
+
/* @__PURE__ */ jsx(Text, { as: "span", variant: "body-medium", children: stepName }),
|
|
38
|
+
/* @__PURE__ */ jsx(Text, { as: "span", variant: "body-medium", children: progressText })
|
|
39
|
+
] })
|
|
40
|
+
] });
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
ProgressBar
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/ProgressBar/index.tsx"],"sourcesContent":["import { Conditional } from '@components/misc'\nimport classNames from 'classnames'\nimport { Text } from '../Text'\n\nimport './styles.scss'\n\ninterface ProgressBarProps {\n percentageMode?: boolean\n stepName: string\n currentStep: number\n totalSteps: number\n}\n\nexport const ProgressBar: React.FC<ProgressBarProps> = ({\n percentageMode = false,\n stepName,\n currentStep,\n totalSteps,\n}) => {\n const safeCurrentStep = Math.max(1, Math.min(currentStep, totalSteps))\n const percentageWidth = (safeCurrentStep / totalSteps) * 100\n\n const progressText = percentageMode\n ? `${Math.round(percentageWidth)}%`\n : `${safeCurrentStep} de ${totalSteps}`\n\n return (\n <div className=\"au-progress-bar\">\n <Conditional\n condition={!!percentageMode}\n renderIf={\n <div className=\"au-progress-bar__bar\">\n <div\n style={{ width: `${percentageWidth}%` }}\n className=\"au-progress-bar__bar-filled\"\n />\n </div>\n }\n renderElse={\n <div className=\"au-progress-bar__steps\">\n {Array.from({ length: totalSteps }).map((_, index) => (\n <div key={index} className=\"au-progress-bar__step-container\">\n <div\n className={classNames('au-progress-bar__step-filled', {\n 'au-progress-bar__step-filled--is-active':\n index < safeCurrentStep,\n })}\n />\n </div>\n ))}\n </div>\n }\n />\n\n <div className=\"au-progress-bar__text\">\n <Text as=\"span\" variant=\"body-medium\">\n {stepName}\n </Text>\n\n <Text as=\"span\" variant=\"body-medium\">\n {progressText}\n </Text>\n </div>\n </div>\n )\n}\n"],"names":[],"mappings":";;;;AAaO,MAAM,cAA0C,CAAC;AAAA,EACtD,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACE,QAAA,kBAAkB,KAAK,IAAI,GAAG,KAAK,IAAI,aAAa,UAAU,CAAC;AAC/D,QAAA,kBAAmB,kBAAkB,aAAc;AAEnD,QAAA,eAAe,iBACjB,GAAG,KAAK,MAAM,eAAe,CAAC,MAC9B,GAAG,eAAe,OAAO,UAAU;AAGrC,SAAA,qBAAC,OAAI,EAAA,WAAU,mBACb,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAW,CAAC,CAAC;AAAA,QACb,UACE,oBAAC,OAAI,EAAA,WAAU,wBACb,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,OAAO,EAAE,OAAO,GAAG,eAAe,IAAI;AAAA,YACtC,WAAU;AAAA,UAAA;AAAA,QAAA,GAEd;AAAA,QAEF,YACG,oBAAA,OAAA,EAAI,WAAU,0BACZ,UAAA,MAAM,KAAK,EAAE,QAAQ,WAAY,CAAA,EAAE,IAAI,CAAC,GAAG,UACzC,oBAAA,OAAA,EAAgB,WAAU,mCACzB,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,WAAW,gCAAgC;AAAA,cACpD,2CACE,QAAQ;AAAA,YAAA,CACX;AAAA,UAAA;AAAA,QAAA,KALK,KAOV,CACD,GACH;AAAA,MAAA;AAAA,IAEJ;AAAA,IAEA,qBAAC,OAAI,EAAA,WAAU,yBACb,UAAA;AAAA,MAAA,oBAAC,MAAK,EAAA,IAAG,QAAO,SAAQ,eACrB,UACH,UAAA;AAAA,0BAEC,MAAK,EAAA,IAAG,QAAO,SAAQ,eACrB,UACH,cAAA;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.au-progress-bar{display:flex;flex-direction:column;gap:12px}.au-progress-bar__bar{background-color:#e2e4e9;overflow:hidden;border-radius:4px;width:100%;height:8px}.au-progress-bar__bar-filled{background-color:#0048db;transition:width .3s ease-in-out;border-radius:500px;height:8px}.au-progress-bar__steps{display:flex;width:100%;gap:8px}.au-progress-bar__step-container{display:flex;align-items:center;justify-content:center;background-color:#e2e4e9;border-radius:4px;width:100%;height:8px}.au-progress-bar__step-filled{transition:background-color .3s ease-in-out;background-color:transparent;border-radius:4px;width:100%;height:100%}.au-progress-bar__step-filled--is-active{background-color:#0048db}.au-progress-bar__text{display:flex;flex-direction:row;justify-content:space-between}
|
package/dist/main.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { Tabs } from './components/Tabs';
|
|
|
23
23
|
export { Skeleton } from './components/Skeleton';
|
|
24
24
|
export { Spinner } from './components/Spinner';
|
|
25
25
|
export { Image } from '../../../../../../lib/components/Image';
|
|
26
|
+
export { ProgressBar } from './components/ProgressBar';
|
|
26
27
|
export { useDrawer } from './components/Drawer/hooks';
|
|
27
28
|
export * from './components/Logo';
|
|
28
29
|
export * from './components/icons';
|
package/dist/main.es.js
CHANGED
|
@@ -22,6 +22,7 @@ import { Tabs } from "./components/Tabs/index.es.js";
|
|
|
22
22
|
import { Skeleton } from "./components/Skeleton/index.es.js";
|
|
23
23
|
import { Spinner } from "./components/Spinner/index.es.js";
|
|
24
24
|
import { Image } from "./components/Image/index.es.js";
|
|
25
|
+
import { ProgressBar } from "./components/ProgressBar/index.es.js";
|
|
25
26
|
import { useState } from "react";
|
|
26
27
|
import { L, a, b, c, d, e, f, g, h, i, j, k, l, m } from "./Tertiary-gAn3a4CX.js";
|
|
27
28
|
import { IconActivity } from "./components/icons/IconActivity/index.es.js";
|
|
@@ -785,6 +786,7 @@ export {
|
|
|
785
786
|
ap as OPACITY_40,
|
|
786
787
|
PasswordField,
|
|
787
788
|
ProfileNav,
|
|
789
|
+
ProgressBar,
|
|
788
790
|
Radio,
|
|
789
791
|
aq as SHADOW_01,
|
|
790
792
|
ar as SHADOW_02,
|
package/dist/main.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.es.js","sources":["../lib/components/Drawer/hooks.ts"],"sourcesContent":["import { useState } from 'react'\n\ntype UseDrawerProps = Record<string, boolean>\n\nexport function useDrawer(props: UseDrawerProps) {\n const [drawerOpen, setDrawerOpen] = useState<UseDrawerProps>(props)\n\n function handleOpenDrawer(name: string) {\n setDrawerOpen((prev) => {\n return {\n ...prev,\n [name]: !prev[name],\n }\n })\n }\n\n return {\n handleOpenDrawer,\n drawerOpen,\n }\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"main.es.js","sources":["../lib/components/Drawer/hooks.ts"],"sourcesContent":["import { useState } from 'react'\n\ntype UseDrawerProps = Record<string, boolean>\n\nexport function useDrawer(props: UseDrawerProps) {\n const [drawerOpen, setDrawerOpen] = useState<UseDrawerProps>(props)\n\n function handleOpenDrawer(name: string) {\n setDrawerOpen((prev) => {\n return {\n ...prev,\n [name]: !prev[name],\n }\n })\n }\n\n return {\n handleOpenDrawer,\n drawerOpen,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIO,SAAS,UAAU,OAAuB;AAC/C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAyB,KAAK;AAElE,WAAS,iBAAiB,MAAc;AACtC,kBAAc,CAAC,SAAS;AACf,aAAA;AAAA,QACL,GAAG;AAAA,QACH,CAAC,IAAI,GAAG,CAAC,KAAK,IAAI;AAAA,MAAA;AAAA,IACpB,CACD;AAAA,EACH;AAEO,SAAA;AAAA,IACL;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|