@xyd-js/themes 0.1.1-xyd.3 → 0.1.1-xyd.44

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.
@@ -0,0 +1,429 @@
1
+ :root {
2
+ color-scheme: light dark;
3
+ }
4
+
5
+ /* Global */
6
+ :root {
7
+ --white: #fff;
8
+ --black: #000;
9
+ --dark8: #f7f7f8;
10
+ --dark16: #f9f9f9;
11
+ --dark32: #ececf1;
12
+ --dark32-rgb: 236, 236, 241;
13
+ --dark40: #c5c5d2;
14
+ --dark48: #6e6e80;
15
+ --dark60: #443a3a;
16
+ --dark80: #111827;
17
+ --dark100: var(--black);
18
+ --purple80: #7051d4;
19
+ --purple100: #2e108e;
20
+ --blue16: #e4edff;
21
+ --blue32: #60A5FA;
22
+ --blue80: #1971a8;
23
+ --green32: #d4f5e7;
24
+ --green60: #14c397;
25
+ --green80: #28a745;
26
+ /* --green100: #108944; */
27
+ --green100: #00936f;
28
+ --red80: #dc3545;
29
+ --red100: #b91c1c;
30
+ --yellow80: #ffc107;
31
+
32
+ --color-bg: var(--white);
33
+ --color-text: var(--dark100);
34
+
35
+ --text-primary: var(--color-text);
36
+ --text-secondary: var(--dark80);
37
+ --text-tertiary: var(--dark60);
38
+
39
+ --color-primary: var(--theme-color-primary, var(--purple80));
40
+ --color-primary--active: var(--theme-color-primary-active, var(--purple100));
41
+ }
42
+
43
+ /* Dark Mode Global */
44
+ [data-color-scheme="dark"] {
45
+ --white: #0e0e10;
46
+ --black: #fff;
47
+ --dark8: #1a1a1a;
48
+ --dark16: #2d2d2d;
49
+ --dark32: #404040;
50
+ --dark32-rgb: 64, 64, 64;
51
+ --dark40: #525252;
52
+ --dark48: #9E9E9E;
53
+ --dark60: #a3a3a3;
54
+ --dark80: #d4d4d4;
55
+ --dark100: var(--black);
56
+ --purple80: #7051d4;
57
+ --purple100: #2e108e;
58
+ --blue16: #e4edff;
59
+ --blue32: #60A5FA;
60
+ --blue80: #1971a8;
61
+ --green80: #28a745;
62
+ --green100: #108944;
63
+ --red80: #dc3545;
64
+ --red100: #b91c1c;
65
+ --yellow80: #ffc107;
66
+
67
+ --color-bg: var(--white);
68
+ --color-text: var(--dark100);
69
+
70
+ --text-primary: var(--color-text);
71
+ --text-secondary: var(--dark80);
72
+ --text-tertiary: var(--dark60);
73
+
74
+ --color-primary: var(--theme-color-primary, var(--purple80));
75
+ --color-primary--active: var(--theme-color-primary-active, var(--purple100));
76
+
77
+ body {
78
+ color: var(--xyd-text-color--default);
79
+ }
80
+ }
81
+
82
+ /* System Dark Mode Support */
83
+ @media (prefers-color-scheme: dark) {
84
+ :root:not([data-color-scheme="light"]):not([data-color-scheme="dark"]) {
85
+ --white: #0e0e10;
86
+ --black: #fff;
87
+ --dark8: #1a1a1a;
88
+ --dark16: #2d2d2d;
89
+ --dark32: #404040;
90
+ --dark32-rgb: 64, 64, 64;
91
+ --dark40: #525252;
92
+ --dark48: #9E9E9E;
93
+ --dark60: #a3a3a3;
94
+ --dark80: #d4d4d4;
95
+ --dark100: var(--black);
96
+ --purple80: #7051d4;
97
+ --purple100: #2e108e;
98
+ --blue16: #e4edff;
99
+ --blue32: #60A5FA;
100
+ --blue80: #1971a8;
101
+ --green80: #28a745;
102
+ --green100: #108944;
103
+ --red80: #dc3545;
104
+ --red100: #b91c1c;
105
+ --yellow80: #ffc107;
106
+
107
+ --color-bg: var(--white);
108
+ --color-text: var(--dark100);
109
+
110
+ --text-primary: var(--color-text);
111
+ --text-secondary: var(--dark80);
112
+ --text-tertiary: var(--dark60);
113
+
114
+ --color-primary: var(--theme-color-primary, var(--purple80));
115
+ --color-primary--active: var(--theme-color-primary-active, var(--purple100));
116
+ }
117
+
118
+ :root:not([data-color-scheme="light"]):not([data-color-scheme="dark"]) body {
119
+ color: var(--xyd-text-color--default);
120
+ }
121
+ }
122
+
123
+ /* Layout */
124
+ :root {
125
+ --xyd-page-body-bgcolor: var(--color-bg);
126
+ --xyd-layout-header-bgcolor: var(--color-bg);
127
+ --xyd-page-body-color: var(--text-primary);
128
+ --xyd-page-body-color--secondary: var(--dark60);
129
+
130
+ --xyd-page-gutter: 8px;
131
+ --xyd-content-space: 12px;
132
+
133
+ --xyd-sidebar-width: 250px;
134
+ --xyd-sidebar-width--mobile: 250px;
135
+ --xyd-layout-sidebar-bgcolor: var(--color-bg);
136
+
137
+ --xyd-header-total-height: calc(var(--xyd-nav-height) + var(--xyd-subnav-height));
138
+
139
+ --xyd-layout-width-small: 800px;
140
+ --xyd-layout-width-medium: 1000px;
141
+ --xyd-layout-width-large: 1200px;
142
+ --xyd-layout-nav-width-small: 200px;
143
+ --xyd-layout-nav-width-medium: 256px;
144
+ }
145
+
146
+ /* Fonts */
147
+ :root {
148
+ /* Font Sizes */
149
+ --xyd-font-size-xsmall: 12px;
150
+ --xyd-font-size-small: 14px;
151
+ --xyd-font-size-medium: 16px;
152
+ --xyd-font-size-large: 18px;
153
+ --xyd-font-size-xlarge: 22px;
154
+ --xyd-font-size-xxlarge: 26px;
155
+ --xyd-font-size-2xl: 32px;
156
+
157
+ /* Line Heights */
158
+ --xyd-line-height-xsmall: 16px;
159
+ --xyd-line-height-small: 19px;
160
+ --xyd-line-height-medium: 25px;
161
+ --xyd-line-height-large: 27px;
162
+ --xyd-line-height-xlarge: 33px;
163
+ --xyd-line-height-xxlarge: 39px;
164
+ --xyd-line-height-2xl: 44px;
165
+
166
+ /* Font Weights */
167
+ --xyd-font-weight-normal: 400;
168
+ --xyd-font-weight-medium: 500;
169
+ --xyd-font-weight-semibold: 600;
170
+ --xyd-font-weight-bold: 700;
171
+ --xyd-font-weight-extrabold: 800;
172
+ --xyd-font-weight-black: 900;
173
+ }
174
+
175
+ /* Media Queries */
176
+ :root {
177
+ /* ////////////// MEDIA QUERIES ////////////// */
178
+ --xyd-mobile-breakpoint: 768px;
179
+ --xyd-tablet-breakpoint: 1024px;
180
+ }
181
+
182
+ /* Transitions */
183
+ :root {
184
+ --xyd-cubic-bezier: cubic-bezier(.65, 0, .35, 1);
185
+
186
+ }
187
+
188
+ /* Sizes */
189
+ :root {
190
+ --xyd-padding-default: 16px;
191
+ }
192
+
193
+ /* Components */
194
+ :root {
195
+ /* Callout */
196
+ --xyd-callout-bgcolor: var(--dark8);
197
+ --xyd-callout-border-color: var(--dark32);
198
+ --xyd-callout-icon-color: var(--dark48);
199
+ --xyd-callout-message-color: var(--dark80);
200
+
201
+ /* Button */
202
+ --xyd-button-primary-bg: var(--color-primary);
203
+ --xyd-button-primary-color: var(--white);
204
+ --xyd-button-primary-border: var(--color-primary);
205
+ --xyd-button-primary-bg-hover: var(--color-primary--active);
206
+ --xyd-button-primary-border-hover: var(--color-primary--active);
207
+
208
+ --xyd-button-secondary-bg: var(--dark16);
209
+ --xyd-button-secondary-color: var(--text-primary);
210
+ --xyd-button-secondary-border: var(--dark32);
211
+ --xyd-button-secondary-bg-hover: var(--dark32);
212
+ --xyd-button-secondary-border-hover: var(--dark40);
213
+
214
+ --xyd-button-tertiary-bg: transparent;
215
+ --xyd-button-tertiary-color: var(--text-primary);
216
+ --xyd-button-tertiary-border: transparent;
217
+ --xyd-button-tertiary-bg-hover: var(--dark16);
218
+ --xyd-button-tertiary-border-hover: var(--dark32);
219
+
220
+ /* Card */
221
+ --xyd-card-bgcolor: var(--color-bg);
222
+ --xyd-card-shadow-color: var(--dark32);
223
+ --xyd-card-border-color: var(--dark32);
224
+
225
+ /* Coder */
226
+ --xyd-code-bgcolor: linear-gradient(45deg, var(--dark8) 0%, var(--dark8) 100%);
227
+ --xyd-code-border-color: var(--dark32);
228
+
229
+ /* Coder Code */
230
+ --xyd-coder-code-background: linear-gradient(45deg, var(--dark8) 0%, var(--dark8) 100%);
231
+ --xyd-coder-code-border-color: var(--dark32);
232
+ --xyd-coder-code-mark-border-color: var(--blue32);
233
+ --xyd-coder-code-mark-bgcolor: var(--dark16);
234
+ --xyd-coder-code-copy-color: var(--dark48);
235
+
236
+ /* Code Tabs */
237
+ --xyd-codetabs-border-color: var(--dark32);
238
+ --xyd-codetabs-bgcolor: linear-gradient(45deg, var(--dark8) 0%, var(--dark8) 100%);
239
+ --xyd-codetabs-color: var(--dark80);
240
+ --xyd-codetabs-color--active: var(--color-primary);
241
+ --xyd-codetabs-color--hover: var(--dark32);
242
+
243
+ /* Badge */
244
+ --xyd-badge-color--default: var(--xyd-text-color);
245
+ --xyd-badge-bgcolor--default: var(--dark32);
246
+
247
+ --xyd-badge-color--warning: var(--xyd-page-body-color);
248
+ --xyd-badge-bgcolor--warning: var(--yellow80);
249
+ --xyd-badge-color--info: var(--color-bg);
250
+ --xyd-badge-bgcolor--info: var(--blue80);
251
+
252
+ /* Banner */
253
+ --xyd-banner-bgcolor: var(--blue16);
254
+ --xyd-banner-border-color: unset;
255
+ --xyd-banner-color: var(--black);
256
+ --xyd-banner-boxshadow: 0 2px 5px rgba(0, 0, 0, .1);
257
+
258
+ /* Breadcrumbs */
259
+ --xyd-breadcrumbs-color: var(--dark48);
260
+ --xyd-breadcrumbs-color--active: var(--text-primary);
261
+
262
+ /* Details */
263
+ --xyd-details-border-color: var(--dark32);
264
+ --xyd-details-bgcolor--secondary: var(--dark16);
265
+ --xyd-details-summary-color: var(--dark48);
266
+ --xyd-details-summary-color--active: var(--text-primary);
267
+ --xyd-details-summary-code-bgcolor: var(--color-bg);
268
+ --xyd-details-content-bgcolor: var(--color-bg);
269
+
270
+ /* GuideCard */
271
+ --xyd-guidecard-border-color--secondary: var(--dark32);
272
+ --xyd-guidecard-bgcolor--secondary: var(--dark16);
273
+ --xyd-guidecard-bgcolor--secondary-active: var(--color-bg);
274
+ --xyd-guidecard-icon-color: var(--text-primary);
275
+ --xyd-guidecard-title-color: var(--text-primary);
276
+ --xyd-guidecard-color: var(--dark48);
277
+ /* Heading */
278
+ --xyd-heading-color: var(--text-primary);
279
+ --xyd-heading-color--muted: var(--dark48);
280
+ --xyd-heading-icon-color: var(--color-primary);
281
+
282
+ /* Text */
283
+ --xyd-text-color: var(--text-primary);
284
+ --xyd-text-color--default: var(--text-primary);
285
+ --xyd-text-color--ghost: var(--text-tertiary);
286
+ --xyd-text-color--success: var(--green80);
287
+ --xyd-text-color--success--active: var(--green100);
288
+ --xyd-text-color--success--muted: rgba(40, 167, 69, 0.3);
289
+ --xyd-text-color--warn: var(--yellow80);
290
+ --xyd-text-color--error: var(--red80);
291
+ --xyd-text-color--error--active: var(--red100);
292
+ --xyd-text-color--error--muted: rgba(220, 53, 69, 0.3);
293
+ --xyd-text-color--primary: var(--color-primary);
294
+ --xyd-text-color--secondary: var(--text-secondary);
295
+
296
+ /* Anchor */
297
+ --xyd-anchor-color: var(--color-primary);
298
+ --xyd-anchor-color--hover: var(--color-primary--active);
299
+
300
+ /* Hr */
301
+ --xyd-hr-border-color: var(--dark32);
302
+
303
+ /* List */
304
+ --xyd-list-marker-color: var(--dark48);
305
+ --xyd-list-item-bgcolor: var(--dark48);
306
+
307
+ /* NavLinks */
308
+ --xyd-navlinks-border-color: var(--dark32);
309
+
310
+ /* Pre */
311
+ --xyd-pre-bgcolor: var(--dark16);
312
+
313
+ /* Steps */
314
+ --xyd-steps-marker-bgcolor: var(--dark32);
315
+ --xyd-steps-marker-color: var(--dark80);
316
+
317
+ /* Table */
318
+ --xyd-table-border-color: var(--dark32);
319
+ --xyd-table-bgcolor: var(--dark16);
320
+
321
+ /* Tabs */
322
+ --xyd-tabs-bgcolor: var(--dark16);
323
+ --xyd-tabs-arrow-bgcolor: var(--color-bg);
324
+ --xyd-tabs-color: var(--dark48);
325
+ --xyd-tabs-color--active: var(--text-primary);
326
+ --xyd-tabs-bgcolor--active: var(--color-bg);
327
+ --xyd-tabs-shadow-color--active: rgba(0, 0, 0, 0.05);
328
+
329
+ /* TocCard */
330
+ --xyd-toccard-border-color: var(--dark32);
331
+ --xyd-toccard-border-color--active: var(--dark40);
332
+ --xyd-toccard-color: var(--dark48);
333
+ --xyd-toccard-title-color: var(--dark80);
334
+ --xyd-toccard-icon-color: var(--dark80);
335
+
336
+ /* UnderlineNav */
337
+ --xyd-underlinenav-bgcolor: var(--color-bg);
338
+ --xyd-underlinenav-border-color: hsl(212, 15%, calc(96% - 12% * 1));
339
+ --xyd-underlinenav-list-color: hsl(212, 15%, calc(96% - 12% * 4));
340
+ --xyd-underlinenav-color--active: var(--color-primary);
341
+
342
+ /* VideoGuide Miniature*/
343
+ --xyd-videoguide-miniature-mini-width: 202px;
344
+ --xyd-videoguide-miniature-mini-height: 113px;
345
+ --xyd-videoguide-miniature-expanded-height: 100px;
346
+ --xyd-videoguide-miniature-z-index: 1000;
347
+ --xyd-videoguide-miniature-radius: 4px;
348
+ --xyd-videoguide-miniature-shadow: 0 7px 14px 0 rgba(60, 66, 87, 0.08), 0 3px 6px 0 rgba(0, 0, 0, 0.12);
349
+ --xyd-videoguide-miniature-bgcolor: var(--color-bg);
350
+ --xyd-videoguide-miniature-duration: 0.3s;
351
+ --xyd-videoguide-miniature-color: var(--color-bg);
352
+
353
+ /* Nav */
354
+ --xyd-nav-height: 50px;
355
+ --xyd-nav-shadow-bgcolor: var(--color-bg);
356
+ --xyd-nav-item-color: var(--text-primary);
357
+ --xyd-nav-item-color--active: var(--dark80);
358
+ --xyd-nav-item-bgcolor--active: var(--dark16);
359
+
360
+ /* ProgressBar */
361
+ --xyd-progressbar-bgcolor: var(--dark16);
362
+ --xyd-progressbar-bgcolor--active: var(--color-primary);
363
+
364
+ /* Sidebar */
365
+ --xyd-sidebar-padding: 8px;
366
+
367
+ --xyd-sidebar-bgcolor: var(--dark16);
368
+ --xyd-sidebar-divider-color: var(--dark32);
369
+ --xyd-sidebar-divider-shadow-color: var(--dark32);
370
+
371
+ --xyd-sidebar-item-color--active: var(--text-primary);
372
+ --xyd-sidebar-item-bgcolor--active: var(--dark32);
373
+ --xyd-sidebar-item-bgcolor--active-hover: var(--dark32);
374
+ --xyd-sidebar-item-bgcolor--active-mark: var(--color-primary);
375
+ --xyd-sidebar-item-color: var(--dark48);
376
+ --xyd-sidebar-item-header-color: var(--text-primary);
377
+ --xyd-sidebar-item-padding-left: var(--xyd-padding-default);
378
+
379
+ /* SubNav */
380
+ --xyd-subnav-height: 44px;
381
+ --xyd-subnav-bgcolor: var(--dark16);
382
+ --xyd-subnav-prefix-color: var(--dark48);
383
+ --xyd-subnav-prefix-marker-color: var(--dark32);
384
+ --xyd-subnav-item-color: var(--dark48);
385
+ --xyd-subnav-item-color--active: var(--color-text);
386
+ --xyd-subnav-item-color--active-mark: var(--color-primary);
387
+
388
+ /* Toc */
389
+ --xyd-toc-bgcolor: var(--dark32);
390
+ --xyd-toc-scroll-bgcolor: var(--dark80);
391
+ --xyd-toc-item-color: var(--dark48);
392
+ --xyd-toc-item-color--active: var(--dark80);
393
+
394
+ /* SearchButton */
395
+ --xyd-searchbutton-background: var(--dark16);
396
+ }
397
+
398
+ /* Atlas */
399
+ :root {
400
+ --XydAtlas-Ref-Palette-White: var(--white);
401
+ --XydAtlas-Ref-Palette-Primary-60: var(--purple80);
402
+ --XydAtlas-Ref-Palette-Primary-70: var(--purple80);
403
+ --XydAtlas-Ref-Palette-Primary-80: var(--purple80);
404
+ --XydAtlas-Ref-Palette-Neutral-10: var(--dark8);
405
+ --XydAtlas-Ref-Palette-Neutral-20: var(--dark16);
406
+ --XydAtlas-Ref-Palette-Neutral-30: var(--dark32);
407
+ --XydAtlas-Ref-Palette-Neutral-40: var(--dark48);
408
+ --XydAtlas-Ref-Palette-Neutral-70: var(--dark60);
409
+ --XydAtlas-Ref-Palette-Neutral-80: var(--dark80);
410
+ --XydAtlas-Ref-Palette-Neutral-100: var(--dark100);
411
+
412
+ }
413
+
414
+ [data-color-scheme="dark"] {
415
+ --xyd-sidebar-bgcolor: var(--white);
416
+ --xyd-text-color--default: var(--dark48);
417
+ --xyd-heading-color--muted: var(--dark80);
418
+ --xyd-button-primary-color: var(--black);
419
+ }
420
+
421
+ /* System dark mode support for sidebar - only when OS preference is enabled */
422
+ @media (prefers-color-scheme: dark) {
423
+ :root:not([data-color-scheme="light"]):not([data-color-scheme="dark"]) {
424
+ --xyd-sidebar-bgcolor: var(--white);
425
+ --xyd-text-color--default: var(--dark48);
426
+ --xyd-heading-color--muted: var(--dark80);
427
+ --xyd-button-primary-color: var(--black);
428
+ }
429
+ }
package/tsconfig.json CHANGED
@@ -1,5 +1,16 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "paths": {
4
+ "@xyd-js/framework/react": [
5
+ "../xyd-framework/packages/react/index.ts"
6
+ ],
7
+ "@xyd-js/context": [
8
+ "../xyd-context/src/index.ts"
9
+ ],
10
+ "@xyd-js/core": [
11
+ "../xyd-core/src/index.ts"
12
+ ]
13
+ },
3
14
  "module": "esnext",
4
15
  "esModuleInterop": true,
5
16
  "moduleResolution": "bundler",
@@ -22,11 +33,15 @@
22
33
  "name": "next"
23
34
  }
24
35
  ],
25
- "strictNullChecks": true
36
+ "strictNullChecks": true,
37
+ "typeRoots": [
38
+ "./types.d.ts"
39
+ ]
26
40
  },
27
41
  "include": [
28
42
  "src/**/*.ts",
29
- "src/**/*.tsx"
43
+ "src/**/*.tsx",
44
+ "types.d.ts"
30
45
  ],
31
46
  "exclude": [
32
47
  "node_modules"
package/tsup.config.ts CHANGED
@@ -1,4 +1,11 @@
1
1
  import { defineConfig } from 'tsup';
2
+ import pkg from './package.json' assert { type: 'json' }
3
+
4
+ const deps = [
5
+ ...Object.keys(pkg.dependencies || {}),
6
+ ...Object.keys(pkg.devDependencies || {}),
7
+ ...Object.keys(pkg.peerDependencies || {}),
8
+ ]
2
9
 
3
10
  export default defineConfig({
4
11
  entry: {
@@ -15,6 +22,9 @@ export default defineConfig({
15
22
  splitting: false,
16
23
  sourcemap: true,
17
24
  clean: true,
25
+ external: [
26
+ ...deps
27
+ ],
18
28
  esbuildOptions: (options) => {
19
29
  options.platform = 'node';
20
30
  options.external = ['node:fs/promises', 'react-router'];
package/types.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import * as React from 'react'
2
+
3
+ declare global {
4
+ namespace React {
5
+ namespace JSX {
6
+ interface IntrinsicElements {
7
+ 'xyd-built-with': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
8
+ 'xyd-page-footer': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
9
+ }
10
+ }
11
+ }
12
+ }
package/dist/tokens.css DELETED
@@ -1,55 +0,0 @@
1
- /*TODO: in the future not needed cuz every component would have have default styles itself?*/
2
-
3
- body {
4
- margin: 0;
5
- }
6
-
7
- ol, ul, menu {
8
- list-style: none;
9
- margin: 0;
10
- padding: 0;
11
- }
12
-
13
- button, input:where([type=button]), input:where([type=reset]), input:where([type=submit]) {
14
- -webkit-appearance: button;
15
- background-color: transparent;
16
- background-image: none;
17
- }
18
-
19
- button, [role=button] {
20
- cursor: pointer;
21
- }
22
-
23
- button, select {
24
- text-transform: none;
25
- }
26
-
27
- button, input, optgroup, select, textarea {
28
- font-family: inherit;
29
- font-feature-settings: inherit;
30
- font-variation-settings: inherit;
31
- font-size: 100%;
32
- font-weight: inherit;
33
- line-height: inherit;
34
- letter-spacing: inherit;
35
- color: inherit;
36
- margin: 0;
37
- padding: 0;
38
- }
39
-
40
- a {
41
- color: inherit;
42
- text-decoration: inherit;
43
- }
44
-
45
- *, :before, :after {
46
- box-sizing: border-box;
47
- border-width: 0;
48
- border-style: solid;
49
- }
50
-
51
- p {
52
- padding: 0;
53
- margin: 0;
54
- }
55
-
package/src/settings.ts DELETED
@@ -1,58 +0,0 @@
1
- import * as React from "react";
2
-
3
- export abstract class BaseThemeSettings {
4
- private _toc?: React.ReactNode = undefined;
5
- private _tocHidden: boolean = false;
6
- private _clientSidebarRouting: boolean = false;
7
- private _layoutSize: string = "";
8
-
9
- protected toc: {
10
- (value: React.ReactElement): BaseThemeSettings;
11
- get: () => React.ReactNode | undefined;
12
- hide: () => BaseThemeSettings;
13
- isHidden: () => boolean;
14
- } = Object.assign(
15
- (value: React.ReactElement) => {
16
- this._toc = value;
17
- return this;
18
- },
19
- {
20
- get: () => {
21
- return this._toc;
22
- },
23
- hide: () => {
24
- this._tocHidden = true;
25
- return this;
26
- },
27
- isHidden: () => {
28
- return this._tocHidden;
29
- }
30
- }
31
- );
32
-
33
- protected sidebar: {
34
- clientSideRouting: (value: boolean) => BaseThemeSettings;
35
- getClientSideRouting: () => boolean
36
- } = {
37
- clientSideRouting: (value: boolean) => { // TODO: deprecate?
38
- this._clientSidebarRouting = value;
39
- return this;
40
- },
41
- getClientSideRouting: () => {
42
- return this._clientSidebarRouting;
43
- }
44
- };
45
-
46
- protected layout: {
47
- size: (value: string) => BaseThemeSettings;
48
- getSize: () => string;
49
- } = {
50
- size: (value: string) => {
51
- this._layoutSize = value;
52
- return this;
53
- },
54
- getSize: () => {
55
- return this._layoutSize;
56
- }
57
- };
58
- }
package/src/types.ts DELETED
@@ -1,11 +0,0 @@
1
- import * as React from "react";
2
-
3
- import {BaseThemeSettings} from "./settings";
4
-
5
- interface ThemeProps<T extends BaseThemeSettings> {
6
- children: React.ReactNode;
7
-
8
- settings?: T;
9
- }
10
-
11
- export type {ThemeProps};
package/src/withTheme.tsx DELETED
@@ -1,20 +0,0 @@
1
- import React from "react";
2
-
3
- import {type ThemeProps} from "./types";
4
- import {BaseThemeSettings} from "./settings";
5
- import {BaseTheme} from "./BaseTheme";
6
-
7
- export function withTheme<T extends BaseThemeSettings>(theme: BaseTheme) {
8
- return function WithThemeComponent(props: ThemeProps<T>) {
9
- return withThemeComponent.call(theme, props);
10
- };
11
- }
12
-
13
- function withThemeComponent<T extends BaseThemeSettings>(
14
- this: BaseTheme,
15
- props: ThemeProps<T>
16
- ) {
17
- this.mergeSettings(props); // TODO: is it ok to do this on this level?
18
-
19
- return this.render(props);
20
- }