@kanso-labs/kanso-ui 0.35.0 → 0.37.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 (220) hide show
  1. package/README.md +90 -9
  2. package/dist/button/context.js +7 -0
  3. package/dist/button/context.js.map +1 -0
  4. package/dist/button/group.js +25 -0
  5. package/dist/button/group.js.map +1 -0
  6. package/dist/button/hooks.js +81 -0
  7. package/dist/button/hooks.js.map +1 -0
  8. package/dist/button/index.d.ts +11 -0
  9. package/dist/button/index.js +273 -0
  10. package/dist/button/index.js.map +1 -0
  11. package/dist/button/styles.js +23 -0
  12. package/dist/button/styles.js.map +1 -0
  13. package/dist/calendar/index.js +473 -7
  14. package/dist/calendar/index.js.map +1 -1
  15. package/dist/calendar/styles.js +132 -4
  16. package/dist/calendar/styles.js.map +1 -1
  17. package/dist/chip/index.js +74 -9
  18. package/dist/chip/index.js.map +1 -1
  19. package/dist/chip/styles.js +78 -4
  20. package/dist/chip/styles.js.map +1 -1
  21. package/dist/collection/index.js +12 -9
  22. package/dist/collection/index.js.map +1 -1
  23. package/dist/collection/styles.js +21 -2
  24. package/dist/collection/styles.js.map +1 -1
  25. package/dist/color-scheme.d.ts +29 -0
  26. package/dist/color-scheme.js +32 -0
  27. package/dist/color-scheme.js.map +1 -0
  28. package/dist/components/avatar/index.js +35 -22
  29. package/dist/components/avatar/index.js.map +1 -1
  30. package/dist/components/badge/index.d.ts +40 -0
  31. package/dist/components/badge/index.js +102 -0
  32. package/dist/components/badge/index.js.map +1 -0
  33. package/dist/components/breadcrumbs/index.d.ts +1 -1
  34. package/dist/components/breadcrumbs/index.js +1 -1
  35. package/dist/components/breadcrumbs/index.js.map +1 -1
  36. package/dist/components/button/index.d.ts +58 -14
  37. package/dist/components/button/index.js +400 -147
  38. package/dist/components/button/index.js.map +1 -1
  39. package/dist/components/button-group/index.d.ts +54 -0
  40. package/dist/components/button-group/index.js +272 -0
  41. package/dist/components/button-group/index.js.map +1 -0
  42. package/dist/components/calendar/index.d.ts +9 -1
  43. package/dist/components/calendar/index.js +71 -44
  44. package/dist/components/calendar/index.js.map +1 -1
  45. package/dist/components/card/index.d.ts +1 -1
  46. package/dist/components/card/index.js +4 -4
  47. package/dist/components/card/index.js.map +1 -1
  48. package/dist/components/checkbox/index.js +15 -1
  49. package/dist/components/checkbox/index.js.map +1 -1
  50. package/dist/components/checkbox-group/index.js +1 -0
  51. package/dist/components/checkbox-group/index.js.map +1 -1
  52. package/dist/components/chip/index.d.ts +55 -8
  53. package/dist/components/chip/index.js +174 -63
  54. package/dist/components/chip/index.js.map +1 -1
  55. package/dist/components/chip-group/index.d.ts +16 -7
  56. package/dist/components/chip-group/index.js +58 -35
  57. package/dist/components/chip-group/index.js.map +1 -1
  58. package/dist/components/color-field/index.js +25 -23
  59. package/dist/components/color-field/index.js.map +1 -1
  60. package/dist/components/color-picker/index.js +42 -31
  61. package/dist/components/color-picker/index.js.map +1 -1
  62. package/dist/components/color-swatch-picker/index.d.ts +1 -1
  63. package/dist/components/color-swatch-picker/index.js +17 -13
  64. package/dist/components/color-swatch-picker/index.js.map +1 -1
  65. package/dist/components/combo-box/index.d.ts +5 -3
  66. package/dist/components/combo-box/index.js +63 -58
  67. package/dist/components/combo-box/index.js.map +1 -1
  68. package/dist/components/copy-field/index.d.ts +7 -6
  69. package/dist/components/copy-field/index.js +92 -90
  70. package/dist/components/copy-field/index.js.map +1 -1
  71. package/dist/components/currency/index.d.ts +8 -7
  72. package/dist/components/currency/index.js +43 -65
  73. package/dist/components/currency/index.js.map +1 -1
  74. package/dist/components/date-field/index.js +24 -22
  75. package/dist/components/date-field/index.js.map +1 -1
  76. package/dist/components/date-picker/index.d.ts +10 -2
  77. package/dist/components/date-picker/index.js +76 -69
  78. package/dist/components/date-picker/index.js.map +1 -1
  79. package/dist/components/date-range-picker/index.d.ts +10 -2
  80. package/dist/components/date-range-picker/index.js +93 -86
  81. package/dist/components/date-range-picker/index.js.map +1 -1
  82. package/dist/components/dialog/index.d.ts +1 -1
  83. package/dist/components/dialog/index.js +2 -2
  84. package/dist/components/dialog/index.js.map +1 -1
  85. package/dist/components/disclosure/index.d.ts +1 -1
  86. package/dist/components/disclosure/index.js +6 -6
  87. package/dist/components/disclosure/index.js.map +1 -1
  88. package/dist/components/fab/index.d.ts +72 -0
  89. package/dist/components/fab/index.js +89 -0
  90. package/dist/components/fab/index.js.map +1 -0
  91. package/dist/components/fab-menu/index.d.ts +90 -0
  92. package/dist/components/fab-menu/index.js +297 -0
  93. package/dist/components/fab-menu/index.js.map +1 -0
  94. package/dist/components/feed/index.d.ts +2 -1
  95. package/dist/components/feed/index.js +1 -1
  96. package/dist/components/feed/index.js.map +1 -1
  97. package/dist/components/icon-button/index.d.ts +11 -8
  98. package/dist/components/icon-button/index.js +244 -181
  99. package/dist/components/icon-button/index.js.map +1 -1
  100. package/dist/components/index.d.ts +30 -21
  101. package/dist/components/list/index.d.ts +15 -13
  102. package/dist/components/list/index.js +60 -61
  103. package/dist/components/list/index.js.map +1 -1
  104. package/dist/components/list-box/index.d.ts +3 -2
  105. package/dist/components/list-box/index.js +16 -16
  106. package/dist/components/list-box/index.js.map +1 -1
  107. package/dist/components/list-item/index.js +1 -1
  108. package/dist/components/list-item/index.js.map +1 -1
  109. package/dist/components/menu/index.d.ts +3 -2
  110. package/dist/components/menu/index.js +2 -2
  111. package/dist/components/menu/index.js.map +1 -1
  112. package/dist/components/navigation-bar/index.d.ts +50 -0
  113. package/dist/components/navigation-bar/index.js +129 -0
  114. package/dist/components/navigation-bar/index.js.map +1 -0
  115. package/dist/components/navigation-rail/index.d.ts +59 -0
  116. package/dist/components/navigation-rail/index.js +166 -0
  117. package/dist/components/navigation-rail/index.js.map +1 -0
  118. package/dist/components/navigation-tree/index.d.ts +1 -5
  119. package/dist/components/navigation-tree/index.js +3 -3
  120. package/dist/components/navigation-tree/index.js.map +1 -1
  121. package/dist/components/number-field/index.d.ts +6 -4
  122. package/dist/components/number-field/index.js +84 -84
  123. package/dist/components/number-field/index.js.map +1 -1
  124. package/dist/components/popover/index.d.ts +1 -1
  125. package/dist/components/popover/index.js +1 -1
  126. package/dist/components/popover/index.js.map +1 -1
  127. package/dist/components/radio-group/index.js +22 -11
  128. package/dist/components/radio-group/index.js.map +1 -1
  129. package/dist/components/range-calendar/index.d.ts +7 -1
  130. package/dist/components/range-calendar/index.js +71 -44
  131. package/dist/components/range-calendar/index.js.map +1 -1
  132. package/dist/components/search-field/index.d.ts +2 -1
  133. package/dist/components/search-field/index.js +24 -25
  134. package/dist/components/search-field/index.js.map +1 -1
  135. package/dist/components/search-view/index.d.ts +79 -0
  136. package/dist/components/search-view/index.js +255 -0
  137. package/dist/components/search-view/index.js.map +1 -0
  138. package/dist/components/segmented-button/index.d.ts +2 -2
  139. package/dist/components/segmented-button/index.js +60 -31
  140. package/dist/components/segmented-button/index.js.map +1 -1
  141. package/dist/components/select/index.js +1 -0
  142. package/dist/components/select/index.js.map +1 -1
  143. package/dist/components/sheet/index.d.ts +1 -1
  144. package/dist/components/sheet/index.js +2 -2
  145. package/dist/components/sheet/index.js.map +1 -1
  146. package/dist/components/slider/index.js +1 -1
  147. package/dist/components/slider/index.js.map +1 -1
  148. package/dist/components/snackbar/index.d.ts +2 -2
  149. package/dist/components/snackbar/index.js +28 -13
  150. package/dist/components/snackbar/index.js.map +1 -1
  151. package/dist/components/split-button/index.d.ts +83 -0
  152. package/dist/components/split-button/index.js +341 -0
  153. package/dist/components/split-button/index.js.map +1 -0
  154. package/dist/components/switch/index.js +11 -1
  155. package/dist/components/switch/index.js.map +1 -1
  156. package/dist/components/table/index.d.ts +11 -9
  157. package/dist/components/table/index.js +87 -31
  158. package/dist/components/table/index.js.map +1 -1
  159. package/dist/components/tabs/index.d.ts +35 -4
  160. package/dist/components/tabs/index.js +403 -93
  161. package/dist/components/tabs/index.js.map +1 -1
  162. package/dist/components/tag/index.d.ts +1 -1
  163. package/dist/components/tag/index.js.map +1 -1
  164. package/dist/components/text-area/index.d.ts +7 -5
  165. package/dist/components/text-area/index.js +28 -26
  166. package/dist/components/text-area/index.js.map +1 -1
  167. package/dist/components/text-field/index.d.ts +7 -5
  168. package/dist/components/text-field/index.js +28 -26
  169. package/dist/components/text-field/index.js.map +1 -1
  170. package/dist/components/time-field/index.js +24 -22
  171. package/dist/components/time-field/index.js.map +1 -1
  172. package/dist/components/tree/index.d.ts +7 -9
  173. package/dist/components/tree/index.js +15 -16
  174. package/dist/components/tree/index.js.map +1 -1
  175. package/dist/drag/index.js.map +1 -1
  176. package/dist/drag/styles.js +4 -1
  177. package/dist/drag/styles.js.map +1 -1
  178. package/dist/fab/styles.js +161 -0
  179. package/dist/fab/styles.js.map +1 -0
  180. package/dist/field/index.js +260 -214
  181. package/dist/field/index.js.map +1 -1
  182. package/dist/field/styles.js +10 -2
  183. package/dist/field/styles.js.map +1 -1
  184. package/dist/glyphs/index.js +55 -1
  185. package/dist/glyphs/index.js.map +1 -1
  186. package/dist/hooks/useRipple.js +199 -162
  187. package/dist/hooks/useRipple.js.map +1 -1
  188. package/dist/hooks/useToggleGroupDisabled.js +24 -0
  189. package/dist/hooks/useToggleGroupDisabled.js.map +1 -0
  190. package/dist/i18n/index.js +43 -0
  191. package/dist/i18n/index.js.map +1 -0
  192. package/dist/i18n/messages.js +387 -0
  193. package/dist/i18n/messages.js.map +1 -0
  194. package/dist/index.d.ts +31 -21
  195. package/dist/index.js +25 -16
  196. package/dist/navigation/context.js +7 -0
  197. package/dist/navigation/context.js.map +1 -0
  198. package/dist/navigation/index.d.ts +28 -0
  199. package/dist/navigation/index.js +96 -0
  200. package/dist/navigation/index.js.map +1 -0
  201. package/dist/navigation/styles.js +312 -0
  202. package/dist/navigation/styles.js.map +1 -0
  203. package/dist/react-aria.d.ts +2 -2
  204. package/dist/react-aria.js +2 -2
  205. package/dist/render/useRender.js +0 -1
  206. package/dist/render/useRender.js.map +1 -1
  207. package/dist/row/styles.js +33 -11
  208. package/dist/row/styles.js.map +1 -1
  209. package/dist/styles/focus.js.map +1 -1
  210. package/dist/styles/icon-button.js +9 -1
  211. package/dist/styles/icon-button.js.map +1 -1
  212. package/dist/styles/overlay.js +1 -0
  213. package/dist/styles/overlay.js.map +1 -1
  214. package/dist/styles/picker.js +1 -1
  215. package/dist/styles/picker.js.map +1 -1
  216. package/dist/styles.css +1104 -336
  217. package/dist/tokens/design.tokens.stylex.js +42 -1
  218. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  219. package/dist/tokens.css +166 -53
  220. package/package.json +9 -5
@@ -1,80 +1,191 @@
1
1
  "use client";
2
- import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
2
  import { mergeStatefulStyles } from "../../styles/merge.js";
4
- import { ariaAttributesOf, toggleButtonRenderer } from "../../render/aria.js";
5
- import { focus } from "../../styles/focus.js";
6
- import { chipStyles } from "../../chip/styles.js";
7
- import { chipGlyph, chipLabel } from "../../chip/index.js";
3
+ import { ariaAttributesOf, buttonRenderer, toggleButtonRenderer } from "../../render/aria.js";
4
+ import { useRipple } from "../../hooks/useRipple.js";
5
+ import { chipGlyph, chipLabel, chipPropsFor } from "../../chip/index.js";
8
6
  import { c } from "react/compiler-runtime";
9
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
- import { ToggleButton } from "react-aria-components";
8
+ import { Button, ToggleButton } from "react-aria-components";
11
9
  //#region src/components/chip/index.tsx
10
+ function ActionChip(t0) {
11
+ const $ = c(18);
12
+ const { children, elevated: t1, icon, onClick, onContextMenu, onKeyDown, onKeyUp, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, render, variant, ...props } = t0;
13
+ const elevated = t1 === void 0 ? false : t1;
14
+ const element = {
15
+ aria: ariaAttributesOf(props),
16
+ onKeyDown,
17
+ onKeyUp
18
+ };
19
+ let t2;
20
+ if ($[0] !== onClick || $[1] !== onContextMenu || $[2] !== onPointerCancel || $[3] !== onPointerDown || $[4] !== onPointerLeave || $[5] !== onPointerUp) {
21
+ t2 = {
22
+ onClick,
23
+ onContextMenu,
24
+ onPointerCancel,
25
+ onPointerDown,
26
+ onPointerLeave,
27
+ onPointerUp
28
+ };
29
+ $[0] = onClick;
30
+ $[1] = onContextMenu;
31
+ $[2] = onPointerCancel;
32
+ $[3] = onPointerDown;
33
+ $[4] = onPointerLeave;
34
+ $[5] = onPointerUp;
35
+ $[6] = t2;
36
+ } else t2 = $[6];
37
+ const ripple = useRipple(props.isDisabled !== true, t2);
38
+ const T0 = Button;
39
+ const t3 = buttonRenderer(element, render);
40
+ const t4 = ripple.handlers;
41
+ const t5 = mergeStatefulStyles(actionChipClasses(variant, elevated), props);
42
+ let t6;
43
+ if ($[7] !== children || $[8] !== icon || $[9] !== ripple.surface) {
44
+ t6 = actionChipContent(children, icon, ripple.surface);
45
+ $[7] = children;
46
+ $[8] = icon;
47
+ $[9] = ripple.surface;
48
+ $[10] = t6;
49
+ } else t6 = $[10];
50
+ let t7;
51
+ if ($[11] !== T0 || $[12] !== props || $[13] !== ripple.handlers || $[14] !== t3 || $[15] !== t5 || $[16] !== t6) {
52
+ t7 = /* @__PURE__ */ jsx(T0, {
53
+ render: t3,
54
+ ...t4,
55
+ ...props,
56
+ ...t5,
57
+ children: t6
58
+ });
59
+ $[11] = T0;
60
+ $[12] = props;
61
+ $[13] = ripple.handlers;
62
+ $[14] = t3;
63
+ $[15] = t5;
64
+ $[16] = t6;
65
+ $[17] = t7;
66
+ } else t7 = $[17];
67
+ return t7;
68
+ }
69
+ function actionChipClasses(kind, elevated) {
70
+ return (state) => chipPropsFor({
71
+ ...state,
72
+ isSelected: false
73
+ }, {
74
+ elevated,
75
+ kind
76
+ });
77
+ }
78
+ function actionChipContent(children, icon, surface) {
79
+ return (state) => /* @__PURE__ */ jsxs(Fragment, { children: [
80
+ chipGlyph({
81
+ isDisabled: state.isDisabled,
82
+ isSelected: false
83
+ }, icon),
84
+ chipLabel(children),
85
+ surface
86
+ ] });
87
+ }
12
88
  /**
13
- * A chip is a two-state button, so its selected state is React Aria's
14
- * `isSelected`: pass it with `onChange` to control it, or `defaultSelected` to
15
- * let it keep its own state. Selection is announced through `aria-pressed`
16
- * rather than a role of its own.
89
+ * A chip. By default a filter chip, which is a two-state button, so its
90
+ * selected state is React Aria's `isSelected`: pass it with `onChange` to
91
+ * control it, or `defaultSelected` to let it keep its own state. Selection is
92
+ * announced through `aria-pressed` rather than a role of its own.
93
+ *
94
+ * `variant="assist"` and `variant="suggestion"` draw the page's two action
95
+ * chips instead: plain buttons, pressed with `onPress`, never selected.
17
96
  */
18
- function Chip(t0) {
19
- const $ = c(14);
20
- let T0;
21
- let children;
22
- let t1;
23
- let t2;
97
+ function Chip(props) {
98
+ const $ = c(4);
99
+ if (isAction(props)) {
100
+ let t0;
101
+ if ($[0] !== props) {
102
+ t0 = /* @__PURE__ */ jsx(ActionChip, { ...props });
103
+ $[0] = props;
104
+ $[1] = t0;
105
+ } else t0 = $[1];
106
+ return t0;
107
+ }
108
+ let t0;
109
+ if ($[2] !== props) {
110
+ t0 = /* @__PURE__ */ jsx(FilterChip, { ...props });
111
+ $[2] = props;
112
+ $[3] = t0;
113
+ } else t0 = $[3];
114
+ return t0;
115
+ }
116
+ function chipContent(children, icon, surface) {
117
+ return (state) => /* @__PURE__ */ jsxs(Fragment, { children: [
118
+ chipGlyph(state, icon),
119
+ chipLabel(children),
120
+ surface
121
+ ] });
122
+ }
123
+ function FilterChip(t0) {
124
+ const $ = c(17);
125
+ const { children, elevated: t1, icon, onContextMenu, onKeyDown, onKeyUp, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, render, variant: t2, ...props } = t0;
126
+ const elevated = t1 === void 0 ? false : t1;
127
+ const variant = t2 === void 0 ? "filter" : t2;
128
+ const element = {
129
+ aria: ariaAttributesOf(props),
130
+ onKeyDown,
131
+ onKeyUp
132
+ };
24
133
  let t3;
25
- if ($[0] !== t0) {
26
- const { children: t4, onKeyDown, onKeyUp, render, ...props } = t0;
27
- children = t4;
28
- const element = {
29
- aria: ariaAttributesOf(props),
30
- onKeyDown,
31
- onKeyUp
134
+ if ($[0] !== onContextMenu || $[1] !== onPointerCancel || $[2] !== onPointerDown || $[3] !== onPointerLeave || $[4] !== onPointerUp) {
135
+ t3 = {
136
+ onContextMenu,
137
+ onPointerCancel,
138
+ onPointerDown,
139
+ onPointerLeave,
140
+ onPointerUp
32
141
  };
33
- T0 = ToggleButton;
34
- t1 = toggleButtonRenderer(element, render);
35
- t2 = props;
36
- t3 = mergeStatefulStyles(propsFor, props);
37
- $[0] = t0;
38
- $[1] = T0;
39
- $[2] = children;
40
- $[3] = t1;
41
- $[4] = t2;
142
+ $[0] = onContextMenu;
143
+ $[1] = onPointerCancel;
144
+ $[2] = onPointerDown;
145
+ $[3] = onPointerLeave;
146
+ $[4] = onPointerUp;
42
147
  $[5] = t3;
43
- } else {
44
- T0 = $[1];
45
- children = $[2];
46
- t1 = $[3];
47
- t2 = $[4];
48
- t3 = $[5];
49
- }
50
- let t4;
51
- if ($[6] !== children) {
52
- t4 = chipContent(children);
148
+ } else t3 = $[5];
149
+ const ripple = useRipple(props.isDisabled !== true, t3);
150
+ const T0 = ToggleButton;
151
+ const t4 = toggleButtonRenderer(element, render);
152
+ const t5 = ripple.handlers;
153
+ const t6 = mergeStatefulStyles(filterChipClasses(variant, elevated), props);
154
+ let t7;
155
+ if ($[6] !== children || $[7] !== icon || $[8] !== ripple.surface) {
156
+ t7 = chipContent(children, icon, ripple.surface);
53
157
  $[6] = children;
54
- $[7] = t4;
55
- } else t4 = $[7];
56
- let t5;
57
- if ($[8] !== T0 || $[9] !== t1 || $[10] !== t2 || $[11] !== t3 || $[12] !== t4) {
58
- t5 = /* @__PURE__ */ jsx(T0, {
59
- render: t1,
60
- ...t2,
61
- ...t3,
62
- children: t4
158
+ $[7] = icon;
159
+ $[8] = ripple.surface;
160
+ $[9] = t7;
161
+ } else t7 = $[9];
162
+ let t8;
163
+ if ($[10] !== T0 || $[11] !== props || $[12] !== ripple.handlers || $[13] !== t4 || $[14] !== t6 || $[15] !== t7) {
164
+ t8 = /* @__PURE__ */ jsx(T0, {
165
+ render: t4,
166
+ ...t5,
167
+ ...props,
168
+ ...t6,
169
+ children: t7
63
170
  });
64
- $[8] = T0;
65
- $[9] = t1;
66
- $[10] = t2;
67
- $[11] = t3;
68
- $[12] = t4;
69
- $[13] = t5;
70
- } else t5 = $[13];
71
- return t5;
171
+ $[10] = T0;
172
+ $[11] = props;
173
+ $[12] = ripple.handlers;
174
+ $[13] = t4;
175
+ $[14] = t6;
176
+ $[15] = t7;
177
+ $[16] = t8;
178
+ } else t8 = $[16];
179
+ return t8;
72
180
  }
73
- function chipContent(children) {
74
- return (state) => /* @__PURE__ */ jsxs(Fragment, { children: [chipGlyph(state.isSelected), chipLabel(children)] });
181
+ function filterChipClasses(kind, elevated) {
182
+ return (state) => chipPropsFor(state, {
183
+ elevated,
184
+ kind
185
+ });
75
186
  }
76
- function propsFor(state) {
77
- return props(chipStyles.base, chipStyles.target, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, state.isDisabled && chipStyles.disabled, state.isDisabled && (state.isSelected ? chipStyles.disabledSelected : chipStyles.disabledUnselected));
187
+ function isAction(props) {
188
+ return props.variant === "assist" || props.variant === "suggestion";
78
189
  }
79
190
  //#endregion
80
191
  export { Chip as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ToggleButtonProps","RACToggleButtonProps","ToggleButtonRenderProps","stylex","ToggleButton","chipGlyph","chipLabel","chipStyles","ariaAttributesOf","toggleButtonRenderer","focus","mergeStatefulStyles","ChipProps","Omit","children","Chip","t0","$","T0","t1","t2","t3","t4","onKeyDown","onKeyUp","render","props","element","aria","propsFor","chipContent","t5","state","isSelected","base","target","ring","selected","unselected","isDisabled","disabled","disabledSelected","disabledUnselected","_c","stylex.props"],"sources":["../../../src/components/chip/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { ToggleButtonProps as RACToggleButtonProps, ToggleButtonRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { ToggleButton } from 'react-aria-components';\nimport { chipGlyph, chipLabel } from '../../chip';\nimport { chipStyles } from '../../chip/styles';\nimport { ariaAttributesOf, toggleButtonRenderer } from '../../render/aria';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles } from '../../styles/merge';\n\n// The pill, its two containers, its check and its disabled treatment are the\n// chip module's in `src/chip`, shared with the chips a ChipGroup draws; what\n// is here is React Aria's `ToggleButton` around them, which is what makes a\n// standalone chip a two-state button rather than one of a set.\n//\n// Two of the call site's props go on the element through `src/render/aria`\n// rather than through that spread, as `Button` and `IconButton` do. React\n// Aria builds a button's attributes from an allowlist that holds only the\n// labelling `aria-*` and the state it manages itself, so any other one — a\n// shortcut, an owned element — is dropped before it reaches the DOM. And it\n// wraps a keyboard handler it is given so that the event stops there unless\n// the handler asks otherwise, which is its convention rather than the DOM's;\n// on the element the handler bubbles, so an Escape pressed on a chip inside\n// a dialog still reaches the dialog.\n\ntype ChipProps = Omit<RACToggleButtonProps, 'children'> & {\n /**\n * The chip's label. A node rather than React Aria's node-or-function,\n * since the chip puts its own check before whatever this is and a function\n * would be handed a `defaultChildren` the chip never rendered. ChipGroup's\n * chip narrows it the same way, for the same reason.\n */\n children?: ReactNode;\n};\n\n/**\n * A chip is a two-state button, so its selected state is React Aria's\n * `isSelected`: pass it with `onChange` to control it, or `defaultSelected` to\n * let it keep its own state. Selection is announced through `aria-pressed`\n * rather than a role of its own.\n */\nfunction Chip({\n children,\n onKeyDown,\n onKeyUp,\n render,\n ...props\n}: ChipProps & RefAttributes<HTMLButtonElement>) {\n const element = {\n aria: ariaAttributesOf(props),\n onKeyDown,\n onKeyUp\n };\n return <ToggleButton render={toggleButtonRenderer(element, render)} {...props} {...mergeStatefulStyles(propsFor, props)}>\n {chipContent(children)}\n </ToggleButton>;\n}\n\n// What the chip draws, from React Aria's render state: the check while it is\n// selected, then the label. Built by a call rather than written inline at\n// the prop, which is what react-perf's no-new-function-as-prop is after; the\n// React Compiler memoises the result on its input.\nfunction chipContent(children: ReactNode) {\n return (state: ToggleButtonRenderProps) => <>\n {chipGlyph(state.isSelected)}\n {chipLabel(children)}\n </>;\n}\n\n// StyleX has no way to target [data-selected] on the element it is styling,\n// so the selected styles cannot be chosen in CSS. React Aria's answer is to\n// let className and style be functions of the component's own render state,\n// which is what this is — and it is why an uncontrolled chip styles itself\n// correctly without this component keeping a copy of the state.\n//\n// mergeStatefulStyles takes the function rather than a computed result for\n// exactly that reason, and combines it with whatever the call site passed.\nfunction propsFor(state: ToggleButtonRenderProps) {\n return stylex.props(chipStyles.base, chipStyles.target, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, state.isDisabled && chipStyles.disabled, state.isDisabled && (state.isSelected ? chipStyles.disabledSelected : chipStyles.disabledUnselected));\n}\nexport type { ChipProps };\nexport default Chip;"],"mappings":";;;;;;;;;;;;;;;;;AA2CA,SAAAmB,KAAAC,IAAA;CAAA,MAAAC,IAAApB,EAAA,EAAA;CAAA,IAAAqB;CAAA,IAAAJ;CAAA,IAAAK;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAc,MAAA,EAAAF,UAAAQ,IAAAC,WAAAC,SAAAC,QAAA,GAAAC,UAAAV;EAAAF,WAAAQ;EAOZ,MAAAK,UAAgB;GAAAC,MACRpB,iBAAiBkB,KAAK;GAACH;GAAAC;EAG/B;EACQN,KAAAd;EAAqBe,KAAAV,qBAAqBkB,SAASF,MAAM;EAAOC,KAAAA;EAAWL,KAAAV,oBAAoBkB,UAAUH,KAAK;EAACT,EAAA,KAAAD;EAAAC,EAAA,KAAAC;EAAAD,EAAA,KAAAH;EAAAG,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;CAAA,OAAA;EAAAH,KAAAD,EAAA;EAAAH,WAAAG,EAAA;EAAAE,KAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAAA,IAAAK;CAAA,IAAAL,EAAA,OAAAH,UAAA;EAClHQ,KAAAQ,YAAYhB,QAAQ;EAACG,EAAA,KAAAH;EAAAG,EAAA,KAAAK;CAAA,OAAAA,KAAAL,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAC,MAAAD,EAAA,OAAAE,MAAAF,EAAA,QAAAG,MAAAH,EAAA,QAAAI,MAAAJ,EAAA,QAAAK,IAAA;EADnBS,KAAA,oBAAC,IAAD;GAAsB,QAAAZ;GAAqC,GAAMO;GAAK,GAAML;GAC9EC,UAAAA;EADe,CAAA;EAEHL,EAAA,KAAAC;EAAAD,EAAA,KAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAK;EAAAL,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OAFVc;AAEU;AAOnB,SAASD,YAAYhB,UAAqB;CACxC,QAAQkB,UAAmC,qBAAA,UAAA,EAAA,UAAA,CACtC3B,UAAU2B,MAAMC,UAAU,GAC1B3B,UAAUQ,QAAQ,CACrB,EAAA,CAAA;AACJ;AAUA,SAASe,SAASG,OAAgC;CAChD,OAAO7B,MAAaI,WAAW2B,MAAM3B,WAAW4B,QAAQzB,MAAM0B,MAAMJ,MAAMC,aAAa1B,WAAW8B,WAAW9B,WAAW+B,YAAYN,MAAMO,cAAchC,WAAWiC,UAAUR,MAAMO,eAAeP,MAAMC,aAAa1B,WAAWkC,mBAAmBlC,WAAWmC,mBAAmB;AACnR"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","ButtonRenderProps","FocusableElement","ButtonProps","RACButtonProps","ToggleButtonProps","RACToggleButtonProps","ToggleButtonRenderProps","Button","ToggleButton","ChipKind","chipGlyph","chipLabel","chipPropsFor","useRipple","ariaAttributesOf","buttonRenderer","toggleButtonRenderer","mergeStatefulStyles","ChipActionProps","Omit","children","elevated","icon","variant","ChipFilterProps","ChipProps","ChipVariant","ActionChip","t0","$","t1","onClick","onContextMenu","onKeyDown","onKeyUp","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","render","props","undefined","element","aria","t2","ripple","isDisabled","T0","t3","t4","handlers","t5","actionChipClasses","t6","surface","actionChipContent","t7","kind","state","isSelected","Chip","isAction","chipContent","FilterChip","filterChipClasses","t8","_c"],"sources":["../../../src/components/chip/index.tsx"],"sourcesContent":["'use client'\n\nimport type { ReactNode, RefAttributes } from 'react'\nimport type {\n ButtonRenderProps,\n FocusableElement,\n ButtonProps as RACButtonProps,\n ToggleButtonProps as RACToggleButtonProps,\n ToggleButtonRenderProps,\n} from 'react-aria-components'\n\nimport { Button, ToggleButton } from 'react-aria-components'\n\nimport type { ChipKind } from '../../chip'\n\nimport { chipGlyph, chipLabel, chipPropsFor } from '../../chip'\nimport { useRipple } from '../../hooks/useRipple'\nimport {\n ariaAttributesOf,\n buttonRenderer,\n toggleButtonRenderer,\n} from '../../render/aria'\nimport { mergeStatefulStyles } from '../../styles/merge'\n\n// The pill, its containers, its check and its disabled treatment are the\n// chip module's in `src/chip`, shared with the chips a ChipGroup draws; what\n// is here is React Aria's button around them. Three of the chips page's four\n// chips are drawn here, and `variant` picks the button:\n//\n// - **A filter chip**, the default, is React Aria's `ToggleButton`: a\n// two-state button announced through `aria-pressed`, which takes the\n// secondary container and the check once selected.\n// - **An assist or suggestion chip** is React Aria's `Button`: an action, so\n// nothing is announced as pressed and nothing is ever selected. The two\n// differ in the label's role alone; see `src/chip/styles.ts`.\n//\n// The page's fourth, the input chip, is ChipGroup's removable chip, and a\n// token in a TokenField.\n//\n// Two of the call site's props go on the element through `src/render/aria`\n// rather than through that spread, as `Button` and `IconButton` do. React\n// Aria builds a button's attributes from an allowlist that holds only the\n// labelling `aria-*` and the state it manages itself, so any other one — a\n// shortcut, an owned element — is dropped before it reaches the DOM. And it\n// wraps a keyboard handler it is given so that the event stops there unless\n// the handler asks otherwise, which is its convention rather than the DOM's;\n// on the element the handler bubbles, so an Escape pressed on a chip inside\n// a dialog still reaches the dialog.\n//\n// A press ripples, as it does on every other pressable control here: the\n// chips page names the ripple as the pressed state, beside the layer.\n\n/** An assist or suggestion chip: an action, drawn as a plain button. */\ntype ChipActionProps = Omit<RACButtonProps, 'children' | 'isPending'> & {\n /** The chip's label. */\n children?: ReactNode\n /**\n * Raises the chip off the page on a container of its own, at the page's\n * elevation 1, in place of the outline.\n * @default false\n */\n elevated?: boolean\n /**\n * An icon before the label, in the page's 18dp slot and the primary role.\n * An icon drawn in `em` takes its size from the slot.\n */\n icon?: ReactNode\n /**\n * `assist` for an action the chip's context suggests, and `suggestion`\n * for one the product generates. Either is an action rather than a\n * selection, so neither is ever selected.\n */\n variant: 'assist' | 'suggestion'\n}\n\n/** A filter chip: a two-state button, the default. */\ntype ChipFilterProps = Omit<RACToggleButtonProps, 'children'> & {\n /**\n * The chip's label. A node rather than React Aria's node-or-function,\n * since the chip puts its own check before whatever this is and a function\n * would be handed a `defaultChildren` the chip never rendered. ChipGroup's\n * chip narrows it the same way, for the same reason.\n */\n children?: ReactNode\n /**\n * Raises the chip off the page on a container of its own, at the page's\n * elevation 1, in place of the outline. A selected one keeps the\n * secondary container.\n * @default false\n */\n elevated?: boolean\n /**\n * An icon before the label, in the page's 18dp slot and the primary role.\n * The check takes its place while the chip is selected, so the chip keeps\n * its width. An icon drawn in `em` takes its size from the slot.\n */\n icon?: ReactNode\n /**\n * A filter chip, a two-state button.\n * @default 'filter'\n */\n variant?: 'filter'\n}\n\ntype ChipProps = ChipActionProps | ChipFilterProps\n\n/** Which of the chips page's chips a Chip is. */\ntype ChipVariant = 'assist' | 'filter' | 'suggestion'\n\nfunction ActionChip({\n children,\n elevated = false,\n icon,\n onClick,\n onContextMenu,\n onKeyDown,\n onKeyUp,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n render,\n variant,\n ...props\n}: ChipActionProps & RefAttributes<HTMLButtonElement>) {\n const element = { aria: ariaAttributesOf(props), onKeyDown, onKeyUp }\n // Off while disabled, as on the filter chip. `onClick` goes through the\n // ripple too: on a mouse press the ripple ends on the click, so a call\n // site's own handler spread beside it would leave it pressed.\n const ripple = useRipple<FocusableElement>(props.isDisabled !== true, {\n onClick,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n })\n\n return (\n <Button\n render={buttonRenderer(element, render)}\n {...ripple.handlers}\n {...props}\n {...mergeStatefulStyles(actionChipClasses(variant, elevated), props)}\n >\n {actionChipContent(children, icon, ripple.surface)}\n </Button>\n )\n}\n\n// An action chip's classes: the unselected pill, which it always is.\nfunction actionChipClasses(kind: ChipKind, elevated: boolean) {\n return (state: ButtonRenderProps) =>\n chipPropsFor({ ...state, isSelected: false }, { elevated, kind })\n}\n\n// What an action chip draws: its icon, if any, then the label, and the\n// ripple over both. Built by a call for the reason `chipContent` is.\nfunction actionChipContent(\n children: ReactNode,\n icon: ReactNode,\n surface: ReactNode,\n) {\n return (state: ButtonRenderProps) => (\n <>\n {chipGlyph({ isDisabled: state.isDisabled, isSelected: false }, icon)}\n {chipLabel(children)}\n {surface}\n </>\n )\n}\n\n/**\n * A chip. By default a filter chip, which is a two-state button, so its\n * selected state is React Aria's `isSelected`: pass it with `onChange` to\n * control it, or `defaultSelected` to let it keep its own state. Selection is\n * announced through `aria-pressed` rather than a role of its own.\n *\n * `variant=\"assist\"` and `variant=\"suggestion\"` draw the page's two action\n * chips instead: plain buttons, pressed with `onPress`, never selected.\n */\nfunction Chip(props: ChipProps & RefAttributes<HTMLButtonElement>) {\n if (isAction(props)) {\n return <ActionChip {...props} />\n }\n return <FilterChip {...props} />\n}\n\n// What the chip draws, from React Aria's render state: the check while it is\n// selected or its icon while it is not, then the label, and the ripple over\n// both. Built by a call rather than written inline at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// the result on its inputs.\nfunction chipContent(children: ReactNode, icon: ReactNode, surface: ReactNode) {\n return (state: ToggleButtonRenderProps) => (\n <>\n {chipGlyph(state, icon)}\n {chipLabel(children)}\n {surface}\n </>\n )\n}\n\nfunction FilterChip({\n children,\n elevated = false,\n icon,\n onContextMenu,\n onKeyDown,\n onKeyUp,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n render,\n variant = 'filter',\n ...props\n}: ChipFilterProps & RefAttributes<HTMLButtonElement>) {\n const element = { aria: ariaAttributesOf(props), onKeyDown, onKeyUp }\n // Off while disabled: React Aria still forwards pointer events to a\n // disabled element, and a press that changes nothing should not look like\n // one. Typed as Button's ripple is, since React Aria types a toggle\n // button's pointer events against a <div> rather than the <button> it\n // renders.\n const ripple = useRipple<FocusableElement>(props.isDisabled !== true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n })\n\n return (\n <ToggleButton\n render={toggleButtonRenderer(element, render)}\n {...ripple.handlers}\n {...props}\n {...mergeStatefulStyles(filterChipClasses(variant, elevated), props)}\n >\n {chipContent(children, icon, ripple.surface)}\n </ToggleButton>\n )\n}\n\n// A filter chip's classes, from its render state.\nfunction filterChipClasses(kind: ChipKind, elevated: boolean) {\n return (state: ToggleButtonRenderProps) =>\n chipPropsFor(state, { elevated, kind })\n}\n\n// Whether a chip is one of the two action chips. A guard rather than a\n// comparison at the call, since TypeScript does not narrow the union through\n// React Aria's mapped prop types on `variant` alone.\nfunction isAction(props: ChipProps): props is ChipActionProps {\n return props.variant === 'assist' || props.variant === 'suggestion'\n}\n\nexport type { ChipActionProps, ChipFilterProps, ChipProps, ChipVariant }\n\nexport default Chip\n"],"mappings":";;;;;;;;;AA6GA,SAAA+B,WAAAC,IAAA;CAAA,MAAAC,IAAAhC,EAAA,EAAA;CAAoB,MAAA,EAAAuB,UAAAC,UAAAS,IAAAR,MAAAS,SAAAC,eAAAC,WAAAC,SAAAC,iBAAAC,eAAAC,gBAAAC,aAAAC,QAAAhB,SAAA,GAAAiB,UAAAZ;CAElB,MAAAP,WAAAS,OAAAW,KAAA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,EAAA,QAAAkB,MAAAlB,EAAA,QAAAW,SAAAX,EAAA,QAAAgB,OAAAK,YAAArB,EAAA,QAAAoB,MAAApB,EAAA,QAAAwB,MAAAxB,EAAA,QAAA2B,IAAA;EAN9CS,KAAA,oBAAC,IAAD;GACU,QAAAhB;GAAqC,GACzCE;GAAe,GACfX;GAAK,GACLa;GAEHG,UAAAA;EANU,CAAA;EAOE3B,EAAA,MAAAkB;EAAAlB,EAAA,MAAAW;EAAAX,EAAA,MAAAgB,OAAAK;EAAArB,EAAA,MAAAoB;EAAApB,EAAA,MAAAwB;EAAAxB,EAAA,MAAA2B;EAAA3B,EAAA,MAAAoC;CAAA,OAAAA,KAAApC,EAAA;CAAA,OAPfoC;AAOe;AAKnB,SAASD,kBAAkBP,MAAgBpC,UAAmB;CAC5D,QAAQqC,UACN9C,aAAa8C,OAAO;EAAErC;EAAUoC;CAAK,CAAC;AAC1C;AAKA,SAASI,SAASrB,OAA4C;CAC5D,OAAOA,MAAMjB,YAAY,YAAYiB,MAAMjB,YAAY;AACzD"}
@@ -1,4 +1,4 @@
1
- import { ReactNode, RefAttributes } from "react";
1
+ import { ReactElement, ReactNode, RefAttributes } from "react";
2
2
  import { TagGroupProps, TagListProps, TagProps } from "react-aria-components";
3
3
  //#region src/components/chip-group/index.d.ts
4
4
  type ChipGroupChipProps = Omit<TagProps, 'children' | 'className' | 'style'> & {
@@ -6,12 +6,21 @@ type ChipGroupChipProps = Omit<TagProps, 'children' | 'className' | 'style'> & {
6
6
  children?: ReactNode;
7
7
  /** A function may compute the class from the chip's render state. */
8
8
  className?: TagProps['className'];
9
+ /**
10
+ * An icon before the label, in the page's 18dp slot and the primary role.
11
+ * The check takes its place while the chip is chosen, so the chip keeps
12
+ * its width. An icon drawn in `em` takes its size from the slot.
13
+ */
14
+ icon?: ReactNode;
9
15
  /** A function may compute the style from the chip's render state. */
10
16
  style?: TagProps['style'];
11
17
  };
12
18
  type ChipGroupProps<T extends object = object> = {
13
- /** The chips, each with an `id` of its own. */
14
- children?: ReactNode;
19
+ /**
20
+ * The chips, each with an `id` of its own. With `items`, a function from an
21
+ * item to its chip, which React Aria calls for each item in turn.
22
+ */
23
+ children?: ((item: T) => ReactElement) | ReactNode;
15
24
  /**
16
25
  * A hint under the group. Replaced by `error` when there is one, so the
17
26
  * two never stack.
@@ -35,8 +44,8 @@ type ChipGroupProps<T extends object = object> = {
35
44
  /**
36
45
  * What the close target on each chip is called, for a screen reader. React
37
46
  * Aria adds the chip's own label after it, so this is the verb rather than
38
- * the whole phrase — "Remove" becomes "Remove First item".
39
- * @default 'Remove'
47
+ * the whole phrase — "Remove" becomes "Remove First item". Left out, React
48
+ * Aria names it in the reader's locale — "Remove" in English.
40
49
  */
41
50
  removeLabel?: string;
42
51
  } & Omit<TagGroupProps, 'children'> & Pick<TagListProps<T>, 'items' | 'renderEmptyState'>;
@@ -48,7 +57,7 @@ declare namespace ChipGroup {
48
57
  * One chip. Give every chip an `id` — that is the key selection and removal
49
58
  * are reported by.
50
59
  */
51
- declare function ChipGroupChip({ children, ...props }: ChipGroupChipProps): import("react").JSX.Element;
60
+ declare function ChipGroupChip({ children, icon, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, ...props }: ChipGroupChipProps): import("react").JSX.Element;
52
61
  //#endregion
53
- export { type ChipGroupChipProps, type ChipGroupProps, ChipGroup as default };
62
+ export { ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, ChipGroup as default };
54
63
  //# sourceMappingURL=index.d.ts.map
@@ -2,26 +2,27 @@
2
2
  import { props } from "../../node_modules/@stylexjs/stylex/lib/es/stylex.js";
3
3
  import { mergeStatefulStyles, mergeStyles } from "../../styles/merge.js";
4
4
  import { CloseGlyph } from "../../glyphs/index.js";
5
- import { focus } from "../../styles/focus.js";
5
+ import { useRipple } from "../../hooks/useRipple.js";
6
6
  import { invalidFrom } from "../../field/root.js";
7
7
  import { groupStyles } from "../../field/styles.js";
8
8
  import { FieldLabel, FieldMessage } from "../../field/index.js";
9
9
  import { chipStyles } from "../../chip/styles.js";
10
- import { chipGlyph, chipLabel } from "../../chip/index.js";
10
+ import { chipGlyph, chipLabel, chipPropsFor, chipRemoveClassName } from "../../chip/index.js";
11
11
  import { textOf } from "../../collection/text.js";
12
12
  import { c } from "react/compiler-runtime";
13
13
  import { createContext, useContext } from "react";
14
14
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
15
15
  import { Button, Tag, TagGroup, TagList } from "react-aria-components";
16
16
  //#region src/components/chip-group/index.tsx
17
- function chipContent(children, removeLabel) {
17
+ function chipContent(children, icon, removeLabel, surface) {
18
18
  return (state) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
19
- chipGlyph(state.isSelected),
19
+ chipGlyph(state, icon),
20
20
  chipLabel(children),
21
+ state.selectionMode !== "none" && !state.isDisabled ? surface : null,
21
22
  state.allowsRemoving ? /* @__PURE__ */ jsx(Button, {
22
23
  "aria-label": removeLabel,
24
+ className: chipRemoveClassName,
23
25
  slot: "remove",
24
- ...props(chipStyles.remove),
25
26
  children: /* @__PURE__ */ jsx(CloseGlyph, { ...props(chipStyles.removeGlyph) })
26
27
  }) : null
27
28
  ] });
@@ -47,7 +48,7 @@ function chipContent(children, removeLabel) {
47
48
  * The call site's `className` and `style` land on the group as a whole,
48
49
  * which is the element a layout positions.
49
50
  */
50
- const RemoveLabelContext = createContext("Remove");
51
+ const RemoveLabelContext = createContext(void 0);
51
52
  const LABEL_STATE_VALID = { isInvalid: false };
52
53
  const LABEL_STATE_INVALID = { isInvalid: true };
53
54
  function ChipGroup(t0) {
@@ -70,8 +71,8 @@ function ChipGroup(t0) {
70
71
  error = t5;
71
72
  items = t6;
72
73
  label = t7;
74
+ removeLabel = t8;
73
75
  renderEmptyState = t9;
74
- removeLabel = t8 === void 0 ? "Remove" : t8;
75
76
  invalid = invalidFrom(error);
76
77
  T0 = TagGroup;
77
78
  t1 = props$1;
@@ -173,41 +174,63 @@ function ChipGroup(t0) {
173
174
  * are reported by.
174
175
  */
175
176
  function ChipGroupChip(t0) {
176
- const $ = c(9);
177
- const { children, ...props } = t0;
177
+ const $ = c(18);
178
+ const { children, icon, onContextMenu, onPointerCancel, onPointerDown, onPointerLeave, onPointerUp, ...props } = t0;
178
179
  const removeLabel = useContext(RemoveLabelContext);
180
+ let t1;
181
+ if ($[0] !== onContextMenu || $[1] !== onPointerCancel || $[2] !== onPointerDown || $[3] !== onPointerLeave || $[4] !== onPointerUp) {
182
+ t1 = {
183
+ onContextMenu,
184
+ onPointerCancel,
185
+ onPointerDown,
186
+ onPointerLeave,
187
+ onPointerUp
188
+ };
189
+ $[0] = onContextMenu;
190
+ $[1] = onPointerCancel;
191
+ $[2] = onPointerDown;
192
+ $[3] = onPointerLeave;
193
+ $[4] = onPointerUp;
194
+ $[5] = t1;
195
+ } else t1 = $[5];
196
+ const ripple = useRipple(true, t1, true);
179
197
  const T0 = Tag;
180
- const t1 = props.textValue ?? textOf(children);
181
- const t2 = mergeStatefulStyles(chipPropsFor, props);
182
- let t3;
183
- if ($[0] !== children || $[1] !== removeLabel) {
184
- t3 = chipContent(children, removeLabel);
185
- $[0] = children;
186
- $[1] = removeLabel;
187
- $[2] = t3;
188
- } else t3 = $[2];
189
- let t4;
190
- if ($[3] !== T0 || $[4] !== props || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
191
- t4 = /* @__PURE__ */ jsx(T0, {
192
- textValue: t1,
198
+ const t2 = props.textValue ?? textOf(children);
199
+ const t3 = ripple.handlers;
200
+ const t4 = mergeStatefulStyles(groupChipPropsFor, props);
201
+ let t5;
202
+ if ($[6] !== children || $[7] !== icon || $[8] !== removeLabel || $[9] !== ripple.surface) {
203
+ t5 = chipContent(children, icon, removeLabel, ripple.surface);
204
+ $[6] = children;
205
+ $[7] = icon;
206
+ $[8] = removeLabel;
207
+ $[9] = ripple.surface;
208
+ $[10] = t5;
209
+ } else t5 = $[10];
210
+ let t6;
211
+ if ($[11] !== T0 || $[12] !== props || $[13] !== ripple.handlers || $[14] !== t2 || $[15] !== t4 || $[16] !== t5) {
212
+ t6 = /* @__PURE__ */ jsx(T0, {
213
+ textValue: t2,
214
+ ...t3,
193
215
  ...props,
194
- ...t2,
195
- children: t3
216
+ ...t4,
217
+ children: t5
196
218
  });
197
- $[3] = T0;
198
- $[4] = props;
199
- $[5] = t1;
200
- $[6] = t2;
201
- $[7] = t3;
202
- $[8] = t4;
203
- } else t4 = $[8];
204
- return t4;
219
+ $[11] = T0;
220
+ $[12] = props;
221
+ $[13] = ripple.handlers;
222
+ $[14] = t2;
223
+ $[15] = t4;
224
+ $[16] = t5;
225
+ $[17] = t6;
226
+ } else t6 = $[17];
227
+ return t6;
205
228
  }
206
- function chipPropsFor(state) {
207
- return props(chipStyles.base, chipStyles.target, chipStyles.targetInGroup, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, state.isDisabled && chipStyles.disabled, state.isDisabled && (state.isSelected ? chipStyles.disabledSelected : chipStyles.disabledUnselected));
229
+ function groupChipPropsFor(state) {
230
+ return chipPropsFor(state, { inGroup: true });
208
231
  }
209
232
  ChipGroup.Chip = ChipGroupChip;
210
233
  //#endregion
211
- export { ChipGroup as default };
234
+ export { ChipGroupChip, ChipGroup as default };
212
235
 
213
236
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","ReactNode","RefAttributes","TagGroupProps","RACTagGroupProps","TagListProps","RACTagListProps","TagProps","RACTagProps","TagRenderProps","stylex","createContext","useContext","Button","RACButton","Tag","RACTag","TagGroup","RACTagGroup","TagList","RACTagList","chipGlyph","chipLabel","chipStyles","textOf","FieldLabel","FieldMessage","invalidFrom","groupStyles","CloseGlyph","focus","mergeStatefulStyles","mergeStyles","spacing","ChipGroupChipProps","Omit","children","className","style","ChipGroupProps","description","error","label","removeLabel","Pick","T","chipContent","state","isSelected","allowsRemoving","props","remove","removeGlyph","RemoveLabelContext","LABEL_STATE_VALID","isInvalid","LABEL_STATE_INVALID","ChipGroup","t0","$","T0","invalid","items","renderEmptyState","t1","t2","t3","t4","t5","t6","t7","t8","t9","undefined","root","ChipGroupChip","textValue","chipPropsFor","base","target","targetInGroup","ring","selected","unselected","isDisabled","disabled","disabledSelected","disabledUnselected","Chip","RACButton","stylex.props","_c","props","RACTagGroup","RACTagList","RACTag"],"sources":["../../../src/components/chip-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode, RefAttributes } from 'react';\nimport type { TagGroupProps as RACTagGroupProps, TagListProps as RACTagListProps, TagProps as RACTagProps, TagRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Button as RACButton, Tag as RACTag, TagGroup as RACTagGroup, TagList as RACTagList } from 'react-aria-components';\nimport { chipGlyph, chipLabel } from '../../chip';\nimport { chipStyles } from '../../chip/styles';\nimport { textOf } from '../../collection/text';\nimport { FieldLabel, FieldMessage } from '../../field';\nimport { invalidFrom } from '../../field/root';\nimport { groupStyles } from '../../field/styles';\nimport { CloseGlyph } from '../../glyphs';\nimport { focus } from '../../styles/focus';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// The chips page's filter and input chips as a set: one or more chosen from a\n// row, each one removable. The pill is the chip module's in `src/chip`,\n// shared with the standalone Chip, so the two cannot drift; what is here is\n// the group around them.\n//\n// Three things it adds over a row of Chips.\n//\n// **It is a group, not a row of buttons.** React Aria's `TagGroup` names the\n// set, describes it, reports it invalid as a whole, and moves between its\n// chips with the arrow keys rather than making each one a tab stop — which\n// is what a set of a dozen filters needs. The label, the supporting line and\n// the error are the field chrome's, so a group reads like the fields beside\n// it, exactly as CheckboxGroup and RadioGroup do.\n//\n// **A chip can be removed.** Give the group `onRemove` and each chip draws\n// the page's trailing close target, an 18dp glyph in a target of its own so a\n// press there removes rather than toggles. Backspace and Delete remove the\n// focused chip too, which is React Aria's. A chosen chip's check sits at the\n// other end, so a chip that is both selected and removable carries one glyph\n// on each side of its label.\n//\n// **Selection is the group's, not each chip's.** `selectionMode` and\n// `selectedKeys` live on the group, so a set that chooses one of its chips\n// and a set that chooses several are the same component with a different\n// word. A chip on its own that toggles nothing else is still Chip.\n//\n// One thing is worth knowing about how this maps onto React Aria. A chip's\n// text value is read off its children and found only when they are a plain\n// string, and a chip here is always an element — the label sits beside a\n// close target. So a plain-string label is passed through as the text value,\n// which is what typeahead and a screen reader's announcement are made of;\n// see ListBox.Item, where the same thing bit.\n\ntype ChipGroupChipProps = Omit<RACTagProps, 'children' | 'className' | 'style'> & {\n /** The chip's label. */\n children?: ReactNode;\n /** A function may compute the class from the chip's render state. */\n className?: RACTagProps['className'];\n /** A function may compute the style from the chip's render state. */\n style?: RACTagProps['style'];\n};\ntype ChipGroupProps<T extends object = object> = {\n /** The chips, each with an `id` of its own. */\n children?: ReactNode;\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n description?: string;\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state — the message and `aria-invalid` both\n * follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * What the group is for. Required rather than optional: a set of chips\n * with no name is a row a screen reader cannot introduce.\n */\n label: string;\n /**\n * What the close target on each chip is called, for a screen reader. React\n * Aria adds the chip's own label after it, so this is the verb rather than\n * the whole phrase — \"Remove\" becomes \"Remove First item\".\n * @default 'Remove'\n */\n removeLabel?: string;\n} & Omit<RACTagGroupProps, 'children'> & Pick<RACTagListProps<T>, 'items' | 'renderEmptyState'>;\n\n// What the chip draws, from React Aria's render state. Built by a call rather\n// than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result on\n// its inputs.\n//\n// The check is the chip module's, so a chip in a group and a chip on its own\n// draw the same one. The close target is drawn only where the group allows\n// removing, which React Aria reports rather than the call site saying so on\n// every chip.\nfunction chipContent(children: ReactNode, removeLabel: string) {\n return (state: TagRenderProps) => <>\n {chipGlyph(state.isSelected)}\n {chipLabel(children)}\n {state.allowsRemoving ? <RACButton aria-label={removeLabel} slot=\"remove\" {...stylex.props(chipStyles.remove)}>\n <CloseGlyph {...stylex.props(chipStyles.removeGlyph)} />\n </RACButton> : null}\n </>;\n}\n\n/**\n * A labelled set of chips, one or more of which can be chosen, each of which\n * can be removed. Selection is React Aria's: set `selectionMode` to `single`\n * or `multiple` and pass `selectedKeys` with `onSelectionChange` to control\n * it, or `defaultSelectedKeys` to let it keep its own.\n *\n * ```tsx\n * <ChipGroup label=\"Label\" selectionMode=\"multiple\" onRemove={remove}>\n * <ChipGroup.Chip id=\"first\">First item</ChipGroup.Chip>\n * </ChipGroup>\n * ```\n *\n * Give the group `onRemove` and each chip draws a close target. The arrow\n * keys move between chips, so a set of many is one tab stop rather than many.\n *\n * A chip that toggles nothing else is Chip; this is for a set that shares a\n * value.\n *\n * The call site's `className` and `style` land on the group as a whole,\n * which is the element a layout positions.\n */\n// What each chip calls its close target. A context rather than a prop on the\n// chip, since it is the group's decision and repeating it on every chip is\n// how the two drift.\nconst RemoveLabelContext = createContext('Remove');\n\n// Hoisted so neither is a new object on every render.\nconst LABEL_STATE_VALID = {\n isInvalid: false\n};\nconst LABEL_STATE_INVALID = {\n isInvalid: true\n};\nfunction ChipGroup<T extends object = object>({\n children,\n description,\n error,\n items,\n label,\n removeLabel = 'Remove',\n renderEmptyState,\n ...props\n}: ChipGroupProps<T> & RefAttributes<HTMLDivElement>) {\n const invalid = invalidFrom(error);\n return <RACTagGroup {...props} {...mergeStyles(stylex.props(groupStyles.root), props)}>\n {/* React Aria's tag group has no disabled state of its own — a chip is\n disabled through the group's `disabledKeys` — so the label follows\n validity alone. */}\n <FieldLabel state={invalid ? LABEL_STATE_INVALID : LABEL_STATE_VALID} variant=\"group\">\n {label}\n </FieldLabel>\n <RemoveLabelContext value={removeLabel}>\n <RACTagList<T> items={items} renderEmptyState={renderEmptyState} className=\"x9f619 x78zum5 x1a02dak x126z3so x1t137rt\">\n {children}\n </RACTagList>\n </RemoveLabelContext>\n <FieldMessage description={description} error={error} inset={false} />\n </RACTagGroup>;\n}\n\n/**\n * One chip. Give every chip an `id` — that is the key selection and removal\n * are reported by.\n */\nfunction ChipGroupChip({\n children,\n ...props\n}: ChipGroupChipProps) {\n const removeLabel = useContext(RemoveLabelContext);\n return <RACTag textValue={props.textValue ?? textOf(children)} {...props} {...mergeStatefulStyles(chipPropsFor, props)}>\n {chipContent(children, removeLabel)}\n </RACTag>;\n}\n\n// StyleX cannot target `[data-selected]` on the element it is styling, so a\n// chip's state comes from the render state React Aria hands its className.\n// Disabled is applied last so it wins over both containers, and StyleX\n// replaces a property whole, so it takes their hover branches with it.\nfunction chipPropsFor(state: TagRenderProps) {\n return stylex.props(chipStyles.base, chipStyles.target, chipStyles.targetInGroup, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, state.isDisabled && chipStyles.disabled, state.isDisabled && (state.isSelected ? chipStyles.disabledSelected : chipStyles.disabledUnselected));\n}\nChipGroup.Chip = ChipGroupChip;\nexport type { ChipGroupChipProps, ChipGroupProps };\nexport default ChipGroup;"],"mappings":";;;;;;;;;;;;;;;;AAqGA,SAAS+C,YAAYV,UAAqBO,aAAqB;CAC7D,QAAQI,UAA0B,qBAAA,YAAA,EAAA,UAAA;EAC7B1B,UAAU0B,MAAMC,UAAU;EAC1B1B,UAAUc,QAAQ;EAClBW,MAAME,iBAAiB,oBAACwC,QAAD;GAAW,cAAY9C;GAAa,MAAK;GAAS,GAAIjC,MAAaa,WAAW4B,MAAM;GACxG,UAAA,oBAAC,YAAD,EAAY,GAAIzC,MAAaa,WAAW6B,WAAW,EAAE,CAAA;EAC5C,CAAA,IAAI;CACnB,EAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMC,qBAAqB1C,cAAc,QAAQ;AAGjD,MAAM2C,oBAAoB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AAazB,WAAW2D,WAAW3D,WAAW4D,YAAYpC,MAAMqC,cAAc7D,WAAW8D,UAAUtC,MAAMqC,eAAerC,MAAMC,aAAazB,WAAW+D,mBAAmB/D,WAAWgE,mBAAmB;AAC7S;AACA9B,UAAU+B,OAAOb"}
1
+ {"version":3,"file":"index.js","names":["c","_c","ReactElement","ReactNode","RefAttributes","TagGroupProps","RACTagGroupProps","TagListProps","RACTagListProps","TagProps","RACTagProps","TagRenderProps","stylex","createContext","useContext","Button","RACButton","Tag","RACTag","TagGroup","RACTagGroup","TagList","RACTagList","chipGlyph","chipLabel","chipPropsFor","chipRemoveClassName","chipStyles","textOf","FieldLabel","FieldMessage","invalidFrom","groupStyles","CloseGlyph","useRipple","mergeStatefulStyles","mergeStyles","spacing","ChipGroupChipProps","Omit","children","className","icon","style","ChipGroupProps","item","T","description","error","label","removeLabel","Pick","chipContent","surface","state","selectionMode","isDisabled","allowsRemoving","props","removeGlyph","RemoveLabelContext","undefined","LABEL_STATE_VALID","isInvalid","LABEL_STATE_INVALID","ChipGroup","t0","$","T0","invalid","items","renderEmptyState","t1","t2","t3","t4","t5","t6","t7","t8","t9","root","ChipGroupChip","onContextMenu","onPointerCancel","onPointerDown","onPointerLeave","onPointerUp","ripple","textValue","handlers","groupChipPropsFor","inGroup","Chip","RACButton","stylex.props","_c","props","RACTagGroup","RACTagList","RACTag"],"sources":["../../../src/components/chip-group/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement, ReactNode, RefAttributes } from 'react';\nimport type { TagGroupProps as RACTagGroupProps, TagListProps as RACTagListProps, TagProps as RACTagProps, TagRenderProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { Button as RACButton, Tag as RACTag, TagGroup as RACTagGroup, TagList as RACTagList } from 'react-aria-components';\nimport { chipGlyph, chipLabel, chipPropsFor, chipRemoveClassName } from '../../chip';\nimport { chipStyles } from '../../chip/styles';\nimport { textOf } from '../../collection/text';\nimport { FieldLabel, FieldMessage } from '../../field';\nimport { invalidFrom } from '../../field/root';\nimport { groupStyles } from '../../field/styles';\nimport { CloseGlyph } from '../../glyphs';\nimport { useRipple } from '../../hooks/useRipple';\nimport { mergeStatefulStyles, mergeStyles } from '../../styles/merge';\nimport '../../tokens/design.tokens.stylex';\nimport { spacing } from '../../tokens/design.tokens.stylex';\n\n// The chips page's filter and input chips as a set: one or more chosen from a\n// row, each one removable. The pill is the chip module's in `src/chip`,\n// shared with the standalone Chip, so the two cannot drift; what is here is\n// the group around them.\n//\n// Three things it adds over a row of Chips.\n//\n// **It is a group, not a row of buttons.** React Aria's `TagGroup` names the\n// set, describes it, reports it invalid as a whole, and moves between its\n// chips with the arrow keys rather than making each one a tab stop — which\n// is what a set of a dozen filters needs. The label, the supporting line and\n// the error are the field chrome's, so a group reads like the fields beside\n// it, exactly as CheckboxGroup and RadioGroup do.\n//\n// **A chip can be removed.** Give the group `onRemove` and each chip draws\n// the page's trailing close target, an 18dp glyph in a target of its own so a\n// press there removes rather than toggles. Backspace and Delete remove the\n// focused chip too, which is React Aria's. A chosen chip's check sits at the\n// other end, so a chip that is both selected and removable carries one glyph\n// on each side of its label.\n//\n// **Selection is the group's, not each chip's.** `selectionMode` and\n// `selectedKeys` live on the group, so a set that chooses one of its chips\n// and a set that chooses several are the same component with a different\n// word. A chip on its own that toggles nothing else is still Chip.\n//\n// One thing is worth knowing about how this maps onto React Aria. A chip's\n// text value is read off its children and found only when they are a plain\n// string, and a chip here is always an element — the label sits beside a\n// close target. So a plain-string label is passed through as the text value,\n// which is what typeahead and a screen reader's announcement are made of;\n// see ListBox.Item, where the same thing bit.\n\ntype ChipGroupChipProps = Omit<RACTagProps, 'children' | 'className' | 'style'> & {\n /** The chip's label. */\n children?: ReactNode;\n /** A function may compute the class from the chip's render state. */\n className?: RACTagProps['className'];\n /**\n * An icon before the label, in the page's 18dp slot and the primary role.\n * The check takes its place while the chip is chosen, so the chip keeps\n * its width. An icon drawn in `em` takes its size from the slot.\n */\n icon?: ReactNode;\n /** A function may compute the style from the chip's render state. */\n style?: RACTagProps['style'];\n};\ntype ChipGroupProps<T extends object = object> = {\n /**\n * The chips, each with an `id` of its own. With `items`, a function from an\n * item to its chip, which React Aria calls for each item in turn.\n */\n children?: ((item: T) => ReactElement) | ReactNode;\n /**\n * A hint under the group. Replaced by `error` when there is one, so the\n * two never stack.\n */\n description?: string;\n /**\n * The problem with the current selection, in words. Its presence is what\n * puts the group in its error state — the message and `aria-invalid` both\n * follow from it.\n *\n * Outside a `Form` the message line arrives with the message, so the\n * field grows when this does and moves what is under it. A `Form` holds\n * that space from the start; so does a permanent `description`.\n */\n error?: string;\n /**\n * What the group is for. Required rather than optional: a set of chips\n * with no name is a row a screen reader cannot introduce.\n */\n label: string;\n /**\n * What the close target on each chip is called, for a screen reader. React\n * Aria adds the chip's own label after it, so this is the verb rather than\n * the whole phrase — \"Remove\" becomes \"Remove First item\". Left out, React\n * Aria names it in the reader's locale — \"Remove\" in English.\n */\n removeLabel?: string;\n} & Omit<RACTagGroupProps, 'children'> & Pick<RACTagListProps<T>, 'items' | 'renderEmptyState'>;\n\n// What the chip draws, from React Aria's render state. Built by a call rather\n// than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after; the React Compiler memoises the result on\n// its inputs.\n//\n// The check and the icon it replaces are the chip module's, so a chip in a\n// group and a chip on its own draw the same ones. The close target is drawn\n// only where the group allows removing, which React Aria reports rather than\n// the call site saying so on every chip.\n//\n// The ripple is drawn only on a chip a press does something to: one the\n// group lets be selected, and not disabled. A chip in a group that selects\n// nothing is a control only for its close target, and React Aria reports\n// neither hover nor press on it, so a ripple there would answer a press that\n// changes nothing.\nfunction chipContent(children: ReactNode, icon: ReactNode, removeLabel: string | undefined, surface: ReactNode) {\n return (state: TagRenderProps) => <>\n {chipGlyph(state, icon)}\n {chipLabel(children)}\n {state.selectionMode !== 'none' && !state.isDisabled ? surface : null}\n {state.allowsRemoving ? <RACButton aria-label={removeLabel} className={chipRemoveClassName} slot=\"remove\">\n <CloseGlyph {...stylex.props(chipStyles.removeGlyph)} />\n </RACButton> : null}\n </>;\n}\n\n/**\n * A labelled set of chips, one or more of which can be chosen, each of which\n * can be removed. Selection is React Aria's: set `selectionMode` to `single`\n * or `multiple` and pass `selectedKeys` with `onSelectionChange` to control\n * it, or `defaultSelectedKeys` to let it keep its own.\n *\n * ```tsx\n * <ChipGroup label=\"Label\" selectionMode=\"multiple\" onRemove={remove}>\n * <ChipGroup.Chip id=\"first\">First item</ChipGroup.Chip>\n * </ChipGroup>\n * ```\n *\n * Give the group `onRemove` and each chip draws a close target. The arrow\n * keys move between chips, so a set of many is one tab stop rather than many.\n *\n * A chip that toggles nothing else is Chip; this is for a set that shares a\n * value.\n *\n * The call site's `className` and `style` land on the group as a whole,\n * which is the element a layout positions.\n */\n// What each chip calls its close target. A context rather than a prop on the\n// chip, since it is the group's decision and repeating it on every chip is\n// how the two drift. Undefined unless the group is given one, which leaves\n// the name React Aria gives in the reader's locale.\nconst RemoveLabelContext = createContext<string | undefined>(undefined);\n\n// Hoisted so neither is a new object on every render.\nconst LABEL_STATE_VALID = {\n isInvalid: false\n};\nconst LABEL_STATE_INVALID = {\n isInvalid: true\n};\nfunction ChipGroup<T extends object = object>({\n children,\n description,\n error,\n items,\n label,\n removeLabel,\n renderEmptyState,\n ...props\n}: ChipGroupProps<T> & RefAttributes<HTMLDivElement>) {\n const invalid = invalidFrom(error);\n return <RACTagGroup {...props} {...mergeStyles(stylex.props(groupStyles.root), props)}>\n {/* React Aria's tag group has no disabled state of its own — a chip is\n disabled through the group's `disabledKeys` — so the label follows\n validity alone. */}\n <FieldLabel state={invalid ? LABEL_STATE_INVALID : LABEL_STATE_VALID} variant=\"group\">\n {label}\n </FieldLabel>\n <RemoveLabelContext value={removeLabel}>\n <RACTagList<T> items={items} renderEmptyState={renderEmptyState} className=\"x9f619 x78zum5 x1a02dak x126z3so x1t137rt\">\n {children}\n </RACTagList>\n </RemoveLabelContext>\n <FieldMessage description={description} error={error} inset={false} />\n </RACTagGroup>;\n}\n\n/**\n * One chip. Give every chip an `id` — that is the key selection and removal\n * are reported by.\n */\nfunction ChipGroupChip({\n children,\n icon,\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp,\n ...props\n}: ChipGroupChipProps) {\n const removeLabel = useContext(RemoveLabelContext);\n // The press ripple a list's rows draw — see ListItem there. A chip in a\n // group is a collection row, whose clicks React Aria keeps for itself, so\n // the press ends when the pointer is released rather than on a click.\n const ripple = useRipple<HTMLDivElement>(true, {\n onContextMenu,\n onPointerCancel,\n onPointerDown,\n onPointerLeave,\n onPointerUp\n }, true);\n return <RACTag textValue={props.textValue ?? textOf(children)} {...ripple.handlers} {...props} {...mergeStatefulStyles(groupChipPropsFor, props)}>\n {chipContent(children, icon, removeLabel, ripple.surface)}\n </RACTag>;\n}\n\n// The pill a standalone Chip draws, from `src/chip`, with the touch target a\n// chip in a group takes instead.\nfunction groupChipPropsFor(state: TagRenderProps) {\n return chipPropsFor(state, {\n inGroup: true\n });\n}\nChipGroup.Chip = ChipGroupChip;\nexport type { ChipGroupChipProps, ChipGroupProps };\nexport { ChipGroupChip };\nexport default ChipGroup;"],"mappings":";;;;;;;;;;;;;;;;AAoHA,SAASoD,YAAYZ,UAAqBE,MAAiBQ,aAAiCG,SAAoB;CAC9G,QAAQC,UAA0B,qBAAA,YAAA,EAAA,UAAA;EAC7B/B,UAAU+B,OAAOZ,IAAI;EACrBlB,UAAUgB,QAAQ;EAClBc,MAAMC,kBAAkB,UAAU,CAACD,MAAME,aAAaH,UAAU;EAChEC,MAAMG,iBAAiB,oBAACqC,QAAD;GAAW,cAAY5C;GAAa,WAAWxB;GAAqB,MAAK;GAC7F,UAAA,oBAAC,YAAD,EAAY,GAAId,MAAae,WAAWgC,WAAW,EAAE,CAAA;EAC5C,CAAA,IAAI;CACnB,EAAA,CAAA;AACJ;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAMC,qBAAqB/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