jfs-components 0.0.25 → 0.0.27
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/AppBar/AppBar.js +2 -1
- package/lib/commonjs/components/AppBar/AppBar.js.map +1 -1
- package/lib/commonjs/components/Drawer/Drawer.js +31 -12
- package/lib/commonjs/components/Drawer/Drawer.js.map +1 -1
- package/lib/commonjs/components/HStack/HStack.js +5 -5
- package/lib/commonjs/components/RadioButton/RadioButton.mdx +1 -3
- package/lib/commonjs/design-tokens/JFS Variables-variables-full.json +1 -1
- package/lib/commonjs/design-tokens/figma-variables-resolver.js +3 -9
- package/lib/commonjs/design-tokens/figma-variables-resolver.js.map +1 -2
- package/lib/commonjs/icons/registry.js +1 -1
- package/lib/module/components/AppBar/AppBar.js +2 -1
- package/lib/module/components/AppBar/AppBar.js.map +1 -1
- package/lib/module/components/Drawer/Drawer.js +31 -12
- package/lib/module/components/Drawer/Drawer.js.map +1 -1
- package/lib/module/components/HStack/HStack.js +5 -5
- package/lib/module/components/RadioButton/RadioButton.mdx +1 -3
- package/lib/module/design-tokens/JFS Variables-variables-full.json +1 -1
- package/lib/module/icons/registry.js +1 -1
- package/lib/typescript/components/Drawer/Drawer.d.ts.map +1 -1
- package/lib/typescript/icons/registry.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/AppBar/AppBar.tsx +3 -3
- package/src/components/Drawer/Drawer.tsx +31 -11
- package/src/components/HStack/HStack.tsx +5 -5
- package/src/components/RadioButton/RadioButton.mdx +1 -3
- package/src/design-tokens/JFS Variables-variables-full.json +1 -1
- package/src/icons/registry.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../src/components/Drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAsDvE,KAAK,WAAW,GAAG;IAEjB,KAAK,CAAC,EAAE,MAAM,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O,cAAc,EAAE,SAAS,CAAC,CAAA;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,WAAW,GAAG,UAAU,CAAA;IACvC,YAAY,CAAC,EAAE,GAAG,CAAA;IAClB,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,cAAc,EAAE,SAAS,CAAC,OAAO,cAAc,EAAE,SAAS,CAAC,CAAA;IAC1F,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED;;;GAGG;AACH,iBAAS,MAAM,CAAC,EAEd,KAAU,EACV,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,EACR,eAAqB,EACrB,aAAoB,EACpB,YAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,4BAAoC,EACpC,WAAgB,GACjB,EAAE,WAAW,2CAgRb;AA8BD,eAAe,MAAM,CAAA"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Auto-generated from SVG files in src/icons/
|
|
5
5
|
* DO NOT EDIT MANUALLY - Run "npm run icons:generate" to regenerate
|
|
6
6
|
*
|
|
7
|
-
* Generated: 2026-02-
|
|
7
|
+
* Generated: 2026-02-11T09:51:16.534Z
|
|
8
8
|
*/
|
|
9
9
|
export declare const iconRegistry: Record<string, {
|
|
10
10
|
path: string;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
|
|
|
2
2
|
import { View, type StyleProp, type ViewStyle, Pressable } from 'react-native'
|
|
3
3
|
import { getVariableByName } from '../../design-tokens/figma-variables-resolver'
|
|
4
4
|
import { useTokens } from '../../design-tokens/JFSThemeProvider'
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
import Avatar from '../Avatar/Avatar'
|
|
7
7
|
import NavArrow from '../NavArrow/NavArrow'
|
|
8
8
|
// We might need to import Image or Svg if we had the assets locally, but for now we'll use placeholders or standard icons for defaults.
|
|
@@ -104,7 +104,7 @@ export default function AppBar({
|
|
|
104
104
|
...rest
|
|
105
105
|
}: AppBarProps) {
|
|
106
106
|
const { modes: globalModes } = useTokens()
|
|
107
|
-
const modes = { ...globalModes, ...propModes }
|
|
107
|
+
const modes = { Context2: 'AppBar', ...globalModes, ...propModes }
|
|
108
108
|
|
|
109
109
|
const isMain = type === 'MainPage'
|
|
110
110
|
const isSub = type === 'SubPage'
|
|
@@ -149,7 +149,7 @@ export default function AppBar({
|
|
|
149
149
|
// but usually a component library provides sensible defaults.)
|
|
150
150
|
|
|
151
151
|
// Actually, let's implement the specific defaults mentioned in the plan/analysis
|
|
152
|
-
// SubPage: NavArrow props (icon, etc).
|
|
152
|
+
// SubPage: NavArrow props (icon, etc).
|
|
153
153
|
|
|
154
154
|
let defaultLeading: React.ReactNode = null
|
|
155
155
|
if (leadingSlot === undefined) {
|
|
@@ -99,7 +99,7 @@ function Drawer({
|
|
|
99
99
|
accessibilityLabel,
|
|
100
100
|
accessibilityHint,
|
|
101
101
|
contentContainerStyle,
|
|
102
|
-
showsVerticalScrollIndicator =
|
|
102
|
+
showsVerticalScrollIndicator = false,
|
|
103
103
|
bottomInset = 80,
|
|
104
104
|
}: DrawerProps) {
|
|
105
105
|
const { height: screenHeight } = useWindowDimensions()
|
|
@@ -117,11 +117,19 @@ function Drawer({
|
|
|
117
117
|
const scrollY = useSharedValue(0)
|
|
118
118
|
const scrollRef = useRef(null)
|
|
119
119
|
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
120
|
+
// Whether the drawer is currently snapped to the fully-expanded position.
|
|
121
|
+
// Set in onEnd — used to gate scroll so that an upward swipe from the
|
|
122
|
+
// collapsed state only moves the drawer (scroll kicks in after expansion).
|
|
123
|
+
const isFullyExpanded = useSharedValue(initialState === 'expanded')
|
|
124
|
+
|
|
125
|
+
// Dynamically control native ScrollView props on the UI thread:
|
|
126
|
+
// • bounces: disabled at the top so a downward swipe drags the drawer
|
|
127
|
+
// instead of rubber-banding the scroll view. Bottom bounce preserved.
|
|
128
|
+
// • scrollEnabled: disabled while the drawer is not fully expanded so
|
|
129
|
+
// that an upward swipe only raises the drawer (no simultaneous scroll).
|
|
123
130
|
const animatedScrollProps = useAnimatedProps(() => ({
|
|
124
131
|
bounces: scrollY.value > 1,
|
|
132
|
+
scrollEnabled: isFullyExpanded.value,
|
|
125
133
|
}))
|
|
126
134
|
|
|
127
135
|
// We need to know if we are currently dragging the drawer or scrolling the content
|
|
@@ -224,19 +232,31 @@ function Drawer({
|
|
|
224
232
|
? (translateY.value - minTranslateY) / totalRange
|
|
225
233
|
: 0
|
|
226
234
|
|
|
227
|
-
// Fast
|
|
235
|
+
// Fast fling → always follow the fling direction
|
|
228
236
|
if (event.velocityY < -500) {
|
|
229
237
|
scrollTo(minTranslateY)
|
|
238
|
+
isFullyExpanded.value = true
|
|
230
239
|
runOnJS(updateMode)('expanded')
|
|
231
|
-
} else if (
|
|
232
|
-
// Handle position past 50% of range → collapse
|
|
240
|
+
} else if (event.velocityY > 500) {
|
|
233
241
|
scrollTo(maxTranslateY)
|
|
242
|
+
isFullyExpanded.value = false
|
|
234
243
|
runOnJS(updateMode)('collapsed')
|
|
235
244
|
} else {
|
|
236
|
-
//
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
|
|
245
|
+
// Slow / medium gesture → use asymmetric snap thresholds.
|
|
246
|
+
// Down stroke: must cross 75% to collapse (hard to dismiss).
|
|
247
|
+
// Up stroke: must reach top 35% to expand (35% from top).
|
|
248
|
+
const isDraggingDown = event.velocityY >= 0
|
|
249
|
+
const threshold = isDraggingDown ? 0.75 : 0.35
|
|
250
|
+
|
|
251
|
+
if (currentRatio >= threshold) {
|
|
252
|
+
scrollTo(maxTranslateY)
|
|
253
|
+
isFullyExpanded.value = false
|
|
254
|
+
runOnJS(updateMode)('collapsed')
|
|
255
|
+
} else {
|
|
256
|
+
scrollTo(minTranslateY)
|
|
257
|
+
isFullyExpanded.value = true
|
|
258
|
+
runOnJS(updateMode)('expanded')
|
|
259
|
+
}
|
|
240
260
|
}
|
|
241
261
|
})
|
|
242
262
|
|
|
@@ -55,11 +55,11 @@ export const HStack = ({
|
|
|
55
55
|
const { modes: globalModes } = useTokens()
|
|
56
56
|
const modes = { ...globalModes, ...propModes }
|
|
57
57
|
|
|
58
|
-
const paddingTop = getVariableByName('
|
|
59
|
-
const paddingBottom = getVariableByName('
|
|
60
|
-
const paddingLeft = getVariableByName('
|
|
61
|
-
const paddingRight = getVariableByName('
|
|
62
|
-
const gap = getVariableByName('
|
|
58
|
+
const paddingTop = getVariableByName('hStack/padding/top', modes)
|
|
59
|
+
const paddingBottom = getVariableByName('hStack/padding/bottom', modes)
|
|
60
|
+
const paddingLeft = getVariableByName('hStack/padding/left', modes)
|
|
61
|
+
const paddingRight = getVariableByName('hStack/padding/right', modes)
|
|
62
|
+
const gap = getVariableByName('hStack/gap', modes)
|
|
63
63
|
|
|
64
64
|
const flexWrap = typeof wrap === 'boolean' ? (wrap ? 'wrap' : 'nowrap') : wrap
|
|
65
65
|
|
|
@@ -15,7 +15,6 @@ This component uses the following design token collections. Each collection supp
|
|
|
15
15
|
### Colors Router
|
|
16
16
|
- **Modes:** POC | Old
|
|
17
17
|
- **Default:** POC
|
|
18
|
-
|
|
19
18
|
## Usage
|
|
20
19
|
|
|
21
20
|
# RadioButton
|
|
@@ -88,5 +87,4 @@ This component uses the following design tokens, resolved through `getVariableBy
|
|
|
88
87
|
- **`radio/selector/size`**
|
|
89
88
|
- **`radio/width`**
|
|
90
89
|
|
|
91
|
-
All tokens support mode-based theming through the `modes` prop.
|
|
92
|
-
|
|
90
|
+
All tokens support mode-based theming through the `modes` prop.
|