@razorpay/blade 11.12.0 → 11.13.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 (43) hide show
  1. package/build/lib/native/components/ProgressBar/CircularProgressBar.native.js +31 -0
  2. package/build/lib/native/components/ProgressBar/CircularProgressBar.native.js.map +1 -0
  3. package/build/lib/native/components/ProgressBar/CircularProgressLabel.js +17 -0
  4. package/build/lib/native/components/ProgressBar/CircularProgressLabel.js.map +1 -0
  5. package/build/lib/native/components/ProgressBar/ProgressBar.js +2 -1
  6. package/build/lib/native/components/ProgressBar/ProgressBar.js.map +1 -1
  7. package/build/lib/native/components/ProgressBar/ProgressBarFilled.native.js +1 -1
  8. package/build/lib/native/components/ProgressBar/ProgressBarFilled.native.js.map +1 -1
  9. package/build/lib/native/components/ProgressBar/progressBarTokens.js +6 -2
  10. package/build/lib/native/components/ProgressBar/progressBarTokens.js.map +1 -1
  11. package/build/lib/native/tokens/global/size.js +1 -1
  12. package/build/lib/native/tokens/global/size.js.map +1 -1
  13. package/build/lib/web/development/components/ProgressBar/CircularProgressBar.web.js +140 -0
  14. package/build/lib/web/development/components/ProgressBar/CircularProgressBar.web.js.map +1 -0
  15. package/build/lib/web/development/components/ProgressBar/CircularProgressLabel.js +38 -0
  16. package/build/lib/web/development/components/ProgressBar/CircularProgressLabel.js.map +1 -0
  17. package/build/lib/web/development/components/ProgressBar/ProgressBar.js +47 -10
  18. package/build/lib/web/development/components/ProgressBar/ProgressBar.js.map +1 -1
  19. package/build/lib/web/development/components/ProgressBar/ProgressBarFilled.web.js +6 -6
  20. package/build/lib/web/development/components/ProgressBar/ProgressBarFilled.web.js.map +1 -1
  21. package/build/lib/web/development/components/ProgressBar/progressBarTokens.js +45 -1
  22. package/build/lib/web/development/components/ProgressBar/progressBarTokens.js.map +1 -1
  23. package/build/lib/web/development/tokens/global/size.js +4 -0
  24. package/build/lib/web/development/tokens/global/size.js.map +1 -1
  25. package/build/lib/web/production/components/ProgressBar/CircularProgressBar.web.js +140 -0
  26. package/build/lib/web/production/components/ProgressBar/CircularProgressBar.web.js.map +1 -0
  27. package/build/lib/web/production/components/ProgressBar/CircularProgressLabel.js +38 -0
  28. package/build/lib/web/production/components/ProgressBar/CircularProgressLabel.js.map +1 -0
  29. package/build/lib/web/production/components/ProgressBar/ProgressBar.js +47 -10
  30. package/build/lib/web/production/components/ProgressBar/ProgressBar.js.map +1 -1
  31. package/build/lib/web/production/components/ProgressBar/ProgressBarFilled.web.js +6 -6
  32. package/build/lib/web/production/components/ProgressBar/ProgressBarFilled.web.js.map +1 -1
  33. package/build/lib/web/production/components/ProgressBar/progressBarTokens.js +45 -1
  34. package/build/lib/web/production/components/ProgressBar/progressBarTokens.js.map +1 -1
  35. package/build/lib/web/production/tokens/global/size.js +4 -0
  36. package/build/lib/web/production/tokens/global/size.js.map +1 -1
  37. package/build/types/components/index.d.ts +11 -5
  38. package/build/types/components/index.native.d.ts +11 -5
  39. package/build/types/tokens/index.d.ts +4 -0
  40. package/build/types/tokens/index.native.d.ts +4 -0
  41. package/codemods/migrate-progressbar/transformers/__test__/migrate-progressbar.test.ts +28 -0
  42. package/codemods/migrate-progressbar/transformers/index.ts +89 -0
  43. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CircularProgressLabel.js","sources":["../../../../../../src/components/ProgressBar/CircularProgressLabel.tsx"],"sourcesContent":["import React from 'react';\nimport type { CircularProgressBarFilledProps } from './types';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\n\nconst CircularProgressLabel = ({\n progressPercent,\n size = 'small',\n label,\n showPercentage = true,\n}: Pick<\n CircularProgressBarFilledProps,\n 'progressPercent' | 'size' | 'label' | 'showPercentage'\n>): React.ReactElement => {\n const hasLabel = label && label.trim()?.length > 0;\n\n return (\n <BaseBox display=\"flex\" flexDirection=\"column\" alignItems=\"center\">\n {hasLabel && (\n <Text marginTop=\"spacing.3\" variant=\"body\" weight=\"regular\" size=\"small\">\n {label}\n </Text>\n )}\n\n {showPercentage && size === 'small' && (\n <Text\n marginTop={hasLabel ? 'spacing.0' : 'spacing.3'}\n variant=\"body\"\n weight=\"semibold\"\n size=\"small\"\n >\n {progressPercent}%\n </Text>\n )}\n </BaseBox>\n );\n};\n\nexport { CircularProgressLabel };\n"],"names":["CircularProgressLabel","_ref","_label$trim","progressPercent","_ref$size","size","label","_ref$showPercentage","showPercentage","hasLabel","trim","length","_jsxs","BaseBox","display","flexDirection","alignItems","children","_jsx","Text","marginTop","variant","weight"],"mappings":";;;;;;;AAKA,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAAC,IAAA,EAQD;AAAA,EAAA,IAAAC,WAAA,CAAA;AAAA,EAAA,IAPxBC,eAAe,GAAAF,IAAA,CAAfE,eAAe;IAAAC,SAAA,GAAAH,IAAA,CACfI,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,OAAO,GAAAA,SAAA;IACdE,KAAK,GAAAL,IAAA,CAALK,KAAK;IAAAC,mBAAA,GAAAN,IAAA,CACLO,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAG,KAAA,CAAA,GAAA,IAAI,GAAAA,mBAAA,CAAA;AAKrB,EAAA,IAAME,QAAQ,GAAGH,KAAK,IAAI,CAAAJ,CAAAA,WAAA,GAAAI,KAAK,CAACI,IAAI,EAAE,cAAAR,WAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAZA,WAAA,CAAcS,MAAM,IAAG,CAAC,CAAA;EAElD,oBACEC,IAAA,CAACC,OAAO,EAAA;AAACC,IAAAA,OAAO,EAAC,MAAM;AAACC,IAAAA,aAAa,EAAC,QAAQ;AAACC,IAAAA,UAAU,EAAC,QAAQ;AAAAC,IAAAA,QAAA,EAC/DR,CAAAA,QAAQ,iBACPS,GAAA,CAACC,IAAI,EAAA;AAACC,MAAAA,SAAS,EAAC,WAAW;AAACC,MAAAA,OAAO,EAAC,MAAM;AAACC,MAAAA,MAAM,EAAC,SAAS;AAACjB,MAAAA,IAAI,EAAC,OAAO;AAAAY,MAAAA,QAAA,EACrEX,KAAAA;KACG,CACP,EAEAE,cAAc,IAAIH,IAAI,KAAK,OAAO,iBACjCO,IAAA,CAACO,IAAI,EAAA;AACHC,MAAAA,SAAS,EAAEX,QAAQ,GAAG,WAAW,GAAG,WAAY;AAChDY,MAAAA,OAAO,EAAC,MAAM;AACdC,MAAAA,MAAM,EAAC,UAAU;AACjBjB,MAAAA,IAAI,EAAC,OAAO;MAAAY,QAAA,EAAA,CAEXd,eAAe,EAAC,GACnB,CAAA;AAAA,KAAM,CACP,CAAA;AAAA,GACM,CAAC,CAAA;AAEd;;;;"}
@@ -1,6 +1,7 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
3
  import { ProgressBarFilled } from './ProgressBarFilled.web.js';
4
+ import { CircularProgressBarFilled } from './CircularProgressBar.web.js';
4
5
  import clamp from '../../utils/lodashButBetter/clamp.js';
5
6
  import '../../utils/metaAttribute/index.js';
6
7
  import '../Typography/Text/index.js';
@@ -24,17 +25,20 @@ import { Text } from '../Typography/Text/Text.js';
24
25
  import { makeAccessible } from '../../utils/makeAccessible/makeAccessible.web.js';
25
26
  import { makeSize } from '../../utils/makeSize/makeSize.js';
26
27
 
27
- var _excluded = ["accessibilityLabel", "color", "isIndeterminate", "label", "showPercentage", "size", "value", "variant", "min", "max", "testID"];
28
+ var _excluded = ["accessibilityLabel", "color", "type", "isIndeterminate", "label", "showPercentage", "size", "value", "variant", "min", "max", "testID"];
28
29
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
30
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
30
31
  var progressBarHeight = {
31
32
  small: size[2],
32
- medium: size[4]
33
+ medium: size[4],
34
+ // Large size isn't available when variant is 'linear'
35
+ large: size[0]
33
36
  };
34
37
  var ProgressBar = function ProgressBar(_ref) {
35
38
  var _label$trim;
36
39
  var accessibilityLabel = _ref.accessibilityLabel,
37
40
  color = _ref.color,
41
+ type = _ref.type,
38
42
  _ref$isIndeterminate = _ref.isIndeterminate,
39
43
  isIndeterminate = _ref$isIndeterminate === void 0 ? false : _ref$isIndeterminate,
40
44
  label = _ref.label,
@@ -54,19 +58,40 @@ var ProgressBar = function ProgressBar(_ref) {
54
58
  styledProps = _objectWithoutProperties(_ref, _excluded);
55
59
  var _useTheme = useTheme(),
56
60
  theme = _useTheme.theme;
57
- var id = useId(variant);
61
+ var progressType = !type && (variant === 'meter' || variant === 'progress') ? variant : type;
62
+ var progressVariant = variant === 'meter' || variant === 'progress' ? 'linear' : variant;
63
+ var id = useId("".concat(progressType, "-").concat(progressVariant));
58
64
  if (false) {
59
- if (variant === 'meter' && isIndeterminate) {
65
+ if (progressType === 'meter' && isIndeterminate) {
60
66
  throwBladeError({
61
67
  moduleName: 'ProgressBar',
62
- message: "Cannot set 'isIndeterminate' when 'variant' is 'meter'."
68
+ message: "Cannot set 'isIndeterminate' when 'type' or 'variant' is 'meter'."
69
+ });
70
+ }
71
+ if (progressVariant === 'circular' && isIndeterminate) {
72
+ throwBladeError({
73
+ moduleName: 'ProgressBar',
74
+ message: "Cannot set 'isIndeterminate' when 'variant' is 'circular'."
75
+ });
76
+ }
77
+ if (progressVariant === 'linear' && size === 'large') {
78
+ throwBladeError({
79
+ moduleName: 'ProgressBar',
80
+ message: "Large size isn't available when 'variant' is 'linear'."
81
+ });
82
+ }
83
+ if (type && (variant === 'progress' || variant === 'meter')) {
84
+ throwBladeError({
85
+ moduleName: 'ProgressBar',
86
+ message: "variant can only be 'linear' or 'circular' when 'type=".concat(type, "'.")
63
87
  });
64
88
  }
65
89
  }
66
90
  var unfilledBackgroundColor = theme.colors.feedback.background.neutral.subtle;
67
91
  var filledBackgroundColor = color ? theme.colors.feedback.background[color].intense : theme.colors.surface.background.primary.intense;
68
92
  var hasLabel = label && ((_label$trim = label.trim()) === null || _label$trim === void 0 ? void 0 : _label$trim.length) > 0;
69
- var isMeter = variant === 'meter';
93
+ var isMeter = progressType === 'meter';
94
+ var isCircular = progressVariant === 'circular';
70
95
  var progressValue = clamp(value, min, max);
71
96
  var percentageProgressValue = Math.floor((progressValue - min) * 100 / (max - min));
72
97
  var shouldShowPercentage = showPercentage && !isMeter && !isIndeterminate;
@@ -97,7 +122,7 @@ var ProgressBar = function ProgressBar(_ref) {
97
122
  display: "flex",
98
123
  flexDirection: "column",
99
124
  width: "100%",
100
- children: [/*#__PURE__*/jsxs(BaseBox, {
125
+ children: [!isCircular ? /*#__PURE__*/jsxs(BaseBox, {
101
126
  display: "flex",
102
127
  flexDirection: "row",
103
128
  justifyContent: hasLabel ? 'space-between' : 'flex-end',
@@ -116,7 +141,7 @@ var ProgressBar = function ProgressBar(_ref) {
116
141
  children: "".concat(percentageProgressValue, "%")
117
142
  })
118
143
  }) : null]
119
- }), /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
144
+ }) : null, /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
120
145
  id: id
121
146
  }, makeAccessible({
122
147
  role: accessibilityProps.role,
@@ -126,7 +151,19 @@ var ProgressBar = function ProgressBar(_ref) {
126
151
  valueMin: accessibilityProps.valueMin,
127
152
  valueMax: accessibilityProps.valueMax
128
153
  })), {}, {
129
- children: /*#__PURE__*/jsx(BaseBox, {
154
+ children: isCircular ? /*#__PURE__*/jsx(CircularProgressBarFilled, {
155
+ size: size,
156
+ label: label,
157
+ progressPercent: percentageProgressValue,
158
+ isMeter: isMeter,
159
+ showPercentage: shouldShowPercentage,
160
+ backgroundColor: unfilledBackgroundColor,
161
+ fillColor: filledBackgroundColor,
162
+ pulseMotionDuration: "duration.2xgentle",
163
+ fillMotionDuration: "duration.2xgentle",
164
+ pulseMotionDelay: "delay.long",
165
+ motionEasing: "easing.standard.revealing"
166
+ }) : /*#__PURE__*/jsx(BaseBox, {
130
167
  backgroundColor: unfilledBackgroundColor,
131
168
  height: makeSize(progressBarHeight[size]),
132
169
  overflow: "hidden",
@@ -139,7 +176,7 @@ var ProgressBar = function ProgressBar(_ref) {
139
176
  indeterminateMotionDuration: "duration.2xgentle",
140
177
  pulseMotionDelay: "delay.long",
141
178
  motionEasing: "easing.standard.revealing",
142
- variant: variant,
179
+ type: progressType,
143
180
  isIndeterminate: isIndeterminate
144
181
  })
145
182
  })
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.js","sources":["../../../../../../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { ProgressBarFilled } from './ProgressBarFilled';\nimport clamp from '~utils/lodashButBetter/clamp';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { Text } from '~components/Typography/Text';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { useId } from '~utils/useId';\nimport { useTheme } from '~components/BladeProvider';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { size } from '~tokens/global';\nimport type { TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\n\ntype ProgressBarCommonProps = {\n /**\n * Sets aria-label to help users know what the progress bar is for. Default value is the same as the `label` passed.\n */\n accessibilityLabel?: string;\n /**\n * Sets the color of the progress bar which changes the feedback color.\n */\n color?: FeedbackColors;\n /**\n * Sets the label to be rendered for the progress bar. This value will also be used as default for `accessibilityLabel`.\n */\n label?: string;\n /**\n * Sets the size of the progress bar.\n * @default 'small'\n */\n size?: 'small' | 'medium';\n /**\n * Sets the progress value of the progress bar.\n * @default 'small'\n */\n value?: number;\n /**\n * Sets the minimum value for the progress bar.\n * @default 0\n */\n min?: number;\n /**\n * Sets the maximum value for the progress bar.\n * @default 100\n */\n max?: number;\n} & TestID &\n StyledPropsBlade;\n\ntype ProgressBarVariant = 'progress' | 'meter';\n\ntype ProgressBarProgressProps = ProgressBarCommonProps & {\n /**\n * Sets the variant to be rendered for the progress bar.\n * @default 'progress'\n */\n variant?: Extract<ProgressBarVariant, 'progress'>;\n /**\n * Sets whether the progress bar is in an indeterminate state.\n * @default false\n */\n isIndeterminate?: boolean;\n /**\n * Sets whether or not to show the progress percentage for the progress bar. Percentage is hidden by default for the `meter` variant.\n * @default true\n */\n showPercentage?: boolean;\n};\n\ntype ProgressBarMeterProps = ProgressBarCommonProps & {\n /**\n * Sets the variant to be rendered for thr progress bar.\n * @default 'progress'\n */\n variant?: Extract<ProgressBarVariant, 'meter'>;\n /**\n * Sets whether the progress bar is in an indeterminate state.\n * @default false\n */\n isIndeterminate?: undefined;\n /**\n * Sets whether or not to show the progress percentage for the progress bar. Percentage is hidden by default for the `meter` variant.\n * @default false\n */\n showPercentage?: undefined;\n};\n\ntype ProgressBarProps = ProgressBarProgressProps | ProgressBarMeterProps;\n\nconst progressBarHeight: Record<NonNullable<ProgressBarCommonProps['size']>, 2 | 4> = {\n small: size[2],\n medium: size[4],\n};\n\nconst ProgressBar = ({\n accessibilityLabel,\n color,\n isIndeterminate = false,\n label,\n showPercentage = true,\n size = 'small',\n value = 0,\n variant = 'progress',\n min = 0,\n max = 100,\n testID,\n ...styledProps\n}: ProgressBarProps): ReactElement => {\n const { theme } = useTheme();\n const id = useId(variant);\n\n if (__DEV__) {\n if (variant === 'meter' && isIndeterminate) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Cannot set 'isIndeterminate' when 'variant' is 'meter'.`,\n });\n }\n }\n\n const unfilledBackgroundColor = theme.colors.feedback.background.neutral\n .subtle as BaseBoxProps['backgroundColor'];\n const filledBackgroundColor = color\n ? theme.colors.feedback.background[color].intense\n : theme.colors.surface.background.primary.intense;\n const hasLabel = label && label.trim()?.length > 0;\n const isMeter = variant === 'meter';\n const progressValue = clamp(value, min, max);\n const percentageProgressValue = Math.floor(((progressValue - min) * 100) / (max - min));\n const shouldShowPercentage = showPercentage && !isMeter && !isIndeterminate;\n const accessibilityProps: Pick<\n AccessibilityProps,\n 'role' | 'label' | 'valueMax' | 'valueNow' | 'valueMin' | 'valueText'\n > = {\n role: 'progressbar',\n label: accessibilityLabel ?? label,\n valueNow: percentageProgressValue,\n valueText: `${percentageProgressValue}%`,\n valueMin: min,\n valueMax: max,\n };\n\n if (isMeter) {\n accessibilityProps.role = 'meter';\n accessibilityProps.valueNow = progressValue;\n accessibilityProps.valueText = `${progressValue}`;\n }\n\n if (isIndeterminate) {\n accessibilityProps.valueNow = undefined;\n accessibilityProps.valueMin = undefined;\n accessibilityProps.valueMax = undefined;\n accessibilityProps.valueText = undefined;\n }\n\n return (\n <BaseBox\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.ProgressBar, testID })}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\" width=\"100%\">\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent={hasLabel ? 'space-between' : 'flex-end'}\n >\n {hasLabel ? (\n <Text as=\"label\" variant=\"body\" size=\"small\" color=\"surface.text.gray.subtle\">\n {label}\n </Text>\n ) : null}\n {shouldShowPercentage ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text\n variant=\"body\"\n size=\"small\"\n color=\"surface.text.gray.subtle\"\n >{`${percentageProgressValue}%`}</Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n <BaseBox\n id={id}\n {...makeAccessible({\n role: accessibilityProps.role,\n label: accessibilityProps.label,\n valueNow: accessibilityProps.valueNow,\n valueText: accessibilityProps.valueText,\n valueMin: accessibilityProps.valueMin,\n valueMax: accessibilityProps.valueMax,\n })}\n >\n <BaseBox\n backgroundColor={unfilledBackgroundColor}\n height={makeSize(progressBarHeight[size])}\n overflow=\"hidden\"\n position=\"relative\"\n >\n <ProgressBarFilled\n backgroundColor={filledBackgroundColor}\n progress={percentageProgressValue}\n fillMotionDuration=\"duration.2xgentle\"\n pulseMotionDuration=\"duration.2xgentle\"\n indeterminateMotionDuration=\"duration.2xgentle\"\n pulseMotionDelay=\"delay.long\"\n motionEasing=\"easing.standard.revealing\"\n variant={variant}\n isIndeterminate={isIndeterminate}\n />\n </BaseBox>\n </BaseBox>\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport type { ProgressBarProps, ProgressBarVariant };\nexport { ProgressBar };\n"],"names":["progressBarHeight","small","size","medium","ProgressBar","_ref","_label$trim","accessibilityLabel","color","_ref$isIndeterminate","isIndeterminate","label","_ref$showPercentage","showPercentage","_ref$size","_ref$value","value","_ref$variant","variant","_ref$min","min","_ref$max","max","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","id","useId","throwBladeError","moduleName","message","unfilledBackgroundColor","colors","feedback","background","neutral","subtle","filledBackgroundColor","intense","surface","primary","hasLabel","trim","length","isMeter","progressValue","clamp","percentageProgressValue","Math","floor","shouldShowPercentage","accessibilityProps","role","valueNow","valueText","concat","valueMin","valueMax","undefined","_jsx","BaseBox","_objectSpread","getStyledProps","metaAttribute","name","MetaConstants","children","_jsxs","display","flexDirection","width","justifyContent","Text","as","marginBottom","makeAccessible","backgroundColor","height","makeSize","overflow","position","ProgressBarFilled","progress","fillMotionDuration","pulseMotionDuration","indeterminateMotionDuration","pulseMotionDelay","motionEasing"],"mappings":";;;;;;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,SAAS;QACvCE,QAAQ,EAAEL,kBAAkB,CAACK,QAAQ;QACrCC,QAAQ,EAAEN,kBAAkB,CAACM,QAAAA;AAC/B,OAAC,CAAC,CAAA,EAAA,EAAA,EAAA;QAAAS,QAAA,eAEFP,GAAA,CAACC,OAAO,EAAA;AACNgB,UAAAA,eAAe,EAAE7C,uBAAwB;AACzC8C,UAAAA,MAAM,EAAEC,QAAQ,CAAClF,iBAAiB,CAACE,IAAI,CAAC,CAAE;AAC1CiF,UAAAA,QAAQ,EAAC,QAAQ;AACjBC,UAAAA,QAAQ,EAAC,UAAU;UAAAd,QAAA,eAEnBP,GAAA,CAACsB,iBAAiB,EAAA;AAChBL,YAAAA,eAAe,EAAEvC,qBAAsB;AACvC6C,YAAAA,QAAQ,EAAEnC,uBAAwB;AAClCoC,YAAAA,kBAAkB,EAAC,mBAAmB;AACtCC,YAAAA,mBAAmB,EAAC,mBAAmB;AACvCC,YAAAA,2BAA2B,EAAC,mBAAmB;AAC/CC,YAAAA,gBAAgB,EAAC,YAAY;AAC7BC,YAAAA,YAAY,EAAC,2BAA2B;AACxCzE,YAAAA,OAAO,EAAEA,OAAQ;AACjBR,YAAAA,eAAe,EAAEA,eAAAA;WAClB,CAAA;SACM,CAAA;AAAC,OAAA,CACH,CAAC,CAAA;KACH,CAAA;AAAC,GAAA,CACH,CAAC,CAAA;AAEd;;;;"}
1
+ {"version":3,"file":"ProgressBar.js","sources":["../../../../../../src/components/ProgressBar/ProgressBar.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { ProgressBarFilled } from './ProgressBarFilled';\nimport { CircularProgressBarFilled } from './CircularProgressBar';\nimport clamp from '~utils/lodashButBetter/clamp';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { Text } from '~components/Typography/Text';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport type { StyledPropsBlade } from '~components/Box/styledProps';\nimport { useId } from '~utils/useId';\nimport { useTheme } from '~components/BladeProvider';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { FeedbackColors } from '~tokens/theme/theme';\nimport { size } from '~tokens/global';\nimport type { TestID } from '~utils/types';\nimport { makeSize } from '~utils/makeSize';\nimport type { AccessibilityProps } from '~utils/makeAccessible';\nimport { makeAccessible } from '~utils/makeAccessible';\nimport { throwBladeError } from '~utils/logger';\n\ntype ProgressBarCommonProps = {\n /**\n * Sets aria-label to help users know what the progress bar is for. Default value is the same as the `label` passed.\n */\n accessibilityLabel?: string;\n /**\n * Sets the color of the progress bar which changes the feedback color.\n */\n color?: FeedbackColors;\n /**\n * Sets the type of the progress bar.\n * @default 'progress'\n */\n type?: 'meter' | 'progress';\n /**\n * Sets the label to be rendered for the progress bar. This value will also be used as default for `accessibilityLabel`.\n */\n label?: string;\n /**\n * Sets the size of the progress bar.\n * Note: 'large' size isn't available when the variant is 'linear'.\n * @default 'small'\n */\n size?: 'small' | 'medium' | 'large';\n /**\n * Sets the progress value of the progress bar.\n * @default 'small'\n */\n value?: number;\n /**\n * Sets the minimum value for the progress bar.\n * @default 0\n */\n min?: number;\n /**\n * Sets the maximum value for the progress bar.\n * @default 100\n */\n max?: number;\n} & TestID &\n StyledPropsBlade;\n\ntype ProgressBarVariant = 'progress' | 'meter' | 'linear' | 'circular';\n\ntype ProgressBarProgressProps = ProgressBarCommonProps & {\n /**\n * Sets the variant to be rendered for the progress bar.\n * @default 'progress'\n */\n variant?: Extract<ProgressBarVariant, 'progress' | 'linear' | 'circular'>;\n /**\n * Sets whether the progress bar is in an indeterminate state.\n * @default false\n */\n isIndeterminate?: boolean;\n /**\n * Sets whether or not to show the progress percentage for the progress bar. Percentage is hidden by default for the `meter` variant.\n * @default true\n */\n showPercentage?: boolean;\n};\n\ntype ProgressBarMeterProps = ProgressBarCommonProps & {\n /**\n * Sets the variant to be rendered for thr progress bar.\n * @default 'progress'\n */\n variant?: Extract<ProgressBarVariant, 'meter' | 'linear' | 'circular'>;\n /**\n * Sets whether the progress bar is in an indeterminate state.\n * @default false\n */\n isIndeterminate?: undefined;\n /**\n * Sets whether or not to show the progress percentage for the progress bar. Percentage is hidden by default for the `meter` variant.\n * @default false\n */\n showPercentage?: undefined;\n};\n\ntype ProgressBarProps = ProgressBarProgressProps | ProgressBarMeterProps;\n\nconst progressBarHeight: Record<NonNullable<ProgressBarProps['size']>, 2 | 4 | 0> = {\n small: size[2],\n medium: size[4],\n // Large size isn't available when variant is 'linear'\n large: size[0],\n};\n\nconst ProgressBar = ({\n accessibilityLabel,\n color,\n type,\n isIndeterminate = false,\n label,\n showPercentage = true,\n size = 'small',\n value = 0,\n variant = 'progress',\n min = 0,\n max = 100,\n testID,\n ...styledProps\n}: ProgressBarProps): ReactElement => {\n const { theme } = useTheme();\n const progressType = !type && (variant === 'meter' || variant === 'progress') ? variant : type;\n const progressVariant = variant === 'meter' || variant === 'progress' ? 'linear' : variant;\n const id = useId(`${progressType}-${progressVariant}`);\n\n if (__DEV__) {\n if (progressType === 'meter' && isIndeterminate) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Cannot set 'isIndeterminate' when 'type' or 'variant' is 'meter'.`,\n });\n }\n\n if (progressVariant === 'circular' && isIndeterminate) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Cannot set 'isIndeterminate' when 'variant' is 'circular'.`,\n });\n }\n\n if (progressVariant === 'linear' && size === 'large') {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `Large size isn't available when 'variant' is 'linear'.`,\n });\n }\n\n if (type && (variant === 'progress' || variant === 'meter')) {\n throwBladeError({\n moduleName: 'ProgressBar',\n message: `variant can only be 'linear' or 'circular' when 'type=${type}'.`,\n });\n }\n }\n\n const unfilledBackgroundColor = theme.colors.feedback.background.neutral\n .subtle as BaseBoxProps['backgroundColor'];\n const filledBackgroundColor = color\n ? theme.colors.feedback.background[color].intense\n : theme.colors.surface.background.primary.intense;\n const hasLabel = label && label.trim()?.length > 0;\n const isMeter = progressType === 'meter';\n const isCircular = progressVariant === 'circular';\n const progressValue = clamp(value, min, max);\n const percentageProgressValue = Math.floor(((progressValue - min) * 100) / (max - min));\n const shouldShowPercentage = showPercentage && !isMeter && !isIndeterminate;\n const accessibilityProps: Pick<\n AccessibilityProps,\n 'role' | 'label' | 'valueMax' | 'valueNow' | 'valueMin' | 'valueText'\n > = {\n role: 'progressbar',\n label: accessibilityLabel ?? label,\n valueNow: percentageProgressValue,\n valueText: `${percentageProgressValue}%`,\n valueMin: min,\n valueMax: max,\n };\n\n if (isMeter) {\n accessibilityProps.role = 'meter';\n accessibilityProps.valueNow = progressValue;\n accessibilityProps.valueText = `${progressValue}`;\n }\n\n if (isIndeterminate) {\n accessibilityProps.valueNow = undefined;\n accessibilityProps.valueMin = undefined;\n accessibilityProps.valueMax = undefined;\n accessibilityProps.valueText = undefined;\n }\n\n return (\n <BaseBox\n {...getStyledProps(styledProps)}\n {...metaAttribute({ name: MetaConstants.ProgressBar, testID })}\n >\n <BaseBox display=\"flex\" flexDirection=\"column\" width=\"100%\">\n {!isCircular ? (\n <BaseBox\n display=\"flex\"\n flexDirection=\"row\"\n justifyContent={hasLabel ? 'space-between' : 'flex-end'}\n >\n {hasLabel ? (\n <Text as=\"label\" variant=\"body\" size=\"small\" color=\"surface.text.gray.subtle\">\n {label}\n </Text>\n ) : null}\n {shouldShowPercentage ? (\n <BaseBox marginBottom=\"spacing.2\">\n <Text\n variant=\"body\"\n size=\"small\"\n color=\"surface.text.gray.subtle\"\n >{`${percentageProgressValue}%`}</Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n ) : null}\n\n <BaseBox\n id={id}\n {...makeAccessible({\n role: accessibilityProps.role,\n label: accessibilityProps.label,\n valueNow: accessibilityProps.valueNow,\n valueText: accessibilityProps.valueText,\n valueMin: accessibilityProps.valueMin,\n valueMax: accessibilityProps.valueMax,\n })}\n >\n {isCircular ? (\n <CircularProgressBarFilled\n size={size}\n label={label}\n progressPercent={percentageProgressValue}\n isMeter={isMeter}\n showPercentage={shouldShowPercentage}\n backgroundColor={unfilledBackgroundColor as string}\n fillColor={filledBackgroundColor}\n pulseMotionDuration=\"duration.2xgentle\"\n fillMotionDuration=\"duration.2xgentle\"\n pulseMotionDelay=\"delay.long\"\n motionEasing=\"easing.standard.revealing\"\n />\n ) : (\n <BaseBox\n backgroundColor={unfilledBackgroundColor}\n height={makeSize(progressBarHeight[size])}\n overflow=\"hidden\"\n position=\"relative\"\n >\n <ProgressBarFilled\n backgroundColor={filledBackgroundColor}\n progress={percentageProgressValue}\n fillMotionDuration=\"duration.2xgentle\"\n pulseMotionDuration=\"duration.2xgentle\"\n indeterminateMotionDuration=\"duration.2xgentle\"\n pulseMotionDelay=\"delay.long\"\n motionEasing=\"easing.standard.revealing\"\n type={progressType}\n isIndeterminate={isIndeterminate}\n />\n </BaseBox>\n )}\n </BaseBox>\n </BaseBox>\n </BaseBox>\n );\n};\n\nexport type { ProgressBarProps, ProgressBarVariant };\nexport { ProgressBar };\n"],"names":["progressBarHeight","small","size","medium","large","ProgressBar","_ref","_label$trim","accessibilityLabel","color","type","_ref$isIndeterminate","isIndeterminate","label","_ref$showPercentage","showPercentage","_ref$size","_ref$value","value","_ref$variant","variant","_ref$min","min","_ref$max","max","testID","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","progressType","progressVariant","id","useId","concat","throwBladeError","moduleName","message","unfilledBackgroundColor","colors","feedback","background","neutral","subtle","filledBackgroundColor","intense","surface","primary","hasLabel","trim","length","isMeter","isCircular","progressValue","clamp","percentageProgressValue","Math","floor","shouldShowPercentage","accessibilityProps","role","valueNow","valueText","valueMin","valueMax","undefined","_jsx","BaseBox","_objectSpread","getStyledProps","metaAttribute","name","MetaConstants","children","_jsxs","display","flexDirection","width","justifyContent","Text","as","marginBottom","makeAccessible","CircularProgressBarFilled","progressPercent","backgroundColor","fillColor","pulseMotionDuration","fillMotionDuration","pulseMotionDelay","motionEasing","height","makeSize","overflow","position","ProgressBarFilled","progress","indeterminateMotionDuration"],"mapp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AAC,CAAA;AAEd;;;;"}
@@ -46,11 +46,11 @@ var IndeterminatePulseAnimation = /*#__PURE__*/styled(BoxWithIndeterminateAnimat
46
46
  pulseMotionDuration = _ref4.pulseMotionDuration,
47
47
  pulseMotionDelay = _ref4.pulseMotionDelay,
48
48
  motionEasing = _ref4.motionEasing,
49
- variant = _ref4.variant;
49
+ type = _ref4.type;
50
50
  var duration = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDuration)));
51
51
  var easing = castWebType(getIn(theme.motion, motionEasing));
52
52
  var delay = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDelay)));
53
- return variant === 'progress' ? getPulseAnimationStyles({
53
+ return type === 'progress' ? getPulseAnimationStyles({
54
54
  duration: duration,
55
55
  easing: easing,
56
56
  delay: delay
@@ -89,11 +89,11 @@ var DeterminatePulseAnimation = /*#__PURE__*/styled(BoxWithProgressFillTransitio
89
89
  pulseMotionDuration = _ref7.pulseMotionDuration,
90
90
  pulseMotionDelay = _ref7.pulseMotionDelay,
91
91
  motionEasing = _ref7.motionEasing,
92
- variant = _ref7.variant;
92
+ type = _ref7.type;
93
93
  var duration = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDuration)));
94
94
  var easing = castWebType(getIn(theme.motion, motionEasing));
95
95
  var delay = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDelay)));
96
- return variant === 'progress' ? getPulseAnimationStyles({
96
+ return type === 'progress' ? getPulseAnimationStyles({
97
97
  duration: duration,
98
98
  easing: easing,
99
99
  delay: delay
@@ -107,7 +107,7 @@ var ProgressBarFilled = function ProgressBarFilled(_ref8) {
107
107
  pulseMotionDelay = _ref8.pulseMotionDelay,
108
108
  pulseMotionDuration = _ref8.pulseMotionDuration,
109
109
  indeterminateMotionDuration = _ref8.indeterminateMotionDuration,
110
- variant = _ref8.variant,
110
+ type = _ref8.type,
111
111
  isIndeterminate = _ref8.isIndeterminate;
112
112
  var ProgressBarFilledContainer = isIndeterminate ? IndeterminateFilledContainer : DeterminateFilledContainer;
113
113
  var ProgressBarPulseAnimation = isIndeterminate ? IndeterminatePulseAnimation : DeterminatePulseAnimation;
@@ -119,7 +119,7 @@ var ProgressBarFilled = function ProgressBarFilled(_ref8) {
119
119
  children: /*#__PURE__*/jsx(ProgressBarPulseAnimation, {
120
120
  fillMotionDuration: fillMotionDuration,
121
121
  motionEasing: motionEasing,
122
- variant: variant,
122
+ type: type,
123
123
  pulseMotionDelay: pulseMotionDelay,
124
124
  pulseMotionDuration: pulseMotionDuration
125
125
  })
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBarFilled.web.js","sources":["../../../../../../src/components/ProgressBar/ProgressBarFilled.web.tsx"],"sourcesContent":["import type { FlattenSimpleInterpolation } from 'styled-components';\nimport styled, { css, keyframes } from 'styled-components';\nimport React from 'react';\nimport type { ProgressBarFilledProps } from './types';\nimport { indeterminateAnimation, pulseAnimation } from './progressBarTokens';\nimport getIn from '~utils/lodashButBetter/get';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castWebType } from '~utils';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nconst pulseKeyframes = keyframes`\n 0% {\n opacity: ${pulseAnimation.opacityInitial};\n }\n 50% {\n opacity: ${pulseAnimation.opacityMid};\n }\n 100% {\n opacity: ${pulseAnimation.opacityFinal};\n }\n`;\n\nconst slideAndScaleKeyframes = keyframes`\n 0% {\n left: ${indeterminateAnimation.leftInitial};\n transform: scaleX(${indeterminateAnimation.scaleXInitial});\n }\n 50% {\n left: ${indeterminateAnimation.leftMid};\n transform: scaleX(${indeterminateAnimation.scaleXMid});\n }\n 100% {\n left: ${indeterminateAnimation.leftFinal};\n transform: scaleX(${indeterminateAnimation.scaleXFinal});\n }\n`;\n\nconst getPulseAnimationStyles = ({\n duration,\n easing,\n delay,\n}: {\n duration: string;\n easing: string;\n delay: string;\n}): FlattenSimpleInterpolation => css`\n height: 100%;\n width: 100%;\n opacity: ${pulseAnimation.opacityInitial};\n background-color: ${pulseAnimation.backgroundColor};\n animation: ${pulseKeyframes} ${duration} ${easing} infinite;\n animation-delay: ${delay};\n`;\n\nconst BoxWithIndeterminateAnimation = styled(BaseBox)<\n Pick<ProgressBarFilledProps, 'fillMotionDuration' | 'indeterminateMotionDuration'>\n>(({ theme, indeterminateMotionDuration }) => {\n const duration = castWebType(makeMotionTime(getIn(theme.motion, indeterminateMotionDuration)));\n const easing = 'linear'; // TODO: Add this in motion tokens\n\n return css`\n animation: ${slideAndScaleKeyframes} ${duration} ${easing} infinite;\n position: absolute;\n width: ${indeterminateAnimation.fillWidth};\n height: 100%;\n `;\n});\n\nconst IndeterminateFilledContainer = styled(BoxWithIndeterminateAnimation)<\n Pick<ProgressBarFilledProps, 'backgroundColor' | 'progress'>\n>(({ backgroundColor }) => ({\n backgroundColor,\n}));\n\nconst IndeterminatePulseAnimation = styled(BoxWithIndeterminateAnimation)<\n Pick<\n ProgressBarFilledProps,\n 'pulseMotionDuration' | 'pulseMotionDelay' | 'motionEasing' | 'variant'\n >\n>(({ theme, pulseMotionDuration, pulseMotionDelay, motionEasing, variant }) => {\n const duration = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDuration)));\n const easing = castWebType(getIn(theme.motion, motionEasing));\n const delay = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDelay)));\n\n return variant === 'progress' ? getPulseAnimationStyles({ duration, easing, delay }) : '';\n});\n\nconst BoxWithProgressFillTransition = styled(BaseBox)<\n Pick<ProgressBarFilledProps, 'fillMotionDuration' | 'motionEasing'>\n>(({ theme, fillMotionDuration, motionEasing }) => ({\n transitionProperty: 'width',\n transitionDuration: castWebType(makeMotionTime(getIn(theme.motion, fillMotionDuration))),\n transitionTimingFunction: castWebType(getIn(theme.motion, motionEasing)),\n}));\n\nconst DeterminateFilledContainer = styled(BoxWithProgressFillTransition)<\n Pick<ProgressBarFilledProps, 'backgroundColor' | 'progress' | 'indeterminateMotionDuration'>\n>(({ backgroundColor, progress }) => ({\n backgroundColor,\n height: '100%',\n width: `${progress}%`,\n}));\n\nconst DeterminatePulseAnimation = styled(BoxWithProgressFillTransition)<\n Pick<\n ProgressBarFilledProps,\n 'pulseMotionDuration' | 'pulseMotionDelay' | 'motionEasing' | 'variant'\n >\n>(({ theme, pulseMotionDuration, pulseMotionDelay, motionEasing, variant }) => {\n const duration = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDuration)));\n const easing = castWebType(getIn(theme.motion, motionEasing));\n const delay = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDelay)));\n\n return variant === 'progress' ? getPulseAnimationStyles({ duration, easing, delay }) : '';\n});\n\nconst ProgressBarFilled = ({\n backgroundColor,\n fillMotionDuration,\n motionEasing,\n progress,\n pulseMotionDelay,\n pulseMotionDuration,\n indeterminateMotionDuration,\n variant,\n isIndeterminate,\n}: ProgressBarFilledProps): React.ReactElement => {\n const ProgressBarFilledContainer = isIndeterminate\n ? IndeterminateFilledContainer\n : DeterminateFilledContainer;\n const ProgressBarPulseAnimation = isIndeterminate\n ? IndeterminatePulseAnimation\n : DeterminatePulseAnimation;\n\n return (\n <ProgressBarFilledContainer\n backgroundColor={backgroundColor}\n fillMotionDuration={fillMotionDuration}\n progress={progress}\n indeterminateMotionDuration={indeterminateMotionDuration}\n >\n <ProgressBarPulseAnimation\n fillMotionDuration={fillMotionDuration}\n motionEasing={motionEasing}\n variant={variant}\n pulseMotionDelay={pulseMotionDelay}\n pulseMotionDuration={pulseMotionDuration}\n />\n </ProgressBarFilledContainer>\n );\n};\n\nexport { ProgressBarFilled };\n"],"names":["pulseKeyframes","keyframes","pulseAnimation","opacityInitial","opacityMid","opacityFinal","slideAndScaleKeyframes","indeterminateAnimation","leftInitial","scaleXInitial","leftMid","scaleXMid","leftFinal","scaleXFinal","getPulseAnimationStyles","_ref","duration","easing","delay","css","backgroundColor","BoxWithIndeterminateAnimation","styled","BaseBox","withConfig","displayName","componentId","_ref2","theme","indeterminateMotionDuration","castWebType","makeMotionTime","getIn","motion","fillWidth","IndeterminateFilledContainer","_ref3","IndeterminatePulseAnimation","_ref4","pulseMotionDuration","pulseMotionDelay","motionEasing","variant","BoxWithProgressFillTransition","_ref5","fillMotionDuration","transitionProperty","transitionDuration","transitionTimingFunction","DeterminateFilledContainer","_ref6","progress","height","width","concat","DeterminatePulseAnimation","_ref7","ProgressBarFilled","_ref8","isIndeterminate","ProgressBarFilledContainer","ProgressBarPulseAnimation","_jsx","children"],"mappings":";;;;;;;;;;;;AAUA,IAAMA,cAAc,gBAAGC,SAAS,CAAA,CAAA,aAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,IAAA,CAAA,EAEjBC,cAAc,CAACC,cAAc,EAG7BD,cAAc,CAACE,UAAU,EAGzBF,cAAc,CAACG,YAAY,CAEzC,CAAA;AAED,IAAMC,sBAAsB,gBAAGL,SAAS,CAE5BM,CAAAA,UAAAA,EAAAA,oBAAAA,EAAAA,cAAAA,EAAAA,oBAAAA,EAAAA,eAAAA,EAAAA,oBAAAA,EAAAA,KAAAA,CAAAA,EAAAA,sBAAsB,CAACC,WAAW,EACtBD,sBAAsB,CAACE,aAAa,EAGhDF,sBAAsB,CAACG,OAAO,EAClBH,sBAAsB,CAACI,SAAS,EAG5CJ,sBAAsB,CAACK,SAAS,EACnBL,sBAAsB,CAACM,WAAW,CAE1D,CAAA;AAED,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAC3BC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,KAAK,GAAAH,IAAA,CAALG,KAAK,CAAA;AAAA,EAAA,OAK2BC,GAAG,CAGxBjB,CAAAA,iCAAAA,EAAAA,oBAAAA,EAAAA,aAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAAAA,4BAAAA,EAAAA,GAAAA,CAAAA,EAAAA,cAAc,CAACC,cAAc,EACpBD,cAAc,CAACkB,eAAe,EACrCpB,cAAc,EAAIgB,QAAQ,EAAIC,M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AAAA,2BAA2B,EAAEA,2BAA4B;IAAAkC,QAAA,eAEzDD,GAAA,CAACD,yBAAyB,EAAA;AACxBhB,MAAAA,kBAAkB,EAAEA,kBAAmB;AACvCJ,MAAAA,YAAY,EAAEA,YAAa;AAC3BC,MAAAA,OAAO,EAAEA,OAAQ;AACjBF,MAAAA,gBAAgB,EAAEA,gBAAiB;AACnCD,MAAAA,mBAAmB,EAAEA,mBAAAA;KACtB,CAAA;AAAC,GACwB,CAAC,CAAA;AAEjC;;;;"}
1
+ {"version":3,"file":"ProgressBarFilled.web.js","sources":["../../../../../../src/components/ProgressBar/ProgressBarFilled.web.tsx"],"sourcesContent":["import type { FlattenSimpleInterpolation } from 'styled-components';\nimport styled, { css, keyframes } from 'styled-components';\nimport React from 'react';\nimport type { ProgressBarFilledProps } from './types';\nimport { indeterminateAnimation, pulseAnimation } from './progressBarTokens';\nimport getIn from '~utils/lodashButBetter/get';\nimport BaseBox from '~components/Box/BaseBox';\nimport { castWebType } from '~utils';\nimport { makeMotionTime } from '~utils/makeMotionTime';\n\nconst pulseKeyframes = keyframes`\n 0% {\n opacity: ${pulseAnimation.opacityInitial};\n }\n 50% {\n opacity: ${pulseAnimation.opacityMid};\n }\n 100% {\n opacity: ${pulseAnimation.opacityFinal};\n }\n`;\n\nconst slideAndScaleKeyframes = keyframes`\n 0% {\n left: ${indeterminateAnimation.leftInitial};\n transform: scaleX(${indeterminateAnimation.scaleXInitial});\n }\n 50% {\n left: ${indeterminateAnimation.leftMid};\n transform: scaleX(${indeterminateAnimation.scaleXMid});\n }\n 100% {\n left: ${indeterminateAnimation.leftFinal};\n transform: scaleX(${indeterminateAnimation.scaleXFinal});\n }\n`;\n\nconst getPulseAnimationStyles = ({\n duration,\n easing,\n delay,\n}: {\n duration: string;\n easing: string;\n delay: string;\n}): FlattenSimpleInterpolation => css`\n height: 100%;\n width: 100%;\n opacity: ${pulseAnimation.opacityInitial};\n background-color: ${pulseAnimation.backgroundColor};\n animation: ${pulseKeyframes} ${duration} ${easing} infinite;\n animation-delay: ${delay};\n`;\n\nconst BoxWithIndeterminateAnimation = styled(BaseBox)<\n Pick<ProgressBarFilledProps, 'fillMotionDuration' | 'indeterminateMotionDuration'>\n>(({ theme, indeterminateMotionDuration }) => {\n const duration = castWebType(makeMotionTime(getIn(theme.motion, indeterminateMotionDuration)));\n const easing = 'linear'; // TODO: Add this in motion tokens\n\n return css`\n animation: ${slideAndScaleKeyframes} ${duration} ${easing} infinite;\n position: absolute;\n width: ${indeterminateAnimation.fillWidth};\n height: 100%;\n `;\n});\n\nconst IndeterminateFilledContainer = styled(BoxWithIndeterminateAnimation)<\n Pick<ProgressBarFilledProps, 'backgroundColor' | 'progress'>\n>(({ backgroundColor }) => ({\n backgroundColor,\n}));\n\nconst IndeterminatePulseAnimation = styled(BoxWithIndeterminateAnimation)<\n Pick<ProgressBarFilledProps, 'pulseMotionDuration' | 'pulseMotionDelay' | 'motionEasing' | 'type'>\n>(({ theme, pulseMotionDuration, pulseMotionDelay, motionEasing, type }) => {\n const duration = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDuration)));\n const easing = castWebType(getIn(theme.motion, motionEasing));\n const delay = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDelay)));\n\n return type === 'progress' ? getPulseAnimationStyles({ duration, easing, delay }) : '';\n});\n\nconst BoxWithProgressFillTransition = styled(BaseBox)<\n Pick<ProgressBarFilledProps, 'fillMotionDuration' | 'motionEasing'>\n>(({ theme, fillMotionDuration, motionEasing }) => ({\n transitionProperty: 'width',\n transitionDuration: castWebType(makeMotionTime(getIn(theme.motion, fillMotionDuration))),\n transitionTimingFunction: castWebType(getIn(theme.motion, motionEasing)),\n}));\n\nconst DeterminateFilledContainer = styled(BoxWithProgressFillTransition)<\n Pick<ProgressBarFilledProps, 'backgroundColor' | 'progress' | 'indeterminateMotionDuration'>\n>(({ backgroundColor, progress }) => ({\n backgroundColor,\n height: '100%',\n width: `${progress}%`,\n}));\n\nconst DeterminatePulseAnimation = styled(BoxWithProgressFillTransition)<\n Pick<ProgressBarFilledProps, 'pulseMotionDuration' | 'pulseMotionDelay' | 'motionEasing' | 'type'>\n>(({ theme, pulseMotionDuration, pulseMotionDelay, motionEasing, type }) => {\n const duration = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDuration)));\n const easing = castWebType(getIn(theme.motion, motionEasing));\n const delay = castWebType(makeMotionTime(getIn(theme.motion, pulseMotionDelay)));\n\n return type === 'progress' ? getPulseAnimationStyles({ duration, easing, delay }) : '';\n});\n\nconst ProgressBarFilled = ({\n backgroundColor,\n fillMotionDuration,\n motionEasing,\n progress,\n pulseMotionDelay,\n pulseMotionDuration,\n indeterminateMotionDuration,\n type,\n isIndeterminate,\n}: ProgressBarFilledProps): React.ReactElement => {\n const ProgressBarFilledContainer = isIndeterminate\n ? IndeterminateFilledContainer\n : DeterminateFilledContainer;\n const ProgressBarPulseAnimation = isIndeterminate\n ? IndeterminatePulseAnimation\n : DeterminatePulseAnimation;\n\n return (\n <ProgressBarFilledContainer\n backgroundColor={backgroundColor}\n fillMotionDuration={fillMotionDuration}\n progress={progress}\n indeterminateMotionDuration={indeterminateMotionDuration}\n >\n <ProgressBarPulseAnimation\n fillMotionDuration={fillMotionDuration}\n motionEasing={motionEasing}\n type={type}\n pulseMotionDelay={pulseMotionDelay}\n pulseMotionDuration={pulseMotionDuration}\n />\n </ProgressBarFilledContainer>\n );\n};\n\nexport { ProgressBarFilled };\n"],"names":["pulseKeyframes","keyframes","pulseAnimation","opacityInitial","opacityMid","opacityFinal","slideAndScaleKeyframes","indeterminateAnimation","leftInitial","scaleXInitial","leftMid","scaleXMid","leftFinal","scaleXFinal","getPulseAnimationStyles","_ref","duration","easing","delay","css","backgroundColor","BoxWithIndeterminateAnimation","styled","BaseBox","withConfig","displayName","componentId","_ref2","theme","indeterminateMotionDuration","castWebType","makeMotionTime","getIn","motion","fillWidth","IndeterminateFilledContainer","_ref3","IndeterminatePulseAnimation","_ref4","pulseMotionDuration","pulseMotionDelay","motionEasing","type","BoxWithProgressFillTransition","_ref5","fillMotionDuration","transitionProperty","transitionDuration","transitionTimingFunction","DeterminateFilledContainer","_ref6","progress","height","width","concat","DeterminatePulseAnimation","_ref7","ProgressBarFilled","_ref8","isIndeterminate","ProgressBarFilledContainer","ProgressBarPulseAnimation","_jsx","children"],"mappings":";;;;;;;;;;;;AAUA,IAAMA,cAAc,gBAAGC,SAAS,CAAA,CAAA,aAAA,EAAA,gBAAA,EAAA,iBAAA,EAAA,IAAA,CAAA,EAEjBC,cAAc,CAACC,cAAc,EAG7BD,cAAc,CAACE,UAAU,EAGzBF,cAAc,CAACG,YAAY,CAEzC,CAAA;AAED,IAAMC,sBAAsB,gBAAGL,SAAS,CAE5BM,CAAAA,UAAAA,EAAAA,oBAAAA,EAAAA,cAAAA,EAAAA,oBAAAA,EAAAA,eAAAA,EAAAA,oBAAAA,EAAAA,KAAAA,CAAAA,EAAAA,sBAAsB,CAACC,WAAW,EACtBD,sBAAsB,CAACE,aAAa,EAGhDF,sBAAsB,CAACG,OAAO,EAClBH,sBAAsB,CAACI,SAAS,EAG5CJ,sBAAsB,CAACK,SAAS,EACnBL,sBAAsB,CAACM,WAAW,CAE1D,CAAA;AAED,IAAMC,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAC3BC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,KAAK,GAAAH,IAAA,CAALG,KAAK,CAAA;AAAA,EAAA,OAK2BC,GAAG,CAGxBjB,CAAAA,iCAAAA,EAAAA,oBAAAA,EAAAA,aAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAAAA,4BAAAA,EAAAA,GAAAA,CAAAA,EAAAA,cAAc,CAACC,cAAc,EACpBD,cAAc,CAACkB,eAAe,EACrCpB,cAAc,EAAIgB,QAAQ,EAAIC,MAAM,EAC9BC,KAAK,CAAA,CAAA;AAAA,CACzB,C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zDD,GAAA,CAACD,yBAAyB,EAAA;AACxBhB,MAAAA,kBAAkB,EAAEA,kBAAmB;AACvCJ,MAAAA,YAAY,EAAEA,YAAa;AAC3BC,MAAAA,IAAI,EAAEA,IAAK;AACXF,MAAAA,gBAAgB,EAAEA,gBAAiB;AACnCD,MAAAA,mBAAmB,EAAEA,mBAAAA;KACtB,CAAA;AAAC,GACwB,CAAC,CAAA;AAEjC;;;;"}
@@ -1,3 +1,6 @@
1
+ import '../../tokens/global/index.js';
2
+ import { size } from '../../tokens/global/size.js';
3
+
1
4
  var indeterminateAnimation = {
2
5
  scaleXInitial: 1,
3
6
  scaleXMid: 5,
@@ -13,6 +16,47 @@ var pulseAnimation = {
13
16
  opacityFinal: 0,
14
17
  backgroundColor: 'white'
15
18
  };
19
+ var circularProgressSizeTokens = {
20
+ small: {
21
+ size: size[24],
22
+ strokeWidth: size[3],
23
+ percentTextSize: 'small'
24
+ },
25
+ medium: {
26
+ size: size[48],
27
+ strokeWidth: size[5],
28
+ percentTextSize: 'small'
29
+ },
30
+ large: {
31
+ size: size[72],
32
+ strokeWidth: size[7],
33
+ percentTextSize: 'medium'
34
+ }
35
+ };
36
+ var getCircularProgressSVGTokens = function getCircularProgressSVGTokens(_ref) {
37
+ var size = _ref.size,
38
+ progressPercent = _ref.progressPercent;
39
+ // Size of the enclosing square
40
+ var sqSize = circularProgressSizeTokens[size].size;
41
+ var strokeWidth = circularProgressSizeTokens[size].strokeWidth;
42
+
43
+ // SVG centers the stroke width on the radius, subtract out so circle fits in square
44
+ var radius = (sqSize - strokeWidth) / 2;
45
+ // Enclose circle in a circumscribing square
46
+ var viewBox = "0 0 ".concat(sqSize, " ").concat(sqSize);
47
+ // Arc length at 100% coverage is the circle circumference
48
+ var dashArray = radius * Math.PI * 2;
49
+ // Scale 100% coverage overlay with the actual percent
50
+ var dashOffset = dashArray - dashArray * progressPercent / 100;
51
+ return {
52
+ sqSize: sqSize,
53
+ strokeWidth: strokeWidth,
54
+ radius: radius,
55
+ viewBox: viewBox,
56
+ dashArray: dashArray,
57
+ dashOffset: dashOffset
58
+ };
59
+ };
16
60
 
17
- export { indeterminateAnimation, pulseAnimation };
61
+ export { circularProgressSizeTokens, getCircularProgressSVGTokens, indeterminateAnimation, pulseAnimation };
18
62
  //# sourceMappingURL=progressBarTokens.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progressBarTokens.js","sources":["../../../../../../src/components/ProgressBar/progressBarTokens.ts"],"sourcesContent":["const indeterminateAnimation = {\n scaleXInitial: 1,\n scaleXMid: 5,\n scaleXFinal: 1,\n leftInitial: '-8%',\n leftMid: '50%',\n leftFinal: '103%',\n fillWidth: '5%',\n};\n\nconst pulseAnimation = {\n opacityInitial: 0,\n opacityMid: 0.25,\n opacityFinal: 0,\n backgroundColor: 'white',\n};\n\nexport { indeterminateAnimation, pulseAnimation };\n"],"names":["indeterminateAnimation","scaleXInitial","scaleXMid","scaleXFinal","leftInitial","leftMid","leftFinal","fillWidth","pulseAnimation","opacityInitial","opacityMid","opacityFinal","backgroundColor"],"mappings":"AAAA,IAAMA,sBAAsB,GAAG;AAC7BC,EAAAA,aAAa,EAAE,CAAC;AAChBC,EAAAA,SAAS,EAAE,CAAC;AACZC,EAAAA,WAAW,EAAE,CAAC;AACdC,EAAAA,WAAW,EAAE,KAAK;AAClBC,EAAAA,OAAO,EAAE,KAAK;AACdC,EAAAA,SAAS,EAAE,MAAM;AACjBC,EAAAA,SAAS,EAAE,IAAA;AACb,EAAC;AAED,IAAMC,cAAc,GAAG;AACrBC,EAAAA,cAAc,EAAE,CAAC;AACjBC,EAAAA,UAAU,EAAE,IAAI;AAChBC,EAAAA,YAAY,EAAE,CAAC;AACfC,EAAAA,eAAe,EAAE,OAAA;AACnB;;;;"}
1
+ {"version":3,"file":"progressBarTokens.js","sources":["../../../../../../src/components/ProgressBar/progressBarTokens.ts"],"sourcesContent":["import type { CircularProgressBarFilledProps } from './types';\nimport { size } from '~tokens/global';\n\nconst indeterminateAnimation = {\n scaleXInitial: 1,\n scaleXMid: 5,\n scaleXFinal: 1,\n leftInitial: '-8%',\n leftMid: '50%',\n leftFinal: '103%',\n fillWidth: '5%',\n};\n\nconst pulseAnimation = {\n opacityInitial: 0,\n opacityMid: 0.25,\n opacityFinal: 0,\n backgroundColor: 'white',\n};\n\nconst circularProgressSizeTokens = {\n small: {\n size: size[24],\n strokeWidth: size[3],\n percentTextSize: 'small',\n },\n medium: {\n size: size[48],\n strokeWidth: size[5],\n percentTextSize: 'small',\n },\n large: {\n size: size[72],\n strokeWidth: size[7],\n percentTextSize: 'medium',\n },\n} as const;\n\nconst getCircularProgressSVGTokens = ({\n size,\n progressPercent,\n}: {\n size: NonNullable<CircularProgressBarFilledProps['size']>;\n progressPercent: number;\n}): {\n sqSize: number;\n strokeWidth: number;\n radius: number;\n viewBox: string;\n dashArray: number;\n dashOffset: number;\n} => {\n // Size of the enclosing square\n const sqSize = circularProgressSizeTokens[size].size;\n const strokeWidth = circularProgressSizeTokens[size].strokeWidth;\n\n // SVG centers the stroke width on the radius, subtract out so circle fits in square\n const radius = (sqSize - strokeWidth) / 2;\n // Enclose circle in a circumscribing square\n const viewBox = `0 0 ${sqSize} ${sqSize}`;\n // Arc length at 100% coverage is the circle circumference\n const dashArray = radius * Math.PI * 2;\n // Scale 100% coverage overlay with the actual percent\n const dashOffset = dashArray - (dashArray * progressPercent) / 100;\n\n return {\n sqSize,\n strokeWidth,\n radius,\n viewBox,\n dashArray,\n dashOffset,\n };\n};\n\nexport {\n indeterminateAnimation,\n pulseAnimation,\n circularProgressSizeTokens,\n getCircularProgressSVGTokens,\n};\n"],"names":["indeterminateAnimation","scaleXInitial","scaleXMid","scaleXFinal","leftInitial","leftMid","leftFinal","fillWidth","pulseAnimation","opacityInitial","opacityMid","opacityFinal","backgroundColor","circularProgressSizeTokens","small","size","strokeWidth","percentTextSize","medium","large","getCircularProgressSVGTokens","_ref","progressPercent","sqSize","radius","viewBox","concat","dashArray","Math","PI","dashOffset"],"mappings":";;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AW,GAAGH,0BAA0B,CAACE,IAAI,CAAC,CAACC,WAAW,CAAA;;AAEhE;AACA,EAAA,IAAMQ,MAAM,GAAG,CAACD,MAAM,GAAGP,WAAW,IAAI,CAAC,CAAA;AACzC;EACA,IAAMS,OAAO,UAAAC,MAAA,CAAUH,MAAM,EAAAG,GAAAA,CAAAA,CAAAA,MAAA,CAAIH,MAAM,CAAE,CAAA;AACzC;EACA,IAAMI,SAAS,GAAGH,MAAM,GAAGI,IAAI,CAACC,EAAE,GAAG,CAAC,CAAA;AACtC;EACA,IAAMC,UAAU,GAAGH,SAAS,GAAIA,SAAS,GAAGL,eAAe,GAAI,GAAG,CAAA;EAElE,OAAO;AACLC,IAAAA,MAAM,EAANA,MAAM;AACNP,IAAAA,WAAW,EAAXA,WAAW;AACXQ,IAAAA,MAAM,EAANA,MAAM;AACNC,IAAAA,OAAO,EAAPA,OAAO;AACPE,IAAAA,SAAS,EAATA,SAAS;AACTG,IAAAA,UAAU,EAAVA,UAAAA;GACD,CAAA;AACH;;;;"}
@@ -16,6 +16,8 @@ var size = {
16
16
  5: 5,
17
17
  /** 6 px */
18
18
  6: 6,
19
+ /** 7 px */
20
+ 7: 7,
19
21
  /** 8 px */
20
22
  8: 8,
21
23
  /** 10 px */
@@ -46,6 +48,8 @@ var size = {
46
48
  56: 56,
47
49
  /** 64 px */
48
50
  64: 64,
51
+ /** 72 px */
52
+ 72: 72,
49
53
  /** 100 px */
50
54
  100: 100,
51
55
  /** 120 px */
@@ -1 +1 @@
1
- {"version":3,"file":"size.js","sources":["../../../../../../src/tokens/global/size.ts"],"sourcesContent":["/**\n * Size tokens are currently not exposed for users (therefore not available in theme)\n */\nexport const size = {\n /** 0 px */\n 0: 0,\n /** 1 px */\n 1: 1,\n /** 2 px */\n 2: 2,\n /** 3 px */\n 3: 3,\n /** 4 px */\n 4: 4,\n /** 5 px */\n 5: 5,\n /** 6 px */\n 6: 6,\n /** 8 px */\n 8: 8,\n /** 10 px */\n 10: 10,\n /** 12 px */\n 12: 12,\n /** 16 px */\n 16: 16,\n /** 18 px */\n 18: 18,\n /** 20 px */\n 20: 20,\n /** 24 px */\n 24: 24,\n /** 28 px */\n 28: 28,\n /** 32 px */\n 32: 32,\n /** 36 px */\n 36: 36,\n /** 40 px */\n 40: 40,\n /** 44 px */\n 44: 44,\n /** 48 px */\n 48: 48,\n /** 56 px */\n 56: 56,\n /** 64 px */\n 64: 64,\n /** 100 px */\n 100: 100,\n /** 120 px */\n 120: 120,\n /** 140 px */\n 140: 140,\n /** 160 px */\n 160: 160,\n /** 176 px */\n 176: 176,\n /** 200 px */\n 200: 200,\n /** 240 px */\n 240: 240,\n /** 300 px */\n 300: 300,\n /** 360 px */\n 360: 360,\n /** 400 px */\n 400: 400,\n /** 584 px */\n 584: 584,\n /** 640 px */\n 640: 640,\n /** 760 px */\n 760: 760,\n /** 800 px */\n 800: 800,\n /** 1024 px */\n 1024: 1024,\n /** 1136 px */\n 1136: 1136,\n} as const;\n\nexport type Size = typeof size;\n"],"names":["size"],"mappings":"AAAA;AACA;AACA;AACO,IAAMA,IAAI,GAAG;AAClB;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,IAAI,EAAE,IAAI;AACV;AACA,EAAA,IAAI,EAAE,IAAA;AACR;;;;"}
1
+ {"version":3,"file":"size.js","sources":["../../../../../../src/tokens/global/size.ts"],"sourcesContent":["/**\n * Size tokens are currently not exposed for users (therefore not available in theme)\n */\nexport const size = {\n /** 0 px */\n 0: 0,\n /** 1 px */\n 1: 1,\n /** 2 px */\n 2: 2,\n /** 3 px */\n 3: 3,\n /** 4 px */\n 4: 4,\n /** 5 px */\n 5: 5,\n /** 6 px */\n 6: 6,\n /** 7 px */\n 7: 7,\n /** 8 px */\n 8: 8,\n /** 10 px */\n 10: 10,\n /** 12 px */\n 12: 12,\n /** 16 px */\n 16: 16,\n /** 18 px */\n 18: 18,\n /** 20 px */\n 20: 20,\n /** 24 px */\n 24: 24,\n /** 28 px */\n 28: 28,\n /** 32 px */\n 32: 32,\n /** 36 px */\n 36: 36,\n /** 40 px */\n 40: 40,\n /** 44 px */\n 44: 44,\n /** 48 px */\n 48: 48,\n /** 56 px */\n 56: 56,\n /** 64 px */\n 64: 64,\n /** 72 px */\n 72: 72,\n /** 100 px */\n 100: 100,\n /** 120 px */\n 120: 120,\n /** 140 px */\n 140: 140,\n /** 160 px */\n 160: 160,\n /** 176 px */\n 176: 176,\n /** 200 px */\n 200: 200,\n /** 240 px */\n 240: 240,\n /** 300 px */\n 300: 300,\n /** 360 px */\n 360: 360,\n /** 400 px */\n 400: 400,\n /** 584 px */\n 584: 584,\n /** 640 px */\n 640: 640,\n /** 760 px */\n 760: 760,\n /** 800 px */\n 800: 800,\n /** 1024 px */\n 1024: 1024,\n /** 1136 px */\n 1136: 1136,\n} as const;\n\nexport type Size = typeof size;\n"],"names":["size"],"mappings":"AAAA;AACA;AACA;AACO,IAAMA,IAAI,GAAG;AAClB;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,CAAC,EAAE,CAAC;AACJ;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,EAAE,EAAE,EAAE;AACN;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,GAAG,EAAE,GAAG;AACR;AACA,EAAA,IAAI,EAAE,IAAI;AACV;AACA,EAAA,IAAI,EAAE,IAAA;AACR;;;;"}
@@ -7070,15 +7070,21 @@ type ProgressBarCommonProps = {
7070
7070
  * Sets the color of the progress bar which changes the feedback color.
7071
7071
  */
7072
7072
  color?: FeedbackColors;
7073
+ /**
7074
+ * Sets the type of the progress bar.
7075
+ * @default 'progress'
7076
+ */
7077
+ type?: 'meter' | 'progress';
7073
7078
  /**
7074
7079
  * Sets the label to be rendered for the progress bar. This value will also be used as default for `accessibilityLabel`.
7075
7080
  */
7076
7081
  label?: string;
7077
7082
  /**
7078
7083
  * Sets the size of the progress bar.
7084
+ * Note: 'large' size isn't available when the variant is 'linear'.
7079
7085
  * @default 'small'
7080
7086
  */
7081
- size?: 'small' | 'medium';
7087
+ size?: 'small' | 'medium' | 'large';
7082
7088
  /**
7083
7089
  * Sets the progress value of the progress bar.
7084
7090
  * @default 'small'
@@ -7095,13 +7101,13 @@ type ProgressBarCommonProps = {
7095
7101
  */
7096
7102
  max?: number;
7097
7103
  } & TestID & StyledPropsBlade;
7098
- type ProgressBarVariant = 'progress' | 'meter';
7104
+ type ProgressBarVariant = 'progress' | 'meter' | 'linear' | 'circular';
7099
7105
  type ProgressBarProgressProps = ProgressBarCommonProps & {
7100
7106
  /**
7101
7107
  * Sets the variant to be rendered for the progress bar.
7102
7108
  * @default 'progress'
7103
7109
  */
7104
- variant?: Extract<ProgressBarVariant, 'progress'>;
7110
+ variant?: Extract<ProgressBarVariant, 'progress' | 'linear' | 'circular'>;
7105
7111
  /**
7106
7112
  * Sets whether the progress bar is in an indeterminate state.
7107
7113
  * @default false
@@ -7118,7 +7124,7 @@ type ProgressBarMeterProps = ProgressBarCommonProps & {
7118
7124
  * Sets the variant to be rendered for thr progress bar.
7119
7125
  * @default 'progress'
7120
7126
  */
7121
- variant?: Extract<ProgressBarVariant, 'meter'>;
7127
+ variant?: Extract<ProgressBarVariant, 'meter' | 'linear' | 'circular'>;
7122
7128
  /**
7123
7129
  * Sets whether the progress bar is in an indeterminate state.
7124
7130
  * @default false
@@ -7131,7 +7137,7 @@ type ProgressBarMeterProps = ProgressBarCommonProps & {
7131
7137
  showPercentage?: undefined;
7132
7138
  };
7133
7139
  type ProgressBarProps = ProgressBarProgressProps | ProgressBarMeterProps;
7134
- declare const ProgressBar: ({ accessibilityLabel, color, isIndeterminate, label, showPercentage, size, value, variant, min, max, testID, ...styledProps }: ProgressBarProps) => ReactElement;
7140
+ declare const ProgressBar: ({ accessibilityLabel, color, type, isIndeterminate, label, showPercentage, size, value, variant, min, max, testID, ...styledProps }: ProgressBarProps) => ReactElement;
7135
7141
 
7136
7142
  type RadioProps = {
7137
7143
  /**
@@ -6103,15 +6103,21 @@ type ProgressBarCommonProps = {
6103
6103
  * Sets the color of the progress bar which changes the feedback color.
6104
6104
  */
6105
6105
  color?: FeedbackColors;
6106
+ /**
6107
+ * Sets the type of the progress bar.
6108
+ * @default 'progress'
6109
+ */
6110
+ type?: 'meter' | 'progress';
6106
6111
  /**
6107
6112
  * Sets the label to be rendered for the progress bar. This value will also be used as default for `accessibilityLabel`.
6108
6113
  */
6109
6114
  label?: string;
6110
6115
  /**
6111
6116
  * Sets the size of the progress bar.
6117
+ * Note: 'large' size isn't available when the variant is 'linear'.
6112
6118
  * @default 'small'
6113
6119
  */
6114
- size?: 'small' | 'medium';
6120
+ size?: 'small' | 'medium' | 'large';
6115
6121
  /**
6116
6122
  * Sets the progress value of the progress bar.
6117
6123
  * @default 'small'
@@ -6128,13 +6134,13 @@ type ProgressBarCommonProps = {
6128
6134
  */
6129
6135
  max?: number;
6130
6136
  } & TestID & StyledPropsBlade;
6131
- type ProgressBarVariant = 'progress' | 'meter';
6137
+ type ProgressBarVariant = 'progress' | 'meter' | 'linear' | 'circular';
6132
6138
  type ProgressBarProgressProps = ProgressBarCommonProps & {
6133
6139
  /**
6134
6140
  * Sets the variant to be rendered for the progress bar.
6135
6141
  * @default 'progress'
6136
6142
  */
6137
- variant?: Extract<ProgressBarVariant, 'progress'>;
6143
+ variant?: Extract<ProgressBarVariant, 'progress' | 'linear' | 'circular'>;
6138
6144
  /**
6139
6145
  * Sets whether the progress bar is in an indeterminate state.
6140
6146
  * @default false
@@ -6151,7 +6157,7 @@ type ProgressBarMeterProps = ProgressBarCommonProps & {
6151
6157
  * Sets the variant to be rendered for thr progress bar.
6152
6158
  * @default 'progress'
6153
6159
  */
6154
- variant?: Extract<ProgressBarVariant, 'meter'>;
6160
+ variant?: Extract<ProgressBarVariant, 'meter' | 'linear' | 'circular'>;
6155
6161
  /**
6156
6162
  * Sets whether the progress bar is in an indeterminate state.
6157
6163
  * @default false
@@ -6164,7 +6170,7 @@ type ProgressBarMeterProps = ProgressBarCommonProps & {
6164
6170
  showPercentage?: undefined;
6165
6171
  };
6166
6172
  type ProgressBarProps = ProgressBarProgressProps | ProgressBarMeterProps;
6167
- declare const ProgressBar: ({ accessibilityLabel, color, isIndeterminate, label, showPercentage, size, value, variant, min, max, testID, ...styledProps }: ProgressBarProps) => ReactElement;
6173
+ declare const ProgressBar: ({ accessibilityLabel, color, type, isIndeterminate, label, showPercentage, size, value, variant, min, max, testID, ...styledProps }: ProgressBarProps) => ReactElement;
6168
6174
 
6169
6175
  type RadioProps = {
6170
6176
  /**
@@ -737,6 +737,8 @@ declare const size: {
737
737
  readonly 5: 5;
738
738
  /** 6 px */
739
739
  readonly 6: 6;
740
+ /** 7 px */
741
+ readonly 7: 7;
740
742
  /** 8 px */
741
743
  readonly 8: 8;
742
744
  /** 10 px */
@@ -767,6 +769,8 @@ declare const size: {
767
769
  readonly 56: 56;
768
770
  /** 64 px */
769
771
  readonly 64: 64;
772
+ /** 72 px */
773
+ readonly 72: 72;
770
774
  /** 100 px */
771
775
  readonly 100: 100;
772
776
  /** 120 px */
@@ -737,6 +737,8 @@ declare const size: {
737
737
  readonly 5: 5;
738
738
  /** 6 px */
739
739
  readonly 6: 6;
740
+ /** 7 px */
741
+ readonly 7: 7;
740
742
  /** 8 px */
741
743
  readonly 8: 8;
742
744
  /** 10 px */
@@ -767,6 +769,8 @@ declare const size: {
767
769
  readonly 56: 56;
768
770
  /** 64 px */
769
771
  readonly 64: 64;
772
+ /** 72 px */
773
+ readonly 72: 72;
770
774
  /** 100 px */
771
775
  readonly 100: 100;
772
776
  /** 120 px */
@@ -0,0 +1,28 @@
1
+ import { applyTransform } from '@hypermod/utils';
2
+ import * as transformer from '..';
3
+
4
+ it('should migrate the ProgressBar component', async () => {
5
+ const result = await applyTransform(
6
+ transformer,
7
+ `
8
+ const App = () => (
9
+ <>
10
+ <ProgressBar value={20} label="Label" />
11
+ <ProgressBar variant="meter" value={20} label="Label" />
12
+ <ProgressBar variant="progress" value={20} label="Label" />
13
+ </>
14
+ );
15
+ `,
16
+ { parser: 'tsx' },
17
+ );
18
+
19
+ expect(result).toMatchInlineSnapshot(`
20
+ "const App = () => (
21
+ <>
22
+ <ProgressBar value={20} label="Label" type="progress" />
23
+ <ProgressBar type="meter" value={20} label="Label" />
24
+ <ProgressBar type="progress" value={20} label="Label" />
25
+ </>
26
+ );"
27
+ `);
28
+ });