@razorpay/blade 12.58.0 → 12.60.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 (107) hide show
  1. package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  2. package/build/lib/native/components/CounterInput/CounterInput.native.js +12 -0
  3. package/build/lib/native/components/CounterInput/CounterInput.native.js.map +1 -0
  4. package/build/lib/native/components/CounterInput/CounterInputContext.js +6 -0
  5. package/build/lib/native/components/CounterInput/CounterInputContext.js.map +1 -0
  6. package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
  7. package/build/lib/native/components/Form/FormHint.js.map +1 -1
  8. package/build/lib/native/components/Form/FormLabel.js.map +1 -1
  9. package/build/lib/native/components/Form/formTokens.js +1 -1
  10. package/build/lib/native/components/Form/formTokens.js.map +1 -1
  11. package/build/lib/native/components/Input/BaseInput/BaseInput.js +2 -1
  12. package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
  13. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +1 -1
  14. package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  15. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +2 -2
  16. package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  17. package/build/lib/native/components/Input/BaseInput/baseInputTokens.js +2 -2
  18. package/build/lib/native/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  19. package/build/lib/native/components/ProgressBar/ProgressBar.js +1 -1
  20. package/build/lib/native/components/ProgressBar/ProgressBar.js.map +1 -1
  21. package/build/lib/native/components/index.js +1 -0
  22. package/build/lib/native/components/index.js.map +1 -1
  23. package/build/lib/native/tokens/global/size.js +1 -1
  24. package/build/lib/native/tokens/global/size.js.map +1 -1
  25. package/build/lib/native/utils/metaAttribute/metaConstants.js +1 -1
  26. package/build/lib/native/utils/metaAttribute/metaConstants.js.map +1 -1
  27. package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  28. package/build/lib/web/development/components/CounterInput/CounterInput.web.js +348 -0
  29. package/build/lib/web/development/components/CounterInput/CounterInput.web.js.map +1 -0
  30. package/build/lib/web/development/components/CounterInput/CounterInputContext.js +12 -0
  31. package/build/lib/web/development/components/CounterInput/CounterInputContext.js.map +1 -0
  32. package/build/lib/web/development/components/CounterInput/StyledCounterInput.js +22 -0
  33. package/build/lib/web/development/components/CounterInput/StyledCounterInput.js.map +1 -0
  34. package/build/lib/web/development/components/CounterInput/index.js +2 -0
  35. package/build/lib/web/development/components/CounterInput/index.js.map +1 -0
  36. package/build/lib/web/development/components/CounterInput/token.js +50 -0
  37. package/build/lib/web/development/components/CounterInput/token.js.map +1 -0
  38. package/build/lib/web/development/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
  39. package/build/lib/web/development/components/Form/FormHint.js.map +1 -1
  40. package/build/lib/web/development/components/Form/FormLabel.js.map +1 -1
  41. package/build/lib/web/development/components/Form/formTokens.js +9 -0
  42. package/build/lib/web/development/components/Form/formTokens.js.map +1 -1
  43. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +13 -3
  44. package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
  45. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +2 -0
  46. package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  47. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +12 -3
  48. package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  49. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +80 -30
  50. package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  51. package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js +30 -1
  52. package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  53. package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js +1 -0
  54. package/build/lib/web/development/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
  55. package/build/lib/web/development/components/ProgressBar/ProgressBar.js +6 -2
  56. package/build/lib/web/development/components/ProgressBar/ProgressBar.js.map +1 -1
  57. package/build/lib/web/development/components/ProgressBar/ProgressBarFilled.web.js +10 -4
  58. package/build/lib/web/development/components/ProgressBar/ProgressBarFilled.web.js.map +1 -1
  59. package/build/lib/web/development/components/index.js +2 -0
  60. package/build/lib/web/development/components/index.js.map +1 -1
  61. package/build/lib/web/development/tokens/global/size.js +28 -0
  62. package/build/lib/web/development/tokens/global/size.js.map +1 -1
  63. package/build/lib/web/development/utils/metaAttribute/metaConstants.js +1 -0
  64. package/build/lib/web/development/utils/metaAttribute/metaConstants.js.map +1 -1
  65. package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
  66. package/build/lib/web/production/components/CounterInput/CounterInput.web.js +348 -0
  67. package/build/lib/web/production/components/CounterInput/CounterInput.web.js.map +1 -0
  68. package/build/lib/web/production/components/CounterInput/CounterInputContext.js +12 -0
  69. package/build/lib/web/production/components/CounterInput/CounterInputContext.js.map +1 -0
  70. package/build/lib/web/production/components/CounterInput/StyledCounterInput.js +22 -0
  71. package/build/lib/web/production/components/CounterInput/StyledCounterInput.js.map +1 -0
  72. package/build/lib/web/production/components/CounterInput/index.js +2 -0
  73. package/build/lib/web/production/components/CounterInput/index.js.map +1 -0
  74. package/build/lib/web/production/components/CounterInput/token.js +50 -0
  75. package/build/lib/web/production/components/CounterInput/token.js.map +1 -0
  76. package/build/lib/web/production/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
  77. package/build/lib/web/production/components/Form/FormHint.js.map +1 -1
  78. package/build/lib/web/production/components/Form/FormLabel.js.map +1 -1
  79. package/build/lib/web/production/components/Form/formTokens.js +9 -0
  80. package/build/lib/web/production/components/Form/formTokens.js.map +1 -1
  81. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +13 -3
  82. package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
  83. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +2 -0
  84. package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
  85. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +12 -3
  86. package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
  87. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +80 -30
  88. package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
  89. package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js +30 -1
  90. package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js.map +1 -1
  91. package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js +1 -0
  92. package/build/lib/web/production/components/Input/PhoneNumberInput/CountrySelector.web.js.map +1 -1
  93. package/build/lib/web/production/components/ProgressBar/ProgressBar.js +6 -2
  94. package/build/lib/web/production/components/ProgressBar/ProgressBar.js.map +1 -1
  95. package/build/lib/web/production/components/ProgressBar/ProgressBarFilled.web.js +10 -4
  96. package/build/lib/web/production/components/ProgressBar/ProgressBarFilled.web.js.map +1 -1
  97. package/build/lib/web/production/components/index.js +2 -0
  98. package/build/lib/web/production/components/index.js.map +1 -1
  99. package/build/lib/web/production/tokens/global/size.js +28 -0
  100. package/build/lib/web/production/tokens/global/size.js.map +1 -1
  101. package/build/lib/web/production/utils/metaAttribute/metaConstants.js +1 -0
  102. package/build/lib/web/production/utils/metaAttribute/metaConstants.js.map +1 -1
  103. package/build/types/components/index.d.ts +1052 -577
  104. package/build/types/components/index.native.d.ts +324 -254
  105. package/build/types/tokens/index.d.ts +28 -0
  106. package/build/types/tokens/index.native.d.ts +28 -0
  107. package/package.json +67 -68
@@ -0,0 +1,348 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
+ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
4
+ import React__default, { useState, useRef, useEffect, useCallback } from 'react';
5
+ import styled from 'styled-components';
6
+ import { StyledCounterInput } from './StyledCounterInput.js';
7
+ import { COUNTER_INPUT_TOKEN } from './token.js';
8
+ import { CounterInputProvider } from './CounterInputContext.js';
9
+ import '../Input/BaseInput/index.js';
10
+ import '../../utils/metaAttribute/index.js';
11
+ import '../Box/styledProps/index.js';
12
+ import '../../utils/assignWithoutSideEffects/index.js';
13
+ import '../../utils/makeAnalyticsAttribute/index.js';
14
+ import { useControllableState } from '../../utils/useControllable.js';
15
+ import { getOuterMotionRef } from '../../utils/getMotionRefs.js';
16
+ import '../Box/BaseBox/index.js';
17
+ import '../Form/index.js';
18
+ import { useFormId } from '../Form/useFormId.js';
19
+ import { useId } from '../../utils/useId.js';
20
+ import '../BladeProvider/index.js';
21
+ import '../../utils/index.js';
22
+ import '../Icons/index.js';
23
+ import '../ProgressBar/index.js';
24
+ import getIn from '../../utils/lodashButBetter/get.js';
25
+ import { mergeRefs } from '../../utils/useMergeRefs.js';
26
+ import '../../utils/getFocusRingStyles/index.js';
27
+ import { jsx, jsxs } from 'react/jsx-runtime';
28
+ import { makeSpace } from '../../utils/makeSpace/makeSpace.js';
29
+ import { castWebType } from '../../utils/platform/castUtils.js';
30
+ import { makeMotionTime } from '../../utils/makeMotionTime/makeMotionTime.web.js';
31
+ import { getFocusRingStyles } from '../../utils/getFocusRingStyles/getFocusRingStyles.web.js';
32
+ import useTheme from '../BladeProvider/useTheme.js';
33
+ import { useBreakpoint } from '../../utils/useBreakpoint/useBreakpoint.js';
34
+ import { metaAttribute } from '../../utils/metaAttribute/metaAttribute.web.js';
35
+ import { MetaConstants } from '../../utils/metaAttribute/metaConstants.js';
36
+ import { getStyledProps } from '../Box/styledProps/getStyledProps.js';
37
+ import { makeAnalyticsAttribute } from '../../utils/makeAnalyticsAttribute/makeAnalyticsAttribute.js';
38
+ import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
39
+ import { FormLabel } from '../Form/FormLabel.js';
40
+ import MinusIcon from '../Icons/MinusIcon/MinusIcon.js';
41
+ import { BaseInput } from '../Input/BaseInput/BaseInput.js';
42
+ import PlusIcon from '../Icons/PlusIcon/PlusIcon.js';
43
+ import { ProgressBar } from '../ProgressBar/ProgressBar.js';
44
+ import { assignWithoutSideEffects } from '../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
45
+
46
+ var _excluded = ["label", "accessibilityLabel", "labelPosition", "name", "value", "defaultValue", "min", "max", "emphasis", "size", "isLoading", "isDisabled", "onChange", "onFocus", "onBlur", "testID", "_motionMeta"];
47
+ 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; }
48
+ 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; }
49
+ var StyledCounterButton = /*#__PURE__*/styled.button.withConfig({
50
+ displayName: "CounterInputweb__StyledCounterButton",
51
+ componentId: "l7imdl-0"
52
+ })(["background-color:transparent;border:none;cursor:", ";display:flex;align-items:center;justify-content:center;border-radius:", "px;padding:", ";margin:", ";transition-property:background-color,color;transition-duration:", ";transition-timing-function:", ";&:focus-visible{", "}&:hover:not(:disabled){", "}"], function (props) {
53
+ return props.disabled ? 'not-allowed' : 'pointer';
54
+ }, function (_ref) {
55
+ var theme = _ref.theme;
56
+ return theme.border.radius.small;
57
+ }, function (_ref2) {
58
+ var $padding = _ref2.$padding;
59
+ return makeSpace($padding);
60
+ }, function (_ref3) {
61
+ var $margin = _ref3.$margin;
62
+ return $margin.map(function (m) {
63
+ return makeSpace(m);
64
+ }).join(' ');
65
+ }, function (_ref4) {
66
+ var theme = _ref4.theme;
67
+ return castWebType(makeMotionTime(getIn(theme.motion, 'duration.xquick')));
68
+ }, function (_ref5) {
69
+ var theme = _ref5.theme;
70
+ return getIn(theme.motion, 'easing.standard');
71
+ }, function (_ref6) {
72
+ var theme = _ref6.theme;
73
+ return getFocusRingStyles({
74
+ theme: theme,
75
+ negativeOffset: true
76
+ });
77
+ }, function (_ref7) {
78
+ var theme = _ref7.theme,
79
+ $emphasis = _ref7.$emphasis;
80
+ if ($emphasis === 'subtle') {
81
+ return "\n background-color: ".concat(theme.colors.interactive.background.gray.fadedHighlighted, " !important;\n color: ").concat(theme.colors.interactive.icon.gray.normal, " !important;\n ");
82
+ } else {
83
+ return "\n background-color: ".concat(theme.colors.interactive.background.primary.fadedHighlighted, " !important;\n color: ").concat(theme.colors.interactive.icon.primary.normal, " !important;\n ");
84
+ }
85
+ });
86
+
87
+ // Icon size mapping for counter input
88
+ var ICON_SIZE_MAP = {
89
+ xsmall: 'small',
90
+ small: 'small',
91
+ medium: 'large',
92
+ large: 'xlarge'
93
+ };
94
+ var _CounterInput = /*#__PURE__*/React__default.forwardRef(function (_ref8, ref) {
95
+ var _internalValue$toStri;
96
+ var label = _ref8.label,
97
+ accessibilityLabel = _ref8.accessibilityLabel,
98
+ _ref8$labelPosition = _ref8.labelPosition,
99
+ labelPosition = _ref8$labelPosition === void 0 ? 'top' : _ref8$labelPosition,
100
+ name = _ref8.name,
101
+ value = _ref8.value,
102
+ defaultValue = _ref8.defaultValue,
103
+ _ref8$min = _ref8.min,
104
+ min = _ref8$min === void 0 ? 0 : _ref8$min,
105
+ max = _ref8.max,
106
+ _ref8$emphasis = _ref8.emphasis,
107
+ emphasis = _ref8$emphasis === void 0 ? 'subtle' : _ref8$emphasis,
108
+ _ref8$size = _ref8.size,
109
+ size = _ref8$size === void 0 ? 'medium' : _ref8$size,
110
+ _ref8$isLoading = _ref8.isLoading,
111
+ isLoading = _ref8$isLoading === void 0 ? false : _ref8$isLoading,
112
+ _ref8$isDisabled = _ref8.isDisabled,
113
+ isDisabled = _ref8$isDisabled === void 0 ? false : _ref8$isDisabled,
114
+ _onChange = _ref8.onChange,
115
+ onFocus = _ref8.onFocus,
116
+ onBlur = _ref8.onBlur,
117
+ testID = _ref8.testID,
118
+ _motionMeta = _ref8._motionMeta,
119
+ rest = _objectWithoutProperties(_ref8, _excluded);
120
+ var _useControllableState = useControllableState({
121
+ value: value,
122
+ defaultValue: defaultValue,
123
+ onChange: function onChange(newValue) {
124
+ return _onChange === null || _onChange === void 0 ? void 0 : _onChange({
125
+ value: newValue
126
+ });
127
+ }
128
+ }),
129
+ _useControllableState2 = _slicedToArray(_useControllableState, 2),
130
+ internalValue = _useControllableState2[0],
131
+ setInternalValue = _useControllableState2[1];
132
+ var _useFormId = useFormId('counter-input'),
133
+ inputId = _useFormId.inputId;
134
+ var idBase = useId('counter-input');
135
+ var labelId = "".concat(idBase, "-label");
136
+ var _useTheme = useTheme(),
137
+ theme = _useTheme.theme;
138
+ var _useBreakpoint = useBreakpoint({
139
+ breakpoints: theme.breakpoints
140
+ }),
141
+ matchedDeviceType = _useBreakpoint.matchedDeviceType;
142
+ var isLabelLeftPositioned = labelPosition === 'left' && matchedDeviceType === 'desktop';
143
+ var emphasisTokens = COUNTER_INPUT_TOKEN.emphasis[emphasis];
144
+ var _isDisabled = isDisabled || isLoading;
145
+ var _useState = useState(''),
146
+ _useState2 = _slicedToArray(_useState, 2),
147
+ animationClass = _useState2[0],
148
+ setAnimationClass = _useState2[1];
149
+ var lastActionRef = useRef(null);
150
+ var previousValueRef = useRef(internalValue);
151
+ var containerRef = useRef(null);
152
+
153
+ // Track Tab navigation to show focus ring only on keyboard navigation (not mouse clicks)
154
+ // Note: :focus-visible doesn't work for text inputs - shows ring on both Tab and click
155
+ // TODO: Re-evaluate and remove later once focus style is unified from design
156
+ useEffect(function () {
157
+ var container = containerRef.current;
158
+ if (!container) return undefined;
159
+ var handleTabKey = function handleTabKey(event) {
160
+ if (event.key === 'Tab') {
161
+ container.classList.add('counter-input-keyboard-focus');
162
+ }
163
+ };
164
+ var handleMouseDown = function handleMouseDown() {
165
+ container.classList.remove('counter-input-keyboard-focus');
166
+ };
167
+ document.addEventListener('keydown', handleTabKey, true);
168
+ document.addEventListener('mousedown', handleMouseDown, true);
169
+ return function () {
170
+ document.removeEventListener('keydown', handleTabKey, true);
171
+ document.removeEventListener('mousedown', handleMouseDown, true);
172
+ };
173
+ }, []);
174
+
175
+ // Animation effect - triggers only when value actually changes
176
+ useEffect(function () {
177
+ // Only animate if:
178
+ // 1. We have a stored action (button was clicked)
179
+ // 2. Value actually changed from previous value
180
+ // 3. Not currently loading
181
+ if (lastActionRef.current && !isLoading && internalValue !== previousValueRef.current) {
182
+ var _animationClass = lastActionRef.current === 'increment' ? '__blade-counter-input-animate-slide-up' : '__blade-counter-input-animate-slide-down';
183
+ setAnimationClass(_animationClass);
184
+ setTimeout(function () {
185
+ return setAnimationClass('');
186
+ }, 300);
187
+ lastActionRef.current = null;
188
+ }
189
+ previousValueRef.current = internalValue;
190
+ }, [internalValue, isLoading]);
191
+ var handleInputChange = useCallback(function (_ref9) {
192
+ var inputValue = _ref9.value;
193
+ var numericValue = inputValue ? parseInt(inputValue, 10) : min;
194
+ var validValue = isNaN(numericValue) ? min : numericValue;
195
+ var constrainedValue = validValue;
196
+ if (constrainedValue < min) constrainedValue = min;
197
+ if (max !== undefined && constrainedValue > max) constrainedValue = max;
198
+ setInternalValue(function () {
199
+ return constrainedValue;
200
+ });
201
+ }, [min, max, _onChange, name]);
202
+ var handleIncrement = useCallback(function () {
203
+ if (_isDisabled) return;
204
+ var newValue = (internalValue !== null && internalValue !== void 0 ? internalValue : min) + 1;
205
+ var constrainedValue = max !== undefined ? Math.min(newValue, max) : newValue;
206
+ lastActionRef.current = 'increment';
207
+ setInternalValue(function () {
208
+ return constrainedValue;
209
+ });
210
+ }, [internalValue, min, max, _isDisabled, setInternalValue]);
211
+ var handleDecrement = useCallback(function () {
212
+ if (_isDisabled) return;
213
+ var newValue = (internalValue !== null && internalValue !== void 0 ? internalValue : min) - 1;
214
+ var constrainedValue = Math.max(newValue, min);
215
+ lastActionRef.current = 'decrement';
216
+ setInternalValue(function () {
217
+ return constrainedValue;
218
+ });
219
+ }, [internalValue, min, _isDisabled, setInternalValue]);
220
+ var isDecrementDisabled = _isDisabled || (internalValue !== null && internalValue !== void 0 ? internalValue : min) <= min;
221
+ var isIncrementDisabled = _isDisabled || max !== undefined && (internalValue !== null && internalValue !== void 0 ? internalValue : min) >= max;
222
+ var contextValue = {
223
+ size: size,
224
+ emphasis: emphasis,
225
+ isDisabled: isDisabled,
226
+ isLoading: isLoading,
227
+ color: emphasisTokens.color,
228
+ disabledTextColor: emphasisTokens.disabledColor,
229
+ isInsideCounterInput: true
230
+ };
231
+ return /*#__PURE__*/jsx(CounterInputProvider, {
232
+ value: contextValue,
233
+ children: /*#__PURE__*/jsx(StyledCounterInput, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
234
+ className: "__blade-counter-input",
235
+ "data-emphasis": emphasis,
236
+ ref: mergeRefs(getOuterMotionRef({
237
+ _motionMeta: _motionMeta,
238
+ ref: ref
239
+ }), containerRef)
240
+ }, metaAttribute({
241
+ name: MetaConstants.CounterInput,
242
+ testID: testID
243
+ })), getStyledProps(rest)), makeAnalyticsAttribute(rest)), {}, {
244
+ children: /*#__PURE__*/jsxs(BaseBox, {
245
+ display: "flex",
246
+ flexDirection: isLabelLeftPositioned ? 'row' : 'column',
247
+ alignItems: isLabelLeftPositioned ? 'center' : undefined,
248
+ children: [label && /*#__PURE__*/jsx(FormLabel, {
249
+ as: "label",
250
+ position: labelPosition,
251
+ id: labelId,
252
+ htmlFor: inputId,
253
+ size: size,
254
+ children: label
255
+ }), /*#__PURE__*/jsxs(BaseBox, {
256
+ display: "flex",
257
+ position: "relative",
258
+ alignItems: "center",
259
+ flexDirection: "column",
260
+ backgroundColor: isLoading || isDisabled ? emphasisTokens.loadingOrDisabledBgColor : emphasisTokens.backgroundColor,
261
+ width: "".concat(COUNTER_INPUT_TOKEN.width[size], "px"),
262
+ height: "".concat(COUNTER_INPUT_TOKEN.height[size], "px"),
263
+ borderRadius: "medium",
264
+ borderWidth: "thin",
265
+ borderColor: _isDisabled ? emphasisTokens.disabledBorderColor : emphasisTokens.borderColor,
266
+ children: [/*#__PURE__*/jsxs(BaseBox, {
267
+ display: "flex",
268
+ alignItems: "center",
269
+ flexDirection: "row",
270
+ children: [/*#__PURE__*/jsx(StyledCounterButton, {
271
+ className: "__blade-counter-input-decrement-button",
272
+ onClick: handleDecrement,
273
+ $padding: COUNTER_INPUT_TOKEN.iconPadding[size],
274
+ $margin: COUNTER_INPUT_TOKEN.decrementIconMargin,
275
+ $emphasis: emphasis,
276
+ "aria-label": "Decrement value",
277
+ disabled: isDecrementDisabled,
278
+ style: {
279
+ color: isDecrementDisabled ? getIn(theme.colors, emphasisTokens.disabledIconColor, '') : getIn(theme.colors, emphasisTokens.iconColor, '')
280
+ },
281
+ children: /*#__PURE__*/jsx(MinusIcon, {
282
+ size: ICON_SIZE_MAP[size],
283
+ color: "currentColor"
284
+ })
285
+ }), /*#__PURE__*/jsx(BaseBox, {
286
+ className: animationClass,
287
+ children: /*#__PURE__*/jsx(BaseInput, {
288
+ ref: ref,
289
+ id: inputId,
290
+ as: "input",
291
+ name: name,
292
+ type: "number",
293
+ componentName: MetaConstants.CounterInput,
294
+ label: "",
295
+ accessibilityLabel: accessibilityLabel,
296
+ value: (_internalValue$toStri = internalValue === null || internalValue === void 0 ? void 0 : internalValue.toString()) !== null && _internalValue$toStri !== void 0 ? _internalValue$toStri : '',
297
+ onChange: handleInputChange,
298
+ onFocus: onFocus,
299
+ onBlur: onBlur,
300
+ isDisabled: isDisabled,
301
+ size: size,
302
+ textAlign: "center"
303
+ // Accessibility attributes for spinbutton
304
+ ,
305
+ role: "spinbutton",
306
+ "aria-valuemin": min,
307
+ "aria-valuemax": max,
308
+ "aria-valuenow": internalValue !== null && internalValue !== void 0 ? internalValue : min
309
+ })
310
+ }), /*#__PURE__*/jsx(StyledCounterButton, {
311
+ className: "__blade-counter-input-increment-button",
312
+ onClick: handleIncrement,
313
+ $padding: COUNTER_INPUT_TOKEN.iconPadding[size],
314
+ $margin: COUNTER_INPUT_TOKEN.incrementIconMargin,
315
+ $emphasis: emphasis,
316
+ "aria-label": "Increment value",
317
+ disabled: isIncrementDisabled,
318
+ style: {
319
+ color: isIncrementDisabled ? getIn(theme.colors, emphasisTokens.disabledIconColor, '') : getIn(theme.colors, emphasisTokens.iconColor, '')
320
+ },
321
+ children: /*#__PURE__*/jsx(PlusIcon, {
322
+ size: ICON_SIZE_MAP[size],
323
+ color: "currentColor"
324
+ })
325
+ })]
326
+ }), isLoading && /*#__PURE__*/jsx(BaseBox, {
327
+ width: "100%",
328
+ position: "absolute",
329
+ bottom: "spacing.0",
330
+ children: /*#__PURE__*/jsx(ProgressBar, {
331
+ color: emphasisTokens.progressBarColor,
332
+ showPercentage: false,
333
+ value: 1,
334
+ isIndeterminate: true,
335
+ _oscillation: true
336
+ })
337
+ })]
338
+ })]
339
+ })
340
+ }))
341
+ });
342
+ });
343
+ var CounterInput = /*#__PURE__*/assignWithoutSideEffects(_CounterInput, {
344
+ componentId: MetaConstants.CounterInput
345
+ });
346
+
347
+ export { CounterInput };
348
+ //# sourceMappingURL=CounterInput.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CounterInput.web.js","sources":["../../../../../../src/components/CounterInput/CounterInput.web.tsx"],"sourcesContent":["import React, { useCallback, useState, useEffect, useRef } from 'react';\nimport styled from 'styled-components';\nimport type { CounterInputProps } from './types';\nimport { StyledCounterInput } from './StyledCounterInput';\nimport { COUNTER_INPUT_TOKEN } from './token';\nimport { CounterInputProvider } from './CounterInputContext';\nimport { BaseInput } from '~components/Input/BaseInput';\nimport { metaAttribute, MetaConstants } from '~utils/metaAttribute';\nimport { getStyledProps } from '~components/Box/styledProps';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { makeAnalyticsAttribute } from '~utils/makeAnalyticsAttribute';\nimport type { BladeElementRef } from '~utils/types';\nimport { useControllableState } from '~utils/useControllable';\nimport { getOuterMotionRef } from '~utils/getMotionRefs';\nimport BaseBox from '~components/Box/BaseBox';\nimport { FormLabel } from '~components/Form';\nimport { useFormId } from '~components/Form/useFormId';\nimport { useId } from '~utils/useId';\nimport { useTheme } from '~components/BladeProvider';\nimport { useBreakpoint, makeSpace, castWebType, makeMotionTime } from '~utils';\nimport { MinusIcon, PlusIcon } from '~components/Icons';\nimport { ProgressBar } from '~components/ProgressBar';\nimport get from '~utils/lodashButBetter/get';\nimport { mergeRefs } from '~utils/useMergeRefs';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\nconst StyledCounterButton = styled.button<{\n disabled?: boolean;\n $padding: number;\n $margin: readonly number[];\n $emphasis: 'subtle' | 'intense';\n}>`\n background-color: transparent;\n border: none;\n cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: ${({ theme }) => theme.border.radius.small}px;\n padding: ${({ $padding }) => makeSpace($padding)};\n margin: ${({ $margin }) => $margin.map((m) => makeSpace(m)).join(' ')};\n\n /* Transitions for smooth hover effects */\n transition-property: background-color, color;\n transition-duration: ${({ theme }) =>\n castWebType(makeMotionTime(get(theme.motion, 'duration.xquick')))};\n transition-timing-function: ${({ theme }) => get(theme.motion, 'easing.standard')};\n\n &:focus-visible {\n ${({ theme }) => getFocusRingStyles({ theme, negativeOffset: true })}\n }\n\n /* Hover styles based on emphasis */\n &:hover:not(:disabled) {\n ${({ theme, $emphasis }) => {\n if ($emphasis === 'subtle') {\n return `\n background-color: ${theme.colors.interactive.background.gray.fadedHighlighted} !important;\n color: ${theme.colors.interactive.icon.gray.normal} !important;\n `;\n } else {\n return `\n background-color: ${theme.colors.interactive.background.primary.fadedHighlighted} !important;\n color: ${theme.colors.interactive.icon.primary.normal} !important;\n `;\n }\n }}\n }\n`;\n\n// Icon size mapping for counter input\nconst ICON_SIZE_MAP = {\n xsmall: 'small',\n small: 'small',\n medium: 'large',\n large: 'xlarge',\n} as const;\n\nconst _CounterInput = React.forwardRef<BladeElementRef, CounterInputProps>(\n (\n {\n label,\n accessibilityLabel,\n labelPosition = 'top',\n name,\n value,\n defaultValue,\n min = 0,\n max,\n emphasis = 'subtle',\n size = 'medium',\n isLoading = false,\n isDisabled = false,\n onChange,\n onFocus,\n onBlur,\n testID,\n _motionMeta,\n ...rest\n },\n ref,\n ) => {\n const [internalValue, setInternalValue] = useControllableState({\n value,\n defaultValue,\n onChange: (newValue) => onChange?.({ value: newValue }),\n });\n\n const { inputId } = useFormId('counter-input');\n const idBase = useId('counter-input');\n const labelId = `${idBase}-label`;\n const { theme } = useTheme();\n const { matchedDeviceType } = useBreakpoint({ breakpoints: theme.breakpoints });\n const isLabelLeftPositioned = labelPosition === 'left' && matchedDeviceType === 'desktop';\n const emphasisTokens = COUNTER_INPUT_TOKEN.emphasis[emphasis];\n const _isDisabled = isDisabled || isLoading;\n const [animationClass, setAnimationClass] = useState('');\n const lastActionRef = useRef<'increment' | 'decrement' | null>(null);\n const previousValueRef = useRef<number | undefined>(internalValue);\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Track Tab navigation to show focus ring only on keyboard navigation (not mouse clicks)\n // Note: :focus-visible doesn't work for text inputs - shows ring on both Tab and click\n // TODO: Re-evaluate and remove later once focus style is unified from design\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return undefined;\n\n const handleTabKey = (event: KeyboardEvent): void => {\n if (event.key === 'Tab') {\n container.classList.add('counter-input-keyboard-focus');\n }\n };\n\n const handleMouseDown = (): void => {\n container.classList.remove('counter-input-keyboard-focus');\n };\n\n document.addEventListener('keydown', handleTabKey, true);\n document.addEventListener('mousedown', handleMouseDown, true);\n\n return (): void => {\n document.removeEventListener('keydown', handleTabKey, true);\n document.removeEventListener('mousedown', handleMouseDown, true);\n };\n }, []);\n\n // Animation effect - triggers only when value actually changes\n useEffect(() => {\n // Only animate if:\n // 1. We have a stored action (button was clicked)\n // 2. Value actually changed from previous value\n // 3. Not currently loading\n if (lastActionRef.current && !isLoading && internalValue !== previousValueRef.current) {\n const animationClass =\n lastActionRef.current === 'increment'\n ? '__blade-counter-input-animate-slide-up'\n : '__blade-counter-input-animate-slide-down';\n setAnimationClass(animationClass);\n setTimeout(() => setAnimationClass(''), 300);\n lastActionRef.current = null;\n }\n\n previousValueRef.current = internalValue;\n }, [internalValue, isLoading]);\n\n const handleInputChange = useCallback(\n ({ value: inputValue }: { value?: string }) => {\n const numericValue = inputValue ? parseInt(inputValue, 10) : min;\n const validValue = isNaN(numericValue) ? min : numericValue;\n\n let constrainedValue = validValue;\n if (constrainedValue < min) constrainedValue = min;\n if (max !== undefined && constrainedValue > max) constrainedValue = max;\n setInternalValue(() => constrainedValue);\n },\n [min, max, onChange, name],\n );\n\n const handleIncrement = useCallback(() => {\n if (_isDisabled) return;\n\n const newValue = (internalValue ?? min) + 1;\n const constrainedValue = max !== undefined ? Math.min(newValue, max) : newValue;\n\n lastActionRef.current = 'increment';\n setInternalValue(() => constrainedValue);\n }, [internalValue, min, max, _isDisabled, setInternalValue]);\n\n const handleDecrement = useCallback(() => {\n if (_isDisabled) return;\n\n const newValue = (internalValue ?? min) - 1;\n const constrainedValue = Math.max(newValue, min);\n\n lastActionRef.current = 'decrement';\n setInternalValue(() => constrainedValue);\n }, [internalValue, min, _isDisabled, setInternalValue]);\n\n const isDecrementDisabled = _isDisabled || (internalValue ?? min) <= min;\n const isIncrementDisabled = _isDisabled || (max !== undefined && (internalValue ?? min) >= max);\n\n const contextValue = {\n size,\n emphasis,\n isDisabled,\n isLoading,\n color: emphasisTokens.color,\n disabledTextColor: emphasisTokens.disabledColor,\n isInsideCounterInput: true,\n };\n\n return (\n <CounterInputProvider value={contextValue}>\n {/* __blade-counter-input: CSS selector for animations and component-specific styles */}\n <StyledCounterInput\n className=\"__blade-counter-input\"\n data-emphasis={emphasis}\n ref={mergeRefs(getOuterMotionRef({ _motionMeta, ref }), containerRef)}\n {...metaAttribute({ name: MetaConstants.CounterInput, testID })}\n {...getStyledProps(rest)}\n {...makeAnalyticsAttribute(rest)}\n >\n <BaseBox\n display=\"flex\"\n flexDirection={isLabelLeftPositioned ? 'row' : 'column'}\n alignItems={isLabelLeftPositioned ? 'center' : undefined}\n >\n {label && (\n <FormLabel\n as=\"label\"\n position={labelPosition}\n id={labelId}\n htmlFor={inputId}\n size={size}\n >\n {label}\n </FormLabel>\n )}\n\n <BaseBox\n display=\"flex\"\n position=\"relative\"\n alignItems=\"center\"\n flexDirection=\"column\"\n backgroundColor={\n isLoading || isDisabled\n ? emphasisTokens.loadingOrDisabledBgColor\n : emphasisTokens.backgroundColor\n }\n width={`${COUNTER_INPUT_TOKEN.width[size]}px`}\n height={`${COUNTER_INPUT_TOKEN.height[size]}px`}\n borderRadius=\"medium\"\n borderWidth=\"thin\"\n borderColor={\n _isDisabled ? emphasisTokens.disabledBorderColor : emphasisTokens.borderColor\n }\n >\n <BaseBox display=\"flex\" alignItems=\"center\" flexDirection=\"row\">\n <StyledCounterButton\n className=\"__blade-counter-input-decrement-button\"\n onClick={handleDecrement}\n $padding={COUNTER_INPUT_TOKEN.iconPadding[size]}\n $margin={COUNTER_INPUT_TOKEN.decrementIconMargin}\n $emphasis={emphasis}\n aria-label=\"Decrement value\"\n disabled={isDecrementDisabled}\n style={{\n color: isDecrementDisabled\n ? get(theme.colors, emphasisTokens.disabledIconColor, '')\n : get(theme.colors, emphasisTokens.iconColor, ''),\n }}\n >\n {/* Using currentColor allows CSS hover styles to control icon color */}\n <MinusIcon size={ICON_SIZE_MAP[size]} color=\"currentColor\" />\n </StyledCounterButton>\n\n <BaseBox className={animationClass}>\n <BaseInput\n ref={ref}\n id={inputId}\n as=\"input\"\n name={name}\n type=\"number\"\n componentName={MetaConstants.CounterInput}\n label=\"\"\n accessibilityLabel={accessibilityLabel}\n value={internalValue?.toString() ?? ''}\n onChange={handleInputChange}\n onFocus={onFocus}\n onBlur={onBlur}\n isDisabled={isDisabled}\n size={size}\n textAlign=\"center\"\n // Accessibility attributes for spinbutton\n role=\"spinbutton\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={internalValue ?? min}\n />\n </BaseBox>\n\n <StyledCounterButton\n className=\"__blade-counter-input-increment-button\"\n onClick={handleIncrement}\n $padding={COUNTER_INPUT_TOKEN.iconPadding[size]}\n $margin={COUNTER_INPUT_TOKEN.incrementIconMargin}\n $emphasis={emphasis}\n aria-label=\"Increment value\"\n disabled={isIncrementDisabled}\n style={{\n color: isIncrementDisabled\n ? get(theme.colors, emphasisTokens.disabledIconColor, '')\n : get(theme.colors, emphasisTokens.iconColor, ''),\n }}\n >\n {/* Using currentColor allows CSS hover styles to control icon color */}\n <PlusIcon size={ICON_SIZE_MAP[size]} color=\"currentColor\" />\n </StyledCounterButton>\n </BaseBox>\n {isLoading && (\n <BaseBox width=\"100%\" position=\"absolute\" bottom=\"spacing.0\">\n <ProgressBar\n color={emphasisTokens.progressBarColor}\n showPercentage={false}\n value={1}\n isIndeterminate={true}\n _oscillation={true}\n />\n </BaseBox>\n )}\n </BaseBox>\n </BaseBox>\n </StyledCounterInput>\n </CounterInputProvider>\n );\n },\n);\n\nconst CounterInput = assignWithoutSideEffects(_CounterInput, {\n componentId: MetaConstants.CounterInput,\n});\n\nexport { CounterInput };\n"],"names":["StyledCounterButton","styled","button","withConfig","displayName","componentId","props","disabled","_ref","theme","border","radius","small","_ref2","$padding","makeSpace","_ref3","$margin","map","m","join","_ref4","castWebType","makeMotionTime","get","motion","_ref5","_ref6","getFocusRingStyles","negativeOffset","_ref7","$emphasis","concat","colors","interactive","background","gray","fadedHighlighted","icon","normal","primary","ICON_SIZE_MAP","xsmall","medium","large","_CounterInput","React","forwardRef","_ref8","ref","_internalValue$toStri","label","accessibilityLabel","_ref8$labelPosition","labelPosition","name","value","defaultValue","_ref8$min","min","max","_ref8$emphasis","emphasis","_ref8$size","size","_ref8$isLoading","isLoading","_ref8$isDisabled","isDisabled","onChange","onFocus","onBlur","testID","_motionMeta","rest","_objectWithoutProperties","_excluded","_useControllableState","useControllableState","newValue","_useControllableState2","_slicedToArray","internalValue","setInternalValue","_useFormId","useFormId","inputId","idBase","useId","labelId","_useTheme","useTheme","_useBreakpoint","useBreakpoint","breakpoints","matchedDeviceType","isLabelLeftPositioned","emphasisTokens","COUNTER_INPUT_TOKEN","_isDisabled","_useState","useState","_useState2","animationClass","setAnimationClass","lastActionRef","useRef","previousValueRef","containerRef","useEffect","container","current","undefined","handleTabKey","event","key","classList","add","handleMouseDown","remove","document","addEventListener","removeEventListener","setTimeout","handleInputChange","useCallback","_ref9","inputValue","numericValue","parseInt","validValue","isNaN","constrainedValue","handleIncrement","Math","handleDecrement","isDecrementDisabled","isIncrementDisabled","contextValue","color","disabledTextColor","disabledColor","isInsideCounterInput","_jsx","CounterInputProvider","children","StyledCounterInput","_objectSpread","className","mergeRefs","getOuterMotionRef","metaAttribute","MetaConstants","CounterInput","getStyledProps","makeAnalyticsAttribute","_jsxs","BaseBox","display","flexDirection","alignItems","FormLabel","as","position","id","htmlFor","backgroundColor","loadingOrDisabledBgColor","width","height","borderRadius","borderWidth","borderColor","disabledBorderColor","onClick","iconPadding","decrementIconMargin","style","disabledIconColor","iconColor","MinusIcon","BaseInput","type","componentName","toString","textAlign","role","incrementIconMargin","PlusIcon","bottom","ProgressBar","progressBarColor","showPercentage","isIndeterminate","_oscillation","assignWithoutSideEffects"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,IAAMA,mBAAmB,gBAAGC,MAAM,CAACC,MAAM,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,sCAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAA,CAAA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ACvD1J,KAAG,CAACf,KAAK,CAACwB,MAAM,EAAEgE,cAAc,CAACkF,SAAS,EAAE,EAAE,CAAA;eAClD;cAAAlC,QAAA,eAGFF,GAAA,CAAC6C,QAAQ,EAAA;AAAC5H,gBAAAA,IAAI,EAAEvB,aAAa,CAACuB,IAAI,CAAE;AAAC2E,gBAAAA,KAAK,EAAC,cAAA;eAAgB,CAAA;AAAC,aACzC,CAAC,CAAA;AAAA,WACf,CAAC,EACTzE,SAAS,iBACR6E,GAAA,CAACc,OAAO,EAAA;AAACW,YAAAA,KAAK,EAAC,MAAM;AAACL,YAAAA,QAAQ,EAAC,UAAU;AAAC0B,YAAAA,MAAM,EAAC,WAAW;YAAA5C,QAAA,eAC1DF,GAAA,CAAC+C,WAAW,EAAA;cACVnD,KAAK,EAAE1C,cAAc,CAAC8F,gBAAiB;AACvCC,cAAAA,cAAc,EAAE,KAAM;AACtBxI,cAAAA,KAAK,EAAE,CAAE;AACTyI,cAAAA,eAAe,EAAE,IAAK;AACtBC,cAAAA,YAAY,EAAE,IAAA;aACf,CAAA;AAAC,WACK,CACV,CAAA;AAAA,SACM,CAAC,CAAA;OACH,CAAA;KACS,CAAA,CAAA;AAAC,GACD,CAAC,CAAA;AAE3B,CACF,CAAC,CAAA;AAED,IAAMzC,YAAY,gBAAG0C,wBAAwB,CAACtJ,aAAa,EAAE;EAC3DxC,WAAW,EAAEmJ,aAAa,CAACC,YAAAA;AAC7B,CAAC;;;;"}
@@ -0,0 +1,12 @@
1
+ import React__default from 'react';
2
+
3
+ var CounterInputContext = /*#__PURE__*/React__default.createContext({
4
+ isInsideCounterInput: false
5
+ });
6
+ var CounterInputProvider = CounterInputContext.Provider;
7
+ var useCounterInputContext = function useCounterInputContext() {
8
+ return React__default.useContext(CounterInputContext);
9
+ };
10
+
11
+ export { CounterInputProvider, useCounterInputContext };
12
+ //# sourceMappingURL=CounterInputContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CounterInputContext.js","sources":["../../../../../../src/components/CounterInput/CounterInputContext.tsx"],"sourcesContent":["import React from 'react';\nimport type { CounterInputContextType } from './types';\n\nconst CounterInputContext = React.createContext<CounterInputContextType>({\n isInsideCounterInput: false,\n});\nconst CounterInputProvider = CounterInputContext.Provider;\n\nconst useCounterInputContext = (): CounterInputContextType => {\n return React.useContext(CounterInputContext);\n};\n\nexport { useCounterInputContext, CounterInputProvider };\n"],"names":["CounterInputContext","React","createContext","isInsideCounterInput","CounterInputProvider","Provider","useCounterInputContext","useContext"],"mappings":";;AAGA,IAAMA,mBAAmB,gBAAGC,cAAK,CAACC,aAAa,CAA0B;AACvEC,EAAAA,oBAAoB,EAAE,KAAA;AACxB,CAAC,CAAC,CAAA;AACF,IAAMC,oBAAoB,GAAGJ,mBAAmB,CAACK,SAAQ;AAEzD,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,GAAkC;AAC5D,EAAA,OAAOL,cAAK,CAACM,UAAU,CAACP,mBAAmB,CAAC,CAAA;AAC9C;;;;"}
@@ -0,0 +1,22 @@
1
+ import styled, { keyframes, css } from 'styled-components';
2
+ import '../Box/BaseBox/index.js';
3
+ import '../../utils/getFocusRingStyles/index.js';
4
+ import { BaseBox } from '../Box/BaseBox/BaseBox.web.js';
5
+ import { getFocusRingStyles } from '../../utils/getFocusRingStyles/getFocusRingStyles.web.js';
6
+
7
+ // Keyframes for slide animations
8
+ var slideUp = /*#__PURE__*/keyframes(["0%{transform:translateY(30%);opacity:0;}100%{transform:translateY(0);opacity:1;}"]);
9
+ var slideDown = /*#__PURE__*/keyframes(["0%{transform:translateY(-30%);opacity:0;}100%{transform:translateY(0);opacity:1;}"]);
10
+ var StyledCounterInput = /*#__PURE__*/styled(BaseBox).withConfig({
11
+ displayName: "StyledCounterInput",
12
+ componentId: "ljwv28-0"
13
+ })(["&.__blade-counter-input .focus-ring-wrapper:focus-within{outline:none;}&.__blade-counter-input.counter-input-keyboard-focus .focus-ring-wrapper:focus-within{", ";}&.__blade-counter-input .__blade-base-input-wrapper{box-shadow:none;background-color:transparent !important;}&.__blade-counter-input .__blade-counter-input-animate-slide-up{animation:", " 0.3s ease-out;}&.__blade-counter-input .__blade-counter-input-animate-slide-down{animation:", " 0.3s ease-out;}&.__blade-counter-input input[type='number']::-webkit-inner-spin-button,&.__blade-counter-input input[type='number']::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}&.__blade-counter-input input[type='number']{-moz-appearance:textfield;}&.__blade-counter-input [data-blade-component='progress-bar'] .__blade-progress-bar-track{background-color:transparent !important;}"], function (_ref) {
14
+ var theme = _ref.theme;
15
+ return css(getFocusRingStyles({
16
+ theme: theme,
17
+ negativeOffset: true
18
+ }));
19
+ }, slideUp, slideDown);
20
+
21
+ export { StyledCounterInput };
22
+ //# sourceMappingURL=StyledCounterInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StyledCounterInput.js","sources":["../../../../../../src/components/CounterInput/StyledCounterInput.tsx"],"sourcesContent":["import styled, { keyframes, css } from 'styled-components';\nimport type { CSSObject } from 'styled-components';\nimport BaseBox from '~components/Box/BaseBox';\nimport { getFocusRingStyles } from '~utils/getFocusRingStyles';\n\n// Keyframes for slide animations\nconst slideUp = keyframes`\n 0% {\n transform: translateY(30%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n`;\n\nconst slideDown = keyframes`\n 0% {\n transform: translateY(-30%);\n opacity: 0;\n }\n 100% {\n transform: translateY(0);\n opacity: 1;\n }\n`;\n\nconst StyledCounterInput = styled(BaseBox)`\n /* Hide focus ring by default */\n &.__blade-counter-input .focus-ring-wrapper:focus-within {\n outline: none;\n }\n\n /* Show focus ring only during keyboard navigation */\n &.__blade-counter-input.counter-input-keyboard-focus .focus-ring-wrapper:focus-within {\n ${({ theme }) => css(getFocusRingStyles({ theme, negativeOffset: true }) as CSSObject)};\n }\n\n &.__blade-counter-input .__blade-base-input-wrapper {\n box-shadow: none;\n background-color: transparent !important;\n }\n\n /* Animation classes */\n &.__blade-counter-input .__blade-counter-input-animate-slide-up {\n animation: ${slideUp} 0.3s ease-out;\n }\n\n &.__blade-counter-input .__blade-counter-input-animate-slide-down {\n animation: ${slideDown} 0.3s ease-out;\n }\n\n /* Hide number input arrows */\n &.__blade-counter-input input[type='number']::-webkit-inner-spin-button,\n &.__blade-counter-input input[type='number']::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n &.__blade-counter-input input[type='number'] {\n -moz-appearance: textfield; /* Firefox */\n }\n\n /* Remove ProgressBar background */\n &.__blade-counter-input [data-blade-component='progress-bar'] .__blade-progress-bar-track {\n background-color: transparent !important;\n }\n`;\n\nexport { StyledCounterInput };\n"],"names":["slideUp","keyframes","slideDown","StyledCounterInput","styled","BaseBox","withConfig","displayName","componentId","_ref","theme","css","getFocusRingStyles","negativeOffset"],"mappings":";;;;;;AAKA;AACA,IAAMA,OAAO,gBAAGC,SAAS,CASxB,CAAA,kFAAA,CAAA,CAAA,CAAA;AAED,IAAMC,SAAS,gBAAGD,SAAS,CAS1B,CAAA,mFAAA,CAAA,CAAA,CAAA;AAED,IAAME,kBAAkB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,oBAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAAA,CAAA,+JAAA,EAAA,2LAAA,EAAA,8FAAA,EAAA,+YAAA,CAAA,EAQpC,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,KAAK,GAAAD,IAAA,CAALC,KAAK,CAAA;EAAA,OAAOC,GAAG,CAACC,kBAAkB,CAAC;AAAEF,IAAAA,KAAK,EAALA,KAAK;AAAEG,IAAAA,cAAc,EAAE,IAAA;AAAK,GAAC,CAAc,CAAC,CAAA;AAAA,CAUzEb,EAAAA,OAAO,EAIPE,SAAS;;;;"}
@@ -0,0 +1,2 @@
1
+ export { CounterInput } from './CounterInput.web.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,50 @@
1
+ import '../../tokens/global/index.js';
2
+ import { size } from '../../tokens/global/size.js';
3
+ import { spacing } from '../../tokens/global/spacing.js';
4
+
5
+ var COUNTER_INPUT_TOKEN = {
6
+ width: {
7
+ xsmall: size[78],
8
+ medium: size[94],
9
+ large: size[122]
10
+ },
11
+ height: {
12
+ xsmall: size[30],
13
+ medium: size[38],
14
+ large: size[50]
15
+ },
16
+ decrementIconMargin: [spacing[2], spacing[0], spacing[2], spacing[2]],
17
+ incrementIconMargin: [spacing[2], spacing[2], spacing[2], spacing[0]],
18
+ iconPadding: {
19
+ xsmall: spacing[2],
20
+ medium: spacing[2],
21
+ large: spacing[3]
22
+ },
23
+ emphasis: {
24
+ subtle: {
25
+ color: 'surface.text.gray.subtle',
26
+ disabledColor: 'surface.text.gray.disabled',
27
+ iconColor: 'interactive.icon.gray.subtle',
28
+ disabledIconColor: 'interactive.icon.gray.disabled',
29
+ borderColor: 'interactive.border.gray.default',
30
+ disabledBorderColor: 'interactive.border.gray.default',
31
+ backgroundColor: 'surface.background.gray.intense',
32
+ loadingOrDisabledBgColor: 'surface.background.gray.subtle',
33
+ progressBarColor: 'neutral'
34
+ },
35
+ intense: {
36
+ color: 'interactive.text.primary.subtle',
37
+ disabledColor: 'interactive.text.primary.disabled',
38
+ iconColor: 'interactive.icon.primary.subtle',
39
+ disabledIconColor: 'interactive.icon.primary.disabled',
40
+ borderColor: 'interactive.border.primary.highlighted',
41
+ disabledBorderColor: 'interactive.border.primary.disabled',
42
+ backgroundColor: 'surface.background.gray.intense',
43
+ loadingOrDisabledBgColor: 'surface.background.gray.subtle',
44
+ progressBarColor: undefined
45
+ }
46
+ }
47
+ };
48
+
49
+ export { COUNTER_INPUT_TOKEN };
50
+ //# sourceMappingURL=token.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.js","sources":["../../../../../../src/components/CounterInput/token.ts"],"sourcesContent":["import { size as sizeTokens, spacing } from '~tokens/global';\n\nexport const COUNTER_INPUT_TOKEN = {\n width: {\n xsmall: sizeTokens[78],\n medium: sizeTokens[94],\n large: sizeTokens[122],\n },\n height: {\n xsmall: sizeTokens[30],\n medium: sizeTokens[38],\n large: sizeTokens[50],\n },\n\n decrementIconMargin: [spacing[2], spacing[0], spacing[2], spacing[2]],\n incrementIconMargin: [spacing[2], spacing[2], spacing[2], spacing[0]],\n\n iconPadding: {\n xsmall: spacing[2],\n medium: spacing[2],\n large: spacing[3],\n },\n\n emphasis: {\n subtle: {\n color: 'surface.text.gray.subtle',\n disabledColor: 'surface.text.gray.disabled',\n iconColor: 'interactive.icon.gray.subtle',\n disabledIconColor: 'interactive.icon.gray.disabled',\n borderColor: 'interactive.border.gray.default',\n disabledBorderColor: 'interactive.border.gray.default',\n backgroundColor: 'surface.background.gray.intense',\n loadingOrDisabledBgColor: 'surface.background.gray.subtle',\n progressBarColor: 'neutral',\n },\n intense: {\n color: 'interactive.text.primary.subtle',\n disabledColor: 'interactive.text.primary.disabled',\n iconColor: 'interactive.icon.primary.subtle',\n disabledIconColor: 'interactive.icon.primary.disabled',\n borderColor: 'interactive.border.primary.highlighted',\n disabledBorderColor: 'interactive.border.primary.disabled',\n backgroundColor: 'surface.background.gray.intense',\n loadingOrDisabledBgColor: 'surface.background.gray.subtle',\n progressBarColor: undefined,\n },\n },\n} as const;\n"],"names":["COUNTER_INPUT_TOKEN","width","xsmall","sizeTokens","medium","large","height","decrementIconMargin","spacing","incrementIconMargin","iconPadding","emphasis","subtle","color","disabledColor","iconColor","disabledIconColor","borderColor","disabledBorderColor","backgroundColor","loadingOrDisabledBgColor","progressBarColor","intense","undefined"],"mappings":";;;;AAEO,IAAMA,mBAAmB,GAAG;AACjCC,EAAAA,KAAK,EAAE;AACLC,IAAAA,MAAM,EAAEC,IAAU,CAAC,EAAE,CAAC;AACtBC,IAAAA,MAAM,EAAED,IAAU,CAAC,EAAE,CAAC;IACtBE,K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BAAiB,EAAE,mCAAmC;AACtDC,MAAAA,WAAW,EAAE,wCAAwC;AACrDC,MAAAA,mBAAmB,EAAE,qCAAqC;AAC1DC,MAAAA,eAAe,EAAE,iCAAiC;AAClDC,MAAAA,wBAAwB,EAAE,gCAAgC;AAC1DC,MAAAA,gBAAgB,EAAEE,SAAAA;AACpB,KAAA;AACF,GAAA;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CharacterCounter.js","sources":["../../../../../../../src/components/Form/CharacterCounter/CharacterCounter.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { hintTextSize } from '../formTokens';\nimport { Text } from '~components/Typography';\n\ntype CharacterCounterProps = {\n currentCount: number;\n maxCount: number;\n size?: 'medium' | 'large';\n};\n\nexport const CharacterCounter = ({\n currentCount,\n maxCount,\n size = 'medium',\n}: CharacterCounterProps): ReactElement => (\n <Text\n variant=\"caption\"\n size={hintTextSize[size]}\n weight=\"regular\"\n color=\"surface.text.gray.muted\"\n >\n {currentCount}/{maxCount}\n </Text>\n);\n"],"names":["CharacterCounter","_ref","currentCount","maxCount","_ref$size","size","_jsxs","Text","variant","hintTextSize","weight","color","children"],"mappings":";;;;;IAUaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAC3BC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IACZC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAAC,SAAA,GAAAH,IAAA,CACRI,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,SAAA,CAAA;EAAA,oBAEfE,IAAA,CAACC,IAAI,EAAA;AACHC,IAAAA,OAAO,EAAC,SAAS;AACjBH,IAAAA,IAAI,EAAEI,YAAY,CAACJ,IAAI,CAAE;AACzBK,IAAAA,MAAM,EAAC,SAAS;AAChBC,IAAAA,KAAK,EAAC,yBAAyB;AAAAC,IAAAA,QAAA,EAE9BV,CAAAA,YAAY,EAAC,GAAC,EAACC,QAAQ,CAAA;AAAA,GACpB,CAAC,CAAA;AAAA;;;;"}
1
+ {"version":3,"file":"CharacterCounter.js","sources":["../../../../../../../src/components/Form/CharacterCounter/CharacterCounter.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { hintTextSize } from '../formTokens';\nimport { Text } from '~components/Typography';\n\ntype CharacterCounterProps = {\n currentCount: number;\n maxCount: number;\n size?: 'xsmall' | 'medium' | 'large';\n};\n\nexport const CharacterCounter = ({\n currentCount,\n maxCount,\n size = 'medium',\n}: CharacterCounterProps): ReactElement => (\n <Text\n variant=\"caption\"\n size={hintTextSize[size]}\n weight=\"regular\"\n color=\"surface.text.gray.muted\"\n >\n {currentCount}/{maxCount}\n </Text>\n);\n"],"names":["CharacterCounter","_ref","currentCount","maxCount","_ref$size","size","_jsxs","Text","variant","hintTextSize","weight","color","children"],"mappings":";;;;;IAUaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAC3BC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IACZC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAAC,SAAA,GAAAH,IAAA,CACRI,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,QAAQ,GAAAA,SAAA,CAAA;EAAA,oBAEfE,IAAA,CAACC,IAAI,EAAA;AACHC,IAAAA,OAAO,EAAC,SAAS;AACjBH,IAAAA,IAAI,EAAEI,YAAY,CAACJ,IAAI,CAAE;AACzBK,IAAAA,MAAM,EAAC,SAAS;AAChBC,IAAAA,KAAK,EAAC,yBAAyB;AAAAC,IAAAA,QAAA,EAE9BV,CAAAA,YAAY,EAAC,GAAC,EAACC,QAAQ,CAAA;AAAA,GACpB,CAAC,CAAA;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"FormHint.js","sources":["../../../../../../src/components/Form/FormHint.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { FormHintWrapper } from './FormHintWrapper';\nimport { hintIconSize, hintMarginTop, hintTextSize } from './formTokens';\nimport type { TextProps } from '~components/Typography/Text';\nimport { Text } from '~components/Typography/Text';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { CheckIcon, InfoIcon } from '~components/Icons';\nimport { getPlatformType } from '~utils/getPlatformType';\nimport { Box } from '~components/Box';\n\ntype HintTextProps = {\n icon?: IconComponent;\n children: string;\n id?: string;\n color: TextProps<{ variant: 'caption' }>['color'];\n size: 'small' | 'medium' | 'large';\n};\n\nconst HintText = ({ icon: Icon, children, id, color, size }: HintTextProps): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox marginTop={hintMarginTop[size]} id={id}>\n <FormHintWrapper>\n {Icon ? (\n // offset block element 2px down to align with text\n <Box flexShrink={0} marginTop=\"spacing.1\">\n <Icon />\n </Box>\n ) : null}\n <Text\n as={isReactNative ? undefined : 'span'}\n color={color}\n size={hintTextSize[size]}\n variant=\"caption\"\n wordBreak=\"break-word\"\n >\n {children}\n </Text>\n </FormHintWrapper>\n </BaseBox>\n );\n};\n\nexport type FormHintProps = {\n type: 'help' | 'error' | 'success';\n /**\n * Help text for the group\n */\n helpText?: string;\n /**\n * Error text for the group\n *\n * Renders when `state` is set to 'error'\n */\n errorText?: string;\n /**\n * Success text for the group\n *\n * Renders when `state` is set to 'success'\n */\n successText?: string;\n /**\n * Sets the id on errorText.\n * Needed for accessibility reasons.\n */\n errorTextId?: string;\n /**\n * Sets the id on helpText.\n * Needed for accessibility reasons.\n */\n helpTextId?: string;\n /**\n * Sets the id on successText.\n * Needed for accessibility reasons.\n */\n successTextId?: string;\n /**\n * Sets the size of the hint\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n};\n\nconst Icons = {\n error: ({ size }: { size: 'small' | 'medium' | 'large' }): ReactElement => (\n <InfoIcon\n display={'block' as never}\n color=\"feedback.icon.negative.intense\"\n size={hintIconSize[size]}\n />\n ),\n success: ({ size }: { size: 'small' | 'medium' | 'large' }): ReactElement => (\n <CheckIcon\n display={'block' as never}\n color=\"feedback.icon.positive.intense\"\n size={hintIconSize[size]}\n />\n ),\n};\n\nconst FormHint = ({\n type,\n helpText,\n errorText,\n successText,\n helpTextId,\n errorTextId,\n successTextId,\n size = 'medium',\n}: FormHintProps): React.ReactElement => {\n const colors: Record<string, TextProps<{ variant: 'caption' }>['color']> = {\n help: 'surface.text.gray.muted',\n error: 'feedback.text.negative.intense',\n success: 'feedback.text.positive.intense',\n };\n\n const showError = type === 'error' && errorText;\n const showSuccess = type === 'success' && successText;\n const showHelp = !showError && !showSuccess && helpText;\n\n return (\n <>\n {showHelp && (\n <HintText size={size} id={helpTextId} color={colors.help}>\n {helpText}\n </HintText>\n )}\n\n {showError && (\n <HintText\n size={size}\n id={errorTextId}\n icon={() => Icons.error({ size })}\n color={colors.error}\n >\n {errorText}\n </HintText>\n )}\n\n {showSuccess && (\n <HintText\n size={size}\n id={successTextId}\n icon={() => Icons.success({ size })}\n color={colors.success}\n >\n {successText}\n </HintText>\n )}\n </>\n );\n};\n\nexport { FormHint };\n"],"names":["HintText","_ref","Icon","icon","children","id","color","size","isReactNative","getPlatformType","_jsx","BaseBox","marginTop","hintMarginTop","_jsxs","FormHintWrapper","Box","flexShrink","Text","as","undefined","hintTextSize","variant","wordBreak","Icons","error","_ref2","InfoIcon","display","hintIconSize","success","_ref3","CheckIcon","FormHint","_ref4","type","helpText","errorText","successText","helpTextId","errorTextId","successTextId","_ref4$size","colors","help","showError","showSuccess","showHelp","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AAAA;;AAqBA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAA+E;AAAA,EAAA,IAAnEC,IAAI,GAAAD,IAAA,CAAVE,IAAI;IAAQC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,EAAE,G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AAA,EAAA;AAAA5C,IAAAA,QAAA,EACG2C,CAAAA,QAAQ,iBACPrC,GAAA,CAACV,QAAQ,EAAA;AAACO,MAAAA,IAAI,EAAEA,IAAK;AAACF,MAAAA,EAAE,EAAEkC,UAAW;MAACjC,KAAK,EAAEqC,MAAM,CAACC,IAAK;AAAAxC,MAAAA,QAAA,EACtDgC,QAAAA;AAAQ,KACD,CACX,EAEAS,SAAS,iBACRnC,GAAA,CAACV,QAAQ,EAAA;AACPO,MAAAA,IAAI,EAAEA,IAAK;AACXF,MAAAA,EAAE,EAAEmC,WAAY;MAChBrC,IAAI,EAAE,SAANA,IAAIA,GAAA;QAAA,OAAQqB,KAAK,CAACC,KAAK,CAAC;AAAElB,UAAAA,IAAI,EAAJA,IAAAA;AAAK,SAAC,CAAC,CAAA;OAAC;MAClCD,KAAK,EAAEqC,MAAM,CAAClB,KAAM;AAAArB,MAAAA,QAAA,EAEnBiC,SAAAA;AAAS,KACF,CACX,EAEAS,WAAW,iBACVpC,GAAA,CAACV,QAAQ,EAAA;AACPO,MAAAA,IAAI,EAAEA,IAAK;AACXF,MAAAA,EAAE,EAAEoC,aAAc;MAClBtC,IAAI,EAAE,SAANA,IAAIA,GAAA;QAAA,OAAQqB,KAAK,CAACM,OAAO,CAAC;AAAEvB,UAAAA,IAAI,EAAJA,IAAAA;AAAK,SAAC,CAAC,CAAA;OAAC;MACpCD,KAAK,EAAEqC,MAAM,CAACb,OAAQ;AAAA1B,MAAAA,QAAA,EAErBkC,WAAAA;AAAW,KACJ,CACX,CAAA;AAAA,GACD,CAAC,CAAA;AAEP;;;;"}
1
+ {"version":3,"file":"FormHint.js","sources":["../../../../../../src/components/Form/FormHint.tsx"],"sourcesContent":["/* eslint-disable react/display-name */\nimport type { ReactElement } from 'react';\nimport React from 'react';\nimport { FormHintWrapper } from './FormHintWrapper';\nimport { hintIconSize, hintMarginTop, hintTextSize } from './formTokens';\nimport type { TextProps } from '~components/Typography/Text';\nimport { Text } from '~components/Typography/Text';\nimport BaseBox from '~components/Box/BaseBox';\nimport type { IconComponent } from '~components/Icons';\nimport { CheckIcon, InfoIcon } from '~components/Icons';\nimport { getPlatformType } from '~utils/getPlatformType';\nimport { Box } from '~components/Box';\n\ntype HintTextProps = {\n icon?: IconComponent;\n children: string;\n id?: string;\n color: TextProps<{ variant: 'caption' }>['color'];\n size: 'xsmall' | 'small' | 'medium' | 'large';\n};\n\nconst HintText = ({ icon: Icon, children, id, color, size }: HintTextProps): ReactElement => {\n const isReactNative = getPlatformType() === 'react-native';\n\n return (\n <BaseBox marginTop={hintMarginTop[size]} id={id}>\n <FormHintWrapper>\n {Icon ? (\n // offset block element 2px down to align with text\n <Box flexShrink={0} marginTop=\"spacing.1\">\n <Icon />\n </Box>\n ) : null}\n <Text\n as={isReactNative ? undefined : 'span'}\n color={color}\n size={hintTextSize[size]}\n variant=\"caption\"\n wordBreak=\"break-word\"\n >\n {children}\n </Text>\n </FormHintWrapper>\n </BaseBox>\n );\n};\n\nexport type FormHintProps = {\n type: 'help' | 'error' | 'success';\n /**\n * Help text for the group\n */\n helpText?: string;\n /**\n * Error text for the group\n *\n * Renders when `state` is set to 'error'\n */\n errorText?: string;\n /**\n * Success text for the group\n *\n * Renders when `state` is set to 'success'\n */\n successText?: string;\n /**\n * Sets the id on errorText.\n * Needed for accessibility reasons.\n */\n errorTextId?: string;\n /**\n * Sets the id on helpText.\n * Needed for accessibility reasons.\n */\n helpTextId?: string;\n /**\n * Sets the id on successText.\n * Needed for accessibility reasons.\n */\n successTextId?: string;\n /**\n * Sets the size of the hint\n * @default medium\n */\n size?: 'xsmall' | 'small' | 'medium' | 'large';\n};\n\nconst Icons = {\n error: ({ size }: { size: 'xsmall' | 'small' | 'medium' | 'large' }): ReactElement => (\n <InfoIcon\n display={'block' as never}\n color=\"feedback.icon.negative.intense\"\n size={hintIconSize[size]}\n />\n ),\n success: ({ size }: { size: 'xsmall' | 'small' | 'medium' | 'large' }): ReactElement => (\n <CheckIcon\n display={'block' as never}\n color=\"feedback.icon.positive.intense\"\n size={hintIconSize[size]}\n />\n ),\n};\n\nconst FormHint = ({\n type,\n helpText,\n errorText,\n successText,\n helpTextId,\n errorTextId,\n successTextId,\n size = 'medium',\n}: FormHintProps): React.ReactElement => {\n const colors: Record<string, TextProps<{ variant: 'caption' }>['color']> = {\n help: 'surface.text.gray.muted',\n error: 'feedback.text.negative.intense',\n success: 'feedback.text.positive.intense',\n };\n\n const showError = type === 'error' && errorText;\n const showSuccess = type === 'success' && successText;\n const showHelp = !showError && !showSuccess && helpText;\n\n return (\n <>\n {showHelp && (\n <HintText size={size} id={helpTextId} color={colors.help}>\n {helpText}\n </HintText>\n )}\n\n {showError && (\n <HintText\n size={size}\n id={errorTextId}\n icon={() => Icons.error({ size })}\n color={colors.error}\n >\n {errorText}\n </HintText>\n )}\n\n {showSuccess && (\n <HintText\n size={size}\n id={successTextId}\n icon={() => Icons.success({ size })}\n color={colors.success}\n >\n {successText}\n </HintText>\n )}\n </>\n );\n};\n\nexport { FormHint };\n"],"names":["HintText","_ref","Icon","icon","children","id","color","size","isReactNative","getPlatformType","_jsx","BaseBox","marginTop","hintMarginTop","_jsxs","FormHintWrapper","Box","flexShrink","Text","as","undefined","hintTextSize","variant","wordBreak","Icons","error","_ref2","InfoIcon","display","hintIconSize","success","_ref3","CheckIcon","FormHint","_ref4","type","helpText","errorText","successText","helpTextId","errorTextId","successTextId","_ref4$size","colors","help","showError","showSuccess","showHelp","_Fragment"],"mappings":";;;;;;;;;;;;;;;;AAAA;;AAqBA,IAAMA,QAAQ,GAAG,SAAXA,QAAQA,CAAAC,IAAA,EAA+E;AAAA,EAAA,IAAnEC,IAAI,GAAAD,IAAA,CAAVE,IAAI;IAAQC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAEC,EAAE,GAAAJ,IAAA,CAAFI,EAAE;IAAEC,KAAK,GAAAL,IAAA,CAALK,KAAK;IAAEC,IAAI,GAAAN,IAAA,CAAJM,IAAI,CAAA;AACvD,EAAA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