hr-design-system-handlebars 1.11.12 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/.storybook/main.js +9 -0
  2. package/.storybook/manager.js +18 -18
  3. package/.storybook/preview.js +9 -1
  4. package/CHANGELOG.md +12 -0
  5. package/README.md +13 -2
  6. package/build/handlebars/handlebars.js +1 -1
  7. package/build/scripts/build.js +1 -1
  8. package/config.js +1 -0
  9. package/dist/assets/index.css +223 -190
  10. package/dist/views/components/base/image/icon.hbs +1 -1
  11. package/dist/views/components/base/link.hbs +11 -1
  12. package/dist/views/components/base/link_open.hbs +12 -13
  13. package/dist/views/components/base/link_v2.hbs +14 -0
  14. package/dist/views/components/button/button.hbs +9 -24
  15. package/dist/views/components/button/components/button_icon.hbs +2 -1
  16. package/dist/views/components/button/components/button_label.hbs +1 -1
  17. package/dist/views/components/button/link_button.hbs +6 -0
  18. package/dist/views/components/button/utilities/button_base_classes.hbs +1 -0
  19. package/dist/views/components/button/utilities/button_dimension_classes.hbs +1 -0
  20. package/dist/views/components/button/utilities/button_on_image_classes.hbs +39 -0
  21. package/dist/views/components/button/utilities/button_variation_classes.hbs +14 -0
  22. package/dist/views/components/content_nav/content_nav_container.hbs +1 -1
  23. package/dist/views/components/content_nav/content_nav_item.hbs +1 -1
  24. package/dist/views/components/event/calendar/event_calendar_footer.hbs +1 -1
  25. package/dist/views/components/event/event_ticket_button.hbs +11 -9
  26. package/dist/views/components/grid/grid_group_highlight.hbs +1 -1
  27. package/dist/views/components/label/label_old.hbs +1 -1
  28. package/dist/views/components/mediaplayer/media_player.hbs +4 -22
  29. package/dist/views/components/mediaplayer/mediaplayer_button.hbs +9 -0
  30. package/dist/views/components/modal/modal.hbs +2 -2
  31. package/dist/views/components/site_header/brand_navigation/brand_navigation.hbs +1 -1
  32. package/dist/views/components/teaser/cluster/teaser_cluster.hbs +4 -1
  33. package/dist/views/components/teaser/cluster/teaser_cluster_byline.hbs +1 -1
  34. package/dist/views/components/teaser/cluster/teaser_cluster_item.hbs +1 -1
  35. package/dist/views/components/teaser/components/teaser_av_consumption_close_button.hbs +6 -20
  36. package/dist/views/components/teaser/components/teaser_byline.hbs +1 -1
  37. package/dist/views/components/teaser/components/teaser_image.hbs +6 -14
  38. package/dist/views/components/teaser/podcast/podcast_subscribe_button.hbs +18 -15
  39. package/dist/views/components/teaser/podcast/podcast_title.hbs +2 -2
  40. package/dist/views/components/teaser/tabbox/group_tabbox.hbs +4 -1
  41. package/dist/views/components/teaser/tabbox/teaser_tabbox.hbs +10 -11
  42. package/dist/views/components/teaser/teaser_poster.hbs +5 -1
  43. package/gulpfile.js +9 -0
  44. package/package.json +4 -2
  45. package/src/assets/css/custom-components.css +37 -38
  46. package/src/assets/css/custom-utilities.css +2 -2
  47. package/src/assets/fixtures/event/calendar/event_calendar_months.inc.json +5 -1
  48. package/src/assets/tailwind.css +54 -22
  49. package/src/stories/conventions-and-datastructure.mdx +217 -4
  50. package/src/stories/views/components/base/image/icon.hbs +1 -1
  51. package/src/stories/views/components/base/link.hbs +11 -1
  52. package/src/stories/views/components/base/link_open.hbs +12 -13
  53. package/src/stories/views/components/base/link_v2.hbs +14 -0
  54. package/src/stories/views/components/button/button.hbs +9 -24
  55. package/src/stories/views/components/button/button.mdx +186 -0
  56. package/src/stories/views/components/button/button.stories.js +508 -0
  57. package/src/stories/views/components/button/components/button_icon.hbs +2 -1
  58. package/src/stories/views/components/button/components/button_icon.mdx +25 -0
  59. package/src/stories/views/components/button/components/button_icon.stories.js +44 -0
  60. package/src/stories/views/components/button/components/button_label.hbs +1 -1
  61. package/src/stories/views/components/button/components/button_label.mdx +25 -0
  62. package/src/stories/views/components/button/components/button_label.stories.js +33 -0
  63. package/src/stories/views/components/button/link_button.hbs +6 -0
  64. package/src/stories/views/components/button/link_button.mdx +137 -0
  65. package/src/stories/views/components/button/link_button.stories.js +420 -0
  66. package/src/stories/views/components/button/utilities/button_base_classes.hbs +1 -0
  67. package/src/stories/views/components/button/utilities/button_dimension_classes.hbs +1 -0
  68. package/src/stories/views/components/button/utilities/button_on_image_classes.hbs +39 -0
  69. package/src/stories/views/components/button/utilities/button_variation_classes.hbs +14 -0
  70. package/src/stories/views/components/content_nav/content_nav_container.hbs +1 -1
  71. package/src/stories/views/components/content_nav/content_nav_item.hbs +1 -1
  72. package/src/stories/views/components/event/calendar/event_calendar_footer.hbs +1 -1
  73. package/src/stories/views/components/event/event_ticket_button.hbs +11 -9
  74. package/src/stories/views/components/grid/grid_group_highlight.hbs +1 -1
  75. package/src/stories/views/components/label/label_old.hbs +1 -1
  76. package/src/stories/views/components/mediaplayer/media_player.hbs +4 -22
  77. package/src/stories/views/components/mediaplayer/mediaplayer_button.hbs +9 -0
  78. package/src/stories/views/components/mediaplayer/mediaplayer_button.mdx +82 -0
  79. package/src/stories/views/components/mediaplayer/mediaplayer_button.stories.js +178 -0
  80. package/src/stories/views/components/modal/modal.hbs +2 -2
  81. package/src/stories/views/components/site_header/brand_navigation/brand_navigation.hbs +1 -1
  82. package/src/stories/views/components/teaser/cluster/teaser_cluster.hbs +4 -1
  83. package/src/stories/views/components/teaser/cluster/teaser_cluster_byline.hbs +1 -1
  84. package/src/stories/views/components/teaser/cluster/teaser_cluster_item.hbs +1 -1
  85. package/src/stories/views/components/teaser/components/teaser_av_consumption_close_button.hbs +6 -20
  86. package/src/stories/views/components/teaser/components/teaser_byline.hbs +1 -1
  87. package/src/stories/views/components/teaser/components/teaser_image.hbs +6 -14
  88. package/src/stories/views/components/teaser/fixtures/teaser_event_calendar_100_serif.json +1 -1
  89. package/src/stories/views/components/teaser/podcast/podcast_subscribe_button.hbs +18 -15
  90. package/src/stories/views/components/teaser/podcast/podcast_title.hbs +2 -2
  91. package/src/stories/views/components/teaser/tabbox/group_tabbox.hbs +4 -1
  92. package/src/stories/views/components/teaser/tabbox/teaser_tabbox.hbs +10 -11
  93. package/src/stories/views/components/teaser/teaser_poster.hbs +5 -1
  94. package/tailwind.config.js +8 -1
  95. package/dist/views/components/button/button_pseudo.hbs +0 -8
  96. package/dist/views/components/button/button_pseudo.inc.hbs +0 -18
  97. package/dist/views/components/button/button_pseudo_v2.hbs +0 -12
  98. package/dist/views/components/button/button_round.hbs +0 -23
  99. package/dist/views/components/button/button_round_classes.hbs +0 -46
  100. package/dist/views/components/button/button_transparent.hbs +0 -17
  101. package/dist/views/components/button/button_v2.hbs +0 -7
  102. package/dist/views/components/button/components/button_pseudo_link.hbs +0 -3
  103. package/src/stories/views/components/button/button_pseudo.hbs +0 -8
  104. package/src/stories/views/components/button/button_pseudo.inc.hbs +0 -18
  105. package/src/stories/views/components/button/button_pseudo_v2.hbs +0 -12
  106. package/src/stories/views/components/button/button_round.hbs +0 -23
  107. package/src/stories/views/components/button/button_round_classes.hbs +0 -46
  108. package/src/stories/views/components/button/button_transparent.hbs +0 -17
  109. package/src/stories/views/components/button/button_v2.hbs +0 -7
  110. package/src/stories/views/components/button/components/button_pseudo_link.hbs +0 -3
@@ -0,0 +1,508 @@
1
+ const handlebars = require('hrHandlebars')
2
+
3
+ const buttonWithLabelTemplate = (args) => {
4
+ let hbsTemplate = handlebars.compile(`
5
+ {{#> components/button/button}}
6
+ {{> components/button/components/button_label}}
7
+ {{/components/button/button}}
8
+ `)
9
+ return hbsTemplate({ ...args })
10
+ }
11
+
12
+ const buttonWithLabelTemplateOnBackground = (args) => {
13
+ let hbsTemplate = handlebars.compile(`
14
+ <div class="bg-primary p-4">
15
+ {{#> components/button/button}}
16
+ {{> components/button/components/button_label }}
17
+ {{/components/button/button}}
18
+ </div>
19
+ `)
20
+ return hbsTemplate({ ...args })
21
+ }
22
+
23
+ const buttonWithLabelAndIconRightTemplate = (args) => {
24
+ let hbsTemplate = handlebars.compile(`
25
+ {{#> components/button/button}}
26
+ {{> components/button/components/button_label }}
27
+ {{> components/button/components/button_icon }}
28
+ {{/components/button/button}}
29
+ `)
30
+ return hbsTemplate({ ...args })
31
+ }
32
+
33
+ const buttonWithLabelAndIconLeftTemplate = (args) => {
34
+ let hbsTemplate = handlebars.compile(`
35
+ {{#> components/button/button~}}
36
+ {{> components/button/components/button_icon }}
37
+ {{> components/button/components/button_label }}
38
+ {{~/components/button/button}}
39
+ `)
40
+ return hbsTemplate({ ...args })
41
+ }
42
+
43
+ export default {
44
+ title: 'Komponenten/Buttons/Button',
45
+
46
+ argTypes: {
47
+ '_alpineClick': {
48
+ description:
49
+ 'Erlaubt es Javascript bei einem Klick auf den Button auszuführen. Mehr Details unter [https://alpinejs.dev/directives/on](https://alpinejs.dev/directives/on)',
50
+ control: 'text',
51
+
52
+ table: {
53
+ category: 'Button',
54
+ },
55
+ },
56
+
57
+ '_ariaLabel': {
58
+ description: 'Label',
59
+ control: 'text',
60
+
61
+ table: {
62
+ category: 'Button',
63
+ },
64
+ },
65
+
66
+ '_id': {
67
+ control: 'text',
68
+ description: 'Eindeutige ID',
69
+
70
+ table: {
71
+ category: 'Button',
72
+ },
73
+ },
74
+
75
+ '_css': {
76
+ description: 'Erlaubt die Angabe zusätzlicher CSS Klassen für den Button',
77
+ control: 'text',
78
+
79
+ table: {
80
+ category: 'Button',
81
+ },
82
+ },
83
+
84
+ '_label': {
85
+ description: 'Label des Buttons',
86
+ control: 'text',
87
+
88
+ table: {
89
+ category: 'Label',
90
+ },
91
+ },
92
+
93
+ '_name': {
94
+ description:
95
+ 'Legt den Namen des Buttons fest. Wird benötigt, wenn der Button als Submit Button innerhalb eines Formulars genutzt wird.',
96
+ control: 'text',
97
+
98
+ table: {
99
+ category: 'Button',
100
+ },
101
+ },
102
+
103
+ '_title': {
104
+ description: 'Optionaler erläuternder Text, der als Tooltip angezeigt wird.',
105
+ control: 'text',
106
+
107
+ table: {
108
+ category: 'Button',
109
+ },
110
+ },
111
+
112
+ '_value': {
113
+ description:
114
+ 'Dieser Wert wird zusammen mit dem Namen bei einem Submit innerhalb eines Formulars an den Server übertragen.',
115
+ control: 'text',
116
+
117
+ table: {
118
+ category: 'Button',
119
+ },
120
+ },
121
+
122
+ '_noFocus': {
123
+ description:
124
+ 'Legt fest, ob der Button mit einem `Tab` angesprungen werden kann oder nicht. ',
125
+ control: 'boolean',
126
+
127
+ table: {
128
+ category: 'Button',
129
+
130
+ defaultValue: {
131
+ summary: false,
132
+ },
133
+ },
134
+ },
135
+
136
+ '_onBackground': {
137
+ description:
138
+ 'Wird dieser Wert gesetzt, wird der Button in einem auf einen farbigen Hintergrund abgestimmtes Farbschema angezeigt. ',
139
+ control: 'boolean',
140
+
141
+ table: {
142
+ category: 'Button',
143
+
144
+ defaultValue: {
145
+ summary: false,
146
+ },
147
+ },
148
+ },
149
+
150
+ '_disableButtonPress': {
151
+ description:
152
+ 'Durch setzen dieses Wertes, kann deaktiviert werden, dass der Druck auf den Button optisch angezeigt wird.',
153
+ control: 'boolean',
154
+
155
+ table: {
156
+ category: 'Button',
157
+
158
+ defaultValue: {
159
+ summary: false,
160
+ },
161
+ },
162
+ },
163
+
164
+ '_size': {
165
+ options: ['sm', 'md', 'lg'],
166
+ control: {
167
+ type: 'select',
168
+ },
169
+
170
+ description: 'Bestimmt die Größe des Buttons. Erlaubte Werte sind `sm`, `md` und `lg`',
171
+
172
+ table: {
173
+ category: 'Button',
174
+
175
+ defaultValue: {
176
+ summary: 'md',
177
+ },
178
+ },
179
+ },
180
+
181
+ '_type': {
182
+ options: ['button', 'submit', 'reset'],
183
+ control: {
184
+ type: 'select',
185
+ },
186
+
187
+ description:
188
+ 'Setzt das Attribut type des HTML Button Elements. Erlaubte Werte sind `button`, `submit` oder `reset`',
189
+
190
+ table: {
191
+ category: 'Button',
192
+
193
+ defaultValue: {
194
+ summary: 'submit',
195
+ },
196
+ },
197
+ },
198
+
199
+ '_variant': {
200
+ description:
201
+ 'In welcher Variante soll der Button dargestellt werden. Erlaubte Varianten sind `primary`, `secondary`, `tertiary`',
202
+
203
+ options: ['primary', 'secondary', 'tertiary'],
204
+ control: {
205
+ type: 'select',
206
+ },
207
+
208
+ table: {
209
+ category: 'Button',
210
+ defaultValue: {
211
+ summary: 'primary',
212
+ },
213
+ },
214
+ },
215
+
216
+ '_x-show': {
217
+ description:
218
+ 'Setzt die Alpine.js Direktive `x-show` und erlaubt so den Button auf Basis des Wertes einer boolschen Variable ein- oder auszublenden. Mehr dazu unter [https://alpinejs.dev/directives/show](https://alpinejs.dev/directives/show)',
219
+ control: 'text',
220
+
221
+ table: {
222
+ category: 'Button',
223
+ },
224
+ },
225
+
226
+ '_icon': {
227
+ description: 'Der Name des Icons in der Iconmap',
228
+ control: 'text',
229
+
230
+ table: {
231
+ category: 'Icon',
232
+ },
233
+ },
234
+
235
+ '_iconMap': {
236
+ control: 'text',
237
+ description: 'Der Name der zu verwendenden Iconmap',
238
+
239
+ table: {
240
+ defaultValue: {
241
+ summary: 'icons',
242
+ },
243
+
244
+ category: 'Icon',
245
+ },
246
+ },
247
+ },
248
+
249
+ parameters: {
250
+ controls: {
251
+ sort: 'alpha',
252
+ },
253
+ },
254
+ }
255
+
256
+ export const Spielplatz = {
257
+ render: buttonWithLabelTemplate.bind({}),
258
+ name: 'Spielplatz',
259
+
260
+ args: {
261
+ _size: 'md',
262
+ _label: 'Button',
263
+ },
264
+ }
265
+
266
+ export const ButtonLg = {
267
+ render: buttonWithLabelTemplate.bind({}),
268
+ name: 'Button - lg',
269
+
270
+ argTypes: {
271
+ _size: {
272
+ control: false,
273
+ },
274
+
275
+ _variant: {
276
+ control: false,
277
+ },
278
+ _label: {
279
+ control: false,
280
+ },
281
+ },
282
+
283
+ args: {
284
+ _size: 'lg',
285
+ _label: 'Large',
286
+ },
287
+ }
288
+
289
+ export const ButtonMd = {
290
+ render: buttonWithLabelTemplate.bind({}),
291
+ name: 'Button - md',
292
+
293
+ argTypes: {
294
+ _size: {
295
+ control: false,
296
+ },
297
+
298
+ _variant: {
299
+ control: false,
300
+ },
301
+ },
302
+
303
+ args: {
304
+ _size: 'md',
305
+ _label: 'Medium',
306
+ },
307
+ }
308
+
309
+ export const ButtonSm = {
310
+ render: buttonWithLabelTemplate.bind({}),
311
+ name: 'Button - sm',
312
+
313
+ argTypes: {
314
+ _size: {
315
+ control: false,
316
+ },
317
+
318
+ _variant: {
319
+ control: false,
320
+ },
321
+ },
322
+
323
+ args: {
324
+ _size: 'sm',
325
+ _label: 'Small',
326
+ },
327
+ }
328
+
329
+ export const ButtonPrimary = {
330
+ render: buttonWithLabelTemplate.bind({}),
331
+ name: 'Button - Primary',
332
+
333
+ argTypes: {
334
+ _size: {
335
+ control: false,
336
+ },
337
+
338
+ _variant: {
339
+ control: false,
340
+ },
341
+ },
342
+
343
+ args: {
344
+ _size: 'lg',
345
+ _label: 'Primary',
346
+ },
347
+ }
348
+
349
+ export const ButtonSecondary = {
350
+ render: buttonWithLabelTemplate.bind({}),
351
+ name: 'Button - Secondary',
352
+
353
+ argTypes: {
354
+ _size: {
355
+ control: false,
356
+ },
357
+
358
+ _variant: {
359
+ control: false,
360
+ },
361
+ },
362
+
363
+ args: {
364
+ _size: 'lg',
365
+ _label: 'Secondary',
366
+ _variant: 'secondary',
367
+ },
368
+ }
369
+
370
+ export const ButtonTertiary = {
371
+ render: buttonWithLabelTemplate.bind({}),
372
+ name: 'Button - Tertiary',
373
+
374
+ argTypes: {
375
+ _size: {
376
+ control: false,
377
+ },
378
+
379
+ _variant: {
380
+ control: false,
381
+ },
382
+ },
383
+
384
+ args: {
385
+ _size: 'lg',
386
+ _label: 'Tertiary',
387
+ _variant: 'tertiary',
388
+ },
389
+ }
390
+
391
+ export const ButtonIconRechts = {
392
+ render: buttonWithLabelAndIconRightTemplate.bind({}),
393
+ name: 'Button - Icon rechts',
394
+
395
+ argTypes: {
396
+ _size: {
397
+ control: false,
398
+ },
399
+
400
+ _variant: {
401
+ control: false,
402
+ },
403
+ },
404
+
405
+ args: {
406
+ _size: 'lg',
407
+ _label: 'Icon rechts',
408
+ _icon: 'arrow-right',
409
+ },
410
+ }
411
+
412
+ export const ButtonIconLinks = {
413
+ render: buttonWithLabelAndIconLeftTemplate.bind({}),
414
+ name: 'Button - Icon links',
415
+
416
+ argTypes: {
417
+ _size: {
418
+ control: false,
419
+ },
420
+
421
+ _variant: {
422
+ control: false,
423
+ },
424
+ },
425
+
426
+ args: {
427
+ _size: 'lg',
428
+ _label: 'Icon links',
429
+ _icon: 'arrow-left',
430
+ },
431
+ }
432
+
433
+ export const ButtonPrimaryAufFarbigemHintergrund = {
434
+ render: buttonWithLabelTemplateOnBackground.bind({}),
435
+ name: 'Button - Primary auf farbigem Hintergrund',
436
+
437
+ argTypes: {
438
+ _size: {
439
+ control: false,
440
+ },
441
+
442
+ _variant: {
443
+ control: false,
444
+ },
445
+
446
+ _onBackground_: {
447
+ control: false,
448
+ },
449
+ },
450
+
451
+ args: {
452
+ _size: 'lg',
453
+ _label: 'Primary',
454
+ _onBackground: true,
455
+ },
456
+ }
457
+
458
+ export const ButtonSecondaryAufFarbigemHintergrund = {
459
+ render: buttonWithLabelTemplateOnBackground.bind({}),
460
+ name: 'Button - Secondary auf farbigem Hintergrund',
461
+
462
+ argTypes: {
463
+ _size: {
464
+ control: false,
465
+ },
466
+
467
+ _variant: {
468
+ control: false,
469
+ },
470
+
471
+ _onBackground: {
472
+ control: false,
473
+ },
474
+ },
475
+
476
+ args: {
477
+ _size: 'lg',
478
+ _label: 'Secondary',
479
+ _variant: 'secondary',
480
+ _onBackground: true,
481
+ },
482
+ }
483
+
484
+ export const ButtonTertiaryAufFarbigemHintergrund = {
485
+ render: buttonWithLabelTemplateOnBackground.bind({}),
486
+ name: 'Button - Tertiary auf farbigem Hintergrund',
487
+
488
+ argTypes: {
489
+ _size: {
490
+ control: false,
491
+ },
492
+
493
+ _variant: {
494
+ control: false,
495
+ },
496
+
497
+ _onBackground: {
498
+ control: false,
499
+ },
500
+ },
501
+
502
+ args: {
503
+ _size: 'lg',
504
+ _label: 'Tertiary',
505
+ _variant: 'tertiary',
506
+ _onBackground: true,
507
+ },
508
+ }
@@ -1 +1,2 @@
1
- {{> components/base/image/icon _addClass=(appendToDefault _css "w-4 h-4 fill-inherit") _icon=_icon _iconmap=_iconmap}}
1
+ {{> components/base/image/icon _addClass=(appendToDefault _css "ds-button-icon w-4 h-4 fill-current") _icon=_icon _iconmap=_iconmap}}
2
+ {{#*inline "css"}}{{/inline}}
@@ -0,0 +1,25 @@
1
+ import { ArgsTable, Meta, Story, Canvas } from '@storybook/blocks'
2
+ import * as ButtonIconStories from './button_icon.stories'
3
+
4
+ <Meta of={ButtonIconStories} />
5
+
6
+ # Button-Icon
7
+
8
+ Die Komponente erzeugt das Icon für die [Button-Komponente](?path=/docs/komponenten-buttons-button--spielplatz). Sie darf in einem Template
9
+ ausschließlich als Subkomponente der Button-Komponente eingebunden werden.
10
+
11
+ ## Eigenschaften
12
+
13
+ <ArgsTable story="Icon" />
14
+
15
+ ## Verwendung
16
+
17
+ Die Komponente wird wie in folgendem Codebeispiel gezeigt in einem Handlebar Template eingebunden.
18
+
19
+ ```handlebars
20
+ {{> components/button/components/button_icon _icon="calendar"}}
21
+ ```
22
+
23
+ <Canvas withToolbar>
24
+ <Story of={ButtonIconStories.Icon} />
25
+ </Canvas>
@@ -0,0 +1,44 @@
1
+ const handlebars = require('hrHandlebars')
2
+
3
+ const buttonIconTemplate = (args) => {
4
+ let hbsTemplate = handlebars.compile(`
5
+ {{>components/button/components/button_icon }}
6
+ `)
7
+ return hbsTemplate({ ...args })
8
+ }
9
+
10
+ export default {
11
+ title: 'Komponenten/Buttons/Komponenten/Icon',
12
+
13
+ argTypes: {
14
+ _css: {
15
+ control: 'text',
16
+ description: 'Hierüber können dem Icon zusätzliche CSS Klassen zugewiesen werden.',
17
+ },
18
+
19
+ _icon: {
20
+ control: 'text',
21
+ description: 'Der Name des Icons in der Iconmap',
22
+ },
23
+
24
+ _iconMap: {
25
+ control: 'text',
26
+ description: 'Der Name der zu verwendenden Iconmap',
27
+
28
+ table: {
29
+ defaultValue: {
30
+ summary: 'icons',
31
+ },
32
+ },
33
+ },
34
+ },
35
+ }
36
+
37
+ export const Icon = {
38
+ render: buttonIconTemplate.bind({}),
39
+ name: 'Icon',
40
+
41
+ args: {
42
+ _icon: 'calendar',
43
+ },
44
+ }
@@ -1 +1 @@
1
- <span class="{{#if _css}} {{_css}}{{/if}}">{{_label}}</span>
1
+ <span class='ds-button-label {{defaultIfEmpty _css "hallo"}}'>{{_label}}</span>
@@ -0,0 +1,25 @@
1
+ import { ArgsTable, Meta, Story, Canvas } from '@storybook/blocks'
2
+ import * as ButtonLabelStories from './button_label.stories'
3
+
4
+ <Meta of={ButtonLabelStories} />
5
+
6
+ # Button-Label
7
+
8
+ Die Komponente erzeugt den Text für die [Button-Komponente](?path=/docs/komponenten-buttons-button--spielplatz). Sie darf in einem Template
9
+ ausschließlich als Subkomponente der Button-Komponente eingebunden werden.
10
+
11
+ ## Eigenschaften
12
+
13
+ <ArgsTable story="Label" />
14
+
15
+ ## Verwendung
16
+
17
+ Die Komponente wird wie in folgendem Codebeispiel gezeigt in einem Handlebar Template eingebunden.
18
+
19
+ ```handlebars
20
+ {{> components/button/components/button_label _label="Button"}}
21
+ ```
22
+
23
+ <Canvas withToolbar>
24
+ <Story of={ButtonLabelStories.Label} />
25
+ </Canvas>
@@ -0,0 +1,33 @@
1
+ const handlebars = require('hrHandlebars')
2
+
3
+ const buttonLabelTemplate = (args) => {
4
+ let hbsTemplate = handlebars.compile(`
5
+ {{>components/button/components/button_label }}
6
+ `)
7
+ return hbsTemplate({ ...args })
8
+ }
9
+
10
+ export default {
11
+ title: 'Komponenten/Buttons/Komponenten/Label',
12
+
13
+ argTypes: {
14
+ _label: {
15
+ control: 'text',
16
+ description: 'Text des Labels',
17
+ },
18
+
19
+ _css: {
20
+ control: 'text',
21
+ description: 'Hierüber können dem Label zusätzliche CSS Klassen zugewiesen werden.',
22
+ },
23
+ },
24
+ }
25
+
26
+ export const Label = {
27
+ render: buttonLabelTemplate.bind({}),
28
+ name: 'Label',
29
+
30
+ args: {
31
+ _label: 'Button',
32
+ },
33
+ }
@@ -0,0 +1,6 @@
1
+ {{#> components/base/link_v2 _css=_css _isAriaHidden=_isAriaHidden}}
2
+ {{> @partial-block }}
3
+ {{/components/base/link_v2}}
4
+ {{#*inline "css"~}}
5
+ {{> components/button/utilities/button_base_classes}} {{> components/button/utilities/button_variation_classes _variant=_variant-adjust_context _onBackground=_onBackground-adjust_context}} {{> components/button/utilities/button_dimension_classes _size=_size-adjust_context~}}
6
+ {{~/inline}}