@rbxts/uiblox 0.2.0-alpha.0 → 0.2.0-alpha.10
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/README.md +51 -34
- package/out/theme/constants/NumberConstants.d.ts +4 -2
- package/out/theme/constants/NumberConstants.luau +6 -4
- package/out/theme/context/ThemeProvider.d.ts +1 -1
- package/out/theme/hooks/useTheme.d.ts +1 -1
- package/out/theme/interfaces/palette/colorTokens/ColorTokens.d.ts +1 -1
- package/out/theme/interfaces/spacing/Shape.d.ts +3 -0
- package/out/theme/interfaces/typography/FontSizes.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizes.luau +15 -8
- package/out/theme/interfaces/typography/ThemeTypography.d.ts +3 -0
- package/out/theme/interfaces/typography/Variants.d.ts +14 -15
- package/out/theme/interfaces/typography/Variants.luau +68 -18
- package/out/theme/styles/utilities/index.d.ts +1 -1
- package/out/theme/styles/utilities/init.luau +3 -1
- package/out/theme/styles/utilities/resolveStyle.d.ts +32 -0
- package/out/theme/styles/utilities/resolveStyle.luau +66 -0
- package/out/theme/themes/DarkTheme.luau +4 -0
- package/out/theme/themes/LightTheme.luau +4 -0
- package/out/theme/types/types.d.ts +1 -1
- package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.luau +5 -0
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +4 -2
- package/out/ui/packages/alert/components/Alert.d.ts +10 -0
- package/out/ui/packages/alert/components/Alert.luau +98 -0
- package/out/ui/packages/alert/components/Alert.styles.d.ts +6 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +93 -0
- package/out/ui/packages/alert/components/alertTone.d.ts +2 -0
- package/out/ui/packages/alert/components/alertTone.luau +7 -0
- package/out/ui/packages/alert/index.d.ts +3 -0
- package/out/ui/packages/alert/init.luau +6 -0
- package/out/ui/packages/appBar/components/AppBar.d.ts +10 -0
- package/out/ui/packages/appBar/components/AppBar.luau +77 -0
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +6 -0
- package/out/ui/packages/appBar/components/AppBar.styles.luau +66 -0
- package/out/ui/packages/appBar/index.d.ts +3 -0
- package/out/ui/packages/appBar/init.luau +5 -0
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +10 -0
- package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
- package/out/ui/packages/backdrop/components/Backdrop.luau +58 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
- package/out/ui/packages/backdrop/index.d.ts +2 -0
- package/out/ui/packages/backdrop/init.luau +5 -0
- package/out/ui/packages/badge/components/Badge.styles.luau +6 -3
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +10 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +86 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +2 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +58 -0
- package/out/ui/packages/bottomNavigation/index.d.ts +2 -0
- package/out/ui/packages/bottomNavigation/init.luau +5 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +58 -24
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
- package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/init.luau +3 -0
- package/out/ui/packages/brickColorPicker/components/brickColorCatalog.luau +1 -1
- package/out/ui/packages/button/components/Button.luau +9 -5
- package/out/ui/packages/button/components/Button.styles.luau +0 -6
- package/out/ui/packages/button/components/buttonLook.d.ts +2 -2
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +3 -1
- package/out/ui/packages/chip/components/Chip.luau +39 -2
- package/out/ui/packages/chip/components/Chip.styles.d.ts +3 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +40 -6
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
- package/out/ui/packages/dialog/components/Dialog.d.ts +1 -1
- package/out/ui/packages/dialog/components/Dialog.luau +27 -18
- package/out/ui/packages/fab/components/Fab.d.ts +14 -0
- package/out/ui/packages/fab/components/Fab.luau +160 -0
- package/out/ui/packages/fab/components/Fab.styles.d.ts +8 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +65 -0
- package/out/ui/packages/fab/components/fabSize.d.ts +4 -0
- package/out/ui/packages/fab/components/fabSize.luau +33 -0
- package/out/ui/packages/fab/index.d.ts +3 -0
- package/out/ui/packages/fab/init.luau +9 -0
- package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
- package/out/ui/packages/formText/components/FormHelperText.luau +44 -0
- package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
- package/out/ui/packages/formText/components/FormLabel.luau +46 -0
- package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
- package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
- package/out/ui/packages/formText/index.d.ts +4 -0
- package/out/ui/packages/formText/init.luau +6 -0
- package/out/ui/packages/icon/components/Icon.styles.luau +4 -4
- package/out/ui/packages/iconButton/components/IconButton.luau +7 -2
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +7 -4
- package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
- package/out/ui/packages/imageList/components/ImageList.luau +84 -0
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +54 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +3 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +24 -0
- package/out/ui/packages/imageList/index.d.ts +2 -0
- package/out/ui/packages/imageList/init.luau +5 -0
- package/out/ui/packages/index.d.ts +11 -0
- package/out/ui/packages/init.luau +33 -0
- package/out/ui/packages/input/components/Input.d.ts +2 -0
- package/out/ui/packages/input/components/Input.luau +64 -27
- package/out/ui/packages/input/components/Input.styles.luau +6 -2
- package/out/ui/packages/layout/components/Box.d.ts +11 -0
- package/out/ui/packages/layout/components/Box.luau +49 -0
- package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
- package/out/ui/packages/layout/components/Box.styles.luau +34 -0
- package/out/ui/packages/layout/components/Container.d.ts +10 -0
- package/out/ui/packages/layout/components/Container.luau +54 -0
- package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
- package/out/ui/packages/layout/components/Container.styles.luau +41 -0
- package/out/ui/packages/layout/components/Grid.d.ts +1 -1
- package/out/ui/packages/layout/components/Stack.d.ts +12 -0
- package/out/ui/packages/layout/components/Stack.luau +49 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +72 -0
- package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
- package/out/ui/packages/layout/components/boxPad.luau +59 -0
- package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
- package/out/ui/packages/layout/components/containerWidth.luau +17 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +8 -0
- package/out/ui/packages/layout/components/stackAlign.luau +29 -0
- package/out/ui/packages/layout/index.d.ts +10 -0
- package/out/ui/packages/layout/init.luau +4 -0
- package/out/ui/packages/link/components/Link.d.ts +11 -0
- package/out/ui/packages/link/components/Link.luau +83 -0
- package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
- package/out/ui/packages/link/components/Link.styles.luau +59 -0
- package/out/ui/packages/link/index.d.ts +3 -0
- package/out/ui/packages/link/init.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +10 -5
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +2 -0
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
- package/out/ui/packages/menu/components/Menu.d.ts +3 -0
- package/out/ui/packages/menu/components/Menu.luau +48 -23
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/modal/components/Modal.d.ts +1 -1
- package/out/ui/packages/modal/components/Modal.luau +55 -37
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +1 -0
- package/out/ui/packages/motion/unit.d.ts +5 -0
- package/out/ui/packages/motion/unit.luau +23 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +2 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +4 -0
- package/out/ui/packages/pagination/components/Pagination.d.ts +2 -0
- package/out/ui/packages/pagination/components/Pagination.luau +37 -21
- package/out/ui/packages/pagination/components/Pagination.styles.luau +9 -0
- package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
- package/out/ui/packages/pagination/components/pageRange.luau +91 -8
- package/out/ui/packages/pagination/index.d.ts +1 -0
- package/out/ui/packages/pagination/init.luau +1 -0
- package/out/ui/packages/paper/components/Paper.d.ts +1 -0
- package/out/ui/packages/paper/components/Paper.luau +8 -3
- package/out/ui/packages/popup/index.d.ts +1 -0
- package/out/ui/packages/popup/init.luau +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +4 -2
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
- package/out/ui/packages/rating/components/Rating.d.ts +9 -0
- package/out/ui/packages/rating/components/Rating.luau +95 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +4 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +39 -0
- package/out/ui/packages/rating/index.d.ts +2 -0
- package/out/ui/packages/rating/init.luau +5 -0
- package/out/ui/packages/select/components/Select.d.ts +6 -0
- package/out/ui/packages/select/components/Select.luau +74 -27
- package/out/ui/packages/select/components/Select.styles.luau +3 -3
- package/out/ui/packages/sidebar/components/Sidebar.styles.luau +2 -2
- package/out/ui/packages/skeleton/components/Skeleton.luau +3 -2
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
- package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
- package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
- package/out/ui/packages/slider/components/Slider.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.luau +24 -1
- package/out/ui/packages/slider/components/Slider.styles.luau +8 -0
- package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
- package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +17 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +92 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +2 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +26 -0
- package/out/ui/packages/speedDial/index.d.ts +2 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +2 -0
- package/out/ui/packages/stateMatrix.luau +1843 -1335
- package/out/ui/packages/switch/components/Switch.styles.luau +1 -1
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/tabs/components/Tabs.d.ts +2 -0
- package/out/ui/packages/tabs/components/Tabs.luau +10 -3
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +4 -1
- package/out/ui/packages/tabs/components/Tabs.styles.luau +24 -10
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
- package/out/ui/packages/tabs/index.d.ts +1 -0
- package/out/ui/packages/tabs/init.luau +1 -0
- package/out/ui/packages/toast/components/Toast.styles.luau +1 -1
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +17 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +126 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +5 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +58 -0
- package/out/ui/packages/toggleButton/index.d.ts +2 -0
- package/out/ui/packages/toggleButton/init.luau +7 -0
- package/out/ui/packages/treeView/components/TreeView.luau +3 -3
- package/out/ui/packages/treeView/components/TreeView.styles.luau +3 -3
- package/out/ui/packages/typography/components/Typography.styles.luau +4 -5
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +6 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +32 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
- package/out/ui/packages/virtualList/index.d.ts +2 -0
- package/out/ui/packages/virtualList/init.luau +1 -0
- package/package.json +2 -2
- package/out/theme/styles/utilities/interaction.d.ts +0 -13
- package/out/theme/styles/utilities/interaction.luau +0 -68
|
@@ -8,6 +8,7 @@ local function Paper(props)
|
|
|
8
8
|
if elevation == nil then
|
|
9
9
|
elevation = "flat"
|
|
10
10
|
end
|
|
11
|
+
local square = _binding.square
|
|
11
12
|
local children = _binding.children
|
|
12
13
|
local styles = usePaperStyles({
|
|
13
14
|
elevation = elevation,
|
|
@@ -21,9 +22,13 @@ local function Paper(props)
|
|
|
21
22
|
local _attributes_1 = table.clone(styles.padding)
|
|
22
23
|
setmetatable(_attributes_1, nil)
|
|
23
24
|
local _exp = React.createElement("uipadding", _attributes_1)
|
|
24
|
-
local
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
local _condition = square ~= true
|
|
26
|
+
if _condition then
|
|
27
|
+
local _attributes_2 = table.clone(styles.corner)
|
|
28
|
+
setmetatable(_attributes_2, nil)
|
|
29
|
+
_condition = React.createElement("uicorner", _attributes_2)
|
|
30
|
+
end
|
|
31
|
+
return React.createElement("frame", _attributes, _exp, _condition, children)
|
|
27
32
|
end
|
|
28
33
|
local default = Paper
|
|
29
34
|
return {
|
|
@@ -2,3 +2,4 @@ export { default as Popup } from "./components/Popup";
|
|
|
2
2
|
export { PopupProps } from "./components/Popup";
|
|
3
3
|
export { default as Portal } from "./components/Portal";
|
|
4
4
|
export { PortalProps } from "./components/Portal";
|
|
5
|
+
export { portalTarget } from "./components/portalTarget";
|
|
@@ -3,4 +3,5 @@ local TS = _G[script]
|
|
|
3
3
|
local exports = {}
|
|
4
4
|
exports.Popup = TS.import(script, script, "components", "Popup").default
|
|
5
5
|
exports.Portal = TS.import(script, script, "components", "Portal").default
|
|
6
|
+
exports.portalTarget = TS.import(script, script, "components", "portalTarget").portalTarget
|
|
6
7
|
return exports
|
|
@@ -11,6 +11,7 @@ export interface RadioGroupProps<T> {
|
|
|
11
11
|
onChange: (value: T) => void;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
size?: ControlSize;
|
|
14
|
+
row?: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare function RadioGroup<T>(props: CustomizedProps<Frame, RadioGroupProps<T>>): JSX.Element;
|
|
16
17
|
export default RadioGroup;
|
|
@@ -10,17 +10,19 @@ local function RadioGroup(props)
|
|
|
10
10
|
local onChange = _binding.onChange
|
|
11
11
|
local disabled = _binding.disabled
|
|
12
12
|
local size = _binding.size
|
|
13
|
+
local row = _binding.row
|
|
13
14
|
local className = _binding.className
|
|
14
15
|
local sx = _binding.sx
|
|
15
16
|
local id = _binding.id
|
|
16
17
|
local ref = _binding.ref
|
|
17
18
|
local _binding_1 = useRadioGroupStyles({
|
|
18
19
|
size = size,
|
|
20
|
+
row = row,
|
|
19
21
|
})
|
|
20
22
|
local root = _binding_1.root
|
|
21
23
|
local list = _binding_1.list
|
|
22
24
|
local option = _binding_1.option
|
|
23
|
-
local
|
|
25
|
+
local optionRow = _binding_1.optionRow
|
|
24
26
|
local ring = _binding_1.ring
|
|
25
27
|
local dot = _binding_1.dot
|
|
26
28
|
local stroke = _binding_1.stroke
|
|
@@ -70,7 +72,7 @@ local function RadioGroup(props)
|
|
|
70
72
|
end
|
|
71
73
|
end,
|
|
72
74
|
}
|
|
73
|
-
local _attributes_3 = table.clone(
|
|
75
|
+
local _attributes_3 = table.clone(optionRow)
|
|
74
76
|
setmetatable(_attributes_3, nil)
|
|
75
77
|
local _exp_1 = React.createElement("uilistlayout", _attributes_3)
|
|
76
78
|
local _attributes_4 = table.clone(ring)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ControlSize } from "../../../../theme/index";
|
|
2
2
|
export interface RadioGroupStyleProps {
|
|
3
3
|
size?: ControlSize;
|
|
4
|
+
row?: boolean;
|
|
4
5
|
}
|
|
5
6
|
declare const useRadioGroupStyles: (props: RadioGroupStyleProps) => import("../../../../theme/index").ClassNameMap<string>;
|
|
6
7
|
export default useRadioGroupStyles;
|
|
@@ -6,6 +6,7 @@ local createStyles = _theme.createStyles
|
|
|
6
6
|
local componentStyles = _theme.componentStyles
|
|
7
7
|
local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param)
|
|
8
8
|
local size = _param.size
|
|
9
|
+
local row = _param.row
|
|
9
10
|
local metrics = controlMetrics(theme.density, size)
|
|
10
11
|
return createStyles({
|
|
11
12
|
root = {
|
|
@@ -15,8 +16,10 @@ local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param
|
|
|
15
16
|
BorderSizePixel = 0,
|
|
16
17
|
},
|
|
17
18
|
list = {
|
|
19
|
+
FillDirection = if row == true then Enum.FillDirection.Horizontal else Enum.FillDirection.Vertical,
|
|
18
20
|
Padding = UDim.new(0, theme.padding.default),
|
|
19
21
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
22
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
20
23
|
},
|
|
21
24
|
option = {
|
|
22
25
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -25,7 +28,7 @@ local useRadioGroupStyles = componentStyles("RadioGroup", function(theme, _param
|
|
|
25
28
|
BorderSizePixel = 0,
|
|
26
29
|
Text = "",
|
|
27
30
|
},
|
|
28
|
-
|
|
31
|
+
optionRow = {
|
|
29
32
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
30
33
|
Padding = UDim.new(0, theme.padding.default),
|
|
31
34
|
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
export interface RatingProps {
|
|
3
|
+
value: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onChange: (value: number) => void;
|
|
7
|
+
}
|
|
8
|
+
declare function Rating(props: CustomizedProps<Frame, RatingProps>): JSX.Element;
|
|
9
|
+
export default Rating;
|
|
@@ -0,0 +1,95 @@
|
|
|
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 Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
5
|
+
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
6
|
+
local useRatingStyles = TS.import(script, script.Parent, "Rating.styles").default
|
|
7
|
+
local function Rating(props)
|
|
8
|
+
local _binding = props
|
|
9
|
+
local value = _binding.value
|
|
10
|
+
local max = _binding.max
|
|
11
|
+
if max == nil then
|
|
12
|
+
max = 5
|
|
13
|
+
end
|
|
14
|
+
local disabled = _binding.disabled
|
|
15
|
+
local onChange = _binding.onChange
|
|
16
|
+
local className = _binding.className
|
|
17
|
+
local sx = _binding.sx
|
|
18
|
+
local id = _binding.id
|
|
19
|
+
local ref = _binding.ref
|
|
20
|
+
local styles = useRatingStyles({
|
|
21
|
+
disabled = disabled,
|
|
22
|
+
})
|
|
23
|
+
local active = canActivate(disabled)
|
|
24
|
+
local stars = {}
|
|
25
|
+
do
|
|
26
|
+
local i = 1
|
|
27
|
+
local _shouldIncrement = false
|
|
28
|
+
while true do
|
|
29
|
+
if _shouldIncrement then
|
|
30
|
+
i += 1
|
|
31
|
+
else
|
|
32
|
+
_shouldIncrement = true
|
|
33
|
+
end
|
|
34
|
+
if not (i <= max) then
|
|
35
|
+
break
|
|
36
|
+
end
|
|
37
|
+
local _i = i
|
|
38
|
+
table.insert(stars, _i)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
local _attributes = {}
|
|
42
|
+
local _condition = id
|
|
43
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
44
|
+
_condition = "Rating"
|
|
45
|
+
end
|
|
46
|
+
_attributes.key = _condition
|
|
47
|
+
_attributes.ref = ref
|
|
48
|
+
for _k, _v in styles.root do
|
|
49
|
+
_attributes[_k] = _v
|
|
50
|
+
end
|
|
51
|
+
if className then
|
|
52
|
+
for _k, _v in className do
|
|
53
|
+
_attributes[_k] = _v
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
if sx then
|
|
57
|
+
for _k, _v in sx do
|
|
58
|
+
_attributes[_k] = _v
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
local _attributes_1 = table.clone(styles.list)
|
|
62
|
+
setmetatable(_attributes_1, nil)
|
|
63
|
+
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
64
|
+
-- ▼ ReadonlyArray.map ▼
|
|
65
|
+
local _newValue = table.create(#stars)
|
|
66
|
+
local _callback = function(n)
|
|
67
|
+
local _attributes_2 = {
|
|
68
|
+
key = `Star-{n}`,
|
|
69
|
+
}
|
|
70
|
+
for _k, _v in styles.star do
|
|
71
|
+
_attributes_2[_k] = _v
|
|
72
|
+
end
|
|
73
|
+
_attributes_2.Image = tostring(if n <= value then Icons.StarFilled else Icons.Star)
|
|
74
|
+
_attributes_2.LayoutOrder = n
|
|
75
|
+
_attributes_2.Active = active
|
|
76
|
+
_attributes_2.Selectable = active
|
|
77
|
+
_attributes_2.Event = {
|
|
78
|
+
Activated = function()
|
|
79
|
+
if active then
|
|
80
|
+
onChange(if n == value then 0 else n)
|
|
81
|
+
end
|
|
82
|
+
end,
|
|
83
|
+
}
|
|
84
|
+
return React.createElement("imagebutton", _attributes_2)
|
|
85
|
+
end
|
|
86
|
+
for _k, _v in stars do
|
|
87
|
+
_newValue[_k] = _callback(_v, _k - 1, stars)
|
|
88
|
+
end
|
|
89
|
+
-- ▲ ReadonlyArray.map ▲
|
|
90
|
+
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
91
|
+
end
|
|
92
|
+
local default = Rating
|
|
93
|
+
return {
|
|
94
|
+
default = default,
|
|
95
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local componentStyles = _theme.componentStyles
|
|
5
|
+
local createStyles = _theme.createStyles
|
|
6
|
+
local useRatingStyles = componentStyles("Rating", function(theme, _param)
|
|
7
|
+
local disabled = _param.disabled
|
|
8
|
+
if disabled == nil then
|
|
9
|
+
disabled = false
|
|
10
|
+
end
|
|
11
|
+
return createStyles({
|
|
12
|
+
root = {
|
|
13
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
14
|
+
Size = UDim2.fromScale(0, 0),
|
|
15
|
+
BackgroundTransparency = 1,
|
|
16
|
+
BorderSizePixel = 0,
|
|
17
|
+
},
|
|
18
|
+
list = {
|
|
19
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
20
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Left,
|
|
21
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
22
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
23
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
24
|
+
},
|
|
25
|
+
star = {
|
|
26
|
+
Size = UDim2.fromOffset(theme.spacing.calc(3), theme.spacing.calc(3)),
|
|
27
|
+
BackgroundTransparency = 1,
|
|
28
|
+
BorderSizePixel = 0,
|
|
29
|
+
AutoButtonColor = false,
|
|
30
|
+
Active = not disabled,
|
|
31
|
+
Selectable = not disabled,
|
|
32
|
+
ImageColor3 = if disabled then theme.palette.text.disabled else theme.palette.primary.main,
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
end)
|
|
36
|
+
local default = useRatingStyles
|
|
37
|
+
return {
|
|
38
|
+
default = default,
|
|
39
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
1
2
|
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
3
|
import { ChoiceOption } from "../../radioGroup/index";
|
|
3
4
|
export interface SelectProps<T> {
|
|
@@ -6,8 +7,13 @@ export interface SelectProps<T> {
|
|
|
6
7
|
options: ChoiceOption<T>[];
|
|
7
8
|
onChange: (value: T) => void;
|
|
8
9
|
disabled?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
9
11
|
placeholder?: string;
|
|
10
12
|
searchable?: boolean;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
defaultQuery?: string;
|
|
15
|
+
emptyText?: string;
|
|
16
|
+
empty?: React.Element;
|
|
11
17
|
reducedMotion?: boolean;
|
|
12
18
|
size?: ControlSize;
|
|
13
19
|
}
|
|
@@ -14,11 +14,15 @@ local controlMetrics = _theme.controlMetrics
|
|
|
14
14
|
local cx = _theme.cx
|
|
15
15
|
local useTheme = _theme.useTheme
|
|
16
16
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
17
|
+
local spinnerPixels = TS.import(script, script.Parent.Parent.Parent, "button", "components", "buttonLook").spinnerPixels
|
|
18
|
+
local CircularProgress = TS.import(script, script.Parent.Parent.Parent, "circularProgress").CircularProgress
|
|
17
19
|
local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
|
|
18
20
|
local playProperty = TS.import(script, script.Parent.Parent.Parent, "motion").playProperty
|
|
19
21
|
local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
|
|
20
22
|
local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
|
|
21
|
-
local
|
|
23
|
+
local _virtualList = TS.import(script, script.Parent.Parent.Parent, "virtualList")
|
|
24
|
+
local EmptyListHint = _virtualList.EmptyListHint
|
|
25
|
+
local VirtualList = _virtualList.VirtualList
|
|
22
26
|
local useSelectStyles = TS.import(script, script.Parent, "Select.styles").default
|
|
23
27
|
local optionLabel = TS.import(script, script.Parent, "optionLabel").optionLabel
|
|
24
28
|
local _selectFilter = TS.import(script, script.Parent, "selectFilter")
|
|
@@ -42,11 +46,19 @@ local function Select(props)
|
|
|
42
46
|
local options = _binding.options
|
|
43
47
|
local onChange = _binding.onChange
|
|
44
48
|
local disabled = _binding.disabled
|
|
49
|
+
local loading = _binding.loading
|
|
50
|
+
if loading == nil then
|
|
51
|
+
loading = false
|
|
52
|
+
end
|
|
45
53
|
local placeholder = _binding.placeholder
|
|
46
54
|
if placeholder == nil then
|
|
47
55
|
placeholder = ""
|
|
48
56
|
end
|
|
49
57
|
local searchable = _binding.searchable
|
|
58
|
+
local defaultOpen = _binding.defaultOpen
|
|
59
|
+
local defaultQuery = _binding.defaultQuery
|
|
60
|
+
local emptyText = _binding.emptyText
|
|
61
|
+
local empty = _binding.empty
|
|
50
62
|
local reducedProp = _binding.reducedMotion
|
|
51
63
|
local size = _binding.size
|
|
52
64
|
local className = _binding.className
|
|
@@ -60,13 +72,17 @@ local function Select(props)
|
|
|
60
72
|
local _binding_1 = useTheme()
|
|
61
73
|
local theme = _binding_1.theme
|
|
62
74
|
local row = controlMetrics(theme.density, size).height
|
|
63
|
-
local active = canActivate(disabled)
|
|
75
|
+
local active = canActivate(disabled, loading)
|
|
64
76
|
local anchor, setAnchor = useState()
|
|
65
|
-
local open, setOpen = useState(
|
|
77
|
+
local open, setOpen = useState(defaultOpen == true and not loading)
|
|
66
78
|
local held, setHeld = useState(false)
|
|
67
79
|
local focused, setFocused = useState(false)
|
|
68
80
|
local highlight, setHighlight = useState(-1)
|
|
69
|
-
local
|
|
81
|
+
local _condition = defaultQuery
|
|
82
|
+
if _condition == nil then
|
|
83
|
+
_condition = ""
|
|
84
|
+
end
|
|
85
|
+
local query, setQuery = useState(_condition)
|
|
70
86
|
local recent = useRef()
|
|
71
87
|
local typed = useRef()
|
|
72
88
|
local onKeyRef = useRef()
|
|
@@ -89,7 +105,20 @@ local function Select(props)
|
|
|
89
105
|
local search = usesSelectSearch(#options, searchable)
|
|
90
106
|
local filtered = filterChoices(options, query)
|
|
91
107
|
local rows = groupRows(filtered)
|
|
92
|
-
local
|
|
108
|
+
local listHeight = if #rows == 0 then row else math.min(#rows * row, theme.spacing.calc(16))
|
|
109
|
+
local menuHeight = listHeight + (if search then row else 0)
|
|
110
|
+
local _condition_1 = empty
|
|
111
|
+
if _condition_1 == nil then
|
|
112
|
+
local _attributes = {}
|
|
113
|
+
local _condition_2 = emptyText
|
|
114
|
+
if _condition_2 == nil then
|
|
115
|
+
_condition_2 = (if #query > 0 or #options > 0 then "No results" else "No options")
|
|
116
|
+
end
|
|
117
|
+
_attributes.text = _condition_2
|
|
118
|
+
_attributes.height = row
|
|
119
|
+
_condition_1 = (React.createElement(EmptyListHint, _attributes))
|
|
120
|
+
end
|
|
121
|
+
local emptyHint = _condition_1
|
|
93
122
|
local close = function()
|
|
94
123
|
setOpen(false)
|
|
95
124
|
setQuery("")
|
|
@@ -119,15 +148,15 @@ local function Select(props)
|
|
|
119
148
|
if fromPointer == nil then
|
|
120
149
|
fromPointer = false
|
|
121
150
|
end
|
|
122
|
-
local
|
|
123
|
-
if
|
|
151
|
+
local _condition_2 = fromPointer
|
|
152
|
+
if _condition_2 then
|
|
124
153
|
local _result_1 = listRef.current
|
|
125
154
|
if _result_1 ~= nil then
|
|
126
155
|
_result_1 = _result_1.suppressClick()
|
|
127
156
|
end
|
|
128
|
-
|
|
157
|
+
_condition_2 = _result_1
|
|
129
158
|
end
|
|
130
|
-
if
|
|
159
|
+
if _condition_2 then
|
|
131
160
|
return nil
|
|
132
161
|
end
|
|
133
162
|
local choice = filtered[index + 1]
|
|
@@ -218,6 +247,12 @@ local function Select(props)
|
|
|
218
247
|
setHeld(true)
|
|
219
248
|
end
|
|
220
249
|
end, { shown })
|
|
250
|
+
useEffect(function()
|
|
251
|
+
if loading and open then
|
|
252
|
+
setOpen(false)
|
|
253
|
+
setQuery("")
|
|
254
|
+
end
|
|
255
|
+
end, { loading, open })
|
|
221
256
|
useEffect(function()
|
|
222
257
|
local menu = menuRef.current
|
|
223
258
|
if not menu or not held then
|
|
@@ -242,11 +277,11 @@ local function Select(props)
|
|
|
242
277
|
end
|
|
243
278
|
end, { shown, held, reducedMotion })
|
|
244
279
|
local _attributes = {}
|
|
245
|
-
local
|
|
246
|
-
if not (
|
|
247
|
-
|
|
280
|
+
local _condition_2 = id
|
|
281
|
+
if not (_condition_2 ~= 0 and _condition_2 == _condition_2 and _condition_2 ~= "" and _condition_2) then
|
|
282
|
+
_condition_2 = "Select"
|
|
248
283
|
end
|
|
249
|
-
_attributes.key =
|
|
284
|
+
_attributes.key = _condition_2
|
|
250
285
|
_attributes.ref = ref
|
|
251
286
|
for _k, _v in styles.root do
|
|
252
287
|
_attributes[_k] = _v
|
|
@@ -278,11 +313,11 @@ local function Select(props)
|
|
|
278
313
|
if _result_2 ~= nil then
|
|
279
314
|
_result_2 = _result_2.label
|
|
280
315
|
end
|
|
281
|
-
local
|
|
282
|
-
if
|
|
283
|
-
|
|
316
|
+
local _condition_3 = _result_2
|
|
317
|
+
if _condition_3 == nil then
|
|
318
|
+
_condition_3 = placeholder
|
|
284
319
|
end
|
|
285
|
-
_result_1 =
|
|
320
|
+
_result_1 = _condition_3
|
|
286
321
|
end
|
|
287
322
|
_attributes_1.Text = _result_1
|
|
288
323
|
_attributes_1.Active = active
|
|
@@ -305,7 +340,9 @@ local function Select(props)
|
|
|
305
340
|
return onKey(input, true)
|
|
306
341
|
end,
|
|
307
342
|
}
|
|
308
|
-
local _attributes_2 = table.clone(styles.padding
|
|
343
|
+
local _attributes_2 = table.clone(cx(styles.padding, loading and {
|
|
344
|
+
PaddingRight = UDim.new(0, theme.padding.calc(1.5) + spinnerPixels(size) + theme.padding.calc(1)),
|
|
345
|
+
}))
|
|
309
346
|
setmetatable(_attributes_2, nil)
|
|
310
347
|
local _exp = React.createElement("uipadding", _attributes_2)
|
|
311
348
|
local _attributes_3 = table.clone(styles.corner)
|
|
@@ -313,9 +350,18 @@ local function Select(props)
|
|
|
313
350
|
local _exp_1 = React.createElement("uicorner", _attributes_3)
|
|
314
351
|
local _attributes_4 = table.clone(cx(styles.stroke, focused and styles.focusStroke))
|
|
315
352
|
setmetatable(_attributes_4, nil)
|
|
316
|
-
local _exp_2 = React.createElement("textbutton", _attributes_1, _exp, _exp_1, React.createElement("uistroke", _attributes_4)
|
|
317
|
-
|
|
318
|
-
|
|
353
|
+
local _exp_2 = React.createElement("textbutton", _attributes_1, _exp, _exp_1, React.createElement("uistroke", _attributes_4), loading and (React.createElement(CircularProgress, {
|
|
354
|
+
size = spinnerPixels(size),
|
|
355
|
+
thickness = 2,
|
|
356
|
+
color = theme.palette.text.secondary,
|
|
357
|
+
reducedMotion = reducedMotion,
|
|
358
|
+
className = {
|
|
359
|
+
AnchorPoint = Vector2.new(1, 0.5),
|
|
360
|
+
Position = UDim2.new(1, -theme.padding.calc(1), 0.5, 0),
|
|
361
|
+
},
|
|
362
|
+
})))
|
|
363
|
+
local _condition_3 = (shown or held)
|
|
364
|
+
if _condition_3 then
|
|
319
365
|
local _attributes_5 = {
|
|
320
366
|
key = "Menu",
|
|
321
367
|
}
|
|
@@ -333,8 +379,8 @@ local function Select(props)
|
|
|
333
379
|
FillDirection = Enum.FillDirection.Vertical,
|
|
334
380
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
335
381
|
})
|
|
336
|
-
local
|
|
337
|
-
if
|
|
382
|
+
local _condition_4 = search
|
|
383
|
+
if _condition_4 then
|
|
338
384
|
local _attributes_8 = {
|
|
339
385
|
key = "Search",
|
|
340
386
|
}
|
|
@@ -342,7 +388,7 @@ local function Select(props)
|
|
|
342
388
|
_attributes_8[_k] = _v
|
|
343
389
|
end
|
|
344
390
|
_attributes_8.LayoutOrder = 1
|
|
345
|
-
|
|
391
|
+
_condition_4 = (React.createElement("frame", _attributes_8, React.createElement(Input, {
|
|
346
392
|
text = query,
|
|
347
393
|
placeholder = "Search",
|
|
348
394
|
width = UDim.new(1, 0),
|
|
@@ -352,7 +398,7 @@ local function Select(props)
|
|
|
352
398
|
end,
|
|
353
399
|
})))
|
|
354
400
|
end
|
|
355
|
-
|
|
401
|
+
_condition_3 = (React.createElement(Popup, {
|
|
356
402
|
anchor = anchor,
|
|
357
403
|
preferredHeight = menuHeight,
|
|
358
404
|
onDismiss = close,
|
|
@@ -364,7 +410,7 @@ local function Select(props)
|
|
|
364
410
|
Size = UDim2.fromScale(1, 1),
|
|
365
411
|
BackgroundTransparency = 1,
|
|
366
412
|
GroupTransparency = 1,
|
|
367
|
-
}, React.createElement("frame", _attributes_5, _exp_3, _exp_4, _exp_5, _exp_6,
|
|
413
|
+
}, React.createElement("frame", _attributes_5, _exp_3, _exp_4, _exp_5, _exp_6, _condition_4, React.createElement("frame", {
|
|
368
414
|
key = "ListHost",
|
|
369
415
|
Size = UDim2.new(1, 0, 1, if search then -row else 0),
|
|
370
416
|
BackgroundTransparency = 1,
|
|
@@ -377,6 +423,7 @@ local function Select(props)
|
|
|
377
423
|
end,
|
|
378
424
|
itemHeight = row,
|
|
379
425
|
listRef = listRef,
|
|
426
|
+
empty = emptyHint,
|
|
380
427
|
className = styles.list,
|
|
381
428
|
renderItem = function(row)
|
|
382
429
|
if row.kind == "header" then
|
|
@@ -424,7 +471,7 @@ local function Select(props)
|
|
|
424
471
|
end,
|
|
425
472
|
}))))))
|
|
426
473
|
end
|
|
427
|
-
return React.createElement("frame", _attributes, _exp_2,
|
|
474
|
+
return React.createElement("frame", _attributes, _exp_2, _condition_3)
|
|
428
475
|
end
|
|
429
476
|
local default = Select
|
|
430
477
|
return {
|
|
@@ -9,7 +9,7 @@ local useSelectStyles = componentStyles("Select", function(theme, _param)
|
|
|
9
9
|
local metrics = controlMetrics(theme.density, size)
|
|
10
10
|
return createStyles({
|
|
11
11
|
root = {
|
|
12
|
-
Size = UDim2.fromOffset(theme.spacing.calc(
|
|
12
|
+
Size = UDim2.fromOffset(theme.spacing.calc(12), metrics.height),
|
|
13
13
|
BackgroundTransparency = 1,
|
|
14
14
|
BorderSizePixel = 0,
|
|
15
15
|
},
|
|
@@ -38,13 +38,13 @@ local useSelectStyles = componentStyles("Select", function(theme, _param)
|
|
|
38
38
|
ZIndex = 20001,
|
|
39
39
|
},
|
|
40
40
|
search = {
|
|
41
|
-
Size = UDim2.new(1, 0, 0,
|
|
41
|
+
Size = UDim2.new(1, 0, 0, metrics.height),
|
|
42
42
|
BackgroundTransparency = 1,
|
|
43
43
|
ZIndex = 20002,
|
|
44
44
|
},
|
|
45
45
|
list = {
|
|
46
46
|
Size = UDim2.fromScale(1, 1),
|
|
47
|
-
|
|
47
|
+
BackgroundTransparency = 1,
|
|
48
48
|
BorderSizePixel = 0,
|
|
49
49
|
ScrollBarThickness = theme.padding.default,
|
|
50
50
|
ScrollBarImageColor3 = theme.palette.text.secondary,
|
|
@@ -12,8 +12,8 @@ local useSidebarStyles = componentStyles("Sidebar", function(theme, props)
|
|
|
12
12
|
ignoreInset = false
|
|
13
13
|
end
|
|
14
14
|
local sidebarWidths = {
|
|
15
|
-
large =
|
|
16
|
-
compact =
|
|
15
|
+
large = 180,
|
|
16
|
+
compact = 60,
|
|
17
17
|
}
|
|
18
18
|
return createStyles({
|
|
19
19
|
root = {
|
|
@@ -30,6 +30,7 @@ local function SkeletonBlock(props)
|
|
|
30
30
|
local circular = _binding_1.circular
|
|
31
31
|
local fillRef = useRef()
|
|
32
32
|
local gradientRef = useRef()
|
|
33
|
+
local showGradient = motion ~= "pulse"
|
|
33
34
|
useEffect(function()
|
|
34
35
|
local fill = fillRef.current
|
|
35
36
|
local gradient = gradientRef.current
|
|
@@ -45,7 +46,7 @@ local function SkeletonBlock(props)
|
|
|
45
46
|
if motion == "pulse" then
|
|
46
47
|
fill.BackgroundTransparency = 0
|
|
47
48
|
return loopProperty(fill, {
|
|
48
|
-
BackgroundTransparency = 0.
|
|
49
|
+
BackgroundTransparency = 0.45,
|
|
49
50
|
}, 0.9, true)
|
|
50
51
|
end
|
|
51
52
|
fill.BackgroundTransparency = 0
|
|
@@ -90,7 +91,7 @@ local function SkeletonBlock(props)
|
|
|
90
91
|
_attributes_1[_k] = _v
|
|
91
92
|
end
|
|
92
93
|
_attributes_1.Size = UDim2.new(1, 0, 1, 0)
|
|
93
|
-
local _condition_3 =
|
|
94
|
+
local _condition_3 = showGradient
|
|
94
95
|
if _condition_3 then
|
|
95
96
|
local _attributes_2 = {
|
|
96
97
|
ref = gradientRef,
|
|
@@ -3,15 +3,20 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local createStyles = _theme.createStyles
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
|
+
local skeletonTone = TS.import(script, script.Parent, "skeletonTone").skeletonTone
|
|
6
7
|
local useSkeletonStyles = componentStyles("Skeleton", function(theme)
|
|
8
|
+
local _binding = skeletonTone(theme)
|
|
9
|
+
local bone = _binding.bone
|
|
10
|
+
local shine = _binding.shine
|
|
7
11
|
return createStyles({
|
|
8
12
|
block = {
|
|
9
|
-
BackgroundColor3 =
|
|
13
|
+
BackgroundColor3 = bone,
|
|
10
14
|
BackgroundTransparency = 0,
|
|
11
15
|
BorderSizePixel = 0,
|
|
12
16
|
},
|
|
13
17
|
highlight = {
|
|
14
|
-
Color = ColorSequence.new({ ColorSequenceKeypoint.new(0,
|
|
18
|
+
Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, bone), ColorSequenceKeypoint.new(0.5, shine), ColorSequenceKeypoint.new(1, bone) }),
|
|
19
|
+
Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.35), NumberSequenceKeypoint.new(0.5, 0), NumberSequenceKeypoint.new(1, 0.35) }),
|
|
15
20
|
},
|
|
16
21
|
rounded = {
|
|
17
22
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
@@ -3,7 +3,7 @@ local function skeletonMotion(animation, reducedMotion)
|
|
|
3
3
|
if animation == false or reducedMotion == true then
|
|
4
4
|
return false
|
|
5
5
|
end
|
|
6
|
-
return animation or "
|
|
6
|
+
return animation or "shimmer"
|
|
7
7
|
end
|
|
8
8
|
local function skeletonLineWidth(width, index, count)
|
|
9
9
|
if count > 1 and index == count - 1 then
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface SkeletonPalette {
|
|
2
|
+
surface: {
|
|
3
|
+
canvas: Color3;
|
|
4
|
+
elevated: Color3;
|
|
5
|
+
};
|
|
6
|
+
action: {
|
|
7
|
+
hover: Color3;
|
|
8
|
+
};
|
|
9
|
+
text: {
|
|
10
|
+
secondary: Color3;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** Bone + shimmer peak from semantic tokens; shine always lifts off the bone vs canvas. */
|
|
14
|
+
export declare function skeletonTone(theme: {
|
|
15
|
+
palette: SkeletonPalette;
|
|
16
|
+
}): {
|
|
17
|
+
bone: Color3;
|
|
18
|
+
shine: Color3;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local relativeLuminance = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme", "utilites", "colorMath").relativeLuminance
|
|
4
|
+
--* Bone + shimmer peak from semantic tokens; shine always lifts off the bone vs canvas.
|
|
5
|
+
local function skeletonTone(theme)
|
|
6
|
+
local lightCanvas = relativeLuminance(theme.palette.surface.canvas) > 0.5
|
|
7
|
+
return {
|
|
8
|
+
bone = theme.palette.action.hover,
|
|
9
|
+
shine = if lightCanvas then theme.palette.surface.elevated else theme.palette.text.secondary,
|
|
10
|
+
}
|
|
11
|
+
end
|
|
12
|
+
return {
|
|
13
|
+
skeletonTone = skeletonTone,
|
|
14
|
+
}
|