@rbxts/uiblox 0.2.0-alpha.35 → 0.2.0-alpha.37
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/out/theme/styles/utilities/focusRing.d.ts +5 -0
- package/out/theme/styles/utilities/focusRing.luau +11 -0
- package/out/theme/styles/utilities/index.d.ts +1 -0
- package/out/theme/styles/utilities/init.luau +1 -0
- package/out/theme/styles/utilities/resolveSx.d.ts +6 -1
- package/out/theme/styles/utilities/resolveSx.luau +53 -12
- package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.luau +55 -19
- package/out/ui/packages/accordion/components/Accordion.styles.luau +49 -29
- package/out/ui/packages/accordion/components/accordionNote.d.ts +2 -0
- package/out/ui/packages/accordion/components/accordionNote.luau +11 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +24 -1
- package/out/ui/packages/alert/components/Alert.styles.luau +11 -0
- package/out/ui/packages/alert/components/alertAction.d.ts +2 -0
- package/out/ui/packages/alert/components/alertAction.luau +11 -0
- package/out/ui/packages/appBar/components/AppBar.d.ts +1 -0
- package/out/ui/packages/appBar/components/AppBar.luau +59 -15
- package/out/ui/packages/appBar/components/AppBar.styles.luau +24 -0
- package/out/ui/packages/appBar/components/appBarSubtitle.d.ts +2 -0
- package/out/ui/packages/appBar/components/appBarSubtitle.luau +11 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.d.ts +14 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +102 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.d.ts +6 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +50 -0
- package/out/ui/packages/avatarGroup/components/avatarGroupCut.d.ts +2 -0
- package/out/ui/packages/avatarGroup/components/avatarGroupCut.luau +11 -0
- package/out/ui/packages/avatarGroup/index.d.ts +3 -0
- package/out/ui/packages/avatarGroup/init.luau +6 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +4 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +19 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +20 -0
- package/out/ui/packages/bottomNavigation/components/navBadge.d.ts +2 -0
- package/out/ui/packages/bottomNavigation/components/navBadge.luau +14 -0
- package/out/ui/packages/bottomNavigation/index.d.ts +1 -1
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +16 -5
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +6 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +2 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +8 -0
- package/out/ui/packages/button/components/Button.d.ts +2 -0
- package/out/ui/packages/button/components/Button.luau +59 -10
- package/out/ui/packages/button/components/Button.styles.luau +2 -0
- package/out/ui/packages/button/components/buttonLook.d.ts +2 -0
- package/out/ui/packages/button/components/buttonLook.luau +11 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +13 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +102 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.d.ts +5 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.luau +57 -0
- package/out/ui/packages/buttonGroup/components/buttonGroupEdge.d.ts +2 -0
- package/out/ui/packages/buttonGroup/components/buttonGroupEdge.luau +16 -0
- package/out/ui/packages/buttonGroup/index.d.ts +3 -0
- package/out/ui/packages/buttonGroup/init.luau +6 -0
- package/out/ui/packages/card/components/Card.d.ts +1 -0
- package/out/ui/packages/card/components/Card.luau +21 -2
- package/out/ui/packages/card/components/Card.styles.d.ts +3 -1
- package/out/ui/packages/card/components/Card.styles.luau +16 -7
- package/out/ui/packages/card/components/cardWidth.d.ts +10 -0
- package/out/ui/packages/card/components/cardWidth.luau +36 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -4
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +10 -1
- package/out/ui/packages/cframeEditor/components/cframeValue.d.ts +1 -0
- package/out/ui/packages/cframeEditor/components/cframeValue.luau +13 -0
- package/out/ui/packages/checkbox/components/Checkbox.luau +2 -1
- package/out/ui/packages/checkbox/components/Checkbox.styles.luau +2 -0
- package/out/ui/packages/chip/components/Chip.styles.d.ts +2 -1
- package/out/ui/packages/chip/components/Chip.styles.luau +9 -6
- package/out/ui/packages/chip/components/chipTone.d.ts +3 -0
- package/out/ui/packages/chip/components/chipTone.luau +11 -0
- package/out/ui/packages/collapse/components/Collapse.d.ts +8 -0
- package/out/ui/packages/collapse/components/Collapse.luau +34 -0
- package/out/ui/packages/collapse/components/Collapse.styles.d.ts +2 -0
- package/out/ui/packages/collapse/components/Collapse.styles.luau +20 -0
- package/out/ui/packages/collapse/components/collapseOpen.d.ts +1 -0
- package/out/ui/packages/collapse/components/collapseOpen.luau +7 -0
- package/out/ui/packages/collapse/index.d.ts +3 -0
- package/out/ui/packages/collapse/init.luau +6 -0
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +4 -2
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +4 -2
- package/out/ui/packages/colorPicker/components/sequenceValue.d.ts +2 -0
- package/out/ui/packages/colorPicker/components/sequenceValue.luau +8 -0
- package/out/ui/packages/colorPicker/index.d.ts +1 -1
- package/out/ui/packages/colorPicker/init.luau +2 -0
- package/out/ui/packages/copyButton/components/CopyButton.d.ts +8 -0
- package/out/ui/packages/copyButton/components/CopyButton.luau +32 -0
- package/out/ui/packages/copyButton/components/copyInvoke.d.ts +2 -0
- package/out/ui/packages/copyButton/components/copyInvoke.luau +12 -0
- package/out/ui/packages/copyButton/index.d.ts +3 -0
- package/out/ui/packages/copyButton/init.luau +6 -0
- package/out/ui/packages/cover/components/Cover.d.ts +8 -0
- package/out/ui/packages/cover/components/Cover.luau +47 -0
- package/out/ui/packages/cover/components/coverFill.d.ts +2 -0
- package/out/ui/packages/cover/components/coverFill.luau +14 -0
- package/out/ui/packages/cover/index.d.ts +3 -0
- package/out/ui/packages/cover/init.luau +6 -0
- package/out/ui/packages/dateRange/components/DateRangePicker.d.ts +3 -0
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +167 -88
- package/out/ui/packages/dateRange/dateRangeValue.d.ts +5 -0
- package/out/ui/packages/dateRange/dateRangeValue.luau +34 -0
- package/out/ui/packages/dateRange/index.d.ts +1 -1
- package/out/ui/packages/dateRange/init.luau +3 -0
- package/out/ui/packages/dialog/components/Dialog.d.ts +1 -0
- package/out/ui/packages/dialog/components/Dialog.luau +55 -6
- package/out/ui/packages/dialog/components/Dialog.styles.luau +5 -3
- package/out/ui/packages/dialog/components/dialogWidth.d.ts +7 -0
- package/out/ui/packages/dialog/components/dialogWidth.luau +35 -0
- package/out/ui/packages/divider/components/Divider.luau +57 -12
- package/out/ui/packages/divider/components/dividerLabel.d.ts +2 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +11 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
- package/out/ui/packages/drawer/components/Drawer.luau +18 -3
- package/out/ui/packages/drawer/components/drawerPlacement.d.ts +13 -1
- package/out/ui/packages/drawer/components/drawerPlacement.luau +28 -0
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
- package/out/ui/packages/iconButton/components/IconButton.d.ts +2 -0
- package/out/ui/packages/iconButton/components/IconButton.luau +37 -3
- package/out/ui/packages/iconButton/components/transportGlyph.d.ts +9 -0
- package/out/ui/packages/iconButton/components/transportGlyph.luau +73 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +4 -0
- package/out/ui/packages/imageList/components/ImageList.luau +57 -11
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +1 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +16 -10
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +10 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +44 -0
- package/out/ui/packages/index.d.ts +12 -0
- package/out/ui/packages/init.luau +36 -0
- package/out/ui/packages/input/components/Input.d.ts +4 -0
- package/out/ui/packages/input/components/Input.luau +29 -9
- package/out/ui/packages/input/components/Input.styles.d.ts +1 -0
- package/out/ui/packages/input/components/Input.styles.luau +42 -12
- package/out/ui/packages/input/components/clampText.d.ts +2 -0
- package/out/ui/packages/input/components/clampText.luau +16 -0
- package/out/ui/packages/input/components/multilineHeight.d.ts +1 -0
- package/out/ui/packages/input/components/multilineHeight.luau +11 -0
- package/out/ui/packages/link/components/Link.luau +13 -9
- package/out/ui/packages/link/components/Link.styles.d.ts +0 -1
- package/out/ui/packages/link/components/Link.styles.luau +1 -12
- package/out/ui/packages/listItem/components/ListItem.d.ts +6 -0
- package/out/ui/packages/listItem/components/ListItem.luau +97 -39
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +3 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +52 -30
- package/out/ui/packages/listItem/components/listItemInk.d.ts +3 -0
- package/out/ui/packages/listItem/components/listItemInk.luau +14 -0
- package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -0
- package/out/ui/packages/listItem/components/listItemLayout.luau +41 -0
- package/out/ui/packages/markdown/components/Markdown.d.ts +2 -0
- package/out/ui/packages/markdown/components/Markdown.luau +91 -6
- package/out/ui/packages/markdown/components/Markdown.styles.luau +25 -0
- package/out/ui/packages/markdown/index.d.ts +2 -2
- package/out/ui/packages/markdown/init.luau +2 -0
- package/out/ui/packages/markdown/parseMarkdown.d.ts +21 -1
- package/out/ui/packages/markdown/parseMarkdown.luau +109 -2
- package/out/ui/packages/menu/components/Menu.d.ts +3 -0
- package/out/ui/packages/menu/components/Menu.luau +68 -21
- package/out/ui/packages/menu/components/menuIcon.d.ts +6 -0
- package/out/ui/packages/menu/components/menuIcon.luau +32 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +67 -1
- package/out/ui/packages/numberInput/components/numberValue.d.ts +2 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +10 -0
- package/out/ui/packages/pager/components/Pager.d.ts +11 -0
- package/out/ui/packages/pager/components/Pager.luau +112 -0
- package/out/ui/packages/pager/components/Pager.styles.d.ts +2 -0
- package/out/ui/packages/pager/components/Pager.styles.luau +61 -0
- package/out/ui/packages/pager/components/pagerStep.d.ts +3 -0
- package/out/ui/packages/pager/components/pagerStep.luau +24 -0
- package/out/ui/packages/pager/index.d.ts +3 -0
- package/out/ui/packages/pager/init.luau +9 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +5 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +5 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +22 -0
- package/out/ui/packages/popover/components/Popover.d.ts +12 -0
- package/out/ui/packages/popover/components/Popover.luau +50 -0
- package/out/ui/packages/popover/components/Popover.styles.d.ts +2 -0
- package/out/ui/packages/popover/components/Popover.styles.luau +26 -0
- package/out/ui/packages/popover/index.d.ts +2 -0
- package/out/ui/packages/popover/init.luau +5 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +4 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +51 -8
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +26 -2
- package/out/ui/packages/radioGroup/components/radioHint.d.ts +2 -0
- package/out/ui/packages/radioGroup/components/radioHint.luau +11 -0
- package/out/ui/packages/radioGroup/index.d.ts +1 -1
- package/out/ui/packages/rating/components/Rating.d.ts +1 -1
- package/out/ui/packages/rating/components/Rating.luau +4 -2
- package/out/ui/packages/rating/components/ratingCommit.d.ts +2 -0
- package/out/ui/packages/rating/components/ratingCommit.luau +11 -0
- package/out/ui/packages/reorder/index.d.ts +2 -0
- package/out/ui/packages/reorder/init.luau +14 -0
- package/out/ui/packages/reorder/reorder.d.ts +24 -0
- package/out/ui/packages/reorder/reorder.luau +178 -0
- package/out/ui/packages/reorder/useReorderDrag.d.ts +15 -0
- package/out/ui/packages/reorder/useReorderDrag.luau +129 -0
- package/out/ui/packages/scroll/components/ScrollView.luau +76 -7
- package/out/ui/packages/select/components/Select.luau +18 -1
- package/out/ui/packages/select/components/Select.styles.luau +2 -5
- package/out/ui/packages/select/components/selectWidth.d.ts +2 -0
- package/out/ui/packages/select/components/selectWidth.luau +15 -0
- package/out/ui/packages/shadow/components/Shadow.luau +14 -2
- package/out/ui/packages/slider/components/RangeSlider.d.ts +16 -0
- package/out/ui/packages/slider/components/RangeSlider.luau +231 -0
- package/out/ui/packages/slider/components/RangeSlider.styles.d.ts +7 -0
- package/out/ui/packages/slider/components/RangeSlider.styles.luau +48 -0
- package/out/ui/packages/slider/components/Slider.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.luau +44 -11
- package/out/ui/packages/slider/components/Slider.styles.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +19 -5
- package/out/ui/packages/slider/components/rangeValue.d.ts +21 -0
- package/out/ui/packages/slider/components/rangeValue.luau +77 -0
- package/out/ui/packages/slider/components/sliderLabel.d.ts +4 -0
- package/out/ui/packages/slider/components/sliderLabel.luau +30 -0
- package/out/ui/packages/slider/index.d.ts +3 -0
- package/out/ui/packages/slider/init.luau +6 -0
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +1 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +2 -0
- package/out/ui/packages/sparkline/components/Sparkline.d.ts +3 -0
- package/out/ui/packages/sparkline/components/Sparkline.luau +69 -7
- package/out/ui/packages/sparkline/index.d.ts +1 -1
- package/out/ui/packages/sparkline/init.luau +6 -1
- package/out/ui/packages/sparkline/sparklineLayout.d.ts +17 -0
- package/out/ui/packages/sparkline/sparklineLayout.luau +132 -8
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +1 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +56 -9
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +1 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +45 -3
- package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +4 -0
- package/out/ui/packages/speedDial/components/speedDialLabel.luau +16 -0
- package/out/ui/packages/stateMatrix.d.ts +1 -0
- package/out/ui/packages/stateMatrix.luau +9 -0
- package/out/ui/packages/stepper/components/Stepper.d.ts +2 -0
- package/out/ui/packages/stepper/components/Stepper.luau +35 -7
- package/out/ui/packages/stepper/components/Stepper.styles.luau +3 -0
- package/out/ui/packages/stepper/components/stepState.d.ts +4 -2
- package/out/ui/packages/stepper/components/stepState.luau +12 -1
- package/out/ui/packages/stepper/index.d.ts +1 -1
- package/out/ui/packages/stepper/init.luau +3 -1
- package/out/ui/packages/switch/components/Switch.styles.luau +2 -5
- package/out/ui/packages/table/components/Table.luau +8 -5
- package/out/ui/packages/table/components/tableSort.d.ts +2 -0
- package/out/ui/packages/table/components/tableSort.luau +95 -0
- package/out/ui/packages/table/index.d.ts +1 -0
- package/out/ui/packages/table/init.luau +1 -0
- package/out/ui/packages/tabs/components/Tabs.luau +70 -2
- package/out/ui/packages/tabs/components/tabScroll.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabScroll.luau +18 -0
- package/out/ui/packages/text/components/Text.d.ts +7 -0
- package/out/ui/packages/text/components/Text.luau +54 -0
- package/out/ui/packages/text/components/textBox.d.ts +12 -0
- package/out/ui/packages/text/components/textBox.luau +21 -0
- package/out/ui/packages/text/index.d.ts +2 -0
- package/out/ui/packages/text/init.luau +5 -0
- package/out/ui/packages/timeField/components/TimeField.d.ts +13 -0
- package/out/ui/packages/timeField/components/TimeField.luau +102 -0
- package/out/ui/packages/timeField/index.d.ts +4 -0
- package/out/ui/packages/timeField/init.luau +9 -0
- package/out/ui/packages/timeField/timeValue.d.ts +8 -0
- package/out/ui/packages/timeField/timeValue.luau +49 -0
- package/out/ui/packages/timeline/components/Timeline.d.ts +12 -0
- package/out/ui/packages/timeline/components/Timeline.luau +99 -0
- package/out/ui/packages/timeline/components/Timeline.styles.d.ts +2 -0
- package/out/ui/packages/timeline/components/Timeline.styles.luau +106 -0
- package/out/ui/packages/timeline/components/timelineRail.d.ts +4 -0
- package/out/ui/packages/timeline/components/timelineRail.luau +15 -0
- package/out/ui/packages/timeline/index.d.ts +3 -0
- package/out/ui/packages/timeline/init.luau +8 -0
- package/out/ui/packages/toast/components/Toast.d.ts +1 -0
- package/out/ui/packages/toast/components/Toast.luau +59 -12
- package/out/ui/packages/toast/components/Toast.styles.luau +6 -3
- package/out/ui/packages/toast/components/toastPlace.d.ts +12 -0
- package/out/ui/packages/toast/components/toastPlace.luau +31 -0
- package/out/ui/packages/tooltip/components/Tooltip.d.ts +1 -0
- package/out/ui/packages/tooltip/components/Tooltip.luau +109 -31
- package/out/ui/packages/tooltip/components/Tooltip.styles.luau +30 -0
- package/out/ui/packages/tooltip/components/tooltipBox.d.ts +4 -0
- package/out/ui/packages/tooltip/components/tooltipBox.luau +12 -0
- package/out/ui/packages/tooltip/components/tooltipPointer.d.ts +2 -0
- package/out/ui/packages/tooltip/components/tooltipPointer.luau +11 -0
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +1 -0
- package/out/ui/packages/weekGrid/components/WeekGrid.d.ts +24 -0
- package/out/ui/packages/weekGrid/components/WeekGrid.luau +187 -0
- package/out/ui/packages/weekGrid/components/weekColumns.d.ts +9 -0
- package/out/ui/packages/weekGrid/components/weekColumns.luau +25 -0
- package/out/ui/packages/weekGrid/index.d.ts +3 -0
- package/out/ui/packages/weekGrid/init.luau +8 -0
- package/package.json +67 -69
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
|
-
local
|
|
3
|
+
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local React = _react
|
|
5
|
+
local useRef = _react.useRef
|
|
4
6
|
local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
5
7
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
|
-
local
|
|
8
|
+
local _sparklineLayout = TS.import(script, script.Parent.Parent, "sparklineLayout")
|
|
9
|
+
local sparklineArea = _sparklineLayout.sparklineArea
|
|
10
|
+
local sparklineLayout = _sparklineLayout.sparklineLayout
|
|
11
|
+
local sparklinePick = _sparklineLayout.sparklinePick
|
|
12
|
+
local sparklinePoint = _sparklineLayout.sparklinePoint
|
|
7
13
|
local function Sparkline(props)
|
|
8
14
|
local _binding = props
|
|
9
15
|
local values = _binding.values
|
|
@@ -16,13 +22,19 @@ local function Sparkline(props)
|
|
|
16
22
|
height = 36
|
|
17
23
|
end
|
|
18
24
|
local color = _binding.color
|
|
25
|
+
local area = _binding.area
|
|
26
|
+
local mark = _binding.mark
|
|
27
|
+
local onPick = _binding.onPick
|
|
19
28
|
local className = _binding.className
|
|
20
29
|
local sx = _binding.sx
|
|
21
30
|
local id = _binding.id
|
|
22
31
|
local ref = _binding.ref
|
|
23
32
|
local _binding_1 = useTheme()
|
|
24
33
|
local theme = _binding_1.theme
|
|
34
|
+
local host = useRef()
|
|
25
35
|
local segments = sparklineLayout(values, width, height)
|
|
36
|
+
local bars = if area == true then sparklineArea(values, width, height) else {}
|
|
37
|
+
local marked = if mark ~= nil then sparklinePoint(values, mark, width, height) else nil
|
|
26
38
|
local stroke = color or theme.palette.primary.main
|
|
27
39
|
local _attributes = {
|
|
28
40
|
tag = "frame",
|
|
@@ -32,7 +44,30 @@ local function Sparkline(props)
|
|
|
32
44
|
_condition = "Sparkline"
|
|
33
45
|
end
|
|
34
46
|
_attributes.key = _condition
|
|
35
|
-
_attributes.hostRef =
|
|
47
|
+
_attributes.hostRef = function(instance)
|
|
48
|
+
host.current = instance
|
|
49
|
+
if ref == nil then
|
|
50
|
+
return nil
|
|
51
|
+
end
|
|
52
|
+
if type(ref) == "function" then
|
|
53
|
+
ref(instance)
|
|
54
|
+
return nil
|
|
55
|
+
end
|
|
56
|
+
ref.current = instance
|
|
57
|
+
end
|
|
58
|
+
_attributes.Active = onPick ~= nil
|
|
59
|
+
_attributes.Event = if onPick == nil then nil else {
|
|
60
|
+
InputBegan = function(input)
|
|
61
|
+
local frame = host.current
|
|
62
|
+
if frame == nil then
|
|
63
|
+
return nil
|
|
64
|
+
end
|
|
65
|
+
if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then
|
|
66
|
+
return nil
|
|
67
|
+
end
|
|
68
|
+
sparklinePick(input.Position.X - frame.AbsolutePosition.X, #values, width, onPick)
|
|
69
|
+
end,
|
|
70
|
+
}
|
|
36
71
|
_attributes.base = {
|
|
37
72
|
Size = UDim2.fromOffset(width, height),
|
|
38
73
|
BackgroundTransparency = 1,
|
|
@@ -42,8 +77,35 @@ local function Sparkline(props)
|
|
|
42
77
|
_attributes.className = className
|
|
43
78
|
_attributes.sx = sx
|
|
44
79
|
-- ▼ ReadonlyArray.map ▼
|
|
45
|
-
local _newValue = table.create(#
|
|
46
|
-
local _callback = function(
|
|
80
|
+
local _newValue = table.create(#bars)
|
|
81
|
+
local _callback = function(bar, index)
|
|
82
|
+
return if bar.height < 1 then nil else (React.createElement("frame", {
|
|
83
|
+
key = `a-{index}`,
|
|
84
|
+
Position = UDim2.fromOffset(bar.x, bar.y),
|
|
85
|
+
Size = UDim2.fromOffset(math.max(bar.width, 1), bar.height),
|
|
86
|
+
BackgroundColor3 = stroke,
|
|
87
|
+
BackgroundTransparency = 0.62,
|
|
88
|
+
BorderSizePixel = 0,
|
|
89
|
+
}))
|
|
90
|
+
end
|
|
91
|
+
for _k, _v in bars do
|
|
92
|
+
_newValue[_k] = _callback(_v, _k - 1, bars)
|
|
93
|
+
end
|
|
94
|
+
-- ▲ ReadonlyArray.map ▲
|
|
95
|
+
local _exp = if marked ~= nil then (React.createElement("frame", {
|
|
96
|
+
key = "Mark",
|
|
97
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
98
|
+
Position = UDim2.fromOffset(marked.x, marked.y),
|
|
99
|
+
Size = UDim2.fromOffset(8, 8),
|
|
100
|
+
BackgroundColor3 = stroke,
|
|
101
|
+
BorderSizePixel = 0,
|
|
102
|
+
ZIndex = 3,
|
|
103
|
+
}, React.createElement("uicorner", {
|
|
104
|
+
CornerRadius = UDim.new(1, 0),
|
|
105
|
+
}))) else nil
|
|
106
|
+
-- ▼ ReadonlyArray.map ▼
|
|
107
|
+
local _newValue_1 = table.create(#segments)
|
|
108
|
+
local _callback_1 = function(segment, index)
|
|
47
109
|
return React.createElement("frame", {
|
|
48
110
|
key = `s-{index}`,
|
|
49
111
|
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
@@ -55,10 +117,10 @@ local function Sparkline(props)
|
|
|
55
117
|
})
|
|
56
118
|
end
|
|
57
119
|
for _k, _v in segments do
|
|
58
|
-
|
|
120
|
+
_newValue_1[_k] = _callback_1(_v, _k - 1, segments)
|
|
59
121
|
end
|
|
60
122
|
-- ▲ ReadonlyArray.map ▲
|
|
61
|
-
return React.createElement(SxHost, _attributes, _newValue)
|
|
123
|
+
return React.createElement(SxHost, _attributes, _newValue, _exp, _newValue_1)
|
|
62
124
|
end
|
|
63
125
|
local default = Sparkline
|
|
64
126
|
return {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { default as Sparkline } from "./components/Sparkline";
|
|
2
2
|
export { SparklineProps } from "./components/Sparkline";
|
|
3
|
-
export { sparklineLayout, SparkSegment } from "./sparklineLayout";
|
|
3
|
+
export { sparklineArea, sparklineIndex, sparklineLayout, sparklinePick, sparklinePoint, SparkBar, SparkSegment } from "./sparklineLayout";
|
|
@@ -2,5 +2,10 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local exports = {}
|
|
4
4
|
exports.Sparkline = TS.import(script, script, "components", "Sparkline").default
|
|
5
|
-
|
|
5
|
+
local _sparklineLayout = TS.import(script, script, "sparklineLayout")
|
|
6
|
+
exports.sparklineArea = _sparklineLayout.sparklineArea
|
|
7
|
+
exports.sparklineIndex = _sparklineLayout.sparklineIndex
|
|
8
|
+
exports.sparklineLayout = _sparklineLayout.sparklineLayout
|
|
9
|
+
exports.sparklinePick = _sparklineLayout.sparklinePick
|
|
10
|
+
exports.sparklinePoint = _sparklineLayout.sparklinePoint
|
|
6
11
|
return exports
|
|
@@ -4,5 +4,22 @@ export interface SparkSegment {
|
|
|
4
4
|
length: number;
|
|
5
5
|
rotation: number;
|
|
6
6
|
}
|
|
7
|
+
export interface SparkBar {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
}
|
|
7
13
|
/** Line segments for a number series. Empty and single-point series draw nothing. */
|
|
8
14
|
export declare function sparklineLayout(values: number[], width: number, height: number, pad?: number): SparkSegment[];
|
|
15
|
+
/** Vertical slices under the line. Missing when the series cannot draw. */
|
|
16
|
+
export declare function sparklineArea(values: number[], width: number, height: number, pad?: number): SparkBar[];
|
|
17
|
+
/** Nearest sample from a local x. Undefined when the trace cannot be hit. */
|
|
18
|
+
export declare function sparklineIndex(localX: number, count: number, width: number, pad?: number): number | undefined;
|
|
19
|
+
/** Calls onPick with the nearest sample. Does nothing when the callback is absent. */
|
|
20
|
+
export declare function sparklinePick(localX: number, count: number, width: number, onPick?: (index: number) => void, pad?: number): number | undefined;
|
|
21
|
+
/** Point for a sample, used to mark the trace. */
|
|
22
|
+
export declare function sparklinePoint(values: number[], index: number, width: number, height: number, pad?: number): {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
} | undefined;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
|
|
3
|
-
local function sparklineLayout(values, width, height, pad)
|
|
4
|
-
if pad == nil then
|
|
5
|
-
pad = 4
|
|
6
|
-
end
|
|
2
|
+
local function sparklinePoints(values, width, height, pad)
|
|
7
3
|
local count = #values
|
|
8
4
|
if count < 2 or width <= pad * 2 or height <= pad * 2 then
|
|
9
|
-
return
|
|
5
|
+
return nil
|
|
10
6
|
end
|
|
11
7
|
local min = values[1]
|
|
12
8
|
local max = values[1]
|
|
@@ -42,7 +38,22 @@ local function sparklineLayout(values, width, height, pad)
|
|
|
42
38
|
table.insert(points, _arg0)
|
|
43
39
|
end
|
|
44
40
|
end
|
|
41
|
+
return {
|
|
42
|
+
points = points,
|
|
43
|
+
baseline = pad + innerH,
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
--* Line segments for a number series. Empty and single-point series draw nothing.
|
|
47
|
+
local function sparklineLayout(values, width, height, pad)
|
|
48
|
+
if pad == nil then
|
|
49
|
+
pad = 4
|
|
50
|
+
end
|
|
51
|
+
local laid = sparklinePoints(values, width, height, pad)
|
|
52
|
+
if laid == nil then
|
|
53
|
+
return {}
|
|
54
|
+
end
|
|
45
55
|
local segments = {}
|
|
56
|
+
local count = #laid.points
|
|
46
57
|
do
|
|
47
58
|
local index = 0
|
|
48
59
|
local _shouldIncrement = false
|
|
@@ -55,8 +66,8 @@ local function sparklineLayout(values, width, height, pad)
|
|
|
55
66
|
if not (index < count - 1) then
|
|
56
67
|
break
|
|
57
68
|
end
|
|
58
|
-
local start = points[index + 1]
|
|
59
|
-
local finish = points[index + 2]
|
|
69
|
+
local start = laid.points[index + 1]
|
|
70
|
+
local finish = laid.points[index + 2]
|
|
60
71
|
local dx = finish.x - start.x
|
|
61
72
|
local dy = finish.y - start.y
|
|
62
73
|
local _arg0 = {
|
|
@@ -70,6 +81,119 @@ local function sparklineLayout(values, width, height, pad)
|
|
|
70
81
|
end
|
|
71
82
|
return segments
|
|
72
83
|
end
|
|
84
|
+
--* Vertical slices under the line. Missing when the series cannot draw.
|
|
85
|
+
local function sparklineArea(values, width, height, pad)
|
|
86
|
+
if pad == nil then
|
|
87
|
+
pad = 4
|
|
88
|
+
end
|
|
89
|
+
local laid = sparklinePoints(values, width, height, pad)
|
|
90
|
+
if laid == nil then
|
|
91
|
+
return {}
|
|
92
|
+
end
|
|
93
|
+
local bars = {}
|
|
94
|
+
local count = #laid.points
|
|
95
|
+
do
|
|
96
|
+
local index = 0
|
|
97
|
+
local _shouldIncrement = false
|
|
98
|
+
while true do
|
|
99
|
+
if _shouldIncrement then
|
|
100
|
+
index += 1
|
|
101
|
+
else
|
|
102
|
+
_shouldIncrement = true
|
|
103
|
+
end
|
|
104
|
+
if not (index < count - 1) then
|
|
105
|
+
break
|
|
106
|
+
end
|
|
107
|
+
local start = laid.points[index + 1]
|
|
108
|
+
local finish = laid.points[index + 2]
|
|
109
|
+
local span = finish.x - start.x
|
|
110
|
+
local slices = math.max(1, math.floor(span / 4))
|
|
111
|
+
local sliceW = span / slices
|
|
112
|
+
do
|
|
113
|
+
local slice = 0
|
|
114
|
+
local _shouldIncrement_1 = false
|
|
115
|
+
while true do
|
|
116
|
+
if _shouldIncrement_1 then
|
|
117
|
+
slice += 1
|
|
118
|
+
else
|
|
119
|
+
_shouldIncrement_1 = true
|
|
120
|
+
end
|
|
121
|
+
if not (slice < slices) then
|
|
122
|
+
break
|
|
123
|
+
end
|
|
124
|
+
local y = start.y + (finish.y - start.y) * (slice / slices)
|
|
125
|
+
local top = math.min(y, laid.baseline)
|
|
126
|
+
local _arg0 = {
|
|
127
|
+
x = start.x + slice * sliceW,
|
|
128
|
+
y = top,
|
|
129
|
+
width = sliceW,
|
|
130
|
+
height = math.max(0, laid.baseline - top),
|
|
131
|
+
}
|
|
132
|
+
table.insert(bars, _arg0)
|
|
133
|
+
end
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
return bars
|
|
138
|
+
end
|
|
139
|
+
--* Nearest sample from a local x. Undefined when the trace cannot be hit.
|
|
140
|
+
local function sparklineIndex(localX, count, width, pad)
|
|
141
|
+
if pad == nil then
|
|
142
|
+
pad = 4
|
|
143
|
+
end
|
|
144
|
+
if count < 1 or width <= pad * 2 then
|
|
145
|
+
return nil
|
|
146
|
+
end
|
|
147
|
+
local span = width - pad * 2
|
|
148
|
+
local along = (localX - pad) / span
|
|
149
|
+
if along < 0 then
|
|
150
|
+
along = 0
|
|
151
|
+
end
|
|
152
|
+
if along > 1 then
|
|
153
|
+
along = 1
|
|
154
|
+
end
|
|
155
|
+
if count == 1 then
|
|
156
|
+
return 0
|
|
157
|
+
end
|
|
158
|
+
local index = math.floor(along * (count - 1) + 0.5)
|
|
159
|
+
if index < 0 then
|
|
160
|
+
return 0
|
|
161
|
+
end
|
|
162
|
+
if index > count - 1 then
|
|
163
|
+
return count - 1
|
|
164
|
+
end
|
|
165
|
+
return index
|
|
166
|
+
end
|
|
167
|
+
--* Calls onPick with the nearest sample. Does nothing when the callback is absent.
|
|
168
|
+
local function sparklinePick(localX, count, width, onPick, pad)
|
|
169
|
+
if pad == nil then
|
|
170
|
+
pad = 4
|
|
171
|
+
end
|
|
172
|
+
if onPick == nil then
|
|
173
|
+
return nil
|
|
174
|
+
end
|
|
175
|
+
local index = sparklineIndex(localX, count, width, pad)
|
|
176
|
+
if index == nil then
|
|
177
|
+
return nil
|
|
178
|
+
end
|
|
179
|
+
onPick(index)
|
|
180
|
+
return index
|
|
181
|
+
end
|
|
182
|
+
--* Point for a sample, used to mark the trace.
|
|
183
|
+
local function sparklinePoint(values, index, width, height, pad)
|
|
184
|
+
if pad == nil then
|
|
185
|
+
pad = 4
|
|
186
|
+
end
|
|
187
|
+
local laid = sparklinePoints(values, width, height, pad)
|
|
188
|
+
if laid == nil or index < 0 or index >= #laid.points then
|
|
189
|
+
return nil
|
|
190
|
+
end
|
|
191
|
+
return laid.points[index + 1]
|
|
192
|
+
end
|
|
73
193
|
return {
|
|
74
194
|
sparklineLayout = sparklineLayout,
|
|
195
|
+
sparklineArea = sparklineArea,
|
|
196
|
+
sparklineIndex = sparklineIndex,
|
|
197
|
+
sparklinePick = sparklinePick,
|
|
198
|
+
sparklinePoint = sparklinePoint,
|
|
75
199
|
}
|
|
@@ -5,6 +5,9 @@ local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Ico
|
|
|
5
5
|
local Fab = TS.import(script, script.Parent.Parent.Parent, "fab").Fab
|
|
6
6
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
7
|
local useSpeedDialStyles = TS.import(script, script.Parent, "SpeedDial.styles").default
|
|
8
|
+
local _speedDialLabel = TS.import(script, script.Parent, "speedDialLabel")
|
|
9
|
+
local speedDialLabel = _speedDialLabel.speedDialLabel
|
|
10
|
+
local speedDialLabelFirst = _speedDialLabel.speedDialLabelFirst
|
|
8
11
|
local function SpeedDial(props)
|
|
9
12
|
local _binding = props
|
|
10
13
|
local open = _binding.open
|
|
@@ -27,9 +30,24 @@ local function SpeedDial(props)
|
|
|
27
30
|
local sx = _binding.sx
|
|
28
31
|
local id = _binding.id
|
|
29
32
|
local ref = _binding.ref
|
|
33
|
+
-- ▼ ReadonlyArray.some ▼
|
|
34
|
+
local _result = false
|
|
35
|
+
local _callback = function(action)
|
|
36
|
+
return speedDialLabel(action.label) ~= nil
|
|
37
|
+
end
|
|
38
|
+
for _k, _v in actions do
|
|
39
|
+
if _callback(_v, _k - 1, actions) then
|
|
40
|
+
_result = true
|
|
41
|
+
break
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
-- ▲ ReadonlyArray.some ▲
|
|
45
|
+
local labeled = _result
|
|
30
46
|
local styles = useSpeedDialStyles({
|
|
31
47
|
direction = direction,
|
|
48
|
+
labeled = labeled,
|
|
32
49
|
})
|
|
50
|
+
local labelFirst = speedDialLabelFirst(direction)
|
|
33
51
|
local mainFirst = direction == "down" or direction == "right"
|
|
34
52
|
local mainOrder = if mainFirst then 0 else 1000
|
|
35
53
|
local actionBase = if mainFirst then 1 else 0
|
|
@@ -55,26 +73,55 @@ local function SpeedDial(props)
|
|
|
55
73
|
if _condition_1 then
|
|
56
74
|
-- ▼ ReadonlyArray.map ▼
|
|
57
75
|
local _newValue = table.create(#actions)
|
|
58
|
-
local
|
|
59
|
-
|
|
60
|
-
|
|
76
|
+
local _callback_1 = function(action, index)
|
|
77
|
+
local name = speedDialLabel(action.label)
|
|
78
|
+
local order = actionBase + index
|
|
79
|
+
local button = (React.createElement(Fab, {
|
|
80
|
+
key = if name == nil then `Action-{index}` else "Action",
|
|
61
81
|
icon = action.icon,
|
|
62
82
|
size = "small",
|
|
63
83
|
disabled = disabled == true or action.disabled == true,
|
|
64
84
|
onClick = function()
|
|
65
|
-
local
|
|
66
|
-
if
|
|
67
|
-
|
|
85
|
+
local _result_1 = action.onClick
|
|
86
|
+
if _result_1 ~= nil then
|
|
87
|
+
_result_1()
|
|
68
88
|
end
|
|
69
89
|
onOpenChange(false)
|
|
70
90
|
end,
|
|
71
91
|
className = {
|
|
72
|
-
LayoutOrder =
|
|
92
|
+
LayoutOrder = if name == nil then order elseif labelFirst then 2 else 1,
|
|
73
93
|
},
|
|
74
|
-
})
|
|
94
|
+
}))
|
|
95
|
+
if name == nil then
|
|
96
|
+
return button
|
|
97
|
+
end
|
|
98
|
+
local _attributes_2 = {
|
|
99
|
+
key = `Action-{index}`,
|
|
100
|
+
}
|
|
101
|
+
for _k, _v in styles.action do
|
|
102
|
+
_attributes_2[_k] = _v
|
|
103
|
+
end
|
|
104
|
+
_attributes_2.LayoutOrder = order
|
|
105
|
+
local _attributes_3 = table.clone(styles.actionRow)
|
|
106
|
+
setmetatable(_attributes_3, nil)
|
|
107
|
+
local _exp_1 = React.createElement("uilistlayout", _attributes_3)
|
|
108
|
+
local _attributes_4 = {
|
|
109
|
+
key = "Label",
|
|
110
|
+
}
|
|
111
|
+
for _k, _v in styles.actionLabel do
|
|
112
|
+
_attributes_4[_k] = _v
|
|
113
|
+
end
|
|
114
|
+
_attributes_4.Text = name
|
|
115
|
+
_attributes_4.LayoutOrder = if labelFirst then 1 else 2
|
|
116
|
+
local _attributes_5 = table.clone(styles.actionPad)
|
|
117
|
+
setmetatable(_attributes_5, nil)
|
|
118
|
+
local _exp_2 = React.createElement("uipadding", _attributes_5)
|
|
119
|
+
local _attributes_6 = table.clone(styles.actionCorner)
|
|
120
|
+
setmetatable(_attributes_6, nil)
|
|
121
|
+
return React.createElement("frame", _attributes_2, _exp_1, React.createElement("textlabel", _attributes_4, _exp_2, React.createElement("uicorner", _attributes_6)), button)
|
|
75
122
|
end
|
|
76
123
|
for _k, _v in actions do
|
|
77
|
-
_newValue[_k] =
|
|
124
|
+
_newValue[_k] = _callback_1(_v, _k - 1, actions)
|
|
78
125
|
end
|
|
79
126
|
-- ▲ ReadonlyArray.map ▲
|
|
80
127
|
_condition_1 = (React.createElement(React.Fragment, nil, _newValue))
|
|
@@ -8,8 +8,12 @@ local useSpeedDialStyles = componentStyles("SpeedDial", function(theme, _param)
|
|
|
8
8
|
if direction == nil then
|
|
9
9
|
direction = "up"
|
|
10
10
|
end
|
|
11
|
+
local labeled = _param.labeled
|
|
12
|
+
if labeled == nil then
|
|
13
|
+
labeled = false
|
|
14
|
+
end
|
|
11
15
|
local vertical = direction == "up" or direction == "down"
|
|
12
|
-
|
|
16
|
+
local _object = {
|
|
13
17
|
root = {
|
|
14
18
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
15
19
|
Size = UDim2.fromScale(0, 0),
|
|
@@ -18,12 +22,50 @@ local useSpeedDialStyles = componentStyles("SpeedDial", function(theme, _param)
|
|
|
18
22
|
},
|
|
19
23
|
list = {
|
|
20
24
|
FillDirection = if vertical then Enum.FillDirection.Vertical else Enum.FillDirection.Horizontal,
|
|
21
|
-
HorizontalAlignment = if direction == "left" then Enum.HorizontalAlignment.Right elseif direction == "right" then Enum.HorizontalAlignment.Left else Enum.HorizontalAlignment.Center,
|
|
25
|
+
HorizontalAlignment = if vertical and labeled then Enum.HorizontalAlignment.Right elseif direction == "left" then Enum.HorizontalAlignment.Right elseif direction == "right" then Enum.HorizontalAlignment.Left else Enum.HorizontalAlignment.Center,
|
|
22
26
|
VerticalAlignment = if direction == "up" then Enum.VerticalAlignment.Bottom elseif direction == "down" then Enum.VerticalAlignment.Top else Enum.VerticalAlignment.Center,
|
|
23
27
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
24
28
|
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
25
29
|
},
|
|
26
|
-
|
|
30
|
+
action = {
|
|
31
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
32
|
+
Size = UDim2.fromScale(0, 0),
|
|
33
|
+
BackgroundTransparency = 1,
|
|
34
|
+
BorderSizePixel = 0,
|
|
35
|
+
},
|
|
36
|
+
actionRow = {
|
|
37
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
38
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
39
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
40
|
+
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
local _left = "actionLabel"
|
|
44
|
+
local _object_1 = {
|
|
45
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
46
|
+
Size = UDim2.fromScale(0, 0),
|
|
47
|
+
BackgroundColor3 = theme.palette.surface.paper,
|
|
48
|
+
BorderSizePixel = 0,
|
|
49
|
+
Font = theme.typography.fontFamilies.default,
|
|
50
|
+
}
|
|
51
|
+
local _left_1 = "TextSize"
|
|
52
|
+
local _condition = theme.typography.fontSizes.caption
|
|
53
|
+
if _condition == nil then
|
|
54
|
+
_condition = theme.typography.fontSizes.body
|
|
55
|
+
end
|
|
56
|
+
_object_1[_left_1] = _condition
|
|
57
|
+
_object_1.TextColor3 = theme.palette.text.primary
|
|
58
|
+
_object[_left] = _object_1
|
|
59
|
+
_object.actionPad = {
|
|
60
|
+
PaddingLeft = UDim.new(0, theme.padding.calc(1)),
|
|
61
|
+
PaddingRight = UDim.new(0, theme.padding.calc(1)),
|
|
62
|
+
PaddingTop = UDim.new(0, theme.padding.calc(0.5)),
|
|
63
|
+
PaddingBottom = UDim.new(0, theme.padding.calc(0.5)),
|
|
64
|
+
}
|
|
65
|
+
_object.actionCorner = {
|
|
66
|
+
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
67
|
+
}
|
|
68
|
+
return createStyles(_object)
|
|
27
69
|
end)
|
|
28
70
|
local default = useSpeedDialStyles
|
|
29
71
|
return {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** An empty name stays off the action. */
|
|
2
|
+
export declare function speedDialLabel(text?: string): string | undefined;
|
|
3
|
+
/** The name sits beside the button, opposite the way the dial travels. */
|
|
4
|
+
export declare function speedDialLabelFirst(direction: "up" | "down" | "left" | "right"): direction is "up" | "down" | "right";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* An empty name stays off the action.
|
|
3
|
+
local function speedDialLabel(text)
|
|
4
|
+
if text == nil or text == "" then
|
|
5
|
+
return nil
|
|
6
|
+
end
|
|
7
|
+
return text
|
|
8
|
+
end
|
|
9
|
+
--* The name sits beside the button, opposite the way the dial travels.
|
|
10
|
+
local function speedDialLabelFirst(direction)
|
|
11
|
+
return direction ~= "left"
|
|
12
|
+
end
|
|
13
|
+
return {
|
|
14
|
+
speedDialLabel = speedDialLabel,
|
|
15
|
+
speedDialLabelFirst = speedDialLabelFirst,
|
|
16
|
+
}
|
|
@@ -146,6 +146,11 @@ local function controlsRows()
|
|
|
146
146
|
text = LONG,
|
|
147
147
|
width = NARROW,
|
|
148
148
|
})
|
|
149
|
+
pushPair(out, "Input", "multiline", {
|
|
150
|
+
text = "First line\nSecond line",
|
|
151
|
+
width = NARROW,
|
|
152
|
+
multiline = true,
|
|
153
|
+
})
|
|
149
154
|
pushPair(out, "Input", "sx", {
|
|
150
155
|
variant = "sx",
|
|
151
156
|
})
|
|
@@ -282,6 +287,10 @@ local function editorsRows()
|
|
|
282
287
|
value = "0,0,0",
|
|
283
288
|
disabled = true,
|
|
284
289
|
})
|
|
290
|
+
pushPair(out, "CFrameEditor", "narrow", {
|
|
291
|
+
value = "0,0,0",
|
|
292
|
+
width = 320,
|
|
293
|
+
})
|
|
285
294
|
pushPair(out, "CFrameEditor", "sx", {
|
|
286
295
|
value = "0,0,0",
|
|
287
296
|
})
|
|
@@ -3,6 +3,8 @@ export interface StepperProps {
|
|
|
3
3
|
steps: string[];
|
|
4
4
|
activeStep: number;
|
|
5
5
|
orientation?: "horizontal" | "vertical";
|
|
6
|
+
errorStep?: number;
|
|
7
|
+
onStep?: (index: number) => void;
|
|
6
8
|
}
|
|
7
9
|
declare function Stepper(props: CustomizedProps<Frame, StepperProps>): JSX.Element;
|
|
8
10
|
export default Stepper;
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
|
-
local
|
|
5
|
+
local _stepState = TS.import(script, script.Parent, "stepState")
|
|
6
|
+
local stepPress = _stepState.stepPress
|
|
7
|
+
local stepState = _stepState.stepState
|
|
6
8
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
9
|
local useStepperStyles = TS.import(script, script.Parent, "Stepper.styles").default
|
|
8
10
|
local function Stepper(props)
|
|
@@ -13,6 +15,8 @@ local function Stepper(props)
|
|
|
13
15
|
if orientation == nil then
|
|
14
16
|
orientation = "horizontal"
|
|
15
17
|
end
|
|
18
|
+
local errorStep = _binding.errorStep
|
|
19
|
+
local onStep = _binding.onStep
|
|
16
20
|
local className = _binding.className
|
|
17
21
|
local sx = _binding.sx
|
|
18
22
|
local id = _binding.id
|
|
@@ -37,17 +41,41 @@ local function Stepper(props)
|
|
|
37
41
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
38
42
|
-- ▼ ReadonlyArray.map ▼
|
|
39
43
|
local _newValue = table.create(#steps)
|
|
40
|
-
local _callback = function(
|
|
41
|
-
local state = stepState(index, activeStep)
|
|
44
|
+
local _callback = function(title, index)
|
|
45
|
+
local state = stepState(index, activeStep, errorStep)
|
|
46
|
+
local caption = `{index + 1}. {title}`
|
|
47
|
+
local look = cx(styles.step, state == "active" and styles.active, state == "complete" and styles.complete, state == "error" and styles.error)
|
|
48
|
+
local press = if onStep ~= nil then stepPress(index, activeStep) else nil
|
|
49
|
+
if onStep == nil then
|
|
50
|
+
local _attributes_2 = {
|
|
51
|
+
key = `{title}-{index}`,
|
|
52
|
+
}
|
|
53
|
+
for _k, _v in look do
|
|
54
|
+
_attributes_2[_k] = _v
|
|
55
|
+
end
|
|
56
|
+
_attributes_2.Text = caption
|
|
57
|
+
_attributes_2.LayoutOrder = index
|
|
58
|
+
return React.createElement("textlabel", _attributes_2)
|
|
59
|
+
end
|
|
42
60
|
local _attributes_2 = {
|
|
43
|
-
key = `{
|
|
61
|
+
key = `{title}-{index}`,
|
|
44
62
|
}
|
|
45
|
-
for _k, _v in
|
|
63
|
+
for _k, _v in look do
|
|
46
64
|
_attributes_2[_k] = _v
|
|
47
65
|
end
|
|
48
|
-
_attributes_2.Text =
|
|
66
|
+
_attributes_2.Text = caption
|
|
49
67
|
_attributes_2.LayoutOrder = index
|
|
50
|
-
|
|
68
|
+
_attributes_2.AutoButtonColor = false
|
|
69
|
+
_attributes_2.Active = press ~= nil
|
|
70
|
+
_attributes_2.Selectable = press ~= nil
|
|
71
|
+
_attributes_2.Event = {
|
|
72
|
+
Activated = function()
|
|
73
|
+
if press ~= nil then
|
|
74
|
+
onStep(press)
|
|
75
|
+
end
|
|
76
|
+
end,
|
|
77
|
+
}
|
|
78
|
+
return React.createElement("textbutton", _attributes_2)
|
|
51
79
|
end
|
|
52
80
|
for _k, _v in steps do
|
|
53
81
|
_newValue[_k] = _callback(_v, _k - 1, steps)
|
|
@@ -35,6 +35,9 @@ local useStepperStyles = componentStyles("Stepper", function(theme, _param)
|
|
|
35
35
|
complete = {
|
|
36
36
|
TextColor3 = theme.palette.text.primary,
|
|
37
37
|
},
|
|
38
|
+
error = {
|
|
39
|
+
TextColor3 = theme.palette.status.error.main,
|
|
40
|
+
},
|
|
38
41
|
})
|
|
39
42
|
end)
|
|
40
43
|
local default = useStepperStyles
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export type StepState = "complete" | "active" | "pending";
|
|
2
|
-
export declare function stepState(index: number, activeStep: number): StepState;
|
|
1
|
+
export type StepState = "complete" | "active" | "pending" | "error";
|
|
2
|
+
export declare function stepState(index: number, activeStep: number, errorStep?: number): StepState;
|
|
3
|
+
/** Completed and current steps can be pressed. A later step cannot. */
|
|
4
|
+
export declare function stepPress(index: number, activeStep: number): number | undefined;
|