react-native-terra-ui 0.13.7 → 0.13.8
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/CHANGELOG.md +12 -0
- package/lib/module/components/input/hooks/use-focus-state.js +25 -0
- package/lib/module/components/input/hooks/use-focus-state.js.map +1 -0
- package/lib/module/components/input/parts/InputField.js +53 -31
- package/lib/module/components/input/parts/InputField.js.map +1 -1
- package/lib/module/components/input/variants/SearchInput/SearchCancelButton.js +93 -0
- package/lib/module/components/input/variants/SearchInput/SearchCancelButton.js.map +1 -0
- package/lib/module/components/input/variants/SearchInput/SearchClearButton.js +52 -0
- package/lib/module/components/input/variants/SearchInput/SearchClearButton.js.map +1 -0
- package/lib/module/components/input/variants/SearchInput/index.js +85 -30
- package/lib/module/components/input/variants/SearchInput/index.js.map +1 -1
- package/lib/module/components/input/variants/SearchInput/utils.js +9 -0
- package/lib/module/components/input/variants/SearchInput/utils.js.map +1 -0
- package/lib/module/components/screen/ScreenList.js +5 -1
- package/lib/module/components/screen/ScreenList.js.map +1 -1
- package/lib/module/components/screen/ScreenScrollView.js +5 -1
- package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
- package/lib/module/theme/tokens/light.js +1 -1
- package/lib/typescript/src/components/input/hooks/use-focus-state.d.ts +15 -0
- package/lib/typescript/src/components/input/hooks/use-focus-state.d.ts.map +1 -0
- package/lib/typescript/src/components/input/parts/InputField.d.ts +3 -1
- package/lib/typescript/src/components/input/parts/InputField.d.ts.map +1 -1
- package/lib/typescript/src/components/input/types.d.ts +11 -1
- package/lib/typescript/src/components/input/types.d.ts.map +1 -1
- package/lib/typescript/src/components/input/variants/SearchInput/SearchCancelButton.d.ts +19 -0
- package/lib/typescript/src/components/input/variants/SearchInput/SearchCancelButton.d.ts.map +1 -0
- package/lib/typescript/src/components/input/variants/SearchInput/SearchClearButton.d.ts +13 -0
- package/lib/typescript/src/components/input/variants/SearchInput/SearchClearButton.d.ts.map +1 -0
- package/lib/typescript/src/components/input/variants/SearchInput/index.d.ts +15 -1
- package/lib/typescript/src/components/input/variants/SearchInput/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input/variants/SearchInput/utils.d.ts +4 -0
- package/lib/typescript/src/components/input/variants/SearchInput/utils.d.ts.map +1 -0
- package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
- package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/input/hooks/use-focus-state.ts +32 -0
- package/src/components/input/parts/InputField.tsx +45 -31
- package/src/components/input/types.ts +11 -1
- package/src/components/input/variants/SearchInput/SearchCancelButton.tsx +109 -0
- package/src/components/input/variants/SearchInput/SearchClearButton.tsx +58 -0
- package/src/components/input/variants/SearchInput/index.tsx +92 -24
- package/src/components/input/variants/SearchInput/utils.ts +4 -0
- package/src/components/screen/ScreenList.tsx +3 -0
- package/src/components/screen/ScreenScrollView.tsx +3 -0
- package/src/theme/tokens/light.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","useEffect","useMemo","StyleSheet","NativeStyleSheet","Animated","useUnistyles","resolveScreenPadding","useNestedContainerWarning","useScreenRef","useScreenScrollHandler","ScreenBottomInset","ScreenHeaderContent","renderScreenPlaceholder","useScreen","hasHorizontalPadding","hasVerticalPadding","renderListComponent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenListBase","ScreenList","as","data","renderItem","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","bottomInset","extraBottomPadding","scrollHandler","externalScrollHandler","onScroll","rest","ref","isDefaultFlatList","undefined","FlatList","Component","AnimatedComponent","createAnimatedComponent","background","scrollRef","headerSnapOffsets","screenPadding","hasHeader","headerAccessoryHeight","hasLargeTitle","setContentTopPadding","contentOwnsBottomInset","platformAdjustsInsets","ownsBottomInset","mergedRef","resolvedPadding","theme","rt","y","paddingY","breakpoint","defaultTopPadding","layout","header","height","paddingTopOverride","flatten","paddingTop","contentTopPadding","resolvedLoading","placeholder","isEmpty","length","composedScrollHandler","children","View","styles","headerWrapper","footer","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","displayName","create","runtime","padding","accessoryHeight","x","flexGrow","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenList.tsx"],"mappings":";;;;AAAA,SAKEA,UAAU,EAIVC,SAAS,EACTC,OAAO,QACF,OAAO;AACd,SAIEC,UAAU,IAAIC,gBAAgB,QAEzB,cAAc;AAErB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASF,UAAU,EAAEG,YAAY,QAAQ,wBAAwB;AAEjE,SAASC,oBAAoB;AAC7B,SAASC,yBAAyB;AAClC,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,uBAAuB;AAChC,SAASC,SAAS;AAElB,SAASC,oBAAoB,EAAEC,kBAAkB,EAAEC,mBAAmB;;AAEtE;;AAKA;;AAgBA;;AAyBA;;AA+BA;;AAiBA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBA,MAAMC,cAAc,gBAAGxB,UAAU,CAAC,SAASyB,UAAUA,CACnD;EACEC,EAAE;EACFC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,qBAAqB;EACrBC,mBAAmB;EACnBC,mBAAmB;EACnBC,kBAAkB;EAClBC,UAAU,GAAG,KAAK;EAClBC,SAAS;EACTC,OAAO,GAAG,KAAK;EACfC,cAAc;EACdC,gBAAgB;EAChBC,YAAY;EACZC,cAAc;EACdC,cAAc;EACdC,OAAO;EACPC,W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CAACe,mBAAmB,CAAC,eACzCb,IAAA,CAACR,iBAAiB,IAAE,CAAC;EAAA,CACrB,CAAC,GAEHqB,mBACD;EAED,oBACEb,IAAA,CAACmC,iBAAiB;IAChBL,GAAG,EAAEkB,SAAU;IACfxC,IAAI,EAAEuD,eAAe,GAAG,EAAE,GAAGvD,IAAK;IAClCC,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAE,CAAC;MAAE+D,eAAe,EAAEpC;IAAW,CAAC,EAAE3B,KAAK,CAAE;IAChDK,UAAU,EAAEA;IACZ;AACN;AACA;AACA;AACA,MAJM;IAKA2D,8BAA8B,EAAE5B,qBAAqB,GAAG,WAAW,GAAG,OAAQ;IAC9E6B,gCAAgC,EAAE,KAAM;IACxCC,yCAAyC,EAAE,
|
|
1
|
+
{"version":3,"names":["forwardRef","useEffect","useMemo","StyleSheet","NativeStyleSheet","Animated","useUnistyles","resolveScreenPadding","useNestedContainerWarning","useScreenRef","useScreenScrollHandler","ScreenBottomInset","ScreenHeaderContent","renderScreenPlaceholder","useScreen","hasHorizontalPadding","hasVerticalPadding","renderListComponent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ScreenListBase","ScreenList","as","data","renderItem","style","contentContainerStyle","ListHeaderComponent","ListFooterComponent","ListEmptyComponent","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","bottomInset","extraBottomPadding","scrollHandler","externalScrollHandler","onScroll","rest","ref","isDefaultFlatList","undefined","FlatList","Component","AnimatedComponent","createAnimatedComponent","background","scrollRef","headerSnapOffsets","screenPadding","hasHeader","headerAccessoryHeight","hasLargeTitle","setContentTopPadding","contentOwnsBottomInset","platformAdjustsInsets","ownsBottomInset","mergedRef","resolvedPadding","theme","rt","y","paddingY","breakpoint","defaultTopPadding","layout","header","height","paddingTopOverride","flatten","paddingTop","contentTopPadding","resolvedLoading","placeholder","isEmpty","length","composedScrollHandler","children","View","styles","headerWrapper","footer","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","automaticallyAdjustKeyboardInsets","keyboardShouldPersistTaps","content","showsVerticalScrollIndicator","scrollEventThrottle","snapToOffsets","displayName","create","runtime","padding","accessoryHeight","x","flexGrow","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenList.tsx"],"mappings":";;;;AAAA,SAKEA,UAAU,EAIVC,SAAS,EACTC,OAAO,QACF,OAAO;AACd,SAIEC,UAAU,IAAIC,gBAAgB,QAEzB,cAAc;AAErB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASF,UAAU,EAAEG,YAAY,QAAQ,wBAAwB;AAEjE,SAASC,oBAAoB;AAC7B,SAASC,yBAAyB;AAClC,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,uBAAuB;AAChC,SAASC,SAAS;AAElB,SAASC,oBAAoB,EAAEC,kBAAkB,EAAEC,mBAAmB;;AAEtE;;AAKA;;AAgBA;;AAyBA;;AA+BA;;AAiBA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBA,MAAMC,cAAc,gBAAGxB,UAAU,CAAC,SAASyB,UAAUA,CACnD;EACEC,EAAE;EACFC,IAAI;EACJC,UAAU;EACVC,KAAK;EACLC,qBAAqB;EACrBC,mBAAmB;EACnBC,mBAAmB;EACnBC,kBAAkB;EAClBC,UAAU,GAAG,KAAK;EAClBC,SAAS;EACTC,OAAO,GAAG,KAAK;EACfC,cAAc;EACdC,gBAAgB;EAChBC,YAAY;EACZC,cAAc;EACdC,cAAc;EACdC,OAAO;EACPC,WAAW;EACXC,kBAAkB,GAAG,CAAC;EACtBC,aAAa,EAAEC,qBAAqB;EACpCC,QAAQ;EACR,GAAGC;AACgB,CAAC,EACtBC,GAAiB,EACjB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MAAM;MAAEC,CAAC;MAAEpC;IAAE,CAAC,GAAGhE,oBAAoB,CAAC8D,KAAK,EAAEmC,OAAO,CAAC/B,UAAU,CAAC;IAChE,OAAO;MACLmC,QAAQ,EAAE,CAAC;MACX;MACA;MACA;MACA5B,UAAU,EACR,CAACpB,SAAS,GAAGS,KAAK,CAACM,MAAM,CAACC,MAAM,CAACC,MAAM,GAAG6B,eAAe,GAAG,CAAC,KAC5D1F,kBAAkB,CAACyF,OAAO,CAAC,IAAI,CAAC3C,aAAa,GAAGS,CAAC,GAAG,CAAC,CAAC;MACzDsC,iBAAiB,EAAE9F,oBAAoB,CAAC0F,OAAO,CAAC,GAAGE,CAAC,GAAG,CAAC;MACxDG,aAAa,EAAE,CAACnE,WAAW,KAAK3B,kBAAkB,CAACyF,OAAO,CAAC,GAAGlC,CAAC,GAAG,CAAC,CAAC,IAAI3B,kBAAkB;MAAAmE,iBAAA;IAC5F,CAAC;EACH,CAAC;EACDrB,aAAa,EAAGe,OAA6B,KAAM;IACjDO,gBAAgB,EAAEjG,oBAAoB,CAAC0F,OAAO,CAAC,GAAG,CAAClG,oBAAoB,CAAC8D,KAAK,EAAEmC,OAAO,CAAC/B,UAAU,CAAC,CAACkC,CAAC,GAAG,CAAC;IAAAI,iBAAA;EAC1G,CAAC;AACH,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -93,7 +93,11 @@ export const ScreenScrollView = /*#__PURE__*/forwardRef(function ScreenScrollVie
|
|
|
93
93
|
*/,
|
|
94
94
|
contentInsetAdjustmentBehavior: platformAdjustsInsets ? "automatic" : "never",
|
|
95
95
|
automaticallyAdjustContentInsets: false,
|
|
96
|
-
automaticallyAdjustsScrollIndicatorInsets: false
|
|
96
|
+
automaticallyAdjustsScrollIndicatorInsets: false
|
|
97
|
+
// iOS: inset by the keyboard so a focused field can scroll above it.
|
|
98
|
+
,
|
|
99
|
+
automaticallyAdjustKeyboardInsets: true,
|
|
100
|
+
keyboardShouldPersistTaps: "handled",
|
|
97
101
|
showsVerticalScrollIndicator: false,
|
|
98
102
|
scrollEventThrottle: 16,
|
|
99
103
|
contentContainerStyle: [styles.scrollContent(hasHeader, hasLargeTitle, resolvedPadding, extraBottomPadding, headerAccessoryHeight), contentContainerStyle],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Children","forwardRef","useCallback","Animated","StyleSheet","resolveScreenPadding","useNestedContainerWarning","useScreenRef","useScreenScrollHandler","ScreenBottomInset","ScreenHeaderContent","renderScreenPlaceholder","useScreen","hasHorizontalPadding","hasVerticalPadding","jsx","_jsx","jsxs","_jsxs","ScreenScrollView","children","style","contentContainerStyle","contentStyle","scrollHandler","externalScrollHandler","onScroll","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","extraBottomPadding","isEmpty","rest","ref","scrollRef","screenPadding","hasHeader","headerAccessoryHeight","hasLargeTitle","setContentTopPadding","background","contentOwnsBottomInset","platformAdjustsInsets","ownsBottomInset","resolvedPadding","mergedRef","placeholder","undefined","toArray","length","composedScrollHandler","handleHeaderWrapperLayout","event","nativeEvent","layout","y","ScrollView","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","showsVerticalScrollIndicator","scrollEventThrottle","styles","scrollContent","View","headerWrapper","onLayout","content","displayName","create","theme","runtime","padding","accessoryHeight","x","breakpoint","flexGrow","paddingTop","header","height","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal","flexDirection"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenScrollView.tsx"],"mappings":";;;AAAA,SAASA,QAAQ,EAAqBC,UAAU,EAAkBC,WAAW,QAAQ,OAAO;AAU5F,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,oBAAoB;AAC7B,SAASC,yBAAyB;AAClC,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;A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U;IAC/FrB,YAAY,EAAEA,YAAY,KAAKqB,SAAS,GAAGrB,YAAY,GAAGC,cAAc;IACxEI,OAAO,EAAEA,OAAO,IAAIrC,QAAQ,CAACsD,OAAO,CAAClC,QAAQ,CAAC,CAACmC,MAAM,KAAK;EAC5D,CAAC,CAAC;EACF,MAAMC,qBAAqB,GAAGhD,sBAAsB,CAACgB,aAAa,EAAEE,QAAQ,EAAED,qBAAqB,CAAC;EACpG;EACA,MAAMgC,yBAAyB,GAAGvD,WAAW,CAC1CwD,KAAwB,IAAKb,oBAAoB,CAACa,KAAK,CAACC,WAAW,CAACC,MAAM,CAACC,CAAC,CAAC,EAC9E,CAAChB,oBAAoB,CACvB,CAAC;EAED,oBACE3B,KAAA,CAACf,QAAQ,CAAC2D,UAAU;IAClBvB,GAAG,EAAEY,SAAU;IACf9B,KAAK,EAAE,CAAC;MAAE0C,eAAe,EAAEjB;IAAW,CAAC,EAAEzB,KAAK,CAAE;IAChDM,UAAU,EAAEA;IACZ;AACR;AACA;AACA;AACA,MAJQ;IAKAqC,8BAA8B,EAAEhB,qBAAqB,GAAG,WAAW,GAAG,OAAQ;IAC9EiB,gCAAgC,EAAE,KAAM;IACxCC,yCAAyC,EAAE,
|
|
1
|
+
{"version":3,"names":["Children","forwardRef","useCallback","Animated","StyleSheet","resolveScreenPadding","useNestedContainerWarning","useScreenRef","useScreenScrollHandler","ScreenBottomInset","ScreenHeaderContent","renderScreenPlaceholder","useScreen","hasHorizontalPadding","hasVerticalPadding","jsx","_jsx","jsxs","_jsxs","ScreenScrollView","children","style","contentContainerStyle","contentStyle","scrollHandler","externalScrollHandler","onScroll","horizontal","isLoading","loading","loadingContent","LoadingComponent","emptyContent","EmptyComponent","contentPadding","margins","extraBottomPadding","isEmpty","rest","ref","scrollRef","screenPadding","hasHeader","headerAccessoryHeight","hasLargeTitle","setContentTopPadding","background","contentOwnsBottomInset","platformAdjustsInsets","ownsBottomInset","resolvedPadding","mergedRef","placeholder","undefined","toArray","length","composedScrollHandler","handleHeaderWrapperLayout","event","nativeEvent","layout","y","ScrollView","backgroundColor","contentInsetAdjustmentBehavior","automaticallyAdjustContentInsets","automaticallyAdjustsScrollIndicatorInsets","automaticallyAdjustKeyboardInsets","keyboardShouldPersistTaps","showsVerticalScrollIndicator","scrollEventThrottle","styles","scrollContent","View","headerWrapper","onLayout","content","displayName","create","theme","runtime","padding","accessoryHeight","x","breakpoint","flexGrow","paddingTop","header","height","paddingHorizontal","paddingBottom","uni__dependencies","marginHorizontal","flexDirection"],"sourceRoot":"../../../../src","sources":["components/screen/ScreenScrollView.tsx"],"mappings":";;;AAAA,SAASA,QAAQ,EAAqBC,UAAU,EAAkBC,WAAW,QAAQ,OAAO;AAU5F,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,SAASC,oBAAoB;AAC7B,SAASC,yBAAyB;AAClC,SAASC,YAAY;AACrB,SAASC,sBAAsB;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,uBAAuB;AAChC,SAASC,SAAS;AAElB,SAASC,oBAAoB,EAAEC,kBAAkB;;AAEjD;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,gBAAGlB,UAAU,CACxC,SAASkB,gBAAgBA,CACvB;EACEC,QAAQ;EACRC,KAAK;EACLC,qBAAqB;EACrBC,YAAY;EACZC,aAAa,EAAEC,qBAAqB;EACpCC,QAAQ;EACRC,UAAU,GAAG,KAAK;EAClBC,SAAS;EACTC,OAAO,GAAG,KAAK;EACfC,cAAc;EACdC,gBAAgB;EAChBC,YAAY;EACZC,cAAc;EACdC,cAAc;EACdC,OAAO;EACPC,kBAAkB,GAAG,CAAC;EACtBC,OAAO;EACP,GAAGC;AACL,CAAC,EACD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AAC,GAAGxD,oBAAoB,CAAC0E,KAAK,EAAEC,OAAO,CAACI,UAAU,CAAC;IAChE,OAAO;MACLC,QAAQ,EAAE,CAAC;MACX;MACA;MACA;MACAC,UAAU,EACR,CAAC5C,SAAS,GAAGqC,KAAK,CAACnB,MAAM,CAAC2B,MAAM,CAACC,MAAM,GAAGN,eAAe,GAAG,CAAC,KAC5DpE,kBAAkB,CAACmE,OAAO,CAAC,IAAI,CAACrC,aAAa,GAAGiB,CAAC,GAAG,CAAC,CAAC;MACzD4B,iBAAiB,EAAE5E,oBAAoB,CAACoE,OAAO,CAAC,GAAGE,CAAC,GAAG,CAAC;MACxDO,aAAa,EAAE,CAAC5E,kBAAkB,CAACmE,OAAO,CAAC,GAAGpB,CAAC,GAAG,CAAC,IAAIzB,kBAAkB;MAAAuD,iBAAA;IAC3E,CAAC;EACH,CAAC;EACDjB,aAAa,EAAGO,OAA6B,KAAM;IACjDW,gBAAgB,EAAE/E,oBAAoB,CAACoE,OAAO,CAAC,GAAG,CAAC5E,oBAAoB,CAAC0E,KAAK,EAAEC,OAAO,CAACI,UAAU,CAAC,CAACD,CAAC,GAAG,CAAC;IAAAQ,iBAAA;EAC1G,CAAC,CAAC;EACFf,OAAO,EAAGjD,UAAmB,KAAM;IAAE0D,QAAQ,EAAE,CAAC;IAAEQ,aAAa,EAAElE,UAAU,GAAG,KAAK,GAAG;EAAS,CAAC;AAClG,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ export const light = {
|
|
|
12
12
|
"color.surface.sunken": "{palette.neutral.100}",
|
|
13
13
|
// Text
|
|
14
14
|
"color.text.primary": "{palette.neutral.950}",
|
|
15
|
-
"color.text.secondary": "#
|
|
15
|
+
"color.text.secondary": "#55555d",
|
|
16
16
|
"color.text.tertiary": "#6e6e76",
|
|
17
17
|
"color.text.disabled": "#d4d4d8",
|
|
18
18
|
"color.text.inverse": "{palette.white}",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TextInputProps } from "react-native";
|
|
2
|
+
type FocusHandler = NonNullable<TextInputProps["onFocus"]>;
|
|
3
|
+
type BlurHandler = NonNullable<TextInputProps["onBlur"]>;
|
|
4
|
+
/**
|
|
5
|
+
* Track whether a `TextInput` is focused while still forwarding the caller's
|
|
6
|
+
* own `onFocus` / `onBlur`. Shared by the field (for its focus ring) and by
|
|
7
|
+
* variants that show extra controls while focused.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useFocusState(onFocus?: FocusHandler, onBlur?: BlurHandler): {
|
|
10
|
+
isFocused: boolean;
|
|
11
|
+
handleFocus: (e: import("react-native").TextInputFocusEvent) => unknown;
|
|
12
|
+
handleBlur: (e: import("react-native/types_generated/Libraries/Components/TextInput/TextInput.flow").TextInputBlurEvent) => unknown;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=use-focus-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-focus-state.d.ts","sourceRoot":"","sources":["../../../../../../src/components/input/hooks/use-focus-state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,KAAK,YAAY,GAAG,WAAW,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC;AAC3D,KAAK,WAAW,GAAG,WAAW,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,WAAW;;;;EAoBzE"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { InputBaseProps } from "../types.js";
|
|
1
|
+
import type { InputBaseProps, InputSize } from "../types.js";
|
|
2
|
+
/** Container height per size, in dp. Sibling controls sized to match read from here. */
|
|
3
|
+
export declare const FIELD_HEIGHT: Record<InputSize, number>;
|
|
2
4
|
/**
|
|
3
5
|
* The field every input in the family renders: a themed container with optional
|
|
4
6
|
* leading and trailing slots around a native `TextInput`. Internal — consumers
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/input/parts/InputField.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InputField.d.ts","sourceRoot":"","sources":["../../../../../../src/components/input/parts/InputField.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAU,CAAC;AAE1D,wFAAwF;AACxF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAA8B,CAAC;AASlF;;;;GAIG;AACH,eAAO,MAAM,UAAU,oMAqDrB,CAAC"}
|
|
@@ -21,8 +21,18 @@ export interface InputBaseProps extends Omit<TextInputProps, "style" | "editable
|
|
|
21
21
|
trailing?: ReactNode;
|
|
22
22
|
/** Fill token. Defaults to `'surface.sunken'`. */
|
|
23
23
|
background?: ColorToken;
|
|
24
|
-
/** Corner radius. Defaults to `'
|
|
24
|
+
/** Corner radius. Defaults to `'lg'`; `Input.Search` uses `'full'`. */
|
|
25
25
|
radius?: RadiusKey;
|
|
26
|
+
/** Border colour while focused. Defaults to `undefined` — the resting border stays. */
|
|
27
|
+
focusBorderColor?: ColorToken;
|
|
28
|
+
/** Border width while focused, in dp. Defaults to `undefined` — the resting hairline stays. */
|
|
29
|
+
focusBorderWidth?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Surround the field with a soft glow while focused, tinted by
|
|
32
|
+
* `focusBorderColor` or `border.default` when that is unset. Defaults to
|
|
33
|
+
* `false`; `Input.Search` turns it on.
|
|
34
|
+
*/
|
|
35
|
+
hasFocusGlow?: boolean;
|
|
26
36
|
/** Merged over the container's own style. */
|
|
27
37
|
style?: StyleProp<ViewStyle>;
|
|
28
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,wCAAwC;AACxC,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,UAAU,CAAC;IAChF,sDAAsD;IACtD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sDAAsD;IACtD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kDAAkD;IAClD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,wCAAwC;AACxC,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C;;;;GAIG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,UAAU,CAAC;IAChF,sDAAsD;IACtD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sDAAsD;IACtD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,kDAAkD;IAClD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,uEAAuE;IACvE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,uFAAuF;IACvF,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,+FAA+F;IAC/F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ColorToken } from "../../../../theme/types";
|
|
2
|
+
import type { InputSize } from "../../types.js";
|
|
3
|
+
interface SearchCancelButtonProps {
|
|
4
|
+
/** Slides the button in when `true` and out when `false`. */
|
|
5
|
+
isVisible: boolean;
|
|
6
|
+
size: InputSize;
|
|
7
|
+
/** Fill token, matched to the field it sits beside. */
|
|
8
|
+
background: ColorToken;
|
|
9
|
+
accessibilityLabel: string;
|
|
10
|
+
onPress: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A round button the height of the field, in a slot that opens and closes
|
|
14
|
+
* beside it. The slot stays mounted so it can animate out; while collapsed it
|
|
15
|
+
* is hidden from touch and from screen readers.
|
|
16
|
+
*/
|
|
17
|
+
export declare function SearchCancelButton({ isVisible, size, background, accessibilityLabel, onPress, }: SearchCancelButtonProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=SearchCancelButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchCancelButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/input/variants/SearchInput/SearchCancelButton.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAa,CAAC;AAY7C,UAAU,uBAAuB;IAC/B,6DAA6D;IAC7D,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,uDAAuD;IACvD,UAAU,EAAE,UAAU,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,OAAO,GACR,EAAE,uBAAuB,+BAuCzB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InputSize } from "../../types.js";
|
|
2
|
+
interface SearchClearButtonProps {
|
|
3
|
+
size: InputSize;
|
|
4
|
+
accessibilityLabel: string;
|
|
5
|
+
onPress: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A solid disc with an x, like iOS's `xmark.circle.fill`. Sized to the field's
|
|
9
|
+
* glyphs so it sits in the trailing slot without changing the row height.
|
|
10
|
+
*/
|
|
11
|
+
export declare function SearchClearButton({ size, accessibilityLabel, onPress }: SearchClearButtonProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=SearchClearButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchClearButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/input/variants/SearchInput/SearchClearButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAa,CAAC;AAY7C,UAAU,sBAAsB;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,EAAE,sBAAsB,+BAmB9F"}
|
|
@@ -9,15 +9,29 @@ export interface SearchInputProps extends Omit<InputBaseProps, "leading" | "trai
|
|
|
9
9
|
isClearable?: boolean;
|
|
10
10
|
/** Accessible name of the clear button. Defaults to `'Clear search'`. */
|
|
11
11
|
clearAccessibilityLabel?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Show a round cancel button beside the field while it is focused. Pressing it
|
|
14
|
+
* blurs the field and calls `onCancelPress`. Defaults to `false`.
|
|
15
|
+
*/
|
|
16
|
+
hasCancelButton?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Called when the cancel button is pressed, after the field has blurred. The
|
|
19
|
+
* text is left alone; clear it here if cancelling should also reset the query.
|
|
20
|
+
*/
|
|
21
|
+
onCancelPress?: () => void;
|
|
22
|
+
/** Accessible name of the cancel button. Defaults to `'Cancel search'`. */
|
|
23
|
+
cancelAccessibilityLabel?: string;
|
|
12
24
|
}
|
|
13
25
|
/**
|
|
14
26
|
* A search field: a leading magnifier, and a clear button that appears as soon
|
|
15
27
|
* as there is text. Controlled through `value` or left to manage its own, and
|
|
16
|
-
* it defaults to the search return key so the keyboard reads correctly.
|
|
28
|
+
* it defaults to the search return key so the keyboard reads correctly. With
|
|
29
|
+
* `hasCancelButton`, a round cancel button slides in beside it while focused.
|
|
17
30
|
*
|
|
18
31
|
* @example
|
|
19
32
|
* ```tsx
|
|
20
33
|
* <Input.Search value={query} onChangeText={setQuery} onSubmitEditing={run} />
|
|
34
|
+
* <Input.Search hasCancelButton onCancelPress={() => setQuery("")} />
|
|
21
35
|
* ```
|
|
22
36
|
*/
|
|
23
37
|
export declare const SearchInput: import("react").ForwardRefExoticComponent<SearchInputProps & import("react").RefAttributes<import("react-native/types_generated/Libraries/Components/TextInput/TextInput.flow")._TextInputInstance>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/input/variants/SearchInput/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/input/variants/SearchInput/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAa,CAAC;AAKlD,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,UAAU,CAAC;IACpF;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,oEAAoE;IACpE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,2EAA2E;IAC3E,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,sMA8HtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/input/variants/SearchInput/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAa,CAAC;AAE7C,kFAAkF;AAClF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenList.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenList.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAE1B,KAAK,WAAW,EAEhB,K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AAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAatB,OAAO,KAAK,EAAwB,qBAAqB,EAAE,MAAM,YAAS,CAAC;AAG3E,qFAAqF;AACrF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE,qBAAqB;IACvG,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ScreenScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/ScreenScrollView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAC7F,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAatB,OAAO,KAAK,EAAwB,qBAAqB,EAAE,MAAM,YAAS,CAAC;AAG3E,qFAAqF;AACrF,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE,qBAAqB;IACvG,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,8MA8F5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
import type { TextInputProps } from "react-native";
|
|
3
|
+
|
|
4
|
+
type FocusHandler = NonNullable<TextInputProps["onFocus"]>;
|
|
5
|
+
type BlurHandler = NonNullable<TextInputProps["onBlur"]>;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Track whether a `TextInput` is focused while still forwarding the caller's
|
|
9
|
+
* own `onFocus` / `onBlur`. Shared by the field (for its focus ring) and by
|
|
10
|
+
* variants that show extra controls while focused.
|
|
11
|
+
*/
|
|
12
|
+
export function useFocusState(onFocus?: FocusHandler, onBlur?: BlurHandler) {
|
|
13
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
14
|
+
|
|
15
|
+
const handleFocus = useCallback<FocusHandler>(
|
|
16
|
+
(event) => {
|
|
17
|
+
setIsFocused(true);
|
|
18
|
+
onFocus?.(event);
|
|
19
|
+
},
|
|
20
|
+
[onFocus]
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const handleBlur = useCallback<BlurHandler>(
|
|
24
|
+
(event) => {
|
|
25
|
+
setIsFocused(false);
|
|
26
|
+
onBlur?.(event);
|
|
27
|
+
},
|
|
28
|
+
[onBlur]
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return { isFocused, handleFocus, handleBlur };
|
|
32
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentRef, forwardRef
|
|
1
|
+
import { type ComponentRef, forwardRef } from "react";
|
|
2
2
|
import { TextInput, View } from "react-native";
|
|
3
3
|
|
|
4
4
|
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
@@ -6,8 +6,12 @@ import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
|
6
6
|
import type { ColorToken, RadiusKey } from "#theme/types";
|
|
7
7
|
import { resolveThemeColor } from "#utils/resolve-theme-color";
|
|
8
8
|
import { FONT_WEIGHT_VALUE, SYSTEM_FONT } from "#utils/typography";
|
|
9
|
+
import { useFocusState } from "../hooks/use-focus-state";
|
|
9
10
|
import type { InputBaseProps, InputSize } from "../types";
|
|
10
11
|
|
|
12
|
+
/** Container height per size, in dp. Sibling controls sized to match read from here. */
|
|
13
|
+
export const FIELD_HEIGHT: Record<InputSize, number> = { sm: 36, md: 44, lg: 52 };
|
|
14
|
+
|
|
11
15
|
/** Typographic role of the text, per size. */
|
|
12
16
|
const TEXT_VARIANT: Record<InputSize, "subheadline" | "callout" | "body"> = {
|
|
13
17
|
sm: "subheadline",
|
|
@@ -25,6 +29,9 @@ export const InputField = forwardRef<ComponentRef<typeof TextInput>, InputBasePr
|
|
|
25
29
|
size = "md",
|
|
26
30
|
isDisabled = false,
|
|
27
31
|
isInvalid = false,
|
|
32
|
+
focusBorderColor,
|
|
33
|
+
focusBorderWidth,
|
|
34
|
+
hasFocusGlow = false,
|
|
28
35
|
leading,
|
|
29
36
|
trailing,
|
|
30
37
|
background = "surface.sunken",
|
|
@@ -36,32 +43,24 @@ export const InputField = forwardRef<ComponentRef<typeof TextInput>, InputBasePr
|
|
|
36
43
|
},
|
|
37
44
|
ref
|
|
38
45
|
) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// as a prop rather than as a style.
|
|
42
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
43
|
-
const { theme } = useUnistyles();
|
|
44
|
-
|
|
45
|
-
const handleFocus = useCallback<NonNullable<InputBaseProps["onFocus"]>>(
|
|
46
|
-
(event) => {
|
|
47
|
-
setIsFocused(true);
|
|
48
|
-
onFocus?.(event);
|
|
49
|
-
},
|
|
50
|
-
[onFocus]
|
|
51
|
-
);
|
|
46
|
+
const { isFocused, handleFocus, handleBlur } = useFocusState(onFocus, onBlur);
|
|
47
|
+
const showsFocus = isFocused && !isDisabled;
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
onBlur?.(event);
|
|
57
|
-
},
|
|
58
|
-
[onBlur]
|
|
59
|
-
);
|
|
49
|
+
// The placeholder colour has to leave the stylesheet because `TextInput` takes
|
|
50
|
+
// it as a prop rather than as a style.
|
|
51
|
+
const { theme } = useUnistyles();
|
|
60
52
|
|
|
61
|
-
styles.useVariants({ size, disabled: isDisabled, invalid: isInvalid
|
|
53
|
+
styles.useVariants({ size, disabled: isDisabled, invalid: isInvalid });
|
|
62
54
|
|
|
63
55
|
return (
|
|
64
|
-
<View
|
|
56
|
+
<View
|
|
57
|
+
style={[
|
|
58
|
+
styles.container,
|
|
59
|
+
styles.fill(background, radius),
|
|
60
|
+
showsFocus && styles.focus(focusBorderColor, focusBorderWidth, hasFocusGlow, isInvalid),
|
|
61
|
+
style,
|
|
62
|
+
]}
|
|
63
|
+
>
|
|
65
64
|
{leading}
|
|
66
65
|
<TextInput
|
|
67
66
|
ref={ref}
|
|
@@ -97,13 +96,9 @@ const styles = StyleSheet.create((theme) => {
|
|
|
97
96
|
borderColor: theme.color["border.subtle"],
|
|
98
97
|
variants: {
|
|
99
98
|
size: {
|
|
100
|
-
sm: { height:
|
|
101
|
-
md: { height:
|
|
102
|
-
lg: { height:
|
|
103
|
-
},
|
|
104
|
-
focused: {
|
|
105
|
-
true: { borderColor: theme.color["accent.border"] },
|
|
106
|
-
false: {},
|
|
99
|
+
sm: { height: FIELD_HEIGHT.sm, paddingHorizontal: theme.spacing["3"], gap: 6 },
|
|
100
|
+
md: { height: FIELD_HEIGHT.md, paddingHorizontal: theme.spacing["3"], gap: 6 },
|
|
101
|
+
lg: { height: FIELD_HEIGHT.lg, paddingHorizontal: theme.spacing["4"], gap: 6 },
|
|
107
102
|
},
|
|
108
103
|
invalid: {
|
|
109
104
|
true: { borderColor: theme.color["danger.text"] },
|
|
@@ -115,6 +110,26 @@ const styles = StyleSheet.create((theme) => {
|
|
|
115
110
|
},
|
|
116
111
|
},
|
|
117
112
|
},
|
|
113
|
+
// Only the keys that apply are set, so an unset option leaves the resting
|
|
114
|
+
// border alone rather than overriding it with `undefined`. An invalid field
|
|
115
|
+
// keeps its danger border and skips the glow, so the error stays the loudest
|
|
116
|
+
// signal; only the width still follows focus.
|
|
117
|
+
focus: (
|
|
118
|
+
color: ColorToken | undefined,
|
|
119
|
+
width: number | undefined,
|
|
120
|
+
hasGlow: boolean,
|
|
121
|
+
isInvalid: boolean
|
|
122
|
+
) => {
|
|
123
|
+
const focusColor = resolveThemeColor(color ?? "border.default", theme);
|
|
124
|
+
return {
|
|
125
|
+
...(width !== undefined && { borderWidth: width }),
|
|
126
|
+
...(color && !isInvalid && { borderColor: focusColor }),
|
|
127
|
+
...(hasGlow &&
|
|
128
|
+
!isInvalid && {
|
|
129
|
+
boxShadow: [{ offsetX: 0, offsetY: 0, blurRadius: 4, spreadDistance: 1, color: focusColor }],
|
|
130
|
+
}),
|
|
131
|
+
};
|
|
132
|
+
},
|
|
118
133
|
// `background` is an open `ColorToken` and `radius` an eight-step scale, so
|
|
119
134
|
// both resolve in a dynamic function rather than enumerating as variants.
|
|
120
135
|
fill: (background: ColorToken, radius: RadiusKey) => ({
|
|
@@ -137,7 +152,6 @@ const styles = StyleSheet.create((theme) => {
|
|
|
137
152
|
md: { fontSize: theme.typography.variants[TEXT_VARIANT.md].fontSize },
|
|
138
153
|
lg: { fontSize: theme.typography.variants[TEXT_VARIANT.lg].fontSize },
|
|
139
154
|
},
|
|
140
|
-
focused: { true: {}, false: {} },
|
|
141
155
|
invalid: { true: {}, false: {} },
|
|
142
156
|
disabled: { true: {}, false: {} },
|
|
143
157
|
},
|
|
@@ -24,8 +24,18 @@ export interface InputBaseProps extends Omit<TextInputProps, "style" | "editable
|
|
|
24
24
|
trailing?: ReactNode;
|
|
25
25
|
/** Fill token. Defaults to `'surface.sunken'`. */
|
|
26
26
|
background?: ColorToken;
|
|
27
|
-
/** Corner radius. Defaults to `'
|
|
27
|
+
/** Corner radius. Defaults to `'lg'`; `Input.Search` uses `'full'`. */
|
|
28
28
|
radius?: RadiusKey;
|
|
29
|
+
/** Border colour while focused. Defaults to `undefined` — the resting border stays. */
|
|
30
|
+
focusBorderColor?: ColorToken;
|
|
31
|
+
/** Border width while focused, in dp. Defaults to `undefined` — the resting hairline stays. */
|
|
32
|
+
focusBorderWidth?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Surround the field with a soft glow while focused, tinted by
|
|
35
|
+
* `focusBorderColor` or `border.default` when that is unset. Defaults to
|
|
36
|
+
* `false`; `Input.Search` turns it on.
|
|
37
|
+
*/
|
|
38
|
+
hasFocusGlow?: boolean;
|
|
29
39
|
/** Merged over the container's own style. */
|
|
30
40
|
style?: StyleProp<ViewStyle>;
|
|
31
41
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
|
|
3
|
+
import Animated, {
|
|
4
|
+
Easing,
|
|
5
|
+
interpolate,
|
|
6
|
+
useAnimatedStyle,
|
|
7
|
+
useSharedValue,
|
|
8
|
+
withTiming,
|
|
9
|
+
} from "react-native-reanimated";
|
|
10
|
+
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
11
|
+
|
|
12
|
+
import type { ColorToken } from "#theme/types";
|
|
13
|
+
import { resolveThemeColor } from "#utils/resolve-theme-color";
|
|
14
|
+
import { Icon } from "../../../icon";
|
|
15
|
+
import { PressableOpacity } from "../../../pressable";
|
|
16
|
+
import { FIELD_HEIGHT } from "../../parts/InputField";
|
|
17
|
+
import type { InputSize } from "../../types";
|
|
18
|
+
import { ICON_SIZE } from "./utils";
|
|
19
|
+
|
|
20
|
+
/** How long the button takes to slide in and the field to make room, in ms. */
|
|
21
|
+
const TRANSITION_MS = 250;
|
|
22
|
+
|
|
23
|
+
/** Scale the button grows from, so it pops in rather than only fading. */
|
|
24
|
+
const START_SCALE = 0.6;
|
|
25
|
+
|
|
26
|
+
/** The x runs a touch larger than the field's glyphs; it has a circle to itself. */
|
|
27
|
+
const GLYPH_EXTRA = 2;
|
|
28
|
+
|
|
29
|
+
interface SearchCancelButtonProps {
|
|
30
|
+
/** Slides the button in when `true` and out when `false`. */
|
|
31
|
+
isVisible: boolean;
|
|
32
|
+
size: InputSize;
|
|
33
|
+
/** Fill token, matched to the field it sits beside. */
|
|
34
|
+
background: ColorToken;
|
|
35
|
+
accessibilityLabel: string;
|
|
36
|
+
onPress: () => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A round button the height of the field, in a slot that opens and closes
|
|
41
|
+
* beside it. The slot stays mounted so it can animate out; while collapsed it
|
|
42
|
+
* is hidden from touch and from screen readers.
|
|
43
|
+
*/
|
|
44
|
+
export function SearchCancelButton({
|
|
45
|
+
isVisible,
|
|
46
|
+
size,
|
|
47
|
+
background,
|
|
48
|
+
accessibilityLabel,
|
|
49
|
+
onPress,
|
|
50
|
+
}: SearchCancelButtonProps) {
|
|
51
|
+
// One progress value drives the slot's width, so the field (flex: 1) gives
|
|
52
|
+
// up its room frame by frame instead of jumping when the button appears.
|
|
53
|
+
const { theme } = useUnistyles();
|
|
54
|
+
const progress = useSharedValue(0);
|
|
55
|
+
const diameter = FIELD_HEIGHT[size];
|
|
56
|
+
// The gap lives inside the slot, so it opens with the button and the field
|
|
57
|
+
// sits flush to the edge when the button is gone.
|
|
58
|
+
const slotWidth = diameter + theme.spacing["2"];
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
progress.value = withTiming(isVisible ? 1 : 0, {
|
|
62
|
+
duration: TRANSITION_MS,
|
|
63
|
+
easing: Easing.bezier(0.25, 0.1, 0.25, 1),
|
|
64
|
+
});
|
|
65
|
+
}, [isVisible, progress]);
|
|
66
|
+
|
|
67
|
+
const slotStyle = useAnimatedStyle(() => ({
|
|
68
|
+
width: progress.value * slotWidth,
|
|
69
|
+
opacity: progress.value,
|
|
70
|
+
transform: [{ scale: interpolate(progress.value, [0, 1], [START_SCALE, 1]) }],
|
|
71
|
+
}));
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<Animated.View
|
|
75
|
+
style={[styles.slot(isVisible), slotStyle]}
|
|
76
|
+
accessibilityElementsHidden={!isVisible}
|
|
77
|
+
importantForAccessibility={isVisible ? "auto" : "no-hide-descendants"}
|
|
78
|
+
>
|
|
79
|
+
<PressableOpacity
|
|
80
|
+
accessibilityLabel={accessibilityLabel}
|
|
81
|
+
accessibilityRole="button"
|
|
82
|
+
onPress={onPress}
|
|
83
|
+
style={styles.button(diameter, background)}
|
|
84
|
+
>
|
|
85
|
+
<Icon name="terra.x" size={ICON_SIZE[size] + GLYPH_EXTRA} color="text.primary" />
|
|
86
|
+
</PressableOpacity>
|
|
87
|
+
</Animated.View>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const styles = StyleSheet.create((theme) => ({
|
|
92
|
+
slot: (isVisible: boolean) => ({
|
|
93
|
+
flexDirection: "row",
|
|
94
|
+
justifyContent: "flex-end",
|
|
95
|
+
overflow: "hidden",
|
|
96
|
+
pointerEvents: isVisible ? "auto" : "none",
|
|
97
|
+
}),
|
|
98
|
+
// A circle the height of the field, filled and edged to match it.
|
|
99
|
+
button: (diameter: number, background: ColorToken) => ({
|
|
100
|
+
width: diameter,
|
|
101
|
+
height: diameter,
|
|
102
|
+
borderRadius: diameter / 2,
|
|
103
|
+
alignItems: "center",
|
|
104
|
+
justifyContent: "center",
|
|
105
|
+
backgroundColor: resolveThemeColor(background, theme),
|
|
106
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
107
|
+
borderColor: theme.color["border.subtle"],
|
|
108
|
+
}),
|
|
109
|
+
}));
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Pressable } from "react-native";
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
4
|
+
|
|
5
|
+
import { Icon } from "../../../icon";
|
|
6
|
+
import type { InputSize } from "../../types";
|
|
7
|
+
import { ICON_SIZE } from "./utils";
|
|
8
|
+
|
|
9
|
+
/** Touch expansion around the button, in dp — it is smaller than a cell. */
|
|
10
|
+
const HIT_SLOP = 8;
|
|
11
|
+
|
|
12
|
+
/** The x as a share of its disc, so it reads inside the circle. */
|
|
13
|
+
const GLYPH_RATIO = 0.6;
|
|
14
|
+
|
|
15
|
+
/** Heavier than the icon default so the small glyph stays legible on the disc. */
|
|
16
|
+
const GLYPH_STROKE_WIDTH = 3.3;
|
|
17
|
+
|
|
18
|
+
interface SearchClearButtonProps {
|
|
19
|
+
size: InputSize;
|
|
20
|
+
accessibilityLabel: string;
|
|
21
|
+
onPress: () => void;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A solid disc with an x, like iOS's `xmark.circle.fill`. Sized to the field's
|
|
26
|
+
* glyphs so it sits in the trailing slot without changing the row height.
|
|
27
|
+
*/
|
|
28
|
+
export function SearchClearButton({ size, accessibilityLabel, onPress }: SearchClearButtonProps) {
|
|
29
|
+
const diameter = ICON_SIZE[size];
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Pressable
|
|
33
|
+
accessibilityLabel={accessibilityLabel}
|
|
34
|
+
accessibilityRole="button"
|
|
35
|
+
hitSlop={HIT_SLOP}
|
|
36
|
+
onPress={onPress}
|
|
37
|
+
style={styles.disc(diameter)}
|
|
38
|
+
>
|
|
39
|
+
<Icon
|
|
40
|
+
name="terra.x"
|
|
41
|
+
size={Math.round(diameter * GLYPH_RATIO)}
|
|
42
|
+
color="text.inverse"
|
|
43
|
+
strokeWidth={GLYPH_STROKE_WIDTH}
|
|
44
|
+
/>
|
|
45
|
+
</Pressable>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const styles = StyleSheet.create((theme) => ({
|
|
50
|
+
disc: (diameter: number) => ({
|
|
51
|
+
width: diameter,
|
|
52
|
+
height: diameter,
|
|
53
|
+
borderRadius: diameter / 2,
|
|
54
|
+
alignItems: "center",
|
|
55
|
+
justifyContent: "center",
|
|
56
|
+
backgroundColor: theme.color["text.tertiary"],
|
|
57
|
+
}),
|
|
58
|
+
}));
|