@yahoo/uds-mobile 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +1174 -0
- package/README.md +614 -0
- package/cli/uds-mobile.js +10 -0
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/bin/generateTheme.mjs +390 -0
- package/dist/bin/mobile/scripts/utils/configToRNMappings.mjs +74 -0
- package/dist/bin/uds/dist/fixtures.mjs +404 -0
- package/dist/bin/uds/dist/tokens/configs/palette/alwaysPalette.mjs +23 -0
- package/dist/bin/uds/dist/tokens/consts/defaultModes.mjs +6 -0
- package/dist/bin/uds/dist/tokens/consts/fontDeclarationsMap.mjs +652 -0
- package/dist/bin/uds-mobile.mjs +256 -0
- package/dist/components/Avatar.cjs +109 -0
- package/dist/components/Avatar.d.cts +60 -0
- package/dist/components/Avatar.d.cts.map +1 -0
- package/dist/components/Avatar.d.mts +60 -0
- package/dist/components/Avatar.d.mts.map +1 -0
- package/dist/components/Avatar.mjs +109 -0
- package/dist/components/Avatar.mjs.map +1 -0
- package/dist/components/Badge.cjs +68 -0
- package/dist/components/Badge.d.cts +43 -0
- package/dist/components/Badge.d.cts.map +1 -0
- package/dist/components/Badge.d.mts +43 -0
- package/dist/components/Badge.d.mts.map +1 -0
- package/dist/components/Badge.mjs +68 -0
- package/dist/components/Badge.mjs.map +1 -0
- package/dist/components/Box.cjs +114 -0
- package/dist/components/Box.d.cts +87 -0
- package/dist/components/Box.d.cts.map +1 -0
- package/dist/components/Box.d.mts +87 -0
- package/dist/components/Box.d.mts.map +1 -0
- package/dist/components/Box.mjs +114 -0
- package/dist/components/Box.mjs.map +1 -0
- package/dist/components/Button.cjs +187 -0
- package/dist/components/Button.d.cts +56 -0
- package/dist/components/Button.d.cts.map +1 -0
- package/dist/components/Button.d.mts +56 -0
- package/dist/components/Button.d.mts.map +1 -0
- package/dist/components/Button.mjs +186 -0
- package/dist/components/Button.mjs.map +1 -0
- package/dist/components/Checkbox.cjs +156 -0
- package/dist/components/Checkbox.d.cts +48 -0
- package/dist/components/Checkbox.d.cts.map +1 -0
- package/dist/components/Checkbox.d.mts +48 -0
- package/dist/components/Checkbox.d.mts.map +1 -0
- package/dist/components/Checkbox.mjs +155 -0
- package/dist/components/Checkbox.mjs.map +1 -0
- package/dist/components/Chip.cjs +124 -0
- package/dist/components/Chip.d.cts +60 -0
- package/dist/components/Chip.d.cts.map +1 -0
- package/dist/components/Chip.d.mts +60 -0
- package/dist/components/Chip.d.mts.map +1 -0
- package/dist/components/Chip.mjs +124 -0
- package/dist/components/Chip.mjs.map +1 -0
- package/dist/components/HStack.cjs +46 -0
- package/dist/components/HStack.d.cts +41 -0
- package/dist/components/HStack.d.cts.map +1 -0
- package/dist/components/HStack.d.mts +41 -0
- package/dist/components/HStack.d.mts.map +1 -0
- package/dist/components/HStack.mjs +46 -0
- package/dist/components/HStack.mjs.map +1 -0
- package/dist/components/Icon.cjs +150 -0
- package/dist/components/Icon.d.cts +90 -0
- package/dist/components/Icon.d.cts.map +1 -0
- package/dist/components/Icon.d.mts +90 -0
- package/dist/components/Icon.d.mts.map +1 -0
- package/dist/components/Icon.mjs +148 -0
- package/dist/components/Icon.mjs.map +1 -0
- package/dist/components/IconButton.cjs +127 -0
- package/dist/components/IconButton.d.cts +46 -0
- package/dist/components/IconButton.d.cts.map +1 -0
- package/dist/components/IconButton.d.mts +46 -0
- package/dist/components/IconButton.d.mts.map +1 -0
- package/dist/components/IconButton.mjs +127 -0
- package/dist/components/IconButton.mjs.map +1 -0
- package/dist/components/IconSlot.cjs +55 -0
- package/dist/components/IconSlot.d.cts +45 -0
- package/dist/components/IconSlot.d.cts.map +1 -0
- package/dist/components/IconSlot.d.mts +45 -0
- package/dist/components/IconSlot.d.mts.map +1 -0
- package/dist/components/IconSlot.mjs +55 -0
- package/dist/components/IconSlot.mjs.map +1 -0
- package/dist/components/Image.cjs +104 -0
- package/dist/components/Image.d.cts +85 -0
- package/dist/components/Image.d.cts.map +1 -0
- package/dist/components/Image.d.mts +85 -0
- package/dist/components/Image.d.mts.map +1 -0
- package/dist/components/Image.mjs +104 -0
- package/dist/components/Image.mjs.map +1 -0
- package/dist/components/Input.cjs +174 -0
- package/dist/components/Input.d.cts +39 -0
- package/dist/components/Input.d.cts.map +1 -0
- package/dist/components/Input.d.mts +39 -0
- package/dist/components/Input.d.mts.map +1 -0
- package/dist/components/Input.mjs +174 -0
- package/dist/components/Input.mjs.map +1 -0
- package/dist/components/Link.cjs +139 -0
- package/dist/components/Link.d.cts +45 -0
- package/dist/components/Link.d.cts.map +1 -0
- package/dist/components/Link.d.mts +45 -0
- package/dist/components/Link.d.mts.map +1 -0
- package/dist/components/Link.mjs +138 -0
- package/dist/components/Link.mjs.map +1 -0
- package/dist/components/Pressable.cjs +120 -0
- package/dist/components/Pressable.d.cts +90 -0
- package/dist/components/Pressable.d.cts.map +1 -0
- package/dist/components/Pressable.d.mts +90 -0
- package/dist/components/Pressable.d.mts.map +1 -0
- package/dist/components/Pressable.mjs +118 -0
- package/dist/components/Pressable.mjs.map +1 -0
- package/dist/components/Radio.cjs +153 -0
- package/dist/components/Radio.d.cts +46 -0
- package/dist/components/Radio.d.cts.map +1 -0
- package/dist/components/Radio.d.mts +46 -0
- package/dist/components/Radio.d.mts.map +1 -0
- package/dist/components/Radio.mjs +152 -0
- package/dist/components/Radio.mjs.map +1 -0
- package/dist/components/Screen.cjs +89 -0
- package/dist/components/Screen.d.cts +53 -0
- package/dist/components/Screen.d.cts.map +1 -0
- package/dist/components/Screen.d.mts +53 -0
- package/dist/components/Screen.d.mts.map +1 -0
- package/dist/components/Screen.mjs +89 -0
- package/dist/components/Screen.mjs.map +1 -0
- package/dist/components/Switch.cjs +172 -0
- package/dist/components/Switch.d.cts +42 -0
- package/dist/components/Switch.d.cts.map +1 -0
- package/dist/components/Switch.d.mts +42 -0
- package/dist/components/Switch.d.mts.map +1 -0
- package/dist/components/Switch.mjs +171 -0
- package/dist/components/Switch.mjs.map +1 -0
- package/dist/components/Text.cjs +107 -0
- package/dist/components/Text.d.cts +96 -0
- package/dist/components/Text.d.cts.map +1 -0
- package/dist/components/Text.d.mts +96 -0
- package/dist/components/Text.d.mts.map +1 -0
- package/dist/components/Text.mjs +107 -0
- package/dist/components/Text.mjs.map +1 -0
- package/dist/components/VStack.cjs +46 -0
- package/dist/components/VStack.d.cts +41 -0
- package/dist/components/VStack.d.cts.map +1 -0
- package/dist/components/VStack.d.mts +41 -0
- package/dist/components/VStack.d.mts.map +1 -0
- package/dist/components/VStack.mjs +46 -0
- package/dist/components/VStack.mjs.map +1 -0
- package/dist/icons/dist/glyphMap.cjs +5475 -0
- package/dist/icons/dist/glyphMap.d.cts +10 -0
- package/dist/icons/dist/glyphMap.d.cts.map +1 -0
- package/dist/icons/dist/glyphMap.d.mts +10 -0
- package/dist/icons/dist/glyphMap.d.mts.map +1 -0
- package/dist/icons/dist/glyphMap.mjs +5474 -0
- package/dist/icons/dist/glyphMap.mjs.map +1 -0
- package/dist/icons/dist/svgMap.cjs +525 -0
- package/dist/icons/dist/svgMap.d.cts +10 -0
- package/dist/icons/dist/svgMap.d.cts.map +1 -0
- package/dist/icons/dist/svgMap.d.mts +10 -0
- package/dist/icons/dist/svgMap.d.mts.map +1 -0
- package/dist/icons/dist/svgMap.mjs +524 -0
- package/dist/icons/dist/svgMap.mjs.map +1 -0
- package/dist/icons/dist/tokens.cjs +13 -0
- package/dist/icons/dist/tokens.mjs +13 -0
- package/dist/icons/dist/tokens.mjs.map +1 -0
- package/dist/icons/dist/types.d.cts +24 -0
- package/dist/icons/dist/types.d.cts.map +1 -0
- package/dist/icons/dist/types.d.mts +24 -0
- package/dist/icons/dist/types.d.mts.map +1 -0
- package/dist/motion.cjs +56 -0
- package/dist/motion.d.cts +46 -0
- package/dist/motion.d.cts.map +1 -0
- package/dist/motion.d.mts +46 -0
- package/dist/motion.d.mts.map +1 -0
- package/dist/motion.mjs +52 -0
- package/dist/motion.mjs.map +1 -0
- package/dist/types.cjs +1 -0
- package/dist/types.d.cts +13 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +13 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +2 -0
- package/dist/uds/dist/components/Box.d.cts +3 -0
- package/dist/uds/dist/components/Box.d.mts +3 -0
- package/dist/uds/dist/components/Divider/Divider.d.cts +3 -0
- package/dist/uds/dist/components/Divider/Divider.d.mts +3 -0
- package/dist/uds/dist/components/Divider/DividerCore.d.cts +4 -0
- package/dist/uds/dist/components/Divider/DividerCore.d.mts +4 -0
- package/dist/uds/dist/components/Divider/DividerInternal.d.cts +4 -0
- package/dist/uds/dist/components/Divider/DividerInternal.d.mts +4 -0
- package/dist/uds/dist/components/Divider/index.d.cts +2 -0
- package/dist/uds/dist/components/Divider/index.d.mts +2 -0
- package/dist/uds/dist/components/FormLabel.d.cts +3 -0
- package/dist/uds/dist/components/FormLabel.d.mts +4 -0
- package/dist/uds/dist/components/HStack.d.cts +4 -0
- package/dist/uds/dist/components/HStack.d.mts +4 -0
- package/dist/uds/dist/components/Icon.d.cts +3 -0
- package/dist/uds/dist/components/Icon.d.mts +3 -0
- package/dist/uds/dist/components/Image.d.cts +2 -0
- package/dist/uds/dist/components/Image.d.mts +3 -0
- package/dist/uds/dist/components/Link.d.cts +3 -0
- package/dist/uds/dist/components/Link.d.mts +3 -0
- package/dist/uds/dist/components/Text.d.cts +3 -0
- package/dist/uds/dist/components/Text.d.mts +3 -0
- package/dist/uds/dist/components/VStack.d.cts +4 -0
- package/dist/uds/dist/components/VStack.d.mts +4 -0
- package/dist/uds/dist/components/client/Avatar/Avatar.d.cts +2 -0
- package/dist/uds/dist/components/client/Avatar/Avatar.d.mts +3 -0
- package/dist/uds/dist/components/client/Avatar/AvatarIcon.d.cts +2 -0
- package/dist/uds/dist/components/client/Avatar/AvatarIcon.d.mts +3 -0
- package/dist/uds/dist/components/client/Avatar/AvatarImage.d.cts +4 -0
- package/dist/uds/dist/components/client/Avatar/AvatarImage.d.mts +5 -0
- package/dist/uds/dist/components/client/Avatar/AvatarText.d.cts +3 -0
- package/dist/uds/dist/components/client/Avatar/AvatarText.d.mts +4 -0
- package/dist/uds/dist/components/client/Avatar/index.d.cts +5 -0
- package/dist/uds/dist/components/client/Avatar/index.d.mts +5 -0
- package/dist/uds/dist/components/client/Badge.d.cts +3 -0
- package/dist/uds/dist/components/client/Badge.d.mts +3 -0
- package/dist/uds/dist/components/client/Button.d.cts +3 -0
- package/dist/uds/dist/components/client/Button.d.mts +3 -0
- package/dist/uds/dist/components/client/Checkbox.d.cts +3 -0
- package/dist/uds/dist/components/client/Checkbox.d.mts +3 -0
- package/dist/uds/dist/components/client/Chip/Chip.d.cts +4 -0
- package/dist/uds/dist/components/client/Chip/Chip.d.mts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipBase.d.cts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipBase.d.mts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipButton.d.cts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipButton.d.mts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipDismissible.d.cts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipDismissible.d.mts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipLink.d.cts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipLink.d.mts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipToggle.d.cts +4 -0
- package/dist/uds/dist/components/client/Chip/ChipToggle.d.mts +4 -0
- package/dist/uds/dist/components/client/Chip/index.d.cts +6 -0
- package/dist/uds/dist/components/client/Chip/index.d.mts +6 -0
- package/dist/uds/dist/components/client/IconButton.d.cts +3 -0
- package/dist/uds/dist/components/client/IconButton.d.mts +3 -0
- package/dist/uds/dist/components/client/Input/Input.d.cts +4 -0
- package/dist/uds/dist/components/client/Input/Input.d.mts +4 -0
- package/dist/uds/dist/components/client/Input/InputHelpText.d.cts +2 -0
- package/dist/uds/dist/components/client/Input/InputHelpText.d.mts +3 -0
- package/dist/uds/dist/components/client/Input/InputHelpTextInternal.d.cts +5 -0
- package/dist/uds/dist/components/client/Input/InputHelpTextInternal.d.mts +6 -0
- package/dist/uds/dist/components/client/Input/index.d.cts +3 -0
- package/dist/uds/dist/components/client/Input/index.d.mts +3 -0
- package/dist/uds/dist/components/client/Menu/Menu.Content.d.cts +4 -0
- package/dist/uds/dist/components/client/Menu/Menu.Content.d.mts +4 -0
- package/dist/uds/dist/components/client/Menu/Menu.Divider.d.cts +3 -0
- package/dist/uds/dist/components/client/Menu/Menu.Divider.d.mts +3 -0
- package/dist/uds/dist/components/client/Menu/Menu.Item.d.cts +4 -0
- package/dist/uds/dist/components/client/Menu/Menu.Item.d.mts +4 -0
- package/dist/uds/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +4 -0
- package/dist/uds/dist/components/client/Menu/Menu.ItemCheckbox.d.mts +4 -0
- package/dist/uds/dist/components/client/Menu/Menu.Provider.d.cts +2 -0
- package/dist/uds/dist/components/client/Menu/Menu.Provider.d.mts +3 -0
- package/dist/uds/dist/components/client/Menu/Menu.Trigger.d.cts +4 -0
- package/dist/uds/dist/components/client/Menu/Menu.Trigger.d.mts +4 -0
- package/dist/uds/dist/components/client/Menu/Menu.d.cts +2 -0
- package/dist/uds/dist/components/client/Menu/Menu.d.mts +2 -0
- package/dist/uds/dist/components/client/Menu/Menu.index.d.cts +7 -0
- package/dist/uds/dist/components/client/Menu/Menu.index.d.mts +7 -0
- package/dist/uds/dist/components/client/Menu/index.d.cts +9 -0
- package/dist/uds/dist/components/client/Menu/index.d.mts +9 -0
- package/dist/uds/dist/components/client/Pressable.d.cts +3 -0
- package/dist/uds/dist/components/client/Pressable.d.mts +3 -0
- package/dist/uds/dist/components/client/Radio/Radio.d.cts +3 -0
- package/dist/uds/dist/components/client/Radio/Radio.d.mts +3 -0
- package/dist/uds/dist/components/client/Radio/RadioGroupProvider.d.cts +3 -0
- package/dist/uds/dist/components/client/Radio/RadioGroupProvider.d.mts +3 -0
- package/dist/uds/dist/components/client/Radio/index.d.cts +3 -0
- package/dist/uds/dist/components/client/Radio/index.d.mts +3 -0
- package/dist/uds/dist/components/client/SpringMotionConfig.d.cts +3 -0
- package/dist/uds/dist/components/client/SpringMotionConfig.d.mts +3 -0
- package/dist/uds/dist/components/client/Switch.d.cts +3 -0
- package/dist/uds/dist/components/client/Switch.d.mts +3 -0
- package/dist/uds/dist/components/client/index.d.cts +33 -0
- package/dist/uds/dist/components/client/index.d.mts +33 -0
- package/dist/uds/dist/components/index.d.cts +40 -0
- package/dist/uds/dist/components/index.d.mts +40 -0
- package/dist/uds/dist/index.d.cts +46 -0
- package/dist/uds/dist/index.d.mts +46 -0
- package/dist/uds/dist/styles/styler.d.cts +2 -0
- package/dist/uds/dist/styles/styler.d.mts +2 -0
- package/dist/uds/dist/styles/stylerTypes.d.cts +2 -0
- package/dist/uds/dist/styles/stylerTypes.d.mts +2 -0
- package/dist/uds/dist/tokens/automation/configs/avatar.d.cts +2 -0
- package/dist/uds/dist/tokens/automation/configs/avatar.d.mts +2 -0
- package/dist/uds/dist/tokens/automation/properties.d.cts +3 -0
- package/dist/uds/dist/tokens/automation/properties.d.mts +3 -0
- package/dist/uds/dist/tokens/automation/types/ComponentConfig.d.cts +3 -0
- package/dist/uds/dist/tokens/automation/types/ComponentConfig.d.mts +3 -0
- package/dist/uds/dist/tokens/configs/motion.cjs +109 -0
- package/dist/uds/dist/tokens/configs/motion.d.cts +20 -0
- package/dist/uds/dist/tokens/configs/motion.d.cts.map +1 -0
- package/dist/uds/dist/tokens/configs/motion.d.mts +20 -0
- package/dist/uds/dist/tokens/configs/motion.d.mts.map +1 -0
- package/dist/uds/dist/tokens/configs/motion.mjs +108 -0
- package/dist/uds/dist/tokens/configs/motion.mjs.map +1 -0
- package/dist/uds/dist/tokens/configs/palette/alwaysPalette.d.cts +32 -0
- package/dist/uds/dist/tokens/configs/palette/alwaysPalette.d.cts.map +1 -0
- package/dist/uds/dist/tokens/configs/palette/alwaysPalette.d.mts +32 -0
- package/dist/uds/dist/tokens/configs/palette/alwaysPalette.d.mts.map +1 -0
- package/dist/uds/dist/tokens/types.d.cts +426 -0
- package/dist/uds/dist/tokens/types.d.cts.map +1 -0
- package/dist/uds/dist/tokens/types.d.mts +426 -0
- package/dist/uds/dist/tokens/types.d.mts.map +1 -0
- package/dist/uds/dist/types.d.cts +2 -0
- package/dist/uds/dist/types.d.mts +2 -0
- package/fonts/centra-no2-black-italic.otf +0 -0
- package/fonts/centra-no2-black.otf +0 -0
- package/fonts/centra-no2-bold-italic.otf +0 -0
- package/fonts/centra-no2-bold.otf +0 -0
- package/fonts/centra-no2-book-italic.otf +0 -0
- package/fonts/centra-no2-book.otf +0 -0
- package/fonts/centra-no2-extrabold-italic.otf +0 -0
- package/fonts/centra-no2-extrabold.otf +0 -0
- package/fonts/centra-no2-hairline-italic.otf +0 -0
- package/fonts/centra-no2-hairline.otf +0 -0
- package/fonts/centra-no2-light-italic.otf +0 -0
- package/fonts/centra-no2-light.otf +0 -0
- package/fonts/centra-no2-medium-italic.otf +0 -0
- package/fonts/centra-no2-medium.otf +0 -0
- package/fonts/centra-no2-thin-italic.otf +0 -0
- package/fonts/centra-no2-thin.otf +0 -0
- package/fonts/gelica-black-italic.otf +0 -0
- package/fonts/gelica-black.otf +0 -0
- package/fonts/gelica-bold-italic.otf +0 -0
- package/fonts/gelica-bold.otf +0 -0
- package/fonts/gelica-extra-light-italic.otf +0 -0
- package/fonts/gelica-extra-light.otf +0 -0
- package/fonts/gelica-light-italic.otf +0 -0
- package/fonts/gelica-light.otf +0 -0
- package/fonts/gelica-medium-italic.otf +0 -0
- package/fonts/gelica-medium.otf +0 -0
- package/fonts/gelica-regular-italic.otf +0 -0
- package/fonts/gelica-regular.otf +0 -0
- package/fonts/gelica-semi-bold-italic.otf +0 -0
- package/fonts/gelica-semi-bold.otf +0 -0
- package/fonts/index.cjs +270 -0
- package/fonts/index.d.ts +10 -0
- package/fonts/index.mjs +272 -0
- package/fonts/inter-black.ttf +0 -0
- package/fonts/inter-bold.ttf +0 -0
- package/fonts/inter-extra-bold.ttf +0 -0
- package/fonts/inter-extra-light.ttf +0 -0
- package/fonts/inter-light.ttf +0 -0
- package/fonts/inter-medium.ttf +0 -0
- package/fonts/inter-regular.ttf +0 -0
- package/fonts/inter-semi-bold.ttf +0 -0
- package/fonts/inter-thin.ttf +0 -0
- package/fonts/roboto-mono-bold-italic.ttf +0 -0
- package/fonts/roboto-mono-bold.ttf +0 -0
- package/fonts/roboto-mono-light-italic.ttf +0 -0
- package/fonts/roboto-mono-light.ttf +0 -0
- package/fonts/roboto-mono-medium-italic.ttf +0 -0
- package/fonts/roboto-mono-medium.ttf +0 -0
- package/fonts/roboto-mono-regular-italic.ttf +0 -0
- package/fonts/roboto-mono-regular.ttf +0 -0
- package/fonts/roboto-mono-thin-italic.ttf +0 -0
- package/fonts/roboto-mono-thin.ttf +0 -0
- package/fonts/uds-icons.ttf +0 -0
- package/fonts/yahoo-product-sans-bold.otf +0 -0
- package/fonts/yahoo-product-sans-extended-black-italic.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-black.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-bold-italic.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-bold.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-light-italic.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-light.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-medium-italic.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-medium.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-regular-italic.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-regular.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-semibold-italic.ttf +0 -0
- package/fonts/yahoo-product-sans-extended-semibold.ttf +0 -0
- package/fonts/yahoo-product-sans-medium.otf +0 -0
- package/fonts/yahoo-product-sans-regular.otf +0 -0
- package/fonts/yahoo-sans-beta-bold.otf +0 -0
- package/fonts/yahoo-sans-beta-medium.otf +0 -0
- package/fonts/yahoo-sans-beta-regular.otf +0 -0
- package/fonts/yahoo-sans-black.otf +0 -0
- package/fonts/yahoo-sans-bold.otf +0 -0
- package/fonts/yahoo-sans-condensed-black.otf +0 -0
- package/fonts/yahoo-sans-condensed-bold.otf +0 -0
- package/fonts/yahoo-sans-condensed-light.otf +0 -0
- package/fonts/yahoo-sans-condensed-medium.otf +0 -0
- package/fonts/yahoo-sans-condensed-regular.otf +0 -0
- package/fonts/yahoo-sans-condensed-xbold.ttf +0 -0
- package/fonts/yahoo-sans-cr4-bold.ttf +0 -0
- package/fonts/yahoo-sans-cr4-medium.ttf +0 -0
- package/fonts/yahoo-sans-cr4-regular.ttf +0 -0
- package/fonts/yahoo-sans-extrabold.otf +0 -0
- package/fonts/yahoo-sans-extralight.otf +0 -0
- package/fonts/yahoo-sans-italic.otf +0 -0
- package/fonts/yahoo-sans-light.otf +0 -0
- package/fonts/yahoo-sans-medium.otf +0 -0
- package/fonts/yahoo-sans-regular-italic.otf +0 -0
- package/fonts/yahoo-sans-regular.otf +0 -0
- package/fonts/yahoo-sans-semibold.otf +0 -0
- package/fonts/yahoo-serif-display-black.otf +0 -0
- package/fonts/yahoo-serif-display-bold.otf +0 -0
- package/fonts/yahoo-serif-display-extrabold.otf +0 -0
- package/fonts/yahoo-serif-display-light.otf +0 -0
- package/fonts/yahoo-serif-display-regular.otf +0 -0
- package/fonts/yahoo-serif-text-bold-italic.ttf +0 -0
- package/fonts/yahoo-serif-text-bold.otf +0 -0
- package/fonts/yahoo-serif-text-italic.otf +0 -0
- package/fonts/yahoo-serif-text-regular.otf +0 -0
- package/fonts/yas-black-italic.otf +0 -0
- package/fonts/yas-black.otf +0 -0
- package/fonts/yas-bold-italic.otf +0 -0
- package/fonts/yas-bold.otf +0 -0
- package/fonts/yas-condensed-black-italic.otf +0 -0
- package/fonts/yas-condensed-black.otf +0 -0
- package/fonts/yas-condensed-bold-italic.otf +0 -0
- package/fonts/yas-condensed-bold.otf +0 -0
- package/fonts/yas-condensed-light-italic.otf +0 -0
- package/fonts/yas-condensed-light.otf +0 -0
- package/fonts/yas-condensed-medium-italic.otf +0 -0
- package/fonts/yas-condensed-medium.otf +0 -0
- package/fonts/yas-condensed-regular-italic.otf +0 -0
- package/fonts/yas-condensed-regular.otf +0 -0
- package/fonts/yas-condensed-semibold-italic.otf +0 -0
- package/fonts/yas-condensed-semibold.otf +0 -0
- package/fonts/yas-extended-black-italic.otf +0 -0
- package/fonts/yas-extended-black.otf +0 -0
- package/fonts/yas-extended-bold-italic.otf +0 -0
- package/fonts/yas-extended-bold.otf +0 -0
- package/fonts/yas-extended-light-italic.otf +0 -0
- package/fonts/yas-extended-light.otf +0 -0
- package/fonts/yas-extended-medium-italic.otf +0 -0
- package/fonts/yas-extended-medium.otf +0 -0
- package/fonts/yas-extended-regular-italic.otf +0 -0
- package/fonts/yas-extended-regular.otf +0 -0
- package/fonts/yas-extended-semibold-italic.otf +0 -0
- package/fonts/yas-extended-semibold.otf +0 -0
- package/fonts/yas-light-italic.otf +0 -0
- package/fonts/yas-light.otf +0 -0
- package/fonts/yas-medium-italic.otf +0 -0
- package/fonts/yas-medium.otf +0 -0
- package/fonts/yas-regular-italic.otf +0 -0
- package/fonts/yas-regular.otf +0 -0
- package/fonts/yas-semibold-italic.otf +0 -0
- package/fonts/yas-semibold.otf +0 -0
- package/generated/styles.cjs +4510 -0
- package/generated/styles.d.cts +1 -0
- package/generated/styles.d.mts +1 -0
- package/generated/styles.d.ts +2965 -0
- package/generated/styles.mjs +4510 -0
- package/generated/unistyles.d.ts +4320 -0
- package/package.json +308 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { SCALE_EFFECTS } from "../uds/dist/tokens/configs/motion.mjs";
|
|
3
|
+
import { BUTTON_SPRING_CONFIG } from "../motion.mjs";
|
|
4
|
+
import { Icon } from "./Icon.mjs";
|
|
5
|
+
import { AnimatedPressable } from "./Pressable.mjs";
|
|
6
|
+
import { memo, useCallback, useMemo, useState } from "react";
|
|
7
|
+
import { ActivityIndicator } from "react-native";
|
|
8
|
+
import { buttonStyles, iconButtonStyles, styles } from "../../generated/styles";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
import { Easing, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring, withTiming } from "react-native-reanimated";
|
|
11
|
+
import { useAnimatedTheme, useAnimatedVariantColor } from "react-native-unistyles/reanimated";
|
|
12
|
+
|
|
13
|
+
//#region src/components/IconButton.tsx
|
|
14
|
+
function interpolateShadowAlpha(shadow, alpha) {
|
|
15
|
+
"worklet";
|
|
16
|
+
if (!shadow || alpha >= 1) return shadow;
|
|
17
|
+
if (alpha <= 0) return "";
|
|
18
|
+
return shadow.replace(/rgba\(([^,]+),\s*([^,]+),\s*([^,]+),\s*([^)]+)\)/g, (_, r, g, b, a) => {
|
|
19
|
+
return `rgba(${r}, ${g}, ${b}, ${(parseFloat(a) * alpha).toFixed(3)})`;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* **An icon button element that can be used to trigger an action**
|
|
24
|
+
*
|
|
25
|
+
* Features animated scale effect on press and smooth color transitions
|
|
26
|
+
* matching the web UDS IconButton behavior.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* import { IconButton } from '@yahoo/uds-mobile';
|
|
31
|
+
*
|
|
32
|
+
* <IconButton name="Add" onPress={() => console.log('pressed')} />
|
|
33
|
+
* <IconButton name="Close" variant="secondary" size="sm" />
|
|
34
|
+
* <IconButton name="Settings" loading />
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
const IconButton = memo(function IconButton$1({ name, variant = "primary", size = "md", iconVariant = "outline", loading, disabled, style, accessibilityLabel, accessibilityHint, disableEffects = false, onPressIn, onPressOut, ref, ...props }) {
|
|
38
|
+
const isDisabled = disabled || loading;
|
|
39
|
+
const shouldAnimate = !disableEffects && !isDisabled;
|
|
40
|
+
const [pressed, setPressed] = useState(false);
|
|
41
|
+
iconButtonStyles.useVariants({ size });
|
|
42
|
+
buttonStyles.useVariants({
|
|
43
|
+
variant,
|
|
44
|
+
disabled: isDisabled,
|
|
45
|
+
pressed
|
|
46
|
+
});
|
|
47
|
+
const backgroundColor = useAnimatedVariantColor(buttonStyles.root, "backgroundColor");
|
|
48
|
+
const borderColor = useAnimatedVariantColor(buttonStyles.root, "borderColor");
|
|
49
|
+
const animatedTheme = useAnimatedTheme();
|
|
50
|
+
const scale = useSharedValue(SCALE_EFFECTS.none);
|
|
51
|
+
const handlePressIn = useCallback((event) => {
|
|
52
|
+
setPressed(true);
|
|
53
|
+
if (shouldAnimate) scale.value = withSpring(SCALE_EFFECTS.down, BUTTON_SPRING_CONFIG);
|
|
54
|
+
onPressIn?.(event);
|
|
55
|
+
}, [
|
|
56
|
+
shouldAnimate,
|
|
57
|
+
scale,
|
|
58
|
+
onPressIn
|
|
59
|
+
]);
|
|
60
|
+
const handlePressOut = useCallback((event) => {
|
|
61
|
+
setPressed(false);
|
|
62
|
+
if (shouldAnimate) scale.value = withSpring(SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG);
|
|
63
|
+
onPressOut?.(event);
|
|
64
|
+
}, [
|
|
65
|
+
shouldAnimate,
|
|
66
|
+
scale,
|
|
67
|
+
onPressOut
|
|
68
|
+
]);
|
|
69
|
+
const a11yState = useMemo(() => ({
|
|
70
|
+
disabled: isDisabled,
|
|
71
|
+
busy: loading
|
|
72
|
+
}), [isDisabled, loading]);
|
|
73
|
+
const pressProgress = useDerivedValue(() => withTiming(pressed ? 1 : 0, {
|
|
74
|
+
duration: 220,
|
|
75
|
+
easing: Easing.bezier(0, 0, .2, 1)
|
|
76
|
+
}), [pressed]);
|
|
77
|
+
const animatedRootStyle = useAnimatedStyle(() => {
|
|
78
|
+
const shadowPressed = animatedTheme.value.components[`button/variant/${variant}/root/pressed`]?.boxShadow ?? "";
|
|
79
|
+
return {
|
|
80
|
+
transform: [{ scale: scale.value }],
|
|
81
|
+
backgroundColor: withTiming(backgroundColor.value, {
|
|
82
|
+
duration: 220,
|
|
83
|
+
easing: Easing.bezier(0, 0, .2, 1)
|
|
84
|
+
}),
|
|
85
|
+
borderColor: withTiming(borderColor.value, {
|
|
86
|
+
duration: 220,
|
|
87
|
+
easing: Easing.bezier(0, 0, .2, 1)
|
|
88
|
+
}),
|
|
89
|
+
boxShadow: interpolateShadowAlpha(shadowPressed, pressProgress.value)
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
return /* @__PURE__ */ jsx(AnimatedPressable, {
|
|
93
|
+
ref,
|
|
94
|
+
disabled: isDisabled,
|
|
95
|
+
onPressIn: handlePressIn,
|
|
96
|
+
onPressOut: handlePressOut,
|
|
97
|
+
flexDirection: "row",
|
|
98
|
+
alignItems: "center",
|
|
99
|
+
justifyContent: "center",
|
|
100
|
+
overflow: "hidden",
|
|
101
|
+
accessibilityLabel: loading ? `${accessibilityLabel ?? ""}, loading` : accessibilityLabel,
|
|
102
|
+
accessibilityHint,
|
|
103
|
+
accessibilityRole: "button",
|
|
104
|
+
accessibilityState: a11yState,
|
|
105
|
+
style: [
|
|
106
|
+
iconButtonStyles.root,
|
|
107
|
+
buttonStyles.root,
|
|
108
|
+
styles.foundation,
|
|
109
|
+
animatedRootStyle,
|
|
110
|
+
typeof style === "function" ? style({ pressed }) : style
|
|
111
|
+
],
|
|
112
|
+
...props,
|
|
113
|
+
children: loading ? /* @__PURE__ */ jsx(ActivityIndicator, {
|
|
114
|
+
size: buttonStyles.icon.fontSize,
|
|
115
|
+
color: buttonStyles.icon.color
|
|
116
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
117
|
+
name,
|
|
118
|
+
variant: iconVariant,
|
|
119
|
+
style: buttonStyles.icon
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
IconButton.displayName = "IconButton";
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
export { IconButton };
|
|
127
|
+
//# sourceMappingURL=IconButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconButton.mjs","names":["IconButton","foundationStyles"],"sources":["../../src/components/IconButton.tsx"],"sourcesContent":["import type { ButtonVariantFlat, IconButtonSize, IconVariant } from '@yahoo/uds/tokens';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useMemo, useState } from 'react';\nimport type { View } from 'react-native';\nimport { ActivityIndicator } from 'react-native';\nimport {\n Easing,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withSpring,\n withTiming,\n} from 'react-native-reanimated';\nimport { useAnimatedTheme, useAnimatedVariantColor } from 'react-native-unistyles/reanimated';\n\nimport { buttonStyles, iconButtonStyles, styles as foundationStyles } from '../../generated/styles';\nimport { BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '../motion';\nimport type { IconName } from './Icon';\nimport { Icon } from './Icon';\nimport type { PressableProps } from './Pressable';\nimport { AnimatedPressable } from './Pressable';\n\n/* -------------------------------------------------------------------------- */\n/* Animation Helpers */\n/* -------------------------------------------------------------------------- */\n\nfunction interpolateShadowAlpha(shadow: string, alpha: number): string {\n 'worklet';\n if (!shadow || alpha >= 1) {\n return shadow;\n }\n if (alpha <= 0) {\n return '';\n }\n\n return shadow.replace(/rgba\\(([^,]+),\\s*([^,]+),\\s*([^,]+),\\s*([^)]+)\\)/g, (_, r, g, b, a) => {\n const newAlpha = parseFloat(a) * alpha;\n return `rgba(${r}, ${g}, ${b}, ${newAlpha.toFixed(3)})`;\n });\n}\n\n/* -------------------------------------------------------------------------- */\n/* IconButton Props */\n/* -------------------------------------------------------------------------- */\n\ninterface IconButtonProps extends Omit<PressableProps, 'children'> {\n /** Icon to render from the icons package. */\n name: IconName;\n /** @default 'primary' */\n variant?: ButtonVariantFlat;\n /** @default 'md' */\n size?: IconButtonSize;\n /** @default 'outline' */\n iconVariant?: IconVariant;\n loading?: boolean;\n /**\n * Disable motion effects (scale on press, icon animations)\n * @default false\n */\n disableEffects?: boolean;\n ref?: Ref<View>;\n}\n\n/* -------------------------------------------------------------------------- */\n/* IconButton Component */\n/* -------------------------------------------------------------------------- */\n\n/**\n * **An icon button element that can be used to trigger an action**\n *\n * Features animated scale effect on press and smooth color transitions\n * matching the web UDS IconButton behavior.\n *\n * @example\n * ```tsx\n * import { IconButton } from '@yahoo/uds-mobile';\n *\n * <IconButton name=\"Add\" onPress={() => console.log('pressed')} />\n * <IconButton name=\"Close\" variant=\"secondary\" size=\"sm\" />\n * <IconButton name=\"Settings\" loading />\n * ```\n */\nconst IconButton = memo(function IconButton({\n name,\n variant = 'primary',\n size = 'md',\n iconVariant = 'outline',\n loading,\n disabled,\n style,\n accessibilityLabel,\n accessibilityHint,\n disableEffects = false,\n onPressIn,\n onPressOut,\n ref,\n ...props\n}: IconButtonProps) {\n const isDisabled = disabled || loading;\n const shouldAnimate = !disableEffects && !isDisabled;\n\n /* --------------------------------- State ---------------------------------- */\n const [pressed, setPressed] = useState(false);\n\n // Apply layer-based styles with compound variant support\n iconButtonStyles.useVariants({ size });\n buttonStyles.useVariants({ variant, disabled: isDisabled, pressed });\n\n // Animate colors using Unistyles' useAnimatedVariantColor\n const backgroundColor = useAnimatedVariantColor(buttonStyles.root, 'backgroundColor');\n const borderColor = useAnimatedVariantColor(buttonStyles.root, 'borderColor');\n\n // Get animated theme for boxShadow\n const animatedTheme = useAnimatedTheme();\n\n /* ------------------------------- Animation -------------------------------- */\n const scale = useSharedValue<number>(SCALE_EFFECTS.none);\n\n const handlePressIn = useCallback<NonNullable<PressableProps['onPressIn']>>(\n (event) => {\n setPressed(true);\n if (shouldAnimate) {\n scale.value = withSpring(SCALE_EFFECTS.down, BUTTON_SPRING_CONFIG);\n }\n onPressIn?.(event);\n },\n [shouldAnimate, scale, onPressIn],\n );\n\n const handlePressOut = useCallback<NonNullable<PressableProps['onPressOut']>>(\n (event) => {\n setPressed(false);\n if (shouldAnimate) {\n scale.value = withSpring(SCALE_EFFECTS.none, BUTTON_SPRING_CONFIG);\n }\n onPressOut?.(event);\n },\n [shouldAnimate, scale, onPressOut],\n );\n\n const a11yState = useMemo(() => ({ disabled: isDisabled, busy: loading }), [isDisabled, loading]);\n\n /* --------------------------------- Styles --------------------------------- */\n // Animate pressed state for shadow\n const pressProgress = useDerivedValue(\n () => withTiming(pressed ? 1 : 0, { duration: 220, easing: Easing.bezier(0, 0, 0.2, 1) }),\n [pressed],\n );\n\n // Animate using Unistyles' variant color system + boxShadow from theme\n const animatedRootStyle = useAnimatedStyle(() => {\n // Get boxShadow from theme using flattened path (no camelCase conversion needed!)\n const components = animatedTheme.value.components as unknown as Record<\n string,\n Record<string, unknown>\n >;\n const shadowPressed =\n (components[`button/variant/${variant}/root/pressed`]?.boxShadow as string) ?? '';\n\n return {\n transform: [{ scale: scale.value }],\n backgroundColor: withTiming(backgroundColor.value, {\n duration: 220,\n easing: Easing.bezier(0, 0, 0.2, 1),\n }),\n borderColor: withTiming(borderColor.value, {\n duration: 220,\n easing: Easing.bezier(0, 0, 0.2, 1),\n }),\n boxShadow: interpolateShadowAlpha(shadowPressed, pressProgress.value),\n };\n });\n\n /* --------------------------------- Render --------------------------------- */\n return (\n <AnimatedPressable\n ref={ref}\n disabled={isDisabled}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n overflow=\"hidden\"\n accessibilityLabel={loading ? `${accessibilityLabel ?? ''}, loading` : accessibilityLabel}\n accessibilityHint={accessibilityHint}\n accessibilityRole=\"button\"\n accessibilityState={a11yState}\n style={[\n iconButtonStyles.root,\n buttonStyles.root,\n foundationStyles.foundation,\n animatedRootStyle,\n typeof style === 'function' ? style({ pressed }) : style,\n ]}\n {...props}\n >\n {loading ? (\n <ActivityIndicator size={buttonStyles.icon.fontSize} color={buttonStyles.icon.color} />\n ) : (\n <Icon name={name} variant={iconVariant} style={buttonStyles.icon} />\n )}\n </AnimatedPressable>\n );\n});\n\nIconButton.displayName = 'IconButton';\n\nexport { IconButton, type IconButtonProps };\n"],"mappings":";;;;;;;;;;;;;AA0BA,SAAS,uBAAuB,QAAgB,OAAuB;AACrE;AACA,KAAI,CAAC,UAAU,SAAS,EACtB,QAAO;AAET,KAAI,SAAS,EACX,QAAO;AAGT,QAAO,OAAO,QAAQ,sDAAsD,GAAG,GAAG,GAAG,GAAG,MAAM;AAE5F,SAAO,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KADZ,WAAW,EAAE,GAAG,OACS,QAAQ,EAAE,CAAC;GACrD;;;;;;;;;;;;;;;;;AA4CJ,MAAM,aAAa,KAAK,SAASA,aAAW,EAC1C,MACA,UAAU,WACV,OAAO,MACP,cAAc,WACd,SACA,UACA,OACA,oBACA,mBACA,iBAAiB,OACjB,WACA,YACA,KACA,GAAG,SACe;CAClB,MAAM,aAAa,YAAY;CAC/B,MAAM,gBAAgB,CAAC,kBAAkB,CAAC;CAG1C,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;AAG7C,kBAAiB,YAAY,EAAE,MAAM,CAAC;AACtC,cAAa,YAAY;EAAE;EAAS,UAAU;EAAY;EAAS,CAAC;CAGpE,MAAM,kBAAkB,wBAAwB,aAAa,MAAM,kBAAkB;CACrF,MAAM,cAAc,wBAAwB,aAAa,MAAM,cAAc;CAG7E,MAAM,gBAAgB,kBAAkB;CAGxC,MAAM,QAAQ,eAAuB,cAAc,KAAK;CAExD,MAAM,gBAAgB,aACnB,UAAU;AACT,aAAW,KAAK;AAChB,MAAI,cACF,OAAM,QAAQ,WAAW,cAAc,MAAM,qBAAqB;AAEpE,cAAY,MAAM;IAEpB;EAAC;EAAe;EAAO;EAAU,CAClC;CAED,MAAM,iBAAiB,aACpB,UAAU;AACT,aAAW,MAAM;AACjB,MAAI,cACF,OAAM,QAAQ,WAAW,cAAc,MAAM,qBAAqB;AAEpE,eAAa,MAAM;IAEr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-development */
|
|
2
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
3
|
+
const require_components_Icon = require('./Icon.cjs');
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let lodash_es = require("lodash-es");
|
|
7
|
+
|
|
8
|
+
//#region src/components/IconSlot.tsx
|
|
9
|
+
/**
|
|
10
|
+
* **🔌 A helper container to render icons flexibly**
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Useful in components that use icons and have a startIcon and endIcon. It allows
|
|
14
|
+
* consumers to pass in a standard UDS icon name, an Icon component, or a render function
|
|
15
|
+
* for custom rendering.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { IconSlot } from '@yahoo/uds-mobile';
|
|
20
|
+
*
|
|
21
|
+
* // Using icon name (preferred - stable reference, no useMemo needed)
|
|
22
|
+
* <IconSlot icon="Info" size="md" variant="fill" />
|
|
23
|
+
*
|
|
24
|
+
* // Using Icon component
|
|
25
|
+
* <IconSlot icon={<Icon name="Info" variant="fill" />} />
|
|
26
|
+
*
|
|
27
|
+
* // Using render function
|
|
28
|
+
* <IconSlot icon={(props) => <Icon name="Info" {...props} variant="fill" />} />
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @usage
|
|
32
|
+
* - Pass icon name for simple usage
|
|
33
|
+
* - Pass Icon component for custom props
|
|
34
|
+
* - Pass function for dynamic rendering
|
|
35
|
+
*/
|
|
36
|
+
const IconSlot = (0, react.memo)(function IconSlot$1({ icon, ref, ...props }) {
|
|
37
|
+
if (!icon) return null;
|
|
38
|
+
if (typeof icon === "string") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Icon.Icon, {
|
|
39
|
+
ref,
|
|
40
|
+
name: icon,
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
if ((0, lodash_es.isFunction)(icon)) {
|
|
44
|
+
const iconEl = icon(props);
|
|
45
|
+
return (0, react.isValidElement)(iconEl) ? (0, react.cloneElement)(iconEl, { ...props }) : null;
|
|
46
|
+
}
|
|
47
|
+
return (0, react.isValidElement)(icon) ? (0, react.cloneElement)(icon, {
|
|
48
|
+
...props,
|
|
49
|
+
...icon.props
|
|
50
|
+
}) : null;
|
|
51
|
+
});
|
|
52
|
+
IconSlot.displayName = "IconSlot";
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.IconSlot = IconSlot;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconName, IconProps } from "./Icon.cjs";
|
|
3
|
+
import * as react8 from "react";
|
|
4
|
+
import { ReactElement, Ref } from "react";
|
|
5
|
+
import { Text } from "react-native";
|
|
6
|
+
|
|
7
|
+
//#region src/components/IconSlot.d.ts
|
|
8
|
+
type IconPropsWithoutName = Omit<IconProps, 'name'>;
|
|
9
|
+
type IconSlotType = IconName | ReactElement<IconProps> | ((iconProps: IconPropsWithoutName) => ReactElement<IconProps>);
|
|
10
|
+
interface IconSlotProps extends IconPropsWithoutName {
|
|
11
|
+
ref?: Ref<Text>;
|
|
12
|
+
/** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that returns a ReactNode. */
|
|
13
|
+
icon?: IconSlotType;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* **🔌 A helper container to render icons flexibly**
|
|
17
|
+
*
|
|
18
|
+
* @description
|
|
19
|
+
* Useful in components that use icons and have a startIcon and endIcon. It allows
|
|
20
|
+
* consumers to pass in a standard UDS icon name, an Icon component, or a render function
|
|
21
|
+
* for custom rendering.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* import { IconSlot } from '@yahoo/uds-mobile';
|
|
26
|
+
*
|
|
27
|
+
* // Using icon name (preferred - stable reference, no useMemo needed)
|
|
28
|
+
* <IconSlot icon="Info" size="md" variant="fill" />
|
|
29
|
+
*
|
|
30
|
+
* // Using Icon component
|
|
31
|
+
* <IconSlot icon={<Icon name="Info" variant="fill" />} />
|
|
32
|
+
*
|
|
33
|
+
* // Using render function
|
|
34
|
+
* <IconSlot icon={(props) => <Icon name="Info" {...props} variant="fill" />} />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @usage
|
|
38
|
+
* - Pass icon name for simple usage
|
|
39
|
+
* - Pass Icon component for custom props
|
|
40
|
+
* - Pass function for dynamic rendering
|
|
41
|
+
*/
|
|
42
|
+
declare const IconSlot: react8.NamedExoticComponent<IconSlotProps>;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { IconSlot, type IconSlotProps, type IconSlotType };
|
|
45
|
+
//# sourceMappingURL=IconSlot.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconSlot.d.cts","names":[],"sources":["../../src/components/IconSlot.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAOK,oBAAA,GAAuB,KAAK;KAE5B,YAAA,GACD,WACA,aAAa,0BACA,yBAAyB,aAAa;UAE7C,aAAA,SAAsB;EAP3B,GAAA,CAAA,EAQG,GARH,CAQO,IARP,CAAA;EAEA;EACD,IAAA,CAAA,EAOK,YAPL;;;;;;;AAEkD;;;;;;AAEF;;;;;;;;;;;;;;;;cAkC9C,UAAQ,MAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
import { IconName, IconProps } from "./Icon.mjs";
|
|
3
|
+
import * as react1 from "react";
|
|
4
|
+
import { ReactElement, Ref } from "react";
|
|
5
|
+
import { Text } from "react-native";
|
|
6
|
+
|
|
7
|
+
//#region src/components/IconSlot.d.ts
|
|
8
|
+
type IconPropsWithoutName = Omit<IconProps, 'name'>;
|
|
9
|
+
type IconSlotType = IconName | ReactElement<IconProps> | ((iconProps: IconPropsWithoutName) => ReactElement<IconProps>);
|
|
10
|
+
interface IconSlotProps extends IconPropsWithoutName {
|
|
11
|
+
ref?: Ref<Text>;
|
|
12
|
+
/** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that returns a ReactNode. */
|
|
13
|
+
icon?: IconSlotType;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* **🔌 A helper container to render icons flexibly**
|
|
17
|
+
*
|
|
18
|
+
* @description
|
|
19
|
+
* Useful in components that use icons and have a startIcon and endIcon. It allows
|
|
20
|
+
* consumers to pass in a standard UDS icon name, an Icon component, or a render function
|
|
21
|
+
* for custom rendering.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* import { IconSlot } from '@yahoo/uds-mobile';
|
|
26
|
+
*
|
|
27
|
+
* // Using icon name (preferred - stable reference, no useMemo needed)
|
|
28
|
+
* <IconSlot icon="Info" size="md" variant="fill" />
|
|
29
|
+
*
|
|
30
|
+
* // Using Icon component
|
|
31
|
+
* <IconSlot icon={<Icon name="Info" variant="fill" />} />
|
|
32
|
+
*
|
|
33
|
+
* // Using render function
|
|
34
|
+
* <IconSlot icon={(props) => <Icon name="Info" {...props} variant="fill" />} />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @usage
|
|
38
|
+
* - Pass icon name for simple usage
|
|
39
|
+
* - Pass Icon component for custom props
|
|
40
|
+
* - Pass function for dynamic rendering
|
|
41
|
+
*/
|
|
42
|
+
declare const IconSlot: react1.NamedExoticComponent<IconSlotProps>;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { IconSlot, type IconSlotProps, type IconSlotType };
|
|
45
|
+
//# sourceMappingURL=IconSlot.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconSlot.d.mts","names":[],"sources":["../../src/components/IconSlot.tsx"],"sourcesContent":[],"mappings":";;;;;;;KAOK,oBAAA,GAAuB,KAAK;KAE5B,YAAA,GACD,WACA,aAAa,0BACA,yBAAyB,aAAa;UAE7C,aAAA,SAAsB;EAP3B,GAAA,CAAA,EAQG,GARH,CAQO,IARP,CAAA;EAEA;EACD,IAAA,CAAA,EAOK,YAPL;;;;;;;AAEkD;;;;;;AAEF;;;;;;;;;;;;;;;;cAkC9C,UAAQ,MAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { Icon } from "./Icon.mjs";
|
|
3
|
+
import { cloneElement, isValidElement, memo } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { isFunction } from "lodash-es";
|
|
6
|
+
|
|
7
|
+
//#region src/components/IconSlot.tsx
|
|
8
|
+
/**
|
|
9
|
+
* **🔌 A helper container to render icons flexibly**
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* Useful in components that use icons and have a startIcon and endIcon. It allows
|
|
13
|
+
* consumers to pass in a standard UDS icon name, an Icon component, or a render function
|
|
14
|
+
* for custom rendering.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { IconSlot } from '@yahoo/uds-mobile';
|
|
19
|
+
*
|
|
20
|
+
* // Using icon name (preferred - stable reference, no useMemo needed)
|
|
21
|
+
* <IconSlot icon="Info" size="md" variant="fill" />
|
|
22
|
+
*
|
|
23
|
+
* // Using Icon component
|
|
24
|
+
* <IconSlot icon={<Icon name="Info" variant="fill" />} />
|
|
25
|
+
*
|
|
26
|
+
* // Using render function
|
|
27
|
+
* <IconSlot icon={(props) => <Icon name="Info" {...props} variant="fill" />} />
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @usage
|
|
31
|
+
* - Pass icon name for simple usage
|
|
32
|
+
* - Pass Icon component for custom props
|
|
33
|
+
* - Pass function for dynamic rendering
|
|
34
|
+
*/
|
|
35
|
+
const IconSlot = memo(function IconSlot$1({ icon, ref, ...props }) {
|
|
36
|
+
if (!icon) return null;
|
|
37
|
+
if (typeof icon === "string") return /* @__PURE__ */ jsx(Icon, {
|
|
38
|
+
ref,
|
|
39
|
+
name: icon,
|
|
40
|
+
...props
|
|
41
|
+
});
|
|
42
|
+
if (isFunction(icon)) {
|
|
43
|
+
const iconEl = icon(props);
|
|
44
|
+
return isValidElement(iconEl) ? cloneElement(iconEl, { ...props }) : null;
|
|
45
|
+
}
|
|
46
|
+
return isValidElement(icon) ? cloneElement(icon, {
|
|
47
|
+
...props,
|
|
48
|
+
...icon.props
|
|
49
|
+
}) : null;
|
|
50
|
+
});
|
|
51
|
+
IconSlot.displayName = "IconSlot";
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
export { IconSlot };
|
|
55
|
+
//# sourceMappingURL=IconSlot.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconSlot.mjs","names":["IconSlot"],"sources":["../../src/components/IconSlot.tsx"],"sourcesContent":["import { isFunction } from 'lodash-es';\nimport type { ReactElement, Ref } from 'react';\nimport { cloneElement, isValidElement, memo } from 'react';\nimport type { Text as RNText } from 'react-native';\n\nimport type { IconName, IconProps } from './Icon';\nimport { Icon } from './Icon';\ntype IconPropsWithoutName = Omit<IconProps, 'name'>;\n\ntype IconSlotType =\n | IconName\n | ReactElement<IconProps>\n | ((iconProps: IconPropsWithoutName) => ReactElement<IconProps>);\n\ninterface IconSlotProps extends IconPropsWithoutName {\n ref?: Ref<RNText>;\n /** The icon to render. Can be a UDS icon, an Icon component, ReactNode, or a function that returns a ReactNode. */\n icon?: IconSlotType;\n /** Props to spread onto the icon. */\n}\n\n/**\n * **🔌 A helper container to render icons flexibly**\n *\n * @description\n * Useful in components that use icons and have a startIcon and endIcon. It allows\n * consumers to pass in a standard UDS icon name, an Icon component, or a render function\n * for custom rendering.\n *\n * @example\n * ```tsx\n * import { IconSlot } from '@yahoo/uds-mobile';\n *\n * // Using icon name (preferred - stable reference, no useMemo needed)\n * <IconSlot icon=\"Info\" size=\"md\" variant=\"fill\" />\n *\n * // Using Icon component\n * <IconSlot icon={<Icon name=\"Info\" variant=\"fill\" />} />\n *\n * // Using render function\n * <IconSlot icon={(props) => <Icon name=\"Info\" {...props} variant=\"fill\" />} />\n * ```\n *\n * @usage\n * - Pass icon name for simple usage\n * - Pass Icon component for custom props\n * - Pass function for dynamic rendering\n */\nconst IconSlot = memo(function IconSlot({ icon, ref, ...props }: IconSlotProps) {\n if (!icon) {\n return null;\n }\n\n if (typeof icon === 'string') {\n return <Icon ref={ref} name={icon} {...props} />;\n }\n\n if (isFunction(icon)) {\n const iconEl = icon(props);\n return isValidElement(iconEl) ? cloneElement(iconEl, { ...props } as Partial<IconProps>) : null;\n }\n\n return isValidElement(icon)\n ? cloneElement(icon, {\n ...props,\n ...icon.props, // user's props on <Icon>\n } as Partial<IconProps>)\n : null;\n});\n\nIconSlot.displayName = 'IconSlot';\n\nexport { IconSlot, type IconSlotProps, type IconSlotType };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,WAAW,KAAK,SAASA,WAAS,EAAE,MAAM,KAAK,GAAG,SAAwB;AAC9E,KAAI,CAAC,KACH,QAAO;AAGT,KAAI,OAAO,SAAS,SAClB,QAAO,oBAAC;EAAU;EAAK,MAAM;EAAM,GAAI;GAAS;AAGlD,KAAI,WAAW,KAAK,EAAE;EACpB,MAAM,SAAS,KAAK,MAAM;AAC1B,SAAO,eAAe,OAAO,GAAG,aAAa,QAAQ,EAAE,GAAG,OAAO,CAAuB,GAAG;;AAG7F,QAAO,eAAe,KAAK,GACvB,aAAa,MAAM;EACjB,GAAG;EACH,GAAG,KAAK;EACT,CAAuB,GACxB;EACJ;AAEF,SAAS,cAAc"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
3
|
+
let react = require("react");
|
|
4
|
+
let react_native = require("react-native");
|
|
5
|
+
let generated_styles = require("../../generated/styles");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
|
|
8
|
+
//#region src/components/Image.tsx
|
|
9
|
+
const CONTENT_FIT_TO_RESIZE_MODE = {
|
|
10
|
+
cover: "cover",
|
|
11
|
+
contain: "contain",
|
|
12
|
+
fill: "stretch",
|
|
13
|
+
none: "center",
|
|
14
|
+
"scale-down": "contain"
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* **A component for displaying images**
|
|
18
|
+
*
|
|
19
|
+
* @description
|
|
20
|
+
* Wrapper for the React Native Image component with UDS styling props.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* import { Image } from '~/components/ui/Image';
|
|
25
|
+
*
|
|
26
|
+
* <Image src="https://example.com/image.png" width={200} height={150} />
|
|
27
|
+
* <Image src={require('./local-image.png')} contentFit="cover" borderRadius="md" />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const Image = (0, react.memo)(function Image$1({ src, alt, width, height, contentFit = "cover", style, backgroundColor, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, flexWrap, justifyContent, display, overflow, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, columnGap, rowGap, ref, ...props }) {
|
|
31
|
+
generated_styles.styles.useVariants({
|
|
32
|
+
backgroundColor,
|
|
33
|
+
borderRadius,
|
|
34
|
+
borderTopStartRadius,
|
|
35
|
+
borderTopEndRadius,
|
|
36
|
+
borderBottomStartRadius,
|
|
37
|
+
borderBottomEndRadius,
|
|
38
|
+
borderColor,
|
|
39
|
+
borderStartColor,
|
|
40
|
+
borderEndColor,
|
|
41
|
+
borderTopColor,
|
|
42
|
+
borderBottomColor,
|
|
43
|
+
borderWidth,
|
|
44
|
+
borderVerticalWidth,
|
|
45
|
+
borderHorizontalWidth,
|
|
46
|
+
borderStartWidth,
|
|
47
|
+
borderEndWidth,
|
|
48
|
+
borderTopWidth,
|
|
49
|
+
borderBottomWidth,
|
|
50
|
+
alignContent,
|
|
51
|
+
alignItems,
|
|
52
|
+
alignSelf,
|
|
53
|
+
flex,
|
|
54
|
+
flexDirection,
|
|
55
|
+
flexGrow,
|
|
56
|
+
flexShrink,
|
|
57
|
+
flexWrap,
|
|
58
|
+
justifyContent,
|
|
59
|
+
display,
|
|
60
|
+
overflow,
|
|
61
|
+
spacing,
|
|
62
|
+
spacingHorizontal,
|
|
63
|
+
spacingVertical,
|
|
64
|
+
spacingBottom,
|
|
65
|
+
spacingEnd,
|
|
66
|
+
spacingStart,
|
|
67
|
+
spacingTop,
|
|
68
|
+
offset,
|
|
69
|
+
offsetVertical,
|
|
70
|
+
offsetHorizontal,
|
|
71
|
+
offsetBottom,
|
|
72
|
+
offsetEnd,
|
|
73
|
+
offsetStart,
|
|
74
|
+
offsetTop,
|
|
75
|
+
columnGap,
|
|
76
|
+
rowGap
|
|
77
|
+
});
|
|
78
|
+
const source = (0, react.useMemo)(() => typeof src === "string" ? { uri: src } : src, [src]);
|
|
79
|
+
const imageStyles = (0, react.useMemo)(() => [
|
|
80
|
+
generated_styles.styles.foundation,
|
|
81
|
+
{
|
|
82
|
+
width,
|
|
83
|
+
height
|
|
84
|
+
},
|
|
85
|
+
style
|
|
86
|
+
], [
|
|
87
|
+
generated_styles.styles.foundation,
|
|
88
|
+
width,
|
|
89
|
+
height,
|
|
90
|
+
style
|
|
91
|
+
]);
|
|
92
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Image, {
|
|
93
|
+
ref,
|
|
94
|
+
source,
|
|
95
|
+
accessibilityLabel: alt,
|
|
96
|
+
resizeMode: CONTENT_FIT_TO_RESIZE_MODE[contentFit],
|
|
97
|
+
style: imageStyles,
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
Image.displayName = "Image";
|
|
102
|
+
|
|
103
|
+
//#endregion
|
|
104
|
+
exports.Image = Image;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalImageProps } from "../uds/dist/tokens/types.cjs";
|
|
3
|
+
import * as react15 from "react";
|
|
4
|
+
import { Ref } from "react";
|
|
5
|
+
import { Image as Image$1, ImageProps as ImageProps$1 } from "react-native";
|
|
6
|
+
import { StyleProps } from "../../generated/styles";
|
|
7
|
+
|
|
8
|
+
//#region src/components/Image.d.ts
|
|
9
|
+
type ContentFit = NonNullable<UniversalImageProps['contentFit']>;
|
|
10
|
+
interface ImageProps extends Omit<ImageProps$1, 'source' | 'src' | 'width' | 'height' | 'borderRadius'> {
|
|
11
|
+
ref?: Ref<Image$1>;
|
|
12
|
+
/** Image source URL or require() */
|
|
13
|
+
src: UniversalImageProps['src'];
|
|
14
|
+
/** Alt text for accessibility */
|
|
15
|
+
alt?: string;
|
|
16
|
+
/** Image width */
|
|
17
|
+
width?: number;
|
|
18
|
+
/** Image height */
|
|
19
|
+
height?: number;
|
|
20
|
+
/** How to fit the image within its container */
|
|
21
|
+
contentFit?: ContentFit;
|
|
22
|
+
backgroundColor?: StyleProps['backgroundColor'];
|
|
23
|
+
borderRadius?: StyleProps['borderRadius'];
|
|
24
|
+
borderTopStartRadius?: StyleProps['borderTopStartRadius'];
|
|
25
|
+
borderTopEndRadius?: StyleProps['borderTopEndRadius'];
|
|
26
|
+
borderBottomStartRadius?: StyleProps['borderBottomStartRadius'];
|
|
27
|
+
borderBottomEndRadius?: StyleProps['borderBottomEndRadius'];
|
|
28
|
+
borderColor?: StyleProps['borderColor'];
|
|
29
|
+
borderStartColor?: StyleProps['borderStartColor'];
|
|
30
|
+
borderEndColor?: StyleProps['borderEndColor'];
|
|
31
|
+
borderTopColor?: StyleProps['borderTopColor'];
|
|
32
|
+
borderBottomColor?: StyleProps['borderBottomColor'];
|
|
33
|
+
borderWidth?: StyleProps['borderWidth'];
|
|
34
|
+
borderVerticalWidth?: StyleProps['borderVerticalWidth'];
|
|
35
|
+
borderHorizontalWidth?: StyleProps['borderHorizontalWidth'];
|
|
36
|
+
borderStartWidth?: StyleProps['borderStartWidth'];
|
|
37
|
+
borderEndWidth?: StyleProps['borderEndWidth'];
|
|
38
|
+
borderTopWidth?: StyleProps['borderTopWidth'];
|
|
39
|
+
borderBottomWidth?: StyleProps['borderBottomWidth'];
|
|
40
|
+
alignContent?: StyleProps['alignContent'];
|
|
41
|
+
alignItems?: StyleProps['alignItems'];
|
|
42
|
+
alignSelf?: StyleProps['alignSelf'];
|
|
43
|
+
flex?: StyleProps['flex'];
|
|
44
|
+
flexDirection?: StyleProps['flexDirection'];
|
|
45
|
+
flexGrow?: StyleProps['flexGrow'];
|
|
46
|
+
flexShrink?: StyleProps['flexShrink'];
|
|
47
|
+
flexWrap?: StyleProps['flexWrap'];
|
|
48
|
+
justifyContent?: StyleProps['justifyContent'];
|
|
49
|
+
display?: StyleProps['display'];
|
|
50
|
+
overflow?: StyleProps['overflow'];
|
|
51
|
+
spacing?: StyleProps['spacing'];
|
|
52
|
+
spacingHorizontal?: StyleProps['spacingHorizontal'];
|
|
53
|
+
spacingVertical?: StyleProps['spacingVertical'];
|
|
54
|
+
spacingBottom?: StyleProps['spacingBottom'];
|
|
55
|
+
spacingEnd?: StyleProps['spacingEnd'];
|
|
56
|
+
spacingStart?: StyleProps['spacingStart'];
|
|
57
|
+
spacingTop?: StyleProps['spacingTop'];
|
|
58
|
+
offset?: StyleProps['offset'];
|
|
59
|
+
offsetVertical?: StyleProps['offsetVertical'];
|
|
60
|
+
offsetHorizontal?: StyleProps['offsetHorizontal'];
|
|
61
|
+
offsetBottom?: StyleProps['offsetBottom'];
|
|
62
|
+
offsetEnd?: StyleProps['offsetEnd'];
|
|
63
|
+
offsetStart?: StyleProps['offsetStart'];
|
|
64
|
+
offsetTop?: StyleProps['offsetTop'];
|
|
65
|
+
columnGap?: StyleProps['columnGap'];
|
|
66
|
+
rowGap?: StyleProps['rowGap'];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* **A component for displaying images**
|
|
70
|
+
*
|
|
71
|
+
* @description
|
|
72
|
+
* Wrapper for the React Native Image component with UDS styling props.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* import { Image } from '~/components/ui/Image';
|
|
77
|
+
*
|
|
78
|
+
* <Image src="https://example.com/image.png" width={200} height={150} />
|
|
79
|
+
* <Image src={require('./local-image.png')} contentFit="cover" borderRadius="md" />
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
declare const Image: react15.NamedExoticComponent<ImageProps>;
|
|
83
|
+
//#endregion
|
|
84
|
+
export { Image, type ImageProps };
|
|
85
|
+
//# sourceMappingURL=Image.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.cts","names":[],"sources":["../../src/components/Image.tsx"],"sourcesContent":[],"mappings":";;;;;;;;KASK,UAAA,GAAa,YAAY;UAUpB,UAAA,SAAmB,KAC3B;EAXG,GAAA,CAAA,EAcG,GAdH,CAcO,OAdG,CAAA;EAUL;EACR,GAAA,EAKK,mBALL,CAAA,KAAA,CAAA;EAGU;EAAJ,GAAA,CAAA,EAAA,MAAA;EAED;EAQQ,KAAA,CAAA,EAAA,MAAA;EAEK;EAEH,MAAA,CAAA,EAAA,MAAA;EACQ;EACF,UAAA,CAAA,EANR,UAMQ;EACK,eAAA,CAAA,EALR,UAKQ,CAAA,iBAAA,CAAA;EACF,YAAA,CAAA,EAJT,UAIS,CAAA,cAAA,CAAA;EACV,oBAAA,CAAA,EAJS,UAIT,CAAA,sBAAA,CAAA;EACK,kBAAA,CAAA,EA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,CAAA,EAJH,UAIG,CAAA,SAAA,CAAA;EACE,iBAAA,CAAA,EAJK,UAIL,CAAA,mBAAA,CAAA;EACF,eAAA,CAAA,EAJK,UAIL,CAAA,iBAAA,CAAA;EACJ,aAAA,CAAA,EAJO,UAIP,CAAA,eAAA,CAAA;EACQ,UAAA,CAAA,EAJJ,UAII,CAAA,YAAA,CAAA;EACE,YAAA,CAAA,EAJJ,UAII,CAAA,cAAA,CAAA;EACJ,UAAA,CAAA,EAJF,UAIE,CAAA,YAAA,CAAA;EACH,MAAA,CAAA,EAJH,UAIG,CAAA,QAAA,CAAA;EACE,cAAA,CAAA,EAJG,UAIH,CAAA,gBAAA,CAAA;EACF,gBAAA,CAAA,EAJO,UAIP,CAAA,kBAAA,CAAA;EACA,YAAA,CAAA,EAJG,UAIH,CAAA,cAAA,CAAA;EACH,SAAA,CAAA,EAJG,UAIH,CAAA,WAAA,CAAA;EAhEkB,WAAA,CAAA,EA6Db,UA7Da,CAAA,aAAA,CAAA;EAAI,SAAA,CAAA,EA8DnB,UA9DmB,CAAA,WAAA,CAAA;EAiF3B,SAmIJ,CAAA,EArJY,UAkBH,CAAA,WAAA,CAAA;WAjBA;;;;;;;;;;;;;;;;cAiBL,OAAK,OAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
import { UniversalImageProps } from "../uds/dist/tokens/types.mjs";
|
|
3
|
+
import * as react7 from "react";
|
|
4
|
+
import { Ref } from "react";
|
|
5
|
+
import { Image as Image$1, ImageProps as ImageProps$1 } from "react-native";
|
|
6
|
+
import { StyleProps } from "../../generated/styles";
|
|
7
|
+
|
|
8
|
+
//#region src/components/Image.d.ts
|
|
9
|
+
type ContentFit = NonNullable<UniversalImageProps['contentFit']>;
|
|
10
|
+
interface ImageProps extends Omit<ImageProps$1, 'source' | 'src' | 'width' | 'height' | 'borderRadius'> {
|
|
11
|
+
ref?: Ref<Image$1>;
|
|
12
|
+
/** Image source URL or require() */
|
|
13
|
+
src: UniversalImageProps['src'];
|
|
14
|
+
/** Alt text for accessibility */
|
|
15
|
+
alt?: string;
|
|
16
|
+
/** Image width */
|
|
17
|
+
width?: number;
|
|
18
|
+
/** Image height */
|
|
19
|
+
height?: number;
|
|
20
|
+
/** How to fit the image within its container */
|
|
21
|
+
contentFit?: ContentFit;
|
|
22
|
+
backgroundColor?: StyleProps['backgroundColor'];
|
|
23
|
+
borderRadius?: StyleProps['borderRadius'];
|
|
24
|
+
borderTopStartRadius?: StyleProps['borderTopStartRadius'];
|
|
25
|
+
borderTopEndRadius?: StyleProps['borderTopEndRadius'];
|
|
26
|
+
borderBottomStartRadius?: StyleProps['borderBottomStartRadius'];
|
|
27
|
+
borderBottomEndRadius?: StyleProps['borderBottomEndRadius'];
|
|
28
|
+
borderColor?: StyleProps['borderColor'];
|
|
29
|
+
borderStartColor?: StyleProps['borderStartColor'];
|
|
30
|
+
borderEndColor?: StyleProps['borderEndColor'];
|
|
31
|
+
borderTopColor?: StyleProps['borderTopColor'];
|
|
32
|
+
borderBottomColor?: StyleProps['borderBottomColor'];
|
|
33
|
+
borderWidth?: StyleProps['borderWidth'];
|
|
34
|
+
borderVerticalWidth?: StyleProps['borderVerticalWidth'];
|
|
35
|
+
borderHorizontalWidth?: StyleProps['borderHorizontalWidth'];
|
|
36
|
+
borderStartWidth?: StyleProps['borderStartWidth'];
|
|
37
|
+
borderEndWidth?: StyleProps['borderEndWidth'];
|
|
38
|
+
borderTopWidth?: StyleProps['borderTopWidth'];
|
|
39
|
+
borderBottomWidth?: StyleProps['borderBottomWidth'];
|
|
40
|
+
alignContent?: StyleProps['alignContent'];
|
|
41
|
+
alignItems?: StyleProps['alignItems'];
|
|
42
|
+
alignSelf?: StyleProps['alignSelf'];
|
|
43
|
+
flex?: StyleProps['flex'];
|
|
44
|
+
flexDirection?: StyleProps['flexDirection'];
|
|
45
|
+
flexGrow?: StyleProps['flexGrow'];
|
|
46
|
+
flexShrink?: StyleProps['flexShrink'];
|
|
47
|
+
flexWrap?: StyleProps['flexWrap'];
|
|
48
|
+
justifyContent?: StyleProps['justifyContent'];
|
|
49
|
+
display?: StyleProps['display'];
|
|
50
|
+
overflow?: StyleProps['overflow'];
|
|
51
|
+
spacing?: StyleProps['spacing'];
|
|
52
|
+
spacingHorizontal?: StyleProps['spacingHorizontal'];
|
|
53
|
+
spacingVertical?: StyleProps['spacingVertical'];
|
|
54
|
+
spacingBottom?: StyleProps['spacingBottom'];
|
|
55
|
+
spacingEnd?: StyleProps['spacingEnd'];
|
|
56
|
+
spacingStart?: StyleProps['spacingStart'];
|
|
57
|
+
spacingTop?: StyleProps['spacingTop'];
|
|
58
|
+
offset?: StyleProps['offset'];
|
|
59
|
+
offsetVertical?: StyleProps['offsetVertical'];
|
|
60
|
+
offsetHorizontal?: StyleProps['offsetHorizontal'];
|
|
61
|
+
offsetBottom?: StyleProps['offsetBottom'];
|
|
62
|
+
offsetEnd?: StyleProps['offsetEnd'];
|
|
63
|
+
offsetStart?: StyleProps['offsetStart'];
|
|
64
|
+
offsetTop?: StyleProps['offsetTop'];
|
|
65
|
+
columnGap?: StyleProps['columnGap'];
|
|
66
|
+
rowGap?: StyleProps['rowGap'];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* **A component for displaying images**
|
|
70
|
+
*
|
|
71
|
+
* @description
|
|
72
|
+
* Wrapper for the React Native Image component with UDS styling props.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* import { Image } from '~/components/ui/Image';
|
|
77
|
+
*
|
|
78
|
+
* <Image src="https://example.com/image.png" width={200} height={150} />
|
|
79
|
+
* <Image src={require('./local-image.png')} contentFit="cover" borderRadius="md" />
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
declare const Image: react7.NamedExoticComponent<ImageProps>;
|
|
83
|
+
//#endregion
|
|
84
|
+
export { Image, type ImageProps };
|
|
85
|
+
//# sourceMappingURL=Image.d.mts.map
|
|
@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