@momentum-design/components 0.16.9 → 0.16.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/browser/index.js +3 -0
- package/dist/browser/index.js.map +2 -2
- package/dist/components/labelandhelper/index.d.ts +9 -0
- package/dist/components/labelandhelper/index.js +6 -0
- package/dist/components/labelandhelper/labelandhelper.component.d.ts +72 -0
- package/dist/components/labelandhelper/labelandhelper.component.js +137 -0
- package/dist/components/labelandhelper/labelandhelper.constants.d.ts +19 -0
- package/dist/components/labelandhelper/labelandhelper.constants.js +21 -0
- package/dist/components/labelandhelper/labelandhelper.styles.d.ts +2 -0
- package/dist/components/labelandhelper/labelandhelper.styles.js +48 -0
- package/dist/components/labelandhelper/labelandhelper.types.d.ts +4 -0
- package/dist/components/labelandhelper/labelandhelper.types.js +1 -0
- package/dist/components/labelandhelper/labelandhelper.utils.d.ts +4 -0
- package/dist/components/labelandhelper/labelandhelper.utils.js +12 -0
- package/dist/components/text/fonts.styles.js +3 -0
- package/dist/custom-elements.json +906 -578
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +2 -1
- package/dist/react/labelandhelper/index.d.ts +11 -0
- package/dist/react/labelandhelper/index.js +20 -0
- package/dist/utils/mixins/NameMixin.d.ts +6 -0
- package/dist/utils/mixins/{LabelMixin.js → NameMixin.js} +6 -16
- package/dist/utils/mixins/ReadonlyMixin.d.ts +6 -0
- package/dist/utils/mixins/ReadonlyMixin.js +29 -0
- package/dist/utils/mixins/RequiredMixin.d.ts +6 -0
- package/dist/utils/mixins/RequiredMixin.js +29 -0
- package/dist/utils/mixins/ValueMixin.d.ts +6 -0
- package/dist/utils/mixins/ValueMixin.js +28 -0
- package/package.json +3 -2
- package/dist/utils/mixins/LabelMixin.d.ts +0 -7
package/dist/react/index.d.ts
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
export { default as Avatar } from './avatar';
|
2
|
-
export { default as Badge } from './badge';
|
3
2
|
export { default as AvatarButton } from './avatarbutton';
|
3
|
+
export { default as Badge } from './badge';
|
4
4
|
export { default as Bullet } from './bullet';
|
5
5
|
export { default as Button } from './button';
|
6
6
|
export { default as Buttonsimple } from './buttonsimple';
|
7
7
|
export { default as Divider } from './divider';
|
8
8
|
export { default as Icon } from './icon';
|
9
9
|
export { default as IconProvider } from './iconprovider';
|
10
|
+
export { default as LabelAndHelper } from './labelandhelper';
|
10
11
|
export { default as Marker } from './marker';
|
11
12
|
export { default as Presence } from './presence';
|
12
13
|
export { default as Text } from './text';
|
package/dist/react/index.js
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
export { default as Avatar } from './avatar';
|
2
|
-
export { default as Badge } from './badge';
|
3
2
|
export { default as AvatarButton } from './avatarbutton';
|
3
|
+
export { default as Badge } from './badge';
|
4
4
|
export { default as Bullet } from './bullet';
|
5
5
|
export { default as Button } from './button';
|
6
6
|
export { default as Buttonsimple } from './buttonsimple';
|
7
7
|
export { default as Divider } from './divider';
|
8
8
|
export { default as Icon } from './icon';
|
9
9
|
export { default as IconProvider } from './iconprovider';
|
10
|
+
export { default as LabelAndHelper } from './labelandhelper';
|
10
11
|
export { default as Marker } from './marker';
|
11
12
|
export { default as Presence } from './presence';
|
12
13
|
export { default as Text } from './text';
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import Component from '../../components/labelandhelper';
|
2
|
+
/**
|
3
|
+
* labelandhelper is a component that contains the label and helper/validation text
|
4
|
+
* that can be configured in various ways to suit different use cases (most of the input related components).
|
5
|
+
* It is used as an internal component and is not intended to be used directly by consumers.
|
6
|
+
*
|
7
|
+
* @tagname mdc-labelandhelper
|
8
|
+
*
|
9
|
+
*/
|
10
|
+
declare const reactWrapper: import("@lit/react").ReactWebComponent<Component, {}>;
|
11
|
+
export default reactWrapper;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { createComponent } from '@lit/react';
|
3
|
+
import Component from '../../components/labelandhelper';
|
4
|
+
import { TAG_NAME } from '../../components/labelandhelper/labelandhelper.constants';
|
5
|
+
/**
|
6
|
+
* labelandhelper is a component that contains the label and helper/validation text
|
7
|
+
* that can be configured in various ways to suit different use cases (most of the input related components).
|
8
|
+
* It is used as an internal component and is not intended to be used directly by consumers.
|
9
|
+
*
|
10
|
+
* @tagname mdc-labelandhelper
|
11
|
+
*
|
12
|
+
*/
|
13
|
+
const reactWrapper = createComponent({
|
14
|
+
tagName: TAG_NAME,
|
15
|
+
elementClass: Component,
|
16
|
+
react: React,
|
17
|
+
events: {},
|
18
|
+
displayName: 'LabelAndHelper',
|
19
|
+
});
|
20
|
+
export default reactWrapper;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { Constructor } from './index.types';
|
3
|
+
export interface NameMixinInterface {
|
4
|
+
name: string;
|
5
|
+
}
|
6
|
+
export declare const NameMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<NameMixinInterface> & T;
|
@@ -7,33 +7,23 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
9
|
};
|
10
|
-
import { nothing, html } from 'lit';
|
11
10
|
import { property } from 'lit/decorators.js';
|
12
|
-
export const
|
11
|
+
export const NameMixin = (superClass) => {
|
13
12
|
class InnerMixinClass extends superClass {
|
14
13
|
constructor() {
|
15
14
|
super(...arguments);
|
16
15
|
/**
|
17
|
-
*
|
16
|
+
* Indicates the name of the component group (ex: checkbox, radio group).
|
17
|
+
* They are used to group elements in a form together.
|
18
|
+
* @default ''
|
18
19
|
*/
|
19
|
-
this.
|
20
|
-
}
|
21
|
-
/**
|
22
|
-
* creates the label element when the label property is set.
|
23
|
-
* id is used to link the label with the input field.
|
24
|
-
* @returns void
|
25
|
-
*/
|
26
|
-
renderLabel() {
|
27
|
-
if (!this.label) {
|
28
|
-
return nothing;
|
29
|
-
}
|
30
|
-
return html `<label for="${this.id}" class='mdc-label'>${this.label}</label>`;
|
20
|
+
this.name = '';
|
31
21
|
}
|
32
22
|
}
|
33
23
|
__decorate([
|
34
24
|
property({ reflect: true, type: String }),
|
35
25
|
__metadata("design:type", Object)
|
36
|
-
], InnerMixinClass.prototype, "
|
26
|
+
], InnerMixinClass.prototype, "name", void 0);
|
37
27
|
// Cast return type to your mixin's interface intersected with the superClass type
|
38
28
|
return InnerMixinClass;
|
39
29
|
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { Constructor } from './index.types';
|
3
|
+
export interface ReadonlyMixinInterface {
|
4
|
+
readonly: boolean;
|
5
|
+
}
|
6
|
+
export declare const ReadonlyMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<ReadonlyMixinInterface> & T;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
+
};
|
10
|
+
import { property } from 'lit/decorators.js';
|
11
|
+
export const ReadonlyMixin = (superClass) => {
|
12
|
+
class InnerMixinClass extends superClass {
|
13
|
+
constructor() {
|
14
|
+
super(...arguments);
|
15
|
+
/**
|
16
|
+
* Indicates whether the component is readonly.
|
17
|
+
* When the component is readonly, it is not editable.
|
18
|
+
* @default false
|
19
|
+
*/
|
20
|
+
this.readonly = false;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
__decorate([
|
24
|
+
property({ reflect: true, type: Boolean }),
|
25
|
+
__metadata("design:type", Object)
|
26
|
+
], InnerMixinClass.prototype, "readonly", void 0);
|
27
|
+
// Cast return type to your mixin's interface intersected with the superClass type
|
28
|
+
return InnerMixinClass;
|
29
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { Constructor } from './index.types';
|
3
|
+
export interface RequiredMixinInterface {
|
4
|
+
required: boolean;
|
5
|
+
}
|
6
|
+
export declare const RequiredMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<RequiredMixinInterface> & T;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
+
};
|
10
|
+
import { property } from 'lit/decorators.js';
|
11
|
+
export const RequiredMixin = (superClass) => {
|
12
|
+
class InnerMixinClass extends superClass {
|
13
|
+
constructor() {
|
14
|
+
super(...arguments);
|
15
|
+
/**
|
16
|
+
* Indicates whether the component is required.
|
17
|
+
* When the component is required, it is a mandatory field.
|
18
|
+
* @default false
|
19
|
+
*/
|
20
|
+
this.required = false;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
__decorate([
|
24
|
+
property({ reflect: true, type: Boolean }),
|
25
|
+
__metadata("design:type", Object)
|
26
|
+
], InnerMixinClass.prototype, "required", void 0);
|
27
|
+
// Cast return type to your mixin's interface intersected with the superClass type
|
28
|
+
return InnerMixinClass;
|
29
|
+
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { LitElement } from 'lit';
|
2
|
+
import type { Constructor } from './index.types';
|
3
|
+
export interface ValueMixinInterface {
|
4
|
+
value: string;
|
5
|
+
}
|
6
|
+
export declare const ValueMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<ValueMixinInterface> & T;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
9
|
+
};
|
10
|
+
import { property } from 'lit/decorators.js';
|
11
|
+
export const ValueMixin = (superClass) => {
|
12
|
+
class InnerMixinClass extends superClass {
|
13
|
+
constructor() {
|
14
|
+
super(...arguments);
|
15
|
+
/**
|
16
|
+
* Indicates the value of the component group (ex: input, checkbox, radio, select etc...)
|
17
|
+
* @default ''
|
18
|
+
*/
|
19
|
+
this.value = '';
|
20
|
+
}
|
21
|
+
}
|
22
|
+
__decorate([
|
23
|
+
property({ reflect: true, type: String }),
|
24
|
+
__metadata("design:type", Object)
|
25
|
+
], InnerMixinClass.prototype, "value", void 0);
|
26
|
+
// Cast return type to your mixin's interface intersected with the superClass type
|
27
|
+
return InnerMixinClass;
|
28
|
+
};
|
package/package.json
CHANGED
@@ -1,7 +0,0 @@
|
|
1
|
-
import { LitElement } from 'lit';
|
2
|
-
import type { Constructor } from './index.types';
|
3
|
-
export interface LabelMixinInterface {
|
4
|
-
label: string;
|
5
|
-
renderLabel(): void;
|
6
|
-
}
|
7
|
-
export declare const LabelMixin: <T extends Constructor<LitElement>>(superClass: T) => Constructor<LabelMixinInterface> & T;
|