@codeleap/web 3.25.3 → 3.25.4

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": "@codeleap/web",
3
- "version": "3.25.3",
3
+ "version": "3.25.4",
4
4
  "main": "src/index.ts",
5
5
  "repository": {
6
6
  "url": "https://github.com/codeleap-uk/internal-libs-monorepo.git",
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { StylesOf, TypeGuards } from '@codeleap/common'
2
+ import { StylesOf, TypeGuards, PropsOf } from '@codeleap/common'
3
3
  import { ListComposition, ListParts } from './styles'
4
4
  import { ListProps } from './types'
5
5
  import { View } from '../View'
@@ -11,6 +11,7 @@ export type ListLayoutProps = Omit<ListProps, 'renderItem'> & UseInfiniteScrollR
11
11
  variantStyles: StylesOf<ListComposition>
12
12
  children?: React.ReactNode
13
13
  showFooter?: boolean
14
+ wrapperProps?: Partial<PropsOf<typeof View>>
14
15
  }
15
16
 
16
17
  type ListRefreshControlComponent = Partial<ListLayoutProps> & {
@@ -67,6 +68,7 @@ export const ListLayout = (props: ListLayoutProps) => {
67
68
  ListLoadingIndicatorComponent,
68
69
  scrollableRef,
69
70
  showFooter = true,
71
+ wrapperProps = {},
70
72
  } = props
71
73
 
72
74
  const getKeyStyle = React.useCallback((key: ListParts) => ([
@@ -77,7 +79,7 @@ export const ListLayout = (props: ListLayoutProps) => {
77
79
 
78
80
  return (
79
81
  // @ts-ignore
80
- <View css={[getKeyStyle('wrapper'), style]} ref={scrollableRef}>
82
+ <View css={[getKeyStyle('wrapper'), style]} ref={scrollableRef} {...wrapperProps}>
81
83
  {!!ListHeaderComponent ? <ListHeaderComponent /> : null}
82
84
 
83
85
  {isEmpty ? <ListEmptyComponent debugName={debugName} {...placeholder} /> : null}
@@ -56,6 +56,7 @@ export function List<T = any>(props: ListProps<T>) {
56
56
  masonryProps = {},
57
57
  reloadTimeout,
58
58
  showFooter,
59
+ layoutWrapperProps = {},
59
60
  } = allProps
60
61
 
61
62
  const variantStyles = useDefaultComponentStyle<'u:List', typeof ListPresets>('u:List', {
@@ -102,6 +103,7 @@ export function List<T = any>(props: ListProps<T>) {
102
103
  <ListLayout
103
104
  {...allProps}
104
105
  {...layoutProps}
106
+ wrapperProps={layoutWrapperProps}
105
107
  variantStyles={variantStyles}
106
108
  showFooter={reloadingLayout ? false : showFooter}
107
109
  >
@@ -54,4 +54,5 @@ Data = T extends Array<infer D> ? D : never
54
54
  masonryProps?: Partial<ListMasonryProps<T>>
55
55
  reloadTimeout?: number
56
56
  showFooter?: boolean
57
+ layoutWrapperProps?: Partial<PropsOf<typeof View>>
57
58
  } & ComponentCommonProps & UseInfiniteScrollArgs
@@ -22,6 +22,11 @@ export type ElementMap = {
22
22
  'section': WithChildren<JSX.IntrinsicElements['section']>
23
23
  'header': WithChildren<JSX.IntrinsicElements['header']>
24
24
  'footer': WithChildren<JSX.IntrinsicElements['footer']>
25
+ 'nav': WithChildren<JSX.IntrinsicElements['nav']>
26
+ 'article': WithChildren<JSX.IntrinsicElements['article']>
27
+ 'ul': WithChildren<JSX.IntrinsicElements['ul']>
28
+ 'ol': WithChildren<JSX.IntrinsicElements['ol']>
29
+ 'aside': WithChildren<JSX.IntrinsicElements['aside']>
25
30
  }
26
31
 
27
32
  export type NativeHTMLElement = keyof ElementMap