onecart-ui 0.1.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.
Files changed (62) hide show
  1. package/README.md +186 -0
  2. package/dist/Button/Button.mobile.d.ts +4 -0
  3. package/dist/Button/Button.types.d.ts +43 -0
  4. package/dist/Button/Button.web.d.ts +4 -0
  5. package/dist/Button/buttonStyles.d.ts +12 -0
  6. package/dist/Button/index.d.ts +1 -0
  7. package/dist/Button/index.mobile.d.ts +1 -0
  8. package/dist/Typography/Body/index.d.ts +3 -0
  9. package/dist/Typography/Display/index.d.ts +3 -0
  10. package/dist/Typography/Heading/index.d.ts +3 -0
  11. package/dist/Typography/Utility/index.d.ts +3 -0
  12. package/dist/Typography/index.d.ts +4 -0
  13. package/dist/components/Button.d.ts +1 -0
  14. package/dist/components/Icon.d.ts +10 -0
  15. package/dist/components/index.d.ts +4 -0
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.js +2057 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/index.mobile.js +1803 -0
  20. package/dist/index.mobile.js.map +1 -0
  21. package/dist/mobile/index.d.ts +2 -0
  22. package/dist/src/Button/Button.mobile.d.ts +4 -0
  23. package/dist/src/Button/Button.types.d.ts +43 -0
  24. package/dist/src/Button/Button.web.d.ts +4 -0
  25. package/dist/src/Button/buttonStyles.d.ts +12 -0
  26. package/dist/src/Button/index.d.ts +2 -0
  27. package/dist/src/Button/index.mobile.d.ts +2 -0
  28. package/dist/src/Typography/Body/Body.mobile.d.ts +3 -0
  29. package/dist/src/Typography/Body/Body.web.d.ts +3 -0
  30. package/dist/src/Typography/Body/index.d.ts +1 -0
  31. package/dist/src/Typography/Body/index.mobile.d.ts +1 -0
  32. package/dist/src/Typography/Display/Display.mobile.d.ts +3 -0
  33. package/dist/src/Typography/Display/Display.web.d.ts +3 -0
  34. package/dist/src/Typography/Display/index.d.ts +1 -0
  35. package/dist/src/Typography/Display/index.mobile.d.ts +1 -0
  36. package/dist/src/Typography/Heading/Heading.mobile.d.ts +3 -0
  37. package/dist/src/Typography/Heading/Heading.web.d.ts +3 -0
  38. package/dist/src/Typography/Heading/index.d.ts +1 -0
  39. package/dist/src/Typography/Heading/index.mobile.d.ts +1 -0
  40. package/dist/src/Typography/Typography.types.d.ts +51 -0
  41. package/dist/src/Typography/Utility/Utility.mobile.d.ts +3 -0
  42. package/dist/src/Typography/Utility/Utility.web.d.ts +3 -0
  43. package/dist/src/Typography/Utility/index.d.ts +1 -0
  44. package/dist/src/Typography/Utility/index.mobile.d.ts +1 -0
  45. package/dist/src/Typography/index.d.ts +5 -0
  46. package/dist/src/Typography/index.mobile.d.ts +5 -0
  47. package/dist/src/components/Button.d.ts +1 -0
  48. package/dist/src/components/Icon.d.ts +10 -0
  49. package/dist/src/components/index.d.ts +4 -0
  50. package/dist/src/index.d.ts +2 -0
  51. package/dist/src/styles/tokens/typography.d.ts +138 -0
  52. package/dist/src/theme/ThemeProvider.d.ts +5 -0
  53. package/dist/src/tokens/design-tokens.d.ts +54 -0
  54. package/dist/styles/tokens/typography.d.ts +138 -0
  55. package/dist/theme/ThemeProvider.d.ts +5 -0
  56. package/dist/tokens/design-tokens.d.ts +54 -0
  57. package/dist/types/Button.d.ts +24 -0
  58. package/dist/types/Typography.d.ts +32 -0
  59. package/package.json +102 -0
  60. package/tokens/tokens.css +7 -0
  61. package/tokens/tokens.d.ts +2 -0
  62. package/tokens/tokens.js +3 -0
@@ -0,0 +1,138 @@
1
+ export declare const typographyTokens: {
2
+ display2xl: {
3
+ fontFamily: string;
4
+ fontSize: number;
5
+ lineHeight: number;
6
+ fontWeight: string;
7
+ color: string;
8
+ letterSpacing: string;
9
+ textDecoration: string;
10
+ };
11
+ displayXl: {
12
+ fontFamily: string;
13
+ fontSize: number;
14
+ lineHeight: number;
15
+ fontWeight: string;
16
+ color: string;
17
+ letterSpacing: string;
18
+ textDecoration: string;
19
+ };
20
+ headingXl: {
21
+ fontFamily: string;
22
+ fontSize: number;
23
+ lineHeight: number;
24
+ fontWeight: string;
25
+ color: string;
26
+ letterSpacing: string;
27
+ textDecoration: string;
28
+ };
29
+ headingLg: {
30
+ fontFamily: string;
31
+ fontSize: number;
32
+ lineHeight: number;
33
+ fontWeight: string;
34
+ color: string;
35
+ letterSpacing: string;
36
+ textDecoration: string;
37
+ };
38
+ headingMd: {
39
+ fontFamily: string;
40
+ fontSize: number;
41
+ lineHeight: number;
42
+ fontWeight: string;
43
+ color: string;
44
+ letterSpacing: string;
45
+ textDecoration: string;
46
+ };
47
+ headingSm: {
48
+ fontFamily: string;
49
+ fontSize: number;
50
+ lineHeight: number;
51
+ fontWeight: string;
52
+ color: string;
53
+ letterSpacing: string;
54
+ textDecoration: string;
55
+ };
56
+ headingXs: {
57
+ fontFamily: string;
58
+ fontSize: number;
59
+ lineHeight: number;
60
+ fontWeight: string;
61
+ color: string;
62
+ letterSpacing: string;
63
+ textDecoration: string;
64
+ };
65
+ heading2xs: {
66
+ fontFamily: string;
67
+ fontSize: number;
68
+ lineHeight: number;
69
+ fontWeight: string;
70
+ color: string;
71
+ letterSpacing: string;
72
+ textDecoration: string;
73
+ };
74
+ bodyXl: {
75
+ fontFamily: string;
76
+ fontSize: number;
77
+ lineHeight: number;
78
+ fontWeight: string;
79
+ color: string;
80
+ letterSpacing: string;
81
+ textDecoration: string;
82
+ };
83
+ bodyLg: {
84
+ fontFamily: string;
85
+ fontSize: number;
86
+ lineHeight: number;
87
+ fontWeight: string;
88
+ color: string;
89
+ letterSpacing: string;
90
+ textDecoration: string;
91
+ };
92
+ bodyMd: {
93
+ fontFamily: string;
94
+ fontSize: number;
95
+ lineHeight: number;
96
+ fontWeight: string;
97
+ color: string;
98
+ letterSpacing: string;
99
+ textDecoration: string;
100
+ };
101
+ bodySm: {
102
+ fontFamily: string;
103
+ fontSize: number;
104
+ lineHeight: number;
105
+ fontWeight: string;
106
+ color: string;
107
+ letterSpacing: string;
108
+ textDecoration: string;
109
+ };
110
+ labelLg: {
111
+ fontFamily: string;
112
+ fontSize: number;
113
+ lineHeight: number;
114
+ fontWeight: string;
115
+ color: string;
116
+ letterSpacing: string;
117
+ textDecoration: string;
118
+ };
119
+ labelMd: {
120
+ fontFamily: string;
121
+ fontSize: number;
122
+ lineHeight: number;
123
+ fontWeight: string;
124
+ color: string;
125
+ letterSpacing: string;
126
+ textDecoration: string;
127
+ };
128
+ labelSm: {
129
+ fontFamily: string;
130
+ fontSize: number;
131
+ lineHeight: number;
132
+ fontWeight: string;
133
+ color: string;
134
+ letterSpacing: string;
135
+ textDecoration: string;
136
+ };
137
+ };
138
+ export type TypographyTokenMap = typeof typographyTokens;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare const ThemeContext: React.Context<{}>;
3
+ export declare const ThemeProvider: React.FC<{
4
+ children: React.ReactNode;
5
+ }>;
@@ -0,0 +1,54 @@
1
+ export declare const buttonTokens: {
2
+ primary: {
3
+ default: string;
4
+ hover: string;
5
+ active: string;
6
+ disabled: string;
7
+ };
8
+ secondary: {
9
+ default: string;
10
+ hover: string;
11
+ active: string;
12
+ disabled: string;
13
+ };
14
+ outline: {
15
+ borderDefault: string;
16
+ borderHover: string;
17
+ borderActive: string;
18
+ text: {
19
+ default: string;
20
+ hover: string;
21
+ active: string;
22
+ disabled: string;
23
+ };
24
+ };
25
+ ghost: {
26
+ text: {
27
+ default: string;
28
+ hover: string;
29
+ active: string;
30
+ disabled: string;
31
+ };
32
+ };
33
+ destructive: {
34
+ text: {
35
+ default: string;
36
+ hover: string;
37
+ active: string;
38
+ disabled: string;
39
+ };
40
+ };
41
+ spacing: {
42
+ none: string | number;
43
+ cardSm: string;
44
+ gapMd: string;
45
+ gapXs: string;
46
+ };
47
+ radius: string;
48
+ typography: {
49
+ family: string;
50
+ weightMedium: string | number;
51
+ };
52
+ neutralText: string;
53
+ };
54
+ export type ButtonTokenMap = typeof buttonTokens;
@@ -0,0 +1,138 @@
1
+ export declare const typographyTokens: {
2
+ display2xl: {
3
+ fontFamily: string;
4
+ fontSize: number;
5
+ lineHeight: number;
6
+ fontWeight: string;
7
+ color: string;
8
+ letterSpacing: string;
9
+ textDecoration: string;
10
+ };
11
+ displayXl: {
12
+ fontFamily: string;
13
+ fontSize: number;
14
+ lineHeight: number;
15
+ fontWeight: string;
16
+ color: string;
17
+ letterSpacing: string;
18
+ textDecoration: string;
19
+ };
20
+ headingXl: {
21
+ fontFamily: string;
22
+ fontSize: number;
23
+ lineHeight: number;
24
+ fontWeight: string;
25
+ color: string;
26
+ letterSpacing: string;
27
+ textDecoration: string;
28
+ };
29
+ headingLg: {
30
+ fontFamily: string;
31
+ fontSize: number;
32
+ lineHeight: number;
33
+ fontWeight: string;
34
+ color: string;
35
+ letterSpacing: string;
36
+ textDecoration: string;
37
+ };
38
+ headingMd: {
39
+ fontFamily: string;
40
+ fontSize: number;
41
+ lineHeight: number;
42
+ fontWeight: string;
43
+ color: string;
44
+ letterSpacing: string;
45
+ textDecoration: string;
46
+ };
47
+ headingSm: {
48
+ fontFamily: string;
49
+ fontSize: number;
50
+ lineHeight: number;
51
+ fontWeight: string;
52
+ color: string;
53
+ letterSpacing: string;
54
+ textDecoration: string;
55
+ };
56
+ headingXs: {
57
+ fontFamily: string;
58
+ fontSize: number;
59
+ lineHeight: number;
60
+ fontWeight: string;
61
+ color: string;
62
+ letterSpacing: string;
63
+ textDecoration: string;
64
+ };
65
+ heading2xs: {
66
+ fontFamily: string;
67
+ fontSize: number;
68
+ lineHeight: number;
69
+ fontWeight: string;
70
+ color: string;
71
+ letterSpacing: string;
72
+ textDecoration: string;
73
+ };
74
+ bodyXl: {
75
+ fontFamily: string;
76
+ fontSize: number;
77
+ lineHeight: number;
78
+ fontWeight: string;
79
+ color: string;
80
+ letterSpacing: string;
81
+ textDecoration: string;
82
+ };
83
+ bodyLg: {
84
+ fontFamily: string;
85
+ fontSize: number;
86
+ lineHeight: number;
87
+ fontWeight: string;
88
+ color: string;
89
+ letterSpacing: string;
90
+ textDecoration: string;
91
+ };
92
+ bodyMd: {
93
+ fontFamily: string;
94
+ fontSize: number;
95
+ lineHeight: number;
96
+ fontWeight: string;
97
+ color: string;
98
+ letterSpacing: string;
99
+ textDecoration: string;
100
+ };
101
+ bodySm: {
102
+ fontFamily: string;
103
+ fontSize: number;
104
+ lineHeight: number;
105
+ fontWeight: string;
106
+ color: string;
107
+ letterSpacing: string;
108
+ textDecoration: string;
109
+ };
110
+ labelLg: {
111
+ fontFamily: string;
112
+ fontSize: number;
113
+ lineHeight: number;
114
+ fontWeight: string;
115
+ color: string;
116
+ letterSpacing: string;
117
+ textDecoration: string;
118
+ };
119
+ labelMd: {
120
+ fontFamily: string;
121
+ fontSize: number;
122
+ lineHeight: number;
123
+ fontWeight: string;
124
+ color: string;
125
+ letterSpacing: string;
126
+ textDecoration: string;
127
+ };
128
+ labelSm: {
129
+ fontFamily: string;
130
+ fontSize: number;
131
+ lineHeight: number;
132
+ fontWeight: string;
133
+ color: string;
134
+ letterSpacing: string;
135
+ textDecoration: string;
136
+ };
137
+ };
138
+ export type TypographyTokenMap = typeof typographyTokens;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare const ThemeContext: React.Context<{}>;
3
+ export declare const ThemeProvider: React.FC<{
4
+ children: React.ReactNode;
5
+ }>;
@@ -0,0 +1,54 @@
1
+ export declare const buttonTokens: {
2
+ primary: {
3
+ default: string;
4
+ hover: string;
5
+ active: string;
6
+ disabled: string;
7
+ };
8
+ secondary: {
9
+ default: string;
10
+ hover: string;
11
+ active: string;
12
+ disabled: string;
13
+ };
14
+ outline: {
15
+ borderDefault: string;
16
+ borderHover: string;
17
+ borderActive: string;
18
+ text: {
19
+ default: string;
20
+ hover: string;
21
+ active: string;
22
+ disabled: string;
23
+ };
24
+ };
25
+ ghost: {
26
+ text: {
27
+ default: string;
28
+ hover: string;
29
+ active: string;
30
+ disabled: string;
31
+ };
32
+ };
33
+ destructive: {
34
+ text: {
35
+ default: string;
36
+ hover: string;
37
+ active: string;
38
+ disabled: string;
39
+ };
40
+ };
41
+ spacing: {
42
+ none: string | number;
43
+ cardSm: string;
44
+ gapMd: string;
45
+ gapXs: string;
46
+ };
47
+ radius: string;
48
+ typography: {
49
+ family: string;
50
+ weightMedium: string | number;
51
+ };
52
+ neutralText: string;
53
+ };
54
+ export type ButtonTokenMap = typeof buttonTokens;
@@ -0,0 +1,24 @@
1
+ export type ButtonType = "primary" | "outline" | "ghost" | "destructive";
2
+ export type ButtonSize = "large" | "small";
3
+ export type ButtonState = "default" | "hover" | "active" | "disabled";
4
+ export interface ButtonProps {
5
+ label: string;
6
+ type?: ButtonType;
7
+ size?: ButtonSize;
8
+ disabled?: boolean;
9
+ leftIcon?: string;
10
+ rightIcon?: string;
11
+ icon?: string;
12
+ fullWidth?: boolean;
13
+ ghostUnderline?: boolean;
14
+ accessibilityLabel?: string;
15
+ testID?: string;
16
+ className?: string;
17
+ style?: React.CSSProperties | Record<string, unknown>;
18
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
19
+ onPress?: () => void;
20
+ onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement>) => void;
21
+ onMouseLeave?: (e: React.MouseEvent<HTMLButtonElement>) => void;
22
+ onMouseDown?: (e: React.MouseEvent<HTMLButtonElement>) => void;
23
+ onMouseUp?: (e: React.MouseEvent<HTMLButtonElement>) => void;
24
+ }
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ export type BodySize = "xl" | "lg" | "md" | "sm";
3
+ export interface BaseTypographyProps {
4
+ align?: "left" | "center" | "right";
5
+ color?: string;
6
+ truncate?: boolean;
7
+ lineClamp?: number;
8
+ className?: string;
9
+ style?: React.CSSProperties | Record<string, unknown>;
10
+ onClick?: (e: React.MouseEvent<HTMLElement>) => void;
11
+ testID?: string;
12
+ children?: React.ReactNode;
13
+ }
14
+ export interface BodyProps extends BaseTypographyProps {
15
+ size?: BodySize;
16
+ element?: keyof JSX.IntrinsicElements;
17
+ }
18
+ export type DisplaySize = "2xl" | "xl";
19
+ export interface DisplayProps extends BaseTypographyProps {
20
+ size?: DisplaySize;
21
+ element?: keyof JSX.IntrinsicElements;
22
+ }
23
+ export type HeadingSize = "xl" | "lg" | "md" | "sm" | "xs" | "2xs";
24
+ export interface HeadingProps extends BaseTypographyProps {
25
+ size?: HeadingSize;
26
+ element?: keyof JSX.IntrinsicElements;
27
+ }
28
+ export type UtilityVariant = "button" | "link" | "caption";
29
+ export interface UtilityProps extends BaseTypographyProps {
30
+ variant?: UtilityVariant;
31
+ element?: keyof JSX.IntrinsicElements;
32
+ }
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "onecart-ui",
3
+ "version": "0.1.0",
4
+ "description": "OneCart UI: Cross-platform design tokens + React & React Native components",
5
+ "keywords": [
6
+ "react",
7
+ "react-native",
8
+ "design-system",
9
+ "components",
10
+ "design-tokens",
11
+ "cross-platform",
12
+ "ui",
13
+ "onecart"
14
+ ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/yourusername/onecart-design-system.git"
18
+ },
19
+ "license": "MIT",
20
+ "author": "OneCart Team",
21
+ "main": "dist/index.js",
22
+ "module": "dist/index.js",
23
+ "types": "dist/index.d.ts",
24
+ "react-native": "dist/index.mobile.js",
25
+ "files": [
26
+ "dist",
27
+ "tokens",
28
+ "README.md"
29
+ ],
30
+ "exports": {
31
+ ".": {
32
+ "import": "./dist/index.js",
33
+ "require": "./dist/index.js",
34
+ "types": "./dist/index.d.ts"
35
+ },
36
+ "./mobile": {
37
+ "react-native": "./dist/index.mobile.js",
38
+ "import": "./dist/index.mobile.js",
39
+ "types": "./dist/mobile/index.d.ts"
40
+ },
41
+ "./tokens": {
42
+ "import": "./tokens/tokens.js",
43
+ "types": "./tokens/tokens.d.ts"
44
+ },
45
+ "./tokens/web": {
46
+ "import": "./tokens/tokens.js",
47
+ "types": "./tokens/tokens.d.ts"
48
+ },
49
+ "./tokens/mobile": {
50
+ "import": "./tokens/tokens.js",
51
+ "types": "./tokens/tokens.d.ts"
52
+ }
53
+ },
54
+ "workspaces": [
55
+ "packages/*",
56
+ "packages/components/mobile",
57
+ "apps/*"
58
+ ],
59
+ "scripts": {
60
+ "dev": "turbo run dev --parallel",
61
+ "build": "turbo run build && npm run copy-dist",
62
+ "copy-dist": "mkdir -p dist && cp -r packages/components/dist/* dist/ && mkdir -p tokens && cp -r packages/tokens/build/web/* tokens/",
63
+ "prepublishOnly": "npm run build",
64
+ "lint": "turbo run lint",
65
+ "test": "turbo run test",
66
+ "generate-tokens": "npm --workspace @onecart-ui/tokens run generate-tokens",
67
+ "components:build": "npm --workspace @onecart-ui/components run build",
68
+ "storybook": "npm --workspace @onecart-ui/docs run storybook",
69
+ "storybook:build": "npm --workspace @onecart-ui/docs run build"
70
+ },
71
+ "peerDependencies": {
72
+ "react": "^18.2.0",
73
+ "react-dom": "^18.2.0",
74
+ "react-native": "^0.74.0"
75
+ },
76
+ "peerDependenciesMeta": {
77
+ "react-native": {
78
+ "optional": true
79
+ },
80
+ "react-dom": {
81
+ "optional": true
82
+ }
83
+ },
84
+ "devDependencies": {
85
+ "turbo": "^2.1.1",
86
+ "typescript": "^5.4.0",
87
+ "rollup": "^4.21.0",
88
+ "@rollup/plugin-typescript": "^11.1.5",
89
+ "@rollup/plugin-node-resolve": "^15.2.3",
90
+ "@rollup/plugin-commonjs": "^25.0.7",
91
+ "@rollup/plugin-json": "^6.1.0",
92
+ "semantic-release": "^22.0.0",
93
+ "@semantic-release/changelog": "^6.0.3",
94
+ "@semantic-release/git": "^10.0.1",
95
+ "@semantic-release/npm": "^11.0.2",
96
+ "husky": "^9.0.11",
97
+ "@commitlint/cli": "^19.3.0",
98
+ "@commitlint/config-conventional": "^19.2.2",
99
+ "storybook": "^8.1.0"
100
+ },
101
+ "packageManager": "npm@10.0.0"
102
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Do not edit directly, this file was auto-generated.
3
+ */
4
+
5
+ :root {
6
+
7
+ }
@@ -0,0 +1,2 @@
1
+ /** Auto-generated token type declarations */
2
+
@@ -0,0 +1,3 @@
1
+ /**
2
+ * Do not edit directly, this file was auto-generated.
3
+ */