@rbxts/uiblox 0.2.0-alpha.37 → 0.2.0-alpha.38
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 +1 -18
- package/out/theme/constants/NumberConstants.d.ts +10 -0
- package/out/theme/constants/NumberConstants.luau +12 -0
- package/out/theme/interfaces/density/controlMetrics.luau +2 -2
- package/out/theme/interfaces/palette/Palette.d.ts +7 -0
- package/out/theme/interfaces/spacing/Shape.d.ts +6 -0
- package/out/theme/interfaces/theme/Theme.d.ts +6 -0
- package/out/theme/interfaces/typography/FontFamilies.luau +1 -0
- package/out/theme/interfaces/typography/FontFamilyOptions.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizeOptions.d.ts +1 -1
- package/out/theme/interfaces/typography/FontSizes.luau +2 -0
- package/out/theme/interfaces/typography/Variants.d.ts +3 -1
- package/out/theme/interfaces/typography/Variants.luau +25 -1
- package/out/theme/styles/utilities/focusRing.d.ts +2 -0
- package/out/theme/styles/utilities/focusRing.luau +3 -0
- package/out/theme/styles/utilities/index.d.ts +1 -1
- package/out/theme/styles/utilities/init.luau +3 -1
- package/out/theme/themes/DarkTheme.luau +4 -0
- package/out/theme/themes/LightTheme.luau +4 -0
- package/out/theme/themes/createPalette.luau +15 -0
- package/out/ui/packages/accordion/components/Accordion.luau +84 -40
- package/out/ui/packages/accordion/components/Accordion.styles.luau +35 -17
- package/out/ui/packages/alert/components/Alert.luau +15 -11
- package/out/ui/packages/alert/components/Alert.styles.luau +37 -26
- package/out/ui/packages/appBar/components/AppBar.luau +35 -13
- package/out/ui/packages/appBar/components/AppBar.styles.luau +41 -35
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +4 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +9 -2
- package/out/ui/packages/avatar/components/Avatar.styles.luau +7 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +9 -4
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +6 -1
- package/out/ui/packages/badge/components/Badge.luau +14 -11
- package/out/ui/packages/badge/components/Badge.styles.luau +5 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +4 -3
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +6 -2
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +4 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +20 -2
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.styles.luau +72 -66
- package/out/ui/packages/button/components/Button.luau +61 -34
- package/out/ui/packages/button/components/buttonPaint.d.ts +16 -0
- package/out/ui/packages/button/components/buttonPaint.luau +70 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +1 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +17 -2
- package/out/ui/packages/card/components/Card.styles.luau +4 -2
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -1
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +50 -41
- package/out/ui/packages/checkbox/components/Checkbox.luau +5 -4
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +2 -2
- package/out/ui/packages/checkbox/components/checkboxLook.luau +2 -2
- package/out/ui/packages/chip/components/Chip.luau +16 -14
- package/out/ui/packages/chip/components/Chip.styles.luau +7 -4
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +10 -3
- package/out/ui/packages/codeEditor/components/CodeEditor.d.ts +12 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.luau +262 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.styles.d.ts +6 -0
- package/out/ui/packages/codeEditor/components/CodeEditor.styles.luau +124 -0
- package/out/ui/packages/codeEditor/highlightCode.d.ts +11 -0
- package/out/ui/packages/codeEditor/highlightCode.luau +503 -0
- package/out/ui/packages/codeEditor/index.d.ts +2 -0
- package/out/ui/packages/codeEditor/init.luau +5 -0
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +9 -1
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +74 -67
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +12 -4
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +12 -4
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +31 -19
- package/out/ui/packages/dialog/components/Dialog.styles.luau +4 -2
- package/out/ui/packages/divider/components/Divider.luau +3 -1
- package/out/ui/packages/divider/components/Divider.styles.luau +1 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
- package/out/ui/packages/drawer/components/Drawer.luau +43 -14
- package/out/ui/packages/drawer/components/Drawer.styles.luau +13 -5
- package/out/ui/packages/drawer/components/drawerPlacement.d.ts +2 -0
- package/out/ui/packages/drawer/components/drawerPlacement.luau +18 -0
- package/out/ui/packages/editorFace.d.ts +22 -0
- package/out/ui/packages/editorFace.luau +49 -0
- package/out/ui/packages/fab/components/Fab.luau +19 -6
- package/out/ui/packages/fab/components/Fab.styles.luau +4 -3
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
- package/out/ui/packages/fontEditor/components/FontEditor.luau +13 -3
- package/out/ui/packages/fontEditor/components/FontEditor.styles.luau +36 -27
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +21 -13
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +52 -44
- package/out/ui/packages/icon/components/DrawnGlyph.d.ts +11 -0
- package/out/ui/packages/icon/components/DrawnGlyph.luau +87 -0
- package/out/ui/packages/icon/components/Icon.d.ts +6 -2
- package/out/ui/packages/icon/components/Icon.luau +23 -3
- package/out/ui/packages/icon/components/Icon.styles.luau +3 -0
- package/out/ui/packages/icon/components/glyphs.d.ts +28 -0
- package/out/ui/packages/icon/components/glyphs.luau +64 -0
- package/out/ui/packages/icon/index.d.ts +1 -0
- package/out/ui/packages/iconButton/components/IconButton.d.ts +5 -2
- package/out/ui/packages/iconButton/components/IconButton.luau +83 -16
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +4 -27
- package/out/ui/packages/iconButton/components/iconButtonBox.d.ts +11 -0
- package/out/ui/packages/iconButton/components/iconButtonBox.luau +48 -0
- package/out/ui/packages/iconButton/components/transportGlyph.d.ts +1 -0
- package/out/ui/packages/iconButton/components/transportGlyph.luau +4 -0
- package/out/ui/packages/imageList/components/ImageList.luau +11 -36
- package/out/ui/packages/imageList/components/ImageList.styles.luau +1 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -2
- package/out/ui/packages/imageList/components/imageListLayout.luau +0 -8
- package/out/ui/packages/index.d.ts +1 -0
- package/out/ui/packages/init.luau +3 -0
- package/out/ui/packages/input/components/Input.luau +46 -29
- package/out/ui/packages/input/components/Input.styles.luau +8 -11
- package/out/ui/packages/input/components/fieldChrome.d.ts +5 -0
- package/out/ui/packages/input/components/fieldChrome.luau +11 -0
- package/out/ui/packages/layout/components/Box.luau +92 -13
- package/out/ui/packages/layout/components/Box.styles.d.ts +0 -2
- package/out/ui/packages/layout/components/Box.styles.luau +0 -9
- package/out/ui/packages/layout/components/Grid.luau +81 -16
- package/out/ui/packages/layout/components/Pad.d.ts +24 -0
- package/out/ui/packages/layout/components/Pad.luau +88 -0
- package/out/ui/packages/layout/components/Stack.luau +79 -13
- package/out/ui/packages/link/components/Link.luau +19 -13
- package/out/ui/packages/link/components/Link.styles.luau +10 -1
- package/out/ui/packages/listItem/components/ListItem.luau +61 -4
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +28 -11
- package/out/ui/packages/listItem/components/listItemInk.d.ts +1 -1
- package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -2
- package/out/ui/packages/listItem/components/listItemLayout.luau +29 -2
- package/out/ui/packages/markdown/components/Markdown.luau +163 -50
- package/out/ui/packages/markdown/components/Markdown.styles.luau +125 -76
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +215 -146
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +1 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +153 -83
- package/out/ui/packages/markdown/index.d.ts +1 -1
- package/out/ui/packages/markdown/parseMarkdown.d.ts +9 -1
- package/out/ui/packages/markdown/parseMarkdown.luau +350 -29
- package/out/ui/packages/menu/components/Menu.d.ts +1 -1
- package/out/ui/packages/menu/components/Menu.luau +12 -11
- package/out/ui/packages/menu/components/Menu.styles.luau +6 -1
- package/out/ui/packages/menu/components/menuIcon.d.ts +1 -1
- package/out/ui/packages/numberInput/components/NumberInput.luau +19 -4
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +9 -1
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.styles.luau +23 -16
- package/out/ui/packages/pager/components/Pager.luau +15 -13
- package/out/ui/packages/pager/components/Pager.styles.luau +5 -0
- package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -1
- package/out/ui/packages/paper/components/Paper.luau +17 -11
- package/out/ui/packages/paper/components/Paper.styles.luau +12 -5
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +9 -1
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +24 -19
- package/out/ui/packages/popover/components/Popover.d.ts +1 -1
- package/out/ui/packages/popover/components/Popover.luau +6 -4
- package/out/ui/packages/popover/components/Popover.styles.luau +6 -0
- package/out/ui/packages/popup/components/Popup.d.ts +2 -0
- package/out/ui/packages/popup/components/Popup.luau +64 -2
- package/out/ui/packages/popup/components/placement.luau +6 -4
- package/out/ui/packages/progressBar/components/ProgressBar.luau +1 -1
- package/out/ui/packages/progressBar/components/ProgressBar.styles.luau +3 -2
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +2 -1
- package/out/ui/packages/rating/components/Rating.luau +45 -3
- package/out/ui/packages/rating/components/Rating.styles.luau +1 -1
- package/out/ui/packages/rayEditor/components/RayEditor.luau +9 -1
- package/out/ui/packages/rayEditor/components/RayEditor.styles.luau +17 -11
- package/out/ui/packages/rectEditor/components/RectEditor.luau +9 -1
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +49 -42
- package/out/ui/packages/select/components/Select.d.ts +2 -0
- package/out/ui/packages/select/components/Select.luau +148 -106
- package/out/ui/packages/select/components/Select.styles.d.ts +2 -0
- package/out/ui/packages/select/components/Select.styles.luau +29 -5
- package/out/ui/packages/shadow/components/Shadow.luau +188 -19
- package/out/ui/packages/sidebar/components/Sidebar.styles.luau +1 -0
- package/out/ui/packages/skeleton/components/Skeleton.luau +4 -0
- package/out/ui/packages/slider/components/RangeSlider.luau +6 -5
- package/out/ui/packages/slider/components/Slider.luau +11 -16
- package/out/ui/packages/sparkline/components/Sparkline.luau +7 -5
- package/out/ui/packages/speedDial/components/SpeedDial.luau +4 -1
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +5 -0
- package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +1 -1
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stepper/components/Stepper.styles.luau +9 -6
- package/out/ui/packages/switch/components/Switch.luau +2 -2
- package/out/ui/packages/switch/components/switchLook.d.ts +3 -3
- package/out/ui/packages/switch/components/switchLook.luau +4 -10
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +92 -53
- package/out/ui/packages/table/components/Table.styles.luau +23 -6
- package/out/ui/packages/table/components/tableColumns.d.ts +2 -0
- package/out/ui/packages/table/components/tableColumns.luau +2 -0
- package/out/ui/packages/tabs/components/Tabs.luau +7 -4
- package/out/ui/packages/tabs/components/Tabs.styles.luau +12 -11
- package/out/ui/packages/tabs/components/tabIndicator.d.ts +7 -0
- package/out/ui/packages/tabs/components/tabIndicator.luau +21 -0
- package/out/ui/packages/text/components/Text.d.ts +2 -0
- package/out/ui/packages/text/components/Text.luau +12 -2
- package/out/ui/packages/timeField/components/TimeField.luau +11 -7
- package/out/ui/packages/timeline/components/Timeline.luau +35 -32
- package/out/ui/packages/timeline/components/Timeline.styles.luau +19 -10
- package/out/ui/packages/toast/components/Toast.luau +168 -72
- package/out/ui/packages/toast/components/Toast.styles.luau +36 -19
- package/out/ui/packages/toast/components/toastPlace.d.ts +4 -0
- package/out/ui/packages/toast/components/toastPlace.luau +13 -0
- package/out/ui/packages/toast/enums/ToastVariants.d.ts +2 -1
- package/out/ui/packages/toast/enums/ToastVariants.luau +1 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +43 -4
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +1 -1
- package/out/ui/packages/tooltip/components/Tooltip.styles.luau +2 -2
- package/out/ui/packages/treeView/components/TreeView.luau +12 -13
- package/out/ui/packages/treeView/components/TreeView.styles.luau +6 -0
- package/out/ui/packages/typography/components/Typography.d.ts +2 -0
- package/out/ui/packages/typography/components/Typography.luau +8 -0
- package/out/ui/packages/typography/components/Typography.styles.luau +3 -1
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +9 -1
- package/out/ui/packages/udimEditor/components/UDimEditor.styles.luau +25 -18
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +17 -3
- package/out/ui/packages/vectorEditor/components/VectorEditor.styles.luau +30 -16
- package/out/ui/packages/virtualList/components/VirtualList.styles.luau +1 -0
- package/package.json +69 -67
package/README.md
CHANGED
|
@@ -6,25 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
UI library and theming for roblox-ts projects.
|
|
8
8
|
|
|
9
|
-
## Background
|
|
10
|
-
|
|
11
|
-
Roblox has their own internal design system, coined "uiblox-web", that it uses for its new
|
|
12
|
-
web-facing products. This system offers reusable components, implemented in
|
|
13
|
-
React Typescript, that are derived from material UI (MUI). As well, it offers a
|
|
14
|
-
common theme/pallete for consistent UI/UX.
|
|
15
|
-
|
|
16
|
-
Anyone is able to view their design system as
|
|
17
|
-
[UIBlox-Web](https://uiblox.roblox.com). You can see that they leverage
|
|
18
|
-
[Storybook](https://storybook.js.org), a UI component explorer for frontend
|
|
19
|
-
developers, to render component previews.
|
|
20
|
-
|
|
21
|
-
Design systems all help engineers cut down on implementation time and ensure
|
|
22
|
-
consitent UX across products.
|
|
23
|
-
|
|
24
9
|
## Overview
|
|
25
10
|
|
|
26
|
-
|
|
27
|
-
uiblox-web for games written using roblox-ts.
|
|
11
|
+
uiblox-rbxts is a design system for games written using roblox-ts.
|
|
28
12
|
|
|
29
13
|
UIBlox-rbxts aims to provide extensible components that can be reusable by
|
|
30
14
|
anyone who installs this npm package. It also offers a theme and styling system
|
|
@@ -254,4 +238,3 @@ new AppLoader().Mount();
|
|
|
254
238
|
- [Storyblox](https://github.com/bjlarouche/storyblox) a UI component explorer for roblox-ts developers
|
|
255
239
|
- <img src=docs/storyblox-preview.png width=40%>
|
|
256
240
|
- Test it out here [Storyblox Pre-Release Experience](https://www.roblox.com/games/9159382473)
|
|
257
|
-
- Similar to [hoarcekat](https://github.com/Kampfkarren/hoarcekat) by Kampfkarren
|
|
@@ -2,6 +2,16 @@ import { IconSizes } from "../interfaces/iconSizes/index";
|
|
|
2
2
|
export declare const SPACING_BASE = 8;
|
|
3
3
|
export declare const PADDING_BASE = 4;
|
|
4
4
|
export declare const BORDER_RADIUS = 4;
|
|
5
|
+
export declare const RADIUS: {
|
|
6
|
+
small: number;
|
|
7
|
+
default: number;
|
|
8
|
+
large: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const MOTION: {
|
|
11
|
+
fast: number;
|
|
12
|
+
default: number;
|
|
13
|
+
slow: number;
|
|
14
|
+
};
|
|
5
15
|
/** UICorner scale for pill/capsule controls (1 = fully round). */
|
|
6
16
|
export declare const PILL_SCALE = 1;
|
|
7
17
|
export declare const CONTENT_WIDTH = 1024;
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
local SPACING_BASE = 8
|
|
3
3
|
local PADDING_BASE = 4
|
|
4
4
|
local BORDER_RADIUS = 4
|
|
5
|
+
local RADIUS = {
|
|
6
|
+
small = 2,
|
|
7
|
+
default = BORDER_RADIUS,
|
|
8
|
+
large = 8,
|
|
9
|
+
}
|
|
10
|
+
local MOTION = {
|
|
11
|
+
fast = 0.1,
|
|
12
|
+
default = 0.14,
|
|
13
|
+
slow = 0.24,
|
|
14
|
+
}
|
|
5
15
|
--* UICorner scale for pill/capsule controls (1 = fully round).
|
|
6
16
|
local PILL_SCALE = 1
|
|
7
17
|
local CONTENT_WIDTH = 1024
|
|
@@ -14,6 +24,8 @@ return {
|
|
|
14
24
|
SPACING_BASE = SPACING_BASE,
|
|
15
25
|
PADDING_BASE = PADDING_BASE,
|
|
16
26
|
BORDER_RADIUS = BORDER_RADIUS,
|
|
27
|
+
RADIUS = RADIUS,
|
|
28
|
+
MOTION = MOTION,
|
|
17
29
|
PILL_SCALE = PILL_SCALE,
|
|
18
30
|
CONTENT_WIDTH = CONTENT_WIDTH,
|
|
19
31
|
ICON_SIZES = ICON_SIZES,
|
|
@@ -28,7 +28,7 @@ local METRICS = {
|
|
|
28
28
|
sliderTrack = 6,
|
|
29
29
|
sliderKnob = 14,
|
|
30
30
|
radio = 18,
|
|
31
|
-
icon =
|
|
31
|
+
icon = 16,
|
|
32
32
|
font = 14,
|
|
33
33
|
markFont = 12,
|
|
34
34
|
buttonHeight = 36,
|
|
@@ -45,7 +45,7 @@ local METRICS = {
|
|
|
45
45
|
sliderTrack = 8,
|
|
46
46
|
sliderKnob = 18,
|
|
47
47
|
radio = 22,
|
|
48
|
-
icon =
|
|
48
|
+
icon = 20,
|
|
49
49
|
font = 16,
|
|
50
50
|
markFont = 12,
|
|
51
51
|
buttonHeight = 48,
|
|
@@ -3,4 +3,10 @@ export default interface Shape {
|
|
|
3
3
|
borderRadius: number;
|
|
4
4
|
/** UICorner scale for capsules (Switch, Chip). Use `new UDim(pillScale, 0)`. */
|
|
5
5
|
pillScale: number;
|
|
6
|
+
/** Pixel radii: tight internals, controls and surfaces, dialogs and cards. `default` matches `borderRadius`. */
|
|
7
|
+
radius: {
|
|
8
|
+
small: number;
|
|
9
|
+
default: number;
|
|
10
|
+
large: number;
|
|
11
|
+
};
|
|
6
12
|
}
|
|
@@ -7,6 +7,12 @@ interface Theme {
|
|
|
7
7
|
type: string;
|
|
8
8
|
density: ThemeDensity;
|
|
9
9
|
reducedMotion?: boolean;
|
|
10
|
+
/** Tween seconds: focus and hover, menus and disclosure, sheets and snackbars. */
|
|
11
|
+
motion: {
|
|
12
|
+
fast: number;
|
|
13
|
+
default: number;
|
|
14
|
+
slow: number;
|
|
15
|
+
};
|
|
10
16
|
options: ThemeOptions;
|
|
11
17
|
palette: Palette;
|
|
12
18
|
padding: Padding;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type FontFamilyVariant = "default" | "bold" | "semibold" | "light" | "italics";
|
|
1
|
+
export type FontFamilyVariant = "default" | "bold" | "semibold" | "light" | "italics" | "mono";
|
|
2
2
|
export interface FontFamilyOptions extends Partial<Record<FontFamilyVariant, Required<Enum.Font>>> {
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type FontSizeVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body" | "caption" | "button" | "overline";
|
|
1
|
+
export type FontSizeVariant = "display" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "subtitle1" | "subtitle2" | "body" | "bodySmall" | "caption" | "button" | "overline";
|
|
2
2
|
export interface FontSizeOptions extends Partial<Record<FontSizeVariant, Required<number>>> {
|
|
3
3
|
}
|
|
@@ -3,6 +3,7 @@ local TS = _G[script]
|
|
|
3
3
|
local allTypographyVariants = TS.import(script, script.Parent, "Variants").allTypographyVariants
|
|
4
4
|
local baseFontSize = allTypographyVariants.body.size
|
|
5
5
|
local allFontSizes = {
|
|
6
|
+
display = allTypographyVariants.display.size,
|
|
6
7
|
h1 = allTypographyVariants.h1.size,
|
|
7
8
|
h2 = allTypographyVariants.h2.size,
|
|
8
9
|
h3 = allTypographyVariants.h3.size,
|
|
@@ -12,6 +13,7 @@ local allFontSizes = {
|
|
|
12
13
|
subtitle1 = allTypographyVariants.subtitle1.size,
|
|
13
14
|
subtitle2 = allTypographyVariants.subtitle2.size,
|
|
14
15
|
body = allTypographyVariants.body.size,
|
|
16
|
+
bodySmall = allTypographyVariants.bodySmall.size,
|
|
15
17
|
caption = allTypographyVariants.caption.size,
|
|
16
18
|
overline = allTypographyVariants.overline.size,
|
|
17
19
|
button = allTypographyVariants.button.size,
|
|
@@ -5,9 +5,11 @@ export interface TypographyVariantSpec {
|
|
|
5
5
|
family: FontFamilyVariant;
|
|
6
6
|
/** Approx CSS weight; Roblox TextLabel uses `family` / FontFace */
|
|
7
7
|
weight: number;
|
|
8
|
+
/** TextLabel.LineHeight multiplier */
|
|
9
|
+
leading: number;
|
|
8
10
|
}
|
|
9
11
|
export type TypographyVariants = FontSizeVariant;
|
|
10
|
-
/** Size
|
|
12
|
+
/** Size, family, weight, and line height per typography variant. */
|
|
11
13
|
export declare const allTypographyVariants: Record<FontSizeVariant, TypographyVariantSpec>;
|
|
12
14
|
/** @deprecated prefer allTypographyVariants[*].weight */
|
|
13
15
|
export declare const TypographyWeights: {
|
|
@@ -1,65 +1,89 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
--* Size
|
|
2
|
+
--* Size, family, weight, and line height per typography variant.
|
|
3
3
|
local allTypographyVariants = {
|
|
4
|
+
display = {
|
|
5
|
+
size = 36,
|
|
6
|
+
family = "bold",
|
|
7
|
+
weight = 700,
|
|
8
|
+
leading = 1.15,
|
|
9
|
+
},
|
|
4
10
|
h1 = {
|
|
5
11
|
size = 28,
|
|
6
12
|
family = "bold",
|
|
7
13
|
weight = 700,
|
|
14
|
+
leading = 1.2,
|
|
8
15
|
},
|
|
9
16
|
h2 = {
|
|
10
17
|
size = 22,
|
|
11
18
|
family = "bold",
|
|
12
19
|
weight = 700,
|
|
20
|
+
leading = 1.2,
|
|
13
21
|
},
|
|
14
22
|
h3 = {
|
|
15
23
|
size = 18,
|
|
16
24
|
family = "semibold",
|
|
17
25
|
weight = 600,
|
|
26
|
+
leading = 1.3,
|
|
18
27
|
},
|
|
19
28
|
h4 = {
|
|
20
29
|
size = 16,
|
|
21
30
|
family = "semibold",
|
|
22
31
|
weight = 600,
|
|
32
|
+
leading = 1.3,
|
|
23
33
|
},
|
|
24
34
|
h5 = {
|
|
25
35
|
size = 14,
|
|
26
36
|
family = "semibold",
|
|
27
37
|
weight = 600,
|
|
38
|
+
leading = 1.3,
|
|
28
39
|
},
|
|
29
40
|
h6 = {
|
|
30
41
|
size = 14,
|
|
31
42
|
family = "semibold",
|
|
32
43
|
weight = 600,
|
|
44
|
+
leading = 1.3,
|
|
33
45
|
},
|
|
34
46
|
subtitle1 = {
|
|
35
47
|
size = 16,
|
|
36
48
|
family = "default",
|
|
37
49
|
weight = 400,
|
|
50
|
+
leading = 1.4,
|
|
38
51
|
},
|
|
39
52
|
subtitle2 = {
|
|
40
53
|
size = 14,
|
|
41
54
|
family = "semibold",
|
|
42
55
|
weight = 600,
|
|
56
|
+
leading = 1.4,
|
|
43
57
|
},
|
|
44
58
|
body = {
|
|
45
59
|
size = 14,
|
|
46
60
|
family = "default",
|
|
47
61
|
weight = 400,
|
|
62
|
+
leading = 1.4,
|
|
63
|
+
},
|
|
64
|
+
bodySmall = {
|
|
65
|
+
size = 13,
|
|
66
|
+
family = "default",
|
|
67
|
+
weight = 400,
|
|
68
|
+
leading = 1.4,
|
|
48
69
|
},
|
|
49
70
|
button = {
|
|
50
71
|
size = 13,
|
|
51
72
|
family = "semibold",
|
|
52
73
|
weight = 600,
|
|
74
|
+
leading = 1.15,
|
|
53
75
|
},
|
|
54
76
|
caption = {
|
|
55
77
|
size = 12,
|
|
56
78
|
family = "default",
|
|
57
79
|
weight = 400,
|
|
80
|
+
leading = 1.4,
|
|
58
81
|
},
|
|
59
82
|
overline = {
|
|
60
83
|
size = 10,
|
|
61
84
|
family = "default",
|
|
62
85
|
weight = 400,
|
|
86
|
+
leading = 1.4,
|
|
63
87
|
},
|
|
64
88
|
}
|
|
65
89
|
--* @deprecated prefer allTypographyVariants[*].weight
|
|
@@ -3,7 +3,7 @@ export { default as makeStyles } from "./makeStyles";
|
|
|
3
3
|
export { default as classNames, cx } from "./classNames";
|
|
4
4
|
export { applyVariants, CompoundVariant } from "./variants";
|
|
5
5
|
export { default as componentStyles } from "./componentStyles";
|
|
6
|
-
export { focusRing } from "./focusRing";
|
|
6
|
+
export { controlFade, focusRing } from "./focusRing";
|
|
7
7
|
export { resolveResponsive, Responsive } from "../../../hooks/breakpoints";
|
|
8
8
|
export { clearStyleCaches, createStyleCache, styleDepsKey } from "./styleCache";
|
|
9
9
|
export { resolveSx, resolvePaletteToken, PaletteToken, ResolvedSx, SxColor, SxGradient, SxInput } from "./resolveSx";
|
|
@@ -8,7 +8,9 @@ exports.classNames = _classNames.default
|
|
|
8
8
|
exports.cx = _classNames.cx
|
|
9
9
|
exports.applyVariants = TS.import(script, script, "variants").applyVariants
|
|
10
10
|
exports.componentStyles = TS.import(script, script, "componentStyles").default
|
|
11
|
-
|
|
11
|
+
local _focusRing = TS.import(script, script, "focusRing")
|
|
12
|
+
exports.controlFade = _focusRing.controlFade
|
|
13
|
+
exports.focusRing = _focusRing.focusRing
|
|
12
14
|
exports.resolveResponsive = TS.import(script, script.Parent.Parent.Parent, "hooks", "breakpoints").resolveResponsive
|
|
13
15
|
local _styleCache = TS.import(script, script, "styleCache")
|
|
14
16
|
exports.clearStyleCaches = _styleCache.clearStyleCaches
|
|
@@ -5,8 +5,10 @@ local _NumberConstants = TS.import(script, script.Parent.Parent, "constants", "N
|
|
|
5
5
|
local BORDER_RADIUS = _NumberConstants.BORDER_RADIUS
|
|
6
6
|
local CONTENT_WIDTH = _NumberConstants.CONTENT_WIDTH
|
|
7
7
|
local ICON_SIZES = _NumberConstants.ICON_SIZES
|
|
8
|
+
local MOTION = _NumberConstants.MOTION
|
|
8
9
|
local PADDING_BASE = _NumberConstants.PADDING_BASE
|
|
9
10
|
local PILL_SCALE = _NumberConstants.PILL_SCALE
|
|
11
|
+
local RADIUS = _NumberConstants.RADIUS
|
|
10
12
|
local SPACING_BASE = _NumberConstants.SPACING_BASE
|
|
11
13
|
local DEFAULT_BORDERS = TS.import(script, script.Parent.Parent, "constants", "ColorConstants").DEFAULT_BORDERS
|
|
12
14
|
local allFontFamilies = TS.import(script, script.Parent.Parent, "interfaces", "typography", "FontFamilies").allFontFamilies
|
|
@@ -15,6 +17,7 @@ local createDarkPalette = TS.import(script, script.Parent, "createPalette").crea
|
|
|
15
17
|
local DarkTheme = {
|
|
16
18
|
type = "Dark",
|
|
17
19
|
density = "comfortable",
|
|
20
|
+
motion = MOTION,
|
|
18
21
|
palette = createDarkPalette(),
|
|
19
22
|
spacing = {
|
|
20
23
|
default = SPACING_BASE,
|
|
@@ -31,6 +34,7 @@ local DarkTheme = {
|
|
|
31
34
|
shape = {
|
|
32
35
|
borderRadius = BORDER_RADIUS,
|
|
33
36
|
pillScale = PILL_SCALE,
|
|
37
|
+
radius = RADIUS,
|
|
34
38
|
},
|
|
35
39
|
typography = {
|
|
36
40
|
fontSizes = allFontSizes,
|
|
@@ -5,8 +5,10 @@ local _NumberConstants = TS.import(script, script.Parent.Parent, "constants", "N
|
|
|
5
5
|
local BORDER_RADIUS = _NumberConstants.BORDER_RADIUS
|
|
6
6
|
local CONTENT_WIDTH = _NumberConstants.CONTENT_WIDTH
|
|
7
7
|
local ICON_SIZES = _NumberConstants.ICON_SIZES
|
|
8
|
+
local MOTION = _NumberConstants.MOTION
|
|
8
9
|
local PADDING_BASE = _NumberConstants.PADDING_BASE
|
|
9
10
|
local PILL_SCALE = _NumberConstants.PILL_SCALE
|
|
11
|
+
local RADIUS = _NumberConstants.RADIUS
|
|
10
12
|
local SPACING_BASE = _NumberConstants.SPACING_BASE
|
|
11
13
|
local DEFAULT_BORDERS = TS.import(script, script.Parent.Parent, "constants", "ColorConstants").DEFAULT_BORDERS
|
|
12
14
|
local allFontFamilies = TS.import(script, script.Parent.Parent, "interfaces", "typography", "FontFamilies").allFontFamilies
|
|
@@ -15,6 +17,7 @@ local createLightPalette = TS.import(script, script.Parent, "createPalette").cre
|
|
|
15
17
|
local LightTheme = {
|
|
16
18
|
type = "Light",
|
|
17
19
|
density = "comfortable",
|
|
20
|
+
motion = MOTION,
|
|
18
21
|
palette = createLightPalette(),
|
|
19
22
|
spacing = {
|
|
20
23
|
default = SPACING_BASE,
|
|
@@ -31,6 +34,7 @@ local LightTheme = {
|
|
|
31
34
|
shape = {
|
|
32
35
|
borderRadius = BORDER_RADIUS,
|
|
33
36
|
pillScale = PILL_SCALE,
|
|
37
|
+
radius = RADIUS,
|
|
34
38
|
},
|
|
35
39
|
typography = {
|
|
36
40
|
fontSizes = allFontSizes,
|
|
@@ -5,6 +5,7 @@ local Blue = _colors.Blue
|
|
|
5
5
|
local Common = _colors.Common
|
|
6
6
|
local Gray = _colors.Gray
|
|
7
7
|
local Green = _colors.Green
|
|
8
|
+
local Orange = _colors.Orange
|
|
8
9
|
local Purple = _colors.Purple
|
|
9
10
|
local Red = _colors.Red
|
|
10
11
|
local Yellow = _colors.Yellow
|
|
@@ -64,6 +65,13 @@ local createLightPalette = function()
|
|
|
64
65
|
},
|
|
65
66
|
backdrop = Common.Black,
|
|
66
67
|
shadow = Common.Black,
|
|
68
|
+
code = {
|
|
69
|
+
keyword = Purple[80],
|
|
70
|
+
string = Green[90],
|
|
71
|
+
number = Orange[80],
|
|
72
|
+
comment = Gray[70],
|
|
73
|
+
func = Blue[90],
|
|
74
|
+
},
|
|
67
75
|
}
|
|
68
76
|
end
|
|
69
77
|
local createDarkPalette = function()
|
|
@@ -103,6 +111,13 @@ local createDarkPalette = function()
|
|
|
103
111
|
},
|
|
104
112
|
backdrop = Common.Black,
|
|
105
113
|
shadow = Common.Black,
|
|
114
|
+
code = {
|
|
115
|
+
keyword = Purple[30],
|
|
116
|
+
string = Green[50],
|
|
117
|
+
number = Orange[40],
|
|
118
|
+
comment = Gray[50],
|
|
119
|
+
func = Blue[40],
|
|
120
|
+
},
|
|
106
121
|
}
|
|
107
122
|
end
|
|
108
123
|
return {
|
|
@@ -2,14 +2,20 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local React = _react
|
|
5
|
+
local useEffect = _react.useEffect
|
|
6
|
+
local useRef = _react.useRef
|
|
5
7
|
local useState = _react.useState
|
|
6
|
-
local
|
|
8
|
+
local useReducedMotion = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "hooks").useReducedMotion
|
|
9
|
+
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
10
|
+
local controlMetrics = _theme.controlMetrics
|
|
11
|
+
local cx = _theme.cx
|
|
12
|
+
local useTheme = _theme.useTheme
|
|
13
|
+
local playProperty = TS.import(script, script.Parent.Parent.Parent, "motion", "play").playProperty
|
|
7
14
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
15
|
local Collapse = TS.import(script, script.Parent.Parent.Parent, "collapse").Collapse
|
|
16
|
+
local Icon = TS.import(script, script.Parent.Parent.Parent, "icon").Icon
|
|
9
17
|
local accordionNote = TS.import(script, script.Parent, "accordionNote").accordionNote
|
|
10
|
-
local
|
|
11
|
-
local accordionGlyph = _accordionOpen.accordionGlyph
|
|
12
|
-
local accordionOpen = _accordionOpen.accordionOpen
|
|
18
|
+
local accordionOpen = TS.import(script, script.Parent, "accordionOpen").accordionOpen
|
|
13
19
|
local useAccordionStyles = TS.import(script, script.Parent, "Accordion.styles").default
|
|
14
20
|
local function Accordion(props)
|
|
15
21
|
local _binding = props
|
|
@@ -26,12 +32,27 @@ local function Accordion(props)
|
|
|
26
32
|
local id = _binding.id
|
|
27
33
|
local ref = _binding.ref
|
|
28
34
|
local localOpen, setLocalOpen = useState(defaultOpen == true)
|
|
35
|
+
local hovering, setHovering = useState(false)
|
|
29
36
|
local open = accordionOpen(localOpen, controlled)
|
|
30
37
|
local summary = accordionNote(note)
|
|
31
38
|
local styles = useAccordionStyles({
|
|
32
39
|
open = open,
|
|
33
40
|
disabled = disabled,
|
|
34
41
|
})
|
|
42
|
+
local _binding_1 = useTheme()
|
|
43
|
+
local theme = _binding_1.theme
|
|
44
|
+
local reduced = useReducedMotion()
|
|
45
|
+
local iconRef = useRef()
|
|
46
|
+
local icon = controlMetrics(theme.density).icon
|
|
47
|
+
useEffect(function()
|
|
48
|
+
local icon = iconRef.current
|
|
49
|
+
if not icon then
|
|
50
|
+
return nil
|
|
51
|
+
end
|
|
52
|
+
return playProperty(icon, {
|
|
53
|
+
Rotation = if open then 90 else 0,
|
|
54
|
+
}, theme.motion.default, reduced)
|
|
55
|
+
end, { open, reduced, theme })
|
|
35
56
|
local toggle = function()
|
|
36
57
|
if disabled == true then
|
|
37
58
|
return nil
|
|
@@ -66,78 +87,101 @@ local function Accordion(props)
|
|
|
66
87
|
setmetatable(_attributes_1, nil)
|
|
67
88
|
_condition_1 = React.createElement("uicorner", _attributes_1)
|
|
68
89
|
end
|
|
69
|
-
local _attributes_1 = table.clone(styles.
|
|
90
|
+
local _attributes_1 = table.clone(styles.stroke)
|
|
70
91
|
setmetatable(_attributes_1, nil)
|
|
71
|
-
local _exp = React.createElement("
|
|
72
|
-
local _attributes_2 =
|
|
92
|
+
local _exp = React.createElement("uistroke", _attributes_1)
|
|
93
|
+
local _attributes_2 = table.clone(styles.list)
|
|
94
|
+
setmetatable(_attributes_2, nil)
|
|
95
|
+
local _exp_1 = React.createElement("uilistlayout", _attributes_2)
|
|
96
|
+
local _attributes_3 = {
|
|
73
97
|
key = "Header",
|
|
74
98
|
}
|
|
75
|
-
for _k, _v in styles.header do
|
|
76
|
-
|
|
99
|
+
for _k, _v in cx(styles.header, hovering and disabled ~= true and styles.hover) do
|
|
100
|
+
_attributes_3[_k] = _v
|
|
77
101
|
end
|
|
78
|
-
|
|
102
|
+
_attributes_3.Event = {
|
|
79
103
|
Activated = toggle,
|
|
104
|
+
MouseEnter = function()
|
|
105
|
+
return setHovering(true)
|
|
106
|
+
end,
|
|
107
|
+
MouseLeave = function()
|
|
108
|
+
return setHovering(false)
|
|
109
|
+
end,
|
|
80
110
|
}
|
|
81
|
-
local
|
|
82
|
-
setmetatable(
|
|
83
|
-
local
|
|
111
|
+
local _attributes_4 = table.clone(styles.tail)
|
|
112
|
+
setmetatable(_attributes_4, nil)
|
|
113
|
+
local _exp_2 = React.createElement("uipadding", _attributes_4)
|
|
84
114
|
local _result
|
|
85
115
|
if summary == nil then
|
|
86
|
-
local
|
|
116
|
+
local _attributes_5 = {
|
|
87
117
|
key = "Title",
|
|
88
118
|
}
|
|
89
119
|
for _k, _v in styles.title do
|
|
90
|
-
|
|
120
|
+
_attributes_5[_k] = _v
|
|
91
121
|
end
|
|
92
|
-
|
|
93
|
-
_result = (React.createElement("textlabel",
|
|
122
|
+
_attributes_5.Text = title
|
|
123
|
+
_result = (React.createElement("textlabel", _attributes_5))
|
|
94
124
|
else
|
|
95
|
-
local
|
|
125
|
+
local _attributes_5 = {
|
|
96
126
|
key = "Copy",
|
|
97
127
|
}
|
|
98
128
|
for _k, _v in styles.copy do
|
|
99
|
-
|
|
129
|
+
_attributes_5[_k] = _v
|
|
100
130
|
end
|
|
101
|
-
local
|
|
131
|
+
local _exp_3 = React.createElement("uilistlayout", {
|
|
102
132
|
FillDirection = Enum.FillDirection.Vertical,
|
|
103
133
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
104
134
|
Padding = UDim.new(0, 0),
|
|
105
135
|
})
|
|
106
|
-
local
|
|
136
|
+
local _attributes_6 = {
|
|
107
137
|
key = "Title",
|
|
108
138
|
}
|
|
109
139
|
for _k, _v in styles.title do
|
|
110
|
-
|
|
140
|
+
_attributes_6[_k] = _v
|
|
111
141
|
end
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
local
|
|
142
|
+
_attributes_6.Position = UDim2.new(0, 0, 0, 0)
|
|
143
|
+
_attributes_6.Size = UDim2.new(1, 0, 0, 0)
|
|
144
|
+
_attributes_6.Text = title
|
|
145
|
+
_attributes_6.LayoutOrder = 1
|
|
146
|
+
local _exp_4 = React.createElement("textlabel", _attributes_6)
|
|
147
|
+
local _attributes_7 = {
|
|
117
148
|
key = "Note",
|
|
118
149
|
}
|
|
119
150
|
for _k, _v in styles.note do
|
|
120
|
-
|
|
151
|
+
_attributes_7[_k] = _v
|
|
121
152
|
end
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
_result = (React.createElement("frame",
|
|
153
|
+
_attributes_7.Text = summary
|
|
154
|
+
_attributes_7.LayoutOrder = 2
|
|
155
|
+
_result = (React.createElement("frame", _attributes_5, _exp_3, _exp_4, React.createElement("textlabel", _attributes_7)))
|
|
125
156
|
end
|
|
126
|
-
local
|
|
157
|
+
local _exp_3 = React.createElement("textbutton", _attributes_3, _exp_2, _result, React.createElement(SxHost, {
|
|
158
|
+
tag = "frame",
|
|
127
159
|
key = "Icon",
|
|
160
|
+
hostRef = iconRef,
|
|
161
|
+
base = {
|
|
162
|
+
BackgroundTransparency = 1,
|
|
163
|
+
BorderSizePixel = 0,
|
|
164
|
+
Size = UDim2.new(0, icon, 0, icon),
|
|
165
|
+
},
|
|
166
|
+
className = styles.icon,
|
|
167
|
+
}, React.createElement(Icon, {
|
|
168
|
+
glyph = "chevronRight",
|
|
169
|
+
size = icon,
|
|
170
|
+
tint = if disabled == true then theme.palette.text.disabled else theme.palette.text.primary,
|
|
171
|
+
})))
|
|
172
|
+
local _attributes_5 = {
|
|
173
|
+
key = "Inset",
|
|
128
174
|
}
|
|
129
|
-
for _k, _v in styles.
|
|
130
|
-
|
|
175
|
+
for _k, _v in styles.band do
|
|
176
|
+
_attributes_5[_k] = _v
|
|
131
177
|
end
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
setmetatable(_attributes_5, nil)
|
|
136
|
-
return React.createElement(SxHost, _attributes, _condition_1, _exp, _exp_2, React.createElement(Collapse, {
|
|
178
|
+
local _attributes_6 = table.clone(styles.tail)
|
|
179
|
+
setmetatable(_attributes_6, nil)
|
|
180
|
+
return React.createElement(SxHost, _attributes, _condition_1, _exp, _exp_1, _exp_3, React.createElement(Collapse, {
|
|
137
181
|
key = "Body",
|
|
138
182
|
open = open,
|
|
139
183
|
className = styles.body,
|
|
140
|
-
}, React.createElement("uipadding",
|
|
184
|
+
}, React.createElement("frame", _attributes_5, React.createElement("uipadding", _attributes_6), children)))
|
|
141
185
|
end
|
|
142
186
|
local default = Accordion
|
|
143
187
|
return {
|