@seed-design/lynx-react 0.7.1 → 0.8.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 (241) hide show
  1. package/lib/components/Accordion/Accordion.jsx +2 -2
  2. package/lib/components/ActionButton/ActionButton.jsx +1 -1
  3. package/lib/components/AlertDialog/AlertDialog.d.ts +64 -0
  4. package/lib/components/AlertDialog/AlertDialog.d.ts.map +1 -0
  5. package/lib/components/AlertDialog/AlertDialog.jsx +138 -0
  6. package/lib/components/AlertDialog/AlertDialog.namespace.d.ts +2 -0
  7. package/lib/components/AlertDialog/AlertDialog.namespace.d.ts.map +1 -0
  8. package/lib/components/AlertDialog/AlertDialog.namespace.js +17 -0
  9. package/lib/components/AlertDialog/index.d.ts +3 -0
  10. package/lib/components/AlertDialog/index.d.ts.map +1 -0
  11. package/lib/components/AppBar/AppBar.d.ts +14 -1
  12. package/lib/components/AppBar/AppBar.d.ts.map +1 -1
  13. package/lib/components/AppBar/AppBar.jsx +39 -8
  14. package/lib/components/AppBar/AppBar.namespace.d.ts +1 -1
  15. package/lib/components/AppBar/AppBar.namespace.d.ts.map +1 -1
  16. package/lib/components/AppBar/index.d.ts +1 -1
  17. package/lib/components/AppBar/index.d.ts.map +1 -1
  18. package/lib/components/AttachmentDisplay/AttachmentDisplay.d.ts +182 -0
  19. package/lib/components/AttachmentDisplay/AttachmentDisplay.d.ts.map +1 -0
  20. package/lib/components/AttachmentDisplay/AttachmentDisplay.jsx +444 -0
  21. package/lib/components/AttachmentDisplay/index.d.ts +2 -0
  22. package/lib/components/AttachmentDisplay/index.d.ts.map +1 -0
  23. package/lib/components/AttachmentInput/AttachmentInput.d.ts +179 -0
  24. package/lib/components/AttachmentInput/AttachmentInput.d.ts.map +1 -0
  25. package/lib/components/AttachmentInput/AttachmentInput.jsx +520 -0
  26. package/lib/components/AttachmentInput/index.d.ts +2 -0
  27. package/lib/components/AttachmentInput/index.d.ts.map +1 -0
  28. package/lib/components/BottomSheet/BottomSheet.d.ts +1 -1
  29. package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
  30. package/lib/components/BottomSheet/BottomSheet.jsx +1 -7
  31. package/lib/components/Callout/Callout.jsx +2 -2
  32. package/lib/components/Checkbox/Checkbox.jsx +2 -2
  33. package/lib/components/Chip/Chip.jsx +2 -2
  34. package/lib/components/ChipTabs/ChipTabs.d.ts +41 -0
  35. package/lib/components/ChipTabs/ChipTabs.d.ts.map +1 -0
  36. package/lib/components/ChipTabs/ChipTabs.jsx +39 -0
  37. package/lib/components/ChipTabs/ChipTabs.namespace.d.ts +2 -0
  38. package/lib/components/ChipTabs/ChipTabs.namespace.d.ts.map +1 -0
  39. package/lib/components/ChipTabs/ChipTabs.namespace.js +13 -0
  40. package/lib/components/ChipTabs/index.d.ts +3 -0
  41. package/lib/components/ChipTabs/index.d.ts.map +1 -0
  42. package/lib/components/ContextualFloatingButton/ContextualFloatingButton.d.ts +18 -0
  43. package/lib/components/ContextualFloatingButton/ContextualFloatingButton.d.ts.map +1 -0
  44. package/lib/components/ContextualFloatingButton/ContextualFloatingButton.jsx +113 -0
  45. package/lib/components/ContextualFloatingButton/index.d.ts +2 -0
  46. package/lib/components/ContextualFloatingButton/index.d.ts.map +1 -0
  47. package/lib/components/Dialog/Dialog.d.ts +87 -0
  48. package/lib/components/Dialog/Dialog.d.ts.map +1 -0
  49. package/lib/components/Dialog/Dialog.jsx +147 -0
  50. package/lib/components/Dialog/Dialog.namespace.d.ts +2 -0
  51. package/lib/components/Dialog/Dialog.namespace.d.ts.map +1 -0
  52. package/lib/components/Dialog/Dialog.namespace.js +18 -0
  53. package/lib/components/Dialog/index.d.ts +3 -0
  54. package/lib/components/Dialog/index.d.ts.map +1 -0
  55. package/lib/components/FloatingActionButton/FloatingActionButton.d.ts +23 -0
  56. package/lib/components/FloatingActionButton/FloatingActionButton.d.ts.map +1 -0
  57. package/lib/components/FloatingActionButton/FloatingActionButton.jsx +76 -0
  58. package/lib/components/FloatingActionButton/FloatingActionButton.namespace.d.ts +2 -0
  59. package/lib/components/FloatingActionButton/FloatingActionButton.namespace.d.ts.map +1 -0
  60. package/lib/components/FloatingActionButton/FloatingActionButton.namespace.js +10 -0
  61. package/lib/components/FloatingActionButton/index.d.ts +3 -0
  62. package/lib/components/FloatingActionButton/index.d.ts.map +1 -0
  63. package/lib/components/HelpBubble/HelpBubble.d.ts +67 -0
  64. package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -0
  65. package/lib/components/HelpBubble/HelpBubble.jsx +600 -0
  66. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts +2 -0
  67. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts.map +1 -0
  68. package/lib/components/HelpBubble/HelpBubble.namespace.js +18 -0
  69. package/lib/components/HelpBubble/index.d.ts +3 -0
  70. package/lib/components/HelpBubble/index.d.ts.map +1 -0
  71. package/lib/components/Icon/Icon.d.ts +1 -0
  72. package/lib/components/Icon/Icon.d.ts.map +1 -1
  73. package/lib/components/Icon/Icon.jsx +2 -1
  74. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.d.ts +28 -0
  75. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.d.ts.map +1 -0
  76. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.jsx +37 -0
  77. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.namespace.d.ts +2 -0
  78. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.namespace.d.ts.map +1 -0
  79. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.namespace.js +9 -0
  80. package/lib/components/IdentityPlaceholder/identity-placeholder-business.js +4 -0
  81. package/lib/components/IdentityPlaceholder/identity-placeholder-person.js +4 -0
  82. package/lib/components/IdentityPlaceholder/index.d.ts +3 -0
  83. package/lib/components/IdentityPlaceholder/index.d.ts.map +1 -0
  84. package/lib/components/InputButton/InputButton.d.ts +2 -0
  85. package/lib/components/InputButton/InputButton.d.ts.map +1 -1
  86. package/lib/components/InputButton/InputButton.jsx +40 -8
  87. package/lib/components/List/List.d.ts +1 -1
  88. package/lib/components/List/List.d.ts.map +1 -1
  89. package/lib/components/List/List.jsx +26 -12
  90. package/lib/components/Menu/Menu.d.ts.map +1 -1
  91. package/lib/components/Menu/Menu.jsx +15 -5
  92. package/lib/components/PageBanner/PageBanner.d.ts +3 -0
  93. package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
  94. package/lib/components/PageBanner/PageBanner.jsx +49 -11
  95. package/lib/components/QuantityPicker/QuantityPicker.d.ts +53 -0
  96. package/lib/components/QuantityPicker/QuantityPicker.d.ts.map +1 -0
  97. package/lib/components/QuantityPicker/QuantityPicker.jsx +282 -0
  98. package/lib/components/QuantityPicker/QuantityPicker.namespace.d.ts +2 -0
  99. package/lib/components/QuantityPicker/QuantityPicker.namespace.d.ts.map +1 -0
  100. package/lib/components/QuantityPicker/QuantityPicker.namespace.js +11 -0
  101. package/lib/components/QuantityPicker/index.d.ts +3 -0
  102. package/lib/components/QuantityPicker/index.d.ts.map +1 -0
  103. package/lib/components/RadioGroup/RadioGroup.jsx +2 -2
  104. package/lib/components/ReactionButton/ReactionButton.d.ts +1 -1
  105. package/lib/components/ReactionButton/ReactionButton.d.ts.map +1 -1
  106. package/lib/components/ReactionButton/ReactionButton.jsx +22 -13
  107. package/lib/components/ScrollFog/ScrollFog.d.ts +41 -0
  108. package/lib/components/ScrollFog/ScrollFog.d.ts.map +1 -0
  109. package/lib/components/ScrollFog/ScrollFog.jsx +65 -0
  110. package/lib/components/ScrollFog/index.d.ts +2 -0
  111. package/lib/components/ScrollFog/index.d.ts.map +1 -0
  112. package/lib/components/SegmentedControl/SegmentedControl.jsx +2 -2
  113. package/lib/components/Select/Select.d.ts +112 -0
  114. package/lib/components/Select/Select.d.ts.map +1 -0
  115. package/lib/components/Select/Select.jsx +885 -0
  116. package/lib/components/Select/Select.namespace.d.ts +2 -0
  117. package/lib/components/Select/Select.namespace.d.ts.map +1 -0
  118. package/lib/components/Select/Select.namespace.js +23 -0
  119. package/lib/components/Select/index.d.ts +3 -0
  120. package/lib/components/Select/index.d.ts.map +1 -0
  121. package/lib/components/Skeleton/Skeleton.d.ts +15 -0
  122. package/lib/components/Skeleton/Skeleton.d.ts.map +1 -0
  123. package/lib/components/Skeleton/Skeleton.jsx +18 -0
  124. package/lib/components/Skeleton/index.d.ts +2 -0
  125. package/lib/components/Skeleton/index.d.ts.map +1 -0
  126. package/lib/components/Slider/Slider.d.ts +101 -0
  127. package/lib/components/Slider/Slider.d.ts.map +1 -0
  128. package/lib/components/Slider/Slider.jsx +573 -0
  129. package/lib/components/Slider/Slider.namespace.d.ts +2 -0
  130. package/lib/components/Slider/Slider.namespace.d.ts.map +1 -0
  131. package/lib/components/Slider/Slider.namespace.js +19 -0
  132. package/lib/components/Slider/Slider.utils.d.ts +19 -0
  133. package/lib/components/Slider/Slider.utils.d.ts.map +1 -0
  134. package/lib/components/Slider/Slider.utils.js +106 -0
  135. package/lib/components/Slider/index.d.ts +3 -0
  136. package/lib/components/Slider/index.d.ts.map +1 -0
  137. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -1
  138. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.jsx +22 -8
  139. package/lib/components/Switch/Switch.d.ts.map +1 -1
  140. package/lib/components/Switch/Switch.jsx +5 -3
  141. package/lib/components/Tabs/Tabs.d.ts +34 -2
  142. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  143. package/lib/components/Tabs/Tabs.jsx +186 -56
  144. package/lib/components/Tabs/Tabs.utils.d.ts +14 -1
  145. package/lib/components/Tabs/Tabs.utils.d.ts.map +1 -1
  146. package/lib/components/Tabs/Tabs.utils.js +24 -3
  147. package/lib/components/Tabs/index.d.ts +1 -1
  148. package/lib/components/Tabs/index.d.ts.map +1 -1
  149. package/lib/components/index.d.ts +14 -0
  150. package/lib/components/index.d.ts.map +1 -1
  151. package/lib/hooks/useControllableState.d.ts +1 -14
  152. package/lib/hooks/useControllableState.d.ts.map +1 -1
  153. package/lib/hooks/usePressTap.d.ts +1 -27
  154. package/lib/hooks/usePressTap.d.ts.map +1 -1
  155. package/lib/index.js +29 -6
  156. package/lib/{hooks/useControllableState.js → packages/lynx-react-headless/use-controllable-state/lib/index.js} +2 -3
  157. package/lib/{hooks/usePressTap.js → packages/lynx-react-headless/use-press-tap/lib/index.js} +13 -10
  158. package/lib/types.d.ts +1 -0
  159. package/lib/types.d.ts.map +1 -1
  160. package/package.json +9 -5
  161. package/src/components/AlertDialog/AlertDialog.namespace.ts +22 -0
  162. package/src/components/AlertDialog/AlertDialog.test.tsx +226 -0
  163. package/src/components/AlertDialog/AlertDialog.tsx +374 -0
  164. package/src/components/AlertDialog/index.ts +24 -0
  165. package/src/components/AppBar/AppBar.namespace.ts +1 -0
  166. package/src/components/AppBar/AppBar.test.tsx +231 -0
  167. package/src/components/AppBar/AppBar.tsx +105 -13
  168. package/src/components/AppBar/index.ts +1 -0
  169. package/src/components/AttachmentDisplay/AttachmentDisplay.tsx +886 -0
  170. package/src/components/AttachmentDisplay/index.ts +48 -0
  171. package/src/components/AttachmentInput/AttachmentInput.tsx +1001 -0
  172. package/src/components/AttachmentInput/index.ts +49 -0
  173. package/src/components/BottomSheet/BottomSheet.test.tsx +22 -7
  174. package/src/components/BottomSheet/BottomSheet.tsx +1 -19
  175. package/src/components/ChipTabs/ChipTabs.namespace.ts +14 -0
  176. package/src/components/ChipTabs/ChipTabs.tsx +119 -0
  177. package/src/components/ChipTabs/index.ts +16 -0
  178. package/src/components/ContextualFloatingButton/ContextualFloatingButton.test.tsx +63 -0
  179. package/src/components/ContextualFloatingButton/ContextualFloatingButton.tsx +232 -0
  180. package/src/components/ContextualFloatingButton/index.ts +4 -0
  181. package/src/components/Dialog/Dialog.namespace.ts +24 -0
  182. package/src/components/Dialog/Dialog.test.tsx +172 -0
  183. package/src/components/Dialog/Dialog.tsx +373 -0
  184. package/src/components/Dialog/index.ts +26 -0
  185. package/src/components/FloatingActionButton/FloatingActionButton.namespace.ts +8 -0
  186. package/src/components/FloatingActionButton/FloatingActionButton.test.tsx +59 -0
  187. package/src/components/FloatingActionButton/FloatingActionButton.tsx +207 -0
  188. package/src/components/FloatingActionButton/index.ts +10 -0
  189. package/src/components/HelpBubble/HelpBubble.namespace.ts +24 -0
  190. package/src/components/HelpBubble/HelpBubble.tsx +998 -0
  191. package/src/components/HelpBubble/index.ts +26 -0
  192. package/src/components/Icon/Icon.test.tsx +0 -3
  193. package/src/components/Icon/Icon.tsx +11 -1
  194. package/src/components/IdentityPlaceholder/IdentityPlaceholder.namespace.ts +6 -0
  195. package/src/components/IdentityPlaceholder/IdentityPlaceholder.tsx +103 -0
  196. package/src/components/IdentityPlaceholder/assets.d.ts +4 -0
  197. package/src/components/IdentityPlaceholder/identity-placeholder-business.webp +0 -0
  198. package/src/components/IdentityPlaceholder/identity-placeholder-person.webp +0 -0
  199. package/src/components/IdentityPlaceholder/index.ts +8 -0
  200. package/src/components/InputButton/InputButton.test.tsx +128 -1
  201. package/src/components/InputButton/InputButton.tsx +60 -9
  202. package/src/components/List/List.test.tsx +54 -2
  203. package/src/components/List/List.tsx +43 -10
  204. package/src/components/Menu/Menu.tsx +14 -4
  205. package/src/components/Menu/__tests__/Menu.test.tsx +34 -0
  206. package/src/components/PageBanner/PageBanner.test.tsx +110 -3
  207. package/src/components/PageBanner/PageBanner.tsx +83 -19
  208. package/src/components/QuantityPicker/QuantityPicker.namespace.ts +10 -0
  209. package/src/components/QuantityPicker/QuantityPicker.test.tsx +235 -0
  210. package/src/components/QuantityPicker/QuantityPicker.tsx +605 -0
  211. package/src/components/QuantityPicker/index.ts +14 -0
  212. package/src/components/ReactionButton/ReactionButton.feedback.test.tsx +50 -0
  213. package/src/components/ReactionButton/ReactionButton.test.tsx +5 -3
  214. package/src/components/ReactionButton/ReactionButton.tsx +20 -12
  215. package/src/components/ScrollFog/ScrollFog.test.tsx +222 -0
  216. package/src/components/ScrollFog/ScrollFog.tsx +172 -0
  217. package/src/components/ScrollFog/index.ts +1 -0
  218. package/src/components/Select/Select.namespace.ts +34 -0
  219. package/src/components/Select/Select.test.tsx +297 -0
  220. package/src/components/Select/Select.tsx +1483 -0
  221. package/src/components/Select/index.ts +39 -0
  222. package/src/components/Skeleton/Skeleton.test.tsx +64 -0
  223. package/src/components/Skeleton/Skeleton.tsx +45 -0
  224. package/src/components/Skeleton/index.ts +1 -0
  225. package/src/components/Slider/Slider.namespace.ts +26 -0
  226. package/src/components/Slider/Slider.test.tsx +260 -0
  227. package/src/components/Slider/Slider.tsx +897 -0
  228. package/src/components/Slider/Slider.utils.ts +167 -0
  229. package/src/components/Slider/index.ts +30 -0
  230. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.test.tsx +21 -1
  231. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +30 -7
  232. package/src/components/Switch/Switch.tsx +14 -13
  233. package/src/components/Tabs/Tabs.test.tsx +218 -1
  234. package/src/components/Tabs/Tabs.tsx +346 -75
  235. package/src/components/Tabs/Tabs.utils.ts +51 -1
  236. package/src/components/Tabs/index.ts +17 -1
  237. package/src/components/index.ts +14 -0
  238. package/src/hooks/useControllableState.ts +1 -43
  239. package/src/hooks/usePressTap.test.ts +23 -11
  240. package/src/hooks/usePressTap.ts +1 -60
  241. package/src/types.ts +1 -0
@@ -0,0 +1,207 @@
1
+ import * as React from "@lynx-js/react";
2
+ import clsx from "clsx";
3
+
4
+ import {
5
+ floatingActionButton,
6
+ type FloatingActionButtonVariantProps,
7
+ } from "@seed-design/lynx-css/recipes/floating-action-button";
8
+
9
+ import { usePressTap } from "../../hooks/usePressTap";
10
+ import { useScaleFeedback } from "../../hooks/useScaleFeedback";
11
+ import type {
12
+ LynxAccessibilityProps,
13
+ LynxPressableProps,
14
+ LynxStyledElementProps,
15
+ LynxTextProps,
16
+ LynxTextRef,
17
+ LynxTouchProps,
18
+ LynxViewRef,
19
+ LynxViewProps,
20
+ } from "../../types";
21
+ import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context";
22
+ import { mergeProps } from "../../utils/merge-props";
23
+ import { InternalIcon, type InternalIconProps } from "../Icon/Icon";
24
+
25
+ const { ClassNamesProvider, PropsProvider, useClassNames, useProps, withContext } =
26
+ createSlotRecipeContext(floatingActionButton);
27
+
28
+ type FloatingActionButtonPublicVariantProps = Omit<
29
+ FloatingActionButtonVariantProps,
30
+ "pressed" | "transitionEnabled"
31
+ >;
32
+
33
+ const LabelWidthContext = React.createContext<((width: number) => void) | null>(null);
34
+
35
+ interface FloatingActionButtonRootViewProps
36
+ extends FloatingActionButtonVariantProps,
37
+ LynxStyledElementProps,
38
+ LynxTouchProps,
39
+ LynxAccessibilityProps {
40
+ flatten?: false;
41
+ }
42
+
43
+ const FloatingActionButtonRootView = React.forwardRef<unknown, FloatingActionButtonRootViewProps>(
44
+ (props, ref) => {
45
+ const [variantProps, otherProps] = floatingActionButton.splitVariantProps(props);
46
+ const { children, className, style, ...nativeProps } = otherProps;
47
+ const initiallyExtended = React.useRef(variantProps.extended !== false);
48
+ const [labelWidth, setLabelWidth] = React.useState<number>();
49
+ const classNames = floatingActionButton({
50
+ ...variantProps,
51
+ transitionEnabled: labelWidth !== undefined || !initiallyExtended.current,
52
+ });
53
+
54
+ return (
55
+ <ClassNamesProvider value={classNames}>
56
+ <PropsProvider value={variantProps}>
57
+ <LabelWidthContext.Provider value={setLabelWidth}>
58
+ <view
59
+ {...mergeProps(ref ? { ref: ref as LynxViewRef } : {}, nativeProps)}
60
+ className={clsx(classNames.root, className)}
61
+ style={
62
+ {
63
+ "--fab-label-width": `${labelWidth ?? 0}px`,
64
+ ...style,
65
+ } as LynxViewProps["style"]
66
+ }
67
+ >
68
+ {children}
69
+ </view>
70
+ </LabelWidthContext.Provider>
71
+ </PropsProvider>
72
+ </ClassNamesProvider>
73
+ );
74
+ },
75
+ );
76
+ FloatingActionButtonRootView.displayName = "FloatingActionButtonRootView";
77
+
78
+ ////////////////////////////////////////////////////////////////////////////////////
79
+
80
+ /**
81
+ * @platform Lynx
82
+ *
83
+ * Web DOM button props, `asChild`, `aria-*`, and `onClick` are not supported.
84
+ * Use native `bindtap` / `main-thread:bindtap` and `accessibility-*` props instead.
85
+ */
86
+ export interface FloatingActionButtonRootProps
87
+ extends FloatingActionButtonPublicVariantProps,
88
+ LynxStyledElementProps,
89
+ LynxPressableProps,
90
+ LynxAccessibilityProps {
91
+ disabled?: boolean;
92
+ }
93
+
94
+ export const FloatingActionButtonRoot = React.forwardRef<unknown, FloatingActionButtonRootProps>(
95
+ (props, ref) => {
96
+ const {
97
+ bindtap,
98
+ "main-thread:bindtap": mainThreadBindtap,
99
+ disabled = false,
100
+ "accessibility-element": accessibilityElement = true,
101
+ "accessibility-role-description": accessibilityRoleDescription = "button",
102
+ "accessibility-traits": accessibilityTraits,
103
+ ...otherProps
104
+ } = props;
105
+ const { pressed, bindtouchstart, bindtouchend, bindtouchcancel, ...pressTapHandlers } =
106
+ usePressTap({
107
+ disabled,
108
+ onTap: bindtap,
109
+ mainThreadOnTap: mainThreadBindtap,
110
+ });
111
+ const { scaleFeedbackTriggerProps, scaleFeedbackTargetProps } = useScaleFeedback({
112
+ disabled,
113
+ onTouchStart: bindtouchstart,
114
+ onTouchEnd: bindtouchend,
115
+ onTouchCancel: bindtouchcancel,
116
+ });
117
+
118
+ return (
119
+ <FloatingActionButtonRootView
120
+ {...mergeProps(
121
+ ref ? { ref } : {},
122
+ disabled ? {} : scaleFeedbackTargetProps,
123
+ disabled ? {} : scaleFeedbackTriggerProps,
124
+ disabled ? {} : pressTapHandlers,
125
+ otherProps,
126
+ )}
127
+ disabled={disabled}
128
+ pressed={pressed}
129
+ accessibility-element={accessibilityElement}
130
+ accessibility-role-description={accessibilityRoleDescription}
131
+ accessibility-traits={accessibilityTraits ?? (disabled ? "disabled" : undefined)}
132
+ flatten={false}
133
+ />
134
+ );
135
+ },
136
+ );
137
+ FloatingActionButtonRoot.displayName = "FloatingActionButtonRoot";
138
+
139
+ ////////////////////////////////////////////////////////////////////////////////////
140
+
141
+ export interface FloatingActionButtonIconProps
142
+ extends Omit<InternalIconProps, "deps" | "disableDefaultResize"> {}
143
+
144
+ const StyledIcon = withContext<unknown, InternalIconProps>(InternalIcon, "icon");
145
+
146
+ export const FloatingActionButtonIcon = React.forwardRef<unknown, FloatingActionButtonIconProps>(
147
+ (props, ref) => {
148
+ const { className, ...iconProps } = props;
149
+ const classNames = useClassNames();
150
+
151
+ return (
152
+ <StyledIcon
153
+ {...mergeProps(ref ? { ref } : {}, iconProps)}
154
+ className={className}
155
+ deps={[classNames.icon]}
156
+ disableDefaultResize={true}
157
+ accessibility-elements-hidden={true}
158
+ />
159
+ );
160
+ },
161
+ );
162
+ FloatingActionButtonIcon.displayName = "FloatingActionButtonIcon";
163
+
164
+ ////////////////////////////////////////////////////////////////////////////////////
165
+
166
+ export interface FloatingActionButtonLabelProps extends LynxStyledElementProps {}
167
+
168
+ export const FloatingActionButtonLabel = React.forwardRef<unknown, FloatingActionButtonLabelProps>(
169
+ (props, ref) => {
170
+ const { children, className, ...nativeProps } = props;
171
+ const classNames = useClassNames();
172
+ const variantProps = useProps();
173
+ const setLabelWidth = React.useContext(LabelWidthContext);
174
+
175
+ if (!setLabelWidth) {
176
+ throw new Error("FloatingActionButtonLabel must be used within FloatingActionButtonRoot.");
177
+ }
178
+
179
+ const handleLayoutChange = React.useCallback<NonNullable<LynxTextProps["bindlayoutchange"]>>(
180
+ (event) => {
181
+ "background only";
182
+ const width = event.detail.width;
183
+ if (Number.isFinite(width) && width >= 0) setLabelWidth(width);
184
+ },
185
+ [setLabelWidth],
186
+ );
187
+
188
+ if (variantProps?.extended === false) {
189
+ return null;
190
+ }
191
+
192
+ return (
193
+ <text
194
+ {...mergeProps(
195
+ ref ? { ref: ref as LynxTextRef } : {},
196
+ { bindlayoutchange: handleLayoutChange },
197
+ nativeProps,
198
+ )}
199
+ className={clsx(classNames.label, className)}
200
+ accessibility-elements-hidden={true}
201
+ >
202
+ {children}
203
+ </text>
204
+ );
205
+ },
206
+ );
207
+ FloatingActionButtonLabel.displayName = "FloatingActionButtonLabel";
@@ -0,0 +1,10 @@
1
+ export {
2
+ FloatingActionButtonIcon,
3
+ FloatingActionButtonLabel,
4
+ FloatingActionButtonRoot,
5
+ type FloatingActionButtonIconProps,
6
+ type FloatingActionButtonLabelProps,
7
+ type FloatingActionButtonRootProps,
8
+ } from "./FloatingActionButton";
9
+
10
+ export * as FloatingActionButton from "./FloatingActionButton.namespace";
@@ -0,0 +1,24 @@
1
+ export {
2
+ HelpBubbleAnchor as Anchor,
3
+ HelpBubbleArrow as Arrow,
4
+ HelpBubbleArrowTip as ArrowTip,
5
+ HelpBubbleBody as Body,
6
+ HelpBubbleCloseButton as CloseButton,
7
+ HelpBubbleContent as Content,
8
+ HelpBubbleDescription as Description,
9
+ HelpBubblePositioner as Positioner,
10
+ HelpBubbleRoot as Root,
11
+ HelpBubbleTitle as Title,
12
+ HelpBubbleTrigger as Trigger,
13
+ type HelpBubbleAnchorProps as AnchorProps,
14
+ type HelpBubbleArrowProps as ArrowProps,
15
+ type HelpBubbleArrowTipProps as ArrowTipProps,
16
+ type HelpBubbleBodyProps as BodyProps,
17
+ type HelpBubbleCloseButtonProps as CloseButtonProps,
18
+ type HelpBubbleContentProps as ContentProps,
19
+ type HelpBubbleDescriptionProps as DescriptionProps,
20
+ type HelpBubblePositionerProps as PositionerProps,
21
+ type HelpBubbleRootProps as RootProps,
22
+ type HelpBubbleTitleProps as TitleProps,
23
+ type HelpBubbleTriggerProps as TriggerProps,
24
+ } from "./HelpBubble";