@hmscodes/honey-core 1.0.1 → 1.0.3

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 (46) hide show
  1. package/README.md +18 -14
  2. package/fesm2022/honey-core.mjs +84 -0
  3. package/fesm2022/honey-core.mjs.map +1 -0
  4. package/index.d.ts +5 -0
  5. package/lib/components/button/button.component.d.ts +25 -0
  6. package/lib/honey-core.component.d.ts +5 -0
  7. package/lib/honey-core.service.d.ts +6 -0
  8. package/package.json +17 -42
  9. package/{projects/honey-core/src/public-api.ts → public-api.d.ts} +1 -4
  10. package/.editorconfig +0 -17
  11. package/.vscode/extensions.json +0 -4
  12. package/.vscode/launch.json +0 -20
  13. package/.vscode/tasks.json +0 -42
  14. package/angular.json +0 -61
  15. package/projects/honey-core/.storybook/main.ts +0 -18
  16. package/projects/honey-core/.storybook/preview.ts +0 -14
  17. package/projects/honey-core/.storybook/tsconfig.json +0 -11
  18. package/projects/honey-core/.storybook/typings.d.ts +0 -4
  19. package/projects/honey-core/README.md +0 -63
  20. package/projects/honey-core/ng-package.json +0 -7
  21. package/projects/honey-core/package.json +0 -12
  22. package/projects/honey-core/src/lib/components/button/button.component.html +0 -8
  23. package/projects/honey-core/src/lib/components/button/button.component.scss +0 -47
  24. package/projects/honey-core/src/lib/components/button/button.component.spec.ts +0 -23
  25. package/projects/honey-core/src/lib/components/button/button.component.ts +0 -44
  26. package/projects/honey-core/src/lib/honey-core.component.spec.ts +0 -23
  27. package/projects/honey-core/src/lib/honey-core.component.ts +0 -15
  28. package/projects/honey-core/src/lib/honey-core.service.spec.ts +0 -16
  29. package/projects/honey-core/src/lib/honey-core.service.ts +0 -9
  30. package/projects/honey-core/src/stories/.eslintrc.json +0 -5
  31. package/projects/honey-core/src/stories/Colors.mdx +0 -40
  32. package/projects/honey-core/src/stories/Presentation.mdx +0 -7
  33. package/projects/honey-core/src/stories/button.component.stories.ts +0 -67
  34. package/projects/honey-core/src/stories/button.css +0 -30
  35. package/projects/honey-core/src/stories/header.component.ts +0 -74
  36. package/projects/honey-core/src/stories/header.css +0 -32
  37. package/projects/honey-core/src/stories/header.stories.ts +0 -33
  38. package/projects/honey-core/src/stories/page.component.ts +0 -82
  39. package/projects/honey-core/src/stories/page.css +0 -68
  40. package/projects/honey-core/src/stories/page.stories.ts +0 -32
  41. package/projects/honey-core/src/stories/user.ts +0 -3
  42. package/projects/honey-core/src/styles/variables.scss +0 -18
  43. package/projects/honey-core/tsconfig.lib.json +0 -15
  44. package/projects/honey-core/tsconfig.lib.prod.json +0 -11
  45. package/projects/honey-core/tsconfig.spec.json +0 -15
  46. package/tsconfig.json +0 -32
@@ -1,44 +0,0 @@
1
- import { Component, Input, Output, EventEmitter } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'hc-button',
5
- templateUrl: './button.component.html',
6
- styleUrl: './button.component.scss',
7
- imports: [],
8
- standalone: true,
9
- })
10
- export class HcButtonComponent {
11
- /** Is this the principal call to action on the page? */
12
- @Input()
13
- variant: 'primary' | 'secondary' = 'primary';
14
-
15
- /** What background color to use */
16
- @Input()
17
- backgroundColor?: string;
18
-
19
- /** How large should the button be? */
20
- @Input()
21
- size: 'small' | 'medium' | 'large' = 'medium';
22
-
23
- /**
24
- * Button contents
25
- *
26
- * @required
27
- */
28
- @Input()
29
- label = 'Button';
30
-
31
- /**
32
- * Disabled state of the button
33
- */
34
- @Input()
35
- disabled = false;
36
-
37
- /** Optional click handler */
38
- @Output()
39
- onClick = new EventEmitter<Event>();
40
-
41
- public get classes(): string[] {
42
- return ['hc-button', `hc-${this.size}`, `hc-${this.variant}`];
43
- }
44
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { HoneyCoreComponent } from './honey-core.component';
4
-
5
- describe('HoneyCoreComponent', () => {
6
- let component: HoneyCoreComponent;
7
- let fixture: ComponentFixture<HoneyCoreComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- imports: [HoneyCoreComponent]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(HoneyCoreComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,15 +0,0 @@
1
- import { Component } from '@angular/core';
2
-
3
- @Component({
4
- selector: 'lib-honey-core',
5
- imports: [],
6
- template: `
7
- <p>
8
- honey-core works!
9
- </p>
10
- `,
11
- styles: ``
12
- })
13
- export class HoneyCoreComponent {
14
-
15
- }
@@ -1,16 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
-
3
- import { HoneyCoreService } from './honey-core.service';
4
-
5
- describe('HoneyCoreService', () => {
6
- let service: HoneyCoreService;
7
-
8
- beforeEach(() => {
9
- TestBed.configureTestingModule({});
10
- service = TestBed.inject(HoneyCoreService);
11
- });
12
-
13
- it('should be created', () => {
14
- expect(service).toBeTruthy();
15
- });
16
- });
@@ -1,9 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
-
3
- @Injectable({
4
- providedIn: 'root'
5
- })
6
- export class HoneyCoreService {
7
-
8
- constructor() { }
9
- }
@@ -1,5 +0,0 @@
1
- {
2
- "rules": {
3
- "@typescript-eslint/consistent-type-imports": ["error", { "disallowTypeAnnotations": false }]
4
- }
5
- }
@@ -1,40 +0,0 @@
1
- import { Meta, ColorPalette, ColorItem } from '@storybook/blocks';
2
-
3
- <Meta title="Colors" />
4
-
5
- <ColorPalette>
6
- <ColorItem
7
- title="theme.color.primary"
8
- subtitle="Honey Core"
9
- colors={{
10
- '--hc-primary-500': '#F55638',
11
- '--hc-primary-600': '#F57738',
12
- '--hc-primary-700': '#F59838',
13
- }}
14
- />
15
- <ColorItem
16
- title="theme.color.secondary"
17
- subtitle="Honey Core Secondary"
18
- colors={{
19
- '--hc-secondary-500': '#FFC857',
20
- '--hc-secondary-600': '#f7a838',
21
- '--hc-secondary-700': '#d68d2a',
22
- }}
23
- />
24
- <ColorItem
25
- title="theme.color.brown"
26
- subtitle="Honey Core Secondary"
27
- colors={{
28
- '--hc-brown-500': '#95570e',
29
- '--hc-brown-600': '#753c00',
30
- }}
31
- />
32
- <ColorItem
33
- title="theme.color.greyscale"
34
- subtitle="Some of the greys"
35
- colors={{
36
- '--hc-text-strong': '#2E282A',
37
- '--hc-text-light': '#6C757D',
38
- }}
39
- />
40
- </ColorPalette>
@@ -1,7 +0,0 @@
1
- import { Meta } from "@storybook/blocks";
2
-
3
- <Meta title="Apresentação" />
4
-
5
- # Configure your project
6
-
7
- HoneyCore is a reusable component library for Angular, crafted to bring consistency, efficiency, and style to personal projects. Inspired by the elegant structure of honeycombs, it’s built to scale and sweeten your workflow. 🐝
@@ -1,67 +0,0 @@
1
- import { argsToTemplate, type Meta, type StoryObj } from '@storybook/angular';
2
- import { fn } from '@storybook/test';
3
- import { HcButtonComponent } from '../lib/components/button/button.component';
4
-
5
- type ButtonInputsAndCustomArgs = HcButtonComponent & { text: string };
6
-
7
- // More on how to set up stories at: https://storybook.js.org/docs/writing-stories
8
- const meta: Meta<ButtonInputsAndCustomArgs> = {
9
- title: 'Example/Button',
10
- component: HcButtonComponent,
11
- tags: ['autodocs'],
12
- args: {
13
- text: 'Button',
14
- },
15
- render: ({ text, ...buttonArgs }) => ({
16
- props: buttonArgs,
17
- template: `
18
- <hc-button ${argsToTemplate(buttonArgs)}>
19
- ${text}
20
- </hc-button>
21
- `,
22
- }),
23
- };
24
-
25
- export default meta;
26
- type Story = StoryObj<HcButtonComponent>;
27
-
28
- // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args
29
- export const Primary: Story = {
30
- args: {
31
- variant: 'primary',
32
- },
33
- };
34
-
35
- export const PrimaryDisabled: Story = {
36
- args: {
37
- variant: 'primary',
38
- disabled: true,
39
- },
40
- };
41
-
42
- export const Secondary: Story = {
43
- args: {
44
- variant: 'secondary',
45
- },
46
- };
47
-
48
- export const Large: Story = {
49
- args: {
50
- variant: 'primary',
51
- size: 'large',
52
- },
53
- };
54
-
55
- export const Medium: Story = {
56
- args: {
57
- variant: 'primary',
58
- size: 'medium',
59
- },
60
- };
61
-
62
- export const Small: Story = {
63
- args: {
64
- variant: 'primary',
65
- size: 'small',
66
- },
67
- };
@@ -1,30 +0,0 @@
1
- .storybook-button {
2
- display: inline-block;
3
- cursor: pointer;
4
- border: 0;
5
- border-radius: 3em;
6
- font-weight: 700;
7
- line-height: 1;
8
- font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
9
- }
10
- .storybook-button--primary {
11
- background-color: #555ab9;
12
- color: white;
13
- }
14
- .storybook-button--secondary {
15
- box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
16
- background-color: transparent;
17
- color: #333;
18
- }
19
- .storybook-button--small {
20
- padding: 10px 16px;
21
- font-size: 12px;
22
- }
23
- .storybook-button--medium {
24
- padding: 11px 20px;
25
- font-size: 14px;
26
- }
27
- .storybook-button--large {
28
- padding: 12px 24px;
29
- font-size: 16px;
30
- }
@@ -1,74 +0,0 @@
1
- import { Component, Input, Output, EventEmitter } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
-
4
- import type { User } from './user';
5
- import { HcButtonComponent } from '../lib/components/button/button.component';
6
-
7
- @Component({
8
- selector: 'storybook-header',
9
- standalone: true,
10
- imports: [CommonModule, HcButtonComponent],
11
- template: `<header>
12
- <div class="storybook-header">
13
- <div>
14
- <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
15
- <g fill="none" fillRule="evenodd">
16
- <path
17
- d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z"
18
- fill="#FFF"
19
- />
20
- <path
21
- d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z"
22
- fill="#555AB9"
23
- />
24
- <path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8" />
25
- </g>
26
- </svg>
27
- <h1>Acme</h1>
28
- </div>
29
- <div>
30
- <div *ngIf="user">
31
- <span class="welcome">
32
- Welcome, <b>{{ user.name }}</b
33
- >!
34
- </span>
35
- <hc-button
36
- *ngIf="user"
37
- size="small"
38
- (onClick)="onLogout.emit($event)"
39
- >Log out</hc-button>
40
- </div>
41
- <div *ngIf="!user">
42
- <hc-button
43
- *ngIf="!user"
44
- size="small"
45
- class="margin-left"
46
- (onClick)="onLogin.emit($event)"
47
- label="Log in"
48
- ></hc-button>
49
- <hc-button
50
- *ngIf="!user"
51
- size="small"
52
- class="margin-left"
53
- (onClick)="onCreateAccount.emit($event)"
54
- label="Sign up"
55
- ></hc-button>
56
- </div>
57
- </div>
58
- </div>
59
- </header>`,
60
- styleUrls: ['./header.css'],
61
- })
62
- export class HeaderComponent {
63
- @Input()
64
- user: User | null = null;
65
-
66
- @Output()
67
- onLogin = new EventEmitter<Event>();
68
-
69
- @Output()
70
- onLogout = new EventEmitter<Event>();
71
-
72
- @Output()
73
- onCreateAccount = new EventEmitter<Event>();
74
- }
@@ -1,32 +0,0 @@
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
- }
@@ -1,33 +0,0 @@
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 = {};
@@ -1,82 +0,0 @@
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: `<article>
12
- <storybook-header
13
- [user]="user"
14
- (onLogout)="doLogout()"
15
- (onLogin)="doLogin()"
16
- (onCreateAccount)="doCreateAccount()"
17
- ></storybook-header>
18
- <section class="storybook-page">
19
- <h2>Pages in Storybook</h2>
20
- <p>
21
- We recommend building UIs with a
22
- <a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
23
- <strong>component-driven</strong>
24
- </a>
25
- process starting with atomic components and ending with pages.
26
- </p>
27
- <p>
28
- Render pages with mock data. This makes it easy to build and review page states without
29
- needing to navigate to them in your app. Here are some handy patterns for managing page data
30
- in Storybook:
31
- </p>
32
- <ul>
33
- <li>
34
- Use a higher-level connected component. Storybook helps you compose such data from the
35
- "args" of child component stories
36
- </li>
37
- <li>
38
- Assemble data in the page component from your services. You can mock these services out
39
- using Storybook.
40
- </li>
41
- </ul>
42
- <p>
43
- Get a guided tutorial on component-driven development at
44
- <a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
45
- Storybook tutorials
46
- </a>
47
- . Read more in the
48
- <a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer"> docs </a>
49
- .
50
- </p>
51
- <div class="tip-wrapper">
52
- <span class="tip">Tip</span> Adjust the width of the canvas with the
53
- <svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
54
- <g fill="none" fillRule="evenodd">
55
- <path
56
- 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"
57
- id="a"
58
- fill="#999"
59
- />
60
- </g>
61
- </svg>
62
- Viewports addon in the toolbar
63
- </div>
64
- </section>
65
- </article>`,
66
- styleUrls: ['./page.css'],
67
- })
68
- export class PageComponent {
69
- user: User | null = null;
70
-
71
- doLogout() {
72
- this.user = null;
73
- }
74
-
75
- doLogin() {
76
- this.user = { name: 'Jane Doe' };
77
- }
78
-
79
- doCreateAccount() {
80
- this.user = { name: 'Jane Doe' };
81
- }
82
- }
@@ -1,68 +0,0 @@
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
- }
@@ -1,32 +0,0 @@
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/component-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
- };
@@ -1,3 +0,0 @@
1
- export interface User {
2
- name: string;
3
- }
@@ -1,18 +0,0 @@
1
- :root {
2
- --hc-primary-500 : #F55638;
3
- --hc-primary-600 : #F57738;
4
- --hc-primary-700 : #F59838;
5
- --hc-secondary-500 : #FFC857;
6
- --hc-secondary-600 : #f7a838;
7
- --hc-secondary-700 : #d68d2a;
8
- --hc-brown-500 : #95570e;
9
- --hc-brown-600 : #753c00;
10
- --hc-text-strong : #2E282A;
11
- --hc-text-light : #6C757D;
12
-
13
- --hc-disabled-bg : #c7c7c7;
14
- --hc-disabled-text : #6C757D;
15
- --hc-background-primary : var(--hc-primary-500);
16
- --hc-background-primary-hover : var(--hc-primary-600);
17
- }
18
-
@@ -1,15 +0,0 @@
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/lib",
7
- "declaration": true,
8
- "declarationMap": true,
9
- "inlineSources": true,
10
- "types": []
11
- },
12
- "exclude": [
13
- "**/*.spec.ts"
14
- ]
15
- }
@@ -1,11 +0,0 @@
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.lib.json",
5
- "compilerOptions": {
6
- "declarationMap": false
7
- },
8
- "angularCompilerOptions": {
9
- "compilationMode": "partial"
10
- }
11
- }
@@ -1,15 +0,0 @@
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
- "jasmine"
9
- ]
10
- },
11
- "include": [
12
- "**/*.spec.ts",
13
- "**/*.d.ts"
14
- ]
15
- }