{"id":"iam9pasa/bright","name":"bright","scope":"iam9pasa","platform":"roblox","description":"Scale-only vide UI building blocks for Roblox, with swappable styles and a lint for sizing rules","version":"0.1.0","latest":"0.1.0","versions":["0.1.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{"centau/vide":{"version":"^0.3.1","alias":"vide"}},"integrity":"66853bdb1d5a5a4c6245f78112c1feb8ce09cc22e4ab30262f9d2cdec663de25","likes":0,"downloads":0,"install":"forest install iam9pasa/bright","url":"https://forest.dev/p/roblox/iam9pasa/bright","files":"https://api.forest.dev/ai/package/roblox/iam9pasa/bright/files","readme":"# Bright\r\n\r\nUI building blocks on top of [vide](https://github.com/centau/vide) that make any UI style easier to build and prettier by default.\r\nYou write the screen once with `ui.window`, `ui.button`, `ui.item_card` and friends. The **style** decides how it looks: fonts, corners, outlines, header kind, button kind, glow, palettes.\r\nAll sizes are scale: no px offsets, scaled strokes, scaled text. The rules are in [RULES.md](RULES.md), and `ui.lint(root)` checks them in Studio or in the simulator.\r\n\r\n## Styles\r\n\r\n| Style | Look | Good for |\r\n| --- | --- | --- |\r\n| `brainrot` (default) | navy glass, glossy studded header bars, 3D candy buttons, heavy outlined text | simulators, tycoons, meme games |\r\n| `clean` | white rounded windows, flat solid buttons, dark text | menus, settings, modern app-like UI |\r\n| `glass` | dark see-through windows, mint glow edges, glowing buttons | neon, script-hub, nightlife |\r\n| `scifi` | navy, cyan lines, square corners with bracket marks, outline buttons, uppercase | shooters, space, tech |\r\n| `fantasy` | wood and gold, parchment banner title, beveled buttons, serif text | RPG, adventure, quests |\r\n| `pastel` | cream, round everything, bubbly pill buttons, rounded font | pets, cafe, dress-up, cute games |\r\n\r\n```lua\r\nlocal bright = require(ReplicatedStorage.Packages.bright)   -- default style (src/theme.luau)\r\nlocal ui = bright.with(bright.styles.glass)                  -- or any style, several can live side by side\r\n```\r\n\r\nMake your own style from any of them. Only list what changes:\r\n\r\n```lua\r\nlocal candy_night = bright.extend(bright.styles.brainrot, {\r\n\tsurface = { color = Color3.fromHex(\"1A0B2E\"), corner = UDim.new(0.04, 0) },\r\n\tbutton = { studs = false, corner = UDim.new(0.5, 0) },\r\n\tpalette = { blue = { face = { Color3.fromHex(\"C9A8FF\"), Color3.fromHex(\"8A4DFF\") } } },\r\n})\r\nlocal ui = bright.with(candy_night)\r\n```\r\n\r\nStyle settings (see `src/styles/brainrot.luau` for every key):\r\n- **Surface:** `surface` sets the window and card fill, transparency, outline, `corner`, optional `gradient`, `glow` and sci-fi `brackets`.\r\n- **Kinds:** `header.kind` is `bar`, `plain` or `banner`. `button.kind` is `candy`, `flat`, `outline` or `glow`. `button.studs` and `header.studs` turn the stud texture on or off.\r\n- **Text:** `text` sets `outline`, `drop` (dark copy under titles) and `upper` (uppercase). `font` sets the `title` and `body` fonts.\r\n- **Cards:** `card.rays` puts sunbursts behind items. Without it, items get a rarity glow and stripe.\r\n- **Colors:** `palette` sets the named colors (blue, green, red, gold, purple, pink, orange, amber, grey). Each has a dark `base`, an outline `stroke`, a `face` gradient, a `label` color and a `text` outline color. `text_gradient` sets the cash and rarity text.\r\n\r\n## Use\r\n\r\n```toml\r\n# wally.toml\r\n[dependencies]\r\nbright = \"iam9pasa/bright@0.1.0\"\r\n```\r\n\r\n```lua\r\nlocal ui = require(ReplicatedStorage.Packages.bright)\r\n\r\nui.window {\r\n\ttitle = \"Inventory\",\r\n\ticon = ui.theme.asset.icon.inventory,\r\n\tpalette = \"blue\",            -- blue, orange, gold, amber, green, red, purple, pink, grey\r\n\tshape = \"inventory\",         -- standard, inventory, large, popup (reference proportions)\r\n\tclose = function() end,\r\n\tParent = screen_gui,\r\n\r\n\tui.scroll_grid { columns = 4, Size = UDim2.fromScale(0.65, 0.8), Position = UDim2.fromScale(0.02, 0.17),\r\n\t\tui.item_card { name = \"Sharkalino\", image = id, value = \"$1.2K/s\", rarity = \"legendary\" },\r\n\t},\r\n\tui.button { text = \"Equip\", palette = \"green\", Size = UDim2.fromScale(0.25, 0.11) },\r\n}\r\n```\r\n\r\nOpen and close with a spring instead of popping, and roll numbers instead of jumping:\r\n\r\n```lua\r\nlocal open = vide.source(false)\r\nui.window { title = \"Shop\", open = open, ... }        -- springs in and out, closed = no input, no cost\r\n\r\nui.counter { value = cash, style = \"cash\" }           -- 1,450 rolls to 1,390\r\nui.button { text = \"$95K\", locked = function() return cash() < 95000 end }   -- grey, shakes on click\r\n```\r\n\r\n- `disabled`: the action doesn't apply right now (maxed, already claimed). Grey and no input.\r\n- `locked`: the player can't do it yet (can't afford, needs a level). Grey, but a click shakes the button instead of running `Activated`.\r\n\r\nFull API: header comment of `src/init.luau`.\r\n\r\n## Publishing\r\n\r\nbright is not on the Wally index yet, so `iam9pasa/bright@0.1.0` only resolves after the owner publishes it:\r\n\r\n```sh\r\nwally login                 # once, with the GitHub account that owns iam9pasa\r\nwally package --list        # check what ships: src/, default.project.json, wally.toml, README, RULES\r\nwally publish\r\n```\r\n\r\nUntil then, add it as a git submodule or copy `src/` into your project as `Packages/bright` next to vide. The pieces:\r\n- **Windows:** `window`, `header`, `card`, `panel`.\r\n- **Text:** `text` (styles `cash`, `legendary`, `epic`, `rare`, `common`, `gems`, `item`, `rainbow`), `title` (white over dark drop edge).\r\n- **Controls:** `button` (`palette`, `disabled` and `locked` can be vide sources), `close_button`, `icon_button`, `tab`, `input`, `toggle`, `hud_button`, `hit`.\r\n- **Content:** `item_card`, `counter`, `sunburst`, `studs`, `progress`, `icon`, `hex`, `hex_stack`, `hex_grid { radius, cell }`.\r\n- **Layout:** `row`, `column`, `scroll_grid { columns }`, `scroll_list` (gaps stay the same share of the width at any item count), `hud_column`, `padding`, `pad`, `square`, `ratio`.\r\n- **Motion:** `presence { open }` (spring open / close), `motion.loop`, `bob`, `spin`, `pause`, `tween`, `pop`, `shake`.\r\n- **Screen:** `device()`, `adaptive()`, `lint(root)`.\r\n- **Types:** `WindowProps`, `ButtonProps`, `TextProps` and friends, for autocomplete and typo checks.\r\n\r\nAsset ids for the stud texture, sunburst and icons live in `theme.asset`. Replace them with your own game's ids.\r\n\r\n## Simulator: see the UI without Studio\r\n\r\n`sim/` runs the real bright + vide code on a fake Roblox (`sim/roblox.luau`) and draws it in a browser page.\r\nEach example runs once per device (phones, tablet, desktop, console), so code that checks the screen gets real answers.\r\n\r\n```sh\r\nrokit install                        # gets luau (rokit.toml)\r\nnode sim/run.mjs                     # every example -> sim/out/<name>.html, open it in a browser\r\nnode sim/run.mjs gallery --serve     # http://localhost:5173, rebuilds + reloads when you save\r\nnode sim/run.mjs --shot              # pngs per device + design checks in the terminal (needs playwright)\r\nnode sim/run.mjs --strict            # headless: exit 1 on any crash or sizing-rule fail (what CI runs)\r\nnode sim/run.mjs --tests --strict    # sim/tests: lint fixtures and behaviour asserts\r\n```\r\n\r\nCI (`.github/workflows/check.yml`) runs the two headless commands on every push and PR. You never need to open the viewer.\r\n\r\nExamples live in `sim/examples/`, one per style:\r\n\r\n| Example | Style | Shows |\r\n| --- | --- | --- |\r\n| `gallery` | inventory in all 6 styles (one scene each) | same screen code, only the style changes, `hud_column` |\r\n| `styles` | all 6 styles side by side | tabs, progress, toggle, buttons, item card per style |\r\n| `store` | amber large window | pack cards (blue / pink / green), passes, sale price, robux buttons |\r\n| `upgrades` | gold | rows sized with `ui.ratio`, level bars, rolling cash `counter`, maxed (disabled) and can't-afford (locked) buttons |\r\n| `daily` | pink | 7-day grid, claimed / today / locked cells, reactive claim button |\r\n| `popups` | red and green popups | `open` springs popups in and out, a spinning sunburst that pauses while closed |\r\n| `skilltree` | purple | radius-3 `hex_grid`, owned / open / locked nodes, points `counter` |\r\n| `lists` | blue | the same `scroll_list` with 2 and 6 items, same gap |\r\n| `themes` | one style, 4 palettes | only `palette` changes |\r\n\r\n`sim/shared/stand_ins.luau` maps the asset ids to local preview drawings. They are normal client code plus a `sim` global:\r\n\r\n```lua\r\nlocal screen = sim.screen(\"shop\")            -- a ScreenGui in PlayerGui\r\nvide.mount(function() return ui.panel { ... } end, screen)\r\nsim.snapshot(\"default\")                      -- one scene in the viewer\r\nsim.hover(button) sim.press(button) sim.click(button) sim.fire(instance, \"Event\", ...)\r\nsim.step(0.5)                                -- advance time: task.delay / task.wait / springs\r\nsim.asset(\"rbxassetid://123\", \"sim/assets/coin.png\")   -- show a real image instead of a placeholder\r\n```\r\n\r\nThe viewer has device presets with the Roblox top bar and notch safe areas, a game-world, dark or light backdrop, and an inspector (hover for the instance path and size).\r\nIts design checks flag low text contrast (WCAG 2.2), text under 12px on phones, tap targets under 44pt (64px on TV), and buttons under the top bar or a notch.\r\nTweens jump to their end value, and images without `sim.asset` show as placeholders.\r\nThe layout follows Roblox's rules closely but not perfectly, so give final polish a look in Studio.\r\n\r\n## License\r\n\r\nMIT, free to use, change and ship in any game. See [LICENSE](LICENSE).\r\n","readmeTruncated":false}