jfs-components 0.0.65 → 0.0.66
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/lib/commonjs/components/CardCTA/CardCTA.js +15 -1
- package/lib/commonjs/components/Carousel/Carousel.js +22 -4
- package/lib/commonjs/components/Section/Section.js +22 -7
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/CardCTA/CardCTA.js +15 -1
- package/lib/module/components/Carousel/Carousel.js +22 -4
- package/lib/module/components/Section/Section.js +23 -8
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/src/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/CardCTA/CardCTA.tsx +13 -0
- package/src/components/Carousel/Carousel.tsx +21 -3
- package/src/components/Section/Section.tsx +29 -12
- package/src/icons/registry.ts +1 -1
|
@@ -61,8 +61,17 @@ function CardCTA({
|
|
|
61
61
|
flexDirection: 'row',
|
|
62
62
|
overflow: 'hidden'
|
|
63
63
|
};
|
|
64
|
+
|
|
65
|
+
// NOTE: `minWidth: 0` + explicit `flexShrink: 1` are required on native.
|
|
66
|
+
// Without them, Yoga's default `min-width: auto` clamps leftWrap to its
|
|
67
|
+
// single-line intrinsic text width, which steals all space from rightWrap
|
|
68
|
+
// and pushes the IconCapsule outside the card. See: text-not-wrapping
|
|
69
|
+
// inside flex rows on RN.
|
|
64
70
|
const leftWrapStyle = {
|
|
65
71
|
flex: 3,
|
|
72
|
+
flexShrink: 1,
|
|
73
|
+
flexBasis: 0,
|
|
74
|
+
minWidth: 0,
|
|
66
75
|
paddingHorizontal: leftPaddingH,
|
|
67
76
|
paddingVertical: leftPaddingV,
|
|
68
77
|
gap: leftGap,
|
|
@@ -71,13 +80,18 @@ function CardCTA({
|
|
|
71
80
|
};
|
|
72
81
|
const rightWrapStyle = {
|
|
73
82
|
flex: 2,
|
|
83
|
+
flexShrink: 1,
|
|
84
|
+
flexBasis: 0,
|
|
85
|
+
minWidth: 0,
|
|
74
86
|
paddingHorizontal: rightPaddingH,
|
|
75
87
|
paddingVertical: rightPaddingV,
|
|
76
88
|
alignItems: 'flex-end',
|
|
77
89
|
justifyContent: 'flex-start'
|
|
78
90
|
};
|
|
79
91
|
const textWrapStyle = {
|
|
80
|
-
gap: textGap
|
|
92
|
+
gap: textGap,
|
|
93
|
+
alignSelf: 'stretch',
|
|
94
|
+
minWidth: 0
|
|
81
95
|
};
|
|
82
96
|
const titleStyle = {
|
|
83
97
|
color: titleColor,
|
|
@@ -189,8 +189,26 @@ function Carousel({
|
|
|
189
189
|
onScrollBeginDrag: handleScrollBeginDrag,
|
|
190
190
|
onScrollEndDrag: handleScrollEndDrag,
|
|
191
191
|
children: items.map((child, index) => {
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
// Strict slot box: width must be honored; never grow or shrink with
|
|
193
|
+
// content, and clip anything that misbehaves (e.g. a child whose
|
|
194
|
+
// inner flex layout would otherwise leak into the next slot on
|
|
195
|
+
// native).
|
|
196
|
+
const slotStyle = {
|
|
197
|
+
width: effectiveItemWidth > 0 ? effectiveItemWidth : undefined,
|
|
198
|
+
flexGrow: 0,
|
|
199
|
+
flexShrink: 0,
|
|
200
|
+
flexBasis: effectiveItemWidth > 0 ? effectiveItemWidth : 'auto',
|
|
201
|
+
overflow: 'hidden'
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
// The cloned style forces the child's outer node to also honor the
|
|
205
|
+
// slot width strictly. Without this, a child with a weird intrinsic
|
|
206
|
+
// size can render wider than the slot and visually overflow.
|
|
207
|
+
const childOverrideStyle = {
|
|
208
|
+
width: effectiveItemWidth > 0 ? effectiveItemWidth : undefined,
|
|
209
|
+
maxWidth: effectiveItemWidth > 0 ? effectiveItemWidth : undefined,
|
|
210
|
+
flexGrow: 0,
|
|
211
|
+
flexShrink: 0
|
|
194
212
|
};
|
|
195
213
|
|
|
196
214
|
// Pass modes down to children
|
|
@@ -199,10 +217,10 @@ function Carousel({
|
|
|
199
217
|
...(child.props?.modes || {}),
|
|
200
218
|
...modes
|
|
201
219
|
},
|
|
202
|
-
style: [
|
|
220
|
+
style: [childOverrideStyle, child.props?.style]
|
|
203
221
|
}) : child;
|
|
204
222
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
205
|
-
style:
|
|
223
|
+
style: slotStyle,
|
|
206
224
|
children: childWithModes
|
|
207
225
|
}, index);
|
|
208
226
|
})
|
|
@@ -90,7 +90,14 @@ const SLOT_GRID_MAX_COLUMNS = 4;
|
|
|
90
90
|
const SLOT_GRID_STAGGER_CAP = 8;
|
|
91
91
|
const SLOT_GRID_ENTER_STAGGER_MS = 35;
|
|
92
92
|
const SLOT_GRID_EXIT_STAGGER_MS = 20;
|
|
93
|
+
const SLOT_GRID_ENTER_DURATION_MS = 220;
|
|
93
94
|
const SLOT_GRID_EXIT_DURATION_MS = 160;
|
|
95
|
+
const SLOT_GRID_HEIGHT_DURATION_MS = 280;
|
|
96
|
+
|
|
97
|
+
// Standard ease-out cubic curve. Calm, professional, no overshoot — matches
|
|
98
|
+
// system-style transitions. Defined once at module scope so it isn't
|
|
99
|
+
// re-allocated per render.
|
|
100
|
+
const SLOT_GRID_EASING = _reactNativeReanimated.Easing.out(_reactNativeReanimated.Easing.cubic);
|
|
94
101
|
const slotGridRowFlowStyle = {
|
|
95
102
|
flexDirection: 'row',
|
|
96
103
|
justifyContent: 'space-between'
|
|
@@ -136,6 +143,13 @@ const SlotGrid = /*#__PURE__*/_react.default.memo(function SlotGrid({
|
|
|
136
143
|
const containerStyle = (0, _react.useMemo)(() => ({
|
|
137
144
|
gap
|
|
138
145
|
}), [gap]);
|
|
146
|
+
// Strict `width` (not `minWidth`) so every cell in every row is exactly the
|
|
147
|
+
// same size — `space-between` then distributes identical leftover into
|
|
148
|
+
// identical inter-cell gaps on every row, which keeps column N of row 1
|
|
149
|
+
// aligned with column N of rows 2/3/etc. Cells whose label is wider than
|
|
150
|
+
// `cellWidth` simply wrap their text onto more lines (taking more vertical
|
|
151
|
+
// space; the row's height grows naturally to fit the tallest cell, and the
|
|
152
|
+
// animated-height clip springs to the new total).
|
|
139
153
|
const cellStyle = (0, _react.useMemo)(() => cellWidth !== null ? {
|
|
140
154
|
width: cellWidth
|
|
141
155
|
} : undefined, [cellWidth]);
|
|
@@ -169,8 +183,9 @@ const SlotGrid = /*#__PURE__*/_react.default.memo(function SlotGrid({
|
|
|
169
183
|
// and an explicit `height` driven by a shared value.
|
|
170
184
|
// 3. The inner view reports its natural height via `onLayout`. The first
|
|
171
185
|
// measurement snaps the shared value (no first-mount animation). Every
|
|
172
|
-
// subsequent change (e.g. expand/collapse adds or removes rows)
|
|
173
|
-
// the shared value to the new natural height
|
|
186
|
+
// subsequent change (e.g. expand/collapse adds or removes rows) eases
|
|
187
|
+
// the shared value to the new natural height with a calm ease-out
|
|
188
|
+
// timing curve — no spring, no bounce, no overshoot.
|
|
174
189
|
//
|
|
175
190
|
// Visually: the container reveals/conceals content like a curtain, and the
|
|
176
191
|
// cells never deform.
|
|
@@ -184,9 +199,9 @@ const SlotGrid = /*#__PURE__*/_react.default.memo(function SlotGrid({
|
|
|
184
199
|
animatedHeight.value = h;
|
|
185
200
|
return;
|
|
186
201
|
}
|
|
187
|
-
animatedHeight.value = (0, _reactNativeReanimated.
|
|
188
|
-
|
|
189
|
-
|
|
202
|
+
animatedHeight.value = (0, _reactNativeReanimated.withTiming)(h, {
|
|
203
|
+
duration: SLOT_GRID_HEIGHT_DURATION_MS,
|
|
204
|
+
easing: SLOT_GRID_EASING,
|
|
190
205
|
reduceMotion: _reactNativeReanimated.ReduceMotion.System
|
|
191
206
|
});
|
|
192
207
|
}, [animatedHeight]);
|
|
@@ -210,8 +225,8 @@ const SlotGrid = /*#__PURE__*/_react.default.memo(function SlotGrid({
|
|
|
210
225
|
const enterStaggerSteps = Math.min(extraOrdinal, SLOT_GRID_STAGGER_CAP);
|
|
211
226
|
const reverseOrdinal = Math.max(0, extrasCount - 1 - extraOrdinal);
|
|
212
227
|
const exitStaggerSteps = Math.min(reverseOrdinal, SLOT_GRID_STAGGER_CAP);
|
|
213
|
-
const entering = _reactNativeReanimated.FadeInUp.
|
|
214
|
-
const exiting = _reactNativeReanimated.FadeOutUp.duration(SLOT_GRID_EXIT_DURATION_MS).delay(exitStaggerSteps * SLOT_GRID_EXIT_STAGGER_MS).reduceMotion(_reactNativeReanimated.ReduceMotion.System);
|
|
228
|
+
const entering = _reactNativeReanimated.FadeInUp.duration(SLOT_GRID_ENTER_DURATION_MS).easing(SLOT_GRID_EASING).delay(enterStaggerSteps * SLOT_GRID_ENTER_STAGGER_MS).reduceMotion(_reactNativeReanimated.ReduceMotion.System);
|
|
229
|
+
const exiting = _reactNativeReanimated.FadeOutUp.duration(SLOT_GRID_EXIT_DURATION_MS).easing(SLOT_GRID_EASING).delay(exitStaggerSteps * SLOT_GRID_EXIT_STAGGER_MS).reduceMotion(_reactNativeReanimated.ReduceMotion.System);
|
|
215
230
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
216
231
|
entering: entering,
|
|
217
232
|
exiting: exiting,
|