@descope-ui/descope-timer-button 3.4.0 → 3.5.1

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/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@descope-ui/descope-timer-button",
3
- "version": "3.4.0",
3
+ "version": "3.5.1",
4
+ "files": [
5
+ "src",
6
+ "stories"
7
+ ],
4
8
  "exports": {
5
9
  ".": {
6
10
  "import": "./src/component/index.js"
@@ -14,15 +18,15 @@
14
18
  },
15
19
  "devDependencies": {
16
20
  "@playwright/test": "1.58.2",
17
- "e2e-utils": "3.4.0",
18
- "test-drivers": "3.4.0",
19
- "test-assets": "3.4.0"
21
+ "e2e-utils": "3.5.1",
22
+ "test-drivers": "3.5.1",
23
+ "test-assets": "3.5.1"
20
24
  },
21
25
  "dependencies": {
22
- "@descope-ui/common": "3.4.0",
23
- "@descope-ui/theme-globals": "3.4.0",
24
- "@descope-ui/descope-timer": "3.4.0",
25
- "@descope-ui/descope-button": "3.4.0"
26
+ "@descope-ui/theme-globals": "3.5.1",
27
+ "@descope-ui/descope-timer": "3.5.1",
28
+ "@descope-ui/descope-button": "3.5.1",
29
+ "@descope-ui/common": "3.5.1"
26
30
  },
27
31
  "publishConfig": {
28
32
  "link-workspace-packages": false
@@ -10,6 +10,8 @@ import {
10
10
  getComponentName,
11
11
  injectStyle,
12
12
  } from '@descope-ui/common/components-helpers';
13
+ import { TimerClass } from '@descope-ui/descope-timer/class';
14
+ import { ButtonClass } from '@descope-ui/descope-button/class';
13
15
 
14
16
  export const componentName = getComponentName('timer-button');
15
17
 
@@ -67,26 +69,85 @@ class RawTimerButton extends BaseClass {
67
69
  .wrapper {
68
70
  display: flex;
69
71
  flex-direction: column;
70
- gap: 0.5em;
71
72
  align-items: center;
72
73
  width: 100%;
73
74
  }
74
- .timer {
75
+ /* allow timer to grow along the main axis in the wrapper flex container */
76
+ :host(:not([timer-inside="true"])) .timer {
75
77
  flex: 1;
76
78
  }
79
+ :host([timer-inside="true"]) .timer {
80
+ flex: 0 0 auto;
81
+ }
77
82
  `,
78
83
  this,
79
84
  );
80
85
 
86
+ this.wrapper = this.shadowRoot.querySelector('.wrapper');
81
87
  this.timer = this.shadowRoot.querySelector('.timer');
82
88
  this.button = this.shadowRoot.querySelector('.button');
89
+ this.forwardingSlot = this.shadowRoot.querySelector('.button slot');
83
90
 
84
91
  this.timer.addEventListener('timer-started', () => this.onTimerStarted());
85
92
  this.timer.addEventListener('timer-ended', () => this.onTimerEnded());
86
93
 
94
+ this.syncTimerPlacement();
95
+
87
96
  this.button.addEventListener('click', this.onClick.bind(this));
88
97
  }
89
98
 
99
+ static get observedAttributes() {
100
+ return [
101
+ ...(super.observedAttributes || []),
102
+ 'timer-inside',
103
+ 'timer-position',
104
+ ];
105
+ }
106
+
107
+ attributeChangedCallback(name, oldValue, newValue) {
108
+ super.attributeChangedCallback?.(name, oldValue, newValue);
109
+ if (name === 'timer-inside' || name === 'timer-position') {
110
+ this.syncTimerPlacement();
111
+ }
112
+ }
113
+
114
+ get #isTimerInside() {
115
+ return this.getAttribute('timer-inside') === 'true';
116
+ }
117
+
118
+ get #isReversed() {
119
+ return this.getAttribute('timer-position') === 'end';
120
+ }
121
+
122
+ syncTimerPlacement() {
123
+ if (this.#isTimerInside) {
124
+ this.#placeTimerInsideButton(this.#isReversed);
125
+ } else {
126
+ this.#placeTimerOutsideButton();
127
+ }
128
+ }
129
+
130
+ #placeTimerInsideButton(reversed) {
131
+ if (reversed) {
132
+ // timer after label text (right)
133
+ if (this.timer.previousSibling !== this.forwardingSlot) {
134
+ this.button.appendChild(this.timer);
135
+ }
136
+ } else {
137
+ // timer before label text (left) — matches default outside position (above/before button)
138
+ if (this.timer.nextSibling !== this.forwardingSlot) {
139
+ this.button.insertBefore(this.timer, this.forwardingSlot);
140
+ }
141
+ }
142
+ }
143
+
144
+ #placeTimerOutsideButton() {
145
+ // move timer back as a wrapper sibling, before the button so flex-column puts it above
146
+ if (this.timer.parentElement !== this.wrapper) {
147
+ this.wrapper.insertBefore(this.timer, this.button);
148
+ }
149
+ }
150
+
90
151
  set onclick(val) {
91
152
  this.button.onclick = val;
92
153
  }
@@ -134,10 +195,25 @@ class RawTimerButton extends BaseClass {
134
195
  }
135
196
  }
136
197
 
137
- const { host } = {
198
+ const {
199
+ host,
200
+ nestedTimer,
201
+ nestedButton,
202
+ timerInsideNotReversed,
203
+ timerInsideReversed,
204
+ } = {
138
205
  host: { selector: () => ':host' },
139
- icon: { selector: '.icon' },
140
- timer: { selector: '.timer' },
206
+ nestedTimer: { selector: () => ':host([timer-inside="true"]) .timer' },
207
+ nestedButton: {
208
+ selector: () => ':host([timer-inside="true"]) .button',
209
+ },
210
+ timerInsideNotReversed: {
211
+ selector: () =>
212
+ ':host([timer-inside="true"]:not([timer-position="end"])) .timer',
213
+ },
214
+ timerInsideReversed: {
215
+ selector: () => ':host([timer-inside="true"][timer-position="end"]) .timer',
216
+ },
141
217
  };
142
218
 
143
219
  export const TimerButtonClass = compose(
@@ -147,6 +223,30 @@ export const TimerButtonClass = compose(
147
223
  flexDirection: {},
148
224
  hostWidth: { ...host, property: 'width' },
149
225
  hostDirection: { ...host, property: 'direction' },
226
+ timerTextColor: {
227
+ ...nestedTimer,
228
+ property: TimerClass.cssVarList.textColor,
229
+ },
230
+ timerIconColor: {
231
+ ...nestedTimer,
232
+ property: TimerClass.cssVarList.iconColor,
233
+ },
234
+ timerHostWidth: {
235
+ ...nestedTimer,
236
+ property: TimerClass.cssVarList.hostWidth,
237
+ },
238
+ buttonLabelSpacing: {
239
+ ...nestedButton,
240
+ property: ButtonClass.cssVarList.labelSpacing,
241
+ },
242
+ timerInsideGapEnd: {
243
+ ...timerInsideNotReversed,
244
+ property: 'margin-inline-end',
245
+ },
246
+ timerInsideGapStart: {
247
+ ...timerInsideReversed,
248
+ property: 'margin-inline-start',
249
+ },
150
250
  },
151
251
  }),
152
252
  draggableMixin,
package/src/theme.js CHANGED
@@ -11,11 +11,35 @@ const timerButton = {
11
11
 
12
12
  _horizontal: {
13
13
  [vars.flexDirection]: 'row',
14
+ timerPosition: {
15
+ end: {
16
+ [vars.flexDirection]: 'row-reverse',
17
+ },
18
+ },
19
+ },
20
+
21
+ timerPosition: {
22
+ end: {
23
+ [vars.flexDirection]: 'column-reverse',
24
+ },
14
25
  },
15
26
 
16
27
  _fullWidth: {
17
28
  [vars.hostWidth]: '100%',
18
29
  },
30
+
31
+ _timerInside: {
32
+ [vars.timerTextColor]: 'currentColor',
33
+ [vars.timerIconColor]: 'currentColor',
34
+ [vars.timerHostWidth]: 'auto',
35
+ [vars.buttonLabelSpacing]: '0',
36
+ [vars.timerInsideGapEnd]: `var(${vars.gap})`,
37
+ timerPosition: {
38
+ end: {
39
+ [vars.timerInsideGapStart]: `var(${vars.gap})`,
40
+ },
41
+ },
42
+ },
19
43
  };
20
44
 
21
45
  export default timerButton;
@@ -13,6 +13,8 @@ const Template = ({
13
13
  'timer-seconds': timerSeconds,
14
14
  'timer-hide-icon': timerHideIcon,
15
15
  'timer-paused': timerPaused,
16
+ 'timer-position': timerPosition,
17
+ 'timer-inside': timerInside,
16
18
  size,
17
19
  direction,
18
20
  horizontal,
@@ -28,6 +30,8 @@ const Template = ({
28
30
  timer-seconds="${timerSeconds}"
29
31
  timer-hide-icon="${timerHideIcon || false}"
30
32
  timer-paused="${timerPaused || false}"
33
+ timer-position="${timerPosition || 'start'}"
34
+ timer-inside="${timerInside || false}"
31
35
  size="${size}"
32
36
  horizontal="${horizontal || false}"
33
37
  full-width="${fullWidth || false}"
@@ -76,6 +80,19 @@ export default {
76
80
  type: 'boolean',
77
81
  },
78
82
  },
83
+ 'timer-position': {
84
+ name: 'Timer Position',
85
+ options: ['start', 'end'],
86
+ control: {
87
+ type: 'radio',
88
+ },
89
+ },
90
+ 'timer-inside': {
91
+ name: 'Timer Inside Button',
92
+ control: {
93
+ type: 'boolean',
94
+ },
95
+ },
79
96
  'st-gap': {
80
97
  name: 'Gap',
81
98
  control: { type: 'text' },
@@ -94,6 +111,8 @@ Default.args = {
94
111
  'timer-seconds': 5,
95
112
  'timer-hide-icon': false,
96
113
  'timer-paused': false,
114
+ 'timer-position': 'start',
115
+ 'timer-inside': false,
97
116
  horizontal: false,
98
117
  'text-align': 'center',
99
118
  'button-variant': 'contained',
package/CHANGELOG.md DELETED
@@ -1,405 +0,0 @@
1
- # Changelog
2
-
3
- This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
-
5
- ## [3.4.0](https://github.com/descope/web-components-ui/compare/web-components-ui-3.3.5...web-components-ui-3.4.0) (2026-05-07)
6
-
7
- ## [3.3.5](https://github.com/descope/web-components-ui/compare/web-components-ui-3.3.4...web-components-ui-3.3.5) (2026-05-06)
8
-
9
- ## [3.3.4](https://github.com/descope/web-components-ui/compare/web-components-ui-3.3.3...web-components-ui-3.3.4) (2026-05-06)
10
-
11
- ## [3.3.3](https://github.com/descope/web-components-ui/compare/web-components-ui-3.3.2...web-components-ui-3.3.3) (2026-05-03)
12
-
13
- ## [3.3.2](https://github.com/descope/web-components-ui/compare/web-components-ui-3.3.1...web-components-ui-3.3.2) (2026-04-26)
14
-
15
- ## [3.3.1](https://github.com/descope/web-components-ui/compare/web-components-ui-3.3.0...web-components-ui-3.3.1) (2026-04-23)
16
-
17
- ## [3.3.0](https://github.com/descope/web-components-ui/compare/web-components-ui-3.2.2...web-components-ui-3.3.0) (2026-04-19)
18
-
19
- ## [3.2.2](https://github.com/descope/web-components-ui/compare/web-components-ui-3.2.1...web-components-ui-3.2.2) (2026-04-16)
20
-
21
- ## [3.2.1](https://github.com/descope/web-components-ui/compare/web-components-ui-3.2.0...web-components-ui-3.2.1) (2026-04-16)
22
-
23
- ## [3.2.0](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.13...web-components-ui-3.2.0) (2026-04-16)
24
-
25
- ## [3.1.13](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.12...web-components-ui-3.1.13) (2026-04-15)
26
-
27
- ## [3.1.12](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.11...web-components-ui-3.1.12) (2026-04-15)
28
-
29
- ## [3.1.11](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.10...web-components-ui-3.1.11) (2026-04-15)
30
-
31
- ## [3.1.10](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.9...web-components-ui-3.1.10) (2026-04-14)
32
-
33
- ## [3.1.9](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.8...web-components-ui-3.1.9) (2026-04-13)
34
-
35
- ## [3.1.8](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.7...web-components-ui-3.1.8) (2026-04-13)
36
-
37
- ## [3.1.7](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.6...web-components-ui-3.1.7) (2026-04-13)
38
-
39
- ## [3.1.6](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.5...web-components-ui-3.1.6) (2026-04-13)
40
-
41
- ## [3.1.5](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.4...web-components-ui-3.1.5) (2026-04-07)
42
-
43
- ## [3.1.4](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.3...web-components-ui-3.1.4) (2026-04-07)
44
-
45
- ## [3.1.3](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.2...web-components-ui-3.1.3) (2026-04-06)
46
-
47
- ## [3.1.2](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.1...web-components-ui-3.1.2) (2026-04-06)
48
-
49
- ## [3.1.1](https://github.com/descope/web-components-ui/compare/web-components-ui-3.1.0...web-components-ui-3.1.1) (2026-03-31)
50
-
51
- ## [3.1.0](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.10...web-components-ui-3.1.0) (2026-03-31)
52
-
53
- ## [3.0.10](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.9...web-components-ui-3.0.10) (2026-03-30)
54
-
55
- ## [3.0.9](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.8...web-components-ui-3.0.9) (2026-03-26)
56
-
57
- ## [3.0.8](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.7...web-components-ui-3.0.8) (2026-03-26)
58
-
59
- ## [3.0.7](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.6...web-components-ui-3.0.7) (2026-03-25)
60
-
61
- ## [3.0.6](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.5...web-components-ui-3.0.6) (2026-03-23)
62
-
63
- ## [3.0.5](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.4...web-components-ui-3.0.5) (2026-03-22)
64
-
65
- ## [3.0.4](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.3...web-components-ui-3.0.4) (2026-03-22)
66
-
67
- ## [3.0.3](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.2...web-components-ui-3.0.3) (2026-03-18)
68
-
69
- ## [3.0.2](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.1...web-components-ui-3.0.2) (2026-03-08)
70
-
71
- ## [3.0.1](https://github.com/descope/web-components-ui/compare/web-components-ui-3.0.0...web-components-ui-3.0.1) (2026-03-08)
72
-
73
- ## [3.0.0](https://github.com/descope/web-components-ui/compare/web-components-ui-2.3.3...web-components-ui-3.0.0) (2026-03-08)
74
-
75
- ## [2.3.3](https://github.com/descope/web-components-ui/compare/web-components-ui-2.3.2...web-components-ui-2.3.3) (2026-03-05)
76
-
77
- ## [2.3.2](https://github.com/descope/web-components-ui/compare/web-components-ui-2.3.1...web-components-ui-2.3.2) (2026-03-05)
78
-
79
- ## [2.3.1](https://github.com/descope/web-components-ui/compare/web-components-ui-2.3.0...web-components-ui-2.3.1) (2026-03-01)
80
-
81
- ## [2.3.0](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.59...web-components-ui-2.3.0) (2026-03-01)
82
-
83
- ## [2.2.59](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.58...web-components-ui-2.2.59) (2026-02-28)
84
-
85
- ## [2.2.58](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.57...web-components-ui-2.2.58) (2026-02-26)
86
-
87
- ## [2.2.57](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.56...web-components-ui-2.2.57) (2026-02-25)
88
-
89
- ## [2.2.56](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.55...web-components-ui-2.2.56) (2026-02-24)
90
-
91
- ## [2.2.55](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.54...web-components-ui-2.2.55) (2026-02-23)
92
-
93
- ## [2.2.54](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.53...web-components-ui-2.2.54) (2026-02-23)
94
-
95
- ## [2.2.53](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.52...web-components-ui-2.2.53) (2026-02-23)
96
-
97
- ## [2.2.52](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.51...web-components-ui-2.2.52) (2026-02-23)
98
-
99
- ## [2.2.51](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.50...web-components-ui-2.2.51) (2026-02-21)
100
-
101
- ## [2.2.50](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.49...web-components-ui-2.2.50) (2026-02-10)
102
-
103
- ## [2.2.49](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.48...web-components-ui-2.2.49) (2026-02-09)
104
-
105
- ## [2.2.48](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.47...web-components-ui-2.2.48) (2026-02-09)
106
-
107
- ## [2.2.47](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.46...web-components-ui-2.2.47) (2026-02-05)
108
-
109
- ### Bug Fixes
110
-
111
- - Migrate to Playwright 1.58.1 ([#873](https://github.com/descope/web-components-ui/issues/873)) ([ff16007](https://github.com/descope/web-components-ui/commit/ff16007b6316abd82050ce9bcbce8180a5660d95))
112
-
113
- ## [2.2.46](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.45...web-components-ui-2.2.46) (2026-02-05)
114
-
115
- ## [2.2.45](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.44...web-components-ui-2.2.45) (2026-02-05)
116
-
117
- ## [2.2.44](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.43...web-components-ui-2.2.44) (2026-02-05)
118
-
119
- ## [2.2.43](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.42...web-components-ui-2.2.43) (2026-02-04)
120
-
121
- ## [2.2.42](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.41...web-components-ui-2.2.42) (2026-02-04)
122
-
123
- ## [2.2.41](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.40...web-components-ui-2.2.41) (2026-02-01)
124
-
125
- ## [2.2.40](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.39...web-components-ui-2.2.40) (2026-01-29)
126
-
127
- ## [2.2.39](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.38...web-components-ui-2.2.39) (2026-01-29)
128
-
129
- ## [2.2.38](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.37...web-components-ui-2.2.38) (2026-01-28)
130
-
131
- ## [2.2.37](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.36...web-components-ui-2.2.37) (2026-01-28)
132
-
133
- ## [2.2.36](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.35...web-components-ui-2.2.36) (2026-01-28)
134
-
135
- ## [2.2.35](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.34...web-components-ui-2.2.35) (2026-01-22)
136
-
137
- ## [2.2.34](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.33...web-components-ui-2.2.34) (2026-01-21)
138
-
139
- ## [2.2.33](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.32...web-components-ui-2.2.33) (2026-01-21)
140
-
141
- ## [2.2.32](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.31...web-components-ui-2.2.32) (2026-01-21)
142
-
143
- ## [2.2.31](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.30...web-components-ui-2.2.31) (2026-01-21)
144
-
145
- ## [2.2.30](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.29...web-components-ui-2.2.30) (2026-01-19)
146
-
147
- ## [2.2.29](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.28...web-components-ui-2.2.29) (2026-01-19)
148
-
149
- ## [2.2.28](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.27...web-components-ui-2.2.28) (2026-01-19)
150
-
151
- ## [2.2.27](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.26...web-components-ui-2.2.27) (2026-01-18)
152
-
153
- ## [2.2.26](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.25...web-components-ui-2.2.26) (2026-01-18)
154
-
155
- ## [2.2.25](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.24...web-components-ui-2.2.25) (2026-01-15)
156
-
157
- ## [2.2.24](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.23...web-components-ui-2.2.24) (2026-01-13)
158
-
159
- ## [2.2.23](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.22...web-components-ui-2.2.23) (2026-01-13)
160
-
161
- ## [2.2.22](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.21...web-components-ui-2.2.22) (2026-01-13)
162
-
163
- ## [2.2.21](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.20...web-components-ui-2.2.21) (2026-01-12)
164
-
165
- ## [2.2.20](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.19...web-components-ui-2.2.20) (2026-01-12)
166
-
167
- ## [2.2.19](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.18...web-components-ui-2.2.19) (2026-01-11)
168
-
169
- ## [2.2.18](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.17...web-components-ui-2.2.18) (2026-01-06)
170
-
171
- ## [2.2.17](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.16...web-components-ui-2.2.17) (2026-01-05)
172
-
173
- ## [2.2.16](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.15...web-components-ui-2.2.16) (2025-12-28)
174
-
175
- ## [2.2.15](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.14...web-components-ui-2.2.15) (2025-12-23)
176
-
177
- ## [2.2.14](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.13...web-components-ui-2.2.14) (2025-12-22)
178
-
179
- ## [2.2.13](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.12...web-components-ui-2.2.13) (2025-12-21)
180
-
181
- ## [2.2.12](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.11...web-components-ui-2.2.12) (2025-12-18)
182
-
183
- ## [2.2.11](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.10...web-components-ui-2.2.11) (2025-12-02)
184
-
185
- ## [2.2.10](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.9...web-components-ui-2.2.10) (2025-11-10)
186
-
187
- ## [2.2.9](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.8...web-components-ui-2.2.9) (2025-11-09)
188
-
189
- ## [2.2.8](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.7...web-components-ui-2.2.8) (2025-11-06)
190
-
191
- ## [2.2.7](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.6...web-components-ui-2.2.7) (2025-11-05)
192
-
193
- ## [2.2.6](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.5...web-components-ui-2.2.6) (2025-11-05)
194
-
195
- ## [2.2.5](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.4...web-components-ui-2.2.5) (2025-10-30)
196
-
197
- ## [2.2.4](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.3...web-components-ui-2.2.4) (2025-10-30)
198
-
199
- ## [2.2.3](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.2...web-components-ui-2.2.3) (2025-10-29)
200
-
201
- ## [2.2.2](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.1...web-components-ui-2.2.2) (2025-10-28)
202
-
203
- ## [2.2.1](https://github.com/descope/web-components-ui/compare/web-components-ui-2.2.0...web-components-ui-2.2.1) (2025-10-27)
204
-
205
- ## [2.2.0](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.18...web-components-ui-2.2.0) (2025-10-26)
206
-
207
- ## [2.1.18](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.17...web-components-ui-2.1.18) (2025-10-26)
208
-
209
- ## [2.1.17](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.16...web-components-ui-2.1.17) (2025-10-20)
210
-
211
- ## [2.1.16](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.15...web-components-ui-2.1.16) (2025-10-19)
212
-
213
- ## [2.1.15](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.14...web-components-ui-2.1.15) (2025-10-16)
214
-
215
- ## [2.1.14](https://github.com/descope/web-components-ui/compare/web-components-ui-2.1.13...web-components-ui-2.1.14) (2025-10-12)
216
-
217
- ## [1.139.1](https://github.com/descope/web-components-ui/compare/web-components-ui-1.139.0...web-components-ui-1.139.1) (2025-10-08)
218
-
219
- ## [0.0.23](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.22...@descope-ui/descope-timer-button-0.0.23) (2025-09-30)
220
-
221
- ### Dependency Updates
222
-
223
- - `@descope-ui/common` updated to version `0.1.2`
224
- - `@descope-ui/theme-globals` updated to version `0.0.22`
225
- - `@descope-ui/descope-timer` updated to version `0.0.20`
226
- - `@descope-ui/descope-button` updated to version `0.0.22`
227
-
228
- ## [0.0.22](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.21...@descope-ui/descope-timer-button-0.0.22) (2025-09-29)
229
-
230
- ### Dependency Updates
231
-
232
- - `@descope-ui/common` updated to version `0.1.1`
233
- - `@descope-ui/theme-globals` updated to version `0.0.21`
234
- - `@descope-ui/descope-timer` updated to version `0.0.19`
235
- - `@descope-ui/descope-button` updated to version `0.0.21`
236
-
237
- ## [0.0.21](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.20...@descope-ui/descope-timer-button-0.0.21) (2025-09-02)
238
-
239
- ### Dependency Updates
240
-
241
- - `e2e-utils` updated to version `0.1.0`
242
- - `@descope-ui/common` updated to version `0.1.0`
243
- - `@descope-ui/theme-globals` updated to version `0.0.20`
244
- - `@descope-ui/descope-timer` updated to version `0.0.18`
245
- - `@descope-ui/descope-button` updated to version `0.0.20`
246
-
247
- ## [0.0.20](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.19...@descope-ui/descope-timer-button-0.0.20) (2025-07-21)
248
-
249
- ### Dependency Updates
250
-
251
- - `@descope-ui/descope-button` updated to version `0.0.19`
252
-
253
- ## [0.0.19](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.18...@descope-ui/descope-timer-button-0.0.19) (2025-07-21)
254
-
255
- ### Dependency Updates
256
-
257
- - `@descope-ui/common` updated to version `0.0.18`
258
- - `@descope-ui/theme-globals` updated to version `0.0.19`
259
- - `@descope-ui/descope-timer` updated to version `0.0.17`
260
- - `@descope-ui/descope-button` updated to version `0.0.18`
261
-
262
- ## [0.0.18](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.17...@descope-ui/descope-timer-button-0.0.18) (2025-07-16)
263
-
264
- ### Dependency Updates
265
-
266
- - `@descope-ui/descope-timer` updated to version `0.0.16`
267
- - `@descope-ui/descope-button` updated to version `0.0.17`
268
-
269
- ## [0.0.17](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.16...@descope-ui/descope-timer-button-0.0.17) (2025-07-15)
270
-
271
- ### Dependency Updates
272
-
273
- - `@descope-ui/common` updated to version `0.0.17`
274
- - `@descope-ui/theme-globals` updated to version `0.0.18`
275
- - `@descope-ui/descope-timer` updated to version `0.0.15`
276
- - `@descope-ui/descope-button` updated to version `0.0.16`
277
-
278
- ## [0.0.16](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.15...@descope-ui/descope-timer-button-0.0.16) (2025-07-03)
279
-
280
- ### Dependency Updates
281
-
282
- - `test-drivers` updated to version `0.0.1`
283
- - `@descope-ui/descope-timer` updated to version `0.0.14`
284
-
285
- ## [0.0.15](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.14...@descope-ui/descope-timer-button-0.0.15) (2025-06-30)
286
-
287
- ### Dependency Updates
288
-
289
- - `@descope-ui/theme-globals` updated to version `0.0.17`
290
- - `@descope-ui/descope-timer` updated to version `0.0.13`
291
- - `@descope-ui/descope-button` updated to version `0.0.15`
292
-
293
- ## [0.0.14](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.13...@descope-ui/descope-timer-button-0.0.14) (2025-06-30)
294
-
295
- ### Dependency Updates
296
-
297
- - `@descope-ui/common` updated to version `0.0.16`
298
- - `@descope-ui/theme-globals` updated to version `0.0.16`
299
- - `@descope-ui/descope-timer` updated to version `0.0.12`
300
- - `@descope-ui/descope-button` updated to version `0.0.14`
301
-
302
- ## [0.0.13](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.12...@descope-ui/descope-timer-button-0.0.13) (2025-06-29)
303
-
304
- ### Dependency Updates
305
-
306
- - `@descope-ui/common` updated to version `0.0.15`
307
- - `@descope-ui/theme-globals` updated to version `0.0.15`
308
- - `@descope-ui/descope-timer` updated to version `0.0.11`
309
- - `@descope-ui/descope-button` updated to version `0.0.13`
310
-
311
- ## [0.0.12](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.11...@descope-ui/descope-timer-button-0.0.12) (2025-06-26)
312
-
313
- ### Dependency Updates
314
-
315
- - `@descope-ui/common` updated to version `0.0.14`
316
- - `@descope-ui/theme-globals` updated to version `0.0.14`
317
- - `@descope-ui/descope-timer` updated to version `0.0.10`
318
- - `@descope-ui/descope-button` updated to version `0.0.12`
319
-
320
- ## [0.0.11](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.10...@descope-ui/descope-timer-button-0.0.11) (2025-06-19)
321
-
322
- ### Dependency Updates
323
-
324
- - `test-assets` updated to version `0.0.1`
325
- - `@descope-ui/descope-timer` updated to version `0.0.9`
326
- - `@descope-ui/descope-button` updated to version `0.0.11`
327
-
328
- ## [0.0.10](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.9...@descope-ui/descope-timer-button-0.0.10) (2025-06-09)
329
-
330
- ### Dependency Updates
331
-
332
- - `@descope-ui/common` updated to version `0.0.13`
333
- - `@descope-ui/theme-globals` updated to version `0.0.13`
334
- - `@descope-ui/descope-timer` updated to version `0.0.8`
335
- - `@descope-ui/descope-button` updated to version `0.0.10`
336
-
337
- ## [0.0.9](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.8...@descope-ui/descope-timer-button-0.0.9) (2025-06-03)
338
-
339
- ### Dependency Updates
340
-
341
- - `@descope-ui/descope-timer` updated to version `0.0.7`
342
- - `@descope-ui/descope-button` updated to version `0.0.9`
343
-
344
- ## [0.0.8](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.7...@descope-ui/descope-timer-button-0.0.8) (2025-05-28)
345
-
346
- ### Dependency Updates
347
-
348
- - `e2e-utils` updated to version `0.0.1`
349
- - `@descope-ui/common` updated to version `0.0.12`
350
- - `@descope-ui/theme-globals` updated to version `0.0.12`
351
- - `@descope-ui/descope-timer` updated to version `0.0.6`
352
- - `@descope-ui/descope-button` updated to version `0.0.8`
353
-
354
- ## [0.0.7](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.6...@descope-ui/descope-timer-button-0.0.7) (2025-04-29)
355
-
356
- ### Dependency Updates
357
-
358
- - `@descope-ui/common` updated to version `0.0.11`
359
- - `@descope-ui/theme-globals` updated to version `0.0.11`
360
- - `@descope-ui/descope-timer` updated to version `0.0.5`
361
- - `@descope-ui/descope-button` updated to version `0.0.7`
362
-
363
- ## [0.0.6](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.5...@descope-ui/descope-timer-button-0.0.6) (2025-04-21)
364
-
365
- ### Dependency Updates
366
-
367
- - `@descope-ui/descope-button` updated to version `0.0.6`
368
-
369
- ## [0.0.5](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.4...@descope-ui/descope-timer-button-0.0.5) (2025-04-16)
370
-
371
- ### Dependency Updates
372
-
373
- - `@descope-ui/common` updated to version `0.0.10`
374
- - `@descope-ui/theme-globals` updated to version `0.0.10`
375
- - `@descope-ui/descope-timer` updated to version `0.0.4`
376
- - `@descope-ui/descope-button` updated to version `0.0.5`
377
-
378
- ## [0.0.4](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.3...@descope-ui/descope-timer-button-0.0.4) (2025-04-01)
379
-
380
- ## [0.0.3](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.2...@descope-ui/descope-timer-button-0.0.3) (2025-03-20)
381
-
382
- ### Dependency Updates
383
-
384
- - `test-drivers` updated to version `0.0.1`
385
- - `@descope-ui/descope-timer` updated to version `0.0.3`
386
-
387
- ## [0.0.2](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-timer-button-0.0.1...@descope-ui/descope-timer-button-0.0.2) (2025-03-13)
388
-
389
- ### Dependency Updates
390
-
391
- - `@descope-ui/descope-timer` updated to version `0.0.2`
392
-
393
- ## 0.0.1 (2025-03-11)
394
-
395
- ### Dependency Updates
396
-
397
- - `e2e-utils` updated to version `0.0.1`
398
- - `test-drivers` updated to version `0.0.1`
399
- - `test-assets` updated to version `0.0.1`
400
- - `@descope-ui/common` updated to version `0.0.9`
401
- - `@descope-ui/theme-globals` updated to version `0.0.9`
402
- - `@descope-ui/descope-timer` updated to version `0.0.1`
403
- - `@descope-ui/descope-button` updated to version `0.0.4`
404
-
405
- # Changelog
@@ -1,150 +0,0 @@
1
- import { test, expect } from '@playwright/test';
2
- import { getStoryUrl, loopConfig, loopPresets } from 'e2e-utils';
3
- import { createTimerButtonTestDriver } from 'test-drivers';
4
-
5
- const componentAttributes = {
6
- size: ['xs', 'sm', 'md', 'lg'],
7
- horizontal: ['true', 'false'],
8
- 'timer-hide-icon': ['true', 'false'],
9
- 'full-width': ['true', 'false'],
10
- 'button-variant': ['contained', 'outline', 'link'],
11
- 'button-mode': ['primary', 'secondary'],
12
- icon: ['true', 'false'],
13
- 'st-gap': ['0', '10', '20'],
14
- };
15
-
16
- const storyName = 'descope-timer-button';
17
- const componentName = 'descope-timer-button';
18
-
19
- const presets = {
20
- 'full width horizontal': { 'full-width': 'true', horizontal: 'true' },
21
- 'full width vertical': { 'full-width': 'true' },
22
- 'horizontal with gap': { horizontal: 'true', 'st-gap': '35' },
23
- };
24
-
25
- test.describe('theme', () => {
26
- loopConfig(componentAttributes, (attr, value) => {
27
- test(`${attr}: ${value}`, async ({ page }) => {
28
- await page.goto(getStoryUrl(storyName, { [attr]: value }), {
29
- waitUntil: 'load',
30
- });
31
- const component = createTimerButtonTestDriver(
32
- page.locator(componentName),
33
- );
34
- await component.timer.pause();
35
- expect(await component.screenshot()).toMatchSnapshot();
36
- });
37
- });
38
-
39
- ['left', 'center', 'right'].forEach((alignment) => {
40
- test(`text-align: ${alignment}`, async ({ page }) => {
41
- await page.goto(
42
- getStoryUrl(storyName, {
43
- 'text-align': alignment,
44
- 'full-width': 'true',
45
- }),
46
- { waitUntil: 'load' },
47
- );
48
- const component = createTimerButtonTestDriver(
49
- page.locator(componentName),
50
- );
51
- await component.timer.pause();
52
- expect(await component.screenshot()).toMatchSnapshot();
53
- });
54
- });
55
- });
56
-
57
- test.describe('logic', () => {
58
- test(`button restarts timer`, async ({ page }) => {
59
- await page.goto(
60
- getStoryUrl(storyName, {
61
- 'timer-seconds': '2',
62
- }),
63
- {
64
- waitUntil: 'load',
65
- },
66
- );
67
- const component = createTimerButtonTestDriver(page.locator(componentName));
68
-
69
- await component.timer.stop();
70
- expect(await component.screenshot({ delay: 3000 })).toMatchSnapshot();
71
-
72
- await component.button.click();
73
- await component.timer.pause();
74
-
75
- expect(await component.screenshot({ delay: 3000 })).toMatchSnapshot();
76
- });
77
-
78
- test(`disable button if timer is running`, async ({ page }) => {
79
- await page.goto(
80
- getStoryUrl(storyName, {
81
- 'timer-seconds': '3',
82
- }),
83
- {
84
- waitUntil: 'load',
85
- },
86
- );
87
- const component = createTimerButtonTestDriver(page.locator(componentName));
88
-
89
- await component.timer.pause();
90
- expect(await component.screenshot()).toMatchSnapshot();
91
-
92
- await component.timer.resume();
93
- await page.waitForTimeout(1000);
94
-
95
- await component.timer.pause();
96
- expect(await component.screenshot()).toMatchSnapshot();
97
- });
98
-
99
- test(`enable button if timer finished`, async ({ page }) => {
100
- await page.goto(getStoryUrl(storyName, { 'timer-seconds': '2' }), {
101
- waitUntil: 'load',
102
- });
103
-
104
- const component = createTimerButtonTestDriver(page.locator(componentName));
105
-
106
- await component.timer.stop();
107
- await component.timer.reset();
108
- await component.timer.pause();
109
- expect(await component.screenshot()).toMatchSnapshot();
110
-
111
- await component.timer.resume();
112
- await page.waitForTimeout(4000);
113
- expect(await component.screenshot()).toMatchSnapshot();
114
- });
115
-
116
- ['', '-1', '0', '1', '10', '100', '10000', '100000', '100000000'].forEach(
117
- (seconds) => {
118
- test(`format time: ${seconds || 'empty'} seconds`, async ({ page }) => {
119
- await page.goto(getStoryUrl(storyName, { seconds }), {
120
- waitUntil: 'load',
121
- });
122
- const component = createTimerButtonTestDriver(
123
- page.locator(componentName),
124
- );
125
- await component.timer.pause();
126
- expect(await component.screenshot()).toMatchSnapshot();
127
- });
128
- },
129
- );
130
- });
131
-
132
- test.describe('presets', () => {
133
- ['ltr', 'rtl'].forEach((direction) => {
134
- loopPresets(presets, (preset, name) => {
135
- test(`${name} - ${direction}`, async ({ page }) => {
136
- await page.goto(getStoryUrl(storyName, { ...preset, direction }));
137
-
138
- const component = createTimerButtonTestDriver(
139
- page.locator(componentName),
140
- );
141
-
142
- await component.timer.pause();
143
-
144
- expect(
145
- await component.screenshot({ animations: 'disabled' }),
146
- ).toMatchSnapshot();
147
- });
148
- });
149
- });
150
- });
package/project.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@descope-ui/descope-timer-button",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/web-components/components/descope-timer-button/src",
5
- "projectType": "library",
6
- "targets": {},
7
- "tags": []
8
- }