@pantheon-systems/pds-toolkit-react 1.0.0-dev.189 → 1.0.0-dev.190

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.
@@ -1,38 +1,65 @@
1
1
  import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import { GridGapOptions } from '@layouts/layout-types';
2
3
  import './flex-container.css';
4
+ type FlexAlignContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';
5
+ type FlexAlignItems = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline';
6
+ type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
7
+ type FlexJustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
8
+ type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
9
+ type FlexGapOptions = GridGapOptions | 'none';
3
10
  interface FlexContainerProps extends ComponentPropsWithoutRef<'div'> {
4
11
  /**
5
- * Align content
12
+ * Aligns content when there is extra space in the cross-axis.
6
13
  */
7
- alignContent?: 'start' | 'end' | 'center';
14
+ alignContent?: FlexAlignContent;
8
15
  /**
9
- * Align items
16
+ * Aligns items on the cross axis.
10
17
  */
11
- alignItems?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
18
+ alignItems?: FlexAlignItems;
12
19
  /**
13
- * Flex direction
20
+ * Establishes the main-axis, thus defining the direction flex items are placed in the flex container.
14
21
  */
15
- flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
22
+ flexDirection?: FlexDirection;
16
23
  /**
17
- * Flex wrap
24
+ * If the items do not fit in one line (row or column, depending on flexDirection), how should they wrap.
18
25
  */
19
- flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
26
+ flexWrap?: FlexWrap;
20
27
  /**
21
- * Justify content
28
+ * Gap between items.
22
29
  */
23
- justifyContent?: 'start' | 'end' | 'center' | 'between';
30
+ gap?: FlexGapOptions;
24
31
  /**
25
- * How should the flex-direction at mobile (small breakpoint)
32
+ * Alignment along the main axis.
26
33
  */
27
- mobileFlex?: 'none' | 'reverse' | 'same';
34
+ justifyContent?: FlexJustifyContent;
28
35
  /**
29
- * Gap size
36
+ * Align content on mobile. If not set, will default to the same value as `alignContent`.
30
37
  */
31
- spacing?: 'narrow' | 'standard' | 'wide';
38
+ mobileAlignContent?: FlexAlignContent;
32
39
  /**
33
- * Container content
40
+ * Align items on mobile. If not set, will default to the same value as `alignItems`.
34
41
  */
35
- children: ReactNode;
42
+ mobileAlignItems?: FlexAlignItems;
43
+ /**
44
+ * Flex direction for mobile.
45
+ */
46
+ mobileFlexDirection?: FlexDirection;
47
+ /**
48
+ * Flex wrap for mobile. If not set, will default to the same value as `flexWrap`.
49
+ */
50
+ mobileFlexWrap?: FlexWrap;
51
+ /**
52
+ * Gap between items on mobile. If not set, will default to the same value as `gap`.
53
+ */
54
+ mobileGap?: FlexGapOptions;
55
+ /**
56
+ * Justify content for mobile. If not set, will default to the same value as `justifyContent`.
57
+ */
58
+ mobileJustifyContent?: FlexJustifyContent;
59
+ /**
60
+ * Container content.
61
+ */
62
+ children?: ReactNode;
36
63
  /**
37
64
  * Additional class names
38
65
  */
@@ -41,5 +68,5 @@ interface FlexContainerProps extends ComponentPropsWithoutRef<'div'> {
41
68
  /**
42
69
  * Flex Container UI component
43
70
  */
44
- export declare const FlexContainer: ({ alignContent, alignItems, flexDirection, flexWrap, justifyContent, mobileFlex, spacing, children, className, ...props }: FlexContainerProps) => React.JSX.Element;
71
+ export declare const FlexContainer: ({ alignContent, alignItems, flexDirection, flexWrap, gap, justifyContent, mobileAlignItems, mobileAlignContent, mobileFlexDirection, mobileFlexWrap, mobileGap, mobileJustifyContent, children, className, ...props }: FlexContainerProps) => React.JSX.Element;
45
72
  export {};
@@ -0,0 +1 @@
1
+ export declare const useWindowWidth: () => number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pantheon-systems/pds-toolkit-react",
3
3
  "technology": "React",
4
- "version": "1.0.0-dev.189",
4
+ "version": "1.0.0-dev.190",
5
5
  "description": "PDS toolkit built using the React framework",
6
6
  "repository": {
7
7
  "type": "git",