@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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { resolveControlSize, resolveFieldState, resolveInputColors, resolveTextStyles, } from '../../../../internal/resolvers';
|
|
2
|
+
/*** Resolves layout, colors, and editability for one TextInput state. */
|
|
3
|
+
export function resolveTextInputPresentation(theme, props, focused) {
|
|
4
|
+
const controlSize = resolveControlSize(theme, props.size ?? 'm');
|
|
5
|
+
const disabled = props.disabled ?? false;
|
|
6
|
+
const readOnly = props.readOnly ?? false;
|
|
7
|
+
const fieldState = resolveFieldState({
|
|
8
|
+
disabled,
|
|
9
|
+
focused,
|
|
10
|
+
invalid: props.invalid ?? false,
|
|
11
|
+
readOnly,
|
|
12
|
+
});
|
|
13
|
+
const colors = resolveInputColors(theme, fieldState);
|
|
14
|
+
const textStyle = resolveTextStyles(theme, { variant: controlSize.textVariant });
|
|
15
|
+
const heights = resolveTextInputHeights(controlSize, props.multiline, props.numberOfLines, textStyle.lineHeight);
|
|
16
|
+
return {
|
|
17
|
+
accessorySpacing: theme.spacing.s,
|
|
18
|
+
containerStyle: {
|
|
19
|
+
alignItems: props.multiline ? 'flex-start' : 'center',
|
|
20
|
+
backgroundColor: colors.backgroundColor,
|
|
21
|
+
borderColor: colors.borderColor,
|
|
22
|
+
borderRadius: controlSize.borderRadius,
|
|
23
|
+
borderWidth: 1,
|
|
24
|
+
flexDirection: 'row',
|
|
25
|
+
minHeight: heights.container,
|
|
26
|
+
opacity: colors.opacity,
|
|
27
|
+
paddingHorizontal: controlSize.paddingHorizontal,
|
|
28
|
+
paddingVertical: controlSize.paddingVertical,
|
|
29
|
+
},
|
|
30
|
+
editable: props.interactionPolicy === 'passive' ? false : !disabled && !readOnly,
|
|
31
|
+
inputStyle: {
|
|
32
|
+
color: colors.contentColor,
|
|
33
|
+
flex: 1,
|
|
34
|
+
minHeight: heights.input,
|
|
35
|
+
padding: 0,
|
|
36
|
+
textAlignVertical: props.multiline ? 'top' : 'center',
|
|
37
|
+
},
|
|
38
|
+
numberOfLines: props.multiline ? props.numberOfLines : 1,
|
|
39
|
+
placeholderColor: colors.placeholderColor,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/*** Resolves input and container heights from control typography and multiline state. */
|
|
43
|
+
function resolveTextInputHeights(controlSize, multiline, numberOfLines, lineHeight) {
|
|
44
|
+
const resolvedLineHeight = typeof lineHeight === 'number'
|
|
45
|
+
? lineHeight
|
|
46
|
+
: controlSize.minHeight - controlSize.paddingVertical * 2;
|
|
47
|
+
const lineCount = Math.max(numberOfLines ?? 1, 1);
|
|
48
|
+
const input = multiline
|
|
49
|
+
? resolvedLineHeight * lineCount
|
|
50
|
+
: controlSize.minHeight - controlSize.paddingVertical * 2;
|
|
51
|
+
return {
|
|
52
|
+
input,
|
|
53
|
+
container: multiline ? input + controlSize.paddingVertical * 2 : controlSize.minHeight,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=resolveTextInputPresentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveTextInputPresentation.js","sourceRoot":"","sources":["../../../../../src/features/form/text-input/utils/resolveTextInputPresentation.ts"],"names":[],"mappings":"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","sourcesContent":["import type { TextStyle, ViewStyle } from 'react-native';\n\nimport {\n resolveControlSize,\n resolveFieldState,\n resolveInputColors,\n resolveTextStyles,\n} from '../../../../internal/resolvers';\nimport type { SurfaceTheme } from '../../../../theme/types';\nimport type { TextInputProps } from '../../../../types/text-input';\n\n/*** Resolves layout, colors, and editability for one TextInput state. */\nexport function resolveTextInputPresentation(\n theme: SurfaceTheme,\n props: TextInputProps,\n focused: boolean,\n): TextInputPresentation {\n const controlSize = resolveControlSize(theme, props.size ?? 'm');\n const disabled = props.disabled ?? false;\n const readOnly = props.readOnly ?? false;\n const fieldState = resolveFieldState({\n disabled,\n focused,\n invalid: props.invalid ?? false,\n readOnly,\n });\n const colors = resolveInputColors(theme, fieldState);\n const textStyle = resolveTextStyles(theme, { variant: controlSize.textVariant });\n const heights = resolveTextInputHeights(\n controlSize,\n props.multiline,\n props.numberOfLines,\n textStyle.lineHeight,\n );\n\n return {\n accessorySpacing: theme.spacing.s,\n containerStyle: {\n alignItems: props.multiline ? 'flex-start' : 'center',\n backgroundColor: colors.backgroundColor,\n borderColor: colors.borderColor,\n borderRadius: controlSize.borderRadius,\n borderWidth: 1,\n flexDirection: 'row',\n minHeight: heights.container,\n opacity: colors.opacity,\n paddingHorizontal: controlSize.paddingHorizontal,\n paddingVertical: controlSize.paddingVertical,\n },\n editable: props.interactionPolicy === 'passive' ? false : !disabled && !readOnly,\n inputStyle: {\n color: colors.contentColor,\n flex: 1,\n minHeight: heights.input,\n padding: 0,\n textAlignVertical: props.multiline ? 'top' : 'center',\n },\n numberOfLines: props.multiline ? props.numberOfLines : 1,\n placeholderColor: colors.placeholderColor,\n };\n}\n\n/*** Resolves input and container heights from control typography and multiline state. */\nfunction resolveTextInputHeights(\n controlSize: ReturnType<typeof resolveControlSize>,\n multiline: boolean | undefined,\n numberOfLines: number | undefined,\n lineHeight: TextStyle['lineHeight'],\n) {\n const resolvedLineHeight =\n typeof lineHeight === 'number'\n ? lineHeight\n : controlSize.minHeight - controlSize.paddingVertical * 2;\n const lineCount = Math.max(numberOfLines ?? 1, 1);\n const input = multiline\n ? resolvedLineHeight * lineCount\n : controlSize.minHeight - controlSize.paddingVertical * 2;\n return {\n input,\n container: multiline ? input + controlSize.paddingVertical * 2 : controlSize.minHeight,\n };\n}\n\ninterface TextInputPresentation {\n accessorySpacing: number;\n containerStyle: ViewStyle;\n editable: boolean;\n inputStyle: TextStyle;\n numberOfLines: number | undefined;\n placeholderColor: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/Icon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,iFAAiF;AACjF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAOpC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {} from '
|
|
2
|
-
import {
|
|
3
|
-
import { useTheme } from '../../theme/ThemeContext';
|
|
1
|
+
import { resolveToken } from '../../../../theme/resolveToken';
|
|
2
|
+
import { useTheme } from '../../../../theme/ThemeContext';
|
|
4
3
|
import { PortableIcon } from './PortableIcon';
|
|
4
|
+
/*** Renders a theme-aware font or SVG icon through the portable icon adapter. */
|
|
5
5
|
export function Icon(props) {
|
|
6
6
|
const { theme } = useTheme();
|
|
7
7
|
const size = props.size ?? 'm';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,iFAAiF;AACjF,MAAM,UAAU,IAAI,CAAC,KAAgB;IACnC,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,MAAM,CAAC;IACpC,MAAM,YAAY,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzF,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACxD,OAAO,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,EAAG,CAAC;AAC/E,CAAC","sourcesContent":["import { resolveToken } from '../../../../theme/resolveToken';\nimport { useTheme } from '../../../../theme/ThemeContext';\nimport type { IconProps } from '../../../../types/icon';\nimport { PortableIcon } from './PortableIcon';\n\n/*** Renders a theme-aware font or SVG icon through the portable icon adapter. */\nexport function Icon(props: IconProps) {\n const { theme } = useTheme();\n const size = props.size ?? 'm';\n const color = props.color ?? 'text';\n const resolvedSize = typeof size === 'number' ? size : resolveToken(theme.spacing, size);\n const resolvedColor = resolveToken(theme.colors, color);\n return <PortableIcon {...props} color={resolvedColor} size={resolvedSize} />;\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
3
|
+
import type { FontIconSource, SvgIconSource } from '../../../../types/icon';
|
|
4
|
+
/*** Renders a resolved portable icon using the configured font or SVG runtime. */
|
|
5
|
+
export declare function PortableIcon(props: PortableIconProps): React.JSX.Element;
|
|
6
|
+
interface PortableIconPresentationProps {
|
|
7
|
+
color: string;
|
|
8
|
+
size: number;
|
|
9
|
+
testID?: string;
|
|
10
|
+
}
|
|
11
|
+
type FontPortableIconProps = FontIconSource & PortableIconPresentationProps & {
|
|
12
|
+
style?: StyleProp<TextStyle>;
|
|
13
|
+
};
|
|
14
|
+
type SvgPortableIconProps = SvgIconSource & PortableIconPresentationProps & {
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
};
|
|
17
|
+
type PortableIconProps = FontPortableIconProps | SvgPortableIconProps;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=PortableIcon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PortableIcon.d.ts","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/PortableIcon.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EAEd,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,cAAc,EAAc,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGxF,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA0BpD;AAED,UAAU,6BAA6B;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,KAAK,qBAAqB,GAAG,cAAc,GACzC,6BAA6B,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC;AACnE,KAAK,oBAAoB,GAAG,aAAa,GACvC,6BAA6B,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAAE,CAAC;AACnE,KAAK,iBAAiB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC"}
|
|
@@ -1,22 +1,40 @@
|
|
|
1
|
-
import { FontAwesome
|
|
2
|
-
import { FontAwesome5
|
|
3
|
-
import { FontAwesome6
|
|
1
|
+
import { FontAwesome } from '@react-native-vector-icons/fontawesome/static';
|
|
2
|
+
import { FontAwesome5 } from '@react-native-vector-icons/fontawesome5/static';
|
|
3
|
+
import { FontAwesome6 } from '@react-native-vector-icons/fontawesome6/static';
|
|
4
4
|
import { Ionicons } from '@react-native-vector-icons/ionicons/static';
|
|
5
|
-
import { MaterialDesignIcons
|
|
5
|
+
import { MaterialDesignIcons } from '@react-native-vector-icons/material-design-icons/static';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { Image, StyleSheet, View, } from 'react-native';
|
|
8
8
|
import { SvgUri } from 'react-native-svg';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
/*** Renders a resolved portable icon using the configured font or SVG runtime. */
|
|
10
|
+
export function PortableIcon(props) {
|
|
11
|
+
if ('source' in props)
|
|
12
|
+
return renderSvgIcon(props);
|
|
13
|
+
const { provider } = props;
|
|
14
|
+
const sharedProps = {
|
|
15
|
+
color: props.color,
|
|
16
|
+
size: props.size,
|
|
17
|
+
style: props.style,
|
|
18
|
+
testID: props.testID,
|
|
19
|
+
};
|
|
20
|
+
switch (provider) {
|
|
21
|
+
case undefined:
|
|
22
|
+
case 'Ionicons':
|
|
23
|
+
return <Ionicons {...sharedProps} name={props.name}/>;
|
|
24
|
+
case 'FontAwesome':
|
|
25
|
+
return <FontAwesome {...sharedProps} name={props.name}/>;
|
|
26
|
+
case 'FontAwesome5':
|
|
27
|
+
return renderFontAwesome5(props, sharedProps);
|
|
28
|
+
case 'FontAwesome6':
|
|
29
|
+
return renderFontAwesome6(props, sharedProps);
|
|
30
|
+
case 'MaterialDesignIcons':
|
|
31
|
+
return <MaterialDesignIcons {...sharedProps} name={props.name}/>;
|
|
32
|
+
default:
|
|
33
|
+
return assertNever(provider, 'provider');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const styles = StyleSheet.create({ bundledSvgImage: { height: '100%', width: '100%' } });
|
|
37
|
+
/*** Resolves an SVG URI directly or through React Native's bundled-asset API. */
|
|
20
38
|
function resolveSvgIconUri(source) {
|
|
21
39
|
if (typeof source === 'string')
|
|
22
40
|
return source;
|
|
@@ -27,7 +45,7 @@ function resolveSvgIconUri(source) {
|
|
|
27
45
|
return null;
|
|
28
46
|
return Image.resolveAssetSource(source).uri;
|
|
29
47
|
}
|
|
30
|
-
/***
|
|
48
|
+
/*** Renders URI-backed SVGs and bundled SVG image assets. */
|
|
31
49
|
function renderSvgIcon(props) {
|
|
32
50
|
const uri = resolveSvgIconUri(props.source);
|
|
33
51
|
if (uri) {
|
|
@@ -38,9 +56,11 @@ function renderSvgIcon(props) {
|
|
|
38
56
|
<Image source={imageSource} style={styles.bundledSvgImage} tintColor={props.color}/>
|
|
39
57
|
</View>);
|
|
40
58
|
}
|
|
59
|
+
/*** Rejects unsupported icon configuration at runtime. */
|
|
41
60
|
function assertNever(value, configuration) {
|
|
42
61
|
throw new Error(`Unsupported icon ${configuration}: ${String(value)}`);
|
|
43
62
|
}
|
|
63
|
+
/*** Renders one FontAwesome5 variant. */
|
|
44
64
|
function renderFontAwesome5(props, sharedProps) {
|
|
45
65
|
const { variant } = props;
|
|
46
66
|
switch (variant) {
|
|
@@ -54,6 +74,7 @@ function renderFontAwesome5(props, sharedProps) {
|
|
|
54
74
|
return assertNever(variant, 'FontAwesome5 variant');
|
|
55
75
|
}
|
|
56
76
|
}
|
|
77
|
+
/*** Renders one FontAwesome6 variant. */
|
|
57
78
|
function renderFontAwesome6(props, sharedProps) {
|
|
58
79
|
const { variant } = props;
|
|
59
80
|
switch (variant) {
|
|
@@ -67,31 +88,4 @@ function renderFontAwesome6(props, sharedProps) {
|
|
|
67
88
|
return assertNever(variant, 'FontAwesome6 variant');
|
|
68
89
|
}
|
|
69
90
|
}
|
|
70
|
-
export function PortableIcon(props) {
|
|
71
|
-
if ('source' in props) {
|
|
72
|
-
return renderSvgIcon(props);
|
|
73
|
-
}
|
|
74
|
-
const { provider } = props;
|
|
75
|
-
const sharedProps = {
|
|
76
|
-
color: props.color,
|
|
77
|
-
size: props.size,
|
|
78
|
-
style: props.style,
|
|
79
|
-
testID: props.testID,
|
|
80
|
-
};
|
|
81
|
-
switch (provider) {
|
|
82
|
-
case undefined:
|
|
83
|
-
case 'Ionicons':
|
|
84
|
-
return <Ionicons {...sharedProps} name={props.name}/>;
|
|
85
|
-
case 'FontAwesome':
|
|
86
|
-
return <FontAwesome {...sharedProps} name={props.name}/>;
|
|
87
|
-
case 'FontAwesome5':
|
|
88
|
-
return renderFontAwesome5(props, sharedProps);
|
|
89
|
-
case 'FontAwesome6':
|
|
90
|
-
return renderFontAwesome6(props, sharedProps);
|
|
91
|
-
case 'MaterialDesignIcons':
|
|
92
|
-
return <MaterialDesignIcons {...sharedProps} name={props.name}/>;
|
|
93
|
-
default:
|
|
94
|
-
return assertNever(provider, 'provider');
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
91
|
//# sourceMappingURL=PortableIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PortableIcon.js","sourceRoot":"","sources":["../../../../../src/features/icon/adapters/inbound/PortableIcon.tsx"],"names":[],"mappings":"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","sourcesContent":["import { FontAwesome } from '@react-native-vector-icons/fontawesome/static';\nimport { FontAwesome5 } from '@react-native-vector-icons/fontawesome5/static';\nimport { FontAwesome6 } from '@react-native-vector-icons/fontawesome6/static';\nimport { Ionicons } from '@react-native-vector-icons/ionicons/static';\nimport { MaterialDesignIcons } from '@react-native-vector-icons/material-design-icons/static';\nimport React from 'react';\nimport {\n Image,\n type StyleProp,\n StyleSheet,\n type TextStyle,\n View,\n type ViewStyle,\n} from 'react-native';\nimport { SvgUri } from 'react-native-svg';\n\nimport type { FontIconSource, IconSource, SvgIconSource } from '../../../../types/icon';\nimport type { SurfaceImageSource } from '../../../../types/image';\n\n/*** Renders a resolved portable icon using the configured font or SVG runtime. */\nexport function PortableIcon(props: PortableIconProps) {\n if ('source' in props) return renderSvgIcon(props);\n\n const { provider } = props;\n const sharedProps = {\n color: props.color,\n size: props.size,\n style: props.style,\n testID: props.testID,\n };\n\n switch (provider) {\n case undefined:\n case 'Ionicons':\n return <Ionicons {...sharedProps} name={props.name} />;\n case 'FontAwesome':\n return <FontAwesome {...sharedProps} name={props.name} />;\n case 'FontAwesome5':\n return renderFontAwesome5(props, sharedProps);\n case 'FontAwesome6':\n return renderFontAwesome6(props, sharedProps);\n case 'MaterialDesignIcons':\n return <MaterialDesignIcons {...sharedProps} name={props.name} />;\n default:\n return assertNever(provider, 'provider');\n }\n}\n\ninterface PortableIconPresentationProps {\n color: string;\n size: number;\n testID?: string;\n}\n\ntype FontPortableIconProps = FontIconSource &\n PortableIconPresentationProps & { style?: StyleProp<TextStyle> };\ntype SvgPortableIconProps = SvgIconSource &\n PortableIconPresentationProps & { style?: StyleProp<ViewStyle> };\ntype PortableIconProps = FontPortableIconProps | SvgPortableIconProps;\ntype SharedIconProps = PortableIconPresentationProps & { style?: StyleProp<TextStyle> };\n\nconst styles = StyleSheet.create({ bundledSvgImage: { height: '100%', width: '100%' } });\n\n/*** Resolves an SVG URI directly or through React Native's bundled-asset API. */\nfunction resolveSvgIconUri(source: SurfaceImageSource): string | null {\n if (typeof source === 'string') return source;\n if (!Array.isArray(source) && typeof source === 'object' && typeof source.uri === 'string') {\n return source.uri;\n }\n if (typeof Image.resolveAssetSource !== 'function') return null;\n return Image.resolveAssetSource(source).uri;\n}\n\n/*** Renders URI-backed SVGs and bundled SVG image assets. */\nfunction renderSvgIcon(props: SvgPortableIconProps) {\n const uri = resolveSvgIconUri(props.source);\n if (uri) {\n return (\n <SvgUri\n color={props.color}\n height={props.size}\n style={props.style}\n testID={props.testID}\n uri={uri}\n width={props.size}\n />\n );\n }\n\n const imageSource = typeof props.source === 'string' ? { uri: props.source } : props.source;\n return (\n <View style={[{ height: props.size, width: props.size }, props.style]} testID={props.testID}>\n <Image source={imageSource} style={styles.bundledSvgImage} tintColor={props.color} />\n </View>\n );\n}\n\n/*** Rejects unsupported icon configuration at runtime. */\nfunction assertNever(value: never, configuration: string): never {\n throw new Error(`Unsupported icon ${configuration}: ${String(value)}`);\n}\n\n/*** Renders one FontAwesome5 variant. */\nfunction renderFontAwesome5(\n props: Extract<IconSource, { provider: 'FontAwesome5' }>,\n sharedProps: SharedIconProps,\n) {\n const { variant } = props;\n\n switch (variant) {\n case 'brand':\n return <FontAwesome5 {...sharedProps} iconStyle=\"brand\" name={props.name} />;\n case 'regular':\n return <FontAwesome5 {...sharedProps} iconStyle=\"regular\" name={props.name} />;\n case 'solid':\n return <FontAwesome5 {...sharedProps} iconStyle=\"solid\" name={props.name} />;\n default:\n return assertNever(variant, 'FontAwesome5 variant');\n }\n}\n\n/*** Renders one FontAwesome6 variant. */\nfunction renderFontAwesome6(\n props: Extract<IconSource, { provider: 'FontAwesome6' }>,\n sharedProps: SharedIconProps,\n) {\n const { variant } = props;\n\n switch (variant) {\n case 'brand':\n return <FontAwesome6 {...sharedProps} iconStyle=\"brand\" name={props.name} />;\n case 'regular':\n return <FontAwesome6 {...sharedProps} iconStyle=\"regular\" name={props.name} />;\n case 'solid':\n return <FontAwesome6 {...sharedProps} iconStyle=\"solid\" name={props.name} />;\n default:\n return assertNever(variant, 'FontAwesome6 variant');\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/features/icon/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,wBAAwB,6FAMO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/features/icon/constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU;IACV,aAAa;IACb,cAAc;IACd,cAAc;IACd,qBAAqB;CACqB,CAAC","sourcesContent":["import type { IconProvider } from '../../types/icon';\n\nexport const SUPPORTED_ICON_PROVIDERS = [\n 'Ionicons',\n 'FontAwesome',\n 'FontAwesome5',\n 'FontAwesome6',\n 'MaterialDesignIcons',\n] as const satisfies readonly IconProvider[];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/icon/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,UAAU,EACV,WAAW,EACX,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/icon/public.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type {\n FontIconSource,\n IconProps,\n IconProvider,\n IconSource,\n IconVariant,\n SvgIconSource,\n} from '../../types/icon';\nexport { Icon } from './adapters/inbound/Icon';\nexport { SUPPORTED_ICON_PROVIDERS } from './constants';\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ImageProps } from '
|
|
2
|
+
import type { ImageProps } from '../../../../types/image';
|
|
3
|
+
/*** Renders a token-aware accessible image with optional fallback source. */
|
|
3
4
|
export declare function Image({ source, fallbackSource, alt, accessibilityLabel, width, height, aspectRatio, fit, resizeMode, radius, style, testID, onError, }: ImageProps): React.JSX.Element | null;
|
|
4
5
|
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../src/features/image/adapters/inbound/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAS1D,6EAA6E;AAC7E,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,cAAc,EACd,GAAG,EACH,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,WAAW,EACX,GAAG,EACH,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,GACR,EAAE,UAAU,4BA0BZ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image as ReactNativeImage } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../../theme/ThemeContext';
|
|
4
|
+
import { getSourceKey } from '../../utils/getSourceKey';
|
|
5
|
+
import { normalizeSource } from '../../utils/normalizeSource';
|
|
6
|
+
import { resolveAccessibilityLabel } from '../../utils/resolveAccessibilityLabel';
|
|
7
|
+
import { resolveAlt } from '../../utils/resolveAlt';
|
|
8
|
+
import { resolveImageStyle } from '../../utils/resolveImageStyle';
|
|
9
|
+
import { resolveRenderedSource } from '../../utils/resolveRenderedSource';
|
|
10
|
+
import { resolveResizeMode } from '../../utils/resolveResizeMode';
|
|
11
|
+
/*** Renders a token-aware accessible image with optional fallback source. */
|
|
12
|
+
export function Image({ source, fallbackSource, alt, accessibilityLabel, width, height, aspectRatio, fit, resizeMode, radius, style, testID, onError, }) {
|
|
13
|
+
const { theme } = useTheme();
|
|
14
|
+
const primaryKey = React.useMemo(() => getSourceKey(source), [source]);
|
|
15
|
+
const [failedPrimaryKey, setFailedPrimaryKey] = React.useState(null);
|
|
16
|
+
const showFallback = primaryKey !== null && failedPrimaryKey === primaryKey;
|
|
17
|
+
const normalizedPrimary = normalizeSource(source);
|
|
18
|
+
const normalizedFallback = normalizeSource(fallbackSource);
|
|
19
|
+
const resolvedSource = resolveRenderedSource(normalizedPrimary, normalizedFallback, showFallback);
|
|
20
|
+
if (!resolvedSource)
|
|
21
|
+
return null;
|
|
22
|
+
return (<ReactNativeImage accessibilityLabel={resolveAccessibilityLabel(alt, accessibilityLabel)} accessibilityRole="image" alt={resolveAlt(alt, accessibilityLabel)} onError={(event) => {
|
|
23
|
+
onError?.(event);
|
|
24
|
+
if (!showFallback && normalizedFallback)
|
|
25
|
+
setFailedPrimaryKey(primaryKey);
|
|
26
|
+
}} resizeMode={resolveResizeMode(fit, resizeMode)} source={resolvedSource} style={[resolveImageStyle(theme, { width, height, aspectRatio, radius }), style]} testID={testID}/>);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../../../../src/features/image/adapters/inbound/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,6EAA6E;AAC7E,MAAM,UAAU,KAAK,CAAC,EACpB,MAAM,EACN,cAAc,EACd,GAAG,EACH,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,WAAW,EACX,GAAG,EACH,UAAU,EACV,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,GACI;IACX,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC7B,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACvE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACpF,MAAM,YAAY,GAAG,UAAU,KAAK,IAAI,IAAI,gBAAgB,KAAK,UAAU,CAAC;IAC5E,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAClD,MAAM,kBAAkB,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAC3D,MAAM,cAAc,GAAG,qBAAqB,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,YAAY,CAAC,CAAC;IAElG,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IAEjC,OAAO,CACL,CAAC,gBAAgB,CACf,kBAAkB,CAAC,CAAC,yBAAyB,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,CACvE,iBAAiB,CAAC,OAAO,CACzB,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,CACzC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;YACjB,IAAI,CAAC,YAAY,IAAI,kBAAkB;gBAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;QAC3E,CAAC,CAAC,CACF,UAAU,CAAC,CAAC,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAC/C,MAAM,CAAC,CAAC,cAAc,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,CACjF,MAAM,CAAC,CAAC,MAAM,CAAC,EACf,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Image as ReactNativeImage } from 'react-native';\n\nimport { useTheme } from '../../../../theme/ThemeContext';\nimport type { ImageProps } from '../../../../types/image';\nimport { getSourceKey } from '../../utils/getSourceKey';\nimport { normalizeSource } from '../../utils/normalizeSource';\nimport { resolveAccessibilityLabel } from '../../utils/resolveAccessibilityLabel';\nimport { resolveAlt } from '../../utils/resolveAlt';\nimport { resolveImageStyle } from '../../utils/resolveImageStyle';\nimport { resolveRenderedSource } from '../../utils/resolveRenderedSource';\nimport { resolveResizeMode } from '../../utils/resolveResizeMode';\n\n/*** Renders a token-aware accessible image with optional fallback source. */\nexport function Image({\n source,\n fallbackSource,\n alt,\n accessibilityLabel,\n width,\n height,\n aspectRatio,\n fit,\n resizeMode,\n radius,\n style,\n testID,\n onError,\n}: ImageProps) {\n const { theme } = useTheme();\n const primaryKey = React.useMemo(() => getSourceKey(source), [source]);\n const [failedPrimaryKey, setFailedPrimaryKey] = React.useState<string | null>(null);\n const showFallback = primaryKey !== null && failedPrimaryKey === primaryKey;\n const normalizedPrimary = normalizeSource(source);\n const normalizedFallback = normalizeSource(fallbackSource);\n const resolvedSource = resolveRenderedSource(normalizedPrimary, normalizedFallback, showFallback);\n\n if (!resolvedSource) return null;\n\n return (\n <ReactNativeImage\n accessibilityLabel={resolveAccessibilityLabel(alt, accessibilityLabel)}\n accessibilityRole=\"image\"\n alt={resolveAlt(alt, accessibilityLabel)}\n onError={(event) => {\n onError?.(event);\n if (!showFallback && normalizedFallback) setFailedPrimaryKey(primaryKey);\n }}\n resizeMode={resolveResizeMode(fit, resizeMode)}\n source={resolvedSource}\n style={[resolveImageStyle(theme, { width, height, aspectRatio, radius }), style]}\n testID={testID}\n />\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/image/public.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/image/public.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export type { ImageFit, ImageProps, SurfaceImageSource } from '../../types/image';\nexport { Image } from './adapters/inbound/Image';\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SurfaceImageSource } from '../../../types/image';
|
|
2
|
+
/*** Derives a stable runtime key for one Surface image source. */
|
|
3
|
+
export declare function getSourceKey(source: SurfaceImageSource | null | undefined): string | null;
|
|
4
|
+
//# sourceMappingURL=getSourceKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSourceKey.d.ts","sourceRoot":"","sources":["../../../../src/features/image/utils/getSourceKey.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,kEAAkE;AAClE,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAmBzF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*** Derives a stable runtime key for one Surface image source. */
|
|
2
|
+
export function getSourceKey(source) {
|
|
3
|
+
if (source === null || source === undefined)
|
|
4
|
+
return null;
|
|
5
|
+
if (typeof source === 'string')
|
|
6
|
+
return `uri:${source}`;
|
|
7
|
+
if (typeof source === 'number')
|
|
8
|
+
return `asset:${source}`;
|
|
9
|
+
if (Array.isArray(source)) {
|
|
10
|
+
const parts = source
|
|
11
|
+
.map((item) => item.uri)
|
|
12
|
+
.filter((value) => typeof value === 'string');
|
|
13
|
+
return `uri-set:${parts.join('|')}`;
|
|
14
|
+
}
|
|
15
|
+
const uri = getUriFromSource(source);
|
|
16
|
+
if (uri)
|
|
17
|
+
return `uri:${uri}`;
|
|
18
|
+
try {
|
|
19
|
+
return `src:${JSON.stringify(source)}`;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return 'src:unknown';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/*** Reads the first URI represented by a React Native image source. */
|
|
26
|
+
function getUriFromSource(source) {
|
|
27
|
+
if (Array.isArray(source))
|
|
28
|
+
return source[0]?.uri;
|
|
29
|
+
if (typeof source === 'number')
|
|
30
|
+
return undefined;
|
|
31
|
+
return source.uri;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=getSourceKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSourceKey.js","sourceRoot":"","sources":["../../../../src/features/image/utils/getSourceKey.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,MAAM,UAAU,YAAY,CAAC,MAA6C;IACxE,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACzD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,OAAO,MAAM,EAAE,CAAC;IACvD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,MAAM,EAAE,CAAC;IACzD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,MAAM;aACjB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;aACvB,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;QACjE,OAAO,WAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACtC,CAAC;IAED,MAAM,GAAG,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACrC,IAAI,GAAG;QAAE,OAAO,OAAO,GAAG,EAAE,CAAC;IAE7B,IAAI,CAAC;QACH,OAAO,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,SAAS,gBAAgB,CAAC,MAA2B;IACnD,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACjD,OAAO,MAAM,CAAC,GAAG,CAAC;AACpB,CAAC","sourcesContent":["import type { ImageSourcePropType } from 'react-native';\n\nimport type { SurfaceImageSource } from '../../../types/image';\n\n/*** Derives a stable runtime key for one Surface image source. */\nexport function getSourceKey(source: SurfaceImageSource | null | undefined): string | null {\n if (source === null || source === undefined) return null;\n if (typeof source === 'string') return `uri:${source}`;\n if (typeof source === 'number') return `asset:${source}`;\n if (Array.isArray(source)) {\n const parts = source\n .map((item) => item.uri)\n .filter((value): value is string => typeof value === 'string');\n return `uri-set:${parts.join('|')}`;\n }\n\n const uri = getUriFromSource(source);\n if (uri) return `uri:${uri}`;\n\n try {\n return `src:${JSON.stringify(source)}`;\n } catch {\n return 'src:unknown';\n }\n}\n\n/*** Reads the first URI represented by a React Native image source. */\nfunction getUriFromSource(source: ImageSourcePropType): string | undefined {\n if (Array.isArray(source)) return source[0]?.uri;\n if (typeof source === 'number') return undefined;\n return source.uri;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ImageSourcePropType } from 'react-native';
|
|
2
|
+
import type { SurfaceImageSource } from '../../../types/image';
|
|
3
|
+
/*** Normalizes a Surface image source into React Native's source shape. */
|
|
4
|
+
export declare function normalizeSource(source: SurfaceImageSource | null | undefined): ImageSourcePropType | undefined;
|
|
5
|
+
//# sourceMappingURL=normalizeSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeSource.d.ts","sourceRoot":"","sources":["../../../../src/features/image/utils/normalizeSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,2EAA2E;AAC3E,wBAAgB,eAAe,CAC7B,MAAM,EAAE,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAC5C,mBAAmB,GAAG,SAAS,CAIjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/*** Normalizes a Surface image source into React Native's source shape. */
|
|
2
|
+
export function normalizeSource(source) {
|
|
3
|
+
if (source === null || source === undefined)
|
|
4
|
+
return undefined;
|
|
5
|
+
if (typeof source === 'string')
|
|
6
|
+
return { uri: source };
|
|
7
|
+
return source;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=normalizeSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeSource.js","sourceRoot":"","sources":["../../../../src/features/image/utils/normalizeSource.ts"],"names":[],"mappings":"AAIA,2EAA2E;AAC3E,MAAM,UAAU,eAAe,CAC7B,MAA6C;IAE7C,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC9D,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IACvD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { ImageSourcePropType } from 'react-native';\n\nimport type { SurfaceImageSource } from '../../../types/image';\n\n/*** Normalizes a Surface image source into React Native's source shape. */\nexport function normalizeSource(\n source: SurfaceImageSource | null | undefined,\n): ImageSourcePropType | undefined {\n if (source === null || source === undefined) return undefined;\n if (typeof source === 'string') return { uri: source };\n return source;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ImageProps } from '../../../types/image';
|
|
2
|
+
/*** Resolves the accessible image label from explicit label or alt text. */
|
|
3
|
+
export declare function resolveAccessibilityLabel(alt: ImageProps['alt'], accessibilityLabel: ImageProps['accessibilityLabel']): string | undefined;
|
|
4
|
+
//# sourceMappingURL=resolveAccessibilityLabel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAccessibilityLabel.d.ts","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveAccessibilityLabel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,4EAA4E;AAC5E,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EACtB,kBAAkB,EAAE,UAAU,CAAC,oBAAoB,CAAC,GACnD,MAAM,GAAG,SAAS,CAEpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAccessibilityLabel.js","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveAccessibilityLabel.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,MAAM,UAAU,yBAAyB,CACvC,GAAsB,EACtB,kBAAoD;IAEpD,OAAO,kBAAkB,IAAI,GAAG,CAAC;AACnC,CAAC","sourcesContent":["import type { ImageProps } from '../../../types/image';\n\n/*** Resolves the accessible image label from explicit label or alt text. */\nexport function resolveAccessibilityLabel(\n alt: ImageProps['alt'],\n accessibilityLabel: ImageProps['accessibilityLabel'],\n): string | undefined {\n return accessibilityLabel ?? alt;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ImageProps } from '../../../types/image';
|
|
2
|
+
/*** Resolves web alt text from alt or the accessible label. */
|
|
3
|
+
export declare function resolveAlt(alt: ImageProps['alt'], accessibilityLabel: ImageProps['accessibilityLabel']): string | undefined;
|
|
4
|
+
//# sourceMappingURL=resolveAlt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAlt.d.ts","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveAlt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,+DAA+D;AAC/D,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EACtB,kBAAkB,EAAE,UAAU,CAAC,oBAAoB,CAAC,GACnD,MAAM,GAAG,SAAS,CAEpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAlt.js","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveAlt.ts"],"names":[],"mappings":"AAEA,+DAA+D;AAC/D,MAAM,UAAU,UAAU,CACxB,GAAsB,EACtB,kBAAoD;IAEpD,OAAO,GAAG,IAAI,kBAAkB,CAAC;AACnC,CAAC","sourcesContent":["import type { ImageProps } from '../../../types/image';\n\n/*** Resolves web alt text from alt or the accessible label. */\nexport function resolveAlt(\n alt: ImageProps['alt'],\n accessibilityLabel: ImageProps['accessibilityLabel'],\n): string | undefined {\n return alt ?? accessibilityLabel;\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ImageStyle } from 'react-native';
|
|
2
|
+
import type { SurfaceTheme } from '../../../theme/types';
|
|
3
|
+
import type { ImageProps } from '../../../types/image';
|
|
4
|
+
/*** Resolves token-aware dimensions and radius for a Surface image. */
|
|
5
|
+
export declare function resolveImageStyle(theme: SurfaceTheme, props: Pick<ImageProps, 'width' | 'height' | 'aspectRatio' | 'radius'>): ImageStyle;
|
|
6
|
+
//# sourceMappingURL=resolveImageStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveImageStyle.d.ts","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveImageStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,uEAAuE;AACvE,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,CAAC,GACrE,UAAU,CAYZ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { resolveToken } from '../../../theme/resolveToken';
|
|
2
|
+
/*** Resolves token-aware dimensions and radius for a Surface image. */
|
|
3
|
+
export function resolveImageStyle(theme, props) {
|
|
4
|
+
const width = resolveToken(theme.spacing, props.width);
|
|
5
|
+
const height = resolveToken(theme.spacing, props.height);
|
|
6
|
+
const borderRadius = resolveToken(theme.radii, props.radius);
|
|
7
|
+
return {
|
|
8
|
+
width,
|
|
9
|
+
height,
|
|
10
|
+
aspectRatio: props.aspectRatio,
|
|
11
|
+
borderRadius,
|
|
12
|
+
overflow: borderRadius !== undefined ? 'hidden' : undefined,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=resolveImageStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveImageStyle.js","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveImageStyle.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAI3D,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAC/B,KAAmB,EACnB,KAAsE;IAEtE,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACvD,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7D,OAAO;QACL,KAAK;QACL,MAAM;QACN,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,YAAY;QACZ,QAAQ,EAAE,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;KAC5D,CAAC;AACJ,CAAC","sourcesContent":["import type { ImageStyle } from 'react-native';\n\nimport { resolveToken } from '../../../theme/resolveToken';\nimport type { SurfaceTheme } from '../../../theme/types';\nimport type { ImageProps } from '../../../types/image';\n\n/*** Resolves token-aware dimensions and radius for a Surface image. */\nexport function resolveImageStyle(\n theme: SurfaceTheme,\n props: Pick<ImageProps, 'width' | 'height' | 'aspectRatio' | 'radius'>,\n): ImageStyle {\n const width = resolveToken(theme.spacing, props.width);\n const height = resolveToken(theme.spacing, props.height);\n const borderRadius = resolveToken(theme.radii, props.radius);\n\n return {\n width,\n height,\n aspectRatio: props.aspectRatio,\n borderRadius,\n overflow: borderRadius !== undefined ? 'hidden' : undefined,\n };\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ImageSourcePropType } from 'react-native';
|
|
2
|
+
/*** Chooses the primary or fallback normalized image source. */
|
|
3
|
+
export declare function resolveRenderedSource(normalizedPrimary: ImageSourcePropType | undefined, normalizedFallback: ImageSourcePropType | undefined, showFallback: boolean): ImageSourcePropType | undefined;
|
|
4
|
+
//# sourceMappingURL=resolveRenderedSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRenderedSource.d.ts","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveRenderedSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,gEAAgE;AAChE,wBAAgB,qBAAqB,CACnC,iBAAiB,EAAE,mBAAmB,GAAG,SAAS,EAClD,kBAAkB,EAAE,mBAAmB,GAAG,SAAS,EACnD,YAAY,EAAE,OAAO,GACpB,mBAAmB,GAAG,SAAS,CAGjC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*** Chooses the primary or fallback normalized image source. */
|
|
2
|
+
export function resolveRenderedSource(normalizedPrimary, normalizedFallback, showFallback) {
|
|
3
|
+
if (showFallback || !normalizedPrimary)
|
|
4
|
+
return normalizedFallback;
|
|
5
|
+
return normalizedPrimary;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=resolveRenderedSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRenderedSource.js","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveRenderedSource.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,UAAU,qBAAqB,CACnC,iBAAkD,EAClD,kBAAmD,EACnD,YAAqB;IAErB,IAAI,YAAY,IAAI,CAAC,iBAAiB;QAAE,OAAO,kBAAkB,CAAC;IAClE,OAAO,iBAAiB,CAAC;AAC3B,CAAC","sourcesContent":["import type { ImageSourcePropType } from 'react-native';\n\n/*** Chooses the primary or fallback normalized image source. */\nexport function resolveRenderedSource(\n normalizedPrimary: ImageSourcePropType | undefined,\n normalizedFallback: ImageSourcePropType | undefined,\n showFallback: boolean,\n): ImageSourcePropType | undefined {\n if (showFallback || !normalizedPrimary) return normalizedFallback;\n return normalizedPrimary;\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ImageResizeMode } from 'react-native';
|
|
2
|
+
import type { ImageProps } from '../../../types/image';
|
|
3
|
+
/*** Resolves the canonical resize mode, preferring the Surface fit alias. */
|
|
4
|
+
export declare function resolveResizeMode(fit: ImageProps['fit'], resizeMode: ImageProps['resizeMode']): ImageResizeMode;
|
|
5
|
+
//# sourceMappingURL=resolveResizeMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveResizeMode.d.ts","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveResizeMode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,6EAA6E;AAC7E,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,UAAU,CAAC,KAAK,CAAC,EACtB,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,GACnC,eAAe,CAEjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveResizeMode.js","sourceRoot":"","sources":["../../../../src/features/image/utils/resolveResizeMode.ts"],"names":[],"mappings":"AAIA,6EAA6E;AAC7E,MAAM,UAAU,iBAAiB,CAC/B,GAAsB,EACtB,UAAoC;IAEpC,OAAO,GAAG,IAAI,UAAU,IAAI,OAAO,CAAC;AACtC,CAAC","sourcesContent":["import type { ImageResizeMode } from 'react-native';\n\nimport type { ImageProps } from '../../../types/image';\n\n/*** Resolves the canonical resize mode, preferring the Surface fit alias. */\nexport function resolveResizeMode(\n fit: ImageProps['fit'],\n resizeMode: ImageProps['resizeMode'],\n): ImageResizeMode {\n return fit ?? resizeMode ?? 'cover';\n}\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { KeyboardAvoidingViewProps } from '../../../../types/keyboard-avoiding-view';
|
|
3
|
+
/*** Preserves React Native keyboard avoidance behind the stable Surface feature boundary. */
|
|
4
|
+
export declare function KeyboardAvoidingView(props: KeyboardAvoidingViewProps): React.JSX.Element;
|
|
5
|
+
//# sourceMappingURL=KeyboardAvoidingView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyboardAvoidingView.d.ts","sourceRoot":"","sources":["../../../../../src/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAE1F,6FAA6F;AAC7F,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,qBAEpE"}
|