@mindlogic-ai/logician-ui 4.0.0-alpha.42 → 4.0.0-alpha.44
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/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +14 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/Button.mjs +14 -3
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/Button/Button.styles.js +6 -2
- package/dist/components/Button/Button.styles.js.map +1 -1
- package/dist/components/Button/Button.styles.mjs +6 -2
- package/dist/components/Button/Button.styles.mjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/Checkbox/Checkbox.styles.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.styles.mjs +1 -1
- package/dist/components/Checkbox/Checkbox.styles.mjs.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.d.ts.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.js +4 -1
- package/dist/components/ErrorFallback/ErrorFallback.js.map +1 -1
- package/dist/components/ErrorFallback/ErrorFallback.mjs +4 -1
- package/dist/components/ErrorFallback/ErrorFallback.mjs.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.js +6 -1
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/IconButton/IconButton.mjs +6 -1
- package/dist/components/IconButton/IconButton.mjs.map +1 -1
- package/dist/components/InfoSprinkle/InfoSprinkle.d.ts.map +1 -1
- package/dist/components/InfoSprinkle/InfoSprinkle.js +1 -1
- package/dist/components/InfoSprinkle/InfoSprinkle.js.map +1 -1
- package/dist/components/InfoSprinkle/InfoSprinkle.mjs +1 -1
- package/dist/components/InfoSprinkle/InfoSprinkle.mjs.map +1 -1
- package/dist/components/Loaders/PageLoader.d.ts.map +1 -1
- package/dist/components/Loaders/PageLoader.js +4 -1
- package/dist/components/Loaders/PageLoader.js.map +1 -1
- package/dist/components/Loaders/PageLoader.mjs +4 -1
- package/dist/components/Loaders/PageLoader.mjs.map +1 -1
- package/dist/components/Loaders/SectionLoader.d.ts.map +1 -1
- package/dist/components/Loaders/SectionLoader.js +1 -1
- package/dist/components/Loaders/SectionLoader.js.map +1 -1
- package/dist/components/Loaders/SectionLoader.mjs +1 -1
- package/dist/components/Loaders/SectionLoader.mjs.map +1 -1
- package/dist/components/Menu/MenuItem.d.ts.map +1 -1
- package/dist/components/Menu/MenuItem.js +3 -1
- package/dist/components/Menu/MenuItem.js.map +1 -1
- package/dist/components/Menu/MenuItem.mjs +3 -1
- package/dist/components/Menu/MenuItem.mjs.map +1 -1
- package/dist/components/Menu/MenuList.js +2 -2
- package/dist/components/Menu/MenuList.js.map +1 -1
- package/dist/components/Menu/MenuList.mjs +2 -2
- package/dist/components/Menu/MenuList.mjs.map +1 -1
- package/dist/components/Popover/PopoverContent.js +2 -2
- package/dist/components/Popover/PopoverContent.js.map +1 -1
- package/dist/components/Popover/PopoverContent.mjs +2 -2
- package/dist/components/Popover/PopoverContent.mjs.map +1 -1
- package/dist/components/Select/Combobox.js +1 -1
- package/dist/components/Select/Combobox.js.map +1 -1
- package/dist/components/Select/Combobox.mjs +1 -1
- package/dist/components/Select/Combobox.mjs.map +1 -1
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/Select.mjs +1 -1
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +10 -1
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.mjs +10 -1
- package/dist/components/Tooltip/Tooltip.mjs.map +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.d.ts.map +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.js.map +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs +1 -1
- package/dist/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.mjs.map +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/index.mjs +2 -0
- package/dist/theme/index.mjs.map +1 -1
- package/dist/theme/motion.d.ts +74 -2
- package/dist/theme/motion.d.ts.map +1 -1
- package/dist/theme/motion.js +41 -8
- package/dist/theme/motion.js.map +1 -1
- package/dist/theme/motion.mjs +41 -9
- package/dist/theme/motion.mjs.map +1 -1
- package/dist/theme/recipes/accordion.d.ts +12 -0
- package/dist/theme/recipes/accordion.d.ts.map +1 -0
- package/dist/theme/recipes/accordion.js +25 -0
- package/dist/theme/recipes/accordion.js.map +1 -0
- package/dist/theme/recipes/accordion.mjs +23 -0
- package/dist/theme/recipes/accordion.mjs.map +1 -0
- package/dist/utils/focusRing.d.ts +7 -6
- package/dist/utils/focusRing.d.ts.map +1 -1
- package/dist/utils/focusRing.js +7 -4
- package/dist/utils/focusRing.js.map +1 -1
- package/dist/utils/focusRing.mjs +7 -4
- package/dist/utils/focusRing.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.presence.test.tsx +54 -0
- package/src/components/Button/Button.cursor.test.tsx +60 -0
- package/src/components/Button/Button.styles.ts +6 -2
- package/src/components/Button/Button.tsx +18 -3
- package/src/components/Checkbox/Checkbox.styles.ts +1 -1
- package/src/components/Collapsible/Collapsible.presence.test.tsx +2 -2
- package/src/components/ErrorFallback/ErrorFallback.tsx +3 -1
- package/src/components/IconButton/IconButton.tsx +7 -0
- package/src/components/InfoSprinkle/InfoSprinkle.tsx +0 -1
- package/src/components/Loaders/PageLoader.tsx +5 -2
- package/src/components/Loaders/SectionLoader.tsx +2 -1
- package/src/components/Menu/MenuItem.tsx +2 -0
- package/src/components/Menu/MenuList.tsx +2 -2
- package/src/components/Popover/PopoverContent.tsx +2 -2
- package/src/components/Select/Combobox.tsx +1 -1
- package/src/components/Select/Select.tsx +1 -1
- package/src/components/Tooltip/Tooltip.instant.test.tsx +43 -0
- package/src/components/Tooltip/Tooltip.tsx +11 -2
- package/src/components/Workflow/canvas/GraphErrorBanner/GraphErrorBanner.tsx +6 -3
- package/src/theme/Motion.stories.tsx +16 -10
- package/src/theme/animationStyles.test.ts +25 -9
- package/src/theme/claude.md +4 -2
- package/src/theme/index.ts +2 -0
- package/src/theme/motion.ts +43 -9
- package/src/theme/motionGuards.test.ts +2 -0
- package/src/theme/recipes/accordion.ts +20 -0
- package/src/utils/focusRing.ts +7 -4
package/src/theme/motion.ts
CHANGED
|
@@ -175,7 +175,8 @@ const REDUCED = { _motionReduce: { transitionDuration: 'motion.instant' } };
|
|
|
175
175
|
* most of the distance early and settles. An exit has already been decided:
|
|
176
176
|
* the reader dismissed the thing and is looking at what is behind it, so every
|
|
177
177
|
* millisecond the leaving element still owns the screen is a millisecond of
|
|
178
|
-
* waiting. Half the time, on the
|
|
178
|
+
* waiting. Half the time, on the same ease-out — a symmetric curve would
|
|
179
|
+
* start the exit slowly, which is the one place a dismissal must not lag.
|
|
179
180
|
*
|
|
180
181
|
* Only the *clock* is here, never `animation-name`. Each Chakra recipe already
|
|
181
182
|
* names the right movement for its part — the menu slides from its trigger,
|
|
@@ -192,14 +193,14 @@ const REDUCED = { _motionReduce: { transitionDuration: 'motion.instant' } };
|
|
|
192
193
|
* at all reads as a page swap. The movement is what has to go, not the fact
|
|
193
194
|
* that something changed.
|
|
194
195
|
*/
|
|
195
|
-
const PRESENCE_TIMING = {
|
|
196
|
+
export const PRESENCE_TIMING = {
|
|
196
197
|
_open: {
|
|
197
198
|
animationDuration: 'motion.base',
|
|
198
199
|
animationTimingFunction: 'emphasized',
|
|
199
200
|
},
|
|
200
201
|
_closed: {
|
|
201
202
|
animationDuration: 'fast',
|
|
202
|
-
animationTimingFunction: '
|
|
203
|
+
animationTimingFunction: 'emphasized',
|
|
203
204
|
},
|
|
204
205
|
_motionReduce: {
|
|
205
206
|
_open: { animationName: 'fade-in' },
|
|
@@ -207,6 +208,27 @@ const PRESENCE_TIMING = {
|
|
|
207
208
|
},
|
|
208
209
|
} as const;
|
|
209
210
|
|
|
211
|
+
/**
|
|
212
|
+
* The same policy, on a shorter clock, for parts anchored to a trigger —
|
|
213
|
+
* Menu, Select, Combobox, Popover, Tooltip.
|
|
214
|
+
*
|
|
215
|
+
* These open tens of times a day, under a pointer that is already on its way
|
|
216
|
+
* to the first item, so the enter has much less to be read than a dialog does:
|
|
217
|
+
* the reader asked for it and knows where it will appear. 300ms there is twice
|
|
218
|
+
* Chakra's stock 150ms and feels like waiting; 200ms keeps a visible slide from
|
|
219
|
+
* the trigger and finishes before the pointer arrives. The exit keeps the
|
|
220
|
+
* half-the-enter ratio. Curves and the reduced-motion fade come from
|
|
221
|
+
* {@link PRESENCE_TIMING}, so the two cannot drift apart.
|
|
222
|
+
*
|
|
223
|
+
* Modal, BottomSheet and Collapsible stay on the full `presence` clock — they
|
|
224
|
+
* move more of the screen and are not anchored to anything.
|
|
225
|
+
*/
|
|
226
|
+
const ANCHORED_PRESENCE_TIMING = {
|
|
227
|
+
...PRESENCE_TIMING,
|
|
228
|
+
_open: { ...PRESENCE_TIMING._open, animationDuration: 'moderate' },
|
|
229
|
+
_closed: { ...PRESENCE_TIMING._closed, animationDuration: 'faster' },
|
|
230
|
+
} as const;
|
|
231
|
+
|
|
210
232
|
/**
|
|
211
233
|
* Dash length for the `checkmark-draw` keyframe. Declared once so the pattern
|
|
212
234
|
* the tick is hidden behind and the offset the keyframe animates away are the
|
|
@@ -239,7 +261,9 @@ export const animationStyles = {
|
|
|
239
261
|
// The one preset with a real default: a press is a scale, always.
|
|
240
262
|
transitionProperty: 'scale',
|
|
241
263
|
transitionDuration: 'motion.press',
|
|
242
|
-
|
|
264
|
+
// Ease-out, not `standard`: `standard` starts slowly, so the first frames
|
|
265
|
+
// of the press lag behind the finger.
|
|
266
|
+
transitionTimingFunction: 'emphasized',
|
|
243
267
|
...REDUCED,
|
|
244
268
|
},
|
|
245
269
|
},
|
|
@@ -300,6 +324,15 @@ export const animationStyles = {
|
|
|
300
324
|
value: { ...PRESENCE_TIMING },
|
|
301
325
|
},
|
|
302
326
|
|
|
327
|
+
/**
|
|
328
|
+
* `presence` for a part anchored to its trigger — menu, select, combobox,
|
|
329
|
+
* popover and tooltip content. 200ms in, 100ms out; see
|
|
330
|
+
* {@link ANCHORED_PRESENCE_TIMING}.
|
|
331
|
+
*/
|
|
332
|
+
'presence-anchored': {
|
|
333
|
+
value: { ...ANCHORED_PRESENCE_TIMING },
|
|
334
|
+
},
|
|
335
|
+
|
|
303
336
|
/**
|
|
304
337
|
* List items arriving one after another instead of all at once.
|
|
305
338
|
*
|
|
@@ -365,12 +398,13 @@ export const keyframes = {
|
|
|
365
398
|
from: { opacity: '1', scale: '1' },
|
|
366
399
|
to: { opacity: '0', scale: '0.97' },
|
|
367
400
|
},
|
|
368
|
-
// The dot only mounts on check
|
|
369
|
-
//
|
|
370
|
-
//
|
|
401
|
+
// The dot only mounts on check. It starts small and transparent rather than
|
|
402
|
+
// at `scale: 0` — nothing real appears from nothing, and a dot growing from a
|
|
403
|
+
// point reads as a glitch. `0.4` is where Chakra's radiomark recipe rests it;
|
|
404
|
+
// ending anywhere else would make the dot jump when the animation hands back.
|
|
371
405
|
'dot-pop': {
|
|
372
|
-
from: { scale: '0' },
|
|
373
|
-
to: { scale: '0.4' },
|
|
406
|
+
from: { scale: '0.25', opacity: '0' },
|
|
407
|
+
to: { scale: '0.4', opacity: '1' },
|
|
374
408
|
},
|
|
375
409
|
'checkmark-draw': {
|
|
376
410
|
// Negative, not positive. Chakra's polyline runs `20 6 → 9 17 → 4 12`, so
|
|
@@ -37,6 +37,7 @@ const CASES = {
|
|
|
37
37
|
// The two presets that carry their own scope and must not be asked for one.
|
|
38
38
|
pressNeedsNoScope: `<div animationStyle="press" />`,
|
|
39
39
|
presenceNeedsNoScope: `<div animationStyle="presence" />`,
|
|
40
|
+
anchoredNeedsNoScope: `<div animationStyle="presence-anchored" />`,
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
type Case = keyof typeof CASES;
|
|
@@ -126,6 +127,7 @@ describe('the scope guard', () => {
|
|
|
126
127
|
it.each([
|
|
127
128
|
['press', 'pressNeedsNoScope'],
|
|
128
129
|
['presence', 'presenceNeedsNoScope'],
|
|
130
|
+
['presence-anchored', 'anchoredNeedsNoScope'],
|
|
129
131
|
] as const)('leaves %s alone, since it carries its own scope', (_n, key) => {
|
|
130
132
|
// press defaults to `scale`; presence is an `animation-*` preset and its
|
|
131
133
|
// keyframe already names what moves. Asking either for a property would
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineSlotRecipe } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
import { PRESENCE_TIMING } from '../motion';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Logician overrides for Chakra's `accordion` slot recipe.
|
|
7
|
+
*
|
|
8
|
+
* Only the clock. Chakra opens and closes the item content over a symmetric
|
|
9
|
+
* 200 / 200, while `Collapsible` — the same height animation — already runs on
|
|
10
|
+
* the house `presence` policy (300 in, 150 out). Consumers render
|
|
11
|
+
* `Accordion.ItemContent` straight from Chakra, so a component prop cannot
|
|
12
|
+
* reach it; the recipe can. The recipe's own `expand-height` /
|
|
13
|
+
* `collapse-height` names are untouched and still decide what moves.
|
|
14
|
+
*/
|
|
15
|
+
export const accordionSlotRecipe = defineSlotRecipe({
|
|
16
|
+
slots: ['itemContent'],
|
|
17
|
+
base: {
|
|
18
|
+
itemContent: { ...PRESENCE_TIMING },
|
|
19
|
+
},
|
|
20
|
+
});
|
package/src/utils/focusRing.ts
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
* Standard focus ring styles for interactive components.
|
|
3
3
|
*
|
|
4
4
|
* - _focus: suppresses the browser's default outline on all focus events (including mouse)
|
|
5
|
-
* - _focusVisible: shows the ring only on keyboard focus (CSS :focus-visible)
|
|
6
|
-
*
|
|
5
|
+
* - _focusVisible: shows the ring only on keyboard focus (CSS :focus-visible)
|
|
6
|
+
*
|
|
7
|
+
* No transition, on purpose. The ring answers a key press, and keyboard
|
|
8
|
+
* actions should land instantly — Tab is pressed hundreds of times a day. It
|
|
9
|
+
* also used to be a `transition` *shorthand* under `:focus-visible`, which
|
|
10
|
+
* replaced the element's whole transition list while focused, so a
|
|
11
|
+
* keyboard-focused Switch or Checkbox snapped its fill instead of fading it.
|
|
7
12
|
*/
|
|
8
13
|
export const focusRing = {
|
|
9
14
|
_focus: { outline: 'none' },
|
|
@@ -11,7 +16,5 @@ export const focusRing = {
|
|
|
11
16
|
outline: 'none',
|
|
12
17
|
boxShadow:
|
|
13
18
|
'rgb(255, 255, 255) 0px 0px 0px 2px, var(--chakra-colors-primary-main) 0px 0px 0px 4px',
|
|
14
|
-
transition: 'box-shadow 0.15s ease-out',
|
|
15
|
-
_motionReduce: { transition: 'none' },
|
|
16
19
|
},
|
|
17
20
|
} as const;
|