@ledgerhq/lumen-ui-rnative 0.0.51 → 0.0.53
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/package.json +2 -2
- package/dist/src/i18n/locales/de.json +21 -1
- package/dist/src/i18n/locales/en.json +3 -0
- package/dist/src/i18n/locales/es.json +21 -1
- package/dist/src/i18n/locales/fr.json +4 -1
- package/dist/src/i18n/locales/ja.json +21 -1
- package/dist/src/i18n/locales/ko.json +21 -1
- package/dist/src/i18n/locales/pt.json +21 -1
- package/dist/src/i18n/locales/ru.json +21 -1
- package/dist/src/i18n/locales/th.json +21 -1
- package/dist/src/i18n/locales/tr.json +21 -1
- package/dist/src/i18n/locales/zh.json +21 -1
- package/dist/src/lib/Components/BaseInput/BaseInput.d.ts +1 -0
- package/dist/src/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/src/lib/Components/BaseInput/BaseInput.js +6 -2
- package/dist/src/lib/Components/BaseInput/types.d.ts +5 -1
- package/dist/src/lib/Components/BaseInput/types.d.ts.map +1 -1
- package/dist/src/lib/Components/SearchInput/SearchInput.d.ts +3 -1
- package/dist/src/lib/Components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/src/lib/Components/SearchInput/SearchInput.js +12 -2
- package/dist/src/lib/Components/SearchInput/SearchInput.stories.d.ts.map +1 -1
- package/dist/src/lib/Components/SearchInput/SearchInput.stories.js +3 -0
- package/dist/src/lib/Components/SearchInput/types.d.ts +7 -1
- package/dist/src/lib/Components/SearchInput/types.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/src/lib/Components/Tile/Tile.js +1 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.d.ts +32 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.js +75 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.d.ts +11 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.js +107 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/index.d.ts +3 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/index.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/index.js +2 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/types.d.ts +32 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/types.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/LinearGradient/types.js +1 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.d.ts +31 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.js +52 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.d.ts +10 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.js +101 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/index.d.ts +3 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/index.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/index.js +2 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/types.d.ts +32 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/types.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/RadialGradient/types.js +1 -0
- package/dist/src/lib/Components/Utility/Gradient/gradient.types.d.ts +21 -0
- package/dist/src/lib/Components/Utility/Gradient/gradient.types.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/gradient.types.js +1 -0
- package/dist/src/lib/Components/Utility/Gradient/utils/resolveGradientColor.d.ts +21 -0
- package/dist/src/lib/Components/Utility/Gradient/utils/resolveGradientColor.d.ts.map +1 -0
- package/dist/src/lib/Components/Utility/Gradient/utils/resolveGradientColor.js +38 -0
- package/dist/src/lib/Components/Utility/index.d.ts +2 -0
- package/dist/src/lib/Components/Utility/index.d.ts.map +1 -1
- package/dist/src/lib/Components/Utility/index.js +2 -0
- package/package.json +2 -2
- package/src/i18n/locales/de.json +22 -2
- package/src/i18n/locales/en.json +4 -1
- package/src/i18n/locales/es.json +22 -2
- package/src/i18n/locales/fr.json +5 -2
- package/src/i18n/locales/ja.json +22 -2
- package/src/i18n/locales/ko.json +22 -2
- package/src/i18n/locales/pt.json +22 -2
- package/src/i18n/locales/ru.json +22 -2
- package/src/i18n/locales/th.json +22 -2
- package/src/i18n/locales/tr.json +22 -2
- package/src/i18n/locales/zh.json +22 -2
- package/src/lib/Components/BaseInput/BaseInput.tsx +7 -2
- package/src/lib/Components/BaseInput/types.ts +5 -1
- package/src/lib/Components/SearchInput/SearchInput.stories.tsx +3 -0
- package/src/lib/Components/SearchInput/SearchInput.tsx +32 -8
- package/src/lib/Components/SearchInput/types.ts +7 -1
- package/src/lib/Components/Tile/Tile.tsx +1 -0
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.mdx +142 -0
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.tsx +173 -0
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.test.tsx +69 -0
- package/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.tsx +127 -0
- package/src/lib/Components/Utility/Gradient/LinearGradient/index.ts +2 -0
- package/src/lib/Components/Utility/Gradient/LinearGradient/types.ts +42 -0
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.mdx +109 -0
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.stories.tsx +148 -0
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.test.tsx +69 -0
- package/src/lib/Components/Utility/Gradient/RadialGradient/RadialGradient.tsx +102 -0
- package/src/lib/Components/Utility/Gradient/RadialGradient/index.ts +2 -0
- package/src/lib/Components/Utility/Gradient/RadialGradient/types.ts +32 -0
- package/src/lib/Components/Utility/Gradient/gradient.types.ts +22 -0
- package/src/lib/Components/Utility/Gradient/utils/resolveGradientColor.test.ts +144 -0
- package/src/lib/Components/Utility/Gradient/utils/resolveGradientColor.ts +59 -0
- package/src/lib/Components/Utility/index.ts +2 -0
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-rnative",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.52",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@gorhom/bottom-sheet": "^5.0.0",
|
|
36
|
-
"@ledgerhq/lumen-design-core": "0.0.
|
|
36
|
+
"@ledgerhq/lumen-design-core": "0.0.40",
|
|
37
37
|
"react": "~18.3.1",
|
|
38
38
|
"react-native": "~0.77.3",
|
|
39
39
|
"react-native-reanimated": "^3.0.0",
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "QR-Code scannen"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "Eingabe löschen"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "Wird geladen"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "Zurück",
|
|
14
|
+
"closeAriaLabel": "Schließen"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "Schließen"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(Öffnet in neuem Tab)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "Escanear código QR"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "Borrar entrada"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "Cargando"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "Volver",
|
|
14
|
+
"closeAriaLabel": "Cerrar"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "Cerrar"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(se abre en una pestaña nueva)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"components": {
|
|
3
3
|
"addressInput": {
|
|
4
|
-
"qrCodeAriaLabel": "Scanner le QR
|
|
4
|
+
"qrCodeAriaLabel": "Scanner le code QR"
|
|
5
5
|
},
|
|
6
6
|
"baseInput": {
|
|
7
7
|
"clearInputAriaLabel": "Effacer la saisie"
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"banner": {
|
|
17
17
|
"closeAriaLabel": "Fermer"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(s'ouvre dans un nouvel onglet)"
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "QRコードをスキャン"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "インプットを削除"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "読み込み中"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "戻る",
|
|
14
|
+
"closeAriaLabel": "閉じる"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "閉じる"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(新しいタブで開く)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "QR 코드 스캔"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "입력 값 지우기"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "로딩중"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "돌아가기",
|
|
14
|
+
"closeAriaLabel": "닫기"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "닫기"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(새 탭에서 열기)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "Escanear QR Code"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "Limpar input"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "Carregando"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "Voltar",
|
|
14
|
+
"closeAriaLabel": "Fechar"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "Fechar"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(abre em uma nova aba)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "Сканировать QR-код"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "Очистить поле"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "Загрузка"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "Назад",
|
|
14
|
+
"closeAriaLabel": "Закрыть"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "Закрыть"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(открывается в новой вкладке)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "สแกน QR Code"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "ล้างอินพุต"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "กำลังโหลด"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "ย้อนกลับ",
|
|
14
|
+
"closeAriaLabel": "ปิด"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "ปิด"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(เปิดในแท็บใหม่)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "Karekodu okut"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "Girdiyi temizle"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "Yükleniyor"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "Geri dön",
|
|
14
|
+
"closeAriaLabel": "Kapat"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "Kapat"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(yeni sekmede açılır)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
-
"components": {
|
|
2
|
+
"components": {
|
|
3
|
+
"addressInput": {
|
|
4
|
+
"qrCodeAriaLabel": "扫描二维码"
|
|
5
|
+
},
|
|
6
|
+
"baseInput": {
|
|
7
|
+
"clearInputAriaLabel": "清空输入框"
|
|
8
|
+
},
|
|
9
|
+
"spinner": {
|
|
10
|
+
"loadingAriaLabel": "加载中"
|
|
11
|
+
},
|
|
12
|
+
"bottomSheetHeader": {
|
|
13
|
+
"goBackAriaLabel": "返回",
|
|
14
|
+
"closeAriaLabel": "关闭"
|
|
15
|
+
},
|
|
16
|
+
"banner": {
|
|
17
|
+
"closeAriaLabel": "关闭"
|
|
18
|
+
},
|
|
19
|
+
"link": {
|
|
20
|
+
"opensInNewTabAriaLabel": "(在新选项卡中打开)"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
3
23
|
}
|
|
@@ -3,6 +3,7 @@ import { TextInput } from 'react-native';
|
|
|
3
3
|
export declare const BaseInput: React.ForwardRefExoticComponent<{
|
|
4
4
|
label?: string;
|
|
5
5
|
style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
6
|
+
containerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
|
|
6
7
|
inputStyle?: import("react-native").StyleProp<import("react-native").TextStyle>;
|
|
7
8
|
labelStyle?: import("react-native").StyleProp<import("react-native").TextStyle>;
|
|
8
9
|
errorMessage?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAA8B,SAAS,EAAQ,MAAM,cAAc,CAAC;AAQ3E,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"BaseInput.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/BaseInput/BaseInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,EAA8B,SAAS,EAAQ,MAAM,cAAc,CAAC;AAQ3E,eAAO,MAAM,SAAS;;;;;;;;;;;;;sEA0JrB,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { useStyleSheet, useTheme } from '../../../styles';
|
|
|
6
6
|
import { DeleteCircleFill } from '../../Symbols/Icons/DeleteCircleFill';
|
|
7
7
|
import { InteractiveIcon } from '../InteractiveIcon';
|
|
8
8
|
import { Box, Pressable } from '../Utility';
|
|
9
|
-
export const BaseInput = React.forwardRef(({ lx, style, inputStyle, labelStyle, label, errorMessage, hideClearButton, onChangeText: onChangeTextProp, editable = true, prefix, suffix, ...props }, ref) => {
|
|
9
|
+
export const BaseInput = React.forwardRef(({ lx, style, containerStyle, inputStyle, labelStyle, label, errorMessage, hideClearButton, onChangeText: onChangeTextProp, editable = true, prefix, suffix, ...props }, ref) => {
|
|
10
10
|
const { t } = useCommonTranslation();
|
|
11
11
|
const { theme } = useTheme();
|
|
12
12
|
const inputRef = useRef(null);
|
|
@@ -56,7 +56,11 @@ export const BaseInput = React.forwardRef(({ lx, style, inputStyle, labelStyle,
|
|
|
56
56
|
hasError: !!errorMessage,
|
|
57
57
|
isEditable: editable,
|
|
58
58
|
});
|
|
59
|
-
return (_jsxs(Box, { lx: lx, style: style, children: [_jsxs(Pressable, { style: styles.container, onPress: () => inputRef.current?.focus(), disabled: !editable, children: [prefix, _jsx(TextInput, { ref: inputRef, value: value, style:
|
|
59
|
+
return (_jsxs(Box, { lx: lx, style: style, children: [_jsxs(Pressable, { style: StyleSheet.flatten([styles.container, containerStyle]), onPress: () => inputRef.current?.focus(), disabled: !editable, children: [prefix, _jsx(TextInput, { ref: inputRef, value: value, style: StyleSheet.flatten([
|
|
60
|
+
styles.input,
|
|
61
|
+
{ lineHeight: 0 },
|
|
62
|
+
inputStyle,
|
|
63
|
+
]), onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), onChangeText: handleChangeText, editable: editable, autoCapitalize: 'none', autoCorrect: false, selectionColor: theme.colors.text.active, placeholderTextColor: theme.colors.text.muted, ...props }), label && (_jsx(Animated.Text, { style: [
|
|
60
64
|
floatingLabelStyles.label,
|
|
61
65
|
floatingLabelStyles.animatedLabel,
|
|
62
66
|
labelStyle,
|
|
@@ -6,9 +6,13 @@ export type BaseInputProps = {
|
|
|
6
6
|
*/
|
|
7
7
|
label?: string;
|
|
8
8
|
/**
|
|
9
|
-
* Additional styles to apply to the
|
|
9
|
+
* Additional styles to apply to the outer wrapper element.
|
|
10
10
|
*/
|
|
11
11
|
style?: StyleProp<ViewStyle>;
|
|
12
|
+
/**
|
|
13
|
+
* Additional styles to apply to the inner container element (Pressable).
|
|
14
|
+
*/
|
|
15
|
+
containerStyle?: StyleProp<ViewStyle>;
|
|
12
16
|
/**
|
|
13
17
|
* Additional styles to apply to the input element.
|
|
14
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/BaseInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,GAC/B,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/BaseInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAClC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,GAC/B,QAAQ,CAAC"}
|
|
@@ -2,5 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { TextInput } from 'react-native';
|
|
3
3
|
export declare const SearchInput: React.ForwardRefExoticComponent<Omit<import("../BaseInput").BaseInputProps, "label" | "prefix"> & {
|
|
4
4
|
lx?: import("../../../styles").LumenViewStyle;
|
|
5
|
-
} & import("react-native").ViewProps &
|
|
5
|
+
} & import("react-native").ViewProps & {
|
|
6
|
+
appearance?: "plain" | "transparent";
|
|
7
|
+
} & React.RefAttributes<TextInput>>;
|
|
6
8
|
//# sourceMappingURL=SearchInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,eAAO,MAAM,WAAW;;;;mCAqBvB,CAAC"}
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useStyleSheet } from '../../../styles';
|
|
3
4
|
import { Search as SearchIcon } from '../../Symbols';
|
|
4
5
|
import { BaseInput } from '../BaseInput';
|
|
5
|
-
export const SearchInput = React.forwardRef((props, ref) => {
|
|
6
|
-
|
|
6
|
+
export const SearchInput = React.forwardRef(({ appearance = 'plain', style, containerStyle, inputStyle, ...props }, ref) => {
|
|
7
|
+
const styles = useAppearanceStyles(appearance);
|
|
8
|
+
return (_jsx(BaseInput, { ref: ref, prefix: _jsx(SearchIcon, { size: 20, color: 'muted', accessible: false }), style: style, containerStyle: [containerStyle, styles.container], inputStyle: [inputStyle, styles.input], ...props }));
|
|
7
9
|
});
|
|
10
|
+
const useAppearanceStyles = (appearance) => {
|
|
11
|
+
return useStyleSheet((t) => ({
|
|
12
|
+
container: appearance === 'transparent'
|
|
13
|
+
? { backgroundColor: t.colors.bg.mutedTransparent }
|
|
14
|
+
: {},
|
|
15
|
+
input: { backgroundColor: 'transparent' },
|
|
16
|
+
}), [appearance]);
|
|
17
|
+
};
|
|
8
18
|
SearchInput.displayName = 'SearchInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/SearchInput/SearchInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,
|
|
1
|
+
{"version":3,"file":"SearchInput.stories.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/SearchInput/SearchInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAiClC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAC;AA6B1C,eAAO,MAAM,IAAI,EAAE,KAOlB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAOzB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KASjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAOnC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAa/B,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { BaseInputProps } from '../BaseInput';
|
|
2
2
|
import { BoxProps } from '../Utility';
|
|
3
|
-
export type SearchInputProps = Omit<BaseInputProps, 'prefix' | 'label'> & BoxProps
|
|
3
|
+
export type SearchInputProps = Omit<BaseInputProps, 'prefix' | 'label'> & BoxProps & {
|
|
4
|
+
/**
|
|
5
|
+
* The visual appearance of the search input
|
|
6
|
+
* @default 'plain'
|
|
7
|
+
*/
|
|
8
|
+
appearance?: 'plain' | 'transparent';
|
|
9
|
+
};
|
|
4
10
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/SearchInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,OAAO,CAAC,GACrE,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/SearchInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,OAAO,CAAC,GACrE,QAAQ,GAAG;IACT;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;CACtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAc,IAAI,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EAEpB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAc,IAAI,EAAE,MAAM,cAAc,CAAC;AAIhD,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EAEpB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAqDjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,IAAI;;;;;;6HAoChB,CAAC;AAkBF;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ;YAAW,aAAa;;CAM5C,CAAC;AAeF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW;8BAA6B,gBAAgB;;CAWpE,CAAC;AAwBF;;;;GAIG;AACH,eAAO,MAAM,SAAS;8BAA6B,cAAc;;CA6BhE,CAAC;AAwBF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe;+BAIzB,oBAAoB;;CA6BtB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
import type { LinearGradientDirection } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* LinearGradient - A container component that renders a linear gradient background.
|
|
5
|
+
*
|
|
6
|
+
* Uses react-native-svg to render gradients that work consistently across platforms.
|
|
7
|
+
* Extends Box, so it supports all lx style props for layout and sizing.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link https://ldls.vercel.app/?path=/docs/utility-lineargradient--docs Storybook}
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* import { LinearGradient } from '@ledgerhq/lumen-ui-rnative';
|
|
14
|
+
*
|
|
15
|
+
* // Basic usage with direction preset
|
|
16
|
+
* <LinearGradient
|
|
17
|
+
* direction="to-bottomright"
|
|
18
|
+
* stops={[
|
|
19
|
+
* { color: '#FF6B6B', offset: 0 },
|
|
20
|
+
* { color: '#6BCB77', offset: 1 },
|
|
21
|
+
* ]}
|
|
22
|
+
* lx={{ height: 's200', borderRadius: 'lg' }}
|
|
23
|
+
* />
|
|
24
|
+
*/
|
|
25
|
+
export declare const LinearGradient: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<{
|
|
26
|
+
stops: import("../gradient.types").GradientStop[];
|
|
27
|
+
children?: import("react").ReactNode;
|
|
28
|
+
direction?: LinearGradientDirection | number;
|
|
29
|
+
} & {
|
|
30
|
+
lx?: import("../../../../../styles").LumenViewStyle;
|
|
31
|
+
} & import("react-native").ViewProps & import("react").RefAttributes<View>>>;
|
|
32
|
+
//# sourceMappingURL=LinearGradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinearGradient.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAUzC,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,SAAS,CAAC;AAwCjB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,cAAc;;;;;;4EA8C1B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo, useId, useMemo } from 'react';
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
import Svg, { Defs, LinearGradient as SvgLinearGradient, Rect, Stop, } from 'react-native-svg';
|
|
5
|
+
import { useTheme } from '../../../../../styles';
|
|
6
|
+
import { Box } from '../../Box';
|
|
7
|
+
import { processGradientStops } from '../utils/resolveGradientColor';
|
|
8
|
+
const DIRECTION_MAP = {
|
|
9
|
+
'to-bottom': { x1: '0%', y1: '0%', x2: '0%', y2: '100%' },
|
|
10
|
+
'to-top': { x1: '0%', y1: '100%', x2: '0%', y2: '0%' },
|
|
11
|
+
'to-right': { x1: '0%', y1: '0%', x2: '100%', y2: '0%' },
|
|
12
|
+
'to-left': { x1: '100%', y1: '0%', x2: '0%', y2: '0%' },
|
|
13
|
+
'to-bottomright': { x1: '0%', y1: '0%', x2: '100%', y2: '100%' },
|
|
14
|
+
'to-bottomleft': { x1: '100%', y1: '0%', x2: '0%', y2: '100%' },
|
|
15
|
+
'to-topright': { x1: '0%', y1: '100%', x2: '100%', y2: '0%' },
|
|
16
|
+
'to-topleft': { x1: '100%', y1: '100%', x2: '0%', y2: '0%' },
|
|
17
|
+
};
|
|
18
|
+
const angleToCoordinates = (angle) => {
|
|
19
|
+
const normalizedAngle = ((angle % 360) + 360) % 360;
|
|
20
|
+
// Convert to radians (CSS: 0° is up, going clockwise)
|
|
21
|
+
// SVG: we need to map this to x1,y1 -> x2,y2
|
|
22
|
+
const radians = ((normalizedAngle - 90) * Math.PI) / 180;
|
|
23
|
+
const x2 = Math.cos(radians) * 0.5 + 0.5;
|
|
24
|
+
const y2 = Math.sin(radians) * 0.5 + 0.5;
|
|
25
|
+
const x1 = 1 - x2;
|
|
26
|
+
const y1 = 1 - y2;
|
|
27
|
+
return {
|
|
28
|
+
x1: `${Math.round(x1 * 100)}%`,
|
|
29
|
+
y1: `${Math.round(y1 * 100)}%`,
|
|
30
|
+
x2: `${Math.round(x2 * 100)}%`,
|
|
31
|
+
y2: `${Math.round(y2 * 100)}%`,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
gradient: {
|
|
36
|
+
...StyleSheet.absoluteFillObject,
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: '100%',
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* LinearGradient - A container component that renders a linear gradient background.
|
|
43
|
+
*
|
|
44
|
+
* Uses react-native-svg to render gradients that work consistently across platforms.
|
|
45
|
+
* Extends Box, so it supports all lx style props for layout and sizing.
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://ldls.vercel.app/?path=/docs/utility-lineargradient--docs Storybook}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* import { LinearGradient } from '@ledgerhq/lumen-ui-rnative';
|
|
52
|
+
*
|
|
53
|
+
* // Basic usage with direction preset
|
|
54
|
+
* <LinearGradient
|
|
55
|
+
* direction="to-bottomright"
|
|
56
|
+
* stops={[
|
|
57
|
+
* { color: '#FF6B6B', offset: 0 },
|
|
58
|
+
* { color: '#6BCB77', offset: 1 },
|
|
59
|
+
* ]}
|
|
60
|
+
* lx={{ height: 's200', borderRadius: 'lg' }}
|
|
61
|
+
* />
|
|
62
|
+
*/
|
|
63
|
+
export const LinearGradient = memo(forwardRef(({ direction = 'to-bottom', stops, children, lx = {}, ...props }, ref) => {
|
|
64
|
+
const gradientId = useId();
|
|
65
|
+
const { theme } = useTheme();
|
|
66
|
+
const coordinates = useMemo(() => {
|
|
67
|
+
const isCustomAngle = typeof direction === 'number';
|
|
68
|
+
return isCustomAngle
|
|
69
|
+
? angleToCoordinates(direction)
|
|
70
|
+
: DIRECTION_MAP[direction];
|
|
71
|
+
}, [direction]);
|
|
72
|
+
const processedStops = useMemo(() => processGradientStops(stops, theme.colors.bg), [stops, theme.colors.bg]);
|
|
73
|
+
return (_jsxs(Box, { ref: ref, lx: { overflow: 'hidden', ...lx }, ...props, children: [_jsxs(Svg, { style: styles.gradient, preserveAspectRatio: 'none', children: [_jsx(Defs, { children: _jsx(SvgLinearGradient, { id: gradientId, ...coordinates, children: processedStops.map((stop, index) => (_jsx(Stop, { offset: `${stop.offset * 100}%`, stopColor: stop.color, stopOpacity: stop.opacity }, index))) }) }), _jsx(Rect, { x: '0', y: '0', width: '100%', height: '100%', fill: `url(#${gradientId})` })] }), children] }));
|
|
74
|
+
}));
|
|
75
|
+
LinearGradient.displayName = 'LinearGradient';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-native-web-vite';
|
|
2
|
+
import { LinearGradient } from './LinearGradient';
|
|
3
|
+
declare const meta: Meta<typeof LinearGradient>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof LinearGradient>;
|
|
6
|
+
export declare const Base: Story;
|
|
7
|
+
export declare const DirectionShowcase: Story;
|
|
8
|
+
export declare const WithChildren: Story;
|
|
9
|
+
export declare const WithMultipleStops: Story;
|
|
10
|
+
export declare const CryptoGradients: Story;
|
|
11
|
+
//# sourceMappingURL=LinearGradient.stories.d.ts.map
|
package/dist/src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinearGradient.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/lib/Components/Utility/Gradient/LinearGradient/LinearGradient.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAIvE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAcrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7C,eAAO,MAAM,IAAI,EAAE,KAUlB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KAoC/B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAwB1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,KA4B/B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAyC7B,CAAC"}
|