@shadow-library/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 (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +98 -0
  3. package/components/AppLayout/AppLayout.d.ts +19 -0
  4. package/components/AppLayout/AppLayout.js +28 -0
  5. package/components/AppLayout/AppLayout.js.map +1 -0
  6. package/components/AppLayout/ContentFooter.d.ts +13 -0
  7. package/components/AppLayout/ContentFooter.js +16 -0
  8. package/components/AppLayout/ContentFooter.js.map +1 -0
  9. package/components/AppLayout/SideNavbar.d.ts +21 -0
  10. package/components/AppLayout/SideNavbar.js +19 -0
  11. package/components/AppLayout/SideNavbar.js.map +1 -0
  12. package/components/AppLayout/SideNavbarItem.d.ts +14 -0
  13. package/components/AppLayout/SideNavbarItem.js +31 -0
  14. package/components/AppLayout/SideNavbarItem.js.map +1 -0
  15. package/components/AppLayout/TopNavbar.d.ts +16 -0
  16. package/components/AppLayout/TopNavbar.js +19 -0
  17. package/components/AppLayout/TopNavbar.js.map +1 -0
  18. package/components/AppLayout/hooks/use-layout-state.d.ts +20 -0
  19. package/components/AppLayout/hooks/use-layout-state.js +16 -0
  20. package/components/AppLayout/hooks/use-layout-state.js.map +1 -0
  21. package/components/AppLayout/hooks/use-side-navbar-item.d.ts +11 -0
  22. package/components/AppLayout/hooks/use-side-navbar-item.js +37 -0
  23. package/components/AppLayout/hooks/use-side-navbar-item.js.map +1 -0
  24. package/components/AppLayout/index.d.ts +2 -0
  25. package/components/AppLayout/index.js +3 -0
  26. package/components/AppLayout/index.js.map +1 -0
  27. package/components/AppLayout/layout.types.d.ts +59 -0
  28. package/components/AppLayout/layout.types.js +2 -0
  29. package/components/AppLayout/layout.types.js.map +1 -0
  30. package/components/Logo/Alphabets.d.ts +44 -0
  31. package/components/Logo/Alphabets.js +31 -0
  32. package/components/Logo/Alphabets.js.map +1 -0
  33. package/components/Logo/BrandMark.d.ts +16 -0
  34. package/components/Logo/BrandMark.js +17 -0
  35. package/components/Logo/BrandMark.js.map +1 -0
  36. package/components/Logo/Logo.d.ts +17 -0
  37. package/components/Logo/Logo.js +18 -0
  38. package/components/Logo/Logo.js.map +1 -0
  39. package/components/Logo/hooks/use-logo.d.ts +9 -0
  40. package/components/Logo/hooks/use-logo.js +18 -0
  41. package/components/Logo/hooks/use-logo.js.map +1 -0
  42. package/components/Logo/index.d.ts +2 -0
  43. package/components/Logo/index.js +3 -0
  44. package/components/Logo/index.js.map +1 -0
  45. package/hooks/index.d.ts +1 -0
  46. package/hooks/index.js +2 -0
  47. package/hooks/index.js.map +1 -0
  48. package/hooks/useSearchParams.d.ts +15 -0
  49. package/hooks/useSearchParams.js +24 -0
  50. package/hooks/useSearchParams.js.map +1 -0
  51. package/index.d.ts +4 -0
  52. package/index.js +5 -0
  53. package/index.js.map +1 -0
  54. package/lib/api-error.d.ts +29 -0
  55. package/lib/api-error.js +21 -0
  56. package/lib/api-error.js.map +1 -0
  57. package/lib/api-request.d.ts +56 -0
  58. package/lib/api-request.js +119 -0
  59. package/lib/api-request.js.map +1 -0
  60. package/lib/generate-api.d.ts +4 -0
  61. package/lib/generate-api.js +259 -0
  62. package/lib/generate-api.js.map +1 -0
  63. package/lib/index.d.ts +4 -0
  64. package/lib/index.js +5 -0
  65. package/lib/index.js.map +1 -0
  66. package/lib/utils.d.ts +13 -0
  67. package/lib/utils.js +22 -0
  68. package/lib/utils.js.map +1 -0
  69. package/package.json +24 -0
  70. package/theme.d.ts +161 -0
  71. package/theme.js +115 -0
  72. package/theme.js.map +1 -0
  73. package/types.d.ts +20 -0
  74. package/types.js +5 -0
  75. package/types.js.map +1 -0
@@ -0,0 +1,259 @@
1
+ /**
2
+ * Importing npm packages
3
+ */
4
+ /**
5
+ * Declaring the constants
6
+ */
7
+ const HTTP_METHODS = ['get', 'post', 'put', 'patch', 'delete'];
8
+ function isRef(obj) {
9
+ return typeof obj === 'object' && obj !== null && '$ref' in obj;
10
+ }
11
+ function resolveRefName(ref) {
12
+ return ref.split('/').pop();
13
+ }
14
+ function resolveRef(ref, spec) {
15
+ const segments = ref.replace(/^#\//, '').split('/');
16
+ let current = spec;
17
+ for (const segment of segments)
18
+ current = current[segment];
19
+ return current;
20
+ }
21
+ function toCamelCase(str) {
22
+ return str
23
+ .trim()
24
+ .split(/[^a-zA-Z0-9]+/)
25
+ .filter(Boolean)
26
+ .map((word, i) => (i === 0 ? word.toLowerCase() : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()))
27
+ .join('');
28
+ }
29
+ function toPascalCase(str) {
30
+ return str
31
+ .trim()
32
+ .split(/[^a-zA-Z0-9]+/)
33
+ .filter(Boolean)
34
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
35
+ .join('');
36
+ }
37
+ function schemaToTs(schema, spec) {
38
+ if (isRef(schema))
39
+ return resolveRefName(schema.$ref);
40
+ if (schema.allOf) {
41
+ const types = schema.allOf.map(s => schemaToTs(s, spec));
42
+ return types.length === 1 ? types[0] : types.join(' & ');
43
+ }
44
+ if (schema.oneOf) {
45
+ const types = schema.oneOf.map(s => schemaToTs(s, spec));
46
+ return types.length === 1 ? types[0] : types.join(' | ');
47
+ }
48
+ if (schema.anyOf) {
49
+ const types = schema.anyOf.map(s => schemaToTs(s, spec));
50
+ return types.length === 1 ? types[0] : types.join(' | ');
51
+ }
52
+ if (schema.enum) {
53
+ return schema.enum.map(v => (typeof v === 'string' ? `'${v}'` : String(v))).join(' | ');
54
+ }
55
+ let type = schema.type;
56
+ let nullable = schema.nullable === true;
57
+ if (Array.isArray(type)) {
58
+ nullable = nullable || type.includes('null');
59
+ type = type.find(t => t !== 'null');
60
+ }
61
+ let result;
62
+ switch (type) {
63
+ case 'string': {
64
+ result = 'string';
65
+ break;
66
+ }
67
+ case 'integer':
68
+ case 'number': {
69
+ result = 'number';
70
+ break;
71
+ }
72
+ case 'boolean': {
73
+ result = 'boolean';
74
+ break;
75
+ }
76
+ case 'array': {
77
+ result = schema.items ? `Array<${schemaToTs(schema.items, spec)}>` : 'Array<unknown>';
78
+ break;
79
+ }
80
+ case 'object': {
81
+ if (schema.properties) {
82
+ const req = new Set(schema.required ?? []);
83
+ const props = Object.entries(schema.properties).map(([key, val]) => ` ${key}${req.has(key) ? '' : '?'}: ${schemaToTs(val, spec)};`);
84
+ if (schema.additionalProperties) {
85
+ const vt = typeof schema.additionalProperties === 'boolean' ? 'unknown' : schemaToTs(schema.additionalProperties, spec);
86
+ props.push(` [key: string]: ${vt};`);
87
+ }
88
+ result = `{\n${props.join('\n')}\n}`;
89
+ }
90
+ else if (schema.additionalProperties) {
91
+ const vt = typeof schema.additionalProperties === 'boolean' ? 'unknown' : schemaToTs(schema.additionalProperties, spec);
92
+ result = `Record<string, ${vt}>`;
93
+ }
94
+ else
95
+ result = 'Record<string, unknown>';
96
+ break;
97
+ }
98
+ default: {
99
+ result = 'unknown';
100
+ }
101
+ }
102
+ return nullable ? `${result} | null` : result;
103
+ }
104
+ function collectTypes(spec) {
105
+ const schemas = spec.components?.schemas;
106
+ if (!schemas)
107
+ return '';
108
+ const lines = [];
109
+ for (const [name, schema] of Object.entries(schemas)) {
110
+ if (isRef(schema)) {
111
+ lines.push(`export type ${name} = ${resolveRefName(schema.$ref)};`);
112
+ lines.push('');
113
+ continue;
114
+ }
115
+ if (schema.type === 'object' && schema.properties && !schema.allOf && !schema.oneOf && !schema.anyOf) {
116
+ const req = new Set(schema.required ?? []);
117
+ const props = Object.entries(schema.properties).map(([key, val]) => ` ${key}${req.has(key) ? '' : '?'}: ${schemaToTs(val, spec)};`);
118
+ if (schema.additionalProperties) {
119
+ const vt = typeof schema.additionalProperties === 'boolean' ? 'unknown' : schemaToTs(schema.additionalProperties, spec);
120
+ props.push(` [key: string]: ${vt};`);
121
+ }
122
+ lines.push(`export interface ${name} {\n${props.join('\n')}\n}`);
123
+ }
124
+ else
125
+ lines.push(`export type ${name} = ${schemaToTs(schema, spec)};`);
126
+ lines.push('');
127
+ }
128
+ return lines.join('\n');
129
+ }
130
+ function resolveParameter(param, spec) {
131
+ return isRef(param) ? resolveRef(param.$ref, spec) : param;
132
+ }
133
+ function generateEndpoint(path, method, operation, pathLevelParams, spec) {
134
+ const types = [];
135
+ let hasBody = false;
136
+ // Function name
137
+ const summary = operation.summary ?? operation.operationId ?? `${method} ${path}`;
138
+ const funcName = toCamelCase(summary);
139
+ const pascalName = toPascalCase(summary);
140
+ // Merge parameters (operation-level overrides path-level for same name+in)
141
+ const allParams = [...pathLevelParams, ...(operation.parameters ?? [])].map(p => resolveParameter(p, spec));
142
+ const paramMap = new Map();
143
+ for (const param of allParams)
144
+ paramMap.set(`${param.in}:${param.name}`, param);
145
+ const params = Array.from(paramMap.values());
146
+ // Path params sorted by URL appearance
147
+ const pathParams = params.filter(p => p.in === 'path');
148
+ const pathParamOrder = [...path.matchAll(/\{(\w+)\}/g)].map(m => m[1]);
149
+ pathParams.sort((a, b) => pathParamOrder.indexOf(a.name) - pathParamOrder.indexOf(b.name));
150
+ // Query params
151
+ const queryParams = params.filter(p => p.in === 'query');
152
+ let queryTypeName;
153
+ if (queryParams.length > 0) {
154
+ queryTypeName = `${pascalName}Query`;
155
+ const props = queryParams.map(p => {
156
+ const originalType = p.schema ? schemaToTs(p.schema, spec) : 'unknown';
157
+ const tsType = originalType === 'string' ? 'string | undefined' : `string | ${originalType} | undefined`;
158
+ return ` ${p.name}?: ${tsType};`;
159
+ });
160
+ types.push(`export interface ${queryTypeName} extends QueryParams {\n${props.join('\n')}\n}`);
161
+ }
162
+ // Request body
163
+ let bodyTypeName;
164
+ if (operation.requestBody) {
165
+ const reqBody = isRef(operation.requestBody) ? resolveRef(operation.requestBody.$ref, spec) : operation.requestBody;
166
+ const jsonSchema = reqBody.content?.['application/json']?.schema;
167
+ if (jsonSchema) {
168
+ hasBody = true;
169
+ if (isRef(jsonSchema))
170
+ bodyTypeName = resolveRefName(jsonSchema.$ref);
171
+ else {
172
+ bodyTypeName = `${pascalName}Body`;
173
+ if (jsonSchema.type === 'object' && jsonSchema.properties && !jsonSchema.allOf && !jsonSchema.oneOf && !jsonSchema.anyOf) {
174
+ const req = new Set(jsonSchema.required ?? []);
175
+ const props = Object.entries(jsonSchema.properties).map(([key, val]) => ` ${key}${req.has(key) ? '' : '?'}: ${schemaToTs(val, spec)};`);
176
+ types.push(`export interface ${bodyTypeName} {\n${props.join('\n')}\n}`);
177
+ }
178
+ else
179
+ types.push(`export type ${bodyTypeName} = ${schemaToTs(jsonSchema, spec)};`);
180
+ }
181
+ }
182
+ }
183
+ // Response type
184
+ let returnType = 'unknown';
185
+ if (operation.responses) {
186
+ const successCode = ['200', '201', '204'].find(c => operation.responses?.[c]);
187
+ if (successCode === '204')
188
+ returnType = 'void';
189
+ else if (successCode) {
190
+ const resp = operation.responses[successCode];
191
+ const resolved = isRef(resp) ? resolveRef(resp.$ref, spec) : resp;
192
+ const jsonSchema = resolved.content?.['application/json']?.schema;
193
+ if (jsonSchema) {
194
+ if (isRef(jsonSchema))
195
+ returnType = resolveRefName(jsonSchema.$ref);
196
+ else
197
+ types.push(`export type ${pascalName}Response = ${schemaToTs(jsonSchema, spec)};`);
198
+ }
199
+ }
200
+ }
201
+ // Build function arguments
202
+ const args = [];
203
+ for (const p of pathParams)
204
+ args.push(`${p.name}: string`);
205
+ if (queryTypeName)
206
+ args.push(`query: ${queryTypeName}`);
207
+ if (bodyTypeName)
208
+ args.push(`body: ${bodyTypeName}`);
209
+ // Build URL string
210
+ const urlPath = path.replace(/\{(\w+)\}/g, (_, name) => `\${${name}}`);
211
+ const urlStr = urlPath !== path ? `\`${urlPath}\`` : `'${path}'`;
212
+ // Build method chain
213
+ let chain = `APIRequest.${method}(${urlStr})`;
214
+ if (queryTypeName)
215
+ chain += '.query(query)';
216
+ if (bodyTypeName)
217
+ chain += '.body(body)';
218
+ chain += `.execute<${returnType}>()`;
219
+ const func = `export async function ${funcName}(${args.join(', ')}): Promise<${returnType}> {\n return ${chain};\n}`;
220
+ return { types, func, hasBody };
221
+ }
222
+ export async function generateApi(url) {
223
+ const response = await fetch(url);
224
+ const spec = await response.json();
225
+ const allTypes = [];
226
+ const allFuncs = [];
227
+ for (const [path, pathItem] of Object.entries(spec.paths)) {
228
+ const pathLevelParams = pathItem.parameters ?? [];
229
+ for (const method of HTTP_METHODS) {
230
+ const operation = pathItem[method];
231
+ if (!operation)
232
+ continue;
233
+ const endpoint = generateEndpoint(path, method, operation, pathLevelParams, spec);
234
+ allTypes.push(...endpoint.types);
235
+ allFuncs.push(endpoint.func);
236
+ }
237
+ }
238
+ const lines = [
239
+ '/* eslint-disable */',
240
+ '',
241
+ '/** Auto-generated file — do not edit manually */',
242
+ '',
243
+ 'import { APIRequest, type QueryParams } from "@shadow-library/ui";',
244
+ '',
245
+ ];
246
+ const schemaTypes = collectTypes(spec);
247
+ if (schemaTypes.trim())
248
+ lines.push(schemaTypes);
249
+ if (allTypes.length > 0) {
250
+ lines.push(allTypes.join('\n\n'));
251
+ lines.push('');
252
+ }
253
+ if (allFuncs.length > 0) {
254
+ lines.push(allFuncs.join('\n\n'));
255
+ lines.push('');
256
+ }
257
+ return lines.join('\n');
258
+ }
259
+ //# sourceMappingURL=generate-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-api.js","sourceRoot":"","sources":["../../src/lib/generate-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AA2EH;;GAEG;AAEH,MAAM,YAAY,GAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE7E,SAAS,KAAK,CAAC,GAAY;IACzB,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,MAAM,IAAI,GAAG,CAAC;AAClE,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,CAAC;AACxC,CAAC;AAED,SAAS,UAAU,CAAI,GAAW,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package/lib/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from './api-error.js';
2
+ export * from './api-request.js';
3
+ export * from './generate-api.js';
4
+ export * from './utils.js';
package/lib/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from './api-error.js';
2
+ export * from './api-request.js';
3
+ export * from './generate-api.js';
4
+ export * from './utils.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC"}
package/lib/utils.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Importing npm packages
3
+ */
4
+ /**
5
+ * Importing user defined packages
6
+ */
7
+ /**
8
+ * Defining types
9
+ */
10
+ /**
11
+ * Declaring the constants
12
+ */
13
+ export declare function getInitials(name: string): string;
package/lib/utils.js ADDED
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Importing npm packages
3
+ */
4
+ /**
5
+ * Importing user defined packages
6
+ */
7
+ /**
8
+ * Defining types
9
+ */
10
+ /**
11
+ * Declaring the constants
12
+ */
13
+ export function getInitials(name) {
14
+ return name
15
+ .split(' ')
16
+ .map(part => part[0])
17
+ .filter(Boolean)
18
+ .slice(0, 2)
19
+ .join('')
20
+ .toUpperCase();
21
+ }
22
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC;SACf,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACX,IAAI,CAAC,EAAE,CAAC;SACR,WAAW,EAAE,CAAC;AACnB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@shadow-library/ui",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "sideEffects": false,
6
+ "peerDependencies": {
7
+ "typescript": "^5.9.3",
8
+ "@mantine/core": "^8.3.18",
9
+ "@mantine/hooks": "^8.3.18",
10
+ "lucide-react": "^0.577.0",
11
+ "@tanstack/react-router": "1.168.1"
12
+ },
13
+ "dependencies": {
14
+ "clsx": "^2.1.1",
15
+ "openapi-typescript": "^7.13.0"
16
+ },
17
+ "main": "./index.js",
18
+ "module": "./index.js",
19
+ "exports": {
20
+ ".": {
21
+ "import": "./index.js"
22
+ }
23
+ }
24
+ }
package/theme.d.ts ADDED
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Importing npm packages
3
+ */
4
+ import { type DefaultMantineColor, type MantineColorsTuple } from '@mantine/core';
5
+ /**
6
+ * Importing user defined packages
7
+ */
8
+ /**
9
+ * Defining types
10
+ */
11
+ type ShadowColors = 'cyan' | 'slate' | 'terracotta';
12
+ declare module '@mantine/core' {
13
+ interface MantineThemeColorsOverride {
14
+ colors: Record<ShadowColors | DefaultMantineColor, MantineColorsTuple>;
15
+ }
16
+ }
17
+ export declare const shadowTheme: {
18
+ focusRing?: "auto" | "always" | "never" | undefined;
19
+ scale?: number | undefined;
20
+ fontSmoothing?: boolean | undefined;
21
+ white?: string | undefined;
22
+ black?: string | undefined;
23
+ colors?: {
24
+ [x: string & {}]: MantineColorsTuple | undefined;
25
+ dark?: MantineColorsTuple | undefined;
26
+ cyan?: MantineColorsTuple | undefined;
27
+ slate?: MantineColorsTuple | undefined;
28
+ terracotta?: MantineColorsTuple | undefined;
29
+ gray?: MantineColorsTuple | undefined;
30
+ red?: MantineColorsTuple | undefined;
31
+ pink?: MantineColorsTuple | undefined;
32
+ grape?: MantineColorsTuple | undefined;
33
+ violet?: MantineColorsTuple | undefined;
34
+ indigo?: MantineColorsTuple | undefined;
35
+ blue?: MantineColorsTuple | undefined;
36
+ green?: MantineColorsTuple | undefined;
37
+ lime?: MantineColorsTuple | undefined;
38
+ yellow?: MantineColorsTuple | undefined;
39
+ orange?: MantineColorsTuple | undefined;
40
+ teal?: MantineColorsTuple | undefined;
41
+ } | undefined;
42
+ primaryShade?: import("@mantine/core").MantineColorShade | {
43
+ light?: import("@mantine/core").MantineColorShade | undefined;
44
+ dark?: import("@mantine/core").MantineColorShade | undefined;
45
+ } | undefined;
46
+ primaryColor?: string | undefined;
47
+ variantColorResolver?: import("@mantine/core").VariantColorsResolver | undefined;
48
+ autoContrast?: boolean | undefined;
49
+ luminanceThreshold?: number | undefined;
50
+ fontFamily?: string | undefined;
51
+ fontFamilyMonospace?: string | undefined;
52
+ headings?: {
53
+ fontFamily?: string | undefined;
54
+ fontWeight?: string | undefined;
55
+ textWrap?: "balance" | "nowrap" | "wrap" | "stable" | "pretty" | undefined;
56
+ sizes?: {
57
+ h1?: {
58
+ fontSize?: string | undefined;
59
+ fontWeight?: string | undefined;
60
+ lineHeight?: string | undefined;
61
+ } | undefined;
62
+ h2?: {
63
+ fontSize?: string | undefined;
64
+ fontWeight?: string | undefined;
65
+ lineHeight?: string | undefined;
66
+ } | undefined;
67
+ h3?: {
68
+ fontSize?: string | undefined;
69
+ fontWeight?: string | undefined;
70
+ lineHeight?: string | undefined;
71
+ } | undefined;
72
+ h4?: {
73
+ fontSize?: string | undefined;
74
+ fontWeight?: string | undefined;
75
+ lineHeight?: string | undefined;
76
+ } | undefined;
77
+ h5?: {
78
+ fontSize?: string | undefined;
79
+ fontWeight?: string | undefined;
80
+ lineHeight?: string | undefined;
81
+ } | undefined;
82
+ h6?: {
83
+ fontSize?: string | undefined;
84
+ fontWeight?: string | undefined;
85
+ lineHeight?: string | undefined;
86
+ } | undefined;
87
+ } | undefined;
88
+ } | undefined;
89
+ radius?: {
90
+ [x: string & {}]: string | undefined;
91
+ xs?: string | undefined;
92
+ sm?: string | undefined;
93
+ md?: string | undefined;
94
+ lg?: string | undefined;
95
+ xl?: string | undefined;
96
+ } | undefined;
97
+ defaultRadius?: import("@mantine/core").MantineRadius | undefined;
98
+ spacing?: {
99
+ [x: number]: string | undefined;
100
+ [x: string & {}]: string | undefined;
101
+ xs?: string | undefined;
102
+ sm?: string | undefined;
103
+ md?: string | undefined;
104
+ lg?: string | undefined;
105
+ xl?: string | undefined;
106
+ } | undefined;
107
+ fontSizes?: {
108
+ [x: string & {}]: string | undefined;
109
+ xs?: string | undefined;
110
+ sm?: string | undefined;
111
+ md?: string | undefined;
112
+ lg?: string | undefined;
113
+ xl?: string | undefined;
114
+ } | undefined;
115
+ lineHeights?: {
116
+ [x: string & {}]: string | undefined;
117
+ xs?: string | undefined;
118
+ sm?: string | undefined;
119
+ md?: string | undefined;
120
+ lg?: string | undefined;
121
+ xl?: string | undefined;
122
+ } | undefined;
123
+ breakpoints?: {
124
+ [x: string & {}]: string | undefined;
125
+ xs?: string | undefined;
126
+ sm?: string | undefined;
127
+ md?: string | undefined;
128
+ lg?: string | undefined;
129
+ xl?: string | undefined;
130
+ } | undefined;
131
+ shadows?: {
132
+ [x: string & {}]: string | undefined;
133
+ xs?: string | undefined;
134
+ sm?: string | undefined;
135
+ md?: string | undefined;
136
+ lg?: string | undefined;
137
+ xl?: string | undefined;
138
+ } | undefined;
139
+ respectReducedMotion?: boolean | undefined;
140
+ cursorType?: "default" | "pointer" | undefined;
141
+ defaultGradient?: {
142
+ from?: string | undefined;
143
+ to?: string | undefined;
144
+ deg?: number | undefined;
145
+ } | undefined;
146
+ activeClassName?: string | undefined;
147
+ focusClassName?: string | undefined;
148
+ components?: {
149
+ [x: string]: {
150
+ classNames?: any;
151
+ styles?: any;
152
+ vars?: any;
153
+ defaultProps?: any;
154
+ } | undefined;
155
+ } | undefined;
156
+ other?: {
157
+ [x: string]: any;
158
+ } | undefined;
159
+ };
160
+ export type ShadowTheme = typeof shadowTheme;
161
+ export {};
package/theme.js ADDED
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Importing npm packages
3
+ */
4
+ import { ActionIcon, Badge, Card, createTheme, Modal, Paper, Table, Tooltip } from '@mantine/core';
5
+ /**
6
+ * Declaring the constants
7
+ */
8
+ const cyan = ['#e8fffe', '#c0f9f7', '#85f0ec', '#40e3dd', '#12d4cc', '#00bfb8', '#009e98', '#007d78', '#005e5a', '#003e3b'];
9
+ const slate = ['#f5f6f8', '#e5e8ed', '#c8cdd6', '#a2aab6', '#788596', '#546070', '#3a4555', '#253040', '#141e2e', '#0c1220'];
10
+ const terracotta = ['#f9e5dd', '#f2cbbb', '#ecb09a', '#e59678', '#df7c56', '#b26345', '#864a34', '#593223', '#2c1911', '#160c09'];
11
+ export const shadowTheme = createTheme({
12
+ colors: { cyan, slate, terracotta },
13
+ primaryColor: 'cyan',
14
+ primaryShade: { light: 6, dark: 5 },
15
+ autoContrast: true,
16
+ fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
17
+ fontFamilyMonospace: '"JetBrains Mono", "Fira Code", "Cascadia Code", monospace',
18
+ fontSizes: {
19
+ xs: '11px',
20
+ sm: '13px',
21
+ md: '14px',
22
+ lg: '16px',
23
+ xl: '18px',
24
+ },
25
+ lineHeights: {
26
+ xs: '1.4',
27
+ sm: '1.5',
28
+ md: '1.7',
29
+ lg: '1.8',
30
+ xl: '1.9',
31
+ },
32
+ headings: {
33
+ fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, sans-serif',
34
+ fontWeight: '500',
35
+ sizes: {
36
+ h1: { fontSize: '28px', lineHeight: '1.3' },
37
+ h2: { fontSize: '22px', lineHeight: '1.35' },
38
+ h3: { fontSize: '18px', lineHeight: '1.4' },
39
+ h4: { fontSize: '16px', lineHeight: '1.45' },
40
+ h5: { fontSize: '14px', lineHeight: '1.5' },
41
+ h6: { fontSize: '13px', lineHeight: '1.5' },
42
+ },
43
+ },
44
+ defaultRadius: 'sm',
45
+ radius: {
46
+ xs: '2px',
47
+ sm: '3px',
48
+ md: '4px',
49
+ lg: '6px',
50
+ xl: '8px',
51
+ },
52
+ spacing: {
53
+ xs: '4px',
54
+ sm: '8px',
55
+ md: '12px',
56
+ lg: '16px',
57
+ xl: '24px',
58
+ },
59
+ shadows: {
60
+ xs: '0 1px 2px rgba(0, 0, 0, 0.08)',
61
+ sm: '0 2px 6px rgba(0, 0, 0, 0.10)',
62
+ md: '0 4px 12px rgba(0, 0, 0, 0.12)',
63
+ lg: '0 8px 24px rgba(0, 0, 0, 0.14)',
64
+ xl: '0 16px 40px rgba(0, 0, 0, 0.16)',
65
+ },
66
+ components: {
67
+ Card: Card.extend({
68
+ defaultProps: {
69
+ radius: 'md',
70
+ padding: 'lg',
71
+ },
72
+ styles: {
73
+ root: {
74
+ border: `0.5px solid light-dark(${slate[1]}, ${slate[7]})`,
75
+ },
76
+ },
77
+ }),
78
+ Badge: Badge.extend({
79
+ defaultProps: {
80
+ variant: 'light',
81
+ },
82
+ }),
83
+ Paper: Paper.extend({
84
+ defaultProps: {
85
+ radius: 'md',
86
+ },
87
+ }),
88
+ Modal: Modal.extend({
89
+ defaultProps: {
90
+ radius: 'md',
91
+ centered: true,
92
+ },
93
+ }),
94
+ Tooltip: Tooltip.extend({
95
+ defaultProps: {
96
+ radius: 'xs',
97
+ },
98
+ }),
99
+ ActionIcon: ActionIcon.extend({
100
+ defaultProps: {
101
+ variant: 'subtle',
102
+ },
103
+ }),
104
+ Table: Table.extend({
105
+ defaultProps: {
106
+ striped: false,
107
+ highlightOnHover: true,
108
+ withColumnBorders: false,
109
+ },
110
+ }),
111
+ },
112
+ cursorType: 'pointer',
113
+ focusRing: 'auto',
114
+ });
115
+ //# sourceMappingURL=theme.js.map
package/theme.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"A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AC;QAEF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,YAAY,EAAE;gBACZ,OAAO,EAAE,OAAO;aACjB;SACF,CAAC;QAEF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,YAAY,EAAE;gBACZ,MAAM,EAAE,IAAI;aACb;SACF,CAAC;QAEF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,YAAY,EAAE;gBACZ,MAAM,EAAE,IAAI;gBACZ,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;QAEF,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC;YACtB,YAAY,EAAE;gBACZ,MAAM,EAAE,IAAI;aACb;SACF,CAAC;QAEF,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC;YAC5B,YAAY,EAAE;gBACZ,OAAO,EAAE,QAAQ;aAClB;SACF,CAAC;QAEF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,YAAY,EAAE;gBACZ,OAAO,EAAE,KAAK;gBACd,gBAAgB,EAAE,IAAI;gBACtB,iBAAiB,EAAE,KAAK;aACzB;SACF,CAAC;KACH;IAED,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,MAAM;CAClB,CAAC,CAAC"}
package/types.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Importing npm packages
3
+ */
4
+ /**
5
+ * Importing user defined packages
6
+ */
7
+ /**
8
+ * Defining types
9
+ */
10
+ export type Theme = 'light' | 'dark';
11
+ export type JsonObject = {
12
+ [Key in string]: JsonValue;
13
+ };
14
+ export type JsonArray = JsonValue[] | readonly JsonValue[];
15
+ export type JsonPrimitive = string | number | boolean | null;
16
+ export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
17
+ export interface PaginationUpdate extends Record<string, string | number | boolean> {
18
+ limit: number;
19
+ skip: number;
20
+ }