@4byte/shared-lib 0.0.1

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 (121) hide show
  1. package/.editorconfig +17 -0
  2. package/.prettierrc +12 -0
  3. package/.vscode/extensions.json +4 -0
  4. package/.vscode/launch.json +20 -0
  5. package/.vscode/mcp.json +9 -0
  6. package/.vscode/tasks.json +42 -0
  7. package/README.md +284 -0
  8. package/angular.json +211 -0
  9. package/ng-package.json +11 -0
  10. package/package.json +44 -0
  11. package/projects/storybook-host/.storybook/main.ts +20 -0
  12. package/projects/storybook-host/.storybook/preview.ts +74 -0
  13. package/projects/storybook-host/.storybook/tsconfig.doc.json +10 -0
  14. package/projects/storybook-host/.storybook/tsconfig.json +22 -0
  15. package/projects/storybook-host/.storybook/tutorial/Installation.mdx +6 -0
  16. package/projects/storybook-host/.storybook/tutorial/Introduction.mdx +18 -0
  17. package/projects/storybook-host/.storybook/tutorial/Theming.mdx +14 -0
  18. package/projects/storybook-host/.storybook/typings.d.ts +4 -0
  19. package/projects/storybook-host/documentation.json +605 -0
  20. package/projects/storybook-host/public/favicon.ico +0 -0
  21. package/projects/storybook-host/src/app/app.config.ts +8 -0
  22. package/projects/storybook-host/src/app/app.css +0 -0
  23. package/projects/storybook-host/src/app/app.html +343 -0
  24. package/projects/storybook-host/src/app/app.ts +11 -0
  25. package/projects/storybook-host/src/index.html +13 -0
  26. package/projects/storybook-host/src/main.ts +6 -0
  27. package/projects/storybook-host/src/stories/assets/accessibility.png +0 -0
  28. package/projects/storybook-host/src/stories/assets/accessibility.svg +1 -0
  29. package/projects/storybook-host/src/stories/assets/addon-library.png +0 -0
  30. package/projects/storybook-host/src/stories/assets/assets.png +0 -0
  31. package/projects/storybook-host/src/stories/assets/avif-test-image.avif +0 -0
  32. package/projects/storybook-host/src/stories/assets/context.png +0 -0
  33. package/projects/storybook-host/src/stories/assets/discord.svg +1 -0
  34. package/projects/storybook-host/src/stories/assets/docs.png +0 -0
  35. package/projects/storybook-host/src/stories/assets/figma-plugin.png +0 -0
  36. package/projects/storybook-host/src/stories/assets/github.svg +1 -0
  37. package/projects/storybook-host/src/stories/assets/share.png +0 -0
  38. package/projects/storybook-host/src/stories/assets/styling.png +0 -0
  39. package/projects/storybook-host/src/stories/assets/testing.png +0 -0
  40. package/projects/storybook-host/src/stories/assets/theming.png +0 -0
  41. package/projects/storybook-host/src/stories/assets/tutorials.svg +1 -0
  42. package/projects/storybook-host/src/stories/assets/youtube.svg +1 -0
  43. package/projects/storybook-host/src/stories/button.component.ts +50 -0
  44. package/projects/storybook-host/src/stories/button.css +30 -0
  45. package/projects/storybook-host/src/stories/button.stories.ts +49 -0
  46. package/projects/storybook-host/src/stories/header.component.ts +78 -0
  47. package/projects/storybook-host/src/stories/header.css +32 -0
  48. package/projects/storybook-host/src/stories/header.stories.ts +33 -0
  49. package/projects/storybook-host/src/stories/page.component.ts +84 -0
  50. package/projects/storybook-host/src/stories/page.css +68 -0
  51. package/projects/storybook-host/src/stories/page.stories.ts +32 -0
  52. package/projects/storybook-host/src/stories/user.ts +3 -0
  53. package/projects/storybook-host/src/styles.css +1 -0
  54. package/projects/storybook-host/tsconfig.app.json +15 -0
  55. package/projects/storybook-host/tsconfig.spec.json +15 -0
  56. package/src/lib/components/byte-button/byte-button-group/byte-button-group.css +27 -0
  57. package/src/lib/components/byte-button/byte-button-group/byte-button-group.html +6 -0
  58. package/src/lib/components/byte-button/byte-button-group/byte-button-group.spec.ts +22 -0
  59. package/src/lib/components/byte-button/byte-button-group/byte-button-group.ts +35 -0
  60. package/src/lib/components/byte-button/byte-button.css +0 -0
  61. package/src/lib/components/byte-button/byte-button.directive.ts +17 -0
  62. package/src/lib/components/byte-button/byte-button.html +29 -0
  63. package/src/lib/components/byte-button/byte-button.module.ts +19 -0
  64. package/src/lib/components/byte-button/byte-button.stories.ts +449 -0
  65. package/src/lib/components/byte-button/byte-button.ts +129 -0
  66. package/src/lib/components/byte-dialog/byte-dialog.css +0 -0
  67. package/src/lib/components/byte-dialog/byte-dialog.directive.ts +21 -0
  68. package/src/lib/components/byte-dialog/byte-dialog.html +47 -0
  69. package/src/lib/components/byte-dialog/byte-dialog.module.ts +21 -0
  70. package/src/lib/components/byte-dialog/byte-dialog.spec.ts +22 -0
  71. package/src/lib/components/byte-dialog/byte-dialog.ts +121 -0
  72. package/src/lib/components/byte-dialog/byte.dialog.stories.ts +215 -0
  73. package/src/lib/components/byte-input/byte-input.css +29 -0
  74. package/src/lib/components/byte-input/byte-input.html +58 -0
  75. package/src/lib/components/byte-input/byte-input.spec.ts +22 -0
  76. package/src/lib/components/byte-input/byte-input.stories.ts +60 -0
  77. package/src/lib/components/byte-input/byte-input.ts +97 -0
  78. package/src/lib/components/byte-select/byte-select.css +16 -0
  79. package/src/lib/components/byte-select/byte-select.directive.ts +61 -0
  80. package/src/lib/components/byte-select/byte-select.html +101 -0
  81. package/src/lib/components/byte-select/byte-select.module.ts +26 -0
  82. package/src/lib/components/byte-select/byte-select.spec.ts +22 -0
  83. package/src/lib/components/byte-select/byte-select.stories.ts +194 -0
  84. package/src/lib/components/byte-select/byte-select.ts +168 -0
  85. package/src/lib/components/byte-select/index.ts +3 -0
  86. package/src/lib/components/byte-sidebar/byte-sidebar.css +0 -0
  87. package/src/lib/components/byte-sidebar/byte-sidebar.directive.ts +11 -0
  88. package/src/lib/components/byte-sidebar/byte-sidebar.html +31 -0
  89. package/src/lib/components/byte-sidebar/byte-sidebar.module.ts +16 -0
  90. package/src/lib/components/byte-sidebar/byte-sidebar.spec.ts +22 -0
  91. package/src/lib/components/byte-sidebar/byte-sidebar.stories.ts +190 -0
  92. package/src/lib/components/byte-sidebar/byte-sidebar.ts +108 -0
  93. package/src/lib/components/byte-table/byte-table.css +0 -0
  94. package/src/lib/components/byte-table/byte-table.directive.ts +49 -0
  95. package/src/lib/components/byte-table/byte-table.html +102 -0
  96. package/src/lib/components/byte-table/byte-table.module.ts +33 -0
  97. package/src/lib/components/byte-table/byte-table.spec.ts +22 -0
  98. package/src/lib/components/byte-table/byte-table.stories.ts +296 -0
  99. package/src/lib/components/byte-table/byte-table.ts +162 -0
  100. package/src/lib/components/calendar/calendar.css +16 -0
  101. package/src/lib/components/calendar/calendar.html +15 -0
  102. package/src/lib/components/calendar/calendar.spec.ts +22 -0
  103. package/src/lib/components/calendar/calendar.stories.ts +153 -0
  104. package/src/lib/components/calendar/calendar.ts +89 -0
  105. package/src/lib/components/select/select.css +16 -0
  106. package/src/lib/components/select/select.html +14 -0
  107. package/src/lib/components/select/select.spec.ts +22 -0
  108. package/src/lib/components/select/select.ts +73 -0
  109. package/src/lib/config/empresa-ui.token.ts +5 -0
  110. package/src/lib/providers/empresa-ui-config.ts +8 -0
  111. package/src/lib/providers/provide-empresa-ui.ts +42 -0
  112. package/src/lib/themes/CRM-Theme.ts +34 -0
  113. package/src/lib/themes/aura.ts +3 -0
  114. package/src/lib/themes/index.ts +2 -0
  115. package/src/lib/themes/registry.ts +9 -0
  116. package/src/lib/utils/inject-prime-icons.ts +12 -0
  117. package/src/public-api.ts +30 -0
  118. package/tsconfig.json +45 -0
  119. package/tsconfig.lib.json +11 -0
  120. package/tsconfig.lib.prod.json +9 -0
  121. package/tsconfig.spec.json +8 -0
@@ -0,0 +1,74 @@
1
+ import type { Preview } from '@storybook/angular';
2
+
3
+ import { setCompodocJson } from '@storybook/addon-docs/angular';
4
+ import docJson from '../documentation.json';
5
+
6
+ import { EMPRESA_THEMES } from '../../../src/lib/themes/registry';
7
+ import { addons } from 'storybook/internal/preview-api';
8
+ import { FORCE_RE_RENDER, FORCE_REMOUNT } from 'storybook/internal/core-events';
9
+ import { injectPrimeIconsStylesheet } from '../../../src/lib/utils/inject-prime-icons';
10
+
11
+ setCompodocJson(docJson);
12
+
13
+ let previousTheme: string | undefined;
14
+
15
+ injectPrimeIconsStylesheet(); // se ejecuta una sola vez al cargar Storybook
16
+
17
+ const preview: Preview = {
18
+ globalTypes: {
19
+ theme: {
20
+ name: 'Tema',
21
+ description: 'Tema de Empresa UI',
22
+ defaultValue: 'crm',
23
+ toolbar: {
24
+ icon: 'paintbrush',
25
+ items: Object.keys(EMPRESA_THEMES)
26
+ }
27
+ }
28
+ },
29
+
30
+ decorators: [
31
+ (story, context) => {
32
+ const theme = context.globals['theme'] as string;
33
+
34
+ if (previousTheme && previousTheme !== theme) {
35
+
36
+ //sessionStorage.setItem('__storybook_theme_reload__', '1');
37
+
38
+ requestAnimationFrame(() => {
39
+ addons.getChannel().emit(FORCE_REMOUNT, {
40
+ storyId: context.id
41
+ });
42
+ });
43
+ console.log(previousTheme)
44
+ }
45
+
46
+ previousTheme = theme;
47
+
48
+ return story();
49
+
50
+ }
51
+ ],
52
+
53
+ parameters: {
54
+ options: {
55
+ storySort: {
56
+ order: [
57
+ 'Introduction',
58
+ 'Installation',
59
+ 'Theming',
60
+ 'Components'
61
+ ]
62
+ }
63
+ },
64
+ controls: {
65
+ disableSaveFromUI: true
66
+ }
67
+ }
68
+ };
69
+
70
+ if (sessionStorage.getItem('__storybook_theme_reload__')) {
71
+ sessionStorage.removeItem('__storybook_theme_reload__');
72
+ }
73
+
74
+ export default preview;
@@ -0,0 +1,10 @@
1
+ // This tsconfig is used by Compodoc to generate the documentation for the project.
2
+ // If Compodoc is not used, this file can be deleted.
3
+ {
4
+ "extends": "./tsconfig.json",
5
+ // Exclude all files that are not needed for documentation generation.
6
+ "exclude": ["../src/test.ts", "../src/**/*.spec.ts", "../src/**/*.stories.ts"],
7
+ // Please make sure to include all files from which Compodoc should generate documentation.
8
+ "include": ["../src/**/*"],
9
+ "files": ["./typings.d.ts"]
10
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "extends": "../tsconfig.app.json",
3
+ "compilerOptions": {
4
+ "types": ["node"],
5
+ "allowSyntheticDefaultImports": true,
6
+ "resolveJsonModule": true,
7
+ "moduleResolution": "bundler",
8
+ "rootDir": "../../.."
9
+ },
10
+ "exclude": [
11
+ "../src/test.ts",
12
+ "../src/**/*.spec.ts",
13
+ "../../../src/lib/**/*.spec.ts"
14
+ ],
15
+ "include": [
16
+ "../src/**/*.ts",
17
+ "../src/**/*.stories.*",
18
+ "../../../src/lib/**/*.ts",
19
+ "./preview.ts"
20
+ ],
21
+ "files": ["./typings.d.ts"]
22
+ }
@@ -0,0 +1,6 @@
1
+ # Installation
2
+
3
+ ## Instalar dependencias
4
+
5
+ ```bash
6
+ npm install
@@ -0,0 +1,18 @@
1
+ import { Meta } from '@storybook/addon-docs/blocks';
2
+
3
+ <Meta title="Introduction" />
4
+
5
+ # 4Byte Shared Lib
6
+
7
+ 4Byte Shared Lib es una librería de componentes reutilizables desarrollada con Angular y PrimeNG.
8
+
9
+ ## Tecnologías
10
+
11
+ - Angular 21
12
+ - PrimeNG 21
13
+
14
+ ## Requisitos
15
+
16
+ - Node.js 22.12.0+
17
+ - Angular 21
18
+ - npm 10+
@@ -0,0 +1,14 @@
1
+ # Theming
2
+
3
+ Empresa UI permite configurar el tema global mediante `provideEmpresaUI()` en el archivo `app.config.ts`.
4
+
5
+ ## Configuración
6
+
7
+ ```ts
8
+ export const appConfig: ApplicationConfig = {
9
+ providers: [
10
+ provideEmpresaUI({
11
+ theme: 'crm'
12
+ })
13
+ ]
14
+ };
@@ -0,0 +1,4 @@
1
+ declare module '*.md' {
2
+ const content: string;
3
+ export default content;
4
+ }