@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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { useComponentsTokens } from "@impulse-ui-native/theme";
|
|
4
|
+
import { normalizeProgressValue } from "../../utils/progress.utils";
|
|
5
|
+
import { CircularProgress } from "./circular-progress";
|
|
6
|
+
import { LinearProgress } from "./linear-progress";
|
|
7
|
+
const Progress = memo(function Progress2({
|
|
8
|
+
accessibilityRole = "progressbar",
|
|
9
|
+
accessibilityState,
|
|
10
|
+
accessibilityValue,
|
|
11
|
+
accessible = true,
|
|
12
|
+
color,
|
|
13
|
+
max = 100,
|
|
14
|
+
min = 0,
|
|
15
|
+
size = "medium",
|
|
16
|
+
tone = "primary",
|
|
17
|
+
trackColor,
|
|
18
|
+
value,
|
|
19
|
+
variant = "linear",
|
|
20
|
+
...props
|
|
21
|
+
}) {
|
|
22
|
+
const tokens = useComponentsTokens().progress;
|
|
23
|
+
const sizeTokens = tokens.sizes[size];
|
|
24
|
+
const colorTokens = tokens.colors[tone];
|
|
25
|
+
const normalized = useMemo(
|
|
26
|
+
() => normalizeProgressValue(value, min, max),
|
|
27
|
+
[max, min, value]
|
|
28
|
+
);
|
|
29
|
+
const indeterminate = normalized.value === void 0;
|
|
30
|
+
const resolvedAccessibilityState = useMemo(
|
|
31
|
+
() => ({
|
|
32
|
+
...accessibilityState,
|
|
33
|
+
busy: indeterminate ? true : accessibilityState?.busy
|
|
34
|
+
}),
|
|
35
|
+
[accessibilityState, indeterminate]
|
|
36
|
+
);
|
|
37
|
+
const resolvedAccessibilityValue = useMemo(
|
|
38
|
+
() => ({
|
|
39
|
+
...accessibilityValue,
|
|
40
|
+
max: indeterminate ? void 0 : normalized.max,
|
|
41
|
+
min: indeterminate ? void 0 : normalized.min,
|
|
42
|
+
now: indeterminate ? void 0 : normalized.value
|
|
43
|
+
}),
|
|
44
|
+
[accessibilityValue, indeterminate, normalized]
|
|
45
|
+
);
|
|
46
|
+
const commonProps = useMemo(
|
|
47
|
+
() => ({
|
|
48
|
+
...props,
|
|
49
|
+
accessibilityRole,
|
|
50
|
+
accessibilityState: resolvedAccessibilityState,
|
|
51
|
+
accessibilityValue: resolvedAccessibilityValue,
|
|
52
|
+
accessible,
|
|
53
|
+
animationDuration: tokens.animationDuration,
|
|
54
|
+
fraction: normalized.fraction,
|
|
55
|
+
indicatorColor: color ?? colorTokens.indicatorColor,
|
|
56
|
+
indeterminate,
|
|
57
|
+
trackColor: trackColor ?? colorTokens.trackColor
|
|
58
|
+
}),
|
|
59
|
+
[
|
|
60
|
+
accessibilityRole,
|
|
61
|
+
accessible,
|
|
62
|
+
color,
|
|
63
|
+
colorTokens.indicatorColor,
|
|
64
|
+
colorTokens.trackColor,
|
|
65
|
+
indeterminate,
|
|
66
|
+
normalized.fraction,
|
|
67
|
+
props,
|
|
68
|
+
resolvedAccessibilityState,
|
|
69
|
+
resolvedAccessibilityValue,
|
|
70
|
+
tokens.animationDuration,
|
|
71
|
+
trackColor
|
|
72
|
+
]
|
|
73
|
+
);
|
|
74
|
+
return variant === "circular" ? /* @__PURE__ */ jsx(
|
|
75
|
+
CircularProgress,
|
|
76
|
+
{
|
|
77
|
+
...commonProps,
|
|
78
|
+
strokeWidth: sizeTokens.circularStrokeWidth,
|
|
79
|
+
width: sizeTokens.circularSize
|
|
80
|
+
}
|
|
81
|
+
) : /* @__PURE__ */ jsx(
|
|
82
|
+
LinearProgress,
|
|
83
|
+
{
|
|
84
|
+
...commonProps,
|
|
85
|
+
borderRadius: tokens.borderRadius,
|
|
86
|
+
indeterminateWidth: tokens.indeterminateLinearWidth,
|
|
87
|
+
trackHeight: sizeTokens.linearHeight
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
export {
|
|
92
|
+
Progress
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/atoms/progress.tsx"],"sourcesContent":["import type { AccessibilityState, AccessibilityValue } from \"react-native\";\nimport { memo, useMemo } from \"react\";\n\nimport { useComponentsTokens } from \"@impulse-ui-native/theme\";\n\nimport type { ProgressProps } from \"../../types\";\nimport { normalizeProgressValue } from \"../../utils/progress.utils\";\nimport { CircularProgress } from \"./circular-progress\";\nimport { LinearProgress } from \"./linear-progress\";\n\nexport const Progress = memo(function Progress({\n accessibilityRole = \"progressbar\",\n accessibilityState,\n accessibilityValue,\n accessible = true,\n color,\n max = 100,\n min = 0,\n size = \"medium\",\n tone = \"primary\",\n trackColor,\n value,\n variant = \"linear\",\n ...props\n}: ProgressProps) {\n const tokens = useComponentsTokens().progress;\n const sizeTokens = tokens.sizes[size];\n const colorTokens = tokens.colors[tone];\n const normalized = useMemo(\n () => normalizeProgressValue(value, min, max),\n [max, min, value],\n );\n const indeterminate = normalized.value === undefined;\n\n const resolvedAccessibilityState = useMemo<AccessibilityState>(\n () => ({\n ...accessibilityState,\n busy: indeterminate ? true : accessibilityState?.busy,\n }),\n [accessibilityState, indeterminate],\n );\n\n const resolvedAccessibilityValue = useMemo<AccessibilityValue>(\n () => ({\n ...accessibilityValue,\n max: indeterminate ? undefined : normalized.max,\n min: indeterminate ? undefined : normalized.min,\n now: indeterminate ? undefined : normalized.value,\n }),\n [accessibilityValue, indeterminate, normalized],\n );\n\n const commonProps = useMemo(\n () => ({\n ...props,\n accessibilityRole,\n accessibilityState: resolvedAccessibilityState,\n accessibilityValue: resolvedAccessibilityValue,\n accessible,\n animationDuration: tokens.animationDuration,\n fraction: normalized.fraction,\n indicatorColor: color ?? colorTokens.indicatorColor,\n indeterminate,\n trackColor: trackColor ?? colorTokens.trackColor,\n }),\n [\n accessibilityRole,\n accessible,\n color,\n colorTokens.indicatorColor,\n colorTokens.trackColor,\n indeterminate,\n normalized.fraction,\n props,\n resolvedAccessibilityState,\n resolvedAccessibilityValue,\n tokens.animationDuration,\n trackColor,\n ],\n );\n\n return variant === \"circular\" ? (\n <CircularProgress\n {...commonProps}\n strokeWidth={sizeTokens.circularStrokeWidth}\n width={sizeTokens.circularSize}\n />\n ) : (\n <LinearProgress\n {...commonProps}\n borderRadius={tokens.borderRadius}\n indeterminateWidth={tokens.indeterminateLinearWidth}\n trackHeight={sizeTokens.linearHeight}\n />\n );\n});\n"],"mappings":"AAkFI;AAjFJ,SAAS,MAAM,eAAe;AAE9B,SAAS,2BAA2B;AAGpC,SAAS,8BAA8B;AACvC,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAExB,MAAM,WAAW,KAAK,SAASA,UAAS;AAAA,EAC7C,oBAAoB;AAAA,EACpB;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,GAAG;AACL,GAAkB;AAChB,QAAM,SAAS,oBAAoB,EAAE;AACrC,QAAM,aAAa,OAAO,MAAM,IAAI;AACpC,QAAM,cAAc,OAAO,OAAO,IAAI;AACtC,QAAM,aAAa;AAAA,IACjB,MAAM,uBAAuB,OAAO,KAAK,GAAG;AAAA,IAC5C,CAAC,KAAK,KAAK,KAAK;AAAA,EAClB;AACA,QAAM,gBAAgB,WAAW,UAAU;AAE3C,QAAM,6BAA6B;AAAA,IACjC,OAAO;AAAA,MACL,GAAG;AAAA,MACH,MAAM,gBAAgB,OAAO,oBAAoB;AAAA,IACnD;AAAA,IACA,CAAC,oBAAoB,aAAa;AAAA,EACpC;AAEA,QAAM,6BAA6B;AAAA,IACjC,OAAO;AAAA,MACL,GAAG;AAAA,MACH,KAAK,gBAAgB,SAAY,WAAW;AAAA,MAC5C,KAAK,gBAAgB,SAAY,WAAW;AAAA,MAC5C,KAAK,gBAAgB,SAAY,WAAW;AAAA,IAC9C;AAAA,IACA,CAAC,oBAAoB,eAAe,UAAU;AAAA,EAChD;AAEA,QAAM,cAAc;AAAA,IAClB,OAAO;AAAA,MACL,GAAG;AAAA,MACH;AAAA,MACA,oBAAoB;AAAA,MACpB,oBAAoB;AAAA,MACpB;AAAA,MACA,mBAAmB,OAAO;AAAA,MAC1B,UAAU,WAAW;AAAA,MACrB,gBAAgB,SAAS,YAAY;AAAA,MACrC;AAAA,MACA,YAAY,cAAc,YAAY;AAAA,IACxC;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO;AAAA,MACP;AAAA,IACF;AAAA,EACF;AAEA,SAAO,YAAY,aACjB;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,aAAa,WAAW;AAAA,MACxB,OAAO,WAAW;AAAA;AAAA,EACpB,IAEA;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,cAAc,OAAO;AAAA,MACrB,oBAAoB,OAAO;AAAA,MAC3B,aAAa,WAAW;AAAA;AAAA,EAC1B;AAEJ,CAAC;","names":["Progress"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { SpinnerProps } from '../../types/spinner.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/theme';
|
|
6
|
+
|
|
7
|
+
declare const Spinner: react.MemoExoticComponent<({ accessibilityRole, accessibilityState, accessible, animating, color, hidesWhenStopped, size, style, tone, ...props }: SpinnerProps) => react_jsx_runtime.JSX.Element>;
|
|
8
|
+
|
|
9
|
+
export { Spinner };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { ActivityIndicator, StyleSheet, View } from "react-native";
|
|
4
|
+
import { useThemedStyles } from "@impulse-ui-native/theme";
|
|
5
|
+
const Spinner = memo(function Spinner2({
|
|
6
|
+
accessibilityRole = "progressbar",
|
|
7
|
+
accessibilityState,
|
|
8
|
+
accessible = true,
|
|
9
|
+
animating = true,
|
|
10
|
+
color,
|
|
11
|
+
hidesWhenStopped,
|
|
12
|
+
size = "medium",
|
|
13
|
+
style,
|
|
14
|
+
tone = "primary",
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const styles = useThemedStyles(themedStyles, { color, size, tone }, [
|
|
18
|
+
color,
|
|
19
|
+
size,
|
|
20
|
+
tone
|
|
21
|
+
]);
|
|
22
|
+
const resolvedAccessibilityState = useMemo(
|
|
23
|
+
() => ({
|
|
24
|
+
...accessibilityState,
|
|
25
|
+
busy: animating
|
|
26
|
+
}),
|
|
27
|
+
[accessibilityState, animating]
|
|
28
|
+
);
|
|
29
|
+
const containerStyle = useMemo(
|
|
30
|
+
() => [styles.container, style],
|
|
31
|
+
[style, styles.container]
|
|
32
|
+
);
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
View,
|
|
35
|
+
{
|
|
36
|
+
...props,
|
|
37
|
+
accessibilityRole,
|
|
38
|
+
accessibilityState: resolvedAccessibilityState,
|
|
39
|
+
accessible,
|
|
40
|
+
style: containerStyle,
|
|
41
|
+
children: /* @__PURE__ */ jsx(
|
|
42
|
+
ActivityIndicator,
|
|
43
|
+
{
|
|
44
|
+
accessible: false,
|
|
45
|
+
animating,
|
|
46
|
+
color: styles.indicator.color,
|
|
47
|
+
hidesWhenStopped,
|
|
48
|
+
size: "small",
|
|
49
|
+
style: styles.indicator
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
function themedStyles(theme, props) {
|
|
56
|
+
const { color, size, tone } = props;
|
|
57
|
+
const spinnerTokens = theme.components.spinner;
|
|
58
|
+
const resolvedSize = spinnerTokens.sizes[size];
|
|
59
|
+
return StyleSheet.create({
|
|
60
|
+
container: {
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
height: resolvedSize,
|
|
63
|
+
justifyContent: "center",
|
|
64
|
+
width: resolvedSize
|
|
65
|
+
},
|
|
66
|
+
indicator: {
|
|
67
|
+
color: color ?? spinnerTokens.colors[tone],
|
|
68
|
+
transform: [{ scale: resolvedSize / spinnerTokens.baseSize }]
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
Spinner
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/atoms/spinner.tsx"],"sourcesContent":["import type { AccessibilityState } from \"react-native\";\nimport { memo, useMemo } from \"react\";\nimport { ActivityIndicator, StyleSheet, View } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { SpinnerProps } from \"../../types\";\n\nexport const Spinner = memo(function Spinner({\n accessibilityRole = \"progressbar\",\n accessibilityState,\n accessible = true,\n animating = true,\n color,\n hidesWhenStopped,\n size = \"medium\",\n style,\n tone = \"primary\",\n ...props\n}: SpinnerProps) {\n const styles = useThemedStyles(themedStyles, { color, size, tone }, [\n color,\n size,\n tone,\n ]);\n\n const resolvedAccessibilityState = useMemo<AccessibilityState>(\n () => ({\n ...accessibilityState,\n busy: animating,\n }),\n [accessibilityState, animating],\n );\n\n const containerStyle = useMemo(\n () => [styles.container, style],\n [style, styles.container],\n );\n\n return (\n <View\n {...props}\n accessibilityRole={accessibilityRole}\n accessibilityState={resolvedAccessibilityState}\n accessible={accessible}\n style={containerStyle}\n >\n <ActivityIndicator\n accessible={false}\n animating={animating}\n color={styles.indicator.color}\n hidesWhenStopped={hidesWhenStopped}\n size=\"small\"\n style={styles.indicator}\n />\n </View>\n );\n});\n\ninterface SpinnerThemeProps {\n color: SpinnerProps[\"color\"];\n size: NonNullable<SpinnerProps[\"size\"]>;\n tone: NonNullable<SpinnerProps[\"tone\"]>;\n}\n\nfunction themedStyles(theme: AppTheme, props: SpinnerThemeProps) {\n const { color, size, tone } = props;\n const spinnerTokens = theme.components.spinner;\n const resolvedSize = spinnerTokens.sizes[size];\n\n return StyleSheet.create({\n container: {\n alignItems: \"center\",\n height: resolvedSize,\n justifyContent: \"center\",\n width: resolvedSize,\n },\n indicator: {\n color: color ?? spinnerTokens.colors[tone],\n transform: [{ scale: resolvedSize / spinnerTokens.baseSize }],\n },\n });\n}\n"],"mappings":"AAgDM;AA/CN,SAAS,MAAM,eAAe;AAC9B,SAAS,mBAAmB,YAAY,YAAY;AAGpD,SAAS,uBAAuB;AAIzB,MAAM,UAAU,KAAK,SAASA,SAAQ;AAAA,EAC3C,oBAAoB;AAAA,EACpB;AAAA,EACA,aAAa;AAAA,EACb,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,GAAiB;AACf,QAAM,SAAS,gBAAgB,cAAc,EAAE,OAAO,MAAM,KAAK,GAAG;AAAA,IAClE;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,6BAA6B;AAAA,IACjC,OAAO;AAAA,MACL,GAAG;AAAA,MACH,MAAM;AAAA,IACR;AAAA,IACA,CAAC,oBAAoB,SAAS;AAAA,EAChC;AAEA,QAAM,iBAAiB;AAAA,IACrB,MAAM,CAAC,OAAO,WAAW,KAAK;AAAA,IAC9B,CAAC,OAAO,OAAO,SAAS;AAAA,EAC1B;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,oBAAoB;AAAA,MACpB;AAAA,MACA,OAAO;AAAA,MAEP;AAAA,QAAC;AAAA;AAAA,UACC,YAAY;AAAA,UACZ;AAAA,UACA,OAAO,OAAO,UAAU;AAAA,UACxB;AAAA,UACA,MAAK;AAAA,UACL,OAAO,OAAO;AAAA;AAAA,MAChB;AAAA;AAAA,EACF;AAEJ,CAAC;AAQD,SAAS,aAAa,OAAiB,OAA0B;AAC/D,QAAM,EAAE,OAAO,MAAM,KAAK,IAAI;AAC9B,QAAM,gBAAgB,MAAM,WAAW;AACvC,QAAM,eAAe,cAAc,MAAM,IAAI;AAE7C,SAAO,WAAW,OAAO;AAAA,IACvB,WAAW;AAAA,MACT,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,gBAAgB;AAAA,MAChB,OAAO;AAAA,IACT;AAAA,IACA,WAAW;AAAA,MACT,OAAO,SAAS,cAAc,OAAO,IAAI;AAAA,MACzC,WAAW,CAAC,EAAE,OAAO,eAAe,cAAc,SAAS,CAAC;AAAA,IAC9D;AAAA,EACF,CAAC;AACH;","names":["Spinner"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CardRootProps, CardPressableProps, CardHeaderProps, CardContentProps, CardFooterProps, CardMediaProps } from '../../types/card.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/theme';
|
|
6
|
+
import '../../types/view.types.mjs';
|
|
7
|
+
|
|
8
|
+
declare const Card: {
|
|
9
|
+
Root: react.MemoExoticComponent<({ style, ...props }: CardRootProps) => react_jsx_runtime.JSX.Element>;
|
|
10
|
+
Pressable: react.MemoExoticComponent<({ accessibilityRole, accessibilityState, disabled, style, ...props }: CardPressableProps) => react_jsx_runtime.JSX.Element>;
|
|
11
|
+
Header: react.MemoExoticComponent<({ style, ...props }: CardHeaderProps) => react_jsx_runtime.JSX.Element>;
|
|
12
|
+
Content: react.MemoExoticComponent<({ style, ...props }: CardContentProps) => react_jsx_runtime.JSX.Element>;
|
|
13
|
+
Footer: react.MemoExoticComponent<({ style, ...props }: CardFooterProps) => react_jsx_runtime.JSX.Element>;
|
|
14
|
+
Media: react.MemoExoticComponent<({ style, ...props }: CardMediaProps) => react_jsx_runtime.JSX.Element>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { Card };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CardContent } from "./content";
|
|
2
|
+
import { CardFooter } from "./footer";
|
|
3
|
+
import { CardHeader } from "./header";
|
|
4
|
+
import { CardMedia } from "./media";
|
|
5
|
+
import { CardPressable } from "./pressable";
|
|
6
|
+
import { CardRoot } from "./root";
|
|
7
|
+
const Card = {
|
|
8
|
+
Root: CardRoot,
|
|
9
|
+
Pressable: CardPressable,
|
|
10
|
+
Header: CardHeader,
|
|
11
|
+
Content: CardContent,
|
|
12
|
+
Footer: CardFooter,
|
|
13
|
+
Media: CardMedia
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
Card
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/card.tsx"],"sourcesContent":["import { CardContent } from \"./content\";\nimport { CardFooter } from \"./footer\";\nimport { CardHeader } from \"./header\";\nimport { CardMedia } from \"./media\";\nimport { CardPressable } from \"./pressable\";\nimport { CardRoot } from \"./root\";\n\nexport const Card = {\n Root: CardRoot,\n Pressable: CardPressable,\n Header: CardHeader,\n Content: CardContent,\n Footer: CardFooter,\n Media: CardMedia,\n};\n"],"mappings":"AAAA,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AAElB,MAAM,OAAO;AAAA,EAClB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,OAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CardContentProps } from '../../types/card.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/theme';
|
|
6
|
+
import '../../types/view.types.mjs';
|
|
7
|
+
|
|
8
|
+
declare const CardContent: react.MemoExoticComponent<({ style, ...props }: CardContentProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
+
|
|
10
|
+
export { CardContent };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
import { useStyleProps, useThemedStyles } from "@impulse-ui-native/theme";
|
|
5
|
+
import { View } from "../atoms/view";
|
|
6
|
+
const CardContent = memo(function CardContent2({
|
|
7
|
+
style,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
const extractedStyleProps = useStyleProps(props);
|
|
11
|
+
const styles = useThemedStyles(themedStyles);
|
|
12
|
+
const contentStyle = useMemo(
|
|
13
|
+
() => [styles.content, extractedStyleProps, style],
|
|
14
|
+
[extractedStyleProps, style, styles.content]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx(View, { ...props, style: contentStyle });
|
|
17
|
+
});
|
|
18
|
+
function themedStyles(theme) {
|
|
19
|
+
const contentTokens = theme.components.card.content;
|
|
20
|
+
return StyleSheet.create({
|
|
21
|
+
content: {
|
|
22
|
+
gap: contentTokens.gap,
|
|
23
|
+
padding: contentTokens.padding
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
CardContent
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/content.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { CardContentProps } from \"../../types\";\nimport { View } from \"../atoms/view\";\n\nexport const CardContent = memo(function CardContent({\n style,\n ...props\n}: CardContentProps) {\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(themedStyles);\n const contentStyle = useMemo(\n () => [styles.content, extractedStyleProps, style],\n [extractedStyleProps, style, styles.content],\n );\n\n return <View {...props} style={contentStyle} />;\n});\n\nfunction themedStyles(theme: AppTheme) {\n const contentTokens = theme.components.card.content;\n\n return StyleSheet.create({\n content: {\n gap: contentTokens.gap,\n padding: contentTokens.padding,\n },\n });\n}\n"],"mappings":"AAoBS;AApBT,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAG3B,SAAS,eAAe,uBAAuB;AAG/C,SAAS,YAAY;AAEd,MAAM,cAAc,KAAK,SAASA,aAAY;AAAA,EACnD;AAAA,EACA,GAAG;AACL,GAAqB;AACnB,QAAM,sBAAsB,cAAc,KAAK;AAC/C,QAAM,SAAS,gBAAgB,YAAY;AAC3C,QAAM,eAAe;AAAA,IACnB,MAAM,CAAC,OAAO,SAAS,qBAAqB,KAAK;AAAA,IACjD,CAAC,qBAAqB,OAAO,OAAO,OAAO;AAAA,EAC7C;AAEA,SAAO,oBAAC,QAAM,GAAG,OAAO,OAAO,cAAc;AAC/C,CAAC;AAED,SAAS,aAAa,OAAiB;AACrC,QAAM,gBAAgB,MAAM,WAAW,KAAK;AAE5C,SAAO,WAAW,OAAO;AAAA,IACvB,SAAS;AAAA,MACP,KAAK,cAAc;AAAA,MACnB,SAAS,cAAc;AAAA,IACzB;AAAA,EACF,CAAC;AACH;","names":["CardContent"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CardFooterProps } from '../../types/card.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/theme';
|
|
6
|
+
import '../../types/view.types.mjs';
|
|
7
|
+
|
|
8
|
+
declare const CardFooter: react.MemoExoticComponent<({ style, ...props }: CardFooterProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
+
|
|
10
|
+
export { CardFooter };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
import { useStyleProps, useThemedStyles } from "@impulse-ui-native/theme";
|
|
5
|
+
import { View } from "../atoms/view";
|
|
6
|
+
const CardFooter = memo(function CardFooter2({
|
|
7
|
+
style,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
const extractedStyleProps = useStyleProps(props);
|
|
11
|
+
const styles = useThemedStyles(themedStyles);
|
|
12
|
+
const footerStyle = useMemo(
|
|
13
|
+
() => [styles.footer, extractedStyleProps, style],
|
|
14
|
+
[extractedStyleProps, style, styles.footer]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx(View, { ...props, style: footerStyle });
|
|
17
|
+
});
|
|
18
|
+
function themedStyles(theme) {
|
|
19
|
+
const footerTokens = theme.components.card.footer;
|
|
20
|
+
return StyleSheet.create({
|
|
21
|
+
footer: {
|
|
22
|
+
gap: footerTokens.gap,
|
|
23
|
+
padding: footerTokens.padding
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
CardFooter
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/footer.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { CardFooterProps } from \"../../types\";\nimport { View } from \"../atoms/view\";\n\nexport const CardFooter = memo(function CardFooter({\n style,\n ...props\n}: CardFooterProps) {\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(themedStyles);\n const footerStyle = useMemo(\n () => [styles.footer, extractedStyleProps, style],\n [extractedStyleProps, style, styles.footer],\n );\n\n return <View {...props} style={footerStyle} />;\n});\n\nfunction themedStyles(theme: AppTheme) {\n const footerTokens = theme.components.card.footer;\n\n return StyleSheet.create({\n footer: {\n gap: footerTokens.gap,\n padding: footerTokens.padding,\n },\n });\n}\n"],"mappings":"AAoBS;AApBT,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAG3B,SAAS,eAAe,uBAAuB;AAG/C,SAAS,YAAY;AAEd,MAAM,aAAa,KAAK,SAASA,YAAW;AAAA,EACjD;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,QAAM,sBAAsB,cAAc,KAAK;AAC/C,QAAM,SAAS,gBAAgB,YAAY;AAC3C,QAAM,cAAc;AAAA,IAClB,MAAM,CAAC,OAAO,QAAQ,qBAAqB,KAAK;AAAA,IAChD,CAAC,qBAAqB,OAAO,OAAO,MAAM;AAAA,EAC5C;AAEA,SAAO,oBAAC,QAAM,GAAG,OAAO,OAAO,aAAa;AAC9C,CAAC;AAED,SAAS,aAAa,OAAiB;AACrC,QAAM,eAAe,MAAM,WAAW,KAAK;AAE3C,SAAO,WAAW,OAAO;AAAA,IACvB,QAAQ;AAAA,MACN,KAAK,aAAa;AAAA,MAClB,SAAS,aAAa;AAAA,IACxB;AAAA,EACF,CAAC;AACH;","names":["CardFooter"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CardHeaderProps } from '../../types/card.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/theme';
|
|
6
|
+
import '../../types/view.types.mjs';
|
|
7
|
+
|
|
8
|
+
declare const CardHeader: react.MemoExoticComponent<({ style, ...props }: CardHeaderProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
+
|
|
10
|
+
export { CardHeader };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
import { useStyleProps, useThemedStyles } from "@impulse-ui-native/theme";
|
|
5
|
+
import { View } from "../atoms/view";
|
|
6
|
+
const CardHeader = memo(function CardHeader2({
|
|
7
|
+
style,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
const extractedStyleProps = useStyleProps(props);
|
|
11
|
+
const styles = useThemedStyles(themedStyles);
|
|
12
|
+
const headerStyle = useMemo(
|
|
13
|
+
() => [styles.header, extractedStyleProps, style],
|
|
14
|
+
[extractedStyleProps, style, styles.header]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx(View, { ...props, style: headerStyle });
|
|
17
|
+
});
|
|
18
|
+
function themedStyles(theme) {
|
|
19
|
+
const headerTokens = theme.components.card.header;
|
|
20
|
+
return StyleSheet.create({
|
|
21
|
+
header: {
|
|
22
|
+
gap: headerTokens.gap,
|
|
23
|
+
padding: headerTokens.padding
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
CardHeader
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/header.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { CardHeaderProps } from \"../../types\";\nimport { View } from \"../atoms/view\";\n\nexport const CardHeader = memo(function CardHeader({\n style,\n ...props\n}: CardHeaderProps) {\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(themedStyles);\n const headerStyle = useMemo(\n () => [styles.header, extractedStyleProps, style],\n [extractedStyleProps, style, styles.header],\n );\n\n return <View {...props} style={headerStyle} />;\n});\n\nfunction themedStyles(theme: AppTheme) {\n const headerTokens = theme.components.card.header;\n\n return StyleSheet.create({\n header: {\n gap: headerTokens.gap,\n padding: headerTokens.padding,\n },\n });\n}\n"],"mappings":"AAoBS;AApBT,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAG3B,SAAS,eAAe,uBAAuB;AAG/C,SAAS,YAAY;AAEd,MAAM,aAAa,KAAK,SAASA,YAAW;AAAA,EACjD;AAAA,EACA,GAAG;AACL,GAAoB;AAClB,QAAM,sBAAsB,cAAc,KAAK;AAC/C,QAAM,SAAS,gBAAgB,YAAY;AAC3C,QAAM,cAAc;AAAA,IAClB,MAAM,CAAC,OAAO,QAAQ,qBAAqB,KAAK;AAAA,IAChD,CAAC,qBAAqB,OAAO,OAAO,MAAM;AAAA,EAC5C;AAEA,SAAO,oBAAC,QAAM,GAAG,OAAO,OAAO,aAAa;AAC9C,CAAC;AAED,SAAS,aAAa,OAAiB;AACrC,QAAM,eAAe,MAAM,WAAW,KAAK;AAE3C,SAAO,WAAW,OAAO;AAAA,IACvB,QAAQ;AAAA,MACN,KAAK,aAAa;AAAA,MAClB,SAAS,aAAa;AAAA,IACxB;AAAA,EACF,CAAC;AACH;","names":["CardHeader"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/index.ts"],"sourcesContent":["export { Card } from \"./card\";\n"],"mappings":"AAAA,SAAS,YAAY;","names":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CardMediaProps } from '../../types/card.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/theme';
|
|
6
|
+
import '../../types/view.types.mjs';
|
|
7
|
+
|
|
8
|
+
declare const CardMedia: react.MemoExoticComponent<({ style, ...props }: CardMediaProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
+
|
|
10
|
+
export { CardMedia };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
import { useStyleProps, useThemedStyles } from "@impulse-ui-native/theme";
|
|
5
|
+
import { View } from "../atoms/view";
|
|
6
|
+
const CardMedia = memo(function CardMedia2({
|
|
7
|
+
style,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
const extractedStyleProps = useStyleProps(props);
|
|
11
|
+
const styles = useThemedStyles(themedStyles);
|
|
12
|
+
const mediaStyle = useMemo(
|
|
13
|
+
() => [styles.media, extractedStyleProps, style],
|
|
14
|
+
[extractedStyleProps, style, styles.media]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx(View, { ...props, style: mediaStyle });
|
|
17
|
+
});
|
|
18
|
+
function themedStyles(theme) {
|
|
19
|
+
return StyleSheet.create({
|
|
20
|
+
media: {
|
|
21
|
+
backgroundColor: theme.components.card.mediaBackgroundColor,
|
|
22
|
+
overflow: "hidden",
|
|
23
|
+
width: "100%"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
CardMedia
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/media.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { CardMediaProps } from \"../../types\";\nimport { View } from \"../atoms/view\";\n\nexport const CardMedia = memo(function CardMedia({\n style,\n ...props\n}: CardMediaProps) {\n const extractedStyleProps = useStyleProps(props);\n const styles = useThemedStyles(themedStyles);\n const mediaStyle = useMemo(\n () => [styles.media, extractedStyleProps, style],\n [extractedStyleProps, style, styles.media],\n );\n\n return <View {...props} style={mediaStyle} />;\n});\n\nfunction themedStyles(theme: AppTheme) {\n return StyleSheet.create({\n media: {\n backgroundColor: theme.components.card.mediaBackgroundColor,\n overflow: \"hidden\",\n width: \"100%\",\n },\n });\n}\n"],"mappings":"AAoBS;AApBT,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAG3B,SAAS,eAAe,uBAAuB;AAG/C,SAAS,YAAY;AAEd,MAAM,YAAY,KAAK,SAASA,WAAU;AAAA,EAC/C;AAAA,EACA,GAAG;AACL,GAAmB;AACjB,QAAM,sBAAsB,cAAc,KAAK;AAC/C,QAAM,SAAS,gBAAgB,YAAY;AAC3C,QAAM,aAAa;AAAA,IACjB,MAAM,CAAC,OAAO,OAAO,qBAAqB,KAAK;AAAA,IAC/C,CAAC,qBAAqB,OAAO,OAAO,KAAK;AAAA,EAC3C;AAEA,SAAO,oBAAC,QAAM,GAAG,OAAO,OAAO,YAAY;AAC7C,CAAC;AAED,SAAS,aAAa,OAAiB;AACrC,SAAO,WAAW,OAAO;AAAA,IACvB,OAAO;AAAA,MACL,iBAAiB,MAAM,WAAW,KAAK;AAAA,MACvC,UAAU;AAAA,MACV,OAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":["CardMedia"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CardPressableProps } from '../../types/card.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/theme';
|
|
6
|
+
import '../../types/view.types.mjs';
|
|
7
|
+
|
|
8
|
+
declare const CardPressable: react.MemoExoticComponent<({ accessibilityRole, accessibilityState, disabled, style, ...props }: CardPressableProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
+
|
|
10
|
+
export { CardPressable };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useCallback, useMemo } from "react";
|
|
3
|
+
import { StyleSheet } from "react-native";
|
|
4
|
+
import { useStyleProps, useThemedStyles } from "@impulse-ui-native/theme";
|
|
5
|
+
import { Pressable } from "../atoms/pressable";
|
|
6
|
+
import { cardRootStyles } from "./root.styles";
|
|
7
|
+
const CardPressable = memo(function CardPressable2({
|
|
8
|
+
accessibilityRole = "button",
|
|
9
|
+
accessibilityState,
|
|
10
|
+
disabled,
|
|
11
|
+
style,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
const styles = useThemedStyles(cardRootStyles);
|
|
15
|
+
const extractedStyleProps = useStyleProps(props);
|
|
16
|
+
const resolvedAccessibilityState = useMemo(
|
|
17
|
+
() => ({
|
|
18
|
+
...accessibilityState,
|
|
19
|
+
disabled: disabled === true
|
|
20
|
+
}),
|
|
21
|
+
[accessibilityState, disabled]
|
|
22
|
+
);
|
|
23
|
+
const rootStyle = useCallback(
|
|
24
|
+
(state) => StyleSheet.flatten([
|
|
25
|
+
styles.root,
|
|
26
|
+
extractedStyleProps,
|
|
27
|
+
typeof style === "function" ? style(state) : style
|
|
28
|
+
]),
|
|
29
|
+
[extractedStyleProps, style, styles.root]
|
|
30
|
+
);
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
|
+
Pressable,
|
|
33
|
+
{
|
|
34
|
+
...props,
|
|
35
|
+
accessibilityRole,
|
|
36
|
+
accessibilityState: resolvedAccessibilityState,
|
|
37
|
+
disabled: disabled === true,
|
|
38
|
+
style: rootStyle
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
CardPressable
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=pressable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/pressable.tsx"],"sourcesContent":["import type {\n AccessibilityState,\n PressableStateCallbackType,\n StyleProp,\n ViewStyle,\n} from \"react-native\";\nimport { memo, useCallback, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { CardPressableProps } from \"../../types\";\nimport { Pressable } from \"../atoms/pressable\";\nimport { cardRootStyles } from \"./root.styles\";\n\nexport const CardPressable = memo(function CardPressable({\n accessibilityRole = \"button\",\n accessibilityState,\n disabled,\n style,\n ...props\n}: CardPressableProps) {\n const styles = useThemedStyles(cardRootStyles);\n const extractedStyleProps = useStyleProps(props);\n\n const resolvedAccessibilityState = useMemo<AccessibilityState>(\n () => ({\n ...accessibilityState,\n disabled: disabled === true,\n }),\n [accessibilityState, disabled],\n );\n\n const rootStyle = useCallback(\n (state: PressableStateCallbackType): StyleProp<ViewStyle> =>\n StyleSheet.flatten([\n styles.root,\n extractedStyleProps,\n typeof style === \"function\" ? style(state) : style,\n ]),\n [extractedStyleProps, style, styles.root],\n );\n\n return (\n <Pressable\n {...props}\n accessibilityRole={accessibilityRole}\n accessibilityState={resolvedAccessibilityState}\n disabled={disabled === true}\n style={rootStyle}\n />\n );\n});\n"],"mappings":"AA4CI;AAtCJ,SAAS,MAAM,aAAa,eAAe;AAC3C,SAAS,kBAAkB;AAE3B,SAAS,eAAe,uBAAuB;AAG/C,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB;AAExB,MAAM,gBAAgB,KAAK,SAASA,eAAc;AAAA,EACvD,oBAAoB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAuB;AACrB,QAAM,SAAS,gBAAgB,cAAc;AAC7C,QAAM,sBAAsB,cAAc,KAAK;AAE/C,QAAM,6BAA6B;AAAA,IACjC,OAAO;AAAA,MACL,GAAG;AAAA,MACH,UAAU,aAAa;AAAA,IACzB;AAAA,IACA,CAAC,oBAAoB,QAAQ;AAAA,EAC/B;AAEA,QAAM,YAAY;AAAA,IAChB,CAAC,UACC,WAAW,QAAQ;AAAA,MACjB,OAAO;AAAA,MACP;AAAA,MACA,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AAAA,IAC/C,CAAC;AAAA,IACH,CAAC,qBAAqB,OAAO,OAAO,IAAI;AAAA,EAC1C;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA,oBAAoB;AAAA,MACpB,UAAU,aAAa;AAAA,MACvB,OAAO;AAAA;AAAA,EACT;AAEJ,CAAC;","names":["CardPressable"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { CardRootProps } from '../../types/card.types.mjs';
|
|
4
|
+
import 'react-native';
|
|
5
|
+
import '@impulse-ui-native/theme';
|
|
6
|
+
import '../../types/view.types.mjs';
|
|
7
|
+
|
|
8
|
+
declare const CardRoot: react.MemoExoticComponent<({ style, ...props }: CardRootProps) => react_jsx_runtime.JSX.Element>;
|
|
9
|
+
|
|
10
|
+
export { CardRoot };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { useStyleProps, useThemedStyles } from "@impulse-ui-native/theme";
|
|
4
|
+
import { View } from "../atoms/view";
|
|
5
|
+
import { cardRootStyles } from "./root.styles";
|
|
6
|
+
const CardRoot = memo(function CardRoot2({
|
|
7
|
+
style,
|
|
8
|
+
...props
|
|
9
|
+
}) {
|
|
10
|
+
const styles = useThemedStyles(cardRootStyles);
|
|
11
|
+
const extractedStyleProps = useStyleProps(props);
|
|
12
|
+
const rootStyle = useMemo(
|
|
13
|
+
() => [styles.root, extractedStyleProps, style],
|
|
14
|
+
[extractedStyleProps, style, styles.root]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx(View, { ...props, style: rootStyle });
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
CardRoot
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/root.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\n\nimport { useStyleProps, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { CardRootProps } from \"../../types\";\nimport { View } from \"../atoms/view\";\nimport { cardRootStyles } from \"./root.styles\";\n\nexport const CardRoot = memo(function CardRoot({\n style,\n ...props\n}: CardRootProps) {\n const styles = useThemedStyles(cardRootStyles);\n const extractedStyleProps = useStyleProps(props);\n const rootStyle = useMemo(\n () => [styles.root, extractedStyleProps, style],\n [extractedStyleProps, style, styles.root],\n );\n\n return <View {...props} style={rootStyle} />;\n});\n"],"mappings":"AAmBS;AAnBT,SAAS,MAAM,eAAe;AAE9B,SAAS,eAAe,uBAAuB;AAG/C,SAAS,YAAY;AACrB,SAAS,sBAAsB;AAExB,MAAM,WAAW,KAAK,SAASA,UAAS;AAAA,EAC7C;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,QAAM,SAAS,gBAAgB,cAAc;AAC7C,QAAM,sBAAsB,cAAc,KAAK;AAC/C,QAAM,YAAY;AAAA,IAChB,MAAM,CAAC,OAAO,MAAM,qBAAqB,KAAK;AAAA,IAC9C,CAAC,qBAAqB,OAAO,OAAO,IAAI;AAAA,EAC1C;AAEA,SAAO,oBAAC,QAAM,GAAG,OAAO,OAAO,WAAW;AAC5C,CAAC;","names":["CardRoot"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppTheme } from '@impulse-ui-native/theme';
|
|
2
|
+
|
|
3
|
+
declare function cardRootStyles(theme: AppTheme): {
|
|
4
|
+
root: {
|
|
5
|
+
overflow: "hidden";
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
borderColor: string;
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
borderWidth: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { cardRootStyles };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StyleSheet } from "react-native";
|
|
2
|
+
function cardRootStyles(theme) {
|
|
3
|
+
const tokens = theme.components.card;
|
|
4
|
+
return StyleSheet.create({
|
|
5
|
+
root: {
|
|
6
|
+
overflow: "hidden",
|
|
7
|
+
backgroundColor: tokens.backgroundColor,
|
|
8
|
+
borderColor: tokens.borderColor,
|
|
9
|
+
borderRadius: tokens.borderRadius,
|
|
10
|
+
borderWidth: tokens.borderWidth
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
cardRootStyles
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=root.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/card/root.styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\n\nexport function cardRootStyles(theme: AppTheme) {\n const tokens = theme.components.card;\n\n return StyleSheet.create({\n root: {\n overflow: \"hidden\",\n backgroundColor: tokens.backgroundColor,\n borderColor: tokens.borderColor,\n borderRadius: tokens.borderRadius,\n borderWidth: tokens.borderWidth,\n },\n });\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AAIpB,SAAS,eAAe,OAAiB;AAC9C,QAAM,SAAS,MAAM,WAAW;AAEhC,SAAO,WAAW,OAAO;AAAA,IACvB,MAAM;AAAA,MACJ,UAAU;AAAA,MACV,iBAAiB,OAAO;AAAA,MACxB,aAAa,OAAO;AAAA,MACpB,cAAc,OAAO;AAAA,MACrB,aAAa,OAAO;AAAA,IACtB;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -4,6 +4,7 @@ import { ControlAddonProps } 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 ControlAddon: react.MemoExoticComponent<(props: ControlAddonProps) => react_jsx_runtime.JSX.Element | null>;
|
|
@@ -4,6 +4,7 @@ import { ControlContainerProps } 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 ControlContainer: react.MemoExoticComponent<(props: ControlContainerProps) => react_jsx_runtime.JSX.Element>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ViewProps } from '../../types/view.types.mjs';
|
|
4
|
-
import { ControlContainerProps, ControlContextData, ControlLabelProps, ControlErrorLabelProps, ControlAddonProps, ControlInputProps, ControlPlaceholderProps, ControlValueProps } from '../../types/control-components.types.mjs';
|
|
4
|
+
import { ControlContainerProps, ControlContextData, ControlLabelProps, ControlErrorLabelProps, ControlAddonProps, ControlInputProps, ControlPlaceholderProps, ControlValueProps, ControlLoaderProps } from '../../types/control-components.types.mjs';
|
|
5
5
|
import 'react-native';
|
|
6
6
|
import '@impulse-ui-native/theme';
|
|
7
7
|
import '@impulse-ui-native/icon/types';
|
|
8
|
+
import '../../types/spinner.types.mjs';
|
|
8
9
|
import '../../types/button.types.mjs';
|
|
9
10
|
|
|
10
11
|
declare const Control: {
|
|
@@ -17,7 +18,7 @@ declare const Control: {
|
|
|
17
18
|
Input: react.MemoExoticComponent<(props: ControlInputProps) => react_jsx_runtime.JSX.Element>;
|
|
18
19
|
Placeholder: react.MemoExoticComponent<(props: ControlPlaceholderProps) => react_jsx_runtime.JSX.Element>;
|
|
19
20
|
Value: react.MemoExoticComponent<(props: ControlValueProps) => react_jsx_runtime.JSX.Element>;
|
|
20
|
-
Loader: react.MemoExoticComponent<() => react_jsx_runtime.JSX.Element>;
|
|
21
|
+
Loader: react.MemoExoticComponent<(props: ControlLoaderProps) => react_jsx_runtime.JSX.Element>;
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export { Control };
|