@xplortech/apollo-core 0.5.2 → 1.0.0-beta.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/build/style.css +758 -383
- package/dist/apollo-core/apollo-core.css +4 -4
- package/dist/apollo-core/apollo-core.esm.js +1 -1
- package/dist/apollo-core/{p-5854d1e4.entry.js → p-09b2f746.entry.js} +1 -1
- package/dist/apollo-core/p-0bc956c6.entry.js +1 -0
- package/dist/apollo-core/p-1b1e7207.entry.js +1 -0
- package/dist/apollo-core/{p-f167aa05.entry.js → p-20389bb6.entry.js} +1 -1
- package/dist/apollo-core/{p-ee2f4422.entry.js → p-25983fde.entry.js} +1 -1
- package/dist/apollo-core/{p-128a0240.entry.js → p-4a348764.entry.js} +1 -1
- package/dist/apollo-core/{p-eb63b401.entry.js → p-4e2b69e8.entry.js} +1 -1
- package/dist/apollo-core/{p-97cd1f73.entry.js → p-84bf6b2d.entry.js} +1 -1
- package/dist/apollo-core/{p-611536d8.entry.js → p-880c0359.entry.js} +1 -1
- package/dist/apollo-core/p-8e47a5be.entry.js +1 -0
- package/dist/apollo-core/p-93958292.entry.js +1 -0
- package/dist/apollo-core/p-93c27db5.entry.js +1 -0
- package/dist/apollo-core/{p-0b2c612e.entry.js → p-b2327e2c.entry.js} +1 -1
- package/dist/apollo-core/p-c55b5d9c.entry.js +1 -0
- package/dist/apollo-core/p-e369d7af.entry.js +1 -0
- package/dist/apollo-core/p-e60ecaef.entry.js +1 -0
- package/dist/apollo-core/p-f929c958.js +1 -0
- package/dist/cjs/apollo-core.cjs.js +2 -2
- package/dist/cjs/{index-944adb2e.js → index-54ba5804.js} +14 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/xpl-application-shell.cjs.entry.js +58 -0
- package/dist/cjs/xpl-avatar_12.cjs.entry.js +299 -0
- package/dist/cjs/xpl-backdrop.cjs.entry.js +25 -0
- package/dist/cjs/xpl-button-row.cjs.entry.js +2 -4
- package/dist/cjs/xpl-choicelist.cjs.entry.js +21 -14
- package/dist/cjs/xpl-divider.cjs.entry.js +2 -2
- package/dist/cjs/xpl-dropdown-group_3.cjs.entry.js +104 -0
- package/dist/cjs/xpl-dropdown_2.cjs.entry.js +123 -0
- package/dist/cjs/xpl-grid-item.cjs.entry.js +2 -2
- package/dist/cjs/xpl-grid.cjs.entry.js +12 -12
- package/dist/cjs/xpl-input.cjs.entry.js +33 -26
- package/dist/cjs/xpl-list.cjs.entry.js +17 -19
- package/dist/cjs/xpl-main-nav.cjs.entry.js +30 -0
- package/dist/cjs/xpl-pagination.cjs.entry.js +8 -8
- package/dist/cjs/xpl-select.cjs.entry.js +87 -85
- package/dist/cjs/xpl-toggle.cjs.entry.js +13 -13
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/xpl-application-shell/xpl-application-shell.js +11 -7
- package/dist/collection/components/xpl-avatar/xpl-avatar.js +7 -7
- package/dist/collection/components/xpl-backdrop/xpl-backdrop.js +1 -1
- package/dist/collection/components/xpl-badge/xpl-badge.js +5 -5
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumb-item/xpl-breadcrumb-item.js +0 -2
- package/dist/collection/components/xpl-breadcrumbs/xpl-breadcrumbs/xpl-breadcrumbs.js +0 -2
- package/dist/collection/components/xpl-button/xpl-button.js +79 -82
- package/dist/collection/components/xpl-button-row/xpl-button-row.js +7 -9
- package/dist/collection/components/xpl-checkbox/xpl-checkbox.js +11 -11
- package/dist/collection/components/xpl-choicelist/xpl-choicelist.js +22 -15
- package/dist/collection/components/xpl-content-area/xpl-content-area.js +5 -5
- package/dist/collection/components/xpl-divider/xpl-divider.js +1 -1
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.js +66 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.js +27 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown-option/xpl-dropdown-option.js +110 -0
- package/dist/collection/components/xpl-dropdown/xpl-dropdown.js +259 -31
- package/dist/collection/components/xpl-grid/xpl-grid.js +11 -11
- package/dist/collection/components/xpl-grid-item/xpl-grid-item.js +1 -1
- package/dist/collection/components/xpl-input/xpl-input.js +49 -42
- package/dist/collection/components/xpl-list/xpl-list.js +24 -26
- package/dist/collection/components/xpl-main-nav/xpl-main-nav.js +3 -3
- package/dist/collection/components/xpl-nav-item/xpl-nav-item.js +59 -2
- package/dist/collection/components/xpl-pagination/xpl-pagination.js +11 -10
- package/dist/collection/components/xpl-radio/xpl-radio.js +11 -11
- package/dist/collection/components/xpl-select/xpl-select.js +97 -64
- package/dist/collection/components/xpl-table/xpl-table.js +18 -12
- package/dist/collection/components/xpl-toggle/xpl-toggle.js +16 -16
- package/dist/collection/components/xpl-utility-bar/xpl-utility-bar.js +4 -8
- package/dist/custom-elements/index.d.ts +24 -0
- package/dist/custom-elements/index.js +18936 -18694
- package/dist/esm/apollo-core.js +2 -2
- package/dist/esm/{index-899dba3b.js → index-3df6db84.js} +14 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/xpl-application-shell.entry.js +54 -0
- package/dist/esm/xpl-avatar_12.entry.js +284 -0
- package/dist/esm/xpl-backdrop.entry.js +21 -0
- package/dist/esm/xpl-button-row.entry.js +2 -4
- package/dist/esm/xpl-choicelist.entry.js +21 -14
- package/dist/esm/xpl-divider.entry.js +2 -2
- package/dist/esm/xpl-dropdown-group_3.entry.js +98 -0
- package/dist/esm/xpl-dropdown_2.entry.js +118 -0
- package/dist/esm/xpl-grid-item.entry.js +2 -2
- package/dist/esm/xpl-grid.entry.js +12 -12
- package/dist/esm/xpl-input.entry.js +33 -26
- package/dist/esm/xpl-list.entry.js +17 -19
- package/dist/esm/xpl-main-nav.entry.js +26 -0
- package/dist/esm/xpl-pagination.entry.js +8 -8
- package/dist/esm/xpl-select.entry.js +87 -85
- package/dist/esm/xpl-toggle.entry.js +13 -13
- package/dist/stories/application-shell.stories.js +31 -30
- package/dist/stories/avatar.stories.js +38 -38
- package/dist/stories/backdrop.stories.js +3 -3
- package/dist/stories/badge.stories.js +16 -16
- package/dist/stories/breadcrumbs.stories.js +18 -16
- package/dist/stories/button-row.stories.js +18 -14
- package/dist/stories/button.stories.js +69 -57
- package/dist/stories/checkbox.stories.js +21 -19
- package/dist/stories/choicelist.stories.js +19 -19
- package/dist/stories/content-area.stories.js +6 -6
- package/dist/stories/divider.stories.js +7 -7
- package/dist/stories/dropdown.stories.js +377 -0
- package/dist/stories/grid.stories.js +19 -19
- package/dist/stories/input.stories.js +93 -77
- package/dist/stories/list.stories.js +72 -52
- package/dist/stories/main-nav.stories.js +8 -8
- package/dist/stories/radio.stories.js +18 -16
- package/dist/stories/secondary-nav.stories.js +5 -5
- package/dist/stories/select.stories.js +54 -46
- package/dist/stories/table.stories.js +29 -29
- package/dist/stories/toggle.stories.js +30 -26
- package/dist/stories/utility-bar.stories.js +4 -4
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/application-shell.stories.d.ts +4 -4
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/avatar.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/backdrop.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/badge.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/breadcrumbs.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/button-row.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/button.stories.d.ts +19 -10
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/checkbox.stories.d.ts +2 -2
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/choicelist.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/content-area.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/divider.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/dropdown.stories.d.ts +134 -0
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/grid.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/input.stories.d.ts +5 -5
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/list.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/main-nav.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/radio.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/secondary-nav.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/select.stories.d.ts +2 -2
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/table.stories.d.ts +1 -1
- package/dist/types/Users/fernandogelin/Projects/apollo/.stencil/stories/toggle.stories.d.ts +2 -2
- package/dist/types/components/xpl-application-shell/xpl-application-shell.d.ts +2 -2
- package/dist/types/components/xpl-avatar/xpl-avatar.d.ts +3 -3
- package/dist/types/components/xpl-badge/xpl-badge.d.ts +1 -1
- package/dist/types/components/xpl-button/xpl-button.d.ts +32 -8
- package/dist/types/components/xpl-button-row/xpl-button-row.d.ts +3 -3
- package/dist/types/components/xpl-checkbox/xpl-checkbox.d.ts +1 -1
- package/dist/types/components/xpl-content-area/xpl-content-area.d.ts +3 -3
- package/dist/types/components/xpl-dropdown/xpl-dropdown-group/xpl-dropdown-group.d.ts +7 -0
- package/dist/types/components/xpl-dropdown/xpl-dropdown-heading/xpl-dropdown-heading.d.ts +5 -0
- package/dist/types/components/xpl-input/xpl-input.d.ts +4 -4
- package/dist/types/components/xpl-list/xpl-list.d.ts +2 -2
- package/dist/types/components/xpl-main-nav/xpl-main-nav.d.ts +1 -1
- package/dist/types/components/xpl-nav-item/xpl-nav-item.d.ts +10 -0
- package/dist/types/components/xpl-pagination/xpl-pagination.d.ts +1 -1
- package/dist/types/components/xpl-radio/xpl-radio.d.ts +1 -1
- package/dist/types/components/xpl-select/xpl-select.d.ts +6 -2
- package/dist/types/components/xpl-table/xpl-table.d.ts +1 -1
- package/dist/types/components/xpl-toggle/xpl-toggle.d.ts +1 -1
- package/dist/types/components.d.ts +264 -40
- package/package.json +10 -4
- package/dist/apollo-core/p-0203d4e8.entry.js +0 -1
- package/dist/apollo-core/p-30003b15.entry.js +0 -1
- package/dist/apollo-core/p-4e56a2ca.entry.js +0 -1
- package/dist/apollo-core/p-7c9fee7e.entry.js +0 -1
- package/dist/apollo-core/p-8b6633c7.js +0 -1
- package/dist/apollo-core/p-9c5ca308.entry.js +0 -1
- package/dist/apollo-core/p-bd4a7e3c.entry.js +0 -1
- package/dist/apollo-core/p-dab8e7a1.entry.js +0 -1
- package/dist/cjs/xpl-application-shell_11.cjs.entry.js +0 -230
- package/dist/cjs/xpl-badge.cjs.entry.js +0 -21
- package/dist/cjs/xpl-checkbox_2.cjs.entry.js +0 -51
- package/dist/cjs/xpl-table.cjs.entry.js +0 -89
- package/dist/cjs/xpl-tag.cjs.entry.js +0 -21
- package/dist/esm/xpl-application-shell_11.entry.js +0 -216
- package/dist/esm/xpl-badge.entry.js +0 -17
- package/dist/esm/xpl-checkbox_2.entry.js +0 -46
- package/dist/esm/xpl-table.entry.js +0 -85
- package/dist/esm/xpl-tag.entry.js +0 -17
- package/dist/types/components/xpl-choicelist/choice.d.ts +0 -6
- package/dist/types/components/xpl-dropdown/dropdownchoice.d.ts +0 -6
- package/dist/types/components/xpl-dropdown/xpl-dropdown.d.ts +0 -10
- package/dist/types/components/xpl-list/listitem.d.ts +0 -16
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Input',
|
|
3
3
|
argTypes: {
|
|
4
4
|
label: {
|
|
5
|
-
type: { name:
|
|
5
|
+
type: { name: 'string', required: true },
|
|
6
6
|
},
|
|
7
7
|
description: {
|
|
8
|
-
type: { name:
|
|
8
|
+
type: { name: 'string', required: false },
|
|
9
9
|
},
|
|
10
10
|
disabled: {
|
|
11
11
|
type: {
|
|
12
|
-
name:
|
|
13
|
-
}
|
|
12
|
+
name: 'boolean',
|
|
13
|
+
},
|
|
14
14
|
},
|
|
15
15
|
error: {
|
|
16
16
|
type: {
|
|
17
|
-
name:
|
|
18
|
-
}
|
|
17
|
+
name: 'boolean',
|
|
18
|
+
},
|
|
19
19
|
},
|
|
20
20
|
errorMessage: {
|
|
21
|
-
type: { name:
|
|
21
|
+
type: { name: 'string', required: false },
|
|
22
22
|
},
|
|
23
23
|
type: {
|
|
24
|
-
options: [
|
|
24
|
+
options: ['text', 'number'],
|
|
25
25
|
control: {
|
|
26
|
-
type:
|
|
26
|
+
type: 'select',
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
30
|
};
|
|
31
31
|
export const Input = ({ label, description, disabled, error, errorMessage, pre, post, type, }) => {
|
|
32
|
-
let attrs =
|
|
32
|
+
let attrs = '';
|
|
33
33
|
if (label)
|
|
34
34
|
attrs += ` label="${label}"`;
|
|
35
35
|
if (description)
|
|
@@ -37,59 +37,67 @@ export const Input = ({ label, description, disabled, error, errorMessage, pre,
|
|
|
37
37
|
if (disabled)
|
|
38
38
|
attrs += ` disabled`;
|
|
39
39
|
if (error)
|
|
40
|
-
attrs += ` error${errorMessage ?
|
|
40
|
+
attrs += ` error${errorMessage ? '="' + errorMessage + '"' : ''}`;
|
|
41
41
|
if (pre)
|
|
42
42
|
attrs += ` pre="${pre}"`;
|
|
43
43
|
if (post)
|
|
44
44
|
attrs += ` post="${post}"`;
|
|
45
|
-
if (type !==
|
|
45
|
+
if (type !== 'text')
|
|
46
46
|
attrs += ` type=${type}`;
|
|
47
47
|
return `<xpl-input${attrs} name="input-name" placeholder="Placeholder"></xpl-input>`;
|
|
48
48
|
};
|
|
49
49
|
Input.parameters = {
|
|
50
|
-
layout:
|
|
51
|
-
|
|
50
|
+
layout: 'centered',
|
|
51
|
+
'web-component': {
|
|
52
52
|
render: Input,
|
|
53
53
|
},
|
|
54
54
|
html: {
|
|
55
55
|
render({ label, description, disabled, error, errorMessage, pre, post, type, }) {
|
|
56
56
|
const output = [];
|
|
57
|
-
let className =
|
|
57
|
+
let className = 'xpl-input';
|
|
58
58
|
if (disabled)
|
|
59
|
-
className +=
|
|
59
|
+
className += ' xpl-input--disabled';
|
|
60
60
|
if (error)
|
|
61
|
-
className +=
|
|
61
|
+
className += ' xpl-input--error';
|
|
62
62
|
output.push(`<div class="${className}">
|
|
63
63
|
<label for="id">
|
|
64
|
-
${label}${description
|
|
65
|
-
|
|
64
|
+
${label}${description
|
|
65
|
+
? `
|
|
66
|
+
<small>${description}</small>`
|
|
67
|
+
: ''}
|
|
66
68
|
</label>
|
|
67
|
-
<div class="xpl-input-wrapper">${pre
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
<div class="xpl-input-wrapper">${pre
|
|
70
|
+
? `
|
|
71
|
+
<label class="xpl-input-pre" for="id">${pre}</label>`
|
|
72
|
+
: ''}
|
|
73
|
+
${`<input ${disabled ? 'disabled ' : ''}id="id" name="input-name" placeholder="Placeholder" type="${type}" />`}${post
|
|
74
|
+
? `
|
|
75
|
+
<label class="xpl-input-post" for="id">${post}</label>`
|
|
76
|
+
: ''}
|
|
77
|
+
</div>${errorMessage
|
|
78
|
+
? `
|
|
72
79
|
<label class="xpl-input-error" for="id">
|
|
73
80
|
${`<svg width="10" height="11" viewBox="0 0 10 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.84375 5.25C9.84375 2.59375 7.65625 0.40625 5 0.40625C2.32422 0.40625 0.15625 2.59375 0.15625 5.25C0.15625 7.92578 2.32422 10.0938 5 10.0938C7.65625 10.0938 9.84375 7.92578 9.84375 5.25ZM5 6.22656C5.48828 6.22656 5.89844 6.63672 5.89844 7.125C5.89844 7.63281 5.48828 8.02344 5 8.02344C4.49219 8.02344 4.10156 7.63281 4.10156 7.125C4.10156 6.63672 4.49219 6.22656 5 6.22656ZM4.14062 3.00391C4.12109 2.86719 4.23828 2.75 4.375 2.75H5.60547C5.74219 2.75 5.85938 2.86719 5.83984 3.00391L5.70312 5.66016C5.68359 5.79688 5.58594 5.875 5.46875 5.875H4.51172C4.39453 5.875 4.29688 5.79688 4.27734 5.66016L4.14062 3.00391Z" /></svg>`}
|
|
74
81
|
${errorMessage}
|
|
75
|
-
</label>`
|
|
82
|
+
</label>`
|
|
83
|
+
: ''}
|
|
76
84
|
</div>`);
|
|
77
85
|
return output;
|
|
78
86
|
},
|
|
79
87
|
},
|
|
80
88
|
};
|
|
81
89
|
Input.args = {
|
|
82
|
-
label:
|
|
83
|
-
description:
|
|
90
|
+
label: 'Input',
|
|
91
|
+
description: 'A brief description',
|
|
84
92
|
disabled: false,
|
|
85
93
|
error: false,
|
|
86
|
-
errorMessage:
|
|
87
|
-
pre:
|
|
88
|
-
post:
|
|
89
|
-
type:
|
|
94
|
+
errorMessage: '',
|
|
95
|
+
pre: '',
|
|
96
|
+
post: '',
|
|
97
|
+
type: 'text',
|
|
90
98
|
};
|
|
91
99
|
export const Multiline = ({ label, description, disabled, error, errorMessage, maxCharacterCount, }) => {
|
|
92
|
-
let attrs =
|
|
100
|
+
let attrs = ' multiline';
|
|
93
101
|
if (label)
|
|
94
102
|
attrs += ` label="${label}"`;
|
|
95
103
|
if (description)
|
|
@@ -97,52 +105,56 @@ export const Multiline = ({ label, description, disabled, error, errorMessage, m
|
|
|
97
105
|
if (disabled)
|
|
98
106
|
attrs += ` disabled`;
|
|
99
107
|
if (error)
|
|
100
|
-
attrs += ` error${errorMessage ?
|
|
108
|
+
attrs += ` error${errorMessage ? '="' + errorMessage + '"' : ''}`;
|
|
101
109
|
if (maxCharacterCount >= 0)
|
|
102
110
|
attrs += ` max-character-count="${maxCharacterCount}"`;
|
|
103
111
|
return `<xpl-input${attrs} name="input-name" placeholder="Placeholder"></xpl-input>`;
|
|
104
112
|
};
|
|
105
113
|
Multiline.parameters = {
|
|
106
|
-
layout:
|
|
107
|
-
|
|
114
|
+
layout: 'centered',
|
|
115
|
+
'web-component': {
|
|
108
116
|
render: Multiline,
|
|
109
117
|
},
|
|
110
118
|
html: {
|
|
111
|
-
render({ disabled, error, errorMessage, label, description, maxCharacterCount }) {
|
|
119
|
+
render({ disabled, error, errorMessage, label, description, maxCharacterCount, }) {
|
|
112
120
|
const output = [];
|
|
113
121
|
if (maxCharacterCount > 0)
|
|
114
122
|
output.push(`WARNING: For multiline inputs with a max. character count,
|
|
115
123
|
there is JS interactivity that is provided only by
|
|
116
124
|
the web component. The code shown below does not
|
|
117
125
|
reflect the additional markup and interactivity.`);
|
|
118
|
-
let className =
|
|
126
|
+
let className = 'xpl-input';
|
|
119
127
|
if (disabled)
|
|
120
|
-
className +=
|
|
128
|
+
className += ' xpl-input--disabled';
|
|
121
129
|
if (error)
|
|
122
|
-
className +=
|
|
130
|
+
className += ' xpl-input--error';
|
|
123
131
|
output.push(`<div class="${className}">
|
|
124
132
|
<label for="id">
|
|
125
|
-
${label}${description
|
|
126
|
-
|
|
133
|
+
${label}${description
|
|
134
|
+
? `
|
|
135
|
+
<small>${description}</small>`
|
|
136
|
+
: ''}
|
|
127
137
|
</label>
|
|
128
138
|
<div class="xpl-input-wrapper">
|
|
129
139
|
${`<textarea ${disabled ? 'disabled ' : ''}id="id" name="input-name" placeholder="Placeholder"></textarea>`}
|
|
130
|
-
</div>${errorMessage
|
|
140
|
+
</div>${errorMessage
|
|
141
|
+
? `
|
|
131
142
|
<label class="xpl-input-error" for="id">
|
|
132
143
|
${`<svg width="10" height="11" viewBox="0 0 10 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.84375 5.25C9.84375 2.59375 7.65625 0.40625 5 0.40625C2.32422 0.40625 0.15625 2.59375 0.15625 5.25C0.15625 7.92578 2.32422 10.0938 5 10.0938C7.65625 10.0938 9.84375 7.92578 9.84375 5.25ZM5 6.22656C5.48828 6.22656 5.89844 6.63672 5.89844 7.125C5.89844 7.63281 5.48828 8.02344 5 8.02344C4.49219 8.02344 4.10156 7.63281 4.10156 7.125C4.10156 6.63672 4.49219 6.22656 5 6.22656ZM4.14062 3.00391C4.12109 2.86719 4.23828 2.75 4.375 2.75H5.60547C5.74219 2.75 5.85938 2.86719 5.83984 3.00391L5.70312 5.66016C5.68359 5.79688 5.58594 5.875 5.46875 5.875H4.51172C4.39453 5.875 4.29688 5.79688 4.27734 5.66016L4.14062 3.00391Z" /></svg>`}
|
|
133
144
|
${errorMessage}
|
|
134
|
-
</label>`
|
|
145
|
+
</label>`
|
|
146
|
+
: ''}
|
|
135
147
|
</div>`);
|
|
136
148
|
return output;
|
|
137
|
-
}
|
|
149
|
+
},
|
|
138
150
|
},
|
|
139
151
|
};
|
|
140
152
|
Multiline.args = {
|
|
141
|
-
label:
|
|
142
|
-
description:
|
|
153
|
+
label: 'Multiline Input',
|
|
154
|
+
description: 'A brief description',
|
|
143
155
|
disabled: false,
|
|
144
156
|
error: false,
|
|
145
|
-
errorMessage:
|
|
157
|
+
errorMessage: '',
|
|
146
158
|
maxCharacterCount: 50,
|
|
147
159
|
};
|
|
148
160
|
export const Datepicker = ({ label, dateFormat, description, disabled, error, errorMessage, min, mode, max, }) => {
|
|
@@ -156,7 +168,7 @@ export const Datepicker = ({ label, dateFormat, description, disabled, error, er
|
|
|
156
168
|
if (disabled)
|
|
157
169
|
attrs += ` disabled`;
|
|
158
170
|
if (error)
|
|
159
|
-
attrs += ` error${errorMessage ?
|
|
171
|
+
attrs += ` error${errorMessage ? '="' + errorMessage + '"' : ''}`;
|
|
160
172
|
if (min)
|
|
161
173
|
attrs += ` min="${min}"`;
|
|
162
174
|
if (max)
|
|
@@ -167,57 +179,61 @@ export const Datepicker = ({ label, dateFormat, description, disabled, error, er
|
|
|
167
179
|
};
|
|
168
180
|
Datepicker.argTypes = {
|
|
169
181
|
mode: {
|
|
170
|
-
options: [
|
|
182
|
+
options: ['single', /* "multiple", */ 'range'],
|
|
171
183
|
control: {
|
|
172
|
-
type:
|
|
184
|
+
type: 'select',
|
|
173
185
|
},
|
|
174
186
|
},
|
|
175
187
|
};
|
|
176
188
|
Datepicker.args = {
|
|
177
|
-
mode:
|
|
178
|
-
label:
|
|
179
|
-
dateFormat:
|
|
180
|
-
description:
|
|
189
|
+
mode: 'single',
|
|
190
|
+
label: 'Datepicker',
|
|
191
|
+
dateFormat: 'm/d/Y',
|
|
192
|
+
description: 'A brief description',
|
|
181
193
|
disabled: false,
|
|
182
194
|
error: false,
|
|
183
|
-
errorMessage:
|
|
184
|
-
min:
|
|
185
|
-
max:
|
|
195
|
+
errorMessage: '',
|
|
196
|
+
min: '01/01/2000',
|
|
197
|
+
max: '12/31/2099',
|
|
186
198
|
};
|
|
187
199
|
Datepicker.parameters = {
|
|
188
|
-
layout:
|
|
189
|
-
|
|
190
|
-
render: Datepicker
|
|
200
|
+
layout: 'centered',
|
|
201
|
+
'web-component': {
|
|
202
|
+
render: Datepicker,
|
|
191
203
|
},
|
|
192
204
|
html: {
|
|
193
205
|
render({ label, description, disabled, error, errorMessage, min, max, }) {
|
|
194
206
|
const output = [
|
|
195
|
-
`The full-featured Datepicker Input only supports web component usage. However, a 'lite' version that uses native browser features is inlcuded here
|
|
207
|
+
`The full-featured Datepicker Input only supports web component usage. However, a 'lite' version that uses native browser features is inlcuded here:`,
|
|
196
208
|
];
|
|
197
|
-
let className =
|
|
209
|
+
let className = 'xpl-input';
|
|
198
210
|
if (disabled)
|
|
199
|
-
className +=
|
|
211
|
+
className += ' xpl-input--disabled';
|
|
200
212
|
if (error)
|
|
201
|
-
className +=
|
|
213
|
+
className += ' xpl-input--error';
|
|
202
214
|
output.push(`<div class="${className}">
|
|
203
215
|
<label for="id">
|
|
204
|
-
${label}${description
|
|
205
|
-
|
|
216
|
+
${label}${description
|
|
217
|
+
? `
|
|
218
|
+
<small>${description}</small>`
|
|
219
|
+
: ''}
|
|
206
220
|
</label>
|
|
207
221
|
<div class="xpl-input-wrapper">
|
|
208
222
|
${`<input ${disabled ? 'disabled ' : ''}id="id"${min ? ` min="${min}"` : ''}${max ? ` max="${max}"` : ''} name="input-name" placeholder="Placeholder" type="date" />`}
|
|
209
|
-
</div>${errorMessage
|
|
223
|
+
</div>${errorMessage
|
|
224
|
+
? `
|
|
210
225
|
<label class="xpl-input-error" for="id">
|
|
211
226
|
${`<svg width="10" height="11" viewBox="0 0 10 11" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.84375 5.25C9.84375 2.59375 7.65625 0.40625 5 0.40625C2.32422 0.40625 0.15625 2.59375 0.15625 5.25C0.15625 7.92578 2.32422 10.0938 5 10.0938C7.65625 10.0938 9.84375 7.92578 9.84375 5.25ZM5 6.22656C5.48828 6.22656 5.89844 6.63672 5.89844 7.125C5.89844 7.63281 5.48828 8.02344 5 8.02344C4.49219 8.02344 4.10156 7.63281 4.10156 7.125C4.10156 6.63672 4.49219 6.22656 5 6.22656ZM4.14062 3.00391C4.12109 2.86719 4.23828 2.75 4.375 2.75H5.60547C5.74219 2.75 5.85938 2.86719 5.83984 3.00391L5.70312 5.66016C5.68359 5.79688 5.58594 5.875 5.46875 5.875H4.51172C4.39453 5.875 4.29688 5.79688 4.27734 5.66016L4.14062 3.00391Z" /></svg>`}
|
|
212
227
|
${errorMessage}
|
|
213
|
-
</label>`
|
|
228
|
+
</label>`
|
|
229
|
+
: ''}
|
|
214
230
|
</div>`);
|
|
215
231
|
return output;
|
|
216
232
|
},
|
|
217
233
|
},
|
|
218
234
|
};
|
|
219
235
|
export const Password = ({ label, description, disabled, error, errorMessage, pre, post, }) => {
|
|
220
|
-
let attrs =
|
|
236
|
+
let attrs = '';
|
|
221
237
|
if (label)
|
|
222
238
|
attrs += ` label="${label}"`;
|
|
223
239
|
if (description)
|
|
@@ -225,7 +241,7 @@ export const Password = ({ label, description, disabled, error, errorMessage, pr
|
|
|
225
241
|
if (disabled)
|
|
226
242
|
attrs += ` disabled`;
|
|
227
243
|
if (error)
|
|
228
|
-
attrs += ` error${errorMessage ?
|
|
244
|
+
attrs += ` error${errorMessage ? '="' + errorMessage + '"' : ''}`;
|
|
229
245
|
if (pre)
|
|
230
246
|
attrs += ` pre="${pre}"`;
|
|
231
247
|
if (post)
|
|
@@ -233,8 +249,8 @@ export const Password = ({ label, description, disabled, error, errorMessage, pr
|
|
|
233
249
|
return `<xpl-input type="password"${attrs} name="input-name"></xpl-input>`;
|
|
234
250
|
};
|
|
235
251
|
Password.parameters = {
|
|
236
|
-
layout:
|
|
237
|
-
|
|
252
|
+
layout: 'centered',
|
|
253
|
+
'web-component': {
|
|
238
254
|
render: Password,
|
|
239
255
|
},
|
|
240
256
|
html: {
|
|
@@ -244,9 +260,9 @@ Password.parameters = {
|
|
|
244
260
|
},
|
|
245
261
|
};
|
|
246
262
|
Password.args = {
|
|
247
|
-
label:
|
|
248
|
-
description:
|
|
263
|
+
label: 'Password',
|
|
264
|
+
description: 'Enter a password:',
|
|
249
265
|
disabled: false,
|
|
250
266
|
error: false,
|
|
251
|
-
errorMessage:
|
|
267
|
+
errorMessage: '',
|
|
252
268
|
};
|
|
@@ -1,64 +1,72 @@
|
|
|
1
|
-
import { v4 as uuid } from
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
2
|
export default {
|
|
3
|
-
title:
|
|
3
|
+
title: 'Components/List',
|
|
4
4
|
argTypes: {
|
|
5
5
|
avatar: {
|
|
6
|
-
options: [
|
|
6
|
+
options: ['none', 'image', 'placeholder'],
|
|
7
7
|
control: {
|
|
8
|
-
type:
|
|
8
|
+
type: 'select',
|
|
9
9
|
},
|
|
10
10
|
},
|
|
11
11
|
avatars: {
|
|
12
|
-
type: { name:
|
|
12
|
+
type: { name: 'boolean' },
|
|
13
13
|
},
|
|
14
14
|
badges: {
|
|
15
|
-
type: { name:
|
|
15
|
+
type: { name: 'boolean' },
|
|
16
16
|
},
|
|
17
17
|
link: {
|
|
18
|
-
type: { name:
|
|
18
|
+
type: { name: 'boolean' },
|
|
19
19
|
},
|
|
20
20
|
metadata: {
|
|
21
|
-
type: { name:
|
|
21
|
+
type: { name: 'boolean' },
|
|
22
22
|
},
|
|
23
23
|
title: {
|
|
24
|
-
type: { name:
|
|
24
|
+
type: { name: 'string' },
|
|
25
25
|
},
|
|
26
26
|
subtext: {
|
|
27
|
-
type: { name:
|
|
27
|
+
type: { name: 'string' },
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
|
-
const script = ({ id, avatar, avatars, badges, metadata, link, title, subtext }) => `
|
|
31
|
+
const script = ({ id, avatar, avatars, badges, metadata, link, title, subtext, }) => `
|
|
32
32
|
(function() {
|
|
33
33
|
const list = document.getElementById("${id}");
|
|
34
34
|
const item = ${JSON.stringify({
|
|
35
|
-
avatar: avatar ===
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
35
|
+
avatar: avatar === 'image'
|
|
36
|
+
? 'https://pbs.twimg.com/profile_images/1388990311637127168/njwE8QEa_reasonably_small.jpg'
|
|
37
|
+
: avatar === 'placeholder'
|
|
38
|
+
? 'ABC'
|
|
39
|
+
: null,
|
|
40
|
+
avatars: avatars
|
|
41
|
+
? [
|
|
42
|
+
'https://pbs.twimg.com/profile_images/1388990311637127168/njwE8QEa_reasonably_small.jpg',
|
|
43
|
+
'https://pbs.twimg.com/profile_images/1388990311637127168/njwE8QEa_reasonably_small.jpg',
|
|
44
|
+
'https://pbs.twimg.com/profile_images/1388990311637127168/njwE8QEa_reasonably_small.jpg',
|
|
45
|
+
]
|
|
46
|
+
: null,
|
|
47
|
+
badges: badges
|
|
48
|
+
? [
|
|
49
|
+
'Badge',
|
|
50
|
+
{
|
|
51
|
+
dot: 'true',
|
|
52
|
+
text: 'With Dot',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
variant: 'error',
|
|
56
|
+
text: 'Error',
|
|
57
|
+
},
|
|
58
|
+
]
|
|
59
|
+
: null,
|
|
60
|
+
href: link ? '#' : null,
|
|
61
|
+
metadata: metadata
|
|
62
|
+
? [
|
|
63
|
+
'Metadata',
|
|
64
|
+
{
|
|
65
|
+
icon: 'envelope',
|
|
66
|
+
text: 'Metadata w/ Icon',
|
|
67
|
+
},
|
|
68
|
+
]
|
|
69
|
+
: null,
|
|
62
70
|
title,
|
|
63
71
|
subtext,
|
|
64
72
|
})};
|
|
@@ -71,19 +79,24 @@ export const List = (props) => {
|
|
|
71
79
|
<script>${script(Object.assign({ id }, props))}</script>`;
|
|
72
80
|
};
|
|
73
81
|
List.parameters = {
|
|
74
|
-
layout:
|
|
75
|
-
|
|
82
|
+
layout: 'centered',
|
|
83
|
+
'web-component': {
|
|
76
84
|
render({ avatar, avatars, badges, metadata, link, title, subtext }) {
|
|
77
85
|
return [
|
|
78
86
|
`<xpl-list id="list-id"></xpl-list>`,
|
|
79
87
|
`<script>
|
|
80
|
-
const item = {${avatar !==
|
|
81
|
-
|
|
88
|
+
const item = {${avatar !== 'none'
|
|
89
|
+
? `
|
|
90
|
+
avatar: ${avatar === 'placeholder' ? '"ABC"' : '"https://example.jpg"'},`
|
|
91
|
+
: ''}${avatars
|
|
92
|
+
? `
|
|
82
93
|
avatars: [
|
|
83
94
|
"https://example.jpg",
|
|
84
95
|
"https://example.jpg",
|
|
85
96
|
"https://example.jpg",
|
|
86
|
-
],`
|
|
97
|
+
],`
|
|
98
|
+
: ''}${badges
|
|
99
|
+
? `
|
|
87
100
|
badges: [
|
|
88
101
|
"Badge",
|
|
89
102
|
{
|
|
@@ -94,23 +107,30 @@ const item = {${avatar !== "none" ? `
|
|
|
94
107
|
variant: "error",
|
|
95
108
|
text: "Error",
|
|
96
109
|
},
|
|
97
|
-
],`
|
|
110
|
+
],`
|
|
111
|
+
: ''}${metadata
|
|
112
|
+
? `
|
|
98
113
|
metadata: [
|
|
99
114
|
"Metadata",
|
|
100
115
|
{
|
|
101
116
|
icon: "envelope",
|
|
102
117
|
text: "Metadata w/ Icon",
|
|
103
118
|
},
|
|
104
|
-
],`
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
119
|
+
],`
|
|
120
|
+
: ''}${link
|
|
121
|
+
? `
|
|
122
|
+
link: "https://example.com",`
|
|
123
|
+
: ''},
|
|
124
|
+
title: ${title},${subtext
|
|
125
|
+
? `
|
|
126
|
+
subtext: "${subtext}",`
|
|
127
|
+
: ''}
|
|
108
128
|
};
|
|
109
129
|
document.getElementById("list-id").items = [
|
|
110
130
|
item,
|
|
111
131
|
item,
|
|
112
132
|
item
|
|
113
|
-
]
|
|
133
|
+
];`,
|
|
114
134
|
];
|
|
115
135
|
},
|
|
116
136
|
},
|
|
@@ -124,11 +144,11 @@ document.getElementById("list-id").items = [
|
|
|
124
144
|
},
|
|
125
145
|
};
|
|
126
146
|
List.args = {
|
|
127
|
-
avatar:
|
|
147
|
+
avatar: 'none',
|
|
128
148
|
avatars: false,
|
|
129
149
|
badges: false,
|
|
130
150
|
link: true,
|
|
131
151
|
metadata: false,
|
|
132
|
-
title:
|
|
133
|
-
subtext:
|
|
152
|
+
title: 'List Item',
|
|
153
|
+
subtext: '',
|
|
134
154
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Navigation/Main Nav',
|
|
3
3
|
argTypes: {
|
|
4
4
|
width: {
|
|
5
|
-
options: [
|
|
5
|
+
options: ['default', 'sm', 'md'],
|
|
6
6
|
control: {
|
|
7
|
-
type:
|
|
7
|
+
type: 'select',
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
|
-
}
|
|
10
|
+
},
|
|
11
11
|
};
|
|
12
12
|
export const MainNav = ({ width }) => `
|
|
13
13
|
<xpl-main-nav width="${width}">
|
|
@@ -295,14 +295,14 @@ const HtmlMainNav = ({ width }) => `
|
|
|
295
295
|
|
|
296
296
|
`;
|
|
297
297
|
MainNav.parameters = {
|
|
298
|
-
layout:
|
|
299
|
-
|
|
298
|
+
layout: 'centered',
|
|
299
|
+
'web-component': {
|
|
300
300
|
render: MainNav,
|
|
301
301
|
},
|
|
302
302
|
html: {
|
|
303
|
-
render: HtmlMainNav
|
|
303
|
+
render: HtmlMainNav,
|
|
304
304
|
},
|
|
305
305
|
};
|
|
306
306
|
MainNav.args = {
|
|
307
|
-
width:
|
|
307
|
+
width: 'default',
|
|
308
308
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Radio',
|
|
3
3
|
argTypes: {
|
|
4
4
|
label: {
|
|
5
|
-
type: { name:
|
|
5
|
+
type: { name: 'string', required: true },
|
|
6
6
|
},
|
|
7
7
|
description: {
|
|
8
|
-
type: { name:
|
|
8
|
+
type: { name: 'string', required: false },
|
|
9
9
|
},
|
|
10
10
|
checked: {
|
|
11
11
|
control: {
|
|
12
|
-
type:
|
|
12
|
+
type: 'boolean',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
disabled: {
|
|
16
16
|
control: {
|
|
17
|
-
type:
|
|
17
|
+
type: 'boolean',
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
styled: {
|
|
21
21
|
control: {
|
|
22
|
-
type:
|
|
22
|
+
type: 'boolean',
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
27
|
export const Radio = ({ label, description, checked, disabled, styled }) => {
|
|
28
|
-
let attrs =
|
|
28
|
+
let attrs = '';
|
|
29
29
|
if (description)
|
|
30
30
|
attrs += ` description="${description}"`;
|
|
31
31
|
if (checked)
|
|
@@ -37,29 +37,31 @@ export const Radio = ({ label, description, checked, disabled, styled }) => {
|
|
|
37
37
|
return `<xpl-radio${attrs}>${label}</xpl-radio>`;
|
|
38
38
|
};
|
|
39
39
|
Radio.parameters = {
|
|
40
|
-
layout:
|
|
41
|
-
|
|
40
|
+
layout: 'centered',
|
|
41
|
+
'web-component': {
|
|
42
42
|
render: Radio,
|
|
43
43
|
},
|
|
44
44
|
html: {
|
|
45
45
|
render({ label, description, checked, disabled, styled }) {
|
|
46
|
-
let attrs =
|
|
46
|
+
let attrs = '';
|
|
47
47
|
if (checked)
|
|
48
48
|
attrs += ` checked`;
|
|
49
49
|
if (disabled)
|
|
50
50
|
attrs += ` disabled`;
|
|
51
|
-
return `<div class="xpl-checkbox-radio-container${styled ?
|
|
51
|
+
return `<div class="xpl-checkbox-radio-container${styled ? ' styled' : ''}${disabled ? ' disabled' : ''}">
|
|
52
52
|
<input class="xpl-radio" id="id" type="radio"${attrs}></input>
|
|
53
|
-
<label class="xpl-label${disabled ?
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
<label class="xpl-label${disabled ? ' xpl-label--disabled' : ''}" for="id">${label}${description
|
|
54
|
+
? `
|
|
55
|
+
<small class="xpl-description${disabled ? ' xpl-description--disabled' : ''}">${description}</small>
|
|
56
|
+
`
|
|
57
|
+
: ''}</label>
|
|
56
58
|
</div>`;
|
|
57
59
|
},
|
|
58
60
|
},
|
|
59
61
|
};
|
|
60
62
|
Radio.args = {
|
|
61
|
-
label:
|
|
62
|
-
description:
|
|
63
|
+
label: 'Radio Button',
|
|
64
|
+
description: '',
|
|
63
65
|
checked: false,
|
|
64
66
|
disabled: false,
|
|
65
67
|
styled: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Navigation/Secondary Nav',
|
|
3
3
|
};
|
|
4
4
|
export const SecondaryNav = () => `
|
|
5
5
|
<div class="secondary-nav-storybook-container">
|
|
@@ -66,11 +66,11 @@ const HtmlSecondaryNav = () => `
|
|
|
66
66
|
</nav>
|
|
67
67
|
</div>`;
|
|
68
68
|
SecondaryNav.parameters = {
|
|
69
|
-
layout:
|
|
70
|
-
|
|
69
|
+
layout: 'fullscreen',
|
|
70
|
+
'web-component': {
|
|
71
71
|
render: SecondaryNav,
|
|
72
72
|
},
|
|
73
73
|
html: {
|
|
74
|
-
render: HtmlSecondaryNav
|
|
75
|
-
}
|
|
74
|
+
render: HtmlSecondaryNav,
|
|
75
|
+
},
|
|
76
76
|
};
|