@rolster/react-components 18.21.35 → 18.21.36

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.
@@ -1,25 +1,34 @@
1
1
  .rls-tabular-text {
2
+ --pvt-char-font-size: var(
3
+ --rlc-tabular-text-font-size,
4
+ var(--rls-body-font-size)
5
+ );
6
+ --pvt-char-height: calc(var(--pvt-char-font-size) + 1rem);
7
+ --pvt-char-width: var(--rlc-tabular-text-char-width, 5.5rem);
8
+ --pvt-pointer-width: var(--rlc-tabular-text-pointer-width, 2rem);
2
9
  display: flex;
3
10
  width: auto;
4
- justify-content: var(--rlc-tabulartext-text-align, flex-start);
11
+ justify-content: var(--rlc-tabular-text-align, flex-start);
5
12
  }
6
13
  .rls-tabular-text span {
7
- font-size: var(--rlc-tabulartext-font-size, var(--rls-body-font-size));
14
+ font-size: var(--pvt-char-font-size);
15
+ height: var(--pvt-char-height);
16
+ line-height: var(--pvt-char-height);
8
17
  }
9
18
  .rls-tabular-text__char {
10
19
  display: block;
20
+ width: var(--pvt-char-width);
11
21
  text-align: center;
12
- width: var(--rlc-tabulartext-char-width, 5.5rem);
13
22
  }
14
23
  .rls-tabular-text__pointer {
15
24
  display: block;
25
+ width: var(--pvt-pointer-width);
16
26
  text-align: center;
17
- width: var(--rlc-tabulartext-pointer-width, 2rem);
18
27
  } /*# sourceMappingURL=TabularText.css.map */
19
28
 
20
29
  .rls-amount {
21
30
  --pvt-font-size: var(--rlc-amount-font-size, inherit);
22
- --rlc-tabulartext-font-size: var(--pvt-font-size);
31
+ --rlc-tabular-text-font-size: var(--pvt-font-size);
23
32
  display: flex;
24
33
  width: var(--rlc-amount-width, auto);
25
34
  justify-content: var(--rlc-amount-text-align, start);
@@ -28,6 +37,14 @@
28
37
  }
29
38
  .rls-amount[rls-theme] {
30
39
  color: var(--rls-theme-color-500);
40
+ }
41
+ .rls-amount__value {
42
+ display: flex;
43
+ }
44
+ .rls-amount__decimal {
45
+ --rlc-tabular-text-char-width: calc(var(--pvt-font-size) * 0.55);
46
+ --rlc-tabular-text-font-size: calc(var(--pvt-font-size) * 0.75);
47
+ align-items: flex-end;
31
48
  } /*# sourceMappingURL=Amount.css.map */
32
49
 
33
50
  .rls-avatar {
@@ -537,11 +554,13 @@
537
554
  }
538
555
  .rls-input__value {
539
556
  position: absolute;
557
+ display: flex;
540
558
  top: 0rem;
541
559
  left: 0rem;
542
560
  width: 100%;
543
561
  height: var(--pvt-height);
544
562
  line-height: var(--pvt-height);
563
+ align-items: center;
545
564
  background: rgba(0, 0, 0, 0);
546
565
  pointer-events: none;
547
566
  overflow: hidden;
@@ -555,8 +574,8 @@
555
574
  } /*# sourceMappingURL=Input.css.map */
556
575
 
557
576
  .rls-input-money {
558
- --rlc-tabulartext-font-size: var(--rls-input-font-size);
559
- --rlc-tabulartext-char-width: 5.25rem;
577
+ --rlc-tabular-text-font-size: var(--rls-input-font-size);
578
+ --rlc-tabular-text-char-width: 5.25rem;
560
579
  position: relative;
561
580
  width: 100%;
562
581
  box-sizing: border-box;
package/dist/cjs/index.js CHANGED
@@ -1344,26 +1344,6 @@ if (process.env.NODE_ENV === 'production') {
1344
1344
 
1345
1345
  var jsxRuntimeExports = jsxRuntime.exports;
1346
1346
 
1347
- const className = 'rls-tabular-text';
1348
- const pointers = ['.', ','];
1349
- function getCharClass(char) {
1350
- return pointers.includes(char)
1351
- ? `${className}__pointer`
1352
- : `${className}__char`;
1353
- }
1354
- function RlsTabularText({ value }) {
1355
- const [codes, setCodes] = require$$0.useState(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {}));
1356
- require$$0.useEffect(() => {
1357
- setCodes(jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: value?.split('').map((char, index) => (jsxRuntimeExports.jsx("span", { className: getCharClass(char), children: char }, index))) }));
1358
- }, [value]);
1359
- return jsxRuntimeExports.jsx("div", { className: "rls-tabular-text", children: codes });
1360
- }
1361
-
1362
- function RlsAmount({ value, decimals, rlsTheme, symbol }) {
1363
- const amount = require$$0.useMemo(() => commons.currencyFormat({ value, decimals }), [value, decimals]);
1364
- return (jsxRuntimeExports.jsxs("div", { className: "rls-amount", "rls-theme": rlsTheme, children: [symbol && jsxRuntimeExports.jsx("span", { children: symbol }), jsxRuntimeExports.jsx(RlsTabularText, { value: amount })] }));
1365
- }
1366
-
1367
1347
  function renderClassStatus(base, status = {}, additionals) {
1368
1348
  const _classElement = [base];
1369
1349
  Object.entries(status).forEach(([key, state]) => {
@@ -1485,6 +1465,38 @@ function msgErrorsI18n(key, language, interpolators) {
1485
1465
  return _msgErrorsI18n(key, { language, interpolators });
1486
1466
  }
1487
1467
 
1468
+ const className = 'rls-tabular-text';
1469
+ const pointers = ['.', ','];
1470
+ function getCharClass(char) {
1471
+ return pointers.includes(char)
1472
+ ? `${className}__pointer`
1473
+ : `${className}__char`;
1474
+ }
1475
+ function RlsTabularText({ className, value }) {
1476
+ const codes = require$$0.useMemo(() => {
1477
+ return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: value?.split('').map((char, index) => (jsxRuntimeExports.jsx("span", { className: getCharClass(char), children: char }, index))) }));
1478
+ }, [value]);
1479
+ const _className = require$$0.useMemo(() => {
1480
+ return renderClassStatus('rls-tabular-text', {}, className);
1481
+ }, [className]);
1482
+ return jsxRuntimeExports.jsx("div", { className: _className, children: codes });
1483
+ }
1484
+
1485
+ function RlsAmount({ value, decimals, rlsTheme, symbol }) {
1486
+ const { decimal, integer } = require$$0.useMemo(() => {
1487
+ const currency = commons.currencyFormat({ value, decimals });
1488
+ if (!currency.includes(',')) {
1489
+ return { integer: currency, decimal: '' };
1490
+ }
1491
+ const currencySplit = currency.split(',');
1492
+ return {
1493
+ integer: currencySplit[0] + (currencySplit[1] ? ',' : ''),
1494
+ decimal: currencySplit[1] || ''
1495
+ };
1496
+ }, [value, decimals]);
1497
+ return (jsxRuntimeExports.jsxs("div", { className: "rls-amount", "rls-theme": rlsTheme, children: [symbol && jsxRuntimeExports.jsx("span", { children: symbol }), jsxRuntimeExports.jsxs("div", { className: "rls-amount__value", children: [jsxRuntimeExports.jsx(RlsTabularText, { className: "rls-amount__integer", value: integer }), decimal && (jsxRuntimeExports.jsx(RlsTabularText, { className: "rls-amount__decimal", value: decimal }))] })] }));
1498
+ }
1499
+
1488
1500
  function RlsAvatar({ children, rounded, skeleton, rlsTheme }) {
1489
1501
  const className = require$$0.useMemo(() => {
1490
1502
  return renderClassStatus('rls-avatar', { rounded, skeleton });