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

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.
@@ -5,6 +5,7 @@ export interface AlertProps {
5
5
  title?: string;
6
6
  message: string;
7
7
  onClose?: () => void;
8
+ filled?: boolean;
8
9
  }
9
10
  declare function Alert(props: CustomizedProps<Frame, AlertProps>): JSX.Element;
10
11
  export default Alert;
@@ -9,6 +9,7 @@ local function Alert(props)
9
9
  local title = _binding.title
10
10
  local message = _binding.message
11
11
  local onClose = _binding.onClose
12
+ local filled = _binding.filled
12
13
  local className = _binding.className
13
14
  local sx = _binding.sx
14
15
  local id = _binding.id
@@ -17,6 +18,7 @@ local function Alert(props)
17
18
  local styles = useAlertStyles({
18
19
  severity = severity,
19
20
  dismissible = dismissible,
21
+ filled = filled,
20
22
  })
21
23
  local _attributes = {}
22
24
  local _condition = id
@@ -2,5 +2,6 @@ import { AlertSeverity } from "./alertTone";
2
2
  declare const useAlertStyles: (props: {
3
3
  severity?: AlertSeverity;
4
4
  dismissible?: boolean;
5
+ filled?: boolean;
5
6
  }) => import("../../../../theme/index").ClassNameMap<string>;
6
7
  export default useAlertStyles;
@@ -7,13 +7,14 @@ local alertSeverity = TS.import(script, script.Parent, "alertTone").alertSeverit
7
7
  local useAlertStyles = componentStyles("Alert", function(theme, _param)
8
8
  local severity = _param.severity
9
9
  local dismissible = _param.dismissible
10
+ local filled = _param.filled
10
11
  local tone = theme.palette.status[alertSeverity(severity)]
11
12
  local closeSize = theme.spacing.calc(2)
12
13
  local _object = {
13
14
  root = {
14
15
  AutomaticSize = Enum.AutomaticSize.Y,
15
16
  Size = UDim2.new(1, 0, 0, 0),
16
- BackgroundColor3 = tone.surface,
17
+ BackgroundColor3 = if filled == true then tone.main else tone.surface,
17
18
  BorderSizePixel = 0,
18
19
  },
19
20
  padding = {
@@ -26,9 +27,9 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
26
27
  CornerRadius = UDim.new(0, theme.shape.borderRadius),
27
28
  },
28
29
  stroke = {
29
- Color = tone.border,
30
+ Color = if filled == true then tone.main else tone.border,
30
31
  Thickness = 1,
31
- Transparency = 0,
32
+ Transparency = if filled == true then 1 else 0,
32
33
  ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
33
34
  },
34
35
  body = {
@@ -51,7 +52,7 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
51
52
  BorderSizePixel = 0,
52
53
  Font = theme.typography.fontFamilies.default,
53
54
  TextSize = theme.typography.fontSizes.body,
54
- TextColor3 = tone.main,
55
+ TextColor3 = if filled == true then tone.on else tone.main,
55
56
  TextXAlignment = Enum.TextXAlignment.Left,
56
57
  LayoutOrder = 1,
57
58
  },
@@ -70,7 +71,7 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
70
71
  _condition = theme.typography.fontSizes.body
71
72
  end
72
73
  _object_1[_left_1] = _condition
73
- _object_1.TextColor3 = theme.palette.text.primary
74
+ _object_1.TextColor3 = if filled == true then tone.on else theme.palette.text.primary
74
75
  _object_1.TextXAlignment = Enum.TextXAlignment.Left
75
76
  _object_1.TextWrapped = true
76
77
  _object_1.LayoutOrder = 2
@@ -81,7 +82,7 @@ local useAlertStyles = componentStyles("Alert", function(theme, _param)
81
82
  AnchorPoint = Vector2.new(1, 0),
82
83
  BackgroundTransparency = 1,
83
84
  BorderSizePixel = 0,
84
- ImageColor3 = theme.palette.text.secondary,
85
+ ImageColor3 = if filled == true then tone.on else theme.palette.text.secondary,
85
86
  ScaleType = Enum.ScaleType.Fit,
86
87
  ZIndex = 2,
87
88
  }
@@ -5,6 +5,7 @@ export interface BottomNavigationProps<T> {
5
5
  options: ChoiceOption<T>[];
6
6
  onChange: (value: T) => void;
7
7
  disabled?: boolean;
8
+ showLabels?: boolean;
8
9
  }
9
10
  declare function BottomNavigation<T>(props: CustomizedProps<Frame, BottomNavigationProps<T>>): JSX.Element;
10
11
  export default BottomNavigation;
@@ -10,11 +10,17 @@ local function BottomNavigation(props)
10
10
  local options = _binding.options
11
11
  local onChange = _binding.onChange
12
12
  local disabled = _binding.disabled
13
+ local showLabels = _binding.showLabels
14
+ if showLabels == nil then
15
+ showLabels = true
16
+ end
13
17
  local className = _binding.className
14
18
  local sx = _binding.sx
15
19
  local id = _binding.id
16
20
  local ref = _binding.ref
17
- local styles = useBottomNavigationStyles()
21
+ local styles = useBottomNavigationStyles({
22
+ showLabels = showLabels,
23
+ })
18
24
  local count = math.max(#options, 1)
19
25
  local _attributes = {}
20
26
  local _condition = id
@@ -51,7 +57,7 @@ local function BottomNavigation(props)
51
57
  _attributes_2[_k] = _v
52
58
  end
53
59
  _attributes_2.Size = UDim2.new(1 / count, 0, 1, 0)
54
- _attributes_2.Text = choice.label
60
+ _attributes_2.Text = if showLabels == false then "" else choice.label
55
61
  _attributes_2.LayoutOrder = index
56
62
  _attributes_2.Active = active
57
63
  _attributes_2.Selectable = active
@@ -1,2 +1,4 @@
1
- declare const useBottomNavigationStyles: () => import("../../../../theme/index").ClassNameMap<string>;
1
+ declare const useBottomNavigationStyles: (props: {
2
+ showLabels?: boolean;
3
+ }) => import("../../../../theme/index").ClassNameMap<string>;
2
4
  export default useBottomNavigationStyles;
@@ -3,10 +3,14 @@ local TS = _G[script]
3
3
  local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
4
4
  local componentStyles = _theme.componentStyles
5
5
  local createStyles = _theme.createStyles
6
- local useBottomNavigationStyles = componentStyles("BottomNavigation", function(theme)
6
+ local useBottomNavigationStyles = componentStyles("BottomNavigation", function(theme, _param)
7
+ local showLabels = _param.showLabels
8
+ if showLabels == nil then
9
+ showLabels = true
10
+ end
7
11
  local _object = {
8
12
  root = {
9
- Size = UDim2.new(1, 0, 0, theme.spacing.calc(7)),
13
+ Size = UDim2.new(1, 0, 0, theme.spacing.calc(if showLabels == false then 5 else 7)),
10
14
  BackgroundColor3 = theme.palette.surface.elevated,
11
15
  BorderSizePixel = 0,
12
16
  ZIndex = 11000,
@@ -1621,298 +1621,319 @@ local function miscRows()
1621
1621
  local _Length_1 = #_array_2
1622
1622
  table.move(_array_2, 1, _Length_1, _length + 1, _array)
1623
1623
  _length += _Length_1
1624
- local _array_3 = pair("Alert", "info", {
1625
- text = "Heads up",
1626
- variant = "info",
1624
+ local _array_3 = pair("BottomNavigation", "icons", {
1625
+ value = "Home",
1626
+ options = { "Home", "Search", "Profile" },
1627
+ variant = "icons",
1627
1628
  })
1628
1629
  local _Length_2 = #_array_3
1629
1630
  table.move(_array_3, 1, _Length_2, _length + 1, _array)
1630
1631
  _length += _Length_2
1631
- local _array_4 = pair("Alert", "success", {
1632
- text = "Saved",
1633
- variant = "success",
1632
+ local _array_4 = pair("Alert", "info", {
1633
+ text = "Heads up",
1634
+ variant = "info",
1634
1635
  })
1635
1636
  local _Length_3 = #_array_4
1636
1637
  table.move(_array_4, 1, _Length_3, _length + 1, _array)
1637
1638
  _length += _Length_3
1638
- local _array_5 = pair("Alert", "warning", {
1639
- text = "Check this",
1640
- variant = "warning",
1639
+ local _array_5 = pair("Alert", "success", {
1640
+ text = "Saved",
1641
+ variant = "success",
1641
1642
  })
1642
1643
  local _Length_4 = #_array_5
1643
1644
  table.move(_array_5, 1, _Length_4, _length + 1, _array)
1644
1645
  _length += _Length_4
1645
- local _array_6 = pair("Alert", "error", {
1646
- text = "Failed",
1647
- variant = "error",
1646
+ local _array_6 = pair("Alert", "warning", {
1647
+ text = "Check this",
1648
+ variant = "warning",
1648
1649
  })
1649
1650
  local _Length_5 = #_array_6
1650
1651
  table.move(_array_6, 1, _Length_5, _length + 1, _array)
1651
1652
  _length += _Length_5
1652
- local _array_7 = pair("ToggleButton", "default")
1653
+ local _array_7 = pair("Alert", "error", {
1654
+ text = "Failed",
1655
+ variant = "error",
1656
+ })
1653
1657
  local _Length_6 = #_array_7
1654
1658
  table.move(_array_7, 1, _Length_6, _length + 1, _array)
1655
1659
  _length += _Length_6
1656
- local _array_8 = pair("ToggleButton", "selected", {
1657
- value = true,
1660
+ local _array_8 = pair("Alert", "filled", {
1661
+ text = "Heads up",
1662
+ variant = "filled",
1658
1663
  })
1659
1664
  local _Length_7 = #_array_8
1660
1665
  table.move(_array_8, 1, _Length_7, _length + 1, _array)
1661
1666
  _length += _Length_7
1662
- local _array_9 = pair("ToggleButton", "disabled", {
1663
- disabled = true,
1664
- })
1667
+ local _array_9 = pair("ToggleButton", "default")
1665
1668
  local _Length_8 = #_array_9
1666
1669
  table.move(_array_9, 1, _Length_8, _length + 1, _array)
1667
1670
  _length += _Length_8
1668
- local _array_10 = pair("ToggleButtonGroup", "default", {
1669
- value = "Left",
1670
- options = { "Left", "Center", "Right" },
1671
+ local _array_10 = pair("ToggleButton", "selected", {
1672
+ value = true,
1671
1673
  })
1672
1674
  local _Length_9 = #_array_10
1673
1675
  table.move(_array_10, 1, _Length_9, _length + 1, _array)
1674
1676
  _length += _Length_9
1675
- local _array_11 = pair("ToggleButtonGroup", "selected", {
1676
- value = "Center",
1677
- options = { "Left", "Center", "Right" },
1677
+ local _array_11 = pair("ToggleButton", "disabled", {
1678
+ disabled = true,
1678
1679
  })
1679
1680
  local _Length_10 = #_array_11
1680
1681
  table.move(_array_11, 1, _Length_10, _length + 1, _array)
1681
1682
  _length += _Length_10
1682
- local _array_12 = pair("Link", "default", {
1683
- text = "Open docs",
1683
+ local _array_12 = pair("ToggleButton", "size-small", {
1684
+ size = "small",
1684
1685
  })
1685
1686
  local _Length_11 = #_array_12
1686
1687
  table.move(_array_12, 1, _Length_11, _length + 1, _array)
1687
1688
  _length += _Length_11
1688
- local _array_13 = pair("Link", "hover-underline", {
1689
- text = "Open docs",
1690
- variant = "hover",
1691
- pointer = "hover",
1689
+ local _array_13 = pair("ToggleButtonGroup", "default", {
1690
+ value = "Left",
1691
+ options = { "Left", "Center", "Right" },
1692
1692
  })
1693
1693
  local _Length_12 = #_array_13
1694
1694
  table.move(_array_13, 1, _Length_12, _length + 1, _array)
1695
1695
  _length += _Length_12
1696
- local _array_14 = pair("Link", "disabled", {
1697
- text = "Open docs",
1698
- disabled = true,
1696
+ local _array_14 = pair("ToggleButtonGroup", "selected", {
1697
+ value = "Center",
1698
+ options = { "Left", "Center", "Right" },
1699
1699
  })
1700
1700
  local _Length_13 = #_array_14
1701
1701
  table.move(_array_14, 1, _Length_13, _length + 1, _array)
1702
1702
  _length += _Length_13
1703
- local _array_15 = pair("Link", "error", {
1703
+ local _array_15 = pair("Link", "default", {
1704
1704
  text = "Open docs",
1705
- variant = "error",
1706
1705
  })
1707
1706
  local _Length_14 = #_array_15
1708
1707
  table.move(_array_15, 1, _Length_14, _length + 1, _array)
1709
1708
  _length += _Length_14
1710
- local _array_16 = pair("Rating", "default", {
1711
- value = 0,
1709
+ local _array_16 = pair("Link", "hover-underline", {
1710
+ text = "Open docs",
1711
+ variant = "hover",
1712
+ pointer = "hover",
1712
1713
  })
1713
1714
  local _Length_15 = #_array_16
1714
1715
  table.move(_array_16, 1, _Length_15, _length + 1, _array)
1715
1716
  _length += _Length_15
1716
- local _array_17 = pair("Rating", "filled", {
1717
- value = 3,
1717
+ local _array_17 = pair("Link", "disabled", {
1718
+ text = "Open docs",
1719
+ disabled = true,
1718
1720
  })
1719
1721
  local _Length_16 = #_array_17
1720
1722
  table.move(_array_17, 1, _Length_16, _length + 1, _array)
1721
1723
  _length += _Length_16
1722
- local _array_18 = pair("Rating", "disabled", {
1723
- value = 4,
1724
- disabled = true,
1724
+ local _array_18 = pair("Link", "error", {
1725
+ text = "Open docs",
1726
+ variant = "error",
1725
1727
  })
1726
1728
  local _Length_17 = #_array_18
1727
1729
  table.move(_array_18, 1, _Length_17, _length + 1, _array)
1728
1730
  _length += _Length_17
1729
- local _array_19 = pair("Rating", "size-small", {
1730
- value = 3,
1731
- size = "small",
1731
+ local _array_19 = pair("Rating", "default", {
1732
+ value = 0,
1732
1733
  })
1733
1734
  local _Length_18 = #_array_19
1734
1735
  table.move(_array_19, 1, _Length_18, _length + 1, _array)
1735
1736
  _length += _Length_18
1736
- local _array_20 = pair("Stack", "column", {
1737
- variant = "column",
1737
+ local _array_20 = pair("Rating", "filled", {
1738
+ value = 3,
1738
1739
  })
1739
1740
  local _Length_19 = #_array_20
1740
1741
  table.move(_array_20, 1, _Length_19, _length + 1, _array)
1741
1742
  _length += _Length_19
1742
- local _array_21 = pair("Stack", "row", {
1743
- variant = "row",
1743
+ local _array_21 = pair("Rating", "disabled", {
1744
+ value = 4,
1745
+ disabled = true,
1744
1746
  })
1745
1747
  local _Length_20 = #_array_21
1746
1748
  table.move(_array_21, 1, _Length_20, _length + 1, _array)
1747
1749
  _length += _Length_20
1748
- local _array_22 = pair("Stack", "spaced", {
1749
- variant = "column",
1750
- size = "large",
1750
+ local _array_22 = pair("Rating", "size-small", {
1751
+ value = 3,
1752
+ size = "small",
1751
1753
  })
1752
1754
  local _Length_21 = #_array_22
1753
1755
  table.move(_array_22, 1, _Length_21, _length + 1, _array)
1754
1756
  _length += _Length_21
1755
- local _array_23 = pair("Box", "plain")
1757
+ local _array_23 = pair("Stack", "column", {
1758
+ variant = "column",
1759
+ })
1756
1760
  local _Length_22 = #_array_23
1757
1761
  table.move(_array_23, 1, _Length_22, _length + 1, _array)
1758
1762
  _length += _Length_22
1759
- local _array_24 = pair("Box", "padded", {
1760
- size = "medium",
1763
+ local _array_24 = pair("Stack", "row", {
1764
+ variant = "row",
1761
1765
  })
1762
1766
  local _Length_23 = #_array_24
1763
1767
  table.move(_array_24, 1, _Length_23, _length + 1, _array)
1764
1768
  _length += _Length_23
1765
- local _array_25 = pair("Box", "paper", {
1766
- variant = "paper",
1769
+ local _array_25 = pair("Stack", "spaced", {
1770
+ variant = "column",
1771
+ size = "large",
1767
1772
  })
1768
1773
  local _Length_24 = #_array_25
1769
1774
  table.move(_array_25, 1, _Length_24, _length + 1, _array)
1770
1775
  _length += _Length_24
1771
- local _array_26 = pair("Container", "default", {
1772
- variant = "lg",
1773
- })
1776
+ local _array_26 = pair("Box", "plain")
1774
1777
  local _Length_25 = #_array_26
1775
1778
  table.move(_array_26, 1, _Length_25, _length + 1, _array)
1776
1779
  _length += _Length_25
1777
- local _array_27 = pair("Container", "sm", {
1778
- variant = "sm",
1780
+ local _array_27 = pair("Box", "padded", {
1781
+ size = "medium",
1779
1782
  })
1780
1783
  local _Length_26 = #_array_27
1781
1784
  table.move(_array_27, 1, _Length_26, _length + 1, _array)
1782
1785
  _length += _Length_26
1783
- local _array_28 = pair("Container", "fluid", {
1784
- variant = "false",
1786
+ local _array_28 = pair("Box", "paper", {
1787
+ variant = "paper",
1785
1788
  })
1786
1789
  local _Length_27 = #_array_28
1787
1790
  table.move(_array_28, 1, _Length_27, _length + 1, _array)
1788
1791
  _length += _Length_27
1789
- local _array_29 = pair("Backdrop", "default")
1792
+ local _array_29 = pair("Container", "default", {
1793
+ variant = "lg",
1794
+ })
1790
1795
  local _Length_28 = #_array_29
1791
1796
  table.move(_array_29, 1, _Length_28, _length + 1, _array)
1792
1797
  _length += _Length_28
1793
- local _array_30 = pair("Backdrop", "invisible", {
1794
- variant = "invisible",
1798
+ local _array_30 = pair("Container", "sm", {
1799
+ variant = "sm",
1795
1800
  })
1796
1801
  local _Length_29 = #_array_30
1797
1802
  table.move(_array_30, 1, _Length_29, _length + 1, _array)
1798
1803
  _length += _Length_29
1799
- local _array_31 = pair("Backdrop", "closed", {
1800
- open = false,
1804
+ local _array_31 = pair("Container", "fluid", {
1805
+ variant = "false",
1801
1806
  })
1802
1807
  local _Length_30 = #_array_31
1803
1808
  table.move(_array_31, 1, _Length_30, _length + 1, _array)
1804
1809
  _length += _Length_30
1805
- local _array_32 = pair("Divider", "horizontal", {
1806
- variant = "horizontal",
1807
- })
1810
+ local _array_32 = pair("Backdrop", "default")
1808
1811
  local _Length_31 = #_array_32
1809
1812
  table.move(_array_32, 1, _Length_31, _length + 1, _array)
1810
1813
  _length += _Length_31
1811
- local _array_33 = pair("Divider", "vertical", {
1812
- variant = "vertical",
1814
+ local _array_33 = pair("Backdrop", "invisible", {
1815
+ variant = "invisible",
1813
1816
  })
1814
1817
  local _Length_32 = #_array_33
1815
1818
  table.move(_array_33, 1, _Length_32, _length + 1, _array)
1816
1819
  _length += _Length_32
1817
- local _array_34 = pair("ImageList", "default")
1820
+ local _array_34 = pair("Backdrop", "closed", {
1821
+ open = false,
1822
+ })
1818
1823
  local _Length_33 = #_array_34
1819
1824
  table.move(_array_34, 1, _Length_33, _length + 1, _array)
1820
1825
  _length += _Length_33
1821
- local _array_35 = pair("ImageList", "dense", {
1822
- size = "small",
1826
+ local _array_35 = pair("Divider", "horizontal", {
1827
+ variant = "horizontal",
1823
1828
  })
1824
1829
  local _Length_34 = #_array_35
1825
1830
  table.move(_array_35, 1, _Length_34, _length + 1, _array)
1826
1831
  _length += _Length_34
1827
- local _array_36 = pair("ImageList", "wide", {
1828
- size = "large",
1832
+ local _array_36 = pair("Divider", "vertical", {
1833
+ variant = "vertical",
1829
1834
  })
1830
1835
  local _Length_35 = #_array_36
1831
1836
  table.move(_array_36, 1, _Length_35, _length + 1, _array)
1832
1837
  _length += _Length_35
1833
- local _array_37 = pair("SpeedDial", "closed", {
1834
- open = false,
1835
- })
1838
+ local _array_37 = pair("ImageList", "default")
1836
1839
  local _Length_36 = #_array_37
1837
1840
  table.move(_array_37, 1, _Length_36, _length + 1, _array)
1838
1841
  _length += _Length_36
1839
- local _array_38 = pair("SpeedDial", "open", {
1840
- open = true,
1842
+ local _array_38 = pair("ImageList", "dense", {
1843
+ size = "small",
1841
1844
  })
1842
1845
  local _Length_37 = #_array_38
1843
1846
  table.move(_array_38, 1, _Length_37, _length + 1, _array)
1844
1847
  _length += _Length_37
1845
- local _array_39 = pair("SpeedDial", "disabled", {
1846
- open = false,
1847
- disabled = true,
1848
+ local _array_39 = pair("ImageList", "wide", {
1849
+ size = "large",
1848
1850
  })
1849
1851
  local _Length_38 = #_array_39
1850
1852
  table.move(_array_39, 1, _Length_38, _length + 1, _array)
1851
1853
  _length += _Length_38
1852
- local _array_40 = pair("SpeedDial", "down", {
1853
- open = true,
1854
- variant = "down",
1854
+ local _array_40 = pair("SpeedDial", "closed", {
1855
+ open = false,
1855
1856
  })
1856
1857
  local _Length_39 = #_array_40
1857
1858
  table.move(_array_40, 1, _Length_39, _length + 1, _array)
1858
1859
  _length += _Length_39
1859
- local _array_41 = pair("FormLabel", "default", {
1860
- text = "Email",
1860
+ local _array_41 = pair("SpeedDial", "open", {
1861
+ open = true,
1861
1862
  })
1862
1863
  local _Length_40 = #_array_41
1863
1864
  table.move(_array_41, 1, _Length_40, _length + 1, _array)
1864
1865
  _length += _Length_40
1865
- local _array_42 = pair("FormLabel", "required", {
1866
- text = "Email",
1867
- value = true,
1866
+ local _array_42 = pair("SpeedDial", "disabled", {
1867
+ open = false,
1868
+ disabled = true,
1868
1869
  })
1869
1870
  local _Length_41 = #_array_42
1870
1871
  table.move(_array_42, 1, _Length_41, _length + 1, _array)
1871
1872
  _length += _Length_41
1872
- local _array_43 = pair("FormLabel", "error", {
1873
- text = "Email",
1874
- hasError = true,
1873
+ local _array_43 = pair("SpeedDial", "down", {
1874
+ open = true,
1875
+ variant = "down",
1875
1876
  })
1876
1877
  local _Length_42 = #_array_43
1877
1878
  table.move(_array_43, 1, _Length_42, _length + 1, _array)
1878
1879
  _length += _Length_42
1879
- local _array_44 = pair("FormHelperText", "default", {
1880
- text = "We never share this",
1880
+ local _array_44 = pair("FormLabel", "default", {
1881
+ text = "Email",
1881
1882
  })
1882
1883
  local _Length_43 = #_array_44
1883
1884
  table.move(_array_44, 1, _Length_43, _length + 1, _array)
1884
1885
  _length += _Length_43
1885
- local _array_45 = pair("FormHelperText", "error", {
1886
- text = "Required",
1887
- hasError = true,
1886
+ local _array_45 = pair("FormLabel", "required", {
1887
+ text = "Email",
1888
+ value = true,
1888
1889
  })
1889
1890
  local _Length_44 = #_array_45
1890
1891
  table.move(_array_45, 1, _Length_44, _length + 1, _array)
1891
1892
  _length += _Length_44
1892
- local _array_46 = pair("Menu", "closed", {
1893
- open = false,
1893
+ local _array_46 = pair("FormLabel", "error", {
1894
+ text = "Email",
1895
+ hasError = true,
1894
1896
  })
1895
1897
  local _Length_45 = #_array_46
1896
1898
  table.move(_array_46, 1, _Length_45, _length + 1, _array)
1897
1899
  _length += _Length_45
1898
- local _array_47 = pair("Menu", "open", {
1899
- open = true,
1900
+ local _array_47 = pair("FormHelperText", "default", {
1901
+ text = "We never share this",
1900
1902
  })
1901
1903
  local _Length_46 = #_array_47
1902
1904
  table.move(_array_47, 1, _Length_46, _length + 1, _array)
1903
1905
  _length += _Length_46
1904
- local _array_48 = pair("Menu", "empty", {
1905
- open = true,
1906
- options = {},
1906
+ local _array_48 = pair("FormHelperText", "error", {
1907
+ text = "Required",
1908
+ hasError = true,
1907
1909
  })
1908
1910
  local _Length_47 = #_array_48
1909
1911
  table.move(_array_48, 1, _Length_47, _length + 1, _array)
1910
1912
  _length += _Length_47
1911
- local _array_49 = pair("Menu", "dense", {
1913
+ local _array_49 = pair("Menu", "closed", {
1914
+ open = false,
1915
+ })
1916
+ local _Length_48 = #_array_49
1917
+ table.move(_array_49, 1, _Length_48, _length + 1, _array)
1918
+ _length += _Length_48
1919
+ local _array_50 = pair("Menu", "open", {
1920
+ open = true,
1921
+ })
1922
+ local _Length_49 = #_array_50
1923
+ table.move(_array_50, 1, _Length_49, _length + 1, _array)
1924
+ _length += _Length_49
1925
+ local _array_51 = pair("Menu", "empty", {
1926
+ open = true,
1927
+ options = {},
1928
+ })
1929
+ local _Length_50 = #_array_51
1930
+ table.move(_array_51, 1, _Length_50, _length + 1, _array)
1931
+ _length += _Length_50
1932
+ local _array_52 = pair("Menu", "dense", {
1912
1933
  open = true,
1913
1934
  variant = "dense",
1914
1935
  })
1915
- table.move(_array_49, 1, #_array_49, _length + 1, _array)
1936
+ table.move(_array_52, 1, #_array_52, _length + 1, _array)
1916
1937
  return _array
1917
1938
  end
1918
1939
  local function concatRows(...)
@@ -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.13",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.luau",
6
6
  "packageManager": "pnpm@11.3.0",