@rbxts/uiblox 0.1.40 → 0.1.41

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.
@@ -4,4 +4,5 @@ import { ThemeState } from "../types/index";
4
4
  export declare const DARK_THEME_COLORS: Colors;
5
5
  export declare const LIGHT_THEME_COLORS: Colors;
6
6
  export declare const DEFAULT_BORDERS: Borders;
7
+ export declare const DEFAULT_THEME: import("../index").Theme;
7
8
  export declare const INITIAL_THEME_STATE: ThemeState;
@@ -8,7 +8,7 @@ local Green = _colors.Green
8
8
  local Purple = _colors.Purple
9
9
  local Red = _colors.Red
10
10
  local Yellow = _colors.Yellow
11
- local DefaultTheme = TS.import(script, script.Parent.Parent).DefaultTheme
11
+ local DarkTheme = TS.import(script, script.Parent.Parent, "themes").DarkTheme
12
12
  -- dark theme
13
13
  local DARK_THEME_COLORS = {
14
14
  backgroundDefault = Common.Black,
@@ -98,12 +98,14 @@ local DEFAULT_BORDERS = {
98
98
  default = 1,
99
99
  divider = 2,
100
100
  }
101
+ local DEFAULT_THEME = DarkTheme
101
102
  local INITIAL_THEME_STATE = {
102
- theme = DefaultTheme,
103
+ theme = DEFAULT_THEME,
103
104
  }
104
105
  return {
105
106
  DARK_THEME_COLORS = DARK_THEME_COLORS,
106
107
  LIGHT_THEME_COLORS = LIGHT_THEME_COLORS,
107
108
  DEFAULT_BORDERS = DEFAULT_BORDERS,
109
+ DEFAULT_THEME = DEFAULT_THEME,
108
110
  INITIAL_THEME_STATE = INITIAL_THEME_STATE,
109
111
  }
@@ -9,7 +9,6 @@ export { useTheme } from "./hooks/index";
9
9
  export * from "./interfaces/index";
10
10
  export * from "./styles/index";
11
11
  export * from "./themes/index";
12
- export { default as DefaultTheme } from "./themes/index";
13
12
  export { default as DarkTheme } from "./themes/DarkTheme";
14
13
  export { default as LightTheme } from "./themes/LightTheme";
15
14
  export { ThemeState } from "./types/index";
@@ -23,7 +23,6 @@ end
23
23
  for _k, _v in TS.import(script, script, "themes") or {} do
24
24
  exports[_k] = _v
25
25
  end
26
- exports.DefaultTheme = TS.import(script, script, "themes").default
27
26
  exports.DarkTheme = TS.import(script, script, "themes", "DarkTheme").default
28
27
  exports.LightTheme = TS.import(script, script, "themes", "LightTheme").default
29
28
  for _k, _v in TS.import(script, script, "utilites") or {} do
@@ -1,7 +1,7 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
2
  local TS = _G[script]
3
- local DefaultTheme = TS.import(script, script.Parent.Parent.Parent, "theme").DefaultTheme
4
- local ROBLOX_UI_OFFSET = DefaultTheme.spacing.calc(2) + DefaultTheme.padding.calc(4)
3
+ local DEFAULT_THEME = TS.import(script, script.Parent.Parent.Parent, "theme").DEFAULT_THEME
4
+ local ROBLOX_UI_OFFSET = DEFAULT_THEME.spacing.calc(2) + DEFAULT_THEME.padding.calc(4)
5
5
  return {
6
6
  ROBLOX_UI_OFFSET = ROBLOX_UI_OFFSET,
7
7
  }
@@ -5,7 +5,7 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
5
5
  local React = _react
6
6
  local useEffect = _react.useEffect
7
7
  local useRef = _react.useRef
8
- local DefaultTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").DefaultTheme
8
+ local DEFAULT_THEME = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").DEFAULT_THEME
9
9
  local Directions = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Directions
10
10
  local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
11
11
  local useToastStyles = TS.import(script, script.Parent, "Toast.styles").default
@@ -73,7 +73,7 @@ local function Toast(props)
73
73
  end
74
74
  local _exp = React.createElement("uicorner", {
75
75
  key = "Corner",
76
- CornerRadius = UDim.new(0, DefaultTheme.shape.borderRadius),
76
+ CornerRadius = UDim.new(0, DEFAULT_THEME.shape.borderRadius),
77
77
  })
78
78
  local _exp_1 = React.createElement(Shadow)
79
79
  local _attributes_1 = {
@@ -3,7 +3,7 @@ local TS = _G[script]
3
3
  local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
4
  local createStyles = _theme.createStyles
5
5
  local makeStyles = _theme.makeStyles
6
- local DefaultTheme = _theme.DefaultTheme
6
+ local DEFAULT_THEME = _theme.DEFAULT_THEME
7
7
  local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
8
8
  local ToastVariants = TS.import(script, script.Parent.Parent, "enums", "ToastVariants").default
9
9
  local useToastStyles = makeStyles(function(theme, _param)
@@ -14,19 +14,19 @@ local useToastStyles = makeStyles(function(theme, _param)
14
14
  local getToastColor = function()
15
15
  repeat
16
16
  if variant == (ToastVariants.success) then
17
- return DefaultTheme.palette.success.main
17
+ return DEFAULT_THEME.palette.success.main
18
18
  end
19
19
  if variant == (ToastVariants.error) then
20
- return DefaultTheme.palette.error.main
20
+ return DEFAULT_THEME.palette.error.main
21
21
  end
22
22
  if variant == (ToastVariants.warning) then
23
- return DefaultTheme.palette.warning.main
23
+ return DEFAULT_THEME.palette.warning.main
24
24
  end
25
- return DefaultTheme.options.constants.colors.backgroundUIContrast
25
+ return DEFAULT_THEME.options.constants.colors.backgroundUIContrast
26
26
  until true
27
27
  end
28
- local ACTIVE_POSITION = UDim2.new(0.5, 0, 1, -DefaultTheme.padding.calc(2))
29
- local INACTIVE_POSITION = UDim2.new(0.5, 0, 1, DefaultTheme.spacing.calc(20) + DefaultTheme.padding.calc(2))
28
+ local ACTIVE_POSITION = UDim2.new(0.5, 0, 1, -DEFAULT_THEME.padding.calc(2))
29
+ local INACTIVE_POSITION = UDim2.new(0.5, 0, 1, DEFAULT_THEME.spacing.calc(20) + DEFAULT_THEME.padding.calc(2))
30
30
  return createStyles({
31
31
  container = {
32
32
  Size = UDim2.new(0, theme.spacing.calc(20), 0, theme.spacing.calc(4)),
@@ -5,7 +5,7 @@ local React = _react
5
5
  local useCallback = _react.useCallback
6
6
  local useEffect = _react.useEffect
7
7
  local useState = _react.useState
8
- local DefaultTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").DefaultTheme
8
+ local DEFAULT_THEME = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").DEFAULT_THEME
9
9
  local Icon = TS.import(script, script.Parent.Parent.Parent, "icon").Icon
10
10
  local Typography = TS.import(script, script.Parent.Parent.Parent, "typography").Typography
11
11
  local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
@@ -247,7 +247,7 @@ local function TreeView(props)
247
247
  _attributes_5.icon = if table.find(expanded, _branch) ~= nil then Icons.Expanded else Icons.Collapsed
248
248
  _attributes_5.size = "xxs"
249
249
  _attributes_5.className = branchIcon
250
- _attributes_5.tint = DefaultTheme.options.constants.extendedPalette.Gray[70]
250
+ _attributes_5.tint = DEFAULT_THEME.options.constants.extendedPalette.Gray[70]
251
251
  _condition_1 = (React.createElement(Icon, _attributes_5))
252
252
  end
253
253
  local _attributes_5 = {
@@ -288,7 +288,7 @@ local function TreeView(props)
288
288
  icon = icon or Icons.ListPrimary,
289
289
  size = "xs",
290
290
  className = leafIcon,
291
- tint = DefaultTheme.palette.secondary.main,
291
+ tint = DEFAULT_THEME.palette.secondary.main,
292
292
  })
293
293
  local _attributes_7 = {
294
294
  text = leaf.title,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/uiblox",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.lua",
6
6
  "scripts": {