@hmscodes/honey-core 1.0.18 → 1.0.20
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/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/README.md +14 -18
- package/angular.json +64 -0
- package/package.json +45 -24
- package/projects/honey-core/.storybook/main.ts +18 -0
- package/projects/honey-core/.storybook/preview.ts +14 -0
- package/projects/honey-core/.storybook/tsconfig.json +11 -0
- package/projects/honey-core/.storybook/typings.d.ts +4 -0
- package/projects/honey-core/README.md +63 -0
- package/projects/honey-core/ng-package.json +8 -0
- package/projects/honey-core/package.json +20 -0
- package/projects/honey-core/src/lib/components/button/button.component.html +11 -0
- package/projects/honey-core/src/lib/components/button/button.component.scss +25 -0
- package/projects/honey-core/src/lib/components/button/button.component.spec.ts +23 -0
- package/projects/honey-core/src/lib/components/button/button.component.ts +38 -0
- package/projects/honey-core/src/lib/components/input/input-floating-label.component.html +10 -0
- package/projects/honey-core/src/lib/components/input/input-floating-label.component.scss +37 -0
- package/projects/honey-core/src/lib/components/input/input-floating-label.component.spec.ts +22 -0
- package/projects/honey-core/src/lib/components/input/input-floating-label.component.ts +18 -0
- package/projects/honey-core/src/lib/components/input-dropdown/hc-input-dropdown.component.html +23 -0
- package/projects/honey-core/src/lib/components/input-dropdown/hc-input-dropdown.component.scss +67 -0
- package/projects/honey-core/src/lib/components/input-dropdown/hc-input-dropdown.component.ts +44 -0
- package/projects/honey-core/src/lib/honey-core.component.spec.ts +23 -0
- package/projects/honey-core/src/lib/honey-core.component.ts +15 -0
- package/projects/honey-core/src/lib/honey-core.service.spec.ts +16 -0
- package/projects/honey-core/src/lib/honey-core.service.ts +9 -0
- package/{public-api.d.ts → projects/honey-core/src/public-api.ts} +5 -0
- package/projects/honey-core/src/stories/.eslintrc.json +5 -0
- package/projects/honey-core/src/stories/Colors.mdx +40 -0
- package/projects/honey-core/src/stories/Presentation.mdx +7 -0
- package/projects/honey-core/src/stories/button.component.stories.ts +80 -0
- package/projects/honey-core/src/stories/button.css +30 -0
- package/projects/honey-core/src/stories/hc-input-dropdown.stories.ts +36 -0
- package/projects/honey-core/src/stories/input-floating-label.component.stories.ts +25 -0
- package/projects/honey-core/src/stories/user.ts +3 -0
- package/projects/honey-core/styles/hc-button.scss +174 -0
- package/projects/honey-core/styles/variables.css +43 -0
- package/projects/honey-core/tsconfig.lib.json +15 -0
- package/projects/honey-core/tsconfig.lib.prod.json +11 -0
- package/projects/honey-core/tsconfig.spec.json +15 -0
- package/tsconfig.json +32 -0
- package/fesm2022/hmscodes-honey-core.mjs +0 -104
- package/fesm2022/hmscodes-honey-core.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/button/button.component.d.ts +0 -19
- package/lib/components/input/input-floating-label.component.d.ts +0 -11
- package/lib/honey-core.component.d.ts +0 -5
- package/lib/honey-core.service.d.ts +0 -6
- package/styles/variables.css +0 -24
package/projects/honey-core/src/lib/components/input-dropdown/hc-input-dropdown.component.scss
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
.hc-input {
|
|
2
|
+
position: relative;
|
|
3
|
+
border: none;
|
|
4
|
+
padding: 0;
|
|
5
|
+
margin: 1rem 0;
|
|
6
|
+
|
|
7
|
+
input {
|
|
8
|
+
width: 100%;
|
|
9
|
+
padding: 1.2rem 0.8rem 0.4rem;
|
|
10
|
+
font-size: 1rem;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
|
|
14
|
+
&:focus {
|
|
15
|
+
outline: none;
|
|
16
|
+
border-color: var(--hc-primary-500, var(--shc-primary-500));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:focus + label,
|
|
20
|
+
&:not(:placeholder-shown) + label {
|
|
21
|
+
transform: translateY(-1rem);
|
|
22
|
+
font-size: 0.75rem;
|
|
23
|
+
color: var(--hc-primary-500, var(--shc-primary-500));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
label {
|
|
28
|
+
position: absolute;
|
|
29
|
+
left: 0.8rem;
|
|
30
|
+
top: 1rem;
|
|
31
|
+
transition: all 0.2s ease;
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
color: #666;
|
|
34
|
+
background-color: white;
|
|
35
|
+
padding: 0 0.2rem;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.hc-input-dropdown {
|
|
40
|
+
position: relative;
|
|
41
|
+
|
|
42
|
+
.dropdown-options {
|
|
43
|
+
list-style: none;
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding: 0;
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: calc(100% + 4px);
|
|
48
|
+
left: 0;
|
|
49
|
+
right: 0;
|
|
50
|
+
background: white;
|
|
51
|
+
border: 1px solid #ccc;
|
|
52
|
+
border-radius: 4px;
|
|
53
|
+
z-index: 10;
|
|
54
|
+
max-height: 200px;
|
|
55
|
+
overflow-y: auto;
|
|
56
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
|
57
|
+
|
|
58
|
+
li {
|
|
59
|
+
padding: 0.6rem 0.8rem;
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
|
|
62
|
+
&:hover {
|
|
63
|
+
background-color: #f5f5f5;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Component, Input, HostListener } from '@angular/core';
|
|
2
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'hc-input-dropdown',
|
|
6
|
+
templateUrl: './hc-input-dropdown.component.html',
|
|
7
|
+
styleUrls: ['./hc-input-dropdown.component.scss'],
|
|
8
|
+
imports: [ReactiveFormsModule],
|
|
9
|
+
standalone: true
|
|
10
|
+
})
|
|
11
|
+
export class HcInputDropdownComponent {
|
|
12
|
+
@Input() control = new FormControl('');
|
|
13
|
+
@Input() label = 'Escolha uma opção';
|
|
14
|
+
@Input() id = 'input-dropdown';
|
|
15
|
+
@Input() options: string[] = [];
|
|
16
|
+
|
|
17
|
+
filteredOptions: string[] = [];
|
|
18
|
+
showOptions = false;
|
|
19
|
+
|
|
20
|
+
ngOnInit() {
|
|
21
|
+
this.filteredOptions = this.options;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
filterOptions() {
|
|
25
|
+
const value = this.control.value?.toLowerCase() || '';
|
|
26
|
+
this.filteredOptions = this.options.filter(option =>
|
|
27
|
+
option.toLowerCase().includes(value)
|
|
28
|
+
);
|
|
29
|
+
this.showOptions = true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
selectOption(option: string) {
|
|
33
|
+
this.control.setValue(option);
|
|
34
|
+
this.showOptions = false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@HostListener('document:click', ['$event'])
|
|
38
|
+
handleClickOutside(event: MouseEvent) {
|
|
39
|
+
const target = event.target as HTMLElement;
|
|
40
|
+
if (!target.closest('.hc-input-dropdown')) {
|
|
41
|
+
this.showOptions = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
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,4 +1,9 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of honey-core
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
export * from './lib/honey-core.service';
|
|
2
6
|
export * from './lib/honey-core.component';
|
|
3
7
|
export * from './lib/components/button/button.component';
|
|
4
8
|
export * from './lib/components/input/input-floating-label.component';
|
|
9
|
+
export * from './lib/components/input-dropdown/hc-input-dropdown.component';
|
|
@@ -0,0 +1,40 @@
|
|
|
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': 'var(--hc-primary-500)',
|
|
11
|
+
'--hc-primary-600': 'var(--hc-primary-600)',
|
|
12
|
+
'--hc-primary-700': 'var(--hc-primary-700)',
|
|
13
|
+
}}
|
|
14
|
+
/>
|
|
15
|
+
<ColorItem
|
|
16
|
+
title="theme.color.secondary"
|
|
17
|
+
subtitle="Honey Core Secondary"
|
|
18
|
+
colors={{
|
|
19
|
+
'--hc-secondary-500': 'var(--hc-secondary-500)',
|
|
20
|
+
'--hc-secondary-600': 'var(--hc-secondary-600)',
|
|
21
|
+
'--hc-secondary-700': 'var(--hc-secondary-700)',
|
|
22
|
+
}}
|
|
23
|
+
/>
|
|
24
|
+
<ColorItem
|
|
25
|
+
title="theme.color.brown"
|
|
26
|
+
subtitle="Honey Core Secondary"
|
|
27
|
+
colors={{
|
|
28
|
+
'--hc-brown-500': 'var(--hc-brown-500)',
|
|
29
|
+
'--hc-brown-600': 'var(--hc-brown-600)',
|
|
30
|
+
}}
|
|
31
|
+
/>
|
|
32
|
+
<ColorItem
|
|
33
|
+
title="theme.color.greyscale"
|
|
34
|
+
subtitle="Some of the greys"
|
|
35
|
+
colors={{
|
|
36
|
+
'--hc-text-strong': 'var(--hc-text-strong)',
|
|
37
|
+
'--hc-text-light': 'var(--hc-text-light)',
|
|
38
|
+
}}
|
|
39
|
+
/>
|
|
40
|
+
</ColorPalette>
|
|
@@ -0,0 +1,7 @@
|
|
|
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. 🐝
|
|
@@ -0,0 +1,80 @@
|
|
|
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 }: { text: string; [key: string]: any }) => ({
|
|
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
|
+
style: 's-solid',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const PrimaryDots: Story = {
|
|
35
|
+
args: {
|
|
36
|
+
style: 's-solid',
|
|
37
|
+
size: 'w-stretch',
|
|
38
|
+
loading: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const PrimaryDisabled: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
...Primary.args,
|
|
45
|
+
disabled: true,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const SecondarySolid: Story = {
|
|
50
|
+
args: {
|
|
51
|
+
style: 's-solid',
|
|
52
|
+
color: 'c-secondary',
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Hollow: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
style: 's-hollow',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const Plain: Story = {
|
|
63
|
+
args: {
|
|
64
|
+
style: 's-plain',
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const Small: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
...Primary.args,
|
|
71
|
+
size: 'h-small',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const Stretch: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
...Primary.args,
|
|
78
|
+
size: 'w-stretch',
|
|
79
|
+
},
|
|
80
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
|
|
2
|
+
import { ReactiveFormsModule, FormControl } from '@angular/forms';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { HcInputDropdownComponent } from '../lib/components/input-dropdown/hc-input-dropdown.component';
|
|
5
|
+
|
|
6
|
+
type Story = StoryObj<HcInputDropdownComponent>;
|
|
7
|
+
|
|
8
|
+
const meta: Meta<HcInputDropdownComponent> = {
|
|
9
|
+
title: 'Form/Input Dropdown',
|
|
10
|
+
component: HcInputDropdownComponent,
|
|
11
|
+
decorators: [
|
|
12
|
+
moduleMetadata({
|
|
13
|
+
declarations: [],
|
|
14
|
+
imports: [CommonModule, ReactiveFormsModule],
|
|
15
|
+
}),
|
|
16
|
+
],
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
argTypes: {
|
|
19
|
+
label: { control: { type: 'text' } },
|
|
20
|
+
options: {
|
|
21
|
+
control: {
|
|
22
|
+
type: 'object', // 'array' não é mais permitido diretamente
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
export const Default: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
label: 'Fruta favorita',
|
|
33
|
+
options: ['Banana', 'Maçã', 'Uva', 'Abacaxi'],
|
|
34
|
+
control: new FormControl(''),
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/angular';
|
|
2
|
+
import { InputFloatingLabelComponent } from '../lib/components/input/input-floating-label.component';
|
|
3
|
+
import { UntypedFormControl } from '@angular/forms';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<InputFloatingLabelComponent> = {
|
|
6
|
+
title: 'Form/Input Floating Label',
|
|
7
|
+
component: InputFloatingLabelComponent,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
render: (args: InputFloatingLabelComponent) => ({
|
|
10
|
+
props: args,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<InputFloatingLabelComponent>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
label: 'Nome completo',
|
|
21
|
+
id: 'nome',
|
|
22
|
+
required: true,
|
|
23
|
+
control: new UntypedFormControl('text-stories'),
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
$hcButtonBorderRadius : 12px !default;
|
|
2
|
+
$hcButtonFontSize : 14px !default;
|
|
3
|
+
$hcButtonFontWeight : normal !default;
|
|
4
|
+
$hcButtonPadding : 24px !default;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Applies colors to the button
|
|
8
|
+
*/
|
|
9
|
+
@mixin colorButton($color, $background, $border) {
|
|
10
|
+
color : $color;
|
|
11
|
+
background : $background;
|
|
12
|
+
border-color : $border;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
@mixin hcTypography($size, $color, $weight: normal) {
|
|
19
|
+
font-size : $size;
|
|
20
|
+
color : $color;
|
|
21
|
+
font-weight : $weight;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
@mixin flex($justify, $align: center) {
|
|
28
|
+
display : flex;
|
|
29
|
+
align-items : $align;
|
|
30
|
+
justify-content : $justify;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Base shared properties for hc-button styles
|
|
35
|
+
*/
|
|
36
|
+
%hc-button {
|
|
37
|
+
--color-button : var(--color);
|
|
38
|
+
--color-button-hover : var(--hover-color);
|
|
39
|
+
--width : fit-content;
|
|
40
|
+
--height : 36px;
|
|
41
|
+
--h-padding : #{$hcButtonPadding};
|
|
42
|
+
|
|
43
|
+
@include flex(center);
|
|
44
|
+
@include hcTypography($hcButtonFontSize, var(--color-button), $hcButtonFontWeight);
|
|
45
|
+
gap : 8px;
|
|
46
|
+
box-sizing : border-box;
|
|
47
|
+
width : var(--width);
|
|
48
|
+
height : var(--height);
|
|
49
|
+
padding : 0px var(--h-padding);
|
|
50
|
+
white-space : nowrap;
|
|
51
|
+
outline : none;
|
|
52
|
+
border : 1px solid transparent;
|
|
53
|
+
border-radius : $hcButtonBorderRadius;
|
|
54
|
+
transition : background .2s, color .2s, box-shadow .2s;
|
|
55
|
+
cursor : pointer;
|
|
56
|
+
|
|
57
|
+
&:disabled {
|
|
58
|
+
@include colorButton(var(--hc-disabled-text, var(--shc-disabled-text)), var(--hc-disabled-bg, var(--shc-disabled-bg)), var(--hc-disabled-bg, var(--shc-disabled-bg)));
|
|
59
|
+
cursor : not-allowed;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Base colors
|
|
65
|
+
*/
|
|
66
|
+
.hc-button {
|
|
67
|
+
&.c-initial {
|
|
68
|
+
--color-button : var(--hc-text-strong, var(--shc-text-strong));
|
|
69
|
+
--color-button-hover : var(--hc-text-strong, var(--shc-text-strong));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&.c-primary {
|
|
73
|
+
--color-button : var(--hc-background-primary, var(--shc-background-primary));
|
|
74
|
+
--color-button-hover : var(--hc-background-primary-hover, var(--shc-background-primary-hover));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.c-secondary {
|
|
78
|
+
color : var(--hc-brown-600, var(--shc-brown-600)) !important;
|
|
79
|
+
--color-button : var(--hc-background-secondary, var(--shc-background-secondary));
|
|
80
|
+
--color-button-hover : var(--hc-background-secondary-hover, var(--shc-background-secondary-hover));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Solid colored background button
|
|
87
|
+
*/
|
|
88
|
+
.hc-button.s-solid {
|
|
89
|
+
@extend %hc-button;
|
|
90
|
+
@include colorButton(var(--hc-background-main, var(--shc-background-main)), var(--color-button), transparent);
|
|
91
|
+
|
|
92
|
+
&:not(:disabled):hover {
|
|
93
|
+
background : var(--color-button-hover);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Hollow button with colored border and text
|
|
99
|
+
*/
|
|
100
|
+
.hc-button.s-hollow {
|
|
101
|
+
@extend %hc-button;
|
|
102
|
+
@include colorButton(var(--color-button), transparent, var(--color-button));
|
|
103
|
+
|
|
104
|
+
&:not(:disabled):hover {
|
|
105
|
+
@include colorButton(var(--hc-background-main, var(--shc-background-main)), var(--color-button), transparent);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&:disabled {
|
|
109
|
+
background : transparent;
|
|
110
|
+
color : var(--hc-text-light, var(--shc-text-light));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Text button
|
|
116
|
+
*/
|
|
117
|
+
.hc-button.s-plain {
|
|
118
|
+
--height : 28px;
|
|
119
|
+
--h-padding : 16px;
|
|
120
|
+
|
|
121
|
+
@extend %hc-button;
|
|
122
|
+
@include colorButton(var(--color-button), transparent, transparent);
|
|
123
|
+
|
|
124
|
+
&:not(:disabled):hover {
|
|
125
|
+
@include colorButton(var(--color-button-hover), transparent, transparent);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:disabled {
|
|
129
|
+
@include colorButton(var(--hc-button-disabled-foreground, var(--shc-text-light)), transparent, transparent);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* hc-button width classes
|
|
135
|
+
*/
|
|
136
|
+
.hc-button {
|
|
137
|
+
&.v-underlined {
|
|
138
|
+
text-decoration : underline;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&.h-small {
|
|
142
|
+
--height : 32px;
|
|
143
|
+
--h-padding : 16px;
|
|
144
|
+
font-size : 12px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&.w-stretch {
|
|
148
|
+
--width : 100%;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Overwrite buttons style on dark mode
|
|
154
|
+
*/
|
|
155
|
+
:root body[hc-theme='dark'] {
|
|
156
|
+
.s-solid {
|
|
157
|
+
&:disabled {
|
|
158
|
+
background : hsla(var(--hc-primary-500-hsl), 0.5);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.hc-primary {
|
|
163
|
+
&:disabled {
|
|
164
|
+
@include colorButton(hsla(var(--hc-primary-400-hsl), 0.5), transparent, hsla(var(--hc-primary-400-hsl), 0.5));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.hc-button.s-solid {
|
|
169
|
+
&:disabled {
|
|
170
|
+
background : hsla(var(--color-button-hsl), 0.5);
|
|
171
|
+
border-color : transparent;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--shc-primary-500 : #FF7A00;
|
|
3
|
+
--shc-primary-600 : #E86B00;
|
|
4
|
+
--shc-primary-700 : #CC5D00;
|
|
5
|
+
--shc-secondary-500 : #FFC857;
|
|
6
|
+
--shc-secondary-600 : #f7a838;
|
|
7
|
+
--shc-secondary-700 : #d68d2a;
|
|
8
|
+
--shc-brown-500 : #95570e;
|
|
9
|
+
--shc-brown-600 : #753c00;
|
|
10
|
+
--shc-text-strong : #2E282A;
|
|
11
|
+
--shc-text-light : #6C757D;
|
|
12
|
+
--shc-text-white : #FFFFFF;
|
|
13
|
+
|
|
14
|
+
--shc-background-main : #f4f4f4;
|
|
15
|
+
--shc-disabled-bg : #c7c7c7;
|
|
16
|
+
--shc-disabled-text : #6C757D;
|
|
17
|
+
--shc-background-primary : var(--shc-primary-500);
|
|
18
|
+
--shc-background-primary-hover : var(--shc-primary-600);
|
|
19
|
+
--shc-background-secondary : var(--shc-secondary-500);
|
|
20
|
+
--shc-background-secondary-hover : var(--shc-secondary-600);
|
|
21
|
+
--shc-background-linear : linear-gradient(90deg, var(--shc-disabled-bg), var(--shc-secondary-600));
|
|
22
|
+
|
|
23
|
+
--hc-primary-500 : var(--shc-primary-500);
|
|
24
|
+
--hc-primary-600 : var(--shc-primary-600);
|
|
25
|
+
--hc-primary-700 : var(--shc-primary-700);
|
|
26
|
+
--hc-secondary-500 : var(--shc-secondary-500);
|
|
27
|
+
--hc-secondary-600 : var(--shc-secondary-600);
|
|
28
|
+
--hc-secondary-700 : var(--shc-secondary-700);
|
|
29
|
+
--hc-brown-500 : var(--shc-brown-500);
|
|
30
|
+
--hc-brown-600 : var(--shc-brown-600);
|
|
31
|
+
--hc-text-strong : var(--shc-text-strong);
|
|
32
|
+
--hc-text-light : var(--shc-text-light);
|
|
33
|
+
--hc-text-white : var(--shc-text-white);
|
|
34
|
+
|
|
35
|
+
--hc-background-main : var(--shc-background-main);
|
|
36
|
+
--hc-disabled-bg : var(--shc-disabled-bg);
|
|
37
|
+
--hc-disabled-text : var(--shc-disabled-text);
|
|
38
|
+
--hc-background-primary : var(--shc-background-primary);
|
|
39
|
+
--hc-background-primary-hover : var(--shc-background-primary-hover);
|
|
40
|
+
--hc-background-secondary : var(--shc-background-secondary);
|
|
41
|
+
--hc-background-secondary-hover : var(--shc-background-secondary-hover);
|
|
42
|
+
--hc-background-linear : var(--shc-background-linear);
|
|
43
|
+
}
|
|
@@ -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/lib",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"inlineSources": true,
|
|
10
|
+
"types": []
|
|
11
|
+
},
|
|
12
|
+
"exclude": [
|
|
13
|
+
"**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -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
|
+
"jasmine"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"**/*.spec.ts",
|
|
13
|
+
"**/*.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|