@aquera/nile-elements 0.0.6-5 → 0.0.6-6
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/nile-badge/index.d.ts +1 -37
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/index.js +1 -120
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/index.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.css.d.ts +12 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.css.js +63 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.css.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.d.ts +45 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.js +80 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-badge/nile-badge.js.map +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.d.ts +2 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js +1 -0
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- 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 +179 -172
- package/dist/nile-badge/index.cjs.js +1 -1
- package/dist/nile-badge/index.cjs.js.map +1 -1
- package/dist/nile-badge/index.esm.js +1 -55
- package/dist/nile-badge/nile-badge.cjs.js +2 -0
- package/dist/nile-badge/nile-badge.cjs.js.map +1 -0
- package/dist/nile-badge/nile-badge.css.cjs.js +2 -0
- package/dist/nile-badge/nile-badge.css.cjs.js.map +1 -0
- package/dist/nile-badge/nile-badge.css.esm.js +51 -0
- package/dist/nile-badge/nile-badge.esm.js +12 -0
- package/dist/nile-switcher/nile-switcher.cjs.js +1 -1
- package/dist/nile-switcher/nile-switcher.cjs.js.map +1 -1
- package/dist/nile-switcher/nile-switcher.esm.js +14 -14
- package/dist/src/nile-badge/index.d.ts +1 -37
- package/dist/src/nile-badge/index.js +1 -120
- package/dist/src/nile-badge/index.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.css.d.ts +12 -0
- package/dist/src/nile-badge/nile-badge.css.js +63 -0
- package/dist/src/nile-badge/nile-badge.css.js.map +1 -0
- package/dist/src/nile-badge/nile-badge.d.ts +45 -0
- package/dist/src/nile-badge/nile-badge.js +80 -0
- package/dist/src/nile-badge/nile-badge.js.map +1 -0
- package/dist/src/nile-switcher/nile-switcher.d.ts +2 -0
- package/dist/src/nile-switcher/nile-switcher.js +1 -0
- package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-badge/index.ts +1 -119
- package/src/nile-badge/nile-badge.css.ts +64 -0
- package/src/nile-badge/nile-badge.ts +94 -0
- package/src/nile-switcher/nile-switcher.ts +3 -0
package/package.json
CHANGED
package/src/nile-badge/index.ts
CHANGED
@@ -1,119 +1 @@
|
|
1
|
-
|
2
|
-
import { customElement, property } from 'lit/decorators.js';
|
3
|
-
import { classMap } from 'lit/directives/class-map.js';
|
4
|
-
/**
|
5
|
-
* An nile-badge element.
|
6
|
-
*
|
7
|
-
* @fires count-changed - Indicates when the count changes
|
8
|
-
* @slot - This element has a slot
|
9
|
-
* @csspart button - The button
|
10
|
-
*/
|
11
|
-
@customElement('nile-badge')
|
12
|
-
export class NileBadge extends LitElement {
|
13
|
-
static override styles = css`
|
14
|
-
:host {
|
15
|
-
display: block;
|
16
|
-
}
|
17
|
-
.nds-badge {
|
18
|
-
width: 24px;
|
19
|
-
height: 24px;
|
20
|
-
border-radius: 9rem;
|
21
|
-
font-size: 14px;
|
22
|
-
justify-content: space-around;
|
23
|
-
font-weight: bold;
|
24
|
-
display: flex;
|
25
|
-
background-color: rgb(221, 221, 221);
|
26
|
-
flex-wrap: nowrap;
|
27
|
-
align-items: center;
|
28
|
-
color: var(--nile-colors-dark-900);
|
29
|
-
}
|
30
|
-
|
31
|
-
.nds-badge:hover {
|
32
|
-
background: rgba(0, 94, 166, 0.1);
|
33
|
-
}
|
34
|
-
|
35
|
-
.nds-badge__link {
|
36
|
-
font-family: var(--nile-font-family-sans-serif);
|
37
|
-
font-style: normal;
|
38
|
-
font-weight: 400;
|
39
|
-
font-size: 14px;
|
40
|
-
line-height: 1;
|
41
|
-
letter-spacing: 0.2px;
|
42
|
-
text-decoration: none;
|
43
|
-
font-size: 12px;
|
44
|
-
}
|
45
|
-
|
46
|
-
.nds-badge__link:hover {
|
47
|
-
color: var(--nile-colors-dark-900);
|
48
|
-
}
|
49
|
-
|
50
|
-
.nds-badge--active {
|
51
|
-
background-color: var(--nile-colors-primary-700);
|
52
|
-
color: var(--nile-colors-neutral-100);
|
53
|
-
}
|
54
|
-
|
55
|
-
.nds-badge--active:hover {
|
56
|
-
background-color: var(---nile-colors-primary-700);
|
57
|
-
}
|
58
|
-
|
59
|
-
.nds-badge__icon {
|
60
|
-
margin-bottom: 0;
|
61
|
-
height: 14px;
|
62
|
-
}
|
63
|
-
`;
|
64
|
-
|
65
|
-
/**
|
66
|
-
* Button Lab
|
67
|
-
*/
|
68
|
-
@property()
|
69
|
-
name = 0;
|
70
|
-
|
71
|
-
/**
|
72
|
-
* Button Lab
|
73
|
-
*/
|
74
|
-
@property()
|
75
|
-
icon: string = '';
|
76
|
-
|
77
|
-
/**
|
78
|
-
* Button Lab
|
79
|
-
*/
|
80
|
-
@property()
|
81
|
-
active: boolean = false;
|
82
|
-
|
83
|
-
get buttonClassMap() {
|
84
|
-
return {
|
85
|
-
'nds-badge--active': this.active,
|
86
|
-
};
|
87
|
-
}
|
88
|
-
|
89
|
-
/**
|
90
|
-
* Button Lab
|
91
|
-
*/
|
92
|
-
@property()
|
93
|
-
href = '/';
|
94
|
-
|
95
|
-
_hasSlotContent(slotName: string) {
|
96
|
-
const slot = this.querySelector(`slot[name=${slotName}]`);
|
97
|
-
console.log(slot, 'slot');
|
98
|
-
}
|
99
|
-
|
100
|
-
override render() {
|
101
|
-
const { name, icon, href } = this;
|
102
|
-
const hrefPath = `/${href}`;
|
103
|
-
return html`
|
104
|
-
<a class="nds-badge ${classMap(this.buttonClassMap)}">
|
105
|
-
<span class="nds-badge__link">${this.name}</span>
|
106
|
-
</a>
|
107
|
-
`;
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
declare global {
|
112
|
-
interface HTMLElementTagNameMap {
|
113
|
-
'nile-badge': NileBadge;
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
// <span class="nds-badge__icon">
|
118
|
-
// <nile-icon name="${this.icon}" size="14" color="#000"></nile-icon>
|
119
|
-
// </span>
|
1
|
+
export { NileBadge } from './nile-badge';
|
@@ -0,0 +1,64 @@
|
|
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
|
+
* Tag CSS
|
12
|
+
*/
|
13
|
+
export const styles = css`
|
14
|
+
:host {
|
15
|
+
}
|
16
|
+
|
17
|
+
.badge {
|
18
|
+
padding: 0 4px;
|
19
|
+
border-radius: 4px;
|
20
|
+
height: 16px;
|
21
|
+
font-size: 10.24px;
|
22
|
+
display: inline-flex;
|
23
|
+
align-items: center;/
|
24
|
+
justify-content: center;
|
25
|
+
}
|
26
|
+
|
27
|
+
.badge__content {
|
28
|
+
font-family: Colfax-regular;
|
29
|
+
font-size: 10.24px;
|
30
|
+
font-style: normal;
|
31
|
+
font-weight: 400;
|
32
|
+
letter-spacing: 0.2px;
|
33
|
+
}
|
34
|
+
|
35
|
+
.badge--primary {
|
36
|
+
background: #005EA6;
|
37
|
+
}
|
38
|
+
|
39
|
+
.badge--success {
|
40
|
+
background: #A5F3E1;
|
41
|
+
}
|
42
|
+
|
43
|
+
.badge--normal {
|
44
|
+
background: #E5E9EB;
|
45
|
+
}
|
46
|
+
|
47
|
+
.badge--warning {
|
48
|
+
background: #F3E0A5;
|
49
|
+
}
|
50
|
+
|
51
|
+
.badge--error {
|
52
|
+
background: #F3A5AA;
|
53
|
+
}
|
54
|
+
|
55
|
+
.badge--info {
|
56
|
+
background: #A5D3F3;
|
57
|
+
}
|
58
|
+
|
59
|
+
.badge--rounded {
|
60
|
+
border-radius: 100px;
|
61
|
+
padding: 0 6px;
|
62
|
+
}
|
63
|
+
`;
|
64
|
+
export default [styles];
|
@@ -0,0 +1,94 @@
|
|
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 {
|
9
|
+
LitElement,
|
10
|
+
html,
|
11
|
+
property,
|
12
|
+
CSSResultArray,
|
13
|
+
TemplateResult,
|
14
|
+
} from 'lit-element';
|
15
|
+
import { styles } from './nile-badge.css';
|
16
|
+
import '../nile-icon-button/nile-icon-button';
|
17
|
+
import { classMap } from 'lit/directives/class-map.js';
|
18
|
+
import { customElement } from 'lit/decorators.js';
|
19
|
+
import NileElement from '../internal/nile-element';
|
20
|
+
import type { CSSResultGroup } from 'lit';
|
21
|
+
/**
|
22
|
+
* Nile icon component.
|
23
|
+
*
|
24
|
+
* @tag nile-badge
|
25
|
+
*
|
26
|
+
*/
|
27
|
+
|
28
|
+
/**
|
29
|
+
* @summary badges are used as labels to organize things or to indicate a selection.
|
30
|
+
* @status stable
|
31
|
+
*
|
32
|
+
* @dependency nile-icon-button
|
33
|
+
*
|
34
|
+
* @slot - The badge's content.
|
35
|
+
*
|
36
|
+
* @event nile-remove - Emitted when the remove button is activated.
|
37
|
+
*
|
38
|
+
* @csspart base - The component's base wrapper.
|
39
|
+
* @csspart content - The badge's content.
|
40
|
+
* @csspart remove-button - The badge's remove button, an `<nile-icon-button>`.
|
41
|
+
* @csspart remove-button__base - The remove button's exported `base` part.
|
42
|
+
*/
|
43
|
+
|
44
|
+
@customElement('nile-badge')
|
45
|
+
export class NileBadge extends NileElement {
|
46
|
+
static styles: CSSResultGroup = styles;
|
47
|
+
|
48
|
+
/** The badge's theme variant. */
|
49
|
+
@property({ reflect: true }) variant:
|
50
|
+
| 'primary'
|
51
|
+
| 'success'
|
52
|
+
| 'normal'
|
53
|
+
| 'warning'
|
54
|
+
| 'error'
|
55
|
+
| 'info' = 'normal';
|
56
|
+
|
57
|
+
/** Draws a pill-style badge with rounded edges. */
|
58
|
+
@property({ type: Boolean, reflect: true }) rounded = false;
|
59
|
+
|
60
|
+
|
61
|
+
render() {
|
62
|
+
return html`
|
63
|
+
<span
|
64
|
+
part="base"
|
65
|
+
class=${classMap({
|
66
|
+
badge: true,
|
67
|
+
|
68
|
+
// Types
|
69
|
+
'badge--primary': this.variant === 'primary',
|
70
|
+
'badge--success': this.variant === 'success',
|
71
|
+
'badge--normal': this.variant === 'normal',
|
72
|
+
'badge--warning': this.variant === 'warning',
|
73
|
+
'badge--error': this.variant === 'error',
|
74
|
+
'badge--info': this.variant === 'info',
|
75
|
+
'badge--rounded': this.rounded,
|
76
|
+
})}
|
77
|
+
>
|
78
|
+
|
79
|
+
|
80
|
+
<slot part="content" class="badge__content"></slot>
|
81
|
+
|
82
|
+
|
83
|
+
</span>
|
84
|
+
`;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
export default NileBadge;
|
89
|
+
|
90
|
+
declare global {
|
91
|
+
interface HTMLElementTagNameMap {
|
92
|
+
'nile-badge': NileBadge;
|
93
|
+
}
|
94
|
+
}
|
@@ -24,6 +24,8 @@ import { classMap } from 'lit/directives/class-map.js';
|
|
24
24
|
*
|
25
25
|
|
26
26
|
* @event nile-change - Emitted when the control's value changes.
|
27
|
+
* @event nile-switch - Emitted when the nile component is being switched.
|
28
|
+
|
27
29
|
*/
|
28
30
|
|
29
31
|
export interface switchconfig {
|
@@ -131,6 +133,7 @@ export class NileSwitcher extends NileElement {
|
|
131
133
|
...this.nileSwitchConfig,
|
132
134
|
toggleSwitch: !this.nileSwitchConfig.toggleSwitch,
|
133
135
|
};
|
136
|
+
this.emit('nile-switch', { config: this.nileSwitchConfig });
|
134
137
|
}
|
135
138
|
|
136
139
|
singleFieldSwitcher(
|