@seed-design/lynx-react 0.7.1 → 0.9.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 (265) 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 +42 -16
  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/context.d.ts +2 -1
  17. package/lib/components/AppBar/context.d.ts.map +1 -1
  18. package/lib/components/AppBar/index.d.ts +1 -1
  19. package/lib/components/AppBar/index.d.ts.map +1 -1
  20. package/lib/components/AppBar/useAppBar.d.ts +2 -1
  21. package/lib/components/AppBar/useAppBar.d.ts.map +1 -1
  22. package/lib/components/AppBar/useAppBar.js +17 -15
  23. package/lib/components/AttachmentDisplay/AttachmentDisplay.d.ts +182 -0
  24. package/lib/components/AttachmentDisplay/AttachmentDisplay.d.ts.map +1 -0
  25. package/lib/components/AttachmentDisplay/AttachmentDisplay.jsx +444 -0
  26. package/lib/components/AttachmentDisplay/index.d.ts +2 -0
  27. package/lib/components/AttachmentDisplay/index.d.ts.map +1 -0
  28. package/lib/components/AttachmentInput/AttachmentInput.d.ts +179 -0
  29. package/lib/components/AttachmentInput/AttachmentInput.d.ts.map +1 -0
  30. package/lib/components/AttachmentInput/AttachmentInput.jsx +520 -0
  31. package/lib/components/AttachmentInput/index.d.ts +2 -0
  32. package/lib/components/AttachmentInput/index.d.ts.map +1 -0
  33. package/lib/components/BottomSheet/BottomSheet.d.ts +1 -1
  34. package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
  35. package/lib/components/BottomSheet/BottomSheet.jsx +1 -7
  36. package/lib/components/Box/Box.d.ts +3 -3
  37. package/lib/components/Box/Box.d.ts.map +1 -1
  38. package/lib/components/Callout/Callout.jsx +2 -2
  39. package/lib/components/Checkbox/Checkbox.jsx +2 -2
  40. package/lib/components/Chip/Chip.jsx +2 -2
  41. package/lib/components/ChipTabs/ChipTabs.d.ts +41 -0
  42. package/lib/components/ChipTabs/ChipTabs.d.ts.map +1 -0
  43. package/lib/components/ChipTabs/ChipTabs.jsx +39 -0
  44. package/lib/components/ChipTabs/ChipTabs.namespace.d.ts +2 -0
  45. package/lib/components/ChipTabs/ChipTabs.namespace.d.ts.map +1 -0
  46. package/lib/components/ChipTabs/ChipTabs.namespace.js +13 -0
  47. package/lib/components/ChipTabs/index.d.ts +3 -0
  48. package/lib/components/ChipTabs/index.d.ts.map +1 -0
  49. package/lib/components/ContextualFloatingButton/ContextualFloatingButton.d.ts +18 -0
  50. package/lib/components/ContextualFloatingButton/ContextualFloatingButton.d.ts.map +1 -0
  51. package/lib/components/ContextualFloatingButton/ContextualFloatingButton.jsx +113 -0
  52. package/lib/components/ContextualFloatingButton/index.d.ts +2 -0
  53. package/lib/components/ContextualFloatingButton/index.d.ts.map +1 -0
  54. package/lib/components/Dialog/Dialog.d.ts +87 -0
  55. package/lib/components/Dialog/Dialog.d.ts.map +1 -0
  56. package/lib/components/Dialog/Dialog.jsx +147 -0
  57. package/lib/components/Dialog/Dialog.namespace.d.ts +2 -0
  58. package/lib/components/Dialog/Dialog.namespace.d.ts.map +1 -0
  59. package/lib/components/Dialog/Dialog.namespace.js +18 -0
  60. package/lib/components/Dialog/index.d.ts +3 -0
  61. package/lib/components/Dialog/index.d.ts.map +1 -0
  62. package/lib/components/FloatingActionButton/FloatingActionButton.d.ts +23 -0
  63. package/lib/components/FloatingActionButton/FloatingActionButton.d.ts.map +1 -0
  64. package/lib/components/FloatingActionButton/FloatingActionButton.jsx +76 -0
  65. package/lib/components/FloatingActionButton/FloatingActionButton.namespace.d.ts +2 -0
  66. package/lib/components/FloatingActionButton/FloatingActionButton.namespace.d.ts.map +1 -0
  67. package/lib/components/FloatingActionButton/FloatingActionButton.namespace.js +10 -0
  68. package/lib/components/FloatingActionButton/index.d.ts +3 -0
  69. package/lib/components/FloatingActionButton/index.d.ts.map +1 -0
  70. package/lib/components/HelpBubble/HelpBubble.d.ts +67 -0
  71. package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -0
  72. package/lib/components/HelpBubble/HelpBubble.jsx +600 -0
  73. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts +2 -0
  74. package/lib/components/HelpBubble/HelpBubble.namespace.d.ts.map +1 -0
  75. package/lib/components/HelpBubble/HelpBubble.namespace.js +18 -0
  76. package/lib/components/HelpBubble/index.d.ts +3 -0
  77. package/lib/components/HelpBubble/index.d.ts.map +1 -0
  78. package/lib/components/Icon/Icon.d.ts +1 -0
  79. package/lib/components/Icon/Icon.d.ts.map +1 -1
  80. package/lib/components/Icon/Icon.jsx +2 -1
  81. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.d.ts +28 -0
  82. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.d.ts.map +1 -0
  83. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.jsx +37 -0
  84. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.namespace.d.ts +2 -0
  85. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.namespace.d.ts.map +1 -0
  86. package/lib/components/IdentityPlaceholder/IdentityPlaceholder.namespace.js +9 -0
  87. package/lib/components/IdentityPlaceholder/identity-placeholder-business.js +4 -0
  88. package/lib/components/IdentityPlaceholder/identity-placeholder-person.js +4 -0
  89. package/lib/components/IdentityPlaceholder/index.d.ts +3 -0
  90. package/lib/components/IdentityPlaceholder/index.d.ts.map +1 -0
  91. package/lib/components/InputButton/InputButton.d.ts +2 -0
  92. package/lib/components/InputButton/InputButton.d.ts.map +1 -1
  93. package/lib/components/InputButton/InputButton.jsx +40 -8
  94. package/lib/components/List/List.d.ts +1 -1
  95. package/lib/components/List/List.d.ts.map +1 -1
  96. package/lib/components/List/List.jsx +26 -12
  97. package/lib/components/Menu/Menu.d.ts.map +1 -1
  98. package/lib/components/Menu/Menu.jsx +15 -5
  99. package/lib/components/PageBanner/PageBanner.d.ts +3 -0
  100. package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
  101. package/lib/components/PageBanner/PageBanner.jsx +49 -11
  102. package/lib/components/QuantityPicker/QuantityPicker.d.ts +53 -0
  103. package/lib/components/QuantityPicker/QuantityPicker.d.ts.map +1 -0
  104. package/lib/components/QuantityPicker/QuantityPicker.jsx +282 -0
  105. package/lib/components/QuantityPicker/QuantityPicker.namespace.d.ts +2 -0
  106. package/lib/components/QuantityPicker/QuantityPicker.namespace.d.ts.map +1 -0
  107. package/lib/components/QuantityPicker/QuantityPicker.namespace.js +11 -0
  108. package/lib/components/QuantityPicker/index.d.ts +3 -0
  109. package/lib/components/QuantityPicker/index.d.ts.map +1 -0
  110. package/lib/components/RadioGroup/RadioGroup.jsx +2 -2
  111. package/lib/components/ReactionButton/ReactionButton.d.ts +1 -1
  112. package/lib/components/ReactionButton/ReactionButton.d.ts.map +1 -1
  113. package/lib/components/ReactionButton/ReactionButton.jsx +22 -13
  114. package/lib/components/ScrollFog/ScrollFog.d.ts +41 -0
  115. package/lib/components/ScrollFog/ScrollFog.d.ts.map +1 -0
  116. package/lib/components/ScrollFog/ScrollFog.jsx +65 -0
  117. package/lib/components/ScrollFog/index.d.ts +2 -0
  118. package/lib/components/ScrollFog/index.d.ts.map +1 -0
  119. package/lib/components/SegmentedControl/SegmentedControl.jsx +2 -2
  120. package/lib/components/Select/Select.d.ts +112 -0
  121. package/lib/components/Select/Select.d.ts.map +1 -0
  122. package/lib/components/Select/Select.jsx +885 -0
  123. package/lib/components/Select/Select.namespace.d.ts +2 -0
  124. package/lib/components/Select/Select.namespace.d.ts.map +1 -0
  125. package/lib/components/Select/Select.namespace.js +23 -0
  126. package/lib/components/Select/index.d.ts +3 -0
  127. package/lib/components/Select/index.d.ts.map +1 -0
  128. package/lib/components/Skeleton/Skeleton.d.ts +15 -0
  129. package/lib/components/Skeleton/Skeleton.d.ts.map +1 -0
  130. package/lib/components/Skeleton/Skeleton.jsx +18 -0
  131. package/lib/components/Skeleton/index.d.ts +2 -0
  132. package/lib/components/Skeleton/index.d.ts.map +1 -0
  133. package/lib/components/Slider/Slider.d.ts +101 -0
  134. package/lib/components/Slider/Slider.d.ts.map +1 -0
  135. package/lib/components/Slider/Slider.jsx +573 -0
  136. package/lib/components/Slider/Slider.namespace.d.ts +2 -0
  137. package/lib/components/Slider/Slider.namespace.d.ts.map +1 -0
  138. package/lib/components/Slider/Slider.namespace.js +19 -0
  139. package/lib/components/Slider/Slider.utils.d.ts +19 -0
  140. package/lib/components/Slider/Slider.utils.d.ts.map +1 -0
  141. package/lib/components/Slider/Slider.utils.js +106 -0
  142. package/lib/components/Slider/index.d.ts +3 -0
  143. package/lib/components/Slider/index.d.ts.map +1 -0
  144. package/lib/components/Stack/Stack.d.ts +7 -9
  145. package/lib/components/Stack/Stack.d.ts.map +1 -1
  146. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -1
  147. package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.jsx +22 -8
  148. package/lib/components/Switch/Switch.d.ts.map +1 -1
  149. package/lib/components/Switch/Switch.jsx +5 -3
  150. package/lib/components/Tabs/Tabs.d.ts +34 -2
  151. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  152. package/lib/components/Tabs/Tabs.jsx +186 -56
  153. package/lib/components/Tabs/Tabs.utils.d.ts +14 -1
  154. package/lib/components/Tabs/Tabs.utils.d.ts.map +1 -1
  155. package/lib/components/Tabs/Tabs.utils.js +24 -3
  156. package/lib/components/Tabs/index.d.ts +1 -1
  157. package/lib/components/Tabs/index.d.ts.map +1 -1
  158. package/lib/components/index.d.ts +14 -0
  159. package/lib/components/index.d.ts.map +1 -1
  160. package/lib/hooks/useControllableState.d.ts +1 -14
  161. package/lib/hooks/useControllableState.d.ts.map +1 -1
  162. package/lib/hooks/usePressTap.d.ts +1 -27
  163. package/lib/hooks/usePressTap.d.ts.map +1 -1
  164. package/lib/hooks/useSafeArea.d.ts +8 -4
  165. package/lib/hooks/useSafeArea.d.ts.map +1 -1
  166. package/lib/hooks/useSafeArea.js +22 -20
  167. package/lib/index.js +29 -6
  168. package/lib/{hooks/useControllableState.js → packages/lynx-react-headless/use-controllable-state/lib/index.js} +2 -3
  169. package/lib/{hooks/usePressTap.js → packages/lynx-react-headless/use-press-tap/lib/index.js} +13 -10
  170. package/lib/types.d.ts +1 -0
  171. package/lib/types.d.ts.map +1 -1
  172. package/lib/utils/styled.d.ts +46 -6
  173. package/lib/utils/styled.d.ts.map +1 -1
  174. package/lib/utils/styled.js +19 -4
  175. package/package.json +9 -5
  176. package/src/components/AlertDialog/AlertDialog.namespace.ts +22 -0
  177. package/src/components/AlertDialog/AlertDialog.test.tsx +226 -0
  178. package/src/components/AlertDialog/AlertDialog.tsx +374 -0
  179. package/src/components/AlertDialog/index.ts +24 -0
  180. package/src/components/AppBar/AppBar.namespace.ts +1 -0
  181. package/src/components/AppBar/AppBar.test.tsx +252 -3
  182. package/src/components/AppBar/AppBar.tsx +108 -25
  183. package/src/components/AppBar/context.ts +3 -1
  184. package/src/components/AppBar/index.ts +1 -0
  185. package/src/components/AppBar/useAppBar.ts +21 -15
  186. package/src/components/AttachmentDisplay/AttachmentDisplay.tsx +886 -0
  187. package/src/components/AttachmentDisplay/index.ts +48 -0
  188. package/src/components/AttachmentInput/AttachmentInput.tsx +1001 -0
  189. package/src/components/AttachmentInput/index.ts +49 -0
  190. package/src/components/BottomSheet/BottomSheet.test.tsx +22 -7
  191. package/src/components/BottomSheet/BottomSheet.tsx +1 -19
  192. package/src/components/Box/Box.test.tsx +104 -0
  193. package/src/components/Box/Box.tsx +9 -6
  194. package/src/components/ChipTabs/ChipTabs.namespace.ts +14 -0
  195. package/src/components/ChipTabs/ChipTabs.tsx +119 -0
  196. package/src/components/ChipTabs/index.ts +16 -0
  197. package/src/components/ContextualFloatingButton/ContextualFloatingButton.test.tsx +63 -0
  198. package/src/components/ContextualFloatingButton/ContextualFloatingButton.tsx +232 -0
  199. package/src/components/ContextualFloatingButton/index.ts +4 -0
  200. package/src/components/Dialog/Dialog.namespace.ts +24 -0
  201. package/src/components/Dialog/Dialog.test.tsx +172 -0
  202. package/src/components/Dialog/Dialog.tsx +373 -0
  203. package/src/components/Dialog/index.ts +26 -0
  204. package/src/components/FloatingActionButton/FloatingActionButton.namespace.ts +8 -0
  205. package/src/components/FloatingActionButton/FloatingActionButton.test.tsx +59 -0
  206. package/src/components/FloatingActionButton/FloatingActionButton.tsx +207 -0
  207. package/src/components/FloatingActionButton/index.ts +10 -0
  208. package/src/components/HelpBubble/HelpBubble.namespace.ts +24 -0
  209. package/src/components/HelpBubble/HelpBubble.tsx +998 -0
  210. package/src/components/HelpBubble/index.ts +26 -0
  211. package/src/components/Icon/Icon.test.tsx +0 -3
  212. package/src/components/Icon/Icon.tsx +11 -1
  213. package/src/components/IdentityPlaceholder/IdentityPlaceholder.namespace.ts +6 -0
  214. package/src/components/IdentityPlaceholder/IdentityPlaceholder.tsx +103 -0
  215. package/src/components/IdentityPlaceholder/assets.d.ts +4 -0
  216. package/src/components/IdentityPlaceholder/identity-placeholder-business.webp +0 -0
  217. package/src/components/IdentityPlaceholder/identity-placeholder-person.webp +0 -0
  218. package/src/components/IdentityPlaceholder/index.ts +8 -0
  219. package/src/components/InputButton/InputButton.test.tsx +128 -1
  220. package/src/components/InputButton/InputButton.tsx +60 -9
  221. package/src/components/List/List.test.tsx +54 -2
  222. package/src/components/List/List.tsx +43 -10
  223. package/src/components/Menu/Menu.tsx +14 -4
  224. package/src/components/Menu/__tests__/Menu.test.tsx +34 -0
  225. package/src/components/PageBanner/PageBanner.test.tsx +110 -3
  226. package/src/components/PageBanner/PageBanner.tsx +83 -19
  227. package/src/components/QuantityPicker/QuantityPicker.namespace.ts +10 -0
  228. package/src/components/QuantityPicker/QuantityPicker.test.tsx +235 -0
  229. package/src/components/QuantityPicker/QuantityPicker.tsx +605 -0
  230. package/src/components/QuantityPicker/index.ts +14 -0
  231. package/src/components/ReactionButton/ReactionButton.feedback.test.tsx +50 -0
  232. package/src/components/ReactionButton/ReactionButton.test.tsx +5 -3
  233. package/src/components/ReactionButton/ReactionButton.tsx +20 -12
  234. package/src/components/ScrollFog/ScrollFog.test.tsx +222 -0
  235. package/src/components/ScrollFog/ScrollFog.tsx +172 -0
  236. package/src/components/ScrollFog/index.ts +1 -0
  237. package/src/components/Select/Select.namespace.ts +34 -0
  238. package/src/components/Select/Select.test.tsx +297 -0
  239. package/src/components/Select/Select.tsx +1483 -0
  240. package/src/components/Select/index.ts +39 -0
  241. package/src/components/Skeleton/Skeleton.test.tsx +64 -0
  242. package/src/components/Skeleton/Skeleton.tsx +45 -0
  243. package/src/components/Skeleton/index.ts +1 -0
  244. package/src/components/Slider/Slider.namespace.ts +26 -0
  245. package/src/components/Slider/Slider.test.tsx +260 -0
  246. package/src/components/Slider/Slider.tsx +897 -0
  247. package/src/components/Slider/Slider.utils.ts +167 -0
  248. package/src/components/Slider/index.ts +30 -0
  249. package/src/components/Stack/Stack.test.tsx +7 -0
  250. package/src/components/Stack/Stack.tsx +11 -10
  251. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.test.tsx +21 -1
  252. package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +30 -7
  253. package/src/components/Switch/Switch.tsx +14 -13
  254. package/src/components/Tabs/Tabs.test.tsx +218 -1
  255. package/src/components/Tabs/Tabs.tsx +346 -75
  256. package/src/components/Tabs/Tabs.utils.ts +51 -1
  257. package/src/components/Tabs/index.ts +17 -1
  258. package/src/components/index.ts +14 -0
  259. package/src/hooks/useControllableState.ts +1 -43
  260. package/src/hooks/usePressTap.test.ts +23 -11
  261. package/src/hooks/usePressTap.ts +1 -60
  262. package/src/hooks/useSafeArea.test.ts +13 -1
  263. package/src/hooks/useSafeArea.ts +25 -23
  264. package/src/types.ts +1 -0
  265. package/src/utils/styled.ts +127 -9
@@ -1,5 +1,5 @@
1
- import { useControllableState } from "../../hooks/useControllableState.js";
2
- import { usePressTap } from "../../hooks/usePressTap.js";
1
+ import { useControllableState } from "../../packages/lynx-react-headless/use-controllable-state/lib/index.js";
2
+ import { usePressTap } from "../../packages/lynx-react-headless/use-press-tap/lib/index.js";
3
3
  import { useScaleFeedback } from "../../hooks/useScaleFeedback.js";
4
4
  import { toArray } from "../../utils/children.js";
5
5
  import { mergeProps } from "../../utils/merge-props.js";
@@ -1,4 +1,4 @@
1
- import { usePressTap } from "../../hooks/usePressTap.js";
1
+ import { usePressTap } from "../../packages/lynx-react-headless/use-press-tap/lib/index.js";
2
2
  import { useScaleFeedback } from "../../hooks/useScaleFeedback.js";
3
3
  import { toArray } from "../../utils/children.js";
4
4
  import { mergeProps } from "../../utils/merge-props.js";
@@ -0,0 +1,64 @@
1
+ import { DialogBackdropProps as DialogPrimitiveBackdropProps, DialogCloseProps as DialogPrimitiveCloseProps, DialogContentProps as DialogPrimitiveContentProps, DialogRootProps as DialogPrimitiveRootProps, DialogTriggerProps as DialogPrimitiveTriggerProps, DialogViewProps as DialogPrimitiveViewProps } from '@lynx-js/lynx-ui-dialog';
2
+ import { ForwardRefExoticComponent, PropsWithoutRef, ReactElement, RefAttributes } from '@lynx-js/react';
3
+ import { AlertDialogVariantProps } from '@seed-design/lynx-css/recipes/alert-dialog';
4
+ import { LynxAccessibilityProps, LynxStyledElementProps } from '../../types';
5
+ import { StyleProps } from '../../utils/styled';
6
+ type AlertDialogComponent<Props> = ((props: Props) => ReactElement) & {
7
+ displayName?: string;
8
+ };
9
+ type LynxForwardRefComponent<T, Props> = ForwardRefExoticComponent<PropsWithoutRef<Props> & RefAttributes<T>>;
10
+ export interface AlertDialogRootProps extends AlertDialogVariantProps, Omit<DialogPrimitiveRootProps, "show" | "defaultShow" | "onShowChange"> {
11
+ /** Whether the alert dialog is open (controlled mode). */
12
+ open?: boolean;
13
+ /** Whether the alert dialog is open by default (uncontrolled mode). */
14
+ defaultOpen?: boolean;
15
+ /** Called when the alert dialog's open state changes. */
16
+ onOpenChange?: (open: boolean) => void;
17
+ }
18
+ /**
19
+ * @platform Lynx — wraps `@lynx-js/lynx-ui-dialog` as an alert dialog.
20
+ * Refs, `asChild`, focus management, Escape-key dismissal, and close reasons are
21
+ * not supported by the Lynx primitive.
22
+ */
23
+ export declare const AlertDialogRoot: AlertDialogComponent<AlertDialogRootProps>;
24
+ export interface AlertDialogTriggerProps extends DialogPrimitiveTriggerProps {
25
+ }
26
+ /** @platform Lynx — `asChild` and refs are unsupported. */
27
+ export declare const AlertDialogTrigger: AlertDialogComponent<AlertDialogTriggerProps>;
28
+ export interface AlertDialogPositionerProps extends DialogPrimitiveViewProps {
29
+ }
30
+ /** @platform Lynx — maps to `DialogView`; refs are unsupported. */
31
+ export declare const AlertDialogPositioner: AlertDialogComponent<AlertDialogPositionerProps>;
32
+ export interface AlertDialogBackdropProps extends DialogPrimitiveBackdropProps {
33
+ }
34
+ /**
35
+ * @platform Lynx — refs are unsupported. Native lifecycle handlers in
36
+ * `dialogBackdropProps` are reserved by the headless primitive and are omitted.
37
+ * Alert dialogs do not dismiss when the backdrop is tapped by default.
38
+ */
39
+ export declare const AlertDialogBackdrop: AlertDialogComponent<AlertDialogBackdropProps>;
40
+ export interface AlertDialogContentProps extends DialogPrimitiveContentProps, LynxAccessibilityProps {
41
+ }
42
+ /**
43
+ * @platform Lynx — refs are unsupported. Native lifecycle handlers in
44
+ * `dialogContentProps` are reserved by the headless primitive and are omitted.
45
+ */
46
+ export declare const AlertDialogContent: AlertDialogComponent<AlertDialogContentProps>;
47
+ export interface AlertDialogHeaderProps extends StyleProps, LynxStyledElementProps {
48
+ }
49
+ export declare const AlertDialogHeader: LynxForwardRefComponent<unknown, AlertDialogHeaderProps>;
50
+ export interface AlertDialogTitleProps extends StyleProps, LynxStyledElementProps, LynxAccessibilityProps {
51
+ }
52
+ export declare const AlertDialogTitle: LynxForwardRefComponent<unknown, AlertDialogTitleProps>;
53
+ export interface AlertDialogDescriptionProps extends StyleProps, LynxStyledElementProps, LynxAccessibilityProps {
54
+ }
55
+ export declare const AlertDialogDescription: LynxForwardRefComponent<unknown, AlertDialogDescriptionProps>;
56
+ export interface AlertDialogFooterProps extends StyleProps, LynxStyledElementProps {
57
+ }
58
+ export declare const AlertDialogFooter: LynxForwardRefComponent<unknown, AlertDialogFooterProps>;
59
+ export interface AlertDialogActionProps extends DialogPrimitiveCloseProps {
60
+ }
61
+ /** @platform Lynx — maps to `DialogClose`; `asChild` and refs are unsupported. */
62
+ export declare const AlertDialogAction: AlertDialogComponent<AlertDialogActionProps>;
63
+ export {};
64
+ //# sourceMappingURL=AlertDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,mBAAmB,IAAI,4BAA4B,EACxD,KAAK,gBAAgB,IAAI,yBAAyB,EAClD,KAAK,kBAAkB,IAAI,2BAA2B,EACtD,KAAK,eAAe,IAAI,wBAAwB,EAChD,KAAK,kBAAkB,IAAI,2BAA2B,EACtD,KAAK,eAAe,IAAI,wBAAwB,EACjD,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,4CAA4C,CAAC;AAGpD,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EAGvB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEpE,KAAK,oBAAoB,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,YAAY,CAAC,GAAG;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AACF,KAAK,uBAAuB,CAAC,CAAC,EAAE,KAAK,IAAI,yBAAyB,CAChE,eAAe,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAC1C,CAAC;AA0CF,MAAM,WAAW,oBACf,SAAQ,uBAAuB,EAC7B,IAAI,CAAC,wBAAwB,EAAE,MAAM,GAAG,aAAa,GAAG,cAAc,CAAC;IACzE,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uEAAuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yDAAyD;IACzD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAmBtB,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;AAOjD,MAAM,WAAW,uBAAwB,SAAQ,2BAA2B;CAAG;AAE/E,2DAA2D;AAC3D,eAAO,MAAM,kBAAkB,EASzB,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;AAOpD,MAAM,WAAW,0BAA2B,SAAQ,wBAAwB;CAAG;AAE/E,mEAAmE;AACnE,eAAO,MAAM,qBAAqB,EAmB7B,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;AAOtD,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;CAAG;AAEjF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAuB1B,oBAAoB,CAAC,wBAAwB,CAAC,CAAC;AAOrD,MAAM,WAAW,uBACf,SAAQ,2BAA2B,EACjC,sBAAsB;CAAG;AAE7B;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EA4BzB,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;AAOpD,MAAM,WAAW,sBAAuB,SAAQ,UAAU,EAAE,sBAAsB;CAAG;AAErF,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,CAgBnF,CAAC;AAGL,MAAM,WAAW,qBACf,SAAQ,UAAU,EAChB,sBAAsB,EACtB,sBAAsB;CAAG;AAE7B,eAAO,MAAM,gBAAgB,EAAE,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,CAwBnF,CAAC;AAGH,MAAM,WAAW,2BACf,SAAQ,UAAU,EAChB,sBAAsB,EACtB,sBAAsB;CAAG;AAE7B,eAAO,MAAM,sBAAsB,EAAE,uBAAuB,CAAC,OAAO,EAAE,2BAA2B,CAgB7F,CAAC;AAGL,MAAM,WAAW,sBAAuB,SAAQ,UAAU,EAAE,sBAAsB;CAAG;AAErF,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,CAAC,OAAO,EAAE,sBAAsB,CAgBnF,CAAC;AAOL,MAAM,WAAW,sBAAuB,SAAQ,yBAAyB;CAAG;AAE5E,kFAAkF;AAClF,eAAO,MAAM,iBAAiB,EAcxB,oBAAoB,CAAC,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,138 @@
1
+ import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
2
+ import { useStyleProps } from "../../utils/styled.js";
3
+ import { forwardRef } from "@lynx-js/react";
4
+ import clsx from "clsx";
5
+ import { DialogBackdrop, DialogClose, DialogContent, DialogRoot, DialogTrigger, DialogView } from "@lynx-js/lynx-ui-dialog";
6
+ import { alertDialog } from "@seed-design/lynx-css/recipes/alert-dialog";
7
+ //#region src/components/AlertDialog/AlertDialog.tsx
8
+ var { ClassNamesProvider, PropsProvider, useClassNames, useProps } = createSlotRecipeContext(alertDialog);
9
+ function omitHeadlessLifecycleHandlers(props) {
10
+ if (!props) return props;
11
+ const { bindanimationstart: _bindanimationstart, bindanimationend: _bindanimationend, bindanimationcancel: _bindanimationcancel, bindtransitionstart: _bindtransitionstart, bindtransitionend: _bindtransitionend, bindtap: _bindtap, ...nativeProps } = props;
12
+ return nativeProps;
13
+ }
14
+ function useAlertDialogTransition(transition) {
15
+ return useProps()?.skipAnimation === true ? false : transition ?? true;
16
+ }
17
+ /**
18
+ * @platform Lynx — wraps `@lynx-js/lynx-ui-dialog` as an alert dialog.
19
+ * Refs, `asChild`, focus management, Escape-key dismissal, and close reasons are
20
+ * not supported by the Lynx primitive.
21
+ */
22
+ var AlertDialogRoot = forwardRef((props, _ref) => {
23
+ const [variantProps, restProps] = alertDialog.splitVariantProps(props);
24
+ const { children, open, defaultOpen, onOpenChange, ...nativeProps } = restProps;
25
+ const classNames = alertDialog(variantProps);
26
+ return <ClassNamesProvider value={classNames}>
27
+ <PropsProvider value={variantProps}>
28
+ <DialogRoot {...nativeProps} show={open} defaultShow={defaultOpen} onShowChange={onOpenChange}>
29
+ {children}
30
+ </DialogRoot>
31
+ </PropsProvider>
32
+ </ClassNamesProvider>;
33
+ });
34
+ AlertDialogRoot.displayName = "AlertDialogRoot";
35
+ /** @platform Lynx — `asChild` and refs are unsupported. */
36
+ var AlertDialogTrigger = forwardRef((props, _ref) => {
37
+ const { children, transition, ...nativeProps } = props;
38
+ const resolvedTransition = useAlertDialogTransition(transition);
39
+ return <DialogTrigger {...nativeProps} transition={resolvedTransition}>
40
+ {children}
41
+ </DialogTrigger>;
42
+ });
43
+ AlertDialogTrigger.displayName = "AlertDialogTrigger";
44
+ /** @platform Lynx — maps to `DialogView`; refs are unsupported. */
45
+ var AlertDialogPositioner = forwardRef((props, _ref) => {
46
+ const { children, className, container, style, transition, ...nativeProps } = props;
47
+ const classNames = useClassNames();
48
+ const resolvedTransition = useAlertDialogTransition(transition);
49
+ const positionerStyle = container ? {
50
+ width: "100%",
51
+ height: "100%",
52
+ ...style
53
+ } : style;
54
+ return <DialogView {...nativeProps} container={container} className={clsx(classNames.positioner, className)} style={positionerStyle} transition={resolvedTransition}>
55
+ {children}
56
+ </DialogView>;
57
+ });
58
+ AlertDialogPositioner.displayName = "AlertDialogPositioner";
59
+ /**
60
+ * @platform Lynx — refs are unsupported. Native lifecycle handlers in
61
+ * `dialogBackdropProps` are reserved by the headless primitive and are omitted.
62
+ * Alert dialogs do not dismiss when the backdrop is tapped by default.
63
+ */
64
+ var AlertDialogBackdrop = forwardRef((props, _ref) => {
65
+ const { children, className, transition, clickToClose = false, dialogBackdropProps, ...nativeProps } = props;
66
+ const classNames = useClassNames();
67
+ const resolvedTransition = useAlertDialogTransition(transition);
68
+ return <DialogBackdrop {...nativeProps} className={clsx(classNames.backdrop, className)} transition={resolvedTransition} clickToClose={clickToClose} dialogBackdropProps={omitHeadlessLifecycleHandlers(dialogBackdropProps)}>
69
+ {children}
70
+ </DialogBackdrop>;
71
+ });
72
+ AlertDialogBackdrop.displayName = "AlertDialogBackdrop";
73
+ /**
74
+ * @platform Lynx — refs are unsupported. Native lifecycle handlers in
75
+ * `dialogContentProps` are reserved by the headless primitive and are omitted.
76
+ */
77
+ var AlertDialogContent = forwardRef((props, _ref) => {
78
+ const { children, className, transition, dialogContentProps, "accessibility-element": accessibilityElement = true, "accessibility-role-description": accessibilityRoleDescription = "alertdialog", ...nativeProps } = props;
79
+ const classNames = useClassNames();
80
+ const resolvedTransition = useAlertDialogTransition(transition);
81
+ const resolvedDialogContentProps = {
82
+ "accessibility-element": accessibilityElement,
83
+ "accessibility-role-description": accessibilityRoleDescription,
84
+ ...omitHeadlessLifecycleHandlers(dialogContentProps)
85
+ };
86
+ return <DialogContent {...nativeProps} className={clsx(classNames.content, className)} transition={resolvedTransition} dialogContentProps={resolvedDialogContentProps}>
87
+ {children}
88
+ </DialogContent>;
89
+ });
90
+ AlertDialogContent.displayName = "AlertDialogContent";
91
+ var AlertDialogHeader = forwardRef((props, ref) => {
92
+ const { style, restProps } = useStyleProps(props);
93
+ const { children, className, ...nativeProps } = restProps;
94
+ const classNames = useClassNames();
95
+ return <view {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.header, className)} style={style}>
96
+ {children}
97
+ </view>;
98
+ });
99
+ AlertDialogHeader.displayName = "AlertDialogHeader";
100
+ var AlertDialogTitle = forwardRef((props, ref) => {
101
+ const { style, restProps } = useStyleProps(props);
102
+ const { children, className, "accessibility-heading": accessibilityHeading = true, ...nativeProps } = restProps;
103
+ const classNames = useClassNames();
104
+ return <text {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.title, className)} style={style} accessibility-heading={accessibilityHeading}>
105
+ {children}
106
+ </text>;
107
+ });
108
+ AlertDialogTitle.displayName = "AlertDialogTitle";
109
+ var AlertDialogDescription = forwardRef((props, ref) => {
110
+ const { style, restProps } = useStyleProps(props);
111
+ const { children, className, ...nativeProps } = restProps;
112
+ const classNames = useClassNames();
113
+ return <text {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.description, className)} style={style}>
114
+ {children}
115
+ </text>;
116
+ });
117
+ AlertDialogDescription.displayName = "AlertDialogDescription";
118
+ var AlertDialogFooter = forwardRef((props, ref) => {
119
+ const { style, restProps } = useStyleProps(props);
120
+ const { children, className, ...nativeProps } = restProps;
121
+ const classNames = useClassNames();
122
+ return <view {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.footer, className)} style={style}>
123
+ {children}
124
+ </view>;
125
+ });
126
+ AlertDialogFooter.displayName = "AlertDialogFooter";
127
+ /** @platform Lynx — maps to `DialogClose`; `asChild` and refs are unsupported. */
128
+ var AlertDialogAction = forwardRef((props, _ref) => {
129
+ const { children, className, transition, ...nativeProps } = props;
130
+ const classNames = useClassNames();
131
+ const resolvedTransition = useAlertDialogTransition(transition);
132
+ return <DialogClose {...nativeProps} className={clsx(classNames.action, className)} transition={resolvedTransition}>
133
+ {children}
134
+ </DialogClose>;
135
+ });
136
+ AlertDialogAction.displayName = "AlertDialogAction";
137
+ //#endregion
138
+ export { AlertDialogAction, AlertDialogBackdrop, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPositioner, AlertDialogRoot, AlertDialogTitle, AlertDialogTrigger };
@@ -0,0 +1,2 @@
1
+ export { AlertDialogAction as Action, AlertDialogBackdrop as Backdrop, AlertDialogContent as Content, AlertDialogDescription as Description, AlertDialogFooter as Footer, AlertDialogHeader as Header, AlertDialogPositioner as Positioner, AlertDialogRoot as Root, AlertDialogTitle as Title, AlertDialogTrigger as Trigger, type AlertDialogActionProps as ActionProps, type AlertDialogBackdropProps as BackdropProps, type AlertDialogContentProps as ContentProps, type AlertDialogDescriptionProps as DescriptionProps, type AlertDialogFooterProps as FooterProps, type AlertDialogHeaderProps as HeaderProps, type AlertDialogPositionerProps as PositionerProps, type AlertDialogRootProps as RootProps, type AlertDialogTitleProps as TitleProps, type AlertDialogTriggerProps as TriggerProps, } from './AlertDialog';
2
+ //# sourceMappingURL=AlertDialog.namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AlertDialog.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,IAAI,MAAM,EAC3B,mBAAmB,IAAI,QAAQ,EAC/B,kBAAkB,IAAI,OAAO,EAC7B,sBAAsB,IAAI,WAAW,EACrC,iBAAiB,IAAI,MAAM,EAC3B,iBAAiB,IAAI,MAAM,EAC3B,qBAAqB,IAAI,UAAU,EACnC,eAAe,IAAI,IAAI,EACvB,gBAAgB,IAAI,KAAK,EACzB,kBAAkB,IAAI,OAAO,EAC7B,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,wBAAwB,IAAI,aAAa,EAC9C,KAAK,uBAAuB,IAAI,YAAY,EAC5C,KAAK,2BAA2B,IAAI,gBAAgB,EACpD,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,sBAAsB,IAAI,WAAW,EAC1C,KAAK,0BAA0B,IAAI,eAAe,EAClD,KAAK,oBAAoB,IAAI,SAAS,EACtC,KAAK,qBAAqB,IAAI,UAAU,EACxC,KAAK,uBAAuB,IAAI,YAAY,GAC7C,MAAM,eAAe,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { AlertDialogAction, AlertDialogBackdrop, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogPositioner, AlertDialogRoot, AlertDialogTitle, AlertDialogTrigger } from "./AlertDialog.jsx";
3
+ //#region src/components/AlertDialog/AlertDialog.namespace.ts
4
+ var AlertDialog_namespace_exports = /* @__PURE__ */ __exportAll({
5
+ Action: () => AlertDialogAction,
6
+ Backdrop: () => AlertDialogBackdrop,
7
+ Content: () => AlertDialogContent,
8
+ Description: () => AlertDialogDescription,
9
+ Footer: () => AlertDialogFooter,
10
+ Header: () => AlertDialogHeader,
11
+ Positioner: () => AlertDialogPositioner,
12
+ Root: () => AlertDialogRoot,
13
+ Title: () => AlertDialogTitle,
14
+ Trigger: () => AlertDialogTrigger
15
+ });
16
+ //#endregion
17
+ export { AlertDialog_namespace_exports };
@@ -0,0 +1,3 @@
1
+ export { AlertDialogAction, type AlertDialogActionProps, AlertDialogBackdrop, type AlertDialogBackdropProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogPositioner, type AlertDialogPositionerProps, AlertDialogRoot, type AlertDialogRootProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps, } from './AlertDialog';
2
+ export * as AlertDialog from './AlertDialog.namespace';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,eAAe,EACf,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,WAAW,MAAM,yBAAyB,CAAC"}
@@ -2,6 +2,10 @@ import { AppBarVariantProps } from '@seed-design/lynx-css/recipes/app-bar';
2
2
  import { AppBarMainVariantProps } from '@seed-design/lynx-css/recipes/app-bar-main';
3
3
  import { LynxElementProps, LynxIconElementProps, LynxPressableProps, LynxStyledElementProps, LynxViewProps } from '../../types';
4
4
  import * as React from "@lynx-js/react";
5
+ /**
6
+ * 아이콘 버튼의 bleed 보정 방향. `leading`은 왼쪽, `trailing`은 오른쪽, `both`는 양쪽.
7
+ */
8
+ export type AppBarEdge = "leading" | "trailing" | "both";
5
9
  export interface AppBarRootProps extends AppBarVariantProps, LynxStyledElementProps {
6
10
  }
7
11
  export declare const AppBarRoot: React.ForwardRefExoticComponent<AppBarRootProps & React.RefAttributes<unknown>>;
@@ -22,14 +26,23 @@ export declare const AppBarTitle: React.ForwardRefExoticComponent<AppBarTitlePro
22
26
  export interface AppBarSubtitleProps extends LynxElementProps {
23
27
  }
24
28
  export declare const AppBarSubtitle: React.ForwardRefExoticComponent<AppBarSubtitleProps & React.RefAttributes<unknown>>;
25
- export interface AppBarIconButtonProps extends LynxElementProps, LynxPressableProps {
29
+ export interface AppBarIconButtonProps extends Omit<LynxElementProps, "flatten">, LynxPressableProps {
26
30
  icon?: React.ReactElement<LynxIconElementProps>;
27
31
  "accessibility-label"?: LynxViewProps["accessibility-label"];
28
32
  "accessibility-element"?: LynxViewProps["accessibility-element"];
29
33
  "accessibility-traits"?: LynxViewProps["accessibility-traits"];
34
+ /**
35
+ * 슬롯의 첫·마지막 자식이 아이콘 버튼이면 해당 방향을, 유일한 자식이면 양쪽을 자동 보정한다.
36
+ * 명시하면 `AppBarLeft` / `AppBarRight`에서 감지한 자동 보정 방향을 덮어쓴다.
37
+ */
38
+ edge?: AppBarEdge;
30
39
  }
31
40
  export declare const AppBarIconButton: React.ForwardRefExoticComponent<AppBarIconButtonProps & React.RefAttributes<unknown>>;
32
41
  export interface AppBarSlotProps extends LynxStyledElementProps {
42
+ /**
43
+ * @internal 커스텀 슬롯에서는 bleed 보정을 적용하지 않는다. 전달된 값은 native 속성에서 제외한다.
44
+ */
45
+ edge?: AppBarEdge;
33
46
  }
34
47
  export declare const AppBarSlot: React.ForwardRefExoticComponent<AppBarSlotProps & React.RefAttributes<unknown>>;
35
48
  //# sourceMappingURL=AppBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppBar.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/AppBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAGxC,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EAEtB,aAAa,EAEd,MAAM,aAAa,CAAC;AAqCrB,MAAM,WAAW,eAAgB,SAAQ,kBAAkB,EAAE,sBAAsB;CAAG;AAEtF,eAAO,MAAM,UAAU,iFA2BrB,CAAC;AAKH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC7D,gBAAgB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,UAAU,iFA4BrB,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D,gBAAgB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,WAAW,kFA4BtB,CAAC;AAKH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB,EAAE,sBAAsB;CAAG;AAE1F,eAAO,MAAM,UAAU,iFAmCrB,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;CAAG;AAE7D,eAAO,MAAM,WAAW,kFAYtB,CAAC;AAGH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;CAAG;AAEhE,eAAO,MAAM,cAAc,qFAYzB,CAAC;AAKH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB,EAAE,kBAAkB;IACjF,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAChD,qBAAqB,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC7D,uBAAuB,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IACjE,sBAAsB,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CAChE;AAED,eAAO,MAAM,gBAAgB,uFA6B3B,CAAC;AAGH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;CAAG;AAElE,eAAO,MAAM,UAAU,iFAYrB,CAAC"}
1
+ {"version":3,"file":"AppBar.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/AppBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAGxC,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EAEtB,aAAa,EAEd,MAAM,aAAa,CAAC;AAoCrB;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;AA2DzD,MAAM,WAAW,eAAgB,SAAQ,kBAAkB,EAAE,sBAAsB;CAAG;AAEtF,eAAO,MAAM,UAAU,iFA2BrB,CAAC;AAKH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC7D,gBAAgB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,UAAU,iFA4BrB,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D,gBAAgB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,WAAW,kFA4BtB,CAAC;AAKH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB,EAAE,sBAAsB;CAAG;AAE1F,eAAO,MAAM,UAAU,iFA0BrB,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;CAAG;AAE7D,eAAO,MAAM,WAAW,kFAYtB,CAAC;AAGH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;CAAG;AAEhE,eAAO,MAAM,cAAc,qFAYzB,CAAC;AAKH,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,EACvC,kBAAkB;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAChD,qBAAqB,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAC7D,uBAAuB,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAC;IACjE,sBAAsB,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;IAC/D;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,uFA8C3B,CAAC;AAGH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC7D;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,iFAcrB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { useScaleFeedback } from "../../hooks/useScaleFeedback.js";
1
2
  import { mergeProps } from "../../utils/merge-props.js";
2
3
  import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
3
4
  import { Icon, IconSlotProvider } from "../Icon/Icon.jsx";
@@ -24,6 +25,31 @@ function useAppBarMainClassNames(consumer) {
24
25
  throw new Error(`<${consumer}/> must be rendered inside <AppBarMain/>.`);
25
26
  }
26
27
  }
28
+ var AppBarEdgeContext = React.createContext(void 0);
29
+ /** Fragments and arrays do not create layout boxes; retain their keys and nesting. */
30
+ function countEdgeChildren(children) {
31
+ if (children == null || children === "" || typeof children === "boolean") return 0;
32
+ if (Array.isArray(children)) return children.reduce((count, child) => count + countEdgeChildren(child), 0);
33
+ if (React.isValidElement(children) && children.type === React.Fragment) return countEdgeChildren(children.props.children);
34
+ return 1;
35
+ }
36
+ function provideEdgeToChildren(children) {
37
+ const lastIndex = countEdgeChildren(children) - 1;
38
+ let index = 0;
39
+ function visit(child) {
40
+ if (child == null || child === "" || typeof child === "boolean") return child;
41
+ if (Array.isArray(child)) return child.map(visit);
42
+ if (React.isValidElement(child) && child.type === React.Fragment) return React.cloneElement(child, { children: visit(child.props.children) });
43
+ const childIndex = index++;
44
+ const edge = childIndex === 0 ? childIndex === lastIndex ? "both" : "leading" : childIndex === lastIndex ? "trailing" : void 0;
45
+ if (!React.isValidElement(child)) return child;
46
+ const automaticEdge = typeof child.type !== "string" && child.type !== AppBarSlot ? edge : void 0;
47
+ return <AppBarEdgeContext.Provider key={child.key} value={automaticEdge}>
48
+ {child}
49
+ </AppBarEdgeContext.Provider>;
50
+ }
51
+ return visit(children);
52
+ }
27
53
  var AppBarRoot = React.forwardRef((props, ref) => {
28
54
  const [variantProps, otherProps] = appBar.splitVariantProps(props);
29
55
  const { children, className, style, ...nativeProps } = otherProps;
@@ -32,7 +58,7 @@ var AppBarRoot = React.forwardRef((props, ref) => {
32
58
  return <AppBarProvider value={contextValue}>
33
59
  <AppBarClassNamesProvider value={classNames}>
34
60
  <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classNames.root, className)} style={{
35
- "--seed-safe-area-top": contextValue.safeAreaInsetTop,
61
+ "--seed-safe-area-top": contextValue.safeArea.safeAreaInsetTop,
36
62
  "--centered-title-padding-x": contextValue.centeredTitlePaddingX,
37
63
  ...rootLayoutStyle,
38
64
  ...style
@@ -54,7 +80,7 @@ var AppBarLeft = React.forwardRef((props, ref) => {
54
80
  if (width != null) setLeftWidth(width);
55
81
  }, [bindlayoutchange, setLeftWidth]);
56
82
  return <view {...mergeProps({ bindlayoutchange: handleLayoutChange }, ref ? { ref } : {}, nativeProps)} className={clsx(classNames.left, className)}>
57
- {children}
83
+ {provideEdgeToChildren(children)}
58
84
  </view>;
59
85
  });
60
86
  AppBarLeft.displayName = "AppBarLeft";
@@ -68,12 +94,12 @@ var AppBarRight = React.forwardRef((props, ref) => {
68
94
  if (width != null) setRightWidth(width);
69
95
  }, [bindlayoutchange, setRightWidth]);
70
96
  return <view {...mergeProps({ bindlayoutchange: handleLayoutChange }, ref ? { ref } : {}, nativeProps)} className={clsx(classNames.right, className)}>
71
- {children}
97
+ {provideEdgeToChildren(children)}
72
98
  </view>;
73
99
  });
74
100
  AppBarRight.displayName = "AppBarRight";
75
101
  var AppBarMain = React.forwardRef((props, ref) => {
76
- const { centeredTitlePaddingX, safeAreaInsetTop, sharedVariantProps } = useAppBarContext("AppBarMain");
102
+ const { centeredTitlePaddingX, safeArea, sharedVariantProps } = useAppBarContext("AppBarMain");
77
103
  const [variantProps, otherProps] = appBarMain.splitVariantProps({
78
104
  ...sharedVariantProps,
79
105
  ...props
@@ -81,14 +107,9 @@ var AppBarMain = React.forwardRef((props, ref) => {
81
107
  const resolvedTheme = variantProps.theme ?? "cupertino";
82
108
  const classNames = appBarMain(variantProps);
83
109
  const { children, className, style, ...nativeProps } = otherProps;
84
- const centeredTitleStyle = variantProps.theme === "cupertino" ? {
85
- paddingLeft: centeredTitlePaddingX,
86
- paddingRight: centeredTitlePaddingX
87
- } : void 0;
88
110
  return <AppBarMainClassNamesProvider value={classNames}>
89
111
  <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classNames.root, className)} style={{
90
- ...centeredTitleStyle,
91
- ...getMainLayoutStyle(resolvedTheme, safeAreaInsetTop),
112
+ ...getMainLayoutStyle(resolvedTheme, safeArea, centeredTitlePaddingX),
92
113
  ...style
93
114
  }}>
94
115
  {children}
@@ -113,10 +134,13 @@ var AppBarSubtitle = React.forwardRef((props, ref) => {
113
134
  });
114
135
  AppBarSubtitle.displayName = "AppBarSubtitle";
115
136
  var AppBarIconButton = React.forwardRef((props, ref) => {
116
- const { children, className, icon, "accessibility-element": accessibilityElement = true, "accessibility-label": accessibilityLabel, "accessibility-traits": accessibilityTraits = "button", ...nativeProps } = props;
137
+ const { children, className, icon, edge, "accessibility-element": accessibilityElement = true, "accessibility-label": accessibilityLabel, "accessibility-traits": accessibilityTraits = "button", ...nativeProps } = props;
117
138
  const classNames = useAppBarClassNames("AppBarIconButton");
139
+ const { scaleFeedbackTriggerProps, scaleFeedbackTargetProps } = useScaleFeedback();
140
+ const automaticEdge = React.useContext(AppBarEdgeContext);
141
+ const resolvedEdge = edge ?? automaticEdge;
118
142
  if (process.env.NODE_ENV !== "production" && accessibilityElement && !accessibilityLabel) console.warn("AppBarIconButton requires `accessibility-label` for accessibility.");
119
- return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} accessibility-element={accessibilityElement} accessibility-label={accessibilityLabel} accessibility-traits={accessibilityTraits} className={clsx(classNames.iconButton, className)}>
143
+ return <view {...mergeProps(ref ? { ref } : {}, scaleFeedbackTriggerProps, scaleFeedbackTargetProps, nativeProps)} flatten={false} accessibility-element={accessibilityElement} accessibility-label={accessibilityLabel} accessibility-traits={accessibilityTraits} className={clsx(classNames.iconButton, (resolvedEdge === "leading" || resolvedEdge === "both") && "seed-app-bar__icon-button-edge-leading", (resolvedEdge === "trailing" || resolvedEdge === "both") && "seed-app-bar__icon-button-edge-trailing", className)}>
120
144
  <IconSlotProvider value={{
121
145
  classNames: { icon: classNames.icon },
122
146
  deps: [classNames.icon]
@@ -127,11 +151,13 @@ var AppBarIconButton = React.forwardRef((props, ref) => {
127
151
  });
128
152
  AppBarIconButton.displayName = "AppBarIconButton";
129
153
  var AppBarSlot = React.forwardRef((props, ref) => {
130
- const { children, className, ...nativeProps } = props;
154
+ const { children, className, edge: _edge, ...nativeProps } = props;
131
155
  const classNames = useAppBarClassNames("AppBarSlot");
132
- return <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classNames.custom, className)}>
133
- {children}
134
- </view>;
156
+ return <AppBarEdgeContext.Provider value={void 0}>
157
+ <view {...mergeProps(ref ? { ref } : {}, nativeProps)} className={clsx(classNames.custom, className)}>
158
+ {children}
159
+ </view>
160
+ </AppBarEdgeContext.Provider>;
135
161
  });
136
162
  AppBarSlot.displayName = "AppBarSlot";
137
163
  //#endregion
@@ -1,2 +1,2 @@
1
- export { AppBarIconButton as IconButton, AppBarLeft as Left, AppBarMain as Main, AppBarRight as Right, AppBarRoot as Root, AppBarSlot as Slot, AppBarSubtitle as Subtitle, AppBarTitle as Title, type AppBarIconButtonProps as IconButtonProps, type AppBarLeftProps as LeftProps, type AppBarMainProps as MainProps, type AppBarRightProps as RightProps, type AppBarRootProps as RootProps, type AppBarSlotProps as SlotProps, type AppBarSubtitleProps as SubtitleProps, type AppBarTitleProps as TitleProps, } from './AppBar';
1
+ export { AppBarIconButton as IconButton, AppBarLeft as Left, AppBarMain as Main, AppBarRight as Right, AppBarRoot as Root, AppBarSlot as Slot, AppBarSubtitle as Subtitle, AppBarTitle as Title, type AppBarEdge as Edge, type AppBarIconButtonProps as IconButtonProps, type AppBarLeftProps as LeftProps, type AppBarMainProps as MainProps, type AppBarRightProps as RightProps, type AppBarRootProps as RootProps, type AppBarSlotProps as SlotProps, type AppBarSubtitleProps as SubtitleProps, type AppBarTitleProps as TitleProps, } from './AppBar';
2
2
  //# sourceMappingURL=AppBar.namespace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppBar.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/AppBar.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,IAAI,UAAU,EAC9B,UAAU,IAAI,IAAI,EAClB,UAAU,IAAI,IAAI,EAClB,WAAW,IAAI,KAAK,EACpB,UAAU,IAAI,IAAI,EAClB,UAAU,IAAI,IAAI,EAClB,cAAc,IAAI,QAAQ,EAC1B,WAAW,IAAI,KAAK,EACpB,KAAK,qBAAqB,IAAI,eAAe,EAC7C,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,gBAAgB,IAAI,UAAU,EACnC,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,mBAAmB,IAAI,aAAa,EACzC,KAAK,gBAAgB,IAAI,UAAU,GACpC,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"AppBar.namespace.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/AppBar.namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,IAAI,UAAU,EAC9B,UAAU,IAAI,IAAI,EAClB,UAAU,IAAI,IAAI,EAClB,WAAW,IAAI,KAAK,EACpB,UAAU,IAAI,IAAI,EAClB,UAAU,IAAI,IAAI,EAClB,cAAc,IAAI,QAAQ,EAC1B,WAAW,IAAI,KAAK,EACpB,KAAK,UAAU,IAAI,IAAI,EACvB,KAAK,qBAAqB,IAAI,eAAe,EAC7C,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,gBAAgB,IAAI,UAAU,EACnC,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,eAAe,IAAI,SAAS,EACjC,KAAK,mBAAmB,IAAI,aAAa,EACzC,KAAK,gBAAgB,IAAI,UAAU,GACpC,MAAM,UAAU,CAAC"}
@@ -1,9 +1,10 @@
1
1
  import { AppBarMainVariantProps } from '@seed-design/lynx-css/recipes/app-bar-main';
2
+ import { UseSafeAreaReturn } from '../../hooks/useSafeArea';
2
3
  import * as React from "@lynx-js/react";
3
4
  export type SharedAppBarVariantProps = Pick<AppBarMainVariantProps, "theme" | "tone" | "transitionStyle">;
4
5
  export interface AppBarContextValue {
5
6
  centeredTitlePaddingX: string;
6
- safeAreaInsetTop: string;
7
+ safeArea: UseSafeAreaReturn;
7
8
  sharedVariantProps: SharedAppBarVariantProps;
8
9
  setLeftWidth: (width: number) => void;
9
10
  setRightWidth: (width: number) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,sBAAsB,EACtB,OAAO,GAAG,MAAM,GAAG,iBAAiB,CACrC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,wBAAwB,CAAC;IAC7C,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAID,eAAO,MAAM,cAAc,2CAAyB,CAAC;AAErD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAMrE"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAExC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,sBAAsB,EACtB,OAAO,GAAG,MAAM,GAAG,iBAAiB,CACrC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,kBAAkB,EAAE,wBAAwB,CAAC;IAC7C,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAID,eAAO,MAAM,cAAc,2CAAyB,CAAC;AAErD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAMrE"}
@@ -1,3 +1,3 @@
1
- export { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle, type AppBarIconButtonProps, type AppBarLeftProps, type AppBarMainProps, type AppBarRightProps, type AppBarRootProps, type AppBarRootProps as AppBarProps, type AppBarSlotProps, type AppBarSubtitleProps, type AppBarTitleProps, } from './AppBar';
1
+ export { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle, type AppBarEdge, type AppBarIconButtonProps, type AppBarLeftProps, type AppBarMainProps, type AppBarRightProps, type AppBarRootProps, type AppBarRootProps as AppBarProps, type AppBarSlotProps, type AppBarSubtitleProps, type AppBarTitleProps, } from './AppBar';
2
2
  export * as AppBar from './AppBar.namespace';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,IAAI,WAAW,EACnC,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,KAAK,UAAU,EACf,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,eAAe,IAAI,WAAW,EACnC,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import { AppBarVariantProps, AppBarVariant } from '@seed-design/lynx-css/recipes/app-bar';
2
2
  import { AppBarMainVariantProps } from '@seed-design/lynx-css/recipes/app-bar-main';
3
+ import { UseSafeAreaReturn } from '../../hooks/useSafeArea';
3
4
  import { LynxViewProps } from '../../types';
4
5
  import { AppBarContextValue } from './context';
5
6
  type LayoutChangeHandler = NonNullable<LynxViewProps["bindlayoutchange"]>;
6
7
  type AppBarStyleObject = Record<string, string | number>;
7
8
  export declare function getLayoutWidth(event: Parameters<LayoutChangeHandler>[0]): number | null;
8
- export declare function getMainLayoutStyle(theme: AppBarMainVariantProps["theme"], safeAreaInsetTop: string): AppBarStyleObject | undefined;
9
+ export declare function getMainLayoutStyle(theme: AppBarMainVariantProps["theme"], safeArea: UseSafeAreaReturn, centeredTitlePaddingX: string): AppBarStyleObject | undefined;
9
10
  export declare function useAppBar(variantProps: AppBarVariantProps): {
10
11
  contextValue: AppBarContextValue;
11
12
  resolvedVariantProps: Partial< AppBarVariant>;
@@ -1 +1 @@
1
- {"version":3,"file":"useAppBar.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/useAppBar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAIzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAA4B,MAAM,WAAW,CAAC;AAO9E,KAAK,mBAAmB,GAAG,WAAW,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC1E,KAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAkBzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,CAMvF;AAaD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,EACtC,gBAAgB,EAAE,MAAM,GACvB,iBAAiB,GAAG,SAAS,CAO/B;AAED,wBAAgB,SAAS,CAAC,YAAY,EAAE,kBAAkB;;;;EAoCzD"}
1
+ {"version":3,"file":"useAppBar.d.ts","sourceRoot":"","sources":["../../../src/components/AppBar/useAppBar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAIzF,OAAO,EAAE,KAAK,iBAAiB,EAAe,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAA4B,MAAM,WAAW,CAAC;AAO9E,KAAK,mBAAmB,GAAG,WAAW,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAC1E,KAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAgBzD,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,CAMvF;AAiBD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,sBAAsB,CAAC,OAAO,CAAC,EACtC,QAAQ,EAAE,iBAAiB,EAC3B,qBAAqB,EAAE,MAAM,GAC5B,iBAAiB,GAAG,SAAS,CAS/B;AAED,wBAAgB,SAAS,CAAC,YAAY,EAAE,kBAAkB;;;;EAoCzD"}
@@ -1,10 +1,8 @@
1
1
  import { useSafeArea } from "../../hooks/useSafeArea.js";
2
2
  import * as React from "@lynx-js/react";
3
+ import { topNavigation } from "@seed-design/lynx-css/vars/component";
3
4
  //#region src/components/AppBar/useAppBar.ts
4
- var APP_BAR_HEIGHT_BY_THEME = {
5
- cupertino: "44px",
6
- android: "56px"
7
- };
5
+ var ROOT_PADDING_X = 16;
8
6
  function getDefaultAppBarTheme() {
9
7
  const systemInfo = globalThis.SystemInfo ?? (typeof SystemInfo === "undefined" ? void 0 : SystemInfo);
10
8
  if (systemInfo == null) return "cupertino";
@@ -17,23 +15,27 @@ function getLayoutWidth(event) {
17
15
  return Math.max(0, nextWidth);
18
16
  }
19
17
  function getCenteredTitlePadding(leftWidth, rightWidth) {
20
- return `${Math.max(leftWidth, rightWidth)}px`;
18
+ return `${ROOT_PADDING_X + Math.max(leftWidth, rightWidth)}px`;
21
19
  }
22
- function getRootLayoutStyle(theme, safeAreaInsetTop) {
20
+ function getRootLayoutStyle(safeArea) {
23
21
  return {
24
- height: `calc(${APP_BAR_HEIGHT_BY_THEME[theme]} + ${safeAreaInsetTop})`,
25
- paddingTop: safeAreaInsetTop
22
+ height: `calc(${topNavigation.base.enabled.root.height} + ${safeArea.safeAreaInsetTop})`,
23
+ paddingTop: safeArea.safeAreaInsetTop,
24
+ paddingLeft: `calc(${ROOT_PADDING_X}px + ${safeArea.safeAreaInsetLeft})`,
25
+ paddingRight: `calc(${ROOT_PADDING_X}px + ${safeArea.safeAreaInsetRight})`
26
26
  };
27
27
  }
28
- function getMainLayoutStyle(theme, safeAreaInsetTop) {
28
+ function getMainLayoutStyle(theme, safeArea, centeredTitlePaddingX) {
29
29
  if (theme !== "cupertino") return void 0;
30
30
  return {
31
- top: safeAreaInsetTop,
32
- bottom: "0px"
31
+ top: safeArea.safeAreaInsetTop,
32
+ bottom: "0px",
33
+ paddingLeft: `calc(${safeArea.safeAreaInsetLeft} + ${centeredTitlePaddingX})`,
34
+ paddingRight: `calc(${safeArea.safeAreaInsetRight} + ${centeredTitlePaddingX})`
33
35
  };
34
36
  }
35
37
  function useAppBar(variantProps) {
36
- const { safeAreaInsetTop } = useSafeArea();
38
+ const safeArea = useSafeArea();
37
39
  const [leftWidth, setLeftWidth] = React.useState(0);
38
40
  const [rightWidth, setRightWidth] = React.useState(0);
39
41
  const resolvedTheme = variantProps.theme ?? getDefaultAppBarTheme();
@@ -42,7 +44,7 @@ function useAppBar(variantProps) {
42
44
  theme: resolvedTheme
43
45
  };
44
46
  const centeredTitlePaddingX = getCenteredTitlePadding(leftWidth, rightWidth);
45
- const rootLayoutStyle = getRootLayoutStyle(resolvedTheme, safeAreaInsetTop);
47
+ const rootLayoutStyle = getRootLayoutStyle(safeArea);
46
48
  const sharedVariantProps = React.useMemo(() => ({
47
49
  theme: resolvedVariantProps.theme,
48
50
  tone: resolvedVariantProps.tone,
@@ -55,13 +57,13 @@ function useAppBar(variantProps) {
55
57
  return {
56
58
  contextValue: React.useMemo(() => ({
57
59
  centeredTitlePaddingX,
58
- safeAreaInsetTop,
60
+ safeArea,
59
61
  sharedVariantProps,
60
62
  setLeftWidth,
61
63
  setRightWidth
62
64
  }), [
63
65
  centeredTitlePaddingX,
64
- safeAreaInsetTop,
66
+ safeArea,
65
67
  sharedVariantProps
66
68
  ]),
67
69
  resolvedVariantProps,