@faststore/ui 1.8.51 → 1.9.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/ui",
3
- "version": "1.8.51",
3
+ "version": "1.9.2",
4
4
  "description": "A lightweight, framework agnostic component library for React",
5
5
  "author": "emersonlaurentino",
6
6
  "license": "MIT",
@@ -89,5 +89,5 @@
89
89
  "tsdx": "^0.14.1",
90
90
  "typescript": "^4.2.4"
91
91
  },
92
- "gitHead": "be1a2b1a38ec185ca8bd90af6e5fb02119f2fcb9"
92
+ "gitHead": "1e8d1cf3c3f0d670f521be3b1394333fabbfd2ac"
93
93
  }
@@ -49,7 +49,7 @@ const Slider = ({
49
49
  const range = useRef<HTMLDivElement>(null)
50
50
 
51
51
  const getPercent = useCallback(
52
- (value) => Math.round(((value - min) / (max - min)) * 100),
52
+ (value: number) => Math.round(((value - min) / (max - min)) * 100),
53
53
  [min, max]
54
54
  )
55
55
 
@@ -1,3 +1,4 @@
1
+ import type { PropsWithChildren } from 'react'
1
2
  import React, { forwardRef } from 'react'
2
3
 
3
4
  export type SpinnerProps = {
@@ -7,13 +8,12 @@ export type SpinnerProps = {
7
8
  testId?: string
8
9
  }
9
10
 
10
- const Spinner = forwardRef<HTMLDivElement, SpinnerProps>(function Spinner(
11
- { children, testId = 'store-spinner', ...otherProps },
12
- ref
13
- ) {
14
- return (
15
- <span ref={ref} data-store-spinner data-testid={testId} {...otherProps} />
16
- )
17
- })
11
+ const Spinner = forwardRef<HTMLDivElement, PropsWithChildren<SpinnerProps>>(
12
+ function Spinner({ children, testId = 'store-spinner', ...otherProps }, ref) {
13
+ return (
14
+ <span ref={ref} data-store-spinner data-testid={testId} {...otherProps} />
15
+ )
16
+ }
17
+ )
18
18
 
19
19
  export default Spinner
@@ -84,7 +84,10 @@ function Carousel({
84
84
  const preRenderedSlides =
85
85
  infiniteMode && children ? childrenArray.slice(childrenCount - 1) : []
86
86
 
87
- const slides = preRenderedSlides.concat(children ?? [], postRenderedSlides)
87
+ const slides = preRenderedSlides.concat(
88
+ (children as any) ?? [],
89
+ postRenderedSlides
90
+ )
88
91
 
89
92
  const slidePrevious = () => {
90
93
  if (
@@ -13,9 +13,14 @@ export const OutOfStockMessage = ({
13
13
  as: MessageComponent = 'p',
14
14
  testId = 'store-out-of-stock-message',
15
15
  children,
16
+ ...otherProps
16
17
  }: OutOfStockMessageProps) => {
17
18
  return (
18
- <MessageComponent data-out-of-stock-message data-testid={testId}>
19
+ <MessageComponent
20
+ data-out-of-stock-message
21
+ data-testid={testId}
22
+ {...otherProps}
23
+ >
19
24
  {children}
20
25
  </MessageComponent>
21
26
  )
@@ -13,9 +13,14 @@ export const OutOfStockTitle = ({
13
13
  as: TitleComponent = 'h2',
14
14
  testId = 'store-out-of-stock-title',
15
15
  children,
16
+ ...otherProps
16
17
  }: OutOfStockTitleProps) => {
17
18
  return (
18
- <TitleComponent data-out-of-stock-title data-testid={testId}>
19
+ <TitleComponent
20
+ data-out-of-stock-title
21
+ data-testid={testId}
22
+ {...otherProps}
23
+ >
19
24
  {children}
20
25
  </TitleComponent>
21
26
  )