siam-ui-utils 2.1.9 → 2.1.11

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 (42) hide show
  1. package/eslint.config.js +36 -23
  2. package/index.d.ts +73 -14
  3. package/index.html +3 -3
  4. package/package.json +13 -30
  5. package/src/App.css +47 -0
  6. package/src/App.jsx +82 -39
  7. package/src/CustomSelectInput.jsx +1 -1
  8. package/src/IntlMessages.jsx +7 -6
  9. package/src/archivos-adjuntos/dropzone-uploader-dni-digital/index.jsx +152 -0
  10. package/src/{dropzone-uploader → archivos-adjuntos}/index.jsx +57 -63
  11. package/src/archivos-adjuntos/simple-line-icons.css +778 -0
  12. package/src/assets/css/sass/_gogo.style.scss +9012 -0
  13. package/src/assets/css/sass/_mixins.scss +118 -0
  14. package/src/assets/css/sass/_plugins.scss +1 -0
  15. package/src/assets/css/sass/ampf_style.scss +182 -0
  16. package/src/assets/css/sass/main.scss +11 -0
  17. package/src/assets/css/sass/plugins/react-table.scss +311 -0
  18. package/src/assets/css/sass/themes/gogo.light.redruby.scss +40 -0
  19. package/src/bridges/index.js +1 -0
  20. package/src/bridges/{index.jsx → with-router-bridge.jsx} +2 -0
  21. package/src/constants.js +0 -9
  22. package/src/iconos/icon-button-svg.jsx +2 -1
  23. package/src/iconos/index.js +2 -3
  24. package/src/iconos/styled-icon.jsx +1 -1
  25. package/src/index.css +74 -0
  26. package/src/index.js +7 -8
  27. package/src/main.jsx +6 -6
  28. package/src/tomar-foto/index.jsx +66 -63
  29. package/src/video-call-room/index.jsx +10 -0
  30. package/tsconfig.json +24 -25
  31. package/vite.config.ts +19 -10
  32. package/.eslintrc +0 -73
  33. package/.eslintrc.mjs +0 -53
  34. package/.prettierrc.js +0 -5
  35. package/.storybook/main.ts +0 -17
  36. package/.storybook/preview.ts +0 -16
  37. package/src/dropzone-uploader/DropzoneUploader.stories.tsx +0 -34
  38. package/src/tomar-foto/TomarFoto.stories.tsx +0 -29
  39. /package/src/{dropzone-uploader → archivos-adjuntos}/dropzone-uploader.css +0 -0
  40. /package/{.storybook/css → src/assets/css/vendor}/bootstrap.min.css +0 -0
  41. /package/{.storybook/css → src/assets/css/vendor}/bootstrap.rtl.only.min.css +0 -0
  42. /package/src/{constants-svg.js → iconos/constants-svg.js} +0 -0
package/src/index.css ADDED
@@ -0,0 +1,74 @@
1
+ :root {
2
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 0.2;
4
+ font-weight: 400;
5
+
6
+ color-scheme: inherit;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ a {
17
+ font-weight: 500;
18
+ color: #646cff;
19
+ text-decoration: inherit;
20
+ }
21
+ a:hover {
22
+ color: #535bf2;
23
+ }
24
+
25
+ body {
26
+ margin: 0;
27
+ display: flex;
28
+ place-items: center;
29
+ min-width: 320px;
30
+ min-height: 100vh;
31
+ }
32
+
33
+ h1 {
34
+ font-size: 1.2em;
35
+ line-height: 1.1;
36
+ }
37
+
38
+ h2 {
39
+ font-size: 1.2em;
40
+ line-height: 1.1;
41
+ }
42
+
43
+
44
+ button {
45
+ border-radius: 8px;
46
+ border: 1px solid transparent;
47
+ padding: 0.6em 1.2em;
48
+ font-size: 1em;
49
+ font-weight: 500;
50
+ font-family: inherit;
51
+ background-color: grey;
52
+ cursor: pointer;
53
+ transition: border-color 0.25s;
54
+ }
55
+ button:hover {
56
+ border-color: #646cff;
57
+ }
58
+ button:focus,
59
+ button:focus-visible {
60
+ outline: 4px auto -webkit-focus-ring-color;
61
+ }
62
+
63
+ @media (prefers-color-scheme: light) {
64
+ :root {
65
+ color: #213547;
66
+ background-color: #ffffff;
67
+ }
68
+ a:hover {
69
+ color: #747bff;
70
+ }
71
+ button {
72
+ background-color: #f9f9f9;
73
+ }
74
+ }
package/src/index.js CHANGED
@@ -1,8 +1,7 @@
1
- import DropzoneUploader from './dropzone-uploader';
2
- export { withRouter } from './bridges';
3
- export { Colxx, Separator } from './CustomBootstrap';
4
- export { CustomSelectInput } from './CustomSelectInput';
5
- export { IntlMessages } from './IntlMessages';
6
- export { TomarFoto } from './tomar-foto';
7
-
8
- export { DropzoneUploader };
1
+ export * from './archivos-adjuntos';
2
+ export * from './archivos-adjuntos/dropzone-uploader-dni-digital';
3
+ export * from './bridges';
4
+ export * from './CustomBootstrap';
5
+ export * from './CustomSelectInput';
6
+ export * from './tomar-foto';
7
+ export * as IntlMessages from './IntlMessages';
package/src/main.jsx CHANGED
@@ -1,7 +1,7 @@
1
- import React from 'react'
2
- import ReactDOM from 'react-dom/client'
1
+ import { createRoot } from 'react-dom/client';
2
+ import './assets/css/vendor/bootstrap.min.css';
3
+ import './assets/css/vendor/bootstrap.rtl.only.min.css';
4
+ import './assets/css/sass/themes/gogo.light.redruby.scss';
5
+ import App from './App';
3
6
 
4
- export const App = React.lazy(
5
- () => import(/* webpackChunkName: "App" */ './App')
6
- )
7
- ReactDOM.createRoot(document.getElementById('root')).render(<App />)
7
+ createRoot(document.getElementById('root')).render(<App />);
@@ -1,66 +1,69 @@
1
- /* eslint-disable react/prop-types */
2
- import React, { useState } from 'react'
3
- import { Row } from 'reactstrap'
4
- import { DropzoneUploader, Colxx } from '../'
5
- import { TAKE_PHOTO } from '../constants'
6
- import imgHacerFoto from '../assets/img/take-photo.png'
1
+ import { useState } from 'react';
2
+ import { Row } from 'reactstrap';
3
+ import { DropzoneUploader, Colxx } from '../';
4
+ import { TAKE_PHOTO } from '../constants';
5
+ import imgHacerFoto from '../assets/img/take-photo.png';
7
6
 
8
- export const TomarFoto = ({ onFilesSelectedSelfie, isMobile = false }) => {
9
- const [filesTotalSelectedSelfie, setTotalFilesSelectedSelfie] = useState(0)
10
- const {
11
- LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE,
12
- MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE,
13
- TAKE_PHOTO_MESSAGE,
14
- } = TAKE_PHOTO
7
+ // eslint-disable-next-line react/prop-types
8
+ export const TomarFoto = ({
9
+ onFilesSelectedSelfie = () => {},
10
+ isMobile = false,
11
+ }) => {
12
+ const [filesTotalSelectedSelfie, setTotalFilesSelectedSelfie] = useState(0);
13
+ const {
14
+ LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE,
15
+ MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE,
16
+ TAKE_PHOTO_MESSAGE,
17
+ } = TAKE_PHOTO;
15
18
 
16
- const handleFilesSelectedSelfie = (files) => {
17
- setTotalFilesSelectedSelfie(files.length)
18
- onFilesSelectedSelfie(files)
19
- }
19
+ const handleFilesSelectedSelfie = (files) => {
20
+ setTotalFilesSelectedSelfie(files.length);
21
+ onFilesSelectedSelfie(files);
22
+ };
20
23
 
21
- return (
22
- <>
23
- <Row className='pt-2 ml-4'>
24
- <Colxx xxs='11' md='5'>
25
- {LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE}
26
- </Colxx>
27
- </Row>
28
- <Row className='pt-2 ml-2'>
29
- <Colxx xxs='12' md='9'>
30
- {isMobile ? (
31
- <>
32
- <Colxx xxs='12' className='text-center'>
33
- {filesTotalSelectedSelfie === 0 && (
34
- <img
35
- style={{ width: '97%' }}
36
- alt='hacerFotoDNI'
37
- src={imgHacerFoto}
38
- />
39
- )}
40
- <DropzoneUploader
41
- className='pt-2 ml-2'
42
- maxFiles={1}
43
- onChangeFiles={handleFilesSelectedSelfie}
44
- totalFiles={filesTotalSelectedSelfie}
45
- accept='image/jpg,image/jpeg'
46
- capture='environment'
47
- nameFileLabel={TAKE_PHOTO_MESSAGE}
48
- />
49
- </Colxx>
50
- </>
51
- ) : (
52
- <h2
53
- className={'view-icon iconsminds-smartphone-4 ml-2 mr-2'}
54
- style={{
55
- color: 'red',
56
- margin: '10px 10px 0px 10px',
57
- }}
58
- >
59
- {MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE}
60
- </h2>
61
- )}
62
- </Colxx>
63
- </Row>
64
- </>
65
- )
66
- }
24
+ return (
25
+ <>
26
+ <Row className="pt-2 ml-4">
27
+ <Colxx xxs="11" md="5">
28
+ {LOAD_SELFIE_WITH_IDENTITY_CARD_MESSAGE}
29
+ </Colxx>
30
+ </Row>
31
+ <Row className="pt-2 ml-2">
32
+ <Colxx xxs="12" md="9">
33
+ {isMobile ? (
34
+ <>
35
+ <Colxx xxs="12" className="text-center">
36
+ {filesTotalSelectedSelfie === 0 && (
37
+ <img
38
+ style={{ width: '97%' }}
39
+ alt="hacerFotoDNI"
40
+ src={imgHacerFoto}
41
+ />
42
+ )}
43
+ <DropzoneUploader
44
+ className="pt-2 ml-2"
45
+ maxFiles={1}
46
+ onChangeFiles={handleFilesSelectedSelfie}
47
+ totalFiles={filesTotalSelectedSelfie}
48
+ accept="image/jpg,image/jpeg"
49
+ capture="environment"
50
+ nameFileLabel={TAKE_PHOTO_MESSAGE}
51
+ />
52
+ </Colxx>
53
+ </>
54
+ ) : (
55
+ <h2
56
+ className={'view-icon iconsminds-smartphone-4 ml-2 mr-2'}
57
+ style={{
58
+ color: 'red',
59
+ margin: '10px 10px 0px 10px',
60
+ }}
61
+ >
62
+ {MESSAGE_SELFIE_ONLY_CAN_TAKE_FROM_CELLPHONE}
63
+ </h2>
64
+ )}
65
+ </Colxx>
66
+ </Row>
67
+ </>
68
+ );
69
+ };
@@ -0,0 +1,10 @@
1
+ export const VideoCallRoom = ({ url, title = 'Videollamada AMPF' }) => {
2
+ return (
3
+ <iframe
4
+ src={url}
5
+ allow="camera; microphone; fullscreen; speaker; display-capture"
6
+ style={{ width: '100%', height: '100%', border: '0', minHeight: '600px' }}
7
+ title={title}
8
+ />
9
+ );
10
+ };
package/tsconfig.json CHANGED
@@ -1,27 +1,26 @@
1
1
  {
2
- "compilerOptions": {
3
- "target": "es6",
4
- "lib": [
5
- "dom",
6
- "dom.iterable",
7
- "esnext"
8
- ],
9
- "allowJs": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "strict": true,
13
- "forceConsistentCasingInFileNames": true,
14
- "module": "commonjs",
15
- "moduleResolution": "node",
16
- "noImplicitReturns": true,
17
- "resolveJsonModule": true,
18
- "isolatedModules": true,
19
- "noEmit": true,
20
- "jsx": "preserve",
21
- },
22
- "include": [
23
- "src",
24
- "index.d.ts",
25
- "eslint.config.js"
26
- ]
2
+ "compilerOptions": {
3
+ "target": "es6",
4
+ "lib": [
5
+ "dom",
6
+ "dom.iterable",
7
+ "esnext"
8
+ ],
9
+ "allowJs": true,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "strict": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "module": "commonjs",
15
+ "moduleResolution": "node",
16
+ "noImplicitReturns": true,
17
+ "resolveJsonModule": true,
18
+ "isolatedModules": true,
19
+ "noEmit": true,
20
+ "jsx": "preserve",
21
+ },
22
+ "include": [
23
+ "src",
24
+ "index.d.ts"
25
+ ]
27
26
  }
package/vite.config.ts CHANGED
@@ -1,10 +1,19 @@
1
- import react from "@vitejs/plugin-react";
2
- import { defineConfig } from "vitest/config";
3
- import eslint from 'vite-plugin-eslint';
4
-
5
- export default defineConfig({
6
- plugins: [react()],
7
- test: {
8
- globals: true,
9
- }
10
- });
1
+ import react from "@vitejs/plugin-react";
2
+ import { defineConfig } from "vitest/config";
3
+ import commonjs from 'vite-plugin-commonjs'
4
+
5
+ export default defineConfig({
6
+ plugins: [react(), commonjs()],
7
+ server: {
8
+ port: 5173,
9
+ open: true,
10
+ hmr: true
11
+ },
12
+ css: {
13
+ preprocessorOptions: {
14
+ scss: {
15
+ silenceDeprecations: ['legacy-js-api'],
16
+ },
17
+ },
18
+ },
19
+ });
package/.eslintrc DELETED
@@ -1,73 +0,0 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "commonjs": true,
5
- "es2021": true,
6
- "node": true
7
- },
8
- "settings": {
9
- "import/resolver": {
10
- "node": {
11
- "extensions": [
12
- ".js",
13
- ".jsx",
14
- ".ts",
15
- ".tsx"
16
- ]
17
- }
18
- },
19
- "react": {
20
- "version": "detect"
21
- }
22
- },
23
- "extends": [
24
- "eslint:recommended",
25
- "plugin:jsx-a11y/strict",
26
- "plugin:react/recommended",
27
- "plugin:@typescript-eslint/recommended",
28
- "plugin:import/recommended",
29
- "plugin:react-hooks/recommended"
30
- ],
31
- "overrides": [],
32
- "parser": "@typescript-eslint/parser",
33
- "parserOptions": {
34
- "ecmaVersion": "latest"
35
- },
36
- "plugins": [
37
- "react",
38
- "react-hooks",
39
- "@typescript-eslint",
40
- "prettier"
41
- ],
42
- "rules": {
43
- "quotes": "off",
44
- "import/no-unresolved": "warn",
45
- "import/no-named-as-default": "warn",
46
- "no-constant-condition": "warn",
47
- "@typescript-eslint/no-empty-function": "warn",
48
- "no-prototype-builtins": "warn",
49
- "jsx-a11y/no-static-element-interactions": "warn",
50
- "jsx-a11y/click-events-have-key-events": "warn",
51
- "jsx-a11y/no-noninteractive-element-interactions": "warn",
52
- "@typescript-eslint/ban-types": "warn",
53
- "import/no-duplicates": "warn",
54
- "@typescript-eslint/no-extra-semi": "warn",
55
- "@typescript-eslint/no-inferrable-types": "warn",
56
- "prefer-const": "warn",
57
- "@typescript-eslint/no-unused-vars": "warn",
58
- "jsx-a11y/label-has-associated-control": "warn",
59
- "no-case-declarations": "warn",
60
- "no-irregular-whitespace": "warn",
61
- "@typescript-eslint/no-var-requires": "warn",
62
- "no-empty": "warn",
63
- "react/no-deprecated": "warn",
64
- "import/prefer-default-export": "off",
65
- "import/no-cycle": "off",
66
- "react/no-unknown-property": "warn",
67
- "react-hooks/exhaustive-deps": "warn",
68
- "react/no-find-dom-node": "warn",
69
- "react/prop-types": "off",
70
- "@typescript-eslint/no-explicit-any": "off",
71
- "@typescript-eslint/explicit-module-boundary-types": "off"
72
- }
73
- }
package/.eslintrc.mjs DELETED
@@ -1,53 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- 'eslint:recommended',
4
- 'plugin:react/recommended',
5
- 'plugin:react-hooks/recommended',
6
- 'plugin:jsx-a11y/recommended',
7
- ],
8
- plugins: ['react', 'react-hooks', 'jsx-a11y', 'prettier'],
9
- parserOptions: {
10
- ecmaVersion: 2021,
11
- sourceType: 'module',
12
- ecmaFeatures: {
13
- jsx: true,
14
- },
15
- },
16
- rules: {
17
- 'quotes': 'off',
18
- 'import/no-unresolved': 'warn',
19
- 'import/no-named-as-default': 'warn',
20
- 'no-constant-condition': 'warn',
21
- '@typescript-eslint/no-empty-function': 'warn',
22
- 'no-prototype-builtins': 'warn',
23
- 'jsx-a11y/no-static-element-interactions': 'warn',
24
- 'jsx-a11y/click-events-have-key-events': 'warn',
25
- 'jsx-a11y/no-noninteractive-element-interactions': 'warn',
26
- '@typescript-eslint/ban-types': 'warn',
27
- 'import/no-duplicates': 'warn',
28
- '@typescript-eslint/no-extra-semi': 'warn',
29
- '@typescript-eslint/no-inferrable-types': 'warn',
30
- 'prefer-const': 'warn',
31
- '@typescript-eslint/no-unused-vars': 'warn',
32
- 'jsx-a11y/label-has-associated-control': 'warn',
33
- 'no-case-declarations': 'warn',
34
- 'no-irregular-whitespace': 'warn',
35
- '@typescript-eslint/no-var-requires': 'warn',
36
- 'no-empty': 'warn',
37
- 'react/no-deprecated': 'warn',
38
- 'import/prefer-default-export': 'off',
39
- 'import/no-cycle': 'off',
40
- 'react/no-unknown-property': 'warn',
41
- 'react-hooks/exhaustive-deps': 'warn',
42
- 'react/no-find-dom-node': 'warn',
43
- 'react/prop-types': 'off',
44
- '@typescript-eslint/no-explicit-any': 'off',
45
- '@typescript-eslint/explicit-module-boundary-types': 'off',
46
- 'prettier/prettier': [
47
- 'warn',
48
- {
49
- 'endOfLine': 'crlf'
50
- }
51
- ]
52
- }
53
- }
package/.prettierrc.js DELETED
@@ -1,5 +0,0 @@
1
- export const singleQuote = true;
2
- export const semi = true;
3
- export const useTabs = false;
4
- export const tabWidth = 2;
5
- export const trailingComma = "all";
@@ -1,17 +0,0 @@
1
- import type { StorybookConfig } from '@storybook/react-vite';
2
-
3
- const config: StorybookConfig = {
4
- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5
- addons: [
6
- '@storybook/addon-onboarding',
7
- '@storybook/addon-links',
8
- '@storybook/addon-essentials',
9
- '@chromatic-com/storybook',
10
- '@storybook/addon-interactions',
11
- ],
12
- framework: {
13
- name: '@storybook/react-vite',
14
- options: {},
15
- },
16
- };
17
- export default config;
@@ -1,16 +0,0 @@
1
- import type { Preview } from '@storybook/react';
2
- import "./css/bootstrap.min.css";
3
- import "./css/bootstrap.rtl.only.min.css";
4
-
5
- const preview: Preview = {
6
- parameters: {
7
- controls: {
8
- matchers: {
9
- color: /(background|color)$/i,
10
- date: /Date$/i,
11
- },
12
- },
13
- },
14
- };
15
-
16
- export default preview;
@@ -1,34 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { DropzoneUploader } from '.';
4
-
5
- const args = {
6
- onChangeFiles: () => {
7
- console.log('Accion despues de seleccionar un archivo');
8
- },
9
- totalFiles: 0,
10
- maxFiles: 3,
11
- accept: 'image/*, application/pdf',
12
- capture: null,
13
- nameFileLabel: 'Subir archivos',
14
- maxFileSize: 2,
15
- };
16
-
17
- const meta = {
18
- title: 'Components/DropzoneUploader',
19
- component: DropzoneUploader,
20
- args: {
21
- ...args,
22
- },
23
- } satisfies Meta<typeof DropzoneUploader>;
24
-
25
- export default meta;
26
-
27
- type Story = StoryObj<typeof meta>;
28
-
29
- export const DropzoneUploaderBasic: Story = {
30
- args: {
31
- ...args,
32
- maxFileSize: 5,
33
- },
34
- };
@@ -1,29 +0,0 @@
1
- import type { Meta, StoryObj } from '@storybook/react';
2
-
3
- import { TomarFoto } from '.';
4
-
5
- const meta = {
6
- title: 'Components/TomarFoto',
7
- component: TomarFoto,
8
- args: {
9
- onFilesSelectedSelfie:() => { },
10
- isMobile:false
11
- },
12
- } satisfies Meta<typeof TomarFoto>;
13
-
14
- export default meta;
15
- type Story = StoryObj<typeof meta>;
16
-
17
- export const TomarFotoWebApplication: Story = {
18
- args: {
19
- isMobile: false
20
- },
21
- };
22
- export const TomarFotoMobileApplication: Story = {
23
- args: {
24
- isMobile: true,
25
- onFilesSelectedSelfie: () => {
26
- console.log('Dispatch an action')
27
- }
28
- },
29
- };