@faststore/components 2.1.31 → 2.1.51
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/atoms/Badge/Badge.d.ts +1 -1
- package/dist/atoms/Link/Link.d.ts +4 -4
- package/dist/atoms/Loader/Loader.d.ts +7 -6
- package/dist/atoms/Loader/Loader.js +1 -1
- package/dist/atoms/Loader/Loader.js.map +1 -1
- package/dist/atoms/SROnly/SROnly.d.ts +6 -0
- package/dist/atoms/SROnly/SROnly.js.map +1 -1
- package/dist/atoms/Slider/Slider.d.ts +3 -3
- package/dist/molecules/Dropdown/Dropdown.d.ts +13 -5
- package/dist/molecules/Dropdown/Dropdown.js.map +1 -1
- package/dist/molecules/Dropdown/DropdownMenu.d.ts +5 -5
- package/dist/molecules/Dropdown/DropdownMenu.js.map +1 -1
- package/dist/molecules/Modal/ModalBody.d.ts +3 -0
- package/dist/molecules/Modal/ModalBody.js.map +1 -1
- package/dist/molecules/RadioField/RadioField.d.ts +3 -2
- package/dist/molecules/RadioField/RadioField.js +1 -1
- package/dist/molecules/RadioField/RadioField.js.map +1 -1
- package/dist/molecules/Rating/Rating.d.ts +4 -4
- package/dist/molecules/ToggleField/ToggleField.d.ts +2 -2
- package/dist/organisms/PriceRange/PriceRange.d.ts +3 -16
- package/package.json +4 -4
- package/src/atoms/Badge/Badge.tsx +1 -1
- package/src/atoms/Link/Link.tsx +4 -4
- package/src/atoms/Loader/Loader.tsx +7 -6
- package/src/atoms/SROnly/SROnly.tsx +6 -0
- package/src/atoms/Slider/Slider.tsx +2 -2
- package/src/molecules/Dropdown/Dropdown.tsx +12 -4
- package/src/molecules/Dropdown/DropdownMenu.tsx +4 -11
- package/src/molecules/Modal/ModalBody.tsx +3 -0
- package/src/molecules/RadioField/RadioField.tsx +4 -2
- package/src/molecules/Rating/Rating.tsx +4 -4
- package/src/molecules/ToggleField/ToggleField.tsx +1 -1
- package/src/organisms/PriceRange/PriceRange.tsx +1 -1
|
@@ -11,13 +11,13 @@ type LinkBaseProps = {
|
|
|
11
11
|
*/
|
|
12
12
|
variant?: 'default' | 'display' | 'inline';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Specifies the size variant.
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
size?: 'small' | 'regular';
|
|
17
17
|
/**
|
|
18
|
-
* Defines
|
|
18
|
+
* Defines the use of inverted colors.
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
inverse?: boolean;
|
|
21
21
|
};
|
|
22
22
|
export type LinkElementType = ElementType;
|
|
23
23
|
export type LinkProps<C extends LinkElementType = 'a'> = PolymorphicComponentPropsWithRef<C, LinkBaseProps>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
export
|
|
3
|
-
/**
|
|
4
|
-
* Specifies the component color variant.
|
|
5
|
-
*/
|
|
6
|
-
variant?: 'light' | 'dark';
|
|
3
|
+
export interface LoaderProps extends HTMLAttributes<HTMLSpanElement> {
|
|
7
4
|
/**
|
|
8
5
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
9
6
|
*/
|
|
10
7
|
testId?: string;
|
|
11
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Specifies the component color variant.
|
|
10
|
+
*/
|
|
11
|
+
variant?: 'light' | 'dark';
|
|
12
|
+
}
|
|
12
13
|
declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
14
|
export default Loader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
const Loader = forwardRef(function Loader({
|
|
2
|
+
const Loader = forwardRef(function Loader({ testId = 'fs-loader', variant = 'dark', ...otherProps }, ref) {
|
|
3
3
|
return (React.createElement("span", { ref: ref, "data-fs-loader": true, "data-fs-loader-variant": variant, "data-testid": testId, ...otherProps },
|
|
4
4
|
React.createElement("span", { "data-fs-loader-item": true }),
|
|
5
5
|
React.createElement("span", { "data-fs-loader-item": true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../../src/atoms/Loader/Loader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Loader.js","sourceRoot":"","sources":["../../../src/atoms/Loader/Loader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAazC,MAAM,MAAM,GAAG,UAAU,CAA8B,SAAS,MAAM,CACpE,EAAE,MAAM,GAAG,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE,GAAG,UAAU,EAAe,EACtE,GAAG;IAEH,OAAO,CACL,8BACE,GAAG,EAAE,GAAG,oDAEgB,OAAO,iBAClB,MAAM,KACf,UAAU;QAEd,4DAAiC;QACjC,4DAAiC;QACjC,4DAAiC,CAC5B,CACR,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,MAAM,CAAA"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { ElementType } from 'react';
|
|
2
2
|
interface SROnlyProps {
|
|
3
|
+
/**
|
|
4
|
+
* Defines component element type (e.g.: span).
|
|
5
|
+
*/
|
|
3
6
|
text: string;
|
|
7
|
+
/**
|
|
8
|
+
* Defines component element type (e.g.: span).
|
|
9
|
+
*/
|
|
4
10
|
as?: ElementType;
|
|
5
11
|
}
|
|
6
12
|
declare function SROnly({ text, as }: SROnlyProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SROnly.js","sourceRoot":"","sources":["../../../src/atoms/SROnly/SROnly.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"SROnly.js","sourceRoot":"","sources":["../../../src/atoms/SROnly/SROnly.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAczB,SAAS,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,EAAe;IACvC,MAAM,SAAS,GAAG,EAAE,IAAI,MAAM,CAAA;IAE9B,OAAO,oBAAC,SAAS,+BAAkB,IAAI,CAAa,CAAA;AACtD,CAAC;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This code is inspired by the work of [sandra-lewis](https://codesandbox.io/u/sandra-lewis)
|
|
3
3
|
*/
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import type { ReactNode } from 'react';
|
|
5
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
6
6
|
interface Range {
|
|
7
7
|
absolute: number;
|
|
8
8
|
selected: number;
|
|
@@ -11,7 +11,7 @@ interface RangeLabel {
|
|
|
11
11
|
min: string | ReactNode;
|
|
12
12
|
max: string | ReactNode;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export interface SliderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
15
15
|
/**
|
|
16
16
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
17
17
|
*
|
|
@@ -60,7 +60,7 @@ export type SliderProps = {
|
|
|
60
60
|
* Component that renders max value label above the right thumb.
|
|
61
61
|
*/
|
|
62
62
|
maxValueLabelComponent?: (maxValue: number) => ReactNode;
|
|
63
|
-
}
|
|
63
|
+
}
|
|
64
64
|
type SliderRefType = {
|
|
65
65
|
setSliderValues: (values: {
|
|
66
66
|
min: number;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export
|
|
3
|
-
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
export interface DropdownProps {
|
|
3
|
+
/**
|
|
4
|
+
* Event emitted when the Dropdown is closed.
|
|
5
|
+
*/
|
|
4
6
|
onDismiss?(): void;
|
|
7
|
+
/**
|
|
8
|
+
* A boolean value that represents the state of the Dropdown.
|
|
9
|
+
*/
|
|
5
10
|
isOpen?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* ID to identify Dropdown.
|
|
13
|
+
*/
|
|
6
14
|
id?: string;
|
|
7
|
-
}
|
|
8
|
-
declare const Dropdown: ({ children, isOpen: isOpenDefault, onDismiss, id, }: DropdownProps) => JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
declare const Dropdown: ({ children, isOpen: isOpenDefault, onDismiss, id, }: PropsWithChildren<DropdownProps>) => JSX.Element;
|
|
9
17
|
export default Dropdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/molecules/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEhF,OAAO,eAAe,MAAM,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../src/molecules/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEhF,OAAO,eAAe,MAAM,sCAAsC,CAAA;AAiBlE,MAAM,QAAQ,GAAG,CAAC,EAChB,QAAQ,EACR,MAAM,EAAE,aAAa,GAAG,KAAK,EAC7B,SAAS,EACT,EAAE,GAAG,aAAa,GACe,EAAE,EAAE;IACrC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;IACnD,MAAM,gBAAgB,GAAG,MAAM,CAAsB,EAAE,CAAC,CAAA;IACxD,MAAM,4BAA4B,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;IAC9C,MAAM,iBAAiB,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAEzD,MAAM,K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,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;SAC1C;aAAM;YACL,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;SAC7C;QAED,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC9C,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;IAEnB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,OAAO;YACL,MAAM;YACN,KAAK;YACL,IAAI;YACJ,MAAM;YACN,iBAAiB;YACjB,SAAS;YACT,4BAA4B;YAC5B,gBAAgB;YAChB,EAAE;SACH,CAAA;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IAE1C,OAAO,CACL,oBAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACnC,QAAQ,CACgB,CAC5B,CAAA;AACH,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AriaAttributes, KeyboardEvent, PropsWithChildren, MouseEvent, ReactNode
|
|
1
|
+
import type { AriaAttributes, KeyboardEvent, PropsWithChildren, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
type
|
|
4
|
-
export interface DropdownMenuProps extends
|
|
3
|
+
import type { ModalContentProps } from './../Modal/ModalContent';
|
|
4
|
+
export interface DropdownMenuProps extends ModalContentProps {
|
|
5
5
|
/**
|
|
6
6
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
7
|
*/
|
|
@@ -17,8 +17,8 @@ export interface DropdownMenuProps extends BaseModalProps {
|
|
|
17
17
|
*/
|
|
18
18
|
onDismiss?: (event: MouseEvent | KeyboardEvent) => void;
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
* Specifies the size variant.
|
|
21
|
+
*/
|
|
22
22
|
size?: 'small' | 'regular';
|
|
23
23
|
children: ReactNode[] | ReactNode;
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","sourceRoot":"","sources":["../../../src/molecules/Dropdown/DropdownMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","sourceRoot":"","sources":["../../../src/molecules/Dropdown/DropdownMenu.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AA4BjE;;;;GAIG;AAEH,MAAM,YAAY,GAAG,CAAC,EACpB,QAAQ,EACR,MAAM,GAAG,kBAAkB,EAC3B,IAAI,GAAG,SAAS,EAChB,KAAK,EACL,GAAG,UAAU,EACwB,EAAE,EAAE;IACzC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,EAAE,EAAE,GAC5F,WAAW,EAAE,CAAA;IAEf,MAAM,gBAAgB,GAAG,mBAAmB,EAAE,CAAA;IAE9C,MAAM,cAAc,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAA;IAE9D,MAAM,eAAe,GAAG,GAAG,EAAE;QAC3B,IAAI,4BAA6B,CAAC,OAAO,GAAG,cAAc,GAAG,CAAC,EAAE;YAC9D,4BAA6B,CAAC,OAAO,EAAE,CAAA;SACxC;aAAM;YACL,4BAA6B,CAAC,OAAO,GAAG,CAAC,CAAA;SAC1C;QAED,gBAAgB,EAAE,OAAO,CAAC,4BAA6B,CAAC,O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A;QAE1C,KAAK,CAAC,GAAG,KAAK,MAAM,IAAI,eAAe,EAAE,CAAA;QAEzC,KAAK,CAAC,GAAG,KAAK,KAAK,IAAI,cAAc,EAAE,CAAA;QAEvC,KAAK,CAAC,eAAe,EAAE,CAAA;IACzB,CAAC,CAAA;IAED,MAAM,uBAAuB,GAAG,GAAG,EAAE;QACnC,gBAAiB,CAAC,OAAO,GAAG,EAAE,CAAA;QAE9B,OAAO,IAAI,CAAA;IACb,CAAC,CAAA;IAED,OAAO,MAAM;QACX,CAAC,CAAC,YAAY,CACV,6BACE,IAAI,EAAC,cAAc,oCAEnB,SAAS,EAAE,qBAAqB,iBACnB,GAAG,MAAM,UAAU;YAEhC,6BACE,IAAI,EAAC,MAAM,sBACM,UAAU,+DAEC,IAAI,iBACnB,MAAM,EACnB,KAAK,EAAE,EAAE,GAAG,gBAAgB,EAAE,GAAG,KAAK,EAAE,EACxC,EAAE,EAAE,EAAE,KACF,UAAU,IAEb,QAAQ,CACL,CACF,EACN,QAAQ,CAAC,IAAI,CACd;QACH,CAAC,CAAC,uBAAuB,EAAE,CAAA;AAC/B,CAAC,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
2
|
export interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Children or function as a children
|
|
5
|
+
*/
|
|
3
6
|
children: ReactNode;
|
|
4
7
|
}
|
|
5
8
|
declare const ModalBody: ({ children, ...otherProps }: ModalBodyProps) => JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalBody.js","sourceRoot":"","sources":["../../../src/molecules/Modal/ModalBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ModalBody.js","sourceRoot":"","sources":["../../../src/molecules/Modal/ModalBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAA;AASxD,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAkB,EAAE,EAAE,CAAC,CACjE,4DAA4B,UAAU,IACnC,QAAQ,CACL,CACP,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
export
|
|
3
|
+
export interface RadioFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
/**
|
|
4
5
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
5
6
|
*/
|
|
@@ -20,6 +21,6 @@ export type RadioFieldProps = {
|
|
|
20
21
|
* Identify radio in the same group.
|
|
21
22
|
*/
|
|
22
23
|
name?: string;
|
|
23
|
-
}
|
|
24
|
+
}
|
|
24
25
|
declare const RadioField: React.ForwardRefExoticComponent<RadioFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
26
|
export default RadioField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
1
2
|
import Label from '../../atoms/Label';
|
|
2
3
|
import Radio from '../../atoms/Radio';
|
|
3
|
-
import React, { forwardRef } from 'react';
|
|
4
4
|
const RadioField = forwardRef(function RadioField({ testId = 'fs-radio-field', id, label, value, name, ...otherProps }, ref) {
|
|
5
5
|
return (React.createElement("div", { ref: ref, "data-fs-radio-field": true, "data-testid": testId },
|
|
6
6
|
React.createElement(Radio, { id: id, value: value ?? label, name: name, ...otherProps }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioField.js","sourceRoot":"","sources":["../../../src/molecules/RadioField/RadioField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RadioField.js","sourceRoot":"","sources":["../../../src/molecules/RadioField/RadioField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,MAAM,mBAAmB,CAAA;AACrC,OAAO,KAAK,MAAM,mBAAmB,CAAA;AAyBrC,MAAM,UAAU,GAAG,UAAU,CAC3B,SAAS,UAAU,CACjB,EAAE,MAAM,GAAG,gBAAgB,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,EACpE,GAAG;IAEH,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,8CAAmC,MAAM;QACpD,oBAAC,KAAK,IAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,IAAI,EAAE,IAAI,KAAM,UAAU,GAAI;QACpE,oBAAC,KAAK,IAAC,OAAO,EAAE,EAAE,IAAG,KAAK,CAAS,CAC/B,CACP,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export interface RatingProps extends Omit<HTMLAttributes<HTMLUListElement>, 'onChange'> {
|
|
3
|
+
/**
|
|
4
|
+
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
5
|
+
*/
|
|
6
|
+
testId?: string;
|
|
3
7
|
/**
|
|
4
8
|
* The length of child elements.
|
|
5
9
|
*/
|
|
@@ -16,10 +20,6 @@ export interface RatingProps extends Omit<HTMLAttributes<HTMLUListElement>, 'onC
|
|
|
16
20
|
* Function to be triggered when Rating option change. This should only be used if you and an actionable rating list.
|
|
17
21
|
*/
|
|
18
22
|
onChange?: (value: number) => void;
|
|
19
|
-
/**
|
|
20
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
21
|
-
*/
|
|
22
|
-
testId?: string;
|
|
23
23
|
}
|
|
24
24
|
export interface RatingItemProps {
|
|
25
25
|
'data-fs-rating-item'?: 'full' | 'partial' | 'empty';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export interface ToggleFieldProps {
|
|
3
3
|
/**
|
|
4
4
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
5
5
|
*/
|
|
@@ -24,6 +24,6 @@ export type ToggleFieldProps = {
|
|
|
24
24
|
* Controls the component's direction.
|
|
25
25
|
*/
|
|
26
26
|
variant?: 'horizontal' | 'vertical';
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
declare const ToggleField: React.ForwardRefExoticComponent<ToggleFieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
29
|
export default ToggleField;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { AriaAttributes } from 'react';
|
|
3
3
|
import type { PriceProps, SliderProps } from '../../';
|
|
4
|
-
export
|
|
4
|
+
export interface PriceRangeProps extends Omit<SliderProps, 'absoluteValuesLabel'> {
|
|
5
5
|
/**
|
|
6
6
|
* The current use case variant for prices.
|
|
7
7
|
*/
|
|
@@ -14,25 +14,12 @@ export type PriceRangeProps = Omit<SliderProps, 'absoluteValuesLabel'> & {
|
|
|
14
14
|
* Defines a string value that labels the current element.
|
|
15
15
|
*/
|
|
16
16
|
'aria-label'?: AriaAttributes['aria-label'];
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
type PriceRangeRefType = {
|
|
19
19
|
setPriceRangeValues: (values: {
|
|
20
20
|
min: number;
|
|
21
21
|
max: number;
|
|
22
22
|
}) => void;
|
|
23
23
|
};
|
|
24
|
-
declare const PriceRange: React.ForwardRefExoticComponent<
|
|
25
|
-
/**
|
|
26
|
-
* The current use case variant for prices.
|
|
27
|
-
*/
|
|
28
|
-
variant?: PriceProps['variant'];
|
|
29
|
-
/**
|
|
30
|
-
* Formatter function that transforms the raw price value and render the result.
|
|
31
|
-
*/
|
|
32
|
-
formatter: PriceProps['formatter'];
|
|
33
|
-
/**
|
|
34
|
-
* Defines a string value that labels the current element.
|
|
35
|
-
*/
|
|
36
|
-
'aria-label'?: AriaAttributes['aria-label'];
|
|
37
|
-
} & React.RefAttributes<PriceRangeRefType | undefined>>;
|
|
24
|
+
declare const PriceRange: React.ForwardRefExoticComponent<PriceRangeProps & React.RefAttributes<PriceRangeRefType | undefined>>;
|
|
38
25
|
export default PriceRange;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/components",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.51",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"author": "Emerson Laurentino @emersonlaurentino",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"src"
|
|
22
22
|
],
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@faststore/eslint-config": "^2.1.
|
|
25
|
-
"@faststore/shared": "^2.1.
|
|
24
|
+
"@faststore/eslint-config": "^2.1.33",
|
|
25
|
+
"@faststore/shared": "^2.1.33",
|
|
26
26
|
"eslint": "7.32.0",
|
|
27
27
|
"typescript": "^4.8.4"
|
|
28
28
|
},
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"node": "16.18.0",
|
|
31
31
|
"yarn": "1.19.1"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "661c5d1e345616c2b0ea2e8ceb388263644ff67c"
|
|
34
34
|
}
|
package/src/atoms/Link/Link.tsx
CHANGED
|
@@ -12,13 +12,13 @@ type LinkBaseProps = {
|
|
|
12
12
|
*/
|
|
13
13
|
variant?: 'default' | 'display' | 'inline'
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Specifies the size variant.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
size?: 'small' | 'regular'
|
|
18
18
|
/**
|
|
19
|
-
* Defines
|
|
19
|
+
* Defines the use of inverted colors.
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
inverse?: boolean
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export type LinkElementType = ElementType
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react'
|
|
1
2
|
import React, { forwardRef } from 'react'
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
-
/**
|
|
5
|
-
* Specifies the component color variant.
|
|
6
|
-
*/
|
|
7
|
-
variant?: 'light' | 'dark'
|
|
4
|
+
export interface LoaderProps extends HTMLAttributes<HTMLSpanElement> {
|
|
8
5
|
/**
|
|
9
6
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
10
7
|
*/
|
|
11
8
|
testId?: string
|
|
9
|
+
/**
|
|
10
|
+
* Specifies the component color variant.
|
|
11
|
+
*/
|
|
12
|
+
variant?: 'light' | 'dark'
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
const Loader = forwardRef<HTMLDivElement, LoaderProps>(function Loader(
|
|
15
|
-
{
|
|
16
|
+
{ testId = 'fs-loader', variant = 'dark', ...otherProps }: LoaderProps,
|
|
16
17
|
ref
|
|
17
18
|
) {
|
|
18
19
|
return (
|
|
@@ -2,7 +2,13 @@ import React from 'react'
|
|
|
2
2
|
import type { ElementType } from 'react'
|
|
3
3
|
|
|
4
4
|
interface SROnlyProps {
|
|
5
|
+
/**
|
|
6
|
+
* Defines component element type (e.g.: span).
|
|
7
|
+
*/
|
|
5
8
|
text: string
|
|
9
|
+
/**
|
|
10
|
+
* Defines component element type (e.g.: span).
|
|
11
|
+
*/
|
|
6
12
|
as?: ElementType
|
|
7
13
|
}
|
|
8
14
|
|
|
@@ -7,7 +7,7 @@ import React, {
|
|
|
7
7
|
useImperativeHandle,
|
|
8
8
|
forwardRef,
|
|
9
9
|
} from 'react'
|
|
10
|
-
import type { ReactNode } from 'react'
|
|
10
|
+
import type { HTMLAttributes, ReactNode } from 'react'
|
|
11
11
|
|
|
12
12
|
interface Range {
|
|
13
13
|
absolute: number
|
|
@@ -19,7 +19,7 @@ interface RangeLabel {
|
|
|
19
19
|
max: string | ReactNode
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export
|
|
22
|
+
export interface SliderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
23
23
|
/**
|
|
24
24
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
25
25
|
*
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PropsWithChildren } from 'react'
|
|
2
2
|
import React, { useRef, useMemo, useState, useEffect, useCallback } from 'react'
|
|
3
3
|
|
|
4
4
|
import DropdownContext from '../Dropdown/contexts/DropdownContext'
|
|
5
5
|
|
|
6
|
-
export
|
|
7
|
-
|
|
6
|
+
export interface DropdownProps {
|
|
7
|
+
/**
|
|
8
|
+
* Event emitted when the Dropdown is closed.
|
|
9
|
+
*/
|
|
8
10
|
onDismiss?(): void
|
|
11
|
+
/**
|
|
12
|
+
* A boolean value that represents the state of the Dropdown.
|
|
13
|
+
*/
|
|
9
14
|
isOpen?: boolean
|
|
15
|
+
/**
|
|
16
|
+
* ID to identify Dropdown.
|
|
17
|
+
*/
|
|
10
18
|
id?: string
|
|
11
19
|
}
|
|
12
20
|
|
|
@@ -15,7 +23,7 @@ const Dropdown = ({
|
|
|
15
23
|
isOpen: isOpenDefault = false,
|
|
16
24
|
onDismiss,
|
|
17
25
|
id = 'fs-dropdown',
|
|
18
|
-
}: DropdownProps) => {
|
|
26
|
+
}: PropsWithChildren<DropdownProps>) => {
|
|
19
27
|
const [isOpen, setIsOpen] = useState(isOpenDefault)
|
|
20
28
|
const dropdownItemsRef = useRef<HTMLButtonElement[]>([])
|
|
21
29
|
const selectedDropdownItemIndexRef = useRef(0)
|
|
@@ -4,22 +4,15 @@ import type {
|
|
|
4
4
|
PropsWithChildren,
|
|
5
5
|
MouseEvent,
|
|
6
6
|
ReactNode,
|
|
7
|
-
DetailedHTMLProps,
|
|
8
|
-
HTMLAttributes
|
|
9
7
|
} from 'react'
|
|
10
8
|
import React from 'react'
|
|
11
9
|
import { createPortal } from 'react-dom'
|
|
12
10
|
|
|
13
11
|
import { useDropdown } from './hooks/useDropdown'
|
|
14
12
|
import { useDropdownPosition } from './hooks/useDropdownPosition'
|
|
13
|
+
import type { ModalContentProps } from './../Modal/ModalContent'
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
type BaseModalProps = Omit<
|
|
18
|
-
DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
19
|
-
'ref' | 'onClick'
|
|
20
|
-
>
|
|
21
|
-
|
|
22
|
-
export interface DropdownMenuProps extends BaseModalProps {
|
|
15
|
+
export interface DropdownMenuProps extends ModalContentProps {
|
|
23
16
|
/**
|
|
24
17
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
25
18
|
*/
|
|
@@ -36,8 +29,8 @@ export interface DropdownMenuProps extends BaseModalProps {
|
|
|
36
29
|
*/
|
|
37
30
|
onDismiss?: (event: MouseEvent | KeyboardEvent) => void
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
* Specifies the size variant
|
|
32
|
+
/**
|
|
33
|
+
* Specifies the size variant.
|
|
41
34
|
*/
|
|
42
35
|
size?: 'small' | 'regular'
|
|
43
36
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react'
|
|
2
|
+
import React, { forwardRef } from 'react'
|
|
3
|
+
|
|
1
4
|
import Label from '../../atoms/Label'
|
|
2
5
|
import Radio from '../../atoms/Radio'
|
|
3
|
-
import React, { forwardRef } from 'react'
|
|
4
6
|
|
|
5
|
-
export
|
|
7
|
+
export interface RadioFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
8
|
/**
|
|
7
9
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
8
10
|
*/
|
|
@@ -5,6 +5,10 @@ import List from '../../atoms/List'
|
|
|
5
5
|
|
|
6
6
|
export interface RatingProps
|
|
7
7
|
extends Omit<HTMLAttributes<HTMLUListElement>, 'onChange'> {
|
|
8
|
+
/**
|
|
9
|
+
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
10
|
+
*/
|
|
11
|
+
testId?: string
|
|
8
12
|
/**
|
|
9
13
|
* The length of child elements.
|
|
10
14
|
*/
|
|
@@ -21,10 +25,6 @@ export interface RatingProps
|
|
|
21
25
|
* Function to be triggered when Rating option change. This should only be used if you and an actionable rating list.
|
|
22
26
|
*/
|
|
23
27
|
onChange?: (value: number) => void
|
|
24
|
-
/**
|
|
25
|
-
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
26
|
-
*/
|
|
27
|
-
testId?: string
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export interface RatingItemProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
2
|
import { Label, SROnly, Toggle } from './../../'
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export interface ToggleFieldProps {
|
|
5
5
|
/**
|
|
6
6
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
7
|
*/
|
|
@@ -4,7 +4,7 @@ import type { AriaAttributes } from 'react'
|
|
|
4
4
|
import { Price, Slider, InputField } from '../../'
|
|
5
5
|
import type { PriceProps, SliderProps } from '../../'
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export interface PriceRangeProps extends Omit<SliderProps, 'absoluteValuesLabel'> {
|
|
8
8
|
/**
|
|
9
9
|
* The current use case variant for prices.
|
|
10
10
|
*/
|