@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.
Files changed (66) hide show
  1. package/dist/cjs/road-badge_14.cjs.entry.js +9 -12
  2. package/dist/cjs/road-badge_14.cjs.entry.js.map +1 -1
  3. package/dist/collection/components/accordion/accordion.stories.js +38 -4
  4. package/dist/collection/components/alert/alert.stories.js +7 -0
  5. package/dist/collection/components/asset/asset.stories.js +6 -0
  6. package/dist/collection/components/autocomplete/autocomplete.stories.js +43 -47
  7. package/dist/collection/components/avatar/avatar.stories.js +6 -0
  8. package/dist/collection/components/badge/badge.stories.js +6 -0
  9. package/dist/collection/components/banner/banner.stories.js +33 -3
  10. package/dist/collection/components/button/button.stories.js +58 -67
  11. package/dist/collection/components/button-floating/button-floating.stories.js +32 -23
  12. package/dist/collection/components/card/card.stories.js +25 -15
  13. package/dist/collection/components/carousel/carousel.stories.js +72 -280
  14. package/dist/collection/components/checkbox/checkbox.stories.js +54 -33
  15. package/dist/collection/components/chip/chip.stories.js +32 -47
  16. package/dist/collection/components/collapse/collapse.stories.js +88 -78
  17. package/dist/collection/components/content-card/content-card.stories.js +30 -11
  18. package/dist/collection/components/counter/counter.stories.js +40 -11
  19. package/dist/collection/components/dialog/dialog.stories.js +37 -51
  20. package/dist/collection/components/drawer/drawer.js +9 -12
  21. package/dist/collection/components/drawer/drawer.js.map +1 -1
  22. package/dist/collection/components/drawer/drawer.stories.js +64 -134
  23. package/dist/collection/components/dropdown/dropdown.stories.js +69 -53
  24. package/dist/collection/components/duration/duration.stories.js +49 -45
  25. package/dist/collection/components/flap/flap.stories.js +22 -10
  26. package/dist/collection/components/input/input.stories.js +33 -0
  27. package/dist/collection/components/item/item.stories.js +25 -0
  28. package/dist/collection/components/list/list.stories.js +2 -0
  29. package/dist/collection/components/modal/modal.stories.js +14 -0
  30. package/dist/collection/components/navbar/navbar.stories.js +3 -0
  31. package/dist/collection/components/navbar-v2/navbar-v2.stories.js +4 -0
  32. package/dist/collection/components/phone-number-input/phone-number-input.stories.js +15 -1
  33. package/dist/collection/components/plate-number/plate-number.stories.js +13 -0
  34. package/dist/collection/components/profil-dropdown/profil-dropdown.stories.js +8 -0
  35. package/dist/collection/components/progress/progress.stories.js +12 -0
  36. package/dist/collection/components/progress-indicator-horizontal/progress-indicator-horizontal.stories.js +8 -0
  37. package/dist/collection/components/progress-indicator-vertical/progress-indicator-vertical.stories.js +1 -0
  38. package/dist/collection/components/progress-tracker/progress-tracker.stories.js +1 -0
  39. package/dist/collection/components/radio/radio.stories.js +13 -0
  40. package/dist/collection/components/range/range.stories.js +11 -0
  41. package/dist/collection/components/rating/rating.stories.js +7 -0
  42. package/dist/collection/components/segmented-buttons/segmented-buttons.stories.js +2 -0
  43. package/dist/collection/components/select/select.stories.js +13 -0
  44. package/dist/collection/components/select-filter/select-filter.stories.js +5 -0
  45. package/dist/collection/components/skeleton/skeleton.stories.js +2 -0
  46. package/dist/collection/components/spinner/spinner.stories.js +2 -0
  47. package/dist/collection/components/table/table.stories.js +1 -0
  48. package/dist/collection/components/tabs/tabs.stories.js +2 -0
  49. package/dist/collection/components/tag/tag.stories.js +3 -0
  50. package/dist/collection/components/text/text.stories.js +2 -0
  51. package/dist/collection/components/textarea/textarea.stories.js +26 -0
  52. package/dist/collection/components/toast/toast.stories.js +6 -0
  53. package/dist/collection/components/toggle/toggle.stories.js +14 -0
  54. package/dist/collection/components/toolbar/toolbar.stories.js +6 -0
  55. package/dist/collection/components/toolbar-v2/toolbar-v2.stories.js +5 -0
  56. package/dist/collection/components/tooltip/tooltip.stories.js +11 -0
  57. package/dist/esm/road-badge_14.entry.js +9 -12
  58. package/dist/esm/road-badge_14.entry.js.map +1 -1
  59. package/dist/roadtrip/{p-e2a00f9c.entry.js → p-b5c4455e.entry.js} +3 -3
  60. package/dist/roadtrip/p-b5c4455e.entry.js.map +1 -0
  61. package/dist/roadtrip/roadtrip.esm.js +1 -1
  62. package/dist/types/components/drawer/drawer.d.ts +0 -1
  63. package/hydrate/index.js +271 -255
  64. package/hydrate/index.mjs +271 -255
  65. package/package.json +1 -1
  66. package/dist/roadtrip/p-e2a00f9c.entry.js.map +0 -1
@@ -6,99 +6,120 @@ export default {
6
6
  component: 'road-checkbox',
7
7
  parameters: {
8
8
  actions: {
9
- handles: ['roadblur', 'roadfocus'],
9
+ handles: ['roadblur', 'roadfocus', 'roadchange'],
10
10
  },
11
11
  },
12
12
  argTypes: {
13
13
  checked: {
14
14
  control: 'boolean',
15
+ description: 'Specifies whether the checkbox is checked.',
16
+ table: {
17
+ defaultValue: { summary: 'false' },
18
+ },
15
19
  },
16
20
  indeterminate: {
17
21
  control: 'boolean',
22
+ description: 'Specifies whether the checkbox is in an indeterminate state.',
18
23
  },
19
24
  disabled: {
20
25
  control: 'boolean',
26
+ description: 'Disables the checkbox if set to `true`.',
21
27
  },
22
28
  required: {
23
29
  control: 'boolean',
30
+ description: 'Marks the checkbox as required in a form.',
24
31
  },
25
32
  inverse: {
26
33
  control: 'boolean',
34
+ description: 'Applies an inverse color style to the checkbox.',
27
35
  },
28
36
  error: {
29
37
  control: 'text',
38
+ description: 'Displays an error message below the checkbox.',
30
39
  },
31
40
  helper: {
32
41
  control: 'text',
42
+ description: 'Displays a helper text below the checkbox.',
33
43
  },
34
44
  label: {
35
45
  control: 'text',
46
+ description: 'Sets the main label of the checkbox.',
47
+ table: {
48
+ defaultValue: { summary: 'Label' },
49
+ },
36
50
  },
37
51
  'secondary-label': {
38
52
  control: 'text',
53
+ description: 'Sets a secondary label, usually displayed next to the main label.',
39
54
  },
40
55
  name: {
41
56
  control: 'text',
57
+ description: 'Sets the name attribute for form submission.',
42
58
  },
43
59
  'checkbox-id': {
44
60
  control: 'text',
61
+ description: 'Sets a unique ID for the checkbox element.',
45
62
  },
46
63
  value: {
47
64
  control: 'text',
48
- },
49
- ' ': {
50
- control: {
51
- type: null,
65
+ description: 'Defines the value of the checkbox when checked.',
66
+ table: {
67
+ defaultValue: { summary: 'on' },
52
68
  },
53
69
  },
54
70
  roadblur: {
55
- control: {
56
- type: null,
71
+ action: 'roadblur',
72
+ description: 'Triggered when the checkbox loses focus.',
73
+ table: {
74
+ category: 'Events',
57
75
  },
58
76
  },
59
77
  roadfocus: {
60
- control: {
61
- type: null,
78
+ action: 'roadfocus',
79
+ description: 'Triggered when the checkbox gains focus.',
80
+ table: {
81
+ category: 'Events',
62
82
  },
63
83
  },
64
84
  roadchange: {
65
85
  action: 'roadchange',
66
- control: {
67
- type: null,
86
+ description: 'Triggered when the checkbox state changes.',
87
+ table: {
88
+ category: 'Events',
68
89
  },
69
90
  },
70
91
  },
71
92
  args: {
72
- checked: null,
73
- disabled: null,
74
- indeterminate: null,
75
- inverse: null,
93
+ checked: false,
94
+ disabled: false,
95
+ indeterminate: false,
96
+ inverse: false,
97
+ required: false,
76
98
  label: 'Label',
77
- 'secondary-label': undefined,
78
- required: null,
99
+ 'secondary-label': '',
79
100
  value: 'on',
80
101
  },
81
102
  };
82
103
 
83
104
  const Template = (args) => html`
84
- <road-checkbox
85
- checked="${ifDefined(args.checked)}"
86
- indeterminate="${ifDefined(args.indeterminate)}"
87
- disabled="${ifDefined(args.disabled)}"
88
- error="${ifDefined(args.error)}"
89
- helper="${ifDefined(args.helper)}"
90
- inverse="${ifDefined(args.inverse)}"
91
- label="${ifDefined(args.label)}"
92
- secondary-label="${ifDefined(args['secondary-label'])}"
93
- name="${ifDefined(args.name)}"
94
- required="${ifDefined(args.required)}"
95
- value="${ifDefined(args.value)}"
96
- checkbox-id="${ifDefined(args['checkbox-id'])}"
97
- @roadchange=${event => args.roadchange(event.detail)}
98
- ></road-checkbox>
105
+ <road-checkbox
106
+ ?checked="${args.checked}"
107
+ ?indeterminate="${args.indeterminate}"
108
+ ?disabled="${args.disabled}"
109
+ ?inverse="${args.inverse}"
110
+ ?required="${args.required}"
111
+ value="${ifDefined(args.value)}"
112
+ label="${ifDefined(args.label)}"
113
+ secondary-label="${ifDefined(args['secondary-label'])}"
114
+ name="${ifDefined(args.name)}"
115
+ checkbox-id="${ifDefined(args['checkbox-id'])}"
116
+ error="${ifDefined(args.error)}"
117
+ helper="${ifDefined(args.helper)}"
118
+ @roadchange=${event => args.roadchange(event.detail)}
119
+ ></road-checkbox>
99
120
  `;
100
121
 
101
- export const Playground = Template.bind({});
122
+ export const Playground = Template.bind({});
102
123
 
103
124
  export const Checked = Template.bind({});
104
125
  Checked.args = {
@@ -11,69 +11,55 @@ export default {
11
11
  },
12
12
  },
13
13
  argTypes: {
14
- ' ': {
15
- control: 'text',
16
- },
17
14
  outline: {
18
15
  control: 'boolean',
16
+ description: 'Displays the chip with an outline style.',
19
17
  },
20
18
  'has-close-icon': {
21
19
  control: 'boolean',
20
+ description: 'Adds a close icon to the chip.',
22
21
  },
23
22
  size: {
24
23
  options: ['md', 'lg'],
25
- control: {
26
- type: 'select',
24
+ control: { type: 'select' },
25
+ description: 'Defines the size of the chip.',
26
+ table: {
27
+ defaultValue: { summary: 'md' },
27
28
  },
28
29
  },
29
30
  color: {
30
31
  options: ['default', 'secondary', 'inverse'],
31
- control: {
32
- type: 'select',
32
+ control: { type: 'select' },
33
+ description: 'Changes the chip color.',
34
+ table: {
35
+ defaultValue: { summary: 'default' },
33
36
  },
34
37
  },
38
+ ' ': {
39
+ control: 'text',
40
+ description: 'Content inside the chip (label or icon).',
41
+ },
35
42
  },
36
43
  args: {
37
- outline: null,
38
- 'has-close-icon': null,
39
- ' ': `Label`,
44
+ outline: false,
45
+ 'has-close-icon': false,
46
+ size: 'md',
47
+ color: 'default',
48
+ ' ': 'Label',
40
49
  },
41
50
  };
42
51
 
43
52
  const Template = (args) => html`
44
- <road-chip
45
- outline="${ifDefined(args.outline)}"
46
- has-close-icon="${ifDefined(args['has-close-icon'])}"
47
- size="${ifDefined(args.size)}"
48
- color="${ifDefined(args.color)}"
49
- >
50
- ${unsafeHTML(args[' '])}
51
- </road-chip>
52
- <road-chip
53
- outline="${ifDefined(args.outline)}"
54
- has-close-icon="${ifDefined(args['has-close-icon'])}"
55
- size="${ifDefined(args.size)}"
56
- color="${ifDefined(args.color)}"
57
- >
58
- ${unsafeHTML(args[' '])}
59
- </road-chip>
60
- <road-chip
61
- outline="${ifDefined(args.outline)}"
62
- has-close-icon="${ifDefined(args['has-close-icon'])}"
63
- size="${ifDefined(args.size)}"
64
- color="${ifDefined(args.color)}"
65
- >
66
- ${unsafeHTML(args[' '])}
67
- </road-chip>
68
- <road-chip
69
- outline="${ifDefined(args.outline)}"
70
- has-close-icon="${ifDefined(args['has-close-icon'])}"
71
- size="${ifDefined(args.size)}"
72
- color="${ifDefined(args.color)}"
73
- >
74
- ${unsafeHTML(args[' '])}
75
- </road-chip>
76
-
53
+ ${['Label A', 'Label B', 'Label C', 'Label D'].map(label => html`
54
+ <road-chip
55
+ ?outline="${args.outline}"
56
+ ?has-close-icon="${args['has-close-icon']}"
57
+ size="${ifDefined(args.size)}"
58
+ color="${ifDefined(args.color)}"
59
+ >
60
+ ${unsafeHTML(args[' '] || label)}
61
+ </road-chip>
62
+ `)}
77
63
  `;
78
64
 
79
65
  export const Playground = Template.bind({});
@@ -82,12 +68,11 @@ Playground.args = {
82
68
  'has-close-icon': true,
83
69
  };
84
70
 
85
- export const withIcon = Template.bind({});
86
- withIcon.args = {
71
+ export const WithIcon = Template.bind({});
72
+ WithIcon.args = {
87
73
  outline: true,
88
74
  'has-close-icon': true,
89
- ' ': `<road-icon name="weather-rain" role="button"></road-icon>
90
- B`,
75
+ ' ': `<road-icon name="weather-rain" role="button"></road-icon> B`,
91
76
  };
92
77
 
93
78
  export const Color = Template.bind({});
@@ -8,92 +8,102 @@ export default {
8
8
  argTypes: {
9
9
  'is-open': {
10
10
  control: 'boolean',
11
+ description: 'Defines whether the collapse is open or closed.',
11
12
  },
12
13
  centered: {
13
14
  control: 'boolean',
15
+ description: 'Centers the expand/collapse button.',
14
16
  },
15
17
  'show-less': {
16
18
  control: 'text',
19
+ description: 'Label for the button when content is expanded.',
20
+ table: {
21
+ defaultValue: { summary: 'show less' },
22
+ },
17
23
  },
18
24
  'show-more': {
19
25
  control: 'text',
26
+ description: 'Label for the button when content is collapsed.',
27
+ table: {
28
+ defaultValue: { summary: 'show more' },
29
+ },
20
30
  },
21
31
  ' ': {
22
32
  control: 'text',
33
+ description: 'Expanded content of the collapse component.',
23
34
  },
24
35
  'collapsed-content': {
25
36
  control: 'text',
37
+ description: 'Content displayed when the collapse is closed.',
26
38
  },
39
+ // 🔹 Ajout des CSS Variables pour personnalisation
27
40
  '--btn-padding-start': {
28
- table: {
29
- defaultValue: { summary: '1rem' },
30
- },
31
- control: {
32
- type: null,
33
- },
41
+ table: { defaultValue: { summary: '1rem' } },
42
+ control: 'text',
43
+ description: 'Padding at the start of the button.',
34
44
  },
35
45
  '--btn-padding-end': {
36
- table: {
37
- defaultValue: { summary: '1rem' },
38
- },
39
- control: {
40
- type: null,
41
- },
46
+ table: { defaultValue: { summary: '1rem' } },
47
+ control: 'text',
48
+ description: 'Padding at the end of the button.',
42
49
  },
43
50
  '--btn-margin-bottom': {
44
- table: {
45
- defaultValue: { summary: '1rem' },
46
- },
47
- control: {
48
- type: null,
49
- },
51
+ table: { defaultValue: { summary: '1rem' } },
52
+ control: 'text',
53
+ description: 'Margin below the button.',
50
54
  },
51
55
  '--btn-font-size': {
52
- table: {
53
- defaultValue: { summary: '1rem' },
54
- },
55
- control: {
56
- type: null,
57
- },
56
+ table: { defaultValue: { summary: '1rem' } },
57
+ control: 'text',
58
+ description: 'Font size of the button text.',
58
59
  },
59
60
  '--max-height': {
60
- table: {
61
- defaultValue: { summary: '500px' },
62
- },
63
- control: {
64
- type: null,
65
- },
61
+ table: { defaultValue: { summary: '500px' } },
62
+ control: 'text',
63
+ description: 'Maximum height of the collapse content when expanded.',
66
64
  },
67
65
  },
68
66
  args: {
69
- 'is-open': null,
70
- centered: null,
67
+ 'is-open': false,
68
+ centered: false,
71
69
  'show-less': 'show less',
72
70
  'show-more': 'show more',
73
71
  ' ': `<ul class="m-0">
74
- <li>Car tire 205/55 R16 91 V</li>
75
- <li>Good traction on dry and wet soils.</li>
76
- <li>Reduced risk of aquaplaning.</li>
77
- <li>Reduced braking distances.</li>
78
- </ul>`,
72
+ <li>Car tire 205/55 R16 91 V</li>
73
+ <li>Good traction on dry and wet soils.</li>
74
+ <li>Reduced risk of aquaplaning.</li>
75
+ <li>Reduced braking distances.</li>
76
+ </ul>`,
79
77
  'collapsed-content': `<ul class="m-0">
80
- <li>Specific Homologation : <b>non</b></li>
81
- <li>XL : <b>non</b></li>
82
- <li>Runflat : <b>non</b></li>
83
- <li>Seal : <b>non</b></li>
84
- <li>Various tire characteristics : <b>MFS</b></li>
85
- <li>Tire profile : <b>Energy saver</b></li>
86
- </ul>`,
78
+ <li>Specific Homologation: <b>non</b></li>
79
+ <li>XL: <b>non</b></li>
80
+ <li>Runflat: <b>non</b></li>
81
+ <li>Seal: <b>non</b></li>
82
+ <li>Various tire characteristics: <b>MFS</b></li>
83
+ <li>Tire profile: <b>Energy saver</b></li>
84
+ </ul>`,
87
85
  },
88
86
  };
89
87
 
90
88
  const Template = (args) => html`
91
- <road-collapse is-open="${ifDefined(args['is-open'])}" centered="${ifDefined(args.centered)}" show-more="${args['show-more']}" show-less="${args['show-less']}">
92
- ${unsafeHTML(args[' '])}
93
- <div slot="collapsed-content">
94
- ${unsafeHTML(args['collapsed-content'])}
95
- </div>
96
- </road-collapse>
89
+ <road-collapse
90
+ ?is-open="${args['is-open']}"
91
+ ?centered="${args.centered}"
92
+ show-more="${ifDefined(args['show-more'])}"
93
+ show-less="${ifDefined(args['show-less'])}"
94
+ style="
95
+ --btn-padding-start: ${ifDefined(args['--btn-padding-start'])};
96
+ --btn-padding-end: ${ifDefined(args['--btn-padding-end'])};
97
+ --btn-margin-bottom: ${ifDefined(args['--btn-margin-bottom'])};
98
+ --btn-font-size: ${ifDefined(args['--btn-font-size'])};
99
+ --max-height: ${ifDefined(args['--max-height'])};
100
+ "
101
+ >
102
+ ${unsafeHTML(args[' '])}
103
+ <div slot="collapsed-content">
104
+ ${unsafeHTML(args['collapsed-content'])}
105
+ </div>
106
+ </road-collapse>
97
107
  `;
98
108
 
99
109
  export const Playground = Template.bind({});
@@ -137,34 +147,34 @@ VehicleTypes.args = {
137
147
  </road-row>
138
148
  </road-grid>`,
139
149
  'collapsed-content': `<road-grid>
140
- <road-row>
141
- <road-col class="col-6 col-md-4 col-lg-3">
142
- <road-card button value="scooter">
143
- <road-icon name="vehicle-scooter" size="3x" aria-hidden="true"></road-icon>
144
- <road-label>Scooter</road-label>
145
- </road-card>
146
- </road-col>
147
- <road-col class="col-6 col-md-4 col-lg-3">
148
- <road-card button value="competition">
149
- <road-icon name="vehicle-rally" size="3x" aria-hidden="true"></road-icon>
150
- <road-label>Compétition</road-label>
151
- </road-card>
152
- </road-col>
153
- <road-col class="col-6 col-md-4 col-lg-3">
154
- <road-card button value="colletion">
155
- <road-icon name="vehicle-collector" size="3x" aria-hidden="true"></road-icon>
156
- <road-label>Colletion</road-label>
157
- </road-card>
158
- </road-col>
159
- <road-col class="col-6 col-md-4 col-lg-3">
160
- <road-card button value="quad">
161
- <road-icon name="vehicle-quad" size="3x" aria-hidden="true"></road-icon>
162
- <road-label>Quad</road-label>
163
- </road-card>
164
- </road-col>
165
- </road-row>
166
- </road-grid>`,
167
- },
150
+ <road-row>
151
+ <road-col class="col-6 col-md-4 col-lg-3">
152
+ <road-card button value="scooter">
153
+ <road-icon name="vehicle-scooter" size="3x" aria-hidden="true"></road-icon>
154
+ <road-label>Scooter</road-label>
155
+ </road-card>
156
+ </road-col>
157
+ <road-col class="col-6 col-md-4 col-lg-3">
158
+ <road-card button value="competition">
159
+ <road-icon name="vehicle-rally" size="3x" aria-hidden="true"></road-icon>
160
+ <road-label>Compétition</road-label>
161
+ </road-card>
162
+ </road-col>
163
+ <road-col class="col-6 col-md-4 col-lg-3">
164
+ <road-card button value="collection">
165
+ <road-icon name="vehicle-collector" size="3x" aria-hidden="true"></road-icon>
166
+ <road-label>Collection</road-label>
167
+ </road-card>
168
+ </road-col>
169
+ <road-col class="col-6 col-md-4 col-lg-3">
170
+ <road-card button value="quad">
171
+ <road-icon name="vehicle-quad" size="3x" aria-hidden="true"></road-icon>
172
+ <road-label>Quad</road-label>
173
+ </road-card>
174
+ </road-col>
175
+ </road-row>
176
+ </road-grid>`,
177
+ };
168
178
  VehicleTypes.parameters = {
169
179
  backgrounds: {
170
180
  default: 'grey',
@@ -5,37 +5,42 @@ import { unsafeHTML } from 'lit-html/directives/unsafe-html.js';
5
5
  export default {
6
6
  title: 'Listing/ContentCard',
7
7
  component: 'road-content-card',
8
- backgrounds: {
9
- default: 'grey',
8
+ parameters: {
9
+ backgrounds: {
10
+ default: 'grey',
11
+ },
10
12
  },
11
13
  argTypes: {
12
14
  label: {
13
15
  control: 'text',
16
+ description: 'Title text displayed in the card.',
14
17
  },
15
18
  description: {
16
19
  control: 'text',
20
+ description: 'Main description inside the card.',
17
21
  },
18
22
  ' ': {
19
23
  control: 'text',
24
+ description: 'Slot for additional content, such as buttons or links.',
20
25
  },
21
26
  'inset-image': {
22
27
  control: 'boolean',
28
+ description: 'If true, the image is inset within the card.',
23
29
  },
24
30
  },
25
31
  args: {
26
32
  label: `Lorem ipsum`,
27
- description: `Elevate your car's performance with Norauto's all-in-one maintenance kit. `,
28
- ' ': `<road-button color="primary" class="mt-8 mb-0" expand="true" outline="true">Label</road-button> <road-button color="primary" class="mt-8 mb-0 mr-0" expand="true">
29
- Add to cart
30
- </road-button>`,
33
+ description: `Elevate your car's performance with Norauto's all-in-one maintenance kit.`,
34
+ ' ': `
35
+ <road-button color="primary" class="mt-8 mb-0" expand="true" outline="true">Label</road-button>
36
+ <road-button color="primary" class="mt-8 mb-0 mr-0" expand="true">Add to cart</road-button>
37
+ `,
31
38
  'inset-image': false,
32
39
  },
33
40
  };
34
41
 
35
-
36
-
37
- export const Template = (args) => html`
38
- <road-content-card inset-image="${ifDefined(args['inset-image'])}">
42
+ const Template = (args) => html`
43
+ <road-content-card ?inset-image="${args['inset-image']}">
39
44
  <div slot="label">
40
45
  ${unsafeHTML(args.label)}
41
46
  </div>
@@ -44,4 +49,18 @@ export const Template = (args) => html`
44
49
  </div>
45
50
  ${unsafeHTML(args[' '])}
46
51
  </road-content-card>
47
- `;
52
+ `;
53
+
54
+ export const Playground = Template.bind({});
55
+
56
+ export const WithInsetImage = Template.bind({});
57
+ WithInsetImage.args = {
58
+ 'inset-image': true,
59
+ };
60
+
61
+ export const CustomContent = Template.bind({});
62
+ CustomContent.args = {
63
+ label: 'Premium Car Wax',
64
+ description: 'Protect your car’s paint with our long-lasting premium wax formula.',
65
+ ' ': `<road-button color="secondary" class="mt-8 mb-0" expand="true">Learn more</road-button>`,
66
+ };
@@ -12,38 +12,56 @@ export default {
12
12
  argTypes: {
13
13
  'input-id': {
14
14
  control: 'text',
15
+ description: 'Unique identifier for the input field.',
15
16
  },
16
17
  size: {
17
18
  options: ['sm', 'md', 'lg'],
18
- control: {
19
- type: 'select',
19
+ control: { type: 'select' },
20
+ description: 'Defines the size of the counter.',
21
+ table: {
22
+ defaultValue: { summary: 'md' },
20
23
  },
21
24
  },
22
25
  min: {
23
26
  control: 'number',
27
+ description: 'Minimum value allowed for the counter.',
28
+ table: {
29
+ defaultValue: { summary: 1 },
30
+ },
24
31
  },
25
32
  max: {
26
33
  control: 'number',
34
+ description: 'Maximum value allowed for the counter.',
35
+ table: {
36
+ defaultValue: { summary: 20 },
37
+ },
27
38
  },
28
39
  step: {
29
40
  control: 'number',
41
+ description: 'Step interval for increasing or decreasing the counter value.',
42
+ table: {
43
+ defaultValue: { summary: 1 },
44
+ },
30
45
  },
31
46
  value: {
32
47
  control: 'number',
48
+ description: 'Current value of the counter.',
49
+ table: {
50
+ defaultValue: { summary: 1 },
51
+ },
33
52
  },
34
53
  dustbin: {
35
54
  control: 'boolean',
55
+ description: 'Displays a delete (dustbin) icon when set to `true`.',
36
56
  },
37
57
  readonly: {
38
58
  control: 'boolean',
59
+ description: 'Prevents editing the value when set to `true`.',
39
60
  },
40
61
  '--counter-margin-bottom': {
41
- table: {
42
- defaultValue: { summary: '1rem' },
43
- },
44
- control: {
45
- type: null,
46
- },
62
+ table: { defaultValue: { summary: '1rem' } },
63
+ control: 'text',
64
+ description: 'Defines the margin-bottom of the counter.',
47
65
  },
48
66
  },
49
67
  args: {
@@ -63,10 +81,11 @@ const Template = (args) => html`
63
81
  max="${ifDefined(args.max)}"
64
82
  step="${ifDefined(args.step)}"
65
83
  value="${ifDefined(args.value)}"
66
- dustbin="${ifDefined(args.dustbin)}"
84
+ ?dustbin="${args.dustbin}"
85
+ ?readonly="${args.readonly}"
67
86
  input-id="${ifDefined(args['input-id'])}"
68
- readonly="${ifDefined(args.readonly)}"
69
- ></road-counter>
87
+ style="--counter-margin-bottom: ${ifDefined(args['--counter-margin-bottom'])};"
88
+ ></road-counter>
70
89
  `;
71
90
 
72
91
  export const Playground = Template.bind({});
@@ -80,3 +99,13 @@ export const Small = Template.bind({});
80
99
  Small.args = {
81
100
  size: 'sm',
82
101
  };
102
+
103
+ export const ReadOnly = Template.bind({});
104
+ ReadOnly.args = {
105
+ readonly: true,
106
+ };
107
+
108
+ export const WithDustbin = Template.bind({});
109
+ WithDustbin.args = {
110
+ dustbin: true,
111
+ };