@docsplain-kit/utilities 0.0.34 → 0.0.35

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 (43) hide show
  1. package/auto-complete/auto-complete.js +2 -1
  2. package/auto-complete/auto-complete.js.map +1 -1
  3. package/calendar/calendar.js +3 -1
  4. package/calendar/calendar.js.map +1 -1
  5. package/calendar/sub-components/day/day.js +6 -1
  6. package/calendar/sub-components/day/day.js.map +1 -1
  7. package/calendar/sub-components/days/days.js +2 -1
  8. package/calendar/sub-components/days/days.js.map +1 -1
  9. package/calendar/sub-components/days-head/days-head.js +4 -2
  10. package/calendar/sub-components/days-head/days-head.js.map +1 -1
  11. package/countdown-timer/countdown.js +4 -2
  12. package/countdown-timer/countdown.js.map +1 -1
  13. package/data-table/data-table.js +7 -9
  14. package/data-table/data-table.js.map +1 -1
  15. package/date-time-picker/date-time-picker.js +2 -1
  16. package/date-time-picker/date-time-picker.js.map +1 -1
  17. package/index.d.ts +2 -0
  18. package/index.js +12 -1
  19. package/index.js.map +1 -1
  20. package/kanban-list/kanban-list.js +3 -2
  21. package/kanban-list/kanban-list.js.map +1 -1
  22. package/package.json +2 -2
  23. package/right-click-menu/menu-item/menu-item.js +2 -1
  24. package/right-click-menu/menu-item/menu-item.js.map +1 -1
  25. package/right-click-menu/right-click-menu.js +2 -1
  26. package/right-click-menu/right-click-menu.js.map +1 -1
  27. package/simple-data-table/simple-data-table.js +7 -6
  28. package/simple-data-table/simple-data-table.js.map +1 -1
  29. package/theme/ThemeProvider.d.ts +30 -0
  30. package/theme/ThemeProvider.js +49 -0
  31. package/theme/ThemeProvider.js.map +1 -0
  32. package/theme/context.d.ts +2 -0
  33. package/theme/context.js +6 -0
  34. package/theme/context.js.map +1 -0
  35. package/theme/index.d.ts +3 -0
  36. package/theme/index.js +27 -0
  37. package/theme/index.js.map +1 -0
  38. package/theme/theme-utils.d.ts +59 -0
  39. package/theme/theme-utils.js +82 -0
  40. package/theme/theme-utils.js.map +1 -0
  41. package/theme/types.d.ts +7 -0
  42. package/theme/types.js +3 -0
  43. package/theme/types.js.map +1 -0
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ exports.createColorGetter = exports.createThemeSelector = exports.DARK_BORDERS = exports.DARK_TEXT = exports.DARK_BACKGROUNDS = exports.isDarkTheme = exports.themeClass = exports.useThemeSafe = void 0;
4
+ var react_1 = require("react");
5
+ var context_1 = require("./context");
6
+ /**
7
+ * Theme Utility Functions
8
+ *
9
+ * Self-contained theme helpers for utilities components (no dependency on core).
10
+ * Use UtilitiesThemeProvider at the app root with the same theme as your UI kit.
11
+ */
12
+ /**
13
+ * Helper to safely get theme from UtilitiesThemeProvider.
14
+ * Returns 'light' if not in provider context.
15
+ */
16
+ var useThemeSafe = function () {
17
+ var theme = (0, react_1.useContext)(context_1.ThemeContext);
18
+ return theme !== null && theme !== void 0 ? theme : 'light';
19
+ };
20
+ exports.useThemeSafe = useThemeSafe;
21
+ /**
22
+ * Get theme-aware class conditionally (hook).
23
+ *
24
+ * @example
25
+ * themeClass('bg-white', 'bg-gray-800')
26
+ * // Returns 'bg-white' in light, 'bg-gray-800' in dark
27
+ */
28
+ var themeClass = function (lightClass, darkClass) {
29
+ var theme = (0, exports.useThemeSafe)();
30
+ return theme === 'dark' ? darkClass : lightClass;
31
+ };
32
+ exports.themeClass = themeClass;
33
+ /**
34
+ * Quick check if currently in dark theme
35
+ */
36
+ var isDarkTheme = function () { return (0, exports.useThemeSafe)() === 'dark'; };
37
+ exports.isDarkTheme = isDarkTheme;
38
+ /**
39
+ * Common background colors for dark mode
40
+ */
41
+ exports.DARK_BACKGROUNDS = {
42
+ page: 'bg-gray-900',
43
+ card: 'bg-gray-800',
44
+ elevated: 'bg-gray-700',
45
+ overlay: 'bg-black/50',
46
+ subtle: 'bg-gray-800/50'
47
+ };
48
+ /**
49
+ * Common text colors for dark mode
50
+ */
51
+ exports.DARK_TEXT = {
52
+ primary: 'text-gray-100',
53
+ secondary: 'text-gray-400',
54
+ muted: 'text-gray-500',
55
+ disabled: 'text-gray-600'
56
+ };
57
+ /**
58
+ * Common border colors for dark mode
59
+ */
60
+ exports.DARK_BORDERS = {
61
+ "default": 'border-gray-700',
62
+ subtle: 'border-gray-800',
63
+ strong: 'border-gray-600'
64
+ };
65
+ /**
66
+ * Creates a theme selector function for component styles
67
+ */
68
+ function createThemeSelector(lightStyles, darkStyles) {
69
+ return function (theme) { return (theme === 'dark' ? darkStyles : lightStyles); };
70
+ }
71
+ exports.createThemeSelector = createThemeSelector;
72
+ /**
73
+ * Merges light and dark color objects into a theme-aware getter
74
+ */
75
+ function createColorGetter(lightColors, darkColors) {
76
+ return function (theme, key) {
77
+ var colors = theme === 'dark' ? darkColors : lightColors;
78
+ return colors[key];
79
+ };
80
+ }
81
+ exports.createColorGetter = createColorGetter;
82
+ //# sourceMappingURL=theme-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-utils.js","sourceRoot":"","sources":["../../theme/theme-utils.ts"],"names":[],"mappings":";;;AAAA,+BAAmC;AACnC,qCAAyC;AAGzC;;;;;GAKG;AAEH;;;GAGG;AACI,IAAM,YAAY,GAAG;IAC1B,IAAM,KAAK,GAAG,IAAA,kBAAU,EAAC,sBAAY,CAAC,CAAC;IACvC,OAAO,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,OAAO,CAAC;AAC1B,CAAC,CAAC;AAHW,QAAA,YAAY,gBAGvB;AAEF;;;;;;GAMG;AACI,IAAM,UAAU,GAAG,UAAC,UAAkB,EAAE,SAAiB;IAC9D,IAAM,KAAK,GAAG,IAAA,oBAAY,GAAE,CAAC;IAC7B,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;AACnD,CAAC,CAAC;AAHW,QAAA,UAAU,cAGrB;AAEF;;GAEG;AACI,IAAM,WAAW,GAAG,cAAe,OAAA,IAAA,oBAAY,GAAE,KAAK,MAAM,EAAzB,CAAyB,CAAC;AAAvD,QAAA,WAAW,eAA4C;AAEpE;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,gBAAgB;CACzB,CAAC;AAEF;;GAEG;AACU,QAAA,SAAS,GAAG;IACvB,OAAO,EAAE,eAAe;IACxB,SAAS,EAAE,eAAe;IAC1B,KAAK,EAAE,eAAe;IACtB,QAAQ,EAAE,eAAe;CAC1B,CAAC;AAEF;;GAEG;AACU,QAAA,YAAY,GAAG;IAC1B,SAAO,EAAE,iBAAiB;IAC1B,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;CAC1B,CAAC;AAEF;;GAEG;AACH,SAAgB,mBAAmB,CAAI,WAAc,EAAE,UAAa;IAClE,OAAO,UAAC,KAAY,IAAQ,OAAA,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,EAA7C,CAA6C,CAAC;AAC5E,CAAC;AAFD,kDAEC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,WAA8B,EAC9B,UAA6B;IAE7B,OAAO,UAAC,KAAY,EAAE,GAAM;QAC1B,IAAM,MAAM,GAAG,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC;QAC3D,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC,CAAC;AACJ,CAAC;AARD,8CAQC"}
@@ -0,0 +1,7 @@
1
+ export type Theme = 'light' | 'dark';
2
+ export interface UtilitiesThemeProviderProps {
3
+ theme?: Theme;
4
+ children: React.ReactNode;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ }
package/theme/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../theme/types.ts"],"names":[],"mappings":""}