@commercelayer/app-elements 0.0.47 → 0.0.49
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.
- package/dist/{Async-4ea0105b.js → Async-4a93f698.js} +2 -2
- package/dist/{InputDateComponent-337c508d.js → InputDateComponent-6b6ebd0d.js} +1 -1
- package/dist/{Select-67da9837.js → Select-802724c2.js} +2 -2
- package/dist/{main-5d65fb17.js → main-06ca7511.js} +5649 -5309
- package/dist/main.d.ts +3 -0
- package/dist/main.js +95 -92
- package/dist/{overrides-5527bed4.js → overrides-8c00025b.js} +286 -286
- package/dist/style.css +1 -1
- package/dist/ui/atoms/Card.d.ts +268 -7
- package/dist/ui/forms/InputCheckbox.d.ts +2 -3
- package/dist/ui/forms/InputCheckboxGroup.d.ts +56 -0
- package/dist/ui/forms/InputCurrency/index.d.ts +9 -1
- package/dist/ui/forms/InputCurrencyRange.d.ts +24 -0
- package/dist/ui/forms/InputRadioGroup.d.ts +43 -0
- package/dist/ui/forms/InputSpinner.d.ts +9 -0
- package/dist/ui/forms/RadioButtons.d.ts +4 -2
- package/dist/ui/internals/InputWrapper.d.ts +1 -1
- package/dist/ui/lists/ListItem.d.ts +10 -2
- package/dist/utils/tracking.d.ts +2 -2
- package/package.json +1 -1
|
@@ -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
|
|
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 };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface OptionItem {
|
|
3
|
+
/**
|
|
4
|
+
* Item identifier, must be unique and will be used for the onChange callback
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Item content to be displayed in the central section of the row
|
|
9
|
+
*/
|
|
10
|
+
content: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface InputRadioGroupProps {
|
|
13
|
+
/**
|
|
14
|
+
* Input name, will be used to set the html name for all radios
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* List of options to render as radio
|
|
19
|
+
*/
|
|
20
|
+
options: OptionItem[];
|
|
21
|
+
/**
|
|
22
|
+
* Default value
|
|
23
|
+
*/
|
|
24
|
+
defaultValue?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Callback triggered when the user update the selection
|
|
27
|
+
*/
|
|
28
|
+
onChange?: (selected: string | undefined) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Show input element
|
|
31
|
+
*/
|
|
32
|
+
showInput?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Define the `flex-direction`
|
|
35
|
+
* @default 'column'
|
|
36
|
+
*/
|
|
37
|
+
direction?: 'column' | 'row';
|
|
38
|
+
}
|
|
39
|
+
declare function InputRadioGroup({ name, options, defaultValue, onChange, showInput, direction }: InputRadioGroupProps): JSX.Element;
|
|
40
|
+
declare namespace InputRadioGroup {
|
|
41
|
+
var displayName: string;
|
|
42
|
+
}
|
|
43
|
+
export { InputRadioGroup };
|
|
@@ -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 };
|
|
@@ -13,5 +13,7 @@ export interface RadioButtonsProps extends InputWrapperBaseProps {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
onBlur?: InputHTMLAttributes<HTMLInputElement>['onBlur'];
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
*/
|
|
19
|
+
export declare const RadioButtons: import("react").ForwardRefExoticComponent<RadioButtonsProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -23,7 +23,7 @@ export interface InputWrapperProps extends InputWrapperBaseProps {
|
|
|
23
23
|
*/
|
|
24
24
|
className?: string;
|
|
25
25
|
name?: string;
|
|
26
|
-
children:
|
|
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 {
|
|
@@ -7,11 +7,19 @@ type Props = Pick<FlexRowProps, 'alignItems' | 'children'> & {
|
|
|
7
7
|
*/
|
|
8
8
|
icon?: JSX.Element;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Icon alignment
|
|
11
|
+
* @default 'top'
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
alignIcon?: 'top' | 'center' | 'bottom';
|
|
14
|
+
/**
|
|
15
|
+
* Control the horizontal padding (`x`) or vertical padding (`y`).
|
|
16
|
+
* You can specify `none` to remove the padding.
|
|
17
|
+
* @default 'xy'
|
|
18
|
+
*/
|
|
19
|
+
padding?: 'xy' | 'x' | 'y' | 'none';
|
|
13
20
|
/**
|
|
14
21
|
* Border style to render
|
|
22
|
+
* @default 'solid'
|
|
15
23
|
*/
|
|
16
24
|
borderStyle?: 'dashed' | 'solid' | 'none';
|
|
17
25
|
};
|
package/dist/utils/tracking.d.ts
CHANGED
|
@@ -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
|
|
12
|
+
* Check whether the `shipment` has been purchased.
|
|
13
13
|
* @param shipment Shipment
|
|
14
14
|
*/
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function hasBeenPurchased(shipment: Shipment): boolean;
|
|
16
16
|
/**
|
|
17
17
|
* @docs https://www.easypost.com/docs/api#tracking-detail-object
|
|
18
18
|
*/
|