@rbxts/uiblox 0.1.39 → 0.1.40

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 @@
1
+ export { default as useThemeCallbacks } from "./useThemeCallbacks";
@@ -0,0 +1,5 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local exports = {}
4
+ exports.useThemeCallbacks = TS.import(script, script, "useThemeCallbacks").default
5
+ return exports
@@ -0,0 +1,7 @@
1
+ import { Theme } from "../interfaces/index";
2
+ declare function useThemeCallbacks(): {
3
+ onSetTheme: (theme: Theme) => void;
4
+ } | {
5
+ onSetTheme?: undefined;
6
+ };
7
+ export default useThemeCallbacks;
@@ -0,0 +1,23 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local useMemo = TS.import(script, TS.getModule(script, "@rbxts", "react")).useMemo
4
+ local ThemeActionTypes = TS.import(script, script.Parent.Parent, "enums").ThemeActionTypes
5
+ local useTheme = TS.import(script, script.Parent.Parent, "hooks").useTheme
6
+ local function useThemeCallbacks()
7
+ local _binding = useTheme()
8
+ local dispatch = _binding.dispatch
9
+ return useMemo(function()
10
+ return if dispatch then {
11
+ onSetTheme = function(theme)
12
+ return dispatch({
13
+ type = ThemeActionTypes.SetTheme,
14
+ theme = theme,
15
+ })
16
+ end,
17
+ } else {}
18
+ end, { dispatch })
19
+ end
20
+ local default = useThemeCallbacks
21
+ return {
22
+ default = default,
23
+ }
@@ -1,8 +1,9 @@
1
1
  export { default as Theme } from "./interfaces/theme/Theme";
2
+ export { useThemeCallbacks } from "./callbacks/index";
3
+ export * from "./constants/index";
2
4
  export * from "./context/index";
3
5
  export { ThemeProvider } from "./context/index";
4
6
  export { themeReducer } from "./context/index";
5
- export * from "./constants/index";
6
7
  export * from "./enums/index";
7
8
  export { useTheme } from "./hooks/index";
8
9
  export * from "./interfaces/index";
@@ -1,14 +1,15 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
2
  local TS = _G[script]
3
3
  local exports = {}
4
+ exports.useThemeCallbacks = TS.import(script, script, "callbacks").useThemeCallbacks
5
+ for _k, _v in TS.import(script, script, "constants") or {} do
6
+ exports[_k] = _v
7
+ end
4
8
  for _k, _v in TS.import(script, script, "context") or {} do
5
9
  exports[_k] = _v
6
10
  end
7
11
  exports.ThemeProvider = TS.import(script, script, "context").ThemeProvider
8
12
  exports.themeReducer = TS.import(script, script, "context").themeReducer
9
- for _k, _v in TS.import(script, script, "constants") or {} do
10
- exports[_k] = _v
11
- end
12
13
  for _k, _v in TS.import(script, script, "enums") or {} do
13
14
  exports[_k] = _v
14
15
  end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/uiblox",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.lua",
6
6
  "scripts": {