@react-xp/aeiou 1.0.0-beta.2 → 1.0.0-beta.4

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 (175) hide show
  1. package/dist/cjs/components/a/a.native.js +6 -3
  2. package/dist/cjs/components/a/a.web.js +2 -3
  3. package/dist/cjs/components/d/d.native.js +20 -5
  4. package/dist/cjs/components/d/d.web.js +21 -6
  5. package/dist/cjs/components/e/e.native.js +2 -3
  6. package/dist/cjs/components/e/e.web.js +4 -3
  7. package/dist/cjs/components/i/i.native.js +4 -3
  8. package/dist/cjs/components/i/i.web.js +8 -3
  9. package/dist/cjs/components/l/l.web.js +2 -3
  10. package/dist/cjs/components/o/o.native.js +4 -3
  11. package/dist/cjs/components/o/o.web.js +2 -3
  12. package/dist/cjs/components/p/p.native.js +4 -3
  13. package/dist/cjs/components/p/p.web.js +4 -3
  14. package/dist/cjs/components/s/s.native.js +2 -3
  15. package/dist/cjs/components/t/t.native.js +2 -3
  16. package/dist/cjs/components/t/t.web.js +2 -3
  17. package/dist/cjs/hooks/useStyles/useStyles.native.js +2 -0
  18. package/dist/esm/components/a/a.native.js +6 -2
  19. package/dist/esm/components/a/a.web.js +2 -2
  20. package/dist/esm/components/d/d.native.js +20 -4
  21. package/dist/esm/components/d/d.web.js +21 -5
  22. package/dist/esm/components/e/e.native.js +2 -2
  23. package/dist/esm/components/e/e.web.js +4 -2
  24. package/dist/esm/components/i/i.native.js +4 -2
  25. package/dist/esm/components/i/i.web.js +8 -2
  26. package/dist/esm/components/l/l.web.js +2 -2
  27. package/dist/esm/components/o/o.native.js +4 -2
  28. package/dist/esm/components/o/o.web.js +2 -2
  29. package/dist/esm/components/p/p.native.js +4 -2
  30. package/dist/esm/components/p/p.web.js +4 -2
  31. package/dist/esm/components/s/s.native.js +2 -2
  32. package/dist/esm/components/t/t.native.js +2 -2
  33. package/dist/esm/components/t/t.web.js +2 -2
  34. package/dist/esm/hooks/useStyles/useStyles.native.js +2 -0
  35. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  36. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  37. package/dist/types/components/d/d.native.d.ts.map +1 -1
  38. package/dist/types/hooks/useStyles/useStyles.native.d.ts.map +1 -1
  39. package/package.json +5 -5
  40. package/dist/native/cjs/components/a/a.native.js +0 -17
  41. package/dist/native/cjs/components/a/a.web.js +0 -15
  42. package/dist/native/cjs/components/a/index.native.js +0 -17
  43. package/dist/native/cjs/components/a/index.web.js +0 -17
  44. package/dist/native/cjs/components/d/d.native.js +0 -28
  45. package/dist/native/cjs/components/d/d.web.js +0 -38
  46. package/dist/native/cjs/components/d/index.native.js +0 -17
  47. package/dist/native/cjs/components/d/index.web.js +0 -17
  48. package/dist/native/cjs/components/e/e.native.js +0 -16
  49. package/dist/native/cjs/components/e/e.web.js +0 -15
  50. package/dist/native/cjs/components/e/index.native.js +0 -17
  51. package/dist/native/cjs/components/e/index.web.js +0 -17
  52. package/dist/native/cjs/components/i/i.native.js +0 -28
  53. package/dist/native/cjs/components/i/i.web.js +0 -27
  54. package/dist/native/cjs/components/i/index.native.js +0 -17
  55. package/dist/native/cjs/components/i/index.web.js +0 -17
  56. package/dist/native/cjs/components/i/useIUtils.js +0 -71
  57. package/dist/native/cjs/components/index.js +0 -26
  58. package/dist/native/cjs/components/index.native.js +0 -26
  59. package/dist/native/cjs/components/index.web.js +0 -26
  60. package/dist/native/cjs/components/l/index.native.js +0 -17
  61. package/dist/native/cjs/components/l/index.web.js +0 -17
  62. package/dist/native/cjs/components/l/l.native.js +0 -10
  63. package/dist/native/cjs/components/l/l.web.js +0 -15
  64. package/dist/native/cjs/components/o/index.native.js +0 -17
  65. package/dist/native/cjs/components/o/index.web.js +0 -17
  66. package/dist/native/cjs/components/o/o.native.js +0 -12
  67. package/dist/native/cjs/components/o/o.web.js +0 -15
  68. package/dist/native/cjs/components/p/index.native.js +0 -17
  69. package/dist/native/cjs/components/p/index.web.js +0 -17
  70. package/dist/native/cjs/components/p/p.native.js +0 -13
  71. package/dist/native/cjs/components/p/p.web.js +0 -16
  72. package/dist/native/cjs/components/s/index.native.js +0 -17
  73. package/dist/native/cjs/components/s/index.web.js +0 -17
  74. package/dist/native/cjs/components/s/s.native.js +0 -10
  75. package/dist/native/cjs/components/s/s.web.js +0 -10
  76. package/dist/native/cjs/components/t/index.native.js +0 -17
  77. package/dist/native/cjs/components/t/index.web.js +0 -17
  78. package/dist/native/cjs/components/t/t.native.js +0 -15
  79. package/dist/native/cjs/components/t/t.web.js +0 -15
  80. package/dist/native/cjs/components/u/context.js +0 -14
  81. package/dist/native/cjs/components/u/errorBoundary.js +0 -27
  82. package/dist/native/cjs/components/u/index.native.js +0 -19
  83. package/dist/native/cjs/components/u/index.web.js +0 -19
  84. package/dist/native/cjs/components/u/provider.native.js +0 -24
  85. package/dist/native/cjs/components/u/provider.web.js +0 -21
  86. package/dist/native/cjs/components/u/types.js +0 -2
  87. package/dist/native/cjs/components/u/useUniverse.js +0 -8
  88. package/dist/native/cjs/hooks/index.js +0 -19
  89. package/dist/native/cjs/hooks/index.native.js +0 -22
  90. package/dist/native/cjs/hooks/index.web.js +0 -22
  91. package/dist/native/cjs/hooks/useCn.js +0 -15
  92. package/dist/native/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +0 -43
  93. package/dist/native/cjs/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +0 -45
  94. package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.native.js +0 -69
  95. package/dist/native/cjs/hooks/useInteractiveState/useInteractiveState.web.js +0 -74
  96. package/dist/native/cjs/hooks/useOnChange.js +0 -18
  97. package/dist/native/cjs/hooks/useProps.js +0 -66
  98. package/dist/native/cjs/hooks/useStyles/useStyles.helpers.js +0 -35
  99. package/dist/native/cjs/hooks/useStyles/useStyles.native.js +0 -44
  100. package/dist/native/cjs/hooks/useStyles/useStyles.types.js +0 -2
  101. package/dist/native/cjs/hooks/useStyles/useStyles.web.js +0 -71
  102. package/dist/native/cjs/index.js +0 -19
  103. package/dist/native/cjs/index.native.js +0 -19
  104. package/dist/native/cjs/index.web.js +0 -19
  105. package/dist/native/cjs/types/base.js +0 -2
  106. package/dist/native/cjs/types/index.js +0 -17
  107. package/dist/native/esm/components/a/a.native.js +0 -13
  108. package/dist/native/esm/components/a/a.web.js +0 -11
  109. package/dist/native/esm/components/a/index.native.js +0 -1
  110. package/dist/native/esm/components/a/index.web.js +0 -1
  111. package/dist/native/esm/components/d/d.native.js +0 -24
  112. package/dist/native/esm/components/d/d.web.js +0 -34
  113. package/dist/native/esm/components/d/index.native.js +0 -1
  114. package/dist/native/esm/components/d/index.web.js +0 -1
  115. package/dist/native/esm/components/e/e.native.js +0 -12
  116. package/dist/native/esm/components/e/e.web.js +0 -11
  117. package/dist/native/esm/components/e/index.native.js +0 -1
  118. package/dist/native/esm/components/e/index.web.js +0 -1
  119. package/dist/native/esm/components/i/i.native.js +0 -24
  120. package/dist/native/esm/components/i/i.web.js +0 -23
  121. package/dist/native/esm/components/i/index.native.js +0 -1
  122. package/dist/native/esm/components/i/index.web.js +0 -1
  123. package/dist/native/esm/components/i/useIUtils.js +0 -67
  124. package/dist/native/esm/components/index.js +0 -10
  125. package/dist/native/esm/components/index.native.js +0 -10
  126. package/dist/native/esm/components/index.web.js +0 -10
  127. package/dist/native/esm/components/l/index.native.js +0 -1
  128. package/dist/native/esm/components/l/index.web.js +0 -1
  129. package/dist/native/esm/components/l/l.native.js +0 -6
  130. package/dist/native/esm/components/l/l.web.js +0 -11
  131. package/dist/native/esm/components/o/index.native.js +0 -1
  132. package/dist/native/esm/components/o/index.web.js +0 -1
  133. package/dist/native/esm/components/o/o.native.js +0 -8
  134. package/dist/native/esm/components/o/o.web.js +0 -11
  135. package/dist/native/esm/components/p/index.native.js +0 -1
  136. package/dist/native/esm/components/p/index.web.js +0 -1
  137. package/dist/native/esm/components/p/p.native.js +0 -9
  138. package/dist/native/esm/components/p/p.web.js +0 -12
  139. package/dist/native/esm/components/s/index.native.js +0 -1
  140. package/dist/native/esm/components/s/index.web.js +0 -1
  141. package/dist/native/esm/components/s/s.native.js +0 -7
  142. package/dist/native/esm/components/s/s.web.js +0 -6
  143. package/dist/native/esm/components/t/index.native.js +0 -1
  144. package/dist/native/esm/components/t/index.web.js +0 -1
  145. package/dist/native/esm/components/t/t.native.js +0 -11
  146. package/dist/native/esm/components/t/t.web.js +0 -11
  147. package/dist/native/esm/components/u/context.js +0 -11
  148. package/dist/native/esm/components/u/errorBoundary.js +0 -23
  149. package/dist/native/esm/components/u/index.native.js +0 -3
  150. package/dist/native/esm/components/u/index.web.js +0 -3
  151. package/dist/native/esm/components/u/provider.native.js +0 -20
  152. package/dist/native/esm/components/u/provider.web.js +0 -17
  153. package/dist/native/esm/components/u/types.js +0 -1
  154. package/dist/native/esm/components/u/useUniverse.js +0 -5
  155. package/dist/native/esm/hooks/index.js +0 -3
  156. package/dist/native/esm/hooks/index.native.js +0 -6
  157. package/dist/native/esm/hooks/index.web.js +0 -6
  158. package/dist/native/esm/hooks/useCn.js +0 -8
  159. package/dist/native/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.native.js +0 -40
  160. package/dist/native/esm/hooks/useInteractiveHandlers/useInteractiveHandlers.web.js +0 -42
  161. package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.native.js +0 -66
  162. package/dist/native/esm/hooks/useInteractiveState/useInteractiveState.web.js +0 -71
  163. package/dist/native/esm/hooks/useOnChange.js +0 -14
  164. package/dist/native/esm/hooks/useProps.js +0 -59
  165. package/dist/native/esm/hooks/useStyles/useStyles.helpers.js +0 -29
  166. package/dist/native/esm/hooks/useStyles/useStyles.native.js +0 -40
  167. package/dist/native/esm/hooks/useStyles/useStyles.types.js +0 -1
  168. package/dist/native/esm/hooks/useStyles/useStyles.web.js +0 -66
  169. package/dist/native/esm/index.js +0 -3
  170. package/dist/native/esm/index.native.js +0 -3
  171. package/dist/native/esm/index.web.js +0 -3
  172. package/dist/native/esm/types/base.js +0 -1
  173. package/dist/native/esm/types/index.js +0 -1
  174. package/dist/native/tsconfig.native.cjs.tsbuildinfo +0 -1
  175. package/dist/native/tsconfig.native.esm.tsbuildinfo +0 -1
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useStyles = void 0;
4
- const useStyles_helpers_1 = require("./useStyles.helpers");
5
- const getStyles = ({ disabled, style, }) => {
6
- if (!style) {
7
- return {};
8
- }
9
- const { styleBase, styleDisabled, styleFocused, styleHovered, stylePressed } = (0, useStyles_helpers_1.extractStyles)(style);
10
- const composedStyle = { ...styleBase };
11
- if (disabled) {
12
- Object.assign(composedStyle, styleDisabled || {});
13
- }
14
- return { style: composedStyle };
15
- };
16
- const getStylesWithInteraction = ({ disabled, style, }) => ({
17
- style: (options) => {
18
- if (!style) {
19
- return {};
20
- }
21
- const { styleBase, styleDisabled, styleFocused, styleHovered, stylePressed, } = (0, useStyles_helpers_1.extractStyles)(style);
22
- const composedStyle = { ...styleBase };
23
- if (disabled) {
24
- Object.assign(composedStyle, styleDisabled || {});
25
- }
26
- if (options?.focused) {
27
- Object.assign(composedStyle, styleFocused || {});
28
- }
29
- if (options?.hovered) {
30
- Object.assign(composedStyle, styleHovered || {});
31
- }
32
- if (options?.pressed) {
33
- Object.assign(composedStyle, stylePressed || {});
34
- }
35
- return composedStyle;
36
- },
37
- });
38
- const useStyles = () => {
39
- return {
40
- getStyles,
41
- getStylesWithInteraction,
42
- };
43
- };
44
- exports.useStyles = useStyles;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useStyles = exports.createInteractiveClass = void 0;
4
- const react_1 = require("react");
5
- const useStyles_helpers_1 = require("./useStyles.helpers");
6
- const injected = new Set();
7
- const injectOnce = (id, cssText) => {
8
- if (typeof document === 'undefined')
9
- return;
10
- if (injected.has(id))
11
- return;
12
- const style = document.createElement('style');
13
- style.setAttribute('data-interactive', id);
14
- style.textContent = cssText;
15
- document.head.appendChild(style);
16
- injected.add(id);
17
- };
18
- const createInteractiveClass = ({ disabled, id, style, }) => {
19
- const className = `ix-${id}`;
20
- const { styleBase, styleDisabled, styleFocused, styleHovered, stylePressed } = (0, useStyles_helpers_1.extractStyles)(style);
21
- const hoveredClass = styleHovered
22
- ? `.${className}:hover{${(0, useStyles_helpers_1.toCssDecls)(styleHovered)}}`
23
- : '';
24
- const activeClass = stylePressed
25
- ? `.${className}:active{${(0, useStyles_helpers_1.toCssDecls)(stylePressed)}}`
26
- : '';
27
- // focus-visible com fallback para browsers sem suporte
28
- const focusVisibleClass = styleFocused
29
- ? `
30
- .${className}:focus-visible{${(0, useStyles_helpers_1.toCssDecls)(styleFocused)}}
31
- @supports not selector(:focus-visible){
32
- .${className}:focus{${(0, useStyles_helpers_1.toCssDecls)(styleFocused)}}
33
- }
34
- `
35
- : '';
36
- const disabledClass = disabled
37
- ? `
38
- .${className}[data-disabled="true"]{${(0, useStyles_helpers_1.toCssDecls)(styleDisabled)}}
39
- .${className}[data-disabled="true"]:hover{${(0, useStyles_helpers_1.toCssDecls)(styleDisabled)}}
40
- .${className}[data-disabled="true"]:active{${(0, useStyles_helpers_1.toCssDecls)(styleDisabled)}}
41
- `
42
- : '';
43
- const baseClass = `.${className}{${(0, useStyles_helpers_1.toCssDecls)(styleBase)}}`;
44
- injectOnce(id, `${baseClass}${hoveredClass}${activeClass}${focusVisibleClass}${disabledClass}`);
45
- return className;
46
- };
47
- exports.createInteractiveClass = createInteractiveClass;
48
- const getStyles = ({ id }) => ({ disabled, style }) => {
49
- if (!style) {
50
- return {};
51
- }
52
- const className = (0, exports.createInteractiveClass)({ disabled, id, style });
53
- return {
54
- className,
55
- ...(disabled ? { 'aria-disabled': 'true', 'data-disabled': 'true' } : {}),
56
- };
57
- };
58
- const useStyles = () => {
59
- const id = (0, react_1.useId)();
60
- // TODO: cleanup on unmount
61
- // useEffect(() => {
62
- // return () => {
63
- // document.querySelector(`style[data-interactive="${id}"]`)?.remove();
64
- // injected.delete(id);
65
- // };
66
- // }, [id]);
67
- return {
68
- getStyles: getStyles({ id }),
69
- };
70
- };
71
- exports.useStyles = useStyles;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./components/index.web"), exports);
18
- __exportStar(require("./hooks/index.web"), exports);
19
- __exportStar(require("./types"), exports);
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./components/index.native"), exports);
18
- __exportStar(require("./hooks/index.native"), exports);
19
- __exportStar(require("./types"), exports);
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./components/index.web"), exports);
18
- __exportStar(require("./hooks/index.web"), exports);
19
- __exportStar(require("./types"), exports);
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./base"), exports);
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { Pressable } from 'react-native';
3
- import { useInteractiveHandlers, useStyles } from '../../hooks/index.native';
4
- import { useCn } from '../../hooks/useCn';
5
- import { E } from '../e/index.native';
6
- export function A({ accessibilityLabel, accessibilityRole, accessibilityState, className, children, loading, ref, style, testId, ...restProps }) {
7
- const cn = useCn();
8
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
9
- const { getStylesWithInteraction } = useStyles();
10
- const isDisabled = Boolean(disabled || loading);
11
- return (_jsx(Pressable, { ref: ref, disabled: isDisabled, accessibilityLabel: accessibilityLabel, accessibilityRole: accessibilityRole, accessibilityState: accessibilityState, testID: testId, ...eventHandlers, ...getStylesWithInteraction({ disabled, style }), children: _jsx(E, { className: cn(disabled && 'opacity-60', className), style: style, ...restProps, children: children }) }));
12
- }
13
- export const Action = A;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { useInteractiveHandlers, useStyles } from '../../hooks/index.web';
3
- import { useCn } from '../../hooks/useCn';
4
- export function A({ className, children, loading, ref, testId, accessibilityLabel, accessibilityRole, accessibilityState, style, ...restProps }) {
5
- const cn = useCn();
6
- const { getStyles } = useStyles();
7
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
8
- const isDisabled = Boolean(disabled || loading);
9
- return (_jsx("button", { ref: ref, type: "button", className: cn('cursor-pointer', disabled && 'opacity-60', className), "aria-disabled": isDisabled || undefined, "aria-busy": loading || undefined, "aria-label": accessibilityLabel, "data-testid": testId, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
10
- }
11
- export const Action = A;
@@ -1 +0,0 @@
1
- export * from './a.native';
@@ -1 +0,0 @@
1
- export * from './a.web';
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { Modal } from 'react-native';
3
- import { useCn } from '../../hooks/useCn';
4
- import { E } from '../e/index.native';
5
- export function D({ open, onOpenChange, placement = 'center', backdropClassName, backdropStyle, containerClassName, containerStyle, contentClassName, contentStyle, children, ref, ...restProps }) {
6
- const cn = useCn();
7
- const placementClasses = {
8
- center: 'items-center justify-center',
9
- top: 'items-start justify-center',
10
- bottom: 'items-end justify-center',
11
- left: 'items-stretch justify-start',
12
- right: 'items-stretch justify-end',
13
- };
14
- const containerClasses = cn('flex-1 bg-black/40 flex', placementClasses[placement], containerClassName, backdropClassName);
15
- const contentClasses = cn('bg-background p-4 rounded-lg shadow-lg max-h-[90vh] w-full max-w-lg', placement === 'left' || placement === 'right' ? 'h-full max-h-none' : '', placement === 'bottom' || placement === 'top' ? 'max-w-none' : '', contentClassName);
16
- const handleRequestClose = (e) => {
17
- onOpenChange?.(false);
18
- if (typeof restProps.onRequestClose === 'function') {
19
- restProps.onRequestClose?.(e);
20
- }
21
- };
22
- return (_jsx(Modal, { visible: open, animationType: "slide", transparent: true, onRequestClose: handleRequestClose, ...restProps, children: _jsx(E, { className: containerClasses, style: { ...containerStyle, ...backdropStyle }, children: _jsx(E, { ref: ref, className: contentClasses, style: contentStyle, children: children }) }) }));
23
- }
24
- export const Dialog = D;
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { createPortal } from 'react-dom';
3
- import { useCn } from '../../hooks/useCn';
4
- import { E } from '../e/index.web';
5
- export function D({ open, onOpenChange, placement = 'center', backdropClassName, backdropStyle, containerClassName, containerStyle, contentClassName, contentStyle, closeOnBackdropClick = true, children, ref, ...restProps }) {
6
- const cn = useCn();
7
- if (typeof document === 'undefined')
8
- return null;
9
- if (!open)
10
- return null;
11
- const placementClasses = {
12
- center: 'items-center justify-center',
13
- top: 'items-start justify-center',
14
- bottom: 'items-end justify-center',
15
- left: 'items-stretch justify-start',
16
- right: 'items-stretch justify-end',
17
- };
18
- const handleBackdropClick = (event) => {
19
- if (event.target !== event.currentTarget)
20
- return;
21
- if (closeOnBackdropClick) {
22
- onOpenChange?.(false);
23
- }
24
- };
25
- const backdropClasses = cn('fixed inset-0 z-50 flex bg-black/40', placementClasses[placement], containerClassName, backdropClassName);
26
- const contentClasses = cn('relative max-h-[90vh] w-full max-w-lg overflow-auto rounded-lg bg-background p-4 shadow-lg', placement === 'left' || placement === 'right' ? 'h-full max-h-none' : '', placement === 'bottom' || placement === 'top' ? 'max-w-none' : '', contentClassName);
27
- return createPortal(_jsx(E, { className: backdropClasses, role: "presentation", onClick: handleBackdropClick, style: {
28
- ...(containerStyle || {}),
29
- ...(backdropStyle || {}),
30
- }, children: _jsx("div", { ref: ref,
31
- // biome-ignore lint/a11y/useSemanticElements: <explanation>
32
- role: "dialog", "aria-modal": "true", className: contentClasses, style: contentStyle, ...restProps, children: children }) }), document.body);
33
- }
34
- export const Dialog = D;
@@ -1 +0,0 @@
1
- export * from './d.native';
@@ -1 +0,0 @@
1
- export * from './d.web';
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { View } from 'react-native';
3
- import { useCn } from '../../hooks/useCn';
4
- import { useInteractiveHandlers, useStyles } from '../../index.native';
5
- import { T } from '../t/index.native';
6
- export function E({ className, children, ref, style, ...restProps }) {
7
- const cn = useCn();
8
- const { getStyles } = useStyles();
9
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
10
- return (_jsx(View, { ref: ref, className: cn(className), ...eventHandlers, ...getStyles({ disabled, style }), children: typeof children === 'string' ? _jsx(T, { children: children }) : children }));
11
- }
12
- export const Element = E;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { useCn } from '../../hooks/useCn';
3
- import { useInteractiveHandlers, useStyles } from '../../index.web';
4
- export function E({ as = 'div', className, children, ref, role, style, ...restProps }) {
5
- const cn = useCn();
6
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
7
- const { getStyles } = useStyles();
8
- const Comp = as;
9
- return (_jsx(Comp, { ref: ref, className: cn(className), role: role, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
10
- }
11
- export const Element = E;
@@ -1 +0,0 @@
1
- export * from './e.native';
@@ -1 +0,0 @@
1
- export * from './e.web';
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { TextInput } from 'react-native';
3
- import { useCn } from '../../hooks/useCn';
4
- import { useOnChange } from '../../hooks/useOnChange';
5
- import { useInteractiveHandlers, useStyles } from '../../index.native';
6
- import { useIUtils } from './useIUtils';
7
- export function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, ref, name, style, ...restProps }) {
8
- const { treatTypeModeAndKeyboardType } = useIUtils();
9
- const cn = useCn();
10
- const { onChange: handleOnChange } = useOnChange({
11
- onChange,
12
- onChangeValue,
13
- });
14
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
15
- const { getStyles } = useStyles();
16
- const effectiveEditable = editable ?? !disabled;
17
- const { masterInputType, masterInputKeyboardType } = treatTypeModeAndKeyboardType({
18
- inputMode,
19
- keyboardType,
20
- type,
21
- });
22
- return (_jsx(TextInput, { ref: ref, className: cn(!effectiveEditable && 'opacity-60', className), value: value?.toString(), defaultValue: defaultValue?.toString(), placeholder: placeholder, onChange: handleOnChange, secureTextEntry: masterInputType === 'password', keyboardType: masterInputKeyboardType, editable: effectiveEditable, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
23
- }
24
- export const Input = I;
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { useCn } from '../../hooks/useCn';
3
- import { useOnChange } from '../../hooks/useOnChange';
4
- import { useInteractiveHandlers, useStyles } from '../../index.web';
5
- import { useIUtils } from './useIUtils';
6
- export function I({ className, value, defaultValue, placeholder, onChange, onChangeValue, type, inputMode, keyboardType, editable, ref, style, ...restProps }) {
7
- const { treatTypeModeAndKeyboardType } = useIUtils();
8
- const cn = useCn();
9
- const { onChange: handleOnChange } = useOnChange({
10
- onChange,
11
- onChangeValue,
12
- });
13
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
14
- const { getStyles } = useStyles();
15
- const effectiveDisabled = disabled || editable === false;
16
- const { masterInputType, masterInputMode } = treatTypeModeAndKeyboardType({
17
- inputMode,
18
- keyboardType,
19
- type,
20
- });
21
- return (_jsx("input", { ref: ref, type: masterInputType, inputMode: masterInputMode, className: cn('outline-none', effectiveDisabled && 'opacity-60 cursor-not-allowed', className), value: value?.toString(), defaultValue: defaultValue?.toString(), placeholder: placeholder, onChange: handleOnChange, disabled: effectiveDisabled, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
22
- }
23
- export const Input = I;
@@ -1 +0,0 @@
1
- export * from './i.native';
@@ -1 +0,0 @@
1
- export * from './i.web';
@@ -1,67 +0,0 @@
1
- const setWhenUndefined = (value, defaultValue) => {
2
- return value === undefined ? defaultValue : value;
3
- };
4
- const treatTypeModeAndKeyboardType = ({ inputMode, keyboardType, type, }) => {
5
- let masterInputKeyboardType = keyboardType;
6
- let masterInputMode = inputMode;
7
- let masterInputType = type;
8
- // set values according to inputMode first
9
- if (masterInputMode === 'numeric' || masterInputMode === 'decimal') {
10
- masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'numeric');
11
- masterInputType = setWhenUndefined(masterInputType, 'number');
12
- }
13
- else if (masterInputMode === 'email') {
14
- masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'email-address');
15
- masterInputType = setWhenUndefined(masterInputType, 'email');
16
- }
17
- else if (masterInputMode === 'search') {
18
- masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'default');
19
- masterInputType = setWhenUndefined(masterInputType, 'search');
20
- }
21
- else if (masterInputMode === 'tel') {
22
- masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'phone-pad');
23
- masterInputType = setWhenUndefined(masterInputType, 'tel');
24
- }
25
- else if (masterInputMode === 'url') {
26
- masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'url');
27
- masterInputType = setWhenUndefined(masterInputType, 'url');
28
- }
29
- else if (masterInputType === 'text') {
30
- masterInputKeyboardType = setWhenUndefined(masterInputKeyboardType, 'default');
31
- masterInputType = setWhenUndefined(masterInputType, 'text');
32
- }
33
- // set values according to keyboardType second
34
- if (masterInputKeyboardType === 'email-address') {
35
- masterInputMode = setWhenUndefined(masterInputMode, 'email');
36
- masterInputType = setWhenUndefined(masterInputType, 'email');
37
- }
38
- else if (masterInputKeyboardType === 'numeric' ||
39
- masterInputKeyboardType === 'decimal-pad') {
40
- masterInputMode = setWhenUndefined(masterInputMode, 'numeric');
41
- masterInputType = setWhenUndefined(masterInputType, 'number');
42
- }
43
- else if (masterInputKeyboardType === 'phone-pad') {
44
- masterInputMode = setWhenUndefined(masterInputMode, 'tel');
45
- masterInputType = setWhenUndefined(masterInputType, 'tel');
46
- }
47
- else if (masterInputKeyboardType === 'url') {
48
- masterInputMode = setWhenUndefined(masterInputMode, 'url');
49
- masterInputType = setWhenUndefined(masterInputType, 'url');
50
- }
51
- else if (masterInputKeyboardType === 'default') {
52
- masterInputMode = setWhenUndefined(masterInputMode, 'text');
53
- masterInputType = setWhenUndefined(masterInputType, 'text');
54
- }
55
- // finally, set default type if still undefined
56
- masterInputType = setWhenUndefined(masterInputType, 'text');
57
- return {
58
- masterInputKeyboardType,
59
- masterInputMode,
60
- masterInputType,
61
- };
62
- };
63
- export const useIUtils = () => {
64
- return {
65
- treatTypeModeAndKeyboardType,
66
- };
67
- };
@@ -1,10 +0,0 @@
1
- export * from './a/index.web';
2
- export * from './d/index.web';
3
- export * from './e/index.web';
4
- export * from './i/index.web';
5
- export * from './l/index.web';
6
- export * from './o/index.web';
7
- export * from './p/index.web';
8
- export * from './s/index.web';
9
- export * from './t/index.web';
10
- export * from './u/index.web';
@@ -1,10 +0,0 @@
1
- export * from './a/index.native';
2
- export * from './d/index.native';
3
- export * from './e/index.native';
4
- export * from './i/index.native';
5
- export * from './l/index.native';
6
- export * from './o/index.native';
7
- export * from './p/index.native';
8
- export * from './s/index.native';
9
- export * from './t/index.native';
10
- export * from './u/index.native';
@@ -1,10 +0,0 @@
1
- export * from './a/index.web';
2
- export * from './d/index.web';
3
- export * from './e/index.web';
4
- export * from './i/index.web';
5
- export * from './l/index.web';
6
- export * from './o/index.web';
7
- export * from './p/index.web';
8
- export * from './s/index.web';
9
- export * from './t/index.web';
10
- export * from './u/index.web';
@@ -1 +0,0 @@
1
- export * from './l.native';
@@ -1 +0,0 @@
1
- export * from './l.web';
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { A } from '../a/index.native';
3
- export function L(props) {
4
- return _jsx(A, { ...props });
5
- }
6
- export const Link = L;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { useCn } from '../../hooks/useCn';
3
- import { useInteractiveHandlers, useStyles } from '../../index.web';
4
- export function L({ className, children, to, href, preventDefault, ref, style, ...restProps }) {
5
- const cn = useCn();
6
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
7
- const { getStyles } = useStyles();
8
- const resolvedHref = href ?? to ?? '#';
9
- return (_jsx("a", { ref: ref, href: resolvedHref, className: cn('cursor-pointer', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
10
- }
11
- export const Link = L;
@@ -1 +0,0 @@
1
- export * from './o.native';
@@ -1 +0,0 @@
1
- export * from './o.web';
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { ScrollView } from 'react-native';
3
- import { useCn } from '../../hooks/useCn';
4
- export function O({ className, children, horizontal, ref, ...restProps }) {
5
- const cn = useCn();
6
- return (_jsx(ScrollView, { ref: ref, className: cn(className), horizontal: horizontal, ...restProps, children: children }));
7
- }
8
- export const Overflow = O;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { useCn } from '../../hooks/useCn';
3
- import { useInteractiveHandlers, useStyles } from '../../index.web';
4
- export function O({ className, children, horizontal, ref, style, ...restProps }) {
5
- const cn = useCn();
6
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
7
- const { getStyles } = useStyles();
8
- const overflowClass = horizontal ? 'overflow-x-auto' : 'overflow-y-auto';
9
- return (_jsx("div", { ref: ref, className: cn(overflowClass, className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
10
- }
11
- export const Overflow = O;
@@ -1 +0,0 @@
1
- export * from './p.native';
@@ -1 +0,0 @@
1
- export * from './p.web';
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { Image } from 'react-native';
3
- import { useCn } from '../../hooks/useCn';
4
- export function P({ className, src, source, ref, ...restProps }) {
5
- const cn = useCn();
6
- const finalSource = src != null ? { uri: src } : source;
7
- return (_jsx(Image, { ref: ref, className: cn(className), source: finalSource, ...restProps }));
8
- }
9
- export const Picture = P;
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { useCn } from '../../hooks/useCn';
3
- import { useInteractiveHandlers, useStyles } from '../../index.web';
4
- export function P({ alt, className, ref, style, source, src, ...restProps }) {
5
- const cn = useCn();
6
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
7
- const { getStyles } = useStyles();
8
- return (
9
- // biome-ignore lint/a11y/useAltText: <explanation>
10
- _jsx("img", { alt: alt, "aria-label": alt, ref: ref, className: cn('object-cover', className), src: src ?? source, ...restProps, ...eventHandlers, ...getStyles({ disabled, style }) }));
11
- }
12
- export const Picture = P;
@@ -1 +0,0 @@
1
- export * from './s.native';
@@ -1 +0,0 @@
1
- export * from './s.web';
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { SafeAreaView, } from 'react-native-safe-area-context';
3
- import { useCn } from '../../hooks/useCn';
4
- export function S({ className, children, ref, ...restProps }) {
5
- const cn = useCn();
6
- return (_jsx(SafeAreaView, { ref: ref, className: cn(className), ...restProps, children: children }));
7
- }
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { E } from '../e/index.web';
3
- export function S(props) {
4
- return _jsx(E, { ...props });
5
- }
6
- export const Safe = S;
@@ -1 +0,0 @@
1
- export * from './t.native';
@@ -1 +0,0 @@
1
- export * from './t.web';
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { Text as RNText } from 'react-native';
3
- import { useCn } from '../../hooks/useCn';
4
- import { useInteractiveHandlers, useStyles } from '../../index.native';
5
- export function T({ className, children, ref, style, ...restProps }) {
6
- const cn = useCn();
7
- const { disabled, eventHandlers } = useInteractiveHandlers(restProps);
8
- const { getStyles } = useStyles();
9
- return (_jsx(RNText, { ref: ref, className: cn('leading-relaxed', className), ...restProps, ...eventHandlers, ...getStyles({ disabled, style }), children: children }));
10
- }
11
- export const Text = T;