@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.
- package/docs/message-bubble.mdx +37 -3
- package/docs/message-media.mdx +6 -0
- package/lib/commonjs/button/shared.js +10 -1
- package/lib/commonjs/button/shared.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/message-bubble/MessageBubble.js +16 -5
- package/lib/commonjs/message-bubble/MessageBubble.js.map +1 -1
- package/lib/commonjs/sidebar/Sidebar.js +5 -1
- package/lib/commonjs/sidebar/Sidebar.js.map +1 -1
- package/lib/commonjs/sidebar/SidebarModeSwitcher.js +14 -20
- package/lib/commonjs/sidebar/SidebarModeSwitcher.js.map +1 -1
- package/lib/commonjs/sidebar/palette.js +2 -0
- package/lib/commonjs/sidebar/palette.js.map +1 -1
- package/lib/commonjs/social-button/OxyMark.js +4 -2
- package/lib/commonjs/social-button/OxyMark.js.map +1 -1
- package/lib/commonjs/social-button/SocialButton.js +2 -1
- package/lib/commonjs/social-button/SocialButton.js.map +1 -1
- package/lib/commonjs/social-button/use-svg-id.js +16 -0
- package/lib/commonjs/social-button/use-svg-id.js.map +1 -0
- package/lib/commonjs/theme-toggle/ThemeToggle.js +2 -2
- package/lib/commonjs/theme-toggle/ThemeToggle.js.map +1 -1
- package/lib/module/button/shared.js +9 -0
- package/lib/module/button/shared.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/message-bubble/MessageBubble.js +16 -5
- package/lib/module/message-bubble/MessageBubble.js.map +1 -1
- package/lib/module/sidebar/Sidebar.js +5 -1
- package/lib/module/sidebar/Sidebar.js.map +1 -1
- package/lib/module/sidebar/SidebarModeSwitcher.js +16 -22
- package/lib/module/sidebar/SidebarModeSwitcher.js.map +1 -1
- package/lib/module/sidebar/palette.js +3 -1
- package/lib/module/sidebar/palette.js.map +1 -1
- package/lib/module/social-button/OxyMark.js +3 -2
- package/lib/module/social-button/OxyMark.js.map +1 -1
- package/lib/module/social-button/SocialButton.js +3 -2
- package/lib/module/social-button/SocialButton.js.map +1 -1
- package/lib/module/social-button/use-svg-id.js +13 -0
- package/lib/module/social-button/use-svg-id.js.map +1 -0
- package/lib/module/theme-toggle/ThemeToggle.js +3 -3
- package/lib/module/theme-toggle/ThemeToggle.js.map +1 -1
- package/lib/typescript/commonjs/button/shared.d.ts +8 -0
- package/lib/typescript/commonjs/button/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +1 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/message-bubble/MessageBubble.d.ts +1 -1
- package/lib/typescript/commonjs/message-bubble/MessageBubble.d.ts.map +1 -1
- package/lib/typescript/commonjs/message-bubble/index.d.ts +1 -1
- package/lib/typescript/commonjs/message-bubble/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/message-bubble/types.d.ts +27 -5
- package/lib/typescript/commonjs/message-bubble/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/SidebarModeSwitcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/sidebar/palette.d.ts +3 -0
- package/lib/typescript/commonjs/sidebar/palette.d.ts.map +1 -1
- package/lib/typescript/commonjs/social-button/OxyMark.d.ts.map +1 -1
- package/lib/typescript/commonjs/social-button/SocialButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/social-button/use-svg-id.d.ts +7 -0
- package/lib/typescript/commonjs/social-button/use-svg-id.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme-toggle/ThemeToggle.d.ts.map +1 -1
- package/lib/typescript/module/button/shared.d.ts +8 -0
- package/lib/typescript/module/button/shared.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +1 -1
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/message-bubble/MessageBubble.d.ts +1 -1
- package/lib/typescript/module/message-bubble/MessageBubble.d.ts.map +1 -1
- package/lib/typescript/module/message-bubble/index.d.ts +1 -1
- package/lib/typescript/module/message-bubble/index.d.ts.map +1 -1
- package/lib/typescript/module/message-bubble/types.d.ts +27 -5
- package/lib/typescript/module/message-bubble/types.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/Sidebar.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/SidebarModeSwitcher.d.ts.map +1 -1
- package/lib/typescript/module/sidebar/palette.d.ts +3 -0
- package/lib/typescript/module/sidebar/palette.d.ts.map +1 -1
- package/lib/typescript/module/social-button/OxyMark.d.ts.map +1 -1
- package/lib/typescript/module/social-button/SocialButton.d.ts.map +1 -1
- package/lib/typescript/module/social-button/use-svg-id.d.ts +7 -0
- package/lib/typescript/module/social-button/use-svg-id.d.ts.map +1 -0
- package/lib/typescript/module/theme-toggle/ThemeToggle.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/button/shared.ts +9 -0
- package/src/index.ts +1 -0
- package/src/index.web.ts +1 -0
- package/src/message-bubble/MessageBubble.tsx +19 -5
- package/src/message-bubble/index.ts +1 -0
- package/src/message-bubble/types.ts +28 -5
- package/src/sidebar/Sidebar.tsx +5 -1
- package/src/sidebar/SidebarModeSwitcher.tsx +13 -14
- package/src/sidebar/palette.ts +6 -1
- package/src/social-button/OxyMark.tsx +4 -2
- package/src/social-button/SocialButton.tsx +3 -2
- package/src/social-button/use-svg-id.ts +10 -0
- 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(
|
|
70
|
-
const THUMB_MS =
|
|
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 {
|