@retray-dev/ui-kit 12.2.0 → 13.0.0
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/COMPONENTS.md +85 -143
- package/CONSUMER.md +2 -2
- package/DESIGN.md +2 -2
- package/README.md +11 -6
- package/dist/Accordion.js +48 -210
- package/dist/Accordion.mjs +6 -5
- package/dist/AlertBanner.js +29 -153
- package/dist/AlertBanner.mjs +3 -3
- package/dist/AppHeader.js +37 -235
- package/dist/AppHeader.mjs +6 -7
- package/dist/Avatar.d.mts +17 -1
- package/dist/Avatar.d.ts +17 -1
- package/dist/Avatar.js +80 -115
- package/dist/Avatar.mjs +2 -2
- package/dist/Badge.js +24 -149
- package/dist/Badge.mjs +3 -3
- package/dist/Button.js +79 -267
- package/dist/Button.mjs +6 -6
- package/dist/Card.js +15 -200
- package/dist/Card.mjs +4 -5
- package/dist/CategoryStrip.d.mts +0 -5
- package/dist/CategoryStrip.d.ts +0 -5
- package/dist/CategoryStrip.js +47 -265
- package/dist/CategoryStrip.mjs +6 -6
- package/dist/Checkbox.js +15 -200
- package/dist/Checkbox.mjs +5 -5
- package/dist/Chip.js +44 -236
- package/dist/Chip.mjs +7 -6
- package/dist/ConfirmDialog.js +84 -286
- package/dist/ConfirmDialog.mjs +7 -7
- package/dist/CurrencyDisplay.js +1 -114
- package/dist/CurrencyDisplay.mjs +2 -2
- package/dist/CurrencyInput.js +35 -162
- package/dist/CurrencyInput.mjs +5 -5
- package/dist/DetailRow.js +25 -150
- package/dist/DetailRow.mjs +3 -3
- package/dist/EmptyState.js +80 -268
- package/dist/EmptyState.mjs +7 -7
- package/dist/ErrorBoundary.js +32 -199
- package/dist/ErrorBoundary.mjs +4 -4
- package/dist/Form.js +1 -114
- package/dist/Form.mjs +2 -2
- package/dist/HolographicCard.d.mts +0 -28
- package/dist/HolographicCard.d.ts +0 -28
- package/dist/HolographicCard.js +20 -130
- package/dist/HolographicCard.mjs +9 -32
- package/dist/IconButton.js +36 -234
- package/dist/IconButton.mjs +5 -6
- package/dist/IconPicker.js +222 -929
- package/dist/IconPicker.mjs +5 -5
- package/dist/ImageUpload.d.mts +3 -1
- package/dist/ImageUpload.d.ts +3 -1
- package/dist/ImageUpload.js +25 -215
- package/dist/ImageUpload.mjs +5 -6
- package/dist/ImageViewer.js +75 -266
- package/dist/ImageViewer.mjs +8 -8
- package/dist/Input.d.mts +1 -1
- package/dist/Input.d.ts +1 -1
- package/dist/Input.js +35 -162
- package/dist/Input.mjs +4 -4
- package/dist/LabelValue.js +24 -149
- package/dist/LabelValue.mjs +3 -3
- package/dist/ListGroup.js +1 -114
- package/dist/ListGroup.mjs +2 -2
- package/dist/ListItem.js +38 -235
- package/dist/ListItem.mjs +5 -6
- package/dist/MediaCard.d.mts +0 -14
- package/dist/MediaCard.d.ts +0 -14
- package/dist/MediaCard.js +69 -315
- package/dist/MediaCard.mjs +5 -6
- package/dist/MenuGroup.js +1 -114
- package/dist/MenuGroup.mjs +2 -2
- package/dist/MenuItem.js +36 -234
- package/dist/MenuItem.mjs +5 -6
- package/dist/MonthPicker.js +8 -163
- package/dist/MonthPicker.mjs +3 -3
- package/dist/NumberStepper.js +40 -238
- package/dist/NumberStepper.mjs +5 -6
- package/dist/PagerDots.d.mts +1 -1
- package/dist/PagerDots.d.ts +1 -1
- package/dist/PagerDots.js +69 -224
- package/dist/PagerDots.mjs +6 -5
- package/dist/Pressable.js +14 -85
- package/dist/Pressable.mjs +4 -4
- package/dist/PricingCard.js +87 -272
- package/dist/PricingCard.mjs +8 -8
- package/dist/Progress.js +3 -123
- package/dist/Progress.mjs +3 -3
- package/dist/RadioGroup.js +52 -265
- package/dist/RadioGroup.mjs +5 -5
- package/dist/RetrayProvider.js +3 -6
- package/dist/RetrayProvider.mjs +3 -3
- package/dist/Select.d.mts +2 -1
- package/dist/Select.d.ts +2 -1
- package/dist/Select.js +24 -232
- package/dist/Select.mjs +4 -5
- package/dist/SelectableCard.js +33 -209
- package/dist/SelectableCard.mjs +5 -5
- package/dist/SelectableGrid.d.mts +0 -21
- package/dist/SelectableGrid.d.ts +0 -21
- package/dist/SelectableGrid.js +49 -271
- package/dist/SelectableGrid.mjs +5 -6
- package/dist/Separator.js +1 -114
- package/dist/Separator.mjs +2 -2
- package/dist/Sheet.js +7 -162
- package/dist/Sheet.mjs +3 -3
- package/dist/SheetSelect.js +39 -236
- package/dist/SheetSelect.mjs +6 -6
- package/dist/Skeleton.js +4 -124
- package/dist/Skeleton.mjs +3 -3
- package/dist/Slider.js +6 -161
- package/dist/Slider.mjs +3 -3
- package/dist/Spinner.js +3 -116
- package/dist/Spinner.mjs +2 -2
- package/dist/Stats.js +36 -234
- package/dist/Stats.mjs +5 -6
- package/dist/Switch.js +24 -175
- package/dist/Switch.mjs +5 -4
- package/dist/TabBar.js +43 -200
- package/dist/TabBar.mjs +5 -4
- package/dist/Tabs.js +15 -199
- package/dist/Tabs.mjs +5 -5
- package/dist/Text.js +9 -130
- package/dist/Text.mjs +2 -2
- package/dist/Textarea.d.mts +2 -1
- package/dist/Textarea.d.ts +2 -1
- package/dist/Textarea.js +71 -219
- package/dist/Textarea.mjs +4 -4
- package/dist/Toast.js +1 -114
- package/dist/Toast.mjs +2 -2
- package/dist/Toggle.js +39 -236
- package/dist/Toggle.mjs +6 -6
- package/dist/{chunk-M3C7XM2M.mjs → chunk-2QOHHBJC.mjs} +3 -3
- package/dist/{chunk-LIS6I5UP.mjs → chunk-2VIDP72N.mjs} +3 -3
- package/dist/{chunk-DF7JA72E.mjs → chunk-4NQFTHN3.mjs} +13 -7
- package/dist/{chunk-UBUXUMER.mjs → chunk-4ZO5PTKF.mjs} +4 -4
- package/dist/{chunk-3XCFYSX4.mjs → chunk-5MYNAAFE.mjs} +13 -17
- package/dist/{chunk-E7NEHHXV.mjs → chunk-62BBSSUF.mjs} +3 -3
- package/dist/{chunk-MVMGPZN6.mjs → chunk-6CR4S6W2.mjs} +3 -3
- package/dist/{chunk-EDLCGYIO.mjs → chunk-6QLBHUEG.mjs} +8 -7
- package/dist/chunk-ARONDO7M.mjs +40 -0
- package/dist/{chunk-GH67YXG6.mjs → chunk-AZV7KNJI.mjs} +3 -3
- package/dist/{chunk-RMRS44MQ.mjs → chunk-BTUW5LSG.mjs} +11 -8
- package/dist/{chunk-2P2CB235.mjs → chunk-BULKGOIZ.mjs} +7 -8
- package/dist/{chunk-NHDI3VQB.mjs → chunk-CBIZLRYH.mjs} +15 -12
- package/dist/chunk-CM2DG4MR.mjs +142 -0
- package/dist/{chunk-TS7DGUIR.mjs → chunk-DBHSUUKU.mjs} +2 -2
- package/dist/{chunk-57V2LXCK.mjs → chunk-DE25XTVQ.mjs} +3 -3
- package/dist/{chunk-UQ4742ET.mjs → chunk-E4EQSCKR.mjs} +5 -5
- package/dist/{chunk-GUTDFUNF.mjs → chunk-EHGBHFMH.mjs} +9 -17
- package/dist/{chunk-CF27NBXO.mjs → chunk-EROPDCB5.mjs} +16 -24
- package/dist/{chunk-ZIMY2QUM.mjs → chunk-ERWJPVX7.mjs} +2 -2
- package/dist/{chunk-NLZY4TXU.mjs → chunk-ESQDPO5E.mjs} +7 -7
- package/dist/{chunk-VJBUCITV.mjs → chunk-EW2FIDSM.mjs} +1 -1
- package/dist/{chunk-HC4VVCWY.mjs → chunk-FTTI6T5Q.mjs} +4 -4
- package/dist/{chunk-2HFD4IHU.mjs → chunk-HUSSF6TF.mjs} +1 -1
- package/dist/chunk-IFYMBOEN.mjs +14 -0
- package/dist/{chunk-QOLWA2PW.mjs → chunk-IGU223UM.mjs} +80 -4
- package/dist/chunk-IJCMPVW5.mjs +121 -0
- package/dist/{chunk-AENAVIKT.mjs → chunk-ITG4JQM3.mjs} +4 -4
- package/dist/{chunk-E5UKLSJZ.mjs → chunk-K3QX2M26.mjs} +11 -8
- package/dist/{chunk-4OORJ2DY.mjs → chunk-K7TKID3V.mjs} +8 -7
- package/dist/{chunk-2LG326TT.mjs → chunk-KAGADD2O.mjs} +4 -4
- package/dist/{chunk-IVSRW4HS.mjs → chunk-KC5QDYGZ.mjs} +4 -4
- package/dist/{chunk-7AFZWSCI.mjs → chunk-KPTY7UYQ.mjs} +1 -1
- package/dist/{chunk-YTXRIXNZ.mjs → chunk-KSSVIFYR.mjs} +9 -12
- package/dist/chunk-L3YKPTJQ.mjs +119 -0
- package/dist/chunk-M53LC4Q7.mjs +35 -0
- package/dist/{chunk-ZR6HSEAB.mjs → chunk-MP7GLMIR.mjs} +17 -25
- package/dist/chunk-MZ6WRTD2.mjs +40 -0
- package/dist/chunk-NGEN2EES.mjs +581 -0
- package/dist/{chunk-C43HRKXH.mjs → chunk-OBV72JD4.mjs} +1 -1
- package/dist/{chunk-LPV4NJJK.mjs → chunk-PGQ6FMXS.mjs} +6 -5
- package/dist/{chunk-MEPSKGBO.mjs → chunk-PI6RULJX.mjs} +1 -1
- package/dist/{chunk-F3YTWO3T.mjs → chunk-RA6SAAFE.mjs} +9 -8
- package/dist/{chunk-UNNRUJTM.mjs → chunk-RRKM4MKB.mjs} +7 -7
- package/dist/{chunk-ULGNQPNE.mjs → chunk-S2VGME7X.mjs} +1 -1
- package/dist/{chunk-OLVJFKXS.mjs → chunk-S44XWTTC.mjs} +35 -25
- package/dist/{chunk-YMYIEVZP.mjs → chunk-SZEKQAOY.mjs} +1 -1
- package/dist/{chunk-ELGEOM7I.mjs → chunk-TETMEKZE.mjs} +9 -9
- package/dist/{chunk-BXF4AMHY.mjs → chunk-TMH263OK.mjs} +5 -4
- package/dist/{chunk-NJG7DHVF.mjs → chunk-U6DEBYU5.mjs} +10 -9
- package/dist/{chunk-RJNLAH76.mjs → chunk-UOKFSFNJ.mjs} +2 -2
- package/dist/{chunk-HEDQPK4I.mjs → chunk-URIH43IJ.mjs} +13 -21
- package/dist/{chunk-QXDGGOLC.mjs → chunk-V2ZB2XNS.mjs} +6 -6
- package/dist/{chunk-KSUWPU2F.mjs → chunk-WIPEDNSD.mjs} +7 -7
- package/dist/{chunk-QDAZGZUF.mjs → chunk-XCIG6HT2.mjs} +3 -3
- package/dist/{chunk-4J2PXL36.mjs → chunk-Y6YS33GM.mjs} +40 -38
- package/dist/{chunk-4XOB5TTD.mjs → chunk-ZKDKKQCE.mjs} +5 -5
- package/dist/{chunk-LOBLCFMN.mjs → chunk-ZTPYUU5C.mjs} +5 -5
- package/dist/index.d.mts +12 -72
- package/dist/index.d.ts +12 -72
- package/dist/index.js +1051 -1838
- package/dist/index.mjs +81 -85
- package/package.json +8 -10
- package/src/components/Accordion/Accordion.tsx +12 -9
- package/src/components/AlertBanner/AlertBanner.tsx +7 -6
- package/src/components/AppHeader/AppHeader.tsx +1 -1
- package/src/components/Avatar/Avatar.tsx +92 -1
- package/src/components/Avatar/index.ts +2 -2
- package/src/components/Badge/Badge.tsx +2 -2
- package/src/components/Button/Button.tsx +50 -46
- package/src/components/Card/Card.tsx +1 -0
- package/src/components/CategoryStrip/CategoryStrip.tsx +36 -49
- package/src/components/Chip/Chip.tsx +5 -4
- package/src/components/ConfirmDialog/ConfirmDialog.tsx +3 -3
- package/src/components/DetailRow/DetailRow.tsx +3 -3
- package/src/components/EmptyState/EmptyState.tsx +2 -2
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +6 -6
- package/src/components/HolographicCard/HolographicCard.tsx +14 -95
- package/src/components/IconButton/IconButton.tsx +2 -2
- package/src/components/IconPicker/IconPicker.tsx +13 -12
- package/src/components/ImageUpload/ImageUpload.tsx +14 -25
- package/src/components/ImageViewer/ImageViewer.tsx +3 -3
- package/src/components/Input/Input.tsx +11 -5
- package/src/components/LabelValue/LabelValue.tsx +2 -2
- package/src/components/ListItem/ListItem.tsx +4 -4
- package/src/components/MediaCard/MediaCard.tsx +21 -59
- package/src/components/MenuItem/MenuItem.tsx +2 -2
- package/src/components/MonthPicker/MonthPicker.tsx +2 -2
- package/src/components/NumberStepper/NumberStepper.tsx +6 -6
- package/src/components/PagerDots/PagerDots.tsx +38 -28
- package/src/components/PricingCard/PricingCard.tsx +6 -6
- package/src/components/RadioGroup/RadioGroup.tsx +18 -31
- package/src/components/Select/Select.tsx +32 -39
- package/src/components/SelectableCard/SelectableCard.tsx +4 -6
- package/src/components/SelectableGrid/SelectableGrid.tsx +38 -72
- package/src/components/Sheet/Sheet.tsx +1 -1
- package/src/components/SheetSelect/SheetSelect.tsx +3 -3
- package/src/components/Skeleton/Skeleton.tsx +1 -1
- package/src/components/Spinner/Spinner.tsx +2 -2
- package/src/components/Stats/Stats.tsx +2 -2
- package/src/components/Switch/Switch.tsx +9 -6
- package/src/components/TabBar/TabBar.tsx +9 -8
- package/src/components/Text/Text.tsx +12 -1
- package/src/components/Textarea/Textarea.tsx +18 -32
- package/src/components/Toggle/Toggle.tsx +3 -3
- package/src/hooks/useConfirmDialog.ts +31 -42
- package/src/index.ts +3 -4
- package/src/theme/ThemeProvider.tsx +1 -4
- package/src/theme/colorUtils.ts +1 -72
- package/src/theme/colors.ts +40 -1
- package/src/theme/types.ts +2 -2
- package/src/utils/animations.ts +0 -47
- package/src/utils/curatedIcons.ts +93 -801
- package/src/utils/haptics.ts +13 -208
- package/src/utils/icons.ts +27 -91
- package/src/utils/pressable.ts +10 -61
- package/dist/VirtualList.d.mts +0 -19
- package/dist/VirtualList.d.ts +0 -19
- package/dist/VirtualList.js +0 -38
- package/dist/VirtualList.mjs +0 -2
- package/dist/chunk-2BA3JMKK.mjs +0 -136
- package/dist/chunk-3DKJ2GIC.mjs +0 -30
- package/dist/chunk-7ELGZ66G.mjs +0 -164
- package/dist/chunk-DVK4G2GT.mjs +0 -59
- package/dist/chunk-EJ7ZPXOH.mjs +0 -163
- package/dist/chunk-KA7LTET3.mjs +0 -71
- package/dist/chunk-LNPKGWBG.mjs +0 -134
- package/dist/chunk-NC5ZTR2Y.mjs +0 -32
- package/dist/chunk-SAWUXP3A.mjs +0 -1114
- package/dist/chunk-YNROWHQJ.mjs +0 -46
- package/src/components/VirtualList/VirtualList.tsx +0 -60
- package/src/components/VirtualList/index.ts +0 -1
- package/src/utils/fontGuard.ts +0 -35
- package/src/utils/hover.ts +0 -25
- package/src/utils/useColorTransition.ts +0 -40
- package/src/utils/usePressScale.ts +0 -75
package/dist/ConfirmDialog.js
CHANGED
|
@@ -5,6 +5,7 @@ var reactNative = require('react-native');
|
|
|
5
5
|
var bottomSheet = require('@gorhom/bottom-sheet');
|
|
6
6
|
var reactNativeSafeAreaContext = require('react-native-safe-area-context');
|
|
7
7
|
var vectorIcons = require('@expo/vector-icons');
|
|
8
|
+
var reactNativeEase = require('react-native-ease');
|
|
8
9
|
var reactNativeSizeMatters = require('react-native-size-matters');
|
|
9
10
|
var AntDesign = require('@expo/vector-icons/AntDesign');
|
|
10
11
|
var Entypo = require('@expo/vector-icons/Entypo');
|
|
@@ -13,7 +14,6 @@ var FontAwesome5 = require('@expo/vector-icons/FontAwesome5');
|
|
|
13
14
|
var MaterialIcons = require('@expo/vector-icons/MaterialIcons');
|
|
14
15
|
var Ionicons = require('@expo/vector-icons/Ionicons');
|
|
15
16
|
var pressto = require('pressto');
|
|
16
|
-
var reactNativeReanimated = require('react-native-reanimated');
|
|
17
17
|
|
|
18
18
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
19
|
|
|
@@ -25,18 +25,13 @@ var FontAwesome5__default = /*#__PURE__*/_interopDefault(FontAwesome5);
|
|
|
25
25
|
var MaterialIcons__default = /*#__PURE__*/_interopDefault(MaterialIcons);
|
|
26
26
|
var Ionicons__default = /*#__PURE__*/_interopDefault(Ionicons);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
30
|
-
}) : x)(function(x) {
|
|
31
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
32
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
33
|
-
});
|
|
28
|
+
// src/components/ConfirmDialog/ConfirmDialog.tsx
|
|
34
29
|
var _haptics = null;
|
|
35
|
-
var
|
|
30
|
+
var _loaded = false;
|
|
36
31
|
async function getHaptics() {
|
|
37
32
|
if (reactNative.Platform.OS === "web") return null;
|
|
38
|
-
if (!
|
|
39
|
-
|
|
33
|
+
if (!_loaded) {
|
|
34
|
+
_loaded = true;
|
|
40
35
|
try {
|
|
41
36
|
_haptics = await import('expo-haptics');
|
|
42
37
|
} catch {
|
|
@@ -45,180 +40,16 @@ async function getHaptics() {
|
|
|
45
40
|
}
|
|
46
41
|
return _haptics;
|
|
47
42
|
}
|
|
48
|
-
var _pulsar = null;
|
|
49
|
-
var _pulsarChecked = false;
|
|
50
|
-
var _pulsarAvailable = false;
|
|
51
|
-
function isPulsarNativeRegistered() {
|
|
52
|
-
try {
|
|
53
|
-
const g = globalThis;
|
|
54
|
-
if (typeof g.__turboModuleProxy === "function") {
|
|
55
|
-
return g.__turboModuleProxy("RNPulsar") != null;
|
|
56
|
-
}
|
|
57
|
-
return reactNative.NativeModules?.RNPulsar != null;
|
|
58
|
-
} catch {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function getPulsar() {
|
|
63
|
-
if (reactNative.Platform.OS === "web") return null;
|
|
64
|
-
if (!_pulsarChecked) {
|
|
65
|
-
_pulsarChecked = true;
|
|
66
|
-
try {
|
|
67
|
-
if (isPulsarNativeRegistered()) {
|
|
68
|
-
_pulsar = __require("react-native-pulsar");
|
|
69
|
-
_pulsarAvailable = true;
|
|
70
|
-
}
|
|
71
|
-
} catch {
|
|
72
|
-
_pulsar = null;
|
|
73
|
-
_pulsarAvailable = false;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return _pulsarAvailable ? _pulsar : null;
|
|
77
|
-
}
|
|
78
43
|
function selectionAsync() {
|
|
79
|
-
|
|
80
|
-
getHaptics().then((h) => {
|
|
81
|
-
if (h) {
|
|
82
|
-
h.selectionAsync();
|
|
83
|
-
} else {
|
|
84
|
-
getPulsar()?.Presets.System.selection();
|
|
85
|
-
}
|
|
86
|
-
});
|
|
44
|
+
getHaptics().then((h) => h?.selectionAsync());
|
|
87
45
|
}
|
|
88
46
|
function impactMedium() {
|
|
89
|
-
|
|
90
|
-
getHaptics().then((h) => {
|
|
91
|
-
if (h) {
|
|
92
|
-
h.impactAsync(h.ImpactFeedbackStyle.Medium);
|
|
93
|
-
} else {
|
|
94
|
-
getPulsar()?.Presets.System.impactMedium();
|
|
95
|
-
}
|
|
96
|
-
});
|
|
47
|
+
getHaptics().then((h) => h?.impactAsync(h.ImpactFeedbackStyle.Medium));
|
|
97
48
|
}
|
|
98
49
|
function notificationSuccess() {
|
|
99
|
-
|
|
100
|
-
getHaptics().then((h) => {
|
|
101
|
-
if (h) {
|
|
102
|
-
h.notificationAsync(h.NotificationFeedbackType.Success);
|
|
103
|
-
} else {
|
|
104
|
-
getPulsar()?.Presets.System.notificationSuccess();
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// src/theme/colorUtils.ts
|
|
110
|
-
function hexToRgb(hex) {
|
|
111
|
-
const clean = hex.replace("#", "");
|
|
112
|
-
const full = clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean;
|
|
113
|
-
if (full.length !== 6) return null;
|
|
114
|
-
return {
|
|
115
|
-
r: parseInt(full.slice(0, 2), 16),
|
|
116
|
-
g: parseInt(full.slice(2, 4), 16),
|
|
117
|
-
b: parseInt(full.slice(4, 6), 16)
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
function componentToHex(c) {
|
|
121
|
-
return Math.round(Math.max(0, Math.min(255, c))).toString(16).padStart(2, "0");
|
|
122
|
-
}
|
|
123
|
-
function rgbToHex(r, g, b) {
|
|
124
|
-
return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;
|
|
125
|
-
}
|
|
126
|
-
function withAlphaOnWhite(hex, alpha) {
|
|
127
|
-
const rgb = hexToRgb(hex);
|
|
128
|
-
if (!rgb) return hex;
|
|
129
|
-
const r = rgb.r * alpha + 255 * (1 - alpha);
|
|
130
|
-
const g = rgb.g * alpha + 255 * (1 - alpha);
|
|
131
|
-
const b = rgb.b * alpha + 255 * (1 - alpha);
|
|
132
|
-
return rgbToHex(r, g, b);
|
|
133
|
-
}
|
|
134
|
-
function withAlphaOnDark(hex, alpha, bgHex = "#0f0f0f") {
|
|
135
|
-
const rgb = hexToRgb(hex);
|
|
136
|
-
const bg = hexToRgb(bgHex);
|
|
137
|
-
if (!rgb || !bg) return hex;
|
|
138
|
-
const r = rgb.r * alpha + bg.r * (1 - alpha);
|
|
139
|
-
const g = rgb.g * alpha + bg.g * (1 - alpha);
|
|
140
|
-
const b = rgb.b * alpha + bg.b * (1 - alpha);
|
|
141
|
-
return rgbToHex(r, g, b);
|
|
142
|
-
}
|
|
143
|
-
function mixWithBackground(fgHex, bgHex, opacity) {
|
|
144
|
-
const fg = hexToRgb(fgHex);
|
|
145
|
-
const bg = hexToRgb(bgHex);
|
|
146
|
-
if (!fg || !bg) return fgHex;
|
|
147
|
-
const r = fg.r * opacity + bg.r * (1 - opacity);
|
|
148
|
-
const g = fg.g * opacity + bg.g * (1 - opacity);
|
|
149
|
-
const b = fg.b * opacity + bg.b * (1 - opacity);
|
|
150
|
-
return rgbToHex(r, g, b);
|
|
151
|
-
}
|
|
152
|
-
function lighten(hex, amount) {
|
|
153
|
-
return withAlphaOnWhite(hex, 1 - amount);
|
|
154
|
-
}
|
|
155
|
-
function darken(hex, amount) {
|
|
156
|
-
const rgb = hexToRgb(hex);
|
|
157
|
-
if (!rgb) return hex;
|
|
158
|
-
return rgbToHex(rgb.r * (1 - amount), rgb.g * (1 - amount), rgb.b * (1 - amount));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// src/theme/colors.ts
|
|
162
|
-
var defaultLight = {
|
|
163
|
-
background: "#ffffff",
|
|
164
|
-
foreground: "#1a1a1a",
|
|
165
|
-
card: "#ffffff",
|
|
166
|
-
primary: "#1a1a1a",
|
|
167
|
-
primaryForeground: "#ffffff",
|
|
168
|
-
// AUDIT FIX: brand accent — was undefined; falls back to primary when omitted
|
|
169
|
-
accent: "#d4561d",
|
|
170
|
-
accentForeground: "#ffffff",
|
|
171
|
-
border: "#dddddd",
|
|
172
|
-
// AUDIT FIX: was #e53935 (4.22:1 on white — fails AA); #c72828 = 5.59:1 ✓
|
|
173
|
-
destructive: "#c72828",
|
|
174
|
-
destructiveForeground: "#ffffff",
|
|
175
|
-
success: "#1a7a45",
|
|
176
|
-
successForeground: "#ffffff",
|
|
177
|
-
// AUDIT FIX: was #e67e00 (2.86:1 — severe fail); #9a5200 = 5.86:1 ✓ AAA-near
|
|
178
|
-
warning: "#9a5200",
|
|
179
|
-
warningForeground: "#ffffff"
|
|
180
|
-
};
|
|
181
|
-
function deriveColors(t, scheme) {
|
|
182
|
-
const dark = scheme === "dark";
|
|
183
|
-
const bg = t.background;
|
|
184
|
-
const foregroundSubtle = mixWithBackground(t.foreground, bg, 0.7);
|
|
185
|
-
const foregroundMuted = mixWithBackground(t.foreground, bg, 0.62);
|
|
186
|
-
const surface = dark ? lighten(bg, -0.06) : darken(bg, 0.04);
|
|
187
|
-
const surfaceStrong = dark ? lighten(bg, -0.12) : darken(bg, 0.08);
|
|
188
|
-
const skeleton = dark ? lighten(bg, -0.1) : darken(bg, 0.1);
|
|
189
|
-
const destructiveTint = dark ? withAlphaOnDark(t.destructive, 0.15, bg) : withAlphaOnWhite(t.destructive, 0.08);
|
|
190
|
-
const destructiveBorder = dark ? withAlphaOnDark(t.destructive, 0.45, bg) : withAlphaOnWhite(t.destructive, 0.3);
|
|
191
|
-
const successTint = dark ? withAlphaOnDark(t.success, 0.15, bg) : withAlphaOnWhite(t.success, 0.08);
|
|
192
|
-
const successBorder = dark ? withAlphaOnDark(t.success, 0.45, bg) : withAlphaOnWhite(t.success, 0.3);
|
|
193
|
-
const warningTint = dark ? withAlphaOnDark(t.warning, 0.15, bg) : withAlphaOnWhite(t.warning, 0.08);
|
|
194
|
-
const warningBorder = dark ? withAlphaOnDark(t.warning, 0.45, bg) : withAlphaOnWhite(t.warning, 0.3);
|
|
195
|
-
return {
|
|
196
|
-
...t,
|
|
197
|
-
foregroundSubtle,
|
|
198
|
-
foregroundMuted,
|
|
199
|
-
surface,
|
|
200
|
-
surfaceStrong,
|
|
201
|
-
skeleton,
|
|
202
|
-
destructiveTint,
|
|
203
|
-
destructiveBorder,
|
|
204
|
-
successTint,
|
|
205
|
-
successBorder,
|
|
206
|
-
warningTint,
|
|
207
|
-
warningBorder,
|
|
208
|
-
overlay: t.overlay ?? "rgba(0,0,0,0.45)",
|
|
209
|
-
accentResolved: t.accent ?? t.primary,
|
|
210
|
-
accentForegroundResolved: t.accentForeground ?? t.primaryForeground,
|
|
211
|
-
ring: t.accent ?? t.primary,
|
|
212
|
-
input: t.border,
|
|
213
|
-
separator: dark ? lighten(t.border, 0.22) : darken(t.border, 0.16)
|
|
214
|
-
};
|
|
50
|
+
getHaptics().then((h) => h?.notificationAsync(h.NotificationFeedbackType.Success));
|
|
215
51
|
}
|
|
216
|
-
|
|
217
|
-
// src/theme/ThemeProvider.tsx
|
|
218
|
-
var ThemeContext = React3.createContext({
|
|
219
|
-
colors: deriveColors(defaultLight, "light"),
|
|
220
|
-
colorScheme: "light"
|
|
221
|
-
});
|
|
52
|
+
var ThemeContext = React3.createContext(void 0);
|
|
222
53
|
function useTheme() {
|
|
223
54
|
const context = React3.useContext(ThemeContext);
|
|
224
55
|
if (!context) {
|
|
@@ -231,46 +62,34 @@ var s = isWeb ? (n) => n : reactNativeSizeMatters.scale;
|
|
|
231
62
|
var vs = isWeb ? (n) => n : reactNativeSizeMatters.verticalScale;
|
|
232
63
|
var ms = isWeb ? (n, _factor) => n : reactNativeSizeMatters.moderateScale;
|
|
233
64
|
var mvs = isWeb ? (n, _factor) => n : reactNativeSizeMatters.moderateVerticalScale;
|
|
234
|
-
var glyphMapOf = (mod) => mod.glyphMap ?? {};
|
|
235
65
|
var ALL_FAMILIES = [
|
|
236
|
-
{ name: "
|
|
237
|
-
{ name: "
|
|
238
|
-
{ name: "
|
|
239
|
-
{ name: "
|
|
240
|
-
{ name: "
|
|
241
|
-
{ name: "
|
|
66
|
+
{ name: "Feather", component: Feather__default.default },
|
|
67
|
+
{ name: "AntDesign", component: AntDesign__default.default },
|
|
68
|
+
{ name: "Entypo", component: Entypo__default.default },
|
|
69
|
+
{ name: "FontAwesome5", component: FontAwesome5__default.default },
|
|
70
|
+
{ name: "MaterialIcons", component: MaterialIcons__default.default },
|
|
71
|
+
{ name: "Ionicons", component: Ionicons__default.default }
|
|
242
72
|
];
|
|
243
|
-
var
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
for (const
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
73
|
+
var glyphCacheInitialized = false;
|
|
74
|
+
function ensureGlyphCache() {
|
|
75
|
+
if (glyphCacheInitialized) return;
|
|
76
|
+
glyphCacheInitialized = true;
|
|
77
|
+
for (const entry of ALL_FAMILIES) {
|
|
78
|
+
try {
|
|
79
|
+
entry.glyphMap = entry.component.glyphMap;
|
|
80
|
+
} catch {
|
|
81
|
+
entry.glyphMap = {};
|
|
251
82
|
}
|
|
252
83
|
}
|
|
253
|
-
return cache;
|
|
254
|
-
}
|
|
255
|
-
function resolveFamily(name) {
|
|
256
|
-
if (!resolvedCache) {
|
|
257
|
-
resolvedCache = buildCache();
|
|
258
|
-
}
|
|
259
|
-
return resolvedCache.get(name) ?? null;
|
|
260
84
|
}
|
|
261
85
|
function Icon({ name, size, color, family }) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
const Component = resolved.component;
|
|
270
|
-
return React3__default.default.createElement(Component, { name, size, color });
|
|
271
|
-
}
|
|
272
|
-
function renderIcon(name, size, color) {
|
|
273
|
-
return React3__default.default.createElement(Icon, { name, size, color });
|
|
86
|
+
ensureGlyphCache();
|
|
87
|
+
const entry = family ? ALL_FAMILIES.find((f) => f.name === family) : ALL_FAMILIES.find((f) => {
|
|
88
|
+
const glyphMap = f.glyphMap;
|
|
89
|
+
return glyphMap ? name in glyphMap : false;
|
|
90
|
+
});
|
|
91
|
+
if (!entry) return null;
|
|
92
|
+
return React3__default.default.createElement(entry.component, { name, size, color });
|
|
274
93
|
}
|
|
275
94
|
|
|
276
95
|
// src/tokens.ts
|
|
@@ -292,45 +111,24 @@ var TYPOGRAPHY = {
|
|
|
292
111
|
letterSpacing: 0
|
|
293
112
|
}
|
|
294
113
|
};
|
|
295
|
-
({
|
|
296
|
-
/** Material-style ease-out — natural deceleration for state changes. */
|
|
297
|
-
standard: reactNativeReanimated.Easing.bezier(0.2, 0, 0, 1),
|
|
298
|
-
/** Strong ease-out for expanding surfaces (Accordion open). */
|
|
299
|
-
expand: reactNativeReanimated.Easing.bezier(0.23, 1, 0.32, 1),
|
|
300
|
-
/** Quick ease-in for collapsing. */
|
|
301
|
-
collapse: reactNativeReanimated.Easing.in(reactNativeReanimated.Easing.ease)
|
|
302
|
-
});
|
|
303
|
-
var PRESS_SCALE = {
|
|
304
|
-
button: 0.95,
|
|
305
|
-
card: 0.98,
|
|
306
|
-
row: 0.97,
|
|
307
|
-
chip: 0.94
|
|
308
|
-
};
|
|
309
|
-
var PressableButton = pressto.createAnimatedPressable((progress) => {
|
|
114
|
+
var makePressable = (scale2) => pressto.createAnimatedPressable((progress) => {
|
|
310
115
|
"worklet";
|
|
311
|
-
|
|
312
|
-
return { transform: [{ scale: scale2 }] };
|
|
313
|
-
});
|
|
314
|
-
pressto.createAnimatedPressable((progress) => {
|
|
315
|
-
"worklet";
|
|
316
|
-
const scale2 = 1 - (1 - PRESS_SCALE.card) * progress;
|
|
317
|
-
return { transform: [{ scale: scale2 }] };
|
|
318
|
-
});
|
|
319
|
-
pressto.createAnimatedPressable((progress) => {
|
|
320
|
-
"worklet";
|
|
321
|
-
const scale2 = 1 - (1 - PRESS_SCALE.row) * progress;
|
|
322
|
-
return { transform: [{ scale: scale2 }] };
|
|
323
|
-
});
|
|
324
|
-
pressto.createAnimatedPressable((progress) => {
|
|
325
|
-
"worklet";
|
|
326
|
-
const scale2 = 1 - (1 - PRESS_SCALE.chip) * progress;
|
|
327
|
-
return { transform: [{ scale: scale2 }] };
|
|
328
|
-
});
|
|
329
|
-
pressto.createAnimatedPressable((progress) => {
|
|
330
|
-
"worklet";
|
|
331
|
-
const scale2 = 1 - (1 - PRESS_SCALE.button) * progress;
|
|
332
|
-
return { transform: [{ scale: scale2 }] };
|
|
116
|
+
return { transform: [{ scale: 1 - (1 - scale2) * progress }] };
|
|
333
117
|
});
|
|
118
|
+
var PressableButton = makePressable(0.95);
|
|
119
|
+
makePressable(0.98);
|
|
120
|
+
makePressable(0.97);
|
|
121
|
+
makePressable(0.94);
|
|
122
|
+
makePressable(0.95);
|
|
123
|
+
|
|
124
|
+
// src/utils/animations.ts
|
|
125
|
+
var TIMINGS = {
|
|
126
|
+
state: { duration: 160 }};
|
|
127
|
+
var COLOR_TRANSITION = {
|
|
128
|
+
type: "timing",
|
|
129
|
+
duration: TIMINGS.state.duration,
|
|
130
|
+
easing: [0.2, 0, 0, 1]
|
|
131
|
+
};
|
|
334
132
|
|
|
335
133
|
// src/components/Button/Button.tsx
|
|
336
134
|
var containerSizeStyles = {
|
|
@@ -367,17 +165,10 @@ function ButtonBase({
|
|
|
367
165
|
impactMedium();
|
|
368
166
|
onPress?.();
|
|
369
167
|
};
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
destructive: { backgroundColor: colors.surface }
|
|
375
|
-
}[variant] : {
|
|
376
|
-
primary: { backgroundColor: colors.primary },
|
|
377
|
-
secondary: { backgroundColor: "transparent", borderWidth: 1.5, borderColor: colors.primary },
|
|
378
|
-
text: { backgroundColor: "transparent" },
|
|
379
|
-
destructive: { backgroundColor: colors.destructive }
|
|
380
|
-
}[variant];
|
|
168
|
+
const isSecondary = variant === "secondary";
|
|
169
|
+
const borderWidth = isSecondary ? 1.5 : 0;
|
|
170
|
+
const animateBgColor = isDisabled ? { primary: colors.surface, secondary: "transparent", text: "transparent", destructive: colors.surface }[variant] : { primary: colors.primary, secondary: "transparent", text: "transparent", destructive: colors.destructive }[variant];
|
|
171
|
+
const animateBorderColor = isDisabled ? isSecondary ? colors.border : "transparent" : isSecondary ? colors.primary : "transparent";
|
|
381
172
|
const labelColor = isDisabled ? colors.foregroundMuted : {
|
|
382
173
|
primary: colors.primaryForeground,
|
|
383
174
|
secondary: colors.primary,
|
|
@@ -385,7 +176,7 @@ function ButtonBase({
|
|
|
385
176
|
destructive: colors.destructiveForeground
|
|
386
177
|
}[variant];
|
|
387
178
|
const textColor = iconColor ?? labelColor;
|
|
388
|
-
const effectiveIcon = iconName ?
|
|
179
|
+
const effectiveIcon = iconName ? /* @__PURE__ */ React3__default.default.createElement(Icon, { name: iconName, size: iconSizeMap[size], color: textColor }) : typeof icon === "function" ? icon({ label, size, variant, color: textColor }) : icon;
|
|
389
180
|
const spinnerColor = isDisabled ? colors.foregroundMuted : variant === "destructive" ? colors.destructiveForeground : variant === "primary" ? colors.primaryForeground : colors.accentResolved;
|
|
390
181
|
const styleArray = Array.isArray(style) ? style : style ? [style] : [];
|
|
391
182
|
const flatStyle = reactNative.StyleSheet.flatten(styleArray);
|
|
@@ -393,13 +184,6 @@ function ButtonBase({
|
|
|
393
184
|
return /* @__PURE__ */ React3__default.default.createElement(reactNative.View, { style: [fullWidth && styles.fullWidth, flex !== void 0 && { flex }] }, /* @__PURE__ */ React3__default.default.createElement(
|
|
394
185
|
PressableButton,
|
|
395
186
|
{
|
|
396
|
-
style: [
|
|
397
|
-
styles.base,
|
|
398
|
-
containerVariantStyle,
|
|
399
|
-
containerSizeStyles[size],
|
|
400
|
-
fullWidth && styles.fullWidth,
|
|
401
|
-
restStyle
|
|
402
|
-
],
|
|
403
187
|
enabled: !isDisabled,
|
|
404
188
|
onPress: handlePress,
|
|
405
189
|
rippleColor: "transparent",
|
|
@@ -410,23 +194,37 @@ function ButtonBase({
|
|
|
410
194
|
accessibilityHint,
|
|
411
195
|
accessibilityState: { disabled: isDisabled, busy: loading }
|
|
412
196
|
},
|
|
413
|
-
|
|
414
|
-
|
|
197
|
+
/* @__PURE__ */ React3__default.default.createElement(
|
|
198
|
+
reactNativeEase.EaseView,
|
|
415
199
|
{
|
|
416
|
-
style: [
|
|
417
|
-
|
|
418
|
-
|
|
200
|
+
style: [
|
|
201
|
+
styles.base,
|
|
202
|
+
containerSizeStyles[size],
|
|
203
|
+
{ borderWidth },
|
|
204
|
+
fullWidth && styles.fullWidth,
|
|
205
|
+
restStyle
|
|
206
|
+
],
|
|
207
|
+
animate: { backgroundColor: animateBgColor, borderColor: animateBorderColor },
|
|
208
|
+
transition: COLOR_TRANSITION
|
|
419
209
|
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
210
|
+
loading ? /* @__PURE__ */ React3__default.default.createElement(React3__default.default.Fragment, null, /* @__PURE__ */ React3__default.default.createElement(reactNative.ActivityIndicator, { size: "small", color: spinnerColor, style: { marginRight: s(6) } }), /* @__PURE__ */ React3__default.default.createElement(
|
|
211
|
+
reactNative.Text,
|
|
212
|
+
{
|
|
213
|
+
style: [styles.label, { color: labelColor }, labelSizeStyles[size], styles.labelLoading],
|
|
214
|
+
allowFontScaling: true,
|
|
215
|
+
numberOfLines: 1
|
|
216
|
+
},
|
|
217
|
+
label
|
|
218
|
+
)) : /* @__PURE__ */ React3__default.default.createElement(React3__default.default.Fragment, null, effectiveIcon && iconPosition === "left" && /* @__PURE__ */ React3__default.default.createElement(React3__default.default.Fragment, null, effectiveIcon), /* @__PURE__ */ React3__default.default.createElement(
|
|
219
|
+
reactNative.Text,
|
|
220
|
+
{
|
|
221
|
+
style: [styles.label, { color: labelColor }, labelSizeStyles[size], effectiveIcon ? styles.labelWithIcon : void 0],
|
|
222
|
+
allowFontScaling: true,
|
|
223
|
+
numberOfLines: 1
|
|
224
|
+
},
|
|
225
|
+
label
|
|
226
|
+
), effectiveIcon && iconPosition === "right" && /* @__PURE__ */ React3__default.default.createElement(React3__default.default.Fragment, null, effectiveIcon))
|
|
227
|
+
)
|
|
430
228
|
));
|
|
431
229
|
}
|
|
432
230
|
var Button = React3__default.default.memo(ButtonBase);
|
|
@@ -457,8 +255,8 @@ function ConfirmDialog({
|
|
|
457
255
|
visible,
|
|
458
256
|
title,
|
|
459
257
|
subtitle,
|
|
460
|
-
confirmLabel = "
|
|
461
|
-
cancelLabel = "
|
|
258
|
+
confirmLabel = "Confirmar",
|
|
259
|
+
cancelLabel = "Cancelar",
|
|
462
260
|
confirmVariant = "primary",
|
|
463
261
|
loading = false,
|
|
464
262
|
showCloseButton = false,
|
|
@@ -518,7 +316,7 @@ function ConfirmDialog({
|
|
|
518
316
|
activeOpacity: 0.6,
|
|
519
317
|
touchSoundDisabled: true,
|
|
520
318
|
accessibilityRole: "button",
|
|
521
|
-
accessibilityLabel: "
|
|
319
|
+
accessibilityLabel: "Cerrar",
|
|
522
320
|
hitSlop: { top: 12, bottom: 12, left: 12, right: 12 }
|
|
523
321
|
},
|
|
524
322
|
/* @__PURE__ */ React3__default.default.createElement(vectorIcons.Feather, { name: "x", size: ms(18), color: colors.foregroundMuted })
|
package/dist/ConfirmDialog.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { ConfirmDialog } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
export { ConfirmDialog } from './chunk-V2ZB2XNS.mjs';
|
|
2
|
+
import './chunk-Y6YS33GM.mjs';
|
|
3
|
+
import './chunk-M53LC4Q7.mjs';
|
|
4
|
+
import './chunk-IFYMBOEN.mjs';
|
|
5
|
+
import './chunk-ARONDO7M.mjs';
|
|
6
6
|
import './chunk-QY3X2UYR.mjs';
|
|
7
|
-
import './chunk-
|
|
8
|
-
import './chunk-
|
|
7
|
+
import './chunk-MZ6WRTD2.mjs';
|
|
8
|
+
import './chunk-KSSVIFYR.mjs';
|
|
9
9
|
import './chunk-2CE3TQVY.mjs';
|
|
10
10
|
import './chunk-Y6FXYEAI.mjs';
|
package/dist/CurrencyDisplay.js
CHANGED
|
@@ -9,120 +9,7 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
9
9
|
var React2__default = /*#__PURE__*/_interopDefault(React2);
|
|
10
10
|
|
|
11
11
|
// src/components/CurrencyDisplay/CurrencyDisplay.tsx
|
|
12
|
-
|
|
13
|
-
// src/theme/colorUtils.ts
|
|
14
|
-
function hexToRgb(hex) {
|
|
15
|
-
const clean = hex.replace("#", "");
|
|
16
|
-
const full = clean.length === 3 ? clean.split("").map((c) => c + c).join("") : clean;
|
|
17
|
-
if (full.length !== 6) return null;
|
|
18
|
-
return {
|
|
19
|
-
r: parseInt(full.slice(0, 2), 16),
|
|
20
|
-
g: parseInt(full.slice(2, 4), 16),
|
|
21
|
-
b: parseInt(full.slice(4, 6), 16)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function componentToHex(c) {
|
|
25
|
-
return Math.round(Math.max(0, Math.min(255, c))).toString(16).padStart(2, "0");
|
|
26
|
-
}
|
|
27
|
-
function rgbToHex(r, g, b) {
|
|
28
|
-
return `#${componentToHex(r)}${componentToHex(g)}${componentToHex(b)}`;
|
|
29
|
-
}
|
|
30
|
-
function withAlphaOnWhite(hex, alpha) {
|
|
31
|
-
const rgb = hexToRgb(hex);
|
|
32
|
-
if (!rgb) return hex;
|
|
33
|
-
const r = rgb.r * alpha + 255 * (1 - alpha);
|
|
34
|
-
const g = rgb.g * alpha + 255 * (1 - alpha);
|
|
35
|
-
const b = rgb.b * alpha + 255 * (1 - alpha);
|
|
36
|
-
return rgbToHex(r, g, b);
|
|
37
|
-
}
|
|
38
|
-
function withAlphaOnDark(hex, alpha, bgHex = "#0f0f0f") {
|
|
39
|
-
const rgb = hexToRgb(hex);
|
|
40
|
-
const bg = hexToRgb(bgHex);
|
|
41
|
-
if (!rgb || !bg) return hex;
|
|
42
|
-
const r = rgb.r * alpha + bg.r * (1 - alpha);
|
|
43
|
-
const g = rgb.g * alpha + bg.g * (1 - alpha);
|
|
44
|
-
const b = rgb.b * alpha + bg.b * (1 - alpha);
|
|
45
|
-
return rgbToHex(r, g, b);
|
|
46
|
-
}
|
|
47
|
-
function mixWithBackground(fgHex, bgHex, opacity) {
|
|
48
|
-
const fg = hexToRgb(fgHex);
|
|
49
|
-
const bg = hexToRgb(bgHex);
|
|
50
|
-
if (!fg || !bg) return fgHex;
|
|
51
|
-
const r = fg.r * opacity + bg.r * (1 - opacity);
|
|
52
|
-
const g = fg.g * opacity + bg.g * (1 - opacity);
|
|
53
|
-
const b = fg.b * opacity + bg.b * (1 - opacity);
|
|
54
|
-
return rgbToHex(r, g, b);
|
|
55
|
-
}
|
|
56
|
-
function lighten(hex, amount) {
|
|
57
|
-
return withAlphaOnWhite(hex, 1 - amount);
|
|
58
|
-
}
|
|
59
|
-
function darken(hex, amount) {
|
|
60
|
-
const rgb = hexToRgb(hex);
|
|
61
|
-
if (!rgb) return hex;
|
|
62
|
-
return rgbToHex(rgb.r * (1 - amount), rgb.g * (1 - amount), rgb.b * (1 - amount));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/theme/colors.ts
|
|
66
|
-
var defaultLight = {
|
|
67
|
-
background: "#ffffff",
|
|
68
|
-
foreground: "#1a1a1a",
|
|
69
|
-
card: "#ffffff",
|
|
70
|
-
primary: "#1a1a1a",
|
|
71
|
-
primaryForeground: "#ffffff",
|
|
72
|
-
// AUDIT FIX: brand accent — was undefined; falls back to primary when omitted
|
|
73
|
-
accent: "#d4561d",
|
|
74
|
-
accentForeground: "#ffffff",
|
|
75
|
-
border: "#dddddd",
|
|
76
|
-
// AUDIT FIX: was #e53935 (4.22:1 on white — fails AA); #c72828 = 5.59:1 ✓
|
|
77
|
-
destructive: "#c72828",
|
|
78
|
-
destructiveForeground: "#ffffff",
|
|
79
|
-
success: "#1a7a45",
|
|
80
|
-
successForeground: "#ffffff",
|
|
81
|
-
// AUDIT FIX: was #e67e00 (2.86:1 — severe fail); #9a5200 = 5.86:1 ✓ AAA-near
|
|
82
|
-
warning: "#9a5200",
|
|
83
|
-
warningForeground: "#ffffff"
|
|
84
|
-
};
|
|
85
|
-
function deriveColors(t, scheme) {
|
|
86
|
-
const dark = scheme === "dark";
|
|
87
|
-
const bg = t.background;
|
|
88
|
-
const foregroundSubtle = mixWithBackground(t.foreground, bg, 0.7);
|
|
89
|
-
const foregroundMuted = mixWithBackground(t.foreground, bg, 0.62);
|
|
90
|
-
const surface = dark ? lighten(bg, -0.06) : darken(bg, 0.04);
|
|
91
|
-
const surfaceStrong = dark ? lighten(bg, -0.12) : darken(bg, 0.08);
|
|
92
|
-
const skeleton = dark ? lighten(bg, -0.1) : darken(bg, 0.1);
|
|
93
|
-
const destructiveTint = dark ? withAlphaOnDark(t.destructive, 0.15, bg) : withAlphaOnWhite(t.destructive, 0.08);
|
|
94
|
-
const destructiveBorder = dark ? withAlphaOnDark(t.destructive, 0.45, bg) : withAlphaOnWhite(t.destructive, 0.3);
|
|
95
|
-
const successTint = dark ? withAlphaOnDark(t.success, 0.15, bg) : withAlphaOnWhite(t.success, 0.08);
|
|
96
|
-
const successBorder = dark ? withAlphaOnDark(t.success, 0.45, bg) : withAlphaOnWhite(t.success, 0.3);
|
|
97
|
-
const warningTint = dark ? withAlphaOnDark(t.warning, 0.15, bg) : withAlphaOnWhite(t.warning, 0.08);
|
|
98
|
-
const warningBorder = dark ? withAlphaOnDark(t.warning, 0.45, bg) : withAlphaOnWhite(t.warning, 0.3);
|
|
99
|
-
return {
|
|
100
|
-
...t,
|
|
101
|
-
foregroundSubtle,
|
|
102
|
-
foregroundMuted,
|
|
103
|
-
surface,
|
|
104
|
-
surfaceStrong,
|
|
105
|
-
skeleton,
|
|
106
|
-
destructiveTint,
|
|
107
|
-
destructiveBorder,
|
|
108
|
-
successTint,
|
|
109
|
-
successBorder,
|
|
110
|
-
warningTint,
|
|
111
|
-
warningBorder,
|
|
112
|
-
overlay: t.overlay ?? "rgba(0,0,0,0.45)",
|
|
113
|
-
accentResolved: t.accent ?? t.primary,
|
|
114
|
-
accentForegroundResolved: t.accentForeground ?? t.primaryForeground,
|
|
115
|
-
ring: t.accent ?? t.primary,
|
|
116
|
-
input: t.border,
|
|
117
|
-
separator: dark ? lighten(t.border, 0.22) : darken(t.border, 0.16)
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// src/theme/ThemeProvider.tsx
|
|
122
|
-
var ThemeContext = React2.createContext({
|
|
123
|
-
colors: deriveColors(defaultLight, "light"),
|
|
124
|
-
colorScheme: "light"
|
|
125
|
-
});
|
|
12
|
+
var ThemeContext = React2.createContext(void 0);
|
|
126
13
|
function useTheme() {
|
|
127
14
|
const context = React2.useContext(ThemeContext);
|
|
128
15
|
if (!context) {
|
package/dist/CurrencyDisplay.mjs
CHANGED