@rbxts/uiblox 0.2.0-alpha.24 → 0.2.0-alpha.25

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.
@@ -1,4 +1,5 @@
1
1
  export { breakpointName, orientationName, resolveResponsive } from "./breakpoints";
2
2
  export { BreakpointName, OrientationName, Responsive } from "./breakpoints";
3
3
  export { useBreakpoints } from "./useBreakpoints";
4
+ export { clearViewportObservers, observeViewport } from "./viewportObserver";
4
5
  export { useReducedMotion } from "./useReducedMotion";
@@ -6,5 +6,8 @@ exports.breakpointName = _breakpoints.breakpointName
6
6
  exports.orientationName = _breakpoints.orientationName
7
7
  exports.resolveResponsive = _breakpoints.resolveResponsive
8
8
  exports.useBreakpoints = TS.import(script, script, "useBreakpoints").useBreakpoints
9
+ local _viewportObserver = TS.import(script, script, "viewportObserver")
10
+ exports.clearViewportObservers = _viewportObserver.clearViewportObservers
11
+ exports.observeViewport = _viewportObserver.observeViewport
9
12
  exports.useReducedMotion = TS.import(script, script, "useReducedMotion").useReducedMotion
10
13
  return exports
@@ -6,6 +6,7 @@ local useState = _react.useState
6
6
  local _breakpoints = TS.import(script, script.Parent, "breakpoints")
7
7
  local breakpointName = _breakpoints.breakpointName
8
8
  local orientationName = _breakpoints.orientationName
9
+ local observeViewport = TS.import(script, script.Parent, "viewportObserver").observeViewport
9
10
  local function useBreakpoints(host)
10
11
  local size, setSize = useState({
11
12
  width = 0,
@@ -15,17 +16,7 @@ local function useBreakpoints(host)
15
16
  if host == nil then
16
17
  return nil
17
18
  end
18
- local read = function()
19
- return setSize({
20
- width = host.AbsoluteSize.X,
21
- height = host.AbsoluteSize.Y,
22
- })
23
- end
24
- read()
25
- local connection = host:GetPropertyChangedSignal("AbsoluteSize"):Connect(read)
26
- return function()
27
- return connection:Disconnect()
28
- end
19
+ return observeViewport(host, setSize)
29
20
  end, { host })
30
21
  return {
31
22
  width = size.width,
@@ -0,0 +1,10 @@
1
+ type Size = {
2
+ width: number;
3
+ height: number;
4
+ };
5
+ type Listener = (size: Size) => void;
6
+ /** One AbsoluteSize connection per host; shared by all subscribers. */
7
+ export declare function observeViewport(host: GuiObject, listener: Listener): () => void;
8
+ /** Test helper — drop all host observers. */
9
+ export declare function clearViewportObservers(): void;
10
+ export {};
@@ -0,0 +1,75 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ local hosts = {}
3
+ --* One AbsoluteSize connection per host; shared by all subscribers.
4
+ local function observeViewport(host, listener)
5
+ local _host = host
6
+ local entry = hosts[_host]
7
+ if entry == nil then
8
+ entry = {
9
+ listeners = {},
10
+ size = {
11
+ width = host.AbsoluteSize.X,
12
+ height = host.AbsoluteSize.Y,
13
+ },
14
+ }
15
+ local _host_1 = host
16
+ local _entry = entry
17
+ hosts[_host_1] = _entry
18
+ local read = function()
19
+ local _host_2 = host
20
+ local current = hosts[_host_2]
21
+ if current == nil then
22
+ return nil
23
+ end
24
+ current.size = {
25
+ width = host.AbsoluteSize.X,
26
+ height = host.AbsoluteSize.Y,
27
+ }
28
+ for _, cb in current.listeners do
29
+ cb(current.size)
30
+ end
31
+ end
32
+ read()
33
+ entry.connection = host:GetPropertyChangedSignal("AbsoluteSize"):Connect(read)
34
+ end
35
+ local _listeners = entry.listeners
36
+ local _listener = listener
37
+ table.insert(_listeners, _listener)
38
+ listener(entry.size)
39
+ return function()
40
+ local _host_1 = host
41
+ local current = hosts[_host_1]
42
+ if current == nil then
43
+ return nil
44
+ end
45
+ local _listeners_1 = current.listeners
46
+ local _listener_1 = listener
47
+ local index = (table.find(_listeners_1, _listener_1) or 0) - 1
48
+ if index >= 0 then
49
+ table.remove(current.listeners, index + 1)
50
+ end
51
+ if #current.listeners == 0 then
52
+ local _result = current.connection
53
+ if _result ~= nil then
54
+ _result:Disconnect()
55
+ end
56
+ local _host_2 = host
57
+ hosts[_host_2] = nil
58
+ end
59
+ end
60
+ end
61
+ --* Test helper — drop all host observers.
62
+ local function clearViewportObservers()
63
+ for _, entry in hosts do
64
+ local _result = entry.connection
65
+ if _result ~= nil then
66
+ _result:Disconnect()
67
+ end
68
+ table.clear(entry.listeners)
69
+ end
70
+ table.clear(hosts)
71
+ end
72
+ return {
73
+ observeViewport = observeViewport,
74
+ clearViewportObservers = clearViewportObservers,
75
+ }
@@ -21,6 +21,21 @@ interface Theme {
21
21
  styleOverrides?: {
22
22
  [slot: string]: object;
23
23
  };
24
+ variants?: {
25
+ [prop: string]: {
26
+ [value: string]: {
27
+ [slot: string]: object;
28
+ };
29
+ };
30
+ };
31
+ compoundVariants?: Array<{
32
+ when: {
33
+ [prop: string]: unknown;
34
+ };
35
+ styles: {
36
+ [slot: string]: object;
37
+ };
38
+ }>;
24
39
  };
25
40
  };
26
41
  }
@@ -4,6 +4,7 @@ local _componentTheme = TS.import(script, script.Parent, "componentTheme")
4
4
  local propsWithDefaults = _componentTheme.propsWithDefaults
5
5
  local slotsWithOverrides = _componentTheme.slotsWithOverrides
6
6
  local makeStyles = TS.import(script, script.Parent, "makeStyles").default
7
+ local applyVariants = TS.import(script, script.Parent, "variants").applyVariants
7
8
  local componentStyles = function(name, factory)
8
9
  return makeStyles((function(theme, props)
9
10
  local _spec = theme.components
@@ -17,12 +18,53 @@ local componentStyles = function(name, factory)
17
18
  end
18
19
  local merged = propsWithDefaults(_result, props)
19
20
  local paint = factory
20
- local _exp = paint(theme, merged)
21
+ local slots = paint(theme, merged)
21
22
  local _result_1 = spec
22
23
  if _result_1 ~= nil then
23
- _result_1 = _result_1.styleOverrides
24
+ _result_1 = _result_1.variants
24
25
  end
25
- return slotsWithOverrides(_exp, _result_1)
26
+ local _condition = _result_1 ~= nil
27
+ if not _condition then
28
+ local _result_2 = spec
29
+ if _result_2 ~= nil then
30
+ _result_2 = _result_2.compoundVariants
31
+ if _result_2 ~= nil then
32
+ _result_2 = #_result_2
33
+ end
34
+ end
35
+ local _condition_1 = _result_2
36
+ if _condition_1 == nil then
37
+ _condition_1 = 0
38
+ end
39
+ _condition = _condition_1 > 0
40
+ end
41
+ if _condition then
42
+ local _exp = slots
43
+ local _exp_1 = merged
44
+ local _result_2 = spec
45
+ if _result_2 ~= nil then
46
+ _result_2 = _result_2.variants
47
+ end
48
+ local _condition_1 = _result_2
49
+ if _condition_1 == nil then
50
+ _condition_1 = {}
51
+ end
52
+ local _result_3 = spec
53
+ if _result_3 ~= nil then
54
+ _result_3 = _result_3.compoundVariants
55
+ end
56
+ local _condition_2 = _result_3
57
+ if _condition_2 == nil then
58
+ _condition_2 = {}
59
+ end
60
+ slots = applyVariants(_exp, _exp_1, _condition_1, _condition_2)
61
+ end
62
+ local _exp = slots
63
+ local _result_2 = spec
64
+ if _result_2 ~= nil then
65
+ _result_2 = _result_2.styleOverrides
66
+ end
67
+ return slotsWithOverrides(_exp, _result_2)
26
68
  end))
27
69
  end
28
70
  local default = componentStyles
@@ -5,6 +5,21 @@ export interface ComponentSpec {
5
5
  styleOverrides?: {
6
6
  [slot: string]: object;
7
7
  };
8
+ variants?: {
9
+ [prop: string]: {
10
+ [value: string]: {
11
+ [slot: string]: object;
12
+ };
13
+ };
14
+ };
15
+ compoundVariants?: Array<{
16
+ when: {
17
+ [prop: string]: unknown;
18
+ };
19
+ styles: {
20
+ [slot: string]: object;
21
+ };
22
+ }>;
8
23
  }
9
24
  export declare function propsWithDefaults(defaults: {
10
25
  [key: string]: unknown;
@@ -4,4 +4,6 @@ export { default as classNames, cx } from "./classNames";
4
4
  export { applyVariants, CompoundVariant } from "./variants";
5
5
  export { default as componentStyles } from "./componentStyles";
6
6
  export { resolveResponsive, Responsive } from "../../../hooks/breakpoints";
7
+ export { clearStyleCaches, createStyleCache, styleDepsKey } from "./styleCache";
8
+ export { resolveSx, resolvePaletteToken, PaletteToken, ResolvedSx, SxColor, SxInput } from "./resolveSx";
7
9
  export { interactionStyle, InteractionSlots, InteractionState, resolveStyle, StyleSelectorKey, StyleState, StyleWithSelectors, } from "./resolveStyle";
@@ -9,6 +9,13 @@ 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
  exports.resolveResponsive = TS.import(script, script.Parent.Parent.Parent, "hooks", "breakpoints").resolveResponsive
12
+ local _styleCache = TS.import(script, script, "styleCache")
13
+ exports.clearStyleCaches = _styleCache.clearStyleCaches
14
+ exports.createStyleCache = _styleCache.createStyleCache
15
+ exports.styleDepsKey = _styleCache.styleDepsKey
16
+ local _resolveSx = TS.import(script, script, "resolveSx")
17
+ exports.resolveSx = _resolveSx.resolveSx
18
+ exports.resolvePaletteToken = _resolveSx.resolvePaletteToken
12
19
  local _resolveStyle = TS.import(script, script, "resolveStyle")
13
20
  exports.interactionStyle = _resolveStyle.interactionStyle
14
21
  exports.resolveStyle = _resolveStyle.resolveStyle
@@ -1,23 +1,31 @@
1
- export type StyleSelectorKey = "_hover" | "_pressed" | "_focus" | "_disabled" | "_selected" | "_checked" | "_first" | "_last";
1
+ export type StyleSelectorKey = "_hover" | "_pressed" | "_focus" | "_focusVisible" | "_disabled" | "_selected" | "_checked" | "_loading" | "_first" | "_last" | "_odd" | "_even";
2
2
  export interface StyleState {
3
3
  hover?: boolean;
4
4
  pressed?: boolean;
5
5
  focused?: boolean;
6
+ focusVisible?: boolean;
6
7
  disabled?: boolean;
7
8
  selected?: boolean;
8
9
  checked?: boolean;
10
+ loading?: boolean;
9
11
  first?: boolean;
10
12
  last?: boolean;
13
+ odd?: boolean;
14
+ even?: boolean;
11
15
  }
12
16
  export type StyleWithSelectors<T extends object = object> = T & {
13
17
  _hover?: Partial<T>;
14
18
  _pressed?: Partial<T>;
15
19
  _focus?: Partial<T>;
20
+ _focusVisible?: Partial<T>;
16
21
  _disabled?: Partial<T>;
17
22
  _selected?: Partial<T>;
18
23
  _checked?: Partial<T>;
24
+ _loading?: Partial<T>;
19
25
  _first?: Partial<T>;
20
26
  _last?: Partial<T>;
27
+ _odd?: Partial<T>;
28
+ _even?: Partial<T>;
21
29
  };
22
30
  export interface InteractionSlots<T extends object = object> {
23
31
  hover?: T;
@@ -26,7 +34,7 @@ export interface InteractionSlots<T extends object = object> {
26
34
  disabled?: T;
27
35
  }
28
36
  export type InteractionState = Pick<StyleState, "hover" | "pressed" | "focused" | "disabled">;
29
- /** Peels `_hover` / `_pressed` / `_focus` / … and merges active ones onto the Instance props. */
37
+ /** Peels selector keys and merges active ones onto the Instance props. */
30
38
  export declare function resolveStyle<T extends object>(style: StyleWithSelectors<T>, state?: StyleState): T;
31
39
  /** Prefer `resolveStyle` with `_hover` keys. Kept for existing call sites. */
32
40
  export declare function interactionStyle<T extends object>(base: T, slots: InteractionSlots<T>, state: InteractionState): T;
@@ -1,17 +1,21 @@
1
1
  -- Compiled with roblox-ts v3.0.0
2
- --* Order matters: later keys win. Structural first, then interaction; `_disabled` last.
3
- local SELECTORS = { { "_first", "first" }, { "_last", "last" }, { "_selected", "selected" }, { "_checked", "checked" }, { "_hover", "hover" }, { "_pressed", "pressed" }, { "_focus", "focused" }, { "_disabled", "disabled" } }
2
+ --* Order matters: later keys win. Structural → selection → interaction; `_disabled` last.
3
+ local SELECTORS = { { "_first", "first" }, { "_last", "last" }, { "_odd", "odd" }, { "_even", "even" }, { "_selected", "selected" }, { "_checked", "checked" }, { "_loading", "loading" }, { "_hover", "hover" }, { "_pressed", "pressed" }, { "_focus", "focused" }, { "_focusVisible", "focusVisible" }, { "_disabled", "disabled" } }
4
4
  local SELECTOR_FLAGS = {
5
5
  _hover = true,
6
6
  _pressed = true,
7
7
  _focus = true,
8
+ _focusVisible = true,
8
9
  _selected = true,
9
10
  _checked = true,
11
+ _loading = true,
10
12
  _first = true,
11
13
  _last = true,
14
+ _odd = true,
15
+ _even = true,
12
16
  _disabled = true,
13
17
  }
14
- --* Peels `_hover` / `_pressed` / `_focus` / … and merges active ones onto the Instance props.
18
+ --* Peels selector keys and merges active ones onto the Instance props.
15
19
  local function resolveStyle(style, state)
16
20
  if state == nil then
17
21
  state = {}
@@ -0,0 +1,110 @@
1
+ /** Dot-path into `theme.palette` (typed for common roles). */
2
+ export type PaletteToken = "surface.canvas" | "surface.paper" | "surface.elevated" | "surface.overlay" | "surface.input" | "primary.main" | "primary.on" | "primary.hover" | "primary.pressed" | "accent.main" | "accent.on" | "accent.hover" | "accent.pressed" | "text.primary" | "text.secondary" | "text.disabled" | "text.inverse" | "text.link" | "border" | "divider" | "focus" | "action.hover" | "action.pressed" | "action.selected" | "action.disabled" | "status.success.main" | "status.success.on" | "status.success.surface" | "status.success.border" | "status.warning.main" | "status.warning.on" | "status.warning.surface" | "status.warning.border" | "status.error.main" | "status.error.on" | "status.error.surface" | "status.error.border" | "status.info.main" | "status.info.on" | "status.info.surface" | "status.info.border" | "backdrop" | "shadow";
3
+ export declare function resolvePaletteToken(palette: object, token: PaletteToken | Color3): Color3;
4
+ /** Matches `hooks/breakpoints` thresholds. Kept local so Node style checks need no path aliases. */
5
+ type Responsive<T> = T | {
6
+ phone?: T;
7
+ tablet?: T;
8
+ desktop?: T;
9
+ };
10
+ type PadInput = number | {
11
+ x?: number;
12
+ y?: number;
13
+ top?: number;
14
+ right?: number;
15
+ bottom?: number;
16
+ left?: number;
17
+ };
18
+ interface SxTheme {
19
+ spacing: {
20
+ calc: (multiple: number) => number;
21
+ };
22
+ palette: object;
23
+ typography: {
24
+ fontFamilies: {
25
+ [family: string]: Enum.Font;
26
+ };
27
+ variants: {
28
+ [name: string]: {
29
+ size: number;
30
+ family: string;
31
+ };
32
+ };
33
+ };
34
+ }
35
+ export type SxColor = PaletteToken | Color3;
36
+ /** CSS-like shorthands + pass-through Instance props. No CSS string parser. */
37
+ export type SxInput = {
38
+ width?: Responsive<number | UDim | UDim2>;
39
+ height?: Responsive<number | UDim | UDim2>;
40
+ w?: Responsive<number | UDim | UDim2>;
41
+ h?: Responsive<number | UDim | UDim2>;
42
+ size?: Responsive<UDim2 | {
43
+ width?: number | UDim;
44
+ height?: number | UDim;
45
+ }>;
46
+ x?: Responsive<number | UDim>;
47
+ y?: Responsive<number | UDim>;
48
+ position?: Responsive<UDim2>;
49
+ pos?: Responsive<UDim2>;
50
+ anchor?: Responsive<Vector2 | number | [number, number]>;
51
+ p?: Responsive<number>;
52
+ px?: Responsive<number>;
53
+ py?: Responsive<number>;
54
+ pt?: Responsive<number>;
55
+ pr?: Responsive<number>;
56
+ pb?: Responsive<number>;
57
+ pl?: Responsive<number>;
58
+ padding?: Responsive<PadInput>;
59
+ gap?: Responsive<number>;
60
+ bgcolor?: Responsive<SxColor>;
61
+ bg?: Responsive<SxColor>;
62
+ backgroundColor?: Responsive<SxColor>;
63
+ color?: Responsive<SxColor>;
64
+ borderColor?: Responsive<SxColor>;
65
+ opacity?: Responsive<number>;
66
+ transparency?: Responsive<number>;
67
+ border?: Responsive<number>;
68
+ borderWidth?: Responsive<number>;
69
+ radius?: Responsive<number>;
70
+ typography?: Responsive<string>;
71
+ fontSize?: Responsive<number>;
72
+ font?: Responsive<Enum.Font | string>;
73
+ visible?: Responsive<boolean>;
74
+ zIndex?: Responsive<number>;
75
+ z?: Responsive<number>;
76
+ _hover?: SxInput;
77
+ _pressed?: SxInput;
78
+ _focus?: SxInput;
79
+ _focusVisible?: SxInput;
80
+ _disabled?: SxInput;
81
+ _selected?: SxInput;
82
+ _checked?: SxInput;
83
+ _loading?: SxInput;
84
+ _first?: SxInput;
85
+ _last?: SxInput;
86
+ _odd?: SxInput;
87
+ _even?: SxInput;
88
+ [key: string]: unknown;
89
+ };
90
+ export interface ResolvedSx {
91
+ root: {
92
+ [key: string]: unknown;
93
+ };
94
+ padding?: {
95
+ PaddingTop: UDim;
96
+ PaddingRight: UDim;
97
+ PaddingBottom: UDim;
98
+ PaddingLeft: UDim;
99
+ };
100
+ corner?: {
101
+ CornerRadius: UDim;
102
+ };
103
+ gap?: number;
104
+ }
105
+ /**
106
+ * Maps sx shorthands / tokens → Instance props (+ UIPadding / UICorner / gap helpers).
107
+ * Pass-through keys (BackgroundColor3, _hover, …) stay on `root` for `resolveStyle`.
108
+ */
109
+ export declare function resolveSx(theme: SxTheme, sx?: SxInput, width?: number): ResolvedSx;
110
+ export {};
@@ -0,0 +1,479 @@
1
+ -- Compiled with roblox-ts v3.0.0
2
+ --* Dot-path into `theme.palette` (typed for common roles).
3
+ local function resolvePaletteToken(palette, token)
4
+ local _token = token
5
+ if not (type(_token) == "string") then
6
+ return token
7
+ end
8
+ local parts = string.split(token, ".")
9
+ local cursor = palette
10
+ for _, part in parts do
11
+ local _condition = cursor == nil
12
+ if not _condition then
13
+ local _cursor = cursor
14
+ _condition = typeof(_cursor) ~= "table"
15
+ end
16
+ if _condition then
17
+ return Color3.new(0, 0, 0)
18
+ end
19
+ cursor = cursor[part]
20
+ end
21
+ local _cursor = cursor
22
+ if typeof(_cursor) == "Color3" then
23
+ return cursor
24
+ end
25
+ return Color3.new(0, 0, 0)
26
+ end
27
+ --* Matches `hooks/breakpoints` thresholds. Kept local so Node style checks need no path aliases.
28
+ local function resolveResponsive(value, width)
29
+ local _condition = value == nil
30
+ if not _condition then
31
+ local _value = value
32
+ _condition = typeof(_value) ~= "table"
33
+ end
34
+ if _condition then
35
+ return value
36
+ end
37
+ local record = value
38
+ local size = if width == width and width < math.huge and width > 0 then width else 0
39
+ local name = if size < 600 then "phone" elseif size < 960 then "tablet" else "desktop"
40
+ if name == "desktop" then
41
+ local _condition_1 = record.desktop
42
+ if _condition_1 == nil then
43
+ _condition_1 = record.tablet
44
+ if _condition_1 == nil then
45
+ _condition_1 = record.phone
46
+ end
47
+ end
48
+ return _condition_1
49
+ end
50
+ if name == "tablet" then
51
+ local _condition_1 = record.tablet
52
+ if _condition_1 == nil then
53
+ _condition_1 = record.phone
54
+ end
55
+ return _condition_1
56
+ end
57
+ return record.phone
58
+ end
59
+ local SELECTORS = {
60
+ _hover = true,
61
+ _pressed = true,
62
+ _focus = true,
63
+ _focusVisible = true,
64
+ _disabled = true,
65
+ _selected = true,
66
+ _checked = true,
67
+ _loading = true,
68
+ _first = true,
69
+ _last = true,
70
+ _odd = true,
71
+ _even = true,
72
+ }
73
+ local SHORTHAND = {
74
+ width = true,
75
+ height = true,
76
+ w = true,
77
+ h = true,
78
+ size = true,
79
+ x = true,
80
+ y = true,
81
+ position = true,
82
+ pos = true,
83
+ anchor = true,
84
+ p = true,
85
+ px = true,
86
+ py = true,
87
+ pt = true,
88
+ pr = true,
89
+ pb = true,
90
+ pl = true,
91
+ padding = true,
92
+ gap = true,
93
+ bgcolor = true,
94
+ bg = true,
95
+ backgroundColor = true,
96
+ color = true,
97
+ borderColor = true,
98
+ opacity = true,
99
+ transparency = true,
100
+ border = true,
101
+ borderWidth = true,
102
+ radius = true,
103
+ typography = true,
104
+ fontSize = true,
105
+ font = true,
106
+ visible = true,
107
+ zIndex = true,
108
+ z = true,
109
+ }
110
+ --* CSS-like shorthands + pass-through Instance props. No CSS string parser.
111
+ local function pick(value, width)
112
+ if value == nil then
113
+ return nil
114
+ end
115
+ if width ~= nil then
116
+ return resolveResponsive(value, width)
117
+ end
118
+ local _value = value
119
+ if typeof(_value) ~= "table" then
120
+ return value
121
+ end
122
+ local record = value
123
+ if record.phone ~= nil or record.tablet ~= nil or record.desktop ~= nil then
124
+ local _condition = record.desktop
125
+ if _condition == nil then
126
+ _condition = record.tablet
127
+ if _condition == nil then
128
+ _condition = record.phone
129
+ end
130
+ end
131
+ return _condition
132
+ end
133
+ return value
134
+ end
135
+ local function asUDim(value)
136
+ local _value = value
137
+ return if type(_value) == "number" then UDim.new(0, value) else value
138
+ end
139
+ local function sizeAxis(value, axis)
140
+ if value == nil then
141
+ return nil
142
+ end
143
+ local _value = value
144
+ if type(_value) == "number" then
145
+ return UDim.new(0, value)
146
+ end
147
+ local _value_1 = value
148
+ if typeof(_value_1) == "UDim" then
149
+ return value
150
+ end
151
+ return if axis == "X" then value.X else value.Y
152
+ end
153
+ local function padSides(padding)
154
+ if padding == nil then
155
+ return {
156
+ top = 0,
157
+ right = 0,
158
+ bottom = 0,
159
+ left = 0,
160
+ }
161
+ end
162
+ local _padding = padding
163
+ if type(_padding) == "number" then
164
+ return {
165
+ top = padding,
166
+ right = padding,
167
+ bottom = padding,
168
+ left = padding,
169
+ }
170
+ end
171
+ local _condition = padding.x
172
+ if _condition == nil then
173
+ _condition = 0
174
+ end
175
+ local x = _condition
176
+ local _condition_1 = padding.y
177
+ if _condition_1 == nil then
178
+ _condition_1 = 0
179
+ end
180
+ local y = _condition_1
181
+ local _object = {}
182
+ local _left = "top"
183
+ local _condition_2 = padding.top
184
+ if _condition_2 == nil then
185
+ _condition_2 = y
186
+ end
187
+ _object[_left] = _condition_2
188
+ local _left_1 = "right"
189
+ local _condition_3 = padding.right
190
+ if _condition_3 == nil then
191
+ _condition_3 = x
192
+ end
193
+ _object[_left_1] = _condition_3
194
+ local _left_2 = "bottom"
195
+ local _condition_4 = padding.bottom
196
+ if _condition_4 == nil then
197
+ _condition_4 = y
198
+ end
199
+ _object[_left_2] = _condition_4
200
+ local _left_3 = "left"
201
+ local _condition_5 = padding.left
202
+ if _condition_5 == nil then
203
+ _condition_5 = x
204
+ end
205
+ _object[_left_3] = _condition_5
206
+ return _object
207
+ end
208
+ local function colorOf(theme, value)
209
+ if value == nil then
210
+ return nil
211
+ end
212
+ return resolvePaletteToken(theme.palette, value)
213
+ end
214
+ --[[
215
+ *
216
+ * Maps sx shorthands / tokens → Instance props (+ UIPadding / UICorner / gap helpers).
217
+ * Pass-through keys (BackgroundColor3, _hover, …) stay on `root` for `resolveStyle`.
218
+
219
+ ]]
220
+ local function resolveSx(theme, sx, width)
221
+ if sx == nil then
222
+ return {
223
+ root = {},
224
+ }
225
+ end
226
+ local root = {}
227
+ local pad
228
+ local radius
229
+ local gap
230
+ local _condition = sx.width
231
+ if _condition == nil then
232
+ _condition = sx.w
233
+ end
234
+ local widthVal = pick(_condition, width)
235
+ local _condition_1 = sx.height
236
+ if _condition_1 == nil then
237
+ _condition_1 = sx.h
238
+ end
239
+ local heightVal = pick(_condition_1, width)
240
+ local sizeVal = pick(sx.size, width)
241
+ local sizeX = sizeAxis(widthVal, "X")
242
+ local sizeY = sizeAxis(heightVal, "Y")
243
+ if sizeVal ~= nil then
244
+ if typeof(sizeVal) == "UDim2" then
245
+ sizeX = sizeX or sizeVal.X
246
+ sizeY = sizeY or sizeVal.Y
247
+ else
248
+ local record = sizeVal
249
+ sizeX = sizeX or sizeAxis(record.width, "X")
250
+ sizeY = sizeY or sizeAxis(record.height, "Y")
251
+ end
252
+ end
253
+ if sizeX ~= nil or sizeY ~= nil then
254
+ local _result = sizeX
255
+ if _result ~= nil then
256
+ _result = _result.Scale
257
+ end
258
+ local _condition_2 = _result
259
+ if _condition_2 == nil then
260
+ _condition_2 = 0
261
+ end
262
+ local _result_1 = sizeX
263
+ if _result_1 ~= nil then
264
+ _result_1 = _result_1.Offset
265
+ end
266
+ local _condition_3 = _result_1
267
+ if _condition_3 == nil then
268
+ _condition_3 = 0
269
+ end
270
+ local _result_2 = sizeY
271
+ if _result_2 ~= nil then
272
+ _result_2 = _result_2.Scale
273
+ end
274
+ local _condition_4 = _result_2
275
+ if _condition_4 == nil then
276
+ _condition_4 = 0
277
+ end
278
+ local _result_3 = sizeY
279
+ if _result_3 ~= nil then
280
+ _result_3 = _result_3.Offset
281
+ end
282
+ local _condition_5 = _result_3
283
+ if _condition_5 == nil then
284
+ _condition_5 = 0
285
+ end
286
+ root.Size = UDim2.new(_condition_2, _condition_3, _condition_4, _condition_5)
287
+ end
288
+ local position = pick(sx.position or sx.pos, width)
289
+ local x = pick(sx.x, width)
290
+ local y = pick(sx.y, width)
291
+ if position ~= nil then
292
+ root.Position = position
293
+ elseif x ~= nil or y ~= nil then
294
+ local xU = if x ~= nil then asUDim(x) else UDim.new(0, 0)
295
+ local yU = if y ~= nil then asUDim(y) else UDim.new(0, 0)
296
+ root.Position = UDim2.new(xU.Scale, xU.Offset, yU.Scale, yU.Offset)
297
+ end
298
+ local anchor = pick(sx.anchor, width)
299
+ if anchor ~= nil then
300
+ if type(anchor) == "number" then
301
+ root.AnchorPoint = Vector2.new(anchor, anchor)
302
+ elseif typeof(anchor) == "Vector2" then
303
+ root.AnchorPoint = anchor
304
+ else
305
+ local pair = anchor
306
+ root.AnchorPoint = Vector2.new(pair[1], pair[2])
307
+ end
308
+ end
309
+ local padding = pick(sx.padding, width)
310
+ if padding ~= nil then
311
+ pad = padSides(padding)
312
+ end
313
+ local p = pick(sx.p, width)
314
+ local px = pick(sx.px, width)
315
+ local py = pick(sx.py, width)
316
+ local pt = pick(sx.pt, width)
317
+ local pr = pick(sx.pr, width)
318
+ local pb = pick(sx.pb, width)
319
+ local pl = pick(sx.pl, width)
320
+ if p ~= nil or px ~= nil or py ~= nil or pt ~= nil or pr ~= nil or pb ~= nil or pl ~= nil then
321
+ local base = pad or {
322
+ top = 0,
323
+ right = 0,
324
+ bottom = 0,
325
+ left = 0,
326
+ }
327
+ local _condition_2 = p
328
+ if _condition_2 == nil then
329
+ _condition_2 = 0
330
+ end
331
+ local uniform = _condition_2
332
+ local _object = {}
333
+ local _left = "top"
334
+ local _condition_3 = pt
335
+ if _condition_3 == nil then
336
+ _condition_3 = py
337
+ if _condition_3 == nil then
338
+ _condition_3 = (if p ~= nil then uniform else base.top)
339
+ end
340
+ end
341
+ _object[_left] = _condition_3
342
+ local _left_1 = "right"
343
+ local _condition_4 = pr
344
+ if _condition_4 == nil then
345
+ _condition_4 = px
346
+ if _condition_4 == nil then
347
+ _condition_4 = (if p ~= nil then uniform else base.right)
348
+ end
349
+ end
350
+ _object[_left_1] = _condition_4
351
+ local _left_2 = "bottom"
352
+ local _condition_5 = pb
353
+ if _condition_5 == nil then
354
+ _condition_5 = py
355
+ if _condition_5 == nil then
356
+ _condition_5 = (if p ~= nil then uniform else base.bottom)
357
+ end
358
+ end
359
+ _object[_left_2] = _condition_5
360
+ local _left_3 = "left"
361
+ local _condition_6 = pl
362
+ if _condition_6 == nil then
363
+ _condition_6 = px
364
+ if _condition_6 == nil then
365
+ _condition_6 = (if p ~= nil then uniform else base.left)
366
+ end
367
+ end
368
+ _object[_left_3] = _condition_6
369
+ pad = _object
370
+ end
371
+ local gapVal = pick(sx.gap, width)
372
+ if gapVal ~= nil then
373
+ gap = theme.spacing.calc(gapVal)
374
+ end
375
+ local bg = pick(sx.bgcolor or sx.bg or sx.backgroundColor, width)
376
+ local bgColor = colorOf(theme, bg)
377
+ if bgColor ~= nil then
378
+ root.BackgroundColor3 = bgColor
379
+ if root.BackgroundTransparency == nil then
380
+ root.BackgroundTransparency = 0
381
+ end
382
+ end
383
+ local textColor = colorOf(theme, pick(sx.color, width))
384
+ if textColor ~= nil then
385
+ root.TextColor3 = textColor
386
+ end
387
+ local borderColor = colorOf(theme, pick(sx.borderColor, width))
388
+ if borderColor ~= nil then
389
+ root.BorderColor3 = borderColor
390
+ end
391
+ local opacity = pick(sx.opacity, width)
392
+ if opacity ~= nil then
393
+ root.BackgroundTransparency = 1 - opacity
394
+ end
395
+ local transparency = pick(sx.transparency, width)
396
+ if transparency ~= nil then
397
+ root.BackgroundTransparency = transparency
398
+ end
399
+ local _condition_2 = sx.border
400
+ if _condition_2 == nil then
401
+ _condition_2 = sx.borderWidth
402
+ end
403
+ local border = pick(_condition_2, width)
404
+ if border ~= nil then
405
+ root.BorderSizePixel = border
406
+ end
407
+ local radiusVal = pick(sx.radius, width)
408
+ if radiusVal ~= nil then
409
+ radius = radiusVal
410
+ end
411
+ local typography = pick(sx.typography, width)
412
+ if typography ~= nil then
413
+ local variant = theme.typography.variants[typography]
414
+ if variant ~= nil then
415
+ root.TextSize = variant.size
416
+ root.Font = theme.typography.fontFamilies[variant.family]
417
+ end
418
+ end
419
+ local fontSize = pick(sx.fontSize, width)
420
+ if fontSize ~= nil then
421
+ root.TextSize = fontSize
422
+ end
423
+ local font = pick(sx.font, width)
424
+ if font ~= nil then
425
+ if typeof(font) == "EnumItem" then
426
+ root.Font = font
427
+ else
428
+ root.Font = theme.typography.fontFamilies[font]
429
+ end
430
+ end
431
+ local visible = pick(sx.visible, width)
432
+ if visible ~= nil then
433
+ root.Visible = visible
434
+ end
435
+ local _condition_3 = sx.zIndex
436
+ if _condition_3 == nil then
437
+ _condition_3 = sx.z
438
+ end
439
+ local zIndex = pick(_condition_3, width)
440
+ if zIndex ~= nil then
441
+ root.ZIndex = zIndex
442
+ end
443
+ for key, raw in pairs(sx) do
444
+ local name = key
445
+ if SHORTHAND[name] == true then
446
+ continue
447
+ end
448
+ if SELECTORS[name] == true then
449
+ local nested = resolveSx(theme, raw, width)
450
+ root[name] = nested.root
451
+ continue
452
+ end
453
+ root[name] = pick(raw, width)
454
+ end
455
+ local resolved = {
456
+ root = root,
457
+ }
458
+ if pad ~= nil then
459
+ resolved.padding = {
460
+ PaddingTop = UDim.new(0, theme.spacing.calc(pad.top)),
461
+ PaddingRight = UDim.new(0, theme.spacing.calc(pad.right)),
462
+ PaddingBottom = UDim.new(0, theme.spacing.calc(pad.bottom)),
463
+ PaddingLeft = UDim.new(0, theme.spacing.calc(pad.left)),
464
+ }
465
+ end
466
+ if radius ~= nil then
467
+ resolved.corner = {
468
+ CornerRadius = UDim.new(0, radius),
469
+ }
470
+ end
471
+ if gap ~= nil then
472
+ resolved.gap = gap
473
+ end
474
+ return resolved
475
+ end
476
+ return {
477
+ resolvePaletteToken = resolvePaletteToken,
478
+ resolveSx = resolveSx,
479
+ }
@@ -1,2 +1,4 @@
1
1
  export declare function styleDepsKey(props: object | undefined): string;
2
2
  export declare function createStyleCache<T extends defined>(): (theme: object, key: string, create: () => T) => T;
3
+ /** Drop all makeStyles memo buckets (theme hot-reload / tests). */
4
+ export declare function clearStyleCaches(): void;
@@ -9,6 +9,7 @@ local KEYED = {
9
9
  CFrame = true,
10
10
  BrickColor = true,
11
11
  }
12
+ local caches = {}
12
13
  local function styleDepsKey(props)
13
14
  if props == nil then
14
15
  return ""
@@ -40,6 +41,7 @@ local function styleDepsKey(props)
40
41
  end
41
42
  local function createStyleCache()
42
43
  local byTheme = {}
44
+ table.insert(caches, byTheme)
43
45
  return function(theme, key, create)
44
46
  local _theme = theme
45
47
  local bucket = byTheme[_theme]
@@ -62,7 +64,14 @@ local function createStyleCache()
62
64
  return value
63
65
  end
64
66
  end
67
+ --* Drop all makeStyles memo buckets (theme hot-reload / tests).
68
+ local function clearStyleCaches()
69
+ for _, cache in caches do
70
+ table.clear(cache)
71
+ end
72
+ end
65
73
  return {
66
74
  styleDepsKey = styleDepsKey,
67
75
  createStyleCache = createStyleCache,
76
+ clearStyleCaches = clearStyleCaches,
68
77
  }
@@ -1976,217 +1976,245 @@ local function miscRows()
1976
1976
  local _Length_39 = #_array_40
1977
1977
  table.move(_array_40, 1, _Length_39, _length + 1, _array)
1978
1978
  _length += _Length_39
1979
- local _array_41 = pair("Container", "default", {
1980
- variant = "lg",
1981
- })
1979
+ local _array_41 = pair("StyleSx", "default")
1982
1980
  local _Length_40 = #_array_41
1983
1981
  table.move(_array_41, 1, _Length_40, _length + 1, _array)
1984
1982
  _length += _Length_40
1985
- local _array_42 = pair("Container", "sm", {
1986
- variant = "sm",
1983
+ local _array_42 = pair("StyleSx", "hover", {
1984
+ pointer = "hover",
1987
1985
  })
1988
1986
  local _Length_41 = #_array_42
1989
1987
  table.move(_array_42, 1, _Length_41, _length + 1, _array)
1990
1988
  _length += _Length_41
1991
- local _array_43 = pair("Container", "fluid", {
1992
- variant = "false",
1989
+ local _array_43 = pair("StyleSx", "narrow", {
1990
+ width = NARROW,
1993
1991
  })
1994
1992
  local _Length_42 = #_array_43
1995
1993
  table.move(_array_43, 1, _Length_42, _length + 1, _array)
1996
1994
  _length += _Length_42
1997
- local _array_44 = pair("Backdrop", "default")
1995
+ local _array_44 = pair("StyleSx", "disabled", {
1996
+ disabled = true,
1997
+ })
1998
1998
  local _Length_43 = #_array_44
1999
1999
  table.move(_array_44, 1, _Length_43, _length + 1, _array)
2000
2000
  _length += _Length_43
2001
- local _array_45 = pair("Backdrop", "invisible", {
2002
- variant = "invisible",
2001
+ local _array_45 = pair("StyleSx", "loading", {
2002
+ loading = true,
2003
2003
  })
2004
2004
  local _Length_44 = #_array_45
2005
2005
  table.move(_array_45, 1, _Length_44, _length + 1, _array)
2006
2006
  _length += _Length_44
2007
- local _array_46 = pair("Backdrop", "closed", {
2008
- open = false,
2007
+ local _array_46 = pair("Container", "default", {
2008
+ variant = "lg",
2009
2009
  })
2010
2010
  local _Length_45 = #_array_46
2011
2011
  table.move(_array_46, 1, _Length_45, _length + 1, _array)
2012
2012
  _length += _Length_45
2013
- local _array_47 = pair("Divider", "horizontal", {
2014
- variant = "horizontal",
2013
+ local _array_47 = pair("Container", "sm", {
2014
+ variant = "sm",
2015
2015
  })
2016
2016
  local _Length_46 = #_array_47
2017
2017
  table.move(_array_47, 1, _Length_46, _length + 1, _array)
2018
2018
  _length += _Length_46
2019
- local _array_48 = pair("Divider", "vertical", {
2020
- variant = "vertical",
2019
+ local _array_48 = pair("Container", "fluid", {
2020
+ variant = "false",
2021
2021
  })
2022
2022
  local _Length_47 = #_array_48
2023
2023
  table.move(_array_48, 1, _Length_47, _length + 1, _array)
2024
2024
  _length += _Length_47
2025
- local _array_49 = pair("Divider", "label", {
2026
- text = "Or",
2027
- })
2025
+ local _array_49 = pair("Backdrop", "default")
2028
2026
  local _Length_48 = #_array_49
2029
2027
  table.move(_array_49, 1, _Length_48, _length + 1, _array)
2030
2028
  _length += _Length_48
2031
- local _array_50 = pair("ImageList", "default")
2029
+ local _array_50 = pair("Backdrop", "invisible", {
2030
+ variant = "invisible",
2031
+ })
2032
2032
  local _Length_49 = #_array_50
2033
2033
  table.move(_array_50, 1, _Length_49, _length + 1, _array)
2034
2034
  _length += _Length_49
2035
- local _array_51 = pair("ImageList", "dense", {
2036
- size = "small",
2035
+ local _array_51 = pair("Backdrop", "closed", {
2036
+ open = false,
2037
2037
  })
2038
2038
  local _Length_50 = #_array_51
2039
2039
  table.move(_array_51, 1, _Length_50, _length + 1, _array)
2040
2040
  _length += _Length_50
2041
- local _array_52 = pair("ImageList", "wide", {
2042
- size = "large",
2041
+ local _array_52 = pair("Divider", "horizontal", {
2042
+ variant = "horizontal",
2043
2043
  })
2044
2044
  local _Length_51 = #_array_52
2045
2045
  table.move(_array_52, 1, _Length_51, _length + 1, _array)
2046
2046
  _length += _Length_51
2047
- local _array_53 = pair("ImageList", "titled", {
2048
- text = "Cove",
2047
+ local _array_53 = pair("Divider", "vertical", {
2048
+ variant = "vertical",
2049
2049
  })
2050
2050
  local _Length_52 = #_array_53
2051
2051
  table.move(_array_53, 1, _Length_52, _length + 1, _array)
2052
2052
  _length += _Length_52
2053
- local _array_54 = pair("ImageList", "untitled", {
2054
- text = "",
2053
+ local _array_54 = pair("Divider", "label", {
2054
+ text = "Or",
2055
2055
  })
2056
2056
  local _Length_53 = #_array_54
2057
2057
  table.move(_array_54, 1, _Length_53, _length + 1, _array)
2058
2058
  _length += _Length_53
2059
- local _array_55 = pair("SpeedDial", "closed", {
2060
- open = false,
2061
- })
2059
+ local _array_55 = pair("ImageList", "default")
2062
2060
  local _Length_54 = #_array_55
2063
2061
  table.move(_array_55, 1, _Length_54, _length + 1, _array)
2064
2062
  _length += _Length_54
2065
- local _array_56 = pair("SpeedDial", "open", {
2066
- open = true,
2063
+ local _array_56 = pair("ImageList", "dense", {
2064
+ size = "small",
2067
2065
  })
2068
2066
  local _Length_55 = #_array_56
2069
2067
  table.move(_array_56, 1, _Length_55, _length + 1, _array)
2070
2068
  _length += _Length_55
2071
- local _array_57 = pair("SpeedDial", "disabled", {
2072
- open = false,
2073
- disabled = true,
2069
+ local _array_57 = pair("ImageList", "wide", {
2070
+ size = "large",
2074
2071
  })
2075
2072
  local _Length_56 = #_array_57
2076
2073
  table.move(_array_57, 1, _Length_56, _length + 1, _array)
2077
2074
  _length += _Length_56
2078
- local _array_58 = pair("SpeedDial", "down", {
2079
- open = true,
2080
- variant = "down",
2075
+ local _array_58 = pair("ImageList", "titled", {
2076
+ text = "Cove",
2081
2077
  })
2082
2078
  local _Length_57 = #_array_58
2083
2079
  table.move(_array_58, 1, _Length_57, _length + 1, _array)
2084
2080
  _length += _Length_57
2085
- local _array_59 = pair("FormLabel", "default", {
2086
- text = "Email",
2081
+ local _array_59 = pair("ImageList", "untitled", {
2082
+ text = "",
2087
2083
  })
2088
2084
  local _Length_58 = #_array_59
2089
2085
  table.move(_array_59, 1, _Length_58, _length + 1, _array)
2090
2086
  _length += _Length_58
2091
- local _array_60 = pair("FormLabel", "required", {
2092
- text = "Email",
2093
- value = true,
2087
+ local _array_60 = pair("SpeedDial", "closed", {
2088
+ open = false,
2094
2089
  })
2095
2090
  local _Length_59 = #_array_60
2096
2091
  table.move(_array_60, 1, _Length_59, _length + 1, _array)
2097
2092
  _length += _Length_59
2098
- local _array_61 = pair("FormLabel", "error", {
2099
- text = "Email",
2100
- hasError = true,
2093
+ local _array_61 = pair("SpeedDial", "open", {
2094
+ open = true,
2101
2095
  })
2102
2096
  local _Length_60 = #_array_61
2103
2097
  table.move(_array_61, 1, _Length_60, _length + 1, _array)
2104
2098
  _length += _Length_60
2105
- local _array_62 = pair("FormHelperText", "default", {
2106
- text = "We never share this",
2099
+ local _array_62 = pair("SpeedDial", "disabled", {
2100
+ open = false,
2101
+ disabled = true,
2107
2102
  })
2108
2103
  local _Length_61 = #_array_62
2109
2104
  table.move(_array_62, 1, _Length_61, _length + 1, _array)
2110
2105
  _length += _Length_61
2111
- local _array_63 = pair("FormHelperText", "error", {
2112
- text = "Required",
2113
- hasError = true,
2106
+ local _array_63 = pair("SpeedDial", "down", {
2107
+ open = true,
2108
+ variant = "down",
2114
2109
  })
2115
2110
  local _Length_62 = #_array_63
2116
2111
  table.move(_array_63, 1, _Length_62, _length + 1, _array)
2117
2112
  _length += _Length_62
2118
- local _array_64 = pair("Menu", "closed", {
2119
- open = false,
2113
+ local _array_64 = pair("FormLabel", "default", {
2114
+ text = "Email",
2120
2115
  })
2121
2116
  local _Length_63 = #_array_64
2122
2117
  table.move(_array_64, 1, _Length_63, _length + 1, _array)
2123
2118
  _length += _Length_63
2124
- local _array_65 = pair("Menu", "open", {
2125
- open = true,
2119
+ local _array_65 = pair("FormLabel", "required", {
2120
+ text = "Email",
2121
+ value = true,
2126
2122
  })
2127
2123
  local _Length_64 = #_array_65
2128
2124
  table.move(_array_65, 1, _Length_64, _length + 1, _array)
2129
2125
  _length += _Length_64
2130
- local _array_66 = pair("Menu", "empty", {
2131
- open = true,
2132
- options = {},
2126
+ local _array_66 = pair("FormLabel", "error", {
2127
+ text = "Email",
2128
+ hasError = true,
2133
2129
  })
2134
2130
  local _Length_65 = #_array_66
2135
2131
  table.move(_array_66, 1, _Length_65, _length + 1, _array)
2136
2132
  _length += _Length_65
2137
- local _array_67 = pair("Menu", "dense", {
2138
- open = true,
2139
- variant = "dense",
2133
+ local _array_67 = pair("FormHelperText", "default", {
2134
+ text = "We never share this",
2140
2135
  })
2141
2136
  local _Length_66 = #_array_67
2142
2137
  table.move(_array_67, 1, _Length_66, _length + 1, _array)
2143
2138
  _length += _Length_66
2144
- local _array_68 = pair("Menu", "selected", {
2145
- open = true,
2146
- selected = "a",
2139
+ local _array_68 = pair("FormHelperText", "error", {
2140
+ text = "Required",
2141
+ hasError = true,
2147
2142
  })
2148
2143
  local _Length_67 = #_array_68
2149
2144
  table.move(_array_68, 1, _Length_67, _length + 1, _array)
2150
2145
  _length += _Length_67
2151
- local _array_69 = pair("Markdown", "default", {
2152
- text = "# Title\n\nHello **world**",
2146
+ local _array_69 = pair("Menu", "closed", {
2147
+ open = false,
2153
2148
  })
2154
2149
  local _Length_68 = #_array_69
2155
2150
  table.move(_array_69, 1, _Length_68, _length + 1, _array)
2156
2151
  _length += _Length_68
2157
- local _array_70 = pair("Markdown", "empty", {
2158
- text = "",
2152
+ local _array_70 = pair("Menu", "open", {
2153
+ open = true,
2159
2154
  })
2160
2155
  local _Length_69 = #_array_70
2161
2156
  table.move(_array_70, 1, _Length_69, _length + 1, _array)
2162
2157
  _length += _Length_69
2163
- local _array_71 = pair("MarkdownEditor", "split", {
2164
- text = "# Title",
2165
- variant = "split",
2158
+ local _array_71 = pair("Menu", "empty", {
2159
+ open = true,
2160
+ options = {},
2166
2161
  })
2167
2162
  local _Length_70 = #_array_71
2168
2163
  table.move(_array_71, 1, _Length_70, _length + 1, _array)
2169
2164
  _length += _Length_70
2170
- local _array_72 = pair("MarkdownEditor", "edit", {
2171
- text = "# Title",
2172
- variant = "edit",
2165
+ local _array_72 = pair("Menu", "dense", {
2166
+ open = true,
2167
+ variant = "dense",
2173
2168
  })
2174
2169
  local _Length_71 = #_array_72
2175
2170
  table.move(_array_72, 1, _Length_71, _length + 1, _array)
2176
2171
  _length += _Length_71
2177
- local _array_73 = pair("MarkdownEditor", "preview", {
2178
- text = "# Title",
2179
- variant = "preview",
2172
+ local _array_73 = pair("Menu", "selected", {
2173
+ open = true,
2174
+ selected = "a",
2180
2175
  })
2181
2176
  local _Length_72 = #_array_73
2182
2177
  table.move(_array_73, 1, _Length_72, _length + 1, _array)
2183
2178
  _length += _Length_72
2184
- local _array_74 = pair("MarkdownEditor", "density-compact", {
2179
+ local _array_74 = pair("Markdown", "default", {
2180
+ text = "# Title\n\nHello **world**",
2181
+ })
2182
+ local _Length_73 = #_array_74
2183
+ table.move(_array_74, 1, _Length_73, _length + 1, _array)
2184
+ _length += _Length_73
2185
+ local _array_75 = pair("Markdown", "empty", {
2186
+ text = "",
2187
+ })
2188
+ local _Length_74 = #_array_75
2189
+ table.move(_array_75, 1, _Length_74, _length + 1, _array)
2190
+ _length += _Length_74
2191
+ local _array_76 = pair("MarkdownEditor", "split", {
2192
+ text = "# Title",
2193
+ variant = "split",
2194
+ })
2195
+ local _Length_75 = #_array_76
2196
+ table.move(_array_76, 1, _Length_75, _length + 1, _array)
2197
+ _length += _Length_75
2198
+ local _array_77 = pair("MarkdownEditor", "edit", {
2199
+ text = "# Title",
2200
+ variant = "edit",
2201
+ })
2202
+ local _Length_76 = #_array_77
2203
+ table.move(_array_77, 1, _Length_76, _length + 1, _array)
2204
+ _length += _Length_76
2205
+ local _array_78 = pair("MarkdownEditor", "preview", {
2206
+ text = "# Title",
2207
+ variant = "preview",
2208
+ })
2209
+ local _Length_77 = #_array_78
2210
+ table.move(_array_78, 1, _Length_77, _length + 1, _array)
2211
+ _length += _Length_77
2212
+ local _array_79 = pair("MarkdownEditor", "density-compact", {
2185
2213
  text = "# Title",
2186
2214
  density = "compact",
2187
2215
  variant = "split",
2188
2216
  })
2189
- table.move(_array_74, 1, #_array_74, _length + 1, _array)
2217
+ table.move(_array_79, 1, #_array_79, _length + 1, _array)
2190
2218
  return _array
2191
2219
  end
2192
2220
  local function concatRows(...)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/uiblox",
3
- "version": "0.2.0-alpha.24",
3
+ "version": "0.2.0-alpha.25",
4
4
  "description": "UI Library and theming for roblox-ts projects",
5
5
  "main": "out/init.luau",
6
6
  "packageManager": "pnpm@11.3.0",
@@ -8,7 +8,7 @@
8
8
  "build": "rbxtsc",
9
9
  "watch": "rbxtsc -w",
10
10
  "pack:check": "node scripts/pack-check.mjs",
11
- "test": "node scripts/no-internal-refs.check.mjs && node scripts/import-case.check.mjs && node --experimental-strip-types scripts/theme-scope.check.mjs && node --experimental-strip-types scripts/style-types.check.mjs && node --experimental-strip-types scripts/style-cache.check.mjs && node --experimental-strip-types scripts/style-variants.check.mjs && node --experimental-strip-types scripts/component-styles.check.mjs && node --experimental-strip-types scripts/interaction-styles.check.mjs && node --experimental-strip-types scripts/resolve-style.check.mjs && node --experimental-strip-types scripts/density.check.mjs && node --experimental-strip-types scripts/styles.check.mjs && node --experimental-strip-types scripts/contrast.check.mjs && node --experimental-strip-types scripts/primitives.check.mjs && node --experimental-strip-types scripts/paper.check.mjs && node --experimental-strip-types scripts/list-item.check.mjs && node --experimental-strip-types scripts/slider.check.mjs && node --experimental-strip-types scripts/input.check.mjs && node --experimental-strip-types scripts/menu.check.mjs && node --experimental-strip-types scripts/guard.check.mjs && node --experimental-strip-types scripts/breakpoints.check.mjs && node --experimental-strip-types scripts/focus-trap.check.mjs && node --experimental-strip-types scripts/select-typeahead.check.mjs && node --experimental-strip-types scripts/select-groups.check.mjs && node --experimental-strip-types scripts/select-multi.check.mjs && node --experimental-strip-types scripts/select-polish.check.mjs && node --experimental-strip-types scripts/reduced-motion.check.mjs && node --experimental-strip-types scripts/card.check.mjs && node --experimental-strip-types scripts/chip.check.mjs && node --experimental-strip-types scripts/badge.check.mjs && node --experimental-strip-types scripts/avatar.check.mjs && node --experimental-strip-types scripts/imageList.check.mjs && node --experimental-strip-types scripts/drawer.check.mjs && node --experimental-strip-types scripts/breadcrumbs.check.mjs && node --experimental-strip-types scripts/pagination.check.mjs && node --experimental-strip-types scripts/stepper.check.mjs && node --experimental-strip-types scripts/accordion.check.mjs && node --experimental-strip-types scripts/snackbar.check.mjs && node --experimental-strip-types scripts/table.check.mjs && node --experimental-strip-types scripts/autocomplete.check.mjs && node --experimental-strip-types scripts/field-loading.check.mjs && node --experimental-strip-types scripts/fab.check.mjs && node --experimental-strip-types scripts/appbar.check.mjs && node --experimental-strip-types scripts/bottom-navigation.check.mjs && node --experimental-strip-types scripts/alert.check.mjs && node --experimental-strip-types scripts/toggle-button.check.mjs && node --experimental-strip-types scripts/link.check.mjs && node --experimental-strip-types scripts/rating.check.mjs && node --experimental-strip-types scripts/stack.check.mjs && node --experimental-strip-types scripts/flex-item.check.mjs && node --experimental-strip-types scripts/grid.check.mjs && node --experimental-strip-types scripts/speed-dial.check.mjs && node --experimental-strip-types scripts/form-text.check.mjs && node --experimental-strip-types scripts/box.check.mjs && node --experimental-strip-types scripts/image-list.check.mjs && node --experimental-strip-types scripts/radio-group.check.mjs && node --experimental-strip-types scripts/container.check.mjs && node --experimental-strip-types scripts/divider.check.mjs && node --experimental-strip-types scripts/markdown.check.mjs && node --experimental-strip-types scripts/switch.check.mjs && node --experimental-strip-types scripts/tabs.check.mjs && node --experimental-strip-types scripts/dialog.check.mjs && node --experimental-strip-types scripts/backdrop.check.mjs && node --experimental-strip-types scripts/cframe-editor.check.mjs && node --experimental-strip-types scripts/enum-picker.check.mjs && node --experimental-strip-types scripts/number-range.check.mjs && node --experimental-strip-types scripts/rect-editor.check.mjs && node --experimental-strip-types scripts/asset-field.check.mjs && node --experimental-strip-types scripts/gradient-editor.check.mjs && node --experimental-strip-types scripts/ray-editor.check.mjs && node --experimental-strip-types scripts/physical-properties.check.mjs && node --experimental-strip-types scripts/brickcolor-picker.check.mjs",
11
+ "test": "node scripts/no-internal-refs.check.mjs && node scripts/import-case.check.mjs && node --experimental-strip-types scripts/theme-scope.check.mjs && node --experimental-strip-types scripts/style-types.check.mjs && node --experimental-strip-types scripts/style-cache.check.mjs && node --experimental-strip-types scripts/style-variants.check.mjs && node --experimental-strip-types scripts/component-styles.check.mjs && node --experimental-strip-types scripts/interaction-styles.check.mjs && node --experimental-strip-types scripts/resolve-style.check.mjs && node --experimental-strip-types scripts/resolve-sx.check.mjs && node --experimental-strip-types scripts/style-system.check.mjs && node --experimental-strip-types scripts/density.check.mjs && node --experimental-strip-types scripts/styles.check.mjs && node --experimental-strip-types scripts/contrast.check.mjs && node --experimental-strip-types scripts/primitives.check.mjs && node --experimental-strip-types scripts/paper.check.mjs && node --experimental-strip-types scripts/list-item.check.mjs && node --experimental-strip-types scripts/slider.check.mjs && node --experimental-strip-types scripts/input.check.mjs && node --experimental-strip-types scripts/menu.check.mjs && node --experimental-strip-types scripts/guard.check.mjs && node --experimental-strip-types scripts/breakpoints.check.mjs && node --experimental-strip-types scripts/viewport-observer.check.mjs && node --experimental-strip-types scripts/focus-trap.check.mjs && node --experimental-strip-types scripts/select-typeahead.check.mjs && node --experimental-strip-types scripts/select-groups.check.mjs && node --experimental-strip-types scripts/select-multi.check.mjs && node --experimental-strip-types scripts/select-polish.check.mjs && node --experimental-strip-types scripts/reduced-motion.check.mjs && node --experimental-strip-types scripts/card.check.mjs && node --experimental-strip-types scripts/chip.check.mjs && node --experimental-strip-types scripts/badge.check.mjs && node --experimental-strip-types scripts/avatar.check.mjs && node --experimental-strip-types scripts/imageList.check.mjs && node --experimental-strip-types scripts/drawer.check.mjs && node --experimental-strip-types scripts/breadcrumbs.check.mjs && node --experimental-strip-types scripts/pagination.check.mjs && node --experimental-strip-types scripts/stepper.check.mjs && node --experimental-strip-types scripts/accordion.check.mjs && node --experimental-strip-types scripts/snackbar.check.mjs && node --experimental-strip-types scripts/table.check.mjs && node --experimental-strip-types scripts/autocomplete.check.mjs && node --experimental-strip-types scripts/field-loading.check.mjs && node --experimental-strip-types scripts/fab.check.mjs && node --experimental-strip-types scripts/appbar.check.mjs && node --experimental-strip-types scripts/bottom-navigation.check.mjs && node --experimental-strip-types scripts/alert.check.mjs && node --experimental-strip-types scripts/toggle-button.check.mjs && node --experimental-strip-types scripts/link.check.mjs && node --experimental-strip-types scripts/rating.check.mjs && node --experimental-strip-types scripts/stack.check.mjs && node --experimental-strip-types scripts/flex-item.check.mjs && node --experimental-strip-types scripts/grid.check.mjs && node --experimental-strip-types scripts/speed-dial.check.mjs && node --experimental-strip-types scripts/form-text.check.mjs && node --experimental-strip-types scripts/box.check.mjs && node --experimental-strip-types scripts/image-list.check.mjs && node --experimental-strip-types scripts/radio-group.check.mjs && node --experimental-strip-types scripts/container.check.mjs && node --experimental-strip-types scripts/divider.check.mjs && node --experimental-strip-types scripts/markdown.check.mjs && node --experimental-strip-types scripts/switch.check.mjs && node --experimental-strip-types scripts/tabs.check.mjs && node --experimental-strip-types scripts/dialog.check.mjs && node --experimental-strip-types scripts/backdrop.check.mjs && node --experimental-strip-types scripts/cframe-editor.check.mjs && node --experimental-strip-types scripts/enum-picker.check.mjs && node --experimental-strip-types scripts/number-range.check.mjs && node --experimental-strip-types scripts/rect-editor.check.mjs && node --experimental-strip-types scripts/asset-field.check.mjs && node --experimental-strip-types scripts/gradient-editor.check.mjs && node --experimental-strip-types scripts/ray-editor.check.mjs && node --experimental-strip-types scripts/physical-properties.check.mjs && node --experimental-strip-types scripts/brickcolor-picker.check.mjs",
12
12
  "prepublishOnly": "pnpm build"
13
13
  },
14
14
  "keywords": [