@ankit119/doubletick-components 0.0.1
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/dist/doubletick-components.css +1 -0
- package/dist/doubletick-components.js +5211 -0
- package/dist/doubletick-components.js.map +1 -0
- package/dist/doubletick-components.umd.cjs +166 -0
- package/dist/doubletick-components.umd.cjs.map +1 -0
- package/dist/index.d.ts +271 -0
- package/package.json +66 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { Theme } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
/** Semantic design tokens derived from primitives (Figma: Colour Tokens) */
|
|
6
|
+
declare function createSemanticTokens(p: P): {
|
|
7
|
+
readonly text: {
|
|
8
|
+
readonly primary: string;
|
|
9
|
+
readonly secondary: string;
|
|
10
|
+
readonly tertiary: string;
|
|
11
|
+
readonly danger: string;
|
|
12
|
+
readonly success: string;
|
|
13
|
+
readonly warning: string;
|
|
14
|
+
readonly info: string;
|
|
15
|
+
readonly onDark: string;
|
|
16
|
+
readonly inverted: string;
|
|
17
|
+
readonly disabled: string;
|
|
18
|
+
};
|
|
19
|
+
readonly link: {
|
|
20
|
+
readonly default: string;
|
|
21
|
+
readonly hover: string;
|
|
22
|
+
readonly pressed: string;
|
|
23
|
+
readonly visited: string;
|
|
24
|
+
};
|
|
25
|
+
readonly icon: {
|
|
26
|
+
readonly primary: string;
|
|
27
|
+
readonly secondary: string;
|
|
28
|
+
readonly tertiary: string;
|
|
29
|
+
readonly danger: string;
|
|
30
|
+
readonly success: string;
|
|
31
|
+
readonly warning: string;
|
|
32
|
+
readonly info: string;
|
|
33
|
+
readonly onDark: string;
|
|
34
|
+
readonly inverted: string;
|
|
35
|
+
readonly disabled: string;
|
|
36
|
+
};
|
|
37
|
+
readonly border: {
|
|
38
|
+
readonly primary: string;
|
|
39
|
+
readonly secondary: string;
|
|
40
|
+
readonly tertiary: string;
|
|
41
|
+
readonly danger: string;
|
|
42
|
+
readonly success: string;
|
|
43
|
+
readonly warning: string;
|
|
44
|
+
readonly info: string;
|
|
45
|
+
readonly onDark: string;
|
|
46
|
+
readonly inverted: string;
|
|
47
|
+
readonly disabled: string;
|
|
48
|
+
};
|
|
49
|
+
readonly background: {
|
|
50
|
+
readonly primary: string;
|
|
51
|
+
readonly secondary: string;
|
|
52
|
+
readonly tertiary: string;
|
|
53
|
+
readonly overlay: "rgba(0,0,0,0.5)";
|
|
54
|
+
readonly disabled: string;
|
|
55
|
+
readonly field: string;
|
|
56
|
+
readonly canvas: string;
|
|
57
|
+
readonly card: "#ffffff";
|
|
58
|
+
readonly cardInverted: string;
|
|
59
|
+
readonly focus: string;
|
|
60
|
+
readonly hover: string;
|
|
61
|
+
readonly pressed: string;
|
|
62
|
+
readonly selected: string;
|
|
63
|
+
readonly selectedHover: string;
|
|
64
|
+
readonly selectedPressed: string;
|
|
65
|
+
readonly selectedFocussed: string;
|
|
66
|
+
readonly danger: string;
|
|
67
|
+
readonly dangerLight: string;
|
|
68
|
+
readonly success: string;
|
|
69
|
+
readonly successLight: string;
|
|
70
|
+
readonly warning: string;
|
|
71
|
+
readonly warningLight: string;
|
|
72
|
+
readonly info: string;
|
|
73
|
+
readonly infoLight: string;
|
|
74
|
+
readonly buttonPrimary: string;
|
|
75
|
+
readonly buttonPrimaryHover: string;
|
|
76
|
+
readonly buttonPrimaryPressed: string;
|
|
77
|
+
readonly buttonSecondary: string;
|
|
78
|
+
readonly buttonSecondaryHover: string;
|
|
79
|
+
readonly buttonSecondaryPressed: string;
|
|
80
|
+
readonly tag: string;
|
|
81
|
+
readonly tagHover: string;
|
|
82
|
+
readonly tagPressed: string;
|
|
83
|
+
readonly badge: string;
|
|
84
|
+
readonly badgeInverted: string;
|
|
85
|
+
};
|
|
86
|
+
readonly shadow: {
|
|
87
|
+
readonly sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)";
|
|
88
|
+
readonly md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";
|
|
89
|
+
readonly lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export declare function DTFilterButton(props: DTFilterButtonProps): JSX_2.Element;
|
|
94
|
+
|
|
95
|
+
declare type DTFilterButtonBase = {
|
|
96
|
+
placeholder: string;
|
|
97
|
+
options: DTFilterOption[];
|
|
98
|
+
disabled?: boolean;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
declare type DTFilterButtonMulti = DTFilterButtonBase & {
|
|
102
|
+
variant: 'multi';
|
|
103
|
+
value: string[];
|
|
104
|
+
onChange: (values: string[]) => void;
|
|
105
|
+
label?: string;
|
|
106
|
+
searchable?: boolean;
|
|
107
|
+
loading?: boolean;
|
|
108
|
+
noOptionsText?: string;
|
|
109
|
+
noSelectedOptionsText?: string;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export declare type DTFilterButtonProps = DTFilterButtonMulti | DTFilterButtonSingle;
|
|
113
|
+
|
|
114
|
+
declare type DTFilterButtonSingle = DTFilterButtonBase & {
|
|
115
|
+
variant: 'single';
|
|
116
|
+
value: string | null;
|
|
117
|
+
onChange: (value: string | null) => void;
|
|
118
|
+
getDisplayValue?: (value: string | null) => ReactNode;
|
|
119
|
+
customOptionIds?: string[];
|
|
120
|
+
onCustomSelect?: (optionId: string) => void;
|
|
121
|
+
searchable?: boolean;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export declare type DTFilterOption = {
|
|
125
|
+
id: string;
|
|
126
|
+
name: string;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
declare type P = typeof primitives;
|
|
130
|
+
|
|
131
|
+
declare const primitives: {
|
|
132
|
+
readonly primary: PrimitiveScale;
|
|
133
|
+
readonly blue: PrimitiveScale;
|
|
134
|
+
readonly green: PrimitiveScale;
|
|
135
|
+
readonly red: PrimitiveScale;
|
|
136
|
+
readonly yellow: PrimitiveScale;
|
|
137
|
+
readonly purple: PrimitiveScale;
|
|
138
|
+
readonly orange: PrimitiveScale;
|
|
139
|
+
readonly teal: PrimitiveScale;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
declare type PrimitiveScale = Record<Shade, string>;
|
|
143
|
+
|
|
144
|
+
export declare type SemanticTokens = ReturnType<typeof createSemanticTokens>;
|
|
145
|
+
|
|
146
|
+
declare type Shade = (typeof shadeKeys)[number];
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Design system primitive colour scales (50–950).
|
|
150
|
+
* Single source of truth for the DT design system; semantic tokens reference these.
|
|
151
|
+
*/
|
|
152
|
+
declare const shadeKeys: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
|
|
153
|
+
|
|
154
|
+
export declare const theme: Theme;
|
|
155
|
+
|
|
156
|
+
export declare const tokens: {
|
|
157
|
+
readonly text: {
|
|
158
|
+
readonly primary: string;
|
|
159
|
+
readonly secondary: string;
|
|
160
|
+
readonly tertiary: string;
|
|
161
|
+
readonly danger: string;
|
|
162
|
+
readonly success: string;
|
|
163
|
+
readonly warning: string;
|
|
164
|
+
readonly info: string;
|
|
165
|
+
readonly onDark: string;
|
|
166
|
+
readonly inverted: string;
|
|
167
|
+
readonly disabled: string;
|
|
168
|
+
};
|
|
169
|
+
readonly link: {
|
|
170
|
+
readonly default: string;
|
|
171
|
+
readonly hover: string;
|
|
172
|
+
readonly pressed: string;
|
|
173
|
+
readonly visited: string;
|
|
174
|
+
};
|
|
175
|
+
readonly icon: {
|
|
176
|
+
readonly primary: string;
|
|
177
|
+
readonly secondary: string;
|
|
178
|
+
readonly tertiary: string;
|
|
179
|
+
readonly danger: string;
|
|
180
|
+
readonly success: string;
|
|
181
|
+
readonly warning: string;
|
|
182
|
+
readonly info: string;
|
|
183
|
+
readonly onDark: string;
|
|
184
|
+
readonly inverted: string;
|
|
185
|
+
readonly disabled: string;
|
|
186
|
+
};
|
|
187
|
+
readonly border: {
|
|
188
|
+
readonly primary: string;
|
|
189
|
+
readonly secondary: string;
|
|
190
|
+
readonly tertiary: string;
|
|
191
|
+
readonly danger: string;
|
|
192
|
+
readonly success: string;
|
|
193
|
+
readonly warning: string;
|
|
194
|
+
readonly info: string;
|
|
195
|
+
readonly onDark: string;
|
|
196
|
+
readonly inverted: string;
|
|
197
|
+
readonly disabled: string;
|
|
198
|
+
};
|
|
199
|
+
readonly background: {
|
|
200
|
+
readonly primary: string;
|
|
201
|
+
readonly secondary: string;
|
|
202
|
+
readonly tertiary: string;
|
|
203
|
+
readonly overlay: "rgba(0,0,0,0.5)";
|
|
204
|
+
readonly disabled: string;
|
|
205
|
+
readonly field: string;
|
|
206
|
+
readonly canvas: string;
|
|
207
|
+
readonly card: "#ffffff";
|
|
208
|
+
readonly cardInverted: string;
|
|
209
|
+
readonly focus: string;
|
|
210
|
+
readonly hover: string;
|
|
211
|
+
readonly pressed: string;
|
|
212
|
+
readonly selected: string;
|
|
213
|
+
readonly selectedHover: string;
|
|
214
|
+
readonly selectedPressed: string;
|
|
215
|
+
readonly selectedFocussed: string;
|
|
216
|
+
readonly danger: string;
|
|
217
|
+
readonly dangerLight: string;
|
|
218
|
+
readonly success: string;
|
|
219
|
+
readonly successLight: string;
|
|
220
|
+
readonly warning: string;
|
|
221
|
+
readonly warningLight: string;
|
|
222
|
+
readonly info: string;
|
|
223
|
+
readonly infoLight: string;
|
|
224
|
+
readonly buttonPrimary: string;
|
|
225
|
+
readonly buttonPrimaryHover: string;
|
|
226
|
+
readonly buttonPrimaryPressed: string;
|
|
227
|
+
readonly buttonSecondary: string;
|
|
228
|
+
readonly buttonSecondaryHover: string;
|
|
229
|
+
readonly buttonSecondaryPressed: string;
|
|
230
|
+
readonly tag: string;
|
|
231
|
+
readonly tagHover: string;
|
|
232
|
+
readonly tagPressed: string;
|
|
233
|
+
readonly badge: string;
|
|
234
|
+
readonly badgeInverted: string;
|
|
235
|
+
};
|
|
236
|
+
readonly shadow: {
|
|
237
|
+
readonly sm: "0 1px 2px 0 rgb(0 0 0 / 0.05)";
|
|
238
|
+
readonly md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)";
|
|
239
|
+
readonly lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)";
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
export { }
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
declare module '@mui/material/styles' {
|
|
247
|
+
interface Theme {
|
|
248
|
+
designTokens: typeof tokens;
|
|
249
|
+
custom: {
|
|
250
|
+
base_card_ui: {
|
|
251
|
+
borderRadius: string;
|
|
252
|
+
border: string;
|
|
253
|
+
background: string;
|
|
254
|
+
padding: string;
|
|
255
|
+
boxShadow: string;
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
interface ThemeOptions {
|
|
260
|
+
designTokens?: typeof tokens;
|
|
261
|
+
custom?: {
|
|
262
|
+
base_card_ui?: {
|
|
263
|
+
borderRadius?: string;
|
|
264
|
+
border?: string;
|
|
265
|
+
background?: string;
|
|
266
|
+
padding?: string;
|
|
267
|
+
boxShadow?: string;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ankit119/doubletick-components",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Reusable React components with MUI, consumable across repos",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/doubletick-components.umd.cjs",
|
|
7
|
+
"module": "./dist/doubletick-components.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/doubletick-components.js",
|
|
13
|
+
"require": "./dist/doubletick-components.umd.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"dev": "vite",
|
|
21
|
+
"build": "tsc && vite build",
|
|
22
|
+
"preview": "vite preview",
|
|
23
|
+
"storybook": "storybook dev -p 6006",
|
|
24
|
+
"build-storybook": "storybook build",
|
|
25
|
+
"sync-figma": "node scripts/sync-figma-variables.mjs"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@emotion/react": "^11.0.0",
|
|
29
|
+
"@emotion/styled": "^11.0.0",
|
|
30
|
+
"@mui/icons-material": "^5.0.0 || ^6.0.0",
|
|
31
|
+
"@mui/material": "^5.0.0 || ^6.0.0",
|
|
32
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
33
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@chromatic-com/storybook": "^5.0.1",
|
|
37
|
+
"@emotion/react": "^11.13.3",
|
|
38
|
+
"@emotion/styled": "^11.13.0",
|
|
39
|
+
"@mui/icons-material": "^6.1.6",
|
|
40
|
+
"@mui/material": "^6.1.6",
|
|
41
|
+
"@storybook/addon-a11y": "^10.2.11",
|
|
42
|
+
"@storybook/addon-docs": "^10.2.11",
|
|
43
|
+
"@storybook/addon-onboarding": "^10.2.11",
|
|
44
|
+
"@storybook/addon-vitest": "^10.2.11",
|
|
45
|
+
"@storybook/react-vite": "^10.2.11",
|
|
46
|
+
"@types/node": "^22.13.0",
|
|
47
|
+
"@types/react": "^18.3.12",
|
|
48
|
+
"@types/react-dom": "^18.3.1",
|
|
49
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
50
|
+
"@vitest/browser-playwright": "^4.0.18",
|
|
51
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
52
|
+
"chromatic": "^15.2.0",
|
|
53
|
+
"playwright": "^1.58.2",
|
|
54
|
+
"react": "^18.3.1",
|
|
55
|
+
"react-dom": "^18.3.1",
|
|
56
|
+
"storybook": "^10.2.11",
|
|
57
|
+
"typescript": "~5.6.3",
|
|
58
|
+
"vite": "^6.0.1",
|
|
59
|
+
"vite-plugin-dts": "^4.3.0",
|
|
60
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
61
|
+
"vitest": "^4.0.18"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"@fontsource/inter": "^5.2.8"
|
|
65
|
+
}
|
|
66
|
+
}
|