@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,78 @@
1
+ import { Component, Input, Output, EventEmitter } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ import { ButtonComponent } from './button.component';
5
+ import type { User } from './user';
6
+
7
+ @Component({
8
+ selector: 'storybook-header',
9
+ standalone: true,
10
+ imports: [CommonModule, ButtonComponent],
11
+ template: `
12
+ <header>
13
+ <div class="storybook-header">
14
+ <div>
15
+ <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
16
+ <g fill="none" fillRule="evenodd">
17
+ <path
18
+ d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
19
+ fill="#FFF"
20
+ />
21
+ <path
22
+ d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
23
+ fill="#555AB9"
24
+ />
25
+ <path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8" />
26
+ </g>
27
+ </svg>
28
+ <h1>Acme</h1>
29
+ </div>
30
+ <div>
31
+ <div *ngIf="user">
32
+ <span class="welcome">
33
+ Welcome, <b>{{ user.name }}</b
34
+ >!
35
+ </span>
36
+ <storybook-button
37
+ *ngIf="user"
38
+ size="small"
39
+ (onClick)="onLogout.emit($event)"
40
+ label="Log out"
41
+ ></storybook-button>
42
+ </div>
43
+ <div *ngIf="!user">
44
+ <storybook-button
45
+ *ngIf="!user"
46
+ size="small"
47
+ class="margin-left"
48
+ (onClick)="onLogin.emit($event)"
49
+ label="Log in"
50
+ ></storybook-button>
51
+ <storybook-button
52
+ *ngIf="!user"
53
+ size="small"
54
+ [primary]="true"
55
+ class="margin-left"
56
+ (onClick)="onCreateAccount.emit($event)"
57
+ label="Sign up"
58
+ ></storybook-button>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </header>
63
+ `,
64
+ styleUrls: ['./header.css'],
65
+ })
66
+ export class HeaderComponent {
67
+ @Input()
68
+ user: User | null = null;
69
+
70
+ @Output()
71
+ onLogin = new EventEmitter<Event>();
72
+
73
+ @Output()
74
+ onLogout = new EventEmitter<Event>();
75
+
76
+ @Output()
77
+ onCreateAccount = new EventEmitter<Event>();
78
+ }
@@ -0,0 +1,32 @@
1
+ .storybook-header {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
6
+ padding: 15px 20px;
7
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
8
+ }
9
+
10
+ .storybook-header svg {
11
+ display: inline-block;
12
+ vertical-align: top;
13
+ }
14
+
15
+ .storybook-header h1 {
16
+ display: inline-block;
17
+ vertical-align: top;
18
+ margin: 6px 0 6px 10px;
19
+ font-weight: 700;
20
+ font-size: 20px;
21
+ line-height: 1;
22
+ }
23
+
24
+ .storybook-header button + button {
25
+ margin-left: 10px;
26
+ }
27
+
28
+ .storybook-header .welcome {
29
+ margin-right: 10px;
30
+ color: #333;
31
+ font-size: 14px;
32
+ }
@@ -0,0 +1,33 @@
1
+ import type { Meta, StoryObj } from '@storybook/angular';
2
+ import { fn } from 'storybook/test';
3
+
4
+ import { HeaderComponent } from './header.component';
5
+
6
+ const meta: Meta<HeaderComponent> = {
7
+ title: 'Example/Header',
8
+ component: HeaderComponent,
9
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
10
+ tags: ['autodocs'],
11
+ parameters: {
12
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
13
+ layout: 'fullscreen',
14
+ },
15
+ args: {
16
+ onLogin: fn(),
17
+ onLogout: fn(),
18
+ onCreateAccount: fn(),
19
+ },
20
+ };
21
+
22
+ export default meta;
23
+ type Story = StoryObj<HeaderComponent>;
24
+
25
+ export const LoggedIn: Story = {
26
+ args: {
27
+ user: {
28
+ name: 'Jane Doe',
29
+ },
30
+ },
31
+ };
32
+
33
+ export const LoggedOut: Story = {};
@@ -0,0 +1,84 @@
1
+ import { Component } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ import { HeaderComponent } from './header.component';
5
+ import type { User } from './user';
6
+
7
+ @Component({
8
+ selector: 'storybook-page',
9
+ standalone: true,
10
+ imports: [CommonModule, HeaderComponent],
11
+ template: `
12
+ <article>
13
+ <storybook-header
14
+ [user]="user"
15
+ (onLogout)="doLogout()"
16
+ (onLogin)="doLogin()"
17
+ (onCreateAccount)="doCreateAccount()"
18
+ ></storybook-header>
19
+ <section class="storybook-page">
20
+ <h2>Pages in Storybook</h2>
21
+ <p>
22
+ We recommend building UIs with a
23
+ <a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
24
+ <strong>component-driven</strong>
25
+ </a>
26
+ process starting with atomic components and ending with pages.
27
+ </p>
28
+ <p>
29
+ Render pages with mock data. This makes it easy to build and review page states without
30
+ needing to navigate to them in your app. Here are some handy patterns for managing page data
31
+ in Storybook:
32
+ </p>
33
+ <ul>
34
+ <li>
35
+ Use a higher-level connected component. Storybook helps you compose such data from the
36
+ "args" of child component stories
37
+ </li>
38
+ <li>
39
+ Assemble data in the page component from your services. You can mock these services out
40
+ using Storybook.
41
+ </li>
42
+ </ul>
43
+ <p>
44
+ Get a guided tutorial on component-driven development at
45
+ <a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
46
+ Storybook tutorials
47
+ </a>
48
+ . Read more in the
49
+ <a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer"> docs </a>
50
+ .
51
+ </p>
52
+ <div class="tip-wrapper">
53
+ <span class="tip">Tip</span> Adjust the width of the canvas with the
54
+ <svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
55
+ <g fill="none" fillRule="evenodd">
56
+ <path
57
+ d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
58
+ id="a"
59
+ fill="#999"
60
+ />
61
+ </g>
62
+ </svg>
63
+ Viewports addon in the toolbar
64
+ </div>
65
+ </section>
66
+ </article>
67
+ `,
68
+ styleUrls: ['./page.css'],
69
+ })
70
+ export class PageComponent {
71
+ user: User | null = null;
72
+
73
+ doLogout() {
74
+ this.user = null;
75
+ }
76
+
77
+ doLogin() {
78
+ this.user = { name: 'Jane Doe' };
79
+ }
80
+
81
+ doCreateAccount() {
82
+ this.user = { name: 'Jane Doe' };
83
+ }
84
+ }
@@ -0,0 +1,68 @@
1
+ .storybook-page {
2
+ margin: 0 auto;
3
+ padding: 48px 20px;
4
+ max-width: 600px;
5
+ color: #333;
6
+ font-size: 14px;
7
+ line-height: 24px;
8
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
9
+ }
10
+
11
+ .storybook-page h2 {
12
+ display: inline-block;
13
+ vertical-align: top;
14
+ margin: 0 0 4px;
15
+ font-weight: 700;
16
+ font-size: 32px;
17
+ line-height: 1;
18
+ }
19
+
20
+ .storybook-page p {
21
+ margin: 1em 0;
22
+ }
23
+
24
+ .storybook-page a {
25
+ color: inherit;
26
+ }
27
+
28
+ .storybook-page ul {
29
+ margin: 1em 0;
30
+ padding-left: 30px;
31
+ }
32
+
33
+ .storybook-page li {
34
+ margin-bottom: 8px;
35
+ }
36
+
37
+ .storybook-page .tip {
38
+ display: inline-block;
39
+ vertical-align: top;
40
+ margin-right: 10px;
41
+ border-radius: 1em;
42
+ background: #e7fdd8;
43
+ padding: 4px 12px;
44
+ color: #357a14;
45
+ font-weight: 700;
46
+ font-size: 11px;
47
+ line-height: 12px;
48
+ }
49
+
50
+ .storybook-page .tip-wrapper {
51
+ margin-top: 40px;
52
+ margin-bottom: 40px;
53
+ font-size: 13px;
54
+ line-height: 20px;
55
+ }
56
+
57
+ .storybook-page .tip-wrapper svg {
58
+ display: inline-block;
59
+ vertical-align: top;
60
+ margin-top: 3px;
61
+ margin-right: 4px;
62
+ width: 12px;
63
+ height: 12px;
64
+ }
65
+
66
+ .storybook-page .tip-wrapper svg path {
67
+ fill: #1ea7fd;
68
+ }
@@ -0,0 +1,32 @@
1
+ import type { Meta, StoryObj } from '@storybook/angular';
2
+ import { expect, userEvent, within } from 'storybook/test';
3
+
4
+ import { PageComponent } from './page.component';
5
+
6
+ const meta: Meta<PageComponent> = {
7
+ title: 'Example/Page',
8
+ component: PageComponent,
9
+ parameters: {
10
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
11
+ layout: 'fullscreen',
12
+ },
13
+ };
14
+
15
+ export default meta;
16
+ type Story = StoryObj<PageComponent>;
17
+
18
+ export const LoggedOut: Story = {};
19
+
20
+ // More on component testing: https://storybook.js.org/docs/writing-tests/interaction-testing
21
+ export const LoggedIn: Story = {
22
+ play: async ({ canvasElement }) => {
23
+ const canvas = within(canvasElement);
24
+ const loginButton = canvas.getByRole('button', { name: /Log in/i });
25
+ await expect(loginButton).toBeInTheDocument();
26
+ await userEvent.click(loginButton);
27
+ await expect(loginButton).not.toBeInTheDocument();
28
+
29
+ const logoutButton = canvas.getByRole('button', { name: /Log out/i });
30
+ await expect(logoutButton).toBeInTheDocument();
31
+ },
32
+ };
@@ -0,0 +1,3 @@
1
+ export interface User {
2
+ name: string;
3
+ }
@@ -0,0 +1 @@
1
+ /* You can add global styles to this file, and also import other style files */
@@ -0,0 +1,15 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "../../tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "../../out-tsc/app",
7
+ "types": []
8
+ },
9
+ "include": [
10
+ "src/**/*.ts"
11
+ ],
12
+ "exclude": [
13
+ "src/**/*.spec.ts"
14
+ ]
15
+ }
@@ -0,0 +1,15 @@
1
+ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
2
+ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
3
+ {
4
+ "extends": "../../tsconfig.json",
5
+ "compilerOptions": {
6
+ "outDir": "../../out-tsc/spec",
7
+ "types": [
8
+ "vitest/globals"
9
+ ]
10
+ },
11
+ "include": [
12
+ "src/**/*.d.ts",
13
+ "src/**/*.spec.ts"
14
+ ]
15
+ }
@@ -0,0 +1,27 @@
1
+ :host {
2
+ display: inline-flex;
3
+ }
4
+
5
+ :host ::ng-deep {
6
+ byte-button {
7
+ display: contents;
8
+ }
9
+
10
+ byte-button .p-button {
11
+ border-radius: 0;
12
+ }
13
+
14
+ byte-button:not(:last-child) .p-button {
15
+ border-right: 0 none;
16
+ }
17
+
18
+ byte-button:first-child .p-button {
19
+ border-top-left-radius: var(--p-button-border-radius);
20
+ border-bottom-left-radius: var(--p-button-border-radius);
21
+ }
22
+
23
+ byte-button:last-child .p-button {
24
+ border-top-right-radius: var(--p-button-border-radius);
25
+ border-bottom-right-radius: var(--p-button-border-radius);
26
+ }
27
+ }
@@ -0,0 +1,6 @@
1
+ <p-buttonGroup
2
+ [style]="style"
3
+ [class]="styleClass"
4
+ >
5
+ <ng-content />
6
+ </p-buttonGroup>
@@ -0,0 +1,22 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ByteButtonGroup } from './byte-button-group';
4
+
5
+ describe('ByteButtonGroup', () => {
6
+ let component: ByteButtonGroup;
7
+ let fixture: ComponentFixture<ByteButtonGroup>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [ByteButtonGroup],
12
+ }).compileComponents();
13
+
14
+ fixture = TestBed.createComponent(ByteButtonGroup);
15
+ component = fixture.componentInstance;
16
+ await fixture.whenStable();
17
+ });
18
+
19
+ it('should create', () => {
20
+ expect(component).toBeTruthy();
21
+ });
22
+ });
@@ -0,0 +1,35 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ Input
5
+ } from '@angular/core';
6
+
7
+ import { ButtonGroupModule } from 'primeng/buttongroup';
8
+
9
+
10
+ @Component({
11
+ selector: 'byte-button-group',
12
+
13
+ imports: [
14
+ ButtonGroupModule
15
+ ],
16
+
17
+ templateUrl: './byte-button-group.html',
18
+
19
+ styleUrl: './byte-button-group.css',
20
+
21
+ changeDetection: ChangeDetectionStrategy.OnPush
22
+ })
23
+ export class ByteButtonGroup {
24
+
25
+ // =====================================================
26
+ // INPUTS
27
+ // =====================================================
28
+
29
+ @Input()
30
+ style: { [klass: string]: any } | null | undefined;
31
+
32
+ @Input()
33
+ styleClass: string | undefined;
34
+
35
+ }
File without changes
@@ -0,0 +1,17 @@
1
+ import {
2
+ Directive,
3
+ TemplateRef
4
+ } from '@angular/core';
5
+
6
+
7
+ @Directive({
8
+ selector: 'ng-template[byteButtonContent]',
9
+ standalone: true
10
+ })
11
+ export class ByteButtonContentDirective {
12
+
13
+ constructor(
14
+ public template: TemplateRef<any>
15
+ ) {}
16
+
17
+ }
@@ -0,0 +1,29 @@
1
+ <p-button
2
+ [label]="label"
3
+ [icon]="icon"
4
+ [iconPos]="iconPos"
5
+ [severity]="severity"
6
+ [variant]="variant"
7
+ [size]="size"
8
+ [disabled]="disabled"
9
+ [loading]="loading"
10
+ [loadingIcon]="loadingIcon"
11
+ [raised]="raised"
12
+ [rounded]="rounded"
13
+ [text]="text"
14
+ [outlined]="outlined"
15
+ [link]="link"
16
+ [plain]="plain"
17
+ [fluid]="fluid"
18
+ [type]="type"
19
+ [buttonProps]="buttonProps"
20
+ (onClick)="onButtonClick($event)"
21
+ >
22
+ @if (contentTemplate) {
23
+ <ng-template pTemplate="content">
24
+ <ng-container
25
+ [ngTemplateOutlet]="contentTemplate.template"
26
+ />
27
+ </ng-template>
28
+ }
29
+ </p-button>
@@ -0,0 +1,19 @@
1
+ import { NgModule } from '@angular/core';
2
+
3
+ import { ByteButton } from './byte-button';
4
+ import { ByteButtonContentDirective } from './byte-button.directive';
5
+ import { ByteButtonGroup } from './byte-button-group/byte-button-group';
6
+
7
+ @NgModule({
8
+ imports: [
9
+ ByteButton,
10
+ ByteButtonContentDirective,
11
+ ByteButtonGroup
12
+ ],
13
+ exports: [
14
+ ByteButton,
15
+ ByteButtonContentDirective,
16
+ ByteButtonGroup
17
+ ]
18
+ })
19
+ export class ByteButtonModule {}