@pega/cosmos-react-core 9.0.0-build.28.0 → 9.0.0-build.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -96,6 +96,10 @@ export type NumberRangeInputProps = WithAttributes<'fieldset', NumberProps & Pic
96
96
  fromLabel?: FormControlProps['label'];
97
97
  /** Pass a string or a fragment with an Icon and string for second part of NumberRangeInput. */
98
98
  toLabel?: FormControlProps['label'];
99
+ /** Placeholder for the first (from) input. Overrides `placeholder` for the first input. */
100
+ fromPlaceholder?: string;
101
+ /** Placeholder for the second (to) input. Overrides `placeholder` for the second input. */
102
+ toPlaceholder?: string;
99
103
  /** Pass an object with "heading" and "content" properties to show AdditionalInfo for first part of NumberRangeInput. */
100
104
  fromAdditionalInfo?: FormControlProps['additionalInfo'];
101
105
  /** Pass an object with "heading" and "content" properties to show AdditionalInfo for second part of NumberRangeInput. */
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.types.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE1F,MAAM,MAAM,WAAW,GAAG,cAAc,GACtC,UAAU,GAAG;IACX,oDAAoD;IACpD,MAAM,CAAC,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACpC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC9C,6GAA6G;IAC7G,IAAI,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAA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AE,MAAM,CAAC;IACzB,2FAA2F;IAC3F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wHAAwH;IACxH,kBAAkB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACxD,yHAAyH;IACzH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACtD,wBAAwB;IACxB,MAAM,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;CAC3B,CACJ,CAAC;AAEF,qCAAqC;AACrC,eAAO,MAAM,yBAAyB,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NumberInput.types.js","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.types.ts"],"names":[],"mappings":"AA0GA,qCAAqC;AACrC,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC","sourcesContent":["import type { Ref } from 'react';\n\nimport type { FormControlProps, HandleValue } from '../FormControl';\nimport type { Attributes, NoChildrenProp, TestIdProp, WithAttributes } from '../../types';\n\nexport type NumberProps = NoChildrenProp &\n TestIdProp & {\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /**\n * Visually hides the label region.\n * @default false\n */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Makes the component non-editable and non-clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Button when clicked will show additional information */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** Defines unit of the number, like 'kg', 'miles' or '%'. */\n unit?: string;\n /** Determines whether decimal places should be shown. The value is rounded if true.\n * @default true\n */\n showDecimal?: boolean;\n /** Determines the maximum number of decimal places. The value is rounded to the number of places.\n * @default variable NUMBER_MAX_DECIMAL_PLACES. Recommended minimum: 1.\n */\n numberOfDecimals?: number;\n /** Determines whether group separators should be shown.\n * @default true\n */\n showGroupSeparators?: boolean;\n /** The minimum value to accept for this input.\n * This value must be less than or equal to the value of the max attribute.\n * @default Number.MIN_SAFE_INTEGER\n */\n min?: number;\n /**\n * The maximum value to accept for this input.\n * This value must be greater than or equal to the value of the min attribute.\n * @default Number.MAX_SAFE_INTEGER\n */\n max?: number;\n /** A stepping interval to use when using up and down arrows to adjust the value.\n * @default 1\n */\n step?: number;\n /**\n * Component variation. Might be rendered as regular input or stepper.\n * @default 'default'\n */\n variant?: 'default' | 'stepper';\n };\n\nexport type NumberInputProps = WithAttributes<\n 'input',\n NumberProps & {\n /**\n * CurrencyInput input value.\n * Requires an onChange handler to update value.\n */\n value?: string;\n /** Callback fired when input value changes. */\n onChange: (value: string) => void;\n /** Callback fired when the component gets focus. */\n onFocus?: (value: string) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: string) => void;\n /** Callback fired when AI suggestion is accepted/rejected */\n onResolveSuggestion?: FormControlProps['onResolveSuggestion'];\n type?: never;\n defaultValue?: never;\n }\n>;\n\nexport type NumberRangeInputProps = WithAttributes<\n 'fieldset',\n NumberProps &\n Pick<Attributes<'input'>, 'placeholder'> & {\n /** Range as a tuple of start and end. */\n value?: { start?: string; end?: string };\n /** Callback for any modifications to the range */\n onChange: (value: { start: string; end: string }) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: { start: string; end: string }) => void;\n /** Callback fired when the component gets focus. */\n onFocus?: (value: { start: string; end: string }) => void;\n /** Pass a string or a fragment with an Icon and string for first part of NumberRangeInput. */\n fromLabel?: FormControlProps['label'];\n /** Pass a string or a fragment with an Icon and string for second part of NumberRangeInput. */\n toLabel?: FormControlProps['label'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for first part of NumberRangeInput. */\n fromAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for second part of NumberRangeInput. */\n toAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n }\n>;\n\n/** Maximum fraction digits is 20. */\nexport const NUMBER_MAX_DECIMAL_PLACES = 20;\n"]}
1
+ {"version":3,"file":"NumberInput.types.js","sourceRoot":"","sources":["../../../src/components/Number/NumberInput.types.ts"],"names":[],"mappings":"AA8GA,qCAAqC;AACrC,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC","sourcesContent":["import type { Ref } from 'react';\n\nimport type { FormControlProps, HandleValue } from '../FormControl';\nimport type { Attributes, NoChildrenProp, TestIdProp, WithAttributes } from '../../types';\n\nexport type NumberProps = NoChildrenProp &\n TestIdProp & {\n /** Set visual state based on a validation state. */\n status?: FormControlProps['status'];\n /** Pass a string or a fragment with an Icon and string. */\n label?: FormControlProps['label'];\n /**\n * Visually hides the label region.\n * @default false\n */\n labelHidden?: FormControlProps['labelHidden'];\n /** It is recommended to pass a simple string to offer guidance. Text will be styled based on status prop. */\n info?: FormControlProps['info'];\n /** Indicate if the field is required. The browser defaults to false. */\n required?: FormControlProps['required'];\n /** Makes the component non-editable and non-clickable. The browser defaults to false. */\n readOnly?: FormControlProps['readOnly'];\n /** Button when clicked will show additional information */\n additionalInfo?: FormControlProps['additionalInfo'];\n /** Defines unit of the number, like 'kg', 'miles' or '%'. */\n unit?: string;\n /** Determines whether decimal places should be shown. The value is rounded if true.\n * @default true\n */\n showDecimal?: boolean;\n /** Determines the maximum number of decimal places. The value is rounded to the number of places.\n * @default variable NUMBER_MAX_DECIMAL_PLACES. Recommended minimum: 1.\n */\n numberOfDecimals?: number;\n /** Determines whether group separators should be shown.\n * @default true\n */\n showGroupSeparators?: boolean;\n /** The minimum value to accept for this input.\n * This value must be less than or equal to the value of the max attribute.\n * @default Number.MIN_SAFE_INTEGER\n */\n min?: number;\n /**\n * The maximum value to accept for this input.\n * This value must be greater than or equal to the value of the min attribute.\n * @default Number.MAX_SAFE_INTEGER\n */\n max?: number;\n /** A stepping interval to use when using up and down arrows to adjust the value.\n * @default 1\n */\n step?: number;\n /**\n * Component variation. Might be rendered as regular input or stepper.\n * @default 'default'\n */\n variant?: 'default' | 'stepper';\n };\n\nexport type NumberInputProps = WithAttributes<\n 'input',\n NumberProps & {\n /**\n * CurrencyInput input value.\n * Requires an onChange handler to update value.\n */\n value?: string;\n /** Callback fired when input value changes. */\n onChange: (value: string) => void;\n /** Callback fired when the component gets focus. */\n onFocus?: (value: string) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: string) => void;\n /** Callback fired when AI suggestion is accepted/rejected */\n onResolveSuggestion?: FormControlProps['onResolveSuggestion'];\n type?: never;\n defaultValue?: never;\n }\n>;\n\nexport type NumberRangeInputProps = WithAttributes<\n 'fieldset',\n NumberProps &\n Pick<Attributes<'input'>, 'placeholder'> & {\n /** Range as a tuple of start and end. */\n value?: { start?: string; end?: string };\n /** Callback for any modifications to the range */\n onChange: (value: { start: string; end: string }) => void;\n /** Callback fired when the component loses focus. */\n onBlur?: (value: { start: string; end: string }) => void;\n /** Callback fired when the component gets focus. */\n onFocus?: (value: { start: string; end: string }) => void;\n /** Pass a string or a fragment with an Icon and string for first part of NumberRangeInput. */\n fromLabel?: FormControlProps['label'];\n /** Pass a string or a fragment with an Icon and string for second part of NumberRangeInput. */\n toLabel?: FormControlProps['label'];\n /** Placeholder for the first (from) input. Overrides `placeholder` for the first input. */\n fromPlaceholder?: string;\n /** Placeholder for the second (to) input. Overrides `placeholder` for the second input. */\n toPlaceholder?: string;\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for first part of NumberRangeInput. */\n fromAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Pass an object with \"heading\" and \"content\" properties to show AdditionalInfo for second part of NumberRangeInput. */\n toAdditionalInfo?: FormControlProps['additionalInfo'];\n /** Imperative handle */\n handle?: Ref<HandleValue>;\n }\n>;\n\n/** Maximum fraction digits is 20. */\nexport const NUMBER_MAX_DECIMAL_PLACES = 20;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NumberRangeInput.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberRangeInput.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;;;;AAGjE,wBAqHE"}
1
+ {"version":3,"file":"NumberRangeInput.d.ts","sourceRoot":"","sources":["../../../src/components/Number/NumberRangeInput.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;;;;AAGjE,wBAwHE"}
@@ -8,7 +8,7 @@ import { withTestIds, createClassName } from '../../utils';
8
8
  import HiddenText from '../HiddenText';
9
9
  import NumberInput from './NumberInput';
10
10
  import { getNumberRangeTestIds } from './Number.test-ids';
11
- export default withTestIds(forwardRef(function NumberRangeInput({ name, testId, value = {}, onChange, onBlur, onFocus, label, fromLabel, toLabel, labelHidden, placeholder, disabled, readOnly, required, status, unit, showDecimal, numberOfDecimals, showGroupSeparators, min, max, step, variant, fromAdditionalInfo, toAdditionalInfo, autoFocus, handle, className, ...restProps }, ref) {
11
+ export default withTestIds(forwardRef(function NumberRangeInput({ name, testId, value = {}, onChange, onBlur, onFocus, label, fromLabel, toLabel, labelHidden, placeholder, fromPlaceholder, toPlaceholder, disabled, readOnly, required, status, unit, showDecimal, numberOfDecimals, showGroupSeparators, min, max, step, variant, fromAdditionalInfo, toAdditionalInfo, autoFocus, handle, className, ...restProps }, ref) {
12
12
  const testIds = useTestIds(testId, getNumberRangeTestIds);
13
13
  const t = useI18n();
14
14
  const start = value.start ?? '';
@@ -20,7 +20,6 @@ export default withTestIds(forwardRef(function NumberRangeInput({ name, testId,
20
20
  useFocusWithin([containerRef], onFocusChange);
21
21
  const commonProps = {
22
22
  status,
23
- placeholder,
24
23
  readOnly,
25
24
  required,
26
25
  unit,
@@ -32,6 +31,6 @@ export default withTestIds(forwardRef(function NumberRangeInput({ name, testId,
32
31
  variant
33
32
  };
34
33
  const descriptionId = useUID();
35
- return (_jsxs(_Fragment, { children: [_jsx(FormField, { testId: testIds, as: 'fieldset', ...restProps, ref: containerRef, container: { wrap: 'nowrap' }, labelHidden: labelHidden, label: label, disabled: disabled, required: required, readOnly: readOnly, status: status, "aria-describedby": descriptionId, children: _jsxs(Flex, { container: true, as: StyledRangeInputContainer, className: createClassName('number-range-input', className), children: [_jsx(NumberInput, { testId: testIds.min, ...commonProps, value: start, onChange: fromValue => onChange({ start: fromValue, end }), label: fromLabel, "aria-label": `${t('range_from_numeric') + (label ? ` - ${label}` : '')}`, additionalInfo: fromAdditionalInfo, autoFocus: autoFocus }), _jsx(NumberInput, { testId: testIds.max, ...commonProps, value: end, onChange: toValue => onChange({ start, end: toValue }), label: toLabel, "aria-label": `${t('range_to_numeric') + (label ? ` - ${label}` : '')}`, additionalInfo: toAdditionalInfo })] }) }), _jsx(HiddenText, { id: descriptionId, children: t('range_input') })] }));
34
+ return (_jsxs(_Fragment, { children: [_jsx(FormField, { testId: testIds, as: 'fieldset', ...restProps, ref: containerRef, container: { wrap: 'nowrap' }, labelHidden: labelHidden, label: label, disabled: disabled, required: required, readOnly: readOnly, status: status, "aria-describedby": descriptionId, children: _jsxs(Flex, { container: true, as: StyledRangeInputContainer, className: createClassName('number-range-input', className), children: [_jsx(NumberInput, { testId: testIds.min, ...commonProps, placeholder: fromPlaceholder ?? placeholder, value: start, onChange: fromValue => onChange({ start: fromValue, end }), label: fromLabel, "aria-label": `${t('range_from_numeric') + (label ? ` - ${label}` : '')}`, additionalInfo: fromAdditionalInfo, autoFocus: autoFocus }), _jsx(NumberInput, { testId: testIds.max, ...commonProps, placeholder: toPlaceholder ?? placeholder, value: end, onChange: toValue => onChange({ start, end: toValue }), label: toLabel, "aria-label": `${t('range_to_numeric') + (label ? ` - ${label}` : '')}`, additionalInfo: toAdditionalInfo })] }) }), _jsx(HiddenText, { id: descriptionId, children: t('range_input') })] }));
36
35
  }), getNumberRangeTestIds);
37
36
  //# sourceMappingURL=NumberRangeInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberRangeInput.js","sourceRoot":"","sources":["../../../src/components/Number/NumberRangeInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAwB,WAAW,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAe,WAAW,CACxB,UAAU,CACR,SAAS,gBAAgB,CACvB,EACE,IAAI,EACJ,MAAM,EACN,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,MAAM,EACN,OAAO,EACP,KAAK,EACL,SAAS,EACT,OAAO,EACP,WAAW,EACX,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,GAAG,EACH,GAAG,EACH,IAAI,EACJ,OAAO,EACP,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,MAAM,EACN,SAAS,EACT,GAAG,SAAS,EACb,EACD,GAAG;IAEH,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAE1D,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;IAChC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,E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S,EAAE,GAAG,EAAE,CAAC,EAC1D,KAAK,EAAE,SAAS,gBACJ,GAAG,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EACvE,cAAc,EAAE,kBAAkB,EAClC,SAAS,EAAE,SAAS,GACpB,EACF,KAAC,WAAW,IACV,MAAM,EAAE,OAAO,CAAC,GAAG,KACf,WAAW,EACf,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EACtD,KAAK,EAAE,OAAO,gBACF,GAAG,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EACrE,cAAc,EAAE,gBAAgB,GAChC,IACG,GACG,EACZ,KAAC,UAAU,IAAC,EAAE,EAAE,aAAa,YAAG,CAAC,CAAC,aAAa,CAAC,GAAc,IAC7D,CACJ,CAAC;AACJ,CAAC,CACF,EACD,qBAAqB,CACtB,CAAC","sourcesContent":["import { forwardRef, type PropsWithoutRef, useCallback } from 'react';\n\nimport type { RefElement } from '../../types';\nimport { useConsolidatedRef, useI18n, useFocusWithin, useTestIds, useUID } from '../../hooks';\nimport { StyledRangeInputContainer } from '../Input/Input.styles';\nimport FormField from '../FormField';\nimport Flex from '../Flex';\nimport { withTestIds, createClassName } from '../../utils';\nimport HiddenText from '../HiddenText';\n\nimport NumberInput from './NumberInput';\nimport type { NumberRangeInputProps } from './NumberInput.types';\nimport { getNumberRangeTestIds } from './Number.test-ids';\n\nexport default withTestIds(\n forwardRef<RefElement<NumberRangeInputProps>, PropsWithoutRef<NumberRangeInputProps>>(\n function NumberRangeInput(\n {\n name,\n testId,\n value = {},\n onChange,\n onBlur,\n onFocus,\n label,\n fromLabel,\n toLabel,\n labelHidden,\n placeholder,\n disabled,\n readOnly,\n required,\n status,\n unit,\n showDecimal,\n numberOfDecimals,\n showGroupSeparators,\n min,\n max,\n step,\n variant,\n fromAdditionalInfo,\n toAdditionalInfo,\n autoFocus,\n handle,\n className,\n ...restProps\n },\n ref\n ) {\n const testIds = useTestIds(testId, getNumberRangeTestIds);\n\n const t = useI18n();\n\n const start = value.start ?? '';\n const end = value.end ?? '';\n\n const onFocusChange = useCallback(\n (focused: boolean) => {\n (focused ? onFocus : onBlur)?.({ start, end });\n },\n [onBlur, value.start, value.end]\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const commonProps = {\n status,\n placeholder,\n readOnly,\n required,\n unit,\n showDecimal,\n numberOfDecimals,\n showGroupSeparators,\n min,\n max,\n variant\n };\n\n const descriptionId = useUID();\n\n return (\n <>\n <FormField\n testId={testIds}\n as='fieldset'\n {...restProps}\n ref={containerRef}\n container={{ wrap: 'nowrap' }}\n labelHidden={labelHidden}\n label={label}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n status={status}\n aria-describedby={descriptionId}\n >\n <Flex\n container\n as={StyledRangeInputContainer}\n className={createClassName('number-range-input', className)}\n >\n <NumberInput\n testId={testIds.min}\n {...commonProps}\n value={start}\n onChange={fromValue => onChange({ start: fromValue, end })}\n label={fromLabel}\n aria-label={`${t('range_from_numeric') + (label ? ` - ${label}` : '')}`}\n additionalInfo={fromAdditionalInfo}\n autoFocus={autoFocus}\n />\n <NumberInput\n testId={testIds.max}\n {...commonProps}\n value={end}\n onChange={toValue => onChange({ start, end: toValue })}\n label={toLabel}\n aria-label={`${t('range_to_numeric') + (label ? ` - ${label}` : '')}`}\n additionalInfo={toAdditionalInfo}\n />\n </Flex>\n </FormField>\n <HiddenText id={descriptionId}>{t('range_input')}</HiddenText>\n </>\n );\n }\n ),\n getNumberRangeTestIds\n);\n"]}
1
+ {"version":3,"file":"NumberRangeInput.js","sourceRoot":"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AAG,EAAE,CAAC,EAC1D,KAAK,EAAE,SAAS,gBACJ,GAAG,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EACvE,cAAc,EAAE,kBAAkB,EAClC,SAAS,EAAE,SAAS,GACpB,EACF,KAAC,WAAW,IACV,MAAM,EAAE,OAAO,CAAC,GAAG,KACf,WAAW,EACf,WAAW,EAAE,aAAa,IAAI,WAAW,EACzC,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EACtD,KAAK,EAAE,OAAO,gBACF,GAAG,CAAC,CAAC,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EACrE,cAAc,EAAE,gBAAgB,GAChC,IACG,GACG,EACZ,KAAC,UAAU,IAAC,EAAE,EAAE,aAAa,YAAG,CAAC,CAAC,aAAa,CAAC,GAAc,IAC7D,CACJ,CAAC;AACJ,CAAC,CACF,EACD,qBAAqB,CACtB,CAAC","sourcesContent":["import { forwardRef, type PropsWithoutRef, useCallback } from 'react';\n\nimport type { RefElement } from '../../types';\nimport { useConsolidatedRef, useI18n, useFocusWithin, useTestIds, useUID } from '../../hooks';\nimport { StyledRangeInputContainer } from '../Input/Input.styles';\nimport FormField from '../FormField';\nimport Flex from '../Flex';\nimport { withTestIds, createClassName } from '../../utils';\nimport HiddenText from '../HiddenText';\n\nimport NumberInput from './NumberInput';\nimport type { NumberRangeInputProps } from './NumberInput.types';\nimport { getNumberRangeTestIds } from './Number.test-ids';\n\nexport default withTestIds(\n forwardRef<RefElement<NumberRangeInputProps>, PropsWithoutRef<NumberRangeInputProps>>(\n function NumberRangeInput(\n {\n name,\n testId,\n value = {},\n onChange,\n onBlur,\n onFocus,\n label,\n fromLabel,\n toLabel,\n labelHidden,\n placeholder,\n fromPlaceholder,\n toPlaceholder,\n disabled,\n readOnly,\n required,\n status,\n unit,\n showDecimal,\n numberOfDecimals,\n showGroupSeparators,\n min,\n max,\n step,\n variant,\n fromAdditionalInfo,\n toAdditionalInfo,\n autoFocus,\n handle,\n className,\n ...restProps\n },\n ref\n ) {\n const testIds = useTestIds(testId, getNumberRangeTestIds);\n\n const t = useI18n();\n\n const start = value.start ?? '';\n const end = value.end ?? '';\n\n const onFocusChange = useCallback(\n (focused: boolean) => {\n (focused ? onFocus : onBlur)?.({ start, end });\n },\n [onBlur, value.start, value.end]\n );\n\n const containerRef = useConsolidatedRef(ref);\n useFocusWithin([containerRef], onFocusChange);\n\n const commonProps = {\n status,\n readOnly,\n required,\n unit,\n showDecimal,\n numberOfDecimals,\n showGroupSeparators,\n min,\n max,\n variant\n };\n\n const descriptionId = useUID();\n\n return (\n <>\n <FormField\n testId={testIds}\n as='fieldset'\n {...restProps}\n ref={containerRef}\n container={{ wrap: 'nowrap' }}\n labelHidden={labelHidden}\n label={label}\n disabled={disabled}\n required={required}\n readOnly={readOnly}\n status={status}\n aria-describedby={descriptionId}\n >\n <Flex\n container\n as={StyledRangeInputContainer}\n className={createClassName('number-range-input', className)}\n >\n <NumberInput\n testId={testIds.min}\n {...commonProps}\n placeholder={fromPlaceholder ?? placeholder}\n value={start}\n onChange={fromValue => onChange({ start: fromValue, end })}\n label={fromLabel}\n aria-label={`${t('range_from_numeric') + (label ? ` - ${label}` : '')}`}\n additionalInfo={fromAdditionalInfo}\n autoFocus={autoFocus}\n />\n <NumberInput\n testId={testIds.max}\n {...commonProps}\n placeholder={toPlaceholder ?? placeholder}\n value={end}\n onChange={toValue => onChange({ start, end: toValue })}\n label={toLabel}\n aria-label={`${t('range_to_numeric') + (label ? ` - ${label}` : '')}`}\n additionalInfo={toAdditionalInfo}\n />\n </Flex>\n </FormField>\n <HiddenText id={descriptionId}>{t('range_input')}</HiddenText>\n </>\n );\n }\n ),\n getNumberRangeTestIds\n);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-core",
3
- "version": "9.0.0-build.28.0",
3
+ "version": "9.0.0-build.28.1",
4
4
  "description": "Cosmos is a visual design system and UI component collection. Its goal is to empower application developers in their pursuit to create engaging and rewarding user experiences.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Pegasystems",