@youversion/design-system-components 0.0.20 → 0.0.22

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @youversion/design-system-components
2
2
 
3
+ ## 0.0.22
4
+
5
+ ### Patch Changes
6
+
7
+ - f11cfa9: Fixed types on `ListItem` component.
8
+
9
+ ## 0.0.21
10
+
11
+ ### Patch Changes
12
+
13
+ - 23bb542: Refactored `ListItem` component to allow for multiple endIcons and endActions. The prop `endIcons` now takes in an array of icons and the prop `endActions` now take an array of functions that correspond to the `endIcons` array. For example, if you pass `endIcons={[<DeleteIcon />, <DocumentIcon />]}` and `endActions={[function1, function2]}` then the `<DeleteIcon/>` uses `function1` and the `<DocumentIcon />` uses `function2`.
14
+
3
15
  ## 0.0.20
4
16
 
5
17
  ### Patch Changes
@@ -1,35 +1,17 @@
1
1
  import React, { LiHTMLAttributes } from 'react';
2
- interface StartIconWithActionProps {
3
- /** Action to take when clicking the startIcon. */
4
- startAction: () => void;
5
- startIcon: React.ReactNode;
6
- }
7
- interface StartIconWithOutActionProps {
8
- startAction?: never;
9
- startIcon?: React.ReactNode;
10
- }
11
- interface EndIconWithActionProps {
12
- /** Action to take when clicking the endIcon. */
13
- endAction: () => void;
14
- endIcon: React.ReactNode;
15
- }
16
- interface EndIconWithoutActionProps {
17
- endAction?: never;
18
- endIcon?: React.ReactNode;
19
- }
20
- type StartIconAndActionProps = StartIconWithActionProps | StartIconWithOutActionProps;
21
- type EndIconAndActionProps = EndIconWithActionProps | EndIconWithoutActionProps;
22
- type AllIconAndActionProps = StartIconAndActionProps & EndIconAndActionProps;
23
- interface ListItemPropsBase extends LiHTMLAttributes<HTMLLIElement> {
2
+ interface ListItemProps extends LiHTMLAttributes<HTMLLIElement> {
24
3
  children: React.ReactNode;
25
4
  className?: string;
26
5
  /** Display a divider between ListItems. */
27
6
  divider?: boolean;
28
- endIcon?: React.ReactNode;
7
+ /** Actions to take when clicking the endIcons. */
8
+ endActions?: Array<() => void | (() => Promise<void>)>;
9
+ endIcons?: Array<React.ReactNode>;
29
10
  onClick?: () => void;
11
+ /** Action to take when clicking the startIcon. */
12
+ startAction?: () => void | (() => Promise<void>);
30
13
  startIcon?: React.ReactNode;
31
14
  }
32
- export type ListItemProps = ListItemPropsBase & AllIconAndActionProps;
33
15
  /**
34
16
  * The **ListItem** component is to be used inside of the **List** component. This will be each item inside the list.
35
17
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA2C,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAIzF,UAAU,wBAAwB;IAChC,kDAAkD;IAClD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,UAAU,2BAA2B;IACnC,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,UAAU,sBAAsB;IAC9B,gDAAgD;IAChD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,UAAU,yBAAyB;IACjC,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,KAAK,uBAAuB,GAAG,wBAAwB,GAAG,2BAA2B,CAAC;AACtF,KAAK,qBAAqB,GAAG,sBAAsB,GAAG,yBAAyB,CAAC;AAChF,KAAK,qBAAqB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC;AAE7E,UAAU,iBAAkB,SAAQ,gBAAgB,CAAC,aAAa,CAAC;IACjE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB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