@seed-design/lynx-react 0.2.0-alpha.2 → 0.2.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 (186) hide show
  1. package/lib/_virtual/_rolldown/runtime.js +13 -0
  2. package/lib/components/ActionButton/ActionButton.d.ts +26 -32
  3. package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
  4. package/lib/components/ActionButton/ActionButton.jsx +139 -120
  5. package/lib/components/ActionButton/index.d.ts +1 -1
  6. package/lib/components/AppBar/AppBar.d.ts +35 -0
  7. package/lib/components/AppBar/AppBar.d.ts.map +1 -0
  8. package/lib/components/AppBar/AppBar.jsx +132 -0
  9. package/lib/components/AppBar/AppBar.namespace.d.ts +2 -0
  10. package/lib/components/AppBar/AppBar.namespace.d.ts.map +1 -0
  11. package/lib/components/AppBar/AppBar.namespace.js +15 -0
  12. package/lib/components/AppBar/context.d.ts +13 -0
  13. package/lib/components/AppBar/context.d.ts.map +1 -0
  14. package/lib/components/AppBar/context.js +12 -0
  15. package/lib/components/AppBar/index.d.ts +3 -0
  16. package/lib/components/AppBar/index.d.ts.map +1 -0
  17. package/lib/components/AppBar/useAppBar.d.ts +15 -0
  18. package/lib/components/AppBar/useAppBar.d.ts.map +1 -0
  19. package/lib/components/AppBar/useAppBar.js +72 -0
  20. package/lib/components/Badge/Badge.d.ts +14 -0
  21. package/lib/components/Badge/Badge.d.ts.map +1 -0
  22. package/lib/components/Badge/Badge.jsx +15 -0
  23. package/lib/components/Badge/index.d.ts +2 -0
  24. package/lib/components/Badge/index.d.ts.map +1 -0
  25. package/lib/components/BottomSheet/BottomSheet.d.ts +22 -27
  26. package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
  27. package/lib/components/BottomSheet/BottomSheet.jsx +127 -142
  28. package/lib/components/BottomSheet/BottomSheet.namespace.d.ts +1 -1
  29. package/lib/components/BottomSheet/BottomSheet.namespace.js +18 -1
  30. package/lib/components/BottomSheet/index.d.ts +2 -2
  31. package/lib/components/Box/Box.d.ts +20 -0
  32. package/lib/components/Box/Box.d.ts.map +1 -0
  33. package/lib/components/Box/Box.jsx +14 -0
  34. package/lib/components/Box/index.d.ts +2 -0
  35. package/lib/components/Box/index.d.ts.map +1 -0
  36. package/lib/components/Checkbox/Checkbox.d.ts +14 -30
  37. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  38. package/lib/components/Checkbox/Checkbox.jsx +107 -98
  39. package/lib/components/Checkbox/Checkbox.namespace.d.ts +1 -1
  40. package/lib/components/Checkbox/Checkbox.namespace.js +12 -1
  41. package/lib/components/Checkbox/index.d.ts +2 -2
  42. package/lib/components/Icon/Icon.d.ts +37 -0
  43. package/lib/components/Icon/Icon.d.ts.map +1 -0
  44. package/lib/components/Icon/Icon.jsx +143 -0
  45. package/lib/components/Icon/index.d.ts +2 -0
  46. package/lib/components/Icon/index.d.ts.map +1 -0
  47. package/lib/components/ProgressCircle/ProgressCircle.d.ts +4 -8
  48. package/lib/components/ProgressCircle/ProgressCircle.d.ts.map +1 -1
  49. package/lib/components/ProgressCircle/ProgressCircle.jsx +255 -260
  50. package/lib/components/ProgressCircle/ProgressCircle.namespace.d.ts +1 -1
  51. package/lib/components/ProgressCircle/ProgressCircle.namespace.js +9 -1
  52. package/lib/components/ProgressCircle/index.d.ts +2 -2
  53. package/lib/components/RadioGroup/RadioGroup.d.ts +12 -28
  54. package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  55. package/lib/components/RadioGroup/RadioGroup.jsx +134 -118
  56. package/lib/components/RadioGroup/RadioGroup.namespace.d.ts +1 -1
  57. package/lib/components/RadioGroup/RadioGroup.namespace.js +12 -1
  58. package/lib/components/RadioGroup/index.d.ts +2 -2
  59. package/lib/components/Stack/Stack.d.ts +33 -0
  60. package/lib/components/Stack/Stack.d.ts.map +1 -0
  61. package/lib/components/Stack/Stack.jsx +39 -0
  62. package/lib/components/Stack/index.d.ts +2 -0
  63. package/lib/components/Stack/index.d.ts.map +1 -0
  64. package/lib/components/Switch/Switch.d.ts +8 -14
  65. package/lib/components/Switch/Switch.d.ts.map +1 -1
  66. package/lib/components/Switch/Switch.jsx +82 -56
  67. package/lib/components/Switch/Switch.namespace.d.ts +1 -1
  68. package/lib/components/Switch/Switch.namespace.js +11 -1
  69. package/lib/components/Switch/index.d.ts +2 -2
  70. package/lib/components/TagGroup/TagGroup.d.ts +8 -14
  71. package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
  72. package/lib/components/TagGroup/TagGroup.jsx +42 -39
  73. package/lib/components/TagGroup/TagGroup.namespace.d.ts +1 -1
  74. package/lib/components/TagGroup/TagGroup.namespace.js +10 -1
  75. package/lib/components/TagGroup/index.d.ts +2 -2
  76. package/lib/components/Text/Text.d.ts +7 -0
  77. package/lib/components/Text/Text.d.ts.map +1 -0
  78. package/lib/components/Text/Text.jsx +28 -0
  79. package/lib/components/Text/index.d.ts +2 -0
  80. package/lib/components/Text/index.d.ts.map +1 -0
  81. package/lib/components/index.d.ts +13 -7
  82. package/lib/components/index.d.ts.map +1 -1
  83. package/lib/hooks/index.d.ts +4 -3
  84. package/lib/hooks/index.d.ts.map +1 -1
  85. package/lib/hooks/{use-controllable-state.d.ts → useControllableState.d.ts} +1 -1
  86. package/lib/hooks/useControllableState.d.ts.map +1 -0
  87. package/lib/hooks/useControllableState.js +27 -0
  88. package/lib/hooks/useIconColor.d.ts +19 -0
  89. package/lib/hooks/useIconColor.d.ts.map +1 -0
  90. package/lib/hooks/useIconColor.js +38 -0
  91. package/lib/hooks/{use-press-tap.d.ts → usePressTap.d.ts} +12 -9
  92. package/lib/hooks/usePressTap.d.ts.map +1 -0
  93. package/lib/hooks/usePressTap.js +35 -0
  94. package/lib/hooks/useSafeArea.d.ts +19 -0
  95. package/lib/hooks/useSafeArea.d.ts.map +1 -0
  96. package/lib/hooks/useSafeArea.js +33 -0
  97. package/lib/index.d.ts +4 -3
  98. package/lib/index.d.ts.map +1 -1
  99. package/lib/index.js +29 -3
  100. package/lib/types.d.ts +51 -0
  101. package/lib/types.d.ts.map +1 -0
  102. package/lib/utils/children.d.ts +3 -0
  103. package/lib/utils/children.d.ts.map +1 -0
  104. package/lib/utils/children.js +8 -0
  105. package/lib/utils/create-slot-recipe-context.d.ts +13 -12
  106. package/lib/utils/create-slot-recipe-context.d.ts.map +1 -1
  107. package/lib/utils/create-slot-recipe-context.jsx +88 -70
  108. package/lib/utils/get-seed-class-name.d.ts +6 -7
  109. package/lib/utils/get-seed-class-name.d.ts.map +1 -1
  110. package/lib/utils/get-seed-class-name.js +26 -37
  111. package/lib/utils/index.d.ts +4 -4
  112. package/lib/utils/resolve-recipe-token.js +45 -43
  113. package/lib/utils/split-multiple-variants-props.js +32 -32
  114. package/lib/utils/styled.d.ts +83 -0
  115. package/lib/utils/styled.d.ts.map +1 -0
  116. package/lib/utils/styled.js +144 -0
  117. package/package.json +9 -9
  118. package/src/components/ActionButton/ActionButton.test.tsx +167 -0
  119. package/src/components/ActionButton/ActionButton.tsx +210 -168
  120. package/src/components/AppBar/AppBar.namespace.ts +18 -0
  121. package/src/components/AppBar/AppBar.test.tsx +270 -0
  122. package/src/components/AppBar/AppBar.tsx +288 -0
  123. package/src/components/AppBar/context.ts +27 -0
  124. package/src/components/AppBar/index.ts +21 -0
  125. package/src/components/AppBar/useAppBar.ts +100 -0
  126. package/src/components/Badge/Badge.test.tsx +54 -0
  127. package/src/components/Badge/Badge.tsx +32 -0
  128. package/src/components/Badge/index.ts +1 -0
  129. package/src/components/BottomSheet/BottomSheet.test.tsx +219 -0
  130. package/src/components/BottomSheet/BottomSheet.tsx +120 -83
  131. package/src/components/Box/Box.test.tsx +85 -0
  132. package/src/components/Box/Box.tsx +39 -0
  133. package/src/components/Box/index.ts +1 -0
  134. package/src/components/Checkbox/Checkbox.tsx +108 -117
  135. package/src/components/Icon/Icon.tsx +265 -0
  136. package/src/components/Icon/index.ts +8 -0
  137. package/src/components/ProgressCircle/ProgressCircle.tsx +39 -25
  138. package/src/components/RadioGroup/RadioGroup.tsx +100 -118
  139. package/src/components/Stack/Stack.tsx +97 -0
  140. package/src/components/Stack/index.ts +1 -0
  141. package/src/components/Switch/Switch.tsx +61 -52
  142. package/src/components/TagGroup/TagGroup.tsx +27 -25
  143. package/src/components/Text/Text.tsx +64 -0
  144. package/src/components/Text/index.ts +1 -0
  145. package/src/components/index.ts +6 -0
  146. package/src/hooks/index.ts +4 -3
  147. package/src/hooks/{__tests__/use-controllable-state.test.ts → useControllableState.test.ts} +1 -1
  148. package/src/hooks/useIconColor.test.ts +13 -0
  149. package/src/hooks/useIconColor.ts +67 -0
  150. package/src/hooks/{__tests__/use-press-tap.test.ts → usePressTap.test.ts} +1 -1
  151. package/src/hooks/{use-press-tap.ts → usePressTap.ts} +14 -10
  152. package/src/hooks/useSafeArea.test.ts +83 -0
  153. package/src/hooks/useSafeArea.ts +56 -0
  154. package/src/index.ts +1 -0
  155. package/src/types.ts +76 -0
  156. package/src/utils/children.ts +13 -0
  157. package/src/utils/create-slot-recipe-context.test.tsx +96 -0
  158. package/src/utils/create-slot-recipe-context.tsx +55 -15
  159. package/src/utils/get-seed-class-name.ts +7 -12
  160. package/src/utils/{__tests__/split-multiple-variants-props.test.ts → split-multiple-variants-props.test.ts} +1 -1
  161. package/src/utils/styled.ts +442 -0
  162. package/lib/components/ActionButton/index.js +0 -1
  163. package/lib/components/BottomSheet/index.js +0 -2
  164. package/lib/components/Checkbox/index.js +0 -2
  165. package/lib/components/ProgressCircle/index.js +0 -2
  166. package/lib/components/RadioGroup/index.js +0 -2
  167. package/lib/components/Switch/index.js +0 -2
  168. package/lib/components/TagGroup/index.js +0 -2
  169. package/lib/components/index.js +0 -7
  170. package/lib/hooks/index.js +0 -3
  171. package/lib/hooks/use-controllable-state.d.ts.map +0 -1
  172. package/lib/hooks/use-controllable-state.js +0 -27
  173. package/lib/hooks/use-icon-color.d.ts +0 -15
  174. package/lib/hooks/use-icon-color.d.ts.map +0 -1
  175. package/lib/hooks/use-icon-color.js +0 -37
  176. package/lib/hooks/use-press-tap.d.ts.map +0 -1
  177. package/lib/hooks/use-press-tap.js +0 -35
  178. package/lib/utils/index.js +0 -4
  179. package/src/components/ActionButton/__tests__/ActionButton.test.tsx +0 -35
  180. package/src/components/BottomSheet/__tests__/BottomSheet.test.tsx +0 -119
  181. package/src/components/__tests__/ProgressCircle.test.ts +0 -33
  182. package/src/components/__tests__/exports.test.ts +0 -38
  183. package/src/components/__tests__/switch.test.ts +0 -34
  184. package/src/hooks/use-icon-color.ts +0 -51
  185. package/src/utils/__tests__/create-slot-recipe-context.test.tsx +0 -228
  186. /package/src/hooks/{use-controllable-state.ts → useControllableState.ts} +0 -0
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll };
@@ -1,54 +1,48 @@
1
- import type { ActionButtonVariantProps } from "@seed-design/lynx-css/recipes/action-button";
2
- import type { MainThread } from "@lynx-js/types";
3
- import * as React from "react";
4
- import { type ReactElement } from "react";
5
- type IconElementProps = {
6
- className?: string;
7
- style?: React.CSSProperties;
8
- ref?: React.Ref<MainThread.Element>;
9
- };
1
+ import { ActionButtonVariantProps } from '@seed-design/lynx-css/recipes/action-button';
2
+ import { LynxElementProps, LynxPressableProps, LynxViewProps } from '../../types';
3
+ import { StyleProps } from '../../utils/styled';
4
+ import { IconProps, PrefixIconProps, SuffixIconProps } from '../Icon/Icon';
5
+ import * as React from "@lynx-js/react";
6
+ interface ActionButtonAccessibilityProps {
7
+ "accessibility-label"?: LynxViewProps["accessibility-label"];
8
+ "accessibility-element"?: LynxViewProps["accessibility-element"];
9
+ "accessibility-traits"?: LynxViewProps["accessibility-traits"];
10
+ }
10
11
  /**
11
12
  * @platform Lynx
12
13
  *
13
14
  * 웹 대비 차이:
14
- * - 아이콘 전달 방식: 웹의 `<ActionButton.PrefixIcon svg={...} />` 가 아니라 `prefixIcon` /
15
- * `suffixIcon` / `icon` prop 으로 ReactElement 를 직접 넘긴다. Lynx `<text>` 가 flex
16
- * 컨테이너가 아니라 children 전체를 text 로 감싸면 아이콘이 flex item 이 안 되기 때문.
15
+ * - 아이콘 렌더링: 웹의 SVG `currentColor` 대신 Lynx `<image>` 의 `tint-color` 를
16
+ * `Icon` / `PrefixIcon` / `SuffixIcon` wrapper 가 동기화한다.
17
+ * - 호환 API: 기존 `prefixIcon` / `suffixIcon` / `icon` prop 도 유지한다.
17
18
  * - 미지원 prop: `color`, `fontWeight`, `bleedX`, `bleedY` (CSS variable 동적 주입 제한)
18
19
  *
19
20
  * ```tsx
20
21
  * import IconPlusFill from "@karrotmarket/lynx-monochrome-icon/IconPlusFill";
21
22
  * import IconChevronDownFill from "@karrotmarket/lynx-monochrome-icon/IconChevronDownFill";
23
+ * import { Icon, PrefixIcon, SuffixIcon } from "@seed-design/lynx-react";
22
24
  *
23
25
  * // withText (기본)
24
- * <ActionButton
25
- * variant="brandSolid"
26
- * prefixIcon={<IconPlusFill />}
27
- * suffixIcon={<IconChevronDownFill />}
28
- * >
26
+ * <ActionButton variant="brandSolid">
27
+ * <PrefixIcon icon={<IconPlusFill />} />
29
28
  * 라벨
29
+ * <SuffixIcon icon={<IconChevronDownFill />} />
30
30
  * </ActionButton>
31
31
  *
32
- * // iconOnly — `icon` prop 과 `aria-label` 필수
32
+ * // iconOnly — `<Icon />` child 와 `accessibility-label` 필수
33
33
  * <ActionButton
34
34
  * layout="iconOnly"
35
35
  * variant="neutralSolid"
36
- * icon={<IconPlusFill />}
37
- * aria-label="추가"
38
- * />
36
+ * accessibility-label="추가"
37
+ * >
38
+ * <Icon icon={<IconPlusFill />} />
39
+ * </ActionButton>
39
40
  * ```
40
41
  */
41
- export interface ActionButtonProps extends Omit<ActionButtonVariantProps, "layout" | "pressed"> {
42
- children?: React.ReactNode;
43
- className?: string;
44
- flexGrow?: number;
45
- layout?: "withText" | "iconOnly";
46
- icon?: ReactElement<IconElementProps>;
47
- prefixIcon?: ReactElement<IconElementProps>;
48
- suffixIcon?: ReactElement<IconElementProps>;
49
- "aria-label"?: string;
50
- bindtap?: () => void;
51
- "main-thread:bindtap"?: () => void;
42
+ export interface ActionButtonProps extends Omit<ActionButtonVariantProps, "pressed">, Pick<StyleProps, "flexGrow">, LynxElementProps, LynxPressableProps, ActionButtonAccessibilityProps {
43
+ icon?: IconProps["icon"];
44
+ prefixIcon?: PrefixIconProps["icon"];
45
+ suffixIcon?: SuffixIconProps["icon"];
52
46
  }
53
47
  export declare const ActionButton: React.ForwardRefExoticComponent<ActionButtonProps & React.RefAttributes<unknown>>;
54
48
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAE5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAyC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAsBjF,KAAK,gBAAgB,GAAG;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;CACrC,CAAC;AAuLF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,wBAAwB,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC7F,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACjC,IAAI,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACtC,UAAU,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC5C,UAAU,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,YAAY,mFA4DvB,CAAC"}
1
+ {"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAI5F,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AAIxC,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAIlB,aAAa,EAEd,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAMvE,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,cAAc,CAAC;AAiBtB,UAAU,8BAA8B;IACtC,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;AA0LD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,wBAAwB,EAAE,SAAS,CAAC,EAC/C,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,EAC5B,gBAAgB,EAChB,kBAAkB,EAClB,8BAA8B;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,UAAU,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IACrC,UAAU,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;CACtC;AAED,eAAO,MAAM,YAAY,mFA2EvB,CAAC"}
@@ -1,139 +1,158 @@
1
+ import { usePressTap } from "../../hooks/usePressTap.js";
2
+ import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
3
+ import { toArray } from "../../utils/children.js";
4
+ import { capitalize, resolveRecipeToken } from "../../utils/resolve-recipe-token.js";
5
+ import { resolveFlexValue } from "../../utils/styled.js";
6
+ import { ProgressCircleRange, ProgressCircleRoot } from "../ProgressCircle/ProgressCircle.jsx";
7
+ import { Icon, IconRequired, IconSlotProvider, PrefixIcon, SuffixIcon, getIconSlotName } from "../Icon/Icon.jsx";
1
8
  import { actionButton } from "@seed-design/lynx-css/recipes/action-button";
2
- import { actionButton as actionButtonVars } from "@seed-design/lynx-css/vars/component";
9
+ import { progressCircleVariantMap } from "@seed-design/lynx-css/recipes/progress-circle";
10
+ import { actionButton as actionButton$1 } from "@seed-design/lynx-css/vars/component";
3
11
  import clsx from "clsx";
4
- import * as React from "react";
5
- import { cloneElement, isValidElement, useMemo } from "react";
6
- import { useIconColor } from "../../hooks/use-icon-color";
7
- import { usePressTap } from "../../hooks/use-press-tap";
8
- import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context";
9
- import { capitalize, resolveRecipeToken } from "../../utils/resolve-recipe-token";
10
- import { ProgressCircleRange, ProgressCircleRoot, } from "../ProgressCircle";
11
- // Root/TextSlot 은 `withProvider("view", ...)` / `withContext("text", ...)` 를 쓰지 않는다.
12
- // intrinsic string 인자는 `React.createElement("view", ...)` 로 컴파일되어 Lynx 컴파일러의
13
- // 리터럴 JSX 정적 분석을 우회하고 `BackgroundSnapshot not found: view` 런타임 에러를 유발한다.
14
- // (자세한 내용: `packages/lynx-react/AGENTS.md` 의 "Native tag literal JSX constraint" 섹션)
15
- const { ClassNamesProvider, useClassNames, PropsProvider, useProps } = createSlotRecipeContext(actionButton);
16
- const progressCircleSizeMap = {
17
- xsmall: "14",
18
- small: "14",
19
- medium: "16",
20
- large: "18",
21
- };
22
- const ActionButtonRoot = React.forwardRef((innerProps, ref) => {
23
- const props = { layout: "withText", ...innerProps };
24
- const [variantProps, otherProps] = actionButton.splitVariantProps(props);
25
- const classNames = actionButton(variantProps);
26
- const { className: userClassName, children, ...rest } = otherProps;
27
- const propsForContext = useMemo(() => variantProps, [
28
- variantProps.variant,
29
- variantProps.size,
30
- variantProps.layout,
31
- variantProps.pressed,
32
- variantProps.disabled,
33
- variantProps.loading,
34
- ]);
35
- return (<ClassNamesProvider value={classNames}>
12
+ import * as React from "@lynx-js/react";
13
+ import { isValidElement, useMemo } from "@lynx-js/react";
14
+ //#region src/components/ActionButton/ActionButton.tsx
15
+ var { ClassNamesProvider, useClassNames, PropsProvider } = createSlotRecipeContext(actionButton);
16
+ function resolveProgressCircleSize(actionButtonSize) {
17
+ const token = resolveRecipeToken(actionButton$1, [
18
+ `size${capitalize(actionButtonSize ?? "medium")}`,
19
+ "enabled",
20
+ "progressCircle",
21
+ "size"
22
+ ]);
23
+ const normalized = token?.endsWith("px") ? token.slice(0, -2) : token;
24
+ return progressCircleVariantMap.size.find((size) => size === normalized) ?? "16";
25
+ }
26
+ var ActionButtonRoot = React.forwardRef((innerProps, ref) => {
27
+ const props = {
28
+ layout: "withText",
29
+ ...innerProps
30
+ };
31
+ const [variantProps, otherProps] = actionButton.splitVariantProps(props);
32
+ const classNames = actionButton(variantProps);
33
+ const { className: userClassName, children, ...rest } = otherProps;
34
+ const propsForContext = useMemo(() => variantProps, [
35
+ variantProps.variant,
36
+ variantProps.size,
37
+ variantProps.layout,
38
+ variantProps.pressed,
39
+ variantProps.disabled,
40
+ variantProps.loading
41
+ ]);
42
+ const iconSlotContextValue = useMemo(() => ({
43
+ classNames: {
44
+ icon: classNames.icon,
45
+ prefixIcon: classNames.prefixIcon,
46
+ suffixIcon: classNames.suffixIcon
47
+ },
48
+ deps: [
49
+ variantProps.variant ?? null,
50
+ variantProps.disabled ?? false,
51
+ variantProps.loading ?? false,
52
+ variantProps.pressed ?? false
53
+ ]
54
+ }), [
55
+ classNames.icon,
56
+ classNames.prefixIcon,
57
+ classNames.suffixIcon,
58
+ variantProps.variant,
59
+ variantProps.disabled,
60
+ variantProps.loading,
61
+ variantProps.pressed
62
+ ]);
63
+ return <ClassNamesProvider value={classNames}>
36
64
  <PropsProvider value={propsForContext}>
37
- <view {...(ref ? { ref: ref } : {})} {...rest} className={clsx(classNames.root, userClassName)}>
38
- {children}
39
- </view>
65
+ <IconSlotProvider value={iconSlotContextValue}>
66
+ <view {...ref ? { ref } : {}} {...rest} className={clsx(classNames.root, userClassName)}>
67
+ {children}
68
+ </view>
69
+ </IconSlotProvider>
40
70
  </PropsProvider>
41
- </ClassNamesProvider>);
71
+ </ClassNamesProvider>;
42
72
  });
43
73
  ActionButtonRoot.displayName = "ActionButtonRoot";
44
- const ActionButtonTextSlot = React.forwardRef((props, ref) => {
45
- const { children, className: userClassName, ...rest } = props;
46
- const classNames = useClassNames();
47
- return (<text {...(ref ? { ref: ref } : {})} {...rest} className={clsx(classNames.text, userClassName)}>
74
+ var ActionButtonTextSlot = React.forwardRef((props, ref) => {
75
+ const { children, className: userClassName, ...rest } = props;
76
+ const classNames = useClassNames();
77
+ return <text {...ref ? { ref } : {}} {...rest} className={clsx(classNames.text, userClassName)}>
48
78
  {children}
49
- </text>);
79
+ </text>;
50
80
  });
51
81
  ActionButtonTextSlot.displayName = "ActionButtonTextSlot";
52
- /**
53
- * rootage vars 에서 현재 variant/size/layout 조합의 slot `size` 토큰
54
- * (예: `"var(--seed-dimension-x4)"`) 을 꺼낸다. 아이콘 컴포넌트가 inline
55
- * `style={{ width, height }}` 를 박기 때문에 style prop 으로 덮어 씌워야 recipe 사이즈가 적용된다.
56
- */
57
- function resolveIconSize(variantProps, slot) {
58
- const size = variantProps?.size ?? "medium";
59
- // `icon` slot is only rendered under `layout="iconOnly"` and keyed at
60
- // `sizeXxxLayoutIconOnly.enabled.icon.size`. prefixIcon/suffixIcon follow
61
- // the current `layout` (`withText` by default) path.
62
- const layout = slot === "icon" ? "iconOnly" : (variantProps?.layout ?? "withText");
63
- return resolveRecipeToken(actionButtonVars, [
64
- `size${capitalize(size)}Layout${capitalize(layout)}`,
65
- "enabled",
66
- slot,
67
- "size",
68
- ]);
69
- }
70
- /**
71
- * `prefixIcon` / `suffixIcon` prop 으로 전달된 아이콘 element 에 slot className +
72
- * size(style) + main-thread tint-color ref 를 주입한다.
73
- */
74
- function ActionButtonIconSlot({ icon, slot, }) {
75
- const classNames = useClassNames();
76
- const variantProps = useProps();
77
- const { ref } = useIconColor([
78
- variantProps?.variant ?? null,
79
- variantProps?.disabled ?? false,
80
- variantProps?.loading ?? false,
81
- ]);
82
- const sizeVar = resolveIconSize(variantProps, slot);
83
- const childProps = icon.props;
84
- return cloneElement(icon, {
85
- className: clsx(classNames[slot], childProps.className),
86
- style: sizeVar != null ? { width: sizeVar, height: sizeVar, ...childProps.style } : childProps.style,
87
- ref: ref,
88
- });
89
- }
90
- function ActionButtonContent({ children, isIconOnly, icon, prefixIcon, suffixIcon, }) {
91
- if (isIconOnly) {
92
- return icon != null && isValidElement(icon) ? (<ActionButtonIconSlot icon={icon} slot="icon"/>) : null;
93
- }
94
- return (<>
95
- {prefixIcon != null && isValidElement(prefixIcon) ? (<ActionButtonIconSlot icon={prefixIcon} slot="prefixIcon"/>) : null}
96
- <ActionButtonTextSlot>{children}</ActionButtonTextSlot>
97
- {suffixIcon != null && isValidElement(suffixIcon) ? (<ActionButtonIconSlot icon={suffixIcon} slot="suffixIcon"/>) : null}
98
- </>);
82
+ function ActionButtonContent({ children, isIconOnly, icon, prefixIcon, suffixIcon }) {
83
+ const childArray = toArray(children);
84
+ const prefixIconChildren = [];
85
+ const suffixIconChildren = [];
86
+ const iconChildren = [];
87
+ const textChildren = [];
88
+ for (const child of childArray) {
89
+ const slotName = getIconSlotName(child);
90
+ if (slotName === "prefixIcon") {
91
+ prefixIconChildren.push(child);
92
+ continue;
93
+ }
94
+ if (slotName === "suffixIcon") {
95
+ suffixIconChildren.push(child);
96
+ continue;
97
+ }
98
+ if (slotName === "icon") {
99
+ iconChildren.push(child);
100
+ continue;
101
+ }
102
+ textChildren.push(child);
103
+ }
104
+ if (isIconOnly) {
105
+ if (icon != null && isValidElement(icon)) return <Icon icon={icon} />;
106
+ return iconChildren.length > 0 ? <>{iconChildren}</> : null;
107
+ }
108
+ return <>
109
+ {prefixIcon != null && isValidElement(prefixIcon) ? <PrefixIcon icon={prefixIcon} /> : null}
110
+ {prefixIconChildren}
111
+ {textChildren.length > 0 ? <ActionButtonTextSlot>{textChildren}</ActionButtonTextSlot> : null}
112
+ {suffixIconChildren}
113
+ {suffixIcon != null && isValidElement(suffixIcon) ? <SuffixIcon icon={suffixIcon} /> : null}
114
+ </>;
99
115
  }
100
116
  function ActionButtonLoadingContent(props) {
101
- const classNames = useClassNames();
102
- return (<view className={classNames.content}>
103
- <ActionButtonContent {...props}/>
104
- </view>);
117
+ const classNames = useClassNames();
118
+ return <view className={classNames.content}>
119
+ <ActionButtonContent {...props} />
120
+ </view>;
105
121
  }
106
122
  function ActionButtonLoadingIndicator({ size }) {
107
- const classNames = useClassNames();
108
- return (<view className={classNames.loadingIndicator}>
109
- <ProgressCircleRoot size={progressCircleSizeMap[size]} tone="inherit">
123
+ const classNames = useClassNames();
124
+ const progressCircleSize = resolveProgressCircleSize(size);
125
+ return <view className={classNames.loadingIndicator}>
126
+ <ProgressCircleRoot size={progressCircleSize} tone="inherit">
110
127
  <ProgressCircleRange />
111
128
  </ProgressCircleRoot>
112
- </view>);
129
+ </view>;
113
130
  }
114
- export const ActionButton = React.forwardRef((props, ref) => {
115
- const { children, flexGrow, layout, icon, prefixIcon, suffixIcon, bindtap, "main-thread:bindtap": mainThreadBindtap, ...variantAndRest } = props;
116
- const { disabled = false, loading = false } = variantAndRest;
117
- const isInteractive = !disabled && !loading;
118
- const isIconOnly = layout === "iconOnly";
119
- const size = variantAndRest.size ?? "medium";
120
- if (process.env.NODE_ENV !== "production" && isIconOnly && !props["aria-label"]) {
121
- console.warn('ActionButton: `layout="iconOnly"` requires `aria-label` for accessibility.');
122
- }
123
- const { pressed, ...pressTapHandlers } = usePressTap({
124
- disabled: !isInteractive,
125
- onTap: bindtap,
126
- mainThreadOnTap: mainThreadBindtap,
127
- });
128
- return (<ActionButtonRoot {...variantAndRest} layout={layout} pressed={pressed} ref={ref} style={flexGrow != null ? { flexGrow } : undefined} {...pressTapHandlers}>
129
- {loading ? (<>
130
- <ActionButtonLoadingIndicator size={size}/>
131
- <ActionButtonLoadingContent isIconOnly={isIconOnly} icon={icon} prefixIcon={prefixIcon} suffixIcon={suffixIcon}>
131
+ var ActionButton = React.forwardRef((props, ref) => {
132
+ const { children, flexGrow, layout, icon, prefixIcon, suffixIcon, bindtap, "main-thread:bindtap": mainThreadBindtap, "accessibility-element": accessibilityElement = true, "accessibility-label": accessibilityLabel, "accessibility-traits": accessibilityTraits = "button", ...variantAndRest } = props;
133
+ const { disabled = false, loading = false } = variantAndRest;
134
+ const isInteractive = !disabled && !loading;
135
+ const isIconOnly = layout === "iconOnly";
136
+ const size = variantAndRest.size;
137
+ if (process.env.NODE_ENV !== "production" && isIconOnly && accessibilityElement && !accessibilityLabel) console.warn("ActionButton: `layout=\"iconOnly\"` requires `accessibility-label` for accessibility.");
138
+ const { pressed, ...pressTapHandlers } = usePressTap({
139
+ disabled: !isInteractive,
140
+ onTap: bindtap,
141
+ mainThreadOnTap: mainThreadBindtap
142
+ });
143
+ return <IconRequired enabled={isIconOnly}>
144
+ <ActionButtonRoot {...variantAndRest} layout={layout} pressed={pressed} ref={ref} style={flexGrow != null ? { flexGrow: resolveFlexValue(flexGrow) } : void 0} accessibility-element={accessibilityElement} accessibility-label={accessibilityLabel} accessibility-traits={accessibilityTraits} {...pressTapHandlers}>
145
+ {loading ? <>
146
+ <ActionButtonLoadingIndicator size={size} />
147
+ <ActionButtonLoadingContent isIconOnly={isIconOnly} icon={icon} prefixIcon={prefixIcon} suffixIcon={suffixIcon}>
148
+ {children}
149
+ </ActionButtonLoadingContent>
150
+ </> : <ActionButtonContent isIconOnly={isIconOnly} icon={icon} prefixIcon={prefixIcon} suffixIcon={suffixIcon}>
132
151
  {children}
133
- </ActionButtonLoadingContent>
134
- </>) : (<ActionButtonContent isIconOnly={isIconOnly} icon={icon} prefixIcon={prefixIcon} suffixIcon={suffixIcon}>
135
- {children}
136
- </ActionButtonContent>)}
137
- </ActionButtonRoot>);
152
+ </ActionButtonContent>}
153
+ </ActionButtonRoot>
154
+ </IconRequired>;
138
155
  });
139
156
  ActionButton.displayName = "ActionButton";
157
+ //#endregion
158
+ export { ActionButton };
@@ -1,2 +1,2 @@
1
- export { ActionButton, type ActionButtonProps } from "./ActionButton";
1
+ export { ActionButton, type ActionButtonProps } from './ActionButton';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,35 @@
1
+ import { AppBarVariantProps } from '@seed-design/lynx-css/recipes/app-bar';
2
+ import { AppBarMainVariantProps } from '@seed-design/lynx-css/recipes/app-bar-main';
3
+ import { LynxElementProps, LynxIconElementProps, LynxPressableProps, LynxStyledElementProps, LynxViewProps } from '../../types';
4
+ import * as React from "@lynx-js/react";
5
+ export interface AppBarRootProps extends AppBarVariantProps, LynxStyledElementProps {
6
+ }
7
+ export declare const AppBarRoot: React.ForwardRefExoticComponent<AppBarRootProps & React.RefAttributes<unknown>>;
8
+ export interface AppBarLeftProps extends LynxStyledElementProps {
9
+ bindlayoutchange?: LynxViewProps["bindlayoutchange"];
10
+ }
11
+ export declare const AppBarLeft: React.ForwardRefExoticComponent<AppBarLeftProps & React.RefAttributes<unknown>>;
12
+ export interface AppBarRightProps extends LynxStyledElementProps {
13
+ bindlayoutchange?: LynxViewProps["bindlayoutchange"];
14
+ }
15
+ export declare const AppBarRight: React.ForwardRefExoticComponent<AppBarRightProps & React.RefAttributes<unknown>>;
16
+ export interface AppBarMainProps extends AppBarMainVariantProps, LynxStyledElementProps {
17
+ }
18
+ export declare const AppBarMain: React.ForwardRefExoticComponent<AppBarMainProps & React.RefAttributes<unknown>>;
19
+ export interface AppBarTitleProps extends LynxElementProps {
20
+ }
21
+ export declare const AppBarTitle: React.ForwardRefExoticComponent<AppBarTitleProps & React.RefAttributes<unknown>>;
22
+ export interface AppBarSubtitleProps extends LynxElementProps {
23
+ }
24
+ export declare const AppBarSubtitle: React.ForwardRefExoticComponent<AppBarSubtitleProps & React.RefAttributes<unknown>>;
25
+ export interface AppBarIconButtonProps extends LynxElementProps, LynxPressableProps {
26
+ icon?: React.ReactElement<LynxIconElementProps>;
27
+ "accessibility-label"?: LynxViewProps["accessibility-label"];
28
+ "accessibility-element"?: LynxViewProps["accessibility-element"];
29
+ "accessibility-traits"?: LynxViewProps["accessibility-traits"];
30
+ }
31
+ export declare const AppBarIconButton: React.ForwardRefExoticComponent<AppBarIconButtonProps & React.RefAttributes<unknown>>;
32
+ export interface AppBarSlotProps extends LynxStyledElementProps {
33
+ }
34
+ export declare const AppBarSlot: React.ForwardRefExoticComponent<AppBarSlotProps & React.RefAttributes<unknown>>;
35
+ //# sourceMappingURL=AppBar.d.ts.map
@@ -0,0 +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;AAmCrB,MAAM,WAAW,eAAgB,SAAQ,kBAAkB,EAAE,sBAAsB;CAAG;AAEtF,eAAO,MAAM,UAAU,iFA4BrB,CAAC;AAKH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;IAC7D,gBAAgB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,UAAU,iFA0BrB,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;IAC9D,gBAAgB,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,WAAW,kFA0BtB,CAAC;AAKH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB,EAAE,sBAAsB;CAAG;AAE1F,eAAO,MAAM,UAAU,iFAoCrB,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;CAAG;AAE7D,eAAO,MAAM,WAAW,kFAatB,CAAC;AAGH,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;CAAG;AAEhE,eAAO,MAAM,cAAc,qFAazB,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,uFA4B3B,CAAC;AAGH,MAAM,WAAW,eAAgB,SAAQ,sBAAsB;CAAG;AAElE,eAAO,MAAM,UAAU,iFAarB,CAAC"}
@@ -0,0 +1,132 @@
1
+ import { createSlotRecipeContext } from "../../utils/create-slot-recipe-context.jsx";
2
+ import { Icon } from "../Icon/Icon.jsx";
3
+ import { AppBarProvider, useAppBarContext } from "./context.js";
4
+ import { getLayoutWidth, getMainLayoutStyle, useAppBar } from "./useAppBar.js";
5
+ import clsx from "clsx";
6
+ import * as React from "@lynx-js/react";
7
+ import { appBar } from "@seed-design/lynx-css/recipes/app-bar";
8
+ import { appBarMain } from "@seed-design/lynx-css/recipes/app-bar-main";
9
+ //#region src/components/AppBar/AppBar.tsx
10
+ var { ClassNamesProvider: AppBarClassNamesProvider, useClassNames: useAppBarRecipeClassNames } = createSlotRecipeContext(appBar);
11
+ var { ClassNamesProvider: AppBarMainClassNamesProvider, useClassNames: useAppBarMainRecipeClassNames } = createSlotRecipeContext(appBarMain);
12
+ function useAppBarClassNames(consumer) {
13
+ try {
14
+ return useAppBarRecipeClassNames();
15
+ } catch {
16
+ throw new Error(`<${consumer}/> must be rendered inside <AppBarRoot/>.`);
17
+ }
18
+ }
19
+ function useAppBarMainClassNames(consumer) {
20
+ try {
21
+ return useAppBarMainRecipeClassNames();
22
+ } catch {
23
+ throw new Error(`<${consumer}/> must be rendered inside <AppBarMain/>.`);
24
+ }
25
+ }
26
+ var AppBarRoot = React.forwardRef((props, ref) => {
27
+ const [variantProps, otherProps] = appBar.splitVariantProps(props);
28
+ const { children, className, style, ...nativeProps } = otherProps;
29
+ const { contextValue, resolvedVariantProps, rootLayoutStyle } = useAppBar(variantProps);
30
+ const classNames = appBar(resolvedVariantProps);
31
+ return <AppBarProvider value={contextValue}>
32
+ <AppBarClassNamesProvider value={classNames}>
33
+ <view {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.root, className)} style={{
34
+ "--seed-safe-area-top": contextValue.safeAreaInsetTop,
35
+ "--centered-title-padding-x": contextValue.centeredTitlePaddingX,
36
+ ...rootLayoutStyle,
37
+ ...style
38
+ }}>
39
+ <view accessibility-elements-hidden className={classNames.background} />
40
+ {children}
41
+ </view>
42
+ </AppBarClassNamesProvider>
43
+ </AppBarProvider>;
44
+ });
45
+ AppBarRoot.displayName = "AppBarRoot";
46
+ var AppBarLeft = React.forwardRef((props, ref) => {
47
+ const { children, className, bindlayoutchange, ...nativeProps } = props;
48
+ const { setLeftWidth } = useAppBarContext("AppBarLeft");
49
+ const classNames = useAppBarClassNames("AppBarLeft");
50
+ const handleLayoutChange = React.useCallback((...args) => {
51
+ bindlayoutchange?.(...args);
52
+ const width = getLayoutWidth(args[0]);
53
+ if (width != null) setLeftWidth(width);
54
+ }, [bindlayoutchange, setLeftWidth]);
55
+ return <view {...ref ? { ref } : {}} {...nativeProps} bindlayoutchange={handleLayoutChange} className={clsx(classNames.left, className)}>
56
+ {children}
57
+ </view>;
58
+ });
59
+ AppBarLeft.displayName = "AppBarLeft";
60
+ var AppBarRight = React.forwardRef((props, ref) => {
61
+ const { children, className, bindlayoutchange, ...nativeProps } = props;
62
+ const { setRightWidth } = useAppBarContext("AppBarRight");
63
+ const classNames = useAppBarClassNames("AppBarRight");
64
+ const handleLayoutChange = React.useCallback((...args) => {
65
+ bindlayoutchange?.(...args);
66
+ const width = getLayoutWidth(args[0]);
67
+ if (width != null) setRightWidth(width);
68
+ }, [bindlayoutchange, setRightWidth]);
69
+ return <view {...ref ? { ref } : {}} {...nativeProps} bindlayoutchange={handleLayoutChange} className={clsx(classNames.right, className)}>
70
+ {children}
71
+ </view>;
72
+ });
73
+ AppBarRight.displayName = "AppBarRight";
74
+ var AppBarMain = React.forwardRef((props, ref) => {
75
+ const { centeredTitlePaddingX, safeAreaInsetTop, sharedVariantProps } = useAppBarContext("AppBarMain");
76
+ const [variantProps, otherProps] = appBarMain.splitVariantProps({
77
+ ...sharedVariantProps,
78
+ ...props
79
+ });
80
+ const resolvedTheme = variantProps.theme ?? "cupertino";
81
+ const classNames = appBarMain(variantProps);
82
+ const { children, className, style, ...nativeProps } = otherProps;
83
+ const centeredTitleStyle = variantProps.theme === "cupertino" ? {
84
+ paddingLeft: centeredTitlePaddingX,
85
+ paddingRight: centeredTitlePaddingX
86
+ } : void 0;
87
+ return <AppBarMainClassNamesProvider value={classNames}>
88
+ <view {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.root, className)} style={{
89
+ ...centeredTitleStyle,
90
+ ...getMainLayoutStyle(resolvedTheme, safeAreaInsetTop),
91
+ ...style
92
+ }}>
93
+ {children}
94
+ </view>
95
+ </AppBarMainClassNamesProvider>;
96
+ });
97
+ AppBarMain.displayName = "AppBarMain";
98
+ var AppBarTitle = React.forwardRef((props, ref) => {
99
+ const { children, className, ...nativeProps } = props;
100
+ const classNames = useAppBarMainClassNames("AppBarTitle");
101
+ return <text {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.title, className)}>
102
+ {children}
103
+ </text>;
104
+ });
105
+ AppBarTitle.displayName = "AppBarTitle";
106
+ var AppBarSubtitle = React.forwardRef((props, ref) => {
107
+ const { children, className, ...nativeProps } = props;
108
+ const classNames = useAppBarMainClassNames("AppBarSubtitle");
109
+ return <text {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.subtitle, className)}>
110
+ {children}
111
+ </text>;
112
+ });
113
+ AppBarSubtitle.displayName = "AppBarSubtitle";
114
+ var AppBarIconButton = React.forwardRef((props, ref) => {
115
+ const { children, className, icon, "accessibility-element": accessibilityElement = true, "accessibility-label": accessibilityLabel, "accessibility-traits": accessibilityTraits = "button", ...nativeProps } = props;
116
+ const classNames = useAppBarClassNames("AppBarIconButton");
117
+ if (process.env.NODE_ENV !== "production" && accessibilityElement && !accessibilityLabel) console.warn("AppBarIconButton requires `accessibility-label` for accessibility.");
118
+ return <view {...ref ? { ref } : {}} {...nativeProps} accessibility-element={accessibilityElement} accessibility-label={accessibilityLabel} accessibility-traits={accessibilityTraits} className={clsx(classNames.iconButton, className)}>
119
+ {icon ? <Icon className={classNames.icon} icon={icon} /> : children}
120
+ </view>;
121
+ });
122
+ AppBarIconButton.displayName = "AppBarIconButton";
123
+ var AppBarSlot = React.forwardRef((props, ref) => {
124
+ const { children, className, ...nativeProps } = props;
125
+ const classNames = useAppBarClassNames("AppBarSlot");
126
+ return <view {...ref ? { ref } : {}} {...nativeProps} className={clsx(classNames.custom, className)}>
127
+ {children}
128
+ </view>;
129
+ });
130
+ AppBarSlot.displayName = "AppBarSlot";
131
+ //#endregion
132
+ export { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle };
@@ -0,0 +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';
2
+ //# sourceMappingURL=AppBar.namespace.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,15 @@
1
+ import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
2
+ import { AppBarIconButton, AppBarLeft, AppBarMain, AppBarRight, AppBarRoot, AppBarSlot, AppBarSubtitle, AppBarTitle } from "./AppBar.jsx";
3
+ //#region src/components/AppBar/AppBar.namespace.ts
4
+ var AppBar_namespace_exports = /* @__PURE__ */ __exportAll({
5
+ IconButton: () => AppBarIconButton,
6
+ Left: () => AppBarLeft,
7
+ Main: () => AppBarMain,
8
+ Right: () => AppBarRight,
9
+ Root: () => AppBarRoot,
10
+ Slot: () => AppBarSlot,
11
+ Subtitle: () => AppBarSubtitle,
12
+ Title: () => AppBarTitle
13
+ });
14
+ //#endregion
15
+ export { AppBar_namespace_exports };
@@ -0,0 +1,13 @@
1
+ import { AppBarMainVariantProps } from '@seed-design/lynx-css/recipes/app-bar-main';
2
+ import * as React from "@lynx-js/react";
3
+ export type SharedAppBarVariantProps = Pick<AppBarMainVariantProps, "theme" | "tone" | "transitionStyle">;
4
+ export interface AppBarContextValue {
5
+ centeredTitlePaddingX: string;
6
+ safeAreaInsetTop: string;
7
+ sharedVariantProps: SharedAppBarVariantProps;
8
+ setLeftWidth: (width: number) => void;
9
+ setRightWidth: (width: number) => void;
10
+ }
11
+ export declare const AppBarProvider: React.Provider<AppBarContextValue | null>;
12
+ export declare function useAppBarContext(consumer: string): AppBarContextValue;
13
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,12 @@
1
+ import * as React from "@lynx-js/react";
2
+ import "@seed-design/lynx-css/recipes/app-bar-main";
3
+ //#region src/components/AppBar/context.ts
4
+ var AppBarContext = React.createContext(null);
5
+ var AppBarProvider = AppBarContext.Provider;
6
+ function useAppBarContext(consumer) {
7
+ const ctx = React.useContext(AppBarContext);
8
+ if (!ctx) throw new Error(`<${consumer}/> must be rendered inside <AppBarRoot/>.`);
9
+ return ctx;
10
+ }
11
+ //#endregion
12
+ export { AppBarProvider, useAppBarContext };
@@ -0,0 +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';
2
+ export * as AppBar from './AppBar.namespace';
3
+ //# sourceMappingURL=index.d.ts.map