oneslash-design-system 1.0.3

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/global.d.ts ADDED
@@ -0,0 +1,155 @@
1
+ // types/global.d.ts
2
+ export {}
3
+ declare global {
4
+
5
+ interface CommentReactionProps {
6
+ reactions: any;
7
+ isArchiveComment?: boolean;
8
+ }
9
+
10
+ interface TimeStampProps{
11
+ createdAt: string | number | Date;
12
+ dateFormat: 'absolute' | 'relative';
13
+ }
14
+
15
+ interface CheckboxProps {
16
+ label?: string;
17
+ checked?: boolean;
18
+ onChange?: (checked: boolean) => void;
19
+ }
20
+
21
+ interface ReactionIconButtonProps {
22
+ size?: "small" | "medium" | "large";
23
+ color?: "inherit" | "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning";
24
+ figmaCommentId: string;
25
+ fileKey?: string;
26
+ accountId: string;
27
+ selectedHeadCommentId?: any;
28
+ associatedAccountId?: any;
29
+ }
30
+
31
+ interface CheckIconButtonProps {
32
+ size: "small" | "medium" | "large";
33
+ color?: "inherit" | "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning";
34
+ }
35
+
36
+ interface UncheckIconButtonProps {
37
+ size: "small" | "medium" | "large";
38
+ color?: "inherit" | "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning";
39
+ }
40
+
41
+ interface ButtonProps{
42
+ size: 'large' | 'medium' | 'small';
43
+ type: 'primary' | 'secondary' | 'tertiary' | 'textOnly';
44
+ state: 'enabled' | 'hovered' | 'selected' | 'focused' | 'disabled';
45
+ label: string;
46
+ iconLeftName?: keyof typeof HeroIcons;
47
+ iconRightName?: keyof typeof HeroIcons;
48
+ onClick?: any;
49
+ }
50
+
51
+ interface IconButtonProps{
52
+ variant: "contained" | "iconOnly";
53
+ color: "primary" | "secondary";
54
+ state: "enabled" | "selected" | "disabled";
55
+ iconName: keyof typeof HeroIcons;
56
+ onClick?: any;
57
+ }
58
+
59
+ interface TagProps{
60
+ key?: any;
61
+ variant: "contained" | "textOnly";
62
+ size: "medium" | "small";
63
+ state?: "enabled" | "selected" ;
64
+ label: any;
65
+ iconName?: keyof typeof HeroIcons;
66
+ isDeletable?: keyof typeof HeroIcons;
67
+ onClick?: any;
68
+ color?: 'default' | 'info';
69
+ }
70
+
71
+ interface EmptyBoxProps{
72
+ text: string;
73
+ size: "small" | "large";
74
+ }
75
+
76
+ interface TabPanelProps {
77
+ children?: React.ReactNode;
78
+ index: number;
79
+ value: number;
80
+ }
81
+
82
+ interface TextFieldProps {
83
+ id: string;
84
+ label?: string;
85
+ value: string;
86
+ onChange: any;
87
+ iconLeft?: any;
88
+ iconRight?: React.ReactNode | React.ComponentType<any>;
89
+ multiline?: boolean;
90
+ maxRows?: number;
91
+ disabled?: boolean;
92
+ error?: boolean;
93
+ }
94
+
95
+ interface ModalProps {
96
+ isOpen: boolean;
97
+ title: string;
98
+ children: React.ReactNode;
99
+ onClose: () => void;
100
+ actions?: React.ReactNode;
101
+ }
102
+
103
+ interface MenuItemProps {
104
+ href?: string;
105
+ iconName?: string;
106
+ label: string;
107
+ isSelected?: boolean;
108
+ onClick: any;
109
+ }
110
+
111
+ type IconType = React.ComponentType<React.SVGProps<SVGSVGElement>>;
112
+
113
+ interface TooltipProps {
114
+ title: string;
115
+ children: React.ReactElement;
116
+ }
117
+
118
+ interface UserImageProps {
119
+ userHandle: string;
120
+ userImgUrl?: string;
121
+ }
122
+
123
+ interface AlertProps {
124
+ open: boolean;
125
+ type: string;
126
+ message: string;
127
+ onClose: () => void;
128
+ }
129
+
130
+ interface PopoverProps {
131
+ id?: string;
132
+ anchorEl: HTMLElement | null;
133
+ open: boolean;
134
+ onClose: () => void;
135
+ children: ReactNode;
136
+ }
137
+
138
+ interface ScrapTagProps{
139
+ comment?: any;
140
+ }
141
+
142
+ type TabProps = {
143
+ label: string;
144
+ href?: string;
145
+ isSelected: boolean;
146
+ onClick: () => void;
147
+ iconName?: string;
148
+ };
149
+
150
+ }
151
+
152
+ declare module '@heroicons/react/*' {
153
+ const content: any;
154
+ export default content;
155
+ }
package/index.css ADDED
@@ -0,0 +1,4 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');
package/index.ts ADDED
@@ -0,0 +1,16 @@
1
+ import './index.css';
2
+ import Button from './components/button/button';
3
+ export { Button };
4
+
5
+ export * from './components/alert/alert';
6
+ export * from './components/button/button';
7
+ export * from './components/checkBox/checkBox';
8
+ export * from './components/iconButton/iconButton';
9
+ export * from './components/menuItem/menuItem';
10
+ export * from './components/modal/modal';
11
+ export * from './components/popover/popover';
12
+ export * from './components/tab/tab';
13
+ export * from './components/tag/tag';
14
+ export * from './components/textField/textField';
15
+ export * from './components/tooltip/tooltip';
16
+ export * from './components/userImage/userImage';
@@ -0,0 +1,4 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {};
3
+
4
+ export default nextConfig;
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "oneslash-design-system",
3
+ "version": "1.0.3",
4
+ "private": false,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "next build",
8
+ "build:css": "postcss index.css -o dist/output.css",
9
+ "start": "next start",
10
+ "lint": "next lint"
11
+ },
12
+ "dependencies": {
13
+ "@heroicons/react": "^2.1.5",
14
+ "next": "14.2.13",
15
+ "react": "^18",
16
+ "react-dom": "^18"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "20.16.10",
20
+ "@types/react": "18.3.10",
21
+ "@types/react-dom": "^18",
22
+ "autoprefixer": "^10.4.20",
23
+ "eslint": "^8",
24
+ "eslint-config-next": "14.2.13",
25
+ "postcss": "^8",
26
+ "postcss-cli": "^11.0.0",
27
+ "tailwind-scrollbar": "^3.1.0",
28
+ "tailwindcss": "^3.4.1",
29
+ "typescript": "5.6.2"
30
+ }
31
+ }
@@ -0,0 +1,8 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ tailwindcss: {},
5
+ },
6
+ };
7
+
8
+ export default config;
@@ -0,0 +1,232 @@
1
+ import type { Config } from "tailwindcss";
2
+
3
+ const designTokens = require('./designTokens');
4
+
5
+ const config: Config = {
6
+ content: [
7
+ "./components/**/*.{js,ts,jsx,tsx,mdx}",
8
+ ],
9
+ theme: {
10
+ extend: {
11
+ colors: {
12
+ // Light: text colors
13
+ 'light-text-primary': designTokens.colors.light.text.primary,
14
+ 'light-text-secondary': designTokens.colors.light.text.secondary,
15
+ 'light-text-disabled': designTokens.colors.light.text.disabled,
16
+ 'light-text-contrast': designTokens.colors.light.text.contrast,
17
+
18
+ // Dark: text colors
19
+ 'dark-text-primary': designTokens.colors.dark.text.primary,
20
+ 'dark-text-secondary': designTokens.colors.dark.text.secondary,
21
+ 'dark-text-disabled': designTokens.colors.dark.text.disabled,
22
+ 'dark-text-contrast': designTokens.colors.dark.text.contrast,
23
+
24
+ // light: accent colors
25
+ 'light-accent-main': designTokens.colors.light.accent.main,
26
+ 'light-accent-dark': designTokens.colors.light.accent.dark,
27
+ 'light-accent-light': designTokens.colors.light.accent.light,
28
+ 'light-accent-contrast': designTokens.colors.light.accent.contrast,
29
+
30
+ // dark: accent colors
31
+ 'dark-accent-main': designTokens.colors.dark.accent.main,
32
+ 'dark-accent-dark': designTokens.colors.dark.accent.dark,
33
+ 'dark-accent-light': designTokens.colors.dark.accent.light,
34
+ 'dark-accent-contrast': designTokens.colors.dark.accent.contrast,
35
+
36
+ // Light: primary colors
37
+ 'light-primary-main': designTokens.colors.light.primary.main,
38
+ 'light-primary-dark': designTokens.colors.light.primary.dark,
39
+ 'light-primary-light': designTokens.colors.light.primary.light,
40
+ 'light-primary-contrast': designTokens.colors.light.primary.contrast,
41
+
42
+ // Dark: primary colors
43
+ 'dark-primary-main': designTokens.colors.dark.primary.main,
44
+ 'dark-primary-dark': designTokens.colors.dark.primary.dark,
45
+ 'dark-primary-light': designTokens.colors.dark.primary.light,
46
+ 'dark-primary-contrast': designTokens.colors.dark.primary.contrast,
47
+
48
+ // light: secondary colors
49
+ 'light-secondary-main': designTokens.colors.light.secondary.main,
50
+ 'light-secondary-dark': designTokens.colors.light.secondary.dark,
51
+ 'light-secondary-light': designTokens.colors.light.secondary.light,
52
+
53
+ // dark: secondary colors
54
+ 'dark-secondary-main': designTokens.colors.dark.secondary.main,
55
+ 'dark-secondary-dark': designTokens.colors.dark.secondary.dark,
56
+ 'dark-secondary-light': designTokens.colors.dark.secondary.light,
57
+
58
+ // light: error colors
59
+ 'light-error-main': designTokens.colors.light.error.main,
60
+ 'light-error-dark': designTokens.colors.light.error.dark,
61
+ 'light-error-light': designTokens.colors.light.error.light,
62
+
63
+ // dark: error colors
64
+ 'dark-error-main': designTokens.colors.dark.error.main,
65
+ 'dark-error-dark': designTokens.colors.dark.error.dark,
66
+ 'dark-error-light': designTokens.colors.dark.error.light,
67
+
68
+ // light: warning colors
69
+ 'light-warning-main': designTokens.colors.light.warning.main,
70
+ 'light-warning-dark': designTokens.colors.light.warning.dark,
71
+ 'light-warning-light': designTokens.colors.light.warning.light,
72
+
73
+ // dark: warning colors
74
+ 'dark-warning-main': designTokens.colors.dark.warning.main,
75
+ 'dark-warning-dark': designTokens.colors.dark.warning.dark,
76
+ 'dark-warning-light': designTokens.colors.dark.warning.light,
77
+
78
+ // light: info colors
79
+ 'light-info-main': designTokens.colors.light.info.main,
80
+ 'light-info-dark': designTokens.colors.light.info.dark,
81
+ 'light-info-light': designTokens.colors.light.info.light,
82
+
83
+ // dark: info colors
84
+ 'dark-info-main': designTokens.colors.dark.info.main,
85
+ 'dark-info-dark': designTokens.colors.dark.info.dark,
86
+ 'dark-info-light': designTokens.colors.dark.info.light,
87
+
88
+ // light: success colors
89
+ 'light-success-main': designTokens.colors.light.success.main,
90
+ 'light-success-dark': designTokens.colors.light.success.dark,
91
+ 'light-success-light': designTokens.colors.light.success.light,
92
+
93
+ // dark: success colors
94
+ 'dark-success-main': designTokens.colors.dark.success.main,
95
+ 'dark-success-dark': designTokens.colors.dark.success.dark,
96
+ 'dark-success-light': designTokens.colors.dark.success.light,
97
+
98
+ // Light: background colors
99
+ 'light-background-default': designTokens.colors.light.background.default,
100
+ 'light-background-accent100': designTokens.colors.light.background.accent100,
101
+ 'light-background-accent200': designTokens.colors.light.background.accent200,
102
+ 'light-background-accent300': designTokens.colors.light.background.accent300,
103
+
104
+ // Dark: background colors
105
+ 'dark-background-default': designTokens.colors.dark.background.default,
106
+ 'dark-background-accent100': designTokens.colors.dark.background.accent100,
107
+ 'dark-background-accent200': designTokens.colors.dark.background.accent200,
108
+ 'dark-background-accent300': designTokens.colors.dark.background.accent300,
109
+
110
+ // Light: action colors
111
+ 'light-action-active': designTokens.colors.light.action.active,
112
+ 'light-action-hover': designTokens.colors.light.action.hover,
113
+ 'light-action-selected': designTokens.colors.light.action.selected,
114
+ 'light-action-disabledBackground': designTokens.colors.light.action.disabledBackground,
115
+ 'light-action-disabled': designTokens.colors.light.action.disabled,
116
+
117
+ // Dark: action colors
118
+ 'dark-action-active': designTokens.colors.dark.action.active,
119
+ 'dark-action-hover': designTokens.colors.dark.action.hover,
120
+ 'dark-action-selected': designTokens.colors.dark.action.selected,
121
+ 'dark-action-disabledBackground': designTokens.colors.dark.action.disabledBackground,
122
+ 'dark-action-disabled': designTokens.colors.dark.action.disabled,
123
+
124
+ // light: action background
125
+ 'light-actionBackground-enabled': designTokens.colors.light.actionBackground.enabled,
126
+ 'light-actionBackground-hovered': designTokens.colors.light.actionBackground.hovered,
127
+ 'light-actionBackground-selected': designTokens.colors.light.actionBackground.selected,
128
+ 'light-actionBackground-disabled': designTokens.colors.light.actionBackground.disabled,
129
+
130
+ // dark: action background
131
+ 'dark-actionBackground-enabled': designTokens.colors.dark.actionBackground.enabled,
132
+ 'dark-actionBackground-hovered': designTokens.colors.dark.actionBackground.hovered,
133
+ 'dark-actionBackground-selected': designTokens.colors.dark.actionBackground.selected,
134
+ 'dark-actionBackground-disabled': designTokens.colors.dark.actionBackground.disabled,
135
+
136
+ // light: action outlinedBorder
137
+ 'light-actionOutlinedBorder-enabled': designTokens.colors.light.actionOutlinedBorder.enabled,
138
+ 'light-actionOutlinedBorder-hovered': designTokens.colors.light.actionOutlinedBorder.hovered,
139
+ 'light-actionOutlinedBorder-selected': designTokens.colors.light.actionOutlinedBorder.selected,
140
+ 'light-actionOutlinedBorder-disabled': designTokens.colors.light.actionOutlinedBorder.disabled,
141
+
142
+ // dark: action outlinedBorder
143
+ 'dark-actionOutlinedBorder-enabled': designTokens.colors.dark.actionOutlinedBorder.enabled,
144
+ 'dark-actionOutlinedBorder-hovered': designTokens.colors.dark.actionOutlinedBorder.hovered,
145
+ 'dark-actionOutlinedBorder-selected': designTokens.colors.dark.actionOutlinedBorder.selected,
146
+ 'dark-actionOutlinedBorder-disabled': designTokens.colors.dark.actionOutlinedBorder.disabled,
147
+
148
+ // misc light colors
149
+ 'light-misc-divider': designTokens.colors.light.misc.divider,
150
+
151
+ // misc dark colors
152
+ 'dark-misc-divider': designTokens.colors.dark.misc.divider,
153
+
154
+ 'dark-misc-scrollbar-bg': designTokens.colors.dark.background.default,
155
+ 'dark-misc-scrollbar-thumb': designTokens.colors.dark.background.accent200,
156
+ },
157
+ spacing: {
158
+ small: designTokens.spacing.small,
159
+ medium: designTokens.spacing.medium,
160
+ large: designTokens.spacing.large,
161
+ },
162
+ fontSize: {
163
+ h1: designTokens.typography.h1.size,
164
+ h2: designTokens.typography.h2.size,
165
+ h3: designTokens.typography.h3.size,
166
+ h4: designTokens.typography.h4.size,
167
+ h5: designTokens.typography.h5.size,
168
+ h6: designTokens.typography.h6.size,
169
+ subtitle1: designTokens.typography.subtitle1.size,
170
+ subtitle2: designTokens.typography.subtitle2.size,
171
+ body1: designTokens.typography.body1.size,
172
+ body2: designTokens.typography.body2.size,
173
+ caption: designTokens.typography.caption.size,
174
+ },
175
+ fontFamily: {
176
+ inter: designTokens.typography.family,
177
+ },
178
+ fontWeight: {
179
+ h1: designTokens.typography.h1.weight,
180
+ h2: designTokens.typography.h2.weight,
181
+ h3: designTokens.typography.h3.weight,
182
+ h4: designTokens.typography.h4.weight,
183
+ h5: designTokens.typography.h5.weight,
184
+ h6: designTokens.typography.h6.weight,
185
+ subtitle1: designTokens.typography.subtitle1.weight,
186
+ subtitle2: designTokens.typography.subtitle2.weight,
187
+ body1: designTokens.typography.body1.weight,
188
+ body2: designTokens.typography.body2.weight,
189
+ caption: designTokens.typography.caption.weight,
190
+ },
191
+ letterSpacing: {
192
+ h1: designTokens.typography.h1.letterSpacing,
193
+ h2: designTokens.typography.h2.letterSpacing,
194
+ h3: designTokens.typography.h3.letterSpacing,
195
+ h4: designTokens.typography.h4.letterSpacing,
196
+ h5: designTokens.typography.h5.letterSpacing,
197
+ h6: designTokens.typography.h6.letterSpacing,
198
+ subtitle1: designTokens.typography.subtitle1.letterSpacing,
199
+ subtitle2: designTokens.typography.subtitle2.letterSpacing,
200
+ body1: designTokens.typography.body1.letterSpacing,
201
+ body2: designTokens.typography.body2.letterSpacing,
202
+ caption: designTokens.typography.caption.letterSpacing,
203
+ },
204
+ lineHeight: {
205
+ h1: designTokens.typography.h1.lineHeight,
206
+ h2: designTokens.typography.h2.lineHeight,
207
+ h3: designTokens.typography.h3.lineHeight,
208
+ h4: designTokens.typography.h4.lineHeight,
209
+ h5: designTokens.typography.h5.lineHeight,
210
+ h6: designTokens.typography.h6.lineHeight,
211
+ subtitle1: designTokens.typography.subtitle1.lineHeight,
212
+ subtitle2: designTokens.typography.subtitle2.lineHeight,
213
+ body1: designTokens.typography.body1.lineHeight,
214
+ body2: designTokens.typography.body2.lineHeight,
215
+ caption: designTokens.typography.caption.lineHeight,
216
+ },
217
+ textAlign: {
218
+ left: designTokens.typography.alignments.left,
219
+ center: designTokens.typography.alignments.center,
220
+ right: designTokens.typography.alignments.right,
221
+ justify: designTokens.typography.alignments.justify,
222
+ },
223
+ },
224
+ },
225
+ plugins: [
226
+ require('tailwindcss'),
227
+ require('autoprefixer'),
228
+ require('tailwind-scrollbar'),
229
+
230
+ ],
231
+ };
232
+ export default config;
package/tsconfig.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": [
4
+ "dom",
5
+ "dom.iterable",
6
+ "esnext"
7
+ ],
8
+ "allowJs": true,
9
+ "skipLibCheck": true,
10
+ "strict": true,
11
+ "noEmit": true,
12
+ "esModuleInterop": true,
13
+ "module": "esnext",
14
+ "moduleResolution": "bundler",
15
+ "resolveJsonModule": true,
16
+ "isolatedModules": true,
17
+ "jsx": "preserve",
18
+ "incremental": true,
19
+ "plugins": [
20
+ {
21
+ "name": "next"
22
+ }
23
+ ],
24
+ "paths": {
25
+ "@/*": [
26
+ "./*"
27
+ ]
28
+ },
29
+ "forceConsistentCasingInFileNames": true
30
+ },
31
+ "include": [
32
+ "next-env.d.ts",
33
+ "**/*.ts",
34
+ "**/*.tsx",
35
+ ".next/types/**/*.ts"
36
+ ],
37
+ "exclude": [
38
+ "node_modules"
39
+ ]
40
+ }