@impulse-ui-native/primitives 9.1.1 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +21 -0
  2. package/dist/components/atoms/avatar.d.mts +1 -2
  3. package/dist/components/atoms/avatar.js +2 -1
  4. package/dist/components/atoms/avatar.js.map +1 -1
  5. package/dist/components/atoms/badge/addon.d.mts +1 -2
  6. package/dist/components/atoms/badge/addon.js +1 -1
  7. package/dist/components/atoms/badge/addon.js.map +1 -1
  8. package/dist/components/atoms/badge/index.d.mts +0 -1
  9. package/dist/components/atoms/badge/root.d.mts +1 -2
  10. package/dist/components/atoms/badge/root.js +2 -1
  11. package/dist/components/atoms/badge/root.js.map +1 -1
  12. package/dist/components/atoms/button.d.mts +1 -2
  13. package/dist/components/atoms/divider.d.mts +1 -2
  14. package/dist/components/atoms/icon-button.d.mts +1 -2
  15. package/dist/components/atoms/index.d.mts +0 -1
  16. package/dist/components/atoms/pressable.d.mts +3 -5
  17. package/dist/components/atoms/pressable.js +48 -46
  18. package/dist/components/atoms/pressable.js.map +1 -1
  19. package/dist/components/atoms/safe-area-view.d.mts +1 -2
  20. package/dist/components/atoms/spinner.d.mts +1 -2
  21. package/dist/components/atoms/tag.d.mts +1 -2
  22. package/dist/components/atoms/tag.js +2 -7
  23. package/dist/components/atoms/tag.js.map +1 -1
  24. package/dist/components/atoms/typography.d.mts +22 -23
  25. package/dist/components/atoms/view.d.mts +4 -4
  26. package/dist/components/atoms/view.js.map +1 -1
  27. package/dist/components/controls/addon.d.mts +1 -2
  28. package/dist/components/controls/container.d.mts +1 -2
  29. package/dist/components/controls/container.js +9 -33
  30. package/dist/components/controls/container.js.map +1 -1
  31. package/dist/components/controls/container.styles.d.mts +18 -0
  32. package/dist/components/controls/container.styles.js +27 -0
  33. package/dist/components/controls/container.styles.js.map +1 -0
  34. package/dist/components/controls/control.d.mts +14 -12
  35. package/dist/components/controls/control.js +6 -0
  36. package/dist/components/controls/control.js.map +1 -1
  37. package/dist/components/controls/error.d.mts +1 -2
  38. package/dist/components/controls/field.d.mts +11 -0
  39. package/dist/components/controls/field.js +46 -0
  40. package/dist/components/controls/field.js.map +1 -0
  41. package/dist/components/controls/icon.d.mts +11 -0
  42. package/dist/components/controls/icon.js +24 -0
  43. package/dist/components/controls/icon.js.map +1 -0
  44. package/dist/components/controls/index.d.mts +0 -1
  45. package/dist/components/controls/input.d.mts +1 -2
  46. package/dist/components/controls/label.d.mts +1 -2
  47. package/dist/components/controls/loader.d.mts +1 -2
  48. package/dist/components/controls/placeholder.d.mts +1 -2
  49. package/dist/components/controls/provider.d.mts +1 -2
  50. package/dist/components/controls/root.d.mts +1 -2
  51. package/dist/components/controls/trigger.d.mts +11 -0
  52. package/dist/components/controls/trigger.js +41 -0
  53. package/dist/components/controls/trigger.js.map +1 -0
  54. package/dist/components/controls/value.d.mts +1 -2
  55. package/dist/components/index.d.mts +0 -1
  56. package/dist/constants/control-root.constants.d.mts +3 -3
  57. package/dist/hocs/create-preset.hoc.d.mts +1 -2
  58. package/dist/hocs/index.d.mts +0 -1
  59. package/dist/index.d.mts +2 -3
  60. package/dist/types/control-components.types.d.mts +13 -2
  61. package/dist/types/index.d.mts +1 -1
  62. package/package.json +13 -13
@@ -1,5 +1,4 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ControlAddonProps } from '../../types/control-components.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
@@ -7,6 +6,6 @@ import '@impulse-ui-native/theme';
7
6
  import '../../types/button.types.mjs';
8
7
  import '../../types/spinner.types.mjs';
9
8
 
10
- declare const ControlAddon: react.MemoExoticComponent<({ children, disabled, hitSlop, onPress, style, ...props }: ControlAddonProps) => react_jsx_runtime.JSX.Element>;
9
+ declare const ControlAddon: react.MemoExoticComponent<({ children, disabled, hitSlop, onPress, style, ...props }: ControlAddonProps) => react.JSX.Element>;
11
10
 
12
11
  export { ControlAddon };
@@ -1,5 +1,4 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ControlContainerProps } from '../../types/control-components.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
@@ -7,6 +6,6 @@ import '@impulse-ui-native/theme';
7
6
  import '../../types/button.types.mjs';
8
7
  import '../../types/spinner.types.mjs';
9
8
 
10
- declare const ControlContainer: react.MemoExoticComponent<(props: ControlContainerProps) => react_jsx_runtime.JSX.Element>;
9
+ declare const ControlContainer: react.MemoExoticComponent<({ style, ...props }: ControlContainerProps) => react.JSX.Element>;
11
10
 
12
11
  export { ControlContainer };
@@ -1,49 +1,25 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { memo, useMemo } from "react";
3
- import { StyleSheet } from "react-native";
4
- import { getFieldStateTokens, useThemedStyles } from "@impulse-ui-native/theme";
3
+ import { useThemedStyles } from "@impulse-ui-native/theme";
5
4
  import { useControlContext } from "../../hooks/use-control-context.hook";
6
5
  import { View } from "../atoms/view";
7
- const ControlContainer = memo(function ControlContainer2(props) {
8
- const { style, ...rest } = props;
6
+ import { controlContainerStyles } from "./container.styles";
7
+ const ControlContainer = memo(function ControlContainer2({
8
+ style,
9
+ ...props
10
+ }) {
9
11
  const { size, variant, disabled, error } = useControlContext();
10
12
  const styles = useThemedStyles(
11
- themedStyles,
12
- {
13
- size,
14
- variant,
15
- disabled,
16
- error
17
- },
13
+ controlContainerStyles,
14
+ { size, variant, disabled, error },
18
15
  [size, variant, disabled, error]
19
16
  );
20
17
  const containerStyle = useMemo(
21
18
  () => [styles.inputContainer, style],
22
19
  [styles.inputContainer, style]
23
20
  );
24
- return /* @__PURE__ */ jsx(View, { style: containerStyle, ...rest });
21
+ return /* @__PURE__ */ jsx(View, { ...props, style: containerStyle });
25
22
  });
26
- function themedStyles(theme, { size, variant, disabled, error }) {
27
- const controlContainerTokens = theme.components.controlContainer;
28
- const sizeTokens = controlContainerTokens.sizes[size];
29
- const appearanceTokens = getFieldStateTokens(
30
- controlContainerTokens.variants[variant],
31
- { disabled, error: Boolean(error) }
32
- );
33
- return StyleSheet.create({
34
- inputContainer: {
35
- flexDirection: "row",
36
- alignItems: "center",
37
- height: sizeTokens.height,
38
- paddingHorizontal: sizeTokens.paddingHorizontal,
39
- borderRadius: controlContainerTokens.borderRadius,
40
- borderWidth: controlContainerTokens.borderWidth,
41
- opacity: appearanceTokens.opacity,
42
- backgroundColor: appearanceTokens.backgroundColor,
43
- borderColor: appearanceTokens.borderColor
44
- }
45
- });
46
- }
47
23
  export {
48
24
  ControlContainer
49
25
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/controls/container.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { getFieldStateTokens, useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { ControlContainerProps } from \"../../types\";\nimport type { ControlFieldThemeProps } from \"../../types/control-theme.types\";\nimport { useControlContext } from \"../../hooks/use-control-context.hook\";\nimport { View } from \"../atoms/view\";\n\nexport const ControlContainer = memo(function ControlContainer(\n props: ControlContainerProps,\n) {\n const { style, ...rest } = props;\n\n const { size, variant, disabled, error } = useControlContext();\n\n const styles = useThemedStyles(\n themedStyles,\n {\n size,\n variant,\n disabled,\n error,\n },\n [size, variant, disabled, error],\n );\n\n const containerStyle = useMemo(\n () => [styles.inputContainer, style],\n [styles.inputContainer, style],\n );\n\n return <View style={containerStyle} {...rest} />;\n});\n\nfunction themedStyles(\n theme: AppTheme,\n { size, variant, disabled, error }: ControlFieldThemeProps,\n) {\n const controlContainerTokens = theme.components.controlContainer;\n const sizeTokens = controlContainerTokens.sizes[size];\n const appearanceTokens = getFieldStateTokens(\n controlContainerTokens.variants[variant],\n { disabled, error: Boolean(error) },\n );\n\n return StyleSheet.create({\n inputContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n\n height: sizeTokens.height,\n paddingHorizontal: sizeTokens.paddingHorizontal,\n\n borderRadius: controlContainerTokens.borderRadius,\n borderWidth: controlContainerTokens.borderWidth,\n\n opacity: appearanceTokens.opacity,\n backgroundColor: appearanceTokens.backgroundColor,\n borderColor: appearanceTokens.borderColor,\n },\n });\n}\n"],"mappings":"AAkCS;AAlCT,SAAS,MAAM,eAAe;AAC9B,SAAS,kBAAkB;AAG3B,SAAS,qBAAqB,uBAAuB;AAIrD,SAAS,yBAAyB;AAClC,SAAS,YAAY;AAEd,MAAM,mBAAmB,KAAK,SAASA,kBAC5C,OACA;AACA,QAAM,EAAE,OAAO,GAAG,KAAK,IAAI;AAE3B,QAAM,EAAE,MAAM,SAAS,UAAU,MAAM,IAAI,kBAAkB;AAE7D,QAAM,SAAS;AAAA,IACb;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,MAAM,SAAS,UAAU,KAAK;AAAA,EACjC;AAEA,QAAM,iBAAiB;AAAA,IACrB,MAAM,CAAC,OAAO,gBAAgB,KAAK;AAAA,IACnC,CAAC,OAAO,gBAAgB,KAAK;AAAA,EAC/B;AAEA,SAAO,oBAAC,QAAK,OAAO,gBAAiB,GAAG,MAAM;AAChD,CAAC;AAED,SAAS,aACP,OACA,EAAE,MAAM,SAAS,UAAU,MAAM,GACjC;AACA,QAAM,yBAAyB,MAAM,WAAW;AAChD,QAAM,aAAa,uBAAuB,MAAM,IAAI;AACpD,QAAM,mBAAmB;AAAA,IACvB,uBAAuB,SAAS,OAAO;AAAA,IACvC,EAAE,UAAU,OAAO,QAAQ,KAAK,EAAE;AAAA,EACpC;AAEA,SAAO,WAAW,OAAO;AAAA,IACvB,gBAAgB;AAAA,MACd,eAAe;AAAA,MACf,YAAY;AAAA,MAEZ,QAAQ,WAAW;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAE9B,cAAc,uBAAuB;AAAA,MACrC,aAAa,uBAAuB;AAAA,MAEpC,SAAS,iBAAiB;AAAA,MAC1B,iBAAiB,iBAAiB;AAAA,MAClC,aAAa,iBAAiB;AAAA,IAChC;AAAA,EACF,CAAC;AACH;","names":["ControlContainer"]}
1
+ {"version":3,"sources":["../../../src/components/controls/container.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\n\nimport { useThemedStyles } from \"@impulse-ui-native/theme\";\n\nimport type { ControlContainerProps } from \"../../types\";\nimport { useControlContext } from \"../../hooks/use-control-context.hook\";\nimport { View } from \"../atoms/view\";\nimport { controlContainerStyles } from \"./container.styles\";\n\nexport const ControlContainer = memo(function ControlContainer({\n style,\n ...props\n}: ControlContainerProps) {\n const { size, variant, disabled, error } = useControlContext();\n const styles = useThemedStyles(\n controlContainerStyles,\n { size, variant, disabled, error },\n [size, variant, disabled, error],\n );\n const containerStyle = useMemo(\n () => [styles.inputContainer, style],\n [styles.inputContainer, style],\n );\n\n return <View {...props} style={containerStyle} />;\n});\n"],"mappings":"AAwBS;AAxBT,SAAS,MAAM,eAAe;AAE9B,SAAS,uBAAuB;AAGhC,SAAS,yBAAyB;AAClC,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEhC,MAAM,mBAAmB,KAAK,SAASA,kBAAiB;AAAA,EAC7D;AAAA,EACA,GAAG;AACL,GAA0B;AACxB,QAAM,EAAE,MAAM,SAAS,UAAU,MAAM,IAAI,kBAAkB;AAC7D,QAAM,SAAS;AAAA,IACb;AAAA,IACA,EAAE,MAAM,SAAS,UAAU,MAAM;AAAA,IACjC,CAAC,MAAM,SAAS,UAAU,KAAK;AAAA,EACjC;AACA,QAAM,iBAAiB;AAAA,IACrB,MAAM,CAAC,OAAO,gBAAgB,KAAK;AAAA,IACnC,CAAC,OAAO,gBAAgB,KAAK;AAAA,EAC/B;AAEA,SAAO,oBAAC,QAAM,GAAG,OAAO,OAAO,gBAAgB;AACjD,CAAC;","names":["ControlContainer"]}
@@ -0,0 +1,18 @@
1
+ import { AppTheme } from '@impulse-ui-native/theme';
2
+ import { ControlFieldThemeProps } from '../../types/control-theme.types.mjs';
3
+
4
+ declare function controlContainerStyles(theme: AppTheme, { size, variant, disabled, error }: ControlFieldThemeProps): Readonly<{
5
+ inputContainer: {
6
+ flexDirection: "row";
7
+ alignItems: "center";
8
+ height: number;
9
+ paddingHorizontal: number;
10
+ borderRadius: number;
11
+ borderWidth: number;
12
+ opacity: number;
13
+ backgroundColor: string;
14
+ borderColor: string;
15
+ };
16
+ }>;
17
+
18
+ export { controlContainerStyles };
@@ -0,0 +1,27 @@
1
+ import { StyleSheet } from "react-native";
2
+ import { getFieldStateTokens } from "@impulse-ui-native/theme";
3
+ function controlContainerStyles(theme, { size, variant, disabled, error }) {
4
+ const tokens = theme.components.controlContainer;
5
+ const sizeTokens = tokens.sizes[size];
6
+ const appearance = getFieldStateTokens(tokens.variants[variant], {
7
+ disabled,
8
+ error: Boolean(error)
9
+ });
10
+ return StyleSheet.create({
11
+ inputContainer: {
12
+ flexDirection: "row",
13
+ alignItems: "center",
14
+ height: sizeTokens.height,
15
+ paddingHorizontal: sizeTokens.paddingHorizontal,
16
+ borderRadius: tokens.borderRadius,
17
+ borderWidth: tokens.borderWidth,
18
+ opacity: appearance.opacity,
19
+ backgroundColor: appearance.backgroundColor,
20
+ borderColor: appearance.borderColor
21
+ }
22
+ });
23
+ }
24
+ export {
25
+ controlContainerStyles
26
+ };
27
+ //# sourceMappingURL=container.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/container.styles.ts"],"sourcesContent":["import { StyleSheet } from \"react-native\";\n\nimport type { AppTheme } from \"@impulse-ui-native/theme\";\nimport { getFieldStateTokens } from \"@impulse-ui-native/theme\";\n\nimport type { ControlFieldThemeProps } from \"../../types/control-theme.types\";\n\nexport function controlContainerStyles(\n theme: AppTheme,\n { size, variant, disabled, error }: ControlFieldThemeProps,\n) {\n const tokens = theme.components.controlContainer;\n const sizeTokens = tokens.sizes[size];\n const appearance = getFieldStateTokens(tokens.variants[variant], {\n disabled,\n error: Boolean(error),\n });\n\n return StyleSheet.create({\n inputContainer: {\n flexDirection: \"row\",\n alignItems: \"center\",\n height: sizeTokens.height,\n paddingHorizontal: sizeTokens.paddingHorizontal,\n borderRadius: tokens.borderRadius,\n borderWidth: tokens.borderWidth,\n opacity: appearance.opacity,\n backgroundColor: appearance.backgroundColor,\n borderColor: appearance.borderColor,\n },\n });\n}\n"],"mappings":"AAAA,SAAS,kBAAkB;AAG3B,SAAS,2BAA2B;AAI7B,SAAS,uBACd,OACA,EAAE,MAAM,SAAS,UAAU,MAAM,GACjC;AACA,QAAM,SAAS,MAAM,WAAW;AAChC,QAAM,aAAa,OAAO,MAAM,IAAI;AACpC,QAAM,aAAa,oBAAoB,OAAO,SAAS,OAAO,GAAG;AAAA,IAC/D;AAAA,IACA,OAAO,QAAQ,KAAK;AAAA,EACtB,CAAC;AAED,SAAO,WAAW,OAAO;AAAA,IACvB,gBAAgB;AAAA,MACd,eAAe;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ,WAAW;AAAA,MACnB,mBAAmB,WAAW;AAAA,MAC9B,cAAc,OAAO;AAAA,MACrB,aAAa,OAAO;AAAA,MACpB,SAAS,WAAW;AAAA,MACpB,iBAAiB,WAAW;AAAA,MAC5B,aAAa,WAAW;AAAA,IAC1B;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -1,7 +1,6 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ViewProps } from '../../types/view.types.mjs';
4
- import { ControlContainerProps, ControlContextData, ControlLabelProps, ControlErrorLabelProps, ControlAddonProps, ControlInputProps, ControlPlaceholderProps, ControlValueProps, ControlLoaderProps } from '../../types/control-components.types.mjs';
3
+ import { ControlFieldProps, ControlTriggerProps, ControlIconProps, ControlContainerProps, ControlContextData, ControlLabelProps, ControlErrorLabelProps, ControlAddonProps, ControlInputProps, ControlPlaceholderProps, ControlValueProps, ControlLoaderProps } from '../../types/control-components.types.mjs';
5
4
  import 'react-native';
6
5
  import '@impulse-ui-native/theme';
7
6
  import '@impulse-ui-native/icon/types';
@@ -9,16 +8,19 @@ import '../../types/button.types.mjs';
9
8
  import '../../types/spinner.types.mjs';
10
9
 
11
10
  declare const Control: {
12
- Container: react.MemoExoticComponent<(props: ControlContainerProps) => react_jsx_runtime.JSX.Element>;
13
- Provider: react.MemoExoticComponent<(props: react.PropsWithChildren<ControlContextData>) => react_jsx_runtime.JSX.Element>;
14
- Root: react.MemoExoticComponent<(props: ViewProps) => react_jsx_runtime.JSX.Element>;
15
- Label: react.MemoExoticComponent<(props: ControlLabelProps) => react_jsx_runtime.JSX.Element | null>;
16
- Error: react.MemoExoticComponent<(props: ControlErrorLabelProps) => react_jsx_runtime.JSX.Element>;
17
- Addon: react.MemoExoticComponent<({ children, disabled, hitSlop, onPress, style, ...props }: ControlAddonProps) => react_jsx_runtime.JSX.Element>;
18
- Input: react.MemoExoticComponent<(props: ControlInputProps) => react_jsx_runtime.JSX.Element>;
19
- Placeholder: react.MemoExoticComponent<(props: ControlPlaceholderProps) => react_jsx_runtime.JSX.Element>;
20
- Value: react.MemoExoticComponent<(props: ControlValueProps) => react_jsx_runtime.JSX.Element>;
21
- Loader: react.MemoExoticComponent<(props: ControlLoaderProps) => react_jsx_runtime.JSX.Element>;
11
+ Field: react.MemoExoticComponent<({ children, disabled, error, label, onPress, onPressPrefix, onPressSuffix, prefix, size, suffix, variant, }: ControlFieldProps) => react.JSX.Element>;
12
+ Trigger: react.MemoExoticComponent<({ disabled: disabledProp, style, ...props }: ControlTriggerProps) => react.JSX.Element>;
13
+ Icon: react.MemoExoticComponent<({ color, ...props }: ControlIconProps) => react.JSX.Element>;
14
+ Container: react.MemoExoticComponent<({ style, ...props }: ControlContainerProps) => react.JSX.Element>;
15
+ Provider: react.MemoExoticComponent<(props: react.PropsWithChildren<ControlContextData>) => react.JSX.Element>;
16
+ Root: react.MemoExoticComponent<(props: ViewProps) => react.JSX.Element>;
17
+ Label: react.MemoExoticComponent<(props: ControlLabelProps) => react.JSX.Element | null>;
18
+ Error: react.MemoExoticComponent<(props: ControlErrorLabelProps) => react.JSX.Element>;
19
+ Addon: react.MemoExoticComponent<({ children, disabled, hitSlop, onPress, style, ...props }: ControlAddonProps) => react.JSX.Element>;
20
+ Input: react.MemoExoticComponent<(props: ControlInputProps) => react.JSX.Element>;
21
+ Placeholder: react.MemoExoticComponent<(props: ControlPlaceholderProps) => react.JSX.Element>;
22
+ Value: react.MemoExoticComponent<(props: ControlValueProps) => react.JSX.Element>;
23
+ Loader: react.MemoExoticComponent<(props: ControlLoaderProps) => react.JSX.Element>;
22
24
  };
23
25
 
24
26
  export { Control };
@@ -1,14 +1,20 @@
1
1
  import { ControlAddon } from "./addon";
2
2
  import { ControlContainer } from "./container";
3
3
  import { ControlError } from "./error";
4
+ import { ControlField } from "./field";
5
+ import { ControlIcon } from "./icon";
4
6
  import { ControlInput } from "./input";
5
7
  import { ControlLabel } from "./label";
6
8
  import { ControlLoader } from "./loader";
7
9
  import { ControlPlaceholder } from "./placeholder";
8
10
  import { ControlProvider } from "./provider";
9
11
  import { ControlRoot } from "./root";
12
+ import { ControlTrigger } from "./trigger";
10
13
  import { ControlValue } from "./value";
11
14
  const Control = {
15
+ Field: ControlField,
16
+ Trigger: ControlTrigger,
17
+ Icon: ControlIcon,
12
18
  Container: ControlContainer,
13
19
  Provider: ControlProvider,
14
20
  Root: ControlRoot,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/controls/control.tsx"],"sourcesContent":["import { ControlAddon } from \"./addon\";\nimport { ControlContainer } from \"./container\";\nimport { ControlError } from \"./error\";\nimport { ControlInput } from \"./input\";\nimport { ControlLabel } from \"./label\";\nimport { ControlLoader } from \"./loader\";\nimport { ControlPlaceholder } from \"./placeholder\";\nimport { ControlProvider } from \"./provider\";\nimport { ControlRoot } from \"./root\";\nimport { ControlValue } from \"./value\";\n\nexport const Control = {\n Container: ControlContainer,\n Provider: ControlProvider,\n Root: ControlRoot,\n Label: ControlLabel,\n Error: ControlError,\n Addon: ControlAddon,\n Input: ControlInput,\n Placeholder: ControlPlaceholder,\n Value: ControlValue,\n Loader: ControlLoader,\n};\n"],"mappings":"AAAA,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAEtB,MAAM,UAAU;AAAA,EACrB,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AAAA,EACP,QAAQ;AACV;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/controls/control.tsx"],"sourcesContent":["import { ControlAddon } from \"./addon\";\nimport { ControlContainer } from \"./container\";\nimport { ControlError } from \"./error\";\nimport { ControlField } from \"./field\";\nimport { ControlIcon } from \"./icon\";\nimport { ControlInput } from \"./input\";\nimport { ControlLabel } from \"./label\";\nimport { ControlLoader } from \"./loader\";\nimport { ControlPlaceholder } from \"./placeholder\";\nimport { ControlProvider } from \"./provider\";\nimport { ControlRoot } from \"./root\";\nimport { ControlTrigger } from \"./trigger\";\nimport { ControlValue } from \"./value\";\n\nexport const Control = {\n Field: ControlField,\n Trigger: ControlTrigger,\n Icon: ControlIcon,\n Container: ControlContainer,\n Provider: ControlProvider,\n Root: ControlRoot,\n Label: ControlLabel,\n Error: ControlError,\n Addon: ControlAddon,\n Input: ControlInput,\n Placeholder: ControlPlaceholder,\n Value: ControlValue,\n Loader: ControlLoader,\n};\n"],"mappings":"AAAA,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAEtB,MAAM,UAAU;AAAA,EACrB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,WAAW;AAAA,EACX,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,aAAa;AAAA,EACb,OAAO;AAAA,EACP,QAAQ;AACV;","names":[]}
@@ -1,5 +1,4 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ControlErrorLabelProps } from '../../types/control-components.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
@@ -7,6 +6,6 @@ import '@impulse-ui-native/theme';
7
6
  import '../../types/button.types.mjs';
8
7
  import '../../types/spinner.types.mjs';
9
8
 
10
- declare const ControlError: react.MemoExoticComponent<(props: ControlErrorLabelProps) => react_jsx_runtime.JSX.Element>;
9
+ declare const ControlError: react.MemoExoticComponent<(props: ControlErrorLabelProps) => react.JSX.Element>;
11
10
 
12
11
  export { ControlError };
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import { ControlFieldProps } from '../../types/control-components.types.mjs';
3
+ import 'react-native';
4
+ import '@impulse-ui-native/icon/types';
5
+ import '@impulse-ui-native/theme';
6
+ import '../../types/button.types.mjs';
7
+ import '../../types/spinner.types.mjs';
8
+
9
+ declare const ControlField: react.MemoExoticComponent<({ children, disabled, error, label, onPress, onPressPrefix, onPressSuffix, prefix, size, suffix, variant, }: ControlFieldProps) => react.JSX.Element>;
10
+
11
+ export { ControlField };
@@ -0,0 +1,46 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { memo } from "react";
3
+ import { ControlAddon } from "./addon";
4
+ import { ControlError } from "./error";
5
+ import { ControlLabel } from "./label";
6
+ import { ControlProvider } from "./provider";
7
+ import { ControlRoot } from "./root";
8
+ import { ControlTrigger } from "./trigger";
9
+ const ControlField = memo(function ControlField2({
10
+ children,
11
+ disabled,
12
+ error,
13
+ label,
14
+ onPress,
15
+ onPressPrefix,
16
+ onPressSuffix,
17
+ prefix,
18
+ size = "medium",
19
+ suffix,
20
+ variant = "outlined"
21
+ }) {
22
+ const hasPrefix = prefix !== null && prefix !== void 0;
23
+ const hasSuffix = suffix !== null && suffix !== void 0;
24
+ return /* @__PURE__ */ jsx(
25
+ ControlProvider,
26
+ {
27
+ size,
28
+ variant,
29
+ error,
30
+ disabled,
31
+ children: /* @__PURE__ */ jsxs(ControlRoot, { children: [
32
+ /* @__PURE__ */ jsx(ControlLabel, { children: label }),
33
+ /* @__PURE__ */ jsxs(ControlTrigger, { onPress, children: [
34
+ hasPrefix ? /* @__PURE__ */ jsx(ControlAddon, { onPress: onPressPrefix, children: prefix }) : null,
35
+ children,
36
+ hasSuffix ? /* @__PURE__ */ jsx(ControlAddon, { onPress: onPressSuffix, children: suffix }) : null
37
+ ] }),
38
+ error ? /* @__PURE__ */ jsx(ControlError, { children: error }) : null
39
+ ] })
40
+ }
41
+ );
42
+ });
43
+ export {
44
+ ControlField
45
+ };
46
+ //# sourceMappingURL=field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/field.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport type { ControlFieldProps } from \"../../types\";\nimport { ControlAddon } from \"./addon\";\nimport { ControlError } from \"./error\";\nimport { ControlLabel } from \"./label\";\nimport { ControlProvider } from \"./provider\";\nimport { ControlRoot } from \"./root\";\nimport { ControlTrigger } from \"./trigger\";\n\nexport const ControlField = memo(function ControlField({\n children,\n disabled,\n error,\n label,\n onPress,\n onPressPrefix,\n onPressSuffix,\n prefix,\n size = \"medium\",\n suffix,\n variant = \"outlined\",\n}: ControlFieldProps) {\n const hasPrefix = prefix !== null && prefix !== undefined;\n const hasSuffix = suffix !== null && suffix !== undefined;\n\n return (\n <ControlProvider\n size={size}\n variant={variant}\n error={error}\n disabled={disabled}\n >\n <ControlRoot>\n <ControlLabel>{label}</ControlLabel>\n <ControlTrigger onPress={onPress}>\n {hasPrefix ? (\n <ControlAddon onPress={onPressPrefix}>{prefix}</ControlAddon>\n ) : null}\n {children}\n {hasSuffix ? (\n <ControlAddon onPress={onPressSuffix}>{suffix}</ControlAddon>\n ) : null}\n </ControlTrigger>\n {error ? <ControlError>{error}</ControlError> : null}\n </ControlRoot>\n </ControlProvider>\n );\n});\n"],"mappings":"AAkCQ,cACA,YADA;AAlCR,SAAS,YAAY;AAGrB,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAExB,MAAM,eAAe,KAAK,SAASA,cAAa;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP;AAAA,EACA,UAAU;AACZ,GAAsB;AACpB,QAAM,YAAY,WAAW,QAAQ,WAAW;AAChD,QAAM,YAAY,WAAW,QAAQ,WAAW;AAEhD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA,+BAAC,eACC;AAAA,4BAAC,gBAAc,iBAAM;AAAA,QACrB,qBAAC,kBAAe,SACb;AAAA,sBACC,oBAAC,gBAAa,SAAS,eAAgB,kBAAO,IAC5C;AAAA,UACH;AAAA,UACA,YACC,oBAAC,gBAAa,SAAS,eAAgB,kBAAO,IAC5C;AAAA,WACN;AAAA,QACC,QAAQ,oBAAC,gBAAc,iBAAM,IAAkB;AAAA,SAClD;AAAA;AAAA,EACF;AAEJ,CAAC;","names":["ControlField"]}
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import { ControlIconProps } from '../../types/control-components.types.mjs';
3
+ import 'react-native';
4
+ import '@impulse-ui-native/icon/types';
5
+ import '@impulse-ui-native/theme';
6
+ import '../../types/button.types.mjs';
7
+ import '../../types/spinner.types.mjs';
8
+
9
+ declare const ControlIcon: react.MemoExoticComponent<({ color, ...props }: ControlIconProps) => react.JSX.Element>;
10
+
11
+ export { ControlIcon };
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { memo } from "react";
3
+ import { Icon } from "@impulse-ui-native/icon";
4
+ import {
5
+ getFieldStateTokens,
6
+ useComponentsTokens
7
+ } from "@impulse-ui-native/theme";
8
+ import { useControlContext } from "../../hooks/use-control-context.hook";
9
+ const ControlIcon = memo(function ControlIcon2({
10
+ color,
11
+ ...props
12
+ }) {
13
+ const { variant, disabled, error } = useControlContext();
14
+ const tokens = useComponentsTokens().controlAddon;
15
+ const appearance = getFieldStateTokens(tokens.variants[variant], {
16
+ disabled,
17
+ error: Boolean(error)
18
+ });
19
+ return /* @__PURE__ */ jsx(Icon, { ...props, color: color ?? appearance.iconColor });
20
+ });
21
+ export {
22
+ ControlIcon
23
+ };
24
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/icon.tsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Icon } from \"@impulse-ui-native/icon\";\nimport {\n getFieldStateTokens,\n useComponentsTokens,\n} from \"@impulse-ui-native/theme\";\n\nimport type { ControlIconProps } from \"../../types\";\nimport { useControlContext } from \"../../hooks/use-control-context.hook\";\n\nexport const ControlIcon = memo(function ControlIcon({\n color,\n ...props\n}: ControlIconProps) {\n const { variant, disabled, error } = useControlContext();\n const tokens = useComponentsTokens().controlAddon;\n const appearance = getFieldStateTokens(tokens.variants[variant], {\n disabled,\n error: Boolean(error),\n });\n\n return <Icon {...props} color={color ?? appearance.iconColor} />;\n});\n"],"mappings":"AAsBS;AAtBT,SAAS,YAAY;AAErB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAE3B,MAAM,cAAc,KAAK,SAASA,aAAY;AAAA,EACnD;AAAA,EACA,GAAG;AACL,GAAqB;AACnB,QAAM,EAAE,SAAS,UAAU,MAAM,IAAI,kBAAkB;AACvD,QAAM,SAAS,oBAAoB,EAAE;AACrC,QAAM,aAAa,oBAAoB,OAAO,SAAS,OAAO,GAAG;AAAA,IAC/D;AAAA,IACA,OAAO,QAAQ,KAAK;AAAA,EACtB,CAAC;AAED,SAAO,oBAAC,QAAM,GAAG,OAAO,OAAO,SAAS,WAAW,WAAW;AAChE,CAAC;","names":["ControlIcon"]}
@@ -1,7 +1,6 @@
1
1
  export { Control } from './control.mjs';
2
2
  export { useControlContext } from '../../hooks/use-control-context.hook.mjs';
3
3
  import 'react';
4
- import 'react/jsx-runtime';
5
4
  import '../../types/view.types.mjs';
6
5
  import 'react-native';
7
6
  import '@impulse-ui-native/theme';
@@ -1,5 +1,4 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ControlInputProps } from '../../types/control-components.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
@@ -7,6 +6,6 @@ import '@impulse-ui-native/theme';
7
6
  import '../../types/button.types.mjs';
8
7
  import '../../types/spinner.types.mjs';
9
8
 
10
- declare const ControlInput: react.MemoExoticComponent<(props: ControlInputProps) => react_jsx_runtime.JSX.Element>;
9
+ declare const ControlInput: react.MemoExoticComponent<(props: ControlInputProps) => react.JSX.Element>;
11
10
 
12
11
  export { ControlInput };
@@ -1,5 +1,4 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ControlLabelProps } from '../../types/control-components.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
@@ -7,6 +6,6 @@ import '@impulse-ui-native/theme';
7
6
  import '../../types/button.types.mjs';
8
7
  import '../../types/spinner.types.mjs';
9
8
 
10
- declare const ControlLabel: react.MemoExoticComponent<(props: ControlLabelProps) => react_jsx_runtime.JSX.Element | null>;
9
+ declare const ControlLabel: react.MemoExoticComponent<(props: ControlLabelProps) => react.JSX.Element | null>;
11
10
 
12
11
  export { ControlLabel };
@@ -1,5 +1,4 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ControlLoaderProps } from '../../types/control-components.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
@@ -7,6 +6,6 @@ import '@impulse-ui-native/theme';
7
6
  import '../../types/button.types.mjs';
8
7
  import '../../types/spinner.types.mjs';
9
8
 
10
- declare const ControlLoader: react.MemoExoticComponent<(props: ControlLoaderProps) => react_jsx_runtime.JSX.Element>;
9
+ declare const ControlLoader: react.MemoExoticComponent<(props: ControlLoaderProps) => react.JSX.Element>;
11
10
 
12
11
  export { ControlLoader };
@@ -1,5 +1,4 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ControlPlaceholderProps } from '../../types/control-components.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
@@ -7,6 +6,6 @@ import '@impulse-ui-native/theme';
7
6
  import '../../types/button.types.mjs';
8
7
  import '../../types/spinner.types.mjs';
9
8
 
10
- declare const ControlPlaceholder: react.MemoExoticComponent<(props: ControlPlaceholderProps) => react_jsx_runtime.JSX.Element>;
9
+ declare const ControlPlaceholder: react.MemoExoticComponent<(props: ControlPlaceholderProps) => react.JSX.Element>;
11
10
 
12
11
  export { ControlPlaceholder };
@@ -1,6 +1,5 @@
1
1
  import * as react from 'react';
2
2
  import { PropsWithChildren } from 'react';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
3
  import { ControlContextData } from '../../types/control-components.types.mjs';
5
4
  import 'react-native';
6
5
  import '@impulse-ui-native/icon/types';
@@ -8,6 +7,6 @@ import '@impulse-ui-native/theme';
8
7
  import '../../types/button.types.mjs';
9
8
  import '../../types/spinner.types.mjs';
10
9
 
11
- declare const ControlProvider: react.MemoExoticComponent<(props: PropsWithChildren<ControlContextData>) => react_jsx_runtime.JSX.Element>;
10
+ declare const ControlProvider: react.MemoExoticComponent<(props: PropsWithChildren<ControlContextData>) => react.JSX.Element>;
12
11
 
13
12
  export { ControlProvider };
@@ -1,9 +1,8 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ViewProps } from '../../types/view.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/theme';
6
5
 
7
- declare const ControlRoot: react.MemoExoticComponent<(props: ViewProps) => react_jsx_runtime.JSX.Element>;
6
+ declare const ControlRoot: react.MemoExoticComponent<(props: ViewProps) => react.JSX.Element>;
8
7
 
9
8
  export { ControlRoot };
@@ -0,0 +1,11 @@
1
+ import * as react from 'react';
2
+ import { ControlTriggerProps } from '../../types/control-components.types.mjs';
3
+ import 'react-native';
4
+ import '@impulse-ui-native/icon/types';
5
+ import '@impulse-ui-native/theme';
6
+ import '../../types/button.types.mjs';
7
+ import '../../types/spinner.types.mjs';
8
+
9
+ declare const ControlTrigger: react.MemoExoticComponent<({ disabled: disabledProp, style, ...props }: ControlTriggerProps) => react.JSX.Element>;
10
+
11
+ export { ControlTrigger };
@@ -0,0 +1,41 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { memo, useCallback } from "react";
3
+ import {
4
+ useComponentsTokens,
5
+ useStyleProps,
6
+ useThemedStyles
7
+ } from "@impulse-ui-native/theme";
8
+ import { useControlContext } from "../../hooks/use-control-context.hook";
9
+ import { Pressable } from "../atoms/pressable";
10
+ import { controlContainerStyles } from "./container.styles";
11
+ const ControlTrigger = memo(function ControlTrigger2({
12
+ disabled: disabledProp,
13
+ style,
14
+ ...props
15
+ }) {
16
+ const { size, variant, disabled, error } = useControlContext();
17
+ const tokens = useComponentsTokens().pressable;
18
+ const resolvedDisabled = Boolean(disabled) || disabledProp === true;
19
+ const styles = useThemedStyles(
20
+ controlContainerStyles,
21
+ { size, variant, disabled: resolvedDisabled, error },
22
+ [size, variant, resolvedDisabled, error]
23
+ );
24
+ const extractedStyleProps = useStyleProps(props);
25
+ const triggerStyle = useCallback(
26
+ (state) => [
27
+ styles.inputContainer,
28
+ {
29
+ opacity: styles.inputContainer.opacity * (state.pressed ? tokens.pressedOpacity : 1)
30
+ },
31
+ extractedStyleProps,
32
+ typeof style === "function" ? style(state) : style
33
+ ],
34
+ [extractedStyleProps, style, styles.inputContainer, tokens.pressedOpacity]
35
+ );
36
+ return /* @__PURE__ */ jsx(Pressable, { ...props, disabled: resolvedDisabled, style: triggerStyle });
37
+ });
38
+ export {
39
+ ControlTrigger
40
+ };
41
+ //# sourceMappingURL=trigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/controls/trigger.tsx"],"sourcesContent":["import type { PressableStateCallbackType } from \"react-native\";\nimport { memo, useCallback } from \"react\";\n\nimport {\n useComponentsTokens,\n useStyleProps,\n useThemedStyles,\n} from \"@impulse-ui-native/theme\";\n\nimport type { ControlTriggerProps } from \"../../types\";\nimport { useControlContext } from \"../../hooks/use-control-context.hook\";\nimport { Pressable } from \"../atoms/pressable\";\nimport { controlContainerStyles } from \"./container.styles\";\n\nexport const ControlTrigger = memo(function ControlTrigger({\n disabled: disabledProp,\n style,\n ...props\n}: ControlTriggerProps) {\n const { size, variant, disabled, error } = useControlContext();\n const tokens = useComponentsTokens().pressable;\n const resolvedDisabled = Boolean(disabled) || disabledProp === true;\n const styles = useThemedStyles(\n controlContainerStyles,\n { size, variant, disabled: resolvedDisabled, error },\n [size, variant, resolvedDisabled, error],\n );\n const extractedStyleProps = useStyleProps(props);\n\n const triggerStyle = useCallback(\n (state: PressableStateCallbackType) => [\n styles.inputContainer,\n {\n opacity:\n styles.inputContainer.opacity *\n (state.pressed ? tokens.pressedOpacity : 1),\n },\n extractedStyleProps,\n typeof style === \"function\" ? style(state) : style,\n ],\n [extractedStyleProps, style, styles.inputContainer, tokens.pressedOpacity],\n );\n\n return (\n <Pressable {...props} disabled={resolvedDisabled} style={triggerStyle} />\n );\n});\n"],"mappings":"AA4CI;AA3CJ,SAAS,MAAM,mBAAmB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,yBAAyB;AAClC,SAAS,iBAAiB;AAC1B,SAAS,8BAA8B;AAEhC,MAAM,iBAAiB,KAAK,SAASA,gBAAe;AAAA,EACzD,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAAwB;AACtB,QAAM,EAAE,MAAM,SAAS,UAAU,MAAM,IAAI,kBAAkB;AAC7D,QAAM,SAAS,oBAAoB,EAAE;AACrC,QAAM,mBAAmB,QAAQ,QAAQ,KAAK,iBAAiB;AAC/D,QAAM,SAAS;AAAA,IACb;AAAA,IACA,EAAE,MAAM,SAAS,UAAU,kBAAkB,MAAM;AAAA,IACnD,CAAC,MAAM,SAAS,kBAAkB,KAAK;AAAA,EACzC;AACA,QAAM,sBAAsB,cAAc,KAAK;AAE/C,QAAM,eAAe;AAAA,IACnB,CAAC,UAAsC;AAAA,MACrC,OAAO;AAAA,MACP;AAAA,QACE,SACE,OAAO,eAAe,WACrB,MAAM,UAAU,OAAO,iBAAiB;AAAA,MAC7C;AAAA,MACA;AAAA,MACA,OAAO,UAAU,aAAa,MAAM,KAAK,IAAI;AAAA,IAC/C;AAAA,IACA,CAAC,qBAAqB,OAAO,OAAO,gBAAgB,OAAO,cAAc;AAAA,EAC3E;AAEA,SACE,oBAAC,aAAW,GAAG,OAAO,UAAU,kBAAkB,OAAO,cAAc;AAE3E,CAAC;","names":["ControlTrigger"]}
@@ -1,5 +1,4 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { ControlValueProps } from '../../types/control-components.types.mjs';
4
3
  import 'react-native';
5
4
  import '@impulse-ui-native/icon/types';
@@ -7,6 +6,6 @@ import '@impulse-ui-native/theme';
7
6
  import '../../types/button.types.mjs';
8
7
  import '../../types/spinner.types.mjs';
9
8
 
10
- declare const ControlValue: react.MemoExoticComponent<(props: ControlValueProps) => react_jsx_runtime.JSX.Element>;
9
+ declare const ControlValue: react.MemoExoticComponent<(props: ControlValueProps) => react.JSX.Element>;
11
10
 
12
11
  export { ControlValue };
@@ -12,7 +12,6 @@ export { Tag } from './atoms/tag.mjs';
12
12
  export { Control } from './controls/control.mjs';
13
13
  export { useControlContext } from '../hooks/use-control-context.hook.mjs';
14
14
  import 'react';
15
- import 'react/jsx-runtime';
16
15
  import '../types/avatar.types.mjs';
17
16
  import 'react-native';
18
17
  import '@impulse-ui-native/theme';
@@ -1,7 +1,7 @@
1
- declare const ControlRootStyles: {
1
+ declare const ControlRootStyles: Readonly<{
2
2
  container: {
3
- width: "100%";
3
+ width: string;
4
4
  };
5
- };
5
+ }>;
6
6
 
7
7
  export { ControlRootStyles };
@@ -1,11 +1,10 @@
1
1
  import * as react from 'react';
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
2
  import { AppTheme, TypographyProps, TypographyPresetKey } from '@impulse-ui-native/theme';
4
3
  import { TextProps } from '../types/typography.types.mjs';
5
4
  import 'react-native';
6
5
 
7
6
  declare function createPreset(config: (theme: AppTheme) => TypographyProps & Pick<TextProps, "color">, key: TypographyPresetKey): react.MemoExoticComponent<{
8
- (props: TextProps): react_jsx_runtime.JSX.Element;
7
+ (props: TextProps): react.JSX.Element;
9
8
  displayName: string;
10
9
  }>;
11
10
 
@@ -1,6 +1,5 @@
1
1
  export { createPreset } from './create-preset.hoc.mjs';
2
2
  import 'react';
3
- import 'react/jsx-runtime';
4
3
  import '@impulse-ui-native/theme';
5
4
  import '../types/typography.types.mjs';
6
5
  import 'react-native';
package/dist/index.d.mts CHANGED
@@ -23,10 +23,9 @@ export { DividerInset, DividerOrientation, DividerProps } from './types/divider.
23
23
  export { IconButtonProps, IconButtonThemeProps } from './types/icon-button.types.mjs';
24
24
  export { SpinnerProps } from './types/spinner.types.mjs';
25
25
  export { TagProps, TagThemeProps } from './types/tag.types.mjs';
26
- export { ControlAddonProps, ControlComponentCommonProps, ControlComponentProps, ControlContainerProps, ControlContextData, ControlErrorLabelProps, ControlInputProps, ControlLabelProps, ControlLoaderProps, ControlPlaceholderProps, ControlValueProps } from './types/control-components.types.mjs';
26
+ export { ControlAddonProps, ControlComponentCommonProps, ControlComponentProps, ControlContainerProps, ControlContextData, ControlErrorLabelProps, ControlFieldProps, ControlIconProps, ControlInputProps, ControlLabelProps, ControlLoaderProps, ControlPlaceholderProps, ControlTriggerProps, ControlValueProps } from './types/control-components.types.mjs';
27
27
  import 'react';
28
- import 'react/jsx-runtime';
29
- import '@impulse-ui-native/theme';
30
28
  import 'react-native';
29
+ import '@impulse-ui-native/theme';
31
30
  import 'react-native-safe-area-context';
32
31
  import '@impulse-ui-native/icon/types';
@@ -1,4 +1,4 @@
1
- import { ComponentType } from 'react';
1
+ import { ComponentType, ReactNode } from 'react';
2
2
  import { ViewProps, TextProps, TextInputProps } from 'react-native';
3
3
  import { IconProps } from '@impulse-ui-native/icon/types';
4
4
  import { ComponentSize, FieldVariant } from '@impulse-ui-native/theme';
@@ -23,6 +23,17 @@ interface ControlComponentProps {
23
23
  }
24
24
  type ControlContextData = ControlComponentProps;
25
25
  type ControlContainerProps = ViewProps;
26
+ type ControlTriggerProps = PressableCoreProps;
27
+ type ControlIconProps = IconProps;
28
+ interface ControlFieldProps extends Partial<ControlComponentProps> {
29
+ children?: ReactNode;
30
+ label?: string;
31
+ onPress?: PressableCoreProps["onPress"];
32
+ prefix?: ReactNode;
33
+ suffix?: ReactNode;
34
+ onPressPrefix?: PressableCoreProps["onPress"];
35
+ onPressSuffix?: PressableCoreProps["onPress"];
36
+ }
26
37
  type ControlLabelProps = TextProps;
27
38
  type ControlErrorLabelProps = TextProps;
28
39
  interface ControlAddonProps extends ViewProps {
@@ -35,4 +46,4 @@ type ControlPlaceholderProps = TextProps;
35
46
  type ControlValueProps = TextProps;
36
47
  type ControlLoaderProps = SpinnerProps;
37
48
 
38
- export type { ControlAddonProps, ControlComponentCommonProps, ControlComponentProps, ControlContainerProps, ControlContextData, ControlErrorLabelProps, ControlInputProps, ControlLabelProps, ControlLoaderProps, ControlPlaceholderProps, ControlValueProps };
49
+ export type { ControlAddonProps, ControlComponentCommonProps, ControlComponentProps, ControlContainerProps, ControlContextData, ControlErrorLabelProps, ControlFieldProps, ControlIconProps, ControlInputProps, ControlLabelProps, ControlLoaderProps, ControlPlaceholderProps, ControlTriggerProps, ControlValueProps };