-
Notifications
You must be signed in to change notification settings - Fork 11
/
frameworks.ts
156 lines (133 loc) · 4.75 KB
/
frameworks.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import { ascend, indexBy, pipe, prop, sort, sortBy, toLower } from 'ramda';
import { ReactNode } from 'react';
import { Component } from './components';
import { Sentence, URL } from './entities';
import { antDesign } from './frameworks/antDesign';
import { atlaskit } from './frameworks/atlaskit';
import { blueprint } from './frameworks/blueprint';
import { carbonDesign } from './frameworks/carbonDesign';
import { chakra } from './frameworks/chakraUI';
import { elasticUI } from './frameworks/elasticUI';
import { element } from './frameworks/element';
import { elementalUI } from './frameworks/elementalUI';
import { evergreen } from './frameworks/evergreen';
import { fluentUI } from './frameworks/fluentUI';
import { gestalt } from './frameworks/gestalt';
import { grommet } from './frameworks/grommet';
import { mui } from './frameworks/mui';
import { onsenUI } from './frameworks/onsenUI';
import { orbit } from './frameworks/orbit';
import { primeReact } from './frameworks/primeReact';
import { quasar } from './frameworks/quasar';
import { reactBootstrap } from './frameworks/reactBootstrap';
import { reactMD } from './frameworks/reactMD';
import { reactToolbox } from './frameworks/reactToolbox';
import { ringUI } from './frameworks/ringUI';
import { semanticUI } from './frameworks/semanticUI';
import { smoothUI } from './frameworks/smoothUI';
import { zendesk } from './frameworks/zendesk';
import { checkmark, designKits, themer } from './utils';
export type FrameworkId = string;
export interface Framework {
/** must not end with a trailing forward slash */
frameworkHomepage: string;
frameworkId: FrameworkId;
frameworkName: string;
repoURL: URL;
components: Component[];
frameworkFeaturesById: FrameworkFeaturesById;
}
export const frameworks: Framework[] = sort(ascend(pipe(prop('frameworkName'), toLower)), [
antDesign,
atlaskit,
blueprint,
carbonDesign,
chakra,
elasticUI,
element,
elementalUI,
evergreen,
fluentUI,
gestalt,
grommet,
mui,
onsenUI,
orbit,
primeReact,
quasar,
reactBootstrap,
reactMD,
reactToolbox,
ringUI,
semanticUI,
smoothUI,
zendesk,
]);
export type FrameworksById = {
[frameworkId in FrameworkId]: Framework;
};
export const frameworksById: FrameworksById = indexBy(prop('frameworkId'), frameworks);
export interface DesignKit {
type: 'Abstract' | 'Adobe XD' | 'Axure' | 'Custom' | 'Figma' | 'Framer X' | 'Sketch';
href: URL;
}
export interface FrameworkFeaturesById {
/** criteria: an out-of-the-box dark mode */
darkMode: boolean;
/** criteria: a design kit supported by the developers */
designKits: DesignKit[] | false;
/** criteria: out-of-the-box support for right-to-left */
rtlSupport: boolean;
themer: URL | false;
/** criteria: high quality and up to date (in the repo, not on DefinitelyTyped) TypeScript types, or the app is written in TypeScript. */
typeScript: boolean;
}
export interface FrameworkFeatureInfoGeneric<T extends keyof FrameworkFeaturesById> {
featureId: T;
criteria: Sentence;
name: string;
toJsx: (input: FrameworkFeaturesById[T]) => ReactNode | string;
toMarkdown: (input: FrameworkFeaturesById[T]) => string;
}
export type FrameworkFeatureInfo =
| FrameworkFeatureInfoGeneric<'darkMode'>
| FrameworkFeatureInfoGeneric<'designKits'>
| FrameworkFeatureInfoGeneric<'rtlSupport'>
| FrameworkFeatureInfoGeneric<'themer'>
| FrameworkFeatureInfoGeneric<'typeScript'>;
export const frameworkInfo: FrameworkFeatureInfo[] = sortBy(prop('featureId'), [
{
criteria: 'The project is made with dark-mode styling in mind. An out-of-the-box dark mode is either used on the docs site itself or well documented and easy to configure.',
featureId: 'darkMode',
name: 'Native Dark Mode',
...checkmark,
},
{
criteria: 'Ready-made resources exist for designers such as Sketch or Figma download packs.',
featureId: 'designKits',
name: 'Design Kits',
...designKits,
},
{
criteria: 'Explicit right-to-Left support for use in apps with languages like Arabic, Hebrew, or Persian.',
featureId: 'rtlSupport',
name: 'RTL Support',
...checkmark,
},
{
criteria: 'A user-interactable theming area where designers and developers can play around with look and feel without needing to do any programming.',
featureId: 'themer',
name: 'Themer',
...themer,
},
{
criteria: 'Is either written in TypeScript (ideally) or has TypeScript definitions directly in the project. DefinitelyTyped does not qualify.',
featureId: 'typeScript',
name: 'Native TypeScript',
...checkmark,
},
]);
export type FrameworkInfoByFeatureId = {
[featureId in keyof FrameworkFeaturesById]: FrameworkFeatureInfo;
};
export const frameworkInfoByFeatureId: FrameworkInfoByFeatureId = indexBy(prop('featureId'), frameworkInfo);