@rbxts/react-clean-ui 1.0.36 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/Components/Decorator/Corners.luau +5 -1
- package/out/Components/Decorator/Padding.luau +1 -1
- package/out/Components/Input/Button.d.ts +9 -0
- package/out/Components/Input/Button.luau +155 -46
- package/out/Components/Input/Checkbox.luau +22 -6
- package/out/Components/Input/Increment.d.ts +11 -0
- package/out/Components/Input/Increment.luau +107 -0
- package/out/Components/Input/Increment.step.d.ts +1 -0
- package/out/Components/Input/Increment.step.luau +25 -0
- package/out/Components/Input/Input.d.ts +4 -3
- package/out/Components/Input/Input.luau +115 -18
- package/out/Components/Input/Input.validation.d.ts +4 -0
- package/out/Components/Input/Input.validation.luau +42 -0
- package/out/Components/Input/Select.d.ts +4 -3
- package/out/Components/Input/Select.luau +23 -18
- package/out/Components/Input/Slider.d.ts +1 -1
- package/out/Components/Input/Slider.luau +68 -34
- package/out/Components/Input/index.d.ts +1 -0
- package/out/Components/Input/init.luau +3 -0
- package/out/Components/Layout/Accordion.d.ts +4 -4
- package/out/Components/Layout/Accordion.luau +75 -23
- package/out/Components/Layout/Container.d.ts +4 -2
- package/out/Components/Layout/Container.luau +12 -3
- package/out/Components/Layout/Draggable.luau +1 -1
- package/out/Components/Layout/Fieldset.d.ts +1 -1
- package/out/Components/Layout/Fieldset.luau +40 -6
- package/out/Components/Layout/FlexItem.d.ts +2 -1
- package/out/Components/Layout/FlexItem.luau +1 -0
- package/out/Components/Layout/Group.luau +30 -8
- package/out/Components/Layout/HStack.luau +1 -0
- package/out/Components/Layout/Row.luau +43 -9
- package/out/Components/Layout/Scroller.d.ts +1 -0
- package/out/Components/Layout/Scroller.luau +20 -5
- package/out/Components/Layout/Tabs.d.ts +5 -3
- package/out/Components/Layout/Tabs.luau +48 -16
- package/out/Components/Navigation/Menu.d.ts +1 -1
- package/out/Components/Navigation/Menu.luau +2 -0
- package/out/Components/Surface/Box.d.ts +4 -2
- package/out/Components/Surface/Box.luau +25 -22
- package/out/Components/Surface/Card.d.ts +12 -6
- package/out/Components/Surface/Card.luau +456 -26
- package/out/Components/Surface/Icon.luau +42 -4
- package/out/Components/Typography/Text.d.ts +1 -0
- package/out/Components/Typography/Text.luau +119 -10
- package/out/Contexts/row.context.d.ts +1 -1
- package/out/Contexts/theme.context.d.ts +2 -2
- package/out/Helpers/color.helper.d.ts +5 -3
- package/out/Helpers/color.helper.luau +62 -34
- package/out/Helpers/create-ui-story.d.ts +2 -2
- package/out/Helpers/create-ui-story.luau +33 -1
- package/out/Helpers/css.helper.d.ts +28 -2
- package/out/Helpers/css.helper.luau +208 -0
- package/out/Helpers/index.d.ts +1 -0
- package/out/Helpers/init.luau +3 -0
- package/out/Helpers/size.helper.d.ts +3 -1
- package/out/Helpers/size.helper.luau +10 -9
- package/out/Helpers/spacing.helper.d.ts +5 -4
- package/out/Helpers/spacing.helper.luau +102 -18
- package/out/Helpers/typography.helper.d.ts +2 -2
- package/out/Interfaces/css.types.d.ts +30 -0
- package/out/Interfaces/css.types.luau +21 -0
- package/out/Interfaces/element.props.d.ts +61 -0
- package/out/Interfaces/element.props.luau +1 -0
- package/out/Interfaces/index.d.ts +5 -3
- package/out/Interfaces/init.luau +1 -7
- package/out/Interfaces/responsive.types.d.ts +26 -0
- package/out/Interfaces/semantics.d.ts +3 -0
- package/out/Interfaces/semantics.luau +2 -0
- package/out/Providers/app.provider.d.ts +2 -2
- package/out/Providers/theme.provider.d.ts +2 -2
- package/out/Theme/index.d.ts +1 -0
- package/out/Theme/theme.factory.d.ts +3 -3
- package/out/Theme/theme.style.d.ts +48 -0
- package/out/Theme/theme.style.luau +1 -0
- package/out/Theme/theme.template.d.ts +34 -26
- package/out/Theme/themes/dark.theme.d.ts +1 -1
- package/out/Theme/themes/dark.theme.luau +28 -0
- package/out/Theme/themes/default.theme.d.ts +2 -2
- package/out/Theme/themes/default.theme.luau +11 -1
- package/out/Theme/themes/index.d.ts +1 -0
- package/out/Theme/themes/init.luau +3 -0
- package/out/Theme/themes/sandstone.theme.d.ts +1 -1
- package/out/Theme/themes/sandstone.theme.luau +25 -0
- package/out/Theme/themes/wooden.theme.d.ts +1 -0
- package/out/Theme/themes/wooden.theme.luau +554 -0
- package/out/index.d.ts +8 -8
- package/package.json +19 -7
- package/out/Interfaces/clean.element.props.d.ts +0 -114
- /package/out/{Interfaces/userinput.d.ts → Helpers/input.helper.d.ts} +0 -0
- /package/out/{Interfaces/userinput.luau → Helpers/input.helper.luau} +0 -0
- /package/out/Interfaces/{clean.element.props.luau → responsive.types.luau} +0 -0
|
@@ -31,7 +31,8 @@ do
|
|
|
31
31
|
width = props.width
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
|
-
|
|
34
|
+
local height = if props.height == "Auto" then 0 else props.height
|
|
35
|
+
return UDim2.new(self:toUDim(width), self:toUDim(height))
|
|
35
36
|
end
|
|
36
37
|
function SizeHelper:GetPosition(props)
|
|
37
38
|
if props.Position ~= nil then
|
|
@@ -62,25 +63,25 @@ do
|
|
|
62
63
|
if props.AutomaticSize ~= nil then
|
|
63
64
|
return props.AutomaticSize
|
|
64
65
|
end
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
-- "Auto" behaves like an unset dimension for the purposes of deciding
|
|
67
|
+
-- which axes get AutomaticSize, but still forces that axis to 0 in GetSize.
|
|
68
|
+
local width = if props.width == "Auto" then nil else props.width
|
|
69
|
+
local height = if props.height == "Auto" then nil else props.height
|
|
68
70
|
local _condition = props.Size ~= nil
|
|
69
71
|
if not _condition then
|
|
70
|
-
local _condition_1 =
|
|
72
|
+
local _condition_1 = width
|
|
71
73
|
if _condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1 then
|
|
72
|
-
_condition_1 =
|
|
74
|
+
_condition_1 = height
|
|
73
75
|
end
|
|
74
76
|
_condition = _condition_1
|
|
75
77
|
end
|
|
76
78
|
if _condition ~= 0 and _condition == _condition and _condition ~= "" and _condition then
|
|
77
79
|
return Enum.AutomaticSize.None
|
|
78
80
|
end
|
|
79
|
-
if
|
|
81
|
+
if width == nil and height == nil and defaultValue == nil then
|
|
80
82
|
return Enum.AutomaticSize.XY
|
|
81
83
|
end
|
|
82
|
-
|
|
83
|
-
if not (_value ~= 0 and _value == _value and _value ~= "" and _value) then
|
|
84
|
+
if not (width ~= 0 and width == width and width ~= "" and width) then
|
|
84
85
|
return Enum.AutomaticSize.X
|
|
85
86
|
end
|
|
86
87
|
return if defaultValue ~= nil then defaultValue else Enum.AutomaticSize.Y
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { PaddingProps, ResolvedPadding, ScaleSize, ScaleSizeValue } from "../Interfaces";
|
|
2
|
-
import {
|
|
1
|
+
import { PaddingProps, ResolvedPadding, ScaleSize, ScaleSizeValue, ScaledCssPadding } from "../Interfaces";
|
|
2
|
+
import { ThemeTemplate } from "../Theme";
|
|
3
3
|
export declare class SpacingHelper {
|
|
4
|
-
static
|
|
5
|
-
static
|
|
4
|
+
static GetPadding(theme: ThemeTemplate, spacing?: ScaleSize | "None", component?: ScaleSizeValue<number>): number;
|
|
5
|
+
static GetResolvedPadding(theme: ThemeTemplate, props: PaddingProps, componentSpacing?: ScaleSizeValue<number>, componentPadding?: ScaledCssPadding, defaultSpacing?: ScaleSize): ResolvedPadding;
|
|
6
|
+
static GetExplicitPadding(componentPadding: ScaledCssPadding | undefined, key: ScaleSize): ResolvedPadding | undefined;
|
|
6
7
|
static ResolveNumberPadding(value: number): ResolvedPadding;
|
|
7
8
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local CssHelper = TS.import(script, script.Parent, "css.helper").CssHelper
|
|
2
4
|
local SpacingHelper
|
|
3
5
|
do
|
|
4
6
|
SpacingHelper = setmetatable({}, {
|
|
@@ -13,35 +15,117 @@ do
|
|
|
13
15
|
end
|
|
14
16
|
function SpacingHelper:constructor()
|
|
15
17
|
end
|
|
16
|
-
function SpacingHelper:GetResolvedPadding(theme, props, component)
|
|
17
|
-
local amount = self:GetPadding(theme, props.spacing, component)
|
|
18
|
-
return {
|
|
19
|
-
top = if props.top then self:GetPadding(theme, props.top) else amount,
|
|
20
|
-
bottom = if props.bottom then self:GetPadding(theme, props.bottom) else amount,
|
|
21
|
-
left = if props.left then self:GetPadding(theme, props.left) else amount,
|
|
22
|
-
right = if props.right then self:GetPadding(theme, props.right) else amount,
|
|
23
|
-
}
|
|
24
|
-
end
|
|
25
18
|
function SpacingHelper:GetPadding(theme, spacing, component)
|
|
26
19
|
if spacing == "None" then
|
|
27
20
|
return 0
|
|
28
21
|
end
|
|
29
|
-
local
|
|
30
|
-
local _result
|
|
31
|
-
if
|
|
32
|
-
|
|
22
|
+
local key = spacing or theme.default.spacing
|
|
23
|
+
local _result = component
|
|
24
|
+
if _result ~= nil then
|
|
25
|
+
_result = _result[key]
|
|
26
|
+
end
|
|
27
|
+
local _condition = _result
|
|
28
|
+
if _condition == nil then
|
|
29
|
+
_condition = theme.spacing[key]
|
|
33
30
|
if _condition == nil then
|
|
34
31
|
_condition = 0
|
|
35
32
|
end
|
|
36
|
-
|
|
33
|
+
end
|
|
34
|
+
return _condition
|
|
35
|
+
end
|
|
36
|
+
function SpacingHelper:GetResolvedPadding(theme, props, componentSpacing, componentPadding, defaultSpacing)
|
|
37
|
+
if props.resolvedPadding ~= nil then
|
|
38
|
+
return props.resolvedPadding
|
|
39
|
+
end
|
|
40
|
+
local isNone = props.spacing == "None"
|
|
41
|
+
local key = if props.spacing ~= nil and props.spacing ~= "None" then props.spacing else (defaultSpacing or theme.default.spacing)
|
|
42
|
+
-- tier 3: a scale-indexed map picks the quad for the active key
|
|
43
|
+
-- (falling through to tiers 1/2 if that key isn't defined in the
|
|
44
|
+
-- map); a plain quad applies regardless of key.
|
|
45
|
+
local _result
|
|
46
|
+
if isNone or componentPadding == nil then
|
|
47
|
+
_result = nil
|
|
48
|
+
else
|
|
49
|
+
local _componentPadding = componentPadding
|
|
50
|
+
_result = if type(_componentPadding) == "table" then componentPadding[key] else componentPadding
|
|
51
|
+
end
|
|
52
|
+
local quadForKey = _result
|
|
53
|
+
local base = if quadForKey ~= nil then CssHelper:parseCssQuad(quadForKey) else self:ResolveNumberPadding(if isNone then 0 else self:GetPadding(theme, key, componentSpacing))
|
|
54
|
+
local instanceQuad = if props.padding ~= nil then CssHelper:parseCssQuad(props.padding) else nil
|
|
55
|
+
local _object = {}
|
|
56
|
+
local _left = "top"
|
|
57
|
+
local _result_1
|
|
58
|
+
if props.top ~= nil then
|
|
59
|
+
_result_1 = self:GetPadding(theme, props.top, componentSpacing)
|
|
37
60
|
else
|
|
38
|
-
local
|
|
61
|
+
local _result_2 = instanceQuad
|
|
62
|
+
if _result_2 ~= nil then
|
|
63
|
+
_result_2 = _result_2.top
|
|
64
|
+
end
|
|
65
|
+
local _condition = _result_2
|
|
39
66
|
if _condition == nil then
|
|
40
|
-
_condition =
|
|
67
|
+
_condition = base.top
|
|
68
|
+
end
|
|
69
|
+
_result_1 = _condition
|
|
70
|
+
end
|
|
71
|
+
_object[_left] = _result_1
|
|
72
|
+
local _left_1 = "bottom"
|
|
73
|
+
local _result_2
|
|
74
|
+
if props.bottom ~= nil then
|
|
75
|
+
_result_2 = self:GetPadding(theme, props.bottom, componentSpacing)
|
|
76
|
+
else
|
|
77
|
+
local _result_3 = instanceQuad
|
|
78
|
+
if _result_3 ~= nil then
|
|
79
|
+
_result_3 = _result_3.bottom
|
|
80
|
+
end
|
|
81
|
+
local _condition = _result_3
|
|
82
|
+
if _condition == nil then
|
|
83
|
+
_condition = base.bottom
|
|
84
|
+
end
|
|
85
|
+
_result_2 = _condition
|
|
86
|
+
end
|
|
87
|
+
_object[_left_1] = _result_2
|
|
88
|
+
local _left_2 = "left"
|
|
89
|
+
local _result_3
|
|
90
|
+
if props.left ~= nil then
|
|
91
|
+
_result_3 = self:GetPadding(theme, props.left, componentSpacing)
|
|
92
|
+
else
|
|
93
|
+
local _result_4 = instanceQuad
|
|
94
|
+
if _result_4 ~= nil then
|
|
95
|
+
_result_4 = _result_4.left
|
|
96
|
+
end
|
|
97
|
+
local _condition = _result_4
|
|
98
|
+
if _condition == nil then
|
|
99
|
+
_condition = base.left
|
|
41
100
|
end
|
|
42
|
-
|
|
101
|
+
_result_3 = _condition
|
|
102
|
+
end
|
|
103
|
+
_object[_left_2] = _result_3
|
|
104
|
+
local _left_3 = "right"
|
|
105
|
+
local _result_4
|
|
106
|
+
if props.right ~= nil then
|
|
107
|
+
_result_4 = self:GetPadding(theme, props.right, componentSpacing)
|
|
108
|
+
else
|
|
109
|
+
local _result_5 = instanceQuad
|
|
110
|
+
if _result_5 ~= nil then
|
|
111
|
+
_result_5 = _result_5.right
|
|
112
|
+
end
|
|
113
|
+
local _condition = _result_5
|
|
114
|
+
if _condition == nil then
|
|
115
|
+
_condition = base.right
|
|
116
|
+
end
|
|
117
|
+
_result_4 = _condition
|
|
118
|
+
end
|
|
119
|
+
_object[_left_3] = _result_4
|
|
120
|
+
return _object
|
|
121
|
+
end
|
|
122
|
+
function SpacingHelper:GetExplicitPadding(componentPadding, key)
|
|
123
|
+
if componentPadding == nil then
|
|
124
|
+
return nil
|
|
43
125
|
end
|
|
44
|
-
|
|
126
|
+
local _componentPadding = componentPadding
|
|
127
|
+
local quad = if type(_componentPadding) == "table" then componentPadding[key] else componentPadding
|
|
128
|
+
return if quad ~= nil then CssHelper:parseCssQuad(quad) else nil
|
|
45
129
|
end
|
|
46
130
|
function SpacingHelper:ResolveNumberPadding(value)
|
|
47
131
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ScaleSize } from "../Interfaces";
|
|
2
|
-
import { TypographyStyle, ScaledTypographyStyle,
|
|
2
|
+
import { TypographyStyle, ScaledTypographyStyle, ThemeTemplate } from "../Theme";
|
|
3
3
|
export declare class TypographyHelper {
|
|
4
|
-
static getTypography(theme:
|
|
4
|
+
static getTypography(theme: ThemeTemplate, scale?: ScaleSize, component?: Partial<TypographyStyle> | ScaledTypographyStyle): TypographyStyle;
|
|
5
5
|
private static getClosestTypography;
|
|
6
6
|
private static isScaledTypographyStyle;
|
|
7
7
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ScaleSizeValue } from "./responsive.types";
|
|
2
|
+
export type CssUnit = "px" | "%";
|
|
3
|
+
export type CssSize = "Auto" | number | `${number}` | `${number}${CssUnit}`;
|
|
4
|
+
export type CssCalcSize = CssSize | `${number}% - ${number}px` | `${number}% + ${number}px`;
|
|
5
|
+
export type CssBreakpoint = {
|
|
6
|
+
xs: number;
|
|
7
|
+
sm: number;
|
|
8
|
+
md: number;
|
|
9
|
+
lg: number;
|
|
10
|
+
xl: number;
|
|
11
|
+
};
|
|
12
|
+
export type CssBreakpointSize = {
|
|
13
|
+
xs?: CssSize;
|
|
14
|
+
sm?: CssSize;
|
|
15
|
+
md?: CssSize;
|
|
16
|
+
lg?: CssSize;
|
|
17
|
+
xl?: CssSize;
|
|
18
|
+
};
|
|
19
|
+
export type CssDual = CssSize | `${CssSize} ${CssSize}`;
|
|
20
|
+
export type CssQuad = CssDual | `${CssSize} ${CssSize} ${CssSize}` | `${CssSize} ${CssSize} ${CssSize} ${CssSize}`;
|
|
21
|
+
export type CssShadow = CssQuad;
|
|
22
|
+
export type CssSliceInset = `${CssSize} ${CssSize}` | `${CssSize} ${CssSize} ${CssSize} ${CssSize}`;
|
|
23
|
+
export type CssBoxShadow = {
|
|
24
|
+
shadow: CssShadow;
|
|
25
|
+
color: Color3;
|
|
26
|
+
transparency: number;
|
|
27
|
+
};
|
|
28
|
+
export type CssPadding = CssQuad;
|
|
29
|
+
export type ScaledCssPadding = CssPadding | ScaleSizeValue<CssPadding>;
|
|
30
|
+
export type ResponsiveCssSize = CssSize | CssBreakpointSize;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
-- The one CSS calc() shape supported on top of CssSize: a percent term
|
|
3
|
+
-- plus/minus a pixel term (e.g. "100% - 50px"), which maps directly onto
|
|
4
|
+
-- UDim(scale, offset) — no general calc() parser needed for anything beyond
|
|
5
|
+
-- this two-term form. Deliberately kept as its own type rather than folded
|
|
6
|
+
-- directly into CssSize: CssSize is composed multiple times over in CssQuad/
|
|
7
|
+
-- CssDual (a 4-term CssQuad is `${CssSize} ${CssSize} ${CssSize} ${CssSize}`),
|
|
8
|
+
-- so widening CssSize itself multiplies out through every one of those
|
|
9
|
+
-- combinations — doing so was observed to blow past TypeScript's template-
|
|
10
|
+
-- literal complexity limit ("union type that is too complex to represent")
|
|
11
|
+
-- at unrelated call sites that spread a large props object containing
|
|
12
|
+
-- several CssQuad-shaped fields (e.g. Button.tsx's `<BoxShadow {...props} />`).
|
|
13
|
+
-- Use CssCalcSize only where a calc() term is actually needed (currently
|
|
14
|
+
-- just CssPosition.width) rather than everywhere CssSize appears.
|
|
15
|
+
-- absolute pixel corner coordinates for Rect.new(minX, minY, maxX, maxY)-style slicing,
|
|
16
|
+
-- e.g. Roblox's SliceCenter — not a CSS border-image-slice edge-inset shorthand, since
|
|
17
|
+
-- Roblox has no intrinsic-image-size equivalent to derive corners from an inset alone
|
|
18
|
+
-- A CssPadding quad, or a scale-key-indexed map of quads (e.g. a component's
|
|
19
|
+
-- theme.components.X.padding tier, which can pick a different quad shape per
|
|
20
|
+
-- spacing scale key the same way theme.components.X.spacing does for the
|
|
21
|
+
-- numeric tier).
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Binding } from "@rbxts/react";
|
|
2
|
+
import { IconName } from "./icon";
|
|
3
|
+
import { CssSize, CssShadow, CssPadding, ResponsiveCssSize } from "./css.types";
|
|
4
|
+
import { ScaleSize, BreakpointValue } from "./responsive.types";
|
|
5
|
+
import { Intent } from "./semantics";
|
|
6
|
+
export interface ZIndexElementProps {
|
|
7
|
+
ZIndex?: number | Binding<number> | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface BackgroundElementProps {
|
|
10
|
+
BackgroundTransparency?: number | Binding<number> | undefined;
|
|
11
|
+
BackgroundColor3?: Color3 | Binding<Color3> | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface SizeElementProps {
|
|
14
|
+
Size?: UDim2 | Binding<UDim2>;
|
|
15
|
+
width?: ResponsiveCssSize;
|
|
16
|
+
height?: CssSize;
|
|
17
|
+
AutomaticSize?: Enum.AutomaticSize | Binding<Enum.AutomaticSize> | "None" | "X" | "Y" | "XY" | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface ScalableElementProps {
|
|
20
|
+
scale?: ScaleSize;
|
|
21
|
+
}
|
|
22
|
+
export interface PositionElementProps {
|
|
23
|
+
Position?: UDim2 | Binding<UDim2>;
|
|
24
|
+
AnchorPoint?: Vector2 | Binding<Vector2> | undefined;
|
|
25
|
+
center?: boolean;
|
|
26
|
+
top?: CssSize;
|
|
27
|
+
left?: CssSize;
|
|
28
|
+
right?: CssSize;
|
|
29
|
+
bottom?: CssSize;
|
|
30
|
+
}
|
|
31
|
+
export interface IntentElementProps {
|
|
32
|
+
intent?: Intent;
|
|
33
|
+
}
|
|
34
|
+
export interface SpacedElementProps {
|
|
35
|
+
spacing?: ScaleSize | "None";
|
|
36
|
+
}
|
|
37
|
+
export interface BreakPointElementProps {
|
|
38
|
+
breakpoints?: BreakpointValue<number>;
|
|
39
|
+
}
|
|
40
|
+
export interface ShadowElementProps {
|
|
41
|
+
"box-shadow"?: CssShadow;
|
|
42
|
+
"box-shadow-color"?: Color3;
|
|
43
|
+
"box-shadow-transparency"?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface IconElementProps {
|
|
46
|
+
icon?: IconName;
|
|
47
|
+
}
|
|
48
|
+
export interface PaddingProps extends SpacedElementProps {
|
|
49
|
+
right?: ScaleSize | "None";
|
|
50
|
+
left?: ScaleSize | "None";
|
|
51
|
+
top?: ScaleSize | "None";
|
|
52
|
+
bottom?: ScaleSize | "None";
|
|
53
|
+
padding?: CssPadding;
|
|
54
|
+
resolvedPadding?: ResolvedPadding;
|
|
55
|
+
}
|
|
56
|
+
export interface ResolvedPadding {
|
|
57
|
+
top: number;
|
|
58
|
+
bottom: number;
|
|
59
|
+
left: number;
|
|
60
|
+
right: number;
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
export type * from './css.types';
|
|
2
|
+
export * from './responsive.types';
|
|
3
|
+
export type * from './element.props';
|
|
4
|
+
export type * from './semantics';
|
|
5
|
+
export type * from './icon';
|
package/out/Interfaces/init.luau
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local exports = {}
|
|
4
|
-
for _k, _v in TS.import(script, script, "
|
|
5
|
-
exports[_k] = _v
|
|
6
|
-
end
|
|
7
|
-
for _k, _v in TS.import(script, script, "icon") or {} do
|
|
8
|
-
exports[_k] = _v
|
|
9
|
-
end
|
|
10
|
-
for _k, _v in TS.import(script, script, "userinput") or {} do
|
|
4
|
+
for _k, _v in TS.import(script, script, "responsive.types") or {} do
|
|
11
5
|
exports[_k] = _v
|
|
12
6
|
end
|
|
13
7
|
return exports
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl";
|
|
2
|
+
export declare const ScaleSizes: readonly ["xs", "sm", "md", "lg", "xl"];
|
|
3
|
+
export type ScaleSize = typeof ScaleSizes[number];
|
|
4
|
+
export type GridSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
5
|
+
export interface ResponsiveGridSpan {
|
|
6
|
+
xs?: GridSpan;
|
|
7
|
+
sm?: GridSpan;
|
|
8
|
+
md?: GridSpan;
|
|
9
|
+
lg?: GridSpan;
|
|
10
|
+
xl?: GridSpan;
|
|
11
|
+
}
|
|
12
|
+
export type ResponsiveValue<T> = T | Partial<Record<Breakpoint, T>>;
|
|
13
|
+
export interface BreakpointValue<T> {
|
|
14
|
+
xs?: T;
|
|
15
|
+
sm?: T;
|
|
16
|
+
md?: T;
|
|
17
|
+
lg?: T;
|
|
18
|
+
xl?: T;
|
|
19
|
+
}
|
|
20
|
+
export interface ScaleSizeValue<T> {
|
|
21
|
+
xs?: T;
|
|
22
|
+
sm?: T;
|
|
23
|
+
md?: T;
|
|
24
|
+
lg?: T;
|
|
25
|
+
xl?: T;
|
|
26
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeTemplate } from "../Theme";
|
|
3
3
|
interface CleanUiProviderProps {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
theme:
|
|
5
|
+
theme: ThemeTemplate;
|
|
6
6
|
toasts?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare function CleanUiProvider({ children, theme, toasts }: CleanUiProviderProps): React.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeTemplate } from "../Theme";
|
|
3
3
|
interface ThemeProviderProps {
|
|
4
|
-
theme:
|
|
4
|
+
theme: ThemeTemplate;
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
}
|
|
7
7
|
export declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element;
|
package/out/Theme/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ThemeTemplate } from "./theme.template";
|
|
2
2
|
export type DeepPartial<T> = {
|
|
3
3
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
4
4
|
};
|
|
5
|
-
export declare function createTheme(overrides?: DeepPartial<
|
|
6
|
-
export declare function extendTheme(baseTheme:
|
|
5
|
+
export declare function createTheme(overrides?: DeepPartial<ThemeTemplate>): ThemeTemplate;
|
|
6
|
+
export declare function extendTheme(baseTheme: ThemeTemplate, overrides: DeepPartial<ThemeTemplate>): ThemeTemplate;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Binding } from "@rbxts/react";
|
|
2
|
+
import { ScaleSize, CssShadow, ButtonFlag, CssDual, CssSliceInset, CssSize, CssCalcSize } from "../Interfaces/";
|
|
3
|
+
export interface TypographyStyle {
|
|
4
|
+
font: Enum.Font;
|
|
5
|
+
size: Enum.FontSize;
|
|
6
|
+
weight?: Enum.FontWeight;
|
|
7
|
+
lineHeight?: number;
|
|
8
|
+
letterSpacing?: number;
|
|
9
|
+
color?: Color3;
|
|
10
|
+
transparency?: number;
|
|
11
|
+
}
|
|
12
|
+
export type ScaledTypographyStyle = Partial<Record<ScaleSize, Partial<TypographyStyle>>>;
|
|
13
|
+
export interface IntentScheme {
|
|
14
|
+
textColor: Color3;
|
|
15
|
+
backgroundColor: Color3;
|
|
16
|
+
borderColor: Color3;
|
|
17
|
+
backgroundTransparency?: number;
|
|
18
|
+
boxShadow?: CssShadow;
|
|
19
|
+
typography?: Partial<TypographyStyle>;
|
|
20
|
+
backgroundImage?: Partial<CssBackgroundImage>;
|
|
21
|
+
}
|
|
22
|
+
export interface IntentColors extends Partial<Record<ButtonFlag, IntentScheme>> {
|
|
23
|
+
default: IntentScheme;
|
|
24
|
+
hover?: IntentScheme;
|
|
25
|
+
focus?: IntentScheme;
|
|
26
|
+
}
|
|
27
|
+
export type InlineIntentColors = {
|
|
28
|
+
[State in keyof IntentColors]?: Partial<NonNullable<IntentColors[State]>>;
|
|
29
|
+
};
|
|
30
|
+
export interface CssBackgroundImage {
|
|
31
|
+
image: string | number;
|
|
32
|
+
slice?: CssSliceInset;
|
|
33
|
+
size?: Enum.ScaleType | "Stretch" | "Slice" | "Tile" | "Fit" | "Crop" | Binding<Enum.ScaleType>;
|
|
34
|
+
transparency?: number;
|
|
35
|
+
tintColor?: Color3;
|
|
36
|
+
tileSize?: CssDual;
|
|
37
|
+
sliceScale?: number;
|
|
38
|
+
}
|
|
39
|
+
export interface CssPosition {
|
|
40
|
+
position?: "static" | "absolute";
|
|
41
|
+
top?: CssSize;
|
|
42
|
+
left?: CssSize;
|
|
43
|
+
right?: CssSize;
|
|
44
|
+
bottom?: CssSize;
|
|
45
|
+
center?: boolean | "x" | "y";
|
|
46
|
+
zIndex?: number;
|
|
47
|
+
width?: CssCalcSize;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
import { CssShadow, CssSize, Breakpoint, BreakpointValue, ScaleSizeValue, ScaleSize, Intent, IconSet, TextVariant,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
size: Enum.FontSize;
|
|
5
|
-
weight?: Enum.FontWeight;
|
|
6
|
-
lineHeight?: number;
|
|
7
|
-
}
|
|
8
|
-
export type ScaledTypographyStyle = Partial<Record<ScaleSize, Partial<TypographyStyle>>>;
|
|
9
|
-
export interface IntentScheme {
|
|
10
|
-
textColor: Color3;
|
|
11
|
-
backgroundColor: Color3;
|
|
12
|
-
borderColor: Color3;
|
|
13
|
-
backgroundTransparency?: number;
|
|
14
|
-
boxShadow?: CssShadow;
|
|
15
|
-
typography?: Partial<TypographyStyle>;
|
|
16
|
-
}
|
|
17
|
-
export interface IntentColors extends Partial<Record<ButtonFlag, IntentScheme>> {
|
|
18
|
-
default: IntentScheme;
|
|
19
|
-
hover?: IntentScheme;
|
|
20
|
-
focus?: IntentScheme;
|
|
21
|
-
}
|
|
22
|
-
export type InlineIntentColors = {
|
|
23
|
-
[State in keyof IntentColors]?: Partial<NonNullable<IntentColors[State]>>;
|
|
24
|
-
};
|
|
25
|
-
export interface CleanTheme {
|
|
1
|
+
import { CssShadow, CssSize, ScaledCssPadding, Breakpoint, BreakpointValue, ScaleSizeValue, ScaleSize, Intent, IconSet, TextVariant, PositionElementProps, CssBoxShadow } from "../Interfaces/";
|
|
2
|
+
import { TypographyStyle, ScaledTypographyStyle, IntentScheme, IntentColors, InlineIntentColors, CssBackgroundImage, CssPosition } from "./theme.style";
|
|
3
|
+
export interface ThemeTemplate {
|
|
26
4
|
colors: {
|
|
27
5
|
intents: Record<Intent, IntentColors>;
|
|
28
6
|
};
|
|
@@ -70,7 +48,10 @@ export interface CleanTheme {
|
|
|
70
48
|
borderColor: Color3;
|
|
71
49
|
borderThickness: number;
|
|
72
50
|
cornerRadius: CssSize;
|
|
51
|
+
spacing?: ScaleSizeValue<number>;
|
|
52
|
+
padding?: ScaledCssPadding;
|
|
73
53
|
boxShadow?: CssShadow;
|
|
54
|
+
backgroundImage?: CssBackgroundImage;
|
|
74
55
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
75
56
|
};
|
|
76
57
|
button: {
|
|
@@ -81,16 +62,22 @@ export interface CleanTheme {
|
|
|
81
62
|
typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
82
63
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
83
64
|
};
|
|
65
|
+
increment: {
|
|
66
|
+
button?: Partial<ThemeTemplate["components"]["button"]>;
|
|
67
|
+
};
|
|
84
68
|
input: {
|
|
85
69
|
borderColor: Color3;
|
|
86
70
|
borderThickness: number;
|
|
87
71
|
cornerRadius: CssSize;
|
|
88
72
|
typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
73
|
+
backgroundImage?: CssBackgroundImage;
|
|
74
|
+
placeholder?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
89
75
|
};
|
|
90
76
|
select: {
|
|
91
77
|
borderColor: Color3;
|
|
92
78
|
borderThickness: number;
|
|
93
79
|
cornerRadius: CssSize;
|
|
80
|
+
backgroundImage?: CssBackgroundImage;
|
|
94
81
|
dropDownBackgroundColor: Color3;
|
|
95
82
|
typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
96
83
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
@@ -99,27 +86,36 @@ export interface CleanTheme {
|
|
|
99
86
|
checkbox: {
|
|
100
87
|
borderColor: Color3;
|
|
101
88
|
borderThickness: number;
|
|
89
|
+
borderTransparency?: number;
|
|
102
90
|
cornerRadius: CssSize;
|
|
103
91
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
104
92
|
spacing?: ScaleSizeValue<number>;
|
|
93
|
+
padding?: ScaledCssPadding;
|
|
94
|
+
backgroundImage?: CssBackgroundImage;
|
|
105
95
|
};
|
|
106
96
|
tabs: {
|
|
107
97
|
borderColor: Color3;
|
|
108
98
|
backgroundColor: Color3;
|
|
99
|
+
backgroundImage?: CssBackgroundImage;
|
|
109
100
|
borderThickness: number;
|
|
110
101
|
cornerRadius: CssSize;
|
|
111
102
|
spacing?: ScaleSizeValue<number>;
|
|
103
|
+
padding?: ScaledCssPadding;
|
|
112
104
|
list: {
|
|
113
105
|
borderColor?: Color3;
|
|
114
106
|
backgroundColor?: Color3;
|
|
107
|
+
backgroundTransparency?: number;
|
|
115
108
|
borderThickness: number;
|
|
116
109
|
cornerRadius: CssSize;
|
|
117
110
|
spacing?: ScaleSizeValue<number>;
|
|
111
|
+
padding?: ScaledCssPadding;
|
|
112
|
+
backgroundImage?: CssBackgroundImage;
|
|
118
113
|
};
|
|
119
114
|
button: {
|
|
120
115
|
borderThickness: number;
|
|
121
116
|
cornerRadius: CssSize;
|
|
122
117
|
spacing?: ScaleSizeValue<number>;
|
|
118
|
+
padding?: ScaledCssPadding;
|
|
123
119
|
boxShadow?: CssShadow;
|
|
124
120
|
typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
125
121
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
@@ -132,6 +128,7 @@ export interface CleanTheme {
|
|
|
132
128
|
spacing?: ScaleSizeValue<number>;
|
|
133
129
|
header: {
|
|
134
130
|
spacing?: ScaleSizeValue<number>;
|
|
131
|
+
padding?: ScaledCssPadding;
|
|
135
132
|
typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
136
133
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
137
134
|
indicatorSize: number;
|
|
@@ -139,6 +136,7 @@ export interface CleanTheme {
|
|
|
139
136
|
};
|
|
140
137
|
content: {
|
|
141
138
|
spacing?: ScaleSizeValue<number>;
|
|
139
|
+
padding?: ScaledCssPadding;
|
|
142
140
|
backgroundColor: Color3;
|
|
143
141
|
backgroundTransparency: number;
|
|
144
142
|
};
|
|
@@ -150,12 +148,22 @@ export interface CleanTheme {
|
|
|
150
148
|
borderThickness: number;
|
|
151
149
|
cornerRadius: CssSize;
|
|
152
150
|
header: {
|
|
151
|
+
borderThickness?: number;
|
|
153
152
|
spacing?: ScaleSizeValue<number>;
|
|
153
|
+
padding?: ScaledCssPadding;
|
|
154
154
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
155
|
+
position?: CssPosition;
|
|
155
156
|
};
|
|
156
157
|
footer: {
|
|
158
|
+
borderThickness?: number;
|
|
157
159
|
spacing?: ScaleSizeValue<number>;
|
|
160
|
+
padding?: ScaledCssPadding;
|
|
158
161
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
162
|
+
position?: CssPosition;
|
|
163
|
+
};
|
|
164
|
+
body?: {
|
|
165
|
+
spacing?: ScaleSizeValue<number>;
|
|
166
|
+
padding?: ScaledCssPadding;
|
|
159
167
|
};
|
|
160
168
|
};
|
|
161
169
|
slider: {
|
|
@@ -181,7 +189,7 @@ export interface CleanTheme {
|
|
|
181
189
|
cornerRadius: CssSize;
|
|
182
190
|
backgroundColor: Color3;
|
|
183
191
|
backgroundTransparency: number;
|
|
184
|
-
|
|
192
|
+
aspectRatio?: number;
|
|
185
193
|
};
|
|
186
194
|
};
|
|
187
195
|
toast: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DarkTheme: import("..").
|
|
1
|
+
export declare const DarkTheme: import("..").ThemeTemplate;
|