@rbxts/react-clean-ui 1.0.5

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.
Files changed (134) hide show
  1. package/README.md +3 -0
  2. package/out/Components/Decorator/BoxShadow.d.ts +10 -0
  3. package/out/Components/Decorator/BoxShadow.luau +41 -0
  4. package/out/Components/Decorator/Corners.d.ts +7 -0
  5. package/out/Components/Decorator/Corners.luau +15 -0
  6. package/out/Components/Decorator/Padding.d.ts +3 -0
  7. package/out/Components/Decorator/Padding.luau +18 -0
  8. package/out/Components/Decorator/index.d.ts +3 -0
  9. package/out/Components/Decorator/init.luau +13 -0
  10. package/out/Components/Input/Button.d.ts +24 -0
  11. package/out/Components/Input/Button.luau +159 -0
  12. package/out/Components/Input/Checkbox.d.ts +12 -0
  13. package/out/Components/Input/Checkbox.luau +79 -0
  14. package/out/Components/Input/HoverButton.d.ts +16 -0
  15. package/out/Components/Input/HoverButton.luau +127 -0
  16. package/out/Components/Input/Input.d.ts +12 -0
  17. package/out/Components/Input/Input.luau +92 -0
  18. package/out/Components/Input/Select.d.ts +30 -0
  19. package/out/Components/Input/Select.luau +288 -0
  20. package/out/Components/Input/Slider.d.ts +51 -0
  21. package/out/Components/Input/Slider.luau +415 -0
  22. package/out/Components/Input/index.d.ts +6 -0
  23. package/out/Components/Input/init.luau +22 -0
  24. package/out/Components/Layout/Column.d.ts +13 -0
  25. package/out/Components/Layout/Column.luau +60 -0
  26. package/out/Components/Layout/Container.d.ts +6 -0
  27. package/out/Components/Layout/Container.luau +73 -0
  28. package/out/Components/Layout/Draggable.d.ts +46 -0
  29. package/out/Components/Layout/Draggable.luau +315 -0
  30. package/out/Components/Layout/Droppable.d.ts +10 -0
  31. package/out/Components/Layout/Droppable.luau +34 -0
  32. package/out/Components/Layout/Fieldset.d.ts +34 -0
  33. package/out/Components/Layout/Fieldset.luau +130 -0
  34. package/out/Components/Layout/FlexItem.d.ts +11 -0
  35. package/out/Components/Layout/FlexItem.luau +20 -0
  36. package/out/Components/Layout/Group.d.ts +34 -0
  37. package/out/Components/Layout/Group.luau +168 -0
  38. package/out/Components/Layout/HStack.d.ts +12 -0
  39. package/out/Components/Layout/HStack.luau +21 -0
  40. package/out/Components/Layout/Row.d.ts +15 -0
  41. package/out/Components/Layout/Row.luau +87 -0
  42. package/out/Components/Layout/Scroller.d.ts +7 -0
  43. package/out/Components/Layout/Scroller.luau +54 -0
  44. package/out/Components/Layout/Tabs.d.ts +31 -0
  45. package/out/Components/Layout/Tabs.luau +189 -0
  46. package/out/Components/Layout/VStack.d.ts +11 -0
  47. package/out/Components/Layout/VStack.luau +21 -0
  48. package/out/Components/Layout/index.d.ts +12 -0
  49. package/out/Components/Layout/init.luau +40 -0
  50. package/out/Components/Navigation/Menu.d.ts +19 -0
  51. package/out/Components/Navigation/Menu.luau +91 -0
  52. package/out/Components/Navigation/index.d.ts +1 -0
  53. package/out/Components/Navigation/init.luau +7 -0
  54. package/out/Components/Surface/Box.d.ts +7 -0
  55. package/out/Components/Surface/Box.luau +50 -0
  56. package/out/Components/Surface/Card.d.ts +25 -0
  57. package/out/Components/Surface/Card.luau +138 -0
  58. package/out/Components/Surface/Icon.d.ts +10 -0
  59. package/out/Components/Surface/Icon.luau +64 -0
  60. package/out/Components/Surface/Panel.d.ts +4 -0
  61. package/out/Components/Surface/Panel.luau +33 -0
  62. package/out/Components/Surface/index.d.ts +4 -0
  63. package/out/Components/Surface/init.luau +16 -0
  64. package/out/Components/Typography/Text.d.ts +18 -0
  65. package/out/Components/Typography/Text.luau +48 -0
  66. package/out/Components/Typography/index.d.ts +1 -0
  67. package/out/Components/Typography/init.luau +7 -0
  68. package/out/Components/index.d.ts +8 -0
  69. package/out/Components/init.luau +28 -0
  70. package/out/Contexts/draggable.context.d.ts +8 -0
  71. package/out/Contexts/draggable.context.luau +7 -0
  72. package/out/Contexts/droppable.context.d.ts +6 -0
  73. package/out/Contexts/droppable.context.luau +7 -0
  74. package/out/Contexts/index.d.ts +6 -0
  75. package/out/Contexts/init.luau +22 -0
  76. package/out/Contexts/navigation.context.d.ts +5 -0
  77. package/out/Contexts/navigation.context.luau +9 -0
  78. package/out/Contexts/overlay.context.d.ts +13 -0
  79. package/out/Contexts/overlay.context.luau +17 -0
  80. package/out/Contexts/row.context.d.ts +9 -0
  81. package/out/Contexts/row.context.luau +12 -0
  82. package/out/Contexts/theme.context.d.ts +3 -0
  83. package/out/Contexts/theme.context.luau +8 -0
  84. package/out/Helpers/breakpoint.helper.d.ts +7 -0
  85. package/out/Helpers/breakpoint.helper.luau +124 -0
  86. package/out/Helpers/color.helper.d.ts +5 -0
  87. package/out/Helpers/color.helper.luau +101 -0
  88. package/out/Helpers/create-ui-story.d.ts +16 -0
  89. package/out/Helpers/create-ui-story.luau +38 -0
  90. package/out/Helpers/css.helper.d.ts +12 -0
  91. package/out/Helpers/css.helper.luau +114 -0
  92. package/out/Helpers/gui.helper.d.ts +10 -0
  93. package/out/Helpers/gui.helper.luau +134 -0
  94. package/out/Helpers/index.d.ts +8 -0
  95. package/out/Helpers/init.luau +28 -0
  96. package/out/Helpers/size.helper.d.ts +14 -0
  97. package/out/Helpers/size.helper.luau +162 -0
  98. package/out/Helpers/spacing.helper.d.ts +7 -0
  99. package/out/Helpers/spacing.helper.luau +57 -0
  100. package/out/Helpers/typography.helper.d.ts +7 -0
  101. package/out/Helpers/typography.helper.luau +91 -0
  102. package/out/Interfaces/clean.element.props.d.ts +109 -0
  103. package/out/Interfaces/clean.element.props.luau +5 -0
  104. package/out/Interfaces/icon.d.ts +2 -0
  105. package/out/Interfaces/icon.luau +2 -0
  106. package/out/Interfaces/index.d.ts +3 -0
  107. package/out/Interfaces/init.luau +13 -0
  108. package/out/Interfaces/userinput.d.ts +22 -0
  109. package/out/Interfaces/userinput.luau +8 -0
  110. package/out/Providers/index.d.ts +3 -0
  111. package/out/Providers/init.luau +13 -0
  112. package/out/Providers/overlay.provider.d.ts +3 -0
  113. package/out/Providers/overlay.provider.luau +25 -0
  114. package/out/Providers/registry.provider.d.ts +33 -0
  115. package/out/Providers/registry.provider.luau +119 -0
  116. package/out/Providers/theme.provider.d.ts +8 -0
  117. package/out/Providers/theme.provider.luau +12 -0
  118. package/out/Theme/CleanTheme.d.ts +169 -0
  119. package/out/Theme/CleanTheme.luau +2 -0
  120. package/out/Theme/DefaultIcons.d.ts +2 -0
  121. package/out/Theme/DefaultIcons.luau +791 -0
  122. package/out/Theme/index.d.ts +3 -0
  123. package/out/Theme/init.luau +13 -0
  124. package/out/Theme/themes/dark.theme.d.ts +2 -0
  125. package/out/Theme/themes/dark.theme.luau +345 -0
  126. package/out/Theme/themes/default.theme.d.ts +2 -0
  127. package/out/Theme/themes/default.theme.luau +403 -0
  128. package/out/Theme/themes/index.d.ts +3 -0
  129. package/out/Theme/themes/init.luau +13 -0
  130. package/out/Theme/themes/sandstone.theme.d.ts +2 -0
  131. package/out/Theme/themes/sandstone.theme.luau +345 -0
  132. package/out/index.d.ts +6 -0
  133. package/out/init.luau +22 -0
  134. package/package.json +43 -0
@@ -0,0 +1,119 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ -- This registry is used to keep a global map of GuiObjects => React components
5
+ -- For example Droppable zones use this to register themselves
6
+ local DroppableRegistryKey = {
7
+ name = "Droppable",
8
+ }
9
+ local DraggableRegistryKey = {
10
+ name = "Draggable",
11
+ }
12
+ local RegistryContext = React.createContext(nil)
13
+ local function RegistryProvider(props)
14
+ local entries = React.useRef({})
15
+ local register = function(guiObject, key, value)
16
+ local _current = entries.current
17
+ local _name = key.name
18
+ local keyEntries = _current[_name]
19
+ if keyEntries == nil then
20
+ keyEntries = {}
21
+ local _current_1 = entries.current
22
+ local _name_1 = key.name
23
+ local _keyEntries = keyEntries
24
+ _current_1[_name_1] = _keyEntries
25
+ end
26
+ local _keyEntries = keyEntries
27
+ local _guiObject = guiObject
28
+ local _value = value
29
+ _keyEntries[_guiObject] = _value
30
+ end
31
+ local unregister = function(guiObject, key)
32
+ local _current = entries.current
33
+ local _name = key.name
34
+ local keyEntries = _current[_name]
35
+ if keyEntries == nil then
36
+ return nil
37
+ end
38
+ local _guiObject = guiObject
39
+ keyEntries[_guiObject] = nil
40
+ -- ▼ ReadonlyMap.size ▼
41
+ local _size = 0
42
+ for _ in keyEntries do
43
+ _size += 1
44
+ end
45
+ -- ▲ ReadonlyMap.size ▲
46
+ if _size == 0 then
47
+ local _current_1 = entries.current
48
+ local _name_1 = key.name
49
+ _current_1[_name_1] = nil
50
+ end
51
+ end
52
+ local get = function(guiObject, key)
53
+ local _current = entries.current
54
+ local _name = key.name
55
+ local _result = _current[_name]
56
+ if _result ~= nil then
57
+ local _guiObject = guiObject
58
+ _result = _result[_guiObject]
59
+ end
60
+ return _result
61
+ end
62
+ local getAll = function(key)
63
+ local _current = entries.current
64
+ local _name = key.name
65
+ local keyEntries = _current[_name]
66
+ if keyEntries == nil then
67
+ return {}
68
+ end
69
+ local result = {}
70
+ for _, value in keyEntries do
71
+ table.insert(result, value)
72
+ end
73
+ return result
74
+ end
75
+ local contextValue = {
76
+ register = register,
77
+ unregister = unregister,
78
+ get = get,
79
+ getAll = getAll,
80
+ }
81
+ return React.createElement(RegistryContext.Provider, {
82
+ value = contextValue,
83
+ }, props.children)
84
+ end
85
+ local function useRegistryRegistration(key, createRegistration, dependencies)
86
+ local registry = React.useContext(RegistryContext)
87
+ local guiObject, setGuiObject = React.useState()
88
+ local _exp = function()
89
+ if guiObject == nil then
90
+ return nil
91
+ end
92
+ return createRegistration(guiObject)
93
+ end
94
+ local _array = { guiObject }
95
+ local _length = #_array
96
+ table.move(dependencies, 1, #dependencies, _length + 1, _array)
97
+ local registration = React.useMemo(_exp, _array)
98
+ React.useEffect(function()
99
+ if registry == nil or guiObject == nil or registration == nil then
100
+ return nil
101
+ end
102
+ registry.register(guiObject, key, registration)
103
+ return function()
104
+ registry.unregister(guiObject, key)
105
+ end
106
+ end, { registry, guiObject, key, registration })
107
+ return {
108
+ ref = setGuiObject,
109
+ guiObject = guiObject,
110
+ registration = registration,
111
+ }
112
+ end
113
+ return {
114
+ RegistryProvider = RegistryProvider,
115
+ useRegistryRegistration = useRegistryRegistration,
116
+ DroppableRegistryKey = DroppableRegistryKey,
117
+ DraggableRegistryKey = DraggableRegistryKey,
118
+ RegistryContext = RegistryContext,
119
+ }
@@ -0,0 +1,8 @@
1
+ import React from "@rbxts/react";
2
+ import { CleanTheme } from "../Theme";
3
+ interface ThemeProviderProps {
4
+ theme: CleanTheme;
5
+ children?: React.ReactNode;
6
+ }
7
+ export declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element;
8
+ export {};
@@ -0,0 +1,12 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local TS = _G[script]
3
+ local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
4
+ local CleanThemeContext = TS.import(script, script.Parent.Parent, "Contexts").CleanThemeContext
5
+ local function ThemeProvider(props)
6
+ return React.createElement(CleanThemeContext.Provider, {
7
+ value = props.theme,
8
+ }, props.children)
9
+ end
10
+ return {
11
+ ThemeProvider = ThemeProvider,
12
+ }
@@ -0,0 +1,169 @@
1
+ import { CssShadow, CssSize, Breakpoint, BreakpointValue, ScaleSizeValue, ScaleSize, Intent, IconSet, TextVariant, ButtonFlag } from "../Interfaces/";
2
+ export interface TypographyStyle {
3
+ font: Enum.Font;
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 {
26
+ colors: {
27
+ intents: Record<Intent, IntentColors>;
28
+ };
29
+ breakpoints: BreakpointValue<number>;
30
+ default: {
31
+ scale: ScaleSize;
32
+ spacing: ScaleSize;
33
+ };
34
+ spacing: ScaleSizeValue<number>;
35
+ radius: {
36
+ sm: number;
37
+ md: number;
38
+ lg: number;
39
+ default: Breakpoint;
40
+ };
41
+ typography: {
42
+ display: TypographyStyle;
43
+ title: TypographyStyle;
44
+ heading: TypographyStyle;
45
+ body: TypographyStyle;
46
+ label: TypographyStyle;
47
+ caption: TypographyStyle;
48
+ };
49
+ typeScaleMap: Record<ScaleSize, TextVariant>;
50
+ components: {
51
+ draggable: {
52
+ placeholder: {
53
+ backgroundColor: Color3;
54
+ backgroundTransparency: number;
55
+ borderColor: Color3;
56
+ borderThickness: number;
57
+ cornerRadius: CssSize;
58
+ };
59
+ };
60
+ scroller: {
61
+ barColor: Color3;
62
+ };
63
+ boxShadow: {
64
+ color: Color3;
65
+ transparency: number;
66
+ };
67
+ box: {
68
+ backgroundColor: Color3;
69
+ backgroundTransparency: number;
70
+ borderColor: Color3;
71
+ borderThickness: number;
72
+ cornerRadius: CssSize;
73
+ boxShadow?: CssShadow;
74
+ intents?: Partial<Record<Intent, InlineIntentColors>>;
75
+ };
76
+ button: {
77
+ backgroundTransparency: number;
78
+ cornerRadius: CssSize;
79
+ boxShadow?: CssShadow;
80
+ borderThickness: number;
81
+ typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
82
+ intents?: Partial<Record<Intent, InlineIntentColors>>;
83
+ };
84
+ input: {
85
+ borderColor: Color3;
86
+ borderThickness: number;
87
+ cornerRadius: CssSize;
88
+ typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
89
+ };
90
+ select: {
91
+ borderColor: Color3;
92
+ borderThickness: number;
93
+ cornerRadius: CssSize;
94
+ dropDownBackgroundColor: Color3;
95
+ typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
96
+ intents?: Partial<Record<Intent, InlineIntentColors>>;
97
+ maxDropDownHeight: number;
98
+ };
99
+ checkbox: {
100
+ borderColor: Color3;
101
+ borderThickness: number;
102
+ cornerRadius: CssSize;
103
+ intents?: Partial<Record<Intent, InlineIntentColors>>;
104
+ spacing?: ScaleSizeValue<number>;
105
+ };
106
+ tabs: {
107
+ borderColor: Color3;
108
+ backgroundColor: Color3;
109
+ borderThickness: number;
110
+ cornerRadius: CssSize;
111
+ spacing?: ScaleSizeValue<number>;
112
+ list: {
113
+ borderColor?: Color3;
114
+ backgroundColor?: Color3;
115
+ borderThickness: number;
116
+ cornerRadius: CssSize;
117
+ spacing?: ScaleSizeValue<number>;
118
+ };
119
+ button: {
120
+ borderThickness: number;
121
+ cornerRadius: CssSize;
122
+ spacing?: ScaleSizeValue<number>;
123
+ boxShadow?: CssShadow;
124
+ typography?: Partial<TypographyStyle> | ScaledTypographyStyle;
125
+ intents?: Partial<Record<Intent, InlineIntentColors>>;
126
+ };
127
+ };
128
+ card: {
129
+ borderThickness: number;
130
+ cornerRadius: CssSize;
131
+ header: {
132
+ spacing?: ScaleSizeValue<number>;
133
+ intents?: Partial<Record<Intent, InlineIntentColors>>;
134
+ };
135
+ footer: {
136
+ spacing?: ScaleSizeValue<number>;
137
+ intents?: Partial<Record<Intent, InlineIntentColors>>;
138
+ };
139
+ };
140
+ slider: {
141
+ height: CssSize;
142
+ bar: {
143
+ height: CssSize;
144
+ padding: CssSize;
145
+ borderColor: Color3;
146
+ borderThickness: number;
147
+ cornerRadius: CssSize;
148
+ backgroundColor: Color3;
149
+ backgroundTransparency: number;
150
+ highlight: {
151
+ borderColor: Color3;
152
+ backgroundColor: Color3;
153
+ backgroundTransparency: number;
154
+ };
155
+ };
156
+ handle: {
157
+ boxShadow?: CssShadow;
158
+ borderColor: Color3;
159
+ borderThickness: number;
160
+ cornerRadius: CssSize;
161
+ backgroundColor: Color3;
162
+ backgroundTransparency: number;
163
+ aspectRation?: number;
164
+ };
165
+ };
166
+ };
167
+ icons: Partial<IconSet>;
168
+ iconSize: ScaleSizeValue<number>;
169
+ }
@@ -0,0 +1,2 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ return nil
@@ -0,0 +1,2 @@
1
+ import { IconSet } from "../Interfaces";
2
+ export declare const DefaultIconSet: IconSet;