jaml-ui 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets.d.ts +0 -5
- package/dist/assets.js +0 -7
- package/dist/components/JamlCurator.d.ts +1 -2
- package/dist/components/JamlCurator.js +2 -2
- package/dist/hooks/searchWorker.d.ts +1 -0
- package/dist/hooks/searchWorker.js +68 -0
- package/dist/hooks/useSearch.d.ts +1 -1
- package/dist/hooks/useSearch.js +8 -13
- package/dist/render/CanvasRenderer.js +2 -2
- package/dist/ui/hooks.d.ts +13 -0
- package/dist/ui/hooks.js +44 -0
- package/dist/ui/jimbo.css +1092 -1086
- package/dist/ui/panel.d.ts +1 -1
- package/dist/ui/panel.js +7 -6
- package/package.json +1 -1
package/dist/ui/panel.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const JimboPanel: React.MemoExoticComponent<({ children, classNam
|
|
|
8
8
|
export interface JimboInnerPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
9
|
}
|
|
10
10
|
export declare const JimboInnerPanel: React.MemoExoticComponent<({ children, className, style, ...props }: JimboInnerPanelProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
-
export type JimboTone = 'orange' | 'red' | 'blue' | 'green' | '
|
|
11
|
+
export type JimboTone = 'orange' | 'red' | 'blue' | 'green' | 'tarot' | 'planet' | 'spectral' | 'grey' | 'gold';
|
|
12
12
|
export interface JimboButtonProps {
|
|
13
13
|
tone?: JimboTone;
|
|
14
14
|
size?: 'xs' | 'sm' | 'md' | 'lg';
|
package/dist/ui/panel.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState, memo } from 'react';
|
|
4
4
|
import { JimboColorOption } from './tokens.js';
|
|
5
|
-
import { useSway } from './hooks.js';
|
|
5
|
+
import { useSway, useDOMMagneticTilt } from './hooks.js';
|
|
6
6
|
import { JimboText } from './jimboText.js';
|
|
7
7
|
export const JimboPanel = memo(({ children, className = '', sway = false, onBack, hideBack = false, style, ...props }) => {
|
|
8
8
|
const panelRef = useSway(sway);
|
|
@@ -20,20 +20,21 @@ const JIMBO_TONE_PAIRS = {
|
|
|
20
20
|
red: [JimboColorOption.RED, JimboColorOption.DARK_RED],
|
|
21
21
|
blue: [JimboColorOption.BLUE, JimboColorOption.DARK_BLUE],
|
|
22
22
|
green: [JimboColorOption.GREEN, JimboColorOption.DARK_GREEN],
|
|
23
|
-
gold: [JimboColorOption.GOLD, '#8a6a1e'],
|
|
24
|
-
grey: [JimboColorOption.DARK_GREY, JimboColorOption.DARKEST],
|
|
25
23
|
tarot: ['#9e74ce', '#5e437e'],
|
|
26
24
|
planet: ['#00a7ca', '#00657c'],
|
|
27
25
|
spectral: ['#2e76fd', '#14449e'],
|
|
26
|
+
grey: ['#888888', '#555555'],
|
|
27
|
+
gold: ['#f1c40f', '#d35400'],
|
|
28
28
|
};
|
|
29
29
|
export function JimboButton({ tone = 'orange', size = 'md', fullWidth = false, disabled = false, uppercase = false, onClick, style, className = '', children, }) {
|
|
30
30
|
const [pressed, setPressed] = useState(false);
|
|
31
31
|
const [fg, sh] = JIMBO_TONE_PAIRS[tone] ?? JIMBO_TONE_PAIRS.orange;
|
|
32
32
|
const textSize = size === 'xs' ? 'xs' : size === 'sm' ? 'sm' : size === 'lg' ? 'lg' : 'md';
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
const { handlers, tiltStyle } = useDOMMagneticTilt(!disabled);
|
|
34
|
+
return (_jsx("div", { className: `j-btn j-btn--${tone} j-btn--${size} ${fullWidth ? 'j-btn--full' : ''} ${disabled ? 'j-btn--disabled' : ''} ${className}`, "data-pressed": pressed, onMouseDown: () => { if (!disabled)
|
|
35
|
+
setPressed(true); }, onMouseUp: () => setPressed(false), onMouseLeave: (e) => { setPressed(false); handlers.onPointerLeave?.(); }, onTouchStart: () => { if (!disabled)
|
|
35
36
|
setPressed(true); }, onTouchEnd: () => setPressed(false), onClick: () => { if (!disabled)
|
|
36
|
-
onClick?.(); }, style: style, children: [_jsx("div", { className: "j-btn__shadow", style: { background: sh } }), _jsx("div", { className: "j-btn__face", style: { background: fg }, children: _jsx(JimboText, { size: textSize, uppercase: uppercase, children: children }) })] }));
|
|
37
|
+
onClick?.(); }, onPointerEnter: handlers.onPointerEnter, onPointerMove: handlers.onPointerMove, style: style, children: _jsxs("div", { style: { ...tiltStyle, width: '100%' }, children: [_jsx("div", { className: "j-btn__shadow", style: { background: sh } }), _jsx("div", { className: "j-btn__face", style: { background: fg }, children: _jsx(JimboText, { size: textSize, uppercase: uppercase, children: children }) })] }) }));
|
|
37
38
|
}
|
|
38
39
|
export function JimboBackButton({ onClick }) {
|
|
39
40
|
return (_jsx("div", { className: "j-flex j-justify-center j-w-full", style: { padding: '4px 0' }, children: _jsx(JimboButton, { tone: "orange", size: "md", fullWidth: true, onClick: onClick, children: "Back" }) }));
|