hr-design-system-handlebars 0.56.15 → 0.57.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.
@@ -1,3 +1,4 @@
1
+ <script defer src="https://cdn.jsdelivr.net/npm/async-alpine@0.3.x/dist/async-alpine.script.js"></script>
1
2
  <script defer src="https://unpkg.com/@alpinejs/collapse@3.8.1/dist/cdn.min.js"></script>
2
- <script src="https://unpkg.com/@alpine-collective/toolkit@1.0.0/dist/cdn.min.js" defer></script>
3
+ <script defer src="https://unpkg.com/@alpine-collective/toolkit@1.0.0/dist/cdn.min.js"></script>
3
4
  <script defer src="https://unpkg.com/alpinejs@3.8.1/dist/cdn.min.js"></script>
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # v0.57.0 (Tue Sep 27 2022)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Dpe 1766 [#329](https://github.com/mumprod/hr-design-system-handlebars/pull/329) ([@vascoeduardo](https://github.com/vascoeduardo) [@szuelch](https://github.com/szuelch))
6
+
7
+ #### Authors: 2
8
+
9
+ - [@szuelch](https://github.com/szuelch)
10
+ - Vasco ([@vascoeduardo](https://github.com/vascoeduardo))
11
+
12
+ ---
13
+
1
14
  # v0.56.15 (Fri Sep 16 2022)
2
15
 
3
16
  #### 🐛 Bug Fix
@@ -441,7 +441,7 @@ video {
441
441
  --tw-shadow-colored: 0 0 rgba(0,0,0,0);
442
442
  }
443
443
 
444
- .link-focus-inset, .link-focus, .link-focus-inset-white, .link-focus-white {
444
+ .link-focus-inset, .link-focus, .link-focus-inset-white, .link-focus-white, .focus\:ring {
445
445
  --tw-ring-inset: ;
446
446
  --tw-ring-offset-width: 0px;
447
447
  --tw-ring-offset-color: #fff;
@@ -801,6 +801,9 @@ video {
801
801
  .mt-3 {
802
802
  margin-top: 0.75rem;
803
803
  }
804
+ .mb-6 {
805
+ margin-bottom: 1.5rem;
806
+ }
804
807
  .mb-7 {
805
808
  margin-bottom: 1.75rem;
806
809
  }
@@ -886,6 +889,9 @@ video {
886
889
  .h-24 {
887
890
  height: 6rem;
888
891
  }
892
+ .h-1 {
893
+ height: 0.25rem;
894
+ }
889
895
  .max-h-0 {
890
896
  max-height: 0px;
891
897
  }
@@ -1193,6 +1199,12 @@ video {
1193
1199
  .rounded-3xl {
1194
1200
  border-radius: 1.5rem;
1195
1201
  }
1202
+ .rounded-full {
1203
+ border-radius: 9999px;
1204
+ }
1205
+ .rounded-lg {
1206
+ border-radius: 0.5rem;
1207
+ }
1196
1208
  .rounded-t-xl {
1197
1209
  border-top-left-radius: 0.75rem;
1198
1210
  border-top-right-radius: 0.75rem;
@@ -1401,6 +1413,13 @@ video {
1401
1413
  --tw-bg-opacity: 1;
1402
1414
  background-color: rgba(220, 232, 240, var(--tw-bg-opacity));
1403
1415
  }
1416
+ .bg-black {
1417
+ --tw-bg-opacity: 1;
1418
+ background-color: rgba(0, 0, 0, var(--tw-bg-opacity));
1419
+ }
1420
+ .bg-opacity-50 {
1421
+ --tw-bg-opacity: 0.5;
1422
+ }
1404
1423
  .bg-gradient-to-r {
1405
1424
  background-image: -webkit-gradient(linear, left top, right top, from(var(--tw-gradient-stops)));
1406
1425
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
@@ -1457,6 +1476,9 @@ video {
1457
1476
  .p-8 {
1458
1477
  padding: 2rem;
1459
1478
  }
1479
+ .p-0\.5 {
1480
+ padding: 0.125rem;
1481
+ }
1460
1482
  .px-4 {
1461
1483
  padding-left: 1rem;
1462
1484
  padding-right: 1rem;
@@ -1603,15 +1625,15 @@ video {
1603
1625
  .pb-4 {
1604
1626
  padding-bottom: 1rem;
1605
1627
  }
1628
+ .pt-6 {
1629
+ padding-top: 1.5rem;
1630
+ }
1606
1631
  .pb-10 {
1607
1632
  padding-bottom: 2.5rem;
1608
1633
  }
1609
1634
  .pt-8 {
1610
1635
  padding-top: 2rem;
1611
1636
  }
1612
- .pt-6 {
1613
- padding-top: 1.5rem;
1614
- }
1615
1637
  .text-left {
1616
1638
  text-align: left;
1617
1639
  }
@@ -1941,7 +1963,7 @@ video {
1941
1963
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
1942
1964
  }
1943
1965
  .counter-reset {
1944
- counter-reset: cnt1663336382306;
1966
+ counter-reset: cnt1664291825673;
1945
1967
  }
1946
1968
  .placeholder-text-xs::-webkit-input-placeholder {
1947
1969
  font-size: 0.75rem;
@@ -2324,7 +2346,7 @@ video {
2324
2346
  --tw-ring-color: rgba(255, 255, 255, 0.5);
2325
2347
  }
2326
2348
  .-ordered {
2327
- counter-increment: cnt1663336382306 1;
2349
+ counter-increment: cnt1664291825673 1;
2328
2350
  }
2329
2351
  .-ordered::before {
2330
2352
  position: absolute;
@@ -2341,7 +2363,7 @@ video {
2341
2363
  letter-spacing: .0125em;
2342
2364
  --tw-text-opacity: 1;
2343
2365
  color: rgba(0, 0, 0, var(--tw-text-opacity));
2344
- content: counter(cnt1663336382306);
2366
+ content: counter(cnt1664291825673);
2345
2367
  }
2346
2368
  /*! purgecss start ignore */
2347
2369
  :root,
@@ -2823,6 +2845,19 @@ video {
2823
2845
  outline: 2px solid transparent;
2824
2846
  outline-offset: 2px;
2825
2847
  }
2848
+ .focus\:ring:focus {
2849
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
2850
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
2851
+ -webkit-box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 rgba(0,0,0,0);
2852
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 rgba(0,0,0,0);
2853
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), 0 0 rgba(0,0,0,0);
2854
+ -webkit-box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0,0,0,0));
2855
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 rgba(0,0,0,0));
2856
+ }
2857
+ .focus\:ring-\[\#1F89AE\]:focus {
2858
+ --tw-ring-opacity: 1;
2859
+ --tw-ring-color: rgba(31, 137, 174, var(--tw-ring-opacity));
2860
+ }
2826
2861
  .active\:font-bold:active {
2827
2862
  font-weight: 700;
2828
2863
  }
@@ -2837,6 +2872,41 @@ video {
2837
2872
  -webkit-text-decoration-line: underline;
2838
2873
  text-decoration-line: underline;
2839
2874
  }
2875
+ @media (color-index: 48) {
2876
+
2877
+ .dark\:bg-gray-700 {
2878
+ --tw-bg-opacity: 1;
2879
+ background-color: rgba(55, 65, 81, var(--tw-bg-opacity));
2880
+ }
2881
+ }
2882
+ @media (color: 48842621) {
2883
+
2884
+ .dark\:bg-gray-700 {
2885
+ --tw-bg-opacity: 1;
2886
+ background-color: rgba(55, 65, 81, var(--tw-bg-opacity));
2887
+ }
2888
+ }
2889
+ @media (color-index: 48) {
2890
+
2891
+ .dark\:bg-gray-700 {
2892
+ --tw-bg-opacity: 1;
2893
+ background-color: rgba(55, 65, 81, var(--tw-bg-opacity));
2894
+ }
2895
+ }
2896
+ @media (color: 48842621) {
2897
+
2898
+ .dark\:bg-gray-700 {
2899
+ --tw-bg-opacity: 1;
2900
+ background-color: rgba(55, 65, 81, var(--tw-bg-opacity));
2901
+ }
2902
+ }
2903
+ @media (prefers-color-scheme: dark) {
2904
+
2905
+ .dark\:bg-gray-700 {
2906
+ --tw-bg-opacity: 1;
2907
+ background-color: rgba(55, 65, 81, var(--tw-bg-opacity));
2908
+ }
2909
+ }
2840
2910
  @media print {
2841
2911
 
2842
2912
  .print\:flex {
@@ -0,0 +1,3 @@
1
+ <div class="grid grid-cols-12 pt-6 md:pt-7 bg-[#dce8f0] mx-0 md:rounded-tl-3xl md:rounded-br-3xl col-main gap-x-6 gap-y-6" >
2
+ {{> components/teaser/podcast/podcast_player }}
3
+ </div>
@@ -0,0 +1,38 @@
1
+ <div class="w-full col-span-12 js-load"
2
+ x-data="playaudio()"
3
+ ax-load
4
+ ax-load-src="http://localhost:6006/vendor/js/podcastPlayer.alpine.js">
5
+ <button x-on:keydown.tab="playAndStop" x-on:click="playAndStop" type="button" class="relative rounded-xl group cursor-pointer focus:outline-none focus:ring focus:ring-[#1F89AE]">
6
+ <div class="">
7
+ <div x-show="!currentlyPlaying" class="bg-black bg-opacity-50 rounded-full p-0.5 text-white">
8
+ start
9
+ </div>
10
+ <div x-show="currentlyPlaying" class="bg-black bg-opacity-50 rounded-full p-0.5 text-white">
11
+ stop
12
+ </div>
13
+ </div>
14
+ </button>
15
+
16
+ <input x-ref="range" x-on:input="rangeInput()" type="range" x-bind:value="currentTimePercentage" min="0" max="1000" class="w-full h-1 mb-6 rounded-lg appearance-none cursor-pointer range-sm dark:bg-gray-700" >
17
+
18
+ <div class="c-audioPlayer__metaText text__byline">
19
+ <span x-text="currentTime">00:00</span>
20
+ <span class="">/</span>
21
+ <span x-text="audioDuration">06:21 Min</span>
22
+ </div>
23
+
24
+ <audio x-ref="audio" controls="controls">
25
+ <source src="https://mp3podcasthr-a.akamaihd.net/mp3/podcast/hr2_audio/hr2_audio_20220914_95730396.mp3" type="audio/mp3" />
26
+ </audio>
27
+
28
+ <div class="hidden">
29
+ currentTime: <span x-text="currentTime"></span><br>
30
+ currentTimePercentage: <span x-text="currentTimePercentage"></span><br>
31
+ currentTimeMs: <span x-text="currentTimeMs"></span><br>
32
+ currentTimeS: <span x-text="currentTimeS"></span><br>
33
+ currentTimeM: <span x-text="currentTimeM"></span><br>
34
+ currentTimeH: <span x-text="currentTimeH"></span><br>
35
+ audioDuration: <span x-text="audioDuration"></span><br>
36
+ </div>
37
+ </div>
38
+
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
8
8
  "repository": "https://github.com/szuelch/hr-design-system-handlebars",
9
- "version": "0.56.15",
9
+ "version": "0.57.0",
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "storybook": "start-storybook -p 6006 public",
@@ -0,0 +1,63 @@
1
+ export default function playaudio () {
2
+ return {
3
+ init: false,
4
+ currentlyPlaying: false,
5
+ currentTime: "00:00",
6
+ currentTimeMs: 0,
7
+ currentTimeS: 0,
8
+ currentTimeM: 0,
9
+ currentTimeH: 0,
10
+ currentTimePercentage: 0,
11
+ audioDuration: 0,
12
+ pad(n, z) {
13
+ z = z || 2;
14
+ return ('00' + n).slice(-z);
15
+ },
16
+ rangeInput() {
17
+ if(!this.init){
18
+ //start and stop the audio
19
+ this.playAndStop()
20
+ this.playAndStop()
21
+ }
22
+ this.$refs.audio.currentTime = (this.$refs.range.value/1000) * this.audioDuration
23
+ },
24
+ updateCurrentTime(s) {
25
+ this.currentTimeMs = s % 1000;
26
+ s = (s - this.currentTimeMs) / 1000;
27
+ this.currentTimeS = s % 60;
28
+ s = (s - this.currentTimeS) / 60;
29
+ this.currentTimeM = s % 60;
30
+ this.currentTimeH = (s - this.currentTimeM) / 60;
31
+ this.currentTime = this.pad(this.currentTimeM) + ':' + this.pad(this.currentTimeS) ;
32
+ this.currentTimePercentage = ((100 * this.$refs.audio.currentTime) / this.audioDuration) * 10
33
+ },
34
+ playAndStop() {
35
+ if (this.currentlyPlaying) {
36
+ this.stopAudio()
37
+ } else {
38
+ this.startAudio()
39
+ }
40
+ },
41
+ startAudio() {
42
+ if(!this.init) {
43
+ this.init = true;
44
+ this.audioDuration = this.$refs.audio.duration;
45
+ this.initAudioEventListener()
46
+ }
47
+ this.$refs.audio.play();
48
+ this.currentlyPlaying = true;
49
+ },
50
+ stopAudio() {
51
+ this.$refs.audio.pause();
52
+ this.currentlyPlaying = false;
53
+ },
54
+ initAudioEventListener() {
55
+ this.$refs.audio.ontimeupdate = (event) => {
56
+ this.updateCurrentTime( this.$refs.audio.currentTime * 1000)
57
+ };
58
+ },
59
+ returnString() {
60
+ return "String"
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,3 @@
1
+ <div class="grid grid-cols-12 pt-6 md:pt-7 bg-[#dce8f0] mx-0 md:rounded-tl-3xl md:rounded-br-3xl col-main gap-x-6 gap-y-6" >
2
+ {{> components/teaser/podcast/podcast_player }}
3
+ </div>
@@ -0,0 +1,39 @@
1
+ import { ArgsTable, Meta, Story, Canvas, Preview } from '@storybook/addon-docs'
2
+
3
+ import podcast from './podcast.hbs'
4
+
5
+
6
+ <Meta title="Komponenten/Teaser/Podcast"
7
+ parameters={{
8
+ chromatic: {
9
+ viewports: [360, 768, 1024]
10
+ },
11
+ layout: 'fullscreen',
12
+ }}
13
+ argTypes={{
14
+ }}
15
+ decorators={[
16
+ (Story) => {
17
+ return `<div class="grid my-5 grid-page">
18
+
19
+ ${Story()}
20
+
21
+ </div>`
22
+ },
23
+ ]}
24
+ />
25
+
26
+ export const Template = (args, { globals: { customConditionalToolbar } }) => {
27
+ // You can either use a function to create DOM elements or use a plain html string!
28
+ // return `<div>${label}</div>`;
29
+ let brand =
30
+ undefined !== customConditionalToolbar ? customConditionalToolbar['brands'] : 'hessenschau'
31
+ return podcast({ brand, ...args })
32
+ }
33
+
34
+
35
+ <Preview withToolbar>
36
+ <Story name="Beispiel 1" >
37
+ {Template.bind({})}
38
+ </Story>
39
+ </Preview>
@@ -0,0 +1,38 @@
1
+ <div class="w-full col-span-12 js-load"
2
+ x-data="playaudio()"
3
+ ax-load
4
+ ax-load-src="http://localhost:6006/vendor/js/podcastPlayer.alpine.js">
5
+ <button x-on:keydown.tab="playAndStop" x-on:click="playAndStop" type="button" class="relative rounded-xl group cursor-pointer focus:outline-none focus:ring focus:ring-[#1F89AE]">
6
+ <div class="">
7
+ <div x-show="!currentlyPlaying" class="bg-black bg-opacity-50 rounded-full p-0.5 text-white">
8
+ start
9
+ </div>
10
+ <div x-show="currentlyPlaying" class="bg-black bg-opacity-50 rounded-full p-0.5 text-white">
11
+ stop
12
+ </div>
13
+ </div>
14
+ </button>
15
+
16
+ <input x-ref="range" x-on:input="rangeInput()" type="range" x-bind:value="currentTimePercentage" min="0" max="1000" class="w-full h-1 mb-6 rounded-lg appearance-none cursor-pointer range-sm dark:bg-gray-700" >
17
+
18
+ <div class="c-audioPlayer__metaText text__byline">
19
+ <span x-text="currentTime">00:00</span>
20
+ <span class="">/</span>
21
+ <span x-text="audioDuration">06:21 Min</span>
22
+ </div>
23
+
24
+ <audio x-ref="audio" controls="controls">
25
+ <source src="https://mp3podcasthr-a.akamaihd.net/mp3/podcast/hr2_audio/hr2_audio_20220914_95730396.mp3" type="audio/mp3" />
26
+ </audio>
27
+
28
+ <div class="hidden">
29
+ currentTime: <span x-text="currentTime"></span><br>
30
+ currentTimePercentage: <span x-text="currentTimePercentage"></span><br>
31
+ currentTimeMs: <span x-text="currentTimeMs"></span><br>
32
+ currentTimeS: <span x-text="currentTimeS"></span><br>
33
+ currentTimeM: <span x-text="currentTimeM"></span><br>
34
+ currentTimeH: <span x-text="currentTimeH"></span><br>
35
+ audioDuration: <span x-text="audioDuration"></span><br>
36
+ </div>
37
+ </div>
38
+