@youversion/design-system-components 1.2.0 → 1.3.0
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 +21 -0
- package/dist/index.es.js +852 -834
- package/dist/index.umd.js +2 -2
- package/dist/src/List/List.stories.d.ts +1 -0
- package/dist/src/List/List.stories.d.ts.map +1 -1
- package/dist/src/ListItem/ListItem.d.ts +31 -3
- package/dist/src/ListItem/ListItem.d.ts.map +1 -1
- package/dist/src/ListItem/ListItem.stories.d.ts +30 -9
- package/dist/src/ListItem/ListItem.stories.d.ts.map +1 -1
- package/dist/src/Select/Select.d.ts +2 -0
- package/dist/src/Select/Select.d.ts.map +1 -1
- package/dist/src/Select/Select.stories.d.ts +1 -0
- package/dist/src/Select/Select.stories.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -6,6 +6,7 @@ export declare const FiveItems: import("@storybook/types").AnnotatedStoryFn<impo
|
|
|
6
6
|
export declare const WithDividers: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./List").ListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
7
7
|
export declare const WithOnClick: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./List").ListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
8
8
|
export declare const WithOnClickAndDividers: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./List").ListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
9
|
+
export declare const WithLinks: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./List").ListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
9
10
|
export declare const StartIcons: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./List").ListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
10
11
|
export declare const EndIcons: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./List").ListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
11
12
|
export declare const StartAndEndIcons: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./List").ListProps & import("react").RefAttributes<HTMLUListElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.stories.d.ts","sourceRoot":"","sources":["../../../src/List/List.stories.tsx"],"names":[],"mappings":";;AAMA,wBASuB;AAKvB,eAAO,MAAM,OAAO,6KAAoB,CAAC;AASzC,eAAO,MAAM,SAAS,6KAAoB,CAAC;AAuB3C,eAAO,MAAM,YAAY,6KAAoB,CAAC;AAuB9C,eAAO,MAAM,WAAW,6KAAoB,CAAC;AAuB7C,eAAO,MAAM,sBAAsB,6KAAoB,CAAC;AAuBxD,eAAO,MAAM,UAAU,6KAAoB,CAAC;AAsC5C,eAAO,MAAM,QAAQ,6KAAoB,CAAC;AAsC1C,eAAO,MAAM,gBAAgB,6KAAoB,CAAC;AAqDlD,eAAO,MAAM,wBAAwB,6KAAoB,CAAC;AAqD1D,eAAO,MAAM,WAAW,6KAAoB,CAAC;AAgD7C,eAAO,MAAM,SAAS,6KAAoB,CAAC;AAgD3C,eAAO,MAAM,iCAAiC,6KAAoB,CAAC;AAqInE,eAAO,MAAM,YAAY,6KAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"List.stories.d.ts","sourceRoot":"","sources":["../../../src/List/List.stories.tsx"],"names":[],"mappings":";;AAMA,wBASuB;AAKvB,eAAO,MAAM,OAAO,6KAAoB,CAAC;AASzC,eAAO,MAAM,SAAS,6KAAoB,CAAC;AAuB3C,eAAO,MAAM,YAAY,6KAAoB,CAAC;AAuB9C,eAAO,MAAM,WAAW,6KAAoB,CAAC;AAuB7C,eAAO,MAAM,sBAAsB,6KAAoB,CAAC;AAuBxD,eAAO,MAAM,SAAS,6KAAoB,CAAC;AAsC3C,eAAO,MAAM,UAAU,6KAAoB,CAAC;AAsC5C,eAAO,MAAM,QAAQ,6KAAoB,CAAC;AAsC1C,eAAO,MAAM,gBAAgB,6KAAoB,CAAC;AAqDlD,eAAO,MAAM,wBAAwB,6KAAoB,CAAC;AAqD1D,eAAO,MAAM,WAAW,6KAAoB,CAAC;AAgD7C,eAAO,MAAM,SAAS,6KAAoB,CAAC;AAgD3C,eAAO,MAAM,iCAAiC,6KAAoB,CAAC;AAqInE,eAAO,MAAM,YAAY,6KAAoB,CAAC"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface ListItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
1
|
+
import { ComponentPropsWithoutRef, ElementType, LiHTMLAttributes, ReactElement, Ref } from 'react';
|
|
2
|
+
export interface ListItemProps<TComponent extends ElementType> extends LiHTMLAttributes<HTMLLIElement> {
|
|
3
3
|
children: React.ReactNode;
|
|
4
|
+
/** Class names of the `<li>` component. */
|
|
4
5
|
className?: string;
|
|
6
|
+
/** The component type just inside the `<li>`. Defaults to `div`. */
|
|
7
|
+
component?: TComponent;
|
|
8
|
+
/** Props to pass to the component just inside the `<li>`.*/
|
|
9
|
+
componentProps?: ComponentPropsWithoutRef<ElementType extends TComponent ? 'div' : TComponent>;
|
|
5
10
|
disabled?: boolean;
|
|
6
11
|
/** Display a divider between ListItems. */
|
|
7
12
|
divider?: boolean;
|
|
13
|
+
/** Class names for the component just inside the `<li>`. */
|
|
8
14
|
innerBoxClassName?: string;
|
|
15
|
+
/** Function to run in `onClick, onKeyUp, onTouchEnd` events. */
|
|
9
16
|
onClick?: () => void;
|
|
10
17
|
}
|
|
11
18
|
/**
|
|
@@ -52,6 +59,27 @@ export interface ListItemProps extends LiHTMLAttributes<HTMLLIElement> {
|
|
|
52
59
|
* )
|
|
53
60
|
* }
|
|
54
61
|
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* Renders a list item as a link.
|
|
65
|
+
* ```tsx
|
|
66
|
+
* import { ListItem } from '@youversion/design-system-components';
|
|
67
|
+
*
|
|
68
|
+
* function MyComponent() {
|
|
69
|
+
* return (
|
|
70
|
+
* <ListItem
|
|
71
|
+
* component='a'
|
|
72
|
+
* componentProps={{
|
|
73
|
+
* href: 'https://example.com',
|
|
74
|
+
* rel: 'noopener noreferrer',
|
|
75
|
+
* target: '_blank'
|
|
76
|
+
* }}
|
|
77
|
+
* />
|
|
78
|
+
* );
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
55
81
|
*/
|
|
56
|
-
export declare const ListItem:
|
|
82
|
+
export declare const ListItem: <T extends ElementType<any>>(p: ListItemProps<T> & {
|
|
83
|
+
ref?: Ref<HTMLLIElement> | undefined;
|
|
84
|
+
}) => ReactElement;
|
|
57
85
|
//# sourceMappingURL=ListItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EAExB,WAAW,EAIX,gBAAgB,EAEhB,YAAY,EACZ,GAAG,EACJ,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,aAAa,CAAC,UAAU,SAAS,WAAW,CAAE,SAAQ,gBAAgB,CAAC,aAAa,CAAC;IACpG,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,4DAA4D;IAC5D,cAAc,CAAC,EAAE,wBAAwB,CAAC,WAAW,SAAS,UAAU,GAAG,KAAK,GAAG,UAAU,CAAC,CAAC;IAC/F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gEAAgE;IAChE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAyDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,eAAO,MAAM,QAAQ;;MAEhB,YAAY,CAAC"}
|
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps
|
|
2
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
3
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
4
|
+
}>;
|
|
3
5
|
export default _default;
|
|
4
|
-
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare const
|
|
11
|
-
|
|
6
|
+
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
7
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const WithHref: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
10
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const WithStartIcon: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
13
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const WithEndIcon: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
16
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const StartAndEndIcons: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
19
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const WithStartAction: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
22
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const WithEndActions: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
25
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const StartAndEndActions: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
28
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const WithPopoverActions: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./ListItem").ListItemProps<import("react").ElementType<any>> & {
|
|
31
|
+
ref?: import("react").Ref<HTMLLIElement> | undefined;
|
|
32
|
+
}>;
|
|
12
33
|
//# sourceMappingURL=ListItem.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.stories.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItem.stories.d.ts","sourceRoot":"","sources":["../../../src/ListItem/ListItem.stories.tsx"],"names":[],"mappings":";;;;AAkBA,wBAM2B;AAe3B,eAAO,MAAM,OAAO;;EAAoB,CAAC;AAYzC,eAAO,MAAM,QAAQ;;EAAoB,CAAC;AAgB1C,eAAO,MAAM,aAAa;;EAAoB,CAAC;AAc/C,eAAO,MAAM,WAAW;;EAAoB,CAAC;AAc7C,eAAO,MAAM,gBAAgB;;EAAoB,CAAC;AAkBlD,eAAO,MAAM,eAAe;;EAAoB,CAAC;AAgBjD,eAAO,MAAM,cAAc;;EAAoB,CAAC;AAqBhD,eAAO,MAAM,kBAAkB;;EAAoB,CAAC;AA+JpD,eAAO,MAAM,kBAAkB;;EAA2B,CAAC"}
|
|
@@ -9,6 +9,8 @@ export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement
|
|
|
9
9
|
error?: string;
|
|
10
10
|
/** A hint to provide to the user. */
|
|
11
11
|
hint?: string;
|
|
12
|
+
/** An icon that can be passed in to the select. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
12
14
|
/** This shows up above the selected options when an item is selected. */
|
|
13
15
|
label?: string;
|
|
14
16
|
/** The name of the select. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAIL,oBAAoB,EAKrB,MAAM,OAAO,CAAC;AAiBf,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IAC5G,mDAAmD;IACnD,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAIL,oBAAoB,EAKrB,MAAM,OAAO,CAAC;AAiBf,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IAC5G,mDAAmD;IACnD,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;CACd;AAsED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,MAAM,2GAA8B,CAAC"}
|
|
@@ -6,6 +6,7 @@ export declare const Controlled: () => JSX.Element;
|
|
|
6
6
|
export declare const ControlledNoLabel: () => JSX.Element;
|
|
7
7
|
export declare const UncontrolledNoLabel: () => JSX.Element;
|
|
8
8
|
export declare const UncontrolledWithLabel: () => JSX.Element;
|
|
9
|
+
export declare const UncontrolledWithLabelAndIcon: () => JSX.Element;
|
|
9
10
|
export declare const UncontrolledNoLabelOrPlaceholder: () => JSX.Element;
|
|
10
11
|
export declare const UncontrolledWithLabelNoPlaceholder: () => JSX.Element;
|
|
11
12
|
export declare const NoPlaceholder: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, import("./Select").SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/Select/Select.stories.tsx"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"Select.stories.d.ts","sourceRoot":"","sources":["../../../src/Select/Select.stories.tsx"],"names":[],"mappings":";;AAmBA,wBAsCyB;AAOzB,eAAO,MAAM,OAAO,kLAAoB,CAAC;AAGzC,eAAO,MAAM,UAAU,mBActB,CAAC;AAEF,eAAO,MAAM,iBAAiB,mBAc7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,mBAQ/B,CAAC;AACF,eAAO,MAAM,qBAAqB,mBAQjC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBAQxC,CAAC;AAEF,eAAO,MAAM,gCAAgC,mBAQ5C,CAAC;AACF,eAAO,MAAM,kCAAkC,mBAQ9C,CAAC;AAEF,eAAO,MAAM,aAAa,kLAAoB,CAAC;AAM/C,eAAO,MAAM,gBAAgB,kLAAoB,CAAC;AAKlD,eAAO,MAAM,QAAQ,kLAAoB,CAAC;AAK1C,eAAO,MAAM,SAAS,kLAAoB,CAAC;AAK3C,eAAO,MAAM,QAAQ,kLAAoB,CAAC;AAQ1C,eAAO,MAAM,kBAAkB,kLAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@youversion/design-system-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"main": "./dist/index.umd.js",
|
|
5
5
|
"module": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"validate": "yarn lint && yarn typecheck && yarn test"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@youversion/design-system-core": "1.
|
|
25
|
-
"@youversion/design-system-icons": "1.
|
|
24
|
+
"@youversion/design-system-core": "1.1.0",
|
|
25
|
+
"@youversion/design-system-icons": "1.1.0",
|
|
26
26
|
"@youversion/design-system-tokens": "1.3.0",
|
|
27
27
|
"clsx": "1.2.1",
|
|
28
28
|
"tailwind-merge": "1.13.2"
|