@justeattakeaway/pie-form-label 0.4.0 → 0.5.0
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/dist/index.d.ts +3 -0
- package/dist/index.js +11 -8
- package/dist/react.d.ts +3 -0
- package/package.json +2 -2
- package/src/index.ts +5 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { unsafeCSS as m, LitElement as b, html as s, nothing as p } from "lit";
|
|
2
2
|
import { property as f } from "lit/decorators.js";
|
|
3
|
+
function d(t, e) {
|
|
4
|
+
customElements.get(t) ? console.warn(`PIE Web Component: "${t}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(t, e);
|
|
5
|
+
}
|
|
3
6
|
const g = `.c-formLabel{--form-label-font-size: calc(var(--dt-font-size-14) * 1px);--form-label-line-height: calc(var(--dt-font-size-14-line-height) * 1px);--form-label-font-weight: var(--dt-font-weight-bold);--form-label-color: var(--dt-color-content-default);display:flex;justify-content:space-between;gap:var(--dt-spacing-d);color:var(--form-label-color);font-size:var(--form-label-font-size);line-height:var(--form-label-line-height);font-weight:var(--form-label-font-weight);margin-block-end:var(--dt-spacing-a)}.c-formLabel-optional,.c-formLabel-trailing{color:var(--dt-color-content-subdued);font-weight:var(--dt-font-weight-regular)}.c-formLabel-optional{margin-inline-start:var(--dt-spacing-b)}.c-formLabel-trailing{flex-shrink:0;white-space:var(--dt-spacing-d)}
|
|
4
7
|
`;
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
(i = a
|
|
8
|
-
return l &&
|
|
8
|
+
var h = Object.defineProperty, v = Object.getOwnPropertyDescriptor, c = (t, e, n, l) => {
|
|
9
|
+
for (var o = l > 1 ? void 0 : l ? v(e, n) : e, a = t.length - 1, i; a >= 0; a--)
|
|
10
|
+
(i = t[a]) && (o = (l ? i(e, n, o) : i(o)) || o);
|
|
11
|
+
return l && o && h(e, n, o), o;
|
|
9
12
|
};
|
|
10
|
-
const
|
|
13
|
+
const u = "pie-form-label";
|
|
11
14
|
class r extends b {
|
|
12
15
|
render() {
|
|
13
16
|
const {
|
|
14
17
|
optional: e,
|
|
15
|
-
trailing:
|
|
18
|
+
trailing: n
|
|
16
19
|
} = this;
|
|
17
20
|
return s`
|
|
18
21
|
<label
|
|
@@ -23,7 +26,7 @@ class r extends b {
|
|
|
23
26
|
<slot></slot>
|
|
24
27
|
${e ? s`<span class="c-formLabel-optional">${e}</span>` : p}
|
|
25
28
|
</div>
|
|
26
|
-
${
|
|
29
|
+
${n ? s`<span class="c-formLabel-trailing">${n}</span>` : p}
|
|
27
30
|
</label>`;
|
|
28
31
|
}
|
|
29
32
|
}
|
|
@@ -37,7 +40,7 @@ c([
|
|
|
37
40
|
c([
|
|
38
41
|
f({ type: String })
|
|
39
42
|
], r.prototype, "trailing", 2);
|
|
40
|
-
|
|
43
|
+
d(u, r);
|
|
41
44
|
export {
|
|
42
45
|
r as PieFormLabel
|
|
43
46
|
};
|
package/dist/react.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ export declare interface FormLabelProps {
|
|
|
20
20
|
|
|
21
21
|
export declare const PieFormLabel: ReactWebComponent<PieFormLabel_2, {}>;
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @tagname pie-form-label
|
|
25
|
+
*/
|
|
23
26
|
declare class PieFormLabel_2 extends LitElement implements FormLabelProps {
|
|
24
27
|
for?: string;
|
|
25
28
|
optional?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-form-label",
|
|
3
3
|
"description": "PIE Design System Form Label built using Web Components",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@justeattakeaway/pie-components-config": "0.4.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@justeattakeaway/pie-webc-core": "0.
|
|
34
|
+
"@justeattakeaway/pie-webc-core": "0.11.0"
|
|
35
35
|
},
|
|
36
36
|
"volta": {
|
|
37
37
|
"extends": "../../../package.json"
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LitElement, html, nothing, unsafeCSS,
|
|
3
3
|
} from 'lit';
|
|
4
|
+
import { defineCustomElement } from '@justeattakeaway/pie-webc-core';
|
|
4
5
|
import { property } from 'lit/decorators.js';
|
|
5
6
|
import styles from './form-label.scss?inline';
|
|
6
7
|
import { FormLabelProps } from './defs';
|
|
@@ -10,6 +11,9 @@ export * from './defs';
|
|
|
10
11
|
|
|
11
12
|
const componentSelector = 'pie-form-label';
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @tagname pie-form-label
|
|
16
|
+
*/
|
|
13
17
|
export class PieFormLabel extends LitElement implements FormLabelProps {
|
|
14
18
|
@property({ type: String, reflect: true })
|
|
15
19
|
public for?: string;
|
|
@@ -43,7 +47,7 @@ export class PieFormLabel extends LitElement implements FormLabelProps {
|
|
|
43
47
|
static styles = unsafeCSS(styles);
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
defineCustomElement(componentSelector, PieFormLabel);
|
|
47
51
|
|
|
48
52
|
declare global {
|
|
49
53
|
interface HTMLElementTagNameMap {
|