rbro-tat-uds 2.2.2 → 2.2.4

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.
Files changed (28) hide show
  1. package/build/cjs/assets/icons/face-happy.svg.cjs +39 -0
  2. package/build/cjs/assets/icons/person-level.svg.cjs +43 -0
  3. package/build/cjs/components/Button/Button.cjs +2 -0
  4. package/build/cjs/components/GraficContributieUnitlinked/GraficContributieUnitlinked.cjs +157 -0
  5. package/build/cjs/components/GraficContributieUnitlinked/index.cjs +12 -0
  6. package/build/cjs/components/Icon/IconsList.cjs +5 -1
  7. package/build/cjs/components/IconButton/IconButton.cjs +2 -0
  8. package/build/cjs/components/PageMessage/PageMessage.cjs +2 -0
  9. package/build/cjs/components/TextInput/TextInput.cjs +2 -0
  10. package/build/cjs/components/index.cjs +2 -0
  11. package/build/cjs/index.cjs +813 -632
  12. package/build/esm/assets/icons/face-happy.svg.js +18 -0
  13. package/build/esm/assets/icons/person-level.svg.js +22 -0
  14. package/build/esm/components/Button/Button.js +2 -0
  15. package/build/esm/components/GraficContributieUnitlinked/GraficContributieUnitlinked.js +153 -0
  16. package/build/esm/components/GraficContributieUnitlinked/index.js +8 -0
  17. package/build/esm/components/Icon/IconsList.js +5 -1
  18. package/build/esm/components/IconButton/IconButton.js +2 -0
  19. package/build/esm/components/PageMessage/PageMessage.js +2 -0
  20. package/build/esm/components/TextInput/TextInput.js +2 -0
  21. package/build/esm/components/index.js +1 -0
  22. package/build/esm/index.js +813 -633
  23. package/build/types/components/GraficContributieUnitlinked/GraficContributieUnitlinked.d.ts +16 -0
  24. package/build/types/components/GraficContributieUnitlinked/index.d.ts +6 -0
  25. package/build/types/components/Icon/Icon.types.d.ts +1 -1
  26. package/build/types/components/Icon/IconsList.d.ts +2 -0
  27. package/build/types/index.d.ts +1 -0
  28. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+
3
+ var _path, _path2;
4
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
5
+ var SvgFaceHappy = function SvgFaceHappy(props) {
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ viewBox: "0 0 24 24"
9
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
10
+ d: "M10 10.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M15.5 12a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M12 16a3.99 3.99 0 0 1-2.961-1.31l-1.48 1.344A5.99 5.99 0 0 0 11.999 18c1.761 0 3.346-.76 4.442-1.966l-1.48-1.345A3.99 3.99 0 0 1 12 16"
11
+ })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
12
+ fillRule: "evenodd",
13
+ d: "M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12m10-8a8 8 0 1 0 0 16 8 8 0 0 0 0-16",
14
+ clipRule: "evenodd"
15
+ })));
16
+ };
17
+
18
+ export { SvgFaceHappy as default };
@@ -0,0 +1,22 @@
1
+ import * as React from 'react';
2
+
3
+ var _path, _path2, _path3;
4
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
5
+ var SvgPersonLevel = function SvgPersonLevel(props) {
6
+ return /*#__PURE__*/React.createElement("svg", _extends({
7
+ xmlns: "http://www.w3.org/2000/svg",
8
+ viewBox: "0 0 24 24"
9
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
10
+ fillRule: "evenodd",
11
+ d: "M4 7a5 5 0 1 1 10 0A5 5 0 0 1 4 7m5-3a3 3 0 1 0 0 6 3 3 0 0 0 0-6",
12
+ clipRule: "evenodd"
13
+ })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
14
+ d: "M1 22c0-4.402 3.09-9 8.5-9 1.12 0 2.157.201 3.094.57l-.73 1.86A6.4 6.4 0 0 0 9.5 15C5.473 15 3 18.402 3 22z"
15
+ })), _path3 || (_path3 = /*#__PURE__*/React.createElement("path", {
16
+ fillRule: "evenodd",
17
+ d: "M15 15a1 1 0 0 0-.832.445l-1 1.5a1 1 0 0 0 .125 1.262l4 4a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0 .125-1.262l-1-1.5A1 1 0 0 0 21 15zm.287 2.373.248-.373h4.93l.248.373L18 20.086z",
18
+ clipRule: "evenodd"
19
+ })));
20
+ };
21
+
22
+ export { SvgPersonLevel as default };
@@ -143,6 +143,8 @@ import '../../assets/icons/warning-exclamation.svg.js';
143
143
  import '../../assets/icons/warning-outlined.svg.js';
144
144
  import '../../assets/icons/info-outlined.svg.js';
145
145
  import '../../assets/icons/hint-outlined.svg.js';
146
+ import '../../assets/icons/face-happy.svg.js';
147
+ import '../../assets/icons/person-level.svg.js';
146
148
  import Icon from '../Icon/Icon.js';
147
149
  import Spinner from '../Spinner/Spinner.js';
148
150
  import { colors } from '../../utils';
@@ -0,0 +1,153 @@
1
+ "use strict";
2
+ "use client";
3
+
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+ import { colors } from '../../utils';
6
+ import { useRef, useState, useMemo, useEffect } from 'react';
7
+ import styled from 'styled-components';
8
+
9
+ const GraficContributieUnitlinkedStyled = styled.svg`
10
+ & > .limit_label_main {
11
+ font-size: 14px;
12
+ font-weight: 400;
13
+ fill: ${colors.gray_950};
14
+ }
15
+ & > .limit_label_secondary {
16
+ font-size: 16px;
17
+ font-weight: 700;
18
+ fill: ${colors.gray_950};
19
+ }
20
+ `;
21
+ const GraficContributieUnitlinked = ({
22
+ limitTop = 50,
23
+ limitBottom = 100,
24
+ limitTopLabel = "Top Label",
25
+ limitBottomLabel = "Bottom Label",
26
+ currency = "RON",
27
+ height = 142,
28
+ colorBar = colors.danger_100,
29
+ colorFilledBar = colors.success_400
30
+ }) => {
31
+ const RO = new Intl.NumberFormat("RO");
32
+ const svg_ref = useRef(null);
33
+ const [w, setW] = useState(0);
34
+ const BAR_HEIGHT = 24;
35
+ const configuration = useMemo(() => {
36
+ const barY = height / 2 - BAR_HEIGHT / 2;
37
+ const barYStop = barY + BAR_HEIGHT;
38
+ const limitTopHeight = height - barYStop + BAR_HEIGHT;
39
+ const limitTopX = Math.min(Math.max(0, limitTop / limitBottom * w), w - 2);
40
+ const limitTopLabelsAnchor = limitTopX > w * 0.75 ? "end" : "start";
41
+ const limitBottomX = w - 2;
42
+ const limitBottomY = barY;
43
+ const limitBottomHeight = limitTopHeight;
44
+ return {
45
+ barY,
46
+ barYStop,
47
+ limitTopHeight,
48
+ limitTopX,
49
+ limitTopLabelsAnchor,
50
+ limitBottomY,
51
+ limitBottomHeight,
52
+ limitBottomX
53
+ };
54
+ }, [limitTop, limitBottom, height, w]);
55
+ useEffect(() => {
56
+ if (svg_ref.current) {
57
+ setW(svg_ref.current.clientWidth);
58
+ }
59
+ }, [svg_ref]);
60
+ return /* @__PURE__ */ jsxs(
61
+ GraficContributieUnitlinkedStyled,
62
+ {
63
+ ref: svg_ref,
64
+ width: "100%",
65
+ height,
66
+ xmlns: "http://www.w3.org/2000/svg",
67
+ children: [
68
+ /* @__PURE__ */ jsx(
69
+ "rect",
70
+ {
71
+ x: 0,
72
+ y: configuration.barY,
73
+ width: "100%",
74
+ height: BAR_HEIGHT,
75
+ fill: colorBar
76
+ }
77
+ ),
78
+ /* @__PURE__ */ jsx(
79
+ "rect",
80
+ {
81
+ x: 0,
82
+ y: configuration.barY,
83
+ width: configuration.limitTopX,
84
+ height: BAR_HEIGHT,
85
+ fill: colorFilledBar
86
+ }
87
+ ),
88
+ /* @__PURE__ */ jsx(
89
+ "rect",
90
+ {
91
+ x: configuration.limitTopX,
92
+ y: 0,
93
+ height: configuration.limitTopHeight,
94
+ fill: "black",
95
+ width: 2
96
+ }
97
+ ),
98
+ /* @__PURE__ */ jsx(
99
+ "text",
100
+ {
101
+ className: "limit_label_main",
102
+ textAnchor: configuration.limitTopLabelsAnchor,
103
+ x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
104
+ y: 12,
105
+ children: limitTopLabel
106
+ }
107
+ ),
108
+ /* @__PURE__ */ jsx(
109
+ "text",
110
+ {
111
+ className: "limit_label_secondary",
112
+ textAnchor: configuration.limitTopLabelsAnchor,
113
+ x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
114
+ y: 12 + 20,
115
+ children: RO.format(limitTop) + " " + currency
116
+ }
117
+ ),
118
+ /* @__PURE__ */ jsx(
119
+ "rect",
120
+ {
121
+ x: configuration.limitBottomX,
122
+ y: configuration.limitBottomY,
123
+ height: configuration.limitBottomHeight,
124
+ fill: "black",
125
+ width: 2
126
+ }
127
+ ),
128
+ /* @__PURE__ */ jsx(
129
+ "text",
130
+ {
131
+ className: "limit_label_main",
132
+ textAnchor: "end",
133
+ x: configuration.limitBottomX - 12,
134
+ y: height - 20,
135
+ children: limitBottomLabel
136
+ }
137
+ ),
138
+ /* @__PURE__ */ jsx(
139
+ "text",
140
+ {
141
+ className: "limit_label_secondary",
142
+ textAnchor: "end",
143
+ x: configuration.limitBottomX - 12,
144
+ y: height,
145
+ children: RO.format(limitBottom) + " " + currency
146
+ }
147
+ )
148
+ ]
149
+ }
150
+ );
151
+ };
152
+
153
+ export { GraficContributieUnitlinked as default };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ "use client";
3
+
4
+ import GraficContributieUnitlinked from './GraficContributieUnitlinked.js';
5
+
6
+
7
+
8
+ export { GraficContributieUnitlinked as default };
@@ -140,6 +140,8 @@ import WarningExclamationIcon from '../../assets/icons/warning-exclamation.svg.j
140
140
  import WarningOutlinedIcon from '../../assets/icons/warning-outlined.svg.js';
141
141
  import InfoOutlinedIcon from '../../assets/icons/info-outlined.svg.js';
142
142
  import HintOutlinedIcon from '../../assets/icons/hint-outlined.svg.js';
143
+ import FaceHappyIcon from '../../assets/icons/face-happy.svg.js';
144
+ import PersonLevelIcon from '../../assets/icons/person-level.svg.js';
143
145
 
144
146
  const IconsList = {
145
147
  asterix: AsterixIcon,
@@ -280,7 +282,9 @@ const IconsList = {
280
282
  "warning-exclamation": WarningExclamationIcon,
281
283
  "warning-outlined": WarningOutlinedIcon,
282
284
  "info-outlined": InfoOutlinedIcon,
283
- "hint-outlined": HintOutlinedIcon
285
+ "hint-outlined": HintOutlinedIcon,
286
+ "face-happy": FaceHappyIcon,
287
+ "person-level": PersonLevelIcon
284
288
  };
285
289
 
286
290
  export { IconsList as default };
@@ -142,6 +142,8 @@ import '../../assets/icons/warning-exclamation.svg.js';
142
142
  import '../../assets/icons/warning-outlined.svg.js';
143
143
  import '../../assets/icons/info-outlined.svg.js';
144
144
  import '../../assets/icons/hint-outlined.svg.js';
145
+ import '../../assets/icons/face-happy.svg.js';
146
+ import '../../assets/icons/person-level.svg.js';
145
147
  import styled, { css } from 'styled-components';
146
148
  import Icon from '../Icon/Icon.js';
147
149
  import Spinner from '../Spinner/Spinner.js';
@@ -142,6 +142,8 @@ import '../../assets/icons/warning-exclamation.svg.js';
142
142
  import '../../assets/icons/warning-outlined.svg.js';
143
143
  import '../../assets/icons/info-outlined.svg.js';
144
144
  import '../../assets/icons/hint-outlined.svg.js';
145
+ import '../../assets/icons/face-happy.svg.js';
146
+ import '../../assets/icons/person-level.svg.js';
145
147
  import styled from 'styled-components';
146
148
  import Icon from '../Icon/Icon.js';
147
149
  import { colors } from '../../utils';
@@ -143,6 +143,8 @@ import '../../assets/icons/warning-exclamation.svg.js';
143
143
  import '../../assets/icons/warning-outlined.svg.js';
144
144
  import '../../assets/icons/info-outlined.svg.js';
145
145
  import '../../assets/icons/hint-outlined.svg.js';
146
+ import '../../assets/icons/face-happy.svg.js';
147
+ import '../../assets/icons/person-level.svg.js';
146
148
  import { createPortal } from 'react-dom';
147
149
  import Icon from '../Icon/Icon.js';
148
150
  import Numpad from '../Numpad/Numpad.js';
@@ -87,3 +87,4 @@ export { default as UnitlinkGraph } from './UnitlinkGraph/UnitlinkGraph.js';
87
87
  export { default as VerticalHeat } from './VerticalHeat/VerticalHeat.js';
88
88
  export { default as Icon } from './Icon/Icon.js';
89
89
  export { default as Spinner } from './Spinner/Spinner.js';
90
+ export { default as GraficContributieUnitlinked } from './GraficContributieUnitlinked/GraficContributieUnitlinked.js';