@rolster/react-components 19.1.14 → 19.2.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.
@@ -1,10 +1,9 @@
1
- import { RlsTheme } from '../../definitions';
1
+ import { PropsWithClassName, PropsWithRlsTheme } from '../../definitions';
2
2
  import './Amount.css';
3
- interface AmountProps {
3
+ interface AmountProps extends PropsWithClassName, PropsWithRlsTheme {
4
4
  value: number;
5
5
  decimals?: number;
6
- rlsTheme?: RlsTheme;
7
6
  symbol?: string;
8
7
  }
9
- export declare function RlsAmount({ value, decimals, rlsTheme, symbol }: AmountProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function RlsAmount({ value, className, decimals, rlsTheme, symbol }: AmountProps): import("react/jsx-runtime").JSX.Element;
10
9
  export {};
@@ -1,9 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { currencyFormat } from '@rolster/commons';
3
3
  import { useMemo } from 'react';
4
+ import { renderClassStatus } from '../../../helpers/css';
4
5
  import { RlsTabularText } from '../TabularText/TabularText';
5
6
  import './Amount.css';
6
- export function RlsAmount({ value, decimals, rlsTheme, symbol }) {
7
+ export function RlsAmount({ value, className, decimals, rlsTheme, symbol }) {
8
+ const classNameAmount = useMemo(() => {
9
+ return renderClassStatus('rls-amount', {}, className);
10
+ }, [className]);
7
11
  const { decimal, integer } = useMemo(() => {
8
12
  const currency = currencyFormat({ value, decimals });
9
13
  if (!currency.includes(',')) {
@@ -15,6 +19,6 @@ export function RlsAmount({ value, decimals, rlsTheme, symbol }) {
15
19
  decimal: currencySplit[1] || ''
16
20
  };
17
21
  }, [value, decimals]);
18
- return (_jsxs("div", { className: "rls-amount", "rls-theme": rlsTheme, children: [symbol && _jsx("span", { className: "rls-amount__symbol", children: symbol }), _jsxs("div", { className: "rls-amount__content", children: [_jsx(RlsTabularText, { className: "rls-amount__integer", value: integer }), decimal && (_jsx(RlsTabularText, { className: "rls-amount__decimal", value: decimal }))] })] }));
22
+ return (_jsxs("div", { className: classNameAmount, "rls-theme": rlsTheme, children: [symbol && _jsx("span", { className: "rls-amount__symbol", children: symbol }), _jsxs("div", { className: "rls-amount__content", children: [_jsx(RlsTabularText, { className: "rls-amount__integer", value: integer }), decimal && (_jsx(RlsTabularText, { className: "rls-amount__decimal", value: decimal }))] })] }));
19
23
  }
20
24
  //# sourceMappingURL=Amount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Amount.js","sourceRoot":"","sources":["../../../../../src/components/atoms/Amount/Amount.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,cAAc,CAAC;AAStB,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAe;IAC1E,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE;QACxC,MAAM,QAAQ,GAAG,cAAc,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAErD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAC5C,CAAC;QAED,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE1C,OAAO;YACL,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC,EAAE,C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AQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAC5C,CAAC;QAED,MAAM,aAAa,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE1C,OAAO;YACL,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtB,OAAO,CACL,eAAK,SAAS,EAAE,eAAe,eAAa,QAAQ,aACjD,MAAM,IAAI,eAAM,SAAS,EAAC,oBAAoB,YAAE,MAAM,GAAQ,EAE/D,eAAK,SAAS,EAAC,qBAAqB,aAClC,KAAC,cAAc,IAAC,SAAS,EAAC,qBAAqB,EAAC,KAAK,EAAE,OAAO,GAAI,EAEjE,OAAO,IAAI,CACV,KAAC,cAAc,IAAC,SAAS,EAAC,qBAAqB,EAAC,KAAK,EAAE,OAAO,GAAI,CACnE,IACG,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,6 +1,7 @@
1
1
  .rls-icon {
2
2
  --pvt-icon-dimension: var(--rlc-icon-dimension, var(--rls-sizing-x12));
3
3
  --pvt-icon-display: block;
4
+ --pvt-icon-color: var(--rlc-icon-color);
4
5
  position: relative;
5
6
  font-size: var(--pvt-icon-dimension);
6
7
  width: var(--pvt-icon-dimension);
@@ -12,9 +13,12 @@
12
13
  background: var(--rls-theme-color-300);
13
14
  border-radius: var(--rls-sizing-x2);
14
15
  }
16
+ .rls-icon[rls-theme] {
17
+ --pvt-icon-color: var(--rls-theme-color-500);
18
+ }
15
19
  .rls-icon > i {
16
20
  display: var(--pvt-icon-display);
17
- color: var(--rlc-icon-color, inherit);
21
+ color: var(--pvt-icon-color, inherit);
18
22
  width: 100%;
19
23
  height: 100%;
20
24
  line-height: inherit;
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../../../../src/components/atoms/Icon/Icon.scss"],"names":[],"mappings":"AAOA,UACE,uEACA,0BAEA,kBACA,oCACA,gCACA,iCACA,sCAEA,oBACE,yBAEA,sCACA,mCAGF,YACE,gCACA,qCACA,WACA,YACA,oBACA","file":"Icon.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../../../../src/components/atoms/Icon/Icon.scss"],"names":[],"mappings":"AAOA,UACE,uEACA,0BACA,wCAEA,kBACA,oCACA,gCACA,iCACA,sCAEA,oBACE,yBAEA,sCACA,mCAGF,qBACE,6CAGF,YACE,gCACA,qCACA,WACA,YACA,oBACA","file":"Icon.css"}
@@ -1,7 +1,8 @@
1
+ import { PropsWithClassName, PropsWithRlsTheme } from '../../definitions';
1
2
  import './Icon.css';
2
- interface IconProps {
3
+ interface IconProps extends PropsWithClassName, PropsWithRlsTheme {
3
4
  value: string;
4
5
  skeleton?: boolean;
5
6
  }
6
- export declare function RlsIcon({ value, skeleton }: IconProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function RlsIcon({ value, className, rlsTheme, skeleton }: IconProps): import("react/jsx-runtime").JSX.Element;
7
8
  export {};
@@ -2,10 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
3
  import { renderClassStatus } from '../../../helpers/css';
4
4
  import './Icon.css';
5
- export function RlsIcon({ value, skeleton }) {
6
- const className = useMemo(() => {
7
- return renderClassStatus('rls-icon', { skeleton });
8
- }, [skeleton]);
9
- return (_jsx("div", { className: className, children: _jsx("i", { className: `rls-icon-${value}` }) }));
5
+ export function RlsIcon({ value, className, rlsTheme, skeleton }) {
6
+ const classNameIcon = useMemo(() => {
7
+ return renderClassStatus('rls-icon', { skeleton }, className);
8
+ }, [className, skeleton]);
9
+ return (_jsx("div", { className: classNameIcon, "rls-theme": rlsTheme, children: _jsx("i", { className: `rls-icon-${value}` }) }));
10
10
  }
11
11
  //# sourceMappingURL=Icon.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../../src/components/atoms/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,YAAY,CAAC;AAOpB,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAa;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,OAAO,iBAAiB,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO,CACL,cAAK,SAAS,EAAE,SAAS,YACvB,YAAG,SAAS,EAAE,YAAY,KAAK,EAAE,GAAM,GACnC,CACP,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../../src/components/atoms/Icon/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,YAAY,CAAC;AAOpB,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAa;IACzE,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO,iBAAiB,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE1B,OAAO,CACL,cAAK,SAAS,EAAE,aAAa,eAAa,QAAQ,YAChD,YAAG,SAAS,EAAE,YAAY,KAAK,EAAE,GAAM,GACnC,CACP,CAAC;AACJ,CAAC"}
@@ -1,9 +1,11 @@
1
1
  import { PropsWithChildren } from 'react';
2
- export type RlsTheme = 'primary' | 'secondary' | 'tertiary' | 'success' | 'info' | 'warning' | 'danger' | 'berry' | 'hope' | 'mountains' | 'ross' | 'amaizing' | 'purple' | 'amber' | 'smartness' | 'obsidian';
2
+ export type RlsTheme = 'standard' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'info' | 'warning' | 'danger' | 'berry' | 'hope' | 'mountains' | 'ross' | 'amaizing' | 'purple' | 'amber' | 'smartness' | 'obsidian';
3
+ export interface PropsWithClassName {
4
+ className?: string;
5
+ }
3
6
  export interface PropsWithRlsTheme {
4
7
  rlsTheme?: RlsTheme;
5
8
  }
6
- export interface RlsComponent extends PropsWithChildren<PropsWithRlsTheme> {
7
- className?: string;
9
+ export interface RlsComponent extends PropsWithChildren<PropsWithRlsTheme & PropsWithClassName> {
8
10
  identifier?: string;
9
11
  }
package/package.json CHANGED
@@ -1,12 +1,8 @@
1
1
  {
2
2
  "name": "@rolster/react-components",
3
- "version": "19.1.14",
3
+ "version": "19.2.0",
4
4
  "type": "module",
5
5
  "description": "Package containing UI components for React Project.",
6
- "module": "dist/esm/index.js",
7
- "main": "dist/cjs/lib.js",
8
- "unpkg": "dist/es/lib.js",
9
- "types": "dist/esm/index.d.ts",
10
6
  "license": "MIT",
11
7
  "author": "Rolster Technology <rolster.developments@gmail.com>",
12
8
  "contributors": [
@@ -15,40 +11,49 @@
15
11
  "email": "ing.dacastillop@gmail.com"
16
12
  }
17
13
  ],
14
+ "types": "./dist/esm/index.d.ts",
15
+ "main": "./dist/esm/index.js",
16
+ "module": "./dist/esm/index.js",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/esm/index.d.ts",
20
+ "node": {
21
+ "require": "./dist/cjs/index.js",
22
+ "import": "./dist/esm/index.js"
23
+ },
24
+ "default": "./dist/esm/index.js"
25
+ }
26
+ },
18
27
  "files": [
19
28
  "dist/"
20
29
  ],
21
30
  "scripts": {
22
- "dev": "vite",
23
- "prettier": "prettier . --write",
31
+ "prettier": "prettier --write \"src/**/*.{ts}\"",
32
+ "prettier:css": "prettier --write dist/**/*.css --ignore-path .prettierignore",
24
33
  "clean": "rimraf ./dist",
34
+ "dev": "vite",
25
35
  "build:css": "sass src/:dist/esm/ --style=compressed",
26
- "prettier:css": "prettier --write dist/**/*.css --ignore-path .prettierignore",
27
36
  "build": "npm run clean && tsc -p tsconfig.app.json && npm run build:css && npm run prettier:css && rollup -c rollup.config.js",
28
- "test": "jest --coverage",
29
- "test:watch": "jest --coverage --watch",
37
+ "test": "vitest run",
30
38
  "prepublishOnly": "npm run build"
31
39
  },
32
40
  "dependencies": {
33
- "@rolster/commons": "^3.1.9",
34
- "@rolster/components": "^1.0.0",
35
- "@rolster/dates": "^3.1.4",
36
- "@rolster/forms": "^3.1.1",
37
- "@rolster/i18n": "^2.2.1",
38
- "@rolster/react-forms": "^19.1.1",
39
- "@rolster/react-lottie": "^19.0.0",
40
- "@rolster/strings": "^2.2.0",
41
- "@rolster/validators": "^2.3.2",
41
+ "@rolster/commons": "^3.2.1",
42
+ "@rolster/components": "^1.1.0",
43
+ "@rolster/dates": "^3.2.0",
44
+ "@rolster/forms": "^3.3.1",
45
+ "@rolster/i18n": "^2.3.1",
46
+ "@rolster/react-forms": "^19.2.0",
47
+ "@rolster/react-lottie": "^19.1.0",
48
+ "@rolster/strings": "^2.3.1",
49
+ "@rolster/validators": "^2.4.1",
42
50
  "react-dom": "^19.2.0",
43
51
  "uuid": "^11.0.3"
44
52
  },
45
53
  "devDependencies": {
46
54
  "@babel/plugin-proposal-decorators": "^7.21.0",
47
- "@rollup/plugin-commonjs": "^25.0.4",
48
- "@rollup/plugin-node-resolve": "^15.2.1",
49
- "@rollup/plugin-typescript": "^11.1.3",
50
- "@rolster/rollup": "^1.0.8",
51
- "@rolster/styles-foundations": "^2.6.21",
55
+ "@rolster/rollup": "^1.0.10",
56
+ "@rolster/styles-foundations": "^2.6.23",
52
57
  "@rolster/types": "^1.1.0",
53
58
  "@types/node-sass": "^4.11.4",
54
59
  "@types/react": "^19.0.0",
@@ -57,6 +62,7 @@
57
62
  "@typescript-eslint/eslint-plugin": "^8.54.0",
58
63
  "@typescript-eslint/parser": "^8.54.0",
59
64
  "@vitejs/plugin-react": "^4.2.1",
65
+ "@vitest/ui": "^3.2.4",
60
66
  "eslint": "^9.39.2",
61
67
  "eslint-plugin-react-hooks": "^7.0.1",
62
68
  "eslint-plugin-react-refresh": "^0.4.26",
@@ -70,11 +76,12 @@
70
76
  "sass": "^1.89.0",
71
77
  "sort-by": "^0.0.2",
72
78
  "typescript": "^5.7.2",
73
- "vite": "^6.4.1"
79
+ "vite": "^6.4.1",
80
+ "vitest": "^3.2.4"
74
81
  },
75
82
  "repository": {
76
83
  "type": "git",
77
- "url": "https://github.com/rolster-developments/react-components.git"
84
+ "url": "git+https://github.com/rolster-developments/react-components.git"
78
85
  },
79
86
  "publishConfig": {
80
87
  "access": "public"