@react-types/card 3.0.0-alpha.0 → 3.0.0-alpha.10

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.
Files changed (2) hide show
  1. package/package.json +6 -5
  2. package/src/index.d.ts +11 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/card",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.10",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,14 +9,15 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "dependencies": {
12
- "@react-stately/virtualizer": "^3.1.5",
13
- "@react-types/shared": "^3.0.0"
12
+ "@react-stately/virtualizer": "^3.3.1",
13
+ "@react-types/provider": "^3.5.4",
14
+ "@react-types/shared": "^3.15.0"
14
15
  },
15
16
  "peerDependencies": {
16
- "react": "^16.8.0 || ^17.0.0-rc.1"
17
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
17
18
  },
18
19
  "publishConfig": {
19
20
  "access": "public"
20
21
  },
21
- "gitHead": "9397d0262111f7207cb1ee2cbdda86cd5d180298"
22
+ "gitHead": "9202ef59e8c104dd06ffe33148445ef7932a5d1b"
22
23
  }
package/src/index.d.ts CHANGED
@@ -10,9 +10,10 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {AriaLabelingProps, AsyncLoadable, Collection, CollectionBase, Direction, DOMProps, KeyboardDelegate, LoadingState, MultipleSelection, Node, StyleProps} from '@react-types/shared';
13
+ import {AriaLabelingProps, AsyncLoadable, Collection, CollectionBase, Direction, DOMProps, KeyboardDelegate, LoadingState, MultipleSelection, Node, Orientation, StyleProps} from '@react-types/shared';
14
14
  import {Layout} from '@react-stately/virtualizer';
15
15
  import {ReactNode} from 'react';
16
+ import {Scale} from '@react-types/provider';
16
17
 
17
18
  interface AriaCardProps extends AriaLabelingProps {}
18
19
 
@@ -22,13 +23,17 @@ interface SpectrumCardProps extends AriaCardProps, StyleProps, DOMProps {
22
23
  layout?: 'grid' | 'waterfall' | 'gallery',
23
24
  // TODO: readd size when we get updated designs from spectrum
24
25
  // size?: 'S' | 'M' | 'L',
25
- orientation?: 'horizontal' | 'vertical'
26
+ orientation?: Orientation
26
27
  }
27
28
 
28
29
  interface LayoutOptions {
29
30
  // cardSize?: 'S' | 'M' | 'L',
30
- // cardOrientation?: 'horizontal' | 'vertical',
31
- collator?: Intl.Collator
31
+ cardOrientation?: Orientation,
32
+ collator?: Intl.Collator,
33
+ // TODO: is this valid or is scale a spectrum specific thing that should be left out of the layouts?
34
+ // Added here so we can keep the default item padding options within the layouts instead of having to
35
+ // do extra work in CardView to accomodate different sizing for scales
36
+ scale?: Scale
32
37
  }
33
38
 
34
39
  // TODO: double check if this is the best way to type the layout provided to the CardView
@@ -38,7 +43,7 @@ interface CardViewLayout<T> extends Layout<Node<T>>, KeyboardDelegate {
38
43
  isLoading: boolean,
39
44
  direction: Direction,
40
45
  layoutType: string,
41
- itemPadding: number
46
+ margin?: number
42
47
  }
43
48
 
44
49
  export interface CardViewLayoutConstructor<T> {
@@ -51,8 +56,7 @@ interface CardViewProps<T> extends CollectionBase<T>, MultipleSelection, Omit<As
51
56
  layout: CardViewLayoutConstructor<T> | CardViewLayout<T>,
52
57
  // TODO: readd size when we get updated designs from spectrum
53
58
  // cardSize?: 'S' | 'M' | 'L',
54
- // TODO: readd when we support horizontal cards in the layouts
55
- // cardOrientation?: 'horizontal' | 'vertical',
59
+ cardOrientation?: Orientation,
56
60
  isQuiet?: boolean,
57
61
  renderEmptyState?: () => ReactNode,
58
62
  loadingState?: LoadingState