@pega/cosmos-react-work 9.34.0 → 9.36.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 +1 @@
1
- {"version":3,"file":"Stages.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Stages/Stages.styles.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAiJnD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,6NAmF9B,CAAC;AAIH;;;;GAIG;AACH,eAAO,MAAM,YAAY;aAAwB,YAAY;YAoD3D,CAAC;AAIH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,6NA6B1B,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,gBAAgB;eAA4B,OAAO;YAe9D,CAAC;AAsDH;;;GAGG;AACH,eAAO,MAAM,WAAW;YACd,WAAW,GAAG,SAAS,GAAG,SAAS;eAChC,OAAO;aACT,YAAY;YA6EtB,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,uBAAuB,kaAiBlC,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,eAAe;;;gBAA8B,OAAO;kLAIhE,CAAC;AAwZF;;;GAGG;AACH,eAAO,MAAM,oBAAoB;eACpB,OAAO;aACT,YAAY;YAyDtB,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,oBAAoB,mOAS/B,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,UAAU;eAA0B,OAAO;YAoBtD,CAAC;AAIH;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;oMAMhC,CAAC;AAIH;;GAEG;AACH,eAAO,MAAM,kBAAkB,6NAI7B,CAAC;AAaH,eAAO,MAAM,oBAAoB,+NAS/B,CAAC;AAIH;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;YAChC,WAAW,GAAG,SAAS,GAAG,SAAS;qBAC1B,OAAO;eACb,OAAO;YA4ElB,CAAC;AAIH,eAAO,M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B,CAAC;AAaH,eAAO,MAAM,oBAAoB,+NAS/B,CAAC;AAIH;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;YAChC,WAAW,GAAG,SAAS,GAAG,SAAS;qBAC1B,OAAO;eACb,OAAO;YA4ElB,CAAC;AAIH,eAAO,MAAM,qBAAqB;YACxB,WAAW,GAAG,SAAS,GAAG,SAAS;eAChC,OAAO;YAoHlB,CAAC;AAIH;;;GAGG;AACH,eAAO,MAAM,uBAAuB,yOAEnC,CAAC"}
@@ -47,33 +47,20 @@ const segmentedClipPath = (leftCut, rightCut, mirrored = false) => {
47
47
  // === Chevron Configuration ===
48
48
  // Centralizes spacing and border thickness via CSS custom properties set at StyledStages
49
49
  const chevronConfig = {
50
- // Horizontal projection of the rotated border-square forming the chevron point (fine pointer).
51
- // Derived from the border-square size × cos(45° + skew). Tuned to visually align with the stage height.
52
- // All values scaled by 1.25× relative to the original 4× spacing design (now 5× spacing height).
53
- width: 'calc(1.445 * var(--chevron-spacing))',
54
- // Same horizontal projection for coarse/touch pointer (larger square, proportionally wider point).
55
- coarseWidth: 'calc(1.797 * var(--chevron-spacing))',
56
- // Side length of the rotated border-square forming the chevron (fine pointer: 3.75× base spacing).
57
- squareSize: 'calc(3.75 * var(--chevron-spacing))',
58
- // Side length of the rotated border-square for coarse/touch pointer (5× base spacing).
59
- coarseSquareSize: 'calc(5 * var(--chevron-spacing))',
60
- // Distance to inset the ::before notch from the left edge of the stage (fine pointer).
61
- // 0.86 ≈ width − half-border-overlap, keeps the notch flush with the preceding chevron point.
62
- offsetLeft: 'calc(0.86 * var(--chevron-spacing))',
63
- // Distance to inset the ::after point from the right edge of the stage (fine pointer).
64
- // Equal to `width` so the point extends exactly one chevron-width beyond the stage boundary.
65
- offsetRight: 'calc(1.445 * var(--chevron-spacing))',
66
- // Coarse-pointer equivalents of offsetLeft/offsetRight, scaled to match coarseWidth/coarseSquareSize.
67
- // coarseOffsetLeft must satisfy: coarseSquareSize = 2 × coarseWidth + coarseOffsetLeft
68
- // (5 = 2 × 1.797 + 1.406) so that ::before and ::after co-locate on coarse devices.
69
- coarseOffsetLeft: 'calc(1.406 * var(--chevron-spacing))',
70
- coarseOffsetRight: 'calc(1.797 * var(--chevron-spacing))',
71
- // Pre-computed flat positions for ::before notch and ::after point.
72
- notchInsetStart: 'calc(-2.305 * var(--chevron-spacing))',
73
- // 3.203 = exact alignment (coarseSquareSize - coarseWidth); slightly overdone default clears sub-pixel rounding on 3× displays.
74
- coarseNotchInsetStart: 'calc(-1 * var(--stages-coarse-notch-correction) * var(--chevron-spacing))',
50
+ blockSize: 'calc(4 * var(--chevron-spacing))',
51
+ width: 'var(--stages-chevron-width)',
52
+ squareSize: 'var(--stages-chevron-square-size)',
53
+ notchInsetStart: 'var(--stages-chevron-notch-inset-start)',
75
54
  pointInsetEnd: '0'
76
55
  };
56
+ const chevronGeometryScale = {
57
+ fine: {
58
+ width: '0.289',
59
+ square: '0.75',
60
+ notchInsetStart: '-0.461'
61
+ }
62
+ };
63
+ const scaleByChevronBlockSize = (scale) => `calc(${scale} * var(--stages-chevron-block-size))`;
77
64
  // === Chevron Helpers ===
78
65
  // After team discussion we decided to use logical properties throughout — `inset-block-start`
79
66
  // instead of `top`, and `border-block-start/end-width` instead of `border-top/bottom-width` —
@@ -126,16 +113,25 @@ const createChevronInteractiveStates = (config, borderThicknessVar, includeHover
126
113
  border-block-start-width: calc(2 * ${borderThicknessVar});
127
114
  }
128
115
  `;
129
- /**
130
- * Outer wrapper `<div>` for the stages bar. Applies layered scroll-fade masks and
131
- * reserves scrollbar space so the fade gradient does not overlap the scrollbar track.
132
- */
116
+ /** Outer card-colored positioning context for the masked stages viewport and scrollbar. */
117
+ export const StyledStagesRoot = styled.div(({ theme }) => css `
118
+ position: relative;
119
+ display: grid;
120
+ grid-template-columns: minmax(0, 1fr);
121
+ grid-template-rows: auto auto;
122
+ width: 100%;
123
+ overflow: visible;
124
+ border-start-start-radius: ${theme.components.card['border-radius']};
125
+ border-start-end-radius: ${theme.components.card['border-radius']};
126
+ background: ${theme.components.card.background};
127
+ `);
128
+ StyledStagesRoot.defaultProps = defaultThemeProp;
129
+ /** Applies the scroll-fade mask and clips the stages viewport. */
133
130
  export const StyledStagesWrapper = styled.div(({ theme }) => {
134
131
  return css `
135
132
  --stages-fade-width: calc(${theme.base.spacing} * 2);
136
133
  --stages-fade-start: 0;
137
134
  --stages-fade-end: 0;
138
- --stages-scrollbar-reserve: calc(${theme.base.spacing} * 0.25);
139
135
 
140
136
  /* Places gradient stops one physical pixel outside the element boundary,
141
137
  * preventing browser anti-aliasing from creating a semi-transparent seam
@@ -158,31 +154,41 @@ export const StyledStagesWrapper = styled.div(({ theme }) => {
158
154
  --stages-wrapper-bottom-radius,
159
155
  ${theme.components.card['border-radius']}
160
156
  );
161
- mask-image: linear-gradient(black, black),
162
- linear-gradient(
157
+
158
+ /* Review trace 1 — the viewport fade follows stage visibility independently of the scrollbar row. */
159
+ -webkit-mask-image: linear-gradient(
160
+ to right,
161
+ transparent calc(-1 * var(--mask-edge-overhang)),
162
+ black var(--stages-fade-start),
163
+ black calc(100% - var(--stages-fade-end)),
164
+ transparent calc(100% + var(--mask-edge-overhang))
165
+ );
166
+ mask-image: linear-gradient(
167
+ to right,
168
+ transparent calc(-1 * var(--mask-edge-overhang)),
169
+ black var(--stages-fade-start),
170
+ black calc(100% - var(--stages-fade-end)),
171
+ transparent calc(100% + var(--mask-edge-overhang))
172
+ );
173
+ mask-size: 100% 100%;
174
+ mask-position: 0 0;
175
+ mask-repeat: no-repeat;
176
+
177
+ [dir='rtl'] & {
178
+ -webkit-mask-image: linear-gradient(
163
179
  to right,
164
180
  transparent calc(-1 * var(--mask-edge-overhang)),
165
- black var(--stages-fade-start),
166
- black calc(100% - var(--stages-fade-end)),
181
+ black var(--stages-fade-end),
182
+ black calc(100% - var(--stages-fade-start)),
183
+ transparent calc(100% + var(--mask-edge-overhang))
184
+ );
185
+ mask-image: linear-gradient(
186
+ to right,
187
+ transparent calc(-1 * var(--mask-edge-overhang)),
188
+ black var(--stages-fade-end),
189
+ black calc(100% - var(--stages-fade-start)),
167
190
  transparent calc(100% + var(--mask-edge-overhang))
168
191
  );
169
- mask-size:
170
- 100% var(--stages-scrollbar-reserve),
171
- 100% calc(100% - var(--stages-scrollbar-reserve));
172
- mask-position:
173
- 0 100%,
174
- 0 0;
175
- mask-repeat: no-repeat, no-repeat;
176
-
177
- [dir='rtl'] & {
178
- mask-image: linear-gradient(black, black),
179
- linear-gradient(
180
- to right,
181
- transparent calc(-1 * var(--mask-edge-overhang)),
182
- black var(--stages-fade-end),
183
- black calc(100% - var(--stages-fade-start)),
184
- transparent calc(100% + var(--mask-edge-overhang))
185
- );
186
192
  }
187
193
 
188
194
  &:has(:focus-visible) {
@@ -191,26 +197,6 @@ export const StyledStagesWrapper = styled.div(({ theme }) => {
191
197
 
192
198
  @media (pointer: coarse) {
193
199
  --stages-fade-width: calc(${theme.base.spacing} * 3);
194
- mask-image: linear-gradient(
195
- to right,
196
- transparent calc(-1 * var(--mask-edge-overhang)),
197
- black var(--stages-fade-start),
198
- black calc(100% - var(--stages-fade-end)),
199
- transparent calc(100% + var(--mask-edge-overhang))
200
- );
201
- mask-size: 100% 100%;
202
- mask-position: 0 0;
203
- mask-repeat: no-repeat;
204
-
205
- [dir='rtl'] & {
206
- mask-image: linear-gradient(
207
- to right,
208
- transparent calc(-1 * var(--mask-edge-overhang)),
209
- black var(--stages-fade-end),
210
- black calc(100% - var(--stages-fade-start)),
211
- transparent calc(100% + var(--mask-edge-overhang))
212
- );
213
- }
214
200
  }
215
201
  `;
216
202
  });
@@ -224,6 +210,10 @@ export const StyledStages = styled.ol(({ theme, variant }) => {
224
210
  const isMilestone = variant === 'milestone';
225
211
  return css `
226
212
  --chevron-spacing: ${theme.base.spacing};
213
+ --stages-chevron-block-size: ${chevronConfig.blockSize};
214
+ --stages-chevron-width: ${scaleByChevronBlockSize(chevronGeometryScale.fine.width)};
215
+ --stages-chevron-square-size: ${scaleByChevronBlockSize(chevronGeometryScale.fine.square)};
216
+ --stages-chevron-notch-inset-start: ${scaleByChevronBlockSize(chevronGeometryScale.fine.notchInsetStart)};
227
217
  --chevron-border-thickness: ${theme.components.button['border-width']};
228
218
  --segmented-border-thickness: calc(2 * ${theme.components.button['border-width']});
229
219
  --segmented-width: ${segmentedConfig.width};
@@ -234,8 +224,7 @@ export const StyledStages = styled.ol(({ theme, variant }) => {
234
224
  overflow-x: auto;
235
225
  overflow-y: hidden;
236
226
  list-style: none;
237
- scrollbar-width: thin;
238
- scrollbar-color: transparent transparent;
227
+ scrollbar-width: none;
239
228
 
240
229
  ${isMilestone &&
241
230
  css `
@@ -248,31 +237,55 @@ export const StyledStages = styled.ol(({ theme, variant }) => {
248
237
  padding-inline: calc(var(--milestone-size) * 0.25);
249
238
  `}
250
239
 
251
- &:hover,
252
- &:focus-within {
253
- scrollbar-color: var(
254
- --stages-scrollbar-thumb,
255
- ${transparentize(0.4, theme.base.palette['border-line'])}
256
- )
257
- var(--stages-scrollbar-track, transparent);
258
- }
259
-
260
240
  &::-webkit-scrollbar {
261
- height: 0.25rem;
241
+ display: none;
262
242
  }
263
243
 
264
244
  @media (pointer: coarse) {
265
- /* 3.203 = exact alignment; slightly overdone default to clear sub-pixel rounding on 3× displays */
266
- --stages-coarse-notch-correction: 3.35;
267
- scrollbar-width: none;
268
-
269
- &::-webkit-scrollbar {
270
- display: none;
271
- }
245
+ --stages-chevron-block-size: ${theme.base['hit-area']['finger-min']};
246
+ --stages-chevron-width: ${scaleByChevronBlockSize(chevronGeometryScale.fine.width)};
247
+ --stages-chevron-square-size: ${scaleByChevronBlockSize(chevronGeometryScale.fine.square)};
248
+ --stages-chevron-notch-inset-start: ${scaleByChevronBlockSize(chevronGeometryScale.fine.notchInsetStart)};
272
249
  }
273
250
  `;
274
251
  });
275
252
  StyledStages.defaultProps = defaultThemeProp;
253
+ export const StyledStagesScrollbar = styled.div(({ theme, $hasOverflow }) => css `
254
+ position: relative;
255
+ height: ${theme.base.spacing};
256
+ cursor: grab;
257
+ touch-action: none;
258
+ opacity: 0;
259
+ visibility: hidden;
260
+ pointer-events: none;
261
+
262
+ ${$hasOverflow &&
263
+ css `
264
+ ${StyledStagesRoot}:hover & {
265
+ opacity: 1;
266
+ visibility: visible;
267
+ pointer-events: auto;
268
+ }
269
+ `}
270
+
271
+ &:active {
272
+ cursor: grabbing;
273
+ }
274
+
275
+ @media (pointer: coarse) {
276
+ display: none;
277
+ }
278
+ `);
279
+ StyledStagesScrollbar.defaultProps = defaultThemeProp;
280
+ export const StyledStagesScrollbarThumb = styled.div(({ theme, $size, $offset }) => css `
281
+ position: absolute;
282
+ inset-block: 0;
283
+ inset-inline-start: ${$offset * 100}%;
284
+ width: ${$size * 100}%;
285
+ border-radius: ${theme.components.card['border-radius']};
286
+ background: ${transparentize(0.4, theme.base.palette['border-line'])};
287
+ `);
288
+ StyledStagesScrollbarThumb.defaultProps = defaultThemeProp;
276
289
  /**
277
290
  * A sentinel is an invisible 1 px <li> placed at each end of the scrollable stage list.
278
291
  * It is observed by an IntersectionObserver; when it scrolls out of view, the component sets
@@ -360,8 +373,6 @@ const stageButtonChevronStyles = (theme) => css `
360
373
 
361
374
  @media (pointer: coarse) {
362
375
  padding-inline-start: calc(2.25 * var(--chevron-spacing));
363
- width: calc(100% + ${chevronConfig.coarseWidth});
364
- --stage-chevron-width: ${chevronConfig.coarseWidth};
365
376
  }
366
377
  `;
367
378
  const stageButtonSegmentedStyles = (theme) => css `
@@ -388,7 +399,7 @@ const stageButtonVariants = {
388
399
  * Clickable `<button>` for a single stage. Renders the chevron clip-path shape and
389
400
  * applies status-based background and foreground colours.
390
401
  */
391
- export const StyledStage = styled.button(({ theme, theme: { base: { palette, 'hit-area': hitArea, transparency, 'font-weight': fontWeight }, components: { 'case-view': { stages } } }, status, readOnly, variant: shape }) => {
402
+ export const StyledStage = styled.button(({ theme, theme: { base: { palette, transparency, 'font-weight': fontWeight }, components: { 'case-view': { stages } } }, status, readOnly, variant: shape }) => {
392
403
  const stageForeground = calculateForegroundColor(stages.status[status].background, stages.status[status]['foreground-color']);
393
404
  return css `
394
405
  background: ${stages.status[status].background};
@@ -398,11 +409,7 @@ export const StyledStage = styled.button(({ theme, theme: { base: { palette, 'hi
398
409
  border-width: calc(2 * var(--chevron-border-thickness)) 0;
399
410
  border-style: solid;
400
411
  position: relative;
401
-
402
- /* Browsers do not reliably apply flex align-items: stretch to <button> elements.
403
- * Adding 0.0625rem (1px at default font size) to min-height compensates so the button fills its <li> container,
404
- * keeping the clipped chevron background flush with the top and bottom borders. */
405
- min-height: calc(5 * var(--chevron-spacing) + 0.0625rem);
412
+ height: var(--stages-chevron-block-size);
406
413
  margin-inline-start: 0;
407
414
  margin-inline-end: 0;
408
415
 
@@ -444,7 +451,7 @@ export const StyledStage = styled.button(({ theme, theme: { base: { palette, 'hi
444
451
  }
445
452
 
446
453
  @media (pointer: coarse) {
447
- min-height: ${hitArea['finger-min']};
454
+ min-height: var(--stages-chevron-block-size);
448
455
  }
449
456
  `;
450
457
  });
@@ -559,7 +566,6 @@ const stageContainerChevronStyles = (theme, readOnly) => {
559
566
  }
560
567
 
561
568
  @media (pointer: coarse) {
562
- --stage-chevron-width: ${chevronConfig.coarseWidth};
563
569
  width: calc(100% + (2 * var(--stage-chevron-width)));
564
570
  }
565
571
  }
@@ -595,10 +601,6 @@ const stageContainerChevronStyles = (theme, readOnly) => {
595
601
  ${theme.base.palette.interactive};
596
602
  }
597
603
  }
598
-
599
- @media (pointer: coarse) {
600
- --stage-chevron-width: ${chevronConfig.coarseWidth};
601
- }
602
604
  }
603
605
 
604
606
  /* RTL: flip clip-paths for first and last stages */
@@ -632,31 +634,14 @@ const stageContainerChevronStyles = (theme, readOnly) => {
632
634
  inset calc(2 * var(--chevron-border-thickness)) 0 0 ${theme.base.palette.interactive},
633
635
  inset calc(-2 * var(--chevron-border-thickness)) 0 0 ${theme.base.palette.interactive};
634
636
  }
635
-
636
- @media (pointer: coarse) {
637
- --stage-chevron-width: ${chevronConfig.coarseWidth};
638
- }
639
637
  }
640
638
 
641
639
  @media (pointer: coarse) {
642
- margin-inline-start: calc(-1 * ${chevronConfig.coarseWidth});
643
-
644
640
  &:not(:nth-of-type(-n + 2))::before,
645
641
  &:not(:nth-last-of-type(-n + 2))::after {
646
- inset-block-start: calc(50% - ${chevronConfig.coarseSquareSize} / 2);
647
- width: ${chevronConfig.coarseSquareSize};
648
- height: ${chevronConfig.coarseSquareSize};
649
642
  border-inline-end-width: calc(2 * var(--chevron-border-thickness));
650
643
  border-block-start-width: calc(2 * var(--chevron-border-thickness));
651
644
  }
652
-
653
- &:not(:nth-of-type(-n + 2))::before {
654
- inset-inline-start: ${chevronConfig.coarseNotchInsetStart};
655
- }
656
-
657
- &:not(:nth-last-of-type(-n + 2))::after {
658
- inset-inline-end: 0;
659
- }
660
645
  }
661
646
  `;
662
647
  };