@aquera/nile-elements 0.0.4-5 → 0.0.4-7
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/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.d.ts +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.js +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/index.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.js +66 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.d.ts +39 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.js +87 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-link/nile-link.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +81 -13
- package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
- package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
- package/dist/nile-date-picker/nile-date-picker.esm.js +1 -1
- package/dist/nile-link/index.cjs.js +2 -0
- package/dist/nile-link/index.cjs.js.map +1 -0
- package/dist/nile-link/index.esm.js +1 -0
- package/dist/nile-link/nile-link.cjs.js +2 -0
- package/dist/nile-link/nile-link.cjs.js.map +1 -0
- package/dist/nile-link/nile-link.css.cjs.js +2 -0
- package/dist/nile-link/nile-link.css.cjs.js.map +1 -0
- package/dist/nile-link/nile-link.css.esm.js +54 -0
- package/dist/nile-link/nile-link.esm.js +16 -0
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.cjs.js.map +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/nile-date-picker/nile-date-picker.js +1 -1
- package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
- package/dist/src/nile-link/index.d.ts +1 -0
- package/dist/src/nile-link/index.js +2 -0
- package/dist/src/nile-link/index.js.map +1 -0
- package/dist/src/nile-link/nile-link.css.d.ts +12 -0
- package/dist/src/nile-link/nile-link.css.js +66 -0
- package/dist/src/nile-link/nile-link.css.js.map +1 -0
- package/dist/src/nile-link/nile-link.d.ts +39 -0
- package/dist/src/nile-link/nile-link.js +87 -0
- package/dist/src/nile-link/nile-link.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/nile-date-picker/nile-date-picker.ts +1 -1
- package/src/nile-link/index.ts +1 -0
- package/src/nile-link/nile-link.css.ts +68 -0
- package/src/nile-link/nile-link.ts +91 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
@@ -29,3 +29,4 @@ export { NileErrorMessage } from './nile-error-message';
|
|
29
29
|
export { NileFormErrorMessage } from './nile-form-error-message';
|
30
30
|
export { NileFormHelpText } from './nile-form-help-text';
|
31
31
|
export { NileCalendar } from './nile-calendar';
|
32
|
+
export { NileLink} from './nile-link';
|
@@ -0,0 +1 @@
|
|
1
|
+
export { NileLink} from './nile-link';
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import { css } from 'lit-element';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Link CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
}
|
16
|
+
|
17
|
+
.link {
|
18
|
+
display: inline-flex;
|
19
|
+
align-items: center;
|
20
|
+
justify-content: center;
|
21
|
+
text-align: center;
|
22
|
+
user-select: none;
|
23
|
+
white-space: nowrap;
|
24
|
+
padding: 12px;
|
25
|
+
gap: 8px;
|
26
|
+
}
|
27
|
+
|
28
|
+
.link__label {
|
29
|
+
color: #005ea6;
|
30
|
+
text-align: center;
|
31
|
+
font-family: Colfax-regular;
|
32
|
+
font-size: 14px;
|
33
|
+
font-style: normal;
|
34
|
+
font-weight: 400;
|
35
|
+
line-height: 14px;
|
36
|
+
letter-spacing: 0.2px;
|
37
|
+
}
|
38
|
+
|
39
|
+
.link--disabled {
|
40
|
+
color: rgba(0, 94, 166, 0.5);
|
41
|
+
cursor: not-allowed;
|
42
|
+
opacity: 0.6;
|
43
|
+
}
|
44
|
+
|
45
|
+
.link:not(.link--disabled):not(.link__button):hover {
|
46
|
+
color: #005291;
|
47
|
+
text-decoration-line: underline;
|
48
|
+
}
|
49
|
+
|
50
|
+
.link:not(.link--disabled):not(.link__button):active {
|
51
|
+
color: #002f53;
|
52
|
+
text-decoration-line: underline;
|
53
|
+
}
|
54
|
+
|
55
|
+
.link__button:hover {
|
56
|
+
color: #005291;
|
57
|
+
border-radius: 4px;
|
58
|
+
background: #f5f7f7;
|
59
|
+
}
|
60
|
+
|
61
|
+
.link__button:active {
|
62
|
+
color: #002f53;
|
63
|
+
border-radius: 4px;
|
64
|
+
background: rgba(0, 94, 166, 0.1);
|
65
|
+
}
|
66
|
+
`;
|
67
|
+
|
68
|
+
export default [styles];
|
@@ -0,0 +1,91 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright Aquera Inc 2023
|
3
|
+
*
|
4
|
+
* This source code is licensed under the BSD-3-Clause license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
import {LitElement, html, property, CSSResultArray, TemplateResult} from 'lit-element';
|
9
|
+
import { customElement, state } from 'lit/decorators.js';
|
10
|
+
import {styles} from './nile-link.css';
|
11
|
+
import { HasSlotController } from '../slot';
|
12
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
13
|
+
import { classMap } from 'lit/directives/class-map.js';
|
14
|
+
import NileElement from '../internal/nile-element';
|
15
|
+
import { watch } from '../internal/watch';
|
16
|
+
|
17
|
+
/**
|
18
|
+
* Nile icon component.
|
19
|
+
*
|
20
|
+
* @tag nile-link
|
21
|
+
*
|
22
|
+
*/
|
23
|
+
@customElement('nile-link')
|
24
|
+
export class NileLink extends NileElement {
|
25
|
+
|
26
|
+
/**
|
27
|
+
* The styles for Link
|
28
|
+
* @remarks If you are extending this class you can extend the base styles with super. Eg `return [super(), myCustomStyles]`
|
29
|
+
*/
|
30
|
+
public static get styles(): CSSResultArray {
|
31
|
+
return [styles];
|
32
|
+
}
|
33
|
+
|
34
|
+
private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');
|
35
|
+
|
36
|
+
@state() private hasFocus = false;
|
37
|
+
|
38
|
+
/** Disables the button. */
|
39
|
+
@property({ type: Boolean, reflect: true }) disabled = false;
|
40
|
+
|
41
|
+
@property({ type: Boolean }) button = false;
|
42
|
+
|
43
|
+
|
44
|
+
private handleBlur() {
|
45
|
+
this.hasFocus = false;
|
46
|
+
this.emit('nile-blur');
|
47
|
+
}
|
48
|
+
|
49
|
+
private handleFocus() {
|
50
|
+
this.hasFocus = true;
|
51
|
+
this.emit('nile-focus');
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Render method
|
56
|
+
* @slot This is a slot test
|
57
|
+
*/
|
58
|
+
public render(): TemplateResult {
|
59
|
+
return html`
|
60
|
+
<div
|
61
|
+
part="base"
|
62
|
+
class=${classMap({
|
63
|
+
link: true,
|
64
|
+
'link--disabled': this.disabled,
|
65
|
+
'link__button': this.button
|
66
|
+
})}
|
67
|
+
?disabled=${ifDefined(this.disabled)}
|
68
|
+
title=${this.title /* An empty title prevents browser validation tooltips from appearing on hover */}
|
69
|
+
aria-disabled=${this.disabled ? 'true' : 'false'}
|
70
|
+
tabindex=${this.disabled ? '-1' : '0'}
|
71
|
+
@blur=${this.handleBlur}
|
72
|
+
@focus=${this.handleFocus}
|
73
|
+
>
|
74
|
+
<slot name="prefix" part="prefix" class="link__prefix"></slot>
|
75
|
+
<slot part="label" class="link__label"></slot>
|
76
|
+
<slot name="suffix" part="suffix" class="link__suffix"></slot>
|
77
|
+
</div>
|
78
|
+
`;
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
/* #endregion */
|
83
|
+
}
|
84
|
+
|
85
|
+
export default NileLink;
|
86
|
+
|
87
|
+
declare global {
|
88
|
+
interface HTMLElementTagNameMap {
|
89
|
+
'nile-link': NileLink;
|
90
|
+
}
|
91
|
+
}
|