@xaui/native 0.9.1-alpha.4 → 0.9.1-alpha.40

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 (203) hide show
  1. package/dist/chunk-2EGR4LWD.js +145 -0
  2. package/dist/chunk-2NRZKJG7.js +531 -0
  3. package/dist/chunk-2PMXMKS5.js +67 -0
  4. package/dist/chunk-2XPG2243.js +586 -0
  5. package/dist/chunk-36PRYGAM.js +13 -0
  6. package/dist/chunk-3E7CDKFO.cjs +696 -0
  7. package/dist/chunk-3GFRSZYR.js +54 -0
  8. package/dist/chunk-423RQBOX.js +21 -0
  9. package/dist/chunk-4CUZZWFW.js +92 -0
  10. package/dist/chunk-4GTAZM2C.js +174 -0
  11. package/dist/chunk-4KFKWBN5.cjs +89 -0
  12. package/dist/{chunk-3QBT3Q65.cjs → chunk-57SJ4LJF.cjs} +7 -2
  13. package/dist/chunk-5R26NM4M.cjs +402 -0
  14. package/dist/chunk-5VKYNBNA.js +607 -0
  15. package/dist/chunk-64MXEVT3.js +66 -0
  16. package/dist/chunk-6DOLGZVV.cjs +147 -0
  17. package/dist/chunk-6L2TS2R3.cjs +92 -0
  18. package/dist/chunk-6UEZJRVI.js +669 -0
  19. package/dist/chunk-734MFAX4.js +27 -0
  20. package/dist/chunk-73RKQC5X.js +104 -0
  21. package/dist/chunk-7DPL3ZDS.cjs +21 -0
  22. package/dist/chunk-7EIHHOHP.cjs +42 -0
  23. package/dist/chunk-7GHM4GKL.cjs +119 -0
  24. package/dist/chunk-7YF5NAHQ.cjs +74 -0
  25. package/dist/{chunk-X2K2FX3W.js → chunk-A3EGFI6T.js} +6 -1
  26. package/dist/chunk-ABAGZTXZ.cjs +736 -0
  27. package/dist/{chunk-AW63PTQ4.cjs → chunk-ACAPTWE3.cjs} +85 -81
  28. package/dist/chunk-AMCSSOJT.cjs +104 -0
  29. package/dist/chunk-BA2DBSAN.js +102 -0
  30. package/dist/chunk-BRRXFOBY.js +431 -0
  31. package/dist/chunk-C5YLPCFC.cjs +293 -0
  32. package/dist/chunk-DA3OKXHV.cjs +700 -0
  33. package/dist/chunk-DD4276RF.js +366 -0
  34. package/dist/chunk-DG2I4PJG.js +701 -0
  35. package/dist/chunk-DHGLGSH6.js +661 -0
  36. package/dist/chunk-DIBUQ46Y.js +346 -0
  37. package/dist/chunk-EGLLDKN6.js +9 -0
  38. package/dist/chunk-EJQCQPET.cjs +9 -0
  39. package/dist/chunk-EKS3W46M.cjs +66 -0
  40. package/dist/chunk-EZEYMLO3.js +402 -0
  41. package/dist/chunk-F6CQ6CBI.cjs +112 -0
  42. package/dist/chunk-F6W3JQ7K.js +42 -0
  43. package/dist/chunk-FHUYHV6J.js +89 -0
  44. package/dist/chunk-FNEUOBCV.cjs +174 -0
  45. package/dist/chunk-G7P3ERYF.cjs +478 -0
  46. package/dist/chunk-GA6PBWNT.js +147 -0
  47. package/dist/chunk-GFUZ3MUT.cjs +455 -0
  48. package/dist/chunk-GGW43Q37.cjs +1 -0
  49. package/dist/chunk-GTR5X65M.cjs +27 -0
  50. package/dist/chunk-H4E4HDEP.cjs +13 -0
  51. package/dist/chunk-H7DS4IO7.js +198 -0
  52. package/dist/chunk-HDVVZG4S.cjs +198 -0
  53. package/dist/chunk-IKJVLJKT.js +151 -0
  54. package/dist/chunk-J3MB4PI5.cjs +531 -0
  55. package/dist/chunk-K72UDPVN.js +119 -0
  56. package/dist/chunk-KCMYU7WF.js +86 -0
  57. package/dist/chunk-LRN3RNDO.js +940 -0
  58. package/dist/chunk-LTX6TB5I.js +124 -0
  59. package/dist/chunk-LUPCPLND.cjs +145 -0
  60. package/dist/chunk-M63GFNKV.js +194 -0
  61. package/dist/chunk-N3KTZMPG.js +293 -0
  62. package/dist/chunk-NCTOTTVW.js +13 -0
  63. package/dist/chunk-NWGLP6JX.cjs +410 -0
  64. package/dist/chunk-R73XQK7X.cjs +314 -0
  65. package/dist/chunk-RU7JCMWC.cjs +881 -0
  66. package/dist/chunk-SNIHUKDA.cjs +184 -0
  67. package/dist/chunk-T5FV5F7A.cjs +607 -0
  68. package/dist/chunk-TDTUAIFF.cjs +153 -0
  69. package/dist/chunk-TJ74XVZN.cjs +431 -0
  70. package/dist/chunk-TK44VBIE.cjs +194 -0
  71. package/dist/chunk-UAWBAD4E.cjs +346 -0
  72. package/dist/chunk-UFTCTTKK.js +381 -0
  73. package/dist/chunk-WDDXU3OH.cjs +67 -0
  74. package/dist/chunk-WFEMJCXO.cjs +13 -0
  75. package/dist/chunk-WHJTBTYM.js +0 -0
  76. package/dist/{chunk-2KXQATVL.js → chunk-WKCQ6VGW.js} +59 -55
  77. package/dist/chunk-XFPQFCEK.js +455 -0
  78. package/dist/chunk-XSQPVDFH.cjs +60 -0
  79. package/dist/chunk-XTC2SLFT.js +153 -0
  80. package/dist/chunk-XV735BSA.cjs +366 -0
  81. package/dist/chunk-XWNG2U4K.cjs +124 -0
  82. package/dist/chunk-YGYYJ3LQ.js +314 -0
  83. package/dist/chunk-YVHT2UVW.js +74 -0
  84. package/dist/chunk-ZFOOJK37.cjs +86 -0
  85. package/dist/close-button.type-BUYuoSt2.d.ts +36 -0
  86. package/dist/close-button.type-CHsgZ3wO.d.cts +36 -0
  87. package/dist/components/accordion/index.cjs +35 -0
  88. package/dist/components/accordion/index.d.cts +299 -0
  89. package/dist/components/accordion/index.d.ts +299 -0
  90. package/dist/components/accordion/index.js +35 -0
  91. package/dist/components/alert/index.cjs +20 -0
  92. package/dist/components/alert/index.d.cts +169 -0
  93. package/dist/components/alert/index.d.ts +169 -0
  94. package/dist/components/alert/index.js +20 -0
  95. package/dist/components/avatar/index.cjs +16 -0
  96. package/dist/components/avatar/index.d.cts +131 -0
  97. package/dist/components/avatar/index.d.ts +131 -0
  98. package/dist/components/avatar/index.js +16 -0
  99. package/dist/components/badge/index.cjs +15 -0
  100. package/dist/components/badge/index.d.cts +157 -0
  101. package/dist/components/badge/index.d.ts +157 -0
  102. package/dist/components/badge/index.js +15 -0
  103. package/dist/components/button/index.cjs +22 -0
  104. package/dist/components/button/index.d.cts +613 -0
  105. package/dist/components/button/index.d.ts +613 -0
  106. package/dist/components/button/index.js +22 -0
  107. package/dist/components/card/index.cjs +22 -0
  108. package/dist/components/card/index.d.cts +620 -0
  109. package/dist/components/card/index.d.ts +620 -0
  110. package/dist/components/card/index.js +22 -0
  111. package/dist/components/checkbox/index.cjs +26 -0
  112. package/dist/components/checkbox/index.d.cts +1136 -0
  113. package/dist/components/checkbox/index.d.ts +1136 -0
  114. package/dist/components/checkbox/index.js +26 -0
  115. package/dist/components/chip/index.cjs +20 -0
  116. package/dist/components/chip/index.d.cts +608 -0
  117. package/dist/components/chip/index.d.ts +608 -0
  118. package/dist/components/chip/index.js +20 -0
  119. package/dist/components/divider/index.cjs +13 -0
  120. package/dist/components/divider/index.d.cts +117 -0
  121. package/dist/components/divider/index.d.ts +117 -0
  122. package/dist/components/divider/index.js +13 -0
  123. package/dist/components/field-group/index.cjs +27 -0
  124. package/dist/components/field-group/index.d.cts +270 -0
  125. package/dist/components/field-group/index.d.ts +270 -0
  126. package/dist/components/field-group/index.js +27 -0
  127. package/dist/components/input-otp/index.cjs +29 -0
  128. package/dist/components/input-otp/index.d.cts +325 -0
  129. package/dist/components/input-otp/index.d.ts +325 -0
  130. package/dist/components/input-otp/index.js +29 -0
  131. package/dist/components/menu/index.cjs +49 -0
  132. package/dist/components/menu/index.d.cts +351 -0
  133. package/dist/components/menu/index.d.ts +351 -0
  134. package/dist/components/menu/index.js +49 -0
  135. package/dist/components/popover/index.cjs +38 -0
  136. package/dist/components/popover/index.d.cts +254 -0
  137. package/dist/components/popover/index.d.ts +254 -0
  138. package/dist/components/popover/index.js +38 -0
  139. package/dist/components/radio/index.cjs +26 -0
  140. package/dist/components/radio/index.d.cts +1102 -0
  141. package/dist/components/radio/index.d.ts +1102 -0
  142. package/dist/components/radio/index.js +26 -0
  143. package/dist/components/select/index.cjs +50 -0
  144. package/dist/components/select/index.d.cts +498 -0
  145. package/dist/components/select/index.d.ts +498 -0
  146. package/dist/components/select/index.js +50 -0
  147. package/dist/components/skeleton/index.cjs +11 -0
  148. package/dist/components/skeleton/index.d.cts +111 -0
  149. package/dist/components/skeleton/index.d.ts +111 -0
  150. package/dist/components/skeleton/index.js +11 -0
  151. package/dist/components/spinner/index.cjs +17 -0
  152. package/dist/components/spinner/index.d.cts +104 -0
  153. package/dist/components/spinner/index.d.ts +104 -0
  154. package/dist/components/spinner/index.js +17 -0
  155. package/dist/components/switch/index.cjs +27 -0
  156. package/dist/components/switch/index.d.cts +1154 -0
  157. package/dist/components/switch/index.d.ts +1154 -0
  158. package/dist/components/switch/index.js +27 -0
  159. package/dist/components/text-area/index.cjs +14 -0
  160. package/dist/components/text-area/index.d.cts +73 -0
  161. package/dist/components/text-area/index.d.ts +73 -0
  162. package/dist/components/text-area/index.js +14 -0
  163. package/dist/components/text-field/index.cjs +25 -0
  164. package/dist/components/text-field/index.d.cts +205 -0
  165. package/dist/components/text-field/index.d.ts +205 -0
  166. package/dist/components/text-field/index.js +25 -0
  167. package/dist/components/typography/index.cjs +15 -0
  168. package/dist/components/typography/index.d.cts +116 -0
  169. package/dist/components/typography/index.d.ts +116 -0
  170. package/dist/components/typography/index.js +15 -0
  171. package/dist/components/view/index.cjs +17 -0
  172. package/dist/components/view/index.d.cts +152 -0
  173. package/dist/components/view/index.d.ts +152 -0
  174. package/dist/components/view/index.js +17 -0
  175. package/dist/create-recipe-BdVd2ffi.d.ts +114 -0
  176. package/dist/create-recipe-dC7wMfnj.d.cts +114 -0
  177. package/dist/icon.type-Kml72iSz.d.ts +73 -0
  178. package/dist/icon.type-d_i9ma-i.d.cts +73 -0
  179. package/dist/index.cjs +400 -4
  180. package/dist/index.d.cts +118 -4
  181. package/dist/index.d.ts +118 -4
  182. package/dist/index.js +423 -27
  183. package/dist/placement-DHa0Rrh1.d.cts +38 -0
  184. package/dist/placement-DHa0Rrh1.d.ts +38 -0
  185. package/dist/pressable-feedback.type-BA2C9sSz.d.cts +127 -0
  186. package/dist/pressable-feedback.type-Bs4dQlGj.d.ts +127 -0
  187. package/dist/style-props.type-CfnoGEP7.d.cts +31 -0
  188. package/dist/style-props.type-CfnoGEP7.d.ts +31 -0
  189. package/dist/system/index.cjs +73 -4
  190. package/dist/system/index.d.cts +379 -193
  191. package/dist/system/index.d.ts +379 -193
  192. package/dist/system/index.js +87 -18
  193. package/dist/text-field.type-0l73acce.d.ts +167 -0
  194. package/dist/text-field.type-DBh06DU5.d.cts +167 -0
  195. package/dist/theme/index.cjs +5 -3
  196. package/dist/theme/index.d.cts +55 -24
  197. package/dist/theme/index.d.ts +55 -24
  198. package/dist/theme/index.js +4 -2
  199. package/dist/{theme.type-C9bFJKFm.d.cts → theme.type-C2gNHpEx.d.cts} +1 -1
  200. package/dist/{theme.type-C9bFJKFm.d.ts → theme.type-C2gNHpEx.d.ts} +1 -1
  201. package/package.json +254 -18
  202. package/dist/chunk-ECDWSSHJ.js +0 -688
  203. package/dist/chunk-IYFGO523.cjs +0 -688
@@ -0,0 +1,157 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_native from 'react-native';
4
+ import { ViewProps, StyleProp, ViewStyle, View } from 'react-native';
5
+ import { V as ViewStyleProps } from '../../style-props.type-CfnoGEP7.cjs';
6
+ import { S as Size, R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.cjs';
7
+ import { R as Recipe, S as SlotStyles, a as StyleFn } from '../../create-recipe-dC7wMfnj.cjs';
8
+
9
+ type BadgeSlot = 'root' | 'label';
10
+ /**
11
+ * The full vocabulary (§1 bis), and the `Chip`'s eleven — a badge is what a chip is when
12
+ * it is too small to hold a word: something a component **reports** about itself. So the
13
+ * three status families are here for the same reason they are there, and a name means the
14
+ * same thing in both.
15
+ *
16
+ * `danger` is the default rather than `primary`, and it is the only component in the
17
+ * library whose default is not the first name in the ladder. A badge is overwhelmingly the
18
+ * count of something that wants attention — unread, failed, overdue — and a red one is what
19
+ * a caller writing `<Badge>3</Badge>` means. The accent count is a `variant` away.
20
+ */
21
+ type BadgeVariant = 'primary' | 'secondary' | 'default' | 'tertiary' | 'ghost' | 'success' | 'success-soft' | 'warning' | 'warning-soft' | 'danger' | 'danger-soft';
22
+ type BadgeSize = Size;
23
+ /**
24
+ * Which corner it hangs off, when it hangs off something.
25
+ *
26
+ * Unset, the badge is in flow and the parent lays it out like any other node — which is the
27
+ * right thing for a badge at the end of a list row. Set, it is absolutely positioned in
28
+ * that corner of the **parent**, so the parent is whatever the badge decorates:
29
+ *
30
+ * ```tsx
31
+ * <View>
32
+ * <Icon as={BellIcon} size={24} />
33
+ * <Badge placement="top-end">3</Badge>
34
+ * </View>
35
+ * ```
36
+ *
37
+ * It is a prop rather than four style keys the caller writes because the offset is derived
38
+ * from the badge's own `size` — it is pulled out by half its height on each axis, so its
39
+ * centre sits on the corner it marks, and that arithmetic belongs with the measurements
40
+ * rather than at every call site. R13 is the other half: the keys are `start` and `end`, so
41
+ * a badge on the trailing corner mirrors in RTL instead of staying put.
42
+ */
43
+ type BadgePlacement = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';
44
+ /**
45
+ * What the `Badge` itself understands. R14 — a name in here is the component's, so the
46
+ * style prop that shares it is not exposed: `size` is the badge's scale and never
47
+ * `ViewStyle`'s, and `color` is R7's tint.
48
+ */
49
+ type BadgeOwnProps = {
50
+ variant?: BadgeVariant;
51
+ /** Height, horizontal padding and type. The width follows the count inside it. */
52
+ size?: BadgeSize;
53
+ /**
54
+ * Overrides the capsule. A badge is a pill at every size — that is what makes a
55
+ * two-digit count read as one object — so this is the prop for the square marker.
56
+ */
57
+ radius?: RadiusKey;
58
+ /**
59
+ * A raw tint (`'#7c3aed'`), never a token (R7). Where it lands follows the variant: the
60
+ * fill of a `primary`, the border and label of a `tertiary`, the label of a `ghost`.
61
+ */
62
+ color?: string;
63
+ /**
64
+ * The bare circle — no label, no padding, a fixed diameter. It is what a badge is when
65
+ * the fact that there is *something* is the whole message: a dot on a tab, an unsaved
66
+ * marker on a row.
67
+ *
68
+ * Children are not rendered while it is set: a dot is the absence of a label, so there
69
+ * is nothing for one to sit in.
70
+ */
71
+ isDot?: boolean;
72
+ placement?: BadgePlacement;
73
+ /** R12 — the child element becomes the badge and keeps this variant's style. */
74
+ asChild?: boolean;
75
+ style?: StyleProp<ViewStyle>;
76
+ children?: ReactNode;
77
+ };
78
+ type BadgeProps = Omit<ViewProps, 'style'> & BadgeOwnProps & Omit<ViewStyleProps, keyof BadgeOwnProps | keyof ViewProps>;
79
+
80
+ /**
81
+ * A count, or the fact that there is one.
82
+ *
83
+ * ```tsx
84
+ * <Badge>3</Badge>
85
+ * <Badge variant="success-soft" size="sm">Payé</Badge>
86
+ * <Badge isDot variant="warning" />
87
+ *
88
+ * <View>
89
+ * <Icon as={BellIcon} size={24} />
90
+ * <Badge placement="top-end">12</Badge>
91
+ * </View>
92
+ * ```
93
+ *
94
+ * **One node and no slots**, per the plan. A badge is a mark: whatever is inside it is one
95
+ * line of two or three characters, and a slot would be a name for a `Text` this component
96
+ * can just as well insert itself (R3).
97
+ *
98
+ * **It is not a small `Chip`.** A chip holds a word and hugs it; a badge holds a count and
99
+ * is round unless the count is too wide to be. That is the `minWidth` equal to the height —
100
+ * one digit is a circle, two are a capsule — and it is why the label stays at 12pt through
101
+ * three of the four sizes, because a count that grows with its badge stops being a count.
102
+ *
103
+ * **`placement` makes the parent whatever the badge decorates.** Unset, the badge is in
104
+ * flow and laid out like any other node, which is what a badge at the end of a list row
105
+ * wants. Set, it is pulled half its own height out of that corner of the parent, so its
106
+ * centre lands on the corner it marks.
107
+ */
108
+ declare const Badge: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
109
+ variant?: BadgeVariant;
110
+ size?: BadgeSize;
111
+ radius?: RadiusKey;
112
+ color?: string;
113
+ isDot?: boolean;
114
+ placement?: BadgePlacement;
115
+ asChild?: boolean;
116
+ style?: react_native.StyleProp<react_native.ViewStyle>;
117
+ children?: react.ReactNode;
118
+ } & Omit<ViewStyleProps, "color" | "pointerEvents" | "style" | "children" | "size" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "variant" | "radius" | "asChild" | "placement" | "isDot"> & react.RefAttributes<View>>;
119
+
120
+ declare const badgeRecipe: Recipe<"label" | "root", BadgeVariant, {
121
+ readonly size: {
122
+ readonly xs: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
123
+ readonly sm: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
124
+ readonly md: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
125
+ readonly lg: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
126
+ };
127
+ /**
128
+ * The same four keys as `size`, and the root selects it with the resolved size when
129
+ * `isDot` is set and with nothing when it is not — an axis left unselected contributes
130
+ * nothing, which is exactly "this badge has a label". A `{ true, false }` axis would
131
+ * have needed a `false` branch with nothing to say, and a `size × isDot` compound
132
+ * would have been sixteen entries for four measurements.
133
+ */
134
+ readonly dot: {
135
+ readonly xs: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
136
+ readonly sm: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
137
+ readonly md: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
138
+ readonly lg: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
139
+ };
140
+ readonly radius: Record<RadiusKey, StyleFn<BadgeSlot>>;
141
+ }>;
142
+
143
+ /**
144
+ * `placement` turned into the four keys React Native understands, given how far the badge
145
+ * has to be pulled out of the corner it marks.
146
+ *
147
+ * A pure function rather than a lookup in the recipe, because the insets must **not** exist
148
+ * when there is no placement: in flow the node is `position: 'relative'`, where an inset is
149
+ * a nudge rather than a placement, and a cached style carrying `top: -10` would shift every
150
+ * badge that is simply sitting at the end of a row.
151
+ *
152
+ * R13 — `start` and `end`, never `left` and `right`, so a badge on the trailing corner
153
+ * mirrors with the layout instead of staying put.
154
+ */
155
+ declare function placementInsets(placement: BadgePlacement | undefined, offset: number): ViewStyle | undefined;
156
+
157
+ export { Badge, type BadgePlacement, type BadgeProps, type BadgeSize, type BadgeSlot, type BadgeVariant, badgeRecipe, placementInsets };
@@ -0,0 +1,157 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_native from 'react-native';
4
+ import { ViewProps, StyleProp, ViewStyle, View } from 'react-native';
5
+ import { V as ViewStyleProps } from '../../style-props.type-CfnoGEP7.js';
6
+ import { S as Size, R as RadiusKey, X as XAUITheme } from '../../theme.type-C2gNHpEx.js';
7
+ import { R as Recipe, S as SlotStyles, a as StyleFn } from '../../create-recipe-BdVd2ffi.js';
8
+
9
+ type BadgeSlot = 'root' | 'label';
10
+ /**
11
+ * The full vocabulary (§1 bis), and the `Chip`'s eleven — a badge is what a chip is when
12
+ * it is too small to hold a word: something a component **reports** about itself. So the
13
+ * three status families are here for the same reason they are there, and a name means the
14
+ * same thing in both.
15
+ *
16
+ * `danger` is the default rather than `primary`, and it is the only component in the
17
+ * library whose default is not the first name in the ladder. A badge is overwhelmingly the
18
+ * count of something that wants attention — unread, failed, overdue — and a red one is what
19
+ * a caller writing `<Badge>3</Badge>` means. The accent count is a `variant` away.
20
+ */
21
+ type BadgeVariant = 'primary' | 'secondary' | 'default' | 'tertiary' | 'ghost' | 'success' | 'success-soft' | 'warning' | 'warning-soft' | 'danger' | 'danger-soft';
22
+ type BadgeSize = Size;
23
+ /**
24
+ * Which corner it hangs off, when it hangs off something.
25
+ *
26
+ * Unset, the badge is in flow and the parent lays it out like any other node — which is the
27
+ * right thing for a badge at the end of a list row. Set, it is absolutely positioned in
28
+ * that corner of the **parent**, so the parent is whatever the badge decorates:
29
+ *
30
+ * ```tsx
31
+ * <View>
32
+ * <Icon as={BellIcon} size={24} />
33
+ * <Badge placement="top-end">3</Badge>
34
+ * </View>
35
+ * ```
36
+ *
37
+ * It is a prop rather than four style keys the caller writes because the offset is derived
38
+ * from the badge's own `size` — it is pulled out by half its height on each axis, so its
39
+ * centre sits on the corner it marks, and that arithmetic belongs with the measurements
40
+ * rather than at every call site. R13 is the other half: the keys are `start` and `end`, so
41
+ * a badge on the trailing corner mirrors in RTL instead of staying put.
42
+ */
43
+ type BadgePlacement = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start';
44
+ /**
45
+ * What the `Badge` itself understands. R14 — a name in here is the component's, so the
46
+ * style prop that shares it is not exposed: `size` is the badge's scale and never
47
+ * `ViewStyle`'s, and `color` is R7's tint.
48
+ */
49
+ type BadgeOwnProps = {
50
+ variant?: BadgeVariant;
51
+ /** Height, horizontal padding and type. The width follows the count inside it. */
52
+ size?: BadgeSize;
53
+ /**
54
+ * Overrides the capsule. A badge is a pill at every size — that is what makes a
55
+ * two-digit count read as one object — so this is the prop for the square marker.
56
+ */
57
+ radius?: RadiusKey;
58
+ /**
59
+ * A raw tint (`'#7c3aed'`), never a token (R7). Where it lands follows the variant: the
60
+ * fill of a `primary`, the border and label of a `tertiary`, the label of a `ghost`.
61
+ */
62
+ color?: string;
63
+ /**
64
+ * The bare circle — no label, no padding, a fixed diameter. It is what a badge is when
65
+ * the fact that there is *something* is the whole message: a dot on a tab, an unsaved
66
+ * marker on a row.
67
+ *
68
+ * Children are not rendered while it is set: a dot is the absence of a label, so there
69
+ * is nothing for one to sit in.
70
+ */
71
+ isDot?: boolean;
72
+ placement?: BadgePlacement;
73
+ /** R12 — the child element becomes the badge and keeps this variant's style. */
74
+ asChild?: boolean;
75
+ style?: StyleProp<ViewStyle>;
76
+ children?: ReactNode;
77
+ };
78
+ type BadgeProps = Omit<ViewProps, 'style'> & BadgeOwnProps & Omit<ViewStyleProps, keyof BadgeOwnProps | keyof ViewProps>;
79
+
80
+ /**
81
+ * A count, or the fact that there is one.
82
+ *
83
+ * ```tsx
84
+ * <Badge>3</Badge>
85
+ * <Badge variant="success-soft" size="sm">Payé</Badge>
86
+ * <Badge isDot variant="warning" />
87
+ *
88
+ * <View>
89
+ * <Icon as={BellIcon} size={24} />
90
+ * <Badge placement="top-end">12</Badge>
91
+ * </View>
92
+ * ```
93
+ *
94
+ * **One node and no slots**, per the plan. A badge is a mark: whatever is inside it is one
95
+ * line of two or three characters, and a slot would be a name for a `Text` this component
96
+ * can just as well insert itself (R3).
97
+ *
98
+ * **It is not a small `Chip`.** A chip holds a word and hugs it; a badge holds a count and
99
+ * is round unless the count is too wide to be. That is the `minWidth` equal to the height —
100
+ * one digit is a circle, two are a capsule — and it is why the label stays at 12pt through
101
+ * three of the four sizes, because a count that grows with its badge stops being a count.
102
+ *
103
+ * **`placement` makes the parent whatever the badge decorates.** Unset, the badge is in
104
+ * flow and laid out like any other node, which is what a badge at the end of a list row
105
+ * wants. Set, it is pulled half its own height out of that corner of the parent, so its
106
+ * centre lands on the corner it marks.
107
+ */
108
+ declare const Badge: react.ForwardRefExoticComponent<Omit<react_native.ViewProps, "style"> & {
109
+ variant?: BadgeVariant;
110
+ size?: BadgeSize;
111
+ radius?: RadiusKey;
112
+ color?: string;
113
+ isDot?: boolean;
114
+ placement?: BadgePlacement;
115
+ asChild?: boolean;
116
+ style?: react_native.StyleProp<react_native.ViewStyle>;
117
+ children?: react.ReactNode;
118
+ } & Omit<ViewStyleProps, "color" | "pointerEvents" | "style" | "children" | "size" | "hitSlop" | "id" | "needsOffscreenAlphaCompositing" | "onLayout" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "collapsableChildren" | "onBlur" | "onFocus" | "renderToHardwareTextureAndroid" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "aria-label" | "accessibilityRole" | "accessibilityState" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "accessibilityHint" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onAccessibilityAction" | "importantForAccessibility" | "aria-hidden" | "aria-modal" | "role" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "screenReaderFocusable" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLanguage" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "accessibilityRespondsToUserInteraction" | "variant" | "radius" | "asChild" | "placement" | "isDot"> & react.RefAttributes<View>>;
119
+
120
+ declare const badgeRecipe: Recipe<"label" | "root", BadgeVariant, {
121
+ readonly size: {
122
+ readonly xs: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
123
+ readonly sm: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
124
+ readonly md: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
125
+ readonly lg: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
126
+ };
127
+ /**
128
+ * The same four keys as `size`, and the root selects it with the resolved size when
129
+ * `isDot` is set and with nothing when it is not — an axis left unselected contributes
130
+ * nothing, which is exactly "this badge has a label". A `{ true, false }` axis would
131
+ * have needed a `false` branch with nothing to say, and a `size × isDot` compound
132
+ * would have been sixteen entries for four measurements.
133
+ */
134
+ readonly dot: {
135
+ readonly xs: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
136
+ readonly sm: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
137
+ readonly md: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
138
+ readonly lg: (theme: XAUITheme) => SlotStyles<BadgeSlot>;
139
+ };
140
+ readonly radius: Record<RadiusKey, StyleFn<BadgeSlot>>;
141
+ }>;
142
+
143
+ /**
144
+ * `placement` turned into the four keys React Native understands, given how far the badge
145
+ * has to be pulled out of the corner it marks.
146
+ *
147
+ * A pure function rather than a lookup in the recipe, because the insets must **not** exist
148
+ * when there is no placement: in flow the node is `position: 'relative'`, where an inset is
149
+ * a nudge rather than a placement, and a cached style carrying `top: -10` would shift every
150
+ * badge that is simply sitting at the end of a row.
151
+ *
152
+ * R13 — `start` and `end`, never `left` and `right`, so a badge on the trailing corner
153
+ * mirrors with the layout instead of staying put.
154
+ */
155
+ declare function placementInsets(placement: BadgePlacement | undefined, offset: number): ViewStyle | undefined;
156
+
157
+ export { Badge, type BadgePlacement, type BadgeProps, type BadgeSize, type BadgeSlot, type BadgeVariant, badgeRecipe, placementInsets };
@@ -0,0 +1,15 @@
1
+ import {
2
+ Badge,
3
+ badgeRecipe,
4
+ placementInsets
5
+ } from "../../chunk-H7DS4IO7.js";
6
+ import "../../chunk-4GTAZM2C.js";
7
+ import "../../chunk-A3EGFI6T.js";
8
+ import "../../chunk-K72UDPVN.js";
9
+ import "../../chunk-36PRYGAM.js";
10
+ import "../../chunk-M63GFNKV.js";
11
+ export {
12
+ Badge,
13
+ badgeRecipe,
14
+ placementInsets
15
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkR73XQK7Xcjs = require('../../chunk-R73XQK7X.cjs');
6
+ require('../../chunk-XSQPVDFH.cjs');
7
+ require('../../chunk-WFEMJCXO.cjs');
8
+ require('../../chunk-4KFKWBN5.cjs');
9
+ require('../../chunk-7EIHHOHP.cjs');
10
+ require('../../chunk-3E7CDKFO.cjs');
11
+ require('../../chunk-7DPL3ZDS.cjs');
12
+ require('../../chunk-EJQCQPET.cjs');
13
+ require('../../chunk-FNEUOBCV.cjs');
14
+ require('../../chunk-57SJ4LJF.cjs');
15
+ require('../../chunk-7GHM4GKL.cjs');
16
+ require('../../chunk-H4E4HDEP.cjs');
17
+ require('../../chunk-TK44VBIE.cjs');
18
+
19
+
20
+
21
+
22
+ exports.Button = _chunkR73XQK7Xcjs.Button; exports.buttonRecipe = _chunkR73XQK7Xcjs.buttonRecipe; exports.useButton = _chunkR73XQK7Xcjs.useButton;