@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.
- package/.editorconfig +17 -0
- package/.prettierrc +12 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/mcp.json +9 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +284 -0
- package/angular.json +211 -0
- package/ng-package.json +11 -0
- package/package.json +44 -0
- package/projects/storybook-host/.storybook/main.ts +20 -0
- package/projects/storybook-host/.storybook/preview.ts +74 -0
- package/projects/storybook-host/.storybook/tsconfig.doc.json +10 -0
- package/projects/storybook-host/.storybook/tsconfig.json +22 -0
- package/projects/storybook-host/.storybook/tutorial/Installation.mdx +6 -0
- package/projects/storybook-host/.storybook/tutorial/Introduction.mdx +18 -0
- package/projects/storybook-host/.storybook/tutorial/Theming.mdx +14 -0
- package/projects/storybook-host/.storybook/typings.d.ts +4 -0
- package/projects/storybook-host/documentation.json +605 -0
- package/projects/storybook-host/public/favicon.ico +0 -0
- package/projects/storybook-host/src/app/app.config.ts +8 -0
- package/projects/storybook-host/src/app/app.css +0 -0
- package/projects/storybook-host/src/app/app.html +343 -0
- package/projects/storybook-host/src/app/app.ts +11 -0
- package/projects/storybook-host/src/index.html +13 -0
- package/projects/storybook-host/src/main.ts +6 -0
- package/projects/storybook-host/src/stories/assets/accessibility.png +0 -0
- package/projects/storybook-host/src/stories/assets/accessibility.svg +1 -0
- package/projects/storybook-host/src/stories/assets/addon-library.png +0 -0
- package/projects/storybook-host/src/stories/assets/assets.png +0 -0
- package/projects/storybook-host/src/stories/assets/avif-test-image.avif +0 -0
- package/projects/storybook-host/src/stories/assets/context.png +0 -0
- package/projects/storybook-host/src/stories/assets/discord.svg +1 -0
- package/projects/storybook-host/src/stories/assets/docs.png +0 -0
- package/projects/storybook-host/src/stories/assets/figma-plugin.png +0 -0
- package/projects/storybook-host/src/stories/assets/github.svg +1 -0
- package/projects/storybook-host/src/stories/assets/share.png +0 -0
- package/projects/storybook-host/src/stories/assets/styling.png +0 -0
- package/projects/storybook-host/src/stories/assets/testing.png +0 -0
- package/projects/storybook-host/src/stories/assets/theming.png +0 -0
- package/projects/storybook-host/src/stories/assets/tutorials.svg +1 -0
- package/projects/storybook-host/src/stories/assets/youtube.svg +1 -0
- package/projects/storybook-host/src/stories/button.component.ts +50 -0
- package/projects/storybook-host/src/stories/button.css +30 -0
- package/projects/storybook-host/src/stories/button.stories.ts +49 -0
- package/projects/storybook-host/src/stories/header.component.ts +78 -0
- package/projects/storybook-host/src/stories/header.css +32 -0
- package/projects/storybook-host/src/stories/header.stories.ts +33 -0
- package/projects/storybook-host/src/stories/page.component.ts +84 -0
- package/projects/storybook-host/src/stories/page.css +68 -0
- package/projects/storybook-host/src/stories/page.stories.ts +32 -0
- package/projects/storybook-host/src/stories/user.ts +3 -0
- package/projects/storybook-host/src/styles.css +1 -0
- package/projects/storybook-host/tsconfig.app.json +15 -0
- package/projects/storybook-host/tsconfig.spec.json +15 -0
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.css +27 -0
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.html +6 -0
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.spec.ts +22 -0
- package/src/lib/components/byte-button/byte-button-group/byte-button-group.ts +35 -0
- package/src/lib/components/byte-button/byte-button.css +0 -0
- package/src/lib/components/byte-button/byte-button.directive.ts +17 -0
- package/src/lib/components/byte-button/byte-button.html +29 -0
- package/src/lib/components/byte-button/byte-button.module.ts +19 -0
- package/src/lib/components/byte-button/byte-button.stories.ts +449 -0
- package/src/lib/components/byte-button/byte-button.ts +129 -0
- package/src/lib/components/byte-dialog/byte-dialog.css +0 -0
- package/src/lib/components/byte-dialog/byte-dialog.directive.ts +21 -0
- package/src/lib/components/byte-dialog/byte-dialog.html +47 -0
- package/src/lib/components/byte-dialog/byte-dialog.module.ts +21 -0
- package/src/lib/components/byte-dialog/byte-dialog.spec.ts +22 -0
- package/src/lib/components/byte-dialog/byte-dialog.ts +121 -0
- package/src/lib/components/byte-dialog/byte.dialog.stories.ts +215 -0
- package/src/lib/components/byte-input/byte-input.css +29 -0
- package/src/lib/components/byte-input/byte-input.html +58 -0
- package/src/lib/components/byte-input/byte-input.spec.ts +22 -0
- package/src/lib/components/byte-input/byte-input.stories.ts +60 -0
- package/src/lib/components/byte-input/byte-input.ts +97 -0
- package/src/lib/components/byte-select/byte-select.css +16 -0
- package/src/lib/components/byte-select/byte-select.directive.ts +61 -0
- package/src/lib/components/byte-select/byte-select.html +101 -0
- package/src/lib/components/byte-select/byte-select.module.ts +26 -0
- package/src/lib/components/byte-select/byte-select.spec.ts +22 -0
- package/src/lib/components/byte-select/byte-select.stories.ts +194 -0
- package/src/lib/components/byte-select/byte-select.ts +168 -0
- package/src/lib/components/byte-select/index.ts +3 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.css +0 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.directive.ts +11 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.html +31 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.module.ts +16 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.spec.ts +22 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.stories.ts +190 -0
- package/src/lib/components/byte-sidebar/byte-sidebar.ts +108 -0
- package/src/lib/components/byte-table/byte-table.css +0 -0
- package/src/lib/components/byte-table/byte-table.directive.ts +49 -0
- package/src/lib/components/byte-table/byte-table.html +102 -0
- package/src/lib/components/byte-table/byte-table.module.ts +33 -0
- package/src/lib/components/byte-table/byte-table.spec.ts +22 -0
- package/src/lib/components/byte-table/byte-table.stories.ts +296 -0
- package/src/lib/components/byte-table/byte-table.ts +162 -0
- package/src/lib/components/calendar/calendar.css +16 -0
- package/src/lib/components/calendar/calendar.html +15 -0
- package/src/lib/components/calendar/calendar.spec.ts +22 -0
- package/src/lib/components/calendar/calendar.stories.ts +153 -0
- package/src/lib/components/calendar/calendar.ts +89 -0
- package/src/lib/components/select/select.css +16 -0
- package/src/lib/components/select/select.html +14 -0
- package/src/lib/components/select/select.spec.ts +22 -0
- package/src/lib/components/select/select.ts +73 -0
- package/src/lib/config/empresa-ui.token.ts +5 -0
- package/src/lib/providers/empresa-ui-config.ts +8 -0
- package/src/lib/providers/provide-empresa-ui.ts +42 -0
- package/src/lib/themes/CRM-Theme.ts +34 -0
- package/src/lib/themes/aura.ts +3 -0
- package/src/lib/themes/index.ts +2 -0
- package/src/lib/themes/registry.ts +9 -0
- package/src/lib/utils/inject-prime-icons.ts +12 -0
- package/src/public-api.ts +30 -0
- package/tsconfig.json +45 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.lib.prod.json +9 -0
- 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,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
|
+
};
|