@oxy.so/bloom 2.12.2 → 2.12.4

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 (98) hide show
  1. package/docs/message-bubble.mdx +37 -3
  2. package/docs/message-media.mdx +6 -0
  3. package/lib/commonjs/button/shared.js +10 -1
  4. package/lib/commonjs/button/shared.js.map +1 -1
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/index.web.js.map +1 -1
  7. package/lib/commonjs/message-bubble/MessageBubble.js +16 -5
  8. package/lib/commonjs/message-bubble/MessageBubble.js.map +1 -1
  9. package/lib/commonjs/sidebar/Sidebar.js +5 -1
  10. package/lib/commonjs/sidebar/Sidebar.js.map +1 -1
  11. package/lib/commonjs/sidebar/SidebarModeSwitcher.js +14 -20
  12. package/lib/commonjs/sidebar/SidebarModeSwitcher.js.map +1 -1
  13. package/lib/commonjs/sidebar/palette.js +2 -0
  14. package/lib/commonjs/sidebar/palette.js.map +1 -1
  15. package/lib/commonjs/social-button/OxyMark.js +4 -2
  16. package/lib/commonjs/social-button/OxyMark.js.map +1 -1
  17. package/lib/commonjs/social-button/SocialButton.js +2 -1
  18. package/lib/commonjs/social-button/SocialButton.js.map +1 -1
  19. package/lib/commonjs/social-button/use-svg-id.js +16 -0
  20. package/lib/commonjs/social-button/use-svg-id.js.map +1 -0
  21. package/lib/commonjs/theme-toggle/ThemeToggle.js +2 -2
  22. package/lib/commonjs/theme-toggle/ThemeToggle.js.map +1 -1
  23. package/lib/module/button/shared.js +9 -0
  24. package/lib/module/button/shared.js.map +1 -1
  25. package/lib/module/index.js.map +1 -1
  26. package/lib/module/index.web.js.map +1 -1
  27. package/lib/module/message-bubble/MessageBubble.js +16 -5
  28. package/lib/module/message-bubble/MessageBubble.js.map +1 -1
  29. package/lib/module/sidebar/Sidebar.js +5 -1
  30. package/lib/module/sidebar/Sidebar.js.map +1 -1
  31. package/lib/module/sidebar/SidebarModeSwitcher.js +16 -22
  32. package/lib/module/sidebar/SidebarModeSwitcher.js.map +1 -1
  33. package/lib/module/sidebar/palette.js +3 -1
  34. package/lib/module/sidebar/palette.js.map +1 -1
  35. package/lib/module/social-button/OxyMark.js +3 -2
  36. package/lib/module/social-button/OxyMark.js.map +1 -1
  37. package/lib/module/social-button/SocialButton.js +3 -2
  38. package/lib/module/social-button/SocialButton.js.map +1 -1
  39. package/lib/module/social-button/use-svg-id.js +13 -0
  40. package/lib/module/social-button/use-svg-id.js.map +1 -0
  41. package/lib/module/theme-toggle/ThemeToggle.js +3 -3
  42. package/lib/module/theme-toggle/ThemeToggle.js.map +1 -1
  43. package/lib/typescript/commonjs/button/shared.d.ts +8 -0
  44. package/lib/typescript/commonjs/button/shared.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/index.d.ts +1 -1
  46. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/index.web.d.ts +1 -1
  48. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/message-bubble/MessageBubble.d.ts +1 -1
  50. package/lib/typescript/commonjs/message-bubble/MessageBubble.d.ts.map +1 -1
  51. package/lib/typescript/commonjs/message-bubble/index.d.ts +1 -1
  52. package/lib/typescript/commonjs/message-bubble/index.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/message-bubble/types.d.ts +27 -5
  54. package/lib/typescript/commonjs/message-bubble/types.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/sidebar/Sidebar.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/sidebar/SidebarModeSwitcher.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/sidebar/palette.d.ts +3 -0
  58. package/lib/typescript/commonjs/sidebar/palette.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/social-button/OxyMark.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/social-button/SocialButton.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/social-button/use-svg-id.d.ts +7 -0
  62. package/lib/typescript/commonjs/social-button/use-svg-id.d.ts.map +1 -0
  63. package/lib/typescript/commonjs/theme-toggle/ThemeToggle.d.ts.map +1 -1
  64. package/lib/typescript/module/button/shared.d.ts +8 -0
  65. package/lib/typescript/module/button/shared.d.ts.map +1 -1
  66. package/lib/typescript/module/index.d.ts +1 -1
  67. package/lib/typescript/module/index.d.ts.map +1 -1
  68. package/lib/typescript/module/index.web.d.ts +1 -1
  69. package/lib/typescript/module/index.web.d.ts.map +1 -1
  70. package/lib/typescript/module/message-bubble/MessageBubble.d.ts +1 -1
  71. package/lib/typescript/module/message-bubble/MessageBubble.d.ts.map +1 -1
  72. package/lib/typescript/module/message-bubble/index.d.ts +1 -1
  73. package/lib/typescript/module/message-bubble/index.d.ts.map +1 -1
  74. package/lib/typescript/module/message-bubble/types.d.ts +27 -5
  75. package/lib/typescript/module/message-bubble/types.d.ts.map +1 -1
  76. package/lib/typescript/module/sidebar/Sidebar.d.ts.map +1 -1
  77. package/lib/typescript/module/sidebar/SidebarModeSwitcher.d.ts.map +1 -1
  78. package/lib/typescript/module/sidebar/palette.d.ts +3 -0
  79. package/lib/typescript/module/sidebar/palette.d.ts.map +1 -1
  80. package/lib/typescript/module/social-button/OxyMark.d.ts.map +1 -1
  81. package/lib/typescript/module/social-button/SocialButton.d.ts.map +1 -1
  82. package/lib/typescript/module/social-button/use-svg-id.d.ts +7 -0
  83. package/lib/typescript/module/social-button/use-svg-id.d.ts.map +1 -0
  84. package/lib/typescript/module/theme-toggle/ThemeToggle.d.ts.map +1 -1
  85. package/package.json +1 -1
  86. package/src/button/shared.ts +9 -0
  87. package/src/index.ts +1 -0
  88. package/src/index.web.ts +1 -0
  89. package/src/message-bubble/MessageBubble.tsx +19 -5
  90. package/src/message-bubble/index.ts +1 -0
  91. package/src/message-bubble/types.ts +28 -5
  92. package/src/sidebar/Sidebar.tsx +5 -1
  93. package/src/sidebar/SidebarModeSwitcher.tsx +13 -14
  94. package/src/sidebar/palette.ts +6 -1
  95. package/src/social-button/OxyMark.tsx +4 -2
  96. package/src/social-button/SocialButton.tsx +3 -2
  97. package/src/social-button/use-svg-id.ts +10 -0
  98. package/src/theme-toggle/ThemeToggle.tsx +3 -9
@@ -0,0 +1,10 @@
1
+ import { useId } from 'react';
2
+
3
+ /**
4
+ * A DOM-safe id prefix, per component instance. Two marks of one brand on a
5
+ * page must not resolve each other's `url(#…)`, and React's `useId` carries
6
+ * characters an SVG id cannot.
7
+ */
8
+ export function useSvgIdPrefix(prefix: string): string {
9
+ return `${prefix}-${useId().replace(/[^a-zA-Z0-9]/g, '')}-`;
10
+ }
@@ -17,13 +17,7 @@ import Animated, {
17
17
  } from 'react-native-reanimated';
18
18
  import Svg, { Defs, LinearGradient, Rect, Stop } from 'react-native-svg';
19
19
 
20
- import {
21
- ACCENT_TABLE,
22
- BUTTON_SHADOW,
23
- colorRamp,
24
- mixColor,
25
- resolveButtonRamps,
26
- } from '../button/shared';
20
+ import { ACCENT_TABLE, BUTTON_SHADOW, SEGMENTED_THUMB_EASE_BEZIER, SEGMENTED_THUMB_MS, colorRamp, mixColor, resolveButtonRamps } from '../button/shared';
27
21
  import { useInteractionState } from '../hooks/use-interaction-state';
28
22
  import { RiMoonLine, RiSunLine } from '../icons/remix';
29
23
  import { adoptStyleSheet } from '../styles/adopt-style-sheet';
@@ -66,8 +60,8 @@ import { revealTheme, THEME_TRANSITION_DURATION, type RevealOrigin } from './vie
66
60
  */
67
61
 
68
62
  const IS_WEB = Platform.OS === 'web';
69
- const EASE = Easing.bezier(0.25, 0.1, 0.25, 1);
70
- const THUMB_MS = 200;
63
+ const EASE = Easing.bezier(...SEGMENTED_THUMB_EASE_BEZIER);
64
+ const THUMB_MS = SEGMENTED_THUMB_MS;
71
65
  const HOVER_MS = 150;
72
66
 
73
67
  interface TogglePalette {