@alveole/components 0.11.2
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/README.md +13 -0
- package/dist/core/Box/Box.d.ts +13 -0
- package/dist/core/Box/Box.d.ts.map +1 -0
- package/dist/core/Box/Box.js +32 -0
- package/dist/core/Box/Box.types.d.ts +30 -0
- package/dist/core/Box/Box.types.d.ts.map +1 -0
- package/dist/core/Box/Box.types.js +1 -0
- package/dist/core/Box/index.d.ts +2 -0
- package/dist/core/Box/index.d.ts.map +1 -0
- package/dist/core/Box/index.js +1 -0
- package/dist/core/Typography/Typography.d.ts +13 -0
- package/dist/core/Typography/Typography.d.ts.map +1 -0
- package/dist/core/Typography/Typography.js +8 -0
- package/dist/core/Typography/Typography.types.d.ts +24 -0
- package/dist/core/Typography/Typography.types.d.ts.map +1 -0
- package/dist/core/Typography/Typography.types.js +1 -0
- package/dist/core/Typography/index.d.ts +2 -0
- package/dist/core/Typography/index.d.ts.map +1 -0
- package/dist/core/Typography/index.js +1 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @alveole/components
|
|
2
|
+
|
|
3
|
+
Librairie de composants UI partagés pour les applications Alveole.
|
|
4
|
+
|
|
5
|
+
Le package contient les composants de base réutilisables, s'appuie sur le package `@alveole/theme` pour les tokens.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @alveole/components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Peer deps requis : `react`, `react-native`, `@tamagui/core`, `@alveole/theme`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RNTamaguiViewNonStyleProps, TamaguiElement, ViewProps as TamaguiViewProps } from '@tamagui/core';
|
|
2
|
+
import React, { CSSProperties } from 'react';
|
|
3
|
+
import { BoxStyle } from './Box.types';
|
|
4
|
+
export type BoxProps = Pick<TamaguiViewProps, 'exitStyle' | 'focusStyle' | 'pressStyle' | 'disabledStyle'> & RNTamaguiViewNonStyleProps & BoxStyle & {
|
|
5
|
+
hoverStyle?: CSSProperties;
|
|
6
|
+
};
|
|
7
|
+
export type BoxElement = TamaguiElement;
|
|
8
|
+
export declare const Box: React.ForwardRefExoticComponent<Pick<import("@tamagui/web").StackProps, "pressStyle" | "focusStyle" | "disabledStyle" | "exitStyle"> & RNTamaguiViewNonStyleProps & Pick<import("@tamagui/web").StackProps, "display" | "flex" | "flexWrap" | "flexDirection" | "opacity" | "overflow"> & {
|
|
9
|
+
justify?: TamaguiViewProps["justifyContent"];
|
|
10
|
+
} & import("./Box.types").BoxAdvancedStyle & {
|
|
11
|
+
hoverStyle?: CSSProperties;
|
|
12
|
+
} & React.RefAttributes<TamaguiElement>>;
|
|
13
|
+
//# sourceMappingURL=Box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../src/core/Box/Box.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAE1B,cAAc,EAEd,SAAS,IAAI,gBAAgB,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,eAAe,CAAC,GACxG,0BAA0B,GAC1B,QAAQ,GAAG;IACT,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,CAAC;AAGJ,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC;AAExC,eAAO,MAAM,GAAG;;;iBANC,aAAa;wCAgD5B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { isSpacingKey, Spacings } from '@alveole/theme';
|
|
3
|
+
import { styled, View as TamaguiView, } from '@tamagui/core';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
const StyledView = styled(TamaguiView, { name: 'Box' });
|
|
6
|
+
export const Box = React.forwardRef(function Box(props, ref) {
|
|
7
|
+
const { tag, style, borderRadius, hoverStyle, mt, mb, mr, ml, m, pt, pb, pl, pr, p, gap, ...viewProps } = props;
|
|
8
|
+
const radius = {
|
|
9
|
+
borderBottomRightRadius: borderRadius,
|
|
10
|
+
borderTopRightRadius: borderRadius,
|
|
11
|
+
borderBottomLeftRadius: borderRadius,
|
|
12
|
+
borderTopLeftRadius: borderRadius,
|
|
13
|
+
};
|
|
14
|
+
const margins = {
|
|
15
|
+
mt: isSpacingKey(mt) ? Spacings[mt] : mt,
|
|
16
|
+
mb: isSpacingKey(mb) ? Spacings[mb] : mb,
|
|
17
|
+
ml: isSpacingKey(ml) ? Spacings[ml] : ml,
|
|
18
|
+
mr: isSpacingKey(mr) ? Spacings[mr] : mr,
|
|
19
|
+
m: isSpacingKey(m) ? Spacings[m] : m,
|
|
20
|
+
};
|
|
21
|
+
const paddings = {
|
|
22
|
+
pt: isSpacingKey(pt) ? Spacings[pt] : pt,
|
|
23
|
+
pb: isSpacingKey(pb) ? Spacings[pb] : pb,
|
|
24
|
+
pl: isSpacingKey(pl) ? Spacings[pl] : pl,
|
|
25
|
+
pr: isSpacingKey(pr) ? Spacings[pr] : pr,
|
|
26
|
+
p: isSpacingKey(p) ? Spacings[p] : p,
|
|
27
|
+
};
|
|
28
|
+
const spacings = {
|
|
29
|
+
gap: isSpacingKey(gap) ? Spacings[gap] : gap,
|
|
30
|
+
};
|
|
31
|
+
return (_jsx(StyledView, { ref: ref, tag: tag ?? 'box', style: style, ...radius, hoverStyle: hoverStyle, ...viewProps, ...margins, ...paddings, ...spacings }));
|
|
32
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SpacingKey } from '@alveole/theme';
|
|
2
|
+
import { ViewProps } from '@tamagui/core';
|
|
3
|
+
export type BoxBaseStyle = Pick<ViewProps, 'display' | 'flex' | 'flexWrap' | 'flexDirection' | 'opacity' | 'overflow'> & {
|
|
4
|
+
justify?: ViewProps['justifyContent'];
|
|
5
|
+
};
|
|
6
|
+
export type BoxAdvancedStyle = {
|
|
7
|
+
p?: number | SpacingKey;
|
|
8
|
+
pl?: number | SpacingKey;
|
|
9
|
+
pr?: number | SpacingKey;
|
|
10
|
+
pt?: number | SpacingKey;
|
|
11
|
+
pb?: number | SpacingKey;
|
|
12
|
+
m?: number | `${string}%` | SpacingKey | 'auto';
|
|
13
|
+
ml?: number | `${string}%` | SpacingKey | 'auto';
|
|
14
|
+
mr?: number | `${string}%` | SpacingKey | 'auto';
|
|
15
|
+
mt?: number | `${string}%` | SpacingKey | 'auto';
|
|
16
|
+
mb?: number | `${string}%` | SpacingKey | 'auto';
|
|
17
|
+
backgroundColor?: string;
|
|
18
|
+
borderWidth?: number;
|
|
19
|
+
borderRadius?: number;
|
|
20
|
+
borderColor?: any;
|
|
21
|
+
gap?: number | SpacingKey;
|
|
22
|
+
width?: number | `${string}%`;
|
|
23
|
+
height?: number | `${string}%`;
|
|
24
|
+
minW?: number | `${string}%`;
|
|
25
|
+
maxW?: number | `${string}%`;
|
|
26
|
+
minH?: number | `${string}%`;
|
|
27
|
+
maxH?: number | `${string}%`;
|
|
28
|
+
};
|
|
29
|
+
export type BoxStyle = BoxBaseStyle & BoxAdvancedStyle;
|
|
30
|
+
//# sourceMappingURL=Box.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.types.d.ts","sourceRoot":"","sources":["../../../src/core/Box/Box.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAg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AAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/Box/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Box';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RNTamaguiTextNonStyleProps, TamaguiTextElement, TextProps as TamaguiTextProps } from '@tamagui/core';
|
|
2
|
+
import React, { CSSProperties } from 'react';
|
|
3
|
+
import type { TypographyStyle } from './Typography.types';
|
|
4
|
+
export type TypographyProps = Pick<TamaguiTextProps, 'exitStyle' | 'focusStyle' | 'pressStyle' | 'disabledStyle'> & Omit<RNTamaguiTextNonStyleProps, 'children'> & TypographyStyle & {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
hoverStyle?: CSSProperties;
|
|
7
|
+
};
|
|
8
|
+
export type TypographyElement = TamaguiTextElement;
|
|
9
|
+
export declare const Typography: React.ForwardRefExoticComponent<Pick<TamaguiTextProps, "pressStyle" | "focusStyle" | "disabledStyle" | "exitStyle"> & Omit<RNTamaguiTextNonStyleProps, "children"> & import("./Typography.types").TypographyBaseStyle & import("./Typography.types").TypographyAdvancedStyle & {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
hoverStyle?: CSSProperties;
|
|
12
|
+
} & React.RefAttributes<TamaguiTextElement>>;
|
|
13
|
+
//# sourceMappingURL=Typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../src/core/Typography/Typography.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAG1B,kBAAkB,EAClB,SAAS,IAAI,gBAAgB,EAC9B,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,YAAY,GAAG,YAAY,GAAG,eAAe,CAAC,GAC/G,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAAC,GAC5C,eAAe,GAAG;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,UAAU,CAAC,EAAE,aAAa,CAAC;CAC5B,CAAC;AAGJ,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAEnD,eAAO,MAAM,UAAU;cAPT,KAAK,CAAC,SAAS;iBACZ,aAAa;4CAkB5B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { styled, Text as TamaguiText, } from '@tamagui/core';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
const StyledTypography = styled(TamaguiText, { name: 'Typography' });
|
|
5
|
+
export const Typography = React.forwardRef(function Typography(props, ref) {
|
|
6
|
+
const { tag, style, textAlign, hoverStyle, ...textProps } = props;
|
|
7
|
+
return (_jsx(StyledTypography, { ref: ref, hoverStyle: hoverStyle, tag: tag ?? 'typography', style: style, textAlign: textAlign, ...textProps }));
|
|
8
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TextProps } from '@tamagui/core';
|
|
2
|
+
export type TypographyBaseStyle = Pick<TextProps, 'textTransform' | 'fontSize' | 'fontStyle' | 'lineHeight' | 'textDecorationLine' | 'color'>;
|
|
3
|
+
export type TypographyAdvancedStyle = {
|
|
4
|
+
p?: number;
|
|
5
|
+
pl?: number;
|
|
6
|
+
pr?: number;
|
|
7
|
+
pt?: number;
|
|
8
|
+
pb?: number;
|
|
9
|
+
m?: number | `${string}%` | 'auto';
|
|
10
|
+
ml?: number | `${string}%` | 'auto';
|
|
11
|
+
mr?: number | `${string}%` | 'auto';
|
|
12
|
+
mt?: number | `${string}%` | 'auto';
|
|
13
|
+
mb?: number | `${string}%` | 'auto';
|
|
14
|
+
background?: string;
|
|
15
|
+
width?: number | `${string}%`;
|
|
16
|
+
height?: number | `${string}%`;
|
|
17
|
+
minW?: number | `${string}%`;
|
|
18
|
+
maxW?: number | `${string}%`;
|
|
19
|
+
minH?: number | `${string}%`;
|
|
20
|
+
maxH?: number | `${string}%`;
|
|
21
|
+
textAlign?: TextProps['textAlign'];
|
|
22
|
+
};
|
|
23
|
+
export type TypographyStyle = TypographyBaseStyle & TypographyAdvancedStyle;
|
|
24
|
+
//# sourceMappingURL=Typography.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Typography.types.d.ts","sourceRoot":"","sources":["../../../src/core/Typography/Typography.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,SAAS,EACT,eAAe,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,oBAAoB,GAAG,OAAO,CAC3F,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,GAAG,MAAM,CAAC;IACnC,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,GAAG,MAAM,CAAC;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,GAAG,MAAM,CAAC;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,GAAG,MAAM,CAAC;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,GAAG,MAAM,CAAC;IAEpC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC;IAE7B,SAAS,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/Typography/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Typography';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './core';
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alveole/components",
|
|
3
|
+
"version": "0.11.2",
|
|
4
|
+
"description": "Shared UI components.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc -p tsconfig.build.json",
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"typecheck": "tsc -p tsconfig.typecheck.json --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@alveole/eslint-config": "file:../eslint-config",
|
|
19
|
+
"eslint": "^9.39.2"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@alveole/theme": "*",
|
|
23
|
+
"@tamagui/core": "*",
|
|
24
|
+
"react": "*",
|
|
25
|
+
"react-native": "*"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|