@yahoo/uds-mobile 2.14.0 → 2.16.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.
Files changed (168) hide show
  1. package/README.md +27 -24
  2. package/dist/components/Avatar/Avatar.cjs +45 -0
  3. package/dist/components/Avatar/Avatar.d.cts +19 -0
  4. package/dist/components/Avatar/Avatar.d.cts.map +1 -0
  5. package/dist/components/Avatar/Avatar.d.ts +19 -0
  6. package/dist/components/Avatar/Avatar.d.ts.map +1 -0
  7. package/dist/components/Avatar/Avatar.js +45 -0
  8. package/dist/components/Avatar/Avatar.js.map +1 -0
  9. package/dist/components/Avatar/AvatarIcon.cjs +47 -0
  10. package/dist/components/Avatar/AvatarIcon.d.cts +9 -0
  11. package/dist/components/Avatar/AvatarIcon.d.cts.map +1 -0
  12. package/dist/components/Avatar/AvatarIcon.d.ts +9 -0
  13. package/dist/components/Avatar/AvatarIcon.d.ts.map +1 -0
  14. package/dist/components/Avatar/AvatarIcon.js +47 -0
  15. package/dist/components/Avatar/AvatarIcon.js.map +1 -0
  16. package/dist/components/Avatar/AvatarImage.cjs +81 -0
  17. package/dist/components/Avatar/AvatarImage.d.cts +9 -0
  18. package/dist/components/Avatar/AvatarImage.d.cts.map +1 -0
  19. package/dist/components/Avatar/AvatarImage.d.ts +9 -0
  20. package/dist/components/Avatar/AvatarImage.d.ts.map +1 -0
  21. package/dist/components/Avatar/AvatarImage.js +81 -0
  22. package/dist/components/Avatar/AvatarImage.js.map +1 -0
  23. package/dist/components/Avatar/AvatarText.cjs +49 -0
  24. package/dist/components/Avatar/AvatarText.d.cts +9 -0
  25. package/dist/components/Avatar/AvatarText.d.cts.map +1 -0
  26. package/dist/components/Avatar/AvatarText.d.ts +9 -0
  27. package/dist/components/Avatar/AvatarText.d.ts.map +1 -0
  28. package/dist/components/Avatar/AvatarText.js +49 -0
  29. package/dist/components/Avatar/AvatarText.js.map +1 -0
  30. package/dist/components/Avatar/index.cjs +10 -0
  31. package/dist/components/Avatar/index.d.cts +7 -0
  32. package/dist/components/Avatar/index.d.ts +7 -0
  33. package/dist/components/Avatar/index.js +6 -0
  34. package/dist/components/Avatar/types.cjs +1 -0
  35. package/dist/components/Avatar/types.d.cts +28 -0
  36. package/dist/components/Avatar/types.d.cts.map +1 -0
  37. package/dist/components/Avatar/types.d.ts +28 -0
  38. package/dist/components/Avatar/types.d.ts.map +1 -0
  39. package/dist/components/Avatar/types.js +1 -0
  40. package/dist/components/Avatar/utils.cjs +38 -0
  41. package/dist/components/Avatar/utils.d.cts +14 -0
  42. package/dist/components/Avatar/utils.d.cts.map +1 -0
  43. package/dist/components/Avatar/utils.d.ts +14 -0
  44. package/dist/components/Avatar/utils.d.ts.map +1 -0
  45. package/dist/components/Avatar/utils.js +35 -0
  46. package/dist/components/Avatar/utils.js.map +1 -0
  47. package/dist/components/Badge.cjs +1 -1
  48. package/dist/components/Badge.js +1 -1
  49. package/dist/components/Chip/Chip.cjs +54 -0
  50. package/dist/components/Chip/Chip.d.cts +19 -0
  51. package/dist/components/Chip/Chip.d.cts.map +1 -0
  52. package/dist/components/Chip/Chip.d.ts +19 -0
  53. package/dist/components/Chip/Chip.d.ts.map +1 -0
  54. package/dist/components/Chip/Chip.js +54 -0
  55. package/dist/components/Chip/Chip.js.map +1 -0
  56. package/dist/components/Chip/ChipBase.cjs +119 -0
  57. package/dist/components/Chip/ChipBase.d.cts +13 -0
  58. package/dist/components/Chip/ChipBase.d.cts.map +1 -0
  59. package/dist/components/Chip/ChipBase.d.ts +13 -0
  60. package/dist/components/Chip/ChipBase.d.ts.map +1 -0
  61. package/dist/components/Chip/ChipBase.js +116 -0
  62. package/dist/components/Chip/ChipBase.js.map +1 -0
  63. package/dist/components/Chip/ChipButton.cjs +18 -0
  64. package/dist/components/Chip/ChipButton.d.cts +9 -0
  65. package/dist/components/Chip/ChipButton.d.cts.map +1 -0
  66. package/dist/components/Chip/ChipButton.d.ts +9 -0
  67. package/dist/components/Chip/ChipButton.d.ts.map +1 -0
  68. package/dist/components/Chip/ChipButton.js +18 -0
  69. package/dist/components/Chip/ChipButton.js.map +1 -0
  70. package/dist/components/Chip/ChipDismissible.cjs +49 -0
  71. package/dist/components/Chip/ChipDismissible.d.cts +9 -0
  72. package/dist/components/Chip/ChipDismissible.d.cts.map +1 -0
  73. package/dist/components/Chip/ChipDismissible.d.ts +9 -0
  74. package/dist/components/Chip/ChipDismissible.d.ts.map +1 -0
  75. package/dist/components/Chip/ChipDismissible.js +49 -0
  76. package/dist/components/Chip/ChipDismissible.js.map +1 -0
  77. package/dist/components/Chip/ChipToggle.cjs +32 -0
  78. package/dist/components/Chip/ChipToggle.d.cts +9 -0
  79. package/dist/components/Chip/ChipToggle.d.cts.map +1 -0
  80. package/dist/components/Chip/ChipToggle.d.ts +9 -0
  81. package/dist/components/Chip/ChipToggle.d.ts.map +1 -0
  82. package/dist/components/Chip/ChipToggle.js +32 -0
  83. package/dist/components/Chip/ChipToggle.js.map +1 -0
  84. package/dist/components/Chip/chipTheme.cjs +23 -0
  85. package/dist/components/Chip/chipTheme.d.cts +14 -0
  86. package/dist/components/Chip/chipTheme.d.cts.map +1 -0
  87. package/dist/components/Chip/chipTheme.d.ts +14 -0
  88. package/dist/components/Chip/chipTheme.d.ts.map +1 -0
  89. package/dist/components/Chip/chipTheme.js +24 -0
  90. package/dist/components/Chip/chipTheme.js.map +1 -0
  91. package/dist/components/Chip/index.cjs +10 -0
  92. package/dist/components/Chip/index.d.cts +7 -0
  93. package/dist/components/Chip/index.d.ts +7 -0
  94. package/dist/components/Chip/index.js +6 -0
  95. package/dist/components/Chip/types.cjs +1 -0
  96. package/dist/components/Chip/types.d.cts +76 -0
  97. package/dist/components/Chip/types.d.cts.map +1 -0
  98. package/dist/components/Chip/types.d.ts +76 -0
  99. package/dist/components/Chip/types.d.ts.map +1 -0
  100. package/dist/components/Chip/types.js +1 -0
  101. package/dist/components/Input.cjs +17 -14
  102. package/dist/components/Input.d.cts.map +1 -1
  103. package/dist/components/Input.d.ts.map +1 -1
  104. package/dist/components/Input.js +17 -14
  105. package/dist/components/Input.js.map +1 -1
  106. package/dist/components/InputHelpText.cjs +52 -0
  107. package/dist/components/InputHelpText.d.cts +37 -0
  108. package/dist/components/InputHelpText.d.cts.map +1 -0
  109. package/dist/components/InputHelpText.d.ts +37 -0
  110. package/dist/components/InputHelpText.d.ts.map +1 -0
  111. package/dist/components/InputHelpText.js +52 -0
  112. package/dist/components/InputHelpText.js.map +1 -0
  113. package/dist/components/internal/Overlay/OverlayPortal.cjs +20 -0
  114. package/dist/components/internal/Overlay/OverlayPortal.d.cts +17 -0
  115. package/dist/components/internal/Overlay/OverlayPortal.d.cts.map +1 -0
  116. package/dist/components/internal/Overlay/OverlayPortal.d.ts +17 -0
  117. package/dist/components/internal/Overlay/OverlayPortal.d.ts.map +1 -0
  118. package/dist/components/internal/Overlay/OverlayPortal.js +20 -0
  119. package/dist/components/internal/Overlay/OverlayPortal.js.map +1 -0
  120. package/dist/components/internal/Overlay/index.cjs +6 -0
  121. package/dist/components/internal/Overlay/index.d.cts +5 -0
  122. package/dist/components/internal/Overlay/index.d.ts +5 -0
  123. package/dist/components/internal/Overlay/index.js +4 -0
  124. package/dist/components/internal/Overlay/types.cjs +1 -0
  125. package/dist/components/internal/Overlay/types.d.cts +21 -0
  126. package/dist/components/internal/Overlay/types.d.cts.map +1 -0
  127. package/dist/components/internal/Overlay/types.d.ts +21 -0
  128. package/dist/components/internal/Overlay/types.d.ts.map +1 -0
  129. package/dist/components/internal/Overlay/types.js +1 -0
  130. package/dist/components/internal/Overlay/useControllableState.cjs +34 -0
  131. package/dist/components/internal/Overlay/useControllableState.d.cts +18 -0
  132. package/dist/components/internal/Overlay/useControllableState.d.cts.map +1 -0
  133. package/dist/components/internal/Overlay/useControllableState.d.ts +18 -0
  134. package/dist/components/internal/Overlay/useControllableState.d.ts.map +1 -0
  135. package/dist/components/internal/Overlay/useControllableState.js +34 -0
  136. package/dist/components/internal/Overlay/useControllableState.js.map +1 -0
  137. package/dist/portal.cjs +1 -0
  138. package/dist/portal.d.cts +6 -1
  139. package/dist/portal.d.cts.map +1 -1
  140. package/dist/portal.d.ts +6 -1
  141. package/dist/portal.d.ts.map +1 -1
  142. package/dist/portal.js +1 -1
  143. package/dist/portal.js.map +1 -1
  144. package/dist/types/dist/index.d.cts +36 -1
  145. package/dist/types/dist/index.d.cts.map +1 -1
  146. package/dist/types/dist/index.d.ts +36 -1
  147. package/dist/types/dist/index.d.ts.map +1 -1
  148. package/fonts/index.cjs +219 -219
  149. package/fonts/index.mjs +219 -219
  150. package/generated/styles.cjs +114 -0
  151. package/generated/styles.d.ts +29 -0
  152. package/generated/styles.mjs +114 -0
  153. package/generated/unistyles.d.ts +110 -0
  154. package/package.json +19 -9
  155. package/dist/components/Avatar.cjs +0 -116
  156. package/dist/components/Avatar.d.cts +0 -68
  157. package/dist/components/Avatar.d.cts.map +0 -1
  158. package/dist/components/Avatar.d.ts +0 -68
  159. package/dist/components/Avatar.d.ts.map +0 -1
  160. package/dist/components/Avatar.js +0 -116
  161. package/dist/components/Avatar.js.map +0 -1
  162. package/dist/components/Chip.cjs +0 -139
  163. package/dist/components/Chip.d.cts +0 -82
  164. package/dist/components/Chip.d.cts.map +0 -1
  165. package/dist/components/Chip.d.ts +0 -82
  166. package/dist/components/Chip.d.ts.map +0 -1
  167. package/dist/components/Chip.js +0 -139
  168. package/dist/components/Chip.js.map +0 -1
@@ -2011,6 +2011,35 @@ export declare const modalStyles: {
2011
2011
  ) => void;
2012
2012
  };
2013
2013
 
2014
+ export declare const paddleNavStyles: {
2015
+ root: { borderRadius: number; borderWidth: number; padding: number; borderColor: string };
2016
+ icon: {
2017
+ fontSize: number;
2018
+ iconSizeToken: 'md' | 'sm' | 'lg' | 'xs';
2019
+ lineHeight: number;
2020
+ color: string;
2021
+ };
2022
+ background: { backgroundColor: string; opacity: number };
2023
+ } & {
2024
+ useVariants: (
2025
+ variants:
2026
+ | {
2027
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | undefined;
2028
+ variant?: 'primary' | 'secondary' | 'tertiary' | undefined;
2029
+ pressed?: boolean | 'true' | undefined;
2030
+ }
2031
+ | {
2032
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | undefined;
2033
+ variant?: 'primary' | 'secondary' | 'tertiary' | undefined;
2034
+ pressed?: boolean | 'true' | undefined;
2035
+ }
2036
+ | {
2037
+ variant?: 'primary' | 'secondary' | 'tertiary' | undefined;
2038
+ pressed?: boolean | 'true' | undefined;
2039
+ },
2040
+ ) => void;
2041
+ };
2042
+
2014
2043
  export declare const popoverStyles: {
2015
2044
  root: { boxShadow: string };
2016
2045
  blur: { backgroundBlurRadius: number };
@@ -4456,6 +4456,119 @@ const modalStyles = StyleSheet.create((theme) => ({
4456
4456
  },
4457
4457
  }));
4458
4458
 
4459
+ /**
4460
+ * Layer-based styles for PaddleNav.
4461
+ * Uses compound variants for state-specific (disabled/pressed) styles.
4462
+ *
4463
+ * Usage:
4464
+ * ```tsx
4465
+ * paddleNavStyles.useVariants({
4466
+ * size,
4467
+ * variant,
4468
+ * disabled: isDisabled, // boolean
4469
+ * pressed: isPressed, // boolean
4470
+ * });
4471
+ * // Access: paddleNavStyles.root, paddleNavStyles.icon, etc.
4472
+ * ```
4473
+ */
4474
+ const paddleNavStyles = StyleSheet.create((theme) => ({
4475
+ root: {
4476
+ variants: {
4477
+ size: {
4478
+ lg: theme.components['paddleNav/size/lg/root/rest'],
4479
+ md: theme.components['paddleNav/size/md/root/rest'],
4480
+ sm: theme.components['paddleNav/size/sm/root/rest'],
4481
+ xl: theme.components['paddleNav/size/xl/root/rest'],
4482
+ xs: theme.components['paddleNav/size/xs/root/rest'],
4483
+ },
4484
+ variant: {
4485
+ primary: theme.components['paddleNav/variant/primary/root/rest'],
4486
+ secondary: theme.components['paddleNav/variant/secondary/root/rest'],
4487
+ tertiary: theme.components['paddleNav/variant/tertiary/root/rest'],
4488
+ },
4489
+ pressed: { true: {} },
4490
+ },
4491
+ compoundVariants: [
4492
+ {
4493
+ variant: 'primary',
4494
+ pressed: true,
4495
+ styles: theme.components['paddleNav/variant/primary/root/pressed'],
4496
+ },
4497
+ {
4498
+ variant: 'secondary',
4499
+ pressed: true,
4500
+ styles: theme.components['paddleNav/variant/secondary/root/pressed'],
4501
+ },
4502
+ {
4503
+ variant: 'tertiary',
4504
+ pressed: true,
4505
+ styles: theme.components['paddleNav/variant/tertiary/root/pressed'],
4506
+ },
4507
+ ],
4508
+ },
4509
+ icon: {
4510
+ variants: {
4511
+ size: {
4512
+ lg: theme.components['paddleNav/size/lg/icon/rest'],
4513
+ md: theme.components['paddleNav/size/md/icon/rest'],
4514
+ sm: theme.components['paddleNav/size/sm/icon/rest'],
4515
+ xl: theme.components['paddleNav/size/xl/icon/rest'],
4516
+ xs: theme.components['paddleNav/size/xs/icon/rest'],
4517
+ },
4518
+ variant: {
4519
+ primary: theme.components['paddleNav/variant/primary/icon/rest'],
4520
+ secondary: theme.components['paddleNav/variant/secondary/icon/rest'],
4521
+ tertiary: theme.components['paddleNav/variant/tertiary/icon/rest'],
4522
+ },
4523
+ pressed: { true: {} },
4524
+ },
4525
+ compoundVariants: [
4526
+ {
4527
+ variant: 'primary',
4528
+ pressed: true,
4529
+ styles: theme.components['paddleNav/variant/primary/icon/pressed'],
4530
+ },
4531
+ {
4532
+ variant: 'secondary',
4533
+ pressed: true,
4534
+ styles: theme.components['paddleNav/variant/secondary/icon/pressed'],
4535
+ },
4536
+ {
4537
+ variant: 'tertiary',
4538
+ pressed: true,
4539
+ styles: theme.components['paddleNav/variant/tertiary/icon/pressed'],
4540
+ },
4541
+ ],
4542
+ },
4543
+ background: {
4544
+ variants: {
4545
+ variant: {
4546
+ primary: theme.components['paddleNav/variant/primary/background/rest'],
4547
+ secondary: theme.components['paddleNav/variant/secondary/background/rest'],
4548
+ tertiary: theme.components['paddleNav/variant/tertiary/background/rest'],
4549
+ },
4550
+ pressed: { true: {} },
4551
+ },
4552
+ compoundVariants: [
4553
+ {
4554
+ variant: 'primary',
4555
+ pressed: true,
4556
+ styles: theme.components['paddleNav/variant/primary/background/pressed'],
4557
+ },
4558
+ {
4559
+ variant: 'secondary',
4560
+ pressed: true,
4561
+ styles: theme.components['paddleNav/variant/secondary/background/pressed'],
4562
+ },
4563
+ {
4564
+ variant: 'tertiary',
4565
+ pressed: true,
4566
+ styles: theme.components['paddleNav/variant/tertiary/background/pressed'],
4567
+ },
4568
+ ],
4569
+ },
4570
+ }));
4571
+
4459
4572
  /**
4460
4573
  * Layer-based styles for Popover.
4461
4574
  * Uses compound variants for state-specific (disabled/pressed) styles.
@@ -5233,6 +5346,7 @@ export {
5233
5346
  menuContentStyles,
5234
5347
  menuItemStyles,
5235
5348
  modalStyles,
5349
+ paddleNavStyles,
5236
5350
  popoverStyles,
5237
5351
  radioStyles,
5238
5352
  scrimStyles,
@@ -4003,6 +4003,116 @@ interface ComponentTheme {
4003
4003
  'modal/variant/default/title/rest': {
4004
4004
  color: string;
4005
4005
  };
4006
+ 'paddleNav/size/lg/icon/rest': {
4007
+ fontSize: number;
4008
+ iconSizeToken: string;
4009
+ lineHeight: number;
4010
+ };
4011
+ 'paddleNav/size/lg/root/rest': {
4012
+ borderRadius: number;
4013
+ borderWidth: number;
4014
+ padding: number;
4015
+ };
4016
+ 'paddleNav/size/md/icon/rest': {
4017
+ fontSize: number;
4018
+ iconSizeToken: string;
4019
+ lineHeight: number;
4020
+ };
4021
+ 'paddleNav/size/md/root/rest': {
4022
+ borderRadius: number;
4023
+ borderWidth: number;
4024
+ padding: number;
4025
+ };
4026
+ 'paddleNav/size/sm/icon/rest': {
4027
+ fontSize: number;
4028
+ iconSizeToken: string;
4029
+ lineHeight: number;
4030
+ };
4031
+ 'paddleNav/size/sm/root/rest': {
4032
+ borderRadius: number;
4033
+ borderWidth: number;
4034
+ padding: number;
4035
+ };
4036
+ 'paddleNav/size/xl/icon/rest': {
4037
+ fontSize: number;
4038
+ iconSizeToken: string;
4039
+ lineHeight: number;
4040
+ };
4041
+ 'paddleNav/size/xl/root/rest': {
4042
+ borderRadius: number;
4043
+ borderWidth: number;
4044
+ padding: number;
4045
+ };
4046
+ 'paddleNav/size/xs/icon/rest': {
4047
+ fontSize: number;
4048
+ iconSizeToken: string;
4049
+ lineHeight: number;
4050
+ };
4051
+ 'paddleNav/size/xs/root/rest': {
4052
+ borderRadius: number;
4053
+ borderWidth: number;
4054
+ padding: number;
4055
+ };
4056
+ 'paddleNav/variant/primary/background/pressed': {
4057
+ backgroundColor: string;
4058
+ opacity: number;
4059
+ };
4060
+ 'paddleNav/variant/primary/background/rest': {
4061
+ backgroundColor: string;
4062
+ opacity: number;
4063
+ };
4064
+ 'paddleNav/variant/primary/icon/pressed': {
4065
+ color: string;
4066
+ };
4067
+ 'paddleNav/variant/primary/icon/rest': {
4068
+ color: string;
4069
+ };
4070
+ 'paddleNav/variant/primary/root/pressed': {
4071
+ borderColor: string;
4072
+ };
4073
+ 'paddleNav/variant/primary/root/rest': {
4074
+ borderColor: string;
4075
+ };
4076
+ 'paddleNav/variant/secondary/background/pressed': {
4077
+ backgroundColor: string;
4078
+ opacity: number;
4079
+ };
4080
+ 'paddleNav/variant/secondary/background/rest': {
4081
+ backgroundColor: string;
4082
+ opacity: number;
4083
+ };
4084
+ 'paddleNav/variant/secondary/icon/pressed': {
4085
+ color: string;
4086
+ };
4087
+ 'paddleNav/variant/secondary/icon/rest': {
4088
+ color: string;
4089
+ };
4090
+ 'paddleNav/variant/secondary/root/pressed': {
4091
+ borderColor: string;
4092
+ };
4093
+ 'paddleNav/variant/secondary/root/rest': {
4094
+ borderColor: string;
4095
+ };
4096
+ 'paddleNav/variant/tertiary/background/pressed': {
4097
+ backgroundColor: string;
4098
+ opacity: number;
4099
+ };
4100
+ 'paddleNav/variant/tertiary/background/rest': {
4101
+ backgroundColor: string;
4102
+ opacity: number;
4103
+ };
4104
+ 'paddleNav/variant/tertiary/icon/pressed': {
4105
+ color: string;
4106
+ };
4107
+ 'paddleNav/variant/tertiary/icon/rest': {
4108
+ color: string;
4109
+ };
4110
+ 'paddleNav/variant/tertiary/root/pressed': {
4111
+ borderColor: string;
4112
+ };
4113
+ 'paddleNav/variant/tertiary/root/rest': {
4114
+ borderColor: string;
4115
+ };
4006
4116
  'popover/size/default/closeIcon/rest': {
4007
4117
  fontSize: number;
4008
4118
  iconSizeToken: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yahoo/uds-mobile",
3
- "version": "2.14.0",
3
+ "version": "2.16.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "uds-mobile": "./cli/uds-mobile.js"
@@ -22,12 +22,12 @@
22
22
  "exports": {
23
23
  "./Avatar": {
24
24
  "import": {
25
- "types": "./dist/components/Avatar.d.ts",
26
- "default": "./dist/components/Avatar.js"
25
+ "types": "./dist/components/Avatar/index.d.ts",
26
+ "default": "./dist/components/Avatar/index.js"
27
27
  },
28
28
  "require": {
29
- "types": "./dist/components/Avatar.d.cts",
30
- "default": "./dist/components/Avatar.cjs"
29
+ "types": "./dist/components/Avatar/index.d.cts",
30
+ "default": "./dist/components/Avatar/index.cjs"
31
31
  }
32
32
  },
33
33
  "./Badge": {
@@ -102,12 +102,12 @@
102
102
  },
103
103
  "./Chip": {
104
104
  "import": {
105
- "types": "./dist/components/Chip.d.ts",
106
- "default": "./dist/components/Chip.js"
105
+ "types": "./dist/components/Chip/index.d.ts",
106
+ "default": "./dist/components/Chip/index.js"
107
107
  },
108
108
  "require": {
109
- "types": "./dist/components/Chip.d.cts",
110
- "default": "./dist/components/Chip.cjs"
109
+ "types": "./dist/components/Chip/index.d.cts",
110
+ "default": "./dist/components/Chip/index.cjs"
111
111
  }
112
112
  },
113
113
  "./Divider": {
@@ -190,6 +190,16 @@
190
190
  "default": "./dist/components/Input.cjs"
191
191
  }
192
192
  },
193
+ "./InputHelpText": {
194
+ "import": {
195
+ "types": "./dist/components/InputHelpText.d.ts",
196
+ "default": "./dist/components/InputHelpText.js"
197
+ },
198
+ "require": {
199
+ "types": "./dist/components/InputHelpText.d.cts",
200
+ "default": "./dist/components/InputHelpText.cjs"
201
+ }
202
+ },
193
203
  "./Link": {
194
204
  "import": {
195
205
  "types": "./dist/components/Link.d.ts",
@@ -1,116 +0,0 @@
1
- /*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- require("../_virtual/_rolldown/runtime.cjs");
4
- const require_components_Box = require("./Box.cjs");
5
- const require_components_IconSlot = require("./IconSlot.cjs");
6
- const require_components_Text = require("./Text.cjs");
7
- let react = require("react");
8
- let react_native = require("react-native");
9
- let react_jsx_runtime = require("react/jsx-runtime");
10
- let generated_styles = require("../../generated/styles");
11
- //#region src/components/Avatar.tsx
12
- const abbreviationStrategies = {
13
- first: (initials) => initials[0] ?? "",
14
- last: (initials) => initials[initials.length - 1] ?? "",
15
- firstAndLast: (initials) => initials.length === 1 ? initials[0] ?? "" : `${initials[0]}${initials[initials.length - 1]}`,
16
- firstTwo: (initials) => initials.slice(0, 2).join(""),
17
- firstThree: (initials) => initials.slice(0, 3).join(""),
18
- firstOfEach: (initials) => initials.join("")
19
- };
20
- /** Generate initials from a name */
21
- function generateInitials(name, strategy = "firstAndLast") {
22
- if (!name) return "";
23
- if (typeof strategy === "function") return strategy(name);
24
- const initials = name.trim().split(/\s+/).map((word) => word[0]?.toUpperCase() ?? "");
25
- return abbreviationStrategies[strategy](initials);
26
- }
27
- /**
28
- * **Avatar component for user representation**
29
- *
30
- * @description
31
- * Displays a user avatar with image, initials fallback, or icon fallback.
32
- *
33
- * @category Display
34
- * @platform mobile
35
- *
36
- * @example
37
- * ```tsx
38
- * import { Avatar } from '@yahoo/uds-mobile/Avatar';
39
- *
40
- * // With image
41
- * <Avatar
42
- * src="https://example.com/photo.jpg"
43
- * alt="Jane Doe"
44
- * />
45
- *
46
- * // With initials fallback
47
- * <Avatar alt="Jane Doe" />
48
- *
49
- * // With explicit initials
50
- * <Avatar fallback="JD" />
51
- *
52
- * // With custom icon
53
- * <Avatar icon="Person" variant="secondary" />
54
- * ```
55
- *
56
- * @accessibility
57
- * - Sets `accessibilityRole="image"` automatically
58
- * - Uses `alt` prop as accessibility label
59
- * - Always provide meaningful `alt` text for user identification
60
- *
61
- * @see {@link Image} for general image display
62
- */
63
- const Avatar = (0, react.forwardRef)(function Avatar({ src, alt, fallback, size = "md", variant = "primary", icon, abbreviationStrategy = "firstAndLast", style, ...props }, ref) {
64
- const [imageError, setImageError] = (0, react.useState)(false);
65
- const initials = fallback || generateInitials(alt, abbreviationStrategy);
66
- const hasImage = src && !imageError;
67
- const hasText = initials.length > 0;
68
- const showImage = hasImage;
69
- const showText = !hasImage && hasText;
70
- const showIcon = !hasImage && !hasText;
71
- generated_styles.avatarStyles.useVariants({
72
- size,
73
- ...showImage && { image: variant },
74
- ...showText && { text: variant },
75
- ...showIcon && { icon: variant }
76
- });
77
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
78
- ref,
79
- style: [
80
- generated_styles.avatarStyles.root,
81
- {
82
- alignItems: "center",
83
- justifyContent: "center",
84
- overflow: "hidden"
85
- },
86
- style
87
- ],
88
- accessibilityRole: "image",
89
- accessibilityLabel: alt,
90
- ...props,
91
- children: [
92
- showImage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Image, {
93
- source: { uri: src },
94
- style: {
95
- width: "100%",
96
- height: "100%"
97
- },
98
- onError: () => setImageError(true),
99
- accessibilityLabel: alt
100
- }),
101
- showText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
102
- style: generated_styles.avatarStyles.text,
103
- numberOfLines: 1,
104
- children: initials
105
- }),
106
- showIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
107
- icon: icon ?? "Person",
108
- variant: "fill",
109
- style: generated_styles.avatarStyles.icon
110
- })
111
- ]
112
- });
113
- });
114
- Avatar.displayName = "Avatar";
115
- //#endregion
116
- exports.Avatar = Avatar;
@@ -1,68 +0,0 @@
1
-
2
- import { IconSlotType } from "./IconSlot.cjs";
3
- import * as _$react from "react";
4
- import { View, ViewProps } from "react-native";
5
-
6
- //#region src/components/Avatar.d.ts
7
- /** Avatar size options */
8
- type AvatarSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
9
- /** Avatar variant options */
10
- type AvatarVariant = 'primary' | 'secondary';
11
- /** Abbreviation strategy for generating initials */
12
- type AbbreviationStrategy = 'first' | 'last' | 'firstAndLast' | 'firstTwo' | 'firstThree' | 'firstOfEach' | ((name: string) => string);
13
- interface AvatarProps extends ViewProps {
14
- /** Image source URL */
15
- src?: string;
16
- /** Alt text for the image, also used for generating initials */
17
- alt?: string;
18
- /** Explicit initials to display (overrides auto-generated from alt) */
19
- fallback?: string;
20
- /** Size of the avatar @default 'md' */
21
- size?: AvatarSize;
22
- /** Variant style @default 'primary' */
23
- variant?: AvatarVariant;
24
- /** Custom icon to display when no image or text fallback */
25
- icon?: IconSlotType;
26
- /** Strategy for generating initials from name @default 'firstAndLast' */
27
- abbreviationStrategy?: AbbreviationStrategy;
28
- }
29
- /**
30
- * **Avatar component for user representation**
31
- *
32
- * @description
33
- * Displays a user avatar with image, initials fallback, or icon fallback.
34
- *
35
- * @category Display
36
- * @platform mobile
37
- *
38
- * @example
39
- * ```tsx
40
- * import { Avatar } from '@yahoo/uds-mobile/Avatar';
41
- *
42
- * // With image
43
- * <Avatar
44
- * src="https://example.com/photo.jpg"
45
- * alt="Jane Doe"
46
- * />
47
- *
48
- * // With initials fallback
49
- * <Avatar alt="Jane Doe" />
50
- *
51
- * // With explicit initials
52
- * <Avatar fallback="JD" />
53
- *
54
- * // With custom icon
55
- * <Avatar icon="Person" variant="secondary" />
56
- * ```
57
- *
58
- * @accessibility
59
- * - Sets `accessibilityRole="image"` automatically
60
- * - Uses `alt` prop as accessibility label
61
- * - Always provide meaningful `alt` text for user identification
62
- *
63
- * @see {@link Image} for general image display
64
- */
65
- declare const Avatar: _$react.ForwardRefExoticComponent<AvatarProps & _$react.RefAttributes<View>>;
66
- //#endregion
67
- export { Avatar, type AvatarProps };
68
- //# sourceMappingURL=Avatar.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.d.cts","names":[],"sources":["../../src/components/Avatar.tsx"],"mappings":";;;;;;;KAWK,UAAA;;KAGA,aAAA;;KAGA,oBAAA,qFAOC,IAAA;AAAA,UAEI,WAAA,SAAoB,SAAA;EAff;EAiBb,GAAA;EAdgB;EAgBhB,GAAA;EAhBgB;EAkBhB,QAAA;EAfG;EAiBH,IAAA,GAAO,UAAA;;EAEP,OAAA,GAAU,aAAA;EAZM;EAchB,IAAA,GAAO,YAAA;EAZa;EAcpB,oBAAA,GAAuB,oBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;AAAoB;;;;;;;;;;;;;;;;cAoEvC,MAAA,EAAM,OAAA,CAAA,yBAAA,CAAA,WAAA,GAAA,OAAA,CAAA,aAAA,CAAA,IAAA"}
@@ -1,68 +0,0 @@
1
-
2
- import { IconSlotType } from "./IconSlot.js";
3
- import * as _$react from "react";
4
- import { View, ViewProps } from "react-native";
5
-
6
- //#region src/components/Avatar.d.ts
7
- /** Avatar size options */
8
- type AvatarSize = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
9
- /** Avatar variant options */
10
- type AvatarVariant = 'primary' | 'secondary';
11
- /** Abbreviation strategy for generating initials */
12
- type AbbreviationStrategy = 'first' | 'last' | 'firstAndLast' | 'firstTwo' | 'firstThree' | 'firstOfEach' | ((name: string) => string);
13
- interface AvatarProps extends ViewProps {
14
- /** Image source URL */
15
- src?: string;
16
- /** Alt text for the image, also used for generating initials */
17
- alt?: string;
18
- /** Explicit initials to display (overrides auto-generated from alt) */
19
- fallback?: string;
20
- /** Size of the avatar @default 'md' */
21
- size?: AvatarSize;
22
- /** Variant style @default 'primary' */
23
- variant?: AvatarVariant;
24
- /** Custom icon to display when no image or text fallback */
25
- icon?: IconSlotType;
26
- /** Strategy for generating initials from name @default 'firstAndLast' */
27
- abbreviationStrategy?: AbbreviationStrategy;
28
- }
29
- /**
30
- * **Avatar component for user representation**
31
- *
32
- * @description
33
- * Displays a user avatar with image, initials fallback, or icon fallback.
34
- *
35
- * @category Display
36
- * @platform mobile
37
- *
38
- * @example
39
- * ```tsx
40
- * import { Avatar } from '@yahoo/uds-mobile/Avatar';
41
- *
42
- * // With image
43
- * <Avatar
44
- * src="https://example.com/photo.jpg"
45
- * alt="Jane Doe"
46
- * />
47
- *
48
- * // With initials fallback
49
- * <Avatar alt="Jane Doe" />
50
- *
51
- * // With explicit initials
52
- * <Avatar fallback="JD" />
53
- *
54
- * // With custom icon
55
- * <Avatar icon="Person" variant="secondary" />
56
- * ```
57
- *
58
- * @accessibility
59
- * - Sets `accessibilityRole="image"` automatically
60
- * - Uses `alt` prop as accessibility label
61
- * - Always provide meaningful `alt` text for user identification
62
- *
63
- * @see {@link Image} for general image display
64
- */
65
- declare const Avatar: _$react.ForwardRefExoticComponent<AvatarProps & _$react.RefAttributes<View>>;
66
- //#endregion
67
- export { Avatar, type AvatarProps };
68
- //# sourceMappingURL=Avatar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Avatar.d.ts","names":[],"sources":["../../src/components/Avatar.tsx"],"mappings":";;;;;;;KAWK,UAAA;;KAGA,aAAA;;KAGA,oBAAA,qFAOC,IAAA;AAAA,UAEI,WAAA,SAAoB,SAAA;EAff;EAiBb,GAAA;EAdgB;EAgBhB,GAAA;EAhBgB;EAkBhB,QAAA;EAfG;EAiBH,IAAA,GAAO,UAAA;;EAEP,OAAA,GAAU,aAAA;EAZM;EAchB,IAAA,GAAO,YAAA;EAZa;EAcpB,oBAAA,GAAuB,oBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;AAAoB;;;;;;;;;;;;;;;;cAoEvC,MAAA,EAAM,OAAA,CAAA,yBAAA,CAAA,WAAA,GAAA,OAAA,CAAA,aAAA,CAAA,IAAA"}