@ankhorage/surface 6.0.0 → 7.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 (148) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/{components/field → features/form/field/adapters/inbound}/Field.d.ts +2 -2
  4. package/dist/features/form/field/adapters/inbound/Field.d.ts.map +1 -0
  5. package/dist/features/form/field/adapters/inbound/Field.js +40 -0
  6. package/dist/features/form/field/adapters/inbound/Field.js.map +1 -0
  7. package/dist/features/form/field/public.d.ts +3 -0
  8. package/dist/features/form/field/public.d.ts.map +1 -0
  9. package/dist/features/form/field/public.js +2 -0
  10. package/dist/features/form/field/public.js.map +1 -0
  11. package/dist/{components/switch → features/form/switch/adapters/inbound}/Switch.d.ts +1 -1
  12. package/dist/features/form/switch/adapters/inbound/Switch.d.ts.map +1 -0
  13. package/dist/features/form/switch/adapters/inbound/Switch.js +52 -0
  14. package/dist/features/form/switch/adapters/inbound/Switch.js.map +1 -0
  15. package/dist/features/form/switch/public.d.ts +3 -0
  16. package/dist/features/form/switch/public.d.ts.map +1 -0
  17. package/dist/features/form/switch/public.js +2 -0
  18. package/dist/features/form/switch/public.js.map +1 -0
  19. package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -1
  20. package/dist/features/form/text-input/adapters/inbound/TextInput.js +8 -4
  21. package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -1
  22. package/dist/features/list/adapters/inbound/List.d.ts +5 -0
  23. package/dist/features/list/adapters/inbound/List.d.ts.map +1 -0
  24. package/dist/features/list/adapters/inbound/List.js +7 -0
  25. package/dist/features/list/adapters/inbound/List.js.map +1 -0
  26. package/dist/features/list/adapters/inbound/ListItem.d.ts +5 -0
  27. package/dist/features/list/adapters/inbound/ListItem.d.ts.map +1 -0
  28. package/dist/features/list/adapters/inbound/ListItem.js +59 -0
  29. package/dist/features/list/adapters/inbound/ListItem.js.map +1 -0
  30. package/dist/features/list/public.d.ts +4 -0
  31. package/dist/features/list/public.d.ts.map +1 -0
  32. package/dist/features/list/public.js +3 -0
  33. package/dist/features/list/public.js.map +1 -0
  34. package/dist/index.d.ts +6 -12
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +3 -6
  37. package/dist/index.js.map +1 -1
  38. package/dist/{components/field/types.d.ts → types/field.d.ts} +1 -1
  39. package/dist/types/field.d.ts.map +1 -0
  40. package/dist/types/field.js +2 -0
  41. package/dist/types/field.js.map +1 -0
  42. package/dist/types/list.d.ts +20 -0
  43. package/dist/types/list.d.ts.map +1 -0
  44. package/dist/types/list.js +2 -0
  45. package/dist/types/list.js.map +1 -0
  46. package/dist/{components/switch/types.d.ts → types/switch.d.ts} +4 -4
  47. package/dist/types/switch.d.ts.map +1 -0
  48. package/dist/types/switch.js +2 -0
  49. package/dist/types/switch.js.map +1 -0
  50. package/package.json +1 -1
  51. package/src/features/form/field/adapters/inbound/Field.tsx +82 -0
  52. package/src/features/form/field/public.ts +2 -0
  53. package/src/features/form/switch/adapters/inbound/Switch.tsx +123 -0
  54. package/src/features/form/switch/public.ts +2 -0
  55. package/src/features/form/text-input/adapters/inbound/TextInput.tsx +21 -5
  56. package/src/features/list/adapters/inbound/List.tsx +9 -0
  57. package/src/features/list/adapters/inbound/ListItem.tsx +128 -0
  58. package/src/features/list/public.test.ts +13 -0
  59. package/src/features/list/public.ts +3 -0
  60. package/src/index.test.ts +15 -11
  61. package/src/index.ts +6 -12
  62. package/src/types/list.ts +22 -0
  63. package/src/{components/switch/types.ts → types/switch.ts} +3 -3
  64. package/dist/components/field/Field.d.ts.map +0 -1
  65. package/dist/components/field/Field.js +0 -27
  66. package/dist/components/field/Field.js.map +0 -1
  67. package/dist/components/field/index.d.ts +0 -3
  68. package/dist/components/field/index.d.ts.map +0 -1
  69. package/dist/components/field/index.js +0 -2
  70. package/dist/components/field/index.js.map +0 -1
  71. package/dist/components/field/types.d.ts.map +0 -1
  72. package/dist/components/field/types.js +0 -2
  73. package/dist/components/field/types.js.map +0 -1
  74. package/dist/components/helper-text/HelperText.d.ts +0 -4
  75. package/dist/components/helper-text/HelperText.d.ts.map +0 -1
  76. package/dist/components/helper-text/HelperText.js +0 -8
  77. package/dist/components/helper-text/HelperText.js.map +0 -1
  78. package/dist/components/helper-text/index.d.ts +0 -3
  79. package/dist/components/helper-text/index.d.ts.map +0 -1
  80. package/dist/components/helper-text/index.js +0 -2
  81. package/dist/components/helper-text/index.js.map +0 -1
  82. package/dist/components/helper-text/types.d.ts +0 -9
  83. package/dist/components/helper-text/types.d.ts.map +0 -1
  84. package/dist/components/helper-text/types.js +0 -2
  85. package/dist/components/helper-text/types.js.map +0 -1
  86. package/dist/components/label/Label.d.ts +0 -4
  87. package/dist/components/label/Label.d.ts.map +0 -1
  88. package/dist/components/label/Label.js +0 -11
  89. package/dist/components/label/Label.js.map +0 -1
  90. package/dist/components/label/index.d.ts +0 -3
  91. package/dist/components/label/index.d.ts.map +0 -1
  92. package/dist/components/label/index.js +0 -2
  93. package/dist/components/label/index.js.map +0 -1
  94. package/dist/components/label/types.d.ts +0 -10
  95. package/dist/components/label/types.d.ts.map +0 -1
  96. package/dist/components/label/types.js +0 -2
  97. package/dist/components/label/types.js.map +0 -1
  98. package/dist/components/list-item/ListItem.d.ts +0 -5
  99. package/dist/components/list-item/ListItem.d.ts.map +0 -1
  100. package/dist/components/list-item/ListItem.js +0 -44
  101. package/dist/components/list-item/ListItem.js.map +0 -1
  102. package/dist/components/list-item/index.d.ts +0 -3
  103. package/dist/components/list-item/index.d.ts.map +0 -1
  104. package/dist/components/list-item/index.js +0 -2
  105. package/dist/components/list-item/index.js.map +0 -1
  106. package/dist/components/list-item/types.d.ts +0 -11
  107. package/dist/components/list-item/types.d.ts.map +0 -1
  108. package/dist/components/list-item/types.js +0 -2
  109. package/dist/components/list-item/types.js.map +0 -1
  110. package/dist/components/switch/Switch.d.ts.map +0 -1
  111. package/dist/components/switch/Switch.js +0 -68
  112. package/dist/components/switch/Switch.js.map +0 -1
  113. package/dist/components/switch/index.d.ts +0 -3
  114. package/dist/components/switch/index.d.ts.map +0 -1
  115. package/dist/components/switch/index.js +0 -2
  116. package/dist/components/switch/index.js.map +0 -1
  117. package/dist/components/switch/types.d.ts.map +0 -1
  118. package/dist/components/switch/types.js +0 -2
  119. package/dist/components/switch/types.js.map +0 -1
  120. package/dist/components/textarea/Textarea.d.ts +0 -4
  121. package/dist/components/textarea/Textarea.d.ts.map +0 -1
  122. package/dist/components/textarea/Textarea.js +0 -6
  123. package/dist/components/textarea/Textarea.js.map +0 -1
  124. package/dist/components/textarea/index.d.ts +0 -3
  125. package/dist/components/textarea/index.d.ts.map +0 -1
  126. package/dist/components/textarea/index.js +0 -2
  127. package/dist/components/textarea/index.js.map +0 -1
  128. package/dist/components/textarea/types.d.ts +0 -5
  129. package/dist/components/textarea/types.d.ts.map +0 -1
  130. package/dist/components/textarea/types.js +0 -2
  131. package/dist/components/textarea/types.js.map +0 -1
  132. package/src/components/field/Field.tsx +0 -52
  133. package/src/components/field/index.ts +0 -2
  134. package/src/components/helper-text/HelperText.tsx +0 -12
  135. package/src/components/helper-text/index.ts +0 -2
  136. package/src/components/helper-text/types.ts +0 -10
  137. package/src/components/label/Label.tsx +0 -23
  138. package/src/components/label/index.ts +0 -2
  139. package/src/components/label/types.ts +0 -11
  140. package/src/components/list-item/ListItem.tsx +0 -76
  141. package/src/components/list-item/index.ts +0 -2
  142. package/src/components/list-item/types.ts +0 -11
  143. package/src/components/switch/Switch.tsx +0 -113
  144. package/src/components/switch/index.ts +0 -2
  145. package/src/components/textarea/Textarea.tsx +0 -15
  146. package/src/components/textarea/index.ts +0 -2
  147. package/src/components/textarea/types.ts +0 -5
  148. /package/src/{components/field/types.ts → types/field.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/field/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { Field } from './Field';\nexport type { FieldProps } from './types';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/field/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nexport interface FieldProps {\n children?: React.ReactNode;\n label?: React.ReactNode;\n helperText?: React.ReactNode;\n errorText?: React.ReactNode;\n required?: boolean;\n disabled?: boolean;\n invalid?: boolean;\n readOnly?: boolean;\n testID?: string;\n}\n"]}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { HelperTextProps } from './types';
3
- export declare function HelperText({ children, emphasis, color, testID }: HelperTextProps): React.JSX.Element;
4
- //# sourceMappingURL=HelperText.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HelperText.d.ts","sourceRoot":"","sources":["../../../src/components/helper-text/HelperText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,eAAe,qBAM1F"}
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import { Text } from '../../features/typography/public';
3
- export function HelperText({ children, emphasis = 'muted', color, testID }) {
4
- return (<Text color={color} emphasis={emphasis} testID={testID} variant="caption">
5
- {children}
6
- </Text>);
7
- }
8
- //# sourceMappingURL=HelperText.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HelperText.js","sourceRoot":"","sources":["../../../src/components/helper-text/HelperText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAGxD,MAAM,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAmB;IACzF,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,SAAS,CACvE;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { Text } from '../../features/typography/public';\nimport type { HelperTextProps } from './types';\n\nexport function HelperText({ children, emphasis = 'muted', color, testID }: HelperTextProps) {\n return (\n <Text color={color} emphasis={emphasis} testID={testID} variant=\"caption\">\n {children}\n </Text>\n );\n}\n"]}
@@ -1,3 +0,0 @@
1
- export { HelperText } from './HelperText';
2
- export type { HelperTextProps } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/helper-text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export { HelperText } from './HelperText';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/helper-text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { HelperText } from './HelperText';\nexport type { HelperTextProps } from './types';\n"]}
@@ -1,9 +0,0 @@
1
- import type React from 'react';
2
- import type { SurfaceColor, SurfaceEmphasis } from '../../surfaceColor';
3
- export interface HelperTextProps {
4
- children?: React.ReactNode;
5
- emphasis?: Extract<SurfaceEmphasis, 'default' | 'muted'>;
6
- color?: Extract<SurfaceColor, 'error'>;
7
- testID?: string;
8
- }
9
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/helper-text/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAExE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/helper-text/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { SurfaceColor, SurfaceEmphasis } from '../../surfaceColor';\n\nexport interface HelperTextProps {\n children?: React.ReactNode;\n emphasis?: Extract<SurfaceEmphasis, 'default' | 'muted'>;\n color?: Extract<SurfaceColor, 'error'>;\n testID?: string;\n}\n"]}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { LabelProps } from './types';
3
- export declare function Label({ children, required, emphasis, color, testID, }: LabelProps): React.JSX.Element;
4
- //# sourceMappingURL=Label.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/components/label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,QAAgB,EAChB,QAAoB,EACpB,KAAK,EACL,MAAM,GACP,EAAE,UAAU,qBAWZ"}
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { Text } from '../../features/typography/public';
3
- export function Label({ children, required = false, emphasis = 'default', color, testID, }) {
4
- return (<Text color={color} emphasis={emphasis} testID={testID} variant="label" weight="medium">
5
- {children}
6
- {required ? (<Text color="error" variant="label" weight="medium">
7
- {' *'}
8
- </Text>) : null}
9
- </Text>);
10
- }
11
- //# sourceMappingURL=Label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../src/components/label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAGxD,MAAM,UAAU,KAAK,CAAC,EACpB,QAAQ,EACR,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,SAAS,EACpB,KAAK,EACL,MAAM,GACK;IACX,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CACrF;MAAA,CAAC,QAAQ,CACT;MAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CACV,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CACjD;UAAA,CAAC,IAAI,CACP;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { Text } from '../../features/typography/public';\nimport type { LabelProps } from './types';\n\nexport function Label({\n children,\n required = false,\n emphasis = 'default',\n color,\n testID,\n}: LabelProps) {\n return (\n <Text color={color} emphasis={emphasis} testID={testID} variant=\"label\" weight=\"medium\">\n {children}\n {required ? (\n <Text color=\"error\" variant=\"label\" weight=\"medium\">\n {' *'}\n </Text>\n ) : null}\n </Text>\n );\n}\n"]}
@@ -1,3 +0,0 @@
1
- export { Label } from './Label';
2
- export type { LabelProps } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/label/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export { Label } from './Label';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/label/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { Label } from './Label';\nexport type { LabelProps } from './types';\n"]}
@@ -1,10 +0,0 @@
1
- import type React from 'react';
2
- import type { SurfaceColor, SurfaceEmphasis } from '../../surfaceColor';
3
- export interface LabelProps {
4
- children?: React.ReactNode;
5
- required?: boolean;
6
- emphasis?: Extract<SurfaceEmphasis, 'default' | 'muted'>;
7
- color?: Extract<SurfaceColor, 'error'>;
8
- testID?: string;
9
- }
10
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/label/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAExE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/label/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { SurfaceColor, SurfaceEmphasis } from '../../surfaceColor';\n\nexport interface LabelProps {\n children?: React.ReactNode;\n required?: boolean;\n emphasis?: Extract<SurfaceEmphasis, 'default' | 'muted'>;\n color?: Extract<SurfaceColor, 'error'>;\n testID?: string;\n}\n"]}
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import type { ListItemProps } from './types';
3
- /*** Renders a static or pressable list item. */
4
- export declare function ListItem({ onPress, disabled, testID, ...content }: ListItemProps): React.JSX.Element;
5
- //# sourceMappingURL=ListItem.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/components/list-item/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA4C7C,gDAAgD;AAChD,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAgB,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,EAAE,aAAa,qBAuBxF"}
@@ -1,44 +0,0 @@
1
- import React from 'react';
2
- import { View as ReactNativeView } from 'react-native';
3
- import { View } from '../../features/layout/public';
4
- import { Text } from '../../features/typography/public';
5
- import { ButtonBase } from '../../primitives/button-base';
6
- import { useTheme } from '../../theme/ThemeContext';
7
- /*** Renders the content row shared by static and interactive ListItem variants. */
8
- function ListItemContent({ title, description, leading, trailing, testID, }) {
9
- const { theme } = useTheme();
10
- return (<View px="m" py="m" testID={testID} style={{
11
- flexDirection: 'row',
12
- alignItems: 'center',
13
- }}>
14
- {leading ? (<ReactNativeView style={{ marginRight: theme.spacing.m }}>{leading}</ReactNativeView>) : null}
15
- <View flex={1}>
16
- {title ? (<Text numberOfLines={1} variant="body" weight="medium">
17
- {title}
18
- </Text>) : null}
19
- {description ? (<Text emphasis="muted" numberOfLines={2} variant="bodySmall">
20
- {description}
21
- </Text>) : null}
22
- </View>
23
- {trailing ? (<ReactNativeView style={{ marginLeft: theme.spacing.m }}>{trailing}</ReactNativeView>) : null}
24
- </View>);
25
- }
26
- /*** Renders a static or pressable list item. */
27
- export function ListItem({ onPress, disabled = false, testID, ...content }) {
28
- const { theme } = useTheme();
29
- if (!onPress)
30
- return <ListItemContent {...content} testID={testID}/>;
31
- return (<ButtonBase accessibilityRole="button" disabled={disabled} onPress={onPress} testID={testID}>
32
- {(state) => (<View style={{
33
- backgroundColor: state.pressed
34
- ? theme.semantics.neutral.surfaceActive
35
- : state.hovered
36
- ? theme.semantics.neutral.surfaceHover
37
- : 'transparent',
38
- opacity: state.disabled ? 0.72 : 1,
39
- }}>
40
- <ListItemContent {...content}/>
41
- </View>)}
42
- </ButtonBase>);
43
- }
44
- //# sourceMappingURL=ListItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../../../src/components/list-item/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAEvD,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,mFAAmF;AACnF,SAAS,eAAe,CAAC,EACvB,KAAK,EACL,WAAW,EACX,OAAO,EACP,QAAQ,EACR,MAAM,GACsC;IAC5C,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAE7B,OAAO,CACL,CAAC,IAAI,CACH,EAAE,CAAC,GAAG,CACN,EAAE,CAAC,GAAG,CACN,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;SACrB,CAAC,CAEF;MAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CACT,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC,CACtF,CAAC,CAAC,CAAC,IAAI,CACR;MAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACZ;QAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CACP,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,C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OAAO,CAAC,aAAa;oBACvC,CAAC,CAAC,KAAK,CAAC,OAAO;wBACb,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY;wBACtC,CAAC,CAAC,aAAa;gBACnB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnC,CAAC,CAEF;UAAA,CAAC,eAAe,CAAC,IAAI,OAAO,CAAC,EAC/B;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { View as ReactNativeView } from 'react-native';\n\nimport { View } from '../../features/layout/public';\nimport { Text } from '../../features/typography/public';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { ListItemProps } from './types';\n\n/*** Renders the content row shared by static and interactive ListItem variants. */\nfunction ListItemContent({\n title,\n description,\n leading,\n trailing,\n testID,\n}: Omit<ListItemProps, 'disabled' | 'onPress'>) {\n const { theme } = useTheme();\n\n return (\n <View\n px=\"m\"\n py=\"m\"\n testID={testID}\n style={{\n flexDirection: 'row',\n alignItems: 'center',\n }}\n >\n {leading ? (\n <ReactNativeView style={{ marginRight: theme.spacing.m }}>{leading}</ReactNativeView>\n ) : null}\n <View flex={1}>\n {title ? (\n <Text numberOfLines={1} variant=\"body\" weight=\"medium\">\n {title}\n </Text>\n ) : null}\n {description ? (\n <Text emphasis=\"muted\" numberOfLines={2} variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </View>\n {trailing ? (\n <ReactNativeView style={{ marginLeft: theme.spacing.m }}>{trailing}</ReactNativeView>\n ) : null}\n </View>\n );\n}\n\n/*** Renders a static or pressable list item. */\nexport function ListItem({ onPress, disabled = false, testID, ...content }: ListItemProps) {\n const { theme } = useTheme();\n\n if (!onPress) return <ListItemContent {...content} testID={testID} />;\n\n return (\n <ButtonBase accessibilityRole=\"button\" disabled={disabled} onPress={onPress} testID={testID}>\n {(state) => (\n <View\n style={{\n backgroundColor: state.pressed\n ? theme.semantics.neutral.surfaceActive\n : state.hovered\n ? theme.semantics.neutral.surfaceHover\n : 'transparent',\n opacity: state.disabled ? 0.72 : 1,\n }}\n >\n <ListItemContent {...content} />\n </View>\n )}\n </ButtonBase>\n );\n}\n"]}
@@ -1,3 +0,0 @@
1
- export { ListItem } from './ListItem';
2
- export type { ListItemProps } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/list-item/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export { ListItem } from './ListItem';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/list-item/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { ListItem } from './ListItem';\nexport type { ListItemProps } from './types';\n"]}
@@ -1,11 +0,0 @@
1
- import type React from 'react';
2
- export interface ListItemProps {
3
- title?: React.ReactNode;
4
- description?: React.ReactNode;
5
- leading?: React.ReactNode;
6
- trailing?: React.ReactNode;
7
- onPress?: (() => void) | undefined;
8
- disabled?: boolean;
9
- testID?: string;
10
- }
11
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/list-item/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/list-item/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nexport interface ListItemProps {\n title?: React.ReactNode;\n description?: React.ReactNode;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n onPress?: (() => void) | undefined;\n disabled?: boolean;\n testID?: string;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../src/components/switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,+DAA+D;AAC/D,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,OAAO,EACP,cAAsB,EACtB,eAAe,EACf,KAAiB,EACjB,IAAU,EACV,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,kBAAkB,EAClB,MAAM,EACN,GAAG,KAAK,EACT,EAAE,WAAW,qBAmFb"}
@@ -1,68 +0,0 @@
1
- import React from 'react';
2
- import { View } from '../../features/layout/public';
3
- import { Text } from '../../features/typography/public';
4
- import { resolveFieldState, resolveIndicatorSize, resolveSelectionControlColors, resolveSelectionControlNextChecked, } from '../../internal/resolvers';
5
- import { useControllableState } from '../../internal/useControllableState';
6
- import { ButtonBase } from '../../primitives/button-base';
7
- import { useTheme } from '../../theme/ThemeContext';
8
- /*** Renders a controlled or uncontrolled accessible switch. */
9
- export function Switch({ children, checked, defaultChecked = false, onCheckedChange, color = 'primary', size = 'm', disabled = false, invalid = false, readOnly = false, accessibilityLabel, testID, ...props }) {
10
- const { theme } = useTheme();
11
- const [isChecked, setChecked] = useControllableState({
12
- value: checked,
13
- defaultValue: defaultChecked,
14
- onChange: onCheckedChange,
15
- });
16
- const indicatorSize = resolveIndicatorSize(size);
17
- const nextChecked = resolveSelectionControlNextChecked({
18
- checked: isChecked,
19
- disabled,
20
- kind: 'switch',
21
- readOnly,
22
- });
23
- return (<ButtonBase {...props} accessibilityLabel={accessibilityLabel} accessibilityRole="switch" accessibilityState={{ checked: isChecked }} disabled={disabled} onPress={nextChecked === null ? undefined : () => setChecked(nextChecked)} testID={testID}>
24
- {(interactionState) => {
25
- const fieldState = resolveFieldState({
26
- disabled,
27
- focused: interactionState.focused,
28
- invalid,
29
- readOnly,
30
- });
31
- const colors = resolveSelectionControlColors(theme, {
32
- checked: isChecked,
33
- fieldState,
34
- hovered: interactionState.hovered,
35
- pressed: interactionState.pressed,
36
- color,
37
- });
38
- const labelEmphasis = colors.labelColor === theme.semantics.content.muted ? 'muted' : 'default';
39
- return (<View style={{
40
- alignItems: 'center',
41
- flexDirection: 'row',
42
- opacity: colors.opacity,
43
- }}>
44
- <View radius="full" style={{
45
- backgroundColor: colors.trackColor,
46
- borderColor: colors.borderColor,
47
- borderWidth: 1,
48
- justifyContent: 'center',
49
- minWidth: indicatorSize.switchWidth,
50
- paddingHorizontal: 2,
51
- width: indicatorSize.switchWidth,
52
- height: indicatorSize.switchHeight,
53
- }}>
54
- <View radius="full" style={{
55
- alignSelf: isChecked ? 'flex-end' : 'flex-start',
56
- backgroundColor: colors.thumbColor,
57
- height: indicatorSize.switchThumb,
58
- width: indicatorSize.switchThumb,
59
- }}/>
60
- </View>
61
- {children ? (<View ml="s">
62
- <Text emphasis={labelEmphasis}>{children}</Text>
63
- </View>) : null}
64
- </View>);
65
- }}
66
- </ButtonBase>);
67
- }
68
- //# sourceMappingURL=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ACnC,iBAAiB,EAAE,CAAC;oBACpB,KAAK,EAAE,aAAa,CAAC,WAAW;oBAChC,MAAM,EAAE,aAAa,CAAC,YAAY;iBACnC,CAAC,CAEF;cAAA,CAAC,IAAI,CACH,MAAM,CAAC,MAAM,CACb,KAAK,CAAC,CAAC;oBACL,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;oBAChD,eAAe,EAAE,MAAM,CAAC,UAAU;oBAClC,MAAM,EAAE,aAAa,CAAC,WAAW;oBACjC,KAAK,EAAE,aAAa,CAAC,WAAW;iBACjC,CAAC,EAEN;YAAA,EAAE,IAAI,CACN;YAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,CACV,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CACV;gBAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CACjD;cAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;UAAA,EAAE,IAAI,CAAC,CACR,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { View } from '../../features/layout/public';\nimport { Text } from '../../features/typography/public';\nimport {\n resolveFieldState,\n resolveIndicatorSize,\n resolveSelectionControlColors,\n resolveSelectionControlNextChecked,\n} from '../../internal/resolvers';\nimport { useControllableState } from '../../internal/useControllableState';\nimport { ButtonBase } from '../../primitives/button-base';\nimport { useTheme } from '../../theme/ThemeContext';\nimport type { SwitchProps } from './types';\n\n/*** Renders a controlled or uncontrolled accessible switch. */\nexport function Switch({\n children,\n checked,\n defaultChecked = false,\n onCheckedChange,\n color = 'primary',\n size = 'm',\n disabled = false,\n invalid = false,\n readOnly = false,\n accessibilityLabel,\n testID,\n ...props\n}: SwitchProps) {\n const { theme } = useTheme();\n const [isChecked, setChecked] = useControllableState<boolean>({\n value: checked,\n defaultValue: defaultChecked,\n onChange: onCheckedChange,\n });\n const indicatorSize = resolveIndicatorSize(size);\n const nextChecked = resolveSelectionControlNextChecked({\n checked: isChecked,\n disabled,\n kind: 'switch',\n readOnly,\n });\n\n return (\n <ButtonBase\n {...props}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole=\"switch\"\n accessibilityState={{ checked: isChecked }}\n disabled={disabled}\n onPress={nextChecked === null ? undefined : () => setChecked(nextChecked)}\n testID={testID}\n >\n {(interactionState) => {\n const fieldState = resolveFieldState({\n disabled,\n focused: interactionState.focused,\n invalid,\n readOnly,\n });\n const colors = resolveSelectionControlColors(theme, {\n checked: isChecked,\n fieldState,\n hovered: interactionState.hovered,\n pressed: interactionState.pressed,\n color,\n });\n const labelEmphasis =\n colors.labelColor === theme.semantics.content.muted ? 'muted' : 'default';\n\n return (\n <View\n style={{\n alignItems: 'center',\n flexDirection: 'row',\n opacity: colors.opacity,\n }}\n >\n <View\n radius=\"full\"\n style={{\n backgroundColor: colors.trackColor,\n borderColor: colors.borderColor,\n borderWidth: 1,\n justifyContent: 'center',\n minWidth: indicatorSize.switchWidth,\n paddingHorizontal: 2,\n width: indicatorSize.switchWidth,\n height: indicatorSize.switchHeight,\n }}\n >\n <View\n radius=\"full\"\n style={{\n alignSelf: isChecked ? 'flex-end' : 'flex-start',\n backgroundColor: colors.thumbColor,\n height: indicatorSize.switchThumb,\n width: indicatorSize.switchThumb,\n }}\n />\n </View>\n {children ? (\n <View ml=\"s\">\n <Text emphasis={labelEmphasis}>{children}</Text>\n </View>\n ) : null}\n </View>\n );\n }}\n </ButtonBase>\n );\n}\n"]}
@@ -1,3 +0,0 @@
1
- export { Switch } from './Switch';
2
- export type { SwitchProps } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export { Switch } from './Switch';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/switch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { Switch } from './Switch';\nexport type { SwitchProps } from './types';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/switch/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,eAAe,EACf,mBAAmB,GAAG,oBAAoB,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAC9E;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/switch/types.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../../internal/resolvers/resolveControlSize';\nimport type { ButtonBaseProps } from '../../primitives/button-base';\nimport type { SurfaceColor } from '../../surfaceColor';\n\nexport interface SwitchProps extends Omit<\n ButtonBaseProps,\n 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'\n> {\n children?: React.ReactNode;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: ((checked: boolean) => void) | undefined;\n color?: SurfaceColor;\n size?: ControlSize;\n invalid?: boolean;\n readOnly?: boolean;\n}\n"]}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { TextareaProps } from './types';
3
- export declare function Textarea({ rows, numberOfLines, style, ...props }: TextareaProps): React.JSX.Element;
4
- //# sourceMappingURL=Textarea.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,wBAAgB,QAAQ,CAAC,EAAE,IAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,qBASnF"}
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { TextInput } from '../../features/form/text-input/public';
3
- export function Textarea({ rows = 4, numberOfLines, style, ...props }) {
4
- return (<TextInput {...props} multiline numberOfLines={numberOfLines ?? rows} style={[{ textAlignVertical: 'top' }, style]}/>);
5
- }
6
- //# sourceMappingURL=Textarea.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../src/components/textarea/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAGlE,MAAM,UAAU,QAAQ,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,KAAK,EAAiB;IAClF,OAAO,CACL,CAAC,SAAS,CACR,IAAI,KAAK,CAAC,CACV,SAAS,CACT,aAAa,CAAC,CAAC,aAAa,IAAI,IAAI,CAAC,CACrC,KAAK,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,CAAC,EAC7C,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport { TextInput } from '../../features/form/text-input/public';\nimport type { TextareaProps } from './types';\n\nexport function Textarea({ rows = 4, numberOfLines, style, ...props }: TextareaProps) {\n return (\n <TextInput\n {...props}\n multiline\n numberOfLines={numberOfLines ?? rows}\n style={[{ textAlignVertical: 'top' }, style]}\n />\n );\n}\n"]}
@@ -1,3 +0,0 @@
1
- export { Textarea } from './Textarea';
2
- export type { TextareaProps } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export { Textarea } from './Textarea';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/textarea/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { Textarea } from './Textarea';\nexport type { TextareaProps } from './types';\n"]}
@@ -1,5 +0,0 @@
1
- import type { TextInputProps } from '../../types/text-input';
2
- export interface TextareaProps extends Omit<TextInputProps, 'multiline'> {
3
- rows?: number;
4
- }
5
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/textarea/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextInputProps } from '../../types/text-input';\n\nexport interface TextareaProps extends Omit<TextInputProps, 'multiline'> {\n rows?: number;\n}\n"]}
@@ -1,52 +0,0 @@
1
- import React from 'react';
2
-
3
- import { View } from '../../features/layout/public';
4
- import { resolveFieldPresentation, resolveFieldState } from '../../internal/resolvers';
5
- import { HelperText } from '../helper-text';
6
- import { Label } from '../label';
7
- import type { FieldProps } from './types';
8
-
9
- /*** Composes a label, control, and helper or error message into one field. */
10
- export function Field({
11
- children,
12
- label,
13
- helperText,
14
- errorText,
15
- required = false,
16
- disabled = false,
17
- invalid = false,
18
- readOnly = false,
19
- testID,
20
- }: FieldProps) {
21
- const hasErrorText = Boolean(errorText);
22
- const fieldState = resolveFieldState({
23
- disabled,
24
- invalid: invalid || hasErrorText,
25
- readOnly,
26
- });
27
- const presentation = resolveFieldPresentation(fieldState);
28
-
29
- return (
30
- <View gap="xs" testID={testID}>
31
- {label ? (
32
- <Label
33
- color={presentation.labelColor}
34
- emphasis={presentation.labelEmphasis}
35
- required={required}
36
- >
37
- {label}
38
- </Label>
39
- ) : null}
40
- <View>{children}</View>
41
- {hasErrorText ? (
42
- <HelperText color={presentation.helperColor} emphasis={presentation.helperEmphasis}>
43
- {errorText}
44
- </HelperText>
45
- ) : helperText ? (
46
- <HelperText color={presentation.helperColor} emphasis={presentation.helperEmphasis}>
47
- {helperText}
48
- </HelperText>
49
- ) : null}
50
- </View>
51
- );
52
- }
@@ -1,2 +0,0 @@
1
- export { Field } from './Field';
2
- export type { FieldProps } from './types';
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Text } from '../../features/typography/public';
4
- import type { HelperTextProps } from './types';
5
-
6
- export function HelperText({ children, emphasis = 'muted', color, testID }: HelperTextProps) {
7
- return (
8
- <Text color={color} emphasis={emphasis} testID={testID} variant="caption">
9
- {children}
10
- </Text>
11
- );
12
- }
@@ -1,2 +0,0 @@
1
- export { HelperText } from './HelperText';
2
- export type { HelperTextProps } from './types';
@@ -1,10 +0,0 @@
1
- import type React from 'react';
2
-
3
- import type { SurfaceColor, SurfaceEmphasis } from '../../surfaceColor';
4
-
5
- export interface HelperTextProps {
6
- children?: React.ReactNode;
7
- emphasis?: Extract<SurfaceEmphasis, 'default' | 'muted'>;
8
- color?: Extract<SurfaceColor, 'error'>;
9
- testID?: string;
10
- }
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Text } from '../../features/typography/public';
4
- import type { LabelProps } from './types';
5
-
6
- export function Label({
7
- children,
8
- required = false,
9
- emphasis = 'default',
10
- color,
11
- testID,
12
- }: LabelProps) {
13
- return (
14
- <Text color={color} emphasis={emphasis} testID={testID} variant="label" weight="medium">
15
- {children}
16
- {required ? (
17
- <Text color="error" variant="label" weight="medium">
18
- {' *'}
19
- </Text>
20
- ) : null}
21
- </Text>
22
- );
23
- }
@@ -1,2 +0,0 @@
1
- export { Label } from './Label';
2
- export type { LabelProps } from './types';
@@ -1,11 +0,0 @@
1
- import type React from 'react';
2
-
3
- import type { SurfaceColor, SurfaceEmphasis } from '../../surfaceColor';
4
-
5
- export interface LabelProps {
6
- children?: React.ReactNode;
7
- required?: boolean;
8
- emphasis?: Extract<SurfaceEmphasis, 'default' | 'muted'>;
9
- color?: Extract<SurfaceColor, 'error'>;
10
- testID?: string;
11
- }