@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
|
@@ -0,0 +1,99 @@
|
|
|
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 cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
|
+
local useTimelineStyles = TS.import(script, script.Parent, "Timeline.styles").default
|
|
7
|
+
local _timelineRail = TS.import(script, script.Parent, "timelineRail")
|
|
8
|
+
local timelineRail = _timelineRail.timelineRail
|
|
9
|
+
local timelineTone = _timelineRail.timelineTone
|
|
10
|
+
local function Timeline(props)
|
|
11
|
+
local _binding = props
|
|
12
|
+
local items = _binding.items
|
|
13
|
+
local className = _binding.className
|
|
14
|
+
local sx = _binding.sx
|
|
15
|
+
local id = _binding.id
|
|
16
|
+
local ref = _binding.ref
|
|
17
|
+
local styles = useTimelineStyles()
|
|
18
|
+
local count = #items
|
|
19
|
+
local _attributes = {
|
|
20
|
+
tag = "frame",
|
|
21
|
+
}
|
|
22
|
+
local _condition = id
|
|
23
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
24
|
+
_condition = "Timeline"
|
|
25
|
+
end
|
|
26
|
+
_attributes.key = _condition
|
|
27
|
+
_attributes.hostRef = ref
|
|
28
|
+
_attributes.base = styles.root
|
|
29
|
+
_attributes.className = className
|
|
30
|
+
_attributes.sx = sx
|
|
31
|
+
local _attributes_1 = table.clone(styles.list)
|
|
32
|
+
setmetatable(_attributes_1, nil)
|
|
33
|
+
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
34
|
+
-- ▼ ReadonlyArray.map ▼
|
|
35
|
+
local _newValue = table.create(#items)
|
|
36
|
+
local _callback = function(item, index)
|
|
37
|
+
local tone = timelineTone(item.tone)
|
|
38
|
+
local mark = if tone == "done" then styles.done elseif tone == "active" then styles.active elseif tone == "error" then styles.error else styles.pending
|
|
39
|
+
local caption = item.caption
|
|
40
|
+
local _attributes_2 = {
|
|
41
|
+
key = `{item.title}-{index}`,
|
|
42
|
+
}
|
|
43
|
+
for _k, _v in styles.item do
|
|
44
|
+
_attributes_2[_k] = _v
|
|
45
|
+
end
|
|
46
|
+
_attributes_2.LayoutOrder = index
|
|
47
|
+
local _attributes_3 = table.clone(styles.row)
|
|
48
|
+
setmetatable(_attributes_3, nil)
|
|
49
|
+
local _exp_1 = React.createElement("uilistlayout", _attributes_3)
|
|
50
|
+
local _attributes_4 = table.clone(styles.rail)
|
|
51
|
+
setmetatable(_attributes_4, nil)
|
|
52
|
+
local _result
|
|
53
|
+
if timelineRail(index, count) then
|
|
54
|
+
local _attributes_5 = table.clone(styles.line)
|
|
55
|
+
setmetatable(_attributes_5, nil)
|
|
56
|
+
_result = React.createElement("frame", _attributes_5)
|
|
57
|
+
else
|
|
58
|
+
_result = nil
|
|
59
|
+
end
|
|
60
|
+
local _attributes_5 = table.clone(cx(styles.dot, mark))
|
|
61
|
+
setmetatable(_attributes_5, nil)
|
|
62
|
+
local _exp_2 = React.createElement("frame", _attributes_4, _result, React.createElement("frame", _attributes_5, React.createElement("uicorner", {
|
|
63
|
+
CornerRadius = UDim.new(1, 0),
|
|
64
|
+
})))
|
|
65
|
+
local _attributes_6 = table.clone(styles.body)
|
|
66
|
+
setmetatable(_attributes_6, nil)
|
|
67
|
+
local _attributes_7 = table.clone(styles.bodyPad)
|
|
68
|
+
setmetatable(_attributes_7, nil)
|
|
69
|
+
local _exp_3 = React.createElement("uipadding", _attributes_7)
|
|
70
|
+
local _attributes_8 = table.clone(styles.bodyList)
|
|
71
|
+
setmetatable(_attributes_8, nil)
|
|
72
|
+
local _exp_4 = React.createElement("uilistlayout", _attributes_8)
|
|
73
|
+
local _attributes_9 = table.clone(styles.title)
|
|
74
|
+
setmetatable(_attributes_9, nil)
|
|
75
|
+
_attributes_9.Text = item.title
|
|
76
|
+
_attributes_9.LayoutOrder = 0
|
|
77
|
+
local _exp_5 = React.createElement("textlabel", _attributes_9)
|
|
78
|
+
local _result_1
|
|
79
|
+
if caption ~= nil and #caption > 0 then
|
|
80
|
+
local _attributes_10 = table.clone(styles.caption)
|
|
81
|
+
setmetatable(_attributes_10, nil)
|
|
82
|
+
_attributes_10.Text = caption
|
|
83
|
+
_attributes_10.LayoutOrder = 1
|
|
84
|
+
_result_1 = (React.createElement("textlabel", _attributes_10))
|
|
85
|
+
else
|
|
86
|
+
_result_1 = nil
|
|
87
|
+
end
|
|
88
|
+
return React.createElement("frame", _attributes_2, _exp_1, _exp_2, React.createElement("frame", _attributes_6, _exp_3, _exp_4, _exp_5, _result_1))
|
|
89
|
+
end
|
|
90
|
+
for _k, _v in items do
|
|
91
|
+
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
92
|
+
end
|
|
93
|
+
-- ▲ ReadonlyArray.map ▲
|
|
94
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
95
|
+
end
|
|
96
|
+
local default = Timeline
|
|
97
|
+
return {
|
|
98
|
+
default = default,
|
|
99
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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 useTimelineStyles = componentStyles("Timeline", function(theme)
|
|
7
|
+
local dot = theme.spacing.calc(1.5)
|
|
8
|
+
local rail = theme.spacing.calc(2)
|
|
9
|
+
return createStyles({
|
|
10
|
+
root = {
|
|
11
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
12
|
+
Size = UDim2.fromScale(0, 0),
|
|
13
|
+
BackgroundTransparency = 1,
|
|
14
|
+
BorderSizePixel = 0,
|
|
15
|
+
},
|
|
16
|
+
list = {
|
|
17
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
18
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
19
|
+
Padding = UDim.new(0, 0),
|
|
20
|
+
},
|
|
21
|
+
item = {
|
|
22
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
23
|
+
Size = UDim2.fromScale(0, 0),
|
|
24
|
+
BackgroundTransparency = 1,
|
|
25
|
+
BorderSizePixel = 0,
|
|
26
|
+
},
|
|
27
|
+
row = {
|
|
28
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
29
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
30
|
+
ItemLineAlignment = Enum.ItemLineAlignment.Stretch,
|
|
31
|
+
Padding = UDim.new(0, theme.spacing.calc(1)),
|
|
32
|
+
},
|
|
33
|
+
rail = {
|
|
34
|
+
Size = UDim2.fromOffset(rail, 0),
|
|
35
|
+
LayoutOrder = 0,
|
|
36
|
+
BackgroundTransparency = 1,
|
|
37
|
+
BorderSizePixel = 0,
|
|
38
|
+
},
|
|
39
|
+
dot = {
|
|
40
|
+
AnchorPoint = Vector2.new(0.5, 0),
|
|
41
|
+
Position = UDim2.new(0.5, 0, 0, 2),
|
|
42
|
+
Size = UDim2.fromOffset(dot, dot),
|
|
43
|
+
BorderSizePixel = 0,
|
|
44
|
+
ZIndex = 2,
|
|
45
|
+
},
|
|
46
|
+
done = {
|
|
47
|
+
BackgroundColor3 = theme.palette.status.success.main,
|
|
48
|
+
},
|
|
49
|
+
active = {
|
|
50
|
+
BackgroundColor3 = theme.palette.primary.main,
|
|
51
|
+
},
|
|
52
|
+
pending = {
|
|
53
|
+
BackgroundColor3 = theme.palette.text.disabled,
|
|
54
|
+
},
|
|
55
|
+
error = {
|
|
56
|
+
BackgroundColor3 = theme.palette.status.error.main,
|
|
57
|
+
},
|
|
58
|
+
line = {
|
|
59
|
+
AnchorPoint = Vector2.new(0.5, 0),
|
|
60
|
+
Position = UDim2.new(0.5, 0, 0, dot + 2),
|
|
61
|
+
Size = UDim2.new(0, 2, 1, -(dot + 2)),
|
|
62
|
+
BackgroundColor3 = theme.palette.divider,
|
|
63
|
+
BorderSizePixel = 0,
|
|
64
|
+
ZIndex = 1,
|
|
65
|
+
},
|
|
66
|
+
body = {
|
|
67
|
+
LayoutOrder = 1,
|
|
68
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
69
|
+
Size = UDim2.fromScale(0, 0),
|
|
70
|
+
BackgroundTransparency = 1,
|
|
71
|
+
BorderSizePixel = 0,
|
|
72
|
+
},
|
|
73
|
+
bodyPad = {
|
|
74
|
+
PaddingBottom = UDim.new(0, theme.padding.calc(2)),
|
|
75
|
+
},
|
|
76
|
+
bodyList = {
|
|
77
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
78
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
79
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
80
|
+
},
|
|
81
|
+
title = {
|
|
82
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
83
|
+
Size = UDim2.fromScale(0, 0),
|
|
84
|
+
BackgroundTransparency = 1,
|
|
85
|
+
BorderSizePixel = 0,
|
|
86
|
+
Font = theme.typography.fontFamilies.default,
|
|
87
|
+
TextSize = theme.typography.fontSizes.body,
|
|
88
|
+
TextColor3 = theme.palette.text.primary,
|
|
89
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
90
|
+
},
|
|
91
|
+
caption = {
|
|
92
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
93
|
+
Size = UDim2.fromScale(0, 0),
|
|
94
|
+
BackgroundTransparency = 1,
|
|
95
|
+
BorderSizePixel = 0,
|
|
96
|
+
Font = theme.typography.fontFamilies.default,
|
|
97
|
+
TextSize = theme.typography.fontSizes.caption,
|
|
98
|
+
TextColor3 = theme.palette.text.secondary,
|
|
99
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
100
|
+
},
|
|
101
|
+
})
|
|
102
|
+
end)
|
|
103
|
+
local default = useTimelineStyles
|
|
104
|
+
return {
|
|
105
|
+
default = default,
|
|
106
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type TimelineTone = "done" | "active" | "pending" | "error";
|
|
2
|
+
export declare function timelineTone(tone?: string): TimelineTone;
|
|
3
|
+
/** Connector under an item. The last item, and a list shorter than two, has none. */
|
|
4
|
+
export declare function timelineRail(index: number, count: number): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function timelineTone(tone)
|
|
3
|
+
if tone == "done" or tone == "active" or tone == "error" or tone == "pending" then
|
|
4
|
+
return tone
|
|
5
|
+
end
|
|
6
|
+
return "pending"
|
|
7
|
+
end
|
|
8
|
+
--* Connector under an item. The last item, and a list shorter than two, has none.
|
|
9
|
+
local function timelineRail(index, count)
|
|
10
|
+
return index >= 0 and count > 1 and index < count - 1
|
|
11
|
+
end
|
|
12
|
+
return {
|
|
13
|
+
timelineTone = timelineTone,
|
|
14
|
+
timelineRail = timelineRail,
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.Timeline = TS.import(script, script, "components", "Timeline").default
|
|
5
|
+
local _timelineRail = TS.import(script, script, "components", "timelineRail")
|
|
6
|
+
exports.timelineRail = _timelineRail.timelineRail
|
|
7
|
+
exports.timelineTone = _timelineRail.timelineTone
|
|
8
|
+
return exports
|
|
@@ -5,11 +5,15 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
5
5
|
local React = _react
|
|
6
6
|
local useEffect = _react.useEffect
|
|
7
7
|
local useRef = _react.useRef
|
|
8
|
-
local
|
|
8
|
+
local TextService = TS.import(script, TS.getModule(script, "@rbxts", "services")).TextService
|
|
9
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
10
|
+
local DEFAULT_THEME = _theme.DEFAULT_THEME
|
|
11
|
+
local useTheme = _theme.useTheme
|
|
9
12
|
local Directions = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Directions
|
|
10
13
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
11
14
|
local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
|
|
12
15
|
local useToastStyles = TS.import(script, script.Parent, "Toast.styles").default
|
|
16
|
+
local toastWrap = TS.import(script, script.Parent, "toastPlace").toastWrap
|
|
13
17
|
local TWEEN_DURATION = 0.5
|
|
14
18
|
local function Toast(props)
|
|
15
19
|
local _binding = props
|
|
@@ -32,7 +36,47 @@ local function Toast(props)
|
|
|
32
36
|
local actionStyle = _binding_1.action
|
|
33
37
|
local activePosition = _binding_1.activePosition
|
|
34
38
|
local inActivePosition = _binding_1.inActivePosition
|
|
39
|
+
local _binding_2 = useTheme()
|
|
40
|
+
local theme = _binding_2.theme
|
|
35
41
|
local frameRef = useRef()
|
|
42
|
+
local font = theme.typography.fontFamilies.default or Enum.Font.SourceSans
|
|
43
|
+
local _condition = theme.typography.fontSizes.body
|
|
44
|
+
if _condition == nil then
|
|
45
|
+
_condition = 14
|
|
46
|
+
end
|
|
47
|
+
local textSize = _condition
|
|
48
|
+
local actionSlot = if action ~= nil and #action > 0 then theme.spacing.calc(8) else 0
|
|
49
|
+
local box = theme.spacing.calc(20) - theme.padding.calc(4) - actionSlot
|
|
50
|
+
local bounds = TextService:GetTextSize(text, textSize, font, Vector2.new(10000, 100))
|
|
51
|
+
local wrap = toastWrap(bounds.X, box)
|
|
52
|
+
local pad = theme.padding.calc(2)
|
|
53
|
+
local _result
|
|
54
|
+
if wrap then
|
|
55
|
+
local _object = table.clone(container)
|
|
56
|
+
setmetatable(_object, nil)
|
|
57
|
+
_object.AutomaticSize = Enum.AutomaticSize.Y
|
|
58
|
+
_result = _object
|
|
59
|
+
else
|
|
60
|
+
_result = container
|
|
61
|
+
end
|
|
62
|
+
local boxStyle = _result
|
|
63
|
+
local _result_1
|
|
64
|
+
if wrap then
|
|
65
|
+
local _object = table.clone(label)
|
|
66
|
+
setmetatable(_object, nil)
|
|
67
|
+
_object.TextWrapped = true
|
|
68
|
+
_object.TextTruncate = Enum.TextTruncate.None
|
|
69
|
+
_object.AutomaticSize = Enum.AutomaticSize.Y
|
|
70
|
+
_object.Size = UDim2.new(1, -(theme.padding.calc(4) + actionSlot), 0, 0)
|
|
71
|
+
_object.AnchorPoint = Vector2.new(0, 0)
|
|
72
|
+
_object.Position = UDim2.new(0, pad, 0, pad)
|
|
73
|
+
_object.TextXAlignment = Enum.TextXAlignment.Left
|
|
74
|
+
_object.TextYAlignment = Enum.TextYAlignment.Top
|
|
75
|
+
_result_1 = _object
|
|
76
|
+
else
|
|
77
|
+
_result_1 = label
|
|
78
|
+
end
|
|
79
|
+
local labelStyle = _result_1
|
|
36
80
|
local tween = function(direction)
|
|
37
81
|
local frame = frameRef.current
|
|
38
82
|
if not frame then
|
|
@@ -64,11 +108,11 @@ local function Toast(props)
|
|
|
64
108
|
local _attributes = {
|
|
65
109
|
tag = "frame",
|
|
66
110
|
}
|
|
67
|
-
local
|
|
68
|
-
if not (
|
|
69
|
-
|
|
111
|
+
local _condition_1 = id
|
|
112
|
+
if not (_condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1) then
|
|
113
|
+
_condition_1 = "Toast"
|
|
70
114
|
end
|
|
71
|
-
_attributes.key =
|
|
115
|
+
_attributes.key = _condition_1
|
|
72
116
|
_attributes.hostRef = function(instance)
|
|
73
117
|
frameRef.current = instance
|
|
74
118
|
if ref == nil then
|
|
@@ -80,7 +124,7 @@ local function Toast(props)
|
|
|
80
124
|
end
|
|
81
125
|
ref.current = instance
|
|
82
126
|
end
|
|
83
|
-
_attributes.base =
|
|
127
|
+
_attributes.base = boxStyle
|
|
84
128
|
_attributes.className = className
|
|
85
129
|
_attributes.sx = sx
|
|
86
130
|
local _exp = React.createElement("uicorner", {
|
|
@@ -88,16 +132,19 @@ local function Toast(props)
|
|
|
88
132
|
CornerRadius = UDim.new(0, DEFAULT_THEME.shape.borderRadius),
|
|
89
133
|
})
|
|
90
134
|
local _exp_1 = React.createElement(Shadow)
|
|
135
|
+
local _exp_2 = wrap and React.createElement("uipadding", {
|
|
136
|
+
PaddingBottom = UDim.new(0, pad),
|
|
137
|
+
})
|
|
91
138
|
local _attributes_1 = {
|
|
92
139
|
key = "Label",
|
|
93
140
|
}
|
|
94
|
-
for _k, _v in
|
|
141
|
+
for _k, _v in labelStyle do
|
|
95
142
|
_attributes_1[_k] = _v
|
|
96
143
|
end
|
|
97
144
|
_attributes_1.Text = text
|
|
98
|
-
local
|
|
99
|
-
local
|
|
100
|
-
if
|
|
145
|
+
local _exp_3 = React.createElement("textlabel", _attributes_1)
|
|
146
|
+
local _condition_2 = action ~= nil and #action > 0
|
|
147
|
+
if _condition_2 then
|
|
101
148
|
local _attributes_2 = {
|
|
102
149
|
key = "Action",
|
|
103
150
|
}
|
|
@@ -116,7 +163,7 @@ local function Toast(props)
|
|
|
116
163
|
end
|
|
117
164
|
end,
|
|
118
165
|
}
|
|
119
|
-
|
|
166
|
+
_condition_2 = (React.createElement("textbutton", _attributes_2))
|
|
120
167
|
end
|
|
121
168
|
local _attributes_2 = {
|
|
122
169
|
key = "Close",
|
|
@@ -132,7 +179,7 @@ local function Toast(props)
|
|
|
132
179
|
end
|
|
133
180
|
end,
|
|
134
181
|
}
|
|
135
|
-
return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_2,
|
|
182
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_2, _exp_3, _condition_2, React.createElement("imagebutton", _attributes_2))
|
|
136
183
|
end
|
|
137
184
|
local default = Toast
|
|
138
185
|
return {
|
|
@@ -6,12 +6,14 @@ local componentStyles = _theme.componentStyles
|
|
|
6
6
|
local DEFAULT_THEME = _theme.DEFAULT_THEME
|
|
7
7
|
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
8
8
|
local ToastVariants = TS.import(script, script.Parent.Parent, "enums", "ToastVariants").default
|
|
9
|
+
local toastPlace = TS.import(script, script.Parent, "toastPlace").toastPlace
|
|
9
10
|
local useToastStyles = componentStyles("Toast", function(theme, _param)
|
|
10
11
|
local variant = _param.variant
|
|
11
12
|
if variant == nil then
|
|
12
13
|
variant = ToastVariants.default
|
|
13
14
|
end
|
|
14
15
|
local action = _param.action
|
|
16
|
+
local edge = _param.edge
|
|
15
17
|
local getToastColors = function()
|
|
16
18
|
repeat
|
|
17
19
|
if variant == (ToastVariants.success) then
|
|
@@ -41,14 +43,15 @@ local useToastStyles = componentStyles("Toast", function(theme, _param)
|
|
|
41
43
|
local toastColors = getToastColors()
|
|
42
44
|
local hasAction = action ~= nil and #action > 0
|
|
43
45
|
local actionSlot = if hasAction then theme.spacing.calc(8) else 0
|
|
44
|
-
local
|
|
45
|
-
local
|
|
46
|
+
local place = toastPlace(edge, DEFAULT_THEME.padding.calc(2), DEFAULT_THEME.spacing.calc(20) + DEFAULT_THEME.padding.calc(2))
|
|
47
|
+
local ACTIVE_POSITION = UDim2.new(0.5, 0, place.activeY, place.activeOffset)
|
|
48
|
+
local INACTIVE_POSITION = UDim2.new(0.5, 0, place.idleY, place.idleOffset)
|
|
46
49
|
return createStyles({
|
|
47
50
|
container = {
|
|
48
51
|
Size = UDim2.new(0, theme.spacing.calc(20), 0, theme.spacing.calc(4)),
|
|
49
52
|
Position = ACTIVE_POSITION,
|
|
50
53
|
BackgroundColor3 = toastColors.background,
|
|
51
|
-
AnchorPoint = Vector2.new(0.5,
|
|
54
|
+
AnchorPoint = Vector2.new(0.5, place.anchorY),
|
|
52
55
|
BorderSizePixel = 0,
|
|
53
56
|
ZIndex = 50000,
|
|
54
57
|
},
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ToastEdge = "top" | "bottom";
|
|
2
|
+
export interface ToastPlace {
|
|
3
|
+
anchorY: number;
|
|
4
|
+
activeY: number;
|
|
5
|
+
activeOffset: number;
|
|
6
|
+
idleY: number;
|
|
7
|
+
idleOffset: number;
|
|
8
|
+
}
|
|
9
|
+
/** Bottom stays the default. Top sits on the upper edge and hides above the frame. */
|
|
10
|
+
export declare function toastPlace(edge: ToastEdge | undefined, inset: number, hidden: number): ToastPlace;
|
|
11
|
+
/** A line wider than the toast wraps. A short line stays one row. */
|
|
12
|
+
export declare function toastWrap(textWidth: number, box: number): boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* Bottom stays the default. Top sits on the upper edge and hides above the frame.
|
|
3
|
+
local function toastPlace(edge, inset, hidden)
|
|
4
|
+
if edge == "top" then
|
|
5
|
+
return {
|
|
6
|
+
anchorY = 0,
|
|
7
|
+
activeY = 0,
|
|
8
|
+
activeOffset = inset,
|
|
9
|
+
idleY = 0,
|
|
10
|
+
idleOffset = -hidden,
|
|
11
|
+
}
|
|
12
|
+
end
|
|
13
|
+
return {
|
|
14
|
+
anchorY = 1,
|
|
15
|
+
activeY = 1,
|
|
16
|
+
activeOffset = -inset,
|
|
17
|
+
idleY = 1,
|
|
18
|
+
idleOffset = hidden,
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
--* A line wider than the toast wraps. A short line stays one row.
|
|
22
|
+
local function toastWrap(textWidth, box)
|
|
23
|
+
if box <= 0 then
|
|
24
|
+
return false
|
|
25
|
+
end
|
|
26
|
+
return textWidth > box
|
|
27
|
+
end
|
|
28
|
+
return {
|
|
29
|
+
toastPlace = toastPlace,
|
|
30
|
+
toastWrap = toastWrap,
|
|
31
|
+
}
|
|
@@ -10,9 +10,12 @@ local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "t
|
|
|
10
10
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
11
11
|
local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
|
|
12
12
|
local useTooltipStyles = TS.import(script, script.Parent, "Tooltip.styles").default
|
|
13
|
+
local tooltipBox = TS.import(script, script.Parent, "tooltipBox").tooltipBox
|
|
14
|
+
local pointerInside = TS.import(script, script.Parent, "tooltipPointer").pointerInside
|
|
13
15
|
local function Tooltip(props)
|
|
14
16
|
local _binding = props
|
|
15
17
|
local text = _binding.text
|
|
18
|
+
local title = _binding.title
|
|
16
19
|
local delay = _binding.delay
|
|
17
20
|
if delay == nil then
|
|
18
21
|
delay = 0.4
|
|
@@ -36,9 +39,36 @@ local function Tooltip(props)
|
|
|
36
39
|
end
|
|
37
40
|
local textSize = _condition
|
|
38
41
|
local font = theme.typography.fontFamilies.default or Enum.Font.SourceSans
|
|
39
|
-
local
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
local _condition_1 = title
|
|
43
|
+
if _condition_1 == nil then
|
|
44
|
+
_condition_1 = ""
|
|
45
|
+
end
|
|
46
|
+
local heading = _condition_1
|
|
47
|
+
local limit = Vector2.new(theme.spacing.calc(24), 10000)
|
|
48
|
+
local textBounds = TextService:GetTextSize(text, textSize, font, limit)
|
|
49
|
+
local titleFont = theme.typography.fontFamilies.semibold or font
|
|
50
|
+
local titleBounds = if heading ~= "" then TextService:GetTextSize(heading, textSize, titleFont, limit) else nil
|
|
51
|
+
local _exp = textBounds.X
|
|
52
|
+
local _exp_1 = textBounds.Y
|
|
53
|
+
local _result = titleBounds
|
|
54
|
+
if _result ~= nil then
|
|
55
|
+
_result = _result.X
|
|
56
|
+
end
|
|
57
|
+
local _condition_2 = _result
|
|
58
|
+
if _condition_2 == nil then
|
|
59
|
+
_condition_2 = 0
|
|
60
|
+
end
|
|
61
|
+
local _result_1 = titleBounds
|
|
62
|
+
if _result_1 ~= nil then
|
|
63
|
+
_result_1 = _result_1.Y
|
|
64
|
+
end
|
|
65
|
+
local _condition_3 = _result_1
|
|
66
|
+
if _condition_3 == nil then
|
|
67
|
+
_condition_3 = 0
|
|
68
|
+
end
|
|
69
|
+
local box = tooltipBox(_exp, _exp_1, _condition_2, _condition_3, padX, padY, if heading ~= "" then padY else 0)
|
|
70
|
+
local tipWidth = box.width
|
|
71
|
+
local tipHeight = box.height
|
|
42
72
|
local anchor, setAnchor = useState()
|
|
43
73
|
local shown, setShown = useState(false)
|
|
44
74
|
local pending = useRef()
|
|
@@ -54,11 +84,11 @@ local function Tooltip(props)
|
|
|
54
84
|
local _attributes = {
|
|
55
85
|
tag = "frame",
|
|
56
86
|
}
|
|
57
|
-
local
|
|
58
|
-
if not (
|
|
59
|
-
|
|
87
|
+
local _condition_4 = id
|
|
88
|
+
if not (_condition_4 ~= 0 and _condition_4 == _condition_4 and _condition_4 ~= "" and _condition_4) then
|
|
89
|
+
_condition_4 = "Tooltip"
|
|
60
90
|
end
|
|
61
|
-
_attributes.key =
|
|
91
|
+
_attributes.key = _condition_4
|
|
62
92
|
_attributes.hostRef = ref
|
|
63
93
|
_attributes.base = styles.root
|
|
64
94
|
_attributes.className = className
|
|
@@ -72,39 +102,87 @@ local function Tooltip(props)
|
|
|
72
102
|
setShown(true)
|
|
73
103
|
end)
|
|
74
104
|
end,
|
|
75
|
-
MouseLeave = function()
|
|
105
|
+
MouseLeave = function(rbx, x, y)
|
|
106
|
+
if pointerInside(rbx.AbsolutePosition.X, rbx.AbsolutePosition.Y, rbx.AbsoluteSize.X, rbx.AbsoluteSize.Y, x, y) then
|
|
107
|
+
return nil
|
|
108
|
+
end
|
|
76
109
|
cancel()
|
|
77
110
|
setShown(false)
|
|
78
111
|
end,
|
|
79
112
|
}
|
|
80
|
-
local
|
|
81
|
-
local
|
|
82
|
-
if
|
|
83
|
-
local
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
113
|
+
local _exp_2 = children
|
|
114
|
+
local _condition_5 = shown and (text ~= "" or heading ~= "")
|
|
115
|
+
if _condition_5 then
|
|
116
|
+
local _result_2
|
|
117
|
+
if heading == "" then
|
|
118
|
+
local _attributes_1 = {
|
|
119
|
+
key = "Tip",
|
|
120
|
+
}
|
|
121
|
+
for _k, _v in styles.label do
|
|
122
|
+
_attributes_1[_k] = _v
|
|
123
|
+
end
|
|
124
|
+
_attributes_1.Text = text
|
|
125
|
+
_attributes_1.Size = UDim2.fromScale(1, 1)
|
|
126
|
+
_attributes_1.AutomaticSize = Enum.AutomaticSize.None
|
|
127
|
+
_attributes_1.TextWrapped = true
|
|
128
|
+
local _attributes_2 = table.clone(styles.padding)
|
|
129
|
+
setmetatable(_attributes_2, nil)
|
|
130
|
+
local _exp_3 = React.createElement("uipadding", _attributes_2)
|
|
131
|
+
local _attributes_3 = table.clone(styles.corner)
|
|
132
|
+
setmetatable(_attributes_3, nil)
|
|
133
|
+
local _exp_4 = React.createElement("uicorner", _attributes_3)
|
|
134
|
+
local _attributes_4 = table.clone(styles.stroke)
|
|
135
|
+
setmetatable(_attributes_4, nil)
|
|
136
|
+
_result_2 = (React.createElement("textlabel", _attributes_1, _exp_3, _exp_4, React.createElement("uistroke", _attributes_4)))
|
|
137
|
+
else
|
|
138
|
+
local _attributes_1 = {
|
|
139
|
+
key = "Tip",
|
|
140
|
+
}
|
|
141
|
+
for _k, _v in styles.shell do
|
|
142
|
+
_attributes_1[_k] = _v
|
|
143
|
+
end
|
|
144
|
+
local _attributes_2 = table.clone(styles.padding)
|
|
145
|
+
setmetatable(_attributes_2, nil)
|
|
146
|
+
local _exp_3 = React.createElement("uipadding", _attributes_2)
|
|
147
|
+
local _attributes_3 = table.clone(styles.corner)
|
|
148
|
+
setmetatable(_attributes_3, nil)
|
|
149
|
+
local _exp_4 = React.createElement("uicorner", _attributes_3)
|
|
150
|
+
local _attributes_4 = table.clone(styles.stroke)
|
|
151
|
+
setmetatable(_attributes_4, nil)
|
|
152
|
+
local _exp_5 = React.createElement("uistroke", _attributes_4)
|
|
153
|
+
local _attributes_5 = table.clone(styles.stack)
|
|
154
|
+
setmetatable(_attributes_5, nil)
|
|
155
|
+
local _exp_6 = React.createElement("uilistlayout", _attributes_5)
|
|
156
|
+
local _attributes_6 = {
|
|
157
|
+
key = "Title",
|
|
158
|
+
}
|
|
159
|
+
for _k, _v in styles.title do
|
|
160
|
+
_attributes_6[_k] = _v
|
|
161
|
+
end
|
|
162
|
+
_attributes_6.Text = heading
|
|
163
|
+
_attributes_6.LayoutOrder = 0
|
|
164
|
+
local _exp_7 = React.createElement("textlabel", _attributes_6)
|
|
165
|
+
local _condition_6 = text ~= ""
|
|
166
|
+
if _condition_6 then
|
|
167
|
+
local _attributes_7 = {
|
|
168
|
+
key = "Body",
|
|
169
|
+
}
|
|
170
|
+
for _k, _v in styles.body do
|
|
171
|
+
_attributes_7[_k] = _v
|
|
172
|
+
end
|
|
173
|
+
_attributes_7.Text = text
|
|
174
|
+
_attributes_7.LayoutOrder = 1
|
|
175
|
+
_condition_6 = React.createElement("textlabel", _attributes_7)
|
|
176
|
+
end
|
|
177
|
+
_result_2 = (React.createElement("frame", _attributes_1, _exp_3, _exp_4, _exp_5, _exp_6, _exp_7, _condition_6))
|
|
88
178
|
end
|
|
89
|
-
|
|
90
|
-
_attributes_1.Size = UDim2.fromScale(1, 1)
|
|
91
|
-
_attributes_1.AutomaticSize = Enum.AutomaticSize.None
|
|
92
|
-
_attributes_1.TextWrapped = true
|
|
93
|
-
local _attributes_2 = table.clone(styles.padding)
|
|
94
|
-
setmetatable(_attributes_2, nil)
|
|
95
|
-
local _exp_1 = React.createElement("uipadding", _attributes_2)
|
|
96
|
-
local _attributes_3 = table.clone(styles.corner)
|
|
97
|
-
setmetatable(_attributes_3, nil)
|
|
98
|
-
local _exp_2 = React.createElement("uicorner", _attributes_3)
|
|
99
|
-
local _attributes_4 = table.clone(styles.stroke)
|
|
100
|
-
setmetatable(_attributes_4, nil)
|
|
101
|
-
_condition_2 = (React.createElement(Popup, {
|
|
179
|
+
_condition_5 = (React.createElement(Popup, {
|
|
102
180
|
anchor = anchor,
|
|
103
181
|
preferredWidth = tipWidth,
|
|
104
182
|
preferredHeight = tipHeight,
|
|
105
|
-
},
|
|
183
|
+
}, _result_2))
|
|
106
184
|
end
|
|
107
|
-
return React.createElement(SxHost, _attributes,
|
|
185
|
+
return React.createElement(SxHost, _attributes, _exp_2, _condition_5)
|
|
108
186
|
end
|
|
109
187
|
local default = Tooltip
|
|
110
188
|
return {
|