@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
package/README.md
ADDED
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
# @yahoo/uds-mobile
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
|
|
5
|
+
- [Overview](#overview)
|
|
6
|
+
- [Installation](#installation)
|
|
7
|
+
- [Quick Start](#quick-start)
|
|
8
|
+
- [Components](#components)
|
|
9
|
+
- [Icons](#icons)
|
|
10
|
+
- [Fonts](#fonts)
|
|
11
|
+
- [CLI](#cli)
|
|
12
|
+
- [Contributing](#contributing)
|
|
13
|
+
- [API Reference](#api-reference)
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`@yahoo/uds-mobile` brings UDS to React Native. It provides:
|
|
18
|
+
|
|
19
|
+
- **Pre-built Components**: Avatar, Badge, Button, Checkbox, Chip, Icon, IconButton, Image, Input, Link, Radio, Switch, Text, and layout primitives (Box, VStack, HStack, Screen)
|
|
20
|
+
- **Theming**: Full light/dark mode support with automatic system preference detection
|
|
21
|
+
- **Design Token Integration**: Colors, typography, spacing, and motion configs synced from UDS tokens
|
|
22
|
+
- **Animations**: Smooth, physics-based animations using Reanimated with motion parity to web
|
|
23
|
+
- **Icon Support**: Icon font and SVG icon rendering with full UDS icon library
|
|
24
|
+
|
|
25
|
+
### Key Dependencies
|
|
26
|
+
|
|
27
|
+
| Package | Purpose | Required |
|
|
28
|
+
| ---------------------------- | -------------------------------------------- | -------- |
|
|
29
|
+
| `react-native-unistyles` | Styling and theming engine | Yes |
|
|
30
|
+
| `react-native-reanimated` | Animations | Yes |
|
|
31
|
+
| `react-native-svg` | SVG icon rendering | Yes |
|
|
32
|
+
| `react-native-nitro-modules` | Native module system (required by Unistyles) | Yes |
|
|
33
|
+
| `react-native-edge-to-edge` | Edge-to-edge display (required by Unistyles) | Yes |
|
|
34
|
+
| `expo-font` | Font loading (for bundled UDS fonts) | Optional |
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# npm
|
|
40
|
+
npm install @yahoo/uds-mobile
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Supported Versions
|
|
44
|
+
|
|
45
|
+
| Dependency | Supported Version |
|
|
46
|
+
| ----------------------- | ----------------- |
|
|
47
|
+
| Expo SDK | 54 |
|
|
48
|
+
| React Native | ≥ 0.81.0 |
|
|
49
|
+
| React | ≥ 19.0.0 |
|
|
50
|
+
| react-native-unistyles | ≥ 3.0.20 |
|
|
51
|
+
| react-native-reanimated | ~4.1.x |
|
|
52
|
+
|
|
53
|
+
> **Note**: This package is tested against Expo SDK 54. While it may work with other versions, we cannot guarantee compatibility. If you encounter issues on a different Expo SDK version, please check for peer dependency conflicts.
|
|
54
|
+
|
|
55
|
+
### Peer Dependencies
|
|
56
|
+
|
|
57
|
+
This package requires specific versions of React Native libraries as peer dependencies. Your project must have compatible versions installed for `@yahoo/uds-mobile` to work correctly.
|
|
58
|
+
|
|
59
|
+
Install the required peer dependencies:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Required peer dependencies
|
|
63
|
+
expo install react-native-unistyles react-native-reanimated react-native-svg react-native-nitro-modules react-native-edge-to-edge
|
|
64
|
+
|
|
65
|
+
# Optional: For using bundled UDS fonts via expo-font plugin
|
|
66
|
+
expo install expo-font
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Using `expo install` ensures you get versions compatible with your Expo SDK. If you encounter version conflicts, check the `peerDependencies` in the package's `package.json` for the exact version ranges required.
|
|
70
|
+
|
|
71
|
+
### Expo Configuration
|
|
72
|
+
|
|
73
|
+
For Expo apps, add the expo-font plugin to your `app.config.ts` and import fonts from the mobile package:
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import { fonts } from '@yahoo/uds-mobile/fonts';
|
|
77
|
+
|
|
78
|
+
export default {
|
|
79
|
+
plugins: [
|
|
80
|
+
['expo-font', { fonts }],
|
|
81
|
+
// ... other plugins
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
> **⚠️ Development Build Required**: `react-native-unistyles` uses native modules and does not work with Expo Go. You must use a [development build](https://docs.expo.dev/develop/development-builds/introduction/) or prebuild your app. See the [Unistyles setup guide](https://www.unistyl.es/v3/start/setup) for detailed instructions.
|
|
87
|
+
|
|
88
|
+
## Quick Start
|
|
89
|
+
|
|
90
|
+
### 1. Configure Babel
|
|
91
|
+
|
|
92
|
+
Add the Unistyles and Reanimated babel plugins to your `babel.config.js`:
|
|
93
|
+
|
|
94
|
+
```javascript
|
|
95
|
+
module.exports = function (api) {
|
|
96
|
+
api.cache(true);
|
|
97
|
+
return {
|
|
98
|
+
presets: ['babel-preset-expo'],
|
|
99
|
+
plugins: [
|
|
100
|
+
[
|
|
101
|
+
'react-native-unistyles/plugin',
|
|
102
|
+
{
|
|
103
|
+
root: 'src',
|
|
104
|
+
autoProcessImports: ['@yahoo/uds-mobile'],
|
|
105
|
+
autoProcessPaths: ['@yahoo/uds-mobile'],
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
['react-native-reanimated/plugin'], // Must be last
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### 2. Generate Theme
|
|
115
|
+
|
|
116
|
+
Run the CLI to generate theme files from your UDS config:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Using a config ID from UDS API
|
|
120
|
+
npx uds-mobile sync --id YOUR_CONFIG_ID
|
|
121
|
+
|
|
122
|
+
# Or using a local config file
|
|
123
|
+
npx uds-mobile sync ./uds.config.ts
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
This generates `src/lib/unistyles.uds.ts` containing your theme tokens.
|
|
127
|
+
|
|
128
|
+
### 3. Configure Unistyles
|
|
129
|
+
|
|
130
|
+
Create a configuration file that initializes Unistyles with your generated theme:
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
// src/lib/unistyles.ts
|
|
134
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
135
|
+
import { themes, breakpoints } from './unistyles.uds'; // Generated file
|
|
136
|
+
|
|
137
|
+
StyleSheet.configure({
|
|
138
|
+
themes,
|
|
139
|
+
breakpoints,
|
|
140
|
+
settings: {
|
|
141
|
+
adaptiveThemes: true, // Auto-switch based on system preference
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// Type augmentation for TypeScript support
|
|
146
|
+
declare module 'react-native-unistyles' {
|
|
147
|
+
export interface UnistylesBreakpoints extends typeof breakpoints {}
|
|
148
|
+
export interface UnistylesThemes extends typeof themes {}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Update your entry point to import Unistyles **before** any other imports:
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
// src/index.ts
|
|
156
|
+
import './lib/unistyles'; // Must be first!
|
|
157
|
+
// ... your app's existing entry code
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
> **Why?** Unistyles must be configured before any `StyleSheet.create()` calls execute. Since UDS Mobile components use Unistyles internally, the configuration must happen before any component imports.
|
|
161
|
+
|
|
162
|
+
### 4. Rebuild Your App
|
|
163
|
+
|
|
164
|
+
After adding native modules, rebuild your app:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
npx expo prebuild --clean
|
|
168
|
+
npx expo run:ios # or run:android
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 5. Use Components
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
import { VStack } from '@yahoo/uds-mobile/VStack';
|
|
175
|
+
import { Text } from '@yahoo/uds-mobile/Text';
|
|
176
|
+
import { Button } from '@yahoo/uds-mobile/Button';
|
|
177
|
+
import { Badge } from '@yahoo/uds-mobile/Badge';
|
|
178
|
+
import { Avatar } from '@yahoo/uds-mobile/Avatar';
|
|
179
|
+
|
|
180
|
+
function MyComponent() {
|
|
181
|
+
return (
|
|
182
|
+
<VStack spacing="4">
|
|
183
|
+
<Text variant="title1">Welcome!</Text>
|
|
184
|
+
<Avatar name="John Doe" size="lg" />
|
|
185
|
+
<Badge variant="success">Active</Badge>
|
|
186
|
+
<Button onPress={() => console.log('pressed')}>Get Started</Button>
|
|
187
|
+
</VStack>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Benefits of deep imports:**
|
|
193
|
+
|
|
194
|
+
- **Smaller bundle size** — Only loads components you actually use
|
|
195
|
+
- **Faster builds** — Tree-shaking eliminates unused code
|
|
196
|
+
- **Optional dependencies** — Future components with optional peer deps won't affect your app
|
|
197
|
+
|
|
198
|
+
### 6. Toggle Light/Dark Mode
|
|
199
|
+
|
|
200
|
+
Use `useUnistyles` to subscribe to theme changes and `UnistylesRuntime` to toggle:
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
import { Icon } from '@yahoo/uds-mobile/Icon';
|
|
204
|
+
import { Pressable } from '@yahoo/uds-mobile/Pressable';
|
|
205
|
+
import { UnistylesRuntime, useUnistyles } from 'react-native-unistyles';
|
|
206
|
+
|
|
207
|
+
function ThemeToggle() {
|
|
208
|
+
const { rt } = useUnistyles();
|
|
209
|
+
const isDark = rt.themeName === 'dark';
|
|
210
|
+
|
|
211
|
+
const toggleTheme = () => {
|
|
212
|
+
UnistylesRuntime.setTheme(isDark ? 'light' : 'dark');
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
return (
|
|
216
|
+
<Pressable onPress={toggleTheme} hitSlop={20}>
|
|
217
|
+
<Icon name={isDark ? 'CrescentMoon' : 'Sun'} size="sm" color="primary" variant="outline" />
|
|
218
|
+
</Pressable>
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
If you configured `adaptiveThemes: true`, the theme automatically follows the system preference. Calling `UnistylesRuntime.setTheme()` will override this until the app restarts.
|
|
224
|
+
|
|
225
|
+
> **⚠️ Performance Note**: Using `useUnistyles()` causes component re-renders on theme changes, which negates Unistyles' performance benefits. For theme-aware styles, prefer `StyleSheet.create` with a dynamic function instead:
|
|
226
|
+
>
|
|
227
|
+
> ```tsx
|
|
228
|
+
> // ✅ Preferred: No re-renders, styles update automatically
|
|
229
|
+
> const styles = StyleSheet.create((theme) => ({
|
|
230
|
+
> container: { backgroundColor: theme.colors.background.primary },
|
|
231
|
+
> }));
|
|
232
|
+
>
|
|
233
|
+
> // ⚠️ Avoid in hot paths: Causes re-renders
|
|
234
|
+
> const { theme } = useUnistyles();
|
|
235
|
+
> ```
|
|
236
|
+
>
|
|
237
|
+
> Reserve `useUnistyles()` for cases where you need runtime theme values (like the toggle above).
|
|
238
|
+
|
|
239
|
+
### Debugging Re-renders
|
|
240
|
+
|
|
241
|
+
React Native DevTools includes a feature to highlight components when they re-render, helping you identify performance issues:
|
|
242
|
+
|
|
243
|
+
1. Open React Native DevTools (press `j` in Metro terminal)
|
|
244
|
+
2. Go to the **React Components** panel
|
|
245
|
+
3. Click the **View Settings** (`⚙︎`) icon
|
|
246
|
+
4. Enable **"Highlight updates when components render"**
|
|
247
|
+
|
|
248
|
+

|
|
249
|
+
|
|
250
|
+
Components will flash with a colored border when they re-render. This makes it easy to spot unnecessary re-renders caused by `useUnistyles()` or other state changes.
|
|
251
|
+
|
|
252
|
+
> **💡 Testing your setup**: A good way to verify Unistyles is configured correctly is to toggle light/dark mode with highlighting enabled. If set up properly, only the theme toggle button should re-render — not the rest of your app. If you see the entire screen flash, you likely have `useUnistyles()` calls in components that should be using `StyleSheet.create` with dynamic functions instead.
|
|
253
|
+
|
|
254
|
+
See the [React Native DevTools docs](https://reactnative.dev/docs/react-native-devtools#react-components) for more debugging features.
|
|
255
|
+
|
|
256
|
+
### Extending the Theme
|
|
257
|
+
|
|
258
|
+
To add custom theme values alongside UDS tokens, merge your additions with the generated theme:
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
// src/lib/unistyles.ts
|
|
262
|
+
import { StyleSheet } from 'react-native-unistyles';
|
|
263
|
+
import { breakpoints, themes } from './unistyles.uds';
|
|
264
|
+
|
|
265
|
+
// Extend with your app-specific tokens
|
|
266
|
+
const extendedThemes = {
|
|
267
|
+
light: {
|
|
268
|
+
...themes.light,
|
|
269
|
+
// Add custom values
|
|
270
|
+
custom: {
|
|
271
|
+
headerHeight: 64,
|
|
272
|
+
tabBarHeight: 80,
|
|
273
|
+
cardShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
dark: {
|
|
277
|
+
...themes.dark,
|
|
278
|
+
custom: {
|
|
279
|
+
headerHeight: 64,
|
|
280
|
+
tabBarHeight: 80,
|
|
281
|
+
cardShadow: '0 2px 8px rgba(0, 0, 0, 0.3)',
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
} as const;
|
|
285
|
+
|
|
286
|
+
StyleSheet.configure({
|
|
287
|
+
themes: extendedThemes,
|
|
288
|
+
breakpoints,
|
|
289
|
+
settings: {
|
|
290
|
+
adaptiveThemes: true,
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
// Update type augmentation to include custom values
|
|
295
|
+
declare module 'react-native-unistyles' {
|
|
296
|
+
export interface UnistylesBreakpoints extends typeof breakpoints {}
|
|
297
|
+
export interface UnistylesThemes extends typeof extendedThemes {}
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
Now you can use both UDS tokens and your custom values in stylesheets:
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
const styles = StyleSheet.create((theme) => ({
|
|
305
|
+
header: {
|
|
306
|
+
height: theme.custom.headerHeight,
|
|
307
|
+
backgroundColor: theme.colors.background.primary, // UDS token
|
|
308
|
+
},
|
|
309
|
+
}));
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
## Components
|
|
313
|
+
|
|
314
|
+
### Available Components
|
|
315
|
+
|
|
316
|
+
| Component | Description |
|
|
317
|
+
| ------------ | ----------------------------------------------- |
|
|
318
|
+
| `Avatar` | User avatars with image, initials, or icon |
|
|
319
|
+
| `Badge` | Status indicators and labels |
|
|
320
|
+
| `Box` | Flexible container with layout props |
|
|
321
|
+
| `Button` | Interactive button with variants and animations |
|
|
322
|
+
| `Checkbox` | Selectable checkbox with label |
|
|
323
|
+
| `Chip` | Compact elements for filters and selections |
|
|
324
|
+
| `HStack` | Horizontal flex container |
|
|
325
|
+
| `Icon` | Icon rendering (font or SVG) |
|
|
326
|
+
| `IconButton` | Icon-only button |
|
|
327
|
+
| `IconSlot` | Flexible icon slot for component composition |
|
|
328
|
+
| `Image` | Image component with loading states |
|
|
329
|
+
| `Input` | Text input with label and helper text |
|
|
330
|
+
| `Link` | Inline text links with icons |
|
|
331
|
+
| `Pressable` | Base pressable component |
|
|
332
|
+
| `Radio` | Radio button with label |
|
|
333
|
+
| `Screen` | Screen container with safe area handling |
|
|
334
|
+
| `Switch` | Toggle switch with animations |
|
|
335
|
+
| `Text` | Typography component with variants |
|
|
336
|
+
| `VStack` | Vertical flex container |
|
|
337
|
+
|
|
338
|
+
### Usage Examples
|
|
339
|
+
|
|
340
|
+
#### Button with Icons
|
|
341
|
+
|
|
342
|
+
```tsx
|
|
343
|
+
<Button
|
|
344
|
+
variant="primary"
|
|
345
|
+
size="lg"
|
|
346
|
+
startIcon="Add"
|
|
347
|
+
onPress={handlePress}
|
|
348
|
+
>
|
|
349
|
+
Create New
|
|
350
|
+
</Button>
|
|
351
|
+
|
|
352
|
+
<Button
|
|
353
|
+
variant="secondary"
|
|
354
|
+
loading
|
|
355
|
+
disabled
|
|
356
|
+
>
|
|
357
|
+
Saving...
|
|
358
|
+
</Button>
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
#### Form Controls
|
|
362
|
+
|
|
363
|
+
```tsx
|
|
364
|
+
<VStack spacing="4">
|
|
365
|
+
<Input
|
|
366
|
+
label="Email"
|
|
367
|
+
placeholder="Enter your email"
|
|
368
|
+
helperText="We'll never share your email"
|
|
369
|
+
startIcon="Mail"
|
|
370
|
+
/>
|
|
371
|
+
|
|
372
|
+
<Checkbox checked={agreed} onValueChange={setAgreed} label="I agree to the terms" />
|
|
373
|
+
|
|
374
|
+
<Switch isOn={notifications} onValueChange={setNotifications} label="Enable notifications" />
|
|
375
|
+
</VStack>
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
#### Avatar
|
|
379
|
+
|
|
380
|
+
```tsx
|
|
381
|
+
<Avatar
|
|
382
|
+
name="Jane Doe"
|
|
383
|
+
src="https://example.com/avatar.jpg"
|
|
384
|
+
size="lg"
|
|
385
|
+
/>
|
|
386
|
+
|
|
387
|
+
<Avatar
|
|
388
|
+
name="John Smith"
|
|
389
|
+
abbreviation="firstAndLast" // Shows "JS"
|
|
390
|
+
/>
|
|
391
|
+
|
|
392
|
+
<Avatar showIcon /> // Shows person icon
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
#### Link with Icons
|
|
396
|
+
|
|
397
|
+
```tsx
|
|
398
|
+
<Text variant="body1">
|
|
399
|
+
Read our{' '}
|
|
400
|
+
<Link textVariant="body1" variant="primary" endIcon="ExternalLink">
|
|
401
|
+
Terms of Service
|
|
402
|
+
</Link>
|
|
403
|
+
</Text>
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## Icons
|
|
407
|
+
|
|
408
|
+
### Icon Rendering
|
|
409
|
+
|
|
410
|
+
Icons can be rendered using the font-based `Icon` component or as SVGs:
|
|
411
|
+
|
|
412
|
+
```tsx
|
|
413
|
+
import { Icon } from '@yahoo/uds-mobile/Icon';
|
|
414
|
+
|
|
415
|
+
// Basic usage
|
|
416
|
+
<Icon name="Star" size="md" color="primary" />
|
|
417
|
+
|
|
418
|
+
// With variant
|
|
419
|
+
<Icon name="Heart" variant="fill" size="lg" />
|
|
420
|
+
|
|
421
|
+
// Custom color
|
|
422
|
+
<Icon name="Settings" dangerouslySetColor="#FF5733" />
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Available Icons
|
|
426
|
+
|
|
427
|
+
The icon library includes the full UDS icon set. To see available icons:
|
|
428
|
+
|
|
429
|
+
```typescript
|
|
430
|
+
import { iconNames, multicolorIconNames } from '@yahoo/uds-mobile/Icon';
|
|
431
|
+
|
|
432
|
+
console.log(iconNames); // All icon names
|
|
433
|
+
console.log(multicolorIconNames); // Multi-color icons
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### Animation Patterns
|
|
437
|
+
|
|
438
|
+
#### State-Driven Animations
|
|
439
|
+
|
|
440
|
+
Use `useDerivedValue` instead of `useEffect` + `useSharedValue`:
|
|
441
|
+
|
|
442
|
+
```tsx
|
|
443
|
+
// ✅ Preferred pattern
|
|
444
|
+
const progress = useDerivedValue(() => withTiming(visible ? 1 : 0), [visible]);
|
|
445
|
+
|
|
446
|
+
// ❌ Avoid
|
|
447
|
+
const progress = useSharedValue(0);
|
|
448
|
+
useEffect(() => {
|
|
449
|
+
progress.value = withTiming(visible ? 1 : 0);
|
|
450
|
+
}, [visible]);
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
#### Staggered Animations
|
|
454
|
+
|
|
455
|
+
```tsx
|
|
456
|
+
const progress = useDerivedValue(
|
|
457
|
+
() => withSpring(visible ? 1 : 0, BUTTON_SPRING_CONFIG),
|
|
458
|
+
[visible],
|
|
459
|
+
);
|
|
460
|
+
|
|
461
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
462
|
+
width: interpolate(progress.value, [0, 1], [0, totalWidth]),
|
|
463
|
+
opacity: interpolate(progress.value, [0.5, 1], [0, 1], 'clamp'), // Starts at 50%
|
|
464
|
+
transform: [{ scale: interpolate(progress.value, [0.5, 1], [0.7, 1], 'clamp') }],
|
|
465
|
+
}));
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
## Fonts
|
|
469
|
+
|
|
470
|
+
### Font Handling
|
|
471
|
+
|
|
472
|
+
React Native doesn't support variable fonts, so all fonts are static (one file per weight). The package includes pre-converted fonts for:
|
|
473
|
+
|
|
474
|
+
- Yahoo Product Sans
|
|
475
|
+
- Inter
|
|
476
|
+
- Roboto Mono
|
|
477
|
+
- And other UDS-supported fonts
|
|
478
|
+
|
|
479
|
+
### Font Loading
|
|
480
|
+
|
|
481
|
+
Fonts are automatically loaded via the `expo-font` plugin when configured in `app.config.ts`:
|
|
482
|
+
|
|
483
|
+
```typescript
|
|
484
|
+
import { fonts } from '@yahoo/uds-mobile/fonts';
|
|
485
|
+
|
|
486
|
+
export default {
|
|
487
|
+
plugins: [['expo-font', { fonts }]],
|
|
488
|
+
};
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
## CLI
|
|
492
|
+
|
|
493
|
+
The `uds-mobile` CLI generates React Native theme files from UDS design tokens.
|
|
494
|
+
|
|
495
|
+
### Commands
|
|
496
|
+
|
|
497
|
+
#### `sync`
|
|
498
|
+
|
|
499
|
+
Generates/updates theme files from UDS tokens.
|
|
500
|
+
|
|
501
|
+
```bash
|
|
502
|
+
npx uds-mobile sync [options]
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
**Options:**
|
|
506
|
+
|
|
507
|
+
| Option | Description |
|
|
508
|
+
| ------------------- | -------------------------------------------------------- |
|
|
509
|
+
| `--id <config-id>` | Fetch config by ID from UDS API |
|
|
510
|
+
| `[config]` | Path to local config file (auto-detects `uds.config.ts`) |
|
|
511
|
+
| `--config <path>` | Explicit path to config file |
|
|
512
|
+
| `--output <path>` | Output file path (default: `src/lib/unistyles.uds.ts`) |
|
|
513
|
+
| `--prettier=<path>` | Path to Prettier config (auto-detects if not specified) |
|
|
514
|
+
|
|
515
|
+
**Examples:**
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
# Fetch config from UDS API
|
|
519
|
+
npx uds-mobile sync --id abc123
|
|
520
|
+
|
|
521
|
+
# Use local config file
|
|
522
|
+
npx uds-mobile sync ./uds.config.ts
|
|
523
|
+
|
|
524
|
+
# Custom output location
|
|
525
|
+
npx uds-mobile sync --output ./src/theme.ts
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
### Generated Output
|
|
529
|
+
|
|
530
|
+
The CLI generates a TypeScript file containing:
|
|
531
|
+
|
|
532
|
+
- `themes`: Light and dark theme objects with all design tokens
|
|
533
|
+
- `breakpoints`: Responsive breakpoint definitions
|
|
534
|
+
|
|
535
|
+
```typescript
|
|
536
|
+
// AUTO-GENERATED FILE. DO NOT EDIT.
|
|
537
|
+
export const themes = {
|
|
538
|
+
light: {
|
|
539
|
+
/* ... */
|
|
540
|
+
},
|
|
541
|
+
dark: {
|
|
542
|
+
/* ... */
|
|
543
|
+
},
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
export const breakpoints = {
|
|
547
|
+
/* ... */
|
|
548
|
+
};
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
## Contributing
|
|
552
|
+
|
|
553
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for architecture details, development setup, and internal documentation.
|
|
554
|
+
|
|
555
|
+
## API Reference
|
|
556
|
+
|
|
557
|
+
### Component Props
|
|
558
|
+
|
|
559
|
+
All components export their props types:
|
|
560
|
+
|
|
561
|
+
```typescript
|
|
562
|
+
import type {
|
|
563
|
+
ButtonProps,
|
|
564
|
+
TextProps,
|
|
565
|
+
AvatarProps,
|
|
566
|
+
BadgeProps,
|
|
567
|
+
CheckboxProps,
|
|
568
|
+
ChipProps,
|
|
569
|
+
IconProps,
|
|
570
|
+
IconButtonProps,
|
|
571
|
+
ImageProps,
|
|
572
|
+
InputProps,
|
|
573
|
+
LinkProps,
|
|
574
|
+
RadioProps,
|
|
575
|
+
SwitchProps,
|
|
576
|
+
BoxProps,
|
|
577
|
+
VStackProps,
|
|
578
|
+
HStackProps,
|
|
579
|
+
ScreenProps,
|
|
580
|
+
PressableProps,
|
|
581
|
+
IconSlotProps,
|
|
582
|
+
IconSlotType,
|
|
583
|
+
IconName,
|
|
584
|
+
} from '@yahoo/uds-mobile';
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
### Exports
|
|
588
|
+
|
|
589
|
+
```typescript
|
|
590
|
+
// Components (one import per component)
|
|
591
|
+
import { Avatar } from '@yahoo/uds-mobile/Avatar';
|
|
592
|
+
import { Badge } from '@yahoo/uds-mobile/Badge';
|
|
593
|
+
import { Box } from '@yahoo/uds-mobile/Box';
|
|
594
|
+
import { Button } from '@yahoo/uds-mobile/Button';
|
|
595
|
+
import { Checkbox } from '@yahoo/uds-mobile/Checkbox';
|
|
596
|
+
import { Chip } from '@yahoo/uds-mobile/Chip';
|
|
597
|
+
import { HStack } from '@yahoo/uds-mobile/HStack';
|
|
598
|
+
import { Icon, iconNames, multicolorIconNames } from '@yahoo/uds-mobile/Icon';
|
|
599
|
+
import { IconButton } from '@yahoo/uds-mobile/IconButton';
|
|
600
|
+
import { IconSlot } from '@yahoo/uds-mobile/IconSlot';
|
|
601
|
+
import { Image } from '@yahoo/uds-mobile/Image';
|
|
602
|
+
import { Input } from '@yahoo/uds-mobile/Input';
|
|
603
|
+
import { Link } from '@yahoo/uds-mobile/Link';
|
|
604
|
+
import { Pressable } from '@yahoo/uds-mobile/Pressable';
|
|
605
|
+
import { Radio } from '@yahoo/uds-mobile/Radio';
|
|
606
|
+
import { Screen } from '@yahoo/uds-mobile/Screen';
|
|
607
|
+
import { Switch } from '@yahoo/uds-mobile/Switch';
|
|
608
|
+
import { Text } from '@yahoo/uds-mobile/Text';
|
|
609
|
+
import { VStack } from '@yahoo/uds-mobile/VStack';
|
|
610
|
+
|
|
611
|
+
// Sub-exports
|
|
612
|
+
import { motion, BUTTON_SPRING_CONFIG, SCALE_EFFECTS } from '@yahoo/uds-mobile/motion';
|
|
613
|
+
import { fonts, fontAliasToPostscript } from '@yahoo/uds-mobile/fonts';
|
|
614
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Bootstrap for CLI - runs the built CLI from dist
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
const cliPath = path.join(__dirname, '../dist/bin/uds-mobile.mjs');
|
|
9
|
+
|
|
10
|
+
await import(cliPath);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
|
|
30
|
+
exports.__toESM = __toESM;
|