@rbxts/uiblox 0.2.0-alpha.12 → 0.2.0-alpha.14

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 (33) hide show
  1. package/out/ui/packages/alert/components/Alert.d.ts +1 -0
  2. package/out/ui/packages/alert/components/Alert.luau +2 -0
  3. package/out/ui/packages/alert/components/Alert.styles.d.ts +1 -0
  4. package/out/ui/packages/alert/components/Alert.styles.luau +7 -6
  5. package/out/ui/packages/appBar/components/AppBar.d.ts +2 -1
  6. package/out/ui/packages/appBar/components/AppBar.luau +5 -0
  7. package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
  8. package/out/ui/packages/appBar/components/AppBar.styles.luau +6 -2
  9. package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
  10. package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +8 -2
  11. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +3 -1
  12. package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +6 -2
  13. package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
  14. package/out/ui/packages/chip/components/Chip.d.ts +1 -0
  15. package/out/ui/packages/chip/components/Chip.luau +5 -0
  16. package/out/ui/packages/chip/components/Chip.styles.d.ts +1 -0
  17. package/out/ui/packages/chip/components/Chip.styles.luau +6 -1
  18. package/out/ui/packages/pagination/components/Pagination.d.ts +2 -1
  19. package/out/ui/packages/pagination/components/Pagination.luau +4 -1
  20. package/out/ui/packages/pagination/components/Pagination.styles.d.ts +4 -1
  21. package/out/ui/packages/pagination/components/Pagination.styles.luau +12 -6
  22. package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
  23. package/out/ui/packages/stateMatrix.luau +269 -220
  24. package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
  25. package/out/ui/packages/tabs/components/Tabs.d.ts +1 -0
  26. package/out/ui/packages/tabs/components/Tabs.luau +2 -0
  27. package/out/ui/packages/tabs/components/Tabs.styles.d.ts +1 -0
  28. package/out/ui/packages/tabs/components/Tabs.styles.luau +2 -0
  29. package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +3 -1
  30. package/out/ui/packages/toggleButton/components/ToggleButton.luau +10 -1
  31. package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +2 -0
  32. package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +11 -4
  33. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  export type SwitchPointer = "rest" | "hover" | "press" | "focus";
2
2
  export declare function switchPointer(hovering: boolean, pressed: boolean, focused: boolean): SwitchPointer;
3
- export declare function switchTrackTransparency(on: boolean, disabled: boolean, pointer: SwitchPointer): 0 | 0.25 | 0.35 | 0.65 | 0.55 | 0.15 | 0.08;
3
+ export declare function switchTrackTransparency(on: boolean, disabled: boolean, pointer: SwitchPointer): 0 | 0.25 | 0.55 | 0.35 | 0.15 | 0.65 | 0.08;
4
4
  export declare function switchThumbTransparency(disabled: boolean): 0 | 0.35;
5
5
  export declare function switchStrokeTransparency(disabled: boolean, pointer: SwitchPointer): 1 | 0 | 0.35;
6
6
  export declare function switchThumbPlacement(on: boolean, inset: number): {
@@ -7,6 +7,7 @@ export interface TabsProps<T> {
7
7
  onChange: (value: T) => void;
8
8
  disabled?: boolean;
9
9
  orientation?: TabsOrientation;
10
+ centered?: boolean;
10
11
  }
11
12
  declare function Tabs<T>(props: CustomizedProps<ScrollingFrame, TabsProps<T>>): JSX.Element;
12
13
  export default Tabs;
@@ -13,12 +13,14 @@ local function Tabs(props)
13
13
  local onChange = _binding.onChange
14
14
  local disabled = _binding.disabled
15
15
  local orientation = _binding.orientation
16
+ local centered = _binding.centered
16
17
  local className = _binding.className
17
18
  local sx = _binding.sx
18
19
  local id = _binding.id
19
20
  local ref = _binding.ref
20
21
  local styles = useTabsStyles({
21
22
  orientation = orientation,
23
+ centered = centered,
22
24
  })
23
25
  local vertical = tabsIsVertical(orientation)
24
26
  local choose = function(index)
@@ -1,5 +1,6 @@
1
1
  import { TabsOrientation } from "./tabsOrientation";
2
2
  declare const useTabsStyles: (props: {
3
3
  orientation?: TabsOrientation;
4
+ centered?: boolean;
4
5
  }) => import("../../../../theme/index").ClassNameMap<string>;
5
6
  export default useTabsStyles;
@@ -6,6 +6,7 @@ local componentStyles = _theme.componentStyles
6
6
  local tabsIsVertical = TS.import(script, script.Parent, "tabsOrientation").tabsIsVertical
7
7
  local useTabsStyles = componentStyles("Tabs", function(theme, _param)
8
8
  local orientation = _param.orientation
9
+ local centered = _param.centered
9
10
  local vertical = tabsIsVertical(orientation)
10
11
  local bar = theme.padding.calc(0.5)
11
12
  return createStyles({
@@ -23,6 +24,7 @@ local useTabsStyles = componentStyles("Tabs", function(theme, _param)
23
24
  },
24
25
  list = {
25
26
  FillDirection = if vertical then Enum.FillDirection.Vertical else Enum.FillDirection.Horizontal,
27
+ HorizontalAlignment = if centered == true and vertical ~= true then Enum.HorizontalAlignment.Center else Enum.HorizontalAlignment.Left,
26
28
  SortOrder = Enum.SortOrder.LayoutOrder,
27
29
  },
28
30
  tab = {
@@ -1,9 +1,10 @@
1
- import { CustomizedProps } from "../../../../theme/index";
1
+ import { ControlSize, CustomizedProps } from "../../../../theme/index";
2
2
  import { ChoiceOption } from "../../radioGroup/index";
3
3
  export interface ToggleButtonProps {
4
4
  label: string;
5
5
  selected?: boolean;
6
6
  disabled?: boolean;
7
+ size?: ControlSize;
7
8
  onActivated?: () => void;
8
9
  }
9
10
  declare function ToggleButton(props: CustomizedProps<TextButton, ToggleButtonProps>): JSX.Element;
@@ -12,6 +13,7 @@ export interface ToggleButtonGroupProps<T> {
12
13
  options: ChoiceOption<T>[];
13
14
  onChange: (value: T) => void;
14
15
  disabled?: boolean;
16
+ size?: ControlSize;
15
17
  }
16
18
  export declare function ToggleButtonGroup<T>(props: CustomizedProps<Frame, ToggleButtonGroupProps<T>>): JSX.Element;
17
19
  export default ToggleButton;
@@ -8,6 +8,10 @@ local function ToggleButton(props)
8
8
  local label = _binding.label
9
9
  local selected = _binding.selected
10
10
  local disabled = _binding.disabled
11
+ local size = _binding.size
12
+ if size == nil then
13
+ size = "medium"
14
+ end
11
15
  local onActivated = _binding.onActivated
12
16
  local className = _binding.className
13
17
  local sx = _binding.sx
@@ -16,6 +20,7 @@ local function ToggleButton(props)
16
20
  local styles = useToggleButtonStyles({
17
21
  selected = selected,
18
22
  disabled = disabled,
23
+ size = size,
19
24
  })
20
25
  local active = canActivate(disabled)
21
26
  local _attributes = {}
@@ -67,11 +72,14 @@ local function ToggleButtonGroup(props)
67
72
  local options = _binding.options
68
73
  local onChange = _binding.onChange
69
74
  local disabled = _binding.disabled
75
+ local size = _binding.size
70
76
  local className = _binding.className
71
77
  local sx = _binding.sx
72
78
  local id = _binding.id
73
79
  local ref = _binding.ref
74
- local styles = useToggleButtonStyles({})
80
+ local styles = useToggleButtonStyles({
81
+ size = size,
82
+ })
75
83
  local _attributes = {}
76
84
  local _condition = id
77
85
  if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
@@ -103,6 +111,7 @@ local function ToggleButtonGroup(props)
103
111
  label = choice.label,
104
112
  selected = choice.value == value,
105
113
  disabled = disabled == true or choice.disabled == true,
114
+ size = size,
106
115
  onActivated = function()
107
116
  if choice.value ~= value then
108
117
  onChange(choice.value)
@@ -1,5 +1,7 @@
1
+ import { ControlSize } from "../../../../theme/index";
1
2
  declare const useToggleButtonStyles: (props: {
2
3
  selected?: boolean;
3
4
  disabled?: boolean;
5
+ size?: ControlSize;
4
6
  }) => import("../../../../theme/index").ClassNameMap<string>;
5
7
  export default useToggleButtonStyles;
@@ -12,10 +12,17 @@ local useToggleButtonStyles = componentStyles("ToggleButton", function(theme, _p
12
12
  if disabled == nil then
13
13
  disabled = false
14
14
  end
15
+ local size = _param.size
16
+ if size == nil then
17
+ size = "medium"
18
+ end
19
+ local height = if size == "small" then theme.spacing.calc(3) elseif size == "large" then theme.spacing.calc(5) else theme.spacing.calc(4)
20
+ local textSize = if size == "small" then theme.typography.fontSizes.caption elseif size == "large" then theme.typography.fontSizes.h6 else theme.typography.fontSizes.body
21
+ local pad = theme.padding.calc(if size == "small" then 1 else 1.5)
15
22
  return createStyles({
16
23
  root = {
17
24
  AutomaticSize = Enum.AutomaticSize.X,
18
- Size = UDim2.new(0, 0, 0, theme.spacing.calc(4)),
25
+ Size = UDim2.new(0, 0, 0, height),
19
26
  BackgroundColor3 = if selected then theme.palette.action.selected else theme.palette.surface.input,
20
27
  BorderSizePixel = 0,
21
28
  AutoButtonColor = false,
@@ -23,11 +30,11 @@ local useToggleButtonStyles = componentStyles("ToggleButton", function(theme, _p
23
30
  Selectable = not disabled,
24
31
  TextColor3 = if disabled then theme.palette.text.disabled elseif selected then theme.palette.primary.main else theme.palette.text.primary,
25
32
  Font = theme.typography.fontFamilies.default,
26
- TextSize = theme.typography.fontSizes.body,
33
+ TextSize = textSize,
27
34
  },
28
35
  padding = {
29
- PaddingLeft = UDim.new(0, theme.padding.calc(1.5)),
30
- PaddingRight = UDim.new(0, theme.padding.calc(1.5)),
36
+ PaddingLeft = UDim.new(0, pad),
37
+ PaddingRight = UDim.new(0, pad),
31
38
  },
32
39
  corner = {
33
40
  CornerRadius = UDim.new(0, theme.shape.borderRadius),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/uiblox",
3
- "version": "0.2.0-alpha.12",
3
+ "version": "0.2.0-alpha.14",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.luau",
6
6
  "packageManager": "pnpm@11.3.0",