@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/surface
2
2
 
3
+ ## 7.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 2977e37: Move the remaining legacy component APIs into canonical feature ownership. `Field` and `Switch` now live under the form capability, `List` and `ListItem` share the new list capability, and `Textarea`, `Label`, and `HelperText` are removed in favor of `TextInput multiline` and field-owned presentation.
8
+
3
9
  ## 6.0.0
4
10
 
5
11
  ### Major Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/surface
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v5.0.1](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v6.0.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Cross-platform UI foundation for React Native and React Native Web. Provides theming, layout primitives, and core building blocks for modern apps.
9
9
 
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { FieldProps } from './types';
3
- /*** Composes a label, control, and helper or error message into one field. */
2
+ import type { FieldProps } from '../../../../../types/field';
3
+ /*** Composes a control with its label and helper or error message. */
4
4
  export declare function Field({ children, label, helperText, errorText, required, disabled, invalid, readOnly, testID, }: FieldProps): React.JSX.Element;
5
5
  //# sourceMappingURL=Field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/field/adapters/inbound/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAI7D,sEAAsE;AACtE,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,KAAK,EACL,UAAU,EACV,SAAS,EACT,QAAgB,EAChB,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,MAAM,GACP,EAAE,UAAU,qBAcZ"}
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ import { resolveFieldPresentation, resolveFieldState, } from '../../../../../internal/resolvers';
3
+ import { View } from '../../../../layout/public';
4
+ import { Text } from '../../../../typography/public';
5
+ /*** Composes a control with its label and helper or error message. */
6
+ export function Field({ children, label, helperText, errorText, required = false, disabled = false, invalid = false, readOnly = false, testID, }) {
7
+ const hasErrorText = Boolean(errorText);
8
+ const presentation = resolveFieldPresentation(resolveFieldState({ disabled, invalid: invalid || hasErrorText, readOnly }));
9
+ const message = hasErrorText ? errorText : helperText;
10
+ return (<View gap="xs" testID={testID}>
11
+ {renderFieldLabel(label, required, presentation)}
12
+ <View>{children}</View>
13
+ {renderFieldMessage(message, presentation)}
14
+ </View>);
15
+ }
16
+ /*** Renders an optional field label and required indicator. */
17
+ function renderFieldLabel(label, required, presentation) {
18
+ if (label === undefined || label === null)
19
+ return null;
20
+ const labelContent = typeof label === 'string' || typeof label === 'number' ? (<Text color={presentation.labelColor} emphasis={presentation.labelEmphasis} variant="label" weight="medium">
21
+ {label}
22
+ </Text>) : (label);
23
+ return (<View align="center" direction="row" gap="xs">
24
+ <View flex={1}>{labelContent}</View>
25
+ {required ? (<Text color="error" variant="label" weight="medium">
26
+ *
27
+ </Text>) : null}
28
+ </View>);
29
+ }
30
+ /*** Renders an optional helper or error message using field presentation semantics. */
31
+ function renderFieldMessage(message, presentation) {
32
+ if (message === undefined || message === null || message === '')
33
+ return null;
34
+ if (typeof message !== 'string' && typeof message !== 'number')
35
+ return message;
36
+ return (<Text color={presentation.helperColor} emphasis={presentation.helperEmphasis} variant="caption">
37
+ {message}
38
+ </Text>);
39
+ }
40
+ //# sourceMappingURL=Field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Field.js","sourceRoot":"","sources":["../../../../../../src/features/form/field/adapters/inbound/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,sEAAsE;AACtE,MAAM,UAAU,KAAK,CAAC,EACpB,QAAQ,EACR,KAAK,EACL,UAAU,EACV,SAAS,EACT,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,MAAM,GACK;IACX,MAAM,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,YAAY,GAAG,wBAAwB,CAC3C,iBAAiB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,QAAQ,EAAE,CAAC,CAC5E,CAAC;IACF,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;IAEtD,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC5B;MAAA,CAAC,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,CAAC,CAChD;MAAA,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CACtB;MAAA,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,CAAC,CAC5C;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,SAAS,gBAAgB,CACvB,KAAsB,EACtB,QAAiB,EACjB,YAAuC;IAE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AC,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,SAAS,CAC7F;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\n\nimport {\n type ResolvedFieldPresentation,\n resolveFieldPresentation,\n resolveFieldState,\n} from '../../../../../internal/resolvers';\nimport type { FieldProps } from '../../../../../types/field';\nimport { View } from '../../../../layout/public';\nimport { Text } from '../../../../typography/public';\n\n/*** Composes a control with its label and helper or error message. */\nexport function Field({\n children,\n label,\n helperText,\n errorText,\n required = false,\n disabled = false,\n invalid = false,\n readOnly = false,\n testID,\n}: FieldProps) {\n const hasErrorText = Boolean(errorText);\n const presentation = resolveFieldPresentation(\n resolveFieldState({ disabled, invalid: invalid || hasErrorText, readOnly }),\n );\n const message = hasErrorText ? errorText : helperText;\n\n return (\n <View gap=\"xs\" testID={testID}>\n {renderFieldLabel(label, required, presentation)}\n <View>{children}</View>\n {renderFieldMessage(message, presentation)}\n </View>\n );\n}\n\n/*** Renders an optional field label and required indicator. */\nfunction renderFieldLabel(\n label: React.ReactNode,\n required: boolean,\n presentation: ResolvedFieldPresentation,\n) {\n if (label === undefined || label === null) return null;\n const labelContent =\n typeof label === 'string' || typeof label === 'number' ? (\n <Text\n color={presentation.labelColor}\n emphasis={presentation.labelEmphasis}\n variant=\"label\"\n weight=\"medium\"\n >\n {label}\n </Text>\n ) : (\n label\n );\n\n return (\n <View align=\"center\" direction=\"row\" gap=\"xs\">\n <View flex={1}>{labelContent}</View>\n {required ? (\n <Text color=\"error\" variant=\"label\" weight=\"medium\">\n *\n </Text>\n ) : null}\n </View>\n );\n}\n\n/*** Renders an optional helper or error message using field presentation semantics. */\nfunction renderFieldMessage(message: React.ReactNode, presentation: ResolvedFieldPresentation) {\n if (message === undefined || message === null || message === '') return null;\n if (typeof message !== 'string' && typeof message !== 'number') return message;\n\n return (\n <Text color={presentation.helperColor} emphasis={presentation.helperEmphasis} variant=\"caption\">\n {message}\n </Text>\n );\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export type { FieldProps } from '../../../types/field';
2
+ export { Field } from './adapters/inbound/Field';
3
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../src/features/form/field/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Field } from './adapters/inbound/Field';
2
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/features/form/field/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export type { FieldProps } from '../../../types/field';\nexport { Field } from './adapters/inbound/Field';\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import type { SwitchProps } from './types';
2
+ import type { SwitchProps } from '../../../../../types/switch';
3
3
  /*** Renders a controlled or uncontrolled accessible switch. */
4
4
  export declare function Switch({ children, checked, defaultChecked, onCheckedChange, color, size, disabled, invalid, readOnly, accessibilityLabel, testID, ...props }: SwitchProps): React.JSX.Element;
5
5
  //# sourceMappingURL=Switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/switch/adapters/inbound/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D,+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,qBAgCb"}
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { resolveFieldState, resolveIndicatorSize, resolveSelectionControlColors, resolveSelectionControlNextChecked, } from '../../../../../internal/resolvers';
3
+ import { useControllableState } from '../../../../../internal/useControllableState';
4
+ import { ButtonBase } from '../../../../../primitives/button-base';
5
+ import { useTheme } from '../../../../../theme/ThemeContext';
6
+ import { View } from '../../../../layout/public';
7
+ import { Text } from '../../../../typography/public';
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 nextChecked = resolveSelectionControlNextChecked({
17
+ checked: isChecked,
18
+ disabled,
19
+ kind: 'switch',
20
+ readOnly,
21
+ });
22
+ return (<ButtonBase {...props} accessibilityLabel={accessibilityLabel} accessibilityRole="switch" accessibilityState={{ checked: isChecked }} disabled={disabled} onPress={nextChecked === null ? undefined : () => setChecked(nextChecked)} testID={testID}>
23
+ {(interactionState) => renderSwitchContent({ children, color, disabled, invalid, isChecked, readOnly, size, theme }, interactionState)}
24
+ </ButtonBase>);
25
+ }
26
+ /*** Resolves switch presentation for one interaction state and renders the visual control. */
27
+ function renderSwitchContent(input, interactionState) {
28
+ const fieldState = resolveFieldState({
29
+ disabled: input.disabled,
30
+ focused: interactionState.focused,
31
+ invalid: input.invalid,
32
+ readOnly: input.readOnly,
33
+ });
34
+ const colors = resolveSelectionControlColors(input.theme, {
35
+ checked: input.isChecked,
36
+ fieldState,
37
+ hovered: interactionState.hovered,
38
+ pressed: interactionState.pressed,
39
+ color: input.color,
40
+ });
41
+ const indicatorSize = resolveIndicatorSize(input.size);
42
+ const labelEmphasis = colors.labelColor === input.theme.semantics.content.muted ? 'muted' : 'default';
43
+ return (<View align="center" direction="row" opacity={colors.opacity}>
44
+ <View bg={colors.trackColor} borderColor={colors.borderColor} borderWidth={1} height={indicatorSize.switchHeight} justify="center" minWidth={indicatorSize.switchWidth} px={2} radius="full" width={indicatorSize.switchWidth}>
45
+ <View alignSelf={input.isChecked ? 'flex-end' : 'flex-start'} bg={colors.thumbColor} height={indicatorSize.switchThumb} radius="full" width={indicatorSize.switchThumb}/>
46
+ </View>
47
+ {input.children ? (<View ml="s">
48
+ <Text emphasis={labelEmphasis}>{input.children}</Text>
49
+ </View>) : null}
50
+ </View>);
51
+ }
52
+ //# sourceMappingURL=Switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Switch.js","sourceRoot":"","sources":["../../../../../../src/features/form/switch/adapters/inbound/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAEL,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAErD,+DAA+D;AAC/D,MAAM,UAAU,MAAM,CAAC,EACrB,QAAQ,EACR,OAAO,EACP,cAAc,GAAG,KAAK,EACtB,eAAe,EACf,KAAK,GAAG,SAAS,EACjB,IAAI,GAAG,GAAG,EACV,QAAQ,GAAG,KAAK,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,kBAAkB,EAClB,MAAM,EACN,GAAG,KAAK,EACI;IACZ,MAA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CAAC,CAAC,aAAa,CAAC,WAAW,CAAC,EAErC;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAChB,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CACV;UAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,CACvD;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 {\n type InteractionState,\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/switch';\nimport { View } from '../../../../layout/public';\nimport { Text } from '../../../../typography/public';\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 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 renderSwitchContent(\n { children, color, disabled, invalid, isChecked, readOnly, size, theme },\n interactionState,\n )\n }\n </ButtonBase>\n );\n}\n\ninterface SwitchContentInput {\n children: React.ReactNode;\n color: NonNullable<SwitchProps['color']>;\n disabled: boolean;\n invalid: boolean;\n isChecked: boolean;\n readOnly: boolean;\n size: NonNullable<SwitchProps['size']>;\n theme: ReturnType<typeof useTheme>['theme'];\n}\n\n/*** Resolves switch presentation for one interaction state and renders the visual control. */\nfunction renderSwitchContent(input: SwitchContentInput, interactionState: InteractionState) {\n const fieldState = resolveFieldState({\n disabled: input.disabled,\n focused: interactionState.focused,\n invalid: input.invalid,\n readOnly: input.readOnly,\n });\n const colors = resolveSelectionControlColors(input.theme, {\n checked: input.isChecked,\n fieldState,\n hovered: interactionState.hovered,\n pressed: interactionState.pressed,\n color: input.color,\n });\n const indicatorSize = resolveIndicatorSize(input.size);\n const labelEmphasis =\n colors.labelColor === input.theme.semantics.content.muted ? 'muted' : 'default';\n\n return (\n <View align=\"center\" direction=\"row\" opacity={colors.opacity}>\n <View\n bg={colors.trackColor}\n borderColor={colors.borderColor}\n borderWidth={1}\n height={indicatorSize.switchHeight}\n justify=\"center\"\n minWidth={indicatorSize.switchWidth}\n px={2}\n radius=\"full\"\n width={indicatorSize.switchWidth}\n >\n <View\n alignSelf={input.isChecked ? 'flex-end' : 'flex-start'}\n bg={colors.thumbColor}\n height={indicatorSize.switchThumb}\n radius=\"full\"\n width={indicatorSize.switchThumb}\n />\n </View>\n {input.children ? (\n <View ml=\"s\">\n <Text emphasis={labelEmphasis}>{input.children}</Text>\n </View>\n ) : null}\n </View>\n );\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export type { SwitchProps } from '../../../types/switch';
2
+ export { Switch } from './adapters/inbound/Switch';
3
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../../src/features/form/switch/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { Switch } from './adapters/inbound/Switch';
2
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../src/features/form/switch/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["export type { SwitchProps } from '../../../types/switch';\nexport { Switch } from './adapters/inbound/Switch';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBA+C9C"}
1
+ {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBA6C9C"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Platform, TextInput as ReactNativeTextInput, View } from 'react-native';
2
+ import { Platform, TextInput as ReactNativeTextInput, View, } from 'react-native';
3
3
  import { resolveFocusRingStyles } from '../../../../../internal/resolvers';
4
4
  import { useTheme } from '../../../../../theme/ThemeContext';
5
5
  import { resolveTextInputPresentation } from '../../utils/resolveTextInputPresentation';
@@ -18,16 +18,20 @@ export function TextInput(props) {
18
18
  setFocused(false);
19
19
  nativeProps.onBlur?.(event);
20
20
  }} onChangeText={(nextValue) => {
21
- if (interactionPolicy !== 'passive') {
21
+ if (interactionPolicy !== 'passive')
22
22
  nativeProps.onChangeText?.(nextValue);
23
- }
24
23
  }} onFocus={(event) => {
25
24
  setFocused(true);
26
25
  nativeProps.onFocus?.(event);
27
- }} placeholderTextColor={presentation.placeholderColor} readOnly={readOnly} style={[presentation.inputStyle, nativeProps.style]}/>
26
+ }} placeholderTextColor={presentation.placeholderColor} readOnly={readOnly} style={resolveInputStyle(presentation.inputStyle, nativeProps.multiline, nativeProps.style)}/>
28
27
  {renderAccessory(trailingAccessory, presentation.accessorySpacing, 'trailing')}
29
28
  </View>);
30
29
  }
30
+ const multilineInputStyle = { textAlignVertical: 'top' };
31
+ /*** Resolves TextInput style composition including canonical multiline alignment. */
32
+ function resolveInputStyle(presentationStyle, multiline, style) {
33
+ return [presentationStyle, multiline ? multilineInputStyle : undefined, style];
34
+ }
31
35
  /*** Renders one optional TextInput accessory with directional spacing. */
32
36
  function renderAccessory(accessory, spacing, position) {
33
37
  if (!accessory)
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,SAAS,IAAI,oBAAoB,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAC;AAEjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAExF,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,EACJ,QAAQ,EAAE,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B,CAAC,CACpD,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,EAEtD;MAAA,CAAC,eAAe,CAAC,iBAAiB,EAAE,YAAY,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAChF;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,0EAA0E;AAC1E,SAAS,eAAe,CACtB,SAA0B,EAC1B,OAAe,EACf,QAAgC;IAEhC,IAAI,CAAC,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;AACnF,CAAC;AAED,0EAA0E;AAC1E,SAAS,qBAAqB,CAAC,OAAe,EAAE,QAAgC;IAC9E,OAAO,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AACrF,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, TextInput as ReactNativeTextInput, View, type ViewStyle } from 'react-native';\n\nimport { resolveFocusRingStyles } from '../../../../../internal/resolvers';\nimport { useTheme } from '../../../../../theme/ThemeContext';\nimport type { TextInputProps } from '../../../../../types/text-input';\nimport { resolveTextInputPresentation } from '../../utils/resolveTextInputPresentation';\n\n/*** Renders a token-aware text input with controlled interaction policy. */\nexport function TextInput(props: TextInputProps) {\n const { theme } = useTheme();\n const [focused, setFocused] = React.useState(false);\n const {\n disabled: _disabled,\n interactionPolicy = 'enabled',\n invalid: _invalid,\n leadingAccessory,\n readOnly = false,\n size: _size,\n trailingAccessory,\n ...nativeProps\n } = props;\n const presentation = resolveTextInputPresentation(theme, props, focused);\n\n return (\n <View\n style={[\n presentation.containerStyle,\n resolveFocusRingStyles(theme.semantics.border.focus, focused, Platform.OS === 'web'),\n ]}\n >\n {renderAccessory(leadingAccessory, presentation.accessorySpacing, 'leading')}\n <ReactNativeTextInput\n {...nativeProps}\n editable={presentation.editable}\n numberOfLines={presentation.numberOfLines}\n onBlur={(event) => {\n setFocused(false);\n nativeProps.onBlur?.(event);\n }}\n onChangeText={(nextValue) => {\n if (interactionPolicy !== 'passive') {\n nativeProps.onChangeText?.(nextValue);\n }\n }}\n onFocus={(event) => {\n setFocused(true);\n nativeProps.onFocus?.(event);\n }}\n placeholderTextColor={presentation.placeholderColor}\n readOnly={readOnly}\n style={[presentation.inputStyle, nativeProps.style]}\n />\n {renderAccessory(trailingAccessory, presentation.accessorySpacing, 'trailing')}\n </View>\n );\n}\n\n/*** Renders one optional TextInput accessory with directional spacing. */\nfunction renderAccessory(\n accessory: React.ReactNode,\n spacing: number,\n position: 'leading' | 'trailing',\n) {\n if (!accessory) return null;\n return <View style={resolveAccessoryStyle(spacing, position)}>{accessory}</View>;\n}\n\n/*** Resolves spacing around a leading or trailing TextInput accessory. */\nfunction resolveAccessoryStyle(spacing: number, position: 'leading' | 'trailing'): ViewStyle {\n return position === 'leading' ? { marginRight: spacing } : { marginLeft: spacing };\n}\n"]}
1
+ {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../../../src/features/form/text-input/adapters/inbound/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,QAAQ,EAER,SAAS,IAAI,oBAAoB,EAEjC,IAAI,GAEL,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAExF,4EAA4E;AAC5E,MAAM,UAAU,SAAS,CAAC,KAAqB;IAC7C,MA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\n type StyleProp,\n TextInput as ReactNativeTextInput,\n type TextStyle,\n View,\n type ViewStyle,\n} from 'react-native';\n\nimport { resolveFocusRingStyles } from '../../../../../internal/resolvers';\nimport { useTheme } from '../../../../../theme/ThemeContext';\nimport type { TextInputProps } from '../../../../../types/text-input';\nimport { resolveTextInputPresentation } from '../../utils/resolveTextInputPresentation';\n\n/*** Renders a token-aware text input with controlled interaction policy. */\nexport function TextInput(props: TextInputProps) {\n const { theme } = useTheme();\n const [focused, setFocused] = React.useState(false);\n const {\n disabled: _disabled,\n interactionPolicy = 'enabled',\n invalid: _invalid,\n leadingAccessory,\n readOnly = false,\n size: _size,\n trailingAccessory,\n ...nativeProps\n } = props;\n const presentation = resolveTextInputPresentation(theme, props, focused);\n\n return (\n <View\n style={[\n presentation.containerStyle,\n resolveFocusRingStyles(theme.semantics.border.focus, focused, Platform.OS === 'web'),\n ]}\n >\n {renderAccessory(leadingAccessory, presentation.accessorySpacing, 'leading')}\n <ReactNativeTextInput\n {...nativeProps}\n editable={presentation.editable}\n numberOfLines={presentation.numberOfLines}\n onBlur={(event) => {\n setFocused(false);\n nativeProps.onBlur?.(event);\n }}\n onChangeText={(nextValue) => {\n if (interactionPolicy !== 'passive') nativeProps.onChangeText?.(nextValue);\n }}\n onFocus={(event) => {\n setFocused(true);\n nativeProps.onFocus?.(event);\n }}\n placeholderTextColor={presentation.placeholderColor}\n readOnly={readOnly}\n style={resolveInputStyle(presentation.inputStyle, nativeProps.multiline, nativeProps.style)}\n />\n {renderAccessory(trailingAccessory, presentation.accessorySpacing, 'trailing')}\n </View>\n );\n}\n\nconst multilineInputStyle: TextStyle = { textAlignVertical: 'top' };\n\n/*** Resolves TextInput style composition including canonical multiline alignment. */\nfunction resolveInputStyle(\n presentationStyle: StyleProp<TextStyle>,\n multiline: boolean | undefined,\n style: StyleProp<TextStyle>,\n): StyleProp<TextStyle> {\n return [presentationStyle, multiline ? multilineInputStyle : undefined, style];\n}\n\n/*** Renders one optional TextInput accessory with directional spacing. */\nfunction renderAccessory(\n accessory: React.ReactNode,\n spacing: number,\n position: 'leading' | 'trailing',\n) {\n if (!accessory) return null;\n return <View style={resolveAccessoryStyle(spacing, position)}>{accessory}</View>;\n}\n\n/*** Resolves spacing around a leading or trailing TextInput accessory. */\nfunction resolveAccessoryStyle(spacing: number, position: 'leading' | 'trailing'): ViewStyle {\n return position === 'leading' ? { marginRight: spacing } : { marginLeft: spacing };\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { ListProps } from '../../../../types/list';
3
+ /*** Groups list items under one neutral Surface list boundary. */
4
+ export declare function List({ children, testID }: ListProps): React.JSX.Element;
5
+ //# sourceMappingURL=List.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,kEAAkE;AAClE,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,qBAEnD"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { View } from '../../../layout/public';
3
+ /*** Groups list items under one neutral Surface list boundary. */
4
+ export function List({ children, testID }) {
5
+ return <View testID={testID}>{children}</View>;
6
+ }
7
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.js","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,kEAAkE;AAClE,MAAM,UAAU,IAAI,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAa;IAClD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import React from 'react';\n\nimport type { ListProps } from '../../../../types/list';\nimport { View } from '../../../layout/public';\n\n/*** Groups list items under one neutral Surface list boundary. */\nexport function List({ children, testID }: ListProps) {\n return <View testID={testID}>{children}</View>;\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { ListItemProps } from '../../../../types/list';
3
+ /*** Renders a static or interactive list item with shared row geometry and interaction states. */
4
+ export declare function ListItem(props: ListItemProps): React.JSX.Element;
5
+ //# sourceMappingURL=ListItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAI5D,kGAAkG;AAClG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAI5C"}
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { ButtonBase } from '../../../../primitives/button-base';
3
+ import { useTheme } from '../../../../theme/ThemeContext';
4
+ import { View } from '../../../layout/public';
5
+ import { Text } from '../../../typography/public';
6
+ /*** Renders a static or interactive list item with shared row geometry and interaction states. */
7
+ export function ListItem(props) {
8
+ const { theme } = useTheme();
9
+ if (!props.onPress)
10
+ return renderStaticListItem(props, theme);
11
+ return renderInteractiveListItem({ ...props, onPress: props.onPress }, theme);
12
+ }
13
+ /*** Renders a non-pressable list item. */
14
+ function renderStaticListItem(props, theme) {
15
+ return (<ListItemContent {...props} backgroundColor={props.selected ? theme.semantics.selection.background : 'transparent'}/>);
16
+ }
17
+ /*** Renders a pressable list item with shared interaction-state presentation. */
18
+ function renderInteractiveListItem(props, theme) {
19
+ return (<ButtonBase accessibilityLabel={props.accessibilityLabel} accessibilityRole="button" accessibilityState={{ disabled: props.disabled ?? false, selected: props.selected ?? false }} disabled={props.disabled ?? false} interactionPolicy={props.interactionPolicy} onPress={props.onPress} testID={props.testID}>
20
+ {(state) => (<ListItemContent {...props} backgroundColor={resolveListItemBackground(theme, {
21
+ hovered: state.hovered,
22
+ pressed: state.pressed,
23
+ selected: props.selected ?? false,
24
+ })} disabled={state.disabled} testID={undefined}/>)}
25
+ </ButtonBase>);
26
+ }
27
+ /*** Resolves the neutral list-item background for one interaction state. */
28
+ function resolveListItemBackground(theme, state) {
29
+ if (state.pressed)
30
+ return theme.semantics.neutral.surfaceActive;
31
+ if (state.hovered)
32
+ return theme.semantics.neutral.surfaceHover;
33
+ if (state.selected)
34
+ return theme.semantics.selection.background;
35
+ return 'transparent';
36
+ }
37
+ /*** Renders the shared visual row content for static and interactive list items. */
38
+ function ListItemContent({ backgroundColor, children, compact = false, description, disabled = false, leading, testID, title, trailing, }) {
39
+ const content = children ?? renderDefaultContent(title, description);
40
+ return (<View align="center" bg={backgroundColor} direction="row" gap="m" opacity={disabled ? 0.72 : 1} px="m" py={compact ? 's' : 'm'} testID={testID}>
41
+ {leading !== undefined ? <View>{leading}</View> : null}
42
+ <View flex={1}>{content}</View>
43
+ {trailing !== undefined ? <View>{trailing}</View> : null}
44
+ </View>);
45
+ }
46
+ /*** Renders the default title and description content when custom children are absent. */
47
+ function renderDefaultContent(title, description) {
48
+ if (title === undefined && description === undefined)
49
+ return null;
50
+ return (<View flex={1} gap="xs">
51
+ {title !== undefined ? (<Text numberOfLines={1} variant="body" weight="medium">
52
+ {title}
53
+ </Text>) : null}
54
+ {description !== undefined ? (<Text emphasis="muted" numberOfLines={2} variant="bodySmall">
55
+ {description}
56
+ </Text>) : null}
57
+ </View>);
58
+ }
59
+ //# sourceMappingURL=ListItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.js","sourceRoot":"","sources":["../../../../../src/features/list/adapters/inbound/ListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAA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3B,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAC1D;UAAA,CAAC,WAAW,CACd;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 { ButtonBase } from '../../../../primitives/button-base';\nimport { useTheme } from '../../../../theme/ThemeContext';\nimport type { SurfaceTheme } from '../../../../theme/types';\nimport type { ListItemProps } from '../../../../types/list';\nimport { View } from '../../../layout/public';\nimport { Text } from '../../../typography/public';\n\n/*** Renders a static or interactive list item with shared row geometry and interaction states. */\nexport function ListItem(props: ListItemProps) {\n const { theme } = useTheme();\n if (!props.onPress) return renderStaticListItem(props, theme);\n return renderInteractiveListItem({ ...props, onPress: props.onPress }, theme);\n}\n\n/*** Renders a non-pressable list item. */\nfunction renderStaticListItem(props: ListItemProps, theme: SurfaceTheme) {\n return (\n <ListItemContent\n {...props}\n backgroundColor={props.selected ? theme.semantics.selection.background : 'transparent'}\n />\n );\n}\n\n/*** Renders a pressable list item with shared interaction-state presentation. */\nfunction renderInteractiveListItem(\n props: ListItemProps & { onPress: NonNullable<ListItemProps['onPress']> },\n theme: SurfaceTheme,\n) {\n return (\n <ButtonBase\n accessibilityLabel={props.accessibilityLabel}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: props.disabled ?? false, selected: props.selected ?? false }}\n disabled={props.disabled ?? false}\n interactionPolicy={props.interactionPolicy}\n onPress={props.onPress}\n testID={props.testID}\n >\n {(state) => (\n <ListItemContent\n {...props}\n backgroundColor={resolveListItemBackground(theme, {\n hovered: state.hovered,\n pressed: state.pressed,\n selected: props.selected ?? false,\n })}\n disabled={state.disabled}\n testID={undefined}\n />\n )}\n </ButtonBase>\n );\n}\n\ninterface ListItemBackgroundState {\n hovered: boolean;\n pressed: boolean;\n selected: boolean;\n}\n\ntype ListItemContentProps = Omit<\n ListItemProps,\n 'accessibilityLabel' | 'interactionPolicy' | 'onPress' | 'selected'\n> & {\n backgroundColor: string;\n};\n\n/*** Resolves the neutral list-item background for one interaction state. */\nfunction resolveListItemBackground(theme: SurfaceTheme, state: ListItemBackgroundState) {\n if (state.pressed) return theme.semantics.neutral.surfaceActive;\n if (state.hovered) return theme.semantics.neutral.surfaceHover;\n if (state.selected) return theme.semantics.selection.background;\n return 'transparent';\n}\n\n/*** Renders the shared visual row content for static and interactive list items. */\nfunction ListItemContent({\n backgroundColor,\n children,\n compact = false,\n description,\n disabled = false,\n leading,\n testID,\n title,\n trailing,\n}: ListItemContentProps) {\n const content = children ?? renderDefaultContent(title, description);\n\n return (\n <View\n align=\"center\"\n bg={backgroundColor}\n direction=\"row\"\n gap=\"m\"\n opacity={disabled ? 0.72 : 1}\n px=\"m\"\n py={compact ? 's' : 'm'}\n testID={testID}\n >\n {leading !== undefined ? <View>{leading}</View> : null}\n <View flex={1}>{content}</View>\n {trailing !== undefined ? <View>{trailing}</View> : null}\n </View>\n );\n}\n\n/*** Renders the default title and description content when custom children are absent. */\nfunction renderDefaultContent(title: React.ReactNode, description: React.ReactNode) {\n if (title === undefined && description === undefined) return null;\n return (\n <View flex={1} gap=\"xs\">\n {title !== undefined ? (\n <Text numberOfLines={1} variant=\"body\" weight=\"medium\">\n {title}\n </Text>\n ) : null}\n {description !== undefined ? (\n <Text emphasis=\"muted\" numberOfLines={2} variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </View>\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export type { ListItemProps, ListProps } from '../../types/list';
2
+ export { List } from './adapters/inbound/List';
3
+ export { ListItem } from './adapters/inbound/ListItem';
4
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/list/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { List } from './adapters/inbound/List';
2
+ export { ListItem } from './adapters/inbound/ListItem';
3
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/list/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export type { ListItemProps, ListProps } from '../../types/list';\nexport { List } from './adapters/inbound/List';\nexport { ListItem } from './adapters/inbound/ListItem';\n"]}
package/dist/index.d.ts CHANGED
@@ -1,15 +1,3 @@
1
- export type { FieldProps } from './components/field';
2
- export { Field } from './components/field';
3
- export type { HelperTextProps } from './components/helper-text';
4
- export { HelperText } from './components/helper-text';
5
- export type { LabelProps } from './components/label';
6
- export { Label } from './components/label';
7
- export type { ListItemProps } from './components/list-item';
8
- export { ListItem } from './components/list-item';
9
- export type { SwitchProps } from './components/switch';
10
- export { Switch } from './components/switch';
11
- export type { TextareaProps } from './components/textarea';
12
- export { Textarea } from './components/textarea';
13
1
  export type { FontRuntime } from './context/FontContext';
14
2
  export { FontProvider, useFontContext } from './context/FontContext';
15
3
  export type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';
@@ -27,8 +15,12 @@ export type { CardProps } from './features/card/public';
27
15
  export { Card } from './features/card/public';
28
16
  export type { CheckboxProps } from './features/form/checkbox/public';
29
17
  export { Checkbox } from './features/form/checkbox/public';
18
+ export type { FieldProps } from './features/form/field/public';
19
+ export { Field } from './features/form/field/public';
30
20
  export type { RadioProps } from './features/form/radio/public';
31
21
  export { Radio } from './features/form/radio/public';
22
+ export type { SwitchProps } from './features/form/switch/public';
23
+ export { Switch } from './features/form/switch/public';
32
24
  export type { TextInputProps } from './features/form/text-input/public';
33
25
  export { TextInput } from './features/form/text-input/public';
34
26
  export type { FontIconSource, IconProps, IconProvider, IconSource, IconVariant, SvgIconSource, } from './features/icon/public';
@@ -39,6 +31,8 @@ export type { KeyboardAvoidingViewBehavior, KeyboardAvoidingViewProps, } from '.
39
31
  export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
40
32
  export type { DividerProps, GridProps, ScrollViewProps, ViewProps } from './features/layout/public';
41
33
  export { Divider, Grid, ScrollView, View } from './features/layout/public';
34
+ export type { ListItemProps, ListProps } from './features/list/public';
35
+ export { List, ListItem } from './features/list/public';
42
36
  export type { ModalProps } from './features/modal/public';
43
37
  export { Modal } from './features/modal/public';
44
38
  export type { PopoverAnchorRenderProps, PopoverPlacement, PopoverProps, } from './features/popover/public';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,YAA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AAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AACtE,YAAY,EACV,eAAe,EACf,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACzE,YAAY,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAC7D,YAAY,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACrF,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EACV,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,3 @@
1
- export { Field } from './components/field';
2
- export { HelperText } from './components/helper-text';
3
- export { Label } from './components/label';
4
- export { ListItem } from './components/list-item';
5
- export { Switch } from './components/switch';
6
- export { Textarea } from './components/textarea';
7
1
  export { FontProvider, useFontContext } from './context/FontContext';
8
2
  export { TranslationProvider, useTranslationContext } from './context/TranslationContext';
9
3
  export * from './core/responsive';
@@ -13,12 +7,15 @@ export { Badge } from './features/badge/public';
13
7
  export { Button, IconButton } from './features/button/public';
14
8
  export { Card } from './features/card/public';
15
9
  export { Checkbox } from './features/form/checkbox/public';
10
+ export { Field } from './features/form/field/public';
16
11
  export { Radio } from './features/form/radio/public';
12
+ export { Switch } from './features/form/switch/public';
17
13
  export { TextInput } from './features/form/text-input/public';
18
14
  export { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';
19
15
  export { Image } from './features/image/public';
20
16
  export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
21
17
  export { Divider, Grid, ScrollView, View } from './features/layout/public';
18
+ export { List, ListItem } from './features/list/public';
22
19
  export { Modal } from './features/modal/public';
23
20
  export { Popover } from './features/popover/public';
24
21
  export { PopoverMenu } from './features/popover-menu/public';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAErE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1F,cAAc,mBAAmB,CAAC;AAUlC,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,2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,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export type { FieldProps } from './components/field';\nexport { Field } from './components/field';\nexport type { HelperTextProps } from './components/helper-text';\nexport { HelperText } from './components/helper-text';\nexport type { LabelProps } from './components/label';\nexport { Label } from './components/label';\nexport type { ListItemProps } from './components/list-item';\nexport { ListItem } from './components/list-item';\nexport type { SwitchProps } from './components/switch';\nexport { Switch } from './components/switch';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\nexport type { FontRuntime } from './context/FontContext';\nexport { FontProvider, useFontContext } from './context/FontContext';\nexport type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';\nexport { TranslationProvider, useTranslationContext } from './context/TranslationContext';\nexport * from './core/responsive';\nexport type {\n AccordionContentProps,\n AccordionItemProps,\n AccordionMode,\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n AccordionTriggerProps,\n} from './features/accordion/public';\nexport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from './features/accordion/public';\nexport type { AppBarProps } from './features/app-bar/public';\nexport { AppBar } from './features/app-bar/public';\nexport type { BadgeProps } from './features/badge/public';\nexport { Badge } from './features/badge/public';\nexport type { ButtonIconSpec, ButtonProps, IconButtonProps } from './features/button/public';\nexport { Button, IconButton } from './features/button/public';\nexport type { CardProps } from './features/card/public';\nexport { Card } from './features/card/public';\nexport type { CheckboxProps } from './features/form/checkbox/public';\nexport { Checkbox } from './features/form/checkbox/public';\nexport type { RadioProps } from './features/form/radio/public';\nexport { Radio } from './features/form/radio/public';\nexport type { TextInputProps } from './features/form/text-input/public';\nexport { TextInput } from './features/form/text-input/public';\nexport type {\n FontIconSource,\n IconProps,\n IconProvider,\n IconSource,\n IconVariant,\n SvgIconSource,\n} from './features/icon/public';\nexport { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';\nexport type { ImageFit, ImageProps, SurfaceImageSource } from './features/image/public';\nexport { Image } from './features/image/public';\nexport type {\n KeyboardAvoidingViewBehavior,\n KeyboardAvoidingViewProps,\n} from './features/keyboard-avoiding-view/public';\nexport { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';\nexport type { DividerProps, GridProps, ScrollViewProps, ViewProps } from './features/layout/public';\nexport { Divider, Grid, ScrollView, View } from './features/layout/public';\nexport type { ModalProps } from './features/modal/public';\nexport { Modal } from './features/modal/public';\nexport type {\n PopoverAnchorRenderProps,\n PopoverPlacement,\n PopoverProps,\n} from './features/popover/public';\nexport { Popover } from './features/popover/public';\nexport type {\n PopoverMenuAction,\n PopoverMenuActionIntent,\n PopoverMenuProps,\n} from './features/popover-menu/public';\nexport { PopoverMenu } from './features/popover-menu/public';\nexport type { SurfaceProps, SurfaceVariant } from './features/surface/public';\nexport { Surface } from './features/surface/public';\nexport type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';\nexport { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';\nexport type {\n ToastController,\n ToastOptions,\n ToastProps,\n ToastProviderProps,\n ToastStatus,\n} from './features/toast/public';\nexport { Toast, ToastProvider, useToast } from './features/toast/public';\nexport type { TooltipProps } from './features/tooltip/public';\nexport { Tooltip } from './features/tooltip/public';\nexport type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';\nexport { Heading, Text } from './features/typography/public';\nexport type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';\nexport type { ButtonBaseProps } from './primitives/button-base';\nexport { ButtonBase } from './primitives/button-base';\nexport type {\n SurfaceColor,\n SurfaceEmphasis,\n SurfacePaletteColor,\n SurfaceStatusColor,\n} from './surfaceColor';\nexport {\n SURFACE_COLORS,\n SURFACE_EMPHASES,\n SURFACE_PALETTE_COLORS,\n SURFACE_STATUS_COLORS,\n} from './surfaceColor';\nexport * from './theme';\nexport { isDeepEqual } from './utils/deepEqual';\nexport { deepMerge } from './ut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OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAQtE,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAG7D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAOtD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export type { FontRuntime } from './context/FontContext';\nexport { FontProvider, useFontContext } from './context/FontContext';\nexport type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';\nexport { TranslationProvider, useTranslationContext } from './context/TranslationContext';\nexport * from './core/responsive';\nexport type {\n AccordionContentProps,\n AccordionItemProps,\n AccordionMode,\n AccordionMultipleProps,\n AccordionProps,\n AccordionSingleProps,\n AccordionTriggerProps,\n} from './features/accordion/public';\nexport {\n Accordion,\n AccordionContent,\n AccordionItem,\n AccordionTrigger,\n} from './features/accordion/public';\nexport type { AppBarProps } from './features/app-bar/public';\nexport { AppBar } from './features/app-bar/public';\nexport type { BadgeProps } from './features/badge/public';\nexport { Badge } from './features/badge/public';\nexport type { ButtonIconSpec, ButtonProps, IconButtonProps } from './features/button/public';\nexport { Button, IconButton } from './features/button/public';\nexport type { CardProps } from './features/card/public';\nexport { Card } from './features/card/public';\nexport type { CheckboxProps } from './features/form/checkbox/public';\nexport { Checkbox } from './features/form/checkbox/public';\nexport type { FieldProps } from './features/form/field/public';\nexport { Field } from './features/form/field/public';\nexport type { RadioProps } from './features/form/radio/public';\nexport { Radio } from './features/form/radio/public';\nexport type { SwitchProps } from './features/form/switch/public';\nexport { Switch } from './features/form/switch/public';\nexport type { TextInputProps } from './features/form/text-input/public';\nexport { TextInput } from './features/form/text-input/public';\nexport type {\n FontIconSource,\n IconProps,\n IconProvider,\n IconSource,\n IconVariant,\n SvgIconSource,\n} from './features/icon/public';\nexport { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';\nexport type { ImageFit, ImageProps, SurfaceImageSource } from './features/image/public';\nexport { Image } from './features/image/public';\nexport type {\n KeyboardAvoidingViewBehavior,\n KeyboardAvoidingViewProps,\n} from './features/keyboard-avoiding-view/public';\nexport { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';\nexport type { DividerProps, GridProps, ScrollViewProps, ViewProps } from './features/layout/public';\nexport { Divider, Grid, ScrollView, View } from './features/layout/public';\nexport type { ListItemProps, ListProps } from './features/list/public';\nexport { List, ListItem } from './features/list/public';\nexport type { ModalProps } from './features/modal/public';\nexport { Modal } from './features/modal/public';\nexport type {\n PopoverAnchorRenderProps,\n PopoverPlacement,\n PopoverProps,\n} from './features/popover/public';\nexport { Popover } from './features/popover/public';\nexport type {\n PopoverMenuAction,\n PopoverMenuActionIntent,\n PopoverMenuProps,\n} from './features/popover-menu/public';\nexport { PopoverMenu } from './features/popover-menu/public';\nexport type { SurfaceProps, SurfaceVariant } from './features/surface/public';\nexport { Surface } from './features/surface/public';\nexport type { TabListProps, TabPanelProps, TabProps, TabsProps } from './features/tabs/public';\nexport { Tab, TabList, TabPanel, Tabs } from './features/tabs/public';\nexport type {\n ToastController,\n ToastOptions,\n ToastProps,\n ToastProviderProps,\n ToastStatus,\n} from './features/toast/public';\nexport { Toast, ToastProvider, useToast } from './features/toast/public';\nexport type { TooltipProps } from './features/tooltip/public';\nexport { Tooltip } from './features/tooltip/public';\nexport type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';\nexport { Heading, Text } from './features/typography/public';\nexport type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';\nexport type { ButtonBaseProps } from './primitives/button-base';\nexport { ButtonBase } from './primitives/button-base';\nexport type {\n SurfaceColor,\n SurfaceEmphasis,\n SurfacePaletteColor,\n SurfaceStatusColor,\n} from './surfaceColor';\nexport {\n SURFACE_COLORS,\n SURFACE_EMPHASES,\n SURFACE_PALETTE_COLORS,\n SURFACE_STATUS_COLORS,\n} from './surfaceColor';\nexport * from './theme';\nexport { isDeepEqual } from './utils/deepEqual';\nexport { deepMerge } from './utils/deepMerge';\n"]}
@@ -10,4 +10,4 @@ export interface FieldProps {
10
10
  readOnly?: boolean;
11
11
  testID?: string;
12
12
  }
13
- //# sourceMappingURL=types.d.ts.map
13
+ //# sourceMappingURL=field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/types/field.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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/types/field.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"]}
@@ -0,0 +1,20 @@
1
+ import type React from 'react';
2
+ import type { InteractionPolicyProps } from '../interactionPolicy';
3
+ export interface ListProps {
4
+ children?: React.ReactNode;
5
+ testID?: string;
6
+ }
7
+ export interface ListItemProps extends InteractionPolicyProps {
8
+ children?: React.ReactNode;
9
+ title?: React.ReactNode;
10
+ description?: React.ReactNode;
11
+ leading?: React.ReactNode;
12
+ trailing?: React.ReactNode;
13
+ onPress?: (() => void) | undefined;
14
+ disabled?: boolean;
15
+ selected?: boolean;
16
+ compact?: boolean;
17
+ accessibilityLabel?: string;
18
+ testID?: string;
19
+ }
20
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/types/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,sBAAsB;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,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,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/types/list.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { InteractionPolicyProps } from '../interactionPolicy';\n\nexport interface ListProps {\n children?: React.ReactNode;\n testID?: string;\n}\n\nexport interface ListItemProps extends InteractionPolicyProps {\n children?: React.ReactNode;\n title?: React.ReactNode;\n description?: React.ReactNode;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n onPress?: (() => void) | undefined;\n disabled?: boolean;\n selected?: boolean;\n compact?: boolean;\n accessibilityLabel?: string;\n testID?: string;\n}\n"]}