jaml-ui 0.24.20 → 0.25.2

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 (233) hide show
  1. package/README.md +0 -13
  2. package/assets/WeeJokerExampleDAilyGame.png +0 -0
  3. package/assets/balatro-stake-chips.png +0 -0
  4. package/dist/assets.d.ts +1 -2
  5. package/dist/chunks/Layer-BBPJFHfs.js +17 -0
  6. package/dist/chunks/Layer-BBPJFHfs.js.map +1 -0
  7. package/dist/chunks/assets-RWUiFSTc.js +37 -0
  8. package/dist/chunks/assets-RWUiFSTc.js.map +1 -0
  9. package/dist/chunks/motelyItemDecoder-CueyZ0XD.js +6039 -0
  10. package/dist/chunks/motelyItemDecoder-CueyZ0XD.js.map +1 -0
  11. package/dist/chunks/spriteMapper-CFjN0_TV.js +2415 -0
  12. package/dist/chunks/spriteMapper-CFjN0_TV.js.map +1 -0
  13. package/dist/chunks/tokens-B65Fzble.js +57 -0
  14. package/dist/chunks/tokens-B65Fzble.js.map +1 -0
  15. package/dist/chunks/ui-5cBy3zAm.js +1387 -0
  16. package/dist/chunks/ui-5cBy3zAm.js.map +1 -0
  17. package/dist/components/AnalyzerExplorer.d.ts +1 -1
  18. package/dist/components/CardFan.d.ts +1 -1
  19. package/dist/components/CardList.d.ts +1 -1
  20. package/dist/components/DeckSprite.d.ts +1 -1
  21. package/dist/components/JamlAestheticSelector.d.ts +1 -1
  22. package/dist/components/JamlAnalyzerFullscreen.d.ts +5 -5
  23. package/dist/components/JamlCurator.d.ts +1 -6
  24. package/dist/components/JamlIde.d.ts +5 -5
  25. package/dist/components/JamlSeedInput.d.ts +1 -1
  26. package/dist/components/JamlSpeedometer.d.ts +1 -1
  27. package/dist/components/MotelyVersionBadge.d.ts +1 -1
  28. package/dist/components/Standardcard.d.ts +1 -1
  29. package/dist/components/jamlMap/CategoryPicker.d.ts +3 -3
  30. package/dist/components/jamlMap/JamlMapEditor.d.ts +1 -1
  31. package/dist/components/jamlMap/JokerPicker.d.ts +1 -1
  32. package/dist/components/jamlMap/MysterySlot.d.ts +2 -2
  33. package/dist/components/jamlMap/index.d.ts +4 -4
  34. package/dist/core.d.ts +5 -5
  35. package/dist/core.js +27 -5
  36. package/dist/core.js.map +1 -0
  37. package/dist/decode/motelyItemDecoder.d.ts +0 -10
  38. package/dist/decode/motelySprite.d.ts +1 -1
  39. package/dist/fonts/m6x11plus.otf +0 -0
  40. package/dist/hooks/analyzerStreamRegistry.d.ts +2 -2
  41. package/dist/hooks/useAnalyzer.d.ts +3 -3
  42. package/dist/hooks/useSearch.d.ts +2 -2
  43. package/dist/index.d.ts +29 -31
  44. package/dist/index.js +16721 -34
  45. package/dist/index.js.map +1 -0
  46. package/dist/lib/const.d.ts +2 -2
  47. package/dist/lib/hooks/useDragScroll.d.ts +1 -1
  48. package/dist/lib/hooks/useJamlFilter.d.ts +2 -2
  49. package/dist/lib/hooks/useSeedAnalyzer.d.ts +2 -2
  50. package/dist/lib/utils.d.ts +1 -1
  51. package/dist/motely.d.ts +4 -3
  52. package/dist/motely.js +65 -3
  53. package/dist/motely.js.map +1 -0
  54. package/dist/motelyBoot.d.ts +2 -0
  55. package/dist/motelyDisplay.d.ts +0 -2
  56. package/dist/r3f/Card3D.d.ts +2 -2
  57. package/dist/r3f/JimboBillboard.d.ts +1 -1
  58. package/dist/r3f.js +235 -3
  59. package/dist/r3f.js.map +1 -0
  60. package/dist/render/CanvasRenderer.d.ts +1 -1
  61. package/dist/sprites/spriteData.d.ts +1 -6
  62. package/dist/sprites/spriteMapper.d.ts +1 -1
  63. package/dist/ui/JimboBadge.d.ts +1 -1
  64. package/dist/ui/JimboFloating.d.ts +1 -1
  65. package/dist/ui/JimboIconButton.d.ts +1 -1
  66. package/dist/ui/JimboSelect.d.ts +1 -1
  67. package/dist/ui/footer.d.ts +2 -3
  68. package/dist/ui/hooks.d.ts +1 -1
  69. package/dist/ui/ide/DeckSprite.d.ts +1 -1
  70. package/dist/ui/jimbo.css +2 -1856
  71. package/dist/ui/jimboApp.d.ts +1 -1
  72. package/dist/ui/jimboFilterBar.d.ts +1 -1
  73. package/dist/ui/jimboFlankNav.d.ts +1 -1
  74. package/dist/ui/jimboInfoCard.d.ts +1 -1
  75. package/dist/ui/jimboInset.d.ts +1 -1
  76. package/dist/ui/jimboStatGrid.d.ts +1 -1
  77. package/dist/ui/jimboText.d.ts +1 -1
  78. package/dist/ui/jimboTooltip.d.ts +2 -2
  79. package/dist/ui/mascot/SeedMascot.d.ts +2 -2
  80. package/dist/ui/panel.d.ts +1 -1
  81. package/dist/ui/radial/RadialBadge.d.ts +1 -2
  82. package/dist/ui/radial/RadialButton.d.ts +1 -2
  83. package/dist/ui/radial/RadialMenu.d.ts +2 -2
  84. package/dist/ui/radial/RadialPill.d.ts +1 -2
  85. package/dist/ui/radial/index.d.ts +16 -16
  86. package/dist/ui/radial/radialMenuStore.d.ts +1 -1
  87. package/dist/ui/showcase.d.ts +1 -1
  88. package/dist/ui/sprites.d.ts +2 -2
  89. package/dist/ui.d.ts +0 -1
  90. package/dist/ui.js +3 -36
  91. package/dist/utils/gameCardUtils.d.ts +1 -1
  92. package/dist/utils/jamlVisualFilter.d.ts +1 -7
  93. package/package.json +13 -25
  94. package/dist/assets.js +0 -48
  95. package/dist/components/AnalyzerExplorer.js +0 -391
  96. package/dist/components/CardFan.js +0 -80
  97. package/dist/components/CardList.js +0 -5
  98. package/dist/components/DeckSprite.js +0 -75
  99. package/dist/components/GameCard.js +0 -355
  100. package/dist/components/JamlAestheticSelector.js +0 -22
  101. package/dist/components/JamlAnalyzerFullscreen.js +0 -263
  102. package/dist/components/JamlCodeEditor.js +0 -137
  103. package/dist/components/JamlCurator.js +0 -64
  104. package/dist/components/JamlCurator.stories.d.ts +0 -6
  105. package/dist/components/JamlCurator.stories.js +0 -14
  106. package/dist/components/JamlIde.js +0 -193
  107. package/dist/components/JamlIdeToolbar.js +0 -23
  108. package/dist/components/JamlIdeVisual.js +0 -218
  109. package/dist/components/JamlMapPreview.js +0 -121
  110. package/dist/components/JamlSeedInput.js +0 -26
  111. package/dist/components/JamlSpeedometer.js +0 -70
  112. package/dist/components/Jimbolate.js +0 -17
  113. package/dist/components/MotelyVersionBadge.js +0 -19
  114. package/dist/components/PaginatedFilterBrowser.js +0 -54
  115. package/dist/components/RunConfigModal.js +0 -59
  116. package/dist/components/Standardcard.js +0 -80
  117. package/dist/components/jamlMap/CategoryPicker.js +0 -135
  118. package/dist/components/jamlMap/JamlMapEditor.js +0 -304
  119. package/dist/components/jamlMap/JamlMapEditor.stories.d.ts +0 -7
  120. package/dist/components/jamlMap/JamlMapEditor.stories.js +0 -26
  121. package/dist/components/jamlMap/JamlMapEditorDemo.d.ts +0 -8
  122. package/dist/components/jamlMap/JamlMapEditorDemo.js +0 -323
  123. package/dist/components/jamlMap/JokerPicker.js +0 -113
  124. package/dist/components/jamlMap/MysterySlot.js +0 -128
  125. package/dist/components/jamlMap/MysterySlot.stories.d.ts +0 -7
  126. package/dist/components/jamlMap/MysterySlot.stories.js +0 -31
  127. package/dist/components/jamlMap/index.js +0 -4
  128. package/dist/decode/motelyItemDecoder.js +0 -164
  129. package/dist/decode/motelySprite.js +0 -84
  130. package/dist/hooks/analyzerStreamRegistry.js +0 -96
  131. package/dist/hooks/searchWorker.d.ts +0 -1
  132. package/dist/hooks/searchWorker.js +0 -119
  133. package/dist/hooks/searchWorkerCode.d.ts +0 -1
  134. package/dist/hooks/searchWorkerCode.js +0 -85
  135. package/dist/hooks/useAnalyzer.js +0 -91
  136. package/dist/hooks/useIntersectionObserver.js +0 -52
  137. package/dist/hooks/useSearch.js +0 -161
  138. package/dist/hooks/useShopStream.js +0 -85
  139. package/dist/lib/SpriteMapper.js +0 -48
  140. package/dist/lib/cardParser.js +0 -67
  141. package/dist/lib/classes/BuyMetaData.js +0 -1
  142. package/dist/lib/config.js +0 -15
  143. package/dist/lib/const.js +0 -521
  144. package/dist/lib/data/constants.js +0 -14
  145. package/dist/lib/hooks/useDragScroll.js +0 -48
  146. package/dist/lib/hooks/useJamlFilter.js +0 -219
  147. package/dist/lib/hooks/useSeedAnalyzer.js +0 -50
  148. package/dist/lib/jaml/jamlCompletion.js +0 -13
  149. package/dist/lib/jaml/jamlData.js +0 -6
  150. package/dist/lib/jaml/jamlObjectives.js +0 -97
  151. package/dist/lib/jaml/jamlParser.js +0 -47
  152. package/dist/lib/jaml/jamlPresets.js +0 -61
  153. package/dist/lib/jaml/jamlSchema.js +0 -91
  154. package/dist/lib/parseDailyRitual.js +0 -70
  155. package/dist/lib/tts/getRevealPos.js +0 -16
  156. package/dist/lib/tts/splitTtsDisplay.js +0 -35
  157. package/dist/lib/types.js +0 -1
  158. package/dist/lib/utils.js +0 -5
  159. package/dist/motelyDisplay.js +0 -59
  160. package/dist/r3f/Card3D.js +0 -72
  161. package/dist/r3f/JimboBillboard.js +0 -32
  162. package/dist/r3f/JimboText3D.js +0 -8
  163. package/dist/render/CanvasRenderer.js +0 -11
  164. package/dist/render/Layer.js +0 -18
  165. package/dist/sprites/spriteData.js +0 -100
  166. package/dist/sprites/spriteMapper.js +0 -75
  167. package/dist/stories/Button.d.ts +0 -15
  168. package/dist/stories/Button.js +0 -7
  169. package/dist/stories/Button.stories.d.ts +0 -24
  170. package/dist/stories/Button.stories.js +0 -50
  171. package/dist/stories/Header.d.ts +0 -12
  172. package/dist/stories/Header.js +0 -4
  173. package/dist/stories/Header.stories.d.ts +0 -18
  174. package/dist/stories/Header.stories.js +0 -26
  175. package/dist/stories/Page.d.ts +0 -3
  176. package/dist/stories/Page.js +0 -8
  177. package/dist/stories/Page.stories.d.ts +0 -12
  178. package/dist/stories/Page.stories.js +0 -24
  179. package/dist/ui/Jimbo.stories.d.ts +0 -7
  180. package/dist/ui/Jimbo.stories.js +0 -28
  181. package/dist/ui/JimboBadge.js +0 -8
  182. package/dist/ui/JimboFloating.js +0 -17
  183. package/dist/ui/JimboIconButton.js +0 -28
  184. package/dist/ui/JimboInputModal.js +0 -66
  185. package/dist/ui/JimboSelect.js +0 -43
  186. package/dist/ui/JimboToggleList.js +0 -5
  187. package/dist/ui/PanelSplitter.js +0 -78
  188. package/dist/ui/codeBlock.js +0 -14
  189. package/dist/ui/footer.js +0 -20
  190. package/dist/ui/hooks.js +0 -634
  191. package/dist/ui/ide/AgnosticSeedCard.d.ts +0 -19
  192. package/dist/ui/ide/AgnosticSeedCard.js +0 -48
  193. package/dist/ui/ide/DeckSprite.js +0 -2
  194. package/dist/ui/ide/JamlBuilder.d.ts +0 -1
  195. package/dist/ui/ide/JamlBuilder.js +0 -112
  196. package/dist/ui/ide/JamlEditor.js +0 -486
  197. package/dist/ui/ide/JamlEditorMonaco.d.ts +0 -8
  198. package/dist/ui/ide/JamlEditorMonaco.js +0 -78
  199. package/dist/ui/ide/WasmStatus.d.ts +0 -1
  200. package/dist/ui/ide/WasmStatus.js +0 -42
  201. package/dist/ui/jimboApp.js +0 -15
  202. package/dist/ui/jimboBackground.js +0 -27
  203. package/dist/ui/jimboCopyRow.js +0 -18
  204. package/dist/ui/jimboFilterBar.js +0 -16
  205. package/dist/ui/jimboFlankNav.js +0 -18
  206. package/dist/ui/jimboInfoCard.js +0 -26
  207. package/dist/ui/jimboInset.js +0 -9
  208. package/dist/ui/jimboSectionHeader.js +0 -9
  209. package/dist/ui/jimboStatGrid.js +0 -9
  210. package/dist/ui/jimboTabs.js +0 -22
  211. package/dist/ui/jimboText.js +0 -33
  212. package/dist/ui/jimboTooltip.js +0 -39
  213. package/dist/ui/jimboWordmark.js +0 -9
  214. package/dist/ui/mascot/JammySpeechBox.js +0 -30
  215. package/dist/ui/mascot/SeedMascot.js +0 -17
  216. package/dist/ui/mascot/index.js +0 -3
  217. package/dist/ui/mascot/menuConfig.js +0 -12
  218. package/dist/ui/panel.js +0 -24
  219. package/dist/ui/radial/RadialBadge.js +0 -43
  220. package/dist/ui/radial/RadialBreadcrumb.js +0 -18
  221. package/dist/ui/radial/RadialButton.js +0 -102
  222. package/dist/ui/radial/RadialMenu.js +0 -168
  223. package/dist/ui/radial/RadialPill.js +0 -15
  224. package/dist/ui/radial/index.js +0 -18
  225. package/dist/ui/radial/radialMenuStore.js +0 -122
  226. package/dist/ui/radial/radialMenuViewport.js +0 -59
  227. package/dist/ui/radial/useRadialMenu.js +0 -107
  228. package/dist/ui/showcase.js +0 -20
  229. package/dist/ui/sprites.js +0 -77
  230. package/dist/ui/tokens.js +0 -64
  231. package/dist/utils/gameCardUtils.js +0 -15
  232. package/dist/utils/jamlMapPreview.js +0 -106
  233. package/dist/utils/jamlVisualFilter.js +0 -210
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { Header } from './Header';
4
- import './page.css';
5
- export const Page = () => {
6
- const [user, setUser] = React.useState();
7
- return (_jsxs("article", { children: [_jsx(Header, { user: user, onLogin: () => setUser({ name: 'Jane Doe' }), onLogout: () => setUser(undefined), onCreateAccount: () => setUser({ name: 'Jane Doe' }) }), _jsxs("section", { className: "storybook-page", children: [_jsx("h2", { children: "Pages in Storybook" }), _jsxs("p", { children: ["We recommend building UIs with a", ' ', _jsx("a", { href: "https://componentdriven.org", target: "_blank", rel: "noopener noreferrer", children: _jsx("strong", { children: "component-driven" }) }), ' ', "process starting with atomic components and ending with pages."] }), _jsx("p", { children: "Render pages with mock data. This makes it easy to build and review page states without needing to navigate to them in your app. Here are some handy patterns for managing page data in Storybook:" }), _jsxs("ul", { children: [_jsx("li", { children: "Use a higher-level connected component. Storybook helps you compose such data from the \"args\" of child component stories" }), _jsx("li", { children: "Assemble data in the page component from your services. You can mock these services out using Storybook." })] }), _jsxs("p", { children: ["Get a guided tutorial on component-driven development at", ' ', _jsx("a", { href: "https://storybook.js.org/tutorials/", target: "_blank", rel: "noopener noreferrer", children: "Storybook tutorials" }), ". Read more in the", ' ', _jsx("a", { href: "https://storybook.js.org/docs", target: "_blank", rel: "noopener noreferrer", children: "docs" }), "."] }), _jsxs("div", { className: "tip-wrapper", children: [_jsx("span", { className: "tip", children: "Tip" }), " Adjust the width of the canvas with the", ' ', _jsx("svg", { width: "10", height: "10", viewBox: "0 0 12 12", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { fill: "none", fillRule: "evenodd", children: _jsx("path", { d: "M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z", id: "a", fill: "#999" }) }) }), "Viewports addon in the toolbar"] })] })] }));
8
- };
@@ -1,12 +0,0 @@
1
- import type { StoryObj } from '@storybook/react-vite';
2
- declare const meta: {
3
- title: string;
4
- component: import("react").FC<{}>;
5
- parameters: {
6
- layout: string;
7
- };
8
- };
9
- export default meta;
10
- type Story = StoryObj<typeof meta>;
11
- export declare const LoggedOut: Story;
12
- export declare const LoggedIn: Story;
@@ -1,24 +0,0 @@
1
- import { expect, userEvent, within } from 'storybook/test';
2
- import { Page } from './Page';
3
- const meta = {
4
- title: 'Example/Page',
5
- component: Page,
6
- parameters: {
7
- // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
8
- layout: 'fullscreen',
9
- },
10
- };
11
- export default meta;
12
- export const LoggedOut = {};
13
- // More on component testing: https://storybook.js.org/docs/writing-tests/interaction-testing
14
- export const LoggedIn = {
15
- play: async ({ canvasElement }) => {
16
- const canvas = within(canvasElement);
17
- const loginButton = canvas.getByRole('button', { name: /Log in/i });
18
- await expect(loginButton).toBeInTheDocument();
19
- await userEvent.click(loginButton);
20
- await expect(loginButton).not.toBeInTheDocument();
21
- const logoutButton = canvas.getByRole('button', { name: /Log out/i });
22
- await expect(logoutButton).toBeInTheDocument();
23
- },
24
- };
@@ -1,7 +0,0 @@
1
- import type { StoryObj } from '@storybook/react';
2
- import "./jimbo.css";
3
- declare const meta: Meta;
4
- export default meta;
5
- export declare const Typography: StoryObj;
6
- export declare const Buttons: StoryObj;
7
- export declare const Modal: StoryObj;
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { JimboButton, JimboText, JimboModalRoot, useJimboModal } from './index';
3
- import "./jimbo.css";
4
- const meta = {
5
- title: 'JimboUI/Core',
6
- parameters: {
7
- layout: 'centered',
8
- },
9
- };
10
- export default meta;
11
- export const Typography = {
12
- render: () => (_jsxs("div", { className: "j-panel", style: { display: "flex", flexDirection: "column", gap: 10, padding: 20 }, children: [_jsx(JimboText, { size: "title", tone: "white", children: "Title Text" }), _jsx(JimboText, { size: "header", tone: "gold", children: "Header Text (Gold)" }), _jsx(JimboText, { size: "lg", tone: "white", children: "Large Text" }), _jsx(JimboText, { size: "md", tone: "grey", children: "Medium Text (Grey)" }), _jsx(JimboText, { size: "sm", tone: "blue", children: "Small Text (Blue)" }), _jsx(JimboText, { size: "xs", tone: "red", children: "Extra Small (Red)" }), _jsx(JimboText, { size: "micro", tone: "tarot", children: "Micro Text (Tarot)" })] })),
13
- };
14
- export const Buttons = {
15
- render: () => (_jsxs("div", { className: "j-panel", style: { display: "flex", flexDirection: "column", gap: 10, padding: 20, width: 300 }, children: [_jsx(JimboButton, { tone: "gold", size: "lg", children: "Large Gold Button" }), _jsx(JimboButton, { tone: "blue", size: "md", children: "Medium Blue Button" }), _jsx(JimboButton, { tone: "red", size: "sm", children: "Small Red Button" }), _jsx(JimboButton, { tone: "grey", size: "xs", children: "XS Grey Button" }), _jsxs("div", { style: { display: "flex", gap: 10 }, children: [_jsx(JimboButton, { tone: "tarot", size: "md", style: { flex: 1 }, children: "Flex 1" }), _jsx(JimboButton, { tone: "planet", size: "md", style: { flex: 1 }, children: "Flex 2" })] })] })),
16
- };
17
- const ModalDemo = () => {
18
- const { openModal, closeModal } = useJimboModal();
19
- return (_jsxs("div", { className: "j-panel", style: { padding: 20, textAlign: "center" }, children: [_jsx(JimboText, { size: "lg", tone: "white", children: "Modal Testing" }), _jsx("div", { style: { height: 20 } }), _jsx(JimboButton, { tone: "gold", size: "md", onClick: () => {
20
- openModal("demo-modal", (_jsxs("div", { style: { padding: 20 }, children: [_jsx(JimboText, { size: "md", tone: "white", children: "This is a JimboModal!" }), _jsx("div", { style: { height: 20 } }), _jsx(JimboButton, { tone: "red", size: "sm", onClick: () => closeModal(), children: "Close" })] })));
21
- }, children: "Open Modal" })] }));
22
- };
23
- export const Modal = {
24
- decorators: [
25
- (Story) => (_jsxs("div", { style: { width: 375, height: 600, border: "1px solid #333", position: "relative", overflow: "hidden" }, children: [_jsx(Story, {}), _jsx(JimboModalRoot, {})] }))
26
- ],
27
- render: () => _jsx(ModalDemo, {})
28
- };
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * Small colored label pill. Matches Balatro's in-game tag/rarity badges.
4
- * All styling via jimbo.css `.j-badge` classes.
5
- */
6
- export function JimboBadge({ size = 'sm', tone = 'dark', className, children }) {
7
- return (_jsx("span", { className: `j-badge j-badge--${size} j-badge--${tone} ${className ?? ''}`, children: children }));
8
- }
@@ -1,17 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- export function JimboFloating({ anchor = 'top-right', offset = 12, zIndex = 20, children }) {
3
- const pos = { position: 'absolute', zIndex };
4
- if (anchor.includes('top'))
5
- pos.top = offset;
6
- if (anchor.includes('bottom'))
7
- pos.bottom = offset;
8
- if (anchor.includes('left'))
9
- pos.left = offset;
10
- if (anchor.includes('right'))
11
- pos.right = offset;
12
- if (anchor.includes('center')) {
13
- pos.left = '50%';
14
- pos.transform = 'translateX(-50%)';
15
- }
16
- return (_jsx("div", { style: pos, children: children }));
17
- }
@@ -1,28 +0,0 @@
1
- // PORTABLE — intended for jaml-ui/src/ui/jimboIconButton.tsx
2
- // On paste, replace `from 'jaml-ui'` with `from './tokens.js'`.
3
- "use client";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { JimboColorOption } from "./tokens.js";
6
- import { useState } from "react";
7
- const C = JimboColorOption;
8
- export function JimboIconButton({ onClick, title, "aria-label": ariaLabel, disabled = false, size = "md", children, }) {
9
- const [hover, setHover] = useState(false);
10
- const side = size === "sm" ? 26 : 30;
11
- return (_jsx("button", { "aria-label": ariaLabel ?? title, disabled: disabled, onClick: () => !disabled && onClick?.(), onMouseEnter: () => setHover(true), onMouseLeave: () => setHover(false), style: {
12
- width: side,
13
- height: side,
14
- display: "inline-flex",
15
- alignItems: "center",
16
- justifyContent: "center",
17
- background: hover && !disabled ? C.DARK_GREY : C.DARKEST,
18
- color: C.WHITE,
19
- border: `1px solid ${C.PANEL_EDGE}`,
20
- borderRadius: 4,
21
- cursor: disabled ? "not-allowed" : "pointer",
22
- opacity: disabled ? 0.55 : 1,
23
- padding: 0,
24
- fontSize: 14,
25
- lineHeight: 1,
26
- transition: "background 80ms ease",
27
- }, title: title, type: "button", children: children }));
28
- }
@@ -1,66 +0,0 @@
1
- // PORTABLE — intended for jaml-ui/src/ui/jimboInputModal.tsx
2
- // On paste, replace `from 'jaml-ui'` with `from './panel.js'`/`./tokens.js` as appropriate.
3
- "use client";
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- import { JimboButton, JimboModal } from "./panel.js";
6
- import { JimboColorOption } from "./tokens.js";
7
- import { JimboText } from "./jimboText.js";
8
- import { useEffect, useRef, useState } from "react";
9
- const C = JimboColorOption;
10
- export function JimboInputModal({ open, title, message, placeholder, initialValue = "", confirmLabel = "Confirm", cancelLabel = "Cancel", validate, onConfirm, onCancel, }) {
11
- const [value, setValue] = useState(initialValue);
12
- const [error, setError] = useState(null);
13
- const inputRef = useRef(null);
14
- const [prevOpen, setPrevOpen] = useState(open);
15
- if (open !== prevOpen) {
16
- setPrevOpen(open);
17
- if (open) {
18
- setValue(initialValue);
19
- setError(null);
20
- }
21
- }
22
- useEffect(() => {
23
- if (open) {
24
- const t = setTimeout(() => inputRef.current?.focus(), 30);
25
- return () => clearTimeout(t);
26
- }
27
- }, [open]);
28
- function submit() {
29
- const err = validate?.(value) ?? null;
30
- if (err) {
31
- setError(err);
32
- return;
33
- }
34
- onConfirm(value);
35
- }
36
- return (_jsxs(JimboModal, { onClose: onCancel, open: open, title: title, children: [message && (_jsx(JimboText, { size: "sm", style: { display: "block", marginBottom: 8 }, tone: "grey", children: message })), _jsx("input", { "aria-invalid": error ? "true" : "false", onChange: (e) => {
37
- setValue(e.target.value);
38
- if (error) {
39
- setError(null);
40
- }
41
- }, onKeyDown: (e) => {
42
- if (e.key === "Enter") {
43
- submit();
44
- }
45
- if (e.key === "Escape") {
46
- onCancel();
47
- }
48
- }, placeholder: placeholder, ref: inputRef, style: {
49
- width: "100%",
50
- padding: "8px 10px",
51
- background: C.DARKEST,
52
- color: C.WHITE,
53
- border: `1px solid ${error ? C.RED : C.PANEL_EDGE}`,
54
- borderRadius: 4,
55
- fontSize: 13,
56
- fontFamily: "m6x11plus, monospace",
57
- letterSpacing: 1,
58
- outline: "none",
59
- boxSizing: "border-box",
60
- }, type: "text", value: value }), error && (_jsx(JimboText, { size: "sm", style: { display: "block", marginTop: 6 }, tone: "red", children: error })), _jsxs("div", { style: {
61
- display: "flex",
62
- justifyContent: "flex-end",
63
- gap: 8,
64
- marginTop: 14,
65
- }, children: [_jsx(JimboButton, { onClick: onCancel, size: "sm", tone: "red", children: cancelLabel }), _jsx(JimboButton, { onClick: submit, size: "sm", tone: "blue", children: confirmLabel })] })] }));
66
- }
@@ -1,43 +0,0 @@
1
- // PORTABLE — intended for jaml-ui/src/ui/jimboSelect.tsx
2
- // On paste, replace `from 'jaml-ui'` with `from './tokens.js'`.
3
- "use client";
4
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- import { JimboColorOption } from "./tokens.js";
6
- const C = JimboColorOption;
7
- export function JimboSelect({ value, options, onChange, placeholder, disabled = false, fullWidth = true, size = "md", style, "aria-label": ariaLabel, }) {
8
- let normalized;
9
- if (options.length === 0) {
10
- normalized = [];
11
- }
12
- else if (typeof options[0] === "string") {
13
- normalized = options.map((v) => ({ value: v }));
14
- }
15
- else {
16
- normalized = options;
17
- }
18
- const pad = size === "sm" ? "4px 8px" : "6px 10px";
19
- const fontSize = size === "sm" ? 11 : 12;
20
- return (_jsxs("select", { "aria-label": ariaLabel, disabled: disabled, onChange: (e) => onChange(e.target.value), style: {
21
- width: fullWidth ? "100%" : undefined,
22
- padding: pad,
23
- background: C.DARKEST,
24
- color: C.WHITE,
25
- border: `1px solid ${C.PANEL_EDGE}`,
26
- borderRadius: 4,
27
- fontSize,
28
- fontFamily: "m6x11plus, monospace",
29
- cursor: disabled ? "not-allowed" : "pointer",
30
- opacity: disabled ? 0.55 : 1,
31
- appearance: "none",
32
- backgroundImage: "linear-gradient(45deg, transparent 50%, " +
33
- C.GOLD_TEXT +
34
- " 50%), linear-gradient(135deg, " +
35
- C.GOLD_TEXT +
36
- " 50%, transparent 50%)",
37
- backgroundPosition: "calc(100% - 12px) 50%, calc(100% - 7px) 50%",
38
- backgroundSize: "5px 5px, 5px 5px",
39
- backgroundRepeat: "no-repeat",
40
- paddingRight: 22,
41
- ...style,
42
- }, value: value, children: [placeholder !== undefined && (_jsx("option", { disabled: true, value: "", children: placeholder })), normalized.map((opt) => (_jsx("option", { disabled: opt.disabled, value: opt.value, children: opt.label ?? opt.value }, opt.value)))] }));
43
- }
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { JimboPanel } from './panel.js';
3
- export function JimboToggleList({ items, onToggle, title }) {
4
- return (_jsx(JimboPanel, { children: _jsxs("div", { className: "j-toggle-list", children: [title && _jsx("div", { className: "j-toggle-list__title", children: title }), items.map(item => (_jsxs("button", { type: "button", className: "j-toggle-item", onClick: () => onToggle(item.id), children: [_jsx("div", { className: "j-toggle-check", "data-on": item.on }), item.label] }, item.id)))] }) }));
5
- }
@@ -1,78 +0,0 @@
1
- // PORTABLE — intended for jaml-ui/src/ui/panelSplitter.tsx
2
- // On paste, replace `from 'jaml-ui'` with `from './tokens.js'`.
3
- "use client";
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- import { JimboColorOption } from "./tokens.js";
6
- import { useCallback, useEffect, useRef, useLayoutEffect } from "react";
7
- const C = JimboColorOption;
8
- export function PanelSplitter({ orientation = "vertical", onDrag, onKeyAdjust, "aria-label": ariaLabel, }) {
9
- const draggingRef = useRef(false);
10
- const lastRef = useRef(0);
11
- const onDragRef = useRef(onDrag);
12
- useLayoutEffect(() => {
13
- onDragRef.current = onDrag;
14
- });
15
- const handlePointerDown = useCallback((e) => {
16
- e.preventDefault();
17
- e.target.setPointerCapture(e.pointerId);
18
- draggingRef.current = true;
19
- lastRef.current = orientation === "vertical" ? e.clientX : e.clientY;
20
- }, [orientation]);
21
- useEffect(() => {
22
- function move(e) {
23
- if (!draggingRef.current) {
24
- return;
25
- }
26
- const cur = orientation === "vertical" ? e.clientX : e.clientY;
27
- const delta = cur - lastRef.current;
28
- if (delta !== 0) {
29
- lastRef.current = cur;
30
- onDragRef.current(delta);
31
- }
32
- }
33
- function up() {
34
- draggingRef.current = false;
35
- }
36
- window.addEventListener("pointermove", move);
37
- window.addEventListener("pointerup", up);
38
- window.addEventListener("pointercancel", up);
39
- return () => {
40
- window.removeEventListener("pointermove", move);
41
- window.removeEventListener("pointerup", up);
42
- window.removeEventListener("pointercancel", up);
43
- };
44
- }, [orientation]);
45
- const step = 16;
46
- const isVertical = orientation === "vertical";
47
- return (_jsx("button", { "aria-label": ariaLabel ?? "Resize panel", onKeyDown: (e) => {
48
- if (!onKeyAdjust) {
49
- return;
50
- }
51
- if (isVertical && e.key === "ArrowLeft") {
52
- onKeyAdjust(-step);
53
- }
54
- if (isVertical && e.key === "ArrowRight") {
55
- onKeyAdjust(step);
56
- }
57
- if (!isVertical && e.key === "ArrowUp") {
58
- onKeyAdjust(-step);
59
- }
60
- if (!isVertical && e.key === "ArrowDown") {
61
- onKeyAdjust(step);
62
- }
63
- }, onPointerDown: handlePointerDown, style: {
64
- all: "unset",
65
- display: "block",
66
- flex: "0 0 auto",
67
- width: isVertical ? 6 : undefined,
68
- height: isVertical ? undefined : 6,
69
- cursor: isVertical ? "col-resize" : "row-resize",
70
- background: C.PANEL_EDGE,
71
- borderLeft: isVertical ? `1px solid ${C.BLACK}` : undefined,
72
- borderRight: isVertical ? `1px solid ${C.BLACK}` : undefined,
73
- borderTop: isVertical ? undefined : `1px solid ${C.BLACK}`,
74
- borderBottom: isVertical ? undefined : `1px solid ${C.BLACK}`,
75
- touchAction: "none",
76
- userSelect: "none",
77
- }, type: "button" }));
78
- }
@@ -1,14 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useState } from 'react';
4
- export function JimboCodeBlock({ code, language, filename, className = '' }) {
5
- const [copied, setCopied] = useState(false);
6
- const copy = () => {
7
- void navigator.clipboard.writeText(code);
8
- setCopied(true);
9
- setTimeout(() => setCopied(false), 2000);
10
- };
11
- return (_jsxs("div", { className: `j-code-block ${className}`, children: [_jsxs("div", { className: "j-code-block__header", children: [_jsxs("div", { className: "j-code-block__meta", children: [filename && _jsx("span", { className: "j-code-block__filename", children: filename }), language && _jsx("span", { className: "j-code-block__lang", children: language })] }), _jsx("button", { onClick: copy, title: "Copy", className: "j-code-block__copy", "data-copied": copied, children: copied
12
- ? _jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) })
13
- : _jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }), _jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }) })] }), _jsx("pre", { className: "j-code-block__pre", children: _jsx("code", { children: code }) })] }));
14
- }
package/dist/ui/footer.js DELETED
@@ -1,20 +0,0 @@
1
- 'use client';
2
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
- const SUITS = [
4
- { char: '♥️', kf: 'jaml-heart' },
5
- { char: '♠️', kf: 'jaml-spade' },
6
- { char: '♦️', kf: 'jaml-diamond' },
7
- { char: '♣️', kf: 'jaml-club' },
8
- ];
9
- /**
10
- * Attribution footer with animated suit cycle.
11
- * All styling via jimbo.css `.j-footer` classes — zero inline styles.
12
- */
13
- export function JimboBalatroFooter({ hidden = false, className = '' }) {
14
- return (_jsxs("div", { className: `j-footer ${hidden ? 'j-footer--hidden' : ''} ${className}`, children: [_jsx("div", { className: "j-footer__bar", children: _jsxs("p", { className: "j-footer__text", children: [_jsxs("span", { children: ["Not affiliated with LocalThunk or PlayStack \u2022", ' '] }), _jsx("a", { href: "https://store.steampowered.com/app/2379780/Balatro/", target: "_blank", rel: "noopener noreferrer", className: "j-footer__link", children: "BUY BALATRO" }), _jsxs("span", { children: [' ', "\u2022 Created with", ' '] }), _jsxs("span", { className: "j-footer__suits", children: [_jsx("span", { className: "j-footer__suit-stage", children: SUITS.map(({ char, kf }) => (_jsx("span", { className: "j-footer__suit-char", style: { animationName: kf }, children: char }, char))) }), ' ', "for the Balatro community"] })] }) }), _jsx("style", { children: `
15
- @keyframes jaml-heart { 0%{opacity:0;transform:scale(1)} 1%{opacity:1;transform:scale(1.45)} 3.5%{opacity:1;transform:scale(1)} 61.5%{opacity:1;transform:scale(1)} 62%{opacity:0} 100%{opacity:0} }
16
- @keyframes jaml-spade { 0%,61.5%{opacity:0} 62%{opacity:1;transform:scale(1.45)} 64.5%{opacity:1;transform:scale(1)} 71.5%{opacity:1} 72%{opacity:0} 100%{opacity:0} }
17
- @keyframes jaml-diamond { 0%,71.5%{opacity:0} 72%{opacity:1;transform:scale(1.45)} 74.5%{opacity:1;transform:scale(1)} 81.5%{opacity:1} 82%{opacity:0} 100%{opacity:0} }
18
- @keyframes jaml-club { 0%,81.5%{opacity:0} 82%{opacity:1;transform:scale(1.45)} 84.5%{opacity:1;transform:scale(1)} 95%{opacity:1} 96%{opacity:0} 100%{opacity:0} }
19
- ` })] }));
20
- }