@faststore/ui 2.0.52-alpha.0 → 2.0.53-alpha.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.
package/dist/index.d.ts CHANGED
@@ -7,8 +7,6 @@ export { default as Slider } from './components/atoms/Slider';
7
7
  export type { SliderProps } from './components/atoms/Slider';
8
8
  export { default as Skeleton } from './components/atoms/Skeleton';
9
9
  export type { SkeletonProps } from './components/atoms/Skeleton';
10
- export { default as Spinner } from './components/atoms/Spinner';
11
- export type { SpinnerProps } from './components/atoms/Spinner';
12
10
  export { default as Incentive } from './components/atoms/Incentive';
13
11
  export type { IncentiveProps } from './components/atoms/Incentive';
14
12
  export { default as SkuSelector } from './components/molecules/SkuSelector';
@@ -37,8 +35,6 @@ export { default as PaymentMethods } from './components/molecules/PaymentMethods
37
35
  export type { PaymentMethodsProps } from './components/molecules/PaymentMethods';
38
36
  export { default as Breadcrumb } from './components/molecules/Breadcrumb';
39
37
  export type { BreadcrumbProps } from './components/molecules/Breadcrumb';
40
- export { default as LoadingButton } from './components/molecules/LoadingButton';
41
- export type { LoadingButtonProps } from './components/molecules/LoadingButton';
42
38
  export { default as PriceRange } from './components/molecules/PriceRange';
43
39
  export type { PriceRangeProps } from './components/molecules/PriceRange';
44
40
  export { default as Form } from './components/molecules/Form';
package/dist/index.js CHANGED
@@ -4,7 +4,6 @@ export { default as Popover } from './components/atoms/Popover';
4
4
  export { default as TextArea } from './components/atoms/TextArea';
5
5
  export { default as Slider } from './components/atoms/Slider';
6
6
  export { default as Skeleton } from './components/atoms/Skeleton';
7
- export { default as Spinner } from './components/atoms/Spinner';
8
7
  export { default as Incentive } from './components/atoms/Incentive';
9
8
  // Molecules
10
9
  export { default as SkuSelector } from './components/molecules/SkuSelector';
@@ -20,7 +19,6 @@ export { default as Modal } from './components/molecules/Modal';
20
19
  export { default as Banner, BannerContent, BannerImage, BannerLink, } from './components/molecules/Banner';
21
20
  export { default as PaymentMethods } from './components/molecules/PaymentMethods';
22
21
  export { default as Breadcrumb } from './components/molecules/Breadcrumb';
23
- export { default as LoadingButton } from './components/molecules/LoadingButton';
24
22
  export { default as PriceRange } from './components/molecules/PriceRange';
25
23
  export { default as Form } from './components/molecules/Form';
26
24
  // Organisms
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AAErC,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAG/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAG7D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAGjE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAG/D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAGnE,YAAY;AACZ,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAG3E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAG7E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAG7E,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,oCAAoC,CAAA;AAQ3C,OAAO,EACL,OAAO,IAAI,IAAI,EACf,SAAS,EACT,WAAW,EACX,WAAW,GACZ,MAAM,6BAA6B,CAAA;AAQpC,OAAO,EACL,OAAO,IAAI,QAAQ,EACnB,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,eAAe,EACf,aAAa,GACd,MAAM,iCAAiC,CAAA;AAWxC,OAAO,E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,YAAY;AACZ,OAAO,EACL,OAAO,IAAI,UAAU,EACrB,eAAe,EACf,iBAAiB,GAClB,MAAM,mCAAmC,CAAA;AAO1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAA;AAG1D,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/ui",
3
- "version": "2.0.52-alpha.0",
3
+ "version": "2.0.53-alpha.0",
4
4
  "description": "A lightweight, framework agnostic component library for React",
5
5
  "author": "emersonlaurentino",
6
6
  "license": "MIT",
@@ -59,5 +59,5 @@
59
59
  "node": "16.18.0",
60
60
  "yarn": "1.19.1"
61
61
  },
62
- "gitHead": "fe474595d374d91b69063e0b2ed6e56eee0c36d0"
62
+ "gitHead": "a9a211450d2173e08fd8b8dcf4a6da4d78590a71"
63
63
  }
@@ -95,6 +95,9 @@
95
95
  --fs-button-disabled-bkg-color : var(--fs-color-disabled-bkg);
96
96
  --fs-button-disabled-text-color : var(--fs-color-disabled-text);
97
97
 
98
+ // Loading
99
+ --fs-button-loading-label-column-gap : var(--fs-spacing-3);
100
+
98
101
  // Small
99
102
  --fs-button-small-padding : var(--fs-spacing-0) var(--fs-spacing-1);
100
103
  --fs-button-small-min-height : var(--fs-spacing-5);
@@ -314,4 +317,17 @@
314
317
  border-width: 0;
315
318
  }
316
319
  }
320
+
321
+ &[data-fs-button-loading="true"] {
322
+ > * {
323
+ opacity: 0;
324
+ pointer-events: none;
325
+ }
326
+ [data-fs-button-loading-label] {
327
+ position: absolute;
328
+ opacity: 1;
329
+ display: flex;
330
+ column-gap: var(--fs-button-loading-label-column-gap);
331
+ }
332
+ }
317
333
  }
@@ -0,0 +1,72 @@
1
+ [data-fs-loader] {
2
+ // --------------------------------------------------------
3
+ // Design Tokens for Loader
4
+ // --------------------------------------------------------
5
+
6
+ --fs-loader-gap : var(--fs-spacing-0);
7
+
8
+ --fs-loader-animation-function : var(--fs-transition-function);
9
+ --fs-loader-animation-timing : var(--fs-transition-timing);
10
+
11
+ // Item
12
+ --fs-loader-item-width : var(--fs-spacing-0);
13
+ --fs-loader-item-height : var(--fs-loader-item-width);
14
+ --fs-loader-item-border-radius : var(--fs-border-radius-circle);
15
+ --fs-loader-item-initial-opacity : .6;
16
+
17
+ // Dark (Default)
18
+ --fs-loader-dark-item-bkg-color : var(--fs-color-primary-bkg-active);
19
+
20
+ // Light
21
+ --fs-loader-light-item-bkg-color : var(--fs-color-tertiary-bkg-light);
22
+
23
+ // --------------------------------------------------------
24
+ // Structural Styles
25
+ // --------------------------------------------------------
26
+
27
+ display: flex;
28
+ align-items: center;
29
+ column-gap: var(--fs-loader-gap);
30
+
31
+ [data-fs-loader-item] {
32
+ width: var(--fs-loader-item-width);
33
+ height: var(--fs-loader-item-height);
34
+ border-radius: var(--fs-loader-item-border-radius);
35
+ opacity: var(--fs-loader-item-initial-opacity);
36
+ top: 0;
37
+ position: relative;
38
+ animation: load 1.2s infinite var(--fs-loader-animation-function) calc(var(--fs-loader-item-delay,0)*var(--fs-loader-animation-timing));
39
+
40
+ &:first-of-type { --fs-loader-item-delay: -1; }
41
+ &:last-of-type { --fs-loader-item-delay: 1; }
42
+ }
43
+
44
+ @keyframes load {
45
+ 20% {
46
+ top: calc(-1 * var(--fs-spacing-0));
47
+ opacity: 1;
48
+ }
49
+ 40% {
50
+ top: 0;
51
+ opacity: .6;
52
+ }
53
+ 60% {
54
+ top: 0;
55
+ opacity: .6;
56
+ }
57
+ }
58
+
59
+ // --------------------------------------------------------
60
+ // Variants Styles
61
+ // --------------------------------------------------------
62
+
63
+ &[data-fs-loader-variant="dark"] [data-fs-loader-item] {
64
+ background-color: var(--fs-loader-dark-item-bkg-color);
65
+ }
66
+
67
+ &[data-fs-loader-variant="light"] [data-fs-loader-item] {
68
+ background-color: var(--fs-loader-light-item-bkg-color);
69
+ }
70
+
71
+ }
72
+
package/src/index.ts CHANGED
@@ -13,9 +13,6 @@ export type { SliderProps } from './components/atoms/Slider'
13
13
  export { default as Skeleton } from './components/atoms/Skeleton'
14
14
  export type { SkeletonProps } from './components/atoms/Skeleton'
15
15
 
16
- export { default as Spinner } from './components/atoms/Spinner'
17
- export type { SpinnerProps } from './components/atoms/Spinner'
18
-
19
16
  export { default as Incentive } from './components/atoms/Incentive'
20
17
  export type { IncentiveProps } from './components/atoms/Incentive'
21
18
 
@@ -108,9 +105,6 @@ export type { PaymentMethodsProps } from './components/molecules/PaymentMethods'
108
105
  export { default as Breadcrumb } from './components/molecules/Breadcrumb'
109
106
  export type { BreadcrumbProps } from './components/molecules/Breadcrumb'
110
107
 
111
- export { default as LoadingButton } from './components/molecules/LoadingButton'
112
- export type { LoadingButtonProps } from './components/molecules/LoadingButton'
113
-
114
108
  export { default as PriceRange } from './components/molecules/PriceRange'
115
109
  export type { PriceRangeProps } from './components/molecules/PriceRange'
116
110
 
@@ -3,9 +3,10 @@
3
3
  @import "../components/atoms/Button/styles";
4
4
  @import "../components/atoms/Checkbox/styles";
5
5
  @import "../components/atoms/Icon/styles";
6
- @import "../components/atoms/Link/styles";
7
6
  @import "../components/atoms/Input/styles";
7
+ @import "../components/atoms/Link/styles";
8
8
  @import "../components/atoms/List/styles";
9
+ @import "../components/atoms/Loader/styles";
9
10
  @import "../components/atoms/Overlay/styles";
10
11
  @import "../components/atoms/Price/styles";
11
12
  @import "../components/atoms/Radio/styles";
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- export type SpinnerProps = {
3
- /**
4
- * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
5
- */
6
- testId?: string;
7
- };
8
- declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & {
9
- children?: React.ReactNode;
10
- } & React.RefAttributes<HTMLDivElement>>;
11
- export default Spinner;
@@ -1,6 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- const Spinner = forwardRef(function Spinner({ children, testId = 'store-spinner', ...otherProps }, ref) {
3
- return (React.createElement("span", { ref: ref, "data-fs-spinner": true, "data-testid": testId, ...otherProps }));
4
- });
5
- export default Spinner;
6
- //# sourceMappingURL=Spinner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Spinner.js","sourceRoot":"","sources":["../../../../src/components/atoms/Spinner/Spinner.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AASzC,MAAM,OAAO,GAAG,UAAU,CACxB,SAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG;IACzE,OAAO,CACL,8BAAM,GAAG,EAAE,GAAG,0CAA+B,MAAM,KAAM,UAAU,GAAI,CACxE,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,OAAO,CAAA"}
@@ -1,2 +0,0 @@
1
- export { default } from './Spinner';
2
- export type { SpinnerProps } from './Spinner';
@@ -1,2 +0,0 @@
1
- export { default } from './Spinner';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/atoms/Spinner/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import type { ButtonProps } from '@faststore/components';
3
- export interface LoadingButtonProps extends ButtonProps {
4
- /**
5
- * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
- */
7
- testId?: string;
8
- /**
9
- * The current loading state of the button.
10
- */
11
- loading: boolean;
12
- }
13
- declare const LoadingButton: React.ForwardRefExoticComponent<LoadingButtonProps & React.RefAttributes<HTMLButtonElement>>;
14
- export default LoadingButton;
@@ -1,8 +0,0 @@
1
- import React, { forwardRef } from 'react';
2
- import { Button } from '@faststore/components';
3
- import Spinner from '../../atoms/Spinner';
4
- const LoadingButton = forwardRef(function LoadingButton({ children, loading, testId = 'store-loading-button', ...otherProps }, ref) {
5
- return (React.createElement(Button, { ref: ref, "data-fs-loading-button": true, testId: testId, ...otherProps }, loading ? React.createElement(Spinner, null) : children));
6
- });
7
- export default LoadingButton;
8
- //# sourceMappingURL=LoadingButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingButton.js","sourceRoot":"","sources":["../../../../src/components/molecules/LoadingButton/LoadingButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAE9C,OAAO,OAAO,MAAM,qBAAqB,CAAA;AAazC,MAAM,aAAa,GAAG,UAAU,CAC9B,SAAS,aAAa,CACpB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,sBAAsB,EAAE,GAAG,UAAU,EAAE,EACrE,GAAG;IAEH,OAAO,CACL,oBAAC,MAAM,IAAC,GAAG,EAAE,GAAG,kCAAyB,MAAM,EAAE,MAAM,KAAM,UAAU,IACpE,OAAO,CAAC,CAAC,CAAC,oBAAC,OAAO,OAAG,CAAC,CAAC,CAAC,QAAQ,CAC1B,CACV,CAAA;AACH,CAAC,CACF,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -1,2 +0,0 @@
1
- export { default } from './LoadingButton';
2
- export type { LoadingButtonProps } from './LoadingButton';
@@ -1,2 +0,0 @@
1
- export { default } from './LoadingButton';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/molecules/LoadingButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA"}
@@ -1,19 +0,0 @@
1
- import type { PropsWithChildren } from 'react'
2
- import React, { forwardRef } from 'react'
3
-
4
- export type SpinnerProps = {
5
- /**
6
- * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
7
- */
8
- testId?: string
9
- }
10
-
11
- const Spinner = forwardRef<HTMLDivElement, PropsWithChildren<SpinnerProps>>(
12
- function Spinner({ children, testId = 'store-spinner', ...otherProps }, ref) {
13
- return (
14
- <span ref={ref} data-fs-spinner data-testid={testId} {...otherProps} />
15
- )
16
- }
17
- )
18
-
19
- export default Spinner
@@ -1,2 +0,0 @@
1
- export { default } from './Spinner'
2
- export type { SpinnerProps } from './Spinner'
@@ -1,31 +0,0 @@
1
- import React, { forwardRef } from 'react'
2
-
3
- import { Button } from '@faststore/components'
4
- import type { ButtonProps } from '@faststore/components'
5
- import Spinner from '../../atoms/Spinner'
6
-
7
- export interface LoadingButtonProps extends ButtonProps {
8
- /**
9
- * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
10
- */
11
- testId?: string
12
- /**
13
- * The current loading state of the button.
14
- */
15
- loading: boolean
16
- }
17
-
18
- const LoadingButton = forwardRef<HTMLButtonElement, LoadingButtonProps>(
19
- function LoadingButton(
20
- { children, loading, testId = 'store-loading-button', ...otherProps },
21
- ref
22
- ) {
23
- return (
24
- <Button ref={ref} data-fs-loading-button testId={testId} {...otherProps}>
25
- {loading ? <Spinner /> : children}
26
- </Button>
27
- )
28
- }
29
- )
30
-
31
- export default LoadingButton
@@ -1,2 +0,0 @@
1
- export { default } from './LoadingButton'
2
- export type { LoadingButtonProps } from './LoadingButton'