@impulse-ui-native/primitives 2.7.0 → 2.8.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 +49 -3
- package/dist/components/atoms/avatar.d.mts +10 -0
- package/dist/components/atoms/avatar.js +161 -0
- package/dist/components/atoms/avatar.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 +48 -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 +11 -2
- package/dist/components/atoms/index.js +8 -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 +74 -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 +27 -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 +27 -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 +27 -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 +32 -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 +13 -3
- 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 +11 -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/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 +6 -1
- package/dist/types/index.js +5 -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 +8 -6
|
@@ -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,17 @@
|
|
|
1
|
+
export { AvatarImageProps, AvatarProps } from './avatar.types.mjs';
|
|
1
2
|
export { ViewProps } from './view.types.mjs';
|
|
2
3
|
export { SafeAreaViewProps } from './safe-area-view.types.mjs';
|
|
3
4
|
export { TextProps } from './typography.types.mjs';
|
|
4
5
|
export { ButtonProps, ButtonThemeProps, PressableCoreProps } from './button.types.mjs';
|
|
6
|
+
export { CardContentProps, CardFooterProps, CardHeaderProps, CardMediaProps, CardPressableProps, CardRootProps } from './card.types.mjs';
|
|
7
|
+
export { DividerInset, DividerOrientation, DividerProps } from './divider.types.mjs';
|
|
5
8
|
export { IconButtonProps, IconButtonThemeProps } from './icon-button.types.mjs';
|
|
9
|
+
export { ProgressProps } from './progress.types.mjs';
|
|
10
|
+
export { SpinnerProps } from './spinner.types.mjs';
|
|
6
11
|
export { TagProps, TagThemeProps } from './tag.types.mjs';
|
|
7
12
|
export { ControlAddonProps, ControlComponentCommonProps, ControlComponentProps, ControlContainerProps, ControlContextData, ControlErrorLabelProps, ControlInputProps, ControlLabelProps, ControlLoaderProps, ControlPlaceholderProps, ControlValueProps } from './control-components.types.mjs';
|
|
13
|
+
import 'react';
|
|
8
14
|
import 'react-native';
|
|
9
15
|
import '@impulse-ui-native/theme';
|
|
10
16
|
import 'react-native-safe-area-context';
|
|
11
17
|
import '@impulse-ui-native/icon/types';
|
|
12
|
-
import 'react';
|
package/dist/types/index.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
export * from "./avatar.types";
|
|
1
2
|
export * from "./view.types";
|
|
2
3
|
export * from "./safe-area-view.types";
|
|
3
4
|
export * from "./typography.types";
|
|
4
5
|
export * from "./typography.types";
|
|
5
6
|
export * from "./button.types";
|
|
7
|
+
export * from "./card.types";
|
|
8
|
+
export * from "./divider.types";
|
|
6
9
|
export * from "./icon-button.types";
|
|
10
|
+
export * from "./progress.types";
|
|
11
|
+
export * from "./spinner.types";
|
|
7
12
|
export * from "./tag.types";
|
|
8
13
|
export * from "./control-components.types";
|
|
9
14
|
//# 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 \"./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;","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.8.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.8.0",
|
|
32
|
+
"@impulse-ui-native/icon": "2.8.0",
|
|
33
|
+
"@impulse-ui-native/core": "2.8.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/react": "~19.2.14",
|
|
@@ -39,15 +39,17 @@
|
|
|
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
|
-
"@impulse-ui-native/eslint-config": "1.0.0",
|
|
44
44
|
"@impulse-ui-native/prettier-config": "1.0.0",
|
|
45
|
+
"@impulse-ui-native/eslint-config": "1.0.0",
|
|
45
46
|
"@impulse-ui-native/tsconfig": "1.0.0"
|
|
46
47
|
},
|
|
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"
|