baseui 14.0.0 → 15.0.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 (150) hide show
  1. package/accordion/accordion.js +4 -4
  2. package/accordion/panel.d.ts +1 -1
  3. package/accordion/styled-components.js +1 -1
  4. package/accordion/types.d.ts +1 -1
  5. package/app-nav-bar/mobile-menu.js +3 -1
  6. package/banner/banner.js +3 -1
  7. package/banner/types.d.ts +2 -1
  8. package/bottom-navigation/bottom-navigation.js +3 -1
  9. package/bottom-navigation/selector.js +1 -1
  10. package/bottom-navigation/styled-components.js +1 -1
  11. package/button/button.d.ts +1 -3
  12. package/button/button.js +6 -2
  13. package/button/styled-components.d.ts +1 -0
  14. package/button/styled-components.js +61 -4
  15. package/button/types.d.ts +15 -3
  16. package/button-timed/button-timed.js +4 -5
  17. package/button-timed/styled-components.js +5 -3
  18. package/button-timed/types.d.ts +1 -1
  19. package/data-table/column-categorical.js +2 -2
  20. package/data-table/locale.d.ts +2 -0
  21. package/data-table/locale.js +2 -1
  22. package/data-table/stateful-container.js +1 -1
  23. package/data-table/stateful-data-table.js +7 -3
  24. package/data-table/types.d.ts +2 -0
  25. package/datepicker/day.js +2 -4
  26. package/datepicker/utils/date-helpers.d.ts +1 -0
  27. package/datepicker/utils/date-helpers.js +3 -0
  28. package/dialog/dialog.d.ts +1 -1
  29. package/dialog/dialog.js +38 -56
  30. package/dialog/styled-components.d.ts +2 -2
  31. package/dialog/styled-components.js +56 -24
  32. package/dialog/types.d.ts +5 -2
  33. package/file-uploader/constants.d.ts +16 -0
  34. package/file-uploader/constants.js +30 -0
  35. package/file-uploader/file-uploader.d.ts +2 -2
  36. package/file-uploader/file-uploader.js +387 -117
  37. package/file-uploader/index.d.ts +1 -1
  38. package/file-uploader/index.js +67 -18
  39. package/file-uploader/locale.d.ts +10 -10
  40. package/file-uploader/locale.js +5 -5
  41. package/file-uploader/styled-components.d.ts +13 -6
  42. package/file-uploader/styled-components.js +261 -64
  43. package/file-uploader/types.d.ts +47 -32
  44. package/file-uploader/utils.d.ts +5 -0
  45. package/file-uploader/utils.js +45 -0
  46. package/file-uploader-basic/file-uploader-basic.d.ts +10 -0
  47. package/file-uploader-basic/file-uploader-basic.js +175 -0
  48. package/file-uploader-basic/index.d.ts +4 -0
  49. package/file-uploader-basic/index.js +71 -0
  50. package/file-uploader-basic/locale.d.ts +15 -0
  51. package/file-uploader-basic/locale.js +21 -0
  52. package/file-uploader-basic/styled-components.d.ts +7 -0
  53. package/file-uploader-basic/styled-components.js +83 -0
  54. package/file-uploader-basic/types.d.ts +41 -0
  55. package/form-control/form-control.js +38 -3
  56. package/form-control/styled-components.d.ts +2 -0
  57. package/form-control/styled-components.js +22 -2
  58. package/form-control/types.d.ts +4 -0
  59. package/icon/circle-check-filled.d.ts +9 -0
  60. package/icon/circle-check-filled.js +50 -0
  61. package/icon/circle-exclamation-point-filled.d.ts +9 -0
  62. package/icon/circle-exclamation-point-filled.js +50 -0
  63. package/icon/hide.js +1 -1
  64. package/icon/icon-exports.d.ts +4 -0
  65. package/icon/icon-exports.js +28 -0
  66. package/icon/paperclip-filled.d.ts +9 -0
  67. package/icon/paperclip-filled.js +50 -0
  68. package/icon/show.js +1 -1
  69. package/icon/trash-can-filled.d.ts +9 -0
  70. package/{button-docked/button-docked.js → icon/trash-can-filled.js} +35 -16
  71. package/locale/en_US.js +14 -12
  72. package/locale/es_AR.js +9 -1
  73. package/locale/index.d.ts +3 -0
  74. package/locale/index.js +2 -0
  75. package/locale/tr_TR.js +9 -1
  76. package/locale/types.d.ts +2 -0
  77. package/message-card/message-card.js +2 -2
  78. package/message-card/utils.js +8 -3
  79. package/modal/modal-button.d.ts +1 -3
  80. package/package.json +5 -3
  81. package/payment-card/custom-cards.config.d.ts +1 -11
  82. package/payment-card/payment-card.js +1 -3
  83. package/phone-input/base-country-picker.js +2 -2
  84. package/phone-input/country-picker.js +0 -10
  85. package/progress-bar/progressbar-rounded.js +1 -1
  86. package/progress-bar/styled-components.js +8 -6
  87. package/rating/styled-components.js +3 -2
  88. package/rating/svg-icons.d.ts +5 -5
  89. package/rating/svg-icons.js +20 -20
  90. package/select/multi-value.js +1 -1
  91. package/snackbar/index.d.ts +1 -0
  92. package/snackbar/snackbar-context.d.ts +1 -2
  93. package/snackbar/snackbar-context.js +27 -21
  94. package/spinner/index.d.ts +4 -2
  95. package/stepper/stepper.js +28 -27
  96. package/styles/__mocks__/styled.js +0 -2
  97. package/styles/as-primary-export-hoc.js +0 -2
  98. package/styles/styled.js +0 -2
  99. package/styles/types.d.ts +7 -3
  100. package/tabs-motion/tabs.js +2 -2
  101. package/tag/constants.d.ts +5 -4
  102. package/tag/constants.js +7 -6
  103. package/tag/index.d.ts +1 -1
  104. package/tag/index.js +7 -7
  105. package/tag/styled-components.d.ts +1 -1
  106. package/tag/styled-components.js +137 -124
  107. package/tag/tag.js +2 -2
  108. package/tag/types.d.ts +9 -8
  109. package/tag/types.js +2 -2
  110. package/themes/dark-theme/color-component-tokens.d.ts +2 -2
  111. package/themes/dark-theme/color-component-tokens.js +279 -275
  112. package/themes/dark-theme/color-foundation-tokens.d.ts +3 -0
  113. package/themes/dark-theme/{color-tokens.js → color-foundation-tokens.js} +11 -14
  114. package/themes/dark-theme/color-semantic-tokens.d.ts +2 -2
  115. package/themes/dark-theme/color-semantic-tokens.js +52 -58
  116. package/themes/dark-theme/create-dark-theme.d.ts +1 -1
  117. package/themes/dark-theme/create-dark-theme.js +12 -32
  118. package/themes/dark-theme/dark-theme.js +4 -4
  119. package/themes/dark-theme/primitives.js +2 -2
  120. package/themes/light-theme/color-component-tokens.d.ts +2 -2
  121. package/themes/light-theme/color-component-tokens.js +287 -282
  122. package/themes/light-theme/color-foundation-tokens.d.ts +3 -0
  123. package/themes/light-theme/{color-tokens.js → color-foundation-tokens.js} +10 -13
  124. package/themes/light-theme/color-semantic-tokens.d.ts +2 -2
  125. package/themes/light-theme/color-semantic-tokens.js +50 -53
  126. package/themes/light-theme/create-light-theme.d.ts +1 -1
  127. package/themes/light-theme/create-light-theme.js +12 -32
  128. package/themes/light-theme/light-theme.js +4 -4
  129. package/themes/light-theme/primitives.js +2 -2
  130. package/themes/types.d.ts +74 -13
  131. package/themes/utils.d.ts +1 -1
  132. package/themes/utils.js +4 -4
  133. package/tile/tile-group.js +2 -2
  134. package/timezonepicker/update-tzdata.js +0 -1
  135. package/tokens/color-primitive-tokens.d.ts +5 -0
  136. package/tokens/color-primitive-tokens.js +301 -0
  137. package/tokens/index.d.ts +5 -4
  138. package/tokens/index.js +25 -3
  139. package/tokens/types.d.ts +170 -1
  140. package/button-docked/button-docked.d.ts +0 -4
  141. package/button-docked/index.d.ts +0 -3
  142. package/button-docked/index.js +0 -40
  143. package/button-docked/styled-components.d.ts +0 -5
  144. package/button-docked/styled-components.js +0 -55
  145. package/button-docked/types.d.ts +0 -14
  146. package/themes/dark-theme/color-tokens.d.ts +0 -3
  147. package/themes/light-theme/color-tokens.d.ts +0 -3
  148. package/tokens/colors.d.ts +0 -3
  149. package/tokens/colors.js +0 -125
  150. /package/{button-docked → file-uploader-basic}/types.js +0 -0
@@ -312,16 +312,12 @@ const StyledProgressBarRoundedTrackBackground = exports.StyledProgressBarRounded
312
312
  const _StyledProgressBarRoundedTrackForeground = (0, _styles.styled)('path', ({
313
313
  $theme,
314
314
  $size,
315
- $visible,
316
- $pathLength,
317
- $pathProgress
315
+ $visible
318
316
  }) => {
319
317
  return {
320
318
  visibility: $visible ? 'visible' : 'hidden',
321
319
  stroke: $theme.colors.borderAccent,
322
- strokeWidth: PROGRESS_BAR_ROUNDED_SIZES[$size].strokeWidth + 'px',
323
- strokeDasharray: $pathLength,
324
- strokeDashoffset: $pathLength * (1 - $pathProgress) + ''
320
+ strokeWidth: PROGRESS_BAR_ROUNDED_SIZES[$size].strokeWidth + 'px'
325
321
  };
326
322
  });
327
323
  _StyledProgressBarRoundedTrackForeground.displayName = "_StyledProgressBarRoundedTrackForeground";
@@ -329,6 +325,12 @@ _StyledProgressBarRoundedTrackForeground.displayName = '_StyledProgressBarRounde
329
325
  const StyledProgressBarRoundedTrackForeground = exports.StyledProgressBarRoundedTrackForeground = (0, _styles.withWrapper)(_StyledProgressBarRoundedTrackForeground, Styled => function StyledProgressBarRoundedSvg(props) {
330
326
  return /*#__PURE__*/_react.default.createElement(Styled, _extends({
331
327
  d: PROGRESS_BAR_ROUNDED_SIZES[props.$size].d
328
+ // We're using inline styles here to avoid the change on the class name on every update
329
+ ,
330
+ style: {
331
+ strokeDasharray: props.$pathLength,
332
+ strokeDashoffset: props.$pathLength * (1 - props.$pathProgress) + ''
333
+ }
332
334
  }, props));
333
335
  });
334
336
  const StyledProgressBarRoundedText = exports.StyledProgressBarRoundedText = (0, _styles.styled)('div', ({
@@ -106,11 +106,12 @@ const StyledEmoticon = exports.StyledEmoticon = (0, _styles.styled)('li', ({
106
106
  $isReadOnly,
107
107
  $size
108
108
  }) => {
109
- let emoticonFill = $theme.colors.ratingInactiveFill;
109
+ let emoticonFill = $theme.colors.backgroundSecondary;
110
110
  if ($isActive) {
111
111
  emoticonFill = $theme.colors.backgroundWarning;
112
112
  }
113
- const ratingIcons = [(0, _svgIcons.angryRatingSVG)(emoticonFill, $size), (0, _svgIcons.sadRatingSVG)(emoticonFill, $size), (0, _svgIcons.neutralRatingSVG)(emoticonFill, $size), (0, _svgIcons.happyRatingSVG)(emoticonFill, $size), (0, _svgIcons.veryHappyRatingSVG)(emoticonFill, $size)];
113
+ const faceColor = $theme.colors.contentPrimary;
114
+ const ratingIcons = [(0, _svgIcons.angryRatingSVG)(emoticonFill, faceColor, $size), (0, _svgIcons.sadRatingSVG)(emoticonFill, faceColor, $size), (0, _svgIcons.neutralRatingSVG)(emoticonFill, faceColor, $size), (0, _svgIcons.happyRatingSVG)(emoticonFill, faceColor, $size), (0, _svgIcons.veryHappyRatingSVG)(emoticonFill, faceColor, $size)];
114
115
  const styles = {
115
116
  paddingLeft: 0,
116
117
  paddingTop: 0,
@@ -1,6 +1,6 @@
1
1
  export declare function starSVG(fillColor: string, strokeColor: string, size: number): string;
2
- export declare function angryRatingSVG(fillColor: string, size: number): string;
3
- export declare function sadRatingSVG(fillColor: string, size: number): string;
4
- export declare function neutralRatingSVG(fillColor: string, size: number): string;
5
- export declare function happyRatingSVG(fillColor: string, size: number): string;
6
- export declare function veryHappyRatingSVG(fillColor: string, size: number): string;
2
+ export declare function angryRatingSVG(fillColor: string, faceColor: string, size: number): string;
3
+ export declare function sadRatingSVG(fillColor: string, faceColor: string, size: number): string;
4
+ export declare function neutralRatingSVG(fillColor: string, faceColor: string, size: number): string;
5
+ export declare function happyRatingSVG(fillColor: string, faceColor: string, size: number): string;
6
+ export declare function veryHappyRatingSVG(fillColor: string, faceColor: string, size: number): string;
@@ -26,53 +26,53 @@ function starSVG(fillColor, strokeColor, size) {
26
26
  </svg>
27
27
  `);
28
28
  }
29
- function angryRatingSVG(fillColor, size) {
29
+ function angryRatingSVG(fillColor, faceColor, size) {
30
30
  return encodeURIComponent(`
31
31
  <svg width="${size}" height="${size}" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
32
32
  <circle cx="22" cy="22" r="20" fill="${fillColor}"/>
33
- <path fill-rule="evenodd" clip-rule="evenodd" d="M21.8377 29C24.8073 29 26.6585 30.7697 27.1609 31.5442C27.4615 32.0075 28.0807 32.1395 28.5441 31.839C29.0074 31.5384 29.1394 30.9192 28.8388 30.4558C28.0439 29.2303 25.614 27 21.8377 27C18.0453 27 15.8091 29.25 15.1202 30.5245C14.8576 31.0103 15.0385 31.6171 15.5244 31.8797C16.0102 32.1423 16.617 31.9614 16.8796 31.4755C17.2718 30.75 18.8842 29 21.8377 29Z" fill="black"/>
34
- <path fill-rule="evenodd" clip-rule="evenodd" d="M11.684 16.949C11.1601 16.7743 10.8769 16.208 11.0516 15.684C11.2262 15.1601 11.7926 14.8769 12.3165 15.0516L18.3165 17.0516C18.8404 17.2262 19.1236 17.7926 18.949 18.3165C18.8093 18.7355 18.4192 19.0005 18.0005 19.0005C18.0004 20.105 17.105 21.0002 16.0005 21.0002C14.896 21.0002 14.0005 20.1048 14.0005 19.0002C14.0005 18.5694 14.1368 18.1703 14.3686 17.8438L11.684 16.949ZM32.949 15.684C33.1237 16.208 32.8405 16.7743 32.3166 16.949L29.6324 17.8437C29.8642 18.1702 30.0005 18.5693 30.0005 19.0002C30.0005 20.1048 29.1051 21.0002 28.0005 21.0002C26.8961 21.0002 26.0007 20.105 26.0005 19.0005C25.5817 19.0007 25.1914 18.7356 25.0516 18.3165C24.877 17.7926 25.1602 17.2262 25.6841 17.0516L31.6841 15.0516C32.208 14.8769 32.7744 15.1601 32.949 15.684Z" fill="black"/>
33
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M21.8377 29C24.8073 29 26.6585 30.7697 27.1609 31.5442C27.4615 32.0075 28.0807 32.1395 28.5441 31.839C29.0074 31.5384 29.1394 30.9192 28.8388 30.4558C28.0439 29.2303 25.614 27 21.8377 27C18.0453 27 15.8091 29.25 15.1202 30.5245C14.8576 31.0103 15.0385 31.6171 15.5244 31.8797C16.0102 32.1423 16.617 31.9614 16.8796 31.4755C17.2718 30.75 18.8842 29 21.8377 29Z" fill="${faceColor}"/>
34
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.684 16.949C11.1601 16.7743 10.8769 16.208 11.0516 15.684C11.2262 15.1601 11.7926 14.8769 12.3165 15.0516L18.3165 17.0516C18.8404 17.2262 19.1236 17.7926 18.949 18.3165C18.8093 18.7355 18.4192 19.0005 18.0005 19.0005C18.0004 20.105 17.105 21.0002 16.0005 21.0002C14.896 21.0002 14.0005 20.1048 14.0005 19.0002C14.0005 18.5694 14.1368 18.1703 14.3686 17.8438L11.684 16.949ZM32.949 15.684C33.1237 16.208 32.8405 16.7743 32.3166 16.949L29.6324 17.8437C29.8642 18.1702 30.0005 18.5693 30.0005 19.0002C30.0005 20.1048 29.1051 21.0002 28.0005 21.0002C26.8961 21.0002 26.0007 20.105 26.0005 19.0005C25.5817 19.0007 25.1914 18.7356 25.0516 18.3165C24.877 17.7926 25.1602 17.2262 25.6841 17.0516L31.6841 15.0516C32.208 14.8769 32.7744 15.1601 32.949 15.684Z" fill="${faceColor}"/>
35
35
  </svg>
36
36
  `);
37
37
  }
38
- function sadRatingSVG(fillColor, size) {
38
+ function sadRatingSVG(fillColor, faceColor, size) {
39
39
  return encodeURIComponent(`
40
40
  <svg width="${size}" height="${size}" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
41
41
  <circle cx="22" cy="22" r="20" fill="${fillColor}"/>
42
- <ellipse cx="16" cy="18" rx="2" ry="2" fill="black"/>
43
- <ellipse cx="28" cy="18" rx="2" ry="2" fill="black"/>
44
- <path fill-rule="evenodd" clip-rule="evenodd" d="M21.8377 28C24.8073 28 26.6585 29.7697 27.1609 30.5442C27.4615 31.0075 28.0807 31.1395 28.5441 30.839C29.0074 30.5384 29.1394 29.9192 28.8388 29.4558C28.0439 28.2303 25.614 26 21.8377 26C18.0453 26 15.8091 28.25 15.1202 29.5245C14.8576 30.0103 15.0385 30.6171 15.5244 30.8797C16.0102 31.1423 16.617 30.9614 16.8796 30.4755C17.2718 29.75 18.8842 28 21.8377 28Z" fill="black"/>
42
+ <ellipse cx="16" cy="18" rx="2" ry="2" fill="${faceColor}"/>
43
+ <ellipse cx="28" cy="18" rx="2" ry="2" fill="${faceColor}"/>
44
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M21.8377 28C24.8073 28 26.6585 29.7697 27.1609 30.5442C27.4615 31.0075 28.0807 31.1395 28.5441 30.839C29.0074 30.5384 29.1394 29.9192 28.8388 29.4558C28.0439 28.2303 25.614 26 21.8377 26C18.0453 26 15.8091 28.25 15.1202 29.5245C14.8576 30.0103 15.0385 30.6171 15.5244 30.8797C16.0102 31.1423 16.617 30.9614 16.8796 30.4755C17.2718 29.75 18.8842 28 21.8377 28Z" fill="${faceColor}"/>
45
45
  </svg>
46
46
  `);
47
47
  }
48
- function neutralRatingSVG(fillColor, size) {
48
+ function neutralRatingSVG(fillColor, faceColor, size) {
49
49
  return encodeURIComponent(`
50
50
  <svg width="${size}" height="${size}" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
51
51
  <circle cx="22" cy="22" r="20" fill="${fillColor}"/>
52
- <ellipse cx="16" cy="19" rx="2" ry="2" fill="black"/>
53
- <ellipse cx="28" cy="19" rx="2" ry="2" fill="black"/>
54
- <path fill-rule="evenodd" clip-rule="evenodd" d="M15 28C15 27.4477 15.4477 27 16 27L16 28L16 29C15.4477 29 15 28.5523 15 28ZM28 28L28 29H16L16 28L16 27H27.9995L28 28ZM28 28L28 29C28.5523 29 29 28.5523 29 28C29 27.4477 28.5518 27 27.9995 27L28 28Z" fill="black"/>
52
+ <ellipse cx="16" cy="19" rx="2" ry="2" fill="${faceColor}"/>
53
+ <ellipse cx="28" cy="19" rx="2" ry="2" fill="${faceColor}"/>
54
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15 28C15 27.4477 15.4477 27 16 27L16 28L16 29C15.4477 29 15 28.5523 15 28ZM28 28L28 29H16L16 28L16 27H27.9995L28 28ZM28 28L28 29C28.5523 29 29 28.5523 29 28C29 27.4477 28.5518 27 27.9995 27L28 28Z" fill="${faceColor}"/>
55
55
  </svg>
56
56
  `);
57
57
  }
58
- function happyRatingSVG(fillColor, size) {
58
+ function happyRatingSVG(fillColor, faceColor, size) {
59
59
  return encodeURIComponent(`
60
60
  <svg width="${size}" height="${size}" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
61
61
  <circle cx="22" cy="22" r="20" fill="${fillColor}"/>
62
- <ellipse cx="16" cy="18" rx="2" ry="2" fill="black"/>
63
- <ellipse cx="28" cy="18" rx="2" ry="2" fill="black"/>
64
- <path fill-rule="evenodd" clip-rule="evenodd" d="M21.8377 29C24.8073 29 26.6585 27.2303 27.1609 26.4558C27.4615 25.9925 28.0807 25.8605 28.5441 26.161C29.0074 26.4616 29.1394 27.0808 28.8388 27.5442C28.0439 28.7697 25.614 31 21.8377 31C18.0453 31 15.8091 28.75 15.1202 27.4755C14.8576 26.9897 15.0385 26.3829 15.5244 26.1203C16.0102 25.8577 16.617 26.0386 16.8796 26.5245C17.2718 27.25 18.8842 29 21.8377 29Z" fill="black"/>
62
+ <ellipse cx="16" cy="18" rx="2" ry="2" fill="${faceColor}"/>
63
+ <ellipse cx="28" cy="18" rx="2" ry="2" fill="${faceColor}"/>
64
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M21.8377 29C24.8073 29 26.6585 27.2303 27.1609 26.4558C27.4615 25.9925 28.0807 25.8605 28.5441 26.161C29.0074 26.4616 29.1394 27.0808 28.8388 27.5442C28.0439 28.7697 25.614 31 21.8377 31C18.0453 31 15.8091 28.75 15.1202 27.4755C14.8576 26.9897 15.0385 26.3829 15.5244 26.1203C16.0102 25.8577 16.617 26.0386 16.8796 26.5245C17.2718 27.25 18.8842 29 21.8377 29Z" fill="${faceColor}"/>
65
65
  </svg>
66
66
  `);
67
67
  }
68
- function veryHappyRatingSVG(fillColor, size) {
68
+ function veryHappyRatingSVG(fillColor, faceColor, size) {
69
69
  return encodeURIComponent(`
70
70
  <svg width="${size}" height="${size}" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
71
71
  <circle cx="22" cy="22" r="20" fill="${fillColor}"/>
72
- <ellipse cx="16" cy="18" rx="2" ry="2" fill="black"/>
73
- <ellipse cx="28" cy="18" rx="2" ry="2" fill="black"/>
74
- <path d="M21.8378 31C26.7027 31 28 27.8 28 27H16C16 27.8 16.973 31 21.8378 31Z" fill="black"/>
75
- <path fill-rule="evenodd" clip-rule="evenodd" d="M26.5528 28H17.3513C17.4656 28.1996 17.6126 28.3984 17.8211 28.6128C18.4608 29.2891 19.6453 30 21.8378 30C24.0315 30 25.3168 29.2869 26.0488 28.5805C26.2631 28.3781 26.4239 28.1881 26.5528 28ZM27.4377 30.0195C26.3048 31.1131 24.5091 32 21.8378 32C19.1655 32 17.4311 31.1109 16.3681 29.9872C15.3474 28.9082 15 27.6646 15 27C15 26.4477 15.4477 26 16 26H28C28.5523 26 29 26.4477 29 27C29 27.404 28.8568 27.9069 28.6231 28.3946C28.3936 28.868 27.9783 29.4894 27.4377 30.0195Z" fill="black"/>
72
+ <ellipse cx="16" cy="18" rx="2" ry="2" fill="${faceColor}"/>
73
+ <ellipse cx="28" cy="18" rx="2" ry="2" fill="${faceColor}"/>
74
+ <path d="M21.8378 31C26.7027 31 28 27.8 28 27H16C16 27.8 16.973 31 21.8378 31Z" fill="${faceColor}"/>
75
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M26.5528 28H17.3513C17.4656 28.1996 17.6126 28.3984 17.8211 28.6128C18.4608 29.2891 19.6453 30 21.8378 30C24.0315 30 25.3168 29.2869 26.0488 28.5805C26.2631 28.3781 26.4239 28.1881 26.5528 28ZM27.4377 30.0195C26.3048 31.1131 24.5091 32 21.8378 32C19.1655 32 17.4311 31.1109 16.3681 29.9872C15.3474 28.9082 15 27.6646 15 27C15 26.4477 15.4477 26 16 26H28C28.5523 26 29 26.4477 29 27C29 27.404 28.8568 27.9069 28.6231 28.3946C28.3936 28.868 27.9783 29.4894 27.4377 30.0195Z" fill="${faceColor}"/>
76
76
  </svg>
77
77
  `);
78
78
  }
@@ -25,7 +25,7 @@ function MultiValue(props) {
25
25
  // todo(v11): remove the MultiValue override in favor of Tag
26
26
  const [MultiValue, tagProps] = (0, _overrides.getOverrides)(overrides.Tag || overrides.MultiValue, _tag.Tag);
27
27
  return /*#__PURE__*/React.createElement(MultiValue, _extends({
28
- variant: _tag.VARIANT.solid,
28
+ hierarchy: _tag.HIERARCHY.primary,
29
29
  overrides: {
30
30
  Root: {
31
31
  // @ts-ignore
@@ -2,6 +2,7 @@ import type { Duration, Placement, SnackbarElementOverrides, SnackbarElementProp
2
2
  export { DURATION, PLACEMENT } from './constants';
3
3
  export { default as SnackbarElement } from './snackbar-element';
4
4
  export { default as SnackbarProvider, useSnackbar } from './snackbar-context';
5
+ export type { Context as SnackbarContextT } from './snackbar-context';
5
6
  export { StyledRoot, StyledContent, StyledStartEnhancerContainer, StyledSpinner, StyledMessage, StyledWrapActionButtonContainer, StyledActionButtonContainer, StyledPlacementContainer, } from './styled-components';
6
7
  export * from './types';
7
8
  /** @deprecated use Duration instead. To be removed in future versions.*/
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { SnackbarElementProps, SnackbarProviderProps, Duration } from './types';
3
- type Context = {
3
+ export type Context = {
4
4
  enqueue: (elementProps: SnackbarElementProps, duration?: Duration) => void;
5
5
  dequeue: () => void;
6
6
  };
@@ -10,4 +10,3 @@ export declare function useSnackbar(): {
10
10
  dequeue: () => void;
11
11
  };
12
12
  export default function SnackbarProvider({ children, overrides, placement, defaultDuration, }: SnackbarProviderProps): React.JSX.Element;
13
- export {};
@@ -34,11 +34,20 @@ const SnackbarContext = exports.SnackbarContext = /*#__PURE__*/React.createConte
34
34
  dequeue: fallbackHandler
35
35
  });
36
36
  function useSnackbar() {
37
- const context = React.useContext(SnackbarContext);
38
- return {
39
- enqueue: context.enqueue,
40
- dequeue: context.dequeue
41
- };
37
+ const {
38
+ enqueue,
39
+ dequeue
40
+ } = React.useContext(SnackbarContext);
41
+ /* We use an empty dependency array because `enquque` and `dequeue` never change.
42
+ Ideally we'd memoize these functions and include them in the dependency array,
43
+ but that would require us to memoize many more functions in the SnackbarProvider,
44
+ and those functions depend on eachother in a circular way.
45
+ */
46
+ // eslint-disable-next-line react-hooks/exhaustive-deps
47
+ return React.useMemo(() => ({
48
+ enqueue,
49
+ dequeue
50
+ }), []);
42
51
  }
43
52
 
44
53
  // @ts-ignore
@@ -81,17 +90,6 @@ function SnackbarProvider({
81
90
  enter(snackbars[0].duration);
82
91
  }
83
92
  }, [snackbars, prevSnackbars]);
84
- function dequeue() {
85
- setContainerHeight(0);
86
- setSnackbars(prev => {
87
- const next = prev.slice(1);
88
- if (next.length > 0) {
89
- // @ts-ignore
90
- enter(next[0].duration);
91
- }
92
- return next;
93
- });
94
- }
95
93
 
96
94
  // @ts-ignore
97
95
  function enter(duration) {
@@ -101,11 +99,19 @@ function SnackbarProvider({
101
99
  display(duration);
102
100
  }, 0);
103
101
  }
104
- function exit() {
102
+ function dequeue() {
105
103
  setAnimating(true);
106
104
  setTimeout(() => {
107
105
  setAnimating(false);
108
- dequeue();
106
+ setContainerHeight(0);
107
+ setSnackbars(prev => {
108
+ const next = prev.slice(1);
109
+ if (next.length > 0) {
110
+ // @ts-ignore
111
+ enter(next[0].duration);
112
+ }
113
+ return next;
114
+ });
109
115
  }, 1000);
110
116
  }
111
117
 
@@ -117,7 +123,7 @@ function SnackbarProvider({
117
123
 
118
124
  // @ts-ignore
119
125
  timeoutRef.current = setTimeout(() => {
120
- exit();
126
+ dequeue();
121
127
  }, duration);
122
128
  }
123
129
  function handleMouseEnter() {
@@ -132,7 +138,7 @@ function SnackbarProvider({
132
138
  function handleActionClick() {
133
139
  // @ts-ignore
134
140
  clearTimeout(timeoutRef.current);
135
- exit();
141
+ dequeue();
136
142
  }
137
143
  React.useEffect(() => {
138
144
  if (typeof document !== 'undefined') {
@@ -160,7 +166,7 @@ function SnackbarProvider({
160
166
  return /*#__PURE__*/React.createElement(SnackbarContext.Provider, {
161
167
  value: {
162
168
  enqueue,
163
- dequeue: exit
169
+ dequeue
164
170
  }
165
171
  }, /*#__PURE__*/React.createElement("div", {
166
172
  className: css({
@@ -1,4 +1,6 @@
1
- import { StyledSpinner } from './styled-components';
2
- export { StyledSpinner as Spinner };
1
+ import type { SpinnerProps } from './types';
2
+ import type { StyletronComponent } from 'styletron-react';
3
3
  export { SIZE } from './constants';
4
4
  export * from './types';
5
+ declare const Spinner: StyletronComponent<'i', SpinnerProps>;
6
+ export { Spinner };
@@ -41,15 +41,39 @@ function Stepper({
41
41
  const [Input, inputProps] = (0, _overrides.getOverrides)(overrides.Input, _input.Input);
42
42
  const [DecrementButton, decrementButtonProps] = (0, _overrides.getOverrides)(overrides.DecrementButton, DefaultButton);
43
43
  const [DecrementButtonIcon, decrementButtonIconProps] = (0, _overrides.getOverrides)(overrides.DecrementButtonIcon, _icon.CheckIndeterminate);
44
- const [IncrementButton, incrementButtonProps] = (0, _overrides.getOverrides)(overrides.DecrementButton, DefaultButton);
45
- const [IncrementButtonIcon, incrementButtonIconProps] = (0, _overrides.getOverrides)(overrides.DecrementButtonIcon, _icon.Plus);
44
+ const [IncrementButton, incrementButtonProps] = (0, _overrides.getOverrides)(overrides.IncrementButton, DefaultButton);
45
+ const [IncrementButtonIcon, incrementButtonIconProps] = (0, _overrides.getOverrides)(overrides.IncrementButtonIcon, _icon.Plus);
46
+ const [, theme] = (0, _styles.useStyletron)();
47
+ const defaultInputOverrides = {
48
+ Root: {
49
+ style: {
50
+ maxWidth: '36px',
51
+ height: '36px',
52
+ borderLeftStyle: 'none',
53
+ borderRightStyle: 'none',
54
+ borderTopStyle: 'none',
55
+ borderBottomStyle: 'none'
56
+ }
57
+ },
58
+ Input: {
59
+ style: {
60
+ paddingTop: 0,
61
+ paddingBottom: 0,
62
+ paddingLeft: 0,
63
+ paddingRight: 0,
64
+ textAlign: 'center',
65
+ backgroundColor: theme.colors.backgroundPrimary,
66
+ ...theme.typography.LabelLarge
67
+ }
68
+ }
69
+ };
70
+ inputProps.overrides = (0, _overrides.mergeOverrides)(defaultInputOverrides, inputProps.overrides);
46
71
  const handleInputChange = e => {
47
72
  const newValue = Number(e.target.value);
48
73
  if (!isNaN(newValue) && (!maxValue || newValue <= maxValue) && newValue >= minValue) {
49
74
  setValue(newValue);
50
75
  }
51
76
  };
52
- const [, theme] = (0, _styles.useStyletron)();
53
77
  return /*#__PURE__*/React.createElement(Root, rootProps, /*#__PURE__*/React.createElement(DecrementButton, _extends({
54
78
  onClick: () => setValue(value - 1),
55
79
  disabled: disabled || value <= minValue,
@@ -58,30 +82,7 @@ function Stepper({
58
82
  value: value,
59
83
  onChange: handleInputChange,
60
84
  disabled: disabled,
61
- "aria-label": "value",
62
- overrides: {
63
- Root: {
64
- style: {
65
- maxWidth: '36px',
66
- height: '36px',
67
- borderLeftStyle: 'none',
68
- borderRightStyle: 'none',
69
- borderTopStyle: 'none',
70
- borderBottomStyle: 'none'
71
- }
72
- },
73
- Input: {
74
- style: {
75
- paddingTop: 0,
76
- paddingBottom: 0,
77
- paddingLeft: 0,
78
- paddingRight: 0,
79
- textAlign: 'center',
80
- backgroundColor: theme.colors.backgroundPrimary,
81
- ...theme.typography.LabelLarge
82
- }
83
- }
84
- }
85
+ "aria-label": "value"
85
86
  }, inputProps)), /*#__PURE__*/React.createElement(IncrementButton, _extends({
86
87
  onClick: () => setValue(value + 1)
87
88
  // @ts-expect-error todo(ts-migration) TS18048 'maxValue' is possibly 'undefined'.
@@ -24,7 +24,6 @@ This source code is licensed under the MIT license found in the
24
24
  LICENSE file in the root directory of this source tree.
25
25
  */
26
26
  const MOCK_THEME = (0, _createMockTheme.default)(_themes.LightTheme);
27
- // @ts-ignore
28
27
  const IDENTITY = x => x;
29
28
  function useStyletron() {
30
29
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -77,7 +76,6 @@ function styled(ElementName, objOrFn = {}) {
77
76
  } = this.props;
78
77
  return Object.keys(restProps).reduce((acc, key) => {
79
78
  if (key[0] !== '$') {
80
- // @ts-ignore
81
79
  acc[key] = restProps[key];
82
80
  }
83
81
  return acc;
@@ -19,10 +19,8 @@ function asPrimaryExport(StyledComponent, propsTransformNames) {
19
19
  return function withStyledPropsHOC(props) {
20
20
  const styledProps = Object.keys(props).reduce((acc, key) => {
21
21
  if (key[0] === '$' || propsTransformNames.indexOf(key) < 0) {
22
- // @ts-ignore
23
22
  acc[key] = props[key];
24
23
  } else if (propsTransformNames.indexOf(key) >= 0) {
25
- // @ts-ignore
26
24
  acc['$' + key] = props[key];
27
25
  }
28
26
  return acc;
package/styles/styled.js CHANGED
@@ -20,7 +20,6 @@ Copyright (c) Uber Technologies, Inc.
20
20
  This source code is licensed under the MIT license found in the
21
21
  LICENSE file in the root directory of this source tree.
22
22
  */
23
- // @ts-ignore
24
23
  const wrapper = StyledComponent => {
25
24
  // eslint-disable-next-line react/display-name
26
25
  return /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(_themeProvider.ThemeContext.Consumer, null, theme => /*#__PURE__*/React.createElement(StyledComponent, _extends({
@@ -55,7 +54,6 @@ const useStyletron = exports.useStyletron = createThemedUseStyletron();
55
54
 
56
55
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
56
  function withWrapper(StyledElement, wrapperFn) {
58
- // @ts-ignore
59
57
  return (0, _styletronReact.withWrapper)(StyledElement, Styled => {
60
58
  // eslint-disable-next-line @typescript-eslint/no-explicit-any,react/display-name
61
59
  return /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(_themeProvider.ThemeContext.Consumer, null, theme =>
package/styles/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { ComponentType } from 'react';
2
2
  import type { IconProps } from '../icon';
3
- import type { FoundationColorTokens, ComponentColorTokens, SemanticColorTokens, Animation, Breakpoints, Border, Borders, Font, Grid, Lighting, MediaQuery, Sizing, Typography, ZIndex } from '../themes';
4
- import type { PrimitiveColorTokens } from '../tokens';
3
+ import type { FoundationColors, ComponentColors, SemanticColors, Animation, Breakpoints, Border, Borders, Font, Grid, Lighting, MediaQuery, Sizing, Typography, ZIndex } from '../themes';
4
+ import type { PrimitiveColors } from '../tokens';
5
5
  export type { Animation, Breakpoints, Border, Borders, Font, Grid, Lighting, MediaQuery, Sizing, Typography, ZIndex, };
6
- export type ColorTokens = PrimitiveColorTokens & FoundationColorTokens & ComponentColorTokens & SemanticColorTokens & {
6
+ export type ColorTokens = PrimitiveColors & FoundationColors & ComponentColors & SemanticColors & {
7
7
  [key in string]: string;
8
8
  };
9
9
  export type Theme = {
@@ -40,6 +40,8 @@ export type Icon = {
40
40
  ChevronLeftSmall?: ComponentType<IconProps> | ForwardedSVG;
41
41
  ChevronRight?: ComponentType<IconProps> | ForwardedSVG;
42
42
  ChevronRightSmall?: ComponentType<IconProps> | ForwardedSVG;
43
+ CircleCheckFilled?: ComponentType<IconProps> | ForwardedSVG;
44
+ CircleExclamationPointFilled?: ComponentType<IconProps> | ForwardedSVG;
43
45
  DeleteAlt?: ComponentType<IconProps> | ForwardedSVG;
44
46
  Delete?: ComponentType<IconProps> | ForwardedSVG;
45
47
  Filter?: ComponentType<IconProps> | ForwardedSVG;
@@ -47,10 +49,12 @@ export type Icon = {
47
49
  Hide?: ComponentType<IconProps> | ForwardedSVG;
48
50
  Menu?: ComponentType<IconProps> | ForwardedSVG;
49
51
  Overflow?: ComponentType<IconProps> | ForwardedSVG;
52
+ PaperclipFilled?: ComponentType<IconProps> | ForwardedSVG;
50
53
  Plus?: ComponentType<IconProps> | ForwardedSVG;
51
54
  Search?: ComponentType<IconProps> | ForwardedSVG;
52
55
  Show?: ComponentType<IconProps> | ForwardedSVG;
53
56
  Spinner?: ComponentType<IconProps> | ForwardedSVG;
57
+ TrashCanFilled?: ComponentType<IconProps> | ForwardedSVG;
54
58
  TriangleDown?: ComponentType<IconProps> | ForwardedSVG;
55
59
  TriangleLeft?: ComponentType<IconProps> | ForwardedSVG;
56
60
  TriangleRight?: ComponentType<IconProps> | ForwardedSVG;
@@ -153,8 +153,8 @@ function Tabs({
153
153
  }
154
154
  }, [activeTabRef.current, orientation]);
155
155
 
156
- // Update highlight on key and orientation changes.
157
- React.useEffect(updateHighlight, [activeTabRef.current, orientation]);
156
+ // Update highlight on key, orientation and children changes.
157
+ React.useEffect(updateHighlight, [activeTabRef.current, orientation, children]);
158
158
 
159
159
  // Scroll active tab into view when the parent has scrollbar on mount and
160
160
  // on key change (smooth scroll). Note, if the active key changes while
@@ -3,10 +3,9 @@ export declare const SIZE: {
3
3
  readonly medium: "medium";
4
4
  readonly large: "large";
5
5
  };
6
- export declare const VARIANT: Readonly<{
7
- readonly solid: "solid";
8
- readonly light: "light";
9
- readonly outlined: "outlined";
6
+ export declare const HIERARCHY: Readonly<{
7
+ readonly primary: "primary";
8
+ readonly secondary: "secondary";
10
9
  }>;
11
10
  export declare const KIND: {
12
11
  readonly custom: "custom";
@@ -24,4 +23,6 @@ export declare const KIND: {
24
23
  readonly orange: "orange";
25
24
  readonly purple: "purple";
26
25
  readonly brown: "brown";
26
+ readonly teal: "teal";
27
+ readonly lime: "lime";
27
28
  };
package/tag/constants.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.VARIANT = exports.SIZE = exports.KIND = void 0;
6
+ exports.SIZE = exports.KIND = exports.HIERARCHY = void 0;
7
7
  /*
8
8
  Copyright (c) Uber Technologies, Inc.
9
9
 
@@ -15,10 +15,9 @@ const SIZE = exports.SIZE = {
15
15
  medium: 'medium',
16
16
  large: 'large'
17
17
  };
18
- const VARIANT = exports.VARIANT = Object.freeze({
19
- solid: 'solid',
20
- light: 'light',
21
- outlined: 'outlined'
18
+ const HIERARCHY = exports.HIERARCHY = Object.freeze({
19
+ primary: 'primary',
20
+ secondary: 'secondary'
22
21
  });
23
22
 
24
23
  // todo: dynamic identity map generation
@@ -39,5 +38,7 @@ const KIND = exports.KIND = {
39
38
  yellow: 'yellow',
40
39
  orange: 'orange',
41
40
  purple: 'purple',
42
- brown: 'brown'
41
+ brown: 'brown',
42
+ teal: 'teal',
43
+ lime: 'lime'
43
44
  };
package/tag/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { default as Tag } from './tag';
2
2
  export { Root as StyledRoot, Action as StyledAction, Text as StyledText, } from './styled-components';
3
- export { KIND, VARIANT, SIZE } from './constants';
3
+ export { KIND, HIERARCHY, SIZE } from './constants';
4
4
  export * from './types';
package/tag/index.js CHANGED
@@ -9,9 +9,15 @@ var _exportNames = {
9
9
  StyledAction: true,
10
10
  StyledText: true,
11
11
  KIND: true,
12
- VARIANT: true,
12
+ HIERARCHY: true,
13
13
  SIZE: true
14
14
  };
15
+ Object.defineProperty(exports, "HIERARCHY", {
16
+ enumerable: true,
17
+ get: function () {
18
+ return _constants.HIERARCHY;
19
+ }
20
+ });
15
21
  Object.defineProperty(exports, "KIND", {
16
22
  enumerable: true,
17
23
  get: function () {
@@ -48,12 +54,6 @@ Object.defineProperty(exports, "Tag", {
48
54
  return _tag.default;
49
55
  }
50
56
  });
51
- Object.defineProperty(exports, "VARIANT", {
52
- enumerable: true,
53
- get: function () {
54
- return _constants.VARIANT;
55
- }
56
- });
57
57
  var _tag = _interopRequireDefault(require("./tag"));
58
58
  var _styledComponents = require("./styled-components");
59
59
  var _constants = require("./constants");
@@ -1,5 +1,5 @@
1
1
  import type { SharedPropsArg } from './types';
2
- export declare function customOnRamp(color?: string, unit?: string): string;
2
+ export declare function customOnRamp(color: string, unit?: string): string;
3
3
  export declare const Action: import("styletron-react").StyletronComponent<"span", SharedPropsArg>;
4
4
  export declare const StartEnhancerContainer: import("styletron-react").StyletronComponent<"div", SharedPropsArg>;
5
5
  export declare const Text: import("styletron-react").StyletronComponent<"span", SharedPropsArg>;