@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,48 +1,48 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Badge',
|
|
3
3
|
argTypes: {
|
|
4
4
|
variant: {
|
|
5
|
-
options: [
|
|
5
|
+
options: ['default', 'success', 'warning', 'inactive', 'error'],
|
|
6
6
|
control: {
|
|
7
|
-
type:
|
|
7
|
+
type: 'select',
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
dot: {
|
|
11
11
|
control: {
|
|
12
|
-
type:
|
|
12
|
+
type: 'boolean',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
text: {
|
|
16
|
-
type: { name:
|
|
16
|
+
type: { name: 'string', required: false },
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
export const Badge = ({ variant, dot, text }) => {
|
|
21
|
-
let attrs =
|
|
22
|
-
if (variant !==
|
|
21
|
+
let attrs = '';
|
|
22
|
+
if (variant !== 'default')
|
|
23
23
|
attrs += ` variant="${variant}"`;
|
|
24
24
|
if (dot)
|
|
25
|
-
attrs +=
|
|
25
|
+
attrs += ' dot';
|
|
26
26
|
return `<xpl-badge${attrs}>${text}</xpl-badge>`;
|
|
27
27
|
};
|
|
28
28
|
Badge.parameters = {
|
|
29
|
-
layout:
|
|
30
|
-
|
|
29
|
+
layout: 'centered',
|
|
30
|
+
'web-component': {
|
|
31
31
|
render: Badge,
|
|
32
32
|
},
|
|
33
33
|
html: {
|
|
34
34
|
render({ dot, variant, text }) {
|
|
35
|
-
let className =
|
|
35
|
+
let className = 'xpl-badge';
|
|
36
36
|
if (dot)
|
|
37
|
-
className +=
|
|
38
|
-
if (variant !==
|
|
39
|
-
className +=
|
|
37
|
+
className += ' xpl-badge--dot';
|
|
38
|
+
if (variant !== 'default')
|
|
39
|
+
className += ' xpl-badge--' + variant;
|
|
40
40
|
return `<div class="${className}">${text}</div>`;
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
Badge.args = {
|
|
45
|
-
variant:
|
|
45
|
+
variant: 'default',
|
|
46
46
|
dot: false,
|
|
47
|
-
text:
|
|
47
|
+
text: 'Badge',
|
|
48
48
|
};
|
|
@@ -1,34 +1,36 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Navigation/Breadcrumbs',
|
|
3
3
|
argTypes: {
|
|
4
4
|
items: {
|
|
5
5
|
options: [1, 2, 3],
|
|
6
6
|
control: {
|
|
7
|
-
type:
|
|
7
|
+
type: 'select',
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
first: {
|
|
11
|
-
type: { name: 'string', required: false }
|
|
11
|
+
type: { name: 'string', required: false },
|
|
12
12
|
},
|
|
13
13
|
second: {
|
|
14
|
-
type: { name: 'string', required: false }
|
|
14
|
+
type: { name: 'string', required: false },
|
|
15
15
|
},
|
|
16
16
|
third: {
|
|
17
|
-
type: { name: 'string', required: false }
|
|
18
|
-
}
|
|
19
|
-
}
|
|
17
|
+
type: { name: 'string', required: false },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
20
|
};
|
|
21
21
|
export const Breadcrumbs = ({ first, second, third, items }) => {
|
|
22
22
|
const slotMap = {
|
|
23
23
|
0: first,
|
|
24
24
|
1: second,
|
|
25
|
-
2: third
|
|
25
|
+
2: third,
|
|
26
26
|
};
|
|
27
|
-
const breadcrumbItems = Array.from({ length: items })
|
|
27
|
+
const breadcrumbItems = Array.from({ length: items })
|
|
28
|
+
.map((_u, i) => {
|
|
28
29
|
return `<xpl-breadcrumb-item>
|
|
29
30
|
${slotMap[i]}
|
|
30
31
|
</xpl-breadcrumb-item>`;
|
|
31
|
-
})
|
|
32
|
+
})
|
|
33
|
+
.join('\n');
|
|
32
34
|
return `
|
|
33
35
|
<xpl-breadcrumbs>
|
|
34
36
|
${breadcrumbItems}
|
|
@@ -99,17 +101,17 @@ const BreadCrumbsHTML = () => `
|
|
|
99
101
|
</nav>
|
|
100
102
|
`;
|
|
101
103
|
Breadcrumbs.parameters = {
|
|
102
|
-
layout:
|
|
103
|
-
|
|
104
|
-
render: Breadcrumbs
|
|
104
|
+
layout: 'centered',
|
|
105
|
+
'web-component': {
|
|
106
|
+
render: Breadcrumbs,
|
|
105
107
|
},
|
|
106
108
|
html: {
|
|
107
|
-
render: BreadCrumbsHTML
|
|
108
|
-
}
|
|
109
|
+
render: BreadCrumbsHTML,
|
|
110
|
+
},
|
|
109
111
|
};
|
|
110
112
|
Breadcrumbs.args = {
|
|
111
113
|
first: '<a href="javascript:;">Locations</a>',
|
|
112
114
|
second: '<a href="javascript:;">Dupont Circle</a>',
|
|
113
115
|
third: '<a href="javascript:;">Class A</a>',
|
|
114
|
-
items: 3
|
|
116
|
+
items: 3,
|
|
115
117
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Button Row',
|
|
3
3
|
argTypes: {
|
|
4
4
|
primary: {
|
|
5
|
-
type: { name:
|
|
5
|
+
type: { name: 'string', required: true },
|
|
6
6
|
},
|
|
7
7
|
secondary: {
|
|
8
|
-
type: { name:
|
|
8
|
+
type: { name: 'string', required: false },
|
|
9
9
|
},
|
|
10
10
|
tertiary: {
|
|
11
|
-
type: { name:
|
|
11
|
+
type: { name: 'string', required: false },
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
export const ButtonRow = ({ primary, secondary, tertiary }) => {
|
|
16
|
-
let attrs =
|
|
16
|
+
let attrs = '';
|
|
17
17
|
if (primary)
|
|
18
18
|
attrs += ` primary="${primary}"`;
|
|
19
19
|
if (secondary)
|
|
@@ -32,22 +32,26 @@ export const ButtonRow = ({ primary, secondary, tertiary }) => {
|
|
|
32
32
|
`;
|
|
33
33
|
};
|
|
34
34
|
ButtonRow.parameters = {
|
|
35
|
-
layout:
|
|
36
|
-
|
|
35
|
+
layout: 'centered',
|
|
36
|
+
'web-component': {
|
|
37
37
|
render: ButtonRow,
|
|
38
38
|
},
|
|
39
39
|
html: {
|
|
40
40
|
render({ primary, secondary, tertiary }) {
|
|
41
41
|
return `<div class="xpl-button-row">
|
|
42
|
-
<div class="xpl-button-row-inner">${secondary
|
|
42
|
+
<div class="xpl-button-row-inner">${secondary
|
|
43
|
+
? `
|
|
43
44
|
<button class="xpl-button xpl-button--secondary">
|
|
44
45
|
${secondary}
|
|
45
|
-
</button>`
|
|
46
|
+
</button>`
|
|
47
|
+
: `
|
|
46
48
|
<div></div><!-- empty div included for layout only -->`}
|
|
47
|
-
<div>${tertiary
|
|
49
|
+
<div>${tertiary
|
|
50
|
+
? `
|
|
48
51
|
<button class="xpl-button xpl-button--subtle">
|
|
49
52
|
${tertiary}
|
|
50
|
-
</button>`
|
|
53
|
+
</button>`
|
|
54
|
+
: ''}
|
|
51
55
|
<button class="xpl-button">
|
|
52
56
|
${primary}
|
|
53
57
|
</button>
|
|
@@ -58,7 +62,7 @@ ButtonRow.parameters = {
|
|
|
58
62
|
},
|
|
59
63
|
};
|
|
60
64
|
ButtonRow.args = {
|
|
61
|
-
primary:
|
|
62
|
-
secondary:
|
|
63
|
-
tertiary:
|
|
65
|
+
primary: 'Save',
|
|
66
|
+
secondary: '',
|
|
67
|
+
tertiary: '',
|
|
64
68
|
};
|
|
@@ -1,87 +1,98 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Button',
|
|
3
3
|
argTypes: {
|
|
4
4
|
text: {
|
|
5
|
-
type: { name:
|
|
5
|
+
type: { name: 'string', required: false },
|
|
6
6
|
},
|
|
7
7
|
variant: {
|
|
8
|
-
options: [
|
|
8
|
+
options: ['primary', 'secondary', 'subtle'],
|
|
9
9
|
control: {
|
|
10
|
-
type:
|
|
10
|
+
type: 'select',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
state: {
|
|
14
|
+
options: ['neutral', 'success', 'warning'],
|
|
15
|
+
control: {
|
|
16
|
+
type: 'select',
|
|
11
17
|
},
|
|
12
18
|
},
|
|
13
19
|
disabled: {
|
|
14
20
|
control: {
|
|
15
|
-
type:
|
|
21
|
+
type: 'boolean',
|
|
16
22
|
},
|
|
17
23
|
},
|
|
18
24
|
size: {
|
|
19
|
-
options: [
|
|
25
|
+
options: ['default', 'sm', 'xs'],
|
|
20
26
|
control: {
|
|
21
|
-
type:
|
|
27
|
+
type: 'select',
|
|
22
28
|
},
|
|
23
29
|
},
|
|
24
30
|
icon: {
|
|
25
|
-
options: [
|
|
31
|
+
options: ['none', 'leading', 'trailing'],
|
|
26
32
|
control: {
|
|
27
|
-
type:
|
|
33
|
+
type: 'select',
|
|
28
34
|
},
|
|
29
35
|
},
|
|
30
|
-
|
|
36
|
+
link: {
|
|
31
37
|
control: {
|
|
32
|
-
type:
|
|
38
|
+
type: 'boolean',
|
|
33
39
|
},
|
|
34
40
|
},
|
|
35
41
|
},
|
|
36
42
|
};
|
|
37
|
-
export const Button = ({ variant, size, disabled,
|
|
38
|
-
let attrs =
|
|
39
|
-
if (variant !==
|
|
43
|
+
export const Button = ({ variant, size, disabled, state, text, icon, link, }) => {
|
|
44
|
+
let attrs = '';
|
|
45
|
+
if (variant !== 'primary')
|
|
40
46
|
attrs += ` variant="${variant}"`;
|
|
41
|
-
if (size !==
|
|
47
|
+
if (size !== 'default')
|
|
42
48
|
attrs += ` size="${size}"`;
|
|
43
49
|
if (disabled)
|
|
44
|
-
attrs +=
|
|
45
|
-
if (
|
|
46
|
-
attrs +=
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
attrs += ' disabled';
|
|
51
|
+
if (text === '')
|
|
52
|
+
attrs += ' icon-only';
|
|
53
|
+
const iconSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-coffee"><path d="M18 8h1a4 4 0 0 1 0 8h-1"/><path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"/><line x1="6" y1="1" x2="6" y2="4"/><line x1="10" y1="1" x2="10" y2="4"/><line x1="14" y1="1" x2="14" y2="4"/></svg>`;
|
|
54
|
+
const innerHtml = (link) => {
|
|
55
|
+
const textBlock = `
|
|
56
|
+
${icon == 'leading' ? iconSvg : ''}
|
|
57
|
+
${text}
|
|
58
|
+
${icon == 'trailing' ? iconSvg : ''}
|
|
59
|
+
`;
|
|
60
|
+
return link ? `<a href='javascript:;'>${textBlock}</a>` : textBlock;
|
|
61
|
+
};
|
|
62
|
+
return `<xpl-button
|
|
63
|
+
variant='${variant}'
|
|
64
|
+
size='${size}'
|
|
65
|
+
state='${state}'
|
|
66
|
+
${attrs}
|
|
67
|
+
${link ? 'link' : ''}
|
|
68
|
+
>
|
|
69
|
+
${innerHtml(link)}
|
|
70
|
+
</xpl-button>`;
|
|
52
71
|
};
|
|
53
|
-
const HtmlButton = ({ variant, size, disabled,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
className += " xpl-button--warning";
|
|
61
|
-
if (size === "sm")
|
|
62
|
-
className += " xpl-button--sm";
|
|
63
|
-
if (size === "xs")
|
|
64
|
-
className += " xpl-button--xs";
|
|
65
|
-
const iconOnly = icon && text === "";
|
|
66
|
-
if (iconOnly)
|
|
67
|
-
className += " xpl-button--icon-only";
|
|
68
|
-
let attrs = "";
|
|
72
|
+
const HtmlButton = ({ variant, size, state, disabled, text, icon, link }) => {
|
|
73
|
+
const iconSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-coffee"><path d="M18 8h1a4 4 0 0 1 0 8h-1"/><path d="M2 8h16v9a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4V8z"/><line x1="6" y1="1" x2="6" y2="4"/><line x1="10" y1="1" x2="10" y2="4"/><line x1="14" y1="1" x2="14" y2="4"/></svg>`;
|
|
74
|
+
const className = `xpl-button
|
|
75
|
+
xpl-button--${size}
|
|
76
|
+
xpl-button--${state}
|
|
77
|
+
xpl-button--${variant} `;
|
|
78
|
+
let attrs = '';
|
|
69
79
|
if (disabled)
|
|
70
|
-
attrs +=
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
attrs += ' disabled';
|
|
81
|
+
const innerHtml = (link) => {
|
|
82
|
+
const textBlock = `
|
|
83
|
+
${icon == 'leading' ? iconSvg : ''}
|
|
84
|
+
${text}
|
|
85
|
+
${icon == 'trailing' ? iconSvg : ''}
|
|
86
|
+
`;
|
|
87
|
+
return link
|
|
88
|
+
? `<a href='javascript:;' ${attrs}>${textBlock}</a>`
|
|
89
|
+
: `<button>${textBlock}</button>`;
|
|
90
|
+
};
|
|
91
|
+
return `<span class=${className}>${innerHtml(link)}</span>`;
|
|
81
92
|
};
|
|
82
93
|
Button.parameters = {
|
|
83
|
-
layout:
|
|
84
|
-
|
|
94
|
+
layout: 'centered',
|
|
95
|
+
'web-component': {
|
|
85
96
|
render: Button,
|
|
86
97
|
},
|
|
87
98
|
html: {
|
|
@@ -89,10 +100,11 @@ Button.parameters = {
|
|
|
89
100
|
},
|
|
90
101
|
};
|
|
91
102
|
Button.args = {
|
|
92
|
-
|
|
93
|
-
|
|
103
|
+
link: false,
|
|
104
|
+
variant: 'primary',
|
|
105
|
+
size: 'default',
|
|
94
106
|
disabled: false,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
107
|
+
state: 'neutral',
|
|
108
|
+
text: 'Get Coffee',
|
|
109
|
+
icon: 'leading',
|
|
98
110
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Checkbox',
|
|
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
|
indeterminate: {
|
|
21
21
|
control: {
|
|
22
|
-
type:
|
|
22
|
+
type: 'boolean',
|
|
23
23
|
},
|
|
24
24
|
},
|
|
25
25
|
styled: {
|
|
26
26
|
control: {
|
|
27
|
-
type:
|
|
27
|
+
type: 'boolean',
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
};
|
|
32
32
|
export const Checkbox = ({ label, description, checked, disabled, indeterminate, styled, }) => {
|
|
33
|
-
let attrs =
|
|
33
|
+
let attrs = '';
|
|
34
34
|
if (description)
|
|
35
35
|
attrs += ` description="${description}"`;
|
|
36
36
|
if (checked)
|
|
@@ -44,33 +44,35 @@ export const Checkbox = ({ label, description, checked, disabled, indeterminate,
|
|
|
44
44
|
return `<xpl-checkbox${attrs}>${label}</xpl-checkbox>`;
|
|
45
45
|
};
|
|
46
46
|
Checkbox.parameters = {
|
|
47
|
-
layout:
|
|
48
|
-
|
|
47
|
+
layout: 'centered',
|
|
48
|
+
'web-component': {
|
|
49
49
|
render: Checkbox,
|
|
50
50
|
},
|
|
51
51
|
html: {
|
|
52
|
-
render({ label, description, checked, disabled, indeterminate, styled }) {
|
|
53
|
-
let attrs =
|
|
52
|
+
render({ label, description, checked, disabled, indeterminate, styled, }) {
|
|
53
|
+
let attrs = '';
|
|
54
54
|
if (checked)
|
|
55
55
|
attrs += ` checked`;
|
|
56
56
|
if (disabled)
|
|
57
57
|
attrs += ` disabled`;
|
|
58
58
|
if (indeterminate)
|
|
59
59
|
attrs += ` indeterminate`;
|
|
60
|
-
return `<div class="xpl-checkbox-radio-container${styled ?
|
|
60
|
+
return `<div class="xpl-checkbox-radio-container${styled ? ' styled' : ''}${disabled ? ' disabled' : ''}">
|
|
61
61
|
<input class="xpl-checkbox" id="id" type="checkbox"${attrs}></input>
|
|
62
|
-
<label class="xpl-label${disabled ?
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
<label class="xpl-label${disabled ? ' xpl-label--disabled' : ''}" for="id">${label}${description
|
|
63
|
+
? `
|
|
64
|
+
<small class="xpl-description${disabled ? ' xpl-description--disabled' : ''}">${description}</small>
|
|
65
|
+
`
|
|
66
|
+
: ''}</label>
|
|
65
67
|
</div>`;
|
|
66
68
|
},
|
|
67
69
|
},
|
|
68
70
|
};
|
|
69
71
|
Checkbox.args = {
|
|
70
|
-
label:
|
|
71
|
-
description:
|
|
72
|
+
label: 'Checkbox',
|
|
73
|
+
description: '',
|
|
72
74
|
checked: false,
|
|
73
75
|
disabled: false,
|
|
74
76
|
indeterminate: false,
|
|
75
|
-
styled: false
|
|
77
|
+
styled: false,
|
|
76
78
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { v4 as uuid } from
|
|
1
|
+
import { v4 as uuid } from 'uuid';
|
|
2
2
|
export default {
|
|
3
|
-
title:
|
|
3
|
+
title: 'Components/Choicelist',
|
|
4
4
|
argTypes: {
|
|
5
5
|
multi: {
|
|
6
6
|
control: {
|
|
7
|
-
type:
|
|
7
|
+
type: 'boolean',
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
styled: {
|
|
11
11
|
control: {
|
|
12
|
-
type:
|
|
12
|
+
type: 'boolean',
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
const data = [
|
|
18
18
|
{
|
|
19
|
-
label:
|
|
20
|
-
description:
|
|
19
|
+
label: 'Label #1',
|
|
20
|
+
description: 'Lorem ipsum dolor sit amet',
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
label:
|
|
24
|
-
description:
|
|
23
|
+
label: 'Label #2',
|
|
24
|
+
description: 'Lorem ipsum dolor sit amet',
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
label:
|
|
28
|
-
description:
|
|
29
|
-
}
|
|
27
|
+
label: 'Label #3',
|
|
28
|
+
description: 'Lorem ipsum dolor sit amet',
|
|
29
|
+
},
|
|
30
30
|
];
|
|
31
31
|
const script = ({ id, multi, styled }) => `
|
|
32
32
|
(function() {
|
|
@@ -41,18 +41,18 @@ export const Choicelist = ({ multi, styled }) => {
|
|
|
41
41
|
return `<xpl-choicelist id="${id}" name="choicelist"></xpl-choicelist><script>${script({
|
|
42
42
|
id,
|
|
43
43
|
multi,
|
|
44
|
-
styled
|
|
44
|
+
styled,
|
|
45
45
|
})}</script>`;
|
|
46
46
|
};
|
|
47
47
|
Choicelist.parameters = {
|
|
48
|
-
layout:
|
|
49
|
-
|
|
48
|
+
layout: 'centered',
|
|
49
|
+
'web-component': {
|
|
50
50
|
render({ multi, styled }) {
|
|
51
|
-
let attrs =
|
|
51
|
+
let attrs = '';
|
|
52
52
|
if (multi)
|
|
53
|
-
attrs +=
|
|
53
|
+
attrs += ' multi';
|
|
54
54
|
if (styled)
|
|
55
|
-
attrs +=
|
|
55
|
+
attrs += ' styled';
|
|
56
56
|
return [
|
|
57
57
|
`<xpl-choicelist${attrs} name="choicelist-name"></xpl-choicelist>`,
|
|
58
58
|
`choicelist.choices = [
|
|
@@ -71,9 +71,9 @@ Choicelist.parameters = {
|
|
|
71
71
|
},
|
|
72
72
|
html: {
|
|
73
73
|
render({ multi, styled }) {
|
|
74
|
-
let className =
|
|
74
|
+
let className = 'xpl-choicelist';
|
|
75
75
|
if (styled)
|
|
76
|
-
className +=
|
|
76
|
+
className += ' xpl-choicelist--styled';
|
|
77
77
|
const output = [];
|
|
78
78
|
if (styled)
|
|
79
79
|
output.push(`WARNING: For \`styled\` choicelists, there is
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Content Area',
|
|
3
3
|
argTypes: {
|
|
4
4
|
size: {
|
|
5
|
-
options: [
|
|
5
|
+
options: ['wide', 'narrow', 'full'],
|
|
6
6
|
control: {
|
|
7
|
-
type:
|
|
7
|
+
type: 'select',
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
|
-
}
|
|
10
|
+
},
|
|
11
11
|
};
|
|
12
12
|
export const ContentArea = ({ size }) => `<xpl-content-area size="${size}">
|
|
13
13
|
<div>
|
|
@@ -25,7 +25,7 @@ export const ContentArea = ({ size }) => `<xpl-content-area size="${size}">
|
|
|
25
25
|
</div>
|
|
26
26
|
</xpl-content-area>`;
|
|
27
27
|
ContentArea.parameters = {
|
|
28
|
-
|
|
28
|
+
'web-component': {
|
|
29
29
|
render: ContentArea,
|
|
30
30
|
},
|
|
31
31
|
html: {
|
|
@@ -49,5 +49,5 @@ ContentArea.parameters = {
|
|
|
49
49
|
},
|
|
50
50
|
};
|
|
51
51
|
ContentArea.args = {
|
|
52
|
-
size:
|
|
52
|
+
size: 'wide',
|
|
53
53
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
title:
|
|
2
|
+
title: 'Components/Divider',
|
|
3
3
|
argTypes: {
|
|
4
4
|
tier: {
|
|
5
5
|
options: [3, 2, 1, 0],
|
|
6
6
|
control: {
|
|
7
|
-
type:
|
|
7
|
+
type: 'select',
|
|
8
8
|
},
|
|
9
9
|
},
|
|
10
10
|
text: {
|
|
11
|
-
type: { name:
|
|
11
|
+
type: { name: 'string', required: false },
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
14
|
};
|
|
15
15
|
export const Divider = ({ tier, text }) => {
|
|
16
|
-
let attrs =
|
|
16
|
+
let attrs = '';
|
|
17
17
|
attrs += ` tier="${tier}"`;
|
|
18
18
|
return `<xpl-divider${attrs}>${text}</xpl-divider>`;
|
|
19
19
|
};
|
|
20
20
|
Divider.parameters = {
|
|
21
|
-
layout:
|
|
22
|
-
|
|
21
|
+
layout: 'centered',
|
|
22
|
+
'web-component': {
|
|
23
23
|
render: Divider,
|
|
24
24
|
},
|
|
25
25
|
html: {
|
|
@@ -30,5 +30,5 @@ Divider.parameters = {
|
|
|
30
30
|
};
|
|
31
31
|
Divider.args = {
|
|
32
32
|
tier: 3,
|
|
33
|
-
text:
|
|
33
|
+
text: 'Lorem Ipsum',
|
|
34
34
|
};
|