@astryxdesign/core 0.7.8-canary.c1a2cae → 0.7.8-canary.c1ff98e
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/Item/Item.d.ts +1 -2
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +3 -8
- package/dist/RadioList/RadioListItem.d.ts.map +1 -1
- package/dist/RadioList/RadioListItem.js +1 -4
- package/dist/TreeList/TreeListItem.d.ts +1 -2
- package/dist/TreeList/TreeListItem.d.ts.map +1 -1
- package/dist/TreeList/TreeListItem.js +2 -7
- package/dist/astryx.css +0 -19
- package/dist/utils/interactionOverlay.stylex.d.ts +1 -2
- package/dist/utils/interactionOverlay.stylex.d.ts.map +1 -1
- package/dist/utils/interactionOverlay.stylex.js +2 -7
- package/package.json +4 -4
- package/src/Item/Item.tsx +2 -7
- package/src/RadioList/RadioListItem.tsx +5 -4
- package/src/TreeList/TreeListItem.tsx +1 -7
- package/src/utils/interactionOverlay.stylex.ts +2 -7
- package/dist/privateAttributes/press.stylex.d.ts +0 -139
- package/dist/privateAttributes/press.stylex.d.ts.map +0 -1
- package/dist/privateAttributes/press.stylex.js +0 -98
- package/dist/utils/rowPressLayer.stylex.d.ts +0 -14
- package/dist/utils/rowPressLayer.stylex.d.ts.map +0 -1
- package/dist/utils/rowPressLayer.stylex.js +0 -25
- package/src/privateAttributes/press.stylex.ts +0 -244
- package/src/utils/rowPressLayer.stylex.ts +0 -27
package/dist/Item/Item.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Item.tsx
|
|
3
|
-
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
4
|
-
* the shared press overlays and the compositor press layer
|
|
3
|
+
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
5
4
|
* @output Exports Item component, ItemProps type; publishes the shared inline inset.
|
|
6
5
|
* Only numbered composing rows keep their start/label/end slots in one flex
|
|
7
6
|
* group, through Item's private exact-marker scope; other marked rows keep
|
package/dist/Item/Item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA6B5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AAC1D,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE1E,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wBAAwB;IACxB,OAAO,CAAC,EAAE,sBAAsB,CAAC;IACjC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,WAAW,CAAC;IACvD,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE7B;;;;;;;;;;;OAWG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC;IAE/C;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAE9B;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAE5C;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAErD;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAE5B;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAEhC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAiQD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,EACnB,EAAE,EAAE,SAAiB,EACrB,MAAM,EACN,YAAY,EACZ,KAAK,EACL,WAAW,EACX,UAAU,EACV,KAAgB,EAChB,OAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,MAAkB,EAClB,OAAO,EACP,cAAc,EACd,IAAI,EACJ,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,YAAY,EACjB,aAAqB,EACrB,UAAkB,EAClB,UAAkB,EAClB,YAAY,EACZ,aAAwB,EACxB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,IAAI,EACJ,GAAG,SAAS,EACb,EAAE,SAAS,+BAwWX;yBApYe,IAAI"}
|
package/dist/Item/Item.js
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Item.tsx
|
|
7
|
-
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
8
|
-
* the shared press overlays and the compositor press layer
|
|
7
|
+
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
9
8
|
* @output Exports Item component, ItemProps type; publishes the shared inline inset.
|
|
10
9
|
* Only numbered composing rows keep their start/label/end slots in one flex
|
|
11
10
|
* group, through Item's private exact-marker scope; other marked rows keep
|
|
@@ -47,7 +46,6 @@ import { useDevWarning } from "../hooks/useDevWarning.js";
|
|
|
47
46
|
import { themeProps } from "../utils/themeProps.js";
|
|
48
47
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
49
48
|
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
50
|
-
import { rowPressLayerStyles } from "../privateAttributes/press.stylex.js";
|
|
51
49
|
import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
52
50
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
53
51
|
// The gesture and the panels, loaded only by a row that has swipe actions: a
|
|
@@ -193,6 +191,7 @@ const styles = {
|
|
|
193
191
|
$$css: true
|
|
194
192
|
},
|
|
195
193
|
swipeRoot: {
|
|
194
|
+
kHBbk8: "xc8icb0",
|
|
196
195
|
kFalU9: "xge0x1e",
|
|
197
196
|
k3aq6I: "x1kncwj0",
|
|
198
197
|
k1ekBW: "xuo13n2",
|
|
@@ -535,11 +534,7 @@ export function Item({
|
|
|
535
534
|
...mergeProps(themeProps('item', {
|
|
536
535
|
density,
|
|
537
536
|
align
|
|
538
|
-
}), focusOutlineProps.focusWithin(styles.root, densityStyles[density], align === 'start' && styles.alignStart, align === 'first-line' && styles.alignFirstLine, isInteractive && styles.interactive, isInteractive && interactionOverlayStyles.backgroundColor,
|
|
539
|
-
// The touch press on a compositor layer (after the overlay, whose
|
|
540
|
-
// own touch paint it turns off): the release keeps fading while
|
|
541
|
-
// script runs.
|
|
542
|
-
isInteractive && rowPressLayerStyles.cell, isLinkRoot && styles.linkRoot, isHighlighted && styles.highlighted, isSelected && styles.selected, isDisabled && !hasParentRole && styles.disabled, hasSwipe && styles.swipeRoot, xstyle), className, style),
|
|
537
|
+
}), focusOutlineProps.focusWithin(styles.root, densityStyles[density], align === 'start' && styles.alignStart, align === 'first-line' && styles.alignFirstLine, isInteractive && styles.interactive, isInteractive && interactionOverlayStyles.backgroundColor, isLinkRoot && styles.linkRoot, isHighlighted && styles.highlighted, isSelected && styles.selected, isDisabled && !hasParentRole && styles.disabled, hasSwipe && styles.swipeRoot, xstyle), className, style),
|
|
543
538
|
role: role,
|
|
544
539
|
onClick: rootOnClick,
|
|
545
540
|
children: [/*#__PURE__*/_jsxs(ItemDescriptionContext, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioListItem.d.ts","sourceRoot":"","sources":["../../src/RadioList/RadioListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAqB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAY5C,OAAO,EAAO,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"RadioListItem.d.ts","sourceRoot":"","sources":["../../src/RadioList/RadioListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAqB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAY5C,OAAO,EAAO,KAAK,SAAS,EAAC,MAAM,cAAc,CAAC;AA0IlD,MAAM,WAAW,kBAAmB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACnE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;OAUG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,WAAW,EACX,UAAU,EAAE,cAAsB,EAClC,YAAY,EACZ,UAAU,EACV,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,GAAG,IAAI,EACR,EAAE,kBAAkB,qBAoLpB;yBAnMe,aAAa"}
|
|
@@ -34,7 +34,6 @@ import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
|
34
34
|
import { useIndicator } from "../Indicator/useIndicator.js";
|
|
35
35
|
import { Item } from "../Item/Item.js";
|
|
36
36
|
import { themeProps } from "../utils/themeProps.js";
|
|
37
|
-
import { rowPressLayerStyles } from "../privateAttributes/press.stylex.js";
|
|
38
37
|
|
|
39
38
|
// The touch press's paint, declared by the shared overlay styles on the
|
|
40
39
|
// element the controller writes to (`pressedAlpha`) at the press's strength,
|
|
@@ -105,6 +104,7 @@ const rowStyles = {
|
|
|
105
104
|
kaIpWk: "x2u8bby",
|
|
106
105
|
k7Eaqz: "xeuugli",
|
|
107
106
|
kWkggS: "xjbqb8w",
|
|
107
|
+
kKwaWg: "x18o3ruo",
|
|
108
108
|
$$css: true
|
|
109
109
|
},
|
|
110
110
|
press: {
|
|
@@ -276,9 +276,6 @@ export function RadioListItem({
|
|
|
276
276
|
// the painting row element (Item), the same element that carries the
|
|
277
277
|
// theme target, so a theme's hover styling stays in step with the tint.
|
|
278
278
|
!isDisabled && indicatorScope,
|
|
279
|
-
// The row keeps no press paint of its own: the circle paints, and
|
|
280
|
-
// reads the strength whose release the row keeps.
|
|
281
|
-
rowPressLayerStyles.cellWithoutLayer,
|
|
282
279
|
// Restore the bare default look: zero Item's padding/radius and its
|
|
283
280
|
// interactive hover/press background. Applied after Item's own base
|
|
284
281
|
// styles so it wins within the base layer; a `radio-list-item` theme
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file TreeListItem.tsx
|
|
3
|
-
* @input Uses React, StyleX, theme tokens, TreeListBranches
|
|
4
|
-
* overlays and the compositor press layer
|
|
3
|
+
* @input Uses React, StyleX, theme tokens, TreeListBranches
|
|
5
4
|
* @output Exports TreeListItem component (internal, not publicly exported)
|
|
6
5
|
* @position Internal implementation; consumed by TreeList.tsx
|
|
7
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeListItem.d.ts","sourceRoot":"","sources":["../../src/TreeList/TreeListItem.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"TreeListItem.d.ts","sourceRoot":"","sources":["../../src/TreeList/TreeListItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,EAAyB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE7D,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAqB3C,OAAO,KAAK,EAAC,eAAe,EAAE,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAgStE,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;;OAQG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,OAAO,EAAE,eAAe,CAAC;IACzB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,EAAE,OAAO,CAAC;CACrB;AASD,wBAAgB,YAAY,CAAC,EAC3B,EAAE,EACF,KAAK,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,IAAI,EACJ,MAAM,EACN,UAAkB,EAClB,UAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,MAAM,EACN,eAAe,EACf,UAAU,EACV,SAAiB,EACjB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,UAAU,GACX,EAAE,yBAAyB,+BA0U3B;yBAtWe,YAAY"}
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file TreeListItem.tsx
|
|
7
|
-
* @input Uses React, StyleX, theme tokens, TreeListBranches
|
|
8
|
-
* overlays and the compositor press layer
|
|
7
|
+
* @input Uses React, StyleX, theme tokens, TreeListBranches
|
|
9
8
|
* @output Exports TreeListItem component (internal, not publicly exported)
|
|
10
9
|
* @position Internal implementation; consumed by TreeList.tsx
|
|
11
10
|
*
|
|
@@ -21,7 +20,6 @@ import "../theme/tokens.stylex.js";
|
|
|
21
20
|
import { colorVars, radiusVars, spacingVars, durationVars, easeVars, typeScaleVars } from "../theme/tokens.stylex.js";
|
|
22
21
|
import { focusOutlineProps } from "../utils/focusOutline.stylex.js";
|
|
23
22
|
import { interactionOverlayStyles } from "../utils/interactionOverlay.stylex.js";
|
|
24
|
-
import { rowPressLayerStyles } from "../privateAttributes/press.stylex.js";
|
|
25
23
|
import { usePressFeedback } from "../hooks/usePressFeedback.js";
|
|
26
24
|
import { hasInteractiveAncestor, useClickableContainer } from "../hooks/useClickableContainer.js";
|
|
27
25
|
import { Icon } from "../Icon/index.js";
|
|
@@ -466,10 +464,7 @@ export function TreeListItem({
|
|
|
466
464
|
density,
|
|
467
465
|
selected: isSelected ? 'selected' : null,
|
|
468
466
|
disabled: isDisabled ? 'disabled' : null
|
|
469
|
-
}), isInteractive || hasChildren && onClick == null ? focusOutlineProps.focusWithinOrPublished(styles.contentWrapper, styles.focusLift, densityStyles[density], styles.interactive, interactionOverlayStyles.backgroundImage,
|
|
470
|
-
// The touch press on a compositor layer (after the
|
|
471
|
-
// overlay, whose own touch paint it turns off).
|
|
472
|
-
rowPressLayerStyles.cell, rowPressLayerStyles.cellOnImage, isDisabled && styles.disabled, isSelected && styles.selected, xstyle) : stylex.props(styles.contentWrapper, densityStyles[density], isDisabled && styles.disabled, isSelected && styles.selected, xstyle),
|
|
467
|
+
}), isInteractive || hasChildren && onClick == null ? focusOutlineProps.focusWithinOrPublished(styles.contentWrapper, styles.focusLift, densityStyles[density], styles.interactive, interactionOverlayStyles.backgroundImage, isDisabled && styles.disabled, isSelected && styles.selected, xstyle) : stylex.props(styles.contentWrapper, densityStyles[density], isDisabled && styles.disabled, isSelected && styles.selected, xstyle),
|
|
473
468
|
// Consumer row props are merged last so useContainerReveal can
|
|
474
469
|
// publish both its classes and inline custom properties. Seed the
|
|
475
470
|
// private indent first, then preserve the standard inline-style
|
package/dist/astryx.css
CHANGED
|
@@ -1833,8 +1833,6 @@
|
|
|
1833
1833
|
@media (hover: hover){.x7jm8ul.x7jm8ul.x7jm8ul:hover:where(:not(:disabled,[aria-disabled="true"])):not(#\#):not(#\#):not(#\#){color:color-mix(in srgb,var(--color-text-secondary),var(--color-tint-hover) 15%)}}
|
|
1834
1834
|
@media (hover: hover){.x10ue8fs.x10ue8fs.x10ue8fs:hover:where(:not(:disabled,[aria-disabled="true"])):not(#\#):not(#\#):not(#\#){color:var(--color-icon-primary)}}
|
|
1835
1835
|
@media (hover: hover){.xo5jvnm.xo5jvnm.xo5jvnm:hover:where(:not(:disabled,[aria-disabled="true"])):not(#\#):not(#\#):not(#\#){color:var(--color-text-primary)}}
|
|
1836
|
-
@media (pointer: coarse){.xrqzsdu.xrqzsdu:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#){isolation:auto}}
|
|
1837
|
-
@media (pointer: coarse){.xif6eam.xif6eam:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#){isolation:isolate}}
|
|
1838
1836
|
@media (pointer: coarse){.x1pxz8w1.x1pxz8w1:is([dir="rtl"] *):not(#\#):not(#\#):not(#\#){transform:none}}
|
|
1839
1837
|
@media (pointer: coarse){.xom6oz5.xom6oz5.xom6oz5:active:where(:not(:disabled,[aria-disabled="true"])):not(#\#):not(#\#):not(#\#){transform:scale(1)}}
|
|
1840
1838
|
@media (forced-colors: active){.x1xwfpud.x1xwfpud:dir(rtl):not(#\#):not(#\#):not(#\#){transform:none}}
|
|
@@ -2324,9 +2322,6 @@
|
|
|
2324
2322
|
@media (forced-colors: active){.x1r4mieh.x1r4mieh[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-color:Highlight}}
|
|
2325
2323
|
@starting-style{@media (prefers-reduced-motion: reduce) and (pointer: coarse){.xgo67oj.xgo67oj.xgo67oj:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){opacity:0}}}
|
|
2326
2324
|
@starting-style{@media (prefers-reduced-motion: reduce){.xspp5ug.xspp5ug.xspp5ug:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){transform:translateY(0)}}}
|
|
2327
|
-
@media (pointer: coarse){.x10ogxw0.x10ogxw0.x10ogxw0:where(:not(:disabled,[aria-disabled="true"]))[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:none}}
|
|
2328
|
-
@media (pointer: coarse){.x18xnkjv.x18xnkjv.x18xnkjv:where(:not(:disabled,[aria-disabled="true"]))[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#){background-image:none}}
|
|
2329
|
-
@media (pointer: coarse){.xrkptjy.xrkptjy:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{inset:0}}
|
|
2330
2325
|
.xgw21jv:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{background-position:bottom}
|
|
2331
2326
|
.x1d269y:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-position:var(--_segmented-after-background-position,0% 0%)}
|
|
2332
2327
|
.xkyjh71:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{background-position:var(--_segmented-lens-background-position,0% 0%)}
|
|
@@ -2350,7 +2345,6 @@
|
|
|
2350
2345
|
.xslb4at:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::-webkit-datetime-edit{padding-inline:0}
|
|
2351
2346
|
.xvtkv6q:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition:background-color .15s ease,width .15s ease}
|
|
2352
2347
|
.x17s1k9h:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition:opacity .15s ease}
|
|
2353
|
-
@media (pointer: coarse){.x1kec4ew.x1kec4ew:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{border-radius:inherit}}
|
|
2354
2348
|
.xt64kwx:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{-webkit-backdrop-filter:var(--_segmented-after-webkit-backdrop-filter,none)}
|
|
2355
2349
|
.x1icymkt:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{-webkit-backdrop-filter:var(--_segmented-lens-webkit-backdrop-filter,none)}
|
|
2356
2350
|
.x19ds33d:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{align-self:start}
|
|
@@ -2504,18 +2498,12 @@
|
|
|
2504
2498
|
@media (pointer: coarse){.xq2jpp1.xq2jpp1.xq2jpp1:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-fill-mode:both}}
|
|
2505
2499
|
@media (pointer: coarse){.xxhzo2e.xxhzo2e.xxhzo2e:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-name:x1jn504y-B}}
|
|
2506
2500
|
@media (pointer: coarse){.xgq6fxe.xgq6fxe.xgq6fxe:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-timing-function:cubic-bezier(0,0,.2,1)}}
|
|
2507
|
-
@media (pointer: coarse){.x1dn949c.x1dn949c:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{background-color:var(--color-overlay-pressed)}}
|
|
2508
2501
|
@media (pointer: coarse){.x1ikgzpo.x1ikgzpo.x1ikgzpo:where(.x1odsvnm[data-astryx-press="on"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-image:var(--_press-paint-image)}}
|
|
2509
2502
|
@media (pointer: coarse){.xsozn46.xsozn46.xsozn46:where(.x1odsvnm[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{background-image:var(--_press-paint-image)}}
|
|
2510
2503
|
@media (pointer: coarse){.x15cra4q.x15cra4q.x15cra4q:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:""}}
|
|
2511
2504
|
@media (pointer: coarse){.xpxppvc.xpxppvc.xpxppvc:where(.x1iwu4tg[data-astryx-press="on"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:""}}
|
|
2512
2505
|
@media (pointer: coarse){.x1ccaw7f.x1ccaw7f.x1ccaw7f:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{opacity:0}}
|
|
2513
2506
|
@media (pointer: coarse){.x2huugr.x2huugr.x2huugr:where(.x1iwu4tg[data-astryx-press="on"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{opacity:1}}
|
|
2514
|
-
@media (pointer: coarse){.x13r5q6d.x13r5q6d:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{pointer-events:none}}
|
|
2515
|
-
@media (pointer: coarse){.x1ukh9kf.x1ukh9kf:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{position:absolute}}
|
|
2516
|
-
@media (pointer: coarse){.xjscm90.xjscm90:is([data-astryx-press="on"],[data-astryx-press="fading"]):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{z-index:-1}}
|
|
2517
|
-
@media (pointer: coarse){.x1ocadqd.x1ocadqd.x1ocadqd:is([data-astryx-press="on"],[data-astryx-press="fading"]):where(:not(:disabled,[aria-disabled="true"])):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:""}}
|
|
2518
|
-
@media (pointer: coarse){.x1995whq.x1995whq.x1995whq:is([data-astryx-press="on"],[data-astryx-press="fading"]):where(:not(:disabled,[aria-disabled="true"])):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{content:none}}
|
|
2519
2507
|
@media (prefers-reduced-motion: reduce) and (pointer: coarse){@media (pointer: coarse){.xigdn9b.xigdn9b.xigdn9b.xigdn9b:where(.x1iwu4tg[data-astryx-press="fading"] *):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-duration:min(200ms,calc(200ms * var(--_astryx-motion-tempo,1)))}}}
|
|
2520
2508
|
.xp6skj9:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{border-bottom-color:inherit}
|
|
2521
2509
|
.x1tqw9ds:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-bottom-color:var(--_segmented-after-border-bottom-color,currentcolor)}
|
|
@@ -2592,13 +2580,6 @@
|
|
|
2592
2580
|
.x1ea2at[data-astryx-cell-gliding="line"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{position:absolute}
|
|
2593
2581
|
.x15tr235[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-property:none}
|
|
2594
2582
|
.x1xg7wox[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{transition-property:none}
|
|
2595
|
-
@media (pointer: coarse){.x16lp0i7.x16lp0i7[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-duration:calc(200ms * min(var(--_astryx-motion-tempo,1),1.5))}}
|
|
2596
|
-
@media (pointer: coarse){.x1dn5vsf.x1dn5vsf[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-fill-mode:both}}
|
|
2597
|
-
@media (pointer: coarse){.x1gyhjqm.x1gyhjqm[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-timing-function:cubic-bezier(0, 0, 0.2, 1)}}
|
|
2598
|
-
@media (pointer: coarse){.xr9xsjc.xr9xsjc[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{opacity:0}}
|
|
2599
|
-
@media (pointer: coarse){.xw7rim2.xw7rim2[data-astryx-press="on"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{opacity:1}}
|
|
2600
|
-
@media (pointer: coarse){.x1bxn267.x1bxn267.x1bxn267:where(:not(:disabled,[aria-disabled="true"]))[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-name:x1jn504y-B}}
|
|
2601
|
-
@media (prefers-reduced-motion: reduce){@media (pointer: coarse){.x1bf026e.x1bf026e.x1bf026e[data-astryx-press="fading"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{animation-duration:min(200ms,calc(200ms * var(--_astryx-motion-tempo,1)))}}}
|
|
2602
2583
|
.x3mysge[data-astryx-table-pinned="carry"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{border-bottom-color:var(--_table-row-divider-app-color,var(--color-border))}
|
|
2603
2584
|
.x8qyx5[data-astryx-cell-gliding="line"]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::after{border-bottom-color:var(--_table-row-glide-color,var(--color-border))}
|
|
2604
2585
|
.xvlxne[data-astryx-cell-gliding]:not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#):not(#\#)::before{border-bottom-color:var(--_table-row-glide-color,var(--color-border))}
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* @input StyleX and the semantic interaction-overlay color tokens
|
|
4
4
|
* @output Reusable background-color and background-image state styles, the
|
|
5
5
|
* touch press's registered strength variable (`pressVars`) and its clocks
|
|
6
|
-
* (`pressConsts`)
|
|
7
|
-
* are internal (privateAttributes/press.stylex.ts, utils/rowPressLayer.stylex.ts)
|
|
6
|
+
* (`pressConsts`)
|
|
8
7
|
* @position Internal styling utility for interactive core surfaces
|
|
9
8
|
*
|
|
10
9
|
* SYNC: When modified, update pressFeedback.ts, pressGesture.ts (the fade
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactionOverlay.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/interactionOverlay.stylex.ts"],"names":[],"mappings":"AAMA
|
|
1
|
+
{"version":3,"file":"interactionOverlay.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/interactionOverlay.stylex.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AAmCH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAG3C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS;;WAEpB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW;IACtB,iEAAiE;;CAEjE,CAAC;AA8HH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8HnC,CAAC"}
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
* @input StyleX and the semantic interaction-overlay color tokens
|
|
10
10
|
* @output Reusable background-color and background-image state styles, the
|
|
11
11
|
* touch press's registered strength variable (`pressVars`) and its clocks
|
|
12
|
-
* (`pressConsts`)
|
|
13
|
-
* are internal (privateAttributes/press.stylex.ts, utils/rowPressLayer.stylex.ts)
|
|
12
|
+
* (`pressConsts`)
|
|
14
13
|
* @position Internal styling utility for interactive core surfaces
|
|
15
14
|
*
|
|
16
15
|
* SYNC: When modified, update pressFeedback.ts, pressGesture.ts (the fade
|
|
@@ -143,11 +142,7 @@ const pressRelease = "x10jkm1t-B";
|
|
|
143
142
|
* (strength ≈ 0.2 at the midpoint), which is what a deselect crossfade reads
|
|
144
143
|
* as. Not the system's `--ease-standard`: that curve is for things that move,
|
|
145
144
|
* and is so front-loaded (strength 0.05 at the midpoint) that the release
|
|
146
|
-
* would read as half its clock.
|
|
147
|
-
* `timing.press.highlightOutCurve`, which the list row's layer mirrors too
|
|
148
|
-
* (rowPressLayer.stylex.ts); interactionOverlay.cell.test.ts fails if either
|
|
149
|
-
* drifts. A copy, not an import: this module reaches nearly every component,
|
|
150
|
-
* and the row layer's constants stay with the rows.
|
|
145
|
+
* would read as half its clock.
|
|
151
146
|
*/
|
|
152
147
|
const RELEASE_EASE = 'cubic-bezier(0, 0, 0.2, 1)';
|
|
153
148
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/core",
|
|
3
|
-
"version": "0.7.8-canary.
|
|
3
|
+
"version": "0.7.8-canary.c1ff98e",
|
|
4
4
|
"displayName": "Astryx Core",
|
|
5
5
|
"description": "The component library. Accessible, themeable React components with built-in spacing, dark mode, and StyleX styling.",
|
|
6
6
|
"author": "Meta Open Source",
|
|
@@ -870,9 +870,9 @@
|
|
|
870
870
|
"react-dom": ">=19.0.0"
|
|
871
871
|
},
|
|
872
872
|
"devDependencies": {
|
|
873
|
-
"@astryxdesign/a11y-spec": "0.7.8-canary.
|
|
874
|
-
"@astryxdesign/cli": "0.7.8-canary.
|
|
875
|
-
"@astryxdesign/interaction-harness": "0.7.8-canary.
|
|
873
|
+
"@astryxdesign/a11y-spec": "0.7.8-canary.c1ff98e",
|
|
874
|
+
"@astryxdesign/cli": "0.7.8-canary.c1ff98e",
|
|
875
|
+
"@astryxdesign/interaction-harness": "0.7.8-canary.c1ff98e",
|
|
876
876
|
"@babel/cli": "^7.29.7",
|
|
877
877
|
"@babel/core": "^7.29.7",
|
|
878
878
|
"@babel/preset-react": "^7.29.7",
|
package/src/Item/Item.tsx
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Item.tsx
|
|
7
|
-
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
8
|
-
* the shared press overlays and the compositor press layer
|
|
7
|
+
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
9
8
|
* @output Exports Item component, ItemProps type; publishes the shared inline inset.
|
|
10
9
|
* Only numbered composing rows keep their start/label/end slots in one flex
|
|
11
10
|
* group, through Item's private exact-marker scope; other marked rows keep
|
|
@@ -63,7 +62,6 @@ import {useDevWarning} from '../hooks/useDevWarning';
|
|
|
63
62
|
import {themeProps} from '../utils/themeProps';
|
|
64
63
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
65
64
|
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
66
|
-
import {rowPressLayerStyles} from '../privateAttributes/press.stylex';
|
|
67
65
|
import {usePressFeedback} from '../hooks/usePressFeedback';
|
|
68
66
|
import type {ItemSwipeBridge} from './ItemSwipeLayer';
|
|
69
67
|
|
|
@@ -535,6 +533,7 @@ const styles = stylex.create({
|
|
|
535
533
|
// zoomable (WCAG 1.4.4). The hover transition keeps its own clock beside
|
|
536
534
|
// the transform's.
|
|
537
535
|
swipeRoot: {
|
|
536
|
+
isolation: 'isolate',
|
|
538
537
|
touchAction: 'pan-y pinch-zoom',
|
|
539
538
|
transform: `translate3d(${SWIPE_TRAVEL}, 0, 0)`,
|
|
540
539
|
transitionProperty: 'background-color, transform',
|
|
@@ -927,10 +926,6 @@ export function Item({
|
|
|
927
926
|
align === 'first-line' && styles.alignFirstLine,
|
|
928
927
|
isInteractive && styles.interactive,
|
|
929
928
|
isInteractive && interactionOverlayStyles.backgroundColor,
|
|
930
|
-
// The touch press on a compositor layer (after the overlay, whose
|
|
931
|
-
// own touch paint it turns off): the release keeps fading while
|
|
932
|
-
// script runs.
|
|
933
|
-
isInteractive && rowPressLayerStyles.cell,
|
|
934
929
|
isLinkRoot && styles.linkRoot,
|
|
935
930
|
isHighlighted && styles.highlighted,
|
|
936
931
|
isSelected && styles.selected,
|
|
@@ -35,7 +35,6 @@ import {usePressFeedback} from '../hooks/usePressFeedback';
|
|
|
35
35
|
import {useIndicator} from '../Indicator/useIndicator';
|
|
36
36
|
import {Item, type ItemAlign} from '../Item/Item';
|
|
37
37
|
import {themeProps} from '../utils/themeProps';
|
|
38
|
-
import {rowPressLayerStyles} from '../privateAttributes/press.stylex';
|
|
39
38
|
|
|
40
39
|
// The touch press's paint, declared by the shared overlay styles on the
|
|
41
40
|
// element the controller writes to (`pressedAlpha`) at the press's strength,
|
|
@@ -148,6 +147,11 @@ const rowStyles = stylex.create({
|
|
|
148
147
|
// Suppress Item's interactive hover/press background so the resting and
|
|
149
148
|
// hovered row look identical by default (a theme can restyle either).
|
|
150
149
|
backgroundColor: 'transparent',
|
|
150
|
+
// ...and the touch press's overlay image, for the same reason: under a
|
|
151
|
+
// finger only the radio circle paints, as under a mouse. The press's
|
|
152
|
+
// strength still lands on the row, which is where the layer over the
|
|
153
|
+
// circle reads it.
|
|
154
|
+
backgroundImage: 'none',
|
|
151
155
|
},
|
|
152
156
|
// The mouse press (a finger's lives on `data-astryx-press`): the row is
|
|
153
157
|
// pressed, but not through a nested link or button, which keep their own
|
|
@@ -410,9 +414,6 @@ export function RadioListItem({
|
|
|
410
414
|
// the painting row element (Item), the same element that carries the
|
|
411
415
|
// theme target, so a theme's hover styling stays in step with the tint.
|
|
412
416
|
!isDisabled && indicatorScope,
|
|
413
|
-
// The row keeps no press paint of its own: the circle paints, and
|
|
414
|
-
// reads the strength whose release the row keeps.
|
|
415
|
-
rowPressLayerStyles.cellWithoutLayer,
|
|
416
417
|
// Restore the bare default look: zero Item's padding/radius and its
|
|
417
418
|
// interactive hover/press background. Applied after Item's own base
|
|
418
419
|
// styles so it wins within the base layer; a `radio-list-item` theme
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file TreeListItem.tsx
|
|
7
|
-
* @input Uses React, StyleX, theme tokens, TreeListBranches
|
|
8
|
-
* overlays and the compositor press layer
|
|
7
|
+
* @input Uses React, StyleX, theme tokens, TreeListBranches
|
|
9
8
|
* @output Exports TreeListItem component (internal, not publicly exported)
|
|
10
9
|
* @position Internal implementation; consumed by TreeList.tsx
|
|
11
10
|
*
|
|
@@ -28,7 +27,6 @@ import {
|
|
|
28
27
|
} from '../theme/tokens.stylex';
|
|
29
28
|
import {focusOutlineProps} from '../utils/focusOutline.stylex';
|
|
30
29
|
import {interactionOverlayStyles} from '../utils/interactionOverlay.stylex';
|
|
31
|
-
import {rowPressLayerStyles} from '../privateAttributes/press.stylex';
|
|
32
30
|
import {usePressFeedback} from '../hooks/usePressFeedback';
|
|
33
31
|
import {
|
|
34
32
|
hasInteractiveAncestor,
|
|
@@ -715,10 +713,6 @@ export function TreeListItem({
|
|
|
715
713
|
densityStyles[density],
|
|
716
714
|
styles.interactive,
|
|
717
715
|
interactionOverlayStyles.backgroundImage,
|
|
718
|
-
// The touch press on a compositor layer (after the
|
|
719
|
-
// overlay, whose own touch paint it turns off).
|
|
720
|
-
rowPressLayerStyles.cell,
|
|
721
|
-
rowPressLayerStyles.cellOnImage,
|
|
722
716
|
isDisabled && styles.disabled,
|
|
723
717
|
isSelected && styles.selected,
|
|
724
718
|
xstyle,
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
* @input StyleX and the semantic interaction-overlay color tokens
|
|
10
10
|
* @output Reusable background-color and background-image state styles, the
|
|
11
11
|
* touch press's registered strength variable (`pressVars`) and its clocks
|
|
12
|
-
* (`pressConsts`)
|
|
13
|
-
* are internal (privateAttributes/press.stylex.ts, utils/rowPressLayer.stylex.ts)
|
|
12
|
+
* (`pressConsts`)
|
|
14
13
|
* @position Internal styling utility for interactive core surfaces
|
|
15
14
|
*
|
|
16
15
|
* SYNC: When modified, update pressFeedback.ts, pressGesture.ts (the fade
|
|
@@ -149,11 +148,7 @@ const pressRelease = stylex.keyframes({
|
|
|
149
148
|
* (strength ≈ 0.2 at the midpoint), which is what a deselect crossfade reads
|
|
150
149
|
* as. Not the system's `--ease-standard`: that curve is for things that move,
|
|
151
150
|
* and is so front-loaded (strength 0.05 at the midpoint) that the release
|
|
152
|
-
* would read as half its clock.
|
|
153
|
-
* `timing.press.highlightOutCurve`, which the list row's layer mirrors too
|
|
154
|
-
* (rowPressLayer.stylex.ts); interactionOverlay.cell.test.ts fails if either
|
|
155
|
-
* drifts. A copy, not an import: this module reaches nearly every component,
|
|
156
|
-
* and the row layer's constants stay with the rows.
|
|
151
|
+
* would read as half its clock.
|
|
157
152
|
*/
|
|
158
153
|
const RELEASE_EASE = 'cubic-bezier(0, 0, 0.2, 1)';
|
|
159
154
|
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file privateAttributes/press.stylex.ts
|
|
3
|
-
* @input StyleX, the semantic overlay color tokens, the touch press strength
|
|
4
|
-
* (`pressVars`, utils/interactionOverlay.stylex.ts) and the row layer's
|
|
5
|
-
* clocks (utils/rowPressLayer.stylex.ts)
|
|
6
|
-
* @output `rowPressLayerStyles`: the compositor press layer for list rows
|
|
7
|
-
* (`cell`) and its own-image arms for a row on the `backgroundImage`
|
|
8
|
-
* variant (`cellOnImage`)
|
|
9
|
-
* @position Owner module of the private press attribute for the row layer:
|
|
10
|
-
* the press controller (utils/pressFeedback.ts) writes the attribute, and
|
|
11
|
-
* this file reads it. No package entry exports it. Item and TreeList
|
|
12
|
-
* compose these styles after their overlay variant;
|
|
13
|
-
* utils/interactionOverlay.cell.test.ts tests them.
|
|
14
|
-
*/
|
|
15
|
-
import * as stylex from '@stylexjs/stylex';
|
|
16
|
-
export declare const rowPressLayerStyles: Readonly<{
|
|
17
|
-
readonly cell: Readonly<{
|
|
18
|
-
readonly backgroundImage: stylex.StyleXClassNameFor<"backgroundImage", unknown>;
|
|
19
|
-
readonly animationName: stylex.StyleXClassNameFor<"animationName", unknown>;
|
|
20
|
-
readonly isolation: stylex.StyleXClassNameFor<"isolation", "isolate" | null>;
|
|
21
|
-
readonly '::before': stylex.StyleXClassNameFor<"::before", {
|
|
22
|
-
readonly content: {
|
|
23
|
-
readonly default: null;
|
|
24
|
-
readonly "@media (pointer: coarse)": {
|
|
25
|
-
readonly default: null;
|
|
26
|
-
readonly ":where(:not(:disabled,[aria-disabled=\"true\"]))": {
|
|
27
|
-
readonly default: null;
|
|
28
|
-
readonly ":is([data-astryx-press=\"on\"],[data-astryx-press=\"fading\"])": "\"\"";
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
readonly position: {
|
|
33
|
-
readonly default: null;
|
|
34
|
-
readonly "@media (pointer: coarse)": {
|
|
35
|
-
readonly default: null;
|
|
36
|
-
readonly ":is([data-astryx-press=\"on\"],[data-astryx-press=\"fading\"])": "absolute";
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
readonly inset: {
|
|
40
|
-
readonly default: null;
|
|
41
|
-
readonly "@media (pointer: coarse)": {
|
|
42
|
-
readonly default: null;
|
|
43
|
-
readonly ":is([data-astryx-press=\"on\"],[data-astryx-press=\"fading\"])": 0;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
readonly zIndex: {
|
|
47
|
-
readonly default: null;
|
|
48
|
-
readonly "@media (pointer: coarse)": {
|
|
49
|
-
readonly default: null;
|
|
50
|
-
readonly ":is([data-astryx-press=\"on\"],[data-astryx-press=\"fading\"])": -1;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
readonly borderRadius: {
|
|
54
|
-
readonly default: null;
|
|
55
|
-
readonly "@media (pointer: coarse)": {
|
|
56
|
-
readonly default: null;
|
|
57
|
-
readonly ":is([data-astryx-press=\"on\"],[data-astryx-press=\"fading\"])": "inherit";
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
readonly pointerEvents: {
|
|
61
|
-
readonly default: null;
|
|
62
|
-
readonly "@media (pointer: coarse)": {
|
|
63
|
-
readonly default: null;
|
|
64
|
-
readonly ":is([data-astryx-press=\"on\"],[data-astryx-press=\"fading\"])": "none";
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
readonly backgroundColor: {
|
|
68
|
-
readonly default: null;
|
|
69
|
-
readonly "@media (pointer: coarse)": {
|
|
70
|
-
readonly default: null;
|
|
71
|
-
readonly ":is([data-astryx-press=\"on\"],[data-astryx-press=\"fading\"])": stylex.StyleXVar<"light-dark(#05365919, #FFFFFF19)">;
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
readonly opacity: {
|
|
75
|
-
readonly default: null;
|
|
76
|
-
readonly "@media (pointer: coarse)": {
|
|
77
|
-
readonly default: null;
|
|
78
|
-
readonly "[data-astryx-press=\"on\"]": 1;
|
|
79
|
-
readonly "[data-astryx-press=\"fading\"]": 0;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
readonly animationName: {
|
|
83
|
-
readonly default: null;
|
|
84
|
-
readonly "@media (pointer: coarse)": {
|
|
85
|
-
readonly default: null;
|
|
86
|
-
readonly ":where(:not(:disabled,[aria-disabled=\"true\"]))": {
|
|
87
|
-
readonly default: null;
|
|
88
|
-
readonly "[data-astryx-press=\"fading\"]": string;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
readonly animationDuration: {
|
|
93
|
-
readonly default: null;
|
|
94
|
-
readonly "@media (pointer: coarse)": {
|
|
95
|
-
readonly default: null;
|
|
96
|
-
readonly "[data-astryx-press=\"fading\"]": {
|
|
97
|
-
readonly default: string;
|
|
98
|
-
readonly "@media (prefers-reduced-motion: reduce)": string;
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
readonly animationTimingFunction: {
|
|
103
|
-
readonly default: null;
|
|
104
|
-
readonly "@media (pointer: coarse)": {
|
|
105
|
-
readonly default: null;
|
|
106
|
-
readonly "[data-astryx-press=\"fading\"]": string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
readonly animationFillMode: {
|
|
110
|
-
readonly default: null;
|
|
111
|
-
readonly "@media (pointer: coarse)": {
|
|
112
|
-
readonly default: null;
|
|
113
|
-
readonly "[data-astryx-press=\"fading\"]": "both";
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
}>;
|
|
117
|
-
}>;
|
|
118
|
-
readonly cellWithoutLayer: Readonly<{
|
|
119
|
-
readonly backgroundImage: stylex.StyleXClassNameFor<"backgroundImage", "none">;
|
|
120
|
-
readonly animationName: stylex.StyleXClassNameFor<"animationName", unknown>;
|
|
121
|
-
readonly isolation: stylex.StyleXClassNameFor<"isolation", "auto" | null>;
|
|
122
|
-
readonly '::before': stylex.StyleXClassNameFor<"::before", {
|
|
123
|
-
readonly content: {
|
|
124
|
-
readonly default: null;
|
|
125
|
-
readonly "@media (pointer: coarse)": {
|
|
126
|
-
readonly default: null;
|
|
127
|
-
readonly ":where(:not(:disabled,[aria-disabled=\"true\"]))": {
|
|
128
|
-
readonly default: null;
|
|
129
|
-
readonly ":is([data-astryx-press=\"on\"],[data-astryx-press=\"fading\"])": "none";
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
}>;
|
|
134
|
-
}>;
|
|
135
|
-
readonly cellOnImage: Readonly<{
|
|
136
|
-
readonly backgroundImage: stylex.StyleXClassNameFor<"backgroundImage", string | null>;
|
|
137
|
-
}>;
|
|
138
|
-
}>;
|
|
139
|
-
//# sourceMappingURL=press.stylex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"press.stylex.d.ts","sourceRoot":"","sources":["../../src/privateAttributes/press.stylex.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAsD3C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyK9B,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @astryx/no-hover-on-disabled -- Every hover branch is
|
|
4
|
-
* nested beneath ENABLED below, as in interactionOverlay.stylex.ts. */
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @file privateAttributes/press.stylex.ts
|
|
8
|
-
* @input StyleX, the semantic overlay color tokens, the touch press strength
|
|
9
|
-
* (`pressVars`, utils/interactionOverlay.stylex.ts) and the row layer's
|
|
10
|
-
* clocks (utils/rowPressLayer.stylex.ts)
|
|
11
|
-
* @output `rowPressLayerStyles`: the compositor press layer for list rows
|
|
12
|
-
* (`cell`) and its own-image arms for a row on the `backgroundImage`
|
|
13
|
-
* variant (`cellOnImage`)
|
|
14
|
-
* @position Owner module of the private press attribute for the row layer:
|
|
15
|
-
* the press controller (utils/pressFeedback.ts) writes the attribute, and
|
|
16
|
-
* this file reads it. No package entry exports it. Item and TreeList
|
|
17
|
-
* compose these styles after their overlay variant;
|
|
18
|
-
* utils/interactionOverlay.cell.test.ts tests them.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
import * as stylex from '@stylexjs/stylex';
|
|
22
|
-
import "../theme/tokens.stylex.js";
|
|
23
|
-
import { colorVars } from "../theme/tokens.stylex.js";
|
|
24
|
-
import "../utils/interactionOverlay.stylex.js";
|
|
25
|
-
import { pressVars } from "../utils/interactionOverlay.stylex.js";
|
|
26
|
-
import "../utils/rowPressLayer.stylex.js";
|
|
27
|
-
import { cellPressConsts } from "../utils/rowPressLayer.stylex.js";
|
|
28
|
-
|
|
29
|
-
// The overlay's arm selectors (interactionOverlay.stylex.ts), restated here:
|
|
30
|
-
// StyleX resolves a style's keys within its own file.
|
|
31
|
-
const ENABLED = ':where(:not(:disabled,[aria-disabled="true"]))';
|
|
32
|
-
const HOVER_HOVER = '@media (hover: hover)';
|
|
33
|
-
const COARSE = '@media (pointer: coarse)';
|
|
34
|
-
const PRESSED_ON = '[data-astryx-press="on"]';
|
|
35
|
-
const PRESSED_FADING = '[data-astryx-press="fading"]';
|
|
36
|
-
/**
|
|
37
|
-
* A press in any of its states: the row layer exists only then, so at rest a
|
|
38
|
-
* row's own `::before` and its stacking are untouched.
|
|
39
|
-
*/
|
|
40
|
-
const PRESSED_ANY = ':is([data-astryx-press="on"],[data-astryx-press="fading"])';
|
|
41
|
-
const PRESS_ALPHA = pressVars['--astryx-press-alpha'];
|
|
42
|
-
const hoverImage = `linear-gradient(${colorVars['--color-overlay-hover']}, ${colorVars['--color-overlay-hover']})`;
|
|
43
|
-
const pressedImage = `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`;
|
|
44
|
-
/** The overlay's paint, read back off the element (its gradient layer). */
|
|
45
|
-
const pressedOverlayImage = 'var(--_press-paint-image)';
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The overlay's strength release (interactionOverlay.stylex.ts), restated so
|
|
49
|
-
* a fine pointer keeps it: the same keyframes, so the same animation.
|
|
50
|
-
*/
|
|
51
|
-
const pressRelease = "x10jkm1t-B";
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The row layer's clock as CSS. It is the strength release's clock, scaled
|
|
55
|
-
* by the theme's `--_astryx-motion-tempo` up to 1.5, so the layer and the
|
|
56
|
-
* strength land together.
|
|
57
|
-
*/
|
|
58
|
-
const CELL_RELEASE = `calc(${cellPressConsts.cellReleaseMs}ms * min(var(--_astryx-motion-tempo, 1), 1.5))`;
|
|
59
|
-
/** The same clock under Reduce Motion: a tempo may shorten it, never lengthen it. */
|
|
60
|
-
const CELL_RELEASE_REDUCED = `min(${cellPressConsts.cellReleaseMs}ms, calc(${cellPressConsts.cellReleaseMs}ms * var(--_astryx-motion-tempo, 1)))`;
|
|
61
|
-
const REDUCED_MOTION = '@media (prefers-reduced-motion: reduce)';
|
|
62
|
-
|
|
63
|
-
/** Opacity 1 → 0: the row layer leaves; its fading arm runs it. */
|
|
64
|
-
const cellRelease = "x1jn504y-B";
|
|
65
|
-
|
|
66
|
-
/** The release's curve: the table's gentle ease-out. */
|
|
67
|
-
const RELEASE_EASE = cellPressConsts.cellReleaseEase;
|
|
68
|
-
export const rowPressLayerStyles = {
|
|
69
|
-
cell: {
|
|
70
|
-
kKwaWg: "x7ngsy6 x10ogxw0 xubczrd x18xnkjv",
|
|
71
|
-
kKVMdj: "x14e4jsf x6su2wr",
|
|
72
|
-
kHBbk8: "xif6eam",
|
|
73
|
-
kgeoSG: "x1ocadqd",
|
|
74
|
-
kEoFBp: "x1ukh9kf",
|
|
75
|
-
kFcpXp: "xrkptjy",
|
|
76
|
-
kxmVGU: "xjscm90",
|
|
77
|
-
kPB484: "x1kec4ew",
|
|
78
|
-
km8f2m: "x13r5q6d",
|
|
79
|
-
kLkRvE: "x1dn949c",
|
|
80
|
-
k5QlbN: "xw7rim2 xr9xsjc",
|
|
81
|
-
k7EzDT: "x1bxn267",
|
|
82
|
-
kQZAMR: "x16lp0i7 x1bf026e",
|
|
83
|
-
kZiNAr: "x1gyhjqm",
|
|
84
|
-
k8Tatv: "x1dn5vsf",
|
|
85
|
-
$$css: true
|
|
86
|
-
},
|
|
87
|
-
cellWithoutLayer: {
|
|
88
|
-
kKwaWg: "x18o3ruo",
|
|
89
|
-
kKVMdj: "x14e4jsf",
|
|
90
|
-
kHBbk8: "xrqzsdu",
|
|
91
|
-
kgeoSG: "x1995whq",
|
|
92
|
-
$$css: true
|
|
93
|
-
},
|
|
94
|
-
cellOnImage: {
|
|
95
|
-
kKwaWg: "x7uyq82 x3f84ok x7ngsy6 x10ogxw0 xubczrd x18xnkjv xmvprkv xetgvay",
|
|
96
|
-
$$css: true
|
|
97
|
-
}
|
|
98
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A list row's release (`rowPressLayerStyles.cell`), mirrored for the
|
|
3
|
-
* stylesheet. StyleX evaluates a style at build time and cannot read the
|
|
4
|
-
* constants table, so these are the table's press release values
|
|
5
|
-
* (`timing.press`, motion/uikit/timing.ts). interactionOverlay.cell.test.ts
|
|
6
|
-
* fails if they drift.
|
|
7
|
-
*/
|
|
8
|
-
export declare const cellPressConsts: {
|
|
9
|
-
/** `timing.press.highlightOutMs`, in ms. */
|
|
10
|
-
cellReleaseMs: number;
|
|
11
|
-
/** `timing.press.highlightOutCurve`, as CSS. */
|
|
12
|
-
cellReleaseEase: string;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=rowPressLayer.stylex.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rowPressLayer.stylex.d.ts","sourceRoot":"","sources":["../../src/utils/rowPressLayer.stylex.ts"],"names":[],"mappings":"AAcA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe;IAC1B,4CAA4C;;IAE5C,gDAAgD;;CAEhD,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file rowPressLayer.stylex.ts
|
|
5
|
-
* @input StyleX
|
|
6
|
-
* @output The list row press layer's clocks (`cellPressConsts`)
|
|
7
|
-
* @position Internal to core: no package entry exports it. Only the row
|
|
8
|
-
* layer (privateAttributes/press.stylex.ts) reads it, so a component
|
|
9
|
-
* without a press row ships none of it; interactionOverlay.exports.test.ts
|
|
10
|
-
* keeps it off the published paths.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import * as stylex from '@stylexjs/stylex';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A list row's release (`rowPressLayerStyles.cell`), mirrored for the
|
|
17
|
-
* stylesheet. StyleX evaluates a style at build time and cannot read the
|
|
18
|
-
* constants table, so these are the table's press release values
|
|
19
|
-
* (`timing.press`, motion/uikit/timing.ts). interactionOverlay.cell.test.ts
|
|
20
|
-
* fails if they drift.
|
|
21
|
-
*/
|
|
22
|
-
export const cellPressConsts = {
|
|
23
|
-
cellReleaseMs: 200,
|
|
24
|
-
cellReleaseEase: "cubic-bezier(0, 0, 0.2, 1)"
|
|
25
|
-
};
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/* eslint-disable @astryx/no-hover-on-disabled -- Every hover branch is
|
|
4
|
-
* nested beneath ENABLED below, as in interactionOverlay.stylex.ts. */
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @file privateAttributes/press.stylex.ts
|
|
8
|
-
* @input StyleX, the semantic overlay color tokens, the touch press strength
|
|
9
|
-
* (`pressVars`, utils/interactionOverlay.stylex.ts) and the row layer's
|
|
10
|
-
* clocks (utils/rowPressLayer.stylex.ts)
|
|
11
|
-
* @output `rowPressLayerStyles`: the compositor press layer for list rows
|
|
12
|
-
* (`cell`) and its own-image arms for a row on the `backgroundImage`
|
|
13
|
-
* variant (`cellOnImage`)
|
|
14
|
-
* @position Owner module of the private press attribute for the row layer:
|
|
15
|
-
* the press controller (utils/pressFeedback.ts) writes the attribute, and
|
|
16
|
-
* this file reads it. No package entry exports it. Item and TreeList
|
|
17
|
-
* compose these styles after their overlay variant;
|
|
18
|
-
* utils/interactionOverlay.cell.test.ts tests them.
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
import * as stylex from '@stylexjs/stylex';
|
|
22
|
-
import {colorVars} from '../theme/tokens.stylex';
|
|
23
|
-
import {pressVars} from '../utils/interactionOverlay.stylex';
|
|
24
|
-
import {cellPressConsts} from '../utils/rowPressLayer.stylex';
|
|
25
|
-
|
|
26
|
-
// The overlay's arm selectors (interactionOverlay.stylex.ts), restated here:
|
|
27
|
-
// StyleX resolves a style's keys within its own file.
|
|
28
|
-
const ENABLED = ':where(:not(:disabled,[aria-disabled="true"]))';
|
|
29
|
-
const HOVER_HOVER = '@media (hover: hover)';
|
|
30
|
-
const COARSE = '@media (pointer: coarse)';
|
|
31
|
-
const PRESSED_ON = '[data-astryx-press="on"]';
|
|
32
|
-
const PRESSED_FADING = '[data-astryx-press="fading"]';
|
|
33
|
-
/**
|
|
34
|
-
* A press in any of its states: the row layer exists only then, so at rest a
|
|
35
|
-
* row's own `::before` and its stacking are untouched.
|
|
36
|
-
*/
|
|
37
|
-
const PRESSED_ANY =
|
|
38
|
-
':is([data-astryx-press="on"],[data-astryx-press="fading"])';
|
|
39
|
-
|
|
40
|
-
const PRESS_ALPHA = pressVars['--astryx-press-alpha'];
|
|
41
|
-
|
|
42
|
-
const hoverImage = `linear-gradient(${colorVars['--color-overlay-hover']}, ${colorVars['--color-overlay-hover']})`;
|
|
43
|
-
const pressedImage = `linear-gradient(${colorVars['--color-overlay-pressed']}, ${colorVars['--color-overlay-pressed']})`;
|
|
44
|
-
/** The overlay's paint, read back off the element (its gradient layer). */
|
|
45
|
-
const pressedOverlayImage = 'var(--_press-paint-image)';
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* The overlay's strength release (interactionOverlay.stylex.ts), restated so
|
|
49
|
-
* a fine pointer keeps it: the same keyframes, so the same animation.
|
|
50
|
-
*/
|
|
51
|
-
const pressRelease = stylex.keyframes({
|
|
52
|
-
from: {[PRESS_ALPHA]: 1},
|
|
53
|
-
to: {[PRESS_ALPHA]: 0},
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* The row layer's clock as CSS. It is the strength release's clock, scaled
|
|
58
|
-
* by the theme's `--_astryx-motion-tempo` up to 1.5, so the layer and the
|
|
59
|
-
* strength land together.
|
|
60
|
-
*/
|
|
61
|
-
const CELL_RELEASE = `calc(${cellPressConsts.cellReleaseMs}ms * min(var(--_astryx-motion-tempo, 1), 1.5))`;
|
|
62
|
-
/** The same clock under Reduce Motion: a tempo may shorten it, never lengthen it. */
|
|
63
|
-
const CELL_RELEASE_REDUCED = `min(${cellPressConsts.cellReleaseMs}ms, calc(${cellPressConsts.cellReleaseMs}ms * var(--_astryx-motion-tempo, 1)))`;
|
|
64
|
-
const REDUCED_MOTION = '@media (prefers-reduced-motion: reduce)';
|
|
65
|
-
|
|
66
|
-
/** Opacity 1 → 0: the row layer leaves; its fading arm runs it. */
|
|
67
|
-
const cellRelease = stylex.keyframes({
|
|
68
|
-
from: {opacity: 1},
|
|
69
|
-
to: {opacity: 0},
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
/** The release's curve: the table's gentle ease-out. */
|
|
73
|
-
const RELEASE_EASE = cellPressConsts.cellReleaseEase;
|
|
74
|
-
|
|
75
|
-
export const rowPressLayerStyles = stylex.create({
|
|
76
|
-
/**
|
|
77
|
-
* A list row's touch press on a compositor layer (Item, and TreeList's row
|
|
78
|
-
* box), composed AFTER the row's overlay variant (StyleX is last-wins per
|
|
79
|
-
* property). The variant's own touch paint, a gradient whose strength is a
|
|
80
|
-
* registered custom property, animates on the main thread: while script
|
|
81
|
-
* runs, a pressed row would stay at full strength and every frame of the
|
|
82
|
-
* fade would paint. Here the press is an element-sized `::before` under the
|
|
83
|
-
* row's content whose OPACITY is the strength: `on` shows it at once and
|
|
84
|
-
* `fading` runs a keyframe animation of its opacity, 1 → 0, on the cell's
|
|
85
|
-
* release clock (`timing.press`), which engines run on the compositor:
|
|
86
|
-
* it keeps advancing while the main thread is blocked and lays out and
|
|
87
|
-
* paints nothing. Same pixels as the variant's paint at that strength. The
|
|
88
|
-
* variant keeps the hover and a mouse's `:active`. The row must be
|
|
89
|
-
* positioned (the layer is placed absolutely); `isolation: isolate` keeps
|
|
90
|
-
* the layer above the row's background (a selected fill) and below its
|
|
91
|
-
* content. The layer exists only while a press is on or releasing: at rest
|
|
92
|
-
* a row's own `::before` and its stacking are as they were; during a press
|
|
93
|
-
* the layer is the row's `::before`, so a caller's decoration there merges
|
|
94
|
-
* into the layer for that time (decorate with `::after` or a child).
|
|
95
|
-
*
|
|
96
|
-
* Under a finger only (a coarse primary pointer): a fine pointer keeps the
|
|
97
|
-
* variant exactly, with no layer, no stacking context and its own touch
|
|
98
|
-
* paint, so a desktop row is as it was.
|
|
99
|
-
*/
|
|
100
|
-
cell: {
|
|
101
|
-
// The `backgroundColor` variant's own image arms (Item's), its touch
|
|
102
|
-
// paint yielding to the layer under a finger. Only the row's own image
|
|
103
|
-
// turns off: the press paint (`--_press-paint`) stays the variant's, so
|
|
104
|
-
// what a row's descendants paint from it still paints. A fine pointer
|
|
105
|
-
// keeps the arms exactly. `cellOnImage` is the same for the
|
|
106
|
-
// `backgroundImage` variant (TreeList's row box).
|
|
107
|
-
backgroundImage: {
|
|
108
|
-
default: null,
|
|
109
|
-
[ENABLED]: {
|
|
110
|
-
default: null,
|
|
111
|
-
[PRESSED_ON]: {default: pressedOverlayImage, [COARSE]: 'none'},
|
|
112
|
-
[PRESSED_FADING]: {default: pressedOverlayImage, [COARSE]: 'none'},
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
// Under a finger the strength's own release (a main-thread animation)
|
|
116
|
-
// is dropped: the layer fades instead, on the compositor. A row whose
|
|
117
|
-
// descendant fades at the row's strength (a radio row's circle) brings
|
|
118
|
-
// it back with `pressedAlpha`. A fine pointer keeps it as the variant
|
|
119
|
-
// declares it (its clock and curve are untouched).
|
|
120
|
-
animationName: {
|
|
121
|
-
default: null,
|
|
122
|
-
[PRESSED_FADING]: {default: pressRelease, [COARSE]: 'none'},
|
|
123
|
-
},
|
|
124
|
-
// The stacking context the layer needs, for a press only.
|
|
125
|
-
isolation: {
|
|
126
|
-
default: null,
|
|
127
|
-
[COARSE]: {default: null, [PRESSED_ANY]: 'isolate'},
|
|
128
|
-
},
|
|
129
|
-
// The whole layer is under a finger only, and only while a press is on
|
|
130
|
-
// or releasing: with a fine pointer none of it applies, and at rest a
|
|
131
|
-
// row's own `::before` is exactly as it was.
|
|
132
|
-
'::before': {
|
|
133
|
-
content: {
|
|
134
|
-
default: null,
|
|
135
|
-
[COARSE]: {
|
|
136
|
-
default: null,
|
|
137
|
-
[ENABLED]: {default: null, [PRESSED_ANY]: '""'},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
position: {
|
|
141
|
-
default: null,
|
|
142
|
-
[COARSE]: {default: null, [PRESSED_ANY]: 'absolute'},
|
|
143
|
-
},
|
|
144
|
-
inset: {default: null, [COARSE]: {default: null, [PRESSED_ANY]: 0}},
|
|
145
|
-
zIndex: {default: null, [COARSE]: {default: null, [PRESSED_ANY]: -1}},
|
|
146
|
-
borderRadius: {
|
|
147
|
-
default: null,
|
|
148
|
-
[COARSE]: {default: null, [PRESSED_ANY]: 'inherit'},
|
|
149
|
-
},
|
|
150
|
-
pointerEvents: {
|
|
151
|
-
default: null,
|
|
152
|
-
[COARSE]: {default: null, [PRESSED_ANY]: 'none'},
|
|
153
|
-
},
|
|
154
|
-
backgroundColor: {
|
|
155
|
-
default: null,
|
|
156
|
-
[COARSE]: {
|
|
157
|
-
default: null,
|
|
158
|
-
[PRESSED_ANY]: colorVars['--color-overlay-pressed'],
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
// On at once while the press is believed; nothing transitions it.
|
|
162
|
-
opacity: {
|
|
163
|
-
default: null,
|
|
164
|
-
[COARSE]: {default: null, [PRESSED_ON]: 1, [PRESSED_FADING]: 0},
|
|
165
|
-
},
|
|
166
|
-
animationName: {
|
|
167
|
-
default: null,
|
|
168
|
-
[COARSE]: {
|
|
169
|
-
default: null,
|
|
170
|
-
[ENABLED]: {default: null, [PRESSED_FADING]: cellRelease},
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
animationDuration: {
|
|
174
|
-
default: null,
|
|
175
|
-
[COARSE]: {
|
|
176
|
-
default: null,
|
|
177
|
-
[PRESSED_FADING]: {
|
|
178
|
-
default: CELL_RELEASE,
|
|
179
|
-
[REDUCED_MOTION]: CELL_RELEASE_REDUCED,
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
animationTimingFunction: {
|
|
184
|
-
default: null,
|
|
185
|
-
[COARSE]: {
|
|
186
|
-
default: null,
|
|
187
|
-
[PRESSED_FADING]: RELEASE_EASE,
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
animationFillMode: {
|
|
191
|
-
default: null,
|
|
192
|
-
[COARSE]: {default: null, [PRESSED_FADING]: 'both'},
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
/**
|
|
197
|
-
* A row that keeps no press paint of its own, composed after `cell`: a
|
|
198
|
-
* radio row, whose circle paints the press. The row paints no overlay
|
|
199
|
-
* image, keeps the strength's own release (the circle's layer reads the
|
|
200
|
-
* strength), and under a finger has no `::before` box and is no stacking
|
|
201
|
-
* context during a press.
|
|
202
|
-
*/
|
|
203
|
-
cellWithoutLayer: {
|
|
204
|
-
backgroundImage: 'none',
|
|
205
|
-
animationName: {default: null, [PRESSED_FADING]: pressRelease},
|
|
206
|
-
isolation: {
|
|
207
|
-
default: null,
|
|
208
|
-
[COARSE]: {default: null, [PRESSED_ANY]: 'auto'},
|
|
209
|
-
},
|
|
210
|
-
'::before': {
|
|
211
|
-
content: {
|
|
212
|
-
default: null,
|
|
213
|
-
[COARSE]: {
|
|
214
|
-
default: null,
|
|
215
|
-
[ENABLED]: {default: null, [PRESSED_ANY]: 'none'},
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
/**
|
|
221
|
-
* `cell`'s own-image arms for a row on the `backgroundImage` variant
|
|
222
|
-
* (TreeList's row box), composed after `cell`: the variant's arms, its
|
|
223
|
-
* touch press paint yielding to the layer under a coarse primary pointer.
|
|
224
|
-
*/
|
|
225
|
-
cellOnImage: {
|
|
226
|
-
backgroundImage: {
|
|
227
|
-
default: null,
|
|
228
|
-
[ENABLED]: {
|
|
229
|
-
default: null,
|
|
230
|
-
':active': {
|
|
231
|
-
default: pressedImage,
|
|
232
|
-
[COARSE]: 'none',
|
|
233
|
-
},
|
|
234
|
-
[HOVER_HOVER]: {
|
|
235
|
-
default: null,
|
|
236
|
-
':hover': hoverImage,
|
|
237
|
-
':active': pressedImage,
|
|
238
|
-
},
|
|
239
|
-
[PRESSED_ON]: {default: pressedOverlayImage, [COARSE]: 'none'},
|
|
240
|
-
[PRESSED_FADING]: {default: pressedOverlayImage, [COARSE]: 'none'},
|
|
241
|
-
},
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file rowPressLayer.stylex.ts
|
|
5
|
-
* @input StyleX
|
|
6
|
-
* @output The list row press layer's clocks (`cellPressConsts`)
|
|
7
|
-
* @position Internal to core: no package entry exports it. Only the row
|
|
8
|
-
* layer (privateAttributes/press.stylex.ts) reads it, so a component
|
|
9
|
-
* without a press row ships none of it; interactionOverlay.exports.test.ts
|
|
10
|
-
* keeps it off the published paths.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import * as stylex from '@stylexjs/stylex';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A list row's release (`rowPressLayerStyles.cell`), mirrored for the
|
|
17
|
-
* stylesheet. StyleX evaluates a style at build time and cannot read the
|
|
18
|
-
* constants table, so these are the table's press release values
|
|
19
|
-
* (`timing.press`, motion/uikit/timing.ts). interactionOverlay.cell.test.ts
|
|
20
|
-
* fails if they drift.
|
|
21
|
-
*/
|
|
22
|
-
export const cellPressConsts = stylex.defineConsts({
|
|
23
|
-
/** `timing.press.highlightOutMs`, in ms. */
|
|
24
|
-
cellReleaseMs: 200,
|
|
25
|
-
/** `timing.press.highlightOutCurve`, as CSS. */
|
|
26
|
-
cellReleaseEase: 'cubic-bezier(0, 0, 0.2, 1)',
|
|
27
|
-
});
|