@impulse-ui-native/primitives 2.7.0 → 2.9.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/README.md +58 -4
- package/dist/components/atoms/avatar.d.mts +10 -0
- package/dist/components/atoms/avatar.js +144 -0
- package/dist/components/atoms/avatar.js.map +1 -0
- package/dist/components/atoms/badge/addon.d.mts +19 -0
- package/dist/components/atoms/badge/addon.js +28 -0
- package/dist/components/atoms/badge/addon.js.map +1 -0
- package/dist/components/atoms/badge/index.d.mts +11 -0
- package/dist/components/atoms/badge/index.js +5 -0
- package/dist/components/atoms/badge/index.js.map +1 -0
- package/dist/components/atoms/badge/root.d.mts +14 -0
- package/dist/components/atoms/badge/root.js +113 -0
- package/dist/components/atoms/badge/root.js.map +1 -0
- package/dist/components/atoms/button.js +4 -3
- package/dist/components/atoms/button.js.map +1 -1
- package/dist/components/atoms/circular-progress.d.mts +16 -0
- package/dist/components/atoms/circular-progress.js +144 -0
- package/dist/components/atoms/circular-progress.js.map +1 -0
- package/dist/components/atoms/divider.d.mts +10 -0
- package/dist/components/atoms/divider.js +50 -0
- package/dist/components/atoms/divider.js.map +1 -0
- package/dist/components/atoms/icon-button.js +3 -2
- package/dist/components/atoms/icon-button.js.map +1 -1
- package/dist/components/atoms/index.d.mts +16 -4
- package/dist/components/atoms/index.js +10 -0
- package/dist/components/atoms/index.js.map +1 -1
- package/dist/components/atoms/linear-progress.d.mts +17 -0
- package/dist/components/atoms/linear-progress.js +97 -0
- package/dist/components/atoms/linear-progress.js.map +1 -0
- package/dist/components/atoms/pressable.d.mts +4 -4
- package/dist/components/atoms/pressable.js +48 -43
- package/dist/components/atoms/pressable.js.map +1 -1
- package/dist/components/atoms/progress.d.mts +9 -0
- package/dist/components/atoms/progress.js +94 -0
- package/dist/components/atoms/progress.js.map +1 -0
- package/dist/components/atoms/spinner.d.mts +9 -0
- package/dist/components/atoms/spinner.js +75 -0
- package/dist/components/atoms/spinner.js.map +1 -0
- package/dist/components/card/card.d.mts +17 -0
- package/dist/components/card/card.js +18 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/card/content.d.mts +10 -0
- package/dist/components/card/content.js +30 -0
- package/dist/components/card/content.js.map +1 -0
- package/dist/components/card/footer.d.mts +10 -0
- package/dist/components/card/footer.js +30 -0
- package/dist/components/card/footer.js.map +1 -0
- package/dist/components/card/header.d.mts +10 -0
- package/dist/components/card/header.js +30 -0
- package/dist/components/card/header.js.map +1 -0
- package/dist/components/card/index.d.mts +7 -0
- package/dist/components/card/index.js +5 -0
- package/dist/components/card/index.js.map +1 -0
- package/dist/components/card/media.d.mts +10 -0
- package/dist/components/card/media.js +30 -0
- package/dist/components/card/media.js.map +1 -0
- package/dist/components/card/pressable.d.mts +10 -0
- package/dist/components/card/pressable.js +45 -0
- package/dist/components/card/pressable.js.map +1 -0
- package/dist/components/card/root.d.mts +10 -0
- package/dist/components/card/root.js +21 -0
- package/dist/components/card/root.js.map +1 -0
- package/dist/components/card/root.styles.d.mts +13 -0
- package/dist/components/card/root.styles.js +17 -0
- package/dist/components/card/root.styles.js.map +1 -0
- package/dist/components/controls/addon.d.mts +1 -0
- package/dist/components/controls/container.d.mts +1 -0
- package/dist/components/controls/control.d.mts +3 -2
- package/dist/components/controls/error.d.mts +1 -0
- package/dist/components/controls/index.d.mts +1 -0
- package/dist/components/controls/input.d.mts +1 -0
- package/dist/components/controls/label.d.mts +1 -0
- package/dist/components/controls/loader.d.mts +7 -1
- package/dist/components/controls/loader.js +3 -3
- package/dist/components/controls/loader.js.map +1 -1
- package/dist/components/controls/placeholder.d.mts +1 -0
- package/dist/components/controls/provider.d.mts +1 -0
- package/dist/components/controls/value.d.mts +1 -0
- package/dist/components/index.d.mts +18 -6
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/use-indeterminate-progress-animation.hook.d.mts +5 -0
- package/dist/hooks/use-indeterminate-progress-animation.hook.js +47 -0
- package/dist/hooks/use-indeterminate-progress-animation.hook.js.map +1 -0
- package/dist/index.d.mts +13 -1
- package/dist/types/avatar.types.d.mts +20 -0
- package/dist/types/avatar.types.js +1 -0
- package/dist/types/avatar.types.js.map +1 -0
- package/dist/types/badge.types.d.mts +24 -0
- package/dist/types/badge.types.js +1 -0
- package/dist/types/badge.types.js.map +1 -0
- package/dist/types/card.types.d.mts +21 -0
- package/dist/types/card.types.js +1 -0
- package/dist/types/card.types.js.map +1 -0
- package/dist/types/control-components.types.d.mts +3 -2
- package/dist/types/divider.types.d.mts +14 -0
- package/dist/types/divider.types.js +1 -0
- package/dist/types/divider.types.js.map +1 -0
- package/dist/types/index.d.mts +7 -1
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/progress.types.d.mts +15 -0
- package/dist/types/progress.types.js +1 -0
- package/dist/types/progress.types.js.map +1 -0
- package/dist/types/spinner.types.d.mts +9 -0
- package/dist/types/spinner.types.js +1 -0
- package/dist/types/spinner.types.js.map +1 -0
- package/dist/utils/progress.utils.d.mts +9 -0
- package/dist/utils/progress.utils.js +27 -0
- package/dist/utils/progress.utils.js.map +1 -0
- package/package.json +7 -5
|
@@ -4,6 +4,7 @@ import { ControlErrorLabelProps } from '../../types/control-components.types.mjs
|
|
|
4
4
|
import 'react-native';
|
|
5
5
|
import '@impulse-ui-native/icon/types';
|
|
6
6
|
import '@impulse-ui-native/theme';
|
|
7
|
+
import '../../types/spinner.types.mjs';
|
|
7
8
|
import '../../types/button.types.mjs';
|
|
8
9
|
|
|
9
10
|
declare const ControlError: react.MemoExoticComponent<(props: ControlErrorLabelProps) => react_jsx_runtime.JSX.Element | null>;
|
|
@@ -4,6 +4,7 @@ import { ControlInputProps } from '../../types/control-components.types.mjs';
|
|
|
4
4
|
import 'react-native';
|
|
5
5
|
import '@impulse-ui-native/icon/types';
|
|
6
6
|
import '@impulse-ui-native/theme';
|
|
7
|
+
import '../../types/spinner.types.mjs';
|
|
7
8
|
import '../../types/button.types.mjs';
|
|
8
9
|
|
|
9
10
|
declare const ControlInput: react.MemoExoticComponent<(props: ControlInputProps) => react_jsx_runtime.JSX.Element>;
|
|
@@ -4,6 +4,7 @@ import { ControlLabelProps } from '../../types/control-components.types.mjs';
|
|
|
4
4
|
import 'react-native';
|
|
5
5
|
import '@impulse-ui-native/icon/types';
|
|
6
6
|
import '@impulse-ui-native/theme';
|
|
7
|
+
import '../../types/spinner.types.mjs';
|
|
7
8
|
import '../../types/button.types.mjs';
|
|
8
9
|
|
|
9
10
|
declare const ControlLabel: react.MemoExoticComponent<(props: ControlLabelProps) => react_jsx_runtime.JSX.Element | null>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { ControlLoaderProps } from '../../types/control-components.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/icon/types';
|
|
6
|
+
import '@impulse-ui-native/theme';
|
|
7
|
+
import '../../types/spinner.types.mjs';
|
|
8
|
+
import '../../types/button.types.mjs';
|
|
3
9
|
|
|
4
|
-
declare const ControlLoader: react.MemoExoticComponent<() => react_jsx_runtime.JSX.Element>;
|
|
10
|
+
declare const ControlLoader: react.MemoExoticComponent<(props: ControlLoaderProps) => react_jsx_runtime.JSX.Element>;
|
|
5
11
|
|
|
6
12
|
export { ControlLoader };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from "react";
|
|
3
|
-
import {
|
|
4
|
-
const ControlLoader = memo(function ControlLoader2() {
|
|
5
|
-
return /* @__PURE__ */ jsx(
|
|
3
|
+
import { Spinner } from "../atoms/spinner";
|
|
4
|
+
const ControlLoader = memo(function ControlLoader2(props) {
|
|
5
|
+
return /* @__PURE__ */ jsx(Spinner, { ...props });
|
|
6
6
|
});
|
|
7
7
|
export {
|
|
8
8
|
ControlLoader
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/controls/loader.tsx"],"sourcesContent":["import { memo } from \"react\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/components/controls/loader.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport type { ControlLoaderProps } from \"../../types\";\nimport { Spinner } from \"../atoms/spinner\";\n\nexport const ControlLoader = memo(function ControlLoader(\n props: ControlLoaderProps,\n) {\n return <Spinner {...props} />;\n});\n"],"mappings":"AAQS;AART,SAAS,YAAY;AAGrB,SAAS,eAAe;AAEjB,MAAM,gBAAgB,KAAK,SAASA,eACzC,OACA;AACA,SAAO,oBAAC,WAAS,GAAG,OAAO;AAC7B,CAAC;","names":["ControlLoader"]}
|
|
@@ -4,6 +4,7 @@ import { ControlPlaceholderProps } from '../../types/control-components.types.mj
|
|
|
4
4
|
import 'react-native';
|
|
5
5
|
import '@impulse-ui-native/icon/types';
|
|
6
6
|
import '@impulse-ui-native/theme';
|
|
7
|
+
import '../../types/spinner.types.mjs';
|
|
7
8
|
import '../../types/button.types.mjs';
|
|
8
9
|
|
|
9
10
|
declare const ControlPlaceholder: react.MemoExoticComponent<(props: ControlPlaceholderProps) => react_jsx_runtime.JSX.Element>;
|
|
@@ -5,6 +5,7 @@ import { ControlContextData } from '../../types/control-components.types.mjs';
|
|
|
5
5
|
import 'react-native';
|
|
6
6
|
import '@impulse-ui-native/icon/types';
|
|
7
7
|
import '@impulse-ui-native/theme';
|
|
8
|
+
import '../../types/spinner.types.mjs';
|
|
8
9
|
import '../../types/button.types.mjs';
|
|
9
10
|
|
|
10
11
|
declare const ControlProvider: react.MemoExoticComponent<(props: PropsWithChildren<ControlContextData>) => react_jsx_runtime.JSX.Element>;
|
|
@@ -4,6 +4,7 @@ import { ControlValueProps } from '../../types/control-components.types.mjs';
|
|
|
4
4
|
import 'react-native';
|
|
5
5
|
import '@impulse-ui-native/icon/types';
|
|
6
6
|
import '@impulse-ui-native/theme';
|
|
7
|
+
import '../../types/spinner.types.mjs';
|
|
7
8
|
import '../../types/button.types.mjs';
|
|
8
9
|
|
|
9
10
|
declare const ControlValue: react.MemoExoticComponent<(props: ControlValueProps) => react_jsx_runtime.JSX.Element>;
|
|
@@ -1,22 +1,34 @@
|
|
|
1
|
+
export { Avatar } from './atoms/avatar.mjs';
|
|
2
|
+
export { BadgeRoot as Badge } from './atoms/badge/root.mjs';
|
|
1
3
|
export { View } from './atoms/view.mjs';
|
|
2
4
|
export { SafeAreaView } from './atoms/safe-area-view.mjs';
|
|
3
5
|
export { Typography, TypographyComponent } from './atoms/typography.mjs';
|
|
4
6
|
export { Button } from './atoms/button.mjs';
|
|
7
|
+
export { Divider } from './atoms/divider.mjs';
|
|
5
8
|
export { IconButton } from './atoms/icon-button.mjs';
|
|
6
9
|
export { Pressable } from './atoms/pressable.mjs';
|
|
10
|
+
export { Progress } from './atoms/progress.mjs';
|
|
11
|
+
export { Spinner } from './atoms/spinner.mjs';
|
|
7
12
|
export { Tag } from './atoms/tag.mjs';
|
|
13
|
+
export { Card } from './card/card.mjs';
|
|
8
14
|
export { Control } from './controls/control.mjs';
|
|
9
15
|
export { useControlContext } from './controls/provider.mjs';
|
|
10
16
|
import 'react';
|
|
11
|
-
import '@impulse-ui-native/theme';
|
|
12
|
-
import 'react-native';
|
|
13
17
|
import 'react/jsx-runtime';
|
|
18
|
+
import '../types/avatar.types.mjs';
|
|
19
|
+
import 'react-native';
|
|
20
|
+
import '@impulse-ui-native/theme';
|
|
21
|
+
import '../types/view.types.mjs';
|
|
22
|
+
import '../types/badge.types.mjs';
|
|
23
|
+
import '../types/control-components.types.mjs';
|
|
24
|
+
import '@impulse-ui-native/icon/types';
|
|
25
|
+
import '../types/spinner.types.mjs';
|
|
26
|
+
import '../types/button.types.mjs';
|
|
14
27
|
import '../types/safe-area-view.types.mjs';
|
|
15
28
|
import 'react-native-safe-area-context';
|
|
16
29
|
import '../types/typography.types.mjs';
|
|
17
|
-
import '../types/
|
|
30
|
+
import '../types/divider.types.mjs';
|
|
18
31
|
import '../types/icon-button.types.mjs';
|
|
19
|
-
import '
|
|
32
|
+
import '../types/progress.types.mjs';
|
|
20
33
|
import '../types/tag.types.mjs';
|
|
21
|
-
import '../types/
|
|
22
|
-
import '../types/control-components.types.mjs';
|
|
34
|
+
import '../types/card.types.mjs';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["export * from \"./atoms\";\nexport * from \"./controls\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/index.ts"],"sourcesContent":["export * from \"./atoms\";\nexport * from \"./card\";\nexport * from \"./controls\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { AccessibilityInfo, Animated, Easing } from "react-native";
|
|
3
|
+
function useIndeterminateProgressAnimation(duration) {
|
|
4
|
+
const [reduceMotion, setReduceMotion] = useState(false);
|
|
5
|
+
const progress = useRef(new Animated.Value(0)).current;
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
let mounted = true;
|
|
8
|
+
AccessibilityInfo.isReduceMotionEnabled().then((enabled) => {
|
|
9
|
+
if (mounted) {
|
|
10
|
+
setReduceMotion(enabled);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const subscription = AccessibilityInfo.addEventListener(
|
|
14
|
+
"reduceMotionChanged",
|
|
15
|
+
setReduceMotion
|
|
16
|
+
);
|
|
17
|
+
return () => {
|
|
18
|
+
mounted = false;
|
|
19
|
+
subscription.remove();
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
progress.stopAnimation();
|
|
24
|
+
if (reduceMotion) {
|
|
25
|
+
progress.setValue(0.5);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
progress.setValue(0);
|
|
29
|
+
const animation = Animated.loop(
|
|
30
|
+
Animated.timing(progress, {
|
|
31
|
+
duration,
|
|
32
|
+
easing: Easing.linear,
|
|
33
|
+
toValue: 1,
|
|
34
|
+
useNativeDriver: true
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
animation.start();
|
|
38
|
+
return () => {
|
|
39
|
+
animation.stop();
|
|
40
|
+
};
|
|
41
|
+
}, [duration, progress, reduceMotion]);
|
|
42
|
+
return progress;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
useIndeterminateProgressAnimation
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=use-indeterminate-progress-animation.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/use-indeterminate-progress-animation.hook.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport { AccessibilityInfo, Animated, Easing } from \"react-native\";\n\nexport function useIndeterminateProgressAnimation(duration: number) {\n const [reduceMotion, setReduceMotion] = useState(false);\n const progress = useRef(new Animated.Value(0)).current;\n\n useEffect(() => {\n let mounted = true;\n\n AccessibilityInfo.isReduceMotionEnabled().then((enabled) => {\n if (mounted) {\n setReduceMotion(enabled);\n }\n });\n\n const subscription = AccessibilityInfo.addEventListener(\n \"reduceMotionChanged\",\n setReduceMotion,\n );\n\n return () => {\n mounted = false;\n subscription.remove();\n };\n }, []);\n\n useEffect(() => {\n progress.stopAnimation();\n\n if (reduceMotion) {\n progress.setValue(0.5);\n return;\n }\n\n progress.setValue(0);\n\n const animation = Animated.loop(\n Animated.timing(progress, {\n duration,\n easing: Easing.linear,\n toValue: 1,\n useNativeDriver: true,\n }),\n );\n\n animation.start();\n\n return () => {\n animation.stop();\n };\n }, [duration, progress, reduceMotion]);\n\n return progress;\n}\n"],"mappings":"AAAA,SAAS,WAAW,QAAQ,gBAAgB;AAC5C,SAAS,mBAAmB,UAAU,cAAc;AAE7C,SAAS,kCAAkC,UAAkB;AAClE,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AACtD,QAAM,WAAW,OAAO,IAAI,SAAS,MAAM,CAAC,CAAC,EAAE;AAE/C,YAAU,MAAM;AACd,QAAI,UAAU;AAEd,sBAAkB,sBAAsB,EAAE,KAAK,CAAC,YAAY;AAC1D,UAAI,SAAS;AACX,wBAAgB,OAAO;AAAA,MACzB;AAAA,IACF,CAAC;AAED,UAAM,eAAe,kBAAkB;AAAA,MACrC;AAAA,MACA;AAAA,IACF;AAEA,WAAO,MAAM;AACX,gBAAU;AACV,mBAAa,OAAO;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,aAAS,cAAc;AAEvB,QAAI,cAAc;AAChB,eAAS,SAAS,GAAG;AACrB;AAAA,IACF;AAEA,aAAS,SAAS,CAAC;AAEnB,UAAM,YAAY,SAAS;AAAA,MACzB,SAAS,OAAO,UAAU;AAAA,QACxB;AAAA,QACA,QAAQ,OAAO;AAAA,QACf,SAAS;AAAA,QACT,iBAAiB;AAAA,MACnB,CAAC;AAAA,IACH;AAEA,cAAU,MAAM;AAEhB,WAAO,MAAM;AACX,gBAAU,KAAK;AAAA,IACjB;AAAA,EACF,GAAG,CAAC,UAAU,UAAU,YAAY,CAAC;AAErC,SAAO;AACT;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
|
+
export { Avatar } from './components/atoms/avatar.mjs';
|
|
2
|
+
export { BadgeRoot as Badge } from './components/atoms/badge/root.mjs';
|
|
1
3
|
export { View } from './components/atoms/view.mjs';
|
|
2
4
|
export { SafeAreaView } from './components/atoms/safe-area-view.mjs';
|
|
3
5
|
export { Typography, TypographyComponent } from './components/atoms/typography.mjs';
|
|
4
6
|
export { Button } from './components/atoms/button.mjs';
|
|
7
|
+
export { Divider } from './components/atoms/divider.mjs';
|
|
5
8
|
export { IconButton } from './components/atoms/icon-button.mjs';
|
|
6
9
|
export { Pressable } from './components/atoms/pressable.mjs';
|
|
10
|
+
export { Progress } from './components/atoms/progress.mjs';
|
|
11
|
+
export { Spinner } from './components/atoms/spinner.mjs';
|
|
7
12
|
export { Tag } from './components/atoms/tag.mjs';
|
|
13
|
+
export { Card } from './components/card/card.mjs';
|
|
8
14
|
export { Control } from './components/controls/control.mjs';
|
|
9
15
|
export { useControlContext } from './components/controls/provider.mjs';
|
|
10
16
|
export { createPreset } from './hocs/create-preset.hoc.mjs';
|
|
11
17
|
export { EdgeToShorthandKeyMap, EdgeToSpacingKeyMap } from './constants/safe-area-view.constants.mjs';
|
|
18
|
+
export { AvatarImageProps, AvatarProps } from './types/avatar.types.mjs';
|
|
19
|
+
export { BadgeProps, BadgeThemeProps } from './types/badge.types.mjs';
|
|
12
20
|
export { ViewProps } from './types/view.types.mjs';
|
|
13
21
|
export { SafeAreaViewProps } from './types/safe-area-view.types.mjs';
|
|
14
22
|
export { TextProps } from './types/typography.types.mjs';
|
|
15
23
|
export { ButtonProps, ButtonThemeProps, PressableCoreProps } from './types/button.types.mjs';
|
|
24
|
+
export { CardContentProps, CardFooterProps, CardHeaderProps, CardMediaProps, CardPressableProps, CardRootProps } from './types/card.types.mjs';
|
|
25
|
+
export { DividerInset, DividerOrientation, DividerProps } from './types/divider.types.mjs';
|
|
16
26
|
export { IconButtonProps, IconButtonThemeProps } from './types/icon-button.types.mjs';
|
|
27
|
+
export { ProgressProps } from './types/progress.types.mjs';
|
|
28
|
+
export { SpinnerProps } from './types/spinner.types.mjs';
|
|
17
29
|
export { TagProps, TagThemeProps } from './types/tag.types.mjs';
|
|
18
30
|
export { ControlAddonProps, ControlComponentCommonProps, ControlComponentProps, ControlContainerProps, ControlContextData, ControlErrorLabelProps, ControlInputProps, ControlLabelProps, ControlLoaderProps, ControlPlaceholderProps, ControlValueProps } from './types/control-components.types.mjs';
|
|
19
31
|
import 'react';
|
|
32
|
+
import 'react/jsx-runtime';
|
|
20
33
|
import '@impulse-ui-native/theme';
|
|
21
34
|
import 'react-native';
|
|
22
|
-
import 'react/jsx-runtime';
|
|
23
35
|
import 'react-native-safe-area-context';
|
|
24
36
|
import '@impulse-ui-native/icon/types';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ImageProps, StyleProp, ImageStyle, ImageSourcePropType, ViewStyle } from 'react-native';
|
|
3
|
+
import { ComponentSize, AvatarStatus, ComponentVariant } from '@impulse-ui-native/theme';
|
|
4
|
+
import { ViewProps } from './view.types.mjs';
|
|
5
|
+
|
|
6
|
+
interface AvatarImageProps extends Omit<ImageProps, "accessible" | "source" | "style"> {
|
|
7
|
+
style?: StyleProp<ImageStyle>;
|
|
8
|
+
}
|
|
9
|
+
interface AvatarProps extends Omit<ViewProps, "children"> {
|
|
10
|
+
fallback?: ReactNode;
|
|
11
|
+
imageProps?: AvatarImageProps;
|
|
12
|
+
initials?: string;
|
|
13
|
+
size?: ComponentSize;
|
|
14
|
+
source?: ImageSourcePropType;
|
|
15
|
+
status?: AvatarStatus;
|
|
16
|
+
statusColor?: ViewStyle["backgroundColor"];
|
|
17
|
+
variant?: ComponentVariant;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type { AvatarImageProps, AvatarProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=avatar.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ColorValue } from 'react-native';
|
|
3
|
+
import { ComponentSize, BadgeTone, ComponentVariant } from '@impulse-ui-native/theme';
|
|
4
|
+
import { ControlComponentCommonProps } from './control-components.types.mjs';
|
|
5
|
+
import { ViewProps } from './view.types.mjs';
|
|
6
|
+
import '@impulse-ui-native/icon/types';
|
|
7
|
+
import './spinner.types.mjs';
|
|
8
|
+
import './button.types.mjs';
|
|
9
|
+
|
|
10
|
+
interface BadgeProps extends Omit<ViewProps, "children">, Pick<ControlComponentCommonProps, "PrefixIcon" | "Prefix" | "onPressPrefix" | "SuffixIcon" | "Suffix" | "onPressSuffix"> {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
size?: ComponentSize;
|
|
13
|
+
tone?: BadgeTone;
|
|
14
|
+
variant?: ComponentVariant;
|
|
15
|
+
}
|
|
16
|
+
interface BadgeThemeProps {
|
|
17
|
+
backgroundColor?: ColorValue;
|
|
18
|
+
color?: ColorValue;
|
|
19
|
+
size: ComponentSize;
|
|
20
|
+
tone: BadgeTone;
|
|
21
|
+
variant: ComponentVariant;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type { BadgeProps, BadgeThemeProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=badge.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PressableProps, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { DimensionProps, SpacingProps, ShadowProps } from '@impulse-ui-native/theme';
|
|
4
|
+
import { ViewProps } from './view.types.mjs';
|
|
5
|
+
|
|
6
|
+
interface CardRootProps extends ViewProps {
|
|
7
|
+
}
|
|
8
|
+
interface CardPressableProps extends Omit<PressableProps, "children">, DimensionProps, SpacingProps, ShadowProps {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
pressedStyle?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
interface CardHeaderProps extends ViewProps {
|
|
13
|
+
}
|
|
14
|
+
interface CardContentProps extends ViewProps {
|
|
15
|
+
}
|
|
16
|
+
interface CardFooterProps extends ViewProps {
|
|
17
|
+
}
|
|
18
|
+
interface CardMediaProps extends ViewProps {
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type { CardContentProps, CardFooterProps, CardHeaderProps, CardMediaProps, CardPressableProps, CardRootProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=card.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
|
-
import { ViewProps, TextProps, TextInputProps
|
|
2
|
+
import { ViewProps, TextProps, TextInputProps } from 'react-native';
|
|
3
3
|
import { IconProps } from '@impulse-ui-native/icon/types';
|
|
4
4
|
import { ComponentSize, ComponentVariant } from '@impulse-ui-native/theme';
|
|
5
|
+
import { SpinnerProps } from './spinner.types.mjs';
|
|
5
6
|
import { PressableCoreProps } from './button.types.mjs';
|
|
6
7
|
|
|
7
8
|
interface ControlComponentCommonProps {
|
|
@@ -39,7 +40,7 @@ interface ControlPlaceholderProps extends TextProps {
|
|
|
39
40
|
}
|
|
40
41
|
interface ControlValueProps extends TextProps {
|
|
41
42
|
}
|
|
42
|
-
interface ControlLoaderProps extends
|
|
43
|
+
interface ControlLoaderProps extends SpinnerProps {
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export type { ControlAddonProps, ControlComponentCommonProps, ControlComponentProps, ControlContainerProps, ControlContextData, ControlErrorLabelProps, ControlInputProps, ControlLabelProps, ControlLoaderProps, ControlPlaceholderProps, ControlValueProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ViewStyle } from 'react-native';
|
|
2
|
+
import { DividerTone } from '@impulse-ui-native/theme';
|
|
3
|
+
import { ViewProps } from './view.types.mjs';
|
|
4
|
+
|
|
5
|
+
type DividerOrientation = "horizontal" | "vertical";
|
|
6
|
+
type DividerInset = "none" | "start" | "end" | "both";
|
|
7
|
+
interface DividerProps extends Omit<ViewProps, "children" | "color"> {
|
|
8
|
+
color?: ViewStyle["backgroundColor"];
|
|
9
|
+
inset?: DividerInset;
|
|
10
|
+
orientation?: DividerOrientation;
|
|
11
|
+
tone?: DividerTone;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type { DividerInset, DividerOrientation, DividerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=divider.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
export { AvatarImageProps, AvatarProps } from './avatar.types.mjs';
|
|
2
|
+
export { BadgeProps, BadgeThemeProps } from './badge.types.mjs';
|
|
1
3
|
export { ViewProps } from './view.types.mjs';
|
|
2
4
|
export { SafeAreaViewProps } from './safe-area-view.types.mjs';
|
|
3
5
|
export { TextProps } from './typography.types.mjs';
|
|
4
6
|
export { ButtonProps, ButtonThemeProps, PressableCoreProps } from './button.types.mjs';
|
|
7
|
+
export { CardContentProps, CardFooterProps, CardHeaderProps, CardMediaProps, CardPressableProps, CardRootProps } from './card.types.mjs';
|
|
8
|
+
export { DividerInset, DividerOrientation, DividerProps } from './divider.types.mjs';
|
|
5
9
|
export { IconButtonProps, IconButtonThemeProps } from './icon-button.types.mjs';
|
|
10
|
+
export { ProgressProps } from './progress.types.mjs';
|
|
11
|
+
export { SpinnerProps } from './spinner.types.mjs';
|
|
6
12
|
export { TagProps, TagThemeProps } from './tag.types.mjs';
|
|
7
13
|
export { ControlAddonProps, ControlComponentCommonProps, ControlComponentProps, ControlContainerProps, ControlContextData, ControlErrorLabelProps, ControlInputProps, ControlLabelProps, ControlLoaderProps, ControlPlaceholderProps, ControlValueProps } from './control-components.types.mjs';
|
|
14
|
+
import 'react';
|
|
8
15
|
import 'react-native';
|
|
9
16
|
import '@impulse-ui-native/theme';
|
|
10
17
|
import 'react-native-safe-area-context';
|
|
11
18
|
import '@impulse-ui-native/icon/types';
|
|
12
|
-
import 'react';
|
package/dist/types/index.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
export * from "./avatar.types";
|
|
2
|
+
export * from "./badge.types";
|
|
1
3
|
export * from "./view.types";
|
|
2
4
|
export * from "./safe-area-view.types";
|
|
3
5
|
export * from "./typography.types";
|
|
4
6
|
export * from "./typography.types";
|
|
5
7
|
export * from "./button.types";
|
|
8
|
+
export * from "./card.types";
|
|
9
|
+
export * from "./divider.types";
|
|
6
10
|
export * from "./icon-button.types";
|
|
11
|
+
export * from "./progress.types";
|
|
12
|
+
export * from "./spinner.types";
|
|
7
13
|
export * from "./tag.types";
|
|
8
14
|
export * from "./control-components.types";
|
|
9
15
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from \"./view.types\";\nexport * from \"./safe-area-view.types\";\nexport * from \"./typography.types\";\nexport * from \"./typography.types\";\nexport * from \"./button.types\";\nexport * from \"./icon-button.types\";\nexport * from \"./tag.types\";\nexport * from \"./control-components.types\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["export * from \"./avatar.types\";\nexport * from \"./badge.types\";\nexport * from \"./view.types\";\nexport * from \"./safe-area-view.types\";\nexport * from \"./typography.types\";\nexport * from \"./typography.types\";\nexport * from \"./button.types\";\nexport * from \"./card.types\";\nexport * from \"./divider.types\";\nexport * from \"./icon-button.types\";\nexport * from \"./progress.types\";\nexport * from \"./spinner.types\";\nexport * from \"./tag.types\";\nexport * from \"./control-components.types\";\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ViewProps, ColorValue } from 'react-native';
|
|
2
|
+
import { ComponentSize, ProgressTone, ProgressVariant } from '@impulse-ui-native/theme';
|
|
3
|
+
|
|
4
|
+
interface ProgressProps extends Omit<ViewProps, "children"> {
|
|
5
|
+
color?: ColorValue;
|
|
6
|
+
max?: number;
|
|
7
|
+
min?: number;
|
|
8
|
+
size?: ComponentSize;
|
|
9
|
+
tone?: ProgressTone;
|
|
10
|
+
trackColor?: ColorValue;
|
|
11
|
+
value?: number;
|
|
12
|
+
variant?: ProgressVariant;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type { ProgressProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=progress.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActivityIndicatorProps } from 'react-native';
|
|
2
|
+
import { ComponentSize, SpinnerTone } from '@impulse-ui-native/theme';
|
|
3
|
+
|
|
4
|
+
interface SpinnerProps extends Omit<ActivityIndicatorProps, "size"> {
|
|
5
|
+
size?: ComponentSize;
|
|
6
|
+
tone?: SpinnerTone;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type { SpinnerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=spinner.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface NormalizedProgressValue {
|
|
2
|
+
fraction: number;
|
|
3
|
+
max: number;
|
|
4
|
+
min: number;
|
|
5
|
+
value: number | undefined;
|
|
6
|
+
}
|
|
7
|
+
declare function normalizeProgressValue(value: number | undefined, min: number, max: number): NormalizedProgressValue;
|
|
8
|
+
|
|
9
|
+
export { type NormalizedProgressValue, normalizeProgressValue };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function normalizeProgressValue(value, min, max) {
|
|
2
|
+
const resolvedMin = Number.isFinite(min) ? min : 0;
|
|
3
|
+
const resolvedMax = Number.isFinite(max) && max > resolvedMin ? max : resolvedMin + 100;
|
|
4
|
+
if (value === void 0) {
|
|
5
|
+
return {
|
|
6
|
+
fraction: 0,
|
|
7
|
+
max: resolvedMax,
|
|
8
|
+
min: resolvedMin,
|
|
9
|
+
value: void 0
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
const finiteValue = Number.isFinite(value) ? value : resolvedMin;
|
|
13
|
+
const resolvedValue = Math.min(
|
|
14
|
+
Math.max(finiteValue, resolvedMin),
|
|
15
|
+
resolvedMax
|
|
16
|
+
);
|
|
17
|
+
return {
|
|
18
|
+
fraction: (resolvedValue - resolvedMin) / (resolvedMax - resolvedMin),
|
|
19
|
+
max: resolvedMax,
|
|
20
|
+
min: resolvedMin,
|
|
21
|
+
value: resolvedValue
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
normalizeProgressValue
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=progress.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/progress.utils.ts"],"sourcesContent":["export interface NormalizedProgressValue {\n fraction: number;\n max: number;\n min: number;\n value: number | undefined;\n}\n\nexport function normalizeProgressValue(\n value: number | undefined,\n min: number,\n max: number,\n): NormalizedProgressValue {\n const resolvedMin = Number.isFinite(min) ? min : 0;\n const resolvedMax =\n Number.isFinite(max) && max > resolvedMin ? max : resolvedMin + 100;\n\n if (value === undefined) {\n return {\n fraction: 0,\n max: resolvedMax,\n min: resolvedMin,\n value: undefined,\n };\n }\n\n const finiteValue = Number.isFinite(value) ? value : resolvedMin;\n const resolvedValue = Math.min(\n Math.max(finiteValue, resolvedMin),\n resolvedMax,\n );\n\n return {\n fraction: (resolvedValue - resolvedMin) / (resolvedMax - resolvedMin),\n max: resolvedMax,\n min: resolvedMin,\n value: resolvedValue,\n };\n}\n"],"mappings":"AAOO,SAAS,uBACd,OACA,KACA,KACyB;AACzB,QAAM,cAAc,OAAO,SAAS,GAAG,IAAI,MAAM;AACjD,QAAM,cACJ,OAAO,SAAS,GAAG,KAAK,MAAM,cAAc,MAAM,cAAc;AAElE,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,MACL,UAAU;AAAA,MACV,KAAK;AAAA,MACL,KAAK;AAAA,MACL,OAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,cAAc,OAAO,SAAS,KAAK,IAAI,QAAQ;AACrD,QAAM,gBAAgB,KAAK;AAAA,IACzB,KAAK,IAAI,aAAa,WAAW;AAAA,IACjC;AAAA,EACF;AAEA,SAAO;AAAA,IACL,WAAW,gBAAgB,gBAAgB,cAAc;AAAA,IACzD,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,EACT;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@impulse-ui-native/primitives",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Foundational UI primitives for building ImpulseUI Native components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
],
|
|
29
29
|
"sideEffects": false,
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@impulse-ui-native/theme": "2.
|
|
32
|
-
"@impulse-ui-native/icon": "2.
|
|
33
|
-
"@impulse-ui-native/core": "2.
|
|
31
|
+
"@impulse-ui-native/theme": "2.9.0",
|
|
32
|
+
"@impulse-ui-native/icon": "2.9.0",
|
|
33
|
+
"@impulse-ui-native/core": "2.9.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/react": "~19.2.14",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"react": "19.2.3",
|
|
40
40
|
"react-native": "0.86.2",
|
|
41
41
|
"react-native-safe-area-context": "~5.7.0",
|
|
42
|
+
"react-native-svg": "15.15.4",
|
|
42
43
|
"typescript": "~6.0.3",
|
|
43
44
|
"@impulse-ui-native/eslint-config": "1.0.0",
|
|
44
45
|
"@impulse-ui-native/prettier-config": "1.0.0",
|
|
@@ -47,7 +48,8 @@
|
|
|
47
48
|
"peerDependencies": {
|
|
48
49
|
"react": ">=18",
|
|
49
50
|
"react-native": ">=0.73",
|
|
50
|
-
"react-native-safe-area-context": ">=5.0.0"
|
|
51
|
+
"react-native-safe-area-context": ">=5.0.0",
|
|
52
|
+
"react-native-svg": ">=13.9.0"
|
|
51
53
|
},
|
|
52
54
|
"publishConfig": {
|
|
53
55
|
"access": "public"
|