@rbxts/uiblox 0.2.0-alpha.2 → 0.2.0-alpha.21
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 +2 -0
- package/out/theme/constants/NumberConstants.d.ts +2 -0
- package/out/theme/constants/NumberConstants.luau +3 -0
- 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/ui/packages/accordion/components/Accordion.d.ts +2 -0
- package/out/ui/packages/accordion/components/Accordion.luau +36 -16
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +16 -4
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +1 -0
- package/out/ui/packages/accordion/components/accordionOpen.luau +4 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +40 -27
- package/out/ui/packages/alert/components/Alert.styles.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +17 -8
- package/out/ui/packages/appBar/components/AppBar.d.ts +2 -1
- package/out/ui/packages/appBar/components/AppBar.luau +5 -0
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
- package/out/ui/packages/appBar/components/AppBar.styles.luau +6 -2
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +20 -12
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.styles.luau +5 -1
- 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.d.ts +3 -0
- package/out/ui/packages/badge/components/Badge.luau +23 -8
- package/out/ui/packages/badge/components/Badge.styles.d.ts +5 -1
- package/out/ui/packages/badge/components/Badge.styles.luau +20 -8
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +9 -3
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +3 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +6 -2
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +59 -25
- 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/card/components/Card.d.ts +1 -0
- package/out/ui/packages/card/components/Card.luau +2 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +6 -1
- package/out/ui/packages/chip/components/Chip.luau +49 -2
- package/out/ui/packages/chip/components/Chip.styles.d.ts +6 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +55 -10
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +13 -2
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +1 -1
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +1 -1
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +1 -1
- 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/divider/components/Divider.d.ts +1 -0
- package/out/ui/packages/divider/components/Divider.luau +48 -0
- package/out/ui/packages/divider/components/Divider.styles.luau +29 -0
- package/out/ui/packages/divider/components/dividerLabel.d.ts +1 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +10 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
- package/out/ui/packages/drawer/components/Drawer.luau +4 -1
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +3 -1
- package/out/ui/packages/drawer/components/Drawer.styles.luau +3 -2
- package/out/ui/packages/fab/components/Fab.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.luau +62 -25
- package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +33 -3
- 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 +100 -0
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +73 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +4 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +31 -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 +7 -0
- package/out/ui/packages/init.luau +21 -0
- package/out/ui/packages/input/components/Input.d.ts +1 -0
- package/out/ui/packages/input/components/Input.luau +8 -3
- 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/FlexItem.d.ts +12 -0
- package/out/ui/packages/layout/components/FlexItem.luau +49 -0
- package/out/ui/packages/layout/components/FlexItem.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/FlexItem.styles.luau +66 -0
- package/out/ui/packages/layout/components/Grid.d.ts +5 -1
- package/out/ui/packages/layout/components/Grid.luau +35 -4
- package/out/ui/packages/layout/components/Stack.d.ts +14 -0
- package/out/ui/packages/layout/components/Stack.luau +53 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +10 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +101 -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/flexItemMode.d.ts +6 -0
- package/out/ui/packages/layout/components/flexItemMode.luau +36 -0
- package/out/ui/packages/layout/components/gridProps.d.ts +3 -0
- package/out/ui/packages/layout/components/gridProps.luau +20 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +10 -0
- package/out/ui/packages/layout/components/stackAlign.luau +43 -0
- package/out/ui/packages/layout/index.d.ts +14 -0
- package/out/ui/packages/layout/init.luau +5 -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 +2 -0
- package/out/ui/packages/listItem/components/ListItem.luau +22 -1
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +16 -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 +5 -0
- package/out/ui/packages/menu/components/Menu.luau +54 -23
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/modal/components/Modal.d.ts +1 -1
- package/out/ui/packages/modal/components/Modal.luau +55 -37
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +1 -0
- package/out/ui/packages/motion/unit.d.ts +5 -0
- package/out/ui/packages/motion/unit.luau +23 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +2 -0
- package/out/ui/packages/pagination/components/Pagination.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.luau +51 -23
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.styles.luau +36 -4
- 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 +2 -1
- package/out/ui/packages/paper/components/Paper.luau +14 -3
- package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
- package/out/ui/packages/paper/components/Paper.styles.luau +6 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +1 -1
- 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 +5 -3
- 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 +11 -0
- package/out/ui/packages/rating/components/Rating.luau +101 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +6 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +44 -0
- package/out/ui/packages/rating/index.d.ts +2 -0
- package/out/ui/packages/rating/init.luau +5 -0
- package/out/ui/packages/rectEditor/components/RectEditor.luau +1 -1
- 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 +4 -3
- 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 +3 -0
- package/out/ui/packages/slider/components/Slider.luau +32 -3
- package/out/ui/packages/slider/components/Slider.styles.d.ts +2 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +14 -1
- 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/snackbar/components/Snackbar.d.ts +2 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +5 -0
- package/out/ui/packages/snackbar/components/snackbarAction.d.ts +1 -0
- package/out/ui/packages/snackbar/components/snackbarAction.luau +10 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +19 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +101 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +5 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +31 -0
- package/out/ui/packages/speedDial/index.d.ts +3 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/SplitPane.luau +1 -1
- package/out/ui/packages/stateMatrix.d.ts +2 -0
- package/out/ui/packages/stateMatrix.luau +881 -253
- package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
- package/out/ui/packages/stepper/components/Stepper.luau +8 -2
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +3 -1
- package/out/ui/packages/stepper/components/Stepper.styles.luau +6 -2
- package/out/ui/packages/switch/components/Switch.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.luau +5 -0
- package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.styles.luau +7 -2
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +7 -4
- package/out/ui/packages/table/components/Table.styles.d.ts +3 -1
- package/out/ui/packages/table/components/Table.styles.luau +10 -6
- package/out/ui/packages/tabs/components/Tabs.d.ts +3 -0
- package/out/ui/packages/tabs/components/Tabs.luau +13 -4
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +5 -1
- package/out/ui/packages/tabs/components/Tabs.styles.luau +26 -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.d.ts +2 -0
- package/out/ui/packages/toast/components/Toast.luau +26 -1
- package/out/ui/packages/toast/components/Toast.styles.luau +22 -4
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +21 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +137 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +9 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +69 -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/vectorEditor/components/VectorEditor.luau +1 -1
- 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
|
@@ -2,6 +2,7 @@ import { CustomizedProps } from "../../../../theme/index";
|
|
|
2
2
|
export interface StepperProps {
|
|
3
3
|
steps: string[];
|
|
4
4
|
activeStep: number;
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
5
6
|
}
|
|
6
7
|
declare function Stepper(props: CustomizedProps<Frame, StepperProps>): JSX.Element;
|
|
7
8
|
export default Stepper;
|
|
@@ -8,11 +8,17 @@ local function Stepper(props)
|
|
|
8
8
|
local _binding = props
|
|
9
9
|
local steps = _binding.steps
|
|
10
10
|
local activeStep = _binding.activeStep
|
|
11
|
+
local orientation = _binding.orientation
|
|
12
|
+
if orientation == nil then
|
|
13
|
+
orientation = "horizontal"
|
|
14
|
+
end
|
|
11
15
|
local className = _binding.className
|
|
12
16
|
local sx = _binding.sx
|
|
13
17
|
local id = _binding.id
|
|
14
18
|
local ref = _binding.ref
|
|
15
|
-
local styles = useStepperStyles(
|
|
19
|
+
local styles = useStepperStyles({
|
|
20
|
+
orientation = orientation,
|
|
21
|
+
})
|
|
16
22
|
local _attributes = {}
|
|
17
23
|
local _condition = id
|
|
18
24
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
@@ -54,7 +60,7 @@ local function Stepper(props)
|
|
|
54
60
|
_newValue[_k] = _callback(_v, _k - 1, steps)
|
|
55
61
|
end
|
|
56
62
|
-- ▲ ReadonlyArray.map ▲
|
|
57
|
-
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
63
|
+
return React.createElement("frame", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
58
64
|
end
|
|
59
65
|
local default = Stepper
|
|
60
66
|
return {
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const useStepperStyles: (
|
|
1
|
+
declare const useStepperStyles: (props: {
|
|
2
|
+
orientation?: "horizontal" | "vertical";
|
|
3
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
4
|
export default useStepperStyles;
|
|
@@ -3,7 +3,11 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useStepperStyles = componentStyles("Stepper", function(theme)
|
|
6
|
+
local useStepperStyles = componentStyles("Stepper", function(theme, _param)
|
|
7
|
+
local orientation = _param.orientation
|
|
8
|
+
if orientation == nil then
|
|
9
|
+
orientation = "horizontal"
|
|
10
|
+
end
|
|
7
11
|
return createStyles({
|
|
8
12
|
root = {
|
|
9
13
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -12,7 +16,7 @@ local useStepperStyles = componentStyles("Stepper", function(theme)
|
|
|
12
16
|
BorderSizePixel = 0,
|
|
13
17
|
},
|
|
14
18
|
list = {
|
|
15
|
-
FillDirection = Enum.FillDirection.Horizontal,
|
|
19
|
+
FillDirection = if orientation == "vertical" then Enum.FillDirection.Vertical else Enum.FillDirection.Horizontal,
|
|
16
20
|
Padding = UDim.new(0, theme.padding.calc(1)),
|
|
17
21
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
18
22
|
},
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { SwitchColor } from "./Switch.styles";
|
|
2
3
|
export interface SwitchProps {
|
|
3
4
|
value: boolean;
|
|
4
5
|
onChange: (value: boolean) => void;
|
|
5
6
|
disabled?: boolean;
|
|
6
7
|
label?: string;
|
|
7
8
|
size?: ControlSize;
|
|
9
|
+
color?: SwitchColor;
|
|
8
10
|
reducedMotion?: boolean;
|
|
9
11
|
}
|
|
10
12
|
declare function Switch(props: CustomizedProps<TextButton, SwitchProps>): JSX.Element;
|
|
@@ -27,6 +27,10 @@ local function Switch(props)
|
|
|
27
27
|
local disabled = _binding.disabled
|
|
28
28
|
local label = _binding.label
|
|
29
29
|
local size = _binding.size
|
|
30
|
+
local color = _binding.color
|
|
31
|
+
if color == nil then
|
|
32
|
+
color = "primary"
|
|
33
|
+
end
|
|
30
34
|
local reducedProp = _binding.reducedMotion
|
|
31
35
|
local className = _binding.className
|
|
32
36
|
local sx = _binding.sx
|
|
@@ -37,6 +41,7 @@ local function Switch(props)
|
|
|
37
41
|
local theme = _binding_1.theme
|
|
38
42
|
local _binding_2 = useSwitchStyles({
|
|
39
43
|
size = size,
|
|
44
|
+
color = color,
|
|
40
45
|
})
|
|
41
46
|
local root = _binding_2.root
|
|
42
47
|
local row = _binding_2.row
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ControlSize } from "../../../../theme/index";
|
|
2
|
+
export type SwitchColor = "primary" | "accent";
|
|
2
3
|
export interface SwitchStyleProps {
|
|
3
4
|
size?: ControlSize;
|
|
5
|
+
color?: SwitchColor;
|
|
4
6
|
}
|
|
5
7
|
declare const useSwitchStyles: (props: SwitchStyleProps) => import("../../../../theme/index").ClassNameMap<string>;
|
|
6
8
|
export default useSwitchStyles;
|
|
@@ -6,7 +6,12 @@ local createStyles = _theme.createStyles
|
|
|
6
6
|
local componentStyles = _theme.componentStyles
|
|
7
7
|
local useSwitchStyles = componentStyles("Switch", function(theme, _param)
|
|
8
8
|
local size = _param.size
|
|
9
|
+
local color = _param.color
|
|
10
|
+
if color == nil then
|
|
11
|
+
color = "primary"
|
|
12
|
+
end
|
|
9
13
|
local metrics = controlMetrics(theme.density, size)
|
|
14
|
+
local onTone = if color == "accent" then theme.palette.accent.main else theme.palette.primary.main
|
|
10
15
|
return createStyles({
|
|
11
16
|
root = {
|
|
12
17
|
AutomaticSize = Enum.AutomaticSize.XY,
|
|
@@ -28,7 +33,7 @@ local useSwitchStyles = componentStyles("Switch", function(theme, _param)
|
|
|
28
33
|
BorderSizePixel = 0,
|
|
29
34
|
},
|
|
30
35
|
trackOn = {
|
|
31
|
-
BackgroundColor3 =
|
|
36
|
+
BackgroundColor3 = onTone,
|
|
32
37
|
},
|
|
33
38
|
knob = {
|
|
34
39
|
Size = UDim2.fromOffset(metrics.switchThumb, metrics.switchThumb),
|
|
@@ -47,7 +52,7 @@ local useSwitchStyles = componentStyles("Switch", function(theme, _param)
|
|
|
47
52
|
TextWrapped = true,
|
|
48
53
|
},
|
|
49
54
|
corner = {
|
|
50
|
-
CornerRadius = UDim.new(
|
|
55
|
+
CornerRadius = UDim.new(theme.shape.pillScale, 0),
|
|
51
56
|
},
|
|
52
57
|
stroke = {
|
|
53
58
|
Color = theme.palette.focus,
|
|
@@ -9,12 +9,15 @@ local function Table(props)
|
|
|
9
9
|
local columns = _binding.columns
|
|
10
10
|
local rows = _binding.rows
|
|
11
11
|
local selected = _binding.selected
|
|
12
|
+
local dense = _binding.dense
|
|
12
13
|
local onRowActivated = _binding.onRowActivated
|
|
13
14
|
local className = _binding.className
|
|
14
15
|
local sx = _binding.sx
|
|
15
16
|
local id = _binding.id
|
|
16
17
|
local ref = _binding.ref
|
|
17
|
-
local styles = useTableStyles(
|
|
18
|
+
local styles = useTableStyles({
|
|
19
|
+
dense = dense,
|
|
20
|
+
})
|
|
18
21
|
local width = if #columns > 0 then 1 / #columns else 1
|
|
19
22
|
local _attributes = {}
|
|
20
23
|
local _condition = id
|
|
@@ -73,7 +76,7 @@ local function Table(props)
|
|
|
73
76
|
_newValue[_k] = _callback(_v, _k - 1, columns)
|
|
74
77
|
end
|
|
75
78
|
-- ▲ ReadonlyArray.map ▲
|
|
76
|
-
local _exp_4 = React.createElement("frame", _attributes_3, _exp_2, _exp_3, _newValue)
|
|
79
|
+
local _exp_4 = React.createElement("frame", _attributes_3, _exp_2, _exp_3, React.createElement(React.Fragment, nil, _newValue))
|
|
77
80
|
-- ▼ ReadonlyArray.map ▼
|
|
78
81
|
local _newValue_1 = table.create(#rows)
|
|
79
82
|
local _callback_1 = function(cells, rowIndex)
|
|
@@ -121,13 +124,13 @@ local function Table(props)
|
|
|
121
124
|
_newValue_2[_k] = _callback_2(_v, _k - 1, columns)
|
|
122
125
|
end
|
|
123
126
|
-- ▲ ReadonlyArray.map ▲
|
|
124
|
-
return React.createElement("textbutton", _attributes_6, _exp_5, _exp_6, _newValue_2)
|
|
127
|
+
return React.createElement("textbutton", _attributes_6, _exp_5, _exp_6, React.createElement(React.Fragment, nil, _newValue_2))
|
|
125
128
|
end
|
|
126
129
|
for _k, _v in rows do
|
|
127
130
|
_newValue_1[_k] = _callback_1(_v, _k - 1, rows)
|
|
128
131
|
end
|
|
129
132
|
-- ▲ ReadonlyArray.map ▲
|
|
130
|
-
return React.createElement("frame", _attributes, _exp, _exp_1, _exp_4, _newValue_1)
|
|
133
|
+
return React.createElement("frame", _attributes, _exp, _exp_1, _exp_4, React.createElement(React.Fragment, nil, _newValue_1))
|
|
131
134
|
end
|
|
132
135
|
local default = Table
|
|
133
136
|
return {
|
|
@@ -3,7 +3,11 @@ local TS = _G[script]
|
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
4
|
local componentStyles = _theme.componentStyles
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
|
-
local useTableStyles = componentStyles("Table", function(theme)
|
|
6
|
+
local useTableStyles = componentStyles("Table", function(theme, _param)
|
|
7
|
+
local dense = _param.dense
|
|
8
|
+
local padY = theme.padding.calc(if dense == true then 0.5 else 1)
|
|
9
|
+
local padX = theme.padding.calc(if dense == true then 1 else 1.5)
|
|
10
|
+
local textSize = if dense == true then theme.typography.fontSizes.caption else theme.typography.fontSizes.body
|
|
7
11
|
return createStyles({
|
|
8
12
|
root = {
|
|
9
13
|
AutomaticSize = Enum.AutomaticSize.Y,
|
|
@@ -44,7 +48,7 @@ local useTableStyles = componentStyles("Table", function(theme)
|
|
|
44
48
|
BackgroundTransparency = 1,
|
|
45
49
|
BorderSizePixel = 0,
|
|
46
50
|
Font = theme.typography.fontFamilies.default,
|
|
47
|
-
TextSize =
|
|
51
|
+
TextSize = textSize,
|
|
48
52
|
TextColor3 = theme.palette.text.primary,
|
|
49
53
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
50
54
|
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
@@ -54,10 +58,10 @@ local useTableStyles = componentStyles("Table", function(theme)
|
|
|
54
58
|
TextColor3 = theme.palette.text.secondary,
|
|
55
59
|
},
|
|
56
60
|
padding = {
|
|
57
|
-
PaddingTop = UDim.new(0,
|
|
58
|
-
PaddingBottom = UDim.new(0,
|
|
59
|
-
PaddingLeft = UDim.new(0,
|
|
60
|
-
PaddingRight = UDim.new(0,
|
|
61
|
+
PaddingTop = UDim.new(0, padY),
|
|
62
|
+
PaddingBottom = UDim.new(0, padY),
|
|
63
|
+
PaddingLeft = UDim.new(0, padX),
|
|
64
|
+
PaddingRight = UDim.new(0, padX),
|
|
61
65
|
},
|
|
62
66
|
corner = {
|
|
63
67
|
CornerRadius = UDim.new(0, theme.shape.borderRadius),
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { CustomizedProps } from "../../../../theme/index";
|
|
2
2
|
import { ChoiceOption } from "../../radioGroup/index";
|
|
3
|
+
import { TabsOrientation } from "./tabsOrientation";
|
|
3
4
|
export interface TabsProps<T> {
|
|
4
5
|
value: T;
|
|
5
6
|
options: ChoiceOption<T>[];
|
|
6
7
|
onChange: (value: T) => void;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
orientation?: TabsOrientation;
|
|
10
|
+
centered?: boolean;
|
|
8
11
|
}
|
|
9
12
|
declare function Tabs<T>(props: CustomizedProps<ScrollingFrame, TabsProps<T>>): JSX.Element;
|
|
10
13
|
export default Tabs;
|
|
@@ -4,6 +4,7 @@ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
5
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
6
6
|
local stepChoice = TS.import(script, script.Parent.Parent.Parent, "select", "components", "stepChoice").stepChoice
|
|
7
|
+
local tabsIsVertical = TS.import(script, script.Parent, "tabsOrientation").tabsIsVertical
|
|
7
8
|
local useTabsStyles = TS.import(script, script.Parent, "Tabs.styles").default
|
|
8
9
|
local function Tabs(props)
|
|
9
10
|
local _binding = props
|
|
@@ -11,11 +12,17 @@ local function Tabs(props)
|
|
|
11
12
|
local options = _binding.options
|
|
12
13
|
local onChange = _binding.onChange
|
|
13
14
|
local disabled = _binding.disabled
|
|
15
|
+
local orientation = _binding.orientation
|
|
16
|
+
local centered = _binding.centered
|
|
14
17
|
local className = _binding.className
|
|
15
18
|
local sx = _binding.sx
|
|
16
19
|
local id = _binding.id
|
|
17
20
|
local ref = _binding.ref
|
|
18
|
-
local styles = useTabsStyles(
|
|
21
|
+
local styles = useTabsStyles({
|
|
22
|
+
orientation = orientation,
|
|
23
|
+
centered = centered,
|
|
24
|
+
})
|
|
25
|
+
local vertical = tabsIsVertical(orientation)
|
|
19
26
|
local choose = function(index)
|
|
20
27
|
local choice = options[index + 1]
|
|
21
28
|
if choice ~= nil and canActivate(disabled or choice.disabled) and choice.value ~= value then
|
|
@@ -36,9 +43,11 @@ local function Tabs(props)
|
|
|
36
43
|
end
|
|
37
44
|
-- ▲ ReadonlyArray.findIndex ▲
|
|
38
45
|
local index = _result
|
|
39
|
-
if
|
|
46
|
+
local back = if vertical then Enum.KeyCode.Up else Enum.KeyCode.Left
|
|
47
|
+
local forward = if vertical then Enum.KeyCode.Down else Enum.KeyCode.Right
|
|
48
|
+
if input.KeyCode == back then
|
|
40
49
|
choose(stepChoice(options, index, -1))
|
|
41
|
-
elseif input.KeyCode ==
|
|
50
|
+
elseif input.KeyCode == forward then
|
|
42
51
|
choose(stepChoice(options, index, 1))
|
|
43
52
|
end
|
|
44
53
|
end
|
|
@@ -105,7 +114,7 @@ local function Tabs(props)
|
|
|
105
114
|
_newValue[_k] = _callback(_v, _k - 1, options)
|
|
106
115
|
end
|
|
107
116
|
-- ▲ ReadonlyArray.map ▲
|
|
108
|
-
return React.createElement("scrollingframe", _attributes, _exp, _newValue)
|
|
117
|
+
return React.createElement("scrollingframe", _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
109
118
|
end
|
|
110
119
|
local default = Tabs
|
|
111
120
|
return {
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { TabsOrientation } from "./tabsOrientation";
|
|
2
|
+
declare const useTabsStyles: (props: {
|
|
3
|
+
orientation?: TabsOrientation;
|
|
4
|
+
centered?: boolean;
|
|
5
|
+
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
2
6
|
export default useTabsStyles;
|
|
@@ -3,32 +3,40 @@ 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
|
|
6
|
+
local tabsIsVertical = TS.import(script, script.Parent, "tabsOrientation").tabsIsVertical
|
|
7
|
+
local useTabsStyles = componentStyles("Tabs", function(theme, _param)
|
|
8
|
+
local orientation = _param.orientation
|
|
9
|
+
local centered = _param.centered
|
|
10
|
+
local vertical = tabsIsVertical(orientation)
|
|
11
|
+
local bar = theme.padding.calc(0.5)
|
|
7
12
|
return createStyles({
|
|
8
13
|
root = {
|
|
9
|
-
Size = UDim2.new(1, 0, 0, theme.spacing.calc(4)),
|
|
14
|
+
Size = if vertical then UDim2.new(0, theme.spacing.calc(16), 1, 0) else UDim2.new(1, 0, 0, theme.spacing.calc(4)),
|
|
10
15
|
BackgroundTransparency = 1,
|
|
11
16
|
BorderSizePixel = 0,
|
|
12
17
|
CanvasSize = UDim2.fromScale(0, 0),
|
|
13
|
-
AutomaticCanvasSize = Enum.AutomaticSize.X,
|
|
14
|
-
ScrollingDirection = Enum.ScrollingDirection.X,
|
|
18
|
+
AutomaticCanvasSize = if vertical then Enum.AutomaticSize.Y else Enum.AutomaticSize.X,
|
|
19
|
+
ScrollingDirection = if vertical then Enum.ScrollingDirection.Y else Enum.ScrollingDirection.X,
|
|
15
20
|
HorizontalScrollBarInset = Enum.ScrollBarInset.Always,
|
|
21
|
+
VerticalScrollBarInset = Enum.ScrollBarInset.Always,
|
|
16
22
|
ScrollBarThickness = theme.padding.calc(0.5),
|
|
17
23
|
ScrollBarImageColor3 = theme.palette.text.secondary,
|
|
18
24
|
},
|
|
19
25
|
list = {
|
|
20
|
-
FillDirection = Enum.FillDirection.Horizontal,
|
|
26
|
+
FillDirection = if vertical then Enum.FillDirection.Vertical else Enum.FillDirection.Horizontal,
|
|
27
|
+
HorizontalAlignment = if centered == true and vertical ~= true then Enum.HorizontalAlignment.Center else Enum.HorizontalAlignment.Left,
|
|
21
28
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
22
29
|
},
|
|
23
30
|
tab = {
|
|
24
|
-
AutomaticSize = Enum.AutomaticSize.X,
|
|
25
|
-
Size = UDim2.fromScale(0, 1),
|
|
31
|
+
AutomaticSize = if vertical then Enum.AutomaticSize.Y else Enum.AutomaticSize.X,
|
|
32
|
+
Size = if vertical then UDim2.new(1, 0, 0, 0) else UDim2.fromScale(0, 1),
|
|
26
33
|
BackgroundTransparency = 1,
|
|
27
34
|
BorderSizePixel = 0,
|
|
28
35
|
AutoButtonColor = false,
|
|
29
36
|
TextColor3 = theme.palette.text.secondary,
|
|
30
37
|
Font = theme.typography.fontFamilies.default,
|
|
31
38
|
TextSize = theme.typography.fontSizes.body,
|
|
39
|
+
TextXAlignment = if vertical then Enum.TextXAlignment.Left else Enum.TextXAlignment.Center,
|
|
32
40
|
},
|
|
33
41
|
selected = {
|
|
34
42
|
TextColor3 = theme.palette.text.primary,
|
|
@@ -39,14 +47,22 @@ local useTabsStyles = componentStyles("Tabs", function(theme)
|
|
|
39
47
|
padding = {
|
|
40
48
|
PaddingLeft = UDim.new(0, theme.padding.calc(2)),
|
|
41
49
|
PaddingRight = UDim.new(0, theme.padding.calc(2)),
|
|
50
|
+
PaddingTop = UDim.new(0, if vertical then theme.padding.calc(1) else 0),
|
|
51
|
+
PaddingBottom = UDim.new(0, if vertical then theme.padding.calc(1) else 0),
|
|
42
52
|
},
|
|
43
|
-
indicator = {
|
|
44
|
-
Size = UDim2.new(
|
|
53
|
+
indicator = if vertical then ({
|
|
54
|
+
Size = UDim2.new(0, bar, 1, -theme.padding.calc(2)),
|
|
55
|
+
Position = UDim2.new(0, 0, 0.5, 0),
|
|
56
|
+
AnchorPoint = Vector2.new(0, 0.5),
|
|
57
|
+
BackgroundColor3 = theme.palette.primary.main,
|
|
58
|
+
BorderSizePixel = 0,
|
|
59
|
+
}) else ({
|
|
60
|
+
Size = UDim2.new(1, theme.padding.calc(4), 0, bar),
|
|
45
61
|
Position = UDim2.fromScale(0.5, 1),
|
|
46
62
|
AnchorPoint = Vector2.new(0.5, 1),
|
|
47
63
|
BackgroundColor3 = theme.palette.primary.main,
|
|
48
64
|
BorderSizePixel = 0,
|
|
49
|
-
},
|
|
65
|
+
}),
|
|
50
66
|
})
|
|
51
67
|
end)
|
|
52
68
|
local default = useTabsStyles
|
|
@@ -18,6 +18,8 @@ local function Toast(props)
|
|
|
18
18
|
if duration == nil then
|
|
19
19
|
duration = 4
|
|
20
20
|
end
|
|
21
|
+
local action = _binding.action
|
|
22
|
+
local onAction = _binding.onAction
|
|
21
23
|
local className = _binding.className
|
|
22
24
|
local sx = _binding.sx
|
|
23
25
|
local id = _binding.id
|
|
@@ -26,6 +28,7 @@ local function Toast(props)
|
|
|
26
28
|
local container = _binding_1.container
|
|
27
29
|
local label = _binding_1.label
|
|
28
30
|
local close = _binding_1.close
|
|
31
|
+
local actionStyle = _binding_1.action
|
|
29
32
|
local activePosition = _binding_1.activePosition
|
|
30
33
|
local inActivePosition = _binding_1.inActivePosition
|
|
31
34
|
local frameRef = useRef()
|
|
@@ -90,6 +93,28 @@ local function Toast(props)
|
|
|
90
93
|
end
|
|
91
94
|
_attributes_1.Text = text
|
|
92
95
|
local _exp_2 = React.createElement("textlabel", _attributes_1)
|
|
96
|
+
local _condition_1 = action ~= nil and #action > 0
|
|
97
|
+
if _condition_1 then
|
|
98
|
+
local _attributes_2 = {
|
|
99
|
+
key = "Action",
|
|
100
|
+
}
|
|
101
|
+
for _k, _v in actionStyle do
|
|
102
|
+
_attributes_2[_k] = _v
|
|
103
|
+
end
|
|
104
|
+
_attributes_2.Text = action
|
|
105
|
+
_attributes_2.Event = {
|
|
106
|
+
Activated = function()
|
|
107
|
+
if onAction then
|
|
108
|
+
onAction()
|
|
109
|
+
end
|
|
110
|
+
tween(Directions.Out)
|
|
111
|
+
if onDismiss then
|
|
112
|
+
onDismiss()
|
|
113
|
+
end
|
|
114
|
+
end,
|
|
115
|
+
}
|
|
116
|
+
_condition_1 = (React.createElement("textbutton", _attributes_2))
|
|
117
|
+
end
|
|
93
118
|
local _attributes_2 = {
|
|
94
119
|
key = "Close",
|
|
95
120
|
}
|
|
@@ -104,7 +129,7 @@ local function Toast(props)
|
|
|
104
129
|
end
|
|
105
130
|
end,
|
|
106
131
|
}
|
|
107
|
-
return React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, React.createElement("imagebutton", _attributes_2))
|
|
132
|
+
return React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, _condition_1, React.createElement("imagebutton", _attributes_2))
|
|
108
133
|
end
|
|
109
134
|
local default = Toast
|
|
110
135
|
return {
|
|
@@ -11,6 +11,7 @@ local useToastStyles = componentStyles("Toast", function(theme, _param)
|
|
|
11
11
|
if variant == nil then
|
|
12
12
|
variant = ToastVariants.default
|
|
13
13
|
end
|
|
14
|
+
local action = _param.action
|
|
14
15
|
local getToastColors = function()
|
|
15
16
|
repeat
|
|
16
17
|
if variant == (ToastVariants.success) then
|
|
@@ -38,6 +39,8 @@ local useToastStyles = componentStyles("Toast", function(theme, _param)
|
|
|
38
39
|
until true
|
|
39
40
|
end
|
|
40
41
|
local toastColors = getToastColors()
|
|
42
|
+
local hasAction = action ~= nil and #action > 0
|
|
43
|
+
local actionSlot = if hasAction then theme.spacing.calc(8) else 0
|
|
41
44
|
local ACTIVE_POSITION = UDim2.new(0.5, 0, 1, -DEFAULT_THEME.padding.calc(2))
|
|
42
45
|
local INACTIVE_POSITION = UDim2.new(0.5, 0, 1, DEFAULT_THEME.spacing.calc(20) + DEFAULT_THEME.padding.calc(2))
|
|
43
46
|
return createStyles({
|
|
@@ -50,19 +53,34 @@ local useToastStyles = componentStyles("Toast", function(theme, _param)
|
|
|
50
53
|
ZIndex = 50000,
|
|
51
54
|
},
|
|
52
55
|
label = {
|
|
53
|
-
Size = UDim2.new(1, -theme.padding.calc(4), 1, -theme.padding.calc(4)),
|
|
54
|
-
Position = UDim2.new(0.5, 0, 0.5, 0),
|
|
55
|
-
AnchorPoint = Vector2.new(0.5, 0.5),
|
|
56
|
+
Size = UDim2.new(1, -(theme.padding.calc(4) + actionSlot), 1, -theme.padding.calc(4)),
|
|
57
|
+
Position = if hasAction then UDim2.new(0, theme.padding.calc(2), 0.5, 0) else UDim2.new(0.5, 0, 0.5, 0),
|
|
58
|
+
AnchorPoint = if hasAction then Vector2.new(0, 0.5) else Vector2.new(0.5, 0.5),
|
|
56
59
|
BackgroundTransparency = 1,
|
|
57
60
|
BorderSizePixel = 0,
|
|
58
61
|
TextSize = theme.typography.fontSizes.body,
|
|
59
62
|
TextColor3 = toastColors.content,
|
|
60
63
|
Font = theme.typography.fontFamilies.default,
|
|
64
|
+
TextXAlignment = if hasAction then Enum.TextXAlignment.Left else Enum.TextXAlignment.Center,
|
|
65
|
+
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
61
66
|
TextScaled = false,
|
|
62
67
|
ZIndex = 50001,
|
|
63
68
|
},
|
|
69
|
+
action = {
|
|
70
|
+
AutomaticSize = Enum.AutomaticSize.X,
|
|
71
|
+
Size = UDim2.new(0, 0, 0, theme.spacing.calc(3)),
|
|
72
|
+
Position = UDim2.new(1, -(theme.padding.calc(2) + theme.options.constants.iconSizes.small + theme.padding.calc(1)), 0.5, 0),
|
|
73
|
+
AnchorPoint = Vector2.new(1, 0.5),
|
|
74
|
+
BackgroundTransparency = 1,
|
|
75
|
+
BorderSizePixel = 0,
|
|
76
|
+
Font = theme.typography.fontFamilies.default,
|
|
77
|
+
TextSize = theme.typography.fontSizes.body,
|
|
78
|
+
TextColor3 = toastColors.content,
|
|
79
|
+
AutoButtonColor = false,
|
|
80
|
+
ZIndex = 50001,
|
|
81
|
+
},
|
|
64
82
|
close = {
|
|
65
|
-
Size = UDim2.new(0, theme.
|
|
83
|
+
Size = UDim2.new(0, theme.options.constants.iconSizes.small, 0, theme.options.constants.iconSizes.small),
|
|
66
84
|
Position = UDim2.new(1, -theme.padding.calc(2), 0, theme.padding.calc(2)),
|
|
67
85
|
AnchorPoint = Vector2.new(1, 0),
|
|
68
86
|
ImageColor3 = toastColors.content,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ControlSize, CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { ChoiceOption } from "../../radioGroup/index";
|
|
3
|
+
import { ToggleButtonOrientation } from "./ToggleButton.styles";
|
|
4
|
+
export interface ToggleButtonProps {
|
|
5
|
+
label: string;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
size?: ControlSize;
|
|
9
|
+
onActivated?: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare function ToggleButton(props: CustomizedProps<TextButton, ToggleButtonProps>): JSX.Element;
|
|
12
|
+
export interface ToggleButtonGroupProps<T> {
|
|
13
|
+
value: T;
|
|
14
|
+
options: ChoiceOption<T>[];
|
|
15
|
+
onChange: (value: T) => void;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
size?: ControlSize;
|
|
18
|
+
orientation?: ToggleButtonOrientation;
|
|
19
|
+
}
|
|
20
|
+
export declare function ToggleButtonGroup<T>(props: CustomizedProps<Frame, ToggleButtonGroupProps<T>>): JSX.Element;
|
|
21
|
+
export default ToggleButton;
|