@rbxts-ui/components 2.0.0 → 3.0.0

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 (110) hide show
  1. package/dist/DynamicWindow/DynamicWindow.d.ts +19 -0
  2. package/dist/DynamicWindow/DynamicWindow.luau +327 -0
  3. package/dist/DynamicWindow/DynamicWindow.utils.d.ts +13 -0
  4. package/dist/DynamicWindow/DynamicWindow.utils.luau +46 -0
  5. package/dist/DynamicWindow/ResizeCornerButton.d.ts +13 -0
  6. package/dist/DynamicWindow/ResizeCornerButton.luau +47 -0
  7. package/dist/DynamicWindow/TrafficLightButton.d.ts +8 -0
  8. package/dist/DynamicWindow/TrafficLightButton.luau +26 -0
  9. package/dist/buttons/Button.d.ts +15 -0
  10. package/dist/buttons/Button.luau +66 -0
  11. package/dist/buttons/DropdownButton.d.ts +20 -0
  12. package/dist/buttons/DropdownButton.luau +106 -0
  13. package/dist/buttons/DropdownOptionButton.d.ts +11 -0
  14. package/dist/buttons/DropdownOptionButton.luau +66 -0
  15. package/dist/buttons/IconRoundButton.d.ts +21 -0
  16. package/dist/buttons/IconRoundButton.luau +145 -0
  17. package/dist/buttons/IconTileButton.d.ts +12 -0
  18. package/dist/buttons/IconTileButton.luau +86 -0
  19. package/dist/buttons/PrimaryButton.d.ts +23 -0
  20. package/dist/buttons/PrimaryButton.luau +84 -0
  21. package/dist/buttons/ReactiveButton.d.ts +32 -0
  22. package/dist/buttons/ReactiveButton.luau +163 -0
  23. package/dist/buttons/TextButton.d.ts +30 -0
  24. package/dist/buttons/TextButton.luau +121 -0
  25. package/dist/{Checkmark.luau → display/Checkmark.luau} +1 -1
  26. package/dist/display/Legend.d.ts +11 -0
  27. package/dist/display/Legend.luau +54 -0
  28. package/dist/display/PillText.d.ts +6 -0
  29. package/dist/display/PillText.luau +65 -0
  30. package/dist/display/TimeAgo.d.ts +8 -0
  31. package/dist/display/TimeAgo.luau +48 -0
  32. package/dist/error-handler/ErrorHandler.d.ts +3 -0
  33. package/dist/error-handler/ErrorHandler.luau +18 -0
  34. package/dist/error-handler/ErrorPage.d.ts +6 -0
  35. package/dist/error-handler/ErrorPage.luau +144 -0
  36. package/dist/error-handler/index.d.ts +3 -0
  37. package/dist/error-handler/init.luau +6 -0
  38. package/dist/form/Checkbox.d.ts +11 -0
  39. package/dist/form/Checkbox.luau +108 -0
  40. package/dist/form/CheckboxRow.d.ts +12 -0
  41. package/dist/form/CheckboxRow.luau +48 -0
  42. package/dist/form/Dropdown.d.ts +16 -0
  43. package/dist/form/Dropdown.luau +155 -0
  44. package/dist/form/DropdownRow.d.ts +18 -0
  45. package/dist/form/DropdownRow.luau +28 -0
  46. package/dist/form/FormRow.d.ts +9 -0
  47. package/dist/form/FormRow.luau +36 -0
  48. package/dist/form/InputRound.d.ts +18 -0
  49. package/dist/form/InputRound.luau +218 -0
  50. package/dist/form/InputRow.d.ts +13 -0
  51. package/dist/form/InputRow.luau +32 -0
  52. package/dist/form/Radio.d.ts +11 -0
  53. package/dist/form/Radio.luau +105 -0
  54. package/dist/form/RadioRow.d.ts +8 -0
  55. package/dist/form/RadioRow.luau +46 -0
  56. package/dist/form/RoundEmoji.d.ts +8 -0
  57. package/dist/form/RoundEmoji.luau +40 -0
  58. package/dist/form/TextBox.d.ts +24 -0
  59. package/dist/form/TextBox.luau +57 -0
  60. package/dist/{TextField.d.ts → form/TextField.d.ts} +1 -1
  61. package/dist/{TextField.luau → form/TextField.luau} +4 -2
  62. package/dist/form/validation.d.ts +13 -0
  63. package/dist/form/validation.luau +80 -0
  64. package/dist/hooks/use-button-animation.d.ts +36 -0
  65. package/dist/hooks/use-button-animation.luau +80 -0
  66. package/dist/hooks/use-button-state.d.ts +13 -0
  67. package/dist/hooks/use-button-state.luau +81 -0
  68. package/dist/hooks/use-input-device.d.ts +7 -0
  69. package/dist/hooks/use-input-device.luau +38 -0
  70. package/dist/index.d.ts +48 -6
  71. package/dist/init.luau +72 -6
  72. package/dist/layout/Accordion.d.ts +14 -0
  73. package/dist/layout/Accordion.luau +101 -0
  74. package/dist/{Divider.luau → layout/Divider.luau} +1 -1
  75. package/dist/layout/Section.d.ts +10 -0
  76. package/dist/layout/Section.luau +51 -0
  77. package/dist/layout/SegmentedToggle.d.ts +17 -0
  78. package/dist/layout/SegmentedToggle.luau +117 -0
  79. package/dist/layout/SegmentedToggle.story.d.ts +10 -0
  80. package/dist/layout/SegmentedToggle.story.luau +72 -0
  81. package/dist/table/ExampleTable.d.ts +2 -0
  82. package/dist/table/ExampleTable.luau +46 -0
  83. package/dist/table/Table.d.ts +10 -0
  84. package/dist/table/Table.luau +26 -0
  85. package/dist/table/TableCell.d.ts +9 -0
  86. package/dist/table/TableCell.luau +26 -0
  87. package/dist/table/TableFooter.d.ts +9 -0
  88. package/dist/table/TableFooter.luau +12 -0
  89. package/dist/table/TableHeader.d.ts +9 -0
  90. package/dist/table/TableHeader.luau +12 -0
  91. package/dist/table/TableRow.d.ts +9 -0
  92. package/dist/table/TableRow.luau +24 -0
  93. package/dist/tooltip/Tooltip.d.ts +14 -0
  94. package/dist/tooltip/Tooltip.luau +65 -0
  95. package/dist/tooltip/useTooltip.d.ts +12 -0
  96. package/dist/tooltip/useTooltip.luau +40 -0
  97. package/dist/tsconfig.tsbuildinfo +1 -1
  98. package/dist/utils/ClickOutsideOverlay.d.ts +11 -0
  99. package/dist/utils/ClickOutsideOverlay.luau +35 -0
  100. package/dist/utils/Outline.d.ts +14 -0
  101. package/dist/utils/Outline.luau +99 -0
  102. package/package.json +19 -7
  103. /package/dist/{Checkmark.d.ts → display/Checkmark.d.ts} +0 -0
  104. /package/dist/{Divider.d.ts → layout/Divider.d.ts} +0 -0
  105. /package/dist/{Padding.d.ts → layout/Padding.d.ts} +0 -0
  106. /package/dist/{Padding.luau → layout/Padding.luau} +0 -0
  107. /package/dist/{DelayRender.d.ts → utils/DelayRender.d.ts} +0 -0
  108. /package/dist/{DelayRender.luau → utils/DelayRender.luau} +0 -0
  109. /package/dist/{ErrorBoundary.d.ts → utils/ErrorBoundary.d.ts} +0 -0
  110. /package/dist/{ErrorBoundary.luau → utils/ErrorBoundary.luau} +0 -0
@@ -0,0 +1,17 @@
1
+ import React from "@rbxts/react";
2
+ export interface SegmentedToggleOption<T extends string> {
3
+ id: T;
4
+ label: string;
5
+ disabled?: boolean;
6
+ }
7
+ export interface SegmentedToggleProps<T extends string> {
8
+ options: ReadonlyArray<SegmentedToggleOption<T>>;
9
+ value: T;
10
+ onChange: (id: T) => void;
11
+ disabled?: boolean;
12
+ size?: "default" | "small";
13
+ label?: string;
14
+ children?: React.ReactNode;
15
+ }
16
+ export declare function SegmentedToggle<T extends string>({ options, value, onChange, disabled, size, label, children, }: SegmentedToggleProps<T>): JSX.Element;
17
+ //# sourceMappingURL=SegmentedToggle.d.ts.map
@@ -0,0 +1,117 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local useRem = TS.import(script, TS.getModule(script, "@rbxts-ui", "@rbxts-ui/rem")).useRem
5
+ local Button = TS.import(script, script.Parent.Parent, "buttons", "Button").Button
6
+ local Frame = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Frame
7
+ local Text = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Text
8
+ local _layout = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist)
9
+ local HStack = _layout.HStack
10
+ local VStack = _layout.VStack
11
+ local defaultTheme = TS.import(script, TS.getModule(script, "@rbxts-ui", "theme").dist).defaultTheme
12
+ local function SegmentedToggle(_param)
13
+ local options = _param.options
14
+ local value = _param.value
15
+ local onChange = _param.onChange
16
+ local disabled = _param.disabled
17
+ if disabled == nil then
18
+ disabled = false
19
+ end
20
+ local size = _param.size
21
+ if size == nil then
22
+ size = "default"
23
+ end
24
+ local label = _param.label
25
+ local children = _param.children
26
+ local theme = defaultTheme
27
+ local rem = useRem()
28
+ local count = #options
29
+ if count == 0 then
30
+ return React.createElement(React.Fragment)
31
+ end
32
+ local height = if size == "small" then rem(4) else rem(5)
33
+ local spacing = rem(1)
34
+ local innerPaddingX = rem(0.6)
35
+ local innerPaddingY = rem(0.5)
36
+ local buttonCorner = UDim.new(0, rem(2))
37
+ local buttonWidthOffset = if count > 1 then -((count - 1) * spacing) / count else 0
38
+ local buttonSize = UDim2.new(1 / count, buttonWidthOffset, 1, 0)
39
+ local handleChange = function(id, optionDisabled)
40
+ if disabled or optionDisabled then
41
+ return nil
42
+ end
43
+ if id == value then
44
+ return nil
45
+ end
46
+ onChange(id)
47
+ end
48
+ local showLabel = label ~= nil and label ~= ""
49
+ local containerHeight = if showLabel then height + rem(3.5) else height
50
+ local labelColor = if disabled then theme.palette.disabled else theme.palette.crust
51
+ local _exp = showLabel and (React.createElement(Text, {
52
+ text = label,
53
+ textSize = rem(3),
54
+ textScaled = true,
55
+ textColor = labelColor,
56
+ size = UDim2.new(1, 0, 0, rem(3)),
57
+ textXAlignment = "Left",
58
+ }))
59
+ local _exp_1 = React.createElement("uistroke", {
60
+ Color = theme.palette.overlay0,
61
+ Transparency = if disabled then 0.6 else 0.3,
62
+ Thickness = 1,
63
+ })
64
+ local _exp_2 = React.createElement("uipadding", {
65
+ PaddingLeft = UDim.new(0, innerPaddingX),
66
+ PaddingRight = UDim.new(0, innerPaddingX),
67
+ PaddingTop = UDim.new(0, innerPaddingY),
68
+ PaddingBottom = UDim.new(0, innerPaddingY),
69
+ })
70
+ -- ▼ ReadonlyArray.map ▼
71
+ local _newValue = table.create(#options)
72
+ local _callback = function(option, index)
73
+ local isSelected = option.id == value
74
+ local optionDisabled = disabled or option.disabled
75
+ local backgroundColor = theme.palette.blue
76
+ return React.createElement(Button, {
77
+ key = `segmented-toggle-{option.id}-{index}`,
78
+ size = buttonSize,
79
+ backgroundColor = backgroundColor,
80
+ backgroundTransparency = if isSelected then 0 else 1,
81
+ onClick = function()
82
+ return handleChange(option.id, optionDisabled)
83
+ end,
84
+ selectable = false,
85
+ cornerRadius = buttonCorner,
86
+ }, React.createElement(Text, {
87
+ size = UDim2.new(1, 0, 1, 0),
88
+ text = option.label,
89
+ textSize = rem(3),
90
+ textScaled = true,
91
+ textColor = theme.palette.crust,
92
+ textXAlignment = "Center",
93
+ textYAlignment = "Center",
94
+ padding = 0.5,
95
+ rem = rem,
96
+ }))
97
+ end
98
+ for _k, _v in options do
99
+ _newValue[_k] = _callback(_v, _k - 1, options)
100
+ end
101
+ -- ▲ ReadonlyArray.map ▲
102
+ return React.createElement(VStack, {
103
+ spacing = rem(1),
104
+ size = UDim2.new(1, 0, 0, containerHeight),
105
+ automaticSize = Enum.AutomaticSize.Y,
106
+ }, _exp, React.createElement(Frame, {
107
+ size = UDim2.new(1, 0, 0, height),
108
+ backgroundColor = theme.palette.surface1,
109
+ backgroundTransparency = 1,
110
+ cornerRadius = UDim.new(0, rem(3)),
111
+ }, _exp_1, React.createElement(HStack, {
112
+ spacing = spacing,
113
+ }, _exp_2, _newValue)), children)
114
+ end
115
+ return {
116
+ SegmentedToggle = SegmentedToggle,
117
+ }
@@ -0,0 +1,10 @@
1
+ import React from "@rbxts/react";
2
+ import ReactRoblox from "@rbxts/react-roblox";
3
+ declare const story: {
4
+ react: typeof React;
5
+ reactRoblox: typeof ReactRoblox;
6
+ controls: {};
7
+ story: () => JSX.Element;
8
+ };
9
+ export = story;
10
+ //# sourceMappingURL=SegmentedToggle.story.d.ts.map
@@ -0,0 +1,72 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local VStack = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist).VStack
4
+ local Text = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Text
5
+ local _rem = TS.import(script, TS.getModule(script, "@rbxts-ui", "@rbxts-ui/rem"))
6
+ local RemProvider = _rem.RemProvider
7
+ local useRem = _rem.useRem
8
+ local defaultTheme = TS.import(script, TS.getModule(script, "@rbxts-ui", "theme").dist).defaultTheme
9
+ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
10
+ local React = _react
11
+ local useState = _react.useState
12
+ local ReactRoblox = TS.import(script, TS.getModule(script, "@rbxts", "react-roblox"))
13
+ local SegmentedToggle = TS.import(script, script.Parent, "SegmentedToggle").SegmentedToggle
14
+ local controls = {}
15
+ local SegmentedToggleStory = function()
16
+ local rem = useRem()
17
+ local demoOptions = { {
18
+ id = "Folder",
19
+ label = "Folder",
20
+ }, {
21
+ id = "Model",
22
+ label = "Model",
23
+ }, {
24
+ id = "Asset",
25
+ label = "Asset",
26
+ } }
27
+ local selection, setSelection = useState(demoOptions[1].id)
28
+ return React.createElement(RemProvider, {
29
+ baseRem = 16,
30
+ maximumRem = 32,
31
+ }, React.createElement(VStack, {
32
+ size = UDim2.new(1, 0, 1, 0),
33
+ spacing = rem(2),
34
+ horizontalAlignment = Enum.HorizontalAlignment.Center,
35
+ verticalAlignment = Enum.VerticalAlignment.Center,
36
+ }, React.createElement(SegmentedToggle, {
37
+ label = "Output Type",
38
+ options = demoOptions,
39
+ value = selection,
40
+ onChange = setSelection,
41
+ }), React.createElement(Text, {
42
+ text = `Selected: {selection}`,
43
+ textSize = rem(3),
44
+ textScaled = true,
45
+ textColor = defaultTheme.palette.text,
46
+ size = UDim2.new(0, rem(50), 0, rem(4)),
47
+ textXAlignment = "Center",
48
+ }), React.createElement(SegmentedToggle, {
49
+ label = "Disabled Example",
50
+ options = { {
51
+ id = "DisabledFolder",
52
+ label = "Folder",
53
+ disabled = true,
54
+ }, {
55
+ id = "DisabledModel",
56
+ label = "Model",
57
+ } },
58
+ value = "DisabledModel",
59
+ onChange = function() end,
60
+ disabled = true,
61
+ size = "small",
62
+ })))
63
+ end
64
+ local story = {
65
+ react = React,
66
+ reactRoblox = ReactRoblox,
67
+ controls = controls,
68
+ story = function()
69
+ return React.createElement(SegmentedToggleStory)
70
+ end,
71
+ }
72
+ return story
@@ -0,0 +1,2 @@
1
+ export declare function ExampleTable(): JSX.Element;
2
+ //# sourceMappingURL=ExampleTable.d.ts.map
@@ -0,0 +1,46 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local Text = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Text
5
+ local Table = TS.import(script, script.Parent, "Table").Table
6
+ local TableCell = TS.import(script, script.Parent, "TableCell").TableCell
7
+ local TableHeader = TS.import(script, script.Parent, "TableHeader").TableHeader
8
+ local TableRow = TS.import(script, script.Parent, "TableRow").TableRow
9
+ local function ExampleTable()
10
+ return React.createElement(Table, {
11
+ size = UDim2.new(0.8, 0, 0, 200),
12
+ backgroundTransparency = 1,
13
+ position = UDim2.new(0.1, 0, 0.1, 0),
14
+ }, React.createElement(TableHeader, {
15
+ size = UDim2.new(1, 0, 0, 30),
16
+ }, React.createElement(TableCell, {
17
+ size = UDim2.new(0.2, 0, 1, 0),
18
+ }, React.createElement(Text, {
19
+ text = "ID",
20
+ })), React.createElement(TableCell, {
21
+ size = UDim2.new(0.4, 0, 1, 0),
22
+ }, React.createElement(Text, {
23
+ text = "Name",
24
+ })), React.createElement(TableCell, {
25
+ size = UDim2.new(0.4, 0, 1, 0),
26
+ }, React.createElement(Text, {
27
+ text = "Score",
28
+ }))), React.createElement(TableRow, {
29
+ size = UDim2.new(1, 0, 0, 30),
30
+ }, React.createElement(TableCell, {
31
+ size = UDim2.new(0.2, 0, 1, 0),
32
+ }, React.createElement(Text, {
33
+ text = "1",
34
+ })), React.createElement(TableCell, {
35
+ size = UDim2.new(0.4, 0, 1, 0),
36
+ }, React.createElement(Text, {
37
+ text = "Alice",
38
+ })), React.createElement(TableCell, {
39
+ size = UDim2.new(0.4, 0, 1, 0),
40
+ }, React.createElement(Text, {
41
+ text = "95",
42
+ }))))
43
+ end
44
+ return {
45
+ ExampleTable = ExampleTable,
46
+ }
@@ -0,0 +1,10 @@
1
+ import { PropsWithChildren } from "@rbxts/react";
2
+ interface TableProps extends PropsWithChildren {
3
+ readonly size: UDim2;
4
+ readonly position?: UDim2;
5
+ readonly layoutOrder?: number;
6
+ readonly backgroundTransparency?: number;
7
+ }
8
+ export declare function Table({ children, size, position, layoutOrder, backgroundTransparency }: TableProps): JSX.Element;
9
+ export type { TableProps };
10
+ //# sourceMappingURL=Table.d.ts.map
@@ -0,0 +1,26 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local VStack = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist).VStack
5
+ local function Table(_param)
6
+ local children = _param.children
7
+ local size = _param.size
8
+ local position = _param.position
9
+ local layoutOrder = _param.layoutOrder
10
+ if layoutOrder == nil then
11
+ layoutOrder = 0
12
+ end
13
+ local backgroundTransparency = _param.backgroundTransparency
14
+ if backgroundTransparency == nil then
15
+ backgroundTransparency = 1
16
+ end
17
+ return React.createElement(VStack, {
18
+ size = size,
19
+ position = position,
20
+ layoutOrder = layoutOrder,
21
+ backgroundTransparency = backgroundTransparency,
22
+ }, children)
23
+ end
24
+ return {
25
+ Table = Table,
26
+ }
@@ -0,0 +1,9 @@
1
+ import { PropsWithChildren } from "@rbxts/react";
2
+ interface TableCellProps extends PropsWithChildren {
3
+ readonly size: UDim2;
4
+ readonly layoutOrder?: number;
5
+ readonly backgroundTransparency?: number;
6
+ }
7
+ export declare function TableCell({ children, size, layoutOrder, backgroundTransparency }: TableCellProps): JSX.Element;
8
+ export type { TableCellProps };
9
+ //# sourceMappingURL=TableCell.d.ts.map
@@ -0,0 +1,26 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local Frame = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Frame
5
+ local useRem = TS.import(script, TS.getModule(script, "@rbxts-ui", "@rbxts-ui/rem")).useRem
6
+ local function TableCell(_param)
7
+ local children = _param.children
8
+ local size = _param.size
9
+ local layoutOrder = _param.layoutOrder
10
+ if layoutOrder == nil then
11
+ layoutOrder = 0
12
+ end
13
+ local backgroundTransparency = _param.backgroundTransparency
14
+ if backgroundTransparency == nil then
15
+ backgroundTransparency = 1
16
+ end
17
+ local rem = useRem()
18
+ return React.createElement(Frame, {
19
+ size = size,
20
+ layoutOrder = layoutOrder,
21
+ backgroundTransparency = backgroundTransparency,
22
+ }, children)
23
+ end
24
+ return {
25
+ TableCell = TableCell,
26
+ }
@@ -0,0 +1,9 @@
1
+ import { type HStackProps as StackProps } from "@rbxts-ui/layout";
2
+ interface TableFooterProps extends StackProps {
3
+ readonly size: UDim2;
4
+ readonly layoutOrder?: number;
5
+ readonly backgroundTransparency?: number;
6
+ }
7
+ export declare function TableFooter(props: TableFooterProps): JSX.Element;
8
+ export type { TableFooterProps };
9
+ //# sourceMappingURL=TableFooter.d.ts.map
@@ -0,0 +1,12 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local HStack = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist).HStack
5
+ local function TableFooter(props)
6
+ local _attributes = table.clone(props)
7
+ setmetatable(_attributes, nil)
8
+ return React.createElement(HStack, _attributes, props.children)
9
+ end
10
+ return {
11
+ TableFooter = TableFooter,
12
+ }
@@ -0,0 +1,9 @@
1
+ import { type HStackProps as StackProps } from "@rbxts-ui/layout";
2
+ interface TableHeaderProps extends StackProps {
3
+ readonly size: UDim2;
4
+ readonly layoutOrder?: number;
5
+ readonly backgroundTransparency?: number;
6
+ }
7
+ export declare function TableHeader(props: TableHeaderProps): JSX.Element;
8
+ export type { TableHeaderProps };
9
+ //# sourceMappingURL=TableHeader.d.ts.map
@@ -0,0 +1,12 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local HStack = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist).HStack
5
+ local function TableHeader(props)
6
+ local _attributes = table.clone(props)
7
+ setmetatable(_attributes, nil)
8
+ return React.createElement(HStack, _attributes, props.children)
9
+ end
10
+ return {
11
+ TableHeader = TableHeader,
12
+ }
@@ -0,0 +1,9 @@
1
+ import { PropsWithChildren } from "@rbxts/react";
2
+ interface TableRowProps extends PropsWithChildren {
3
+ readonly size: UDim2;
4
+ readonly layoutOrder?: number;
5
+ readonly backgroundTransparency?: number;
6
+ }
7
+ export declare function TableRow({ children, size, layoutOrder, backgroundTransparency }: TableRowProps): JSX.Element;
8
+ export type { TableRowProps };
9
+ //# sourceMappingURL=TableRow.d.ts.map
@@ -0,0 +1,24 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local HStack = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist).HStack
5
+ local function TableRow(_param)
6
+ local children = _param.children
7
+ local size = _param.size
8
+ local layoutOrder = _param.layoutOrder
9
+ if layoutOrder == nil then
10
+ layoutOrder = 0
11
+ end
12
+ local backgroundTransparency = _param.backgroundTransparency
13
+ if backgroundTransparency == nil then
14
+ backgroundTransparency = 1
15
+ end
16
+ return React.createElement(HStack, {
17
+ size = size,
18
+ layoutOrder = layoutOrder,
19
+ backgroundTransparency = backgroundTransparency,
20
+ }, children)
21
+ end
22
+ return {
23
+ TableRow = TableRow,
24
+ }
@@ -0,0 +1,14 @@
1
+ interface TooltipProps {
2
+ text: string;
3
+ visible: boolean;
4
+ position?: UDim2;
5
+ offsetX?: number;
6
+ offsetY?: number;
7
+ backgroundColor?: Color3;
8
+ textColor?: Color3;
9
+ maxWidth?: number;
10
+ anchorPoint?: Vector2;
11
+ }
12
+ export declare function Tooltip({ text, visible, position, backgroundColor, textColor, anchorPoint, maxWidth, offsetX, offsetY, }: TooltipProps): JSX.Element | undefined;
13
+ export type { TooltipProps };
14
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1,65 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local useRem = TS.import(script, TS.getModule(script, "@rbxts-ui", "@rbxts-ui/rem")).useRem
5
+ local Padding = TS.import(script, script.Parent.Parent, "layout", "Padding").Padding
6
+ local Text = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Text
7
+ local defaultTheme = TS.import(script, TS.getModule(script, "@rbxts-ui", "theme").dist).defaultTheme
8
+ local function Tooltip(_param)
9
+ local text = _param.text
10
+ local visible = _param.visible
11
+ local position = _param.position
12
+ local backgroundColor = _param.backgroundColor
13
+ if backgroundColor == nil then
14
+ backgroundColor = defaultTheme.palette.black
15
+ end
16
+ local textColor = _param.textColor
17
+ if textColor == nil then
18
+ textColor = defaultTheme.palette.white
19
+ end
20
+ local anchorPoint = _param.anchorPoint
21
+ if anchorPoint == nil then
22
+ anchorPoint = Vector2.new(0.5, 0.5)
23
+ end
24
+ local maxWidth = _param.maxWidth
25
+ if maxWidth == nil then
26
+ maxWidth = 200
27
+ end
28
+ local offsetX = _param.offsetX
29
+ if offsetX == nil then
30
+ offsetX = 0
31
+ end
32
+ local offsetY = _param.offsetY
33
+ if offsetY == nil then
34
+ offsetY = 0
35
+ end
36
+ local rem = useRem()
37
+ local theme = defaultTheme
38
+ if not visible or not position then
39
+ return nil
40
+ end
41
+ local cornerRadius = UDim.new(0, rem(2))
42
+ return React.createElement(Text, {
43
+ backgroundColor = backgroundColor,
44
+ backgroundTransparency = 0.2,
45
+ text = text,
46
+ textSize = rem(2),
47
+ lineHeight = 1.5,
48
+ textColor = textColor,
49
+ font = theme.fonts.inter.medium,
50
+ position = UDim2.new(0, position.X.Offset + offsetX, 0, position.Y.Offset + offsetY),
51
+ size = UDim2.new(0, rem(maxWidth), 0, 0),
52
+ textYAlignment = "Center",
53
+ textXAlignment = "Left",
54
+ automaticSize = Enum.AutomaticSize.Y,
55
+ textWrapped = true,
56
+ cornerRadius = cornerRadius,
57
+ anchorPoint = anchorPoint,
58
+ }, React.createElement(Padding, {
59
+ paddingX = rem(2),
60
+ paddingY = rem(1.5),
61
+ }))
62
+ end
63
+ return {
64
+ Tooltip = Tooltip,
65
+ }
@@ -0,0 +1,12 @@
1
+ export declare function useTooltip(text?: string): {
2
+ tooltipProps: {
3
+ text: string;
4
+ visible: boolean;
5
+ position: Vector2 | undefined;
6
+ };
7
+ tooltipEvents: {
8
+ onMouseEnter: () => void;
9
+ onMouseLeave: () => void;
10
+ };
11
+ };
12
+ //# sourceMappingURL=useTooltip.d.ts.map
@@ -0,0 +1,40 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local useState = TS.import(script, TS.getModule(script, "@rbxts", "react")).useState
4
+ local UserInputService = TS.import(script, TS.getModule(script, "@rbxts", "services")).UserInputService
5
+ local function useTooltip(text)
6
+ local visible, setVisible = useState(false)
7
+ local position, setPosition = useState(nil)
8
+ local showTooltip = function()
9
+ if not (text ~= "" and text) then
10
+ return nil
11
+ end
12
+ -- Get mouse position
13
+ local mouseLocation = UserInputService:GetMouseLocation()
14
+ setPosition(Vector2.new(mouseLocation.X, mouseLocation.Y))
15
+ setVisible(true)
16
+ end
17
+ local hideTooltip = function()
18
+ setVisible(false)
19
+ end
20
+ local _object = {}
21
+ local _left = "tooltipProps"
22
+ local _object_1 = {}
23
+ local _left_1 = "text"
24
+ local _condition = text
25
+ if _condition == nil then
26
+ _condition = ""
27
+ end
28
+ _object_1[_left_1] = _condition
29
+ _object_1.visible = visible
30
+ _object_1.position = position
31
+ _object[_left] = _object_1
32
+ _object.tooltipEvents = {
33
+ onMouseEnter = showTooltip,
34
+ onMouseLeave = hideTooltip,
35
+ }
36
+ return _object
37
+ end
38
+ return {
39
+ useTooltip = useTooltip,
40
+ }