@docsplain-kit/core 0.0.45 → 0.0.47
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/accordion/accordion-content/accordion-content.js +17 -1
- package/accordion/accordion-content/accordion-content.js.map +1 -1
- package/accordion/accordion-header/accordion-header.js +16 -1
- package/accordion/accordion-header/accordion-header.js.map +1 -1
- package/accordion/accordion-item/accordion-item.js +20 -3
- package/accordion/accordion-item/accordion-item.js.map +1 -1
- package/accordion/accordion-item/accordion-item.style.d.ts +0 -33
- package/accordion/accordion-item/accordion-item.style.js +1 -34
- package/accordion/accordion-item/accordion-item.style.js.map +1 -1
- package/accordion/accordion-item/accordion-item.theme.d.ts +158 -0
- package/accordion/accordion-item/accordion-item.theme.js +171 -0
- package/accordion/accordion-item/accordion-item.theme.js.map +1 -0
- package/alert/alert.js +1 -1
- package/alert/alert.js.map +1 -1
- package/avatar/avatar.props.d.ts +1 -1
- package/avatar/index.d.ts +1 -1
- package/badge/badge.js +11 -1
- package/badge/badge.js.map +1 -1
- package/button/button.js +18 -1
- package/button/button.js.map +1 -1
- package/button/button.style.d.ts +1 -146
- package/button/button.style.js +1 -156
- package/button/button.style.js.map +1 -1
- package/button/button.theme.d.ts +288 -0
- package/button/button.theme.js +310 -0
- package/button/button.theme.js.map +1 -0
- package/checkbox/checkbox.js +11 -1
- package/checkbox/checkbox.js.map +1 -1
- package/chip/chip.js +19 -1
- package/chip/chip.js.map +1 -1
- package/index.d.ts +10 -8
- package/index.js +24 -15
- package/index.js.map +1 -1
- package/package.json +28 -28
- package/provider/docsplain-provider.d.ts +24 -0
- package/provider/docsplain-provider.js +47 -0
- package/provider/docsplain-provider.js.map +1 -0
- package/provider/docsplain-provider.types.d.ts +16 -0
- package/provider/docsplain-provider.types.js +3 -0
- package/provider/docsplain-provider.types.js.map +1 -0
- package/provider/hooks/index.d.ts +6 -0
- package/provider/hooks/index.js +25 -0
- package/provider/hooks/index.js.map +1 -0
- package/provider/hooks/use-font-size.d.ts +19 -0
- package/provider/hooks/use-font-size.js +102 -0
- package/provider/hooks/use-font-size.js.map +1 -0
- package/provider/hooks/use-responsive-font-size.d.ts +10 -0
- package/provider/hooks/use-responsive-font-size.js +24 -0
- package/provider/hooks/use-responsive-font-size.js.map +1 -0
- package/provider/hooks/use-text-direction.d.ts +12 -0
- package/provider/hooks/use-text-direction.js +20 -0
- package/provider/hooks/use-text-direction.js.map +1 -0
- package/provider/hooks/use-text-scale.d.ts +12 -0
- package/provider/hooks/use-text-scale.js +20 -0
- package/provider/hooks/use-text-scale.js.map +1 -0
- package/provider/hooks/use-theme.d.ts +12 -0
- package/provider/hooks/use-theme.js +20 -0
- package/provider/hooks/use-theme.js.map +1 -0
- package/provider/index.d.ts +3 -0
- package/provider/index.js +24 -0
- package/provider/index.js.map +1 -0
- package/radio-button/radio-button.js +12 -2
- package/radio-button/radio-button.js.map +1 -1
- package/spinner/spinner.js +11 -1
- package/spinner/spinner.js.map +1 -1
- package/switch-box/switch-box.js +32 -2
- package/switch-box/switch-box.js.map +1 -1
- package/tab/tab-item/tab-item.js +15 -2
- package/tab/tab-item/tab-item.js.map +1 -1
- package/tab/tab-item/tab-item.style.d.ts +1 -1
- package/tab/tab-item/tab-item.style.js +31 -31
- package/tab/tab-item/tab-item.style.js.map +1 -1
- package/tab/tab.js +115 -28
- package/tab/tab.js.map +1 -1
- package/tab/tab.props.d.ts +2 -0
- package/tab/tab.style.d.ts +2 -1
- package/tab/tab.style.js +35 -1
- package/tab/tab.style.js.map +1 -1
- package/text/text.js +39 -1
- package/text/text.js.map +1 -1
- package/text/text.theme.d.ts +23 -0
- package/text/text.theme.js +114 -0
- package/text/text.theme.js.map +1 -0
- package/theme/badge-theme.d.ts +16 -0
- package/theme/badge-theme.js +84 -0
- package/theme/badge-theme.js.map +1 -0
- package/theme/checkbox-theme.d.ts +16 -0
- package/theme/checkbox-theme.js +82 -0
- package/theme/checkbox-theme.js.map +1 -0
- package/theme/chip-theme.d.ts +370 -0
- package/theme/chip-theme.js +391 -0
- package/theme/chip-theme.js.map +1 -0
- package/theme/index.d.ts +12 -0
- package/theme/index.js +53 -0
- package/theme/index.js.map +1 -0
- package/theme/radio-button-theme.d.ts +25 -0
- package/theme/radio-button-theme.js +48 -0
- package/theme/radio-button-theme.js.map +1 -0
- package/theme/spinner-theme.d.ts +14 -0
- package/theme/spinner-theme.js +80 -0
- package/theme/spinner-theme.js.map +1 -0
- package/theme/switch-box-theme.d.ts +16 -0
- package/theme/switch-box-theme.js +82 -0
- package/theme/switch-box-theme.js.map +1 -0
- package/theme/theme-utils.d.ts +87 -0
- package/theme/theme-utils.js +147 -0
- package/theme/theme-utils.js.map +1 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getSpinnerColors = exports.COLORS_DARK = exports.COLORS_LIGHT = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Light Theme Spinner Colors
|
|
6
|
+
*/
|
|
7
|
+
exports.COLORS_LIGHT = {
|
|
8
|
+
primary: 'text-primary',
|
|
9
|
+
danger: 'text-danger',
|
|
10
|
+
warning: 'text-warning',
|
|
11
|
+
secondary: 'text-secondary',
|
|
12
|
+
control: 'text-control',
|
|
13
|
+
success: 'text-success',
|
|
14
|
+
info: 'text-info',
|
|
15
|
+
inherit: 'text-inherit',
|
|
16
|
+
slate: 'text-slate-500',
|
|
17
|
+
zinc: 'text-zinc-500',
|
|
18
|
+
neutral: 'text-neutral-500',
|
|
19
|
+
stone: 'text-stone-500',
|
|
20
|
+
red: 'text-red-500',
|
|
21
|
+
orange: 'text-orange-500',
|
|
22
|
+
amber: 'text-amber-500',
|
|
23
|
+
yellow: 'text-yellow-500',
|
|
24
|
+
lime: 'text-lime-500',
|
|
25
|
+
green: 'text-green-500',
|
|
26
|
+
emerald: 'text-emerald-500',
|
|
27
|
+
teal: 'text-teal-500',
|
|
28
|
+
cyan: 'text-cyan-500',
|
|
29
|
+
sky: 'text-sky-500',
|
|
30
|
+
blue: 'text-blue-500',
|
|
31
|
+
indigo: 'text-indigo-500',
|
|
32
|
+
violet: 'text-violet-500',
|
|
33
|
+
purple: 'text-purple-500',
|
|
34
|
+
fuchsia: 'text-fuchsia-500',
|
|
35
|
+
pink: 'text-pink-500',
|
|
36
|
+
rose: 'text-rose-500'
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Dark Theme Spinner Colors
|
|
40
|
+
*/
|
|
41
|
+
exports.COLORS_DARK = {
|
|
42
|
+
primary: 'text-primary-400',
|
|
43
|
+
danger: 'text-danger-400',
|
|
44
|
+
warning: 'text-warning-400',
|
|
45
|
+
secondary: 'text-secondary-400',
|
|
46
|
+
control: 'text-gray-400',
|
|
47
|
+
success: 'text-success-400',
|
|
48
|
+
info: 'text-info-400',
|
|
49
|
+
inherit: 'text-inherit',
|
|
50
|
+
slate: 'text-slate-400',
|
|
51
|
+
zinc: 'text-zinc-400',
|
|
52
|
+
neutral: 'text-neutral-400',
|
|
53
|
+
stone: 'text-stone-400',
|
|
54
|
+
red: 'text-red-400',
|
|
55
|
+
orange: 'text-orange-400',
|
|
56
|
+
amber: 'text-amber-400',
|
|
57
|
+
yellow: 'text-yellow-400',
|
|
58
|
+
lime: 'text-lime-400',
|
|
59
|
+
green: 'text-green-400',
|
|
60
|
+
emerald: 'text-emerald-400',
|
|
61
|
+
teal: 'text-teal-400',
|
|
62
|
+
cyan: 'text-cyan-400',
|
|
63
|
+
sky: 'text-sky-400',
|
|
64
|
+
blue: 'text-blue-400',
|
|
65
|
+
indigo: 'text-indigo-400',
|
|
66
|
+
violet: 'text-violet-400',
|
|
67
|
+
purple: 'text-purple-400',
|
|
68
|
+
fuchsia: 'text-fuchsia-400',
|
|
69
|
+
pink: 'text-pink-400',
|
|
70
|
+
rose: 'text-rose-400'
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Helper function to get spinner colors based on theme
|
|
74
|
+
*/
|
|
75
|
+
var getSpinnerColors = function (theme, color) {
|
|
76
|
+
var colorMap = theme === 'dark' ? exports.COLORS_DARK : exports.COLORS_LIGHT;
|
|
77
|
+
return colorMap[color] || colorMap['primary'];
|
|
78
|
+
};
|
|
79
|
+
exports.getSpinnerColors = getSpinnerColors;
|
|
80
|
+
//# sourceMappingURL=spinner-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner-theme.js","sourceRoot":"","sources":["../../theme/spinner-theme.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACU,QAAA,YAAY,GAA2B;IAClD,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,gBAAgB;IACvB,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,gBAAgB;IACvB,GAAG,EAAE,cAAc;IACnB,MAAM,EAAE,iBAAiB;IACzB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,iBAAiB;IACzB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,gBAAgB;IACvB,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,eAAe;IACrB,GAAG,EAAE,cAAc;IACnB,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,eAAe;CACtB,CAAC;AAEF;;GAEG;AACU,QAAA,WAAW,GAA2B;IACjD,OAAO,EAAE,kBAAkB;IAC3B,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,kBAAkB;IAC3B,SAAS,EAAE,oBAAoB;IAC/B,OAAO,EAAE,eAAe;IACxB,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,cAAc;IACvB,KAAK,EAAE,gBAAgB;IACvB,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,gBAAgB;IACvB,GAAG,EAAE,cAAc;IACnB,MAAM,EAAE,iBAAiB;IACzB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,iBAAiB;IACzB,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,gBAAgB;IACvB,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,eAAe;IACrB,GAAG,EAAE,cAAc;IACnB,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;IACzB,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,eAAe;CACtB,CAAC;AAEF;;GAEG;AACI,IAAM,gBAAgB,GAAG,UAAC,KAAY,EAAE,KAAa;IAC1D,IAAM,QAAQ,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,mBAAW,CAAC,CAAC,CAAC,oBAAY,CAAC;IAC/D,OAAO,QAAQ,CAAC,KAAe,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC;AAC1D,CAAC,CAAC;AAHW,QAAA,gBAAgB,oBAG3B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
import { Colors } from '../types';
|
|
3
|
+
type ExtendedColors = Colors | 'tertiary';
|
|
4
|
+
/**
|
|
5
|
+
* Light Theme Switch Colors
|
|
6
|
+
*/
|
|
7
|
+
export declare const COLORS_LIGHT: Record<ExtendedColors, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Dark Theme Switch Colors
|
|
10
|
+
*/
|
|
11
|
+
export declare const COLORS_DARK: Record<ExtendedColors, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to get switch colors based on theme
|
|
14
|
+
*/
|
|
15
|
+
export declare const getSwitchColors: (theme: Theme, color: string) => string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.getSwitchColors = exports.COLORS_DARK = exports.COLORS_LIGHT = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Light Theme Switch Colors
|
|
6
|
+
*/
|
|
7
|
+
exports.COLORS_LIGHT = {
|
|
8
|
+
primary: 'bg-primary hover:bg-primary-dark',
|
|
9
|
+
danger: 'bg-danger hover:bg-danger-dark',
|
|
10
|
+
warning: 'bg-warning hover:bg-warning-dark',
|
|
11
|
+
secondary: 'bg-secondary hover:bg-secondary-dark',
|
|
12
|
+
control: 'bg-control-700 hover:bg-control-900',
|
|
13
|
+
tertiary: 'bg-tertiary hover:bg-tertiary-dark',
|
|
14
|
+
success: 'bg-success hover:bg-success-dark',
|
|
15
|
+
info: 'bg-info hover:bg-info-dark',
|
|
16
|
+
inherit: 'bg-inherit hover:bg-inherit-dark',
|
|
17
|
+
slate: 'bg-slate-500 hover:bg-slate-700',
|
|
18
|
+
zinc: 'bg-zinc-500 hover:bg-zinc-700',
|
|
19
|
+
neutral: 'bg-neutral-500 hover:bg-neutral-700',
|
|
20
|
+
stone: 'bg-stone-500 hover:bg-stone-700',
|
|
21
|
+
red: 'bg-red-500 hover:bg-red-700',
|
|
22
|
+
orange: 'bg-orange-500 hover:bg-orange-700',
|
|
23
|
+
amber: 'bg-amber-500 hover:bg-amber-700',
|
|
24
|
+
yellow: 'bg-yellow-500 hover:bg-yellow-700',
|
|
25
|
+
lime: 'bg-lime-500 hover:bg-lime-700',
|
|
26
|
+
green: 'bg-green-500 hover:bg-green-700',
|
|
27
|
+
emerald: 'bg-emerald-500 hover:bg-emerald-700',
|
|
28
|
+
teal: 'bg-teal-500 hover:bg-teal-700',
|
|
29
|
+
cyan: 'bg-cyan-500 hover:bg-cyan-700',
|
|
30
|
+
sky: 'bg-sky-500 hover:bg-sky-700',
|
|
31
|
+
blue: 'bg-blue-500 hover:bg-blue-700',
|
|
32
|
+
indigo: 'bg-indigo-500 hover:bg-indigo-700',
|
|
33
|
+
violet: 'bg-violet-500 hover:bg-violet-700',
|
|
34
|
+
purple: 'bg-purple-500 hover:bg-purple-700',
|
|
35
|
+
fuchsia: 'bg-fuchsia-500 hover:bg-fuchsia-700',
|
|
36
|
+
pink: 'bg-pink-500 hover:bg-pink-700',
|
|
37
|
+
rose: 'bg-rose-500 hover:bg-rose-700'
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Dark Theme Switch Colors
|
|
41
|
+
*/
|
|
42
|
+
exports.COLORS_DARK = {
|
|
43
|
+
primary: 'bg-primary-400 hover:bg-primary-300',
|
|
44
|
+
danger: 'bg-danger-400 hover:bg-danger-300',
|
|
45
|
+
warning: 'bg-warning-400 hover:bg-warning-300',
|
|
46
|
+
secondary: 'bg-secondary-400 hover:bg-secondary-300',
|
|
47
|
+
control: 'bg-gray-600 hover:bg-gray-500',
|
|
48
|
+
tertiary: 'bg-tertiary-400 hover:bg-tertiary-300',
|
|
49
|
+
success: 'bg-success-400 hover:bg-success-300',
|
|
50
|
+
info: 'bg-info-400 hover:bg-info-300',
|
|
51
|
+
inherit: 'bg-inherit hover:bg-inherit-dark',
|
|
52
|
+
slate: 'bg-slate-400 hover:bg-slate-300',
|
|
53
|
+
zinc: 'bg-zinc-400 hover:bg-zinc-300',
|
|
54
|
+
neutral: 'bg-neutral-400 hover:bg-neutral-300',
|
|
55
|
+
stone: 'bg-stone-400 hover:bg-stone-300',
|
|
56
|
+
red: 'bg-red-400 hover:bg-red-300',
|
|
57
|
+
orange: 'bg-orange-400 hover:bg-orange-300',
|
|
58
|
+
amber: 'bg-amber-400 hover:bg-amber-300',
|
|
59
|
+
yellow: 'bg-yellow-400 hover:bg-yellow-300',
|
|
60
|
+
lime: 'bg-lime-400 hover:bg-lime-300',
|
|
61
|
+
green: 'bg-green-400 hover:bg-green-300',
|
|
62
|
+
emerald: 'bg-emerald-400 hover:bg-emerald-300',
|
|
63
|
+
teal: 'bg-teal-400 hover:bg-teal-300',
|
|
64
|
+
cyan: 'bg-cyan-400 hover:bg-cyan-300',
|
|
65
|
+
sky: 'bg-sky-400 hover:bg-sky-300',
|
|
66
|
+
blue: 'bg-blue-400 hover:bg-blue-300',
|
|
67
|
+
indigo: 'bg-indigo-400 hover:bg-indigo-300',
|
|
68
|
+
violet: 'bg-violet-400 hover:bg-violet-300',
|
|
69
|
+
purple: 'bg-purple-400 hover:bg-purple-300',
|
|
70
|
+
fuchsia: 'bg-fuchsia-400 hover:bg-fuchsia-300',
|
|
71
|
+
pink: 'bg-pink-400 hover:bg-pink-300',
|
|
72
|
+
rose: 'bg-rose-400 hover:bg-rose-300'
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Helper function to get switch colors based on theme
|
|
76
|
+
*/
|
|
77
|
+
var getSwitchColors = function (theme, color) {
|
|
78
|
+
var colorMap = theme === 'dark' ? exports.COLORS_DARK : exports.COLORS_LIGHT;
|
|
79
|
+
return colorMap[color] || colorMap['primary'];
|
|
80
|
+
};
|
|
81
|
+
exports.getSwitchColors = getSwitchColors;
|
|
82
|
+
//# sourceMappingURL=switch-box-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch-box-theme.js","sourceRoot":"","sources":["../../theme/switch-box-theme.ts"],"names":[],"mappings":";;;AAMA;;GAEG;AACU,QAAA,YAAY,GAAmC;IAC1D,OAAO,EAAE,kCAAkC;IAC3C,MAAM,EAAE,gCAAgC;IACxC,OAAO,EAAE,kCAAkC;IAC3C,SAAS,EAAE,sCAAsC;IACjD,OAAO,EAAE,qCAAqC;IAC9C,QAAQ,EAAE,oCAAoC;IAC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C;IAC9C,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,+BAA+B;IACrC,GAAG,EAAE,6BAA6B;IAClC,IAAI,EAAE,+BAA+B;IACrC,MAAM,EAAE,mCAAmC;IAC3C,MAAM,EAAE,mCAAmC;IAC3C,MAAM,EAAE,mCAAmC;IAC3C,OAAO,EAAE,qCAAqC;IAC9C,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,+BAA+B;CACtC,CAAC;AAEF;;GAEG;AACI,IAAM,eAAe,GAAG,UAAC,KAAY,EAAE,KAAa;IACzD,IAAM,QAAQ,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,mBAAW,CAAC,CAAC,CAAC,oBAAY,CAAC;IAC/D,OAAO,QAAQ,CAAC,KAAuB,CAAC,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC;AAClE,CAAC,CAAC;AAHW,QAAA,eAAe,mBAG1B"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Theme } from '../provider';
|
|
2
|
+
/**
|
|
3
|
+
* Theme Utility Functions
|
|
4
|
+
*
|
|
5
|
+
* These utilities help you create consistent dark mode color schemes
|
|
6
|
+
* across all components.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Adjusts Tailwind color weight for dark mode
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* adjustColorWeight('bg-primary-500') // → 'bg-primary-400'
|
|
13
|
+
* adjustColorWeight('hover:bg-primary-700') // → 'hover:bg-primary-300'
|
|
14
|
+
*/
|
|
15
|
+
export declare const adjustColorWeight: (lightModeClass: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Inverts text color for better contrast in dark mode
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* invertTextColor('text-white') // → 'text-gray-900'
|
|
21
|
+
* invertTextColor('text-gray-900') // → 'text-gray-100'
|
|
22
|
+
*/
|
|
23
|
+
export declare const invertTextColor: (textClass: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Converts control colors to dark mode grays
|
|
26
|
+
*/
|
|
27
|
+
export declare const convertControlColors: (controlClass: string) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Helper to safely get theme from provider
|
|
30
|
+
* Returns 'light' if not in provider context
|
|
31
|
+
*/
|
|
32
|
+
export declare const useThemeSafe: () => Theme;
|
|
33
|
+
/**
|
|
34
|
+
* Creates a theme selector function for component styles
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* const getStyles = createThemeSelector(STYLES_LIGHT, STYLES_DARK);
|
|
38
|
+
* const styles = getStyles(theme);
|
|
39
|
+
*/
|
|
40
|
+
export declare function createThemeSelector<T>(lightStyles: T, darkStyles: T): (theme: Theme) => T;
|
|
41
|
+
/**
|
|
42
|
+
* Merges light and dark color objects into a theme-aware getter
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* const getColor = createColorGetter(COLORS_LIGHT, COLORS_DARK);
|
|
46
|
+
* const color = getColor(theme, 'primary');
|
|
47
|
+
*/
|
|
48
|
+
export declare function createColorGetter<K extends string>(lightColors: Record<K, string>, darkColors: Record<K, string>): (theme: Theme, key: K) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Common background colors for dark mode
|
|
51
|
+
*/
|
|
52
|
+
export declare const DARK_BACKGROUNDS: {
|
|
53
|
+
page: string;
|
|
54
|
+
card: string;
|
|
55
|
+
elevated: string;
|
|
56
|
+
overlay: string;
|
|
57
|
+
subtle: string;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Common text colors for dark mode
|
|
61
|
+
*/
|
|
62
|
+
export declare const DARK_TEXT: {
|
|
63
|
+
primary: string;
|
|
64
|
+
secondary: string;
|
|
65
|
+
muted: string;
|
|
66
|
+
disabled: string;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Common border colors for dark mode
|
|
70
|
+
*/
|
|
71
|
+
export declare const DARK_BORDERS: {
|
|
72
|
+
default: string;
|
|
73
|
+
subtle: string;
|
|
74
|
+
strong: string;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Quick check if currently in dark theme
|
|
78
|
+
*/
|
|
79
|
+
export declare const isDarkTheme: () => boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Get theme-aware class conditionally
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* themeClass('bg-white', 'bg-gray-800')
|
|
85
|
+
* // Returns 'bg-white' in light, 'bg-gray-800' in dark
|
|
86
|
+
*/
|
|
87
|
+
export declare const themeClass: (lightClass: string, darkClass: string) => string;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.themeClass = exports.isDarkTheme = exports.DARK_BORDERS = exports.DARK_TEXT = exports.DARK_BACKGROUNDS = exports.createColorGetter = exports.createThemeSelector = exports.useThemeSafe = exports.convertControlColors = exports.invertTextColor = exports.adjustColorWeight = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Theme Utility Functions
|
|
6
|
+
*
|
|
7
|
+
* These utilities help you create consistent dark mode color schemes
|
|
8
|
+
* across all components.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Adjusts Tailwind color weight for dark mode
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* adjustColorWeight('bg-primary-500') // → 'bg-primary-400'
|
|
15
|
+
* adjustColorWeight('hover:bg-primary-700') // → 'hover:bg-primary-300'
|
|
16
|
+
*/
|
|
17
|
+
var adjustColorWeight = function (lightModeClass) {
|
|
18
|
+
return lightModeClass
|
|
19
|
+
.replace(/-50\b/g, '-900/40')
|
|
20
|
+
.replace(/-100\b/g, '-900/30')
|
|
21
|
+
.replace(/-200\b/g, '-800')
|
|
22
|
+
.replace(/-300\b/g, '-700')
|
|
23
|
+
.replace(/-500\b/g, '-400')
|
|
24
|
+
.replace(/-700\b/g, '-300')
|
|
25
|
+
.replace(/-800\b/g, '-200')
|
|
26
|
+
.replace(/-900\b/g, '-100');
|
|
27
|
+
};
|
|
28
|
+
exports.adjustColorWeight = adjustColorWeight;
|
|
29
|
+
/**
|
|
30
|
+
* Inverts text color for better contrast in dark mode
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* invertTextColor('text-white') // → 'text-gray-900'
|
|
34
|
+
* invertTextColor('text-gray-900') // → 'text-gray-100'
|
|
35
|
+
*/
|
|
36
|
+
var invertTextColor = function (textClass) {
|
|
37
|
+
return textClass
|
|
38
|
+
.replace(/text-white\b/g, 'text-gray-900')
|
|
39
|
+
.replace(/text-black\b/g, 'text-gray-100')
|
|
40
|
+
.replace(/text-gray-900\b/g, 'text-gray-100');
|
|
41
|
+
};
|
|
42
|
+
exports.invertTextColor = invertTextColor;
|
|
43
|
+
/**
|
|
44
|
+
* Converts control colors to dark mode grays
|
|
45
|
+
*/
|
|
46
|
+
var convertControlColors = function (controlClass) {
|
|
47
|
+
return controlClass
|
|
48
|
+
.replace(/control-50\b/g, 'gray-800')
|
|
49
|
+
.replace(/control-100\b/g, 'gray-800')
|
|
50
|
+
.replace(/control-300\b/g, 'gray-700')
|
|
51
|
+
.replace(/control-500\b/g, 'gray-600')
|
|
52
|
+
.replace(/control-700\b/g, 'gray-500')
|
|
53
|
+
.replace(/control-dark\b/g, 'gray-600')
|
|
54
|
+
.replace(/control-light\b/g, 'gray-600')
|
|
55
|
+
.replace(/\bcontrol\b/g, 'gray-600');
|
|
56
|
+
};
|
|
57
|
+
exports.convertControlColors = convertControlColors;
|
|
58
|
+
/**
|
|
59
|
+
* Helper to safely get theme from provider
|
|
60
|
+
* Returns 'light' if not in provider context
|
|
61
|
+
*/
|
|
62
|
+
var useThemeSafe = function () {
|
|
63
|
+
var theme = 'light';
|
|
64
|
+
try {
|
|
65
|
+
var useTheme = require('../provider').useTheme;
|
|
66
|
+
theme = useTheme();
|
|
67
|
+
}
|
|
68
|
+
catch (_a) {
|
|
69
|
+
// Not in provider, use default
|
|
70
|
+
}
|
|
71
|
+
return theme;
|
|
72
|
+
};
|
|
73
|
+
exports.useThemeSafe = useThemeSafe;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a theme selector function for component styles
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const getStyles = createThemeSelector(STYLES_LIGHT, STYLES_DARK);
|
|
79
|
+
* const styles = getStyles(theme);
|
|
80
|
+
*/
|
|
81
|
+
function createThemeSelector(lightStyles, darkStyles) {
|
|
82
|
+
return function (theme) {
|
|
83
|
+
return theme === 'dark' ? darkStyles : lightStyles;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
exports.createThemeSelector = createThemeSelector;
|
|
87
|
+
/**
|
|
88
|
+
* Merges light and dark color objects into a theme-aware getter
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* const getColor = createColorGetter(COLORS_LIGHT, COLORS_DARK);
|
|
92
|
+
* const color = getColor(theme, 'primary');
|
|
93
|
+
*/
|
|
94
|
+
function createColorGetter(lightColors, darkColors) {
|
|
95
|
+
return function (theme, key) {
|
|
96
|
+
var colors = theme === 'dark' ? darkColors : lightColors;
|
|
97
|
+
return colors[key];
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
exports.createColorGetter = createColorGetter;
|
|
101
|
+
/**
|
|
102
|
+
* Common background colors for dark mode
|
|
103
|
+
*/
|
|
104
|
+
exports.DARK_BACKGROUNDS = {
|
|
105
|
+
page: 'bg-gray-900',
|
|
106
|
+
card: 'bg-gray-800',
|
|
107
|
+
elevated: 'bg-gray-700',
|
|
108
|
+
overlay: 'bg-black/50',
|
|
109
|
+
subtle: 'bg-gray-800/50'
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Common text colors for dark mode
|
|
113
|
+
*/
|
|
114
|
+
exports.DARK_TEXT = {
|
|
115
|
+
primary: 'text-gray-100',
|
|
116
|
+
secondary: 'text-gray-400',
|
|
117
|
+
muted: 'text-gray-500',
|
|
118
|
+
disabled: 'text-gray-600'
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Common border colors for dark mode
|
|
122
|
+
*/
|
|
123
|
+
exports.DARK_BORDERS = {
|
|
124
|
+
"default": 'border-gray-700',
|
|
125
|
+
subtle: 'border-gray-800',
|
|
126
|
+
strong: 'border-gray-600'
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Quick check if currently in dark theme
|
|
130
|
+
*/
|
|
131
|
+
var isDarkTheme = function () {
|
|
132
|
+
return (0, exports.useThemeSafe)() === 'dark';
|
|
133
|
+
};
|
|
134
|
+
exports.isDarkTheme = isDarkTheme;
|
|
135
|
+
/**
|
|
136
|
+
* Get theme-aware class conditionally
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* themeClass('bg-white', 'bg-gray-800')
|
|
140
|
+
* // Returns 'bg-white' in light, 'bg-gray-800' in dark
|
|
141
|
+
*/
|
|
142
|
+
var themeClass = function (lightClass, darkClass) {
|
|
143
|
+
var theme = (0, exports.useThemeSafe)();
|
|
144
|
+
return theme === 'dark' ? darkClass : lightClass;
|
|
145
|
+
};
|
|
146
|
+
exports.themeClass = themeClass;
|
|
147
|
+
//# sourceMappingURL=theme-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-utils.js","sourceRoot":"","sources":["../../theme/theme-utils.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AAEH;;;;;;GAMG;AACI,IAAM,iBAAiB,GAAG,UAAC,cAAsB;IACtD,OAAO,cAAc;SAClB,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC;SAC5B,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;SAC1B,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;SAC1B,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;SAC1B,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;SAC1B,OAAO,CAAC,SAAS,EAA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