@youversion/design-system-components 0.0.2 → 0.0.5
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 +29 -0
- package/dist/Box/Box.d.ts +44 -0
- package/dist/Box/Box.d.ts.map +1 -0
- package/dist/Box/index.d.ts +2 -0
- package/dist/Box/index.d.ts.map +1 -0
- package/dist/Button/Button.d.ts +78 -0
- package/dist/Button/Button.d.ts.map +1 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.d.ts.map +1 -0
- package/dist/IconButton/IconButton.d.ts +27 -0
- package/dist/IconButton/IconButton.d.ts.map +1 -0
- package/dist/IconButton/index.d.ts +2 -0
- package/dist/IconButton/index.d.ts.map +1 -0
- package/dist/IconLinkButton/IconLinkButton.d.ts +34 -0
- package/dist/IconLinkButton/IconLinkButton.d.ts.map +1 -0
- package/dist/IconLinkButton/index.d.ts +2 -0
- package/dist/IconLinkButton/index.d.ts.map +1 -0
- package/dist/Input/Input.d.ts +47 -0
- package/dist/Input/Input.d.ts.map +1 -0
- package/dist/Input/index.d.ts +2 -0
- package/dist/Input/index.d.ts.map +1 -0
- package/dist/LinkButton/LinkButton.d.ts +42 -0
- package/dist/LinkButton/LinkButton.d.ts.map +1 -0
- package/dist/LinkButton/index.d.ts +2 -0
- package/dist/LinkButton/index.d.ts.map +1 -0
- package/dist/List/List.d.ts +32 -0
- package/dist/List/List.d.ts.map +1 -0
- package/dist/List/index.d.ts +2 -0
- package/dist/List/index.d.ts.map +1 -0
- package/dist/ListItem/ListItem.d.ts +58 -0
- package/dist/ListItem/ListItem.d.ts.map +1 -0
- package/dist/ListItem/index.d.ts +2 -0
- package/dist/ListItem/index.d.ts.map +1 -0
- package/dist/ListItemText/ListItemText.d.ts +34 -0
- package/dist/ListItemText/ListItemText.d.ts.map +1 -0
- package/dist/ListItemText/index.d.ts +2 -0
- package/dist/ListItemText/index.d.ts.map +1 -0
- package/dist/Tooltip/Tooltip.d.ts +34 -0
- package/dist/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/Tooltip/Tooltip.module.css.d.ts +6 -0
- package/dist/Tooltip/index.d.ts +2 -0
- package/dist/Tooltip/index.d.ts.map +1 -0
- package/dist/Typography/Heading/Heading.d.ts +30 -0
- package/dist/Typography/Heading/Heading.d.ts.map +1 -0
- package/dist/Typography/Heading/index.d.ts +2 -0
- package/dist/Typography/Heading/index.d.ts.map +1 -0
- package/dist/Typography/Text/Text.d.ts +19 -0
- package/dist/Typography/Text/Text.d.ts.map +1 -0
- package/dist/Typography/Text/index.d.ts +2 -0
- package/dist/Typography/Text/index.d.ts.map +1 -0
- package/dist/Typography/Typography.d.ts +44 -0
- package/dist/Typography/Typography.d.ts.map +1 -0
- package/dist/Typography/Variants.d.ts +5 -0
- package/dist/Typography/Variants.d.ts.map +1 -0
- package/dist/Typography/index.d.ts +3 -0
- package/dist/Typography/index.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useCombinedRefs.d.ts +33 -0
- package/dist/hooks/useCombinedRefs.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.js +596 -478
- package/dist/index.umd.js +10 -10
- package/dist/utils/get-resolved-dark-mode-value.d.ts +25 -0
- package/dist/utils/get-resolved-dark-mode-value.d.ts.map +1 -0
- package/dist/utils/get-resolved-logical-property.d.ts +25 -0
- package/dist/utils/get-resolved-logical-property.d.ts.map +1 -0
- package/dist/utils/tailwind-types.d.ts +29 -0
- package/dist/utils/tailwind-types.d.ts.map +1 -0
- package/package.json +6 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TypographyProps } from '../Typography';
|
|
2
|
+
/**
|
|
3
|
+
* Text is the used to render text and paragraphs within an interface. Text component renders as a **paragraph** tag by default. Other elements can be passed in through the **component** prop.
|
|
4
|
+
*
|
|
5
|
+
* @param variant - Predefined variants that are used throughout YV applications.
|
|
6
|
+
* @param size - Each `variant` has predefined sizes.
|
|
7
|
+
* @returns Renders a `paragraph` element.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { Text } from '@youversion/design-system-components';
|
|
12
|
+
*
|
|
13
|
+
* function MyComponent() {
|
|
14
|
+
* return <Text component='span' size='xs' variant='headline' />;
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const Text: import("react").ForwardRefExoticComponent<TypographyProps & import("react").RefAttributes<HTMLElement>>;
|
|
19
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../src/Typography/Text/Text.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAyBhD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,IAAI,yGAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Typography/Text/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BoxProps } from '../index';
|
|
2
|
+
export type FontOptions = 'primary' | 'secondary';
|
|
3
|
+
interface BaseTextProps extends Omit<BoxProps, 'size'> {
|
|
4
|
+
font?: FontOptions;
|
|
5
|
+
}
|
|
6
|
+
export interface NoneVariant extends BaseTextProps {
|
|
7
|
+
size?: never;
|
|
8
|
+
variant?: never;
|
|
9
|
+
}
|
|
10
|
+
export interface HeadlineVariant extends BaseTextProps {
|
|
11
|
+
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
12
|
+
variant: 'headline';
|
|
13
|
+
}
|
|
14
|
+
export interface LabelVariant extends BaseTextProps {
|
|
15
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
16
|
+
variant: 'label';
|
|
17
|
+
}
|
|
18
|
+
export interface ParagraphVariant extends BaseTextProps {
|
|
19
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
20
|
+
variant: 'paragraph';
|
|
21
|
+
}
|
|
22
|
+
export interface EyebrowVariant extends BaseTextProps {
|
|
23
|
+
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
24
|
+
variant: 'eyebrow';
|
|
25
|
+
}
|
|
26
|
+
export interface CaptionVariant extends BaseTextProps {
|
|
27
|
+
size: 'sm' | 'md' | 'lg';
|
|
28
|
+
variant: 'caption';
|
|
29
|
+
}
|
|
30
|
+
export interface ButtonLabelVariant extends BaseTextProps {
|
|
31
|
+
size: 'xs' | 'sm' | 'md' | 'lg';
|
|
32
|
+
variant: 'buttonLabel';
|
|
33
|
+
}
|
|
34
|
+
export interface FieldLabelVariant extends BaseTextProps {
|
|
35
|
+
size: 'sm' | 'md' | 'lg';
|
|
36
|
+
variant: 'fieldLabel';
|
|
37
|
+
}
|
|
38
|
+
export interface FieldTextInputVariant extends BaseTextProps {
|
|
39
|
+
size: 'md' | 'lg';
|
|
40
|
+
variant: 'fieldTextInput';
|
|
41
|
+
}
|
|
42
|
+
export type TypographyProps = HeadlineVariant | EyebrowVariant | CaptionVariant | ButtonLabelVariant | FieldLabelVariant | FieldTextInputVariant | NoneVariant | LabelVariant | ParagraphVariant;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=Typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../src/Typography/Typography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAElD,UAAU,aAAc,SAAQ,IAAI,CAAC,QAAQ,EAAE,MAAM,C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IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,MAAM,MAAM,eAAe,GACvB,eAAe,GACf,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,iBAAiB,GACjB,qBAAqB,GACrB,WAAW,GACX,YAAY,GACZ,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import { FontOptions, TypographyProps } from './Typography';
|
|
3
|
+
export declare const getFontVariantStyles: ({ size, variant }: TypographyProps) => string | undefined;
|
|
4
|
+
export declare const fontOptionStyles: Record<FontOptions, ClassValue>;
|
|
5
|
+
//# sourceMappingURL=Variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Variants.d.ts","sourceRoot":"","sources":["../../../src/Typography/Variants.ts"],"names":[],"mappings":"AAEA,OAAa,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAML,WAAW,EAIX,eAAe,EAChB,MAAM,cAAc,CAAC;AAuEtB,eAAO,MAAM,oBAAoB,sBAAuB,eAAe,uBAqBtE,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,WAAW,EAAE,UAAU,CAG5D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Typography/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ForwardedRef, MutableRefObject } from 'react';
|
|
2
|
+
export interface CombinedRefsProps<T> {
|
|
3
|
+
forwardedRef: ForwardedRef<any>;
|
|
4
|
+
innerRef: MutableRefObject<T>;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Combines `innerRef` and `forwardedRef` for a component.
|
|
8
|
+
*
|
|
9
|
+
* Accepts {@link CombinedRefsProps}.
|
|
10
|
+
*
|
|
11
|
+
* @returns Combination of the refs, to be used inside component where you would normally get ref.current.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { useCombinedRefs } from '../hooks';
|
|
16
|
+
* import { Input } from '@youversion/design-system-components';
|
|
17
|
+
*
|
|
18
|
+
* function MyComponent() {
|
|
19
|
+
*
|
|
20
|
+
* const combinedRef = useCombinedRefs({ forwardedRef, innerRef });
|
|
21
|
+
*
|
|
22
|
+
* return (
|
|
23
|
+
* <>
|
|
24
|
+
* <Input name='firstName' label='First Name' ref={combinedRef}/>
|
|
25
|
+
* </>
|
|
26
|
+
* )
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Copied from article on combining refs {@link https://itnext.io/reusing-the-ref-from-forwardref-with-react-hooks-4ce9df693dd}
|
|
31
|
+
*/
|
|
32
|
+
export declare const useCombinedRefs: <T>({ innerRef, forwardedRef }: CombinedRefsProps<T>) => MutableRefObject<T>;
|
|
33
|
+
//# sourceMappingURL=useCombinedRefs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCombinedRefs.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCombinedRefs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAa,MAAM,OAAO,CAAC;AAElE,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAElC,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IAChC,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,eAAO,MAAM,eAAe,8EAa3B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './Box';
|
|
2
|
+
export * from './Button';
|
|
3
|
+
export * from './IconButton';
|
|
4
|
+
export * from './IconLinkButton';
|
|
5
|
+
export * from './Input';
|
|
6
|
+
export * from './LinkButton';
|
|
7
|
+
export * from './List';
|
|
8
|
+
export * from './ListItem';
|
|
9
|
+
export * from './ListItemText';
|
|
10
|
+
export * from './Tooltip';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC"}
|