@rbxts-ui/components 2.1.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.
- package/dist/DynamicWindow/DynamicWindow.d.ts +19 -0
- package/dist/DynamicWindow/DynamicWindow.luau +327 -0
- package/dist/DynamicWindow/DynamicWindow.utils.d.ts +13 -0
- package/dist/DynamicWindow/DynamicWindow.utils.luau +46 -0
- package/dist/DynamicWindow/ResizeCornerButton.d.ts +13 -0
- package/dist/DynamicWindow/ResizeCornerButton.luau +47 -0
- package/dist/DynamicWindow/TrafficLightButton.d.ts +8 -0
- package/dist/DynamicWindow/TrafficLightButton.luau +26 -0
- package/dist/{DropdownButton.d.ts → buttons/DropdownButton.d.ts} +1 -3
- package/dist/{DropdownButton.luau → buttons/DropdownButton.luau} +4 -9
- package/dist/{DropdownOptionButton.d.ts → buttons/DropdownOptionButton.d.ts} +1 -3
- package/dist/{DropdownOptionButton.luau → buttons/DropdownOptionButton.luau} +3 -7
- package/dist/{IconRoundButton.d.ts → buttons/IconRoundButton.d.ts} +1 -3
- package/dist/{IconRoundButton.luau → buttons/IconRoundButton.luau} +4 -8
- package/dist/{IconTileButton.d.ts → buttons/IconTileButton.d.ts} +1 -3
- package/dist/{IconTileButton.luau → buttons/IconTileButton.luau} +8 -11
- package/dist/{PrimaryButton.d.ts → buttons/PrimaryButton.d.ts} +1 -3
- package/dist/{PrimaryButton.luau → buttons/PrimaryButton.luau} +4 -9
- package/dist/{ReactiveButton.d.ts → buttons/ReactiveButton.d.ts} +1 -3
- package/dist/{ReactiveButton.luau → buttons/ReactiveButton.luau} +5 -10
- package/dist/{TextButton.d.ts → buttons/TextButton.d.ts} +1 -3
- package/dist/{TextButton.luau → buttons/TextButton.luau} +7 -11
- package/dist/{Checkmark.luau → display/Checkmark.luau} +1 -1
- package/dist/{Legend.luau → display/Legend.luau} +1 -1
- package/dist/{PillText.d.ts → display/PillText.d.ts} +0 -2
- package/dist/{PillText.luau → display/PillText.luau} +6 -10
- package/dist/error-handler/ErrorHandler.d.ts +3 -0
- package/dist/error-handler/ErrorHandler.luau +18 -0
- package/dist/error-handler/ErrorPage.d.ts +6 -0
- package/dist/error-handler/ErrorPage.luau +144 -0
- package/dist/error-handler/index.d.ts +3 -0
- package/dist/error-handler/init.luau +6 -0
- package/dist/{Checkbox.d.ts → form/Checkbox.d.ts} +1 -3
- package/dist/{Checkbox.luau → form/Checkbox.luau} +5 -10
- package/dist/{CheckboxRow.d.ts → form/CheckboxRow.d.ts} +1 -3
- package/dist/{CheckboxRow.luau → form/CheckboxRow.luau} +4 -8
- package/dist/{Dropdown.d.ts → form/Dropdown.d.ts} +0 -2
- package/dist/{Dropdown.luau → form/Dropdown.luau} +7 -12
- package/dist/form/DropdownRow.d.ts +18 -0
- package/dist/form/DropdownRow.luau +28 -0
- package/dist/form/FormRow.d.ts +9 -0
- package/dist/{FormRow.luau → form/FormRow.luau} +3 -6
- package/dist/form/InputRound.d.ts +18 -0
- package/dist/form/InputRound.luau +218 -0
- package/dist/form/InputRow.d.ts +13 -0
- package/dist/form/InputRow.luau +32 -0
- package/dist/{Radio.d.ts → form/Radio.d.ts} +1 -3
- package/dist/{Radio.luau → form/Radio.luau} +5 -10
- package/dist/{RadioRow.d.ts → form/RadioRow.d.ts} +1 -3
- package/dist/{RadioRow.luau → form/RadioRow.luau} +4 -8
- package/dist/form/RoundEmoji.d.ts +8 -0
- package/dist/form/RoundEmoji.luau +40 -0
- package/dist/form/TextBox.d.ts +24 -0
- package/dist/form/TextBox.luau +57 -0
- package/dist/{TextField.d.ts → form/TextField.d.ts} +1 -1
- package/dist/{TextField.luau → form/TextField.luau} +4 -2
- package/dist/form/validation.d.ts +13 -0
- package/dist/form/validation.luau +80 -0
- package/dist/{use-button-animation.d.ts → hooks/use-button-animation.d.ts} +1 -3
- package/dist/{use-button-animation.luau → hooks/use-button-animation.luau} +3 -6
- package/dist/index.d.ts +48 -32
- package/dist/init.luau +63 -34
- package/dist/{Accordion.d.ts → layout/Accordion.d.ts} +1 -3
- package/dist/{Accordion.luau → layout/Accordion.luau} +4 -8
- package/dist/{Divider.luau → layout/Divider.luau} +1 -1
- package/dist/{Section.d.ts → layout/Section.d.ts} +1 -3
- package/dist/{Section.luau → layout/Section.luau} +4 -7
- package/dist/{SegmentedToggle.d.ts → layout/SegmentedToggle.d.ts} +1 -3
- package/dist/{SegmentedToggle.luau → layout/SegmentedToggle.luau} +4 -7
- package/dist/layout/SegmentedToggle.story.d.ts +10 -0
- package/dist/layout/SegmentedToggle.story.luau +72 -0
- package/dist/table/ExampleTable.d.ts +2 -0
- package/dist/table/ExampleTable.luau +46 -0
- package/dist/table/Table.d.ts +10 -0
- package/dist/table/Table.luau +26 -0
- package/dist/table/TableCell.d.ts +9 -0
- package/dist/table/TableCell.luau +26 -0
- package/dist/table/TableFooter.d.ts +9 -0
- package/dist/table/TableFooter.luau +12 -0
- package/dist/table/TableHeader.d.ts +9 -0
- package/dist/table/TableHeader.luau +12 -0
- package/dist/table/TableRow.d.ts +9 -0
- package/dist/table/TableRow.luau +24 -0
- package/dist/tooltip/Tooltip.d.ts +14 -0
- package/dist/tooltip/Tooltip.luau +65 -0
- package/dist/tooltip/useTooltip.d.ts +12 -0
- package/dist/tooltip/useTooltip.luau +40 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{Outline.d.ts → utils/Outline.d.ts} +1 -3
- package/dist/{Outline.luau → utils/Outline.luau} +3 -6
- package/package.json +11 -9
- package/dist/FormRow.d.ts +0 -11
- package/dist/theme.d.ts +0 -41
- package/dist/theme.luau +0 -58
- /package/dist/{Button.d.ts → buttons/Button.d.ts} +0 -0
- /package/dist/{Button.luau → buttons/Button.luau} +0 -0
- /package/dist/{Checkmark.d.ts → display/Checkmark.d.ts} +0 -0
- /package/dist/{Legend.d.ts → display/Legend.d.ts} +0 -0
- /package/dist/{TimeAgo.d.ts → display/TimeAgo.d.ts} +0 -0
- /package/dist/{TimeAgo.luau → display/TimeAgo.luau} +0 -0
- /package/dist/{use-button-state.d.ts → hooks/use-button-state.d.ts} +0 -0
- /package/dist/{use-button-state.luau → hooks/use-button-state.luau} +0 -0
- /package/dist/{use-input-device.d.ts → hooks/use-input-device.d.ts} +0 -0
- /package/dist/{use-input-device.luau → hooks/use-input-device.luau} +0 -0
- /package/dist/{Divider.d.ts → layout/Divider.d.ts} +0 -0
- /package/dist/{Padding.d.ts → layout/Padding.d.ts} +0 -0
- /package/dist/{Padding.luau → layout/Padding.luau} +0 -0
- /package/dist/{ClickOutsideOverlay.d.ts → utils/ClickOutsideOverlay.d.ts} +0 -0
- /package/dist/{ClickOutsideOverlay.luau → utils/ClickOutsideOverlay.luau} +0 -0
- /package/dist/{DelayRender.d.ts → utils/DelayRender.d.ts} +0 -0
- /package/dist/{DelayRender.luau → utils/DelayRender.luau} +0 -0
- /package/dist/{ErrorBoundary.d.ts → utils/ErrorBoundary.d.ts} +0 -0
- /package/dist/{ErrorBoundary.luau → utils/ErrorBoundary.luau} +0 -0
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local React = _react
|
|
5
|
+
local forwardRef = _react.forwardRef
|
|
5
6
|
local useEffect = _react.useEffect
|
|
6
7
|
local useState = _react.useState
|
|
7
8
|
local _primitives = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist)
|
|
8
9
|
local fonts = _primitives.fonts
|
|
9
10
|
local Group = _primitives.Group
|
|
10
|
-
local
|
|
11
|
+
local TextField = forwardRef(function(props, ref)
|
|
11
12
|
local childRef, setChildRef = useState(nil)
|
|
12
13
|
useEffect(function()
|
|
13
14
|
local _condition = childRef
|
|
@@ -27,6 +28,7 @@ local function TextField(props)
|
|
|
27
28
|
end
|
|
28
29
|
end, { childRef, props.text })
|
|
29
30
|
local _attributes = {
|
|
31
|
+
ref = ref,
|
|
30
32
|
PlaceholderText = props.placeholderText,
|
|
31
33
|
PlaceholderColor3 = props.placeholderColor,
|
|
32
34
|
ClearTextOnFocus = props.clearTextOnFocus,
|
|
@@ -65,7 +67,7 @@ local function TextField(props)
|
|
|
65
67
|
}), React.createElement(Group, {
|
|
66
68
|
ref = setChildRef,
|
|
67
69
|
}))
|
|
68
|
-
end
|
|
70
|
+
end)
|
|
69
71
|
return {
|
|
70
72
|
TextField = TextField,
|
|
71
73
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function validateAngle(val: string): "Please enter a valid number" | "Angle must be greater than 0" | "Angle must be less than 180" | undefined;
|
|
2
|
+
export declare function validatePosNumber(val: string): "Please enter a valid number" | "Number must be greater than 0" | undefined;
|
|
3
|
+
export declare function validateNumber(val: string): "Please enter a valid number" | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Validates that a number is within specified bounds
|
|
6
|
+
* @param val - String value to validate
|
|
7
|
+
* @param min - Minimum allowed value
|
|
8
|
+
* @param max - Maximum allowed value
|
|
9
|
+
* @param customErrorMsg - Optional custom error message for bounds error
|
|
10
|
+
* @returns Error message or undefined if valid
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateNumberBounds(val: string, min: number, max: number, customErrorMsg?: string): string | undefined;
|
|
13
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function validateAngle(val)
|
|
3
|
+
local _condition = tonumber(val)
|
|
4
|
+
if _condition == nil then
|
|
5
|
+
_condition = 0
|
|
6
|
+
end
|
|
7
|
+
local angle = _condition
|
|
8
|
+
local _value = tonumber(val)
|
|
9
|
+
if not (_value ~= 0 and _value == _value and _value) then
|
|
10
|
+
return "Please enter a valid number"
|
|
11
|
+
end
|
|
12
|
+
if angle < 0 then
|
|
13
|
+
return "Angle must be greater than 0"
|
|
14
|
+
end
|
|
15
|
+
if angle > 180 then
|
|
16
|
+
return "Angle must be less than 180"
|
|
17
|
+
end
|
|
18
|
+
return nil
|
|
19
|
+
end
|
|
20
|
+
local function validatePosNumber(val)
|
|
21
|
+
local _condition = tonumber(val)
|
|
22
|
+
if _condition == nil then
|
|
23
|
+
_condition = 0
|
|
24
|
+
end
|
|
25
|
+
local number = _condition
|
|
26
|
+
local _value = tonumber(val)
|
|
27
|
+
if not (_value ~= 0 and _value == _value and _value) then
|
|
28
|
+
return "Please enter a valid number"
|
|
29
|
+
end
|
|
30
|
+
if number < 0 then
|
|
31
|
+
return "Number must be greater than 0"
|
|
32
|
+
end
|
|
33
|
+
return nil
|
|
34
|
+
end
|
|
35
|
+
local function validateNumber(val)
|
|
36
|
+
local valParsed = tonumber(val)
|
|
37
|
+
if not (valParsed ~= 0 and valParsed == valParsed and valParsed) and valParsed ~= 0 then
|
|
38
|
+
return "Please enter a valid number"
|
|
39
|
+
end
|
|
40
|
+
return nil
|
|
41
|
+
end
|
|
42
|
+
--[[
|
|
43
|
+
*
|
|
44
|
+
* Validates that a number is within specified bounds
|
|
45
|
+
* @param val - String value to validate
|
|
46
|
+
* @param min - Minimum allowed value
|
|
47
|
+
* @param max - Maximum allowed value
|
|
48
|
+
* @param customErrorMsg - Optional custom error message for bounds error
|
|
49
|
+
* @returns Error message or undefined if valid
|
|
50
|
+
|
|
51
|
+
]]
|
|
52
|
+
local function validateNumberBounds(val, min, max, customErrorMsg)
|
|
53
|
+
local _condition = tonumber(val)
|
|
54
|
+
if _condition == nil then
|
|
55
|
+
_condition = 0
|
|
56
|
+
end
|
|
57
|
+
local number = _condition
|
|
58
|
+
local _value = tonumber(val)
|
|
59
|
+
local _condition_1 = not (_value ~= 0 and _value == _value and _value)
|
|
60
|
+
if _condition_1 then
|
|
61
|
+
_condition_1 = number ~= 0
|
|
62
|
+
end
|
|
63
|
+
if _condition_1 then
|
|
64
|
+
return "Please enter a valid number"
|
|
65
|
+
end
|
|
66
|
+
if number < min or number > max then
|
|
67
|
+
local _condition_2 = customErrorMsg
|
|
68
|
+
if _condition_2 == nil then
|
|
69
|
+
_condition_2 = `Number must be between {min} and {max}`
|
|
70
|
+
end
|
|
71
|
+
return _condition_2
|
|
72
|
+
end
|
|
73
|
+
return nil
|
|
74
|
+
end
|
|
75
|
+
return {
|
|
76
|
+
validateAngle = validateAngle,
|
|
77
|
+
validatePosNumber = validatePosNumber,
|
|
78
|
+
validateNumber = validateNumber,
|
|
79
|
+
validateNumberBounds = validateNumberBounds,
|
|
80
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import { type Theme } from "./theme";
|
|
3
2
|
export interface ButtonAnimation {
|
|
4
3
|
/**
|
|
5
4
|
* An underdamped spring. `-1` is fully hovered, `0` is neutral, and `1` is
|
|
@@ -31,8 +30,7 @@ export interface ButtonAnimation {
|
|
|
31
30
|
*
|
|
32
31
|
* @param pressedState Whether the button is pressed.
|
|
33
32
|
* @param hoveredState Whether the button is hovered.
|
|
34
|
-
* @param theme Optional theme for spring configs.
|
|
35
33
|
* @returns A `ButtonAnimation` object.
|
|
36
34
|
*/
|
|
37
|
-
export declare function useButtonAnimation(pressedState: boolean, hoveredState: boolean
|
|
35
|
+
export declare function useButtonAnimation(pressedState: boolean, hoveredState: boolean): ButtonAnimation;
|
|
38
36
|
//# sourceMappingURL=use-button-animation.d.ts.map
|
|
@@ -4,7 +4,7 @@ local _pretty_react_hooks = TS.import(script, TS.getModule(script, "@rbxts", "pr
|
|
|
4
4
|
local useMotion = _pretty_react_hooks.useMotion
|
|
5
5
|
local useUpdateEffect = _pretty_react_hooks.useUpdateEffect
|
|
6
6
|
local useMemo = TS.import(script, TS.getModule(script, "@rbxts", "react")).useMemo
|
|
7
|
-
local defaultTheme = TS.import(script, script
|
|
7
|
+
local defaultTheme = TS.import(script, TS.getModule(script, "@rbxts-ui", "theme").dist).defaultTheme
|
|
8
8
|
--[[
|
|
9
9
|
*
|
|
10
10
|
* Returns a `ButtonAnimation` object that can be used to animate a button.
|
|
@@ -18,14 +18,11 @@ local defaultTheme = TS.import(script, script.Parent, "theme").defaultTheme
|
|
|
18
18
|
*
|
|
19
19
|
* @param pressedState Whether the button is pressed.
|
|
20
20
|
* @param hoveredState Whether the button is hovered.
|
|
21
|
-
* @param theme Optional theme for spring configs.
|
|
22
21
|
* @returns A `ButtonAnimation` object.
|
|
23
22
|
|
|
24
23
|
]]
|
|
25
|
-
local function useButtonAnimation(pressedState, hoveredState
|
|
26
|
-
|
|
27
|
-
theme = defaultTheme
|
|
28
|
-
end
|
|
24
|
+
local function useButtonAnimation(pressedState, hoveredState)
|
|
25
|
+
local theme = defaultTheme
|
|
29
26
|
local press, pressMotion = useMotion(0)
|
|
30
27
|
local hover, hoverMotion = useMotion(0)
|
|
31
28
|
local hoverExclusive, hoverExclusiveMotion = useMotion(0)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,49 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export { Button, type ButtonProps } from "./Button";
|
|
10
|
-
export { ReactiveButton, type ReactiveButtonProps } from "./ReactiveButton";
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export { IconRoundButton, type IconRoundButtonProps } from "./IconRoundButton";
|
|
20
|
-
export { IconTileButton, type IconTileButtonProps } from "./IconTileButton";
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
1
|
+
export { Checkmark, type CheckmarkProps } from "./display/Checkmark";
|
|
2
|
+
export { ErrorHandler, ErrorPage } from "./error-handler/index";
|
|
3
|
+
export { TextBox, type TextBoxProps } from "./form/TextBox";
|
|
4
|
+
export { TextField, type TextFieldProps } from "./form/TextField";
|
|
5
|
+
export { Divider, type DividerProps } from "./layout/Divider";
|
|
6
|
+
export { Padding, type PaddingProps } from "./layout/Padding";
|
|
7
|
+
export { DelayRender, type DelayRenderProps } from "./utils/DelayRender";
|
|
8
|
+
export { ErrorBoundary, type ErrorBoundaryProps } from "./utils/ErrorBoundary";
|
|
9
|
+
export { Button, type ButtonProps } from "./buttons/Button";
|
|
10
|
+
export { ReactiveButton, type ReactiveButtonProps } from "./buttons/ReactiveButton";
|
|
11
|
+
export { useButtonAnimation, type ButtonAnimation } from "./hooks/use-button-animation";
|
|
12
|
+
export { useButtonState, type ButtonEvents } from "./hooks/use-button-state";
|
|
13
|
+
export { useInputDevice, type InputDevice } from "./hooks/use-input-device";
|
|
14
|
+
export { useTooltip } from "./tooltip/useTooltip";
|
|
15
|
+
export { ClickOutsideLayer, ClickOutsideOverlay, type ClickOutsideLayerProps, type ClickOutsideOverlayProps, } from "./utils/ClickOutsideOverlay";
|
|
16
|
+
export { Outline, type OutlineProps } from "./utils/Outline";
|
|
17
|
+
export { Checkbox, type CheckboxProps } from "./form/Checkbox";
|
|
18
|
+
export { Radio, type RadioProps } from "./form/Radio";
|
|
19
|
+
export { IconRoundButton, type IconRoundButtonProps } from "./buttons/IconRoundButton";
|
|
20
|
+
export { IconTileButton, type IconTileButtonProps } from "./buttons/IconTileButton";
|
|
21
|
+
export { PrimaryButton, type PrimaryButtonProps } from "./buttons/PrimaryButton";
|
|
22
|
+
export { TextButton, TextButtonVariant, type TextButtonProps } from "./buttons/TextButton";
|
|
23
|
+
export { CheckboxRow, type CheckboxRowProps } from "./form/CheckboxRow";
|
|
24
|
+
export { DropdownRow, type DropdownRowProps } from "./form/DropdownRow";
|
|
25
|
+
export { FormRow, type FormRowProps } from "./form/FormRow";
|
|
26
|
+
export { InputRow, type InputRowProps } from "./form/InputRow";
|
|
27
|
+
export { RadioRow, type RadioRowProps } from "./form/RadioRow";
|
|
28
|
+
export { Accordion, type AccordionProps } from "./layout/Accordion";
|
|
29
|
+
export { Section, type SectionProps } from "./layout/Section";
|
|
30
|
+
export { SegmentedToggle, type SegmentedToggleOption, type SegmentedToggleProps } from "./layout/SegmentedToggle";
|
|
31
|
+
export { ExampleTable } from "./table/ExampleTable";
|
|
32
|
+
export { Table, type TableProps } from "./table/Table";
|
|
33
|
+
export { TableCell, type TableCellProps } from "./table/TableCell";
|
|
34
|
+
export { TableFooter, type TableFooterProps } from "./table/TableFooter";
|
|
35
|
+
export { TableHeader, type TableHeaderProps } from "./table/TableHeader";
|
|
36
|
+
export { TableRow, type TableRowProps } from "./table/TableRow";
|
|
37
|
+
export { DropdownButton, type DropdownButtonProps } from "./buttons/DropdownButton";
|
|
38
|
+
export { DropdownOptionButton, type DropdownOptionButtonProps } from "./buttons/DropdownOptionButton";
|
|
39
|
+
export { Dropdown, type DropdownOption, type DropdownProps } from "./form/Dropdown";
|
|
40
|
+
export { Legend, type LegendProps } from "./display/Legend";
|
|
41
|
+
export { PillText, type PillTextProps } from "./display/PillText";
|
|
42
|
+
export { TimeAgo, type TimeAgoProps } from "./display/TimeAgo";
|
|
43
|
+
export { Tooltip, type TooltipProps } from "./tooltip/Tooltip";
|
|
44
|
+
export { validateAngle, validateNumber, validateNumberBounds, validatePosNumber } from "./form/validation";
|
|
45
|
+
export { InputRound, type InputRoundProps } from "./form/InputRound";
|
|
46
|
+
export { RoundEmoji, type RoundEmojiProps } from "./form/RoundEmoji";
|
|
47
|
+
export { DynamicWindow, type ExtendableFrameProps } from "./DynamicWindow/DynamicWindow";
|
|
48
|
+
export { clampViewportPosition, getInputViewportPos, getMouseViewportPos, resolveWindowSpawnPosition, type Mode, type ResizeCorner, type WindowSpawnOptions, } from "./DynamicWindow/DynamicWindow.utils";
|
|
33
49
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/init.luau
CHANGED
|
@@ -1,47 +1,76 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local exports = {}
|
|
4
|
-
exports.
|
|
5
|
-
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.TextField = TS.import(script, script, "TextField").TextField
|
|
10
|
-
|
|
11
|
-
exports.
|
|
4
|
+
exports.Checkmark = TS.import(script, script, "display", "Checkmark").Checkmark
|
|
5
|
+
local _error_handler = TS.import(script, script, "error-handler")
|
|
6
|
+
exports.ErrorHandler = _error_handler.ErrorHandler
|
|
7
|
+
exports.ErrorPage = _error_handler.ErrorPage
|
|
8
|
+
exports.TextBox = TS.import(script, script, "form", "TextBox").TextBox
|
|
9
|
+
exports.TextField = TS.import(script, script, "form", "TextField").TextField
|
|
10
|
+
exports.Divider = TS.import(script, script, "layout", "Divider").Divider
|
|
11
|
+
exports.Padding = TS.import(script, script, "layout", "Padding").Padding
|
|
12
|
+
exports.DelayRender = TS.import(script, script, "utils", "DelayRender").DelayRender
|
|
13
|
+
exports.ErrorBoundary = TS.import(script, script, "utils", "ErrorBoundary").ErrorBoundary
|
|
12
14
|
-- Utilities
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
|
|
17
|
-
exports.
|
|
15
|
+
exports.Button = TS.import(script, script, "buttons", "Button").Button
|
|
16
|
+
exports.ReactiveButton = TS.import(script, script, "buttons", "ReactiveButton").ReactiveButton
|
|
17
|
+
exports.useButtonAnimation = TS.import(script, script, "hooks", "use-button-animation").useButtonAnimation
|
|
18
|
+
exports.useButtonState = TS.import(script, script, "hooks", "use-button-state").useButtonState
|
|
19
|
+
exports.useInputDevice = TS.import(script, script, "hooks", "use-input-device").useInputDevice
|
|
20
|
+
exports.useTooltip = TS.import(script, script, "tooltip", "useTooltip").useTooltip
|
|
21
|
+
local _ClickOutsideOverlay = TS.import(script, script, "utils", "ClickOutsideOverlay")
|
|
18
22
|
exports.ClickOutsideLayer = _ClickOutsideOverlay.ClickOutsideLayer
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.useButtonAnimation = TS.import(script, script, "use-button-animation").useButtonAnimation
|
|
23
|
+
exports.ClickOutsideOverlay = _ClickOutsideOverlay.ClickOutsideOverlay
|
|
24
|
+
exports.Outline = TS.import(script, script, "utils", "Outline").Outline
|
|
22
25
|
-- Form Inputs
|
|
23
|
-
exports.Checkbox = TS.import(script, script, "Checkbox").Checkbox
|
|
24
|
-
exports.Radio = TS.import(script, script, "Radio").Radio
|
|
26
|
+
exports.Checkbox = TS.import(script, script, "form", "Checkbox").Checkbox
|
|
27
|
+
exports.Radio = TS.import(script, script, "form", "Radio").Radio
|
|
25
28
|
-- Buttons
|
|
26
|
-
exports.
|
|
27
|
-
|
|
29
|
+
exports.IconRoundButton = TS.import(script, script, "buttons", "IconRoundButton").IconRoundButton
|
|
30
|
+
exports.IconTileButton = TS.import(script, script, "buttons", "IconTileButton").IconTileButton
|
|
31
|
+
exports.PrimaryButton = TS.import(script, script, "buttons", "PrimaryButton").PrimaryButton
|
|
32
|
+
local _TextButton = TS.import(script, script, "buttons", "TextButton")
|
|
28
33
|
exports.TextButton = _TextButton.TextButton
|
|
29
34
|
exports.TextButtonVariant = _TextButton.TextButtonVariant
|
|
30
|
-
exports.IconRoundButton = TS.import(script, script, "IconRoundButton").IconRoundButton
|
|
31
|
-
exports.IconTileButton = TS.import(script, script, "IconTileButton").IconTileButton
|
|
32
35
|
-- Form Layout
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.Accordion = TS.import(script, script, "Accordion").Accordion
|
|
36
|
+
exports.CheckboxRow = TS.import(script, script, "form", "CheckboxRow").CheckboxRow
|
|
37
|
+
exports.DropdownRow = TS.import(script, script, "form", "DropdownRow").DropdownRow
|
|
38
|
+
exports.FormRow = TS.import(script, script, "form", "FormRow").FormRow
|
|
39
|
+
exports.InputRow = TS.import(script, script, "form", "InputRow").InputRow
|
|
40
|
+
exports.RadioRow = TS.import(script, script, "form", "RadioRow").RadioRow
|
|
41
|
+
exports.Accordion = TS.import(script, script, "layout", "Accordion").Accordion
|
|
42
|
+
exports.Section = TS.import(script, script, "layout", "Section").Section
|
|
43
|
+
exports.SegmentedToggle = TS.import(script, script, "layout", "SegmentedToggle").SegmentedToggle
|
|
44
|
+
-- Table
|
|
45
|
+
exports.ExampleTable = TS.import(script, script, "table", "ExampleTable").ExampleTable
|
|
46
|
+
exports.Table = TS.import(script, script, "table", "Table").Table
|
|
47
|
+
exports.TableCell = TS.import(script, script, "table", "TableCell").TableCell
|
|
48
|
+
exports.TableFooter = TS.import(script, script, "table", "TableFooter").TableFooter
|
|
49
|
+
exports.TableHeader = TS.import(script, script, "table", "TableHeader").TableHeader
|
|
50
|
+
exports.TableRow = TS.import(script, script, "table", "TableRow").TableRow
|
|
39
51
|
-- Dropdown
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
52
|
+
exports.DropdownButton = TS.import(script, script, "buttons", "DropdownButton").DropdownButton
|
|
53
|
+
exports.DropdownOptionButton = TS.import(script, script, "buttons", "DropdownOptionButton").DropdownOptionButton
|
|
54
|
+
exports.Dropdown = TS.import(script, script, "form", "Dropdown").Dropdown
|
|
43
55
|
-- Display
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
56
|
+
exports.Legend = TS.import(script, script, "display", "Legend").Legend
|
|
57
|
+
exports.PillText = TS.import(script, script, "display", "PillText").PillText
|
|
58
|
+
exports.TimeAgo = TS.import(script, script, "display", "TimeAgo").TimeAgo
|
|
59
|
+
exports.Tooltip = TS.import(script, script, "tooltip", "Tooltip").Tooltip
|
|
60
|
+
-- Form Validation
|
|
61
|
+
local _validation = TS.import(script, script, "form", "validation")
|
|
62
|
+
exports.validateAngle = _validation.validateAngle
|
|
63
|
+
exports.validateNumber = _validation.validateNumber
|
|
64
|
+
exports.validateNumberBounds = _validation.validateNumberBounds
|
|
65
|
+
exports.validatePosNumber = _validation.validatePosNumber
|
|
66
|
+
-- Form Input Components
|
|
67
|
+
exports.InputRound = TS.import(script, script, "form", "InputRound").InputRound
|
|
68
|
+
exports.RoundEmoji = TS.import(script, script, "form", "RoundEmoji").RoundEmoji
|
|
69
|
+
-- DynamicWindow
|
|
70
|
+
exports.DynamicWindow = TS.import(script, script, "DynamicWindow", "DynamicWindow").DynamicWindow
|
|
71
|
+
local _DynamicWindow_utils = TS.import(script, script, "DynamicWindow", "DynamicWindow.utils")
|
|
72
|
+
exports.clampViewportPosition = _DynamicWindow_utils.clampViewportPosition
|
|
73
|
+
exports.getInputViewportPos = _DynamicWindow_utils.getInputViewportPos
|
|
74
|
+
exports.getMouseViewportPos = _DynamicWindow_utils.getMouseViewportPos
|
|
75
|
+
exports.resolveWindowSpawnPosition = _DynamicWindow_utils.resolveWindowSpawnPosition
|
|
47
76
|
return exports
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import { type Theme } from "./theme";
|
|
3
2
|
interface AccordionProps {
|
|
4
3
|
title: string;
|
|
5
4
|
children: React.ReactNode;
|
|
@@ -9,8 +8,7 @@ interface AccordionProps {
|
|
|
9
8
|
backgroundTransparency?: number;
|
|
10
9
|
cornerRadius?: number;
|
|
11
10
|
sortOrder?: Enum.SortOrder;
|
|
12
|
-
theme?: Theme;
|
|
13
11
|
}
|
|
14
|
-
export declare function Accordion({ title, children, backgroundColor, backgroundTransparency, cornerRadius, sortOrder, isExpanded, onExpandedChange,
|
|
12
|
+
export declare function Accordion({ title, children, backgroundColor, backgroundTransparency, cornerRadius, sortOrder, isExpanded, onExpandedChange, }: AccordionProps): JSX.Element;
|
|
15
13
|
export type { AccordionProps };
|
|
16
14
|
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local VStack = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist).VStack
|
|
4
4
|
local Text = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Text
|
|
5
|
-
local useRem = TS.import(script, TS.getModule(script, "@rbxts-ui", "rem")
|
|
5
|
+
local useRem = TS.import(script, TS.getModule(script, "@rbxts-ui", "@rbxts-ui/rem")).useRem
|
|
6
6
|
local useMotion = TS.import(script, TS.getModule(script, "@rbxts", "pretty-react-hooks").out).useMotion
|
|
7
7
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
8
8
|
local React = _react
|
|
9
9
|
local useEffect = _react.useEffect
|
|
10
10
|
local useState = _react.useState
|
|
11
|
-
local ReactiveButton = TS.import(script, script.Parent, "ReactiveButton").ReactiveButton
|
|
12
|
-
local defaultTheme = TS.import(script, script
|
|
11
|
+
local ReactiveButton = TS.import(script, script.Parent.Parent, "buttons", "ReactiveButton").ReactiveButton
|
|
12
|
+
local defaultTheme = TS.import(script, TS.getModule(script, "@rbxts-ui", "theme").dist).defaultTheme
|
|
13
13
|
local DEFAULT_EXPANDED = true
|
|
14
14
|
local function Accordion(_param)
|
|
15
15
|
local title = _param.title
|
|
@@ -29,10 +29,7 @@ local function Accordion(_param)
|
|
|
29
29
|
end
|
|
30
30
|
local isExpanded = _param.isExpanded
|
|
31
31
|
local onExpandedChange = _param.onExpandedChange
|
|
32
|
-
local theme =
|
|
33
|
-
if theme == nil then
|
|
34
|
-
theme = defaultTheme
|
|
35
|
-
end
|
|
32
|
+
local theme = defaultTheme
|
|
36
33
|
local rem = useRem()
|
|
37
34
|
local contentHeight, setContentHeight = useState(0)
|
|
38
35
|
-- Header visual height must match the header button height below (rem(5))
|
|
@@ -63,7 +60,6 @@ local function Accordion(_param)
|
|
|
63
60
|
onClick = handleToggle,
|
|
64
61
|
backgroundTransparency = 1,
|
|
65
62
|
size = UDim2.new(1, 0, 0, rem(5)),
|
|
66
|
-
theme = theme,
|
|
67
63
|
}, React.createElement(Text, {
|
|
68
64
|
text = title,
|
|
69
65
|
textSize = textSize,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
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", "rem")
|
|
5
|
+
local useRem = TS.import(script, TS.getModule(script, "@rbxts-ui", "@rbxts-ui/rem")).useRem
|
|
6
6
|
local DEFAULT_COLOR = Color3.fromRGB(255, 255, 255)
|
|
7
7
|
local function Divider(_param)
|
|
8
8
|
local orientation = _param.orientation
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import { type Theme } from "./theme";
|
|
3
2
|
interface SectionProps {
|
|
4
3
|
title: string;
|
|
5
4
|
children: React.ReactNode;
|
|
6
5
|
cornerRadius?: number;
|
|
7
6
|
sortOrder?: Enum.SortOrder;
|
|
8
|
-
theme?: Theme;
|
|
9
7
|
}
|
|
10
|
-
export declare function Section({ title, children, cornerRadius, sortOrder,
|
|
8
|
+
export declare function Section({ title, children, cornerRadius, sortOrder, }: SectionProps): JSX.Element;
|
|
11
9
|
export type { SectionProps };
|
|
12
10
|
//# sourceMappingURL=Section.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
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", "rem").dist).useRem
|
|
5
3
|
local VStack = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist).VStack
|
|
6
4
|
local Text = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Text
|
|
7
|
-
local
|
|
5
|
+
local useRem = TS.import(script, TS.getModule(script, "@rbxts-ui", "@rbxts-ui/rem")).useRem
|
|
6
|
+
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
7
|
+
local defaultTheme = TS.import(script, TS.getModule(script, "@rbxts-ui", "theme").dist).defaultTheme
|
|
8
8
|
local function Section(_param)
|
|
9
9
|
local title = _param.title
|
|
10
10
|
local children = _param.children
|
|
@@ -16,10 +16,7 @@ local function Section(_param)
|
|
|
16
16
|
if sortOrder == nil then
|
|
17
17
|
sortOrder = Enum.SortOrder.Name
|
|
18
18
|
end
|
|
19
|
-
local theme =
|
|
20
|
-
if theme == nil then
|
|
21
|
-
theme = defaultTheme
|
|
22
|
-
end
|
|
19
|
+
local theme = defaultTheme
|
|
23
20
|
local rem = useRem()
|
|
24
21
|
local textSize = rem(3.5)
|
|
25
22
|
return React.createElement(VStack, {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import { type Theme } from "./theme";
|
|
3
2
|
export interface SegmentedToggleOption<T extends string> {
|
|
4
3
|
id: T;
|
|
5
4
|
label: string;
|
|
@@ -13,7 +12,6 @@ export interface SegmentedToggleProps<T extends string> {
|
|
|
13
12
|
size?: "default" | "small";
|
|
14
13
|
label?: string;
|
|
15
14
|
children?: React.ReactNode;
|
|
16
|
-
theme?: Theme;
|
|
17
15
|
}
|
|
18
|
-
export declare function SegmentedToggle<T extends string>({ options, value, onChange, disabled, size, label, children,
|
|
16
|
+
export declare function SegmentedToggle<T extends string>({ options, value, onChange, disabled, size, label, children, }: SegmentedToggleProps<T>): JSX.Element;
|
|
19
17
|
//# sourceMappingURL=SegmentedToggle.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
-
local useRem = TS.import(script, TS.getModule(script, "@rbxts-ui", "rem")
|
|
5
|
-
local Button = TS.import(script, script.Parent, "Button").Button
|
|
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
6
|
local Frame = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Frame
|
|
7
7
|
local Text = TS.import(script, TS.getModule(script, "@rbxts-ui", "primitives").dist).Text
|
|
8
8
|
local _layout = TS.import(script, TS.getModule(script, "@rbxts-ui", "layout").dist)
|
|
9
9
|
local HStack = _layout.HStack
|
|
10
10
|
local VStack = _layout.VStack
|
|
11
|
-
local defaultTheme = TS.import(script, script
|
|
11
|
+
local defaultTheme = TS.import(script, TS.getModule(script, "@rbxts-ui", "theme").dist).defaultTheme
|
|
12
12
|
local function SegmentedToggle(_param)
|
|
13
13
|
local options = _param.options
|
|
14
14
|
local value = _param.value
|
|
@@ -23,10 +23,7 @@ local function SegmentedToggle(_param)
|
|
|
23
23
|
end
|
|
24
24
|
local label = _param.label
|
|
25
25
|
local children = _param.children
|
|
26
|
-
local theme =
|
|
27
|
-
if theme == nil then
|
|
28
|
-
theme = defaultTheme
|
|
29
|
-
end
|
|
26
|
+
local theme = defaultTheme
|
|
30
27
|
local rem = useRem()
|
|
31
28
|
local count = #options
|
|
32
29
|
if count == 0 then
|
|
@@ -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
|