@ankhorage/surface 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/components/field/Field.js +1 -1
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/helper-text/HelperText.js +1 -1
- package/dist/components/helper-text/HelperText.js.map +1 -1
- package/dist/components/label/Label.js +1 -1
- package/dist/components/label/Label.js.map +1 -1
- package/dist/components/list-item/ListItem.js +2 -2
- package/dist/components/list-item/ListItem.js.map +1 -1
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/Menu.js +4 -2
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +2 -1
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/switch/Switch.js +2 -2
- package/dist/components/switch/Switch.js.map +1 -1
- package/dist/components/tabs/Tab.js +2 -2
- package/dist/components/tabs/Tab.js.map +1 -1
- package/dist/components/tabs/TabList.js +1 -1
- package/dist/components/tabs/TabList.js.map +1 -1
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/textarea/Textarea.js +1 -1
- package/dist/components/textarea/Textarea.js.map +1 -1
- package/dist/components/textarea/types.d.ts +1 -1
- package/dist/components/textarea/types.d.ts.map +1 -1
- package/dist/components/textarea/types.js.map +1 -1
- package/dist/components/toast/Toast.d.ts.map +1 -1
- package/dist/components/toast/Toast.js +4 -2
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components/toast/ToastProvider.js +1 -1
- package/dist/components/toast/ToastProvider.js.map +1 -1
- package/dist/components/tooltip/Tooltip.js +2 -2
- package/dist/components/tooltip/Tooltip.js.map +1 -1
- package/dist/examples/DocsExamples.js +6 -6
- package/dist/examples/DocsExamples.js.map +1 -1
- package/dist/features/accordion/adapters/inbound/Accordion.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/Accordion.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/Accordion.js +46 -0
- package/dist/features/accordion/adapters/inbound/Accordion.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.js +16 -0
- package/dist/features/accordion/adapters/inbound/AccordionContent.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.d.ts +4 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.js +3 -0
- package/dist/features/accordion/adapters/inbound/AccordionContext.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.js +28 -0
- package/dist/features/accordion/adapters/inbound/AccordionItem.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.d.ts +4 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.js +3 -0
- package/dist/features/accordion/adapters/inbound/AccordionItemContext.js.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.d.ts +5 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.d.ts.map +1 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.js +17 -0
- package/dist/features/accordion/adapters/inbound/AccordionTrigger.js.map +1 -0
- package/dist/features/accordion/public.d.ts +6 -0
- package/dist/features/accordion/public.d.ts.map +1 -0
- package/dist/features/accordion/public.js +5 -0
- package/dist/features/accordion/public.js.map +1 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.d.ts +11 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.d.ts.map +1 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.js +13 -0
- package/dist/features/accordion/utils/resolveAccordionToggle.js.map +1 -0
- package/dist/features/badge/adapters/inbound/Badge.d.ts +5 -0
- package/dist/features/badge/adapters/inbound/Badge.d.ts.map +1 -0
- package/dist/features/badge/adapters/inbound/Badge.js +30 -0
- package/dist/features/badge/adapters/inbound/Badge.js.map +1 -0
- package/dist/features/badge/public.d.ts +3 -0
- package/dist/features/badge/public.d.ts.map +1 -0
- package/dist/features/badge/public.js +2 -0
- package/dist/features/badge/public.js.map +1 -0
- package/dist/{components/button → features/button/adapters/inbound}/Button.d.ts +2 -1
- package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -0
- package/dist/features/button/adapters/inbound/Button.js +60 -0
- package/dist/features/button/adapters/inbound/Button.js.map +1 -0
- package/dist/{components/icon-button → features/button/adapters/inbound}/IconButton.d.ts +2 -1
- package/dist/features/button/adapters/inbound/IconButton.d.ts.map +1 -0
- package/dist/features/button/adapters/inbound/IconButton.js +33 -0
- package/dist/features/button/adapters/inbound/IconButton.js.map +1 -0
- package/dist/features/button/public.d.ts +4 -0
- package/dist/features/button/public.d.ts.map +1 -0
- package/dist/features/button/public.js +3 -0
- package/dist/features/button/public.js.map +1 -0
- package/dist/features/card/adapters/inbound/Card.d.ts +5 -0
- package/dist/features/card/adapters/inbound/Card.d.ts.map +1 -0
- package/dist/features/card/adapters/inbound/Card.js +44 -0
- package/dist/features/card/adapters/inbound/Card.js.map +1 -0
- package/dist/features/card/public.d.ts +3 -0
- package/dist/features/card/public.d.ts.map +1 -0
- package/dist/features/card/public.js +2 -0
- package/dist/features/card/public.js.map +1 -0
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.d.ts +5 -0
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.d.ts.map +1 -0
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js +88 -0
- package/dist/features/form/checkbox/adapters/inbound/Checkbox.js.map +1 -0
- package/dist/features/form/checkbox/public.d.ts +3 -0
- package/dist/features/form/checkbox/public.d.ts.map +1 -0
- package/dist/features/form/checkbox/public.js +2 -0
- package/dist/features/form/checkbox/public.js.map +1 -0
- package/dist/features/form/radio/adapters/inbound/Radio.d.ts +5 -0
- package/dist/features/form/radio/adapters/inbound/Radio.d.ts.map +1 -0
- package/dist/features/form/radio/adapters/inbound/Radio.js +91 -0
- package/dist/features/form/radio/adapters/inbound/Radio.js.map +1 -0
- package/dist/features/form/radio/public.d.ts +3 -0
- package/dist/features/form/radio/public.d.ts.map +1 -0
- package/dist/features/form/radio/public.js +2 -0
- package/dist/features/form/radio/public.js.map +1 -0
- package/dist/features/form/radio/utils/isRadioTextContent.d.ts +4 -0
- package/dist/features/form/radio/utils/isRadioTextContent.d.ts.map +1 -0
- package/dist/features/form/radio/utils/isRadioTextContent.js +5 -0
- package/dist/features/form/radio/utils/isRadioTextContent.js.map +1 -0
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts +5 -0
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -0
- package/dist/features/form/text-input/adapters/inbound/TextInput.js +41 -0
- package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -0
- package/dist/features/form/text-input/public.d.ts +3 -0
- package/dist/features/form/text-input/public.d.ts.map +1 -0
- package/dist/features/form/text-input/public.js +2 -0
- package/dist/features/form/text-input/public.js.map +1 -0
- package/dist/features/form/text-input/utils/resolveTextInputPresentation.d.ts +15 -0
- package/dist/features/form/text-input/utils/resolveTextInputPresentation.d.ts.map +1 -0
- package/dist/features/form/text-input/utils/resolveTextInputPresentation.js +56 -0
- package/dist/features/form/text-input/utils/resolveTextInputPresentation.js.map +1 -0
- package/dist/features/icon/adapters/inbound/Icon.d.ts +4 -0
- package/dist/features/icon/adapters/inbound/Icon.d.ts.map +1 -0
- package/dist/{primitives/icon → features/icon/adapters/inbound}/Icon.js +3 -3
- package/dist/features/icon/adapters/inbound/Icon.js.map +1 -0
- package/dist/features/icon/adapters/inbound/PortableIcon.d.ts +19 -0
- package/dist/features/icon/adapters/inbound/PortableIcon.d.ts.map +1 -0
- package/dist/{primitives/icon → features/icon/adapters/inbound}/PortableIcon.js +37 -43
- package/dist/features/icon/adapters/inbound/PortableIcon.js.map +1 -0
- package/dist/features/icon/constants.d.ts +2 -0
- package/dist/features/icon/constants.d.ts.map +1 -0
- package/dist/features/icon/constants.js +8 -0
- package/dist/features/icon/constants.js.map +1 -0
- package/dist/features/icon/public.d.ts +4 -0
- package/dist/features/icon/public.d.ts.map +1 -0
- package/dist/features/icon/public.js +3 -0
- package/dist/features/icon/public.js.map +1 -0
- package/dist/{primitives/image → features/image/adapters/inbound}/Image.d.ts +2 -1
- package/dist/features/image/adapters/inbound/Image.d.ts.map +1 -0
- package/dist/features/image/adapters/inbound/Image.js +28 -0
- package/dist/features/image/adapters/inbound/Image.js.map +1 -0
- package/dist/features/image/public.d.ts +3 -0
- package/dist/features/image/public.d.ts.map +1 -0
- package/dist/features/image/public.js +2 -0
- package/dist/features/image/public.js.map +1 -0
- package/dist/features/image/utils/getSourceKey.d.ts +4 -0
- package/dist/features/image/utils/getSourceKey.d.ts.map +1 -0
- package/dist/features/image/utils/getSourceKey.js +33 -0
- package/dist/features/image/utils/getSourceKey.js.map +1 -0
- package/dist/features/image/utils/normalizeSource.d.ts +5 -0
- package/dist/features/image/utils/normalizeSource.d.ts.map +1 -0
- package/dist/features/image/utils/normalizeSource.js +9 -0
- package/dist/features/image/utils/normalizeSource.js.map +1 -0
- package/dist/features/image/utils/resolveAccessibilityLabel.d.ts +4 -0
- package/dist/features/image/utils/resolveAccessibilityLabel.d.ts.map +1 -0
- package/dist/features/image/utils/resolveAccessibilityLabel.js +5 -0
- package/dist/features/image/utils/resolveAccessibilityLabel.js.map +1 -0
- package/dist/features/image/utils/resolveAlt.d.ts +4 -0
- package/dist/features/image/utils/resolveAlt.d.ts.map +1 -0
- package/dist/features/image/utils/resolveAlt.js +5 -0
- package/dist/features/image/utils/resolveAlt.js.map +1 -0
- package/dist/features/image/utils/resolveImageStyle.d.ts +6 -0
- package/dist/features/image/utils/resolveImageStyle.d.ts.map +1 -0
- package/dist/features/image/utils/resolveImageStyle.js +15 -0
- package/dist/features/image/utils/resolveImageStyle.js.map +1 -0
- package/dist/features/image/utils/resolveRenderedSource.d.ts +4 -0
- package/dist/features/image/utils/resolveRenderedSource.d.ts.map +1 -0
- package/dist/features/image/utils/resolveRenderedSource.js +7 -0
- package/dist/features/image/utils/resolveRenderedSource.js.map +1 -0
- package/dist/features/image/utils/resolveResizeMode.d.ts +5 -0
- package/dist/features/image/utils/resolveResizeMode.d.ts.map +1 -0
- package/dist/features/image/utils/resolveResizeMode.js +5 -0
- package/dist/features/image/utils/resolveResizeMode.js.map +1 -0
- package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.d.ts +5 -0
- package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.d.ts.map +1 -0
- package/dist/{layout → features/keyboard-avoiding-view/adapters/inbound}/KeyboardAvoidingView.js +2 -2
- package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.js.map +1 -0
- package/dist/features/keyboard-avoiding-view/public.d.ts +3 -0
- package/dist/features/keyboard-avoiding-view/public.d.ts.map +1 -0
- package/dist/features/keyboard-avoiding-view/public.js +2 -0
- package/dist/features/keyboard-avoiding-view/public.js.map +1 -0
- package/dist/features/layout/adapters/inbound/Box.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/Box.d.ts.map +1 -0
- package/dist/{layout → features/layout/adapters/inbound}/Box.js +5 -4
- package/dist/features/layout/adapters/inbound/Box.js.map +1 -0
- package/dist/features/layout/adapters/inbound/Container.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/Container.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/Container.js +28 -0
- package/dist/features/layout/adapters/inbound/Container.js.map +1 -0
- package/dist/features/layout/adapters/inbound/Divider.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/Divider.d.ts.map +1 -0
- package/dist/{layout → features/layout/adapters/inbound}/Divider.js +1 -0
- package/dist/features/layout/adapters/inbound/Divider.js.map +1 -0
- package/dist/features/layout/adapters/inbound/Grid.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/Grid.d.ts.map +1 -0
- package/dist/features/layout/adapters/inbound/Grid.js +48 -0
- package/dist/features/layout/adapters/inbound/Grid.js.map +1 -0
- package/dist/features/layout/adapters/inbound/Stack.d.ts +5 -0
- package/dist/features/layout/adapters/inbound/Stack.d.ts.map +1 -0
- package/dist/{layout → features/layout/adapters/inbound}/Stack.js +4 -3
- package/dist/features/layout/adapters/inbound/Stack.js.map +1 -0
- package/dist/features/layout/public.d.ts +7 -0
- package/dist/features/layout/public.d.ts.map +1 -0
- package/dist/features/layout/public.js +6 -0
- package/dist/features/layout/public.js.map +1 -0
- package/dist/features/surface/adapters/inbound/Surface.d.ts +5 -0
- package/dist/features/surface/adapters/inbound/Surface.d.ts.map +1 -0
- package/dist/{layout → features/surface/adapters/inbound}/Surface.js +17 -28
- package/dist/features/surface/adapters/inbound/Surface.js.map +1 -0
- package/dist/features/surface/public.d.ts +3 -0
- package/dist/features/surface/public.d.ts.map +1 -0
- package/dist/features/surface/public.js +2 -0
- package/dist/features/surface/public.js.map +1 -0
- package/dist/features/typography/adapters/inbound/Heading.d.ts +5 -0
- package/dist/features/typography/adapters/inbound/Heading.d.ts.map +1 -0
- package/dist/features/typography/adapters/inbound/Heading.js +29 -0
- package/dist/features/typography/adapters/inbound/Heading.js.map +1 -0
- package/dist/{primitives/text → features/typography/adapters/inbound}/Text.d.ts +2 -1
- package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -0
- package/dist/{primitives/text → features/typography/adapters/inbound}/Text.js +18 -25
- package/dist/features/typography/adapters/inbound/Text.js.map +1 -0
- package/dist/features/typography/public.d.ts +4 -0
- package/dist/features/typography/public.d.ts.map +1 -0
- package/dist/features/typography/public.js +3 -0
- package/dist/features/typography/public.js.map +1 -0
- package/dist/features/typography/utils/resolveHeadingTextStyle.d.ts +7 -0
- package/dist/features/typography/utils/resolveHeadingTextStyle.d.ts.map +1 -0
- package/dist/features/typography/utils/resolveHeadingTextStyle.js +10 -0
- package/dist/features/typography/utils/resolveHeadingTextStyle.js.map +1 -0
- package/dist/index.d.ts +26 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/layout/AppBar.d.ts +1 -1
- package/dist/layout/AppBar.d.ts.map +1 -1
- package/dist/layout/AppBar.js +1 -2
- package/dist/layout/AppBar.js.map +1 -1
- package/dist/layout/Center.d.ts +1 -1
- package/dist/layout/Center.d.ts.map +1 -1
- package/dist/layout/Center.js +1 -1
- package/dist/layout/Center.js.map +1 -1
- package/dist/layout/Inline.d.ts +1 -1
- package/dist/layout/Inline.d.ts.map +1 -1
- package/dist/layout/Inline.js +1 -1
- package/dist/layout/Inline.js.map +1 -1
- package/dist/layout/ScrollArea.d.ts +1 -1
- package/dist/layout/ScrollArea.d.ts.map +1 -1
- package/dist/layout/ScrollArea.js +1 -1
- package/dist/layout/ScrollArea.js.map +1 -1
- package/dist/layout/Spacer.d.ts +1 -1
- package/dist/layout/Spacer.d.ts.map +1 -1
- package/dist/layout/Spacer.js +1 -1
- package/dist/layout/Spacer.js.map +1 -1
- package/dist/layout/Template.d.ts +2 -2
- package/dist/layout/Template.d.ts.map +1 -1
- package/dist/layout/Template.js +2 -2
- package/dist/layout/Template.js.map +1 -1
- package/dist/layout/index.d.ts +0 -14
- package/dist/layout/index.d.ts.map +1 -1
- package/dist/layout/index.js +0 -7
- package/dist/layout/index.js.map +1 -1
- package/dist/primitives/button-base/ButtonBase.js +1 -1
- package/dist/primitives/button-base/ButtonBase.js.map +1 -1
- package/dist/primitives/button-base/types.d.ts +1 -1
- package/dist/primitives/button-base/types.d.ts.map +1 -1
- package/dist/primitives/button-base/types.js.map +1 -1
- package/dist/types/accordion.d.ts +54 -0
- package/dist/types/accordion.d.ts.map +1 -0
- package/dist/types/accordion.js +2 -0
- package/dist/types/accordion.js.map +1 -0
- package/dist/types/badge.d.ts +12 -0
- package/dist/types/badge.d.ts.map +1 -0
- package/dist/types/badge.js +2 -0
- package/dist/types/badge.js.map +1 -0
- package/dist/types/button.d.ts +25 -0
- package/dist/types/button.d.ts.map +1 -0
- package/dist/types/button.js +2 -0
- package/dist/types/button.js.map +1 -0
- package/dist/{components/card/types.d.ts → types/card.d.ts} +2 -2
- package/dist/types/card.d.ts.map +1 -0
- package/dist/types/card.js +2 -0
- package/dist/types/card.js.map +1 -0
- package/dist/{components/checkbox/types.d.ts → types/checkbox.d.ts} +4 -4
- package/dist/types/checkbox.d.ts.map +1 -0
- package/dist/types/checkbox.js +2 -0
- package/dist/types/checkbox.js.map +1 -0
- package/dist/types/icon.d.ts +66 -0
- package/dist/types/icon.d.ts.map +1 -0
- package/dist/types/icon.js +2 -0
- package/dist/types/icon.js.map +1 -0
- package/dist/{primitives/image/types.d.ts → types/image.d.ts} +3 -4
- package/dist/types/image.d.ts.map +1 -0
- package/dist/types/image.js +2 -0
- package/dist/types/image.js.map +1 -0
- package/dist/types/keyboard-avoiding-view.d.ts +4 -0
- package/dist/types/keyboard-avoiding-view.d.ts.map +1 -0
- package/dist/types/keyboard-avoiding-view.js +2 -0
- package/dist/types/keyboard-avoiding-view.js.map +1 -0
- package/dist/{layout/helpers.d.ts → types/layout.d.ts} +39 -5
- package/dist/types/layout.d.ts.map +1 -0
- package/dist/types/layout.js +2 -0
- package/dist/types/layout.js.map +1 -0
- package/dist/{components/radio/types.d.ts → types/radio.d.ts} +4 -4
- package/dist/types/radio.d.ts.map +1 -0
- package/dist/types/radio.js +2 -0
- package/dist/types/radio.js.map +1 -0
- package/dist/types/surface.d.ts +6 -0
- package/dist/types/surface.d.ts.map +1 -0
- package/dist/types/surface.js +2 -0
- package/dist/types/surface.js.map +1 -0
- package/dist/{components/text-input/types.d.ts → types/text-input.d.ts} +3 -3
- package/dist/types/text-input.d.ts.map +1 -0
- package/dist/types/text-input.js +2 -0
- package/dist/types/text-input.js.map +1 -0
- package/dist/types/typography.d.ts +29 -0
- package/dist/types/typography.d.ts.map +1 -0
- package/dist/types/typography.js +2 -0
- package/dist/types/typography.js.map +1 -0
- package/dist/utils/resolveBoxStyles.d.ts +7 -0
- package/dist/utils/resolveBoxStyles.d.ts.map +1 -0
- package/dist/utils/resolveBoxStyles.js +83 -0
- package/dist/utils/resolveBoxStyles.js.map +1 -0
- package/dist/utils/resolveSpacing.d.ts +5 -0
- package/dist/utils/resolveSpacing.d.ts.map +1 -0
- package/dist/utils/resolveSpacing.js +6 -0
- package/dist/utils/resolveSpacing.js.map +1 -0
- package/package.json +1 -1
- package/src/components/field/Field.tsx +1 -1
- package/src/components/helper-text/HelperText.tsx +1 -1
- package/src/components/label/Label.tsx +1 -1
- package/src/components/list-item/ListItem.tsx +2 -2
- package/src/components/menu/Menu.tsx +4 -2
- package/src/components/modal/Modal.tsx +2 -1
- package/src/components/switch/Switch.tsx +2 -2
- package/src/components/tabs/Tab.tsx +2 -2
- package/src/components/tabs/TabList.tsx +1 -1
- package/src/components/tabs/Tabs.tsx +1 -1
- package/src/components/textarea/Textarea.tsx +1 -1
- package/src/components/textarea/types.ts +1 -1
- package/src/components/toast/Toast.tsx +4 -2
- package/src/components/toast/ToastProvider.tsx +1 -1
- package/src/components/tooltip/Tooltip.tsx +2 -2
- package/src/examples/DocsExamples.tsx +6 -6
- package/src/features/accordion/adapters/inbound/Accordion.tsx +83 -0
- package/src/features/accordion/adapters/inbound/AccordionContent.tsx +30 -0
- package/src/features/accordion/adapters/inbound/AccordionContext.ts +5 -0
- package/src/features/accordion/adapters/inbound/AccordionItem.tsx +42 -0
- package/src/features/accordion/adapters/inbound/AccordionItemContext.ts +5 -0
- package/src/features/accordion/adapters/inbound/AccordionTrigger.tsx +34 -0
- package/src/features/accordion/public.ts +13 -0
- package/src/features/accordion/utils/resolveAccordionToggle.test.ts +57 -0
- package/src/features/accordion/utils/resolveAccordionToggle.ts +28 -0
- package/src/features/badge/adapters/inbound/Badge.tsx +58 -0
- package/src/features/badge/public.ts +2 -0
- package/src/features/button/adapters/inbound/Button.tsx +159 -0
- package/src/features/button/adapters/inbound/IconButton.tsx +69 -0
- package/src/features/button/public.ts +3 -0
- package/src/features/card/adapters/inbound/Card.tsx +88 -0
- package/src/features/card/public.ts +2 -0
- package/src/features/form/checkbox/adapters/inbound/Checkbox.tsx +207 -0
- package/src/features/form/checkbox/public.ts +2 -0
- package/src/{components/radio → features/form/radio/adapters/inbound}/Radio.test.ts +5 -5
- package/src/features/form/radio/adapters/inbound/Radio.tsx +214 -0
- package/src/features/form/radio/public.ts +2 -0
- package/src/{components/radio → features/form/radio/utils}/isRadioTextContent.ts +1 -3
- package/src/features/form/text-input/adapters/inbound/TextInput.tsx +72 -0
- package/src/features/form/text-input/public.ts +2 -0
- package/src/features/form/text-input/utils/resolveTextInputPresentation.ts +91 -0
- package/src/features/icon/adapters/inbound/Icon.tsx +14 -0
- package/src/{primitives/icon → features/icon/adapters/inbound}/PortableIcon.tsx +41 -97
- package/src/{primitives/icon → features/icon/adapters/inbound}/PortableIcon.web.test.tsx +6 -10
- package/src/features/icon/constants.ts +9 -0
- package/src/features/icon/public.ts +10 -0
- package/src/features/image/adapters/inbound/Image.tsx +55 -0
- package/src/features/image/public.ts +2 -0
- package/src/features/image/utils/getSourceKey.ts +32 -0
- package/src/features/image/utils/normalizeSource.ts +12 -0
- package/src/features/image/utils/resolveAccessibilityLabel.ts +9 -0
- package/src/features/image/utils/resolveAlt.ts +9 -0
- package/src/{primitives/image → features/image/utils}/resolveImageProps.test.ts +10 -22
- package/src/features/image/utils/resolveImageStyle.ts +23 -0
- package/src/features/image/utils/resolveRenderedSource.ts +11 -0
- package/src/features/image/utils/resolveResizeMode.ts +11 -0
- package/src/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.tsx +9 -0
- package/src/features/keyboard-avoiding-view/public.ts +5 -0
- package/src/{layout → features/layout/adapters/inbound}/Box.tsx +7 -15
- package/src/features/layout/adapters/inbound/Container.tsx +43 -0
- package/src/{layout → features/layout/adapters/inbound}/Divider.tsx +3 -8
- package/src/features/layout/adapters/inbound/Grid.tsx +78 -0
- package/src/{layout → features/layout/adapters/inbound}/Stack.test.ts +0 -1
- package/src/{layout → features/layout/adapters/inbound}/Stack.tsx +6 -15
- package/src/features/layout/public.ts +12 -0
- package/src/{layout → features/surface/adapters/inbound}/Surface.tsx +24 -41
- package/src/features/surface/public.ts +2 -0
- package/src/{primitives/heading → features/typography/adapters/inbound}/Heading.tsx +35 -38
- package/src/{primitives/text → features/typography/adapters/inbound}/Text.tsx +25 -35
- package/src/features/typography/public.ts +3 -0
- package/src/{primitives/heading/resolveHeadingStyle.test.ts → features/typography/utils/resolveHeadingTextStyle.test.ts} +5 -12
- package/src/features/typography/utils/resolveHeadingTextStyle.ts +21 -0
- package/src/index.test.ts +58 -28
- package/src/index.ts +52 -26
- package/src/layout/AppBar.tsx +1 -2
- package/src/layout/Center.tsx +1 -1
- package/src/layout/Inline.tsx +1 -1
- package/src/layout/ScrollArea.tsx +2 -1
- package/src/layout/Spacer.tsx +2 -2
- package/src/layout/Template.tsx +3 -2
- package/src/layout/index.ts +0 -17
- package/src/primitives/button-base/ButtonBase.tsx +1 -1
- package/src/primitives/button-base/types.ts +1 -1
- package/src/types/accordion.ts +69 -0
- package/src/{components/badge/types.ts → types/badge.ts} +3 -3
- package/src/types/button.ts +34 -0
- package/src/{components/card/types.ts → types/card.ts} +1 -1
- package/src/{components/checkbox/types.ts → types/checkbox.ts} +3 -3
- package/src/types/icon.ts +52 -0
- package/src/{primitives/image/types.ts → types/image.ts} +3 -3
- package/src/types/keyboard-avoiding-view.ts +6 -0
- package/src/types/layout.ts +96 -0
- package/src/{components/radio/types.ts → types/radio.ts} +3 -3
- package/src/types/surface.ts +7 -0
- package/src/{components/text-input/types.ts → types/text-input.ts} +2 -2
- package/src/types/typography.ts +32 -0
- package/src/{layout/helpers.test.ts → utils/resolveBoxStyles.test.ts} +8 -25
- package/src/utils/resolveBoxStyles.ts +135 -0
- package/src/utils/resolveSpacing.ts +11 -0
- package/src/webAcceptance.test.tsx +2 -3
- package/dist/components/badge/Badge.d.ts +0 -4
- package/dist/components/badge/Badge.d.ts.map +0 -1
- package/dist/components/badge/Badge.js +0 -30
- package/dist/components/badge/Badge.js.map +0 -1
- package/dist/components/badge/index.d.ts +0 -3
- package/dist/components/badge/index.d.ts.map +0 -1
- package/dist/components/badge/index.js +0 -2
- package/dist/components/badge/index.js.map +0 -1
- package/dist/components/badge/types.d.ts +0 -12
- package/dist/components/badge/types.d.ts.map +0 -1
- package/dist/components/badge/types.js +0 -2
- package/dist/components/badge/types.js.map +0 -1
- package/dist/components/button/Button.d.ts.map +0 -1
- package/dist/components/button/Button.js +0 -51
- package/dist/components/button/Button.js.map +0 -1
- package/dist/components/button/index.d.ts +0 -3
- package/dist/components/button/index.d.ts.map +0 -1
- package/dist/components/button/index.js +0 -2
- package/dist/components/button/index.js.map +0 -1
- package/dist/components/button/types.d.ts +0 -18
- package/dist/components/button/types.d.ts.map +0 -1
- package/dist/components/button/types.js +0 -2
- package/dist/components/button/types.js.map +0 -1
- package/dist/components/card/Card.d.ts +0 -4
- package/dist/components/card/Card.d.ts.map +0 -1
- package/dist/components/card/Card.js +0 -46
- package/dist/components/card/Card.js.map +0 -1
- package/dist/components/card/index.d.ts +0 -3
- package/dist/components/card/index.d.ts.map +0 -1
- package/dist/components/card/index.js +0 -2
- package/dist/components/card/index.js.map +0 -1
- package/dist/components/card/types.d.ts.map +0 -1
- package/dist/components/card/types.js +0 -2
- package/dist/components/card/types.js.map +0 -1
- package/dist/components/checkbox/Checkbox.d.ts +0 -4
- package/dist/components/checkbox/Checkbox.d.ts.map +0 -1
- package/dist/components/checkbox/Checkbox.js +0 -69
- package/dist/components/checkbox/Checkbox.js.map +0 -1
- package/dist/components/checkbox/index.d.ts +0 -3
- package/dist/components/checkbox/index.d.ts.map +0 -1
- package/dist/components/checkbox/index.js +0 -2
- package/dist/components/checkbox/index.js.map +0 -1
- package/dist/components/checkbox/types.d.ts.map +0 -1
- package/dist/components/checkbox/types.js +0 -2
- package/dist/components/checkbox/types.js.map +0 -1
- package/dist/components/icon-button/IconButton.d.ts.map +0 -1
- package/dist/components/icon-button/IconButton.js +0 -28
- package/dist/components/icon-button/IconButton.js.map +0 -1
- package/dist/components/icon-button/index.d.ts +0 -3
- package/dist/components/icon-button/index.d.ts.map +0 -1
- package/dist/components/icon-button/index.js +0 -2
- package/dist/components/icon-button/index.js.map +0 -1
- package/dist/components/icon-button/types.d.ts +0 -13
- package/dist/components/icon-button/types.d.ts.map +0 -1
- package/dist/components/icon-button/types.js +0 -2
- package/dist/components/icon-button/types.js.map +0 -1
- package/dist/components/radio/Radio.d.ts +0 -7
- package/dist/components/radio/Radio.d.ts.map +0 -1
- package/dist/components/radio/Radio.js +0 -75
- package/dist/components/radio/Radio.js.map +0 -1
- package/dist/components/radio/index.d.ts +0 -3
- package/dist/components/radio/index.d.ts.map +0 -1
- package/dist/components/radio/index.js +0 -2
- package/dist/components/radio/index.js.map +0 -1
- package/dist/components/radio/isRadioTextContent.d.ts +0 -6
- package/dist/components/radio/isRadioTextContent.d.ts.map +0 -1
- package/dist/components/radio/isRadioTextContent.js +0 -7
- package/dist/components/radio/isRadioTextContent.js.map +0 -1
- package/dist/components/radio/types.d.ts.map +0 -1
- package/dist/components/radio/types.js +0 -2
- package/dist/components/radio/types.js.map +0 -1
- package/dist/components/text-input/TextInput.d.ts +0 -4
- package/dist/components/text-input/TextInput.d.ts.map +0 -1
- package/dist/components/text-input/TextInput.js +0 -72
- package/dist/components/text-input/TextInput.js.map +0 -1
- package/dist/components/text-input/index.d.ts +0 -3
- package/dist/components/text-input/index.d.ts.map +0 -1
- package/dist/components/text-input/index.js +0 -2
- package/dist/components/text-input/index.js.map +0 -1
- package/dist/components/text-input/types.d.ts.map +0 -1
- package/dist/components/text-input/types.js +0 -2
- package/dist/components/text-input/types.js.map +0 -1
- package/dist/layout/Box.d.ts +0 -14
- package/dist/layout/Box.d.ts.map +0 -1
- package/dist/layout/Box.js.map +0 -1
- package/dist/layout/Container.d.ts +0 -11
- package/dist/layout/Container.d.ts.map +0 -1
- package/dist/layout/Container.js +0 -24
- package/dist/layout/Container.js.map +0 -1
- package/dist/layout/Divider.d.ts +0 -10
- package/dist/layout/Divider.d.ts.map +0 -1
- package/dist/layout/Divider.js.map +0 -1
- package/dist/layout/Grid.d.ts +0 -14
- package/dist/layout/Grid.d.ts.map +0 -1
- package/dist/layout/Grid.js +0 -51
- package/dist/layout/Grid.js.map +0 -1
- package/dist/layout/KeyboardAvoidingView.d.ts +0 -7
- package/dist/layout/KeyboardAvoidingView.d.ts.map +0 -1
- package/dist/layout/KeyboardAvoidingView.js.map +0 -1
- package/dist/layout/Stack.d.ts +0 -14
- package/dist/layout/Stack.d.ts.map +0 -1
- package/dist/layout/Stack.js.map +0 -1
- package/dist/layout/Surface.d.ts +0 -8
- package/dist/layout/Surface.d.ts.map +0 -1
- package/dist/layout/Surface.js.map +0 -1
- package/dist/layout/helpers.d.ts.map +0 -1
- package/dist/layout/helpers.js +0 -91
- package/dist/layout/helpers.js.map +0 -1
- package/dist/primitives/heading/Heading.d.ts +0 -4
- package/dist/primitives/heading/Heading.d.ts.map +0 -1
- package/dist/primitives/heading/Heading.js +0 -30
- package/dist/primitives/heading/Heading.js.map +0 -1
- package/dist/primitives/heading/index.d.ts +0 -3
- package/dist/primitives/heading/index.d.ts.map +0 -1
- package/dist/primitives/heading/index.js +0 -2
- package/dist/primitives/heading/index.js.map +0 -1
- package/dist/primitives/heading/resolveHeadingStyle.d.ts +0 -6
- package/dist/primitives/heading/resolveHeadingStyle.d.ts.map +0 -1
- package/dist/primitives/heading/resolveHeadingStyle.js +0 -9
- package/dist/primitives/heading/resolveHeadingStyle.js.map +0 -1
- package/dist/primitives/heading/types.d.ts +0 -15
- package/dist/primitives/heading/types.d.ts.map +0 -1
- package/dist/primitives/heading/types.js +0 -2
- package/dist/primitives/heading/types.js.map +0 -1
- package/dist/primitives/icon/Icon.d.ts +0 -16
- package/dist/primitives/icon/Icon.d.ts.map +0 -1
- package/dist/primitives/icon/Icon.js.map +0 -1
- package/dist/primitives/icon/PortableIcon.d.ts +0 -70
- package/dist/primitives/icon/PortableIcon.d.ts.map +0 -1
- package/dist/primitives/icon/PortableIcon.js.map +0 -1
- package/dist/primitives/icon/index.d.ts +0 -4
- package/dist/primitives/icon/index.d.ts.map +0 -1
- package/dist/primitives/icon/index.js +0 -3
- package/dist/primitives/icon/index.js.map +0 -1
- package/dist/primitives/image/Image.d.ts.map +0 -1
- package/dist/primitives/image/Image.js +0 -26
- package/dist/primitives/image/Image.js.map +0 -1
- package/dist/primitives/image/index.d.ts +0 -3
- package/dist/primitives/image/index.d.ts.map +0 -1
- package/dist/primitives/image/index.js +0 -2
- package/dist/primitives/image/index.js.map +0 -1
- package/dist/primitives/image/resolveImageProps.d.ts +0 -12
- package/dist/primitives/image/resolveImageProps.d.ts.map +0 -1
- package/dist/primitives/image/resolveImageProps.js +0 -67
- package/dist/primitives/image/resolveImageProps.js.map +0 -1
- package/dist/primitives/image/types.d.ts.map +0 -1
- package/dist/primitives/image/types.js +0 -2
- package/dist/primitives/image/types.js.map +0 -1
- package/dist/primitives/text/Text.d.ts.map +0 -1
- package/dist/primitives/text/Text.js.map +0 -1
- package/dist/primitives/text/index.d.ts +0 -3
- package/dist/primitives/text/index.d.ts.map +0 -1
- package/dist/primitives/text/index.js +0 -2
- package/dist/primitives/text/index.js.map +0 -1
- package/dist/primitives/text/types.d.ts +0 -17
- package/dist/primitives/text/types.d.ts.map +0 -1
- package/dist/primitives/text/types.js +0 -2
- package/dist/primitives/text/types.js.map +0 -1
- package/src/components/badge/Badge.tsx +0 -52
- package/src/components/badge/index.ts +0 -2
- package/src/components/button/Button.tsx +0 -98
- package/src/components/button/index.ts +0 -2
- package/src/components/button/types.ts +0 -23
- package/src/components/card/Card.tsx +0 -81
- package/src/components/card/index.ts +0 -2
- package/src/components/checkbox/Checkbox.tsx +0 -120
- package/src/components/checkbox/index.ts +0 -2
- package/src/components/icon-button/IconButton.tsx +0 -55
- package/src/components/icon-button/index.ts +0 -2
- package/src/components/icon-button/types.ts +0 -16
- package/src/components/radio/Radio.tsx +0 -124
- package/src/components/radio/index.ts +0 -2
- package/src/components/text-input/TextInput.tsx +0 -124
- package/src/components/text-input/index.ts +0 -2
- package/src/layout/Container.tsx +0 -43
- package/src/layout/Grid.tsx +0 -83
- package/src/layout/KeyboardAvoidingView.tsx +0 -16
- package/src/layout/helpers.ts +0 -205
- package/src/primitives/heading/index.ts +0 -2
- package/src/primitives/heading/resolveHeadingStyle.ts +0 -20
- package/src/primitives/heading/types.ts +0 -17
- package/src/primitives/icon/Icon.tsx +0 -34
- package/src/primitives/icon/index.ts +0 -10
- package/src/primitives/image/Image.tsx +0 -65
- package/src/primitives/image/index.ts +0 -2
- package/src/primitives/image/resolveImageProps.ts +0 -92
- package/src/primitives/text/index.ts +0 -2
- package/src/primitives/text/types.ts +0 -18
|
@@ -1,40 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Text } from 'react-native';
|
|
2
|
+
import { Text as ReactNativeText } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { useTranslationContext } from '
|
|
5
|
-
import { useTheme } from '
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
4
|
+
import { useTranslationContext } from '../../../../context/TranslationContext';
|
|
5
|
+
import { useTheme } from '../../../../theme/ThemeContext';
|
|
6
|
+
import type { HeadingProps } from '../../../../types/typography';
|
|
7
|
+
import { resolveHeadingTextStyle } from '../../utils/resolveHeadingTextStyle';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
children,
|
|
12
|
-
i18nKey,
|
|
13
|
-
translate,
|
|
14
|
-
}: {
|
|
15
|
-
text: HeadingProps['text'];
|
|
16
|
-
children: HeadingProps['children'];
|
|
17
|
-
i18nKey: HeadingProps['i18nKey'];
|
|
18
|
-
translate: (key: string) => string;
|
|
19
|
-
}) {
|
|
20
|
-
let content = text ?? children;
|
|
21
|
-
if (!i18nKey) {
|
|
22
|
-
return content;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
const translated = translate(i18nKey);
|
|
27
|
-
if (translated && translated !== i18nKey) {
|
|
28
|
-
content = translated;
|
|
29
|
-
}
|
|
30
|
-
} catch (error) {
|
|
31
|
-
console.warn('[Heading] Translation error:', error);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return content;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const Heading: React.FC<HeadingProps> = ({
|
|
9
|
+
/*** Renders a semantic, translatable heading using Surface typography tokens. */
|
|
10
|
+
export function Heading({
|
|
38
11
|
text,
|
|
39
12
|
children,
|
|
40
13
|
level = 2,
|
|
@@ -44,19 +17,43 @@ export const Heading: React.FC<HeadingProps> = ({
|
|
|
44
17
|
numberOfLines,
|
|
45
18
|
i18nKey,
|
|
46
19
|
testID,
|
|
47
|
-
})
|
|
20
|
+
}: HeadingProps) {
|
|
48
21
|
const { theme } = useTheme();
|
|
49
22
|
const { t } = useTranslationContext();
|
|
50
23
|
const content = resolveHeadingContent({ text, children, i18nKey, translate: t });
|
|
51
24
|
|
|
52
25
|
return (
|
|
53
|
-
<
|
|
26
|
+
<ReactNativeText
|
|
54
27
|
accessibilityRole="header"
|
|
55
28
|
testID={testID}
|
|
56
29
|
numberOfLines={numberOfLines}
|
|
57
30
|
style={resolveHeadingTextStyle(theme, level, align, emphasis, color)}
|
|
58
31
|
>
|
|
59
32
|
{content}
|
|
60
|
-
</
|
|
33
|
+
</ReactNativeText>
|
|
61
34
|
);
|
|
62
|
-
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/*** Resolves authored or translated heading content without mutating source input. */
|
|
38
|
+
function resolveHeadingContent({
|
|
39
|
+
text,
|
|
40
|
+
children,
|
|
41
|
+
i18nKey,
|
|
42
|
+
translate,
|
|
43
|
+
}: {
|
|
44
|
+
text: HeadingProps['text'];
|
|
45
|
+
children: HeadingProps['children'];
|
|
46
|
+
i18nKey: HeadingProps['i18nKey'];
|
|
47
|
+
translate: (key: string) => string;
|
|
48
|
+
}) {
|
|
49
|
+
const content = text ?? children;
|
|
50
|
+
if (!i18nKey) return content;
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
const translated = translate(i18nKey);
|
|
54
|
+
return translated && translated !== i18nKey ? translated : content;
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.warn('[Heading] Translation error:', error);
|
|
57
|
+
return content;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,33 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text as ReactNativeText } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { useTranslationContext } from '
|
|
5
|
-
import { resolveTextColor, resolveTextStyles } from '
|
|
6
|
-
import { useTheme } from '
|
|
7
|
-
import type { TextProps } from '
|
|
8
|
-
|
|
9
|
-
function resolveTextContent(
|
|
10
|
-
children: TextProps['children'],
|
|
11
|
-
i18nKey: TextProps['i18nKey'],
|
|
12
|
-
translate: (key: string) => string,
|
|
13
|
-
) {
|
|
14
|
-
if (children !== undefined) {
|
|
15
|
-
return children;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (!i18nKey) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
const translated = translate(i18nKey);
|
|
24
|
-
return translated && translated !== i18nKey ? translated : i18nKey;
|
|
25
|
-
} catch (error) {
|
|
26
|
-
console.warn('[Text] Translation error:', error);
|
|
27
|
-
return i18nKey;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
4
|
+
import { useTranslationContext } from '../../../../context/TranslationContext';
|
|
5
|
+
import { resolveTextColor, resolveTextStyles } from '../../../../internal/resolvers';
|
|
6
|
+
import { useTheme } from '../../../../theme/ThemeContext';
|
|
7
|
+
import type { TextProps } from '../../../../types/typography';
|
|
30
8
|
|
|
9
|
+
/*** Renders translatable body text using Surface semantic typography. */
|
|
31
10
|
export function Text({
|
|
32
11
|
children,
|
|
33
12
|
i18nKey,
|
|
@@ -49,18 +28,29 @@ export function Text({
|
|
|
49
28
|
numberOfLines={numberOfLines}
|
|
50
29
|
testID={testID}
|
|
51
30
|
style={[
|
|
52
|
-
resolveTextStyles(theme, {
|
|
53
|
-
|
|
54
|
-
italic,
|
|
55
|
-
variant,
|
|
56
|
-
weight,
|
|
57
|
-
}),
|
|
58
|
-
{
|
|
59
|
-
color: resolveTextColor(theme, emphasis, color),
|
|
60
|
-
},
|
|
31
|
+
resolveTextStyles(theme, { align, italic, variant, weight }),
|
|
32
|
+
{ color: resolveTextColor(theme, emphasis, color) },
|
|
61
33
|
]}
|
|
62
34
|
>
|
|
63
35
|
{content}
|
|
64
36
|
</ReactNativeText>
|
|
65
37
|
);
|
|
66
38
|
}
|
|
39
|
+
|
|
40
|
+
/*** Resolves authored or translated Text content with a stable fallback. */
|
|
41
|
+
function resolveTextContent(
|
|
42
|
+
children: TextProps['children'],
|
|
43
|
+
i18nKey: TextProps['i18nKey'],
|
|
44
|
+
translate: (key: string) => string,
|
|
45
|
+
) {
|
|
46
|
+
if (children !== undefined) return children;
|
|
47
|
+
if (!i18nKey) return null;
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
const translated = translate(i18nKey);
|
|
51
|
+
return translated && translated !== i18nKey ? translated : i18nKey;
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.warn('[Text] Translation error:', error);
|
|
54
|
+
return i18nKey;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
import { createTheme } from '
|
|
4
|
-
import { resolveHeadingTextStyle } from './
|
|
3
|
+
import { createTheme } from '../../../theme/createTheme';
|
|
4
|
+
import { resolveHeadingTextStyle } from './resolveHeadingTextStyle';
|
|
5
5
|
|
|
6
6
|
describe('resolveHeadingTextStyle', () => {
|
|
7
7
|
it('maps heading levels to theme-driven typography tokens', () => {
|
|
8
8
|
const theme = createTheme();
|
|
9
9
|
const style = resolveHeadingTextStyle(theme, 4, 'center');
|
|
10
|
-
|
|
11
10
|
expect(style.fontSize).toBe(18);
|
|
12
11
|
expect(style.lineHeight).toBe(24);
|
|
13
12
|
expect(style.fontWeight).toBe('600');
|
|
14
13
|
expect(style.color).toBe(theme.colors.text);
|
|
15
14
|
expect(style.textAlign).toBe('center');
|
|
16
15
|
});
|
|
17
|
-
|
|
18
16
|
it('uses the themed font family when one is configured', () => {
|
|
19
|
-
const
|
|
20
|
-
const style = resolveHeadingTextStyle(theme, 1);
|
|
21
|
-
|
|
17
|
+
const style = resolveHeadingTextStyle(createTheme(undefined, 'light', 'space grotesk'), 1);
|
|
22
18
|
expect(style.fontFamily).toBe('SpaceGrotesk_700Regular');
|
|
23
19
|
});
|
|
24
|
-
|
|
25
|
-
it('shares the default content emphasis with the text primitive', () => {
|
|
20
|
+
it('shares the default content emphasis with Text', () => {
|
|
26
21
|
const theme = createTheme();
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
expect(style.color).toBe(theme.semantics.content.default);
|
|
22
|
+
expect(resolveHeadingTextStyle(theme, 2).color).toBe(theme.semantics.content.default);
|
|
30
23
|
});
|
|
31
24
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TextStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { resolveTextColor } from '../../../internal/resolvers/resolveTextColor';
|
|
4
|
+
import { resolveTextStyles } from '../../../internal/resolvers/resolveTextStyles';
|
|
5
|
+
import type { SurfaceColor, SurfaceEmphasis } from '../../../surfaceColor';
|
|
6
|
+
import type { SurfaceTheme } from '../../../theme/types';
|
|
7
|
+
import type { HeadingLevel, HeadingProps } from '../../../types/typography';
|
|
8
|
+
|
|
9
|
+
/*** Resolves theme-driven typography styles for one heading level. */
|
|
10
|
+
export function resolveHeadingTextStyle(
|
|
11
|
+
theme: SurfaceTheme,
|
|
12
|
+
level: HeadingLevel,
|
|
13
|
+
align?: HeadingProps['align'],
|
|
14
|
+
emphasis: SurfaceEmphasis = 'default',
|
|
15
|
+
color?: SurfaceColor,
|
|
16
|
+
): TextStyle {
|
|
17
|
+
return {
|
|
18
|
+
...resolveTextStyles(theme, { align, level }),
|
|
19
|
+
color: resolveTextColor(theme, emphasis, color),
|
|
20
|
+
};
|
|
21
|
+
}
|
package/src/index.test.ts
CHANGED
|
@@ -17,39 +17,79 @@ const packageJson = JSON.parse(
|
|
|
17
17
|
peerDependencies: Record<string, string>;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
"export { Badge } from './
|
|
22
|
-
"export { Button } from './
|
|
23
|
-
"export { Card } from './
|
|
24
|
-
"export { Checkbox } from './
|
|
20
|
+
const expectedFeatureRootExports = [
|
|
21
|
+
"export { Badge } from './features/badge/public';",
|
|
22
|
+
"export { Button, IconButton } from './features/button/public';",
|
|
23
|
+
"export { Card } from './features/card/public';",
|
|
24
|
+
"export { Checkbox } from './features/form/checkbox/public';",
|
|
25
|
+
"export { Radio } from './features/form/radio/public';",
|
|
26
|
+
"export { TextInput } from './features/form/text-input/public';",
|
|
27
|
+
"export { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';",
|
|
28
|
+
"export { Image } from './features/image/public';",
|
|
29
|
+
"export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';",
|
|
30
|
+
"export { Box, Container, Divider, Grid, Stack } from './features/layout/public';",
|
|
31
|
+
"export { Surface } from './features/surface/public';",
|
|
32
|
+
"export { Heading, Text } from './features/typography/public';",
|
|
33
|
+
] as const;
|
|
34
|
+
|
|
35
|
+
const expectedLegacyRootExports = [
|
|
25
36
|
"export { Field } from './components/field';",
|
|
26
37
|
"export { HelperText } from './components/helper-text';",
|
|
27
|
-
"export { IconButton } from './components/icon-button';",
|
|
28
|
-
"export { Icon, SUPPORTED_ICON_PROVIDERS } from './primitives/icon';",
|
|
29
|
-
"export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';",
|
|
30
38
|
"export { Label } from './components/label';",
|
|
31
39
|
"export { ListItem } from './components/list-item';",
|
|
32
40
|
"export { Menu } from './components/menu';",
|
|
33
41
|
"export { Modal } from './components/modal';",
|
|
34
|
-
"export { Radio } from './components/radio';",
|
|
35
42
|
"export { Switch } from './components/switch';",
|
|
36
43
|
"export { Tab, TabList, TabPanel, Tabs } from './components/tabs';",
|
|
37
|
-
"export { TextInput } from './components/text-input';",
|
|
38
44
|
"export { Textarea } from './components/textarea';",
|
|
39
45
|
"export { Toast, ToastProvider, useToast } from './components/toast';",
|
|
40
46
|
"export { Tooltip } from './components/tooltip';",
|
|
47
|
+
"export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';",
|
|
41
48
|
"export * from './core/responsive';",
|
|
42
49
|
"export * from './layout';",
|
|
43
|
-
"export { Image } from './primitives/image';",
|
|
44
|
-
"export {\n SURFACE_COLORS,\n SURFACE_EMPHASES,\n SURFACE_PALETTE_COLORS,\n SURFACE_STATUS_COLORS,\n} from './surfaceColor';",
|
|
45
|
-
"export * from './theme';",
|
|
46
50
|
] as const;
|
|
47
51
|
|
|
48
|
-
describe('
|
|
49
|
-
it('
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
describe('feature-owned root barrel contract', () => {
|
|
53
|
+
it('routes migrated UI through feature-owned public facades', () => {
|
|
54
|
+
expectedFeatureRootExports.forEach((line) => expect(indexSource).toContain(line));
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('does not retain migrated UI exports from legacy component or primitive paths', () => {
|
|
58
|
+
for (const legacyPath of [
|
|
59
|
+
'./components/badge',
|
|
60
|
+
'./components/button',
|
|
61
|
+
'./components/card',
|
|
62
|
+
'./components/checkbox',
|
|
63
|
+
'./components/icon-button',
|
|
64
|
+
'./components/radio',
|
|
65
|
+
'./components/text-input',
|
|
66
|
+
'./primitives/heading',
|
|
67
|
+
'./primitives/icon',
|
|
68
|
+
'./primitives/image',
|
|
69
|
+
'./primitives/text',
|
|
70
|
+
]) {
|
|
71
|
+
expect(indexSource).not.toContain(legacyPath);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('removes migrated elements from the legacy layout facade', () => {
|
|
76
|
+
for (const name of [
|
|
77
|
+
'Box',
|
|
78
|
+
'Container',
|
|
79
|
+
'Divider',
|
|
80
|
+
'Grid',
|
|
81
|
+
'KeyboardAvoidingView',
|
|
82
|
+
'Stack',
|
|
83
|
+
'Surface',
|
|
84
|
+
]) {
|
|
85
|
+
expect(layoutIndexSource).not.toContain(`./${name}`);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
describe('remaining root barrel contract', () => {
|
|
91
|
+
it('keeps still-unmigrated UI on its current public API until its feature migration', () => {
|
|
92
|
+
expectedLegacyRootExports.forEach((line) => expect(indexSource).toContain(line));
|
|
53
93
|
});
|
|
54
94
|
|
|
55
95
|
it('does not retain obsolete action-sheet, drawer, or navigation chrome', () => {
|
|
@@ -75,19 +115,9 @@ describe('public root barrel contract', () => {
|
|
|
75
115
|
const theme = createTheme();
|
|
76
116
|
const selection: SelectionSemantics = theme.semantics.selection;
|
|
77
117
|
const diagnostics: SurfaceColorDiagnostics = theme.colorDiagnostics;
|
|
78
|
-
|
|
79
118
|
expect(selection.background).toBeDefined();
|
|
80
119
|
expect(diagnostics.generated.swatches).toBe(theme.swatches);
|
|
81
120
|
});
|
|
82
|
-
|
|
83
|
-
it('publishes KeyboardAvoidingView through the root layout facade', () => {
|
|
84
|
-
expect(indexSource).toContain("export * from './layout';");
|
|
85
|
-
expect(layoutIndexSource).toContain(
|
|
86
|
-
"export { KeyboardAvoidingView } from './KeyboardAvoidingView';",
|
|
87
|
-
);
|
|
88
|
-
expect(layoutIndexSource).toContain('KeyboardAvoidingViewProps');
|
|
89
|
-
expect(layoutIndexSource).toContain('KeyboardAvoidingViewBehavior');
|
|
90
|
-
});
|
|
91
121
|
});
|
|
92
122
|
|
|
93
123
|
describe('public package metadata contract', () => {
|
package/src/index.ts
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
export type { BadgeProps } from './components/badge';
|
|
2
|
-
export { Badge } from './components/badge';
|
|
3
|
-
export type { ButtonIconSpec, ButtonProps } from './components/button';
|
|
4
|
-
export { Button } from './components/button';
|
|
5
|
-
export type { CardProps } from './components/card';
|
|
6
|
-
export { Card } from './components/card';
|
|
7
|
-
export type { CheckboxProps } from './components/checkbox';
|
|
8
|
-
export { Checkbox } from './components/checkbox';
|
|
9
1
|
export type { FieldProps } from './components/field';
|
|
10
2
|
export { Field } from './components/field';
|
|
11
3
|
export type { HelperTextProps } from './components/helper-text';
|
|
12
4
|
export { HelperText } from './components/helper-text';
|
|
13
|
-
export type { IconButtonProps } from './components/icon-button';
|
|
14
|
-
export { IconButton } from './components/icon-button';
|
|
15
5
|
export type { LabelProps } from './components/label';
|
|
16
6
|
export { Label } from './components/label';
|
|
17
7
|
export type { ListItemProps } from './components/list-item';
|
|
@@ -20,14 +10,10 @@ export type { MenuAction, MenuActionIntent, MenuItem, MenuProps } from './compon
|
|
|
20
10
|
export { Menu } from './components/menu';
|
|
21
11
|
export type { ModalProps } from './components/modal';
|
|
22
12
|
export { Modal } from './components/modal';
|
|
23
|
-
export type { RadioProps } from './components/radio';
|
|
24
|
-
export { Radio } from './components/radio';
|
|
25
13
|
export type { SwitchProps } from './components/switch';
|
|
26
14
|
export { Switch } from './components/switch';
|
|
27
15
|
export type { TabListProps, TabPanelProps, TabProps, TabsProps } from './components/tabs';
|
|
28
16
|
export { Tab, TabList, TabPanel, Tabs } from './components/tabs';
|
|
29
|
-
export type { TextInputProps } from './components/text-input';
|
|
30
|
-
export { TextInput } from './components/text-input';
|
|
31
17
|
export type { TextareaProps } from './components/textarea';
|
|
32
18
|
export { Textarea } from './components/textarea';
|
|
33
19
|
export type { ToastOptions, ToastProps, ToastStatus } from './components/toast';
|
|
@@ -39,12 +25,33 @@ export { FontProvider, useFontContext } from './context/FontContext';
|
|
|
39
25
|
export type { I18nInstance, TranslationRuntime, Translator } from './context/TranslationContext';
|
|
40
26
|
export { TranslationProvider, useTranslationContext } from './context/TranslationContext';
|
|
41
27
|
export * from './core/responsive';
|
|
42
|
-
export type {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
export type {
|
|
29
|
+
AccordionContentProps,
|
|
30
|
+
AccordionItemProps,
|
|
31
|
+
AccordionMode,
|
|
32
|
+
AccordionMultipleProps,
|
|
33
|
+
AccordionProps,
|
|
34
|
+
AccordionSingleProps,
|
|
35
|
+
AccordionTriggerProps,
|
|
36
|
+
} from './features/accordion/public';
|
|
37
|
+
export {
|
|
38
|
+
Accordion,
|
|
39
|
+
AccordionContent,
|
|
40
|
+
AccordionItem,
|
|
41
|
+
AccordionTrigger,
|
|
42
|
+
} from './features/accordion/public';
|
|
43
|
+
export type { BadgeProps } from './features/badge/public';
|
|
44
|
+
export { Badge } from './features/badge/public';
|
|
45
|
+
export type { ButtonIconSpec, ButtonProps, IconButtonProps } from './features/button/public';
|
|
46
|
+
export { Button, IconButton } from './features/button/public';
|
|
47
|
+
export type { CardProps } from './features/card/public';
|
|
48
|
+
export { Card } from './features/card/public';
|
|
49
|
+
export type { CheckboxProps } from './features/form/checkbox/public';
|
|
50
|
+
export { Checkbox } from './features/form/checkbox/public';
|
|
51
|
+
export type { RadioProps } from './features/form/radio/public';
|
|
52
|
+
export { Radio } from './features/form/radio/public';
|
|
53
|
+
export type { TextInputProps } from './features/form/text-input/public';
|
|
54
|
+
export { TextInput } from './features/form/text-input/public';
|
|
48
55
|
export type {
|
|
49
56
|
FontIconSource,
|
|
50
57
|
IconProps,
|
|
@@ -52,12 +59,31 @@ export type {
|
|
|
52
59
|
IconSource,
|
|
53
60
|
IconVariant,
|
|
54
61
|
SvgIconSource,
|
|
55
|
-
} from './
|
|
56
|
-
export { Icon, SUPPORTED_ICON_PROVIDERS } from './
|
|
57
|
-
export type { ImageFit, ImageProps, SurfaceImageSource } from './
|
|
58
|
-
export { Image } from './
|
|
59
|
-
export type {
|
|
60
|
-
|
|
62
|
+
} from './features/icon/public';
|
|
63
|
+
export { Icon, SUPPORTED_ICON_PROVIDERS } from './features/icon/public';
|
|
64
|
+
export type { ImageFit, ImageProps, SurfaceImageSource } from './features/image/public';
|
|
65
|
+
export { Image } from './features/image/public';
|
|
66
|
+
export type {
|
|
67
|
+
KeyboardAvoidingViewBehavior,
|
|
68
|
+
KeyboardAvoidingViewProps,
|
|
69
|
+
} from './features/keyboard-avoiding-view/public';
|
|
70
|
+
export { KeyboardAvoidingView } from './features/keyboard-avoiding-view/public';
|
|
71
|
+
export type {
|
|
72
|
+
BoxProps,
|
|
73
|
+
ContainerProps,
|
|
74
|
+
DividerProps,
|
|
75
|
+
GridProps,
|
|
76
|
+
StackProps,
|
|
77
|
+
} from './features/layout/public';
|
|
78
|
+
export { Box, Container, Divider, Grid, Stack } from './features/layout/public';
|
|
79
|
+
export type { SurfaceProps, SurfaceVariant } from './features/surface/public';
|
|
80
|
+
export { Surface } from './features/surface/public';
|
|
81
|
+
export type { HeadingLevel, HeadingProps, TextProps } from './features/typography/public';
|
|
82
|
+
export { Heading, Text } from './features/typography/public';
|
|
83
|
+
export type { InteractionPolicy, InteractionPolicyProps } from './interactionPolicy';
|
|
84
|
+
export * from './layout';
|
|
85
|
+
export type { ButtonBaseProps } from './primitives/button-base';
|
|
86
|
+
export { ButtonBase } from './primitives/button-base';
|
|
61
87
|
export type {
|
|
62
88
|
SurfaceColor,
|
|
63
89
|
SurfaceEmphasis,
|
package/src/layout/AppBar.tsx
CHANGED
|
@@ -2,9 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { type StyleProp, View, type ViewStyle } from 'react-native';
|
|
3
3
|
import { SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
|
+
import { Box, type BoxProps, Divider } from '../features/layout/public';
|
|
5
6
|
import { useTheme } from '../theme/ThemeContext';
|
|
6
|
-
import { Box, type BoxProps } from './Box';
|
|
7
|
-
import { Divider } from './Divider';
|
|
8
7
|
|
|
9
8
|
export interface AppBarProps extends Omit<BoxProps, 'children'> {
|
|
10
9
|
leading?: React.ReactNode;
|
package/src/layout/Center.tsx
CHANGED
package/src/layout/Inline.tsx
CHANGED
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import { useResponsiveRuntime } from '../core/responsive';
|
|
10
10
|
import { useTheme } from '../theme/ThemeContext';
|
|
11
|
-
import {
|
|
11
|
+
import type { BoxStyleProps } from '../types/layout';
|
|
12
|
+
import { resolveBoxStyles } from '../utils/resolveBoxStyles';
|
|
12
13
|
|
|
13
14
|
export interface ScrollAreaProps
|
|
14
15
|
extends
|
package/src/layout/Spacer.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { Box } from '
|
|
4
|
-
import type { SpaceValue } from '
|
|
3
|
+
import { Box } from '../features/layout/public';
|
|
4
|
+
import type { SpaceValue } from '../types/layout';
|
|
5
5
|
|
|
6
6
|
export interface SpacerProps {
|
|
7
7
|
size?: SpaceValue;
|
package/src/layout/Template.tsx
CHANGED
|
@@ -7,9 +7,10 @@ import {
|
|
|
7
7
|
type Responsive,
|
|
8
8
|
useResponsiveRuntime,
|
|
9
9
|
} from '../core/responsive';
|
|
10
|
+
import { Box, type BoxProps } from '../features/layout/public';
|
|
10
11
|
import { useTheme } from '../theme/ThemeContext';
|
|
11
|
-
import {
|
|
12
|
-
import { resolveSpacing
|
|
12
|
+
import type { SpaceValue } from '../types/layout';
|
|
13
|
+
import { resolveSpacing } from '../utils/resolveSpacing';
|
|
13
14
|
|
|
14
15
|
type SlotMap = Record<string, React.ReactNode>;
|
|
15
16
|
type TemplateMap = Partial<Record<Breakpoint, string[][]>>;
|
package/src/layout/index.ts
CHANGED
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
export type { AppBarProps } from './AppBar';
|
|
2
2
|
export { AppBar } from './AppBar';
|
|
3
|
-
export type { BoxProps } from './Box';
|
|
4
|
-
export { Box } from './Box';
|
|
5
3
|
export type { CenterProps } from './Center';
|
|
6
4
|
export { Center } from './Center';
|
|
7
|
-
export type { ContainerProps } from './Container';
|
|
8
|
-
export { Container } from './Container';
|
|
9
|
-
export type { DividerProps } from './Divider';
|
|
10
|
-
export { Divider } from './Divider';
|
|
11
|
-
export type { GridProps } from './Grid';
|
|
12
|
-
export { Grid } from './Grid';
|
|
13
5
|
export type { InlineProps } from './Inline';
|
|
14
6
|
export { Inline } from './Inline';
|
|
15
|
-
export type {
|
|
16
|
-
KeyboardAvoidingViewBehavior,
|
|
17
|
-
KeyboardAvoidingViewProps,
|
|
18
|
-
} from './KeyboardAvoidingView';
|
|
19
|
-
export { KeyboardAvoidingView } from './KeyboardAvoidingView';
|
|
20
7
|
export type { ScrollAreaProps } from './ScrollArea';
|
|
21
8
|
export { ScrollArea } from './ScrollArea';
|
|
22
9
|
export type { ShowProps } from './Show';
|
|
23
10
|
export { Show } from './Show';
|
|
24
11
|
export type { SpacerProps } from './Spacer';
|
|
25
12
|
export { Spacer } from './Spacer';
|
|
26
|
-
export type { StackProps } from './Stack';
|
|
27
|
-
export { Stack } from './Stack';
|
|
28
|
-
export type { SurfaceProps, SurfaceVariant } from './Surface';
|
|
29
|
-
export { Surface } from './Surface';
|
|
30
13
|
export type { TemplateProps } from './Template';
|
|
31
14
|
export { Template } from './Template';
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
resolveFocusRingStyles,
|
|
8
8
|
resolveInteractiveState,
|
|
9
9
|
} from '../../internal/resolvers';
|
|
10
|
-
import { resolveBoxStyles } from '../../layout/helpers';
|
|
11
10
|
import { useTheme } from '../../theme/ThemeContext';
|
|
11
|
+
import { resolveBoxStyles } from '../../utils/resolveBoxStyles';
|
|
12
12
|
import type { ButtonBaseProps } from './types';
|
|
13
13
|
|
|
14
14
|
function getInteractionState(
|
|
@@ -3,7 +3,7 @@ import type { AccessibilityRole, AccessibilityState, GestureResponderEvent } fro
|
|
|
3
3
|
|
|
4
4
|
import type { InteractionPolicyProps } from '../../interactionPolicy';
|
|
5
5
|
import type { InteractionState } from '../../internal/resolvers/resolveInteractiveState';
|
|
6
|
-
import type { BoxProps } from '../../layout';
|
|
6
|
+
import type { BoxProps } from '../../types/layout';
|
|
7
7
|
|
|
8
8
|
export interface ButtonBaseProps
|
|
9
9
|
extends Omit<BoxProps, 'children' | 'pointerEvents'>, InteractionPolicyProps {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { InteractionPolicy, InteractionPolicyProps } from '../interactionPolicy';
|
|
5
|
+
|
|
6
|
+
export type AccordionMode = 'single' | 'multiple';
|
|
7
|
+
|
|
8
|
+
interface AccordionBaseProps extends Omit<ViewProps, 'children'>, InteractionPolicyProps {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface AccordionSingleProps extends AccordionBaseProps {
|
|
14
|
+
type?: 'single';
|
|
15
|
+
value?: string;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
onValueChange?: (value: string | undefined) => void;
|
|
18
|
+
collapsible?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface AccordionMultipleProps extends AccordionBaseProps {
|
|
22
|
+
type: 'multiple';
|
|
23
|
+
value?: readonly string[];
|
|
24
|
+
defaultValue?: readonly string[];
|
|
25
|
+
onValueChange?: (value: readonly string[]) => void;
|
|
26
|
+
collapsible?: never;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type AccordionProps = AccordionSingleProps | AccordionMultipleProps;
|
|
30
|
+
|
|
31
|
+
export interface AccordionItemProps extends Omit<ViewProps, 'children'>, InteractionPolicyProps {
|
|
32
|
+
value: string;
|
|
33
|
+
children?: React.ReactNode;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface AccordionTriggerProps
|
|
38
|
+
extends
|
|
39
|
+
Omit<
|
|
40
|
+
PressableProps,
|
|
41
|
+
'accessibilityRole' | 'accessibilityState' | 'children' | 'disabled' | 'onPress'
|
|
42
|
+
>,
|
|
43
|
+
InteractionPolicyProps {
|
|
44
|
+
children?: PressableProps['children'];
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface AccordionContentProps extends Omit<ViewProps, 'children'> {
|
|
49
|
+
children?: React.ReactNode;
|
|
50
|
+
forceMount?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface AccordionContextValue {
|
|
54
|
+
disabled: boolean;
|
|
55
|
+
interactionPolicy: InteractionPolicy;
|
|
56
|
+
mode: AccordionMode;
|
|
57
|
+
openValues: readonly string[];
|
|
58
|
+
toggleValue: (value: string) => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface AccordionItemContextValue {
|
|
62
|
+
contentId: string;
|
|
63
|
+
disabled: boolean;
|
|
64
|
+
interactionPolicy: InteractionPolicy;
|
|
65
|
+
open: boolean;
|
|
66
|
+
toggle: () => void;
|
|
67
|
+
triggerId: string;
|
|
68
|
+
value: string;
|
|
69
|
+
}
|