@rbxts/uiblox 0.2.0-alpha.1 → 0.2.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -8
- package/out/theme/constants/NumberConstants.d.ts +3 -1
- package/out/theme/constants/NumberConstants.luau +3 -0
- package/out/theme/context/ThemeProvider.d.ts +1 -1
- package/out/theme/hooks/useTheme.d.ts +1 -1
- package/out/theme/interfaces/palette/colorTokens/ColorTokens.d.ts +1 -1
- package/out/theme/interfaces/spacing/Shape.d.ts +3 -0
- package/out/theme/interfaces/typography/FontSizes.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizes.luau +15 -8
- package/out/theme/interfaces/typography/ThemeTypography.d.ts +3 -0
- package/out/theme/interfaces/typography/Variants.d.ts +14 -15
- package/out/theme/interfaces/typography/Variants.luau +68 -18
- package/out/theme/themes/DarkTheme.luau +4 -0
- package/out/theme/themes/LightTheme.luau +4 -0
- package/out/theme/types/types.d.ts +1 -1
- package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.luau +5 -0
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +4 -2
- package/out/ui/packages/alert/components/Alert.d.ts +10 -0
- package/out/ui/packages/alert/components/Alert.luau +98 -0
- package/out/ui/packages/alert/components/Alert.styles.d.ts +6 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +93 -0
- package/out/ui/packages/alert/components/alertTone.d.ts +2 -0
- package/out/ui/packages/alert/components/alertTone.luau +7 -0
- package/out/ui/packages/alert/index.d.ts +3 -0
- package/out/ui/packages/alert/init.luau +6 -0
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
- package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
- package/out/ui/packages/backdrop/components/Backdrop.luau +58 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
- package/out/ui/packages/backdrop/index.d.ts +2 -0
- package/out/ui/packages/backdrop/init.luau +5 -0
- package/out/ui/packages/badge/components/Badge.styles.luau +6 -3
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +58 -24
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
- package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/init.luau +3 -0
- package/out/ui/packages/brickColorPicker/components/brickColorCatalog.luau +1 -1
- package/out/ui/packages/button/components/Button.luau +9 -5
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +3 -1
- package/out/ui/packages/chip/components/Chip.luau +39 -2
- package/out/ui/packages/chip/components/Chip.styles.d.ts +3 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +40 -6
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
- package/out/ui/packages/dialog/components/Dialog.d.ts +1 -1
- package/out/ui/packages/dialog/components/Dialog.luau +27 -18
- package/out/ui/packages/fab/components/Fab.d.ts +1 -0
- package/out/ui/packages/fab/components/Fab.luau +57 -25
- package/out/ui/packages/fab/components/Fab.styles.d.ts +1 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +26 -1
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
- package/out/ui/packages/fab/components/fabSize.luau +4 -0
- package/out/ui/packages/fab/index.d.ts +1 -1
- package/out/ui/packages/fab/init.luau +1 -0
- package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
- package/out/ui/packages/formText/components/FormHelperText.luau +44 -0
- package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
- package/out/ui/packages/formText/components/FormLabel.luau +46 -0
- package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
- package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
- package/out/ui/packages/formText/index.d.ts +4 -0
- package/out/ui/packages/formText/init.luau +6 -0
- package/out/ui/packages/iconButton/components/IconButton.luau +7 -2
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
- package/out/ui/packages/imageList/components/ImageList.luau +84 -0
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +54 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +3 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +24 -0
- package/out/ui/packages/imageList/index.d.ts +2 -0
- package/out/ui/packages/imageList/init.luau +5 -0
- package/out/ui/packages/index.d.ts +8 -0
- package/out/ui/packages/init.luau +24 -0
- package/out/ui/packages/input/components/Input.luau +1 -1
- package/out/ui/packages/layout/components/Box.d.ts +11 -0
- package/out/ui/packages/layout/components/Box.luau +49 -0
- package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
- package/out/ui/packages/layout/components/Box.styles.luau +34 -0
- package/out/ui/packages/layout/components/Container.d.ts +10 -0
- package/out/ui/packages/layout/components/Container.luau +54 -0
- package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
- package/out/ui/packages/layout/components/Container.styles.luau +41 -0
- package/out/ui/packages/layout/components/Grid.d.ts +1 -1
- package/out/ui/packages/layout/components/Stack.d.ts +12 -0
- package/out/ui/packages/layout/components/Stack.luau +49 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +72 -0
- package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
- package/out/ui/packages/layout/components/boxPad.luau +59 -0
- package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
- package/out/ui/packages/layout/components/containerWidth.luau +17 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +8 -0
- package/out/ui/packages/layout/components/stackAlign.luau +29 -0
- package/out/ui/packages/layout/index.d.ts +10 -0
- package/out/ui/packages/layout/init.luau +4 -0
- package/out/ui/packages/link/components/Link.d.ts +11 -0
- package/out/ui/packages/link/components/Link.luau +83 -0
- package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
- package/out/ui/packages/link/components/Link.styles.luau +59 -0
- package/out/ui/packages/link/index.d.ts +3 -0
- package/out/ui/packages/link/init.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +10 -5
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +2 -0
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
- package/out/ui/packages/menu/components/Menu.d.ts +3 -0
- package/out/ui/packages/menu/components/Menu.luau +48 -23
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/modal/components/Modal.d.ts +1 -1
- package/out/ui/packages/modal/components/Modal.luau +55 -37
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +1 -0
- package/out/ui/packages/motion/unit.d.ts +5 -0
- package/out/ui/packages/motion/unit.luau +23 -0
- package/out/ui/packages/pagination/components/Pagination.d.ts +2 -0
- package/out/ui/packages/pagination/components/Pagination.luau +37 -21
- package/out/ui/packages/pagination/components/Pagination.styles.luau +9 -0
- package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
- package/out/ui/packages/pagination/components/pageRange.luau +91 -8
- package/out/ui/packages/pagination/index.d.ts +1 -0
- package/out/ui/packages/pagination/init.luau +1 -0
- package/out/ui/packages/paper/components/Paper.d.ts +1 -0
- package/out/ui/packages/paper/components/Paper.luau +8 -3
- package/out/ui/packages/popup/index.d.ts +1 -0
- package/out/ui/packages/popup/init.luau +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +4 -2
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
- package/out/ui/packages/rating/components/Rating.d.ts +9 -0
- package/out/ui/packages/rating/components/Rating.luau +95 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +4 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +39 -0
- package/out/ui/packages/rating/index.d.ts +2 -0
- package/out/ui/packages/rating/init.luau +5 -0
- package/out/ui/packages/select/components/Select.d.ts +5 -0
- package/out/ui/packages/select/components/Select.luau +48 -24
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/skeleton/components/Skeleton.luau +3 -2
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
- package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
- package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
- package/out/ui/packages/slider/components/Slider.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.luau +24 -1
- package/out/ui/packages/slider/components/Slider.styles.luau +8 -0
- package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
- package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +17 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +92 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +2 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +26 -0
- package/out/ui/packages/speedDial/index.d.ts +2 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +2 -0
- package/out/ui/packages/stateMatrix.luau +1843 -1437
- package/out/ui/packages/switch/components/Switch.styles.luau +1 -1
- package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
- package/out/ui/packages/tabs/components/Tabs.d.ts +2 -0
- package/out/ui/packages/tabs/components/Tabs.luau +10 -3
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +4 -1
- package/out/ui/packages/tabs/components/Tabs.styles.luau +24 -10
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
- package/out/ui/packages/tabs/index.d.ts +1 -0
- package/out/ui/packages/tabs/init.luau +1 -0
- package/out/ui/packages/toast/components/Toast.styles.luau +1 -1
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +17 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +126 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +5 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +58 -0
- package/out/ui/packages/toggleButton/index.d.ts +2 -0
- package/out/ui/packages/toggleButton/init.luau +7 -0
- package/out/ui/packages/typography/components/Typography.styles.luau +4 -5
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +6 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +32 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
- package/out/ui/packages/virtualList/index.d.ts +2 -0
- package/out/ui/packages/virtualList/init.luau +1 -0
- package/package.json +2 -2
|
@@ -20,7 +20,9 @@ local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
|
|
|
20
20
|
local playProperty = TS.import(script, script.Parent.Parent.Parent, "motion").playProperty
|
|
21
21
|
local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
|
|
22
22
|
local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
|
|
23
|
-
local
|
|
23
|
+
local _virtualList = TS.import(script, script.Parent.Parent.Parent, "virtualList")
|
|
24
|
+
local EmptyListHint = _virtualList.EmptyListHint
|
|
25
|
+
local VirtualList = _virtualList.VirtualList
|
|
24
26
|
local useSelectStyles = TS.import(script, script.Parent, "Select.styles").default
|
|
25
27
|
local optionLabel = TS.import(script, script.Parent, "optionLabel").optionLabel
|
|
26
28
|
local _selectFilter = TS.import(script, script.Parent, "selectFilter")
|
|
@@ -53,6 +55,10 @@ local function Select(props)
|
|
|
53
55
|
placeholder = ""
|
|
54
56
|
end
|
|
55
57
|
local searchable = _binding.searchable
|
|
58
|
+
local defaultOpen = _binding.defaultOpen
|
|
59
|
+
local defaultQuery = _binding.defaultQuery
|
|
60
|
+
local emptyText = _binding.emptyText
|
|
61
|
+
local empty = _binding.empty
|
|
56
62
|
local reducedProp = _binding.reducedMotion
|
|
57
63
|
local size = _binding.size
|
|
58
64
|
local className = _binding.className
|
|
@@ -68,11 +74,15 @@ local function Select(props)
|
|
|
68
74
|
local row = controlMetrics(theme.density, size).height
|
|
69
75
|
local active = canActivate(disabled, loading)
|
|
70
76
|
local anchor, setAnchor = useState()
|
|
71
|
-
local open, setOpen = useState(
|
|
77
|
+
local open, setOpen = useState(defaultOpen == true and not loading)
|
|
72
78
|
local held, setHeld = useState(false)
|
|
73
79
|
local focused, setFocused = useState(false)
|
|
74
80
|
local highlight, setHighlight = useState(-1)
|
|
75
|
-
local
|
|
81
|
+
local _condition = defaultQuery
|
|
82
|
+
if _condition == nil then
|
|
83
|
+
_condition = ""
|
|
84
|
+
end
|
|
85
|
+
local query, setQuery = useState(_condition)
|
|
76
86
|
local recent = useRef()
|
|
77
87
|
local typed = useRef()
|
|
78
88
|
local onKeyRef = useRef()
|
|
@@ -95,7 +105,20 @@ local function Select(props)
|
|
|
95
105
|
local search = usesSelectSearch(#options, searchable)
|
|
96
106
|
local filtered = filterChoices(options, query)
|
|
97
107
|
local rows = groupRows(filtered)
|
|
98
|
-
local
|
|
108
|
+
local listHeight = if #rows == 0 then row else math.min(#rows * row, theme.spacing.calc(16))
|
|
109
|
+
local menuHeight = listHeight + (if search then row else 0)
|
|
110
|
+
local _condition_1 = empty
|
|
111
|
+
if _condition_1 == nil then
|
|
112
|
+
local _attributes = {}
|
|
113
|
+
local _condition_2 = emptyText
|
|
114
|
+
if _condition_2 == nil then
|
|
115
|
+
_condition_2 = (if #query > 0 or #options > 0 then "No results" else "No options")
|
|
116
|
+
end
|
|
117
|
+
_attributes.text = _condition_2
|
|
118
|
+
_attributes.height = row
|
|
119
|
+
_condition_1 = (React.createElement(EmptyListHint, _attributes))
|
|
120
|
+
end
|
|
121
|
+
local emptyHint = _condition_1
|
|
99
122
|
local close = function()
|
|
100
123
|
setOpen(false)
|
|
101
124
|
setQuery("")
|
|
@@ -125,15 +148,15 @@ local function Select(props)
|
|
|
125
148
|
if fromPointer == nil then
|
|
126
149
|
fromPointer = false
|
|
127
150
|
end
|
|
128
|
-
local
|
|
129
|
-
if
|
|
151
|
+
local _condition_2 = fromPointer
|
|
152
|
+
if _condition_2 then
|
|
130
153
|
local _result_1 = listRef.current
|
|
131
154
|
if _result_1 ~= nil then
|
|
132
155
|
_result_1 = _result_1.suppressClick()
|
|
133
156
|
end
|
|
134
|
-
|
|
157
|
+
_condition_2 = _result_1
|
|
135
158
|
end
|
|
136
|
-
if
|
|
159
|
+
if _condition_2 then
|
|
137
160
|
return nil
|
|
138
161
|
end
|
|
139
162
|
local choice = filtered[index + 1]
|
|
@@ -254,11 +277,11 @@ local function Select(props)
|
|
|
254
277
|
end
|
|
255
278
|
end, { shown, held, reducedMotion })
|
|
256
279
|
local _attributes = {}
|
|
257
|
-
local
|
|
258
|
-
if not (
|
|
259
|
-
|
|
280
|
+
local _condition_2 = id
|
|
281
|
+
if not (_condition_2 ~= 0 and _condition_2 == _condition_2 and _condition_2 ~= "" and _condition_2) then
|
|
282
|
+
_condition_2 = "Select"
|
|
260
283
|
end
|
|
261
|
-
_attributes.key =
|
|
284
|
+
_attributes.key = _condition_2
|
|
262
285
|
_attributes.ref = ref
|
|
263
286
|
for _k, _v in styles.root do
|
|
264
287
|
_attributes[_k] = _v
|
|
@@ -290,11 +313,11 @@ local function Select(props)
|
|
|
290
313
|
if _result_2 ~= nil then
|
|
291
314
|
_result_2 = _result_2.label
|
|
292
315
|
end
|
|
293
|
-
local
|
|
294
|
-
if
|
|
295
|
-
|
|
316
|
+
local _condition_3 = _result_2
|
|
317
|
+
if _condition_3 == nil then
|
|
318
|
+
_condition_3 = placeholder
|
|
296
319
|
end
|
|
297
|
-
_result_1 =
|
|
320
|
+
_result_1 = _condition_3
|
|
298
321
|
end
|
|
299
322
|
_attributes_1.Text = _result_1
|
|
300
323
|
_attributes_1.Active = active
|
|
@@ -337,8 +360,8 @@ local function Select(props)
|
|
|
337
360
|
Position = UDim2.new(1, -theme.padding.calc(1), 0.5, 0),
|
|
338
361
|
},
|
|
339
362
|
})))
|
|
340
|
-
local
|
|
341
|
-
if
|
|
363
|
+
local _condition_3 = (shown or held)
|
|
364
|
+
if _condition_3 then
|
|
342
365
|
local _attributes_5 = {
|
|
343
366
|
key = "Menu",
|
|
344
367
|
}
|
|
@@ -356,8 +379,8 @@ local function Select(props)
|
|
|
356
379
|
FillDirection = Enum.FillDirection.Vertical,
|
|
357
380
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
358
381
|
})
|
|
359
|
-
local
|
|
360
|
-
if
|
|
382
|
+
local _condition_4 = search
|
|
383
|
+
if _condition_4 then
|
|
361
384
|
local _attributes_8 = {
|
|
362
385
|
key = "Search",
|
|
363
386
|
}
|
|
@@ -365,7 +388,7 @@ local function Select(props)
|
|
|
365
388
|
_attributes_8[_k] = _v
|
|
366
389
|
end
|
|
367
390
|
_attributes_8.LayoutOrder = 1
|
|
368
|
-
|
|
391
|
+
_condition_4 = (React.createElement("frame", _attributes_8, React.createElement(Input, {
|
|
369
392
|
text = query,
|
|
370
393
|
placeholder = "Search",
|
|
371
394
|
width = UDim.new(1, 0),
|
|
@@ -375,7 +398,7 @@ local function Select(props)
|
|
|
375
398
|
end,
|
|
376
399
|
})))
|
|
377
400
|
end
|
|
378
|
-
|
|
401
|
+
_condition_3 = (React.createElement(Popup, {
|
|
379
402
|
anchor = anchor,
|
|
380
403
|
preferredHeight = menuHeight,
|
|
381
404
|
onDismiss = close,
|
|
@@ -387,7 +410,7 @@ local function Select(props)
|
|
|
387
410
|
Size = UDim2.fromScale(1, 1),
|
|
388
411
|
BackgroundTransparency = 1,
|
|
389
412
|
GroupTransparency = 1,
|
|
390
|
-
}, React.createElement("frame", _attributes_5, _exp_3, _exp_4, _exp_5, _exp_6,
|
|
413
|
+
}, React.createElement("frame", _attributes_5, _exp_3, _exp_4, _exp_5, _exp_6, _condition_4, React.createElement("frame", {
|
|
391
414
|
key = "ListHost",
|
|
392
415
|
Size = UDim2.new(1, 0, 1, if search then -row else 0),
|
|
393
416
|
BackgroundTransparency = 1,
|
|
@@ -400,6 +423,7 @@ local function Select(props)
|
|
|
400
423
|
end,
|
|
401
424
|
itemHeight = row,
|
|
402
425
|
listRef = listRef,
|
|
426
|
+
empty = emptyHint,
|
|
403
427
|
className = styles.list,
|
|
404
428
|
renderItem = function(row)
|
|
405
429
|
if row.kind == "header" then
|
|
@@ -447,7 +471,7 @@ local function Select(props)
|
|
|
447
471
|
end,
|
|
448
472
|
}))))))
|
|
449
473
|
end
|
|
450
|
-
return React.createElement("frame", _attributes, _exp_2,
|
|
474
|
+
return React.createElement("frame", _attributes, _exp_2, _condition_3)
|
|
451
475
|
end
|
|
452
476
|
local default = Select
|
|
453
477
|
return {
|
|
@@ -44,7 +44,7 @@ local useSelectStyles = componentStyles("Select", function(theme, _param)
|
|
|
44
44
|
},
|
|
45
45
|
list = {
|
|
46
46
|
Size = UDim2.fromScale(1, 1),
|
|
47
|
-
|
|
47
|
+
BackgroundTransparency = 1,
|
|
48
48
|
BorderSizePixel = 0,
|
|
49
49
|
ScrollBarThickness = theme.padding.default,
|
|
50
50
|
ScrollBarImageColor3 = theme.palette.text.secondary,
|
|
@@ -30,6 +30,7 @@ local function SkeletonBlock(props)
|
|
|
30
30
|
local circular = _binding_1.circular
|
|
31
31
|
local fillRef = useRef()
|
|
32
32
|
local gradientRef = useRef()
|
|
33
|
+
local showGradient = motion ~= "pulse"
|
|
33
34
|
useEffect(function()
|
|
34
35
|
local fill = fillRef.current
|
|
35
36
|
local gradient = gradientRef.current
|
|
@@ -45,7 +46,7 @@ local function SkeletonBlock(props)
|
|
|
45
46
|
if motion == "pulse" then
|
|
46
47
|
fill.BackgroundTransparency = 0
|
|
47
48
|
return loopProperty(fill, {
|
|
48
|
-
BackgroundTransparency = 0.
|
|
49
|
+
BackgroundTransparency = 0.45,
|
|
49
50
|
}, 0.9, true)
|
|
50
51
|
end
|
|
51
52
|
fill.BackgroundTransparency = 0
|
|
@@ -90,7 +91,7 @@ local function SkeletonBlock(props)
|
|
|
90
91
|
_attributes_1[_k] = _v
|
|
91
92
|
end
|
|
92
93
|
_attributes_1.Size = UDim2.new(1, 0, 1, 0)
|
|
93
|
-
local _condition_3 =
|
|
94
|
+
local _condition_3 = showGradient
|
|
94
95
|
if _condition_3 then
|
|
95
96
|
local _attributes_2 = {
|
|
96
97
|
ref = gradientRef,
|
|
@@ -3,15 +3,20 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local createStyles = _theme.createStyles
|
|
5
5
|
local componentStyles = _theme.componentStyles
|
|
6
|
+
local skeletonTone = TS.import(script, script.Parent, "skeletonTone").skeletonTone
|
|
6
7
|
local useSkeletonStyles = componentStyles("Skeleton", function(theme)
|
|
8
|
+
local _binding = skeletonTone(theme)
|
|
9
|
+
local bone = _binding.bone
|
|
10
|
+
local shine = _binding.shine
|
|
7
11
|
return createStyles({
|
|
8
12
|
block = {
|
|
9
|
-
BackgroundColor3 =
|
|
13
|
+
BackgroundColor3 = bone,
|
|
10
14
|
BackgroundTransparency = 0,
|
|
11
15
|
BorderSizePixel = 0,
|
|
12
16
|
},
|
|
13
17
|
highlight = {
|
|
14
|
-
Color = ColorSequence.new({ ColorSequenceKeypoint.new(0,
|
|
18
|
+
Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, bone), ColorSequenceKeypoint.new(0.5, shine), ColorSequenceKeypoint.new(1, bone) }),
|
|
19
|
+
Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.35), NumberSequenceKeypoint.new(0.5, 0), NumberSequenceKeypoint.new(1, 0.35) }),
|
|
15
20
|
},
|
|
16
21
|
rounded = {
|
|
17
22
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
@@ -3,7 +3,7 @@ local function skeletonMotion(animation, reducedMotion)
|
|
|
3
3
|
if animation == false or reducedMotion == true then
|
|
4
4
|
return false
|
|
5
5
|
end
|
|
6
|
-
return animation or "
|
|
6
|
+
return animation or "shimmer"
|
|
7
7
|
end
|
|
8
8
|
local function skeletonLineWidth(width, index, count)
|
|
9
9
|
if count > 1 and index == count - 1 then
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface SkeletonPalette {
|
|
2
|
+
surface: {
|
|
3
|
+
canvas: Color3;
|
|
4
|
+
elevated: Color3;
|
|
5
|
+
};
|
|
6
|
+
action: {
|
|
7
|
+
hover: Color3;
|
|
8
|
+
};
|
|
9
|
+
text: {
|
|
10
|
+
secondary: Color3;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** Bone + shimmer peak from semantic tokens; shine always lifts off the bone vs canvas. */
|
|
14
|
+
export declare function skeletonTone(theme: {
|
|
15
|
+
palette: SkeletonPalette;
|
|
16
|
+
}): {
|
|
17
|
+
bone: Color3;
|
|
18
|
+
shine: Color3;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local relativeLuminance = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme", "utilites", "colorMath").relativeLuminance
|
|
4
|
+
--* Bone + shimmer peak from semantic tokens; shine always lifts off the bone vs canvas.
|
|
5
|
+
local function skeletonTone(theme)
|
|
6
|
+
local lightCanvas = relativeLuminance(theme.palette.surface.canvas) > 0.5
|
|
7
|
+
return {
|
|
8
|
+
bone = theme.palette.action.hover,
|
|
9
|
+
shine = if lightCanvas then theme.palette.surface.elevated else theme.palette.text.secondary,
|
|
10
|
+
}
|
|
11
|
+
end
|
|
12
|
+
return {
|
|
13
|
+
skeletonTone = skeletonTone,
|
|
14
|
+
}
|
|
@@ -8,6 +8,7 @@ local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
|
8
8
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
9
9
|
local commitNumber = TS.import(script, script.Parent.Parent.Parent, "numberInput", "components", "numberValue").commitNumber
|
|
10
10
|
local useSliderStyles = TS.import(script, script.Parent, "Slider.styles").default
|
|
11
|
+
local sliderMarkValues = TS.import(script, script.Parent, "sliderMarks").sliderMarkValues
|
|
11
12
|
local _sliderNudge = TS.import(script, script.Parent, "sliderNudge")
|
|
12
13
|
local isSliderDrag = _sliderNudge.isSliderDrag
|
|
13
14
|
local isSliderMove = _sliderNudge.isSliderMove
|
|
@@ -23,6 +24,7 @@ local function Slider(props)
|
|
|
23
24
|
local step = _binding.step
|
|
24
25
|
local disabled = _binding.disabled
|
|
25
26
|
local size = _binding.size
|
|
27
|
+
local marks = _binding.marks
|
|
26
28
|
local className = _binding.className
|
|
27
29
|
local sx = _binding.sx
|
|
28
30
|
local id = _binding.id
|
|
@@ -36,6 +38,7 @@ local function Slider(props)
|
|
|
36
38
|
local knob = _binding_1.knob
|
|
37
39
|
local corner = _binding_1.corner
|
|
38
40
|
local stroke = _binding_1.stroke
|
|
41
|
+
local mark = _binding_1.mark
|
|
39
42
|
local active = canActivate(disabled)
|
|
40
43
|
local focused, setFocused = useState(false)
|
|
41
44
|
local hovering, setHovering = useState(false)
|
|
@@ -45,6 +48,8 @@ local function Slider(props)
|
|
|
45
48
|
local ratio = if max > min then (math.clamp(value, min, max) - min) / (max - min) else 0
|
|
46
49
|
local faded = disabled == true
|
|
47
50
|
local showFocus = focused and active
|
|
51
|
+
local markValues = sliderMarkValues(min, max, step, marks)
|
|
52
|
+
local span = max - min
|
|
48
53
|
local update = function(rbx, x)
|
|
49
54
|
local width = rbx.AbsoluteSize.X
|
|
50
55
|
if width <= 0 then
|
|
@@ -165,6 +170,24 @@ local function Slider(props)
|
|
|
165
170
|
setmetatable(_attributes_3, nil)
|
|
166
171
|
_condition_1 = React.createElement("uistroke", _attributes_3)
|
|
167
172
|
end
|
|
173
|
+
-- ▼ ReadonlyArray.map ▼
|
|
174
|
+
local _newValue = table.create(#markValues)
|
|
175
|
+
local _callback = function(markValue, index)
|
|
176
|
+
local markRatio = if span > 0 then (markValue - min) / span else 0
|
|
177
|
+
local _attributes_3 = {
|
|
178
|
+
key = `Mark-{index}`,
|
|
179
|
+
}
|
|
180
|
+
for _k, _v in mark do
|
|
181
|
+
_attributes_3[_k] = _v
|
|
182
|
+
end
|
|
183
|
+
_attributes_3.Position = UDim2.fromScale(markRatio, 0.5)
|
|
184
|
+
_attributes_3.BackgroundTransparency = if faded then 0.7 else 0.35
|
|
185
|
+
return React.createElement("frame", _attributes_3)
|
|
186
|
+
end
|
|
187
|
+
for _k, _v in markValues do
|
|
188
|
+
_newValue[_k] = _callback(_v, _k - 1, markValues)
|
|
189
|
+
end
|
|
190
|
+
-- ▲ ReadonlyArray.map ▲
|
|
168
191
|
local _attributes_3 = {
|
|
169
192
|
key = "Fill",
|
|
170
193
|
}
|
|
@@ -196,7 +219,7 @@ local function Slider(props)
|
|
|
196
219
|
_attributes_7.Thickness = 1
|
|
197
220
|
_condition_2 = React.createElement("uistroke", _attributes_7)
|
|
198
221
|
end
|
|
199
|
-
return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp, _condition_1, _exp_1, React.createElement("frame", _attributes_5, _exp_2, _condition_2)))
|
|
222
|
+
return React.createElement("frame", _attributes, React.createElement("frame", _attributes_1, _exp, _condition_1, _newValue, _exp_1, React.createElement("frame", _attributes_5, _exp_2, _condition_2)))
|
|
200
223
|
end
|
|
201
224
|
local default = Slider
|
|
202
225
|
return {
|
|
@@ -39,6 +39,14 @@ local useSliderStyles = componentStyles("Slider", function(theme, _param)
|
|
|
39
39
|
Thickness = 2,
|
|
40
40
|
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
41
41
|
},
|
|
42
|
+
mark = {
|
|
43
|
+
Size = UDim2.new(0, 2, 0, metrics.sliderTrack + 4),
|
|
44
|
+
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
45
|
+
BackgroundColor3 = theme.palette.text.secondary,
|
|
46
|
+
BackgroundTransparency = 0.35,
|
|
47
|
+
BorderSizePixel = 0,
|
|
48
|
+
ZIndex = 1,
|
|
49
|
+
},
|
|
42
50
|
})
|
|
43
51
|
end)
|
|
44
52
|
local default = useSliderStyles
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sliderMarkValues(min: number, max: number, step: number | undefined, marks: boolean | ReadonlyArray<number> | undefined): number[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function sliderMarkValues(min, max, step, marks)
|
|
3
|
+
if marks == nil or marks == false then
|
|
4
|
+
return {}
|
|
5
|
+
end
|
|
6
|
+
if marks ~= true then
|
|
7
|
+
local out = {}
|
|
8
|
+
for _, value in marks do
|
|
9
|
+
if value >= min and value <= max then
|
|
10
|
+
table.insert(out, value)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
return out
|
|
14
|
+
end
|
|
15
|
+
local span = max - min
|
|
16
|
+
if span <= 0 then
|
|
17
|
+
return { min }
|
|
18
|
+
end
|
|
19
|
+
local increment = if step ~= nil and step > 0 then step else span
|
|
20
|
+
local out = {}
|
|
21
|
+
local value = min
|
|
22
|
+
local guard = 0
|
|
23
|
+
while value <= max + increment * 1e-9 and guard < 64 do
|
|
24
|
+
local _arg0 = math.clamp(value, min, max)
|
|
25
|
+
table.insert(out, _arg0)
|
|
26
|
+
value += increment
|
|
27
|
+
guard += 1
|
|
28
|
+
end
|
|
29
|
+
if out[#out] ~= max then
|
|
30
|
+
local _max = max
|
|
31
|
+
table.insert(out, _max)
|
|
32
|
+
end
|
|
33
|
+
return out
|
|
34
|
+
end
|
|
35
|
+
return {
|
|
36
|
+
sliderMarkValues = sliderMarkValues,
|
|
37
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { Icons } from "../../../enums/index";
|
|
3
|
+
export interface SpeedDialAction {
|
|
4
|
+
icon: Icons;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface SpeedDialProps {
|
|
9
|
+
open: boolean;
|
|
10
|
+
onOpenChange: (open: boolean) => void;
|
|
11
|
+
actions: SpeedDialAction[];
|
|
12
|
+
icon?: Icons;
|
|
13
|
+
openIcon?: Icons;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function SpeedDial(props: CustomizedProps<Frame, SpeedDialProps>): JSX.Element;
|
|
17
|
+
export default SpeedDial;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local Icons = TS.import(script, script.Parent.Parent.Parent.Parent, "enums").Icons
|
|
5
|
+
local Fab = TS.import(script, script.Parent.Parent.Parent, "fab").Fab
|
|
6
|
+
local useSpeedDialStyles = TS.import(script, script.Parent, "SpeedDial.styles").default
|
|
7
|
+
local function SpeedDial(props)
|
|
8
|
+
local _binding = props
|
|
9
|
+
local open = _binding.open
|
|
10
|
+
local onOpenChange = _binding.onOpenChange
|
|
11
|
+
local actions = _binding.actions
|
|
12
|
+
local icon = _binding.icon
|
|
13
|
+
if icon == nil then
|
|
14
|
+
icon = Icons.OpenBox
|
|
15
|
+
end
|
|
16
|
+
local openIcon = _binding.openIcon
|
|
17
|
+
if openIcon == nil then
|
|
18
|
+
openIcon = Icons.Close
|
|
19
|
+
end
|
|
20
|
+
local disabled = _binding.disabled
|
|
21
|
+
local className = _binding.className
|
|
22
|
+
local sx = _binding.sx
|
|
23
|
+
local id = _binding.id
|
|
24
|
+
local ref = _binding.ref
|
|
25
|
+
local styles = useSpeedDialStyles()
|
|
26
|
+
local _attributes = {}
|
|
27
|
+
local _condition = id
|
|
28
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
29
|
+
_condition = "SpeedDial"
|
|
30
|
+
end
|
|
31
|
+
_attributes.key = _condition
|
|
32
|
+
_attributes.ref = ref
|
|
33
|
+
for _k, _v in styles.root do
|
|
34
|
+
_attributes[_k] = _v
|
|
35
|
+
end
|
|
36
|
+
if className then
|
|
37
|
+
for _k, _v in className do
|
|
38
|
+
_attributes[_k] = _v
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
if sx then
|
|
42
|
+
for _k, _v in sx do
|
|
43
|
+
_attributes[_k] = _v
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
local _attributes_1 = table.clone(styles.list)
|
|
47
|
+
setmetatable(_attributes_1, nil)
|
|
48
|
+
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
49
|
+
local _condition_1 = open
|
|
50
|
+
if _condition_1 then
|
|
51
|
+
-- ▼ ReadonlyArray.map ▼
|
|
52
|
+
local _newValue = table.create(#actions)
|
|
53
|
+
local _callback = function(action, index)
|
|
54
|
+
return React.createElement(Fab, {
|
|
55
|
+
key = `Action-{index}`,
|
|
56
|
+
icon = action.icon,
|
|
57
|
+
size = "small",
|
|
58
|
+
disabled = disabled == true or action.disabled == true,
|
|
59
|
+
onClick = function()
|
|
60
|
+
local _result = action.onClick
|
|
61
|
+
if _result ~= nil then
|
|
62
|
+
_result()
|
|
63
|
+
end
|
|
64
|
+
onOpenChange(false)
|
|
65
|
+
end,
|
|
66
|
+
className = {
|
|
67
|
+
LayoutOrder = index,
|
|
68
|
+
},
|
|
69
|
+
})
|
|
70
|
+
end
|
|
71
|
+
for _k, _v in actions do
|
|
72
|
+
_newValue[_k] = _callback(_v, _k - 1, actions)
|
|
73
|
+
end
|
|
74
|
+
-- ▲ ReadonlyArray.map ▲
|
|
75
|
+
_condition_1 = _newValue
|
|
76
|
+
end
|
|
77
|
+
return React.createElement("frame", _attributes, _exp, _condition_1, React.createElement(Fab, {
|
|
78
|
+
key = "Main",
|
|
79
|
+
icon = if open then openIcon else icon,
|
|
80
|
+
disabled = disabled,
|
|
81
|
+
onClick = function()
|
|
82
|
+
return onOpenChange(not open)
|
|
83
|
+
end,
|
|
84
|
+
className = {
|
|
85
|
+
LayoutOrder = 1000,
|
|
86
|
+
},
|
|
87
|
+
}))
|
|
88
|
+
end
|
|
89
|
+
local default = SpeedDial
|
|
90
|
+
return {
|
|
91
|
+
default = default,
|
|
92
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 useSpeedDialStyles = componentStyles("SpeedDial", function(theme)
|
|
7
|
+
return createStyles({
|
|
8
|
+
root = {
|
|
9
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
10
|
+
Size = UDim2.fromScale(0, 0),
|
|
11
|
+
BackgroundTransparency = 1,
|
|
12
|
+
BorderSizePixel = 0,
|
|
13
|
+
},
|
|
14
|
+
list = {
|
|
15
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
16
|
+
HorizontalAlignment = Enum.HorizontalAlignment.Center,
|
|
17
|
+
VerticalAlignment = Enum.VerticalAlignment.Bottom,
|
|
18
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
19
|
+
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
end)
|
|
23
|
+
local default = useSpeedDialStyles
|
|
24
|
+
return {
|
|
25
|
+
default = default,
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type SplitPointer = "rest" | "hover" | "press";
|
|
2
2
|
export declare function splitPointer(hovering: boolean, pressed: boolean): SplitPointer;
|
|
3
|
-
export declare function splitRuleTransparency(pointer: SplitPointer, disabled?: boolean): 0.
|
|
3
|
+
export declare function splitRuleTransparency(pointer: SplitPointer, disabled?: boolean): 0.25 | 0.7 | 0.55 | 0.35;
|
|
4
4
|
export declare function splitMarkTransparency(pointer: SplitPointer, disabled?: boolean): 0 | 0.55 | 0.1;
|
|
5
5
|
export declare function splitHitTransparency(pointer: SplitPointer, disabled?: boolean): 1 | 0.9 | 0.94;
|