@commercelayer/app-elements 0.0.47 → 0.0.48

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.
@@ -30,6 +30,14 @@ export interface InputCurrencyProps extends InputWrapperBaseProps, Pick<Currency
30
30
  * onChange callback triggered when during typing
31
31
  */
32
32
  onChange: (cents: number | null, formatted: string) => void;
33
+ /**
34
+ * hide currency symbol but keep the currency formatting
35
+ */
36
+ hideCurrencySymbol?: boolean;
37
+ /**
38
+ * show (X) button to clear the input
39
+ */
40
+ isClearable?: boolean;
33
41
  }
34
42
  declare const InputCurrency: import("react").ForwardRefExoticComponent<InputCurrencyProps & import("react").RefAttributes<HTMLInputElement>>;
35
43
  /**
@@ -40,5 +48,5 @@ declare const InputCurrency: import("react").ForwardRefExoticComponent<InputCurr
40
48
  * Example: formatCentsToCurrency(100000, 'USD') -> $1,000.00
41
49
  * Example: formatCentsToCurrency(100, 'JPY') -> ¥100
42
50
  **/
43
- declare function formatCentsToCurrency(cents: number, currencyCode: Uppercase<CurrencyCode>): string;
51
+ declare function formatCentsToCurrency(cents: number, currencyCode: Uppercase<CurrencyCode>, stripZeroDecimals?: boolean): string;
44
52
  export { InputCurrency, formatCentsToCurrency };
@@ -0,0 +1,24 @@
1
+ import { type CurrencyCode } from '../forms/InputCurrency/currencies';
2
+ import { type InputCurrencyProps } from '../forms/InputCurrency/index';
3
+ import { type InputWrapperBaseProps } from '../internals/InputWrapper';
4
+ type Cents = InputCurrencyProps['cents'];
5
+ export interface InputCurrencyRangeProps extends InputWrapperBaseProps {
6
+ fromCents?: Cents;
7
+ toCents?: Cents;
8
+ onChange: (from: {
9
+ cents: Cents;
10
+ formatted: string;
11
+ }, to: {
12
+ cents: Cents;
13
+ formatted: string;
14
+ }, currency: Uppercase<CurrencyCode>) => void;
15
+ placeholders?: [string, string];
16
+ currencyList: Array<Uppercase<CurrencyCode>>;
17
+ defaultCurrency?: Uppercase<CurrencyCode>;
18
+ className?: string;
19
+ }
20
+ declare function InputCurrencyRange({ fromCents, toCents, placeholders, onChange, label, hint, currencyList, defaultCurrency, className, feedback }: InputCurrencyRangeProps): JSX.Element;
21
+ declare namespace InputCurrencyRange {
22
+ var displayName: string;
23
+ }
24
+ export { InputCurrencyRange };
@@ -4,6 +4,15 @@ export interface InputSpinnerProps extends InputWrapperBaseProps, Omit<React.Inp
4
4
  max?: number;
5
5
  defaultValue?: number;
6
6
  onChange: (value: number) => void;
7
+ /**
8
+ * When true the input will not be editable by keyboard, but quantity can be changed only via buttons.
9
+ * Plus keyboard will not be displayed on mobile devices and the input will not be tabbable/focusable, but only the buttons will be.
10
+ */
11
+ disableKeyboard?: boolean;
12
+ /**
13
+ * Makes the entire component disabled, quantity cannot be changed in any way
14
+ */
15
+ disabled?: boolean;
7
16
  }
8
17
  declare const InputSpinner: import("react").ForwardRefExoticComponent<InputSpinnerProps & import("react").RefAttributes<HTMLInputElement>>;
9
18
  export { InputSpinner };
@@ -23,7 +23,7 @@ export interface InputWrapperProps extends InputWrapperBaseProps {
23
23
  */
24
24
  className?: string;
25
25
  name?: string;
26
- children: JSX.Element | JSX.Element[];
26
+ children: React.ReactNode;
27
27
  }
28
28
  declare function InputWrapper({ label, children, className, hint, feedback, name, ...rest }: InputWrapperProps): JSX.Element;
29
29
  declare namespace InputWrapper {
@@ -9,10 +9,10 @@ export declare function getShipmentRate(shipment: Shipment): Rate | undefined;
9
9
  */
10
10
  export declare function hasSingleTracking(shipment: Shipment): boolean;
11
11
  /**
12
- * Check whether the `shipment` has tracking information or not.
12
+ * Check whether the `shipment` has been purchased.
13
13
  * @param shipment Shipment
14
14
  */
15
- export declare function hasTracking(shipment: Shipment): boolean;
15
+ export declare function hasBeenPurchased(shipment: Shipment): boolean;
16
16
  /**
17
17
  * @docs https://www.easypost.com/docs/api#tracking-detail-object
18
18
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/app-elements",
3
- "version": "0.0.47",
3
+ "version": "0.0.48",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"