@rbxts/uiblox 0.2.0-alpha.36 → 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 +11 -0
- package/out/ui/packages/init.luau +33 -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/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,16 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* Keep a field within max characters. A missing or negative max leaves the text alone.
|
|
3
|
+
local function clampText(text, max)
|
|
4
|
+
if max == nil or max < 0 then
|
|
5
|
+
return text
|
|
6
|
+
end
|
|
7
|
+
if #text <= max then
|
|
8
|
+
return text
|
|
9
|
+
end
|
|
10
|
+
local _text = text
|
|
11
|
+
local _max = max
|
|
12
|
+
return string.sub(_text, 1, _max)
|
|
13
|
+
end
|
|
14
|
+
return {
|
|
15
|
+
clampText = clampText,
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function multilineHeight(measured: number, lineHeight: number, minRows: number, maxRows: number, padding: number): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function multilineHeight(measured, lineHeight, minRows, maxRows, padding)
|
|
3
|
+
local minimumRows = math.max(1, math.floor(minRows))
|
|
4
|
+
local maximumRows = math.max(minimumRows, math.floor(maxRows))
|
|
5
|
+
local minimum = minimumRows * lineHeight + padding * 2
|
|
6
|
+
local maximum = maximumRows * lineHeight + padding * 2
|
|
7
|
+
return math.clamp(measured + padding * 2, minimum, maximum)
|
|
8
|
+
end
|
|
9
|
+
return {
|
|
10
|
+
multilineHeight = multilineHeight,
|
|
11
|
+
}
|
|
@@ -6,6 +6,16 @@ local useState = _react.useState
|
|
|
6
6
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
7
7
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
8
|
local useLinkStyles = TS.import(script, script.Parent, "Link.styles").default
|
|
9
|
+
local function escapeRich(text)
|
|
10
|
+
local out = text
|
|
11
|
+
for _, _binding in { { "&", "&" }, { "<", "<" }, { ">", ">" } } do
|
|
12
|
+
local from = _binding[1]
|
|
13
|
+
local to = _binding[2]
|
|
14
|
+
local replaced = string.gsub(out, from, to)
|
|
15
|
+
out = replaced
|
|
16
|
+
end
|
|
17
|
+
return out
|
|
18
|
+
end
|
|
9
19
|
local function Link(props)
|
|
10
20
|
local _binding = props
|
|
11
21
|
local text = _binding.text
|
|
@@ -28,9 +38,9 @@ local function Link(props)
|
|
|
28
38
|
local styles = useLinkStyles({
|
|
29
39
|
color = color,
|
|
30
40
|
disabled = disabled,
|
|
31
|
-
showUnderline = showUnderline,
|
|
32
41
|
})
|
|
33
42
|
local active = canActivate(disabled)
|
|
43
|
+
local label = escapeRich(text)
|
|
34
44
|
local _attributes = {
|
|
35
45
|
tag = "textbutton",
|
|
36
46
|
}
|
|
@@ -47,7 +57,7 @@ local function Link(props)
|
|
|
47
57
|
disabled = disabled,
|
|
48
58
|
hover = hover,
|
|
49
59
|
}
|
|
50
|
-
_attributes.Text =
|
|
60
|
+
_attributes.Text = if showUnderline then `<u>{label}</u>` else label
|
|
51
61
|
_attributes.Active = active
|
|
52
62
|
_attributes.Selectable = active
|
|
53
63
|
_attributes.Event = {
|
|
@@ -66,13 +76,7 @@ local function Link(props)
|
|
|
66
76
|
return setHover(false)
|
|
67
77
|
end,
|
|
68
78
|
}
|
|
69
|
-
|
|
70
|
-
key = "Underline",
|
|
71
|
-
}
|
|
72
|
-
for _k, _v in styles.underline do
|
|
73
|
-
_attributes_1[_k] = _v
|
|
74
|
-
end
|
|
75
|
-
return React.createElement(SxHost, _attributes, React.createElement("frame", _attributes_1))
|
|
79
|
+
return React.createElement(SxHost, _attributes)
|
|
76
80
|
end
|
|
77
81
|
local default = Link
|
|
78
82
|
return {
|
|
@@ -24,10 +24,6 @@ local useLinkStyles = componentStyles("Link", function(theme, _param)
|
|
|
24
24
|
if disabled == nil then
|
|
25
25
|
disabled = false
|
|
26
26
|
end
|
|
27
|
-
local showUnderline = _param.showUnderline
|
|
28
|
-
if showUnderline == nil then
|
|
29
|
-
showUnderline = true
|
|
30
|
-
end
|
|
31
27
|
local ink = linkColor(theme, color, disabled)
|
|
32
28
|
return createStyles({
|
|
33
29
|
root = {
|
|
@@ -38,19 +34,12 @@ local useLinkStyles = componentStyles("Link", function(theme, _param)
|
|
|
38
34
|
AutoButtonColor = false,
|
|
39
35
|
Active = not disabled,
|
|
40
36
|
Selectable = not disabled,
|
|
37
|
+
RichText = true,
|
|
41
38
|
TextColor3 = ink,
|
|
42
39
|
Font = theme.typography.fontFamilies.default,
|
|
43
40
|
TextSize = theme.typography.fontSizes.body,
|
|
44
41
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
45
42
|
},
|
|
46
|
-
underline = {
|
|
47
|
-
Size = UDim2.new(1, 0, 0, 1),
|
|
48
|
-
Position = UDim2.new(0, 0, 1, 0),
|
|
49
|
-
AnchorPoint = Vector2.new(0, 1),
|
|
50
|
-
BackgroundColor3 = ink,
|
|
51
|
-
BackgroundTransparency = if showUnderline then 0 else 1,
|
|
52
|
-
BorderSizePixel = 0,
|
|
53
|
-
},
|
|
54
43
|
})
|
|
55
44
|
end)
|
|
56
45
|
local default = useLinkStyles
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import React from "@rbxts/react";
|
|
1
2
|
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
import { ListItemTone } from "./listItemInk";
|
|
2
4
|
export interface ListItemProps {
|
|
3
5
|
text: string;
|
|
4
6
|
secondary?: string;
|
|
@@ -6,6 +8,10 @@ export interface ListItemProps {
|
|
|
6
8
|
disabled?: boolean;
|
|
7
9
|
dense?: boolean;
|
|
8
10
|
divider?: boolean;
|
|
11
|
+
wrap?: boolean;
|
|
12
|
+
tone?: ListItemTone;
|
|
13
|
+
leading?: React.ReactNode;
|
|
14
|
+
trailing?: React.ReactNode;
|
|
9
15
|
onActivated?: () => void;
|
|
10
16
|
}
|
|
11
17
|
declare function ListItem(props: CustomizedProps<TextButton, ListItemProps>): JSX.Element;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
|
+
local _listItemLayout = TS.import(script, script.Parent, "listItemLayout")
|
|
6
|
+
local listItemCopyInset = _listItemLayout.listItemCopyInset
|
|
7
|
+
local listItemRowInset = _listItemLayout.listItemRowInset
|
|
8
|
+
local listItemTrailInset = _listItemLayout.listItemTrailInset
|
|
5
9
|
local useListItemStyles = TS.import(script, script.Parent, "ListItem.styles").default
|
|
6
10
|
local function ListItem(props)
|
|
7
11
|
local _binding = props
|
|
@@ -23,6 +27,13 @@ local function ListItem(props)
|
|
|
23
27
|
if divider == nil then
|
|
24
28
|
divider = false
|
|
25
29
|
end
|
|
30
|
+
local wrap = _binding.wrap
|
|
31
|
+
if wrap == nil then
|
|
32
|
+
wrap = false
|
|
33
|
+
end
|
|
34
|
+
local tone = _binding.tone
|
|
35
|
+
local leading = _binding.leading
|
|
36
|
+
local trailing = _binding.trailing
|
|
26
37
|
local onActivated = _binding.onActivated
|
|
27
38
|
local className = _binding.className
|
|
28
39
|
local sx = _binding.sx
|
|
@@ -32,62 +43,109 @@ local function ListItem(props)
|
|
|
32
43
|
selected = selected,
|
|
33
44
|
disabled = disabled,
|
|
34
45
|
dense = dense,
|
|
46
|
+
wrap = wrap,
|
|
47
|
+
tone = tone,
|
|
35
48
|
})
|
|
49
|
+
local lead = listItemCopyInset(leading ~= nil)
|
|
50
|
+
local trail = listItemTrailInset(trailing ~= nil)
|
|
51
|
+
local rowInset = listItemRowInset(leading ~= nil, trailing ~= nil)
|
|
36
52
|
local _attributes = {
|
|
53
|
+
key = "Primary",
|
|
54
|
+
}
|
|
55
|
+
for _k, _v in styles.primary do
|
|
56
|
+
_attributes[_k] = _v
|
|
57
|
+
end
|
|
58
|
+
_attributes.Text = text
|
|
59
|
+
local _exp = React.createElement("textlabel", _attributes)
|
|
60
|
+
local _result
|
|
61
|
+
if secondary ~= nil and #secondary > 0 then
|
|
62
|
+
local _attributes_1 = {
|
|
63
|
+
key = "Secondary",
|
|
64
|
+
}
|
|
65
|
+
for _k, _v in styles.secondary do
|
|
66
|
+
_attributes_1[_k] = _v
|
|
67
|
+
end
|
|
68
|
+
_attributes_1.Text = secondary
|
|
69
|
+
_result = (React.createElement("textlabel", _attributes_1))
|
|
70
|
+
else
|
|
71
|
+
_result = nil
|
|
72
|
+
end
|
|
73
|
+
local copy = (React.createElement(React.Fragment, nil, _exp, _result))
|
|
74
|
+
local _attributes_1 = {
|
|
37
75
|
tag = "textbutton",
|
|
38
76
|
}
|
|
39
77
|
local _condition = id
|
|
40
78
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
41
79
|
_condition = "ListItem"
|
|
42
80
|
end
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
81
|
+
_attributes_1.key = _condition
|
|
82
|
+
_attributes_1.hostRef = ref
|
|
83
|
+
_attributes_1.base = styles.root
|
|
84
|
+
_attributes_1.className = className
|
|
85
|
+
_attributes_1.sx = sx
|
|
86
|
+
_attributes_1.state = {
|
|
49
87
|
disabled = disabled,
|
|
50
88
|
selected = selected,
|
|
51
89
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
90
|
+
_attributes_1.Text = ""
|
|
91
|
+
_attributes_1.Active = not disabled
|
|
92
|
+
_attributes_1.Selectable = not disabled
|
|
93
|
+
_attributes_1.AutoButtonColor = false
|
|
94
|
+
_attributes_1.Event = {
|
|
57
95
|
Activated = function()
|
|
58
96
|
if not disabled and onActivated ~= nil then
|
|
59
97
|
onActivated()
|
|
60
98
|
end
|
|
61
99
|
end,
|
|
62
100
|
}
|
|
63
|
-
local
|
|
64
|
-
setmetatable(_attributes_1, nil)
|
|
65
|
-
local _exp = React.createElement("uipadding", _attributes_1)
|
|
66
|
-
local _attributes_2 = table.clone(styles.list)
|
|
101
|
+
local _attributes_2 = table.clone(styles.padding)
|
|
67
102
|
setmetatable(_attributes_2, nil)
|
|
68
|
-
local _exp_1 = React.createElement("
|
|
69
|
-
local _attributes_3 =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
103
|
+
local _exp_1 = React.createElement("uipadding", _attributes_2)
|
|
104
|
+
local _attributes_3 = table.clone(styles.list)
|
|
105
|
+
setmetatable(_attributes_3, nil)
|
|
106
|
+
local _exp_2 = React.createElement("uilistlayout", _attributes_3)
|
|
107
|
+
local _result_1
|
|
108
|
+
if rowInset > 0 then
|
|
109
|
+
local _exp_3 = React.createElement("uilistlayout", {
|
|
110
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
111
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
112
|
+
Padding = UDim.new(0, 8),
|
|
113
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
114
|
+
})
|
|
115
|
+
local _exp_4 = if lead > 0 then (React.createElement("frame", {
|
|
116
|
+
key = "Lead",
|
|
117
|
+
LayoutOrder = 0,
|
|
118
|
+
Size = UDim2.fromOffset(lead, lead),
|
|
119
|
+
BackgroundTransparency = 1,
|
|
120
|
+
BorderSizePixel = 0,
|
|
121
|
+
}, leading)) else nil
|
|
122
|
+
local _attributes_4 = table.clone(styles.list)
|
|
123
|
+
setmetatable(_attributes_4, nil)
|
|
124
|
+
_result_1 = (React.createElement("frame", {
|
|
125
|
+
key = "Body",
|
|
126
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
127
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
128
|
+
BackgroundTransparency = 1,
|
|
129
|
+
BorderSizePixel = 0,
|
|
130
|
+
}, _exp_3, _exp_4, React.createElement("frame", {
|
|
131
|
+
key = "Copy",
|
|
132
|
+
LayoutOrder = 1,
|
|
133
|
+
Size = UDim2.new(1, -rowInset, 0, 0),
|
|
134
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
135
|
+
BackgroundTransparency = 1,
|
|
136
|
+
BorderSizePixel = 0,
|
|
137
|
+
}, React.createElement("uilistlayout", _attributes_4), copy), if trail > 0 then (React.createElement("frame", {
|
|
138
|
+
key = "Trail",
|
|
139
|
+
LayoutOrder = 2,
|
|
140
|
+
Size = UDim2.new(0, trail, 0, 0),
|
|
141
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
142
|
+
BackgroundTransparency = 1,
|
|
143
|
+
BorderSizePixel = 0,
|
|
144
|
+
}, trailing)) else nil))
|
|
87
145
|
else
|
|
88
|
-
|
|
146
|
+
_result_1 = copy
|
|
89
147
|
end
|
|
90
|
-
local
|
|
148
|
+
local _result_2
|
|
91
149
|
if divider == true then
|
|
92
150
|
local _attributes_4 = {
|
|
93
151
|
key = "Divider",
|
|
@@ -95,11 +153,11 @@ local function ListItem(props)
|
|
|
95
153
|
for _k, _v in styles.divider do
|
|
96
154
|
_attributes_4[_k] = _v
|
|
97
155
|
end
|
|
98
|
-
|
|
156
|
+
_result_2 = React.createElement("frame", _attributes_4)
|
|
99
157
|
else
|
|
100
|
-
|
|
158
|
+
_result_2 = nil
|
|
101
159
|
end
|
|
102
|
-
return React.createElement(SxHost,
|
|
160
|
+
return React.createElement(SxHost, _attributes_1, _exp_1, _exp_2, _result_1, _result_2)
|
|
103
161
|
end
|
|
104
162
|
local default = ListItem
|
|
105
163
|
return {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { ListItemTone } from "./listItemInk";
|
|
1
2
|
declare const useListItemStyles: (props: {
|
|
2
3
|
selected?: boolean;
|
|
3
4
|
disabled?: boolean;
|
|
4
5
|
dense?: boolean;
|
|
6
|
+
wrap?: boolean;
|
|
7
|
+
tone?: ListItemTone;
|
|
5
8
|
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
6
9
|
export default useListItemStyles;
|
|
@@ -3,6 +3,8 @@ 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 listItemInk = TS.import(script, script.Parent, "listItemInk").listItemInk
|
|
7
|
+
local listItemLabelLayout = TS.import(script, script.Parent, "listItemLayout").listItemLabelLayout
|
|
6
8
|
local useListItemStyles = componentStyles("ListItem", function(theme, _param)
|
|
7
9
|
local selected = _param.selected
|
|
8
10
|
if selected == nil then
|
|
@@ -16,8 +18,21 @@ local useListItemStyles = componentStyles("ListItem", function(theme, _param)
|
|
|
16
18
|
if dense == nil then
|
|
17
19
|
dense = false
|
|
18
20
|
end
|
|
21
|
+
local wrap = _param.wrap
|
|
22
|
+
if wrap == nil then
|
|
23
|
+
wrap = false
|
|
24
|
+
end
|
|
25
|
+
local tone = _param.tone
|
|
19
26
|
local pad = theme.padding.calc(if dense == true then 0.5 else 1)
|
|
20
|
-
|
|
27
|
+
local label = listItemLabelLayout(wrap)
|
|
28
|
+
local ink = listItemInk(tone, disabled)
|
|
29
|
+
local primaryColor = if ink == "error" then theme.palette.status.error.main elseif ink == "disabled" then theme.palette.text.disabled else theme.palette.text.primary
|
|
30
|
+
local textBox = {
|
|
31
|
+
AutomaticSize = if label.wrapped then Enum.AutomaticSize.Y else Enum.AutomaticSize.XY,
|
|
32
|
+
Size = UDim2.new(label.widthScale, 0, 0, 0),
|
|
33
|
+
TextWrapped = label.wrapped,
|
|
34
|
+
}
|
|
35
|
+
local _object = {
|
|
21
36
|
root = {
|
|
22
37
|
Size = UDim2.new(1, 0, 0, 0),
|
|
23
38
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -39,35 +54,42 @@ local useListItemStyles = componentStyles("ListItem", function(theme, _param)
|
|
|
39
54
|
FillDirection = Enum.FillDirection.Vertical,
|
|
40
55
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
41
56
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
}
|
|
58
|
+
local _left = "primary"
|
|
59
|
+
local _object_1 = {
|
|
60
|
+
LayoutOrder = 1,
|
|
61
|
+
}
|
|
62
|
+
for _k, _v in textBox do
|
|
63
|
+
_object_1[_k] = _v
|
|
64
|
+
end
|
|
65
|
+
_object_1.BackgroundTransparency = 1
|
|
66
|
+
_object_1.BorderSizePixel = 0
|
|
67
|
+
_object_1.Font = theme.typography.fontFamilies.default
|
|
68
|
+
_object_1.TextSize = if dense == true then theme.typography.fontSizes.caption else theme.typography.fontSizes.body
|
|
69
|
+
_object_1.TextColor3 = primaryColor
|
|
70
|
+
_object_1.TextXAlignment = Enum.TextXAlignment.Left
|
|
71
|
+
_object[_left] = _object_1
|
|
72
|
+
local _left_1 = "secondary"
|
|
73
|
+
local _object_2 = {
|
|
74
|
+
LayoutOrder = 2,
|
|
75
|
+
}
|
|
76
|
+
for _k, _v in textBox do
|
|
77
|
+
_object_2[_k] = _v
|
|
78
|
+
end
|
|
79
|
+
_object_2.BackgroundTransparency = 1
|
|
80
|
+
_object_2.BorderSizePixel = 0
|
|
81
|
+
_object_2.Font = theme.typography.fontFamilies.default
|
|
82
|
+
_object_2.TextSize = theme.typography.fontSizes.caption
|
|
83
|
+
_object_2.TextColor3 = theme.palette.text.secondary
|
|
84
|
+
_object_2.TextXAlignment = Enum.TextXAlignment.Left
|
|
85
|
+
_object[_left_1] = _object_2
|
|
86
|
+
_object.divider = {
|
|
87
|
+
LayoutOrder = 3,
|
|
88
|
+
Size = UDim2.new(1, 0, 0, 1),
|
|
89
|
+
BackgroundColor3 = theme.palette.divider,
|
|
90
|
+
BorderSizePixel = 0,
|
|
91
|
+
}
|
|
92
|
+
return createStyles(_object)
|
|
71
93
|
end)
|
|
72
94
|
local default = useListItemStyles
|
|
73
95
|
return {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* Primary label color. Disabled wins over a danger tone.
|
|
3
|
+
local function listItemInk(tone, disabled)
|
|
4
|
+
if disabled == true then
|
|
5
|
+
return "disabled"
|
|
6
|
+
end
|
|
7
|
+
if tone == "danger" then
|
|
8
|
+
return "error"
|
|
9
|
+
end
|
|
10
|
+
return "primary"
|
|
11
|
+
end
|
|
12
|
+
return {
|
|
13
|
+
listItemInk = listItemInk,
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ListItemLabelLayout {
|
|
2
|
+
widthScale: number;
|
|
3
|
+
wrapped: boolean;
|
|
4
|
+
}
|
|
5
|
+
/** Wrapped rows fill the list. Shrink-wrapped rows stay one line for menus. */
|
|
6
|
+
export declare function listItemLabelLayout(wrap?: boolean): ListItemLabelLayout;
|
|
7
|
+
/** Pixels the title column yields when a leading avatar or icon is present. */
|
|
8
|
+
export declare function listItemCopyInset(leading?: boolean): 0 | 40;
|
|
9
|
+
/** Pixels reserved for a control on the far side of the row. */
|
|
10
|
+
export declare function listItemTrailInset(trailing?: boolean): 48 | 0;
|
|
11
|
+
/** Title column inset, including the gaps beside any side slots. */
|
|
12
|
+
export declare function listItemRowInset(leading?: boolean, trailing?: boolean): number;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* Wrapped rows fill the list. Shrink-wrapped rows stay one line for menus.
|
|
3
|
+
local function listItemLabelLayout(wrap)
|
|
4
|
+
if wrap == true then
|
|
5
|
+
return {
|
|
6
|
+
widthScale = 1,
|
|
7
|
+
wrapped = true,
|
|
8
|
+
}
|
|
9
|
+
end
|
|
10
|
+
return {
|
|
11
|
+
widthScale = 0,
|
|
12
|
+
wrapped = false,
|
|
13
|
+
}
|
|
14
|
+
end
|
|
15
|
+
--* Pixels the title column yields when a leading avatar or icon is present.
|
|
16
|
+
local function listItemCopyInset(leading)
|
|
17
|
+
return if leading == true then 40 else 0
|
|
18
|
+
end
|
|
19
|
+
--* Pixels reserved for a control on the far side of the row.
|
|
20
|
+
local function listItemTrailInset(trailing)
|
|
21
|
+
return if trailing == true then 48 else 0
|
|
22
|
+
end
|
|
23
|
+
--* Title column inset, including the gaps beside any side slots.
|
|
24
|
+
local function listItemRowInset(leading, trailing)
|
|
25
|
+
local lead = listItemCopyInset(leading)
|
|
26
|
+
local trail = listItemTrailInset(trailing)
|
|
27
|
+
local gaps = 0
|
|
28
|
+
if lead > 0 then
|
|
29
|
+
gaps += 8
|
|
30
|
+
end
|
|
31
|
+
if trail > 0 then
|
|
32
|
+
gaps += 8
|
|
33
|
+
end
|
|
34
|
+
return lead + trail + gaps
|
|
35
|
+
end
|
|
36
|
+
return {
|
|
37
|
+
listItemLabelLayout = listItemLabelLayout,
|
|
38
|
+
listItemCopyInset = listItemCopyInset,
|
|
39
|
+
listItemTrailInset = listItemTrailInset,
|
|
40
|
+
listItemRowInset = listItemRowInset,
|
|
41
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { MarkdownLinkPayload } from "../parseMarkdown";
|
|
2
3
|
export interface MarkdownProps {
|
|
3
4
|
value?: string;
|
|
5
|
+
onLink?: (payload: MarkdownLinkPayload) => void;
|
|
4
6
|
}
|
|
5
7
|
declare function Markdown(props: CustomizedProps<Frame, MarkdownProps>): JSX.Element;
|
|
6
8
|
export default Markdown;
|