@roadtrip/components 3.32.4 → 3.32.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/road-badge_14.cjs.entry.js +9 -12
- package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
- package/dist/collection/components/accordion/accordion.stories.js +38 -4
- package/dist/collection/components/alert/alert.stories.js +7 -0
- package/dist/collection/components/asset/asset.stories.js +6 -0
- package/dist/collection/components/autocomplete/autocomplete.stories.js +43 -47
- package/dist/collection/components/avatar/avatar.stories.js +6 -0
- package/dist/collection/components/badge/badge.stories.js +6 -0
- package/dist/collection/components/banner/banner.stories.js +33 -3
- package/dist/collection/components/button/button.stories.js +58 -67
- package/dist/collection/components/button-floating/button-floating.stories.js +32 -23
- package/dist/collection/components/card/card.stories.js +25 -15
- package/dist/collection/components/carousel/carousel.stories.js +72 -280
- package/dist/collection/components/checkbox/checkbox.stories.js +54 -33
- package/dist/collection/components/chip/chip.stories.js +32 -47
- package/dist/collection/components/collapse/collapse.stories.js +88 -78
- package/dist/collection/components/content-card/content-card.stories.js +30 -11
- package/dist/collection/components/counter/counter.stories.js +40 -11
- package/dist/collection/components/dialog/dialog.stories.js +37 -51
- package/dist/collection/components/drawer/drawer.js +9 -12
- package/dist/collection/components/drawer/drawer.js.map +1 -1
- package/dist/collection/components/drawer/drawer.stories.js +64 -134
- package/dist/collection/components/dropdown/dropdown.stories.js +69 -53
- package/dist/collection/components/duration/duration.stories.js +49 -45
- package/dist/collection/components/flap/flap.stories.js +22 -10
- package/dist/collection/components/input/input.stories.js +33 -0
- package/dist/collection/components/item/item.stories.js +25 -0
- package/dist/collection/components/list/list.stories.js +2 -0
- package/dist/collection/components/modal/modal.stories.js +14 -0
- package/dist/collection/components/navbar/navbar.stories.js +3 -0
- package/dist/collection/components/navbar-v2/navbar-v2.stories.js +4 -0
- package/dist/collection/components/phone-number-input/phone-number-input.stories.js +15 -1
- package/dist/collection/components/plate-number/plate-number.stories.js +13 -0
- package/dist/collection/components/profil-dropdown/profil-dropdown.stories.js +8 -0
- package/dist/collection/components/progress/progress.stories.js +12 -0
- package/dist/collection/components/progress-indicator-horizontal/progress-indicator-horizontal.stories.js +8 -0
- package/dist/collection/components/progress-indicator-vertical/progress-indicator-vertical.stories.js +1 -0
- package/dist/collection/components/progress-tracker/progress-tracker.stories.js +1 -0
- package/dist/collection/components/radio/radio.stories.js +13 -0
- package/dist/collection/components/range/range.stories.js +11 -0
- package/dist/collection/components/rating/rating.stories.js +7 -0
- package/dist/collection/components/segmented-buttons/segmented-buttons.stories.js +2 -0
- package/dist/collection/components/select/select.stories.js +13 -0
- package/dist/collection/components/select-filter/select-filter.stories.js +5 -0
- package/dist/collection/components/skeleton/skeleton.stories.js +2 -0
- package/dist/collection/components/spinner/spinner.stories.js +2 -0
- package/dist/collection/components/table/table.stories.js +1 -0
- package/dist/collection/components/tabs/tabs.stories.js +2 -0
- package/dist/collection/components/tag/tag.stories.js +3 -0
- package/dist/collection/components/text/text.stories.js +2 -0
- package/dist/collection/components/textarea/textarea.stories.js +26 -0
- package/dist/collection/components/toast/toast.stories.js +6 -0
- package/dist/collection/components/toggle/toggle.stories.js +14 -0
- package/dist/collection/components/toolbar/toolbar.stories.js +6 -0
- package/dist/collection/components/toolbar-v2/toolbar-v2.stories.js +5 -0
- package/dist/collection/components/tooltip/tooltip.stories.js +11 -0
- package/dist/esm/road-badge_14.entry.js +9 -12
- package/dist/esm/road-badge_14.entry.js.map +1 -1
- package/dist/roadtrip/{p-e2a00f9c.entry.js → p-b5c4455e.entry.js} +3 -3
- package/dist/roadtrip/p-b5c4455e.entry.js.map +1 -0
- package/dist/roadtrip/roadtrip.esm.js +1 -1
- package/dist/types/components/drawer/drawer.d.ts +0 -1
- package/hydrate/index.js +271 -255
- package/hydrate/index.mjs +271 -255
- package/package.json +1 -1
- package/dist/roadtrip/p-e2a00f9c.entry.js.map +0 -1
|
@@ -9,26 +9,54 @@ export default {
|
|
|
9
9
|
argTypes: {
|
|
10
10
|
'is-open': {
|
|
11
11
|
control: 'boolean',
|
|
12
|
+
description: 'Set to `true` to open the accordion and to `false` to close it.',
|
|
13
|
+
table: {
|
|
14
|
+
defaultValue: { summary: 'false' },
|
|
15
|
+
type: { summary: null },
|
|
16
|
+
required: { summary: false }
|
|
17
|
+
},
|
|
12
18
|
},
|
|
13
19
|
'is-light': {
|
|
14
20
|
control: 'boolean',
|
|
21
|
+
description: 'Set to `true` to remove border the accordion and to `false` to add border it.',
|
|
22
|
+
table: {
|
|
23
|
+
defaultValue: { summary: 'false' },
|
|
24
|
+
type: { summary: null },
|
|
25
|
+
required: { summary: false }
|
|
26
|
+
},
|
|
15
27
|
},
|
|
16
28
|
'is-light-separator': {
|
|
17
29
|
control: 'boolean',
|
|
30
|
+
description: 'Set to `true` to add a border in the header and the content only for the light accordion.',
|
|
31
|
+
table: {
|
|
32
|
+
defaultValue: { summary: 'false' },
|
|
33
|
+
type: { summary: null },
|
|
34
|
+
required: { summary: false }
|
|
35
|
+
},
|
|
18
36
|
},
|
|
19
37
|
'is-small': {
|
|
20
38
|
control: 'boolean',
|
|
39
|
+
description: 'Set to `true` to add the small version only for the light accordion.',
|
|
40
|
+
table: {
|
|
41
|
+
defaultValue: { summary: 'false' },
|
|
42
|
+
type: { summary: null },
|
|
43
|
+
required: { summary: false }
|
|
44
|
+
},
|
|
21
45
|
},
|
|
22
46
|
'icon-left': {
|
|
23
47
|
control: 'text',
|
|
48
|
+
description: 'Icon of the alert, it should be a road-icon element.\n`<road-icon name=\"alert-info-outline\" class=\"mr-16\"></road-icon>`',
|
|
24
49
|
},
|
|
25
50
|
header: {
|
|
26
51
|
control: 'text',
|
|
52
|
+
description: "Content of the header."
|
|
27
53
|
},
|
|
28
54
|
' ': {
|
|
29
55
|
control: 'text',
|
|
56
|
+
description: "Content hidden in the accordion."
|
|
30
57
|
},
|
|
31
58
|
'--accordion-header-border': {
|
|
59
|
+
description: "height of the border of the header",
|
|
32
60
|
table: {
|
|
33
61
|
defaultValue: { summary: '1px' },
|
|
34
62
|
},
|
|
@@ -37,6 +65,7 @@ export default {
|
|
|
37
65
|
},
|
|
38
66
|
},
|
|
39
67
|
'--content-margin': {
|
|
68
|
+
description: "margin of the accordion content",
|
|
40
69
|
table: {
|
|
41
70
|
defaultValue: { summary: '0 1rem 1rem' },
|
|
42
71
|
},
|
|
@@ -45,6 +74,7 @@ export default {
|
|
|
45
74
|
},
|
|
46
75
|
},
|
|
47
76
|
'--content-padding': {
|
|
77
|
+
description: "padding of the accordion content",
|
|
48
78
|
table: {
|
|
49
79
|
defaultValue: { summary: '1rem 0.5rem 0' },
|
|
50
80
|
},
|
|
@@ -53,6 +83,7 @@ export default {
|
|
|
53
83
|
},
|
|
54
84
|
},
|
|
55
85
|
'--header-padding': {
|
|
86
|
+
description: "padding horizontal and vertical of the accordion header",
|
|
56
87
|
table: {
|
|
57
88
|
defaultValue: { summary: 'var(--road-spacing-04) var(--road-spacing-05)' },
|
|
58
89
|
},
|
|
@@ -61,6 +92,7 @@ export default {
|
|
|
61
92
|
},
|
|
62
93
|
},
|
|
63
94
|
'--header-padding-vertical': {
|
|
95
|
+
description: "padding of the accordion header",
|
|
64
96
|
table: {
|
|
65
97
|
defaultValue: { summary: 'var(--road-spacing-04)' },
|
|
66
98
|
},
|
|
@@ -69,6 +101,7 @@ export default {
|
|
|
69
101
|
},
|
|
70
102
|
},
|
|
71
103
|
'--icon-color': {
|
|
104
|
+
description: "color of the chevron icon",
|
|
72
105
|
table: {
|
|
73
106
|
defaultValue: { summary: 'var(--road-icon)' },
|
|
74
107
|
},
|
|
@@ -77,6 +110,7 @@ export default {
|
|
|
77
110
|
},
|
|
78
111
|
},
|
|
79
112
|
'--max-height': {
|
|
113
|
+
description: "maximum height of the collapse content",
|
|
80
114
|
table: {
|
|
81
115
|
defaultValue: { summary: 'none' },
|
|
82
116
|
},
|
|
@@ -86,10 +120,10 @@ export default {
|
|
|
86
120
|
},
|
|
87
121
|
},
|
|
88
122
|
args: {
|
|
89
|
-
'is-open':
|
|
90
|
-
'is-light':
|
|
91
|
-
'is-light-separator':
|
|
92
|
-
'is-small':
|
|
123
|
+
'is-open': false,
|
|
124
|
+
'is-light': false,
|
|
125
|
+
'is-light-separator': false,
|
|
126
|
+
'is-small': false,
|
|
93
127
|
'icon-left': ``,
|
|
94
128
|
header: `Accordion`,
|
|
95
129
|
' ': `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.`,
|
|
@@ -8,30 +8,37 @@ export default {
|
|
|
8
8
|
component: 'road-alert',
|
|
9
9
|
argTypes: {
|
|
10
10
|
color: {
|
|
11
|
+
description: "Set the color of alert. e.g. info, success, warning, danger",
|
|
11
12
|
options: ['info', 'success', 'warning', 'danger'],
|
|
12
13
|
control: {
|
|
13
14
|
type: 'radio',
|
|
14
15
|
},
|
|
15
16
|
},
|
|
16
17
|
icon: {
|
|
18
|
+
description: "Icon of the alert, it should be a road-icon element.",
|
|
17
19
|
options: list,
|
|
18
20
|
control: {
|
|
19
21
|
type: 'select',
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
link: {
|
|
25
|
+
description: "Text Link display in the alert",
|
|
23
26
|
control: 'text',
|
|
24
27
|
},
|
|
25
28
|
button: {
|
|
29
|
+
description: "Button display in the alert\n`<road-button size=\"sm\">Label</road-button>`",
|
|
26
30
|
control: 'text',
|
|
27
31
|
},
|
|
28
32
|
label: {
|
|
33
|
+
description: "Title display in the alert",
|
|
29
34
|
control: 'text',
|
|
30
35
|
},
|
|
31
36
|
url: {
|
|
37
|
+
description: "url display in the link",
|
|
32
38
|
control: 'text',
|
|
33
39
|
},
|
|
34
40
|
' ': {
|
|
41
|
+
description: "Message of the alert.",
|
|
35
42
|
control: 'text',
|
|
36
43
|
},
|
|
37
44
|
},
|
|
@@ -19,24 +19,30 @@ Playground.args = {
|
|
|
19
19
|
};
|
|
20
20
|
Playground.argTypes = {
|
|
21
21
|
name: {
|
|
22
|
+
description: "Specifies which illustration to use from the built-in set of illustrations.",
|
|
22
23
|
options: asset,
|
|
23
24
|
control: {
|
|
24
25
|
type: 'select',
|
|
25
26
|
},
|
|
26
27
|
},
|
|
27
28
|
lazy: {
|
|
29
|
+
description: "If enabled, road-illustration will be loaded lazily when it's visible in the viewport.\nDefault, `false`.",
|
|
28
30
|
control: 'boolean',
|
|
29
31
|
},
|
|
30
32
|
'aria-label': {
|
|
33
|
+
description: "Specifies the label to use for accessibility. Defaults to the illustration name.",
|
|
31
34
|
control: 'text',
|
|
32
35
|
},
|
|
33
36
|
'aria-hidden': {
|
|
37
|
+
description: "Set the illustration to hidden, respectively `true`, to remove it from the accessibility tree.",
|
|
34
38
|
control: 'text',
|
|
35
39
|
},
|
|
36
40
|
src: {
|
|
41
|
+
description: "Specifies the exact `src` of an SVG file to use.",
|
|
37
42
|
control: 'text',
|
|
38
43
|
},
|
|
39
44
|
sanitize: {
|
|
45
|
+
description: "When set to `false`, SVG content that is HTTP fetched will not be checked\nif the response SVG content has any `<script>` elements, or any attributes\nthat start with `on`, such as `onclick`.",
|
|
40
46
|
control: 'boolean',
|
|
41
47
|
},
|
|
42
48
|
};
|
|
@@ -6,18 +6,29 @@ export default {
|
|
|
6
6
|
component: 'road-autocomplete',
|
|
7
7
|
parameters: {
|
|
8
8
|
actions: {
|
|
9
|
-
handles: ['roadchange', 'roadblur', 'roadfocus'],
|
|
9
|
+
handles: ['roadchange', 'roadblur', 'roadfocus', 'roadselected'],
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
12
|
argTypes: {
|
|
13
|
+
options: {
|
|
14
|
+
control: 'object',
|
|
15
|
+
description: 'Array of options available for autocomplete.',
|
|
16
|
+
table: {
|
|
17
|
+
defaultValue: { summary: '[{ value: "value1", label: "value1" }]' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
13
20
|
' ': {
|
|
14
21
|
control: 'text',
|
|
22
|
+
description: 'Slot for inserting an input inside the autocomplete.',
|
|
15
23
|
},
|
|
16
24
|
roadselected: {
|
|
17
25
|
action: 'roadselected',
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
description: 'Fires when an option is selected.',
|
|
27
|
+
table: {
|
|
28
|
+
category: 'Events',
|
|
29
|
+
type: { summary: 'CustomEvent' },
|
|
20
30
|
},
|
|
31
|
+
control: { type: null },
|
|
21
32
|
},
|
|
22
33
|
},
|
|
23
34
|
args: {
|
|
@@ -29,11 +40,13 @@ export default {
|
|
|
29
40
|
},
|
|
30
41
|
};
|
|
31
42
|
|
|
32
|
-
|
|
33
|
-
<road-autocomplete .options=${args.options} @roadselected=${event => args.roadselected(event.detail)}>
|
|
34
|
-
|
|
35
|
-
</road-autocomplete>
|
|
43
|
+
const Template = (args) => html`
|
|
44
|
+
<road-autocomplete .options=${args.options} @roadselected=${event => args.roadselected(event.detail)}>
|
|
45
|
+
${unsafeHTML(args[' '])}
|
|
46
|
+
</road-autocomplete>
|
|
36
47
|
`;
|
|
48
|
+
|
|
49
|
+
export const Playground = Template.bind({});
|
|
37
50
|
Playground.args = {
|
|
38
51
|
' ': `<road-input
|
|
39
52
|
class="mb-0"
|
|
@@ -43,14 +56,9 @@ Playground.args = {
|
|
|
43
56
|
debounce="500"></road-input>`,
|
|
44
57
|
};
|
|
45
58
|
|
|
46
|
-
export const WithIcon = (
|
|
47
|
-
<road-autocomplete .options=${args.options} @roadselected=${event => args.roadselected(event.detail)}>
|
|
48
|
-
${unsafeHTML(args[' '])}
|
|
49
|
-
</road-autocomplete>
|
|
50
|
-
`;
|
|
59
|
+
export const WithIcon = Template.bind({});
|
|
51
60
|
WithIcon.args = {
|
|
52
61
|
' ': `
|
|
53
|
-
<road-autocomplete>
|
|
54
62
|
<road-input-group>
|
|
55
63
|
<road-input
|
|
56
64
|
class="mb-0"
|
|
@@ -58,24 +66,17 @@ WithIcon.args = {
|
|
|
58
66
|
input-id="country"
|
|
59
67
|
label="Country"
|
|
60
68
|
debounce="500">
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</road-autocomplete>
|
|
68
|
-
`,
|
|
69
|
+
</road-input>
|
|
70
|
+
<label slot="prepend" for="search">
|
|
71
|
+
<road-icon name="search" role="img"></road-icon>
|
|
72
|
+
</label>
|
|
73
|
+
</road-input-group>
|
|
74
|
+
`,
|
|
69
75
|
};
|
|
70
76
|
|
|
71
|
-
export const WithIconButton = (
|
|
72
|
-
<road-autocomplete .options=${args.options} @roadselected=${event => args.roadselected(event.detail)}>
|
|
73
|
-
${unsafeHTML(args[' '])}
|
|
74
|
-
</road-autocomplete>
|
|
75
|
-
`;
|
|
77
|
+
export const WithIconButton = Template.bind({});
|
|
76
78
|
WithIconButton.args = {
|
|
77
79
|
' ': `
|
|
78
|
-
<road-autocomplete>
|
|
79
80
|
<road-input-group>
|
|
80
81
|
<road-input
|
|
81
82
|
class="mb-0"
|
|
@@ -83,32 +84,27 @@ WithIconButton.args = {
|
|
|
83
84
|
input-id="country"
|
|
84
85
|
label="Country"
|
|
85
86
|
debounce="500">
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
</road-autocomplete>
|
|
96
|
-
`,
|
|
87
|
+
</road-input>
|
|
88
|
+
<label slot="prepend" for="search">
|
|
89
|
+
<road-icon name="search" role="img"></road-icon>
|
|
90
|
+
</label>
|
|
91
|
+
<road-button slot="append" class="autocomplete-button" button-type="submit">
|
|
92
|
+
OK
|
|
93
|
+
</road-button>
|
|
94
|
+
</road-input-group>
|
|
95
|
+
`,
|
|
97
96
|
};
|
|
98
97
|
|
|
99
98
|
export const Example = (args) => {
|
|
100
99
|
const getCountry = (event) => {
|
|
101
100
|
fetch(`https://photon.komoot.io/api/?q=${event.detail.value}&osm_tag=place:country&limit=10&lang=en`)
|
|
102
101
|
.then(res => res.json())
|
|
103
|
-
.then(
|
|
104
|
-
result => {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
});
|
|
102
|
+
.then(result => {
|
|
103
|
+
document.querySelector('road-autocomplete').options = result.features.map(item => ({
|
|
104
|
+
value: item.properties.country,
|
|
105
|
+
label: item.properties.country,
|
|
106
|
+
}));
|
|
107
|
+
});
|
|
112
108
|
};
|
|
113
109
|
|
|
114
110
|
return html`
|
|
@@ -7,9 +7,11 @@ export default {
|
|
|
7
7
|
component: 'road-avatar',
|
|
8
8
|
argTypes: {
|
|
9
9
|
' ': {
|
|
10
|
+
description: "Image of the avatar.",
|
|
10
11
|
control: 'text',
|
|
11
12
|
},
|
|
12
13
|
'--avatar-background': {
|
|
14
|
+
description: "background color of the avatar",
|
|
13
15
|
table: {
|
|
14
16
|
defaultValue: { summary: 'var(--road-primary-500)' },
|
|
15
17
|
},
|
|
@@ -18,10 +20,14 @@ export default {
|
|
|
18
20
|
},
|
|
19
21
|
},
|
|
20
22
|
size: {
|
|
23
|
+
description: "The Avatar size.",
|
|
21
24
|
options: ['sm', 'md', 'lg'],
|
|
22
25
|
control: {
|
|
23
26
|
type: 'select',
|
|
24
27
|
},
|
|
28
|
+
table: {
|
|
29
|
+
defaultValue: { summary: 'md' },
|
|
30
|
+
},
|
|
25
31
|
},
|
|
26
32
|
},
|
|
27
33
|
args: {
|
|
@@ -7,15 +7,21 @@ export default {
|
|
|
7
7
|
component: 'road-badge',
|
|
8
8
|
argTypes: {
|
|
9
9
|
color: {
|
|
10
|
+
description: "Color of the badge",
|
|
10
11
|
options: ['primary', 'secondary', 'accent', 'info', 'success', 'warning', 'danger', 'inverse'],
|
|
11
12
|
control: {
|
|
12
13
|
type: 'select',
|
|
13
14
|
},
|
|
15
|
+
table: {
|
|
16
|
+
defaultValue: { summary: 'secondary' },
|
|
17
|
+
},
|
|
14
18
|
},
|
|
15
19
|
bubble: {
|
|
20
|
+
description: "if `true` the badge will be displayed has a little bubble",
|
|
16
21
|
control: 'boolean',
|
|
17
22
|
},
|
|
18
23
|
' ': {
|
|
24
|
+
description: "Content of the badge, it could be a number or a text.",
|
|
19
25
|
control: 'text',
|
|
20
26
|
},
|
|
21
27
|
},
|
|
@@ -8,20 +8,39 @@ export default {
|
|
|
8
8
|
argTypes: {
|
|
9
9
|
label: {
|
|
10
10
|
control: 'text',
|
|
11
|
+
description: 'The main text content of the banner.',
|
|
12
|
+
table: {
|
|
13
|
+
defaultValue: { summary: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' },
|
|
14
|
+
},
|
|
11
15
|
},
|
|
12
16
|
link: {
|
|
13
17
|
control: 'text',
|
|
18
|
+
description: 'The label of the link inside the banner.',
|
|
19
|
+
table: {
|
|
20
|
+
defaultValue: { summary: 'See more' },
|
|
21
|
+
},
|
|
14
22
|
},
|
|
15
23
|
url: {
|
|
16
24
|
control: 'text',
|
|
25
|
+
description: 'The URL for the link inside the banner.',
|
|
26
|
+
table: {
|
|
27
|
+
defaultValue: { summary: '#' },
|
|
28
|
+
},
|
|
17
29
|
},
|
|
18
30
|
'is-open': {
|
|
19
31
|
control: 'boolean',
|
|
32
|
+
description: 'Controls whether the banner is visible or not.',
|
|
33
|
+
table: {
|
|
34
|
+
defaultValue: { summary: true },
|
|
35
|
+
},
|
|
20
36
|
},
|
|
21
37
|
close: {
|
|
22
|
-
|
|
23
|
-
|
|
38
|
+
description: 'Event triggered when the banner is closed.',
|
|
39
|
+
table: {
|
|
40
|
+
category: 'Events',
|
|
41
|
+
type: { summary: 'CustomEvent' },
|
|
24
42
|
},
|
|
43
|
+
control: { type: null }, // Désactive l'affichage du contrôle dans Storybook
|
|
25
44
|
},
|
|
26
45
|
},
|
|
27
46
|
args: {
|
|
@@ -33,7 +52,18 @@ export default {
|
|
|
33
52
|
};
|
|
34
53
|
|
|
35
54
|
const Template = (args) => html`
|
|
36
|
-
<road-banner
|
|
55
|
+
<road-banner
|
|
56
|
+
label="${ifDefined(args.label)}"
|
|
57
|
+
link="${ifDefined(args.link)}"
|
|
58
|
+
url="${ifDefined(args.url)}"
|
|
59
|
+
?is-open="${args['is-open']}"
|
|
60
|
+
></road-banner>
|
|
37
61
|
`;
|
|
38
62
|
|
|
39
63
|
export const Playground = Template.bind({});
|
|
64
|
+
Playground.args = {
|
|
65
|
+
label: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
|
|
66
|
+
link: 'See more',
|
|
67
|
+
url: '#',
|
|
68
|
+
'is-open': true,
|
|
69
|
+
};
|
|
@@ -13,142 +13,133 @@ export default {
|
|
|
13
13
|
argTypes: {
|
|
14
14
|
color: {
|
|
15
15
|
options: ['default', 'primary', 'secondary', 'ghost', 'destructive'],
|
|
16
|
-
control: {
|
|
17
|
-
|
|
16
|
+
control: { type: 'select' },
|
|
17
|
+
description: 'Defines the button color.',
|
|
18
|
+
table: {
|
|
19
|
+
defaultValue: { summary: 'default' },
|
|
18
20
|
},
|
|
19
21
|
},
|
|
20
22
|
'button-type': {
|
|
21
23
|
options: ['button', 'reset', 'submit'],
|
|
22
|
-
control: {
|
|
23
|
-
|
|
24
|
-
},
|
|
24
|
+
control: { type: 'select' },
|
|
25
|
+
description: 'Specifies the type of the button.',
|
|
25
26
|
},
|
|
26
27
|
disabled: {
|
|
27
28
|
control: 'boolean',
|
|
29
|
+
description: 'Disables the button when set to `true`.',
|
|
28
30
|
},
|
|
29
31
|
'icon-only': {
|
|
30
32
|
control: 'boolean',
|
|
31
|
-
|
|
32
|
-
download: {
|
|
33
|
-
control: {
|
|
34
|
-
type: null,
|
|
35
|
-
},
|
|
33
|
+
description: 'If `true`, the button will only contain an icon without text.',
|
|
36
34
|
},
|
|
37
35
|
expand: {
|
|
38
36
|
control: 'boolean',
|
|
39
|
-
|
|
40
|
-
href: {
|
|
41
|
-
control: {
|
|
42
|
-
type: null,
|
|
43
|
-
},
|
|
37
|
+
description: 'Expands the button to the full width of its container.',
|
|
44
38
|
},
|
|
45
39
|
outline: {
|
|
46
40
|
control: 'boolean',
|
|
47
|
-
|
|
48
|
-
rel: {
|
|
49
|
-
control: {
|
|
50
|
-
type: null,
|
|
51
|
-
},
|
|
41
|
+
description: 'Applies an outline style to the button.',
|
|
52
42
|
},
|
|
53
43
|
size: {
|
|
54
44
|
options: ['sm', 'md', 'lg', 'xl'],
|
|
55
|
-
control: {
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
target: {
|
|
60
|
-
control: {
|
|
61
|
-
type: null,
|
|
62
|
-
},
|
|
45
|
+
control: { type: 'select' },
|
|
46
|
+
description: 'Defines the size of the button.',
|
|
63
47
|
},
|
|
64
48
|
start: {
|
|
65
49
|
control: 'text',
|
|
50
|
+
description: 'Slot for an icon or content at the **start** of the button.',
|
|
66
51
|
},
|
|
67
52
|
' ': {
|
|
68
53
|
control: 'text',
|
|
54
|
+
description: 'Label or main content inside the button.',
|
|
69
55
|
},
|
|
70
56
|
end: {
|
|
71
57
|
control: 'text',
|
|
58
|
+
description: 'Slot for an icon or content at the **end** of the button.',
|
|
72
59
|
},
|
|
73
60
|
roadblur: {
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
action: 'roadblur',
|
|
62
|
+
description: 'Triggered when the button loses focus.',
|
|
63
|
+
table: {
|
|
64
|
+
category: 'Events',
|
|
65
|
+
type: { summary: 'CustomEvent' },
|
|
76
66
|
},
|
|
77
67
|
},
|
|
78
68
|
roadfocus: {
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
action: 'roadfocus',
|
|
70
|
+
description: 'Triggered when the button gains focus.',
|
|
71
|
+
table: {
|
|
72
|
+
category: 'Events',
|
|
73
|
+
type: { summary: 'CustomEvent' },
|
|
81
74
|
},
|
|
82
75
|
},
|
|
76
|
+
// 🔹 Ajout des CSS Variables comme contrôles
|
|
83
77
|
'--border-radius': {
|
|
78
|
+
control: 'text',
|
|
79
|
+
description: 'Defines the border radius of the button.',
|
|
84
80
|
table: {
|
|
85
81
|
defaultValue: { summary: '0.25rem' },
|
|
86
82
|
},
|
|
87
|
-
control: {
|
|
88
|
-
type: null,
|
|
89
|
-
},
|
|
90
83
|
},
|
|
91
84
|
'--font-size': {
|
|
85
|
+
control: 'text',
|
|
86
|
+
description: 'Sets the font size of the button text.',
|
|
92
87
|
table: {
|
|
93
88
|
defaultValue: { summary: '1rem' },
|
|
94
89
|
},
|
|
95
|
-
control: {
|
|
96
|
-
type: null,
|
|
97
|
-
},
|
|
98
90
|
},
|
|
99
91
|
'--margin-bottom': {
|
|
92
|
+
control: 'text',
|
|
93
|
+
description: 'Defines the margin bottom of the button.',
|
|
100
94
|
table: {
|
|
101
95
|
defaultValue: { summary: '1rem' },
|
|
102
96
|
},
|
|
103
|
-
control: {
|
|
104
|
-
type: null,
|
|
105
|
-
},
|
|
106
97
|
},
|
|
107
98
|
'--padding-start': {
|
|
99
|
+
control: 'text',
|
|
100
|
+
description: 'Sets the padding on the **left** side of the button.',
|
|
108
101
|
table: {
|
|
109
102
|
defaultValue: { summary: '1rem' },
|
|
110
103
|
},
|
|
111
|
-
control: {
|
|
112
|
-
type: null,
|
|
113
|
-
},
|
|
114
104
|
},
|
|
115
105
|
'--padding-end': {
|
|
106
|
+
control: 'text',
|
|
107
|
+
description: 'Sets the padding on the **right** side of the button.',
|
|
116
108
|
table: {
|
|
117
109
|
defaultValue: { summary: '1rem' },
|
|
118
110
|
},
|
|
119
|
-
control: {
|
|
120
|
-
type: null,
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
native: {
|
|
124
|
-
control: {
|
|
125
|
-
type: null,
|
|
126
|
-
},
|
|
127
111
|
},
|
|
128
112
|
},
|
|
129
113
|
args: {
|
|
130
|
-
'button-type':
|
|
131
|
-
'icon-only':
|
|
132
|
-
color:
|
|
133
|
-
disabled:
|
|
134
|
-
expand:
|
|
135
|
-
outline:
|
|
136
|
-
size:
|
|
137
|
-
start:
|
|
138
|
-
' ':
|
|
139
|
-
end:
|
|
114
|
+
'button-type': 'button',
|
|
115
|
+
'icon-only': false,
|
|
116
|
+
color: 'default',
|
|
117
|
+
disabled: false,
|
|
118
|
+
expand: false,
|
|
119
|
+
outline: false,
|
|
120
|
+
size: 'md',
|
|
121
|
+
start: '',
|
|
122
|
+
' ': 'Label',
|
|
123
|
+
end: '',
|
|
140
124
|
},
|
|
141
125
|
};
|
|
142
126
|
|
|
143
127
|
const Template = (args) => html`
|
|
144
128
|
<road-button
|
|
145
129
|
button-type="${ifDefined(args['button-type'])}"
|
|
146
|
-
icon-only="${
|
|
130
|
+
?icon-only="${args['icon-only']}"
|
|
147
131
|
color="${ifDefined(args.color)}"
|
|
148
|
-
disabled="${
|
|
149
|
-
expand="${
|
|
150
|
-
outline="${
|
|
132
|
+
?disabled="${args.disabled}"
|
|
133
|
+
?expand="${args.expand}"
|
|
134
|
+
?outline="${args.outline}"
|
|
151
135
|
size="${ifDefined(args.size)}"
|
|
136
|
+
style="
|
|
137
|
+
--border-radius: ${ifDefined(args['--border-radius'])};
|
|
138
|
+
--font-size: ${ifDefined(args['--font-size'])};
|
|
139
|
+
--margin-bottom: ${ifDefined(args['--margin-bottom'])};
|
|
140
|
+
--padding-start: ${ifDefined(args['--padding-start'])};
|
|
141
|
+
--padding-end: ${ifDefined(args['--padding-end'])};
|
|
142
|
+
"
|
|
152
143
|
>
|
|
153
144
|
${unsafeHTML(args.start)}
|
|
154
145
|
${unsafeHTML(args[' '])}
|
|
@@ -198,7 +189,7 @@ Destructive.args = {
|
|
|
198
189
|
};
|
|
199
190
|
|
|
200
191
|
export const DestructiveOutline = Template.bind({});
|
|
201
|
-
|
|
192
|
+
DestructiveOutline.args = {
|
|
202
193
|
color: 'destructive',
|
|
203
194
|
outline: true,
|
|
204
195
|
};
|