@rbxts/react-clean-ui 1.0.36 → 1.0.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/out/Components/Input/Button.d.ts +9 -0
- package/out/Components/Input/Button.luau +155 -46
- package/out/Components/Input/Checkbox.luau +21 -5
- 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 +124 -17
- package/out/Components/Input/Input.validation.d.ts +3 -0
- package/out/Components/Input/Input.validation.luau +21 -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 +1 -1
- package/out/Components/Layout/Accordion.luau +7 -6
- 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/FlexItem.d.ts +2 -1
- package/out/Components/Layout/FlexItem.luau +1 -0
- package/out/Components/Layout/Scroller.d.ts +1 -0
- package/out/Components/Layout/Scroller.luau +1 -1
- package/out/Components/Layout/Tabs.d.ts +1 -1
- package/out/Components/Layout/Tabs.luau +37 -7
- package/out/Components/Navigation/Menu.d.ts +1 -1
- package/out/Components/Surface/Box.d.ts +4 -2
- package/out/Components/Surface/Box.luau +12 -3
- package/out/Components/Surface/Card.d.ts +8 -6
- package/out/Components/Surface/Card.luau +416 -24
- 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 +3 -3
- package/out/Helpers/typography.helper.d.ts +2 -2
- package/out/Interfaces/css.types.d.ts +28 -0
- package/out/Interfaces/css.types.luau +17 -0
- package/out/Interfaces/element.props.d.ts +61 -0
- package/out/Interfaces/element.props.luau +1 -0
- package/out/Interfaces/index.d.ts +4 -2
- package/out/Interfaces/init.luau +9 -3
- 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 +23 -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 +443 -0
- package/out/index.d.ts +8 -8
- package/package.json +18 -6
- 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,7 @@
|
|
|
1
1
|
import { PaddingProps, ResolvedPadding, ScaleSize, ScaleSizeValue } from "../Interfaces";
|
|
2
|
-
import {
|
|
2
|
+
import { ThemeTemplate } from "../Theme";
|
|
3
3
|
export declare class SpacingHelper {
|
|
4
|
-
static GetResolvedPadding(theme:
|
|
5
|
-
static GetPadding(theme:
|
|
4
|
+
static GetResolvedPadding(theme: ThemeTemplate, props: PaddingProps, component?: ScaleSizeValue<number>): ResolvedPadding;
|
|
5
|
+
static GetPadding(theme: ThemeTemplate, spacing?: ScaleSize | "None", component?: ScaleSizeValue<number>): number;
|
|
6
6
|
static ResolveNumberPadding(value: number): ResolvedPadding;
|
|
7
7
|
}
|
|
@@ -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,28 @@
|
|
|
1
|
+
export type CssUnit = "px" | "%";
|
|
2
|
+
export type CssSize = "Auto" | number | `${number}` | `${number}${CssUnit}`;
|
|
3
|
+
export type CssCalcSize = CssSize | `${number}% - ${number}px` | `${number}% + ${number}px`;
|
|
4
|
+
export type CssBreakpoint = {
|
|
5
|
+
xs: number;
|
|
6
|
+
sm: number;
|
|
7
|
+
md: number;
|
|
8
|
+
lg: number;
|
|
9
|
+
xl: number;
|
|
10
|
+
};
|
|
11
|
+
export type CssBreakpointSize = {
|
|
12
|
+
xs?: CssSize;
|
|
13
|
+
sm?: CssSize;
|
|
14
|
+
md?: CssSize;
|
|
15
|
+
lg?: CssSize;
|
|
16
|
+
xl?: CssSize;
|
|
17
|
+
};
|
|
18
|
+
export type CssDual = CssSize | `${CssSize} ${CssSize}`;
|
|
19
|
+
export type CssQuad = CssDual | `${CssSize} ${CssSize} ${CssSize}` | `${CssSize} ${CssSize} ${CssSize} ${CssSize}`;
|
|
20
|
+
export type CssShadow = CssQuad;
|
|
21
|
+
export type CssSliceInset = `${CssSize} ${CssSize}` | `${CssSize} ${CssSize} ${CssSize} ${CssSize}`;
|
|
22
|
+
export type CssBoxShadow = {
|
|
23
|
+
shadow: CssShadow;
|
|
24
|
+
color: Color3;
|
|
25
|
+
transparency: number;
|
|
26
|
+
};
|
|
27
|
+
export type CssPadding = CssQuad;
|
|
28
|
+
export type ResponsiveCssSize = CssSize | CssBreakpointSize;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -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
|
package/out/Interfaces/init.luau
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
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, "
|
|
4
|
+
for _k, _v in TS.import(script, script, "css.types") or {} do
|
|
5
5
|
exports[_k] = _v
|
|
6
6
|
end
|
|
7
|
-
for _k, _v in TS.import(script, script, "
|
|
7
|
+
for _k, _v in TS.import(script, script, "responsive.types") or {} do
|
|
8
|
+
exports[_k] = _v
|
|
9
|
+
end
|
|
10
|
+
for _k, _v in TS.import(script, script, "element.props") or {} do
|
|
8
11
|
exports[_k] = _v
|
|
9
12
|
end
|
|
10
|
-
for _k, _v in TS.import(script, script, "
|
|
13
|
+
for _k, _v in TS.import(script, script, "semantics") or {} do
|
|
14
|
+
exports[_k] = _v
|
|
15
|
+
end
|
|
16
|
+
for _k, _v in TS.import(script, script, "icon") or {} do
|
|
11
17
|
exports[_k] = _v
|
|
12
18
|
end
|
|
13
19
|
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, CssPadding, 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,9 @@ export interface CleanTheme {
|
|
|
70
48
|
borderColor: Color3;
|
|
71
49
|
borderThickness: number;
|
|
72
50
|
cornerRadius: CssSize;
|
|
51
|
+
padding?: CssPadding;
|
|
73
52
|
boxShadow?: CssShadow;
|
|
53
|
+
backgroundImage?: CssBackgroundImage;
|
|
74
54
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
75
55
|
};
|
|
76
56
|
button: {
|
|
@@ -81,16 +61,22 @@ export interface CleanTheme {
|
|
|
81
61
|
typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
82
62
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
83
63
|
};
|
|
64
|
+
increment: {
|
|
65
|
+
button?: Partial<ThemeTemplate["components"]["button"]>;
|
|
66
|
+
};
|
|
84
67
|
input: {
|
|
85
68
|
borderColor: Color3;
|
|
86
69
|
borderThickness: number;
|
|
87
70
|
cornerRadius: CssSize;
|
|
88
71
|
typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
72
|
+
backgroundImage?: CssBackgroundImage;
|
|
73
|
+
placeholder?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
89
74
|
};
|
|
90
75
|
select: {
|
|
91
76
|
borderColor: Color3;
|
|
92
77
|
borderThickness: number;
|
|
93
78
|
cornerRadius: CssSize;
|
|
79
|
+
backgroundImage?: CssBackgroundImage;
|
|
94
80
|
dropDownBackgroundColor: Color3;
|
|
95
81
|
typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
|
|
96
82
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
@@ -99,9 +85,11 @@ export interface CleanTheme {
|
|
|
99
85
|
checkbox: {
|
|
100
86
|
borderColor: Color3;
|
|
101
87
|
borderThickness: number;
|
|
88
|
+
borderTransparency?: number;
|
|
102
89
|
cornerRadius: CssSize;
|
|
103
90
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
104
91
|
spacing?: ScaleSizeValue<number>;
|
|
92
|
+
backgroundImage?: CssBackgroundImage;
|
|
105
93
|
};
|
|
106
94
|
tabs: {
|
|
107
95
|
borderColor: Color3;
|
|
@@ -112,9 +100,11 @@ export interface CleanTheme {
|
|
|
112
100
|
list: {
|
|
113
101
|
borderColor?: Color3;
|
|
114
102
|
backgroundColor?: Color3;
|
|
103
|
+
backgroundTransparency?: number;
|
|
115
104
|
borderThickness: number;
|
|
116
105
|
cornerRadius: CssSize;
|
|
117
106
|
spacing?: ScaleSizeValue<number>;
|
|
107
|
+
backgroundImage?: CssBackgroundImage;
|
|
118
108
|
};
|
|
119
109
|
button: {
|
|
120
110
|
borderThickness: number;
|
|
@@ -150,12 +140,19 @@ export interface CleanTheme {
|
|
|
150
140
|
borderThickness: number;
|
|
151
141
|
cornerRadius: CssSize;
|
|
152
142
|
header: {
|
|
143
|
+
borderThickness?: number;
|
|
153
144
|
spacing?: ScaleSizeValue<number>;
|
|
154
145
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
146
|
+
position?: CssPosition;
|
|
155
147
|
};
|
|
156
148
|
footer: {
|
|
149
|
+
borderThickness?: number;
|
|
157
150
|
spacing?: ScaleSizeValue<number>;
|
|
158
151
|
intents?: Partial<Record<Intent, InlineIntentColors>>;
|
|
152
|
+
position?: CssPosition;
|
|
153
|
+
};
|
|
154
|
+
body?: {
|
|
155
|
+
padding?: CssPadding;
|
|
159
156
|
};
|
|
160
157
|
};
|
|
161
158
|
slider: {
|
|
@@ -181,7 +178,7 @@ export interface CleanTheme {
|
|
|
181
178
|
cornerRadius: CssSize;
|
|
182
179
|
backgroundColor: Color3;
|
|
183
180
|
backgroundTransparency: number;
|
|
184
|
-
|
|
181
|
+
aspectRatio?: number;
|
|
185
182
|
};
|
|
186
183
|
};
|
|
187
184
|
toast: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DarkTheme: import("..").
|
|
1
|
+
export declare const DarkTheme: import("..").ThemeTemplate;
|
|
@@ -159,26 +159,51 @@ local DarkTheme = createTheme({
|
|
|
159
159
|
default = {
|
|
160
160
|
textColor = Color3.fromHex("#FFFFFF"),
|
|
161
161
|
},
|
|
162
|
+
disabled = {
|
|
163
|
+
backgroundColor = Color3.fromHex("#1D222B"),
|
|
164
|
+
borderColor = Color3.fromHex("#343B49"),
|
|
165
|
+
textColor = Color3.fromHex("#697386"),
|
|
166
|
+
},
|
|
162
167
|
},
|
|
163
168
|
success = {
|
|
164
169
|
default = {
|
|
165
170
|
textColor = Color3.fromHex("#FFFFFF"),
|
|
166
171
|
},
|
|
172
|
+
disabled = {
|
|
173
|
+
backgroundColor = Color3.fromHex("#1D222B"),
|
|
174
|
+
borderColor = Color3.fromHex("#343B49"),
|
|
175
|
+
textColor = Color3.fromHex("#697386"),
|
|
176
|
+
},
|
|
167
177
|
},
|
|
168
178
|
info = {
|
|
169
179
|
default = {
|
|
170
180
|
textColor = Color3.fromHex("#FFFFFF"),
|
|
171
181
|
},
|
|
182
|
+
disabled = {
|
|
183
|
+
backgroundColor = Color3.fromHex("#1D222B"),
|
|
184
|
+
borderColor = Color3.fromHex("#343B49"),
|
|
185
|
+
textColor = Color3.fromHex("#697386"),
|
|
186
|
+
},
|
|
172
187
|
},
|
|
173
188
|
warning = {
|
|
174
189
|
default = {
|
|
175
190
|
textColor = Color3.fromHex("#FFFFFF"),
|
|
176
191
|
},
|
|
192
|
+
disabled = {
|
|
193
|
+
backgroundColor = Color3.fromHex("#1D222B"),
|
|
194
|
+
borderColor = Color3.fromHex("#343B49"),
|
|
195
|
+
textColor = Color3.fromHex("#697386"),
|
|
196
|
+
},
|
|
177
197
|
},
|
|
178
198
|
danger = {
|
|
179
199
|
default = {
|
|
180
200
|
textColor = Color3.fromHex("#FFFFFF"),
|
|
181
201
|
},
|
|
202
|
+
disabled = {
|
|
203
|
+
backgroundColor = Color3.fromHex("#1D222B"),
|
|
204
|
+
borderColor = Color3.fromHex("#343B49"),
|
|
205
|
+
textColor = Color3.fromHex("#697386"),
|
|
206
|
+
},
|
|
182
207
|
},
|
|
183
208
|
},
|
|
184
209
|
},
|
|
@@ -186,6 +211,9 @@ local DarkTheme = createTheme({
|
|
|
186
211
|
borderColor = Color3.fromHex("#3A4352"),
|
|
187
212
|
borderThickness = 1,
|
|
188
213
|
cornerRadius = 8,
|
|
214
|
+
placeholder = {
|
|
215
|
+
color = Color3.fromHex("#697386"),
|
|
216
|
+
},
|
|
189
217
|
},
|
|
190
218
|
select = {
|
|
191
219
|
dropDownBackgroundColor = Color3.fromHex("#20252E"),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const DefaultTheme:
|
|
1
|
+
import { ThemeTemplate } from "../theme.template";
|
|
2
|
+
export declare const DefaultTheme: ThemeTemplate;
|
|
@@ -157,6 +157,12 @@ local DefaultTheme = {
|
|
|
157
157
|
default = {
|
|
158
158
|
textColor = Color3.fromHex("#1D2433"),
|
|
159
159
|
},
|
|
160
|
+
disabled = {
|
|
161
|
+
backgroundColor = Color3.fromHex("#F5F5F5"),
|
|
162
|
+
backgroundTransparency = 0.35,
|
|
163
|
+
borderColor = Color3.fromHex("#D9DEE8"),
|
|
164
|
+
textColor = Color3.fromHex("#8A8A8A"),
|
|
165
|
+
},
|
|
160
166
|
},
|
|
161
167
|
success = {
|
|
162
168
|
default = {
|
|
@@ -180,10 +186,14 @@ local DefaultTheme = {
|
|
|
180
186
|
},
|
|
181
187
|
},
|
|
182
188
|
},
|
|
189
|
+
increment = {},
|
|
183
190
|
input = {
|
|
184
191
|
borderColor = Color3.fromHex("#D9DEE8"),
|
|
185
192
|
borderThickness = 1,
|
|
186
193
|
cornerRadius = 8,
|
|
194
|
+
placeholder = {
|
|
195
|
+
color = Color3.fromHex("#8A8A8A"),
|
|
196
|
+
},
|
|
187
197
|
},
|
|
188
198
|
select = {
|
|
189
199
|
dropDownBackgroundColor = Color3.fromHex("#FFFFFF"),
|
|
@@ -441,7 +451,7 @@ local DefaultTheme = {
|
|
|
441
451
|
backgroundTransparency = 0,
|
|
442
452
|
borderColor = Color3.fromHex("#D9DEE8"),
|
|
443
453
|
cornerRadius = 8,
|
|
444
|
-
|
|
454
|
+
aspectRatio = 1,
|
|
445
455
|
},
|
|
446
456
|
},
|
|
447
457
|
toast = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SandstoneTheme: import("..").
|
|
1
|
+
export declare const SandstoneTheme: import("..").ThemeTemplate;
|
|
@@ -159,26 +159,51 @@ local SandstoneTheme = createTheme({
|
|
|
159
159
|
default = {
|
|
160
160
|
textColor = Color3.fromHex("#244F4A"),
|
|
161
161
|
},
|
|
162
|
+
disabled = {
|
|
163
|
+
backgroundColor = Color3.fromHex("#E8DFCF"),
|
|
164
|
+
borderColor = Color3.fromHex("#D8CDBA"),
|
|
165
|
+
textColor = Color3.fromHex("#9B8B73"),
|
|
166
|
+
},
|
|
162
167
|
},
|
|
163
168
|
success = {
|
|
164
169
|
default = {
|
|
165
170
|
textColor = Color3.fromHex("#2E6245"),
|
|
166
171
|
},
|
|
172
|
+
disabled = {
|
|
173
|
+
backgroundColor = Color3.fromHex("#E8DFCF"),
|
|
174
|
+
borderColor = Color3.fromHex("#D8CDBA"),
|
|
175
|
+
textColor = Color3.fromHex("#9B8B73"),
|
|
176
|
+
},
|
|
167
177
|
},
|
|
168
178
|
info = {
|
|
169
179
|
default = {
|
|
170
180
|
textColor = Color3.fromHex("#365F78"),
|
|
171
181
|
},
|
|
182
|
+
disabled = {
|
|
183
|
+
backgroundColor = Color3.fromHex("#E8DFCF"),
|
|
184
|
+
borderColor = Color3.fromHex("#D8CDBA"),
|
|
185
|
+
textColor = Color3.fromHex("#9B8B73"),
|
|
186
|
+
},
|
|
172
187
|
},
|
|
173
188
|
warning = {
|
|
174
189
|
default = {
|
|
175
190
|
textColor = Color3.fromHex("#7A5721"),
|
|
176
191
|
},
|
|
192
|
+
disabled = {
|
|
193
|
+
backgroundColor = Color3.fromHex("#E8DFCF"),
|
|
194
|
+
borderColor = Color3.fromHex("#D8CDBA"),
|
|
195
|
+
textColor = Color3.fromHex("#9B8B73"),
|
|
196
|
+
},
|
|
177
197
|
},
|
|
178
198
|
danger = {
|
|
179
199
|
default = {
|
|
180
200
|
textColor = Color3.fromHex("#8A3D3A"),
|
|
181
201
|
},
|
|
202
|
+
disabled = {
|
|
203
|
+
backgroundColor = Color3.fromHex("#E8DFCF"),
|
|
204
|
+
borderColor = Color3.fromHex("#D8CDBA"),
|
|
205
|
+
textColor = Color3.fromHex("#9B8B73"),
|
|
206
|
+
},
|
|
182
207
|
},
|
|
183
208
|
},
|
|
184
209
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WoodenTheme: import("..").ThemeTemplate;
|