@rbxts/uiblox 0.2.0-alpha.29 → 0.2.0-alpha.30

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.
@@ -23,19 +23,32 @@ local function AppBar(props)
23
23
  local sx = _binding.sx
24
24
  local id = _binding.id
25
25
  local ref = _binding.ref
26
+ local hasActions = children ~= nil
26
27
  local styles = useAppBarStyles({
27
28
  elevation = elevation,
28
29
  color = color,
29
- hasActions = children ~= nil,
30
+ hasActions = hasActions,
30
31
  })
32
+ local _condition = title ~= ""
33
+ if _condition then
34
+ local _attributes = {
35
+ key = "Title",
36
+ }
37
+ for _k, _v in styles.title do
38
+ _attributes[_k] = _v
39
+ end
40
+ _attributes.Text = title
41
+ _condition = React.createElement("textlabel", _attributes)
42
+ end
43
+ local titleLabel = _condition
31
44
  local _attributes = {
32
45
  tag = "frame",
33
46
  }
34
- local _condition = id
35
- if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
36
- _condition = "AppBar"
47
+ local _condition_1 = id
48
+ if not (_condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1) then
49
+ _condition_1 = "AppBar"
37
50
  end
38
- _attributes.key = _condition
51
+ _attributes.key = _condition_1
39
52
  _attributes.hostRef = ref
40
53
  _attributes.base = styles.root
41
54
  _attributes.className = className
@@ -44,30 +57,30 @@ local function AppBar(props)
44
57
  setmetatable(_attributes_1, nil)
45
58
  local _exp = React.createElement("uipadding", _attributes_1)
46
59
  local _exp_1 = elevation == "raised" and React.createElement(Shadow)
47
- local _condition_1 = title ~= ""
48
- if _condition_1 then
49
- local _attributes_2 = {
50
- key = "Title",
51
- }
52
- for _k, _v in styles.title do
53
- _attributes_2[_k] = _v
54
- end
55
- _attributes_2.Text = title
56
- _condition_1 = React.createElement("textlabel", _attributes_2)
57
- end
58
- local _condition_2 = children ~= nil
59
- if _condition_2 then
60
- local _attributes_2 = {
60
+ local _result
61
+ if hasActions then
62
+ local _attributes_2 = table.clone(styles.row)
63
+ setmetatable(_attributes_2, nil)
64
+ local _exp_2 = React.createElement("uilistlayout", _attributes_2)
65
+ local _exp_3 = titleLabel
66
+ local _attributes_3 = {
61
67
  key = "Actions",
62
68
  }
63
69
  for _k, _v in styles.actions do
64
- _attributes_2[_k] = _v
70
+ _attributes_3[_k] = _v
65
71
  end
66
- local _attributes_3 = table.clone(styles.actionsLayout)
67
- setmetatable(_attributes_3, nil)
68
- _condition_2 = (React.createElement("frame", _attributes_2, React.createElement("uilistlayout", _attributes_3), children))
72
+ local _attributes_4 = table.clone(styles.actionsLayout)
73
+ setmetatable(_attributes_4, nil)
74
+ _result = (React.createElement("frame", {
75
+ key = "Row",
76
+ Size = UDim2.fromScale(1, 1),
77
+ BackgroundTransparency = 1,
78
+ BorderSizePixel = 0,
79
+ }, _exp_2, _exp_3, React.createElement("frame", _attributes_3, React.createElement("uilistlayout", _attributes_4), children)))
80
+ else
81
+ _result = titleLabel
69
82
  end
70
- return React.createElement(SxHost, _attributes, _exp, _exp_1, _condition_1, _condition_2)
83
+ return React.createElement(SxHost, _attributes, _exp, _exp_1, _result)
71
84
  end
72
85
  local default = AppBar
73
86
  return {
@@ -27,10 +27,18 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
27
27
  PaddingLeft = UDim.new(0, theme.padding.calc(2)),
28
28
  PaddingRight = UDim.new(0, theme.padding.calc(2)),
29
29
  },
30
+ row = {
31
+ FillDirection = Enum.FillDirection.Horizontal,
32
+ VerticalAlignment = Enum.VerticalAlignment.Center,
33
+ HorizontalFlex = Enum.UIFlexAlignment.SpaceBetween,
34
+ SortOrder = Enum.SortOrder.LayoutOrder,
35
+ },
30
36
  }
31
37
  local _left = "title"
32
38
  local _object_1 = {
33
- Size = UDim2.new(1, if hasActions then -theme.spacing.calc(8) else 0, 1, 0),
39
+ LayoutOrder = 1,
40
+ AutomaticSize = if hasActions then Enum.AutomaticSize.X else Enum.AutomaticSize.None,
41
+ Size = if hasActions then UDim2.new(0, 0, 1, 0) else UDim2.new(1, 0, 1, 0),
34
42
  BackgroundTransparency = 1,
35
43
  BorderSizePixel = 0,
36
44
  Font = theme.typography.fontFamilies.default,
@@ -47,10 +55,9 @@ local useAppBarStyles = componentStyles("AppBar", function(theme, _param)
47
55
  _object_1.TextTruncate = Enum.TextTruncate.AtEnd
48
56
  _object[_left] = _object_1
49
57
  _object.actions = {
58
+ LayoutOrder = 2,
50
59
  AutomaticSize = Enum.AutomaticSize.X,
51
60
  Size = UDim2.new(0, 0, 1, 0),
52
- Position = UDim2.new(1, 0, 0, 0),
53
- AnchorPoint = Vector2.new(1, 0),
54
61
  BackgroundTransparency = 1,
55
62
  BorderSizePixel = 0,
56
63
  ZIndex = 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/uiblox",
3
- "version": "0.2.0-alpha.29",
3
+ "version": "0.2.0-alpha.30",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.luau",
6
6
  "packageManager": "pnpm@11.3.0",