rbro-tat-uds 2.2.1 → 2.2.3

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.
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ "use client";
3
+
4
+ 'use strict';
5
+
6
+ Object.defineProperty(exports, '__esModule', { value: true });
7
+
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+ var utils = require('../../utils');
10
+ var React = require('react');
11
+ var styled = require('styled-components');
12
+
13
+ const GraficContributieUnitlinkedStyled = styled.svg`
14
+ & > .limit_label_main {
15
+ font-size: 14px;
16
+ font-weight: 400;
17
+ fill: ${utils.colors.gray_950};
18
+ }
19
+ & > .limit_label_secondary {
20
+ font-size: 16px;
21
+ font-weight: 700;
22
+ fill: ${utils.colors.gray_950};
23
+ }
24
+ `;
25
+ const GraficContributieUnitlinked = ({
26
+ limitTop = 50,
27
+ limitBottom = 100,
28
+ limitTopLabel = "Top Label",
29
+ limitBottomLabel = "Bottom Label",
30
+ currency = "RON",
31
+ height = 142,
32
+ colorBar = utils.colors.danger_100,
33
+ colorFilledBar = utils.colors.success_400
34
+ }) => {
35
+ const RO = new Intl.NumberFormat("RO");
36
+ const svg_ref = React.useRef(null);
37
+ const [w, setW] = React.useState(0);
38
+ const BAR_HEIGHT = 24;
39
+ const configuration = React.useMemo(() => {
40
+ const barY = height / 2 - BAR_HEIGHT / 2;
41
+ const barYStop = barY + BAR_HEIGHT;
42
+ const limitTopHeight = height - barYStop + BAR_HEIGHT;
43
+ const limitTopX = Math.min(Math.max(0, limitTop / limitBottom * w), w - 2);
44
+ const limitTopLabelsAnchor = limitTopX > w * 0.75 ? "end" : "start";
45
+ const limitBottomX = w - 2;
46
+ const limitBottomY = barY;
47
+ const limitBottomHeight = limitTopHeight;
48
+ return {
49
+ barY,
50
+ barYStop,
51
+ limitTopHeight,
52
+ limitTopX,
53
+ limitTopLabelsAnchor,
54
+ limitBottomY,
55
+ limitBottomHeight,
56
+ limitBottomX
57
+ };
58
+ }, [limitTop, limitBottom, height, w]);
59
+ React.useEffect(() => {
60
+ if (svg_ref.current) {
61
+ setW(svg_ref.current.clientWidth);
62
+ }
63
+ }, [svg_ref]);
64
+ return /* @__PURE__ */ jsxRuntime.jsxs(
65
+ GraficContributieUnitlinkedStyled,
66
+ {
67
+ ref: svg_ref,
68
+ width: "100%",
69
+ height,
70
+ xmlns: "http://www.w3.org/2000/svg",
71
+ children: [
72
+ /* @__PURE__ */ jsxRuntime.jsx(
73
+ "rect",
74
+ {
75
+ x: 0,
76
+ y: configuration.barY,
77
+ width: "100%",
78
+ height: BAR_HEIGHT,
79
+ fill: colorBar
80
+ }
81
+ ),
82
+ /* @__PURE__ */ jsxRuntime.jsx(
83
+ "rect",
84
+ {
85
+ x: 0,
86
+ y: configuration.barY,
87
+ width: configuration.limitTopX,
88
+ height: BAR_HEIGHT,
89
+ fill: colorFilledBar
90
+ }
91
+ ),
92
+ /* @__PURE__ */ jsxRuntime.jsx(
93
+ "rect",
94
+ {
95
+ x: configuration.limitTopX,
96
+ y: 0,
97
+ height: configuration.limitTopHeight,
98
+ fill: "black",
99
+ width: 2
100
+ }
101
+ ),
102
+ /* @__PURE__ */ jsxRuntime.jsx(
103
+ "text",
104
+ {
105
+ className: "limit_label_main",
106
+ textAnchor: configuration.limitTopLabelsAnchor,
107
+ x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
108
+ y: 12,
109
+ children: limitTopLabel
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsxRuntime.jsx(
113
+ "text",
114
+ {
115
+ className: "limit_label_secondary",
116
+ textAnchor: configuration.limitTopLabelsAnchor,
117
+ x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
118
+ y: 12 + 20,
119
+ children: RO.format(limitTop) + " " + currency
120
+ }
121
+ ),
122
+ /* @__PURE__ */ jsxRuntime.jsx(
123
+ "rect",
124
+ {
125
+ x: configuration.limitBottomX,
126
+ y: configuration.limitBottomY,
127
+ height: configuration.limitBottomHeight,
128
+ fill: "black",
129
+ width: 2
130
+ }
131
+ ),
132
+ /* @__PURE__ */ jsxRuntime.jsx(
133
+ "text",
134
+ {
135
+ className: "limit_label_main",
136
+ textAnchor: "end",
137
+ x: configuration.limitBottomX - 12,
138
+ y: height - 20,
139
+ children: limitBottomLabel
140
+ }
141
+ ),
142
+ /* @__PURE__ */ jsxRuntime.jsx(
143
+ "text",
144
+ {
145
+ className: "limit_label_secondary",
146
+ textAnchor: "end",
147
+ x: configuration.limitBottomX - 12,
148
+ y: height,
149
+ children: RO.format(limitBottom) + " " + currency
150
+ }
151
+ )
152
+ ]
153
+ }
154
+ );
155
+ };
156
+
157
+ exports.default = GraficContributieUnitlinked;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ "use client";
3
+
4
+ 'use strict';
5
+
6
+ Object.defineProperty(exports, '__esModule', { value: true });
7
+
8
+ var GraficContributieUnitlinked = require('./GraficContributieUnitlinked.cjs');
9
+
10
+
11
+
12
+ exports.default = GraficContributieUnitlinked.default;
@@ -13,6 +13,7 @@ var mNoFees = require('./illustrations/m-no-fees.svg.cjs');
13
13
  var mQuickMoney = require('./illustrations/m-quick-money.svg.cjs');
14
14
  var mCelebrationRaiffeisen = require('./illustrations/m-celebration-raiffeisen.svg.cjs');
15
15
  var sHousingLoan = require('./illustrations/s-housing-loan.svg.cjs');
16
+ var sRegularInvestment = require('./illustrations/s-regular-investment.svg.cjs');
16
17
 
17
18
  const illustrations = {
18
19
  "m-investing-money": mInvestingMoney.default,
@@ -24,7 +25,8 @@ const illustrations = {
24
25
  "m-no-fees": mNoFees.default,
25
26
  "m-quick-money": mQuickMoney.default,
26
27
  "m-celebration-raiffeisen": mCelebrationRaiffeisen.default,
27
- "s-housing-loan": sHousingLoan.default
28
+ "s-housing-loan": sHousingLoan.default,
29
+ "s-regular-investment": sRegularInvestment.default
28
30
  };
29
31
 
30
32
  exports.illustrations = illustrations;