@sula-tech/webcomponents 0.1.1 → 0.2.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.
Files changed (63) hide show
  1. package/dist/cjs/{index-7973b779.js → index-3eac14f6.js} +102 -4
  2. package/dist/cjs/index-3eac14f6.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/{sula-avatar_3.cjs.entry.js → sula-avatar_4.cjs.entry.js} +133 -5
  5. package/dist/cjs/sula-avatar_4.cjs.entry.js.map +1 -0
  6. package/dist/cjs/webcomponents.cjs.js +2 -2
  7. package/dist/collection/collection-manifest.json +2 -1
  8. package/dist/collection/components/sula-avatar/sula-avatar.css +1 -1
  9. package/dist/collection/components/sula-avatar/sula-avatar.stories.js +14 -17
  10. package/dist/collection/components/sula-avatar/sula-avatar.stories.js.map +1 -1
  11. package/dist/collection/components/sula-button/sula-button.css +1 -1
  12. package/dist/collection/components/sula-button/sula-button.stories.js +36 -9
  13. package/dist/collection/components/sula-button/sula-button.stories.js.map +1 -1
  14. package/dist/collection/components/sula-icon/sula-icon.css +1 -1
  15. package/dist/collection/components/sula-icon/sula-icon.stories.js +35 -14
  16. package/dist/collection/components/sula-icon/sula-icon.stories.js.map +1 -1
  17. package/dist/collection/components/sula-textfield/model/sula-textfield.model.js +11 -0
  18. package/dist/collection/components/sula-textfield/model/sula-textfield.model.js.map +1 -0
  19. package/dist/collection/components/sula-textfield/sula-textfield.css +1 -0
  20. package/dist/collection/components/sula-textfield/sula-textfield.js +376 -0
  21. package/dist/collection/components/sula-textfield/sula-textfield.js.map +1 -0
  22. package/dist/collection/components/sula-textfield/sula-textfield.stories.js +148 -0
  23. package/dist/collection/components/sula-textfield/sula-textfield.stories.js.map +1 -0
  24. package/dist/components/index.js +1 -1
  25. package/dist/components/{p-81fcc74a.js → p-a07ff261.js} +3 -3
  26. package/dist/components/{p-81fcc74a.js.map → p-a07ff261.js.map} +1 -1
  27. package/dist/components/{p-d3ba6302.js → p-ca146b16.js} +91 -5
  28. package/dist/components/p-ca146b16.js.map +1 -0
  29. package/dist/components/sula-avatar.js +3 -3
  30. package/dist/components/sula-avatar.js.map +1 -1
  31. package/dist/components/sula-button.js +3 -3
  32. package/dist/components/sula-button.js.map +1 -1
  33. package/dist/components/sula-icon.js +1 -1
  34. package/dist/components/sula-textfield.d.ts +11 -0
  35. package/dist/components/sula-textfield.js +171 -0
  36. package/dist/components/sula-textfield.js.map +1 -0
  37. package/dist/esm/{index-9bf8f892.js → index-1dc4ae53.js} +102 -4
  38. package/dist/esm/index-1dc4ae53.js.map +1 -0
  39. package/dist/esm/loader.js +3 -3
  40. package/dist/esm/{sula-avatar_3.entry.js → sula-avatar_4.entry.js} +133 -6
  41. package/dist/esm/sula-avatar_4.entry.js.map +1 -0
  42. package/dist/esm/webcomponents.js +3 -3
  43. package/dist/types/components/sula-avatar/sula-avatar.stories.d.ts +0 -1
  44. package/dist/types/components/sula-button/sula-button.stories.d.ts +2 -0
  45. package/dist/types/components/sula-icon/sula-icon.stories.d.ts +5 -2
  46. package/dist/types/components/sula-textfield/model/sula-textfield.model.d.ts +8 -0
  47. package/dist/types/components/sula-textfield/sula-textfield.d.ts +74 -0
  48. package/dist/types/components/sula-textfield/sula-textfield.stories.d.ts +108 -0
  49. package/dist/types/components.d.ts +116 -0
  50. package/dist/webcomponents/{p-82d7a024.entry.js → p-77709b3c.entry.js} +201 -9
  51. package/dist/webcomponents/p-77709b3c.entry.js.map +1 -0
  52. package/dist/webcomponents/{p-cca32e44.js → p-fbee9d79.js} +426 -325
  53. package/dist/webcomponents/p-fbee9d79.js.map +1 -0
  54. package/dist/webcomponents/webcomponents.esm.js +27 -13
  55. package/dist/webcomponents/webcomponents.esm.js.map +1 -1
  56. package/package.json +20 -12
  57. package/dist/cjs/index-7973b779.js.map +0 -1
  58. package/dist/cjs/sula-avatar_3.cjs.entry.js.map +0 -1
  59. package/dist/components/p-d3ba6302.js.map +0 -1
  60. package/dist/esm/index-9bf8f892.js.map +0 -1
  61. package/dist/esm/sula-avatar_3.entry.js.map +0 -1
  62. package/dist/webcomponents/p-82d7a024.entry.js.map +0 -1
  63. package/dist/webcomponents/p-cca32e44.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-9bf8f892.js';
2
- export { s as setNonce } from './index-9bf8f892.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-1dc4ae53.js';
2
+ export { s as setNonce } from './index-1dc4ae53.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
@@ -16,7 +16,7 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["sula-avatar_3",[[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-button",{"text":[1025],"icon":[1025],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"]}],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
19
+ return bootstrapLazy([["sula-avatar_4",[[1,"sula-avatar",{"size":[1],"imageUrl":[1,"image-url"],"text":[1],"icon":[1]}],[1,"sula-button",{"text":[1025],"icon":[1025],"appearance":[1025],"type":[1025],"size":[1025],"status":[1025],"loading":[1028],"buttonDisabled":[1028,"button-disabled"]}],[1,"sula-textfield",{"value":[1025],"type":[1],"status":[1025],"label":[1],"placeholder":[1],"disabled":[1028],"helpText":[1,"help-text"],"maxLength":[2,"max-length"],"icon":[1],"inputIsOpen":[32],"textValue":[32],"showPassword":[32],"inputIsFocused":[32]},[[4,"click","handleClick"]]],[0,"sula-icon",{"icon":[1],"customClass":[1,"custom-class"]}]]]], options);
20
20
  });
21
21
 
22
22
  //# sourceMappingURL=webcomponents.js.map
@@ -1,7 +1,6 @@
1
1
  import { SulaAvatarSize } from './model/sula-avatar.model';
2
2
  declare const _default: {
3
3
  title: string;
4
- decorators: ((SulaAvatar: any) => string)[];
5
4
  tags: string[];
6
5
  argTypes: {
7
6
  size: {
@@ -94,3 +94,5 @@ export declare const LargeButton: any;
94
94
  export declare const DangerButton: any;
95
95
  export declare const NegativeButton: any;
96
96
  export declare const DisabledButton: any;
97
+ export declare const LoadingButton: any;
98
+ export declare const IconAndTextButton: any;
@@ -1,6 +1,5 @@
1
1
  declare const _default: {
2
2
  title: string;
3
- decorators: ((SulaIcon: any) => string)[];
4
3
  tags: string[];
5
4
  argTypes: {
6
5
  icon: {
@@ -22,4 +21,8 @@ declare const _default: {
22
21
  };
23
22
  };
24
23
  export default _default;
25
- export declare const Example: any;
24
+ export declare const Default: any;
25
+ export declare const WithCustomClass: any;
26
+ export declare const ArrowIcon: any;
27
+ export declare const CalendarIcon: any;
28
+ export declare const SearchIcon: any;
@@ -0,0 +1,8 @@
1
+ export declare enum SulaTextfieldType {
2
+ Text = "text",
3
+ Password = "password"
4
+ }
5
+ export declare enum SulaTextfieldStatus {
6
+ Default = "default",
7
+ Error = "error"
8
+ }
@@ -0,0 +1,74 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { SulaTextfieldStatus, SulaTextfieldType } from './model/sula-textfield.model';
3
+ export declare class SulaTextfield {
4
+ /**
5
+ * Value for the input.
6
+ */
7
+ value?: string;
8
+ /**
9
+ * The textfield type
10
+ */
11
+ type: SulaTextfieldType;
12
+ /**
13
+ * The textfield status
14
+ */
15
+ status: SulaTextfieldStatus;
16
+ /**
17
+ * The textfield label
18
+ */
19
+ label: string;
20
+ /**
21
+ * The textfield placeholder
22
+ */
23
+ placeholder: string;
24
+ /**
25
+ * The textfield is disabled
26
+ */
27
+ disabled: boolean;
28
+ /**
29
+ * The help text for textfield
30
+ */
31
+ helpText?: string;
32
+ /**
33
+ * The textfield max length
34
+ */
35
+ maxLength?: number;
36
+ /**
37
+ * The textfield icon
38
+ */
39
+ icon?: string;
40
+ /**
41
+ * Event emitted when input value changes.
42
+ */
43
+ valueChanged: EventEmitter<string>;
44
+ /**
45
+ * Event emitted when input is focused.
46
+ */
47
+ focusedOn: EventEmitter<void>;
48
+ /**
49
+ * Event emitted when input is focused out.
50
+ */
51
+ focusedOut: EventEmitter<void>;
52
+ inputIsOpen: boolean;
53
+ textValue: string;
54
+ showPassword: boolean;
55
+ inputIsFocused: boolean;
56
+ inputContainer: HTMLDivElement;
57
+ inputElement: HTMLInputElement;
58
+ labelElement: HTMLDivElement;
59
+ node?: HTMLElement;
60
+ handleClick(event: Event): void;
61
+ componentWillLoad(): void;
62
+ componentDidLoad(): void;
63
+ handleInputClick: () => void;
64
+ toggleOptions(inputIsOpen: boolean): void;
65
+ changeElementsStyle(): void;
66
+ handleInputChanges: (event: InputEvent) => void;
67
+ handleFocus: () => void;
68
+ handleBlur: () => void;
69
+ handleInputFocus: () => void;
70
+ handleIconClick: (event: MouseEvent) => void;
71
+ handlePasswordIconClicked(): void;
72
+ getInputIcon(): string;
73
+ render(): any;
74
+ }
@@ -0,0 +1,108 @@
1
+ import { SulaTextfieldStatus, SulaTextfieldType } from './model/sula-textfield.model';
2
+ declare const _default: {
3
+ title: string;
4
+ tags: string[];
5
+ argTypes: {
6
+ value: {
7
+ control: string;
8
+ defaultValue: string;
9
+ description: string;
10
+ type: {
11
+ required: boolean;
12
+ };
13
+ };
14
+ type: {
15
+ control: {
16
+ type: string;
17
+ };
18
+ options: SulaTextfieldType[];
19
+ defaultValue: SulaTextfieldType;
20
+ description: string;
21
+ type: {
22
+ required: boolean;
23
+ };
24
+ };
25
+ status: {
26
+ control: {
27
+ type: string;
28
+ };
29
+ options: SulaTextfieldStatus[];
30
+ defaultValue: SulaTextfieldStatus;
31
+ description: string;
32
+ type: {
33
+ required: boolean;
34
+ };
35
+ };
36
+ label: {
37
+ control: string;
38
+ defaultValue: string;
39
+ description: string;
40
+ type: {
41
+ required: boolean;
42
+ };
43
+ };
44
+ placeholder: {
45
+ control: string;
46
+ defaultValue: string;
47
+ description: string;
48
+ type: {
49
+ required: boolean;
50
+ };
51
+ };
52
+ disabled: {
53
+ control: string;
54
+ defaultValue: boolean;
55
+ description: string;
56
+ type: {
57
+ required: boolean;
58
+ };
59
+ };
60
+ helpText: {
61
+ control: string;
62
+ defaultValue: string;
63
+ description: string;
64
+ type: {
65
+ required: boolean;
66
+ };
67
+ };
68
+ maxLength: {
69
+ control: string;
70
+ defaultValue: number;
71
+ description: string;
72
+ type: {
73
+ required: boolean;
74
+ };
75
+ };
76
+ icon: {
77
+ control: string;
78
+ defaultValue: string;
79
+ description: string;
80
+ type: {
81
+ required: boolean;
82
+ };
83
+ };
84
+ valueChanged: {
85
+ action: string;
86
+ description: string;
87
+ };
88
+ focusedOn: {
89
+ action: string;
90
+ description: string;
91
+ };
92
+ focusedOut: {
93
+ action: string;
94
+ description: string;
95
+ };
96
+ };
97
+ };
98
+ export default _default;
99
+ export declare const Default: any;
100
+ export declare const WithValue: any;
101
+ export declare const WithHelpText: any;
102
+ export declare const WithMaxLength: any;
103
+ export declare const WithIcon: any;
104
+ export declare const Password: any;
105
+ export declare const Error: any;
106
+ export declare const Disabled: any;
107
+ export declare const WithIconAndHelpText: any;
108
+ export declare const ErrorWithMaxLength: any;
@@ -7,8 +7,10 @@
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { SulaAvatarSize } from "./components/sula-avatar/model/sula-avatar.model";
9
9
  import { SulaButtonAppearance, SulaButtonSize, SulaButtonStatus, SulaButtonType } from "./components/sula-button/model/sula-button.model";
10
+ import { SulaTextfieldStatus, SulaTextfieldType } from "./components/sula-textfield/model/sula-textfield.model";
10
11
  export { SulaAvatarSize } from "./components/sula-avatar/model/sula-avatar.model";
11
12
  export { SulaButtonAppearance, SulaButtonSize, SulaButtonStatus, SulaButtonType } from "./components/sula-button/model/sula-button.model";
13
+ export { SulaTextfieldStatus, SulaTextfieldType } from "./components/sula-textfield/model/sula-textfield.model";
12
14
  export namespace Components {
13
15
  interface SulaAvatar {
14
16
  /**
@@ -72,11 +74,53 @@ export namespace Components {
72
74
  */
73
75
  "icon": string;
74
76
  }
77
+ interface SulaTextfield {
78
+ /**
79
+ * The textfield is disabled
80
+ */
81
+ "disabled": boolean;
82
+ /**
83
+ * The help text for textfield
84
+ */
85
+ "helpText"?: string;
86
+ /**
87
+ * The textfield icon
88
+ */
89
+ "icon"?: string;
90
+ /**
91
+ * The textfield label
92
+ */
93
+ "label": string;
94
+ /**
95
+ * The textfield max length
96
+ */
97
+ "maxLength"?: number;
98
+ /**
99
+ * The textfield placeholder
100
+ */
101
+ "placeholder": string;
102
+ /**
103
+ * The textfield status
104
+ */
105
+ "status": SulaTextfieldStatus;
106
+ /**
107
+ * The textfield type
108
+ */
109
+ "type": SulaTextfieldType;
110
+ /**
111
+ * Value for the input.
112
+ */
113
+ "value"?: string;
114
+ }
75
115
  }
76
116
  export interface SulaButtonCustomEvent<T> extends CustomEvent<T> {
77
117
  detail: T;
78
118
  target: HTMLSulaButtonElement;
79
119
  }
120
+ export interface SulaTextfieldCustomEvent<T> extends CustomEvent<T> {
121
+ detail: T;
122
+ target: HTMLSulaTextfieldElement;
123
+ }
80
124
  declare global {
81
125
  interface HTMLSulaAvatarElement extends Components.SulaAvatar, HTMLStencilElement {
82
126
  }
@@ -107,10 +151,30 @@ declare global {
107
151
  prototype: HTMLSulaIconElement;
108
152
  new (): HTMLSulaIconElement;
109
153
  };
154
+ interface HTMLSulaTextfieldElementEventMap {
155
+ "valueChanged": string;
156
+ "focusedOn": void;
157
+ "focusedOut": void;
158
+ }
159
+ interface HTMLSulaTextfieldElement extends Components.SulaTextfield, HTMLStencilElement {
160
+ addEventListener<K extends keyof HTMLSulaTextfieldElementEventMap>(type: K, listener: (this: HTMLSulaTextfieldElement, ev: SulaTextfieldCustomEvent<HTMLSulaTextfieldElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
161
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
162
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
163
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
164
+ removeEventListener<K extends keyof HTMLSulaTextfieldElementEventMap>(type: K, listener: (this: HTMLSulaTextfieldElement, ev: SulaTextfieldCustomEvent<HTMLSulaTextfieldElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
165
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
166
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
167
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
168
+ }
169
+ var HTMLSulaTextfieldElement: {
170
+ prototype: HTMLSulaTextfieldElement;
171
+ new (): HTMLSulaTextfieldElement;
172
+ };
110
173
  interface HTMLElementTagNameMap {
111
174
  "sula-avatar": HTMLSulaAvatarElement;
112
175
  "sula-button": HTMLSulaButtonElement;
113
176
  "sula-icon": HTMLSulaIconElement;
177
+ "sula-textfield": HTMLSulaTextfieldElement;
114
178
  }
115
179
  }
116
180
  declare namespace LocalJSX {
@@ -181,10 +245,61 @@ declare namespace LocalJSX {
181
245
  */
182
246
  "icon"?: string;
183
247
  }
248
+ interface SulaTextfield {
249
+ /**
250
+ * The textfield is disabled
251
+ */
252
+ "disabled"?: boolean;
253
+ /**
254
+ * The help text for textfield
255
+ */
256
+ "helpText"?: string;
257
+ /**
258
+ * The textfield icon
259
+ */
260
+ "icon"?: string;
261
+ /**
262
+ * The textfield label
263
+ */
264
+ "label"?: string;
265
+ /**
266
+ * The textfield max length
267
+ */
268
+ "maxLength"?: number;
269
+ /**
270
+ * Event emitted when input is focused.
271
+ */
272
+ "onFocusedOn"?: (event: SulaTextfieldCustomEvent<void>) => void;
273
+ /**
274
+ * Event emitted when input is focused out.
275
+ */
276
+ "onFocusedOut"?: (event: SulaTextfieldCustomEvent<void>) => void;
277
+ /**
278
+ * Event emitted when input value changes.
279
+ */
280
+ "onValueChanged"?: (event: SulaTextfieldCustomEvent<string>) => void;
281
+ /**
282
+ * The textfield placeholder
283
+ */
284
+ "placeholder"?: string;
285
+ /**
286
+ * The textfield status
287
+ */
288
+ "status"?: SulaTextfieldStatus;
289
+ /**
290
+ * The textfield type
291
+ */
292
+ "type"?: SulaTextfieldType;
293
+ /**
294
+ * Value for the input.
295
+ */
296
+ "value"?: string;
297
+ }
184
298
  interface IntrinsicElements {
185
299
  "sula-avatar": SulaAvatar;
186
300
  "sula-button": SulaButton;
187
301
  "sula-icon": SulaIcon;
302
+ "sula-textfield": SulaTextfield;
188
303
  }
189
304
  }
190
305
  export { LocalJSX as JSX };
@@ -194,6 +309,7 @@ declare module "@stencil/core" {
194
309
  "sula-avatar": LocalJSX.SulaAvatar & JSXBase.HTMLAttributes<HTMLSulaAvatarElement>;
195
310
  "sula-button": LocalJSX.SulaButton & JSXBase.HTMLAttributes<HTMLSulaButtonElement>;
196
311
  "sula-icon": LocalJSX.SulaIcon & JSXBase.HTMLAttributes<HTMLSulaIconElement>;
312
+ "sula-textfield": LocalJSX.SulaTextfield & JSXBase.HTMLAttributes<HTMLSulaTextfieldElement>;
197
313
  }
198
314
  }
199
315
  }