@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,171 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { IconSlot } from "./IconSlot.mjs";
|
|
3
|
+
import { Text as Text$1 } from "./Text.mjs";
|
|
4
|
+
import { HStack } from "./HStack.mjs";
|
|
5
|
+
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
|
6
|
+
import { AccessibilityInfo, Pressable } from "react-native";
|
|
7
|
+
import { switchStyles } from "../../generated/styles";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { StyleSheet } from "react-native-unistyles";
|
|
10
|
+
import Animated, { useAnimatedStyle, useDerivedValue, withTiming } from "react-native-reanimated";
|
|
11
|
+
import { useAnimatedVariantColor } from "react-native-unistyles/reanimated";
|
|
12
|
+
|
|
13
|
+
//#region src/components/Switch.tsx
|
|
14
|
+
const HANDLE_TRAVEL = {
|
|
15
|
+
md: 20,
|
|
16
|
+
sm: 12
|
|
17
|
+
};
|
|
18
|
+
const ANIMATION_DURATION = 120;
|
|
19
|
+
/**
|
|
20
|
+
* **Switch component for toggling options**
|
|
21
|
+
*
|
|
22
|
+
* @description
|
|
23
|
+
* A switch (also called a toggle) is a binary on/off input control.
|
|
24
|
+
* It allows users to pick between two clearly opposite choices.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* import { Switch } from '@yahoo/uds-mobile';
|
|
29
|
+
*
|
|
30
|
+
* <Switch label="Notifications" />
|
|
31
|
+
* <Switch isOn={enabled} onChange={setEnabled} label="Dark mode" />
|
|
32
|
+
* <Switch onIcon="Check" offIcon="Cross" label="Sync" />
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see The {@link https://uds.build/docs/components/switch Switch Docs} for more info
|
|
36
|
+
*/
|
|
37
|
+
const Switch = memo(function Switch$1({ isOn: isOnProp, defaultIsOn = false, onChange, label, labelPosition = "start", size = "md", onIcon, offIcon, disabled = false, required, accessibilityHint, reduceMotion = false, ref }) {
|
|
38
|
+
const isControlled = isOnProp !== void 0;
|
|
39
|
+
const [internalIsOn, setInternalIsOn] = useState(defaultIsOn);
|
|
40
|
+
const [prefersReducedMotion, setPrefersReducedMotion] = useState(false);
|
|
41
|
+
const isOn = isControlled ? isOnProp : internalIsOn;
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const checkReducedMotion = async () => {
|
|
44
|
+
setPrefersReducedMotion(await AccessibilityInfo.isReduceMotionEnabled());
|
|
45
|
+
};
|
|
46
|
+
checkReducedMotion();
|
|
47
|
+
const subscription = AccessibilityInfo.addEventListener("reduceMotionChanged", setPrefersReducedMotion);
|
|
48
|
+
return () => subscription.remove();
|
|
49
|
+
}, []);
|
|
50
|
+
const animationDuration = reduceMotion || prefersReducedMotion ? 0 : ANIMATION_DURATION;
|
|
51
|
+
const progress = useDerivedValue(() => withTiming(isOn ? 1 : 0, { duration: animationDuration }), [isOn, animationDuration]);
|
|
52
|
+
const travelDistance = HANDLE_TRAVEL[size];
|
|
53
|
+
const handlePress = useCallback(() => {
|
|
54
|
+
if (disabled) return;
|
|
55
|
+
const newValue = !isOn;
|
|
56
|
+
if (!isControlled) setInternalIsOn(newValue);
|
|
57
|
+
onChange?.(newValue);
|
|
58
|
+
}, [
|
|
59
|
+
disabled,
|
|
60
|
+
isOn,
|
|
61
|
+
isControlled,
|
|
62
|
+
onChange
|
|
63
|
+
]);
|
|
64
|
+
switchStyles.useVariants({
|
|
65
|
+
size,
|
|
66
|
+
variant: isOn ? "on" : "off"
|
|
67
|
+
});
|
|
68
|
+
const trackBackgroundColor = useAnimatedVariantColor(switchStyles.switch, "backgroundColor");
|
|
69
|
+
const animatedTrackStyle = useAnimatedStyle(() => {
|
|
70
|
+
"worklet";
|
|
71
|
+
return { backgroundColor: withTiming(trackBackgroundColor.value, { duration: animationDuration }) };
|
|
72
|
+
});
|
|
73
|
+
const animatedHandleStyle = useAnimatedStyle(() => {
|
|
74
|
+
"worklet";
|
|
75
|
+
return { transform: [{ translateX: progress.value * travelDistance }] };
|
|
76
|
+
});
|
|
77
|
+
const rootStyle = useMemo(() => [switchStyles.root, switchStaticStyles.root({ disabled })], [switchStyles.root, disabled]);
|
|
78
|
+
const trackStyle = useMemo(() => [
|
|
79
|
+
switchStyles.switch,
|
|
80
|
+
switchStaticStyles.track,
|
|
81
|
+
animatedTrackStyle
|
|
82
|
+
], [switchStyles.switch, animatedTrackStyle]);
|
|
83
|
+
const handleStyle = useMemo(() => [
|
|
84
|
+
switchStyles.handle,
|
|
85
|
+
switchStaticStyles.handle,
|
|
86
|
+
animatedHandleStyle
|
|
87
|
+
], [switchStyles.handle, animatedHandleStyle]);
|
|
88
|
+
const accessibilityLabel = typeof label === "string" ? label : void 0;
|
|
89
|
+
const resolvedAccessibilityHint = accessibilityHint ?? "Double tap to toggle";
|
|
90
|
+
const resolvedLabel = typeof label === "function" ? label() : label;
|
|
91
|
+
const labelContent = resolvedLabel && /* @__PURE__ */ jsxs(HStack, {
|
|
92
|
+
gap: "2",
|
|
93
|
+
alignItems: "center",
|
|
94
|
+
children: [/* @__PURE__ */ jsx(Text$1, {
|
|
95
|
+
style: switchStyles.text,
|
|
96
|
+
children: resolvedLabel
|
|
97
|
+
}), required && /* @__PURE__ */ jsx(Text$1, {
|
|
98
|
+
color: "alert",
|
|
99
|
+
children: "*"
|
|
100
|
+
})]
|
|
101
|
+
});
|
|
102
|
+
const a11yValue = useMemo(() => ({ text: isOn ? "On" : "Off" }), [isOn]);
|
|
103
|
+
return /* @__PURE__ */ jsxs(Pressable, {
|
|
104
|
+
ref,
|
|
105
|
+
onPress: handlePress,
|
|
106
|
+
disabled,
|
|
107
|
+
accessible: true,
|
|
108
|
+
accessibilityRole: "switch",
|
|
109
|
+
accessibilityState: {
|
|
110
|
+
checked: isOn,
|
|
111
|
+
disabled
|
|
112
|
+
},
|
|
113
|
+
accessibilityLabel,
|
|
114
|
+
accessibilityHint: resolvedAccessibilityHint,
|
|
115
|
+
accessibilityValue: a11yValue,
|
|
116
|
+
style: rootStyle,
|
|
117
|
+
children: [
|
|
118
|
+
labelPosition === "end" && labelContent,
|
|
119
|
+
/* @__PURE__ */ jsx(Animated.View, {
|
|
120
|
+
style: trackStyle,
|
|
121
|
+
importantForAccessibility: "no-hide-descendants",
|
|
122
|
+
children: /* @__PURE__ */ jsxs(Animated.View, {
|
|
123
|
+
style: handleStyle,
|
|
124
|
+
children: [onIcon && isOn && /* @__PURE__ */ jsx(Animated.View, {
|
|
125
|
+
style: switchStaticStyles.iconContainer,
|
|
126
|
+
children: /* @__PURE__ */ jsx(IconSlot, {
|
|
127
|
+
icon: onIcon,
|
|
128
|
+
variant: "fill",
|
|
129
|
+
style: switchStyles.handleIcon
|
|
130
|
+
})
|
|
131
|
+
}), offIcon && !isOn && /* @__PURE__ */ jsx(Animated.View, {
|
|
132
|
+
style: switchStaticStyles.iconContainer,
|
|
133
|
+
children: /* @__PURE__ */ jsx(IconSlot, {
|
|
134
|
+
icon: offIcon,
|
|
135
|
+
variant: "fill",
|
|
136
|
+
style: switchStyles.handleIcon
|
|
137
|
+
})
|
|
138
|
+
})]
|
|
139
|
+
})
|
|
140
|
+
}),
|
|
141
|
+
labelPosition === "start" && labelContent
|
|
142
|
+
]
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
Switch.displayName = "Switch";
|
|
146
|
+
const switchStaticStyles = StyleSheet.create((theme) => ({
|
|
147
|
+
handle: {
|
|
148
|
+
borderRadius: theme.borderRadius.full,
|
|
149
|
+
alignItems: "center",
|
|
150
|
+
justifyContent: "center"
|
|
151
|
+
},
|
|
152
|
+
iconContainer: {
|
|
153
|
+
position: "absolute",
|
|
154
|
+
alignItems: "center",
|
|
155
|
+
justifyContent: "center"
|
|
156
|
+
},
|
|
157
|
+
track: {
|
|
158
|
+
justifyContent: "center",
|
|
159
|
+
borderRadius: theme.borderRadius.full
|
|
160
|
+
},
|
|
161
|
+
root: ({ disabled }) => ({
|
|
162
|
+
flexDirection: "row",
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
alignSelf: "flex-start",
|
|
165
|
+
opacity: disabled ? .5 : 1
|
|
166
|
+
})
|
|
167
|
+
}));
|
|
168
|
+
|
|
169
|
+
//#endregion
|
|
170
|
+
export { Switch };
|
|
171
|
+
//# sourceMappingURL=Switch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch.mjs","names":["HANDLE_TRAVEL: Record<SwitchSize, number>","Switch","rootStyle: StyleProp<ViewStyle>","trackStyle: StyleProp<ViewStyle>","handleStyle: StyleProp<ViewStyle>","Text"],"sources":["../../src/components/Switch.tsx"],"sourcesContent":["import type { SwitchSize, UniversalSwitchProps } from '@yahoo/uds/tokens';\nimport type { Ref } from 'react';\nimport { memo, useCallback, useEffect, useMemo, useState } from 'react';\nimport type { AccessibilityProps, StyleProp, View, ViewStyle } from 'react-native';\nimport { AccessibilityInfo, Pressable } from 'react-native';\nimport Animated, { useAnimatedStyle, useDerivedValue, withTiming } from 'react-native-reanimated';\nimport { StyleSheet } from 'react-native-unistyles';\nimport { useAnimatedVariantColor } from 'react-native-unistyles/reanimated';\n\nimport { switchStyles } from '../../generated/styles';\nimport { HStack } from './HStack';\nimport type { IconSlotType } from './IconSlot';\nimport { IconSlot } from './IconSlot';\nimport { Text } from './Text';\n\ninterface SwitchProps extends UniversalSwitchProps<IconSlotType> {\n /** Ref to the underlying View */\n ref?: Ref<View>;\n /** Callback when the switch value changes */\n onChange?: (value: boolean) => void;\n /** Whether the switch is disabled */\n disabled?: boolean;\n /** Whether the switch is required (shows asterisk with label) */\n required?: boolean;\n /** Accessibility hint describing what happens when activated */\n accessibilityHint?: AccessibilityProps['accessibilityHint'];\n}\n\nconst HANDLE_TRAVEL: Record<SwitchSize, number> = {\n md: 20,\n sm: 12,\n};\n\nconst ANIMATION_DURATION = 120;\n\n/**\n * **Switch component for toggling options**\n *\n * @description\n * A switch (also called a toggle) is a binary on/off input control.\n * It allows users to pick between two clearly opposite choices.\n *\n * @example\n * ```tsx\n * import { Switch } from '@yahoo/uds-mobile';\n *\n * <Switch label=\"Notifications\" />\n * <Switch isOn={enabled} onChange={setEnabled} label=\"Dark mode\" />\n * <Switch onIcon=\"Check\" offIcon=\"Cross\" label=\"Sync\" />\n * ```\n *\n * @see The {@link https://uds.build/docs/components/switch Switch Docs} for more info\n */\nconst Switch = memo(function Switch({\n isOn: isOnProp,\n defaultIsOn = false,\n onChange,\n label,\n labelPosition = 'start',\n size = 'md',\n onIcon,\n offIcon,\n disabled = false,\n required,\n accessibilityHint,\n reduceMotion = false,\n ref,\n}: SwitchProps) {\n const isControlled = isOnProp !== undefined;\n const [internalIsOn, setInternalIsOn] = useState(defaultIsOn);\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(false);\n const isOn = isControlled ? isOnProp : internalIsOn;\n\n // Check system reduced motion preference\n useEffect(() => {\n const checkReducedMotion = async () => {\n const isReduceMotionEnabled = await AccessibilityInfo.isReduceMotionEnabled();\n setPrefersReducedMotion(isReduceMotionEnabled);\n };\n checkReducedMotion();\n\n const subscription = AccessibilityInfo.addEventListener(\n 'reduceMotionChanged',\n setPrefersReducedMotion,\n );\n return () => subscription.remove();\n }, []);\n\n const shouldReduceMotion = reduceMotion || prefersReducedMotion;\n const animationDuration = shouldReduceMotion ? 0 : ANIMATION_DURATION;\n\n const progress = useDerivedValue(\n () => withTiming(isOn ? 1 : 0, { duration: animationDuration }),\n [isOn, animationDuration],\n );\n\n const travelDistance = HANDLE_TRAVEL[size];\n\n const handlePress = useCallback(() => {\n if (disabled) {\n return;\n }\n\n const newValue = !isOn;\n\n if (!isControlled) {\n setInternalIsOn(newValue);\n }\n\n onChange?.(newValue);\n }, [disabled, isOn, isControlled, onChange]);\n\n switchStyles.useVariants({\n size,\n variant: isOn ? 'on' : 'off',\n });\n\n // Get animated track color from design tokens (changes when variant changes)\n const trackBackgroundColor = useAnimatedVariantColor(switchStyles.switch, 'backgroundColor');\n\n const animatedTrackStyle = useAnimatedStyle(() => {\n 'worklet';\n return {\n backgroundColor: withTiming(trackBackgroundColor.value, { duration: animationDuration }),\n };\n });\n\n const animatedHandleStyle = useAnimatedStyle(() => {\n 'worklet';\n return {\n transform: [{ translateX: progress.value * travelDistance }],\n };\n });\n\n const rootStyle: StyleProp<ViewStyle> = useMemo(\n () => [switchStyles.root, switchStaticStyles.root({ disabled })],\n [switchStyles.root, disabled],\n );\n\n const trackStyle: StyleProp<ViewStyle> = useMemo(\n () => [switchStyles.switch, switchStaticStyles.track, animatedTrackStyle],\n [switchStyles.switch, animatedTrackStyle],\n );\n\n const handleStyle: StyleProp<ViewStyle> = useMemo(\n () => [switchStyles.handle, switchStaticStyles.handle, animatedHandleStyle],\n [switchStyles.handle, animatedHandleStyle],\n );\n\n const accessibilityLabel = typeof label === 'string' ? label : undefined;\n const resolvedAccessibilityHint = accessibilityHint ?? 'Double tap to toggle';\n\n const resolvedLabel = typeof label === 'function' ? label() : label;\n const labelContent = resolvedLabel && (\n <HStack gap=\"2\" alignItems=\"center\">\n <Text style={switchStyles.text}>{resolvedLabel}</Text>\n {required && <Text color=\"alert\">*</Text>}\n </HStack>\n );\n\n const a11yValue = useMemo(() => ({ text: isOn ? 'On' : 'Off' }), [isOn]);\n\n return (\n <Pressable\n ref={ref}\n onPress={handlePress}\n disabled={disabled}\n accessible\n accessibilityRole=\"switch\"\n accessibilityState={{ checked: isOn, disabled }}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={resolvedAccessibilityHint}\n accessibilityValue={a11yValue}\n style={rootStyle}\n >\n {labelPosition === 'end' && labelContent}\n\n <Animated.View style={trackStyle} importantForAccessibility=\"no-hide-descendants\">\n <Animated.View style={handleStyle}>\n {onIcon && isOn && (\n <Animated.View style={switchStaticStyles.iconContainer}>\n <IconSlot icon={onIcon} variant=\"fill\" style={switchStyles.handleIcon} />\n </Animated.View>\n )}\n {offIcon && !isOn && (\n <Animated.View style={switchStaticStyles.iconContainer}>\n <IconSlot icon={offIcon} variant=\"fill\" style={switchStyles.handleIcon} />\n </Animated.View>\n )}\n </Animated.View>\n </Animated.View>\n\n {labelPosition === 'start' && labelContent}\n </Pressable>\n );\n});\n\nSwitch.displayName = 'Switch';\n\nconst switchStaticStyles = StyleSheet.create((theme) => ({\n handle: {\n borderRadius: theme.borderRadius.full,\n alignItems: 'center',\n justifyContent: 'center',\n },\n iconContainer: {\n position: 'absolute',\n alignItems: 'center',\n justifyContent: 'center',\n },\n track: {\n justifyContent: 'center',\n borderRadius: theme.borderRadius.full,\n },\n root: ({ disabled }: { disabled: boolean }) => ({\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'flex-start',\n opacity: disabled ? 0.5 : 1,\n }),\n}));\n\nexport { Switch, type SwitchProps };\n"],"mappings":";;;;;;;;;;;;;AA4BA,MAAMA,gBAA4C;CAChD,IAAI;CACJ,IAAI;CACL;AAED,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;AAoB3B,MAAM,SAAS,KAAK,SAASC,SAAO,EAClC,MAAM,UACN,cAAc,OACd,UACA,OACA,gBAAgB,SAChB,OAAO,MACP,QACA,SACA,WAAW,OACX,UACA,mBACA,eAAe,OACf,OACc;CACd,MAAM,eAAe,aAAa;CAClC,MAAM,CAAC,cAAc,mBAAmB,SAAS,YAAY;CAC7D,MAAM,CAAC,sBAAsB,2BAA2B,SAAS,MAAM;CACvE,MAAM,OAAO,eAAe,WAAW;AAGvC,iBAAgB;EACd,MAAM,qBAAqB,YAAY;AAErC,2BAD8B,MAAM,kBAAkB,uBAAuB,CAC/B;;AAEhD,sBAAoB;EAEpB,MAAM,eAAe,kBAAkB,iBACrC,uBACA,wBACD;AACD,eAAa,aAAa,QAAQ;IACjC,EAAE,CAAC;CAGN,MAAM,oBADqB,gBAAgB,uBACI,IAAI;CAEnD,MAAM,WAAW,sBACT,WAAW,OAAO,IAAI,GAAG,EAAE,UAAU,mBAAmB,CAAC,EAC/D,CAAC,MAAM,kBAAkB,CAC1B;CAED,MAAM,iBAAiB,cAAc;CAErC,MAAM,cAAc,kBAAkB;AACpC,MAAI,SACF;EAGF,MAAM,WAAW,CAAC;AAElB,MAAI,CAAC,aACH,iBAAgB,SAAS;AAG3B,aAAW,SAAS;IACnB;EAAC;EAAU;EAAM;EAAc;EAAS,CAAC;AAE5C,cAAa,YAAY;EACvB;EACA,SAAS,OAAO,OAAO;EACxB,CAAC;CAGF,MAAM,uBAAuB,wBAAwB,aAAa,QAAQ,kBAAkB;CAE5F,MAAM,qBAAqB,uBAAuB;AAChD;AACA,SAAO,EACL,iBAAiB,WAAW,qBAAqB,OAAO,EAAE,UAAU,mBAAmB,CAAC,EACzF;GACD;CAEF,MAAM,sBAAsB,uBAAuB;AACjD;AACA,SAAO,EACL,WAAW,CAAC,EAAE,YAAY,SAAS,QAAQ,gBAAgB,CAAC,EAC7D;GACD;CAEF,MAAMC,YAAkC,cAChC,CAAC,aAAa,MAAM,mBAAmB,KAAK,EAAE,UAAU,CAAC,CAAC,EAChE,CAAC,aAAa,MAAM,SAAS,CAC9B;CAED,MAAMC,aAAmC,cACjC;EAAC,aAAa;EAAQ,mBAAmB;EAAO;EAAmB,EACzE,CAAC,aAAa,QAAQ,mBAAmB,CAC1C;CAED,MAAMC,cAAoC,cAClC;EAAC,aAAa;EAAQ,mBAAmB;EAAQ;EAAoB,EAC3E,CAAC,aAAa,QAAQ,oBAAoB,CAC3C;CAED,MAAM,qBAAqB,OAAO,UAAU,WAAW,QAAQ;CAC/D,MAAM,4BAA4B,qBAAqB;CAEvD,MAAM,gBAAgB,OAAO,UAAU,aAAa,OAAO,GAAG;CAC9D,MAAM,eAAe,iBACnB,qBAAC;EAAO,KAAI;EAAI,YAAW;aACzB,oBAACC;GAAK,OAAO,aAAa;aAAO;IAAqB,EACrD,YAAY,oBAACA;GAAK,OAAM;aAAQ;IAAQ;GAClC;CAGX,MAAM,YAAY,eAAe,EAAE,MAAM,OAAO,OAAO,OAAO,GAAG,CAAC,KAAK,CAAC;AAExE,QACE,qBAAC;EACM;EACL,SAAS;EACC;EACV;EACA,mBAAkB;EAClB,oBAAoB;GAAE,SAAS;GAAM;GAAU;EAC3B;EACpB,mBAAmB;EACnB,oBAAoB;EACpB,OAAO;;GAEN,kBAAkB,SAAS;GAE5B,oBAAC,SAAS;IAAK,OAAO;IAAY,2BAA0B;cAC1D,qBAAC,SAAS;KAAK,OAAO;gBACnB,UAAU,QACT,oBAAC,SAAS;MAAK,OAAO,mBAAmB;gBACvC,oBAAC;OAAS,MAAM;OAAQ,SAAQ;OAAO,OAAO,aAAa;QAAc;OAC3D,EAEjB,WAAW,CAAC,QACX,oBAAC,SAAS;MAAK,OAAO,mBAAmB;gBACvC,oBAAC;OAAS,MAAM;OAAS,SAAQ;OAAO,OAAO,aAAa;QAAc;OAC5D;MAEJ;KACF;GAEf,kBAAkB,WAAW;;GACpB;EAEd;AAEF,OAAO,cAAc;AAErB,MAAM,qBAAqB,WAAW,QAAQ,WAAW;CACvD,QAAQ;EACN,cAAc,MAAM,aAAa;EACjC,YAAY;EACZ,gBAAgB;EACjB;CACD,eAAe;EACb,UAAU;EACV,YAAY;EACZ,gBAAgB;EACjB;CACD,OAAO;EACL,gBAAgB;EAChB,cAAc,MAAM,aAAa;EAClC;CACD,OAAO,EAAE,gBAAuC;EAC9C,eAAe;EACf,YAAY;EACZ,WAAW;EACX,SAAS,WAAW,KAAM;EAC3B;CACF,EAAE"}
|
|
@@ -0,0 +1,107 @@
|
|
|
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/Text.tsx
|
|
9
|
+
/**
|
|
10
|
+
* **📝 A text component with UDS styling**
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* A styled text component that supports UDS typography variants and colors.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { Text } from '@yahoo/uds-mobile';
|
|
18
|
+
*
|
|
19
|
+
* <Text variant="body1" color="primary">
|
|
20
|
+
* Hello, World!
|
|
21
|
+
* </Text>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @usage
|
|
25
|
+
* - Use variant prop to set typography (display1, body1, label1, etc.)
|
|
26
|
+
* - Use color prop to set text color from the palette
|
|
27
|
+
*
|
|
28
|
+
* @see The {@link https://uds.build/docs/components/text Text Docs} for more info
|
|
29
|
+
*/
|
|
30
|
+
const Text = (0, react.memo)(function Text$1({ color = "primary", variant = "body1", fontFamily = variant, fontSize = variant, fontWeight, lineHeight = variant, letterSpacing = variant, textAlign, textTransform, textDecorationLine, style, backgroundColor, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, flexShrink, verticalAlign, height, minHeight, maxHeight, width, minWidth, maxWidth, dangerouslySetColor, ref, ...props }) {
|
|
31
|
+
generated_styles.styles.useVariants({
|
|
32
|
+
color,
|
|
33
|
+
fontFamily,
|
|
34
|
+
fontSize,
|
|
35
|
+
fontWeight,
|
|
36
|
+
lineHeight,
|
|
37
|
+
letterSpacing,
|
|
38
|
+
textAlign,
|
|
39
|
+
textTransform,
|
|
40
|
+
backgroundColor,
|
|
41
|
+
borderRadius,
|
|
42
|
+
borderTopStartRadius,
|
|
43
|
+
borderTopEndRadius,
|
|
44
|
+
borderBottomStartRadius,
|
|
45
|
+
borderBottomEndRadius,
|
|
46
|
+
borderColor,
|
|
47
|
+
borderStartColor,
|
|
48
|
+
borderEndColor,
|
|
49
|
+
borderTopColor,
|
|
50
|
+
borderBottomColor,
|
|
51
|
+
borderWidth,
|
|
52
|
+
borderVerticalWidth,
|
|
53
|
+
borderHorizontalWidth,
|
|
54
|
+
borderStartWidth,
|
|
55
|
+
borderEndWidth,
|
|
56
|
+
borderTopWidth,
|
|
57
|
+
borderBottomWidth,
|
|
58
|
+
spacing,
|
|
59
|
+
spacingHorizontal,
|
|
60
|
+
spacingVertical,
|
|
61
|
+
spacingBottom,
|
|
62
|
+
spacingEnd,
|
|
63
|
+
spacingStart,
|
|
64
|
+
spacingTop,
|
|
65
|
+
offset,
|
|
66
|
+
offsetVertical,
|
|
67
|
+
offsetHorizontal,
|
|
68
|
+
offsetBottom,
|
|
69
|
+
offsetEnd,
|
|
70
|
+
offsetStart,
|
|
71
|
+
offsetTop,
|
|
72
|
+
flexShrink
|
|
73
|
+
});
|
|
74
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
|
|
75
|
+
ref,
|
|
76
|
+
style: (0, react.useMemo)(() => [
|
|
77
|
+
textDecorationLine ? { textDecorationLine } : void 0,
|
|
78
|
+
dangerouslySetColor ? { color: dangerouslySetColor } : void 0,
|
|
79
|
+
verticalAlign ? { textAlignVertical: verticalAlign } : void 0,
|
|
80
|
+
height ? { height } : void 0,
|
|
81
|
+
minHeight ? { minHeight } : void 0,
|
|
82
|
+
maxHeight ? { maxHeight } : void 0,
|
|
83
|
+
width ? { width } : void 0,
|
|
84
|
+
minWidth ? { minWidth } : void 0,
|
|
85
|
+
maxWidth ? { maxWidth } : void 0,
|
|
86
|
+
generated_styles.styles.foundation,
|
|
87
|
+
style
|
|
88
|
+
], [
|
|
89
|
+
textDecorationLine,
|
|
90
|
+
dangerouslySetColor,
|
|
91
|
+
verticalAlign,
|
|
92
|
+
height,
|
|
93
|
+
minHeight,
|
|
94
|
+
maxHeight,
|
|
95
|
+
width,
|
|
96
|
+
minWidth,
|
|
97
|
+
maxWidth,
|
|
98
|
+
style,
|
|
99
|
+
generated_styles.styles.foundation
|
|
100
|
+
]),
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
Text.displayName = "Text";
|
|
105
|
+
|
|
106
|
+
//#endregion
|
|
107
|
+
exports.Text = Text;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react3 from "react";
|
|
3
|
+
import { Ref } from "react";
|
|
4
|
+
import { Text as Text$1, TextProps as TextProps$1, TextStyle } from "react-native";
|
|
5
|
+
import { StyleProps } from "../../generated/styles";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Text.d.ts
|
|
8
|
+
type TextVariant = Exclude<StyleProps['fontFamily'], 'sans' | 'sans-alt' | 'serif' | 'serif-alt' | 'mono' | 'icons'>;
|
|
9
|
+
type TextDecorationLine = 'none' | 'underline' | 'line-through' | 'underline line-through';
|
|
10
|
+
interface TextProps extends TextProps$1 {
|
|
11
|
+
ref?: Ref<Text$1>;
|
|
12
|
+
color?: StyleProps['color'];
|
|
13
|
+
/** Typography variant - sets fontSize, lineHeight, letterSpacing, and fontFamily together */
|
|
14
|
+
variant?: TextVariant;
|
|
15
|
+
/** Override the fontFamily independently */
|
|
16
|
+
fontFamily?: StyleProps['fontFamily'];
|
|
17
|
+
/** Override the fontSize independently */
|
|
18
|
+
fontSize?: StyleProps['fontSize'];
|
|
19
|
+
/** Set font weight (not derived from variant) */
|
|
20
|
+
fontWeight?: StyleProps['fontWeight'];
|
|
21
|
+
/** Override the lineHeight independently */
|
|
22
|
+
lineHeight?: StyleProps['lineHeight'];
|
|
23
|
+
/** Override the letterSpacing independently */
|
|
24
|
+
letterSpacing?: StyleProps['letterSpacing'];
|
|
25
|
+
textAlign?: StyleProps['textAlign'];
|
|
26
|
+
/** Set text transform (not derived from variant) */
|
|
27
|
+
textTransform?: StyleProps['textTransform'];
|
|
28
|
+
/** Text decoration (underline, line-through, etc.) */
|
|
29
|
+
textDecorationLine?: TextDecorationLine;
|
|
30
|
+
backgroundColor?: StyleProps['backgroundColor'];
|
|
31
|
+
borderRadius?: StyleProps['borderRadius'];
|
|
32
|
+
borderTopStartRadius?: StyleProps['borderTopStartRadius'];
|
|
33
|
+
borderTopEndRadius?: StyleProps['borderTopEndRadius'];
|
|
34
|
+
borderBottomStartRadius?: StyleProps['borderBottomStartRadius'];
|
|
35
|
+
borderBottomEndRadius?: StyleProps['borderBottomEndRadius'];
|
|
36
|
+
borderColor?: StyleProps['borderColor'];
|
|
37
|
+
borderStartColor?: StyleProps['borderStartColor'];
|
|
38
|
+
borderEndColor?: StyleProps['borderEndColor'];
|
|
39
|
+
borderTopColor?: StyleProps['borderTopColor'];
|
|
40
|
+
borderBottomColor?: StyleProps['borderBottomColor'];
|
|
41
|
+
borderWidth?: StyleProps['borderWidth'];
|
|
42
|
+
borderVerticalWidth?: StyleProps['borderVerticalWidth'];
|
|
43
|
+
borderHorizontalWidth?: StyleProps['borderHorizontalWidth'];
|
|
44
|
+
borderStartWidth?: StyleProps['borderStartWidth'];
|
|
45
|
+
borderEndWidth?: StyleProps['borderEndWidth'];
|
|
46
|
+
borderTopWidth?: StyleProps['borderTopWidth'];
|
|
47
|
+
borderBottomWidth?: StyleProps['borderBottomWidth'];
|
|
48
|
+
spacing?: StyleProps['spacing'];
|
|
49
|
+
spacingHorizontal?: StyleProps['spacingHorizontal'];
|
|
50
|
+
spacingVertical?: StyleProps['spacingVertical'];
|
|
51
|
+
spacingBottom?: StyleProps['spacingBottom'];
|
|
52
|
+
spacingEnd?: StyleProps['spacingEnd'];
|
|
53
|
+
spacingStart?: StyleProps['spacingStart'];
|
|
54
|
+
spacingTop?: StyleProps['spacingTop'];
|
|
55
|
+
offset?: StyleProps['offset'];
|
|
56
|
+
offsetVertical?: StyleProps['offsetVertical'];
|
|
57
|
+
offsetHorizontal?: StyleProps['offsetHorizontal'];
|
|
58
|
+
offsetBottom?: StyleProps['offsetBottom'];
|
|
59
|
+
offsetEnd?: StyleProps['offsetEnd'];
|
|
60
|
+
offsetStart?: StyleProps['offsetStart'];
|
|
61
|
+
offsetTop?: StyleProps['offsetTop'];
|
|
62
|
+
flexShrink?: StyleProps['flexShrink'];
|
|
63
|
+
verticalAlign?: TextStyle['textAlignVertical'];
|
|
64
|
+
height?: number | `${number}%`;
|
|
65
|
+
width?: number | `${number}%`;
|
|
66
|
+
minHeight?: number | `${number}%`;
|
|
67
|
+
maxHeight?: number | `${number}%`;
|
|
68
|
+
minWidth?: number | `${number}%`;
|
|
69
|
+
maxWidth?: number | `${number}%`;
|
|
70
|
+
dangerouslySetColor?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* **📝 A text component with UDS styling**
|
|
74
|
+
*
|
|
75
|
+
* @description
|
|
76
|
+
* A styled text component that supports UDS typography variants and colors.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* import { Text } from '@yahoo/uds-mobile';
|
|
81
|
+
*
|
|
82
|
+
* <Text variant="body1" color="primary">
|
|
83
|
+
* Hello, World!
|
|
84
|
+
* </Text>
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @usage
|
|
88
|
+
* - Use variant prop to set typography (display1, body1, label1, etc.)
|
|
89
|
+
* - Use color prop to set text color from the palette
|
|
90
|
+
*
|
|
91
|
+
* @see The {@link https://uds.build/docs/components/text Text Docs} for more info
|
|
92
|
+
*/
|
|
93
|
+
declare const Text: react3.NamedExoticComponent<TextProps>;
|
|
94
|
+
//#endregion
|
|
95
|
+
export { Text, type TextProps };
|
|
96
|
+
//# sourceMappingURL=Text.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.cts","names":[],"sources":["../../src/components/Text.tsx"],"sourcesContent":[],"mappings":";;;;;;;KASK,WAAA,GAAc,QACjB;KAMG,kBAAA;AAXoD,UAa/C,SAAA,SAAkB,WAR1B,CAAA;EAMG,GAAA,CAAA,EAGG,GAHH,CAGO,MAHP,CAAA;EAEK,KAAA,CAAA,EAGA,UAHU,CAAA,OAAA,CAAA;EACR;EAAJ,OAAA,CAAA,EAII,WAJJ;EAEE;EAEE,UAAA,CAAA,EAEG,UAFH,CAAA,YAAA,CAAA;EAEG;EAEF,QAAA,CAAA,EAAA,UAAA,CAAA,UAAA,CAAA;EAEE;EAEA,UAAA,CAAA,EAFA,UAEA,CAAA,YAAA,CAAA;EAEG;EACJ,UAAA,CAAA,EAHC,UAGD,CAAA,YAAA,CAAA;EAEI;EAEK,aAAA,CAAA,EALL,UAKK,CAAA,eAAA,CAAA;EAEH,SAAA,CAAA,EANN,UAMM,CAAA,WAAA,CAAA;EAEH;EACQ,aAAA,CAAA,EAPP,UAOO,CAAA,eAAA,CAAA;EACF;EACK,kBAAA,CAAA,EAPL,kBAOK;EACF,eAAA,CAAA,EANN,UAMM,CAAA,iBAAA,CAAA;EACV,YAAA,CAAA,EALC,UAKD,CAAA,cAAA,CAAA;EACK,oBAAA,CAAA,EALI,UAKJ,CAAA,sBAAA,CAAA;EACF,kBAAA,CAAA,EALI,UAKJ,CAAA,oBAAA,CAAA;EACA,uBAAA,CAAA,EALS,UAKT,CAAA,yBAAA,CAAA;EACG,qBAAA,CAAA,EALI,UAKJ,CAAA,uBAAA,CAAA;EACN,WAAA,CAAA,EALA,UAKA,CAAA,aAAA,CAAA;EACQ,gBAAA,CAAA,EALH,UAKG,CAAA,kBAAA,CAAA;EACE,cAAA,CAAA,EALP,UAKO,CAAA,gBAAA,CAAA;EACL,cAAA,CAAA,EALF,UAKE,CAAA,gBAAA,CAAA;EACF,iBAAA,CAAA,EALG,UAKH,CAAA,mBAAA,CAAA;EACA,WAAA,CAAA,EALH,UAKG,CAAA,aAAA,CAAA;EACG,mBAAA,CAAA,EALE,UAKF,CAAA,qBAAA,CAAA;EAEV,qBAAA,CAAA,EANc,UAMd,CAAA,uBAAA,CAAA;EACU,gBAAA,CAAA,EAND,UAMC,CAAA,kBAAA,CAAA;EACF,cAAA,CAAA,EAND,UAMC,CAAA,gBAAA,CAAA;EACF,cAAA,CAAA,EANC,UAMD,CAAA,gBAAA,CAAA;EACH,iBAAA,CAAA,EANO,UAMP,CAAA,mBAAA,CAAA;EACE,OAAA,CAAA,EALL,UAKK,CAAA,SAAA,CAAA;EACF,iBAAA,CAAA,EALO,UAKP,CAAA,mBAAA,CAAA;EAEJ,eAAA,CAAA,EANS,UAMT,CAAA,iBAAA,CAAA;EACQ,aAAA,CAAA,EAND,UAMC,CAAA,eAAA,CAAA;EACE,UAAA,CAAA,EANN,UAMM,CAAA,YAAA,CAAA;EACJ,YAAA,CAAA,EANA,UAMA,CAAA,cAAA,CAAA;EACH,UAAA,CAAA,EANC,UAMD,CAAA,YAAA,CAAA;EACE,MAAA,CAAA,EALL,UAKK,CAAA,QAAA,CAAA;EACF,cAAA,CAAA,EALK,UAKL,CAAA,gBAAA,CAAA;EAEC,gBAAA,CAAA,EANM,UAMN,CAAA,kBAAA,CAAA;EAEG,YAAA,CAAA,EAPD,UAOC,CAAA,cAAA,CAAA;EA5DU,SAAA,CAAA,EAsDd,UAtDc,CAAA,WAAA,CAAA;EAAW,WAAA,CAAA,EAuDvB,UAvDuB,CAAA,aAAA,CAAA;EA6FjC,SAmJJ,CAAA,EAxLY,UAqCJ,CAAA,WAAA,CAAA;eAnCK;kBAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCZ,MAAI,MAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
|
|
2
|
+
import * as react8 from "react";
|
|
3
|
+
import { Ref } from "react";
|
|
4
|
+
import { Text as Text$1, TextProps as TextProps$1, TextStyle } from "react-native";
|
|
5
|
+
import { StyleProps } from "../../generated/styles";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Text.d.ts
|
|
8
|
+
type TextVariant = Exclude<StyleProps['fontFamily'], 'sans' | 'sans-alt' | 'serif' | 'serif-alt' | 'mono' | 'icons'>;
|
|
9
|
+
type TextDecorationLine = 'none' | 'underline' | 'line-through' | 'underline line-through';
|
|
10
|
+
interface TextProps extends TextProps$1 {
|
|
11
|
+
ref?: Ref<Text$1>;
|
|
12
|
+
color?: StyleProps['color'];
|
|
13
|
+
/** Typography variant - sets fontSize, lineHeight, letterSpacing, and fontFamily together */
|
|
14
|
+
variant?: TextVariant;
|
|
15
|
+
/** Override the fontFamily independently */
|
|
16
|
+
fontFamily?: StyleProps['fontFamily'];
|
|
17
|
+
/** Override the fontSize independently */
|
|
18
|
+
fontSize?: StyleProps['fontSize'];
|
|
19
|
+
/** Set font weight (not derived from variant) */
|
|
20
|
+
fontWeight?: StyleProps['fontWeight'];
|
|
21
|
+
/** Override the lineHeight independently */
|
|
22
|
+
lineHeight?: StyleProps['lineHeight'];
|
|
23
|
+
/** Override the letterSpacing independently */
|
|
24
|
+
letterSpacing?: StyleProps['letterSpacing'];
|
|
25
|
+
textAlign?: StyleProps['textAlign'];
|
|
26
|
+
/** Set text transform (not derived from variant) */
|
|
27
|
+
textTransform?: StyleProps['textTransform'];
|
|
28
|
+
/** Text decoration (underline, line-through, etc.) */
|
|
29
|
+
textDecorationLine?: TextDecorationLine;
|
|
30
|
+
backgroundColor?: StyleProps['backgroundColor'];
|
|
31
|
+
borderRadius?: StyleProps['borderRadius'];
|
|
32
|
+
borderTopStartRadius?: StyleProps['borderTopStartRadius'];
|
|
33
|
+
borderTopEndRadius?: StyleProps['borderTopEndRadius'];
|
|
34
|
+
borderBottomStartRadius?: StyleProps['borderBottomStartRadius'];
|
|
35
|
+
borderBottomEndRadius?: StyleProps['borderBottomEndRadius'];
|
|
36
|
+
borderColor?: StyleProps['borderColor'];
|
|
37
|
+
borderStartColor?: StyleProps['borderStartColor'];
|
|
38
|
+
borderEndColor?: StyleProps['borderEndColor'];
|
|
39
|
+
borderTopColor?: StyleProps['borderTopColor'];
|
|
40
|
+
borderBottomColor?: StyleProps['borderBottomColor'];
|
|
41
|
+
borderWidth?: StyleProps['borderWidth'];
|
|
42
|
+
borderVerticalWidth?: StyleProps['borderVerticalWidth'];
|
|
43
|
+
borderHorizontalWidth?: StyleProps['borderHorizontalWidth'];
|
|
44
|
+
borderStartWidth?: StyleProps['borderStartWidth'];
|
|
45
|
+
borderEndWidth?: StyleProps['borderEndWidth'];
|
|
46
|
+
borderTopWidth?: StyleProps['borderTopWidth'];
|
|
47
|
+
borderBottomWidth?: StyleProps['borderBottomWidth'];
|
|
48
|
+
spacing?: StyleProps['spacing'];
|
|
49
|
+
spacingHorizontal?: StyleProps['spacingHorizontal'];
|
|
50
|
+
spacingVertical?: StyleProps['spacingVertical'];
|
|
51
|
+
spacingBottom?: StyleProps['spacingBottom'];
|
|
52
|
+
spacingEnd?: StyleProps['spacingEnd'];
|
|
53
|
+
spacingStart?: StyleProps['spacingStart'];
|
|
54
|
+
spacingTop?: StyleProps['spacingTop'];
|
|
55
|
+
offset?: StyleProps['offset'];
|
|
56
|
+
offsetVertical?: StyleProps['offsetVertical'];
|
|
57
|
+
offsetHorizontal?: StyleProps['offsetHorizontal'];
|
|
58
|
+
offsetBottom?: StyleProps['offsetBottom'];
|
|
59
|
+
offsetEnd?: StyleProps['offsetEnd'];
|
|
60
|
+
offsetStart?: StyleProps['offsetStart'];
|
|
61
|
+
offsetTop?: StyleProps['offsetTop'];
|
|
62
|
+
flexShrink?: StyleProps['flexShrink'];
|
|
63
|
+
verticalAlign?: TextStyle['textAlignVertical'];
|
|
64
|
+
height?: number | `${number}%`;
|
|
65
|
+
width?: number | `${number}%`;
|
|
66
|
+
minHeight?: number | `${number}%`;
|
|
67
|
+
maxHeight?: number | `${number}%`;
|
|
68
|
+
minWidth?: number | `${number}%`;
|
|
69
|
+
maxWidth?: number | `${number}%`;
|
|
70
|
+
dangerouslySetColor?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* **📝 A text component with UDS styling**
|
|
74
|
+
*
|
|
75
|
+
* @description
|
|
76
|
+
* A styled text component that supports UDS typography variants and colors.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```tsx
|
|
80
|
+
* import { Text } from '@yahoo/uds-mobile';
|
|
81
|
+
*
|
|
82
|
+
* <Text variant="body1" color="primary">
|
|
83
|
+
* Hello, World!
|
|
84
|
+
* </Text>
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @usage
|
|
88
|
+
* - Use variant prop to set typography (display1, body1, label1, etc.)
|
|
89
|
+
* - Use color prop to set text color from the palette
|
|
90
|
+
*
|
|
91
|
+
* @see The {@link https://uds.build/docs/components/text Text Docs} for more info
|
|
92
|
+
*/
|
|
93
|
+
declare const Text: react8.NamedExoticComponent<TextProps>;
|
|
94
|
+
//#endregion
|
|
95
|
+
export { Text, type TextProps };
|
|
96
|
+
//# sourceMappingURL=Text.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.mts","names":[],"sources":["../../src/components/Text.tsx"],"sourcesContent":[],"mappings":";;;;;;;KASK,WAAA,GAAc,QACjB;KAMG,kBAAA;AAXoD,UAa/C,SAAA,SAAkB,WAR1B,CAAA;EAMG,GAAA,CAAA,EAGG,GAHH,CAGO,MAHP,CAAA;EAEK,KAAA,CAAA,EAGA,UAHU,CAAA,OAAA,CAAA;EACR;EAAJ,OAAA,CAAA,EAII,WAJJ;EAEE;EAEE,UAAA,CAAA,EAEG,UAFH,CAAA,YAAA,CAAA;EAEG;EAEF,QAAA,CAAA,EAAA,UAAA,CAAA,UAAA,CAAA;EAEE;EAEA,UAAA,CAAA,EAFA,UAEA,CAAA,YAAA,CAAA;EAEG;EACJ,UAAA,CAAA,EAHC,UAGD,CAAA,YAAA,CAAA;EAEI;EAEK,aAAA,CAAA,EALL,UAKK,CAAA,eAAA,CAAA;EAEH,SAAA,CAAA,EANN,UAMM,CAAA,WAAA,CAAA;EAEH;EACQ,aAAA,CAAA,EAPP,UAOO,CAAA,eAAA,CAAA;EACF;EACK,kBAAA,CAAA,EAPL,kBAOK;EACF,eAAA,CAAA,EANN,UAMM,CAAA,iBAAA,CAAA;EACV,YAAA,CAAA,EALC,UAKD,CAAA,cAAA,CAAA;EACK,oBAAA,CAAA,EALI,UAKJ,CAAA,sBAAA,CAAA;EACF,kBAAA,CAAA,EALI,UAKJ,CAAA,oBAAA,CAAA;EACA,uBAAA,CAAA,EALS,UAKT,CAAA,yBAAA,CAAA;EACG,qBAAA,CAAA,EALI,UAKJ,CAAA,uBAAA,CAAA;EACN,WAAA,CAAA,EALA,UAKA,CAAA,aAAA,CAAA;EACQ,gBAAA,CAAA,EALH,UAKG,CAAA,kBAAA,CAAA;EACE,cAAA,CAAA,EALP,UAKO,CAAA,gBAAA,CAAA;EACL,cAAA,CAAA,EALF,UAKE,CAAA,gBAAA,CAAA;EACF,iBAAA,CAAA,EALG,UAKH,CAAA,mBAAA,CAAA;EACA,WAAA,CAAA,EALH,UAKG,CAAA,aAAA,CAAA;EACG,mBAAA,CAAA,EALE,UAKF,CAAA,qBAAA,CAAA;EAEV,qBAAA,CAAA,EANc,UAMd,CAAA,uBAAA,CAAA;EACU,gBAAA,CAAA,EAND,UAMC,CAAA,kBAAA,CAAA;EACF,cAAA,CAAA,EAND,UAMC,CAAA,gBAAA,CAAA;EACF,cAAA,CAAA,EANC,UAMD,CAAA,gBAAA,CAAA;EACH,iBAAA,CAAA,EANO,UAMP,CAAA,mBAAA,CAAA;EACE,OAAA,CAAA,EALL,UAKK,CAAA,SAAA,CAAA;EACF,iBAAA,CAAA,EALO,UAKP,CAAA,mBAAA,CAAA;EAEJ,eAAA,CAAA,EANS,UAMT,CAAA,iBAAA,CAAA;EACQ,aAAA,CAAA,EAND,UAMC,CAAA,eAAA,CAAA;EACE,UAAA,CAAA,EANN,UAMM,CAAA,YAAA,CAAA;EACJ,YAAA,CAAA,EANA,UAMA,CAAA,cAAA,CAAA;EACH,UAAA,CAAA,EANC,UAMD,CAAA,YAAA,CAAA;EACE,MAAA,CAAA,EALL,UAKK,CAAA,QAAA,CAAA;EACF,cAAA,CAAA,EALK,UAKL,CAAA,gBAAA,CAAA;EAEC,gBAAA,CAAA,EANM,UAMN,CAAA,kBAAA,CAAA;EAEG,YAAA,CAAA,EAPD,UAOC,CAAA,cAAA,CAAA;EA5DU,SAAA,CAAA,EAsDd,UAtDc,CAAA,WAAA,CAAA;EAAW,WAAA,CAAA,EAuDvB,UAvDuB,CAAA,aAAA,CAAA;EA6FjC,SAmJJ,CAAA,EAxLY,UAqCJ,CAAA,WAAA,CAAA;eAnCK;kBAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCZ,MAAI,MAAA,CAAA,qBAAA"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { Text as Text$1 } from "react-native";
|
|
4
|
+
import { styles } from "../../generated/styles";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/components/Text.tsx
|
|
8
|
+
/**
|
|
9
|
+
* **📝 A text component with UDS styling**
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* A styled text component that supports UDS typography variants and colors.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* import { Text } from '@yahoo/uds-mobile';
|
|
17
|
+
*
|
|
18
|
+
* <Text variant="body1" color="primary">
|
|
19
|
+
* Hello, World!
|
|
20
|
+
* </Text>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @usage
|
|
24
|
+
* - Use variant prop to set typography (display1, body1, label1, etc.)
|
|
25
|
+
* - Use color prop to set text color from the palette
|
|
26
|
+
*
|
|
27
|
+
* @see The {@link https://uds.build/docs/components/text Text Docs} for more info
|
|
28
|
+
*/
|
|
29
|
+
const Text = memo(function Text$2({ color = "primary", variant = "body1", fontFamily = variant, fontSize = variant, fontWeight, lineHeight = variant, letterSpacing = variant, textAlign, textTransform, textDecorationLine, style, backgroundColor, borderRadius, borderTopStartRadius, borderTopEndRadius, borderBottomStartRadius, borderBottomEndRadius, borderColor, borderStartColor, borderEndColor, borderTopColor, borderBottomColor, borderWidth, borderVerticalWidth, borderHorizontalWidth, borderStartWidth, borderEndWidth, borderTopWidth, borderBottomWidth, spacing, spacingHorizontal, spacingVertical, spacingBottom, spacingEnd, spacingStart, spacingTop, offset, offsetVertical, offsetHorizontal, offsetBottom, offsetEnd, offsetStart, offsetTop, flexShrink, verticalAlign, height, minHeight, maxHeight, width, minWidth, maxWidth, dangerouslySetColor, ref, ...props }) {
|
|
30
|
+
styles.useVariants({
|
|
31
|
+
color,
|
|
32
|
+
fontFamily,
|
|
33
|
+
fontSize,
|
|
34
|
+
fontWeight,
|
|
35
|
+
lineHeight,
|
|
36
|
+
letterSpacing,
|
|
37
|
+
textAlign,
|
|
38
|
+
textTransform,
|
|
39
|
+
backgroundColor,
|
|
40
|
+
borderRadius,
|
|
41
|
+
borderTopStartRadius,
|
|
42
|
+
borderTopEndRadius,
|
|
43
|
+
borderBottomStartRadius,
|
|
44
|
+
borderBottomEndRadius,
|
|
45
|
+
borderColor,
|
|
46
|
+
borderStartColor,
|
|
47
|
+
borderEndColor,
|
|
48
|
+
borderTopColor,
|
|
49
|
+
borderBottomColor,
|
|
50
|
+
borderWidth,
|
|
51
|
+
borderVerticalWidth,
|
|
52
|
+
borderHorizontalWidth,
|
|
53
|
+
borderStartWidth,
|
|
54
|
+
borderEndWidth,
|
|
55
|
+
borderTopWidth,
|
|
56
|
+
borderBottomWidth,
|
|
57
|
+
spacing,
|
|
58
|
+
spacingHorizontal,
|
|
59
|
+
spacingVertical,
|
|
60
|
+
spacingBottom,
|
|
61
|
+
spacingEnd,
|
|
62
|
+
spacingStart,
|
|
63
|
+
spacingTop,
|
|
64
|
+
offset,
|
|
65
|
+
offsetVertical,
|
|
66
|
+
offsetHorizontal,
|
|
67
|
+
offsetBottom,
|
|
68
|
+
offsetEnd,
|
|
69
|
+
offsetStart,
|
|
70
|
+
offsetTop,
|
|
71
|
+
flexShrink
|
|
72
|
+
});
|
|
73
|
+
return /* @__PURE__ */ jsx(Text$1, {
|
|
74
|
+
ref,
|
|
75
|
+
style: useMemo(() => [
|
|
76
|
+
textDecorationLine ? { textDecorationLine } : void 0,
|
|
77
|
+
dangerouslySetColor ? { color: dangerouslySetColor } : void 0,
|
|
78
|
+
verticalAlign ? { textAlignVertical: verticalAlign } : void 0,
|
|
79
|
+
height ? { height } : void 0,
|
|
80
|
+
minHeight ? { minHeight } : void 0,
|
|
81
|
+
maxHeight ? { maxHeight } : void 0,
|
|
82
|
+
width ? { width } : void 0,
|
|
83
|
+
minWidth ? { minWidth } : void 0,
|
|
84
|
+
maxWidth ? { maxWidth } : void 0,
|
|
85
|
+
styles.foundation,
|
|
86
|
+
style
|
|
87
|
+
], [
|
|
88
|
+
textDecorationLine,
|
|
89
|
+
dangerouslySetColor,
|
|
90
|
+
verticalAlign,
|
|
91
|
+
height,
|
|
92
|
+
minHeight,
|
|
93
|
+
maxHeight,
|
|
94
|
+
width,
|
|
95
|
+
minWidth,
|
|
96
|
+
maxWidth,
|
|
97
|
+
style,
|
|
98
|
+
styles.foundation
|
|
99
|
+
]),
|
|
100
|
+
...props
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
Text.displayName = "Text";
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
export { Text };
|
|
107
|
+
//# sourceMappingURL=Text.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.mjs","names":["Text","RNText"],"sources":["../../src/components/Text.tsx"],"sourcesContent":["import type { Ref } from 'react';\nimport { memo, useMemo } from 'react';\nimport type { StyleProp, TextProps as RNTextProps, TextStyle } from 'react-native';\nimport { Text as RNText } from 'react-native';\n\nimport type { StyleProps } from '../../generated/styles';\nimport { styles } from '../../generated/styles';\n\n// TextVariant is a subset of fontFamily that represents typography variants\ntype TextVariant = Exclude<\n StyleProps['fontFamily'],\n 'sans' | 'sans-alt' | 'serif' | 'serif-alt' | 'mono' | 'icons'\n>;\n\n// React Native text decoration line values\n// See: https://reactnative.dev/docs/text-style-props#textdecorationline\ntype TextDecorationLine = 'none' | 'underline' | 'line-through' | 'underline line-through';\n\ninterface TextProps extends RNTextProps {\n ref?: Ref<RNText>;\n // Text-specific\n color?: StyleProps['color'];\n /** Typography variant - sets fontSize, lineHeight, letterSpacing, and fontFamily together */\n variant?: TextVariant;\n /** Override the fontFamily independently */\n fontFamily?: StyleProps['fontFamily'];\n /** Override the fontSize independently */\n fontSize?: StyleProps['fontSize'];\n /** Set font weight (not derived from variant) */\n fontWeight?: StyleProps['fontWeight'];\n /** Override the lineHeight independently */\n lineHeight?: StyleProps['lineHeight'];\n /** Override the letterSpacing independently */\n letterSpacing?: StyleProps['letterSpacing'];\n textAlign?: StyleProps['textAlign'];\n /** Set text transform (not derived from variant) */\n textTransform?: StyleProps['textTransform'];\n /** Text decoration (underline, line-through, etc.) */\n textDecorationLine?: TextDecorationLine;\n // Background\n backgroundColor?: StyleProps['backgroundColor'];\n // Border\n borderRadius?: StyleProps['borderRadius'];\n borderTopStartRadius?: StyleProps['borderTopStartRadius'];\n borderTopEndRadius?: StyleProps['borderTopEndRadius'];\n borderBottomStartRadius?: StyleProps['borderBottomStartRadius'];\n borderBottomEndRadius?: StyleProps['borderBottomEndRadius'];\n borderColor?: StyleProps['borderColor'];\n borderStartColor?: StyleProps['borderStartColor'];\n borderEndColor?: StyleProps['borderEndColor'];\n borderTopColor?: StyleProps['borderTopColor'];\n borderBottomColor?: StyleProps['borderBottomColor'];\n borderWidth?: StyleProps['borderWidth'];\n borderVerticalWidth?: StyleProps['borderVerticalWidth'];\n borderHorizontalWidth?: StyleProps['borderHorizontalWidth'];\n borderStartWidth?: StyleProps['borderStartWidth'];\n borderEndWidth?: StyleProps['borderEndWidth'];\n borderTopWidth?: StyleProps['borderTopWidth'];\n borderBottomWidth?: StyleProps['borderBottomWidth'];\n // Spacing\n spacing?: StyleProps['spacing'];\n spacingHorizontal?: StyleProps['spacingHorizontal'];\n spacingVertical?: StyleProps['spacingVertical'];\n spacingBottom?: StyleProps['spacingBottom'];\n spacingEnd?: StyleProps['spacingEnd'];\n spacingStart?: StyleProps['spacingStart'];\n spacingTop?: StyleProps['spacingTop'];\n // Offset\n offset?: StyleProps['offset'];\n offsetVertical?: StyleProps['offsetVertical'];\n offsetHorizontal?: StyleProps['offsetHorizontal'];\n offsetBottom?: StyleProps['offsetBottom'];\n offsetEnd?: StyleProps['offsetEnd'];\n offsetStart?: StyleProps['offsetStart'];\n offsetTop?: StyleProps['offsetTop'];\n // Flex\n flexShrink?: StyleProps['flexShrink'];\n // Vertical Alignment\n verticalAlign?: TextStyle['textAlignVertical'];\n // Size\n height?: number | `${number}%`;\n width?: number | `${number}%`;\n minHeight?: number | `${number}%`;\n maxHeight?: number | `${number}%`;\n minWidth?: number | `${number}%`;\n maxWidth?: number | `${number}%`;\n // Dangerously set props\n dangerouslySetColor?: string;\n}\n\n/**\n * **📝 A text component with UDS styling**\n *\n * @description\n * A styled text component that supports UDS typography variants and colors.\n *\n * @example\n * ```tsx\n * import { Text } from '@yahoo/uds-mobile';\n *\n * <Text variant=\"body1\" color=\"primary\">\n * Hello, World!\n * </Text>\n * ```\n *\n * @usage\n * - Use variant prop to set typography (display1, body1, label1, etc.)\n * - Use color prop to set text color from the palette\n *\n * @see The {@link https://uds.build/docs/components/text Text Docs} for more info\n */\nconst Text = memo(function Text({\n // Text-specific\n color = 'primary',\n variant = 'body1',\n fontFamily = variant,\n fontSize = variant,\n fontWeight,\n lineHeight = variant,\n letterSpacing = variant,\n textAlign,\n textTransform,\n textDecorationLine,\n style,\n // Background\n backgroundColor,\n // Border\n borderRadius,\n borderTopStartRadius,\n borderTopEndRadius,\n borderBottomStartRadius,\n borderBottomEndRadius,\n borderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderWidth,\n borderVerticalWidth,\n borderHorizontalWidth,\n borderStartWidth,\n borderEndWidth,\n borderTopWidth,\n borderBottomWidth,\n // Spacing\n spacing,\n spacingHorizontal,\n spacingVertical,\n spacingBottom,\n spacingEnd,\n spacingStart,\n spacingTop,\n // Offset\n offset,\n offsetVertical,\n offsetHorizontal,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n // Flex\n flexShrink,\n // Vertical Alignment\n verticalAlign,\n // Size\n height,\n minHeight,\n maxHeight,\n width,\n minWidth,\n maxWidth,\n // Dangerously set props\n dangerouslySetColor,\n ref,\n // Rest\n ...props\n}: TextProps) {\n styles.useVariants({\n // Text styles\n color,\n fontFamily,\n fontSize,\n fontWeight,\n lineHeight,\n letterSpacing,\n textAlign,\n textTransform,\n // Background\n backgroundColor,\n // Border\n borderRadius,\n borderTopStartRadius,\n borderTopEndRadius,\n borderBottomStartRadius,\n borderBottomEndRadius,\n borderColor,\n borderStartColor,\n borderEndColor,\n borderTopColor,\n borderBottomColor,\n borderWidth,\n borderVerticalWidth,\n borderHorizontalWidth,\n borderStartWidth,\n borderEndWidth,\n borderTopWidth,\n borderBottomWidth,\n // Spacing\n spacing,\n spacingHorizontal,\n spacingVertical,\n spacingBottom,\n spacingEnd,\n spacingStart,\n spacingTop,\n // Offset\n offset,\n offsetVertical,\n offsetHorizontal,\n offsetBottom,\n offsetEnd,\n offsetStart,\n offsetTop,\n // Flex\n flexShrink,\n });\n\n // styles.foundation must be in deps - it returns a new reference when variants change.\n const computedStyle: StyleProp<TextStyle> = useMemo(\n () => [\n textDecorationLine ? { textDecorationLine } : undefined,\n dangerouslySetColor ? { color: dangerouslySetColor } : undefined,\n verticalAlign ? { textAlignVertical: verticalAlign } : undefined,\n height ? { height } : undefined,\n minHeight ? { minHeight } : undefined,\n maxHeight ? { maxHeight } : undefined,\n width ? { width } : undefined,\n minWidth ? { minWidth } : undefined,\n maxWidth ? { maxWidth } : undefined,\n styles.foundation,\n style,\n ],\n [\n textDecorationLine,\n dangerouslySetColor,\n verticalAlign,\n height,\n minHeight,\n maxHeight,\n width,\n minWidth,\n maxWidth,\n style,\n styles.foundation,\n ],\n );\n\n return <RNText ref={ref} style={computedStyle} {...props} />;\n});\n\nText.displayName = 'Text';\n\nexport { Text, type TextProps };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+GA,MAAM,OAAO,KAAK,SAASA,OAAK,EAE9B,QAAQ,WACR,UAAU,SACV,aAAa,SACb,WAAW,SACX,YACA,aAAa,SACb,gBAAgB,SAChB,WACA,eACA,oBACA,OAEA,iBAEA,cACA,sBACA,oBACA,yBACA,uBACA,aACA,kBACA,gBACA,gBACA,mBACA,aACA,qBACA,uBACA,kBACA,gBACA,gBACA,mBAEA,SACA,mBACA,iBACA,eACA,YACA,cACA,YAEA,QACA,gBACA,kBACA,cACA,WACA,aACA,WAEA,YAEA,eAEA,QACA,WACA,WACA,OACA,UACA,UAEA,qBACA,KAEA,GAAG,SACS;AACZ,QAAO,YAAY;EAEjB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACD,CAAC;AAgCF,QAAO,oBAACC;EAAY;EAAK,OA7BmB,cACpC;GACJ,qBAAqB,EAAE,oBAAoB,GAAG;GAC9C,sBAAsB,EAAE,OAAO,qBAAqB,GAAG;GACvD,gBAAgB,EAAE,mBAAmB,eAAe,GAAG;GACvD,SAAS,EAAE,QAAQ,GAAG;GACtB,YAAY,EAAE,WAAW,GAAG;GAC5B,YAAY,EAAE,WAAW,GAAG;GAC5B,QAAQ,EAAE,OAAO,GAAG;GACpB,WAAW,EAAE,UAAU,GAAG;GAC1B,WAAW,EAAE,UAAU,GAAG;GAC1B,OAAO;GACP;GACD,EACD;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,OAAO;GACR,CACF;EAE8C,GAAI;GAAS;EAC5D;AAEF,KAAK,cAAc"}
|