@kanso-labs/react-native-kanso-ui 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +37 -0
  2. package/dist/badge/index.js +9 -68
  3. package/dist/badge/index.js.map +1 -1
  4. package/dist/button/index.d.ts +2 -1
  5. package/dist/button/index.js +1 -1
  6. package/dist/button/index.js.map +1 -1
  7. package/dist/button/palettes.d.ts +2 -0
  8. package/dist/button/pending.js +17 -21
  9. package/dist/button/pending.js.map +1 -1
  10. package/dist/calendar/index.js +1 -1
  11. package/dist/components/autocomplete/index.js +28 -26
  12. package/dist/components/autocomplete/index.js.map +1 -1
  13. package/dist/components/avatar/index.d.ts +2 -2
  14. package/dist/components/avatar/index.js +2 -2
  15. package/dist/components/avatar/index.js.map +1 -1
  16. package/dist/components/badge/index.d.ts +48 -0
  17. package/dist/components/badge/index.js +122 -0
  18. package/dist/components/badge/index.js.map +1 -0
  19. package/dist/{badge → components/badge}/styles.js +10 -6
  20. package/dist/components/badge/styles.js.map +1 -0
  21. package/dist/components/breadcrumbs/index.d.ts +66 -0
  22. package/dist/components/breadcrumbs/index.js +285 -0
  23. package/dist/components/breadcrumbs/index.js.map +1 -0
  24. package/dist/components/calendar/index.d.ts +1 -1
  25. package/dist/components/calendar/index.js +77 -38
  26. package/dist/components/calendar/index.js.map +1 -1
  27. package/dist/components/checkbox/index.d.ts +7 -1
  28. package/dist/components/checkbox/index.js +183 -138
  29. package/dist/components/checkbox/index.js.map +1 -1
  30. package/dist/components/checkbox-group/index.d.ts +93 -0
  31. package/dist/components/checkbox-group/index.js +306 -0
  32. package/dist/components/checkbox-group/index.js.map +1 -0
  33. package/dist/components/chip-group/index.d.ts +4 -3
  34. package/dist/components/chip-group/index.js +47 -45
  35. package/dist/components/chip-group/index.js.map +1 -1
  36. package/dist/components/code/index.d.ts +25 -0
  37. package/dist/components/code/index.js +87 -0
  38. package/dist/components/code/index.js.map +1 -0
  39. package/dist/components/container/index.d.ts +47 -0
  40. package/dist/components/container/index.js +85 -0
  41. package/dist/components/container/index.js.map +1 -0
  42. package/dist/components/copy-field/index.d.ts +5 -5
  43. package/dist/components/copy-field/index.js +30 -28
  44. package/dist/components/copy-field/index.js.map +1 -1
  45. package/dist/components/currency/index.d.ts +2 -2
  46. package/dist/components/currency/index.js +3 -1
  47. package/dist/components/currency/index.js.map +1 -1
  48. package/dist/components/fab/index.d.ts +80 -0
  49. package/dist/components/fab/index.js +231 -0
  50. package/dist/components/fab/index.js.map +1 -0
  51. package/dist/components/fab-menu/index.d.ts +120 -0
  52. package/dist/components/fab-menu/index.js +640 -0
  53. package/dist/components/fab-menu/index.js.map +1 -0
  54. package/dist/components/feed/index.d.ts +57 -0
  55. package/dist/components/feed/index.js +167 -0
  56. package/dist/components/feed/index.js.map +1 -0
  57. package/dist/components/keycap/index.d.ts +27 -0
  58. package/dist/components/keycap/index.js +136 -0
  59. package/dist/components/keycap/index.js.map +1 -0
  60. package/dist/components/list/index.d.ts +6 -5
  61. package/dist/components/list/index.js +97 -106
  62. package/dist/components/list/index.js.map +1 -1
  63. package/dist/components/menu/index.d.ts +4 -3
  64. package/dist/components/menu/index.js +33 -40
  65. package/dist/components/menu/index.js.map +1 -1
  66. package/dist/components/meter/index.d.ts +2 -1
  67. package/dist/components/meter/index.js +9 -7
  68. package/dist/components/meter/index.js.map +1 -1
  69. package/dist/components/number-field/index.d.ts +7 -3
  70. package/dist/components/number-field/index.js +214 -192
  71. package/dist/components/number-field/index.js.map +1 -1
  72. package/dist/components/product-icon/index.d.ts +2 -2
  73. package/dist/components/product-icon/index.js +2 -2
  74. package/dist/components/product-icon/index.js.map +1 -1
  75. package/dist/components/progress-indicator/index.d.ts +2 -1
  76. package/dist/components/progress-indicator/index.js +15 -13
  77. package/dist/components/progress-indicator/index.js.map +1 -1
  78. package/dist/components/search-field/index.d.ts +3 -3
  79. package/dist/components/search-field/index.js +105 -104
  80. package/dist/components/search-field/index.js.map +1 -1
  81. package/dist/components/separator/index.d.ts +3 -2
  82. package/dist/components/separator/index.js +29 -26
  83. package/dist/components/separator/index.js.map +1 -1
  84. package/dist/components/sheet/index.d.ts +2 -2
  85. package/dist/components/sheet/index.js +22 -26
  86. package/dist/components/sheet/index.js.map +1 -1
  87. package/dist/components/snackbar/index.d.ts +3 -3
  88. package/dist/components/snackbar/index.js +36 -34
  89. package/dist/components/snackbar/index.js.map +1 -1
  90. package/dist/components/supporting-pane/index.d.ts +44 -0
  91. package/dist/components/supporting-pane/index.js +109 -0
  92. package/dist/components/supporting-pane/index.js.map +1 -0
  93. package/dist/components/tag/index.d.ts +58 -0
  94. package/dist/components/tag/index.js +205 -0
  95. package/dist/components/tag/index.js.map +1 -0
  96. package/dist/components/text/index.d.ts +1 -1
  97. package/dist/components/text/index.js +49 -21
  98. package/dist/components/text/index.js.map +1 -1
  99. package/dist/components/text-area/index.d.ts +145 -0
  100. package/dist/components/text-area/index.js +231 -0
  101. package/dist/components/text-area/index.js.map +1 -0
  102. package/dist/components/text-field/index.d.ts +6 -3
  103. package/dist/components/text-field/index.js +3 -0
  104. package/dist/components/text-field/index.js.map +1 -1
  105. package/dist/components/toolbar/index.d.ts +53 -0
  106. package/dist/components/toolbar/index.js +185 -0
  107. package/dist/components/toolbar/index.js.map +1 -0
  108. package/dist/control/group.js +23 -0
  109. package/dist/control/group.js.map +1 -0
  110. package/dist/fab/index.d.ts +19 -0
  111. package/dist/fab/index.js +147 -0
  112. package/dist/fab/index.js.map +1 -0
  113. package/dist/field/index.js +123 -79
  114. package/dist/field/index.js.map +1 -1
  115. package/dist/field/styles.js +18 -0
  116. package/dist/field/styles.js.map +1 -1
  117. package/dist/form/index.d.ts +1 -2
  118. package/dist/form/index.js +1 -1
  119. package/dist/form/index.js.map +1 -1
  120. package/dist/i18n/index.js +12 -1
  121. package/dist/i18n/index.js.map +1 -1
  122. package/dist/i18n/messages.js +367 -0
  123. package/dist/i18n/messages.js.map +1 -1
  124. package/dist/i18n/provider.d.ts +53 -0
  125. package/dist/i18n/provider.js +96 -0
  126. package/dist/i18n/provider.js.map +1 -0
  127. package/dist/index.d.ts +19 -4
  128. package/dist/index.js +17 -3
  129. package/dist/indicator/index.js +1 -2
  130. package/dist/indicator/index.js.map +1 -1
  131. package/dist/mark/index.js +77 -117
  132. package/dist/mark/index.js.map +1 -1
  133. package/dist/mark/initials.js.map +1 -1
  134. package/dist/modal/index.js +59 -46
  135. package/dist/modal/index.js.map +1 -1
  136. package/dist/navigation/index.js +8 -5
  137. package/dist/navigation/index.js.map +1 -1
  138. package/dist/number/count.js +15 -0
  139. package/dist/number/count.js.map +1 -0
  140. package/dist/number/locale.js.map +1 -1
  141. package/dist/overlay/host.js +30 -21
  142. package/dist/overlay/host.js.map +1 -1
  143. package/dist/overlay/placement.js +3 -1
  144. package/dist/overlay/placement.js.map +1 -1
  145. package/dist/separator/index.js +7 -0
  146. package/dist/separator/index.js.map +1 -0
  147. package/dist/typography/size.js +14 -0
  148. package/dist/typography/size.js.map +1 -0
  149. package/package.json +1 -1
  150. package/dist/badge/styles.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { useTheme } from "../../theme/scope.js";
2
2
  import { composeStyles } from "../../theme/styles.js";
3
- import { localeOf } from "../../number/locale.js";
3
+ import { useLocaleOf } from "../../i18n/provider.js";
4
4
  import { stylesOf } from "../../calendar/styles.js";
5
5
  import { CalendarFrame, visibleMonthOf } from "../../calendar/index.js";
6
6
  import { c } from "react/compiler-runtime";
@@ -27,54 +27,93 @@ import { useCalendarState } from "react-stately/useCalendarState";
27
27
  * `style`, `ref` and `testID` land on the container.
28
28
  */
29
29
  function Calendar(t0) {
30
- const $ = c(12);
31
- const { "aria-label": ariaLabel, locale, ref, showMonthYearMenus: t1, style, testID, ...props } = t0;
30
+ const $ = c(26);
31
+ let ariaLabel;
32
+ let locale;
33
+ let props;
34
+ let ref;
35
+ let style;
36
+ let t1;
37
+ let testID;
38
+ if ($[0] !== t0) {
39
+ ({"aria-label": ariaLabel, locale, ref, showMonthYearMenus: t1, style, testID, ...props} = t0);
40
+ $[0] = t0;
41
+ $[1] = ariaLabel;
42
+ $[2] = locale;
43
+ $[3] = props;
44
+ $[4] = ref;
45
+ $[5] = style;
46
+ $[6] = t1;
47
+ $[7] = testID;
48
+ } else {
49
+ ariaLabel = $[1];
50
+ locale = $[2];
51
+ props = $[3];
52
+ ref = $[4];
53
+ style = $[5];
54
+ t1 = $[6];
55
+ testID = $[7];
56
+ }
32
57
  const showMonthYearMenus = t1 === void 0 ? false : t1;
33
- const writtenIn = localeOf(locale);
58
+ const writtenIn = useLocaleOf(locale);
34
59
  const own = stylesOf(useTheme());
35
- const state = useCalendarState({
36
- ...props,
37
- createCalendar,
38
- locale: writtenIn
39
- });
40
- const month = visibleMonthOf(state, writtenIn);
60
+ let t2;
61
+ if ($[8] !== props || $[9] !== writtenIn) {
62
+ t2 = {
63
+ ...props,
64
+ createCalendar,
65
+ locale: writtenIn
66
+ };
67
+ $[8] = props;
68
+ $[9] = writtenIn;
69
+ $[10] = t2;
70
+ } else t2 = $[10];
71
+ const state = useCalendarState(t2);
72
+ let t3;
73
+ if ($[11] !== state || $[12] !== writtenIn) {
74
+ t3 = visibleMonthOf(state, writtenIn);
75
+ $[11] = state;
76
+ $[12] = writtenIn;
77
+ $[13] = t3;
78
+ } else t3 = $[13];
79
+ const month = t3;
41
80
  const T0 = View;
42
- const t2 = ariaLabel === void 0 ? month : `${ariaLabel}, ${month}`;
43
- const t3 = "group";
44
- const t4 = composeStyles(own.root, style);
45
- let t5;
46
- if ($[0] !== props.firstDayOfWeek || $[1] !== showMonthYearMenus || $[2] !== state || $[3] !== writtenIn) {
47
- t5 = /* @__PURE__ */ jsx(CalendarFrame, {
81
+ const t4 = ariaLabel === void 0 ? month : `${ariaLabel}, ${month}`;
82
+ const t5 = "group";
83
+ const t6 = composeStyles(own.root, style);
84
+ let t7;
85
+ if ($[14] !== props.firstDayOfWeek || $[15] !== showMonthYearMenus || $[16] !== state || $[17] !== writtenIn) {
86
+ t7 = /* @__PURE__ */ jsx(CalendarFrame, {
48
87
  firstDayOfWeek: props.firstDayOfWeek,
49
88
  locale: writtenIn,
50
89
  showMonthYearMenus,
51
90
  state
52
91
  });
53
- $[0] = props.firstDayOfWeek;
54
- $[1] = showMonthYearMenus;
55
- $[2] = state;
56
- $[3] = writtenIn;
57
- $[4] = t5;
58
- } else t5 = $[4];
59
- let t6;
60
- if ($[5] !== T0 || $[6] !== ref || $[7] !== t2 || $[8] !== t4 || $[9] !== t5 || $[10] !== testID) {
61
- t6 = /* @__PURE__ */ jsx(T0, {
62
- "aria-label": t2,
92
+ $[14] = props.firstDayOfWeek;
93
+ $[15] = showMonthYearMenus;
94
+ $[16] = state;
95
+ $[17] = writtenIn;
96
+ $[18] = t7;
97
+ } else t7 = $[18];
98
+ let t8;
99
+ if ($[19] !== T0 || $[20] !== ref || $[21] !== t4 || $[22] !== t6 || $[23] !== t7 || $[24] !== testID) {
100
+ t8 = /* @__PURE__ */ jsx(T0, {
101
+ "aria-label": t4,
63
102
  ref,
64
- role: t3,
65
- style: t4,
103
+ role: t5,
104
+ style: t6,
66
105
  testID,
67
- children: t5
106
+ children: t7
68
107
  });
69
- $[5] = T0;
70
- $[6] = ref;
71
- $[7] = t2;
72
- $[8] = t4;
73
- $[9] = t5;
74
- $[10] = testID;
75
- $[11] = t6;
76
- } else t6 = $[11];
77
- return t6;
108
+ $[19] = T0;
109
+ $[20] = ref;
110
+ $[21] = t4;
111
+ $[22] = t6;
112
+ $[23] = t7;
113
+ $[24] = testID;
114
+ $[25] = t8;
115
+ } else t8 = $[25];
116
+ return t8;
78
117
  }
79
118
  //#endregion
80
119
  export { Calendar };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ComponentRef","Ref","StyleProp","ViewStyle","DateValue","CalendarProps","StatelyCalendarProps","createCalendar","View","useCalendarState","CalendarFrame","visibleMonthOf","stylesOf","localeOf","useTheme","composeStyles","Pick","T","locale","ref","showMonthYearMenus","style","testID","Calendar","t0","$","_c","ariaLabel","t1","props","undefined","writtenIn","own","state","month","T0","t2","t3","t4","root","t5","firstDayOfWeek","t6","_c"],"sources":["../../../src/components/calendar/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { StyleProp, ViewStyle } from 'react-native'\nimport type {\n DateValue,\n CalendarProps as StatelyCalendarProps,\n} from 'react-stately/useCalendarState'\n\nimport { createCalendar } from '@internationalized/date'\nimport { View } from 'react-native'\nimport { useCalendarState } from 'react-stately/useCalendarState'\n\nimport { CalendarFrame, visibleMonthOf } from '../../calendar'\nimport { stylesOf } from '../../calendar/styles'\nimport { localeOf } from '../../number/locale'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\n\n// kanso-ui's Calendar, the date pickers page's docked calendar: a month grid\n// with a circle on the selected date and an outline on today. Its values are\n// that page's: a 360dp container on the high surface container, 48dp date\n// cells with a 40dp state layer inside them, body large for both the weekday\n// row and the dates, and primary for the selected circle and for today's\n// outline. The parts are in src/calendar.\n//\n// The state is React Stately's `useCalendarState`, which web's React Aria\n// calendar is built on, over `@internationalized/date`, so the selection,\n// the bounds and the locale's calendar, first day of the week and digits\n// behave as they do on web.\n//\n// The page's container is 456dp tall, which this does not take: that height\n// is a picker's, counting a headline and an action row the calendar itself\n// does not draw. What is held instead is the grid, at six weeks, the most any\n// month occupies, so the calendar keeps its height as the month moves and a\n// shorter month leaves its last rows empty.\n//\n// `showMonthYearMenus` draws the page's docked header instead of one heading:\n// the month's menu button between the chevrons that step it and the year's\n// after them, each opening its list where the grid was, as web's does. The\n// page draws the lists there, and a calendar inside a picker is already in\n// a panel, so a menu over it would be a panel over a panel.\n//\n// Five things are this component's own, as on web.\n//\n// **The year menu has no chevrons of its own.** The page draws a pair either\n// side of it that step a year; the year list reaches any year within a\n// century of the one shown in one press, or any the bounds allow where they\n// are closer.\n//\n// **The cell is a circle in a square.** The page gives the date a 48dp\n// container and a 40dp state layer, which is a 40dp circle with 4dp of room\n// around it. The circle is the pressable, centred in a 48dp column and a 48dp\n// row, and its `hitSlop` reaches the 4dp past it on every side, so the whole\n// square takes the press. The chevrons and the menu buttons reach a 48dp\n// target the same way.\n//\n// **It narrows to its container.** The page's docked calendar is 360dp, and\n// a compact window leaves 328dp between its margins, so the calendar is 360\n// at most and the columns share whatever is left below that.\n//\n// **A date from the month either side is faded because it is disabled**, as\n// React Aria disables those dates: the page's 38% either way. A date\n// `isDateUnavailable` rules out is struck through at full contrast instead,\n// since a reader can still land on it and has to read it.\n//\n// **Today reads as today whether or not it is selected.** The page gives it\n// an outline and the primary label; selected gives it a filled circle and\n// the on-primary label. A selected today takes the fill.\n//\n// Web's month changes at once. Here **the weeks slide in** from the side the\n// new month comes from, Material Design's shared axis transition, and change\n// at once under reduced motion.\n//\n// **The locale is a prop**, defaulting to the device's, where web reads it\n// from React Aria's `I18nProvider`. The words the calendar writes, its\n// chevrons' names and its dates', are React Aria's in that locale.\n\ntype CalendarProps<T extends DateValue = DateValue> = Pick<\n StatelyCalendarProps<T>,\n | 'defaultFocusedValue'\n | 'defaultValue'\n | 'firstDayOfWeek'\n | 'focusedValue'\n | 'isDateUnavailable'\n | 'isDisabled'\n | 'isReadOnly'\n | 'maxValue'\n | 'minValue'\n | 'onChange'\n | 'onFocusChange'\n | 'value'\n> & {\n /**\n * The calendar's name. The month shown is added to it, as React Aria adds\n * it on web.\n */\n readonly 'aria-label'?: string\n /**\n * The BCP 47 locale the calendar is written in: its month and weekday\n * names, its digits, its first day of the week and its calendar system.\n * Defaults to the device's.\n */\n readonly locale?: string\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether the header draws the month and the year as menu buttons, each\n * opening a list of them in the grid's place, as the docked date picker's\n * header does, rather than one heading between the chevrons. For a date\n * far from the one shown, such as a date of birth: the year list runs a\n * century either side of the year shown, or to `minValue` and `maxValue`\n * where they are closer.\n * @default false\n */\n readonly showMonthYearMenus?: boolean\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\n/**\n * A month calendar for picking a date. The value is an\n * `@internationalized/date` value, as on web: pass `value` with `onChange` to\n * control it, or `defaultValue` to let it keep its own.\n *\n * ```tsx\n * import { getLocalTimeZone, today } from '@internationalized/date'\n *\n * <Calendar aria-label=\"Label\" defaultValue={today(getLocalTimeZone())} />\n * ```\n *\n * `minValue` and `maxValue` bound it, and `isDateUnavailable` rules\n * individual dates out. Name it with `aria-label`; the month shown is added\n * to the name.\n *\n * `style`, `ref` and `testID` land on the container.\n */\nfunction Calendar<T extends DateValue = DateValue>({\n 'aria-label': ariaLabel,\n locale,\n ref,\n showMonthYearMenus = false,\n style,\n testID,\n ...props\n}: CalendarProps<T>) {\n const writtenIn = localeOf(locale)\n const own = stylesOf(useTheme())\n const state = useCalendarState<T>({\n ...props,\n createCalendar,\n locale: writtenIn,\n })\n const month = visibleMonthOf(state, writtenIn)\n\n return (\n <View\n aria-label={ariaLabel === undefined ? month : `${ariaLabel}, ${month}`}\n ref={ref}\n role=\"group\"\n style={composeStyles<ViewStyle>(own.root, style)}\n testID={testID}\n >\n <CalendarFrame\n firstDayOfWeek={props.firstDayOfWeek}\n locale={writtenIn}\n showMonthYearMenus={showMonthYearMenus}\n state={state}\n />\n </View>\n )\n}\n\nexport type { CalendarProps }\n\nexport { Calendar }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsIA,SAAAuB,SAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAmD,MAAA,EAAA,cAAAC,WAAAT,QAAAC,KAAAC,oBAAAQ,IAAAP,OAAAC,QAAA,GAAAO,UAAAL;CAIjD,MAAAJ,qBAAAQ,OAAAE,KAAAA,IAAA,QAAAF;CAKA,MAAAG,YAAkBlB,SAASK,MAAM;CACjC,MAAAc,MAAYpB,SAASE,SAAS,CAAC;CAC/B,MAAAmB,QAAcxB,iBAAoB;EAAA,GAC7BoB;EAAKtB;EAAAW,QAEAa;CACV,CAAC;CACD,MAAAG,QAAcvB,eAAesB,OAAOF,SAAS;CAG1C,MAAAI,KAAA3B;CACa,MAAA4B,KAAAT,cAAcG,KAAAA,IAAdI,QAAA,GAAqCP,UAAS,IAAKO;CAE1D,MAAAG,KAAA;CACE,MAAAC,KAAAvB,cAAyBiB,IAAGO,MAAOlB,KAAK;CAAC,IAAAmB;CAAA,IAAAf,EAAA,OAAAI,MAAAY,kBAAAhB,EAAA,OAAAL,sBAAAK,EAAA,OAAAQ,SAAAR,EAAA,OAAAM,WAAA;EAGhDS,KAAA,oBAAC,eAAD;GACkB,gBAAAX,MAAKY;GACbV,QAAAA;GACYX;GACba;EAAK,CAAA;EACZR,EAAA,KAAAI,MAAAY;EAAAhB,EAAA,KAAAL;EAAAK,EAAA,KAAAQ;EAAAR,EAAA,KAAAM;EAAAN,EAAA,KAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,IAAAiB;CAAA,IAAAjB,EAAA,OAAAU,MAAAV,EAAA,OAAAN,OAAAM,EAAA,OAAAW,MAAAX,EAAA,OAAAa,MAAAb,EAAA,OAAAe,MAAAf,EAAA,QAAAH,QAAA;EAZJoB,KAAA,oBAAC,IAAD;GACc,cAAAN;GACPjB;GACA,MAAAkB;GACE,OAAAC;GACChB;GAERkB,UAAAA;EAPG,CAAA;EAaEf,EAAA,KAAAU;EAAAV,EAAA,KAAAN;EAAAM,EAAA,KAAAW;EAAAX,EAAA,KAAAa;EAAAb,EAAA,KAAAe;EAAAf,EAAA,MAAAH;EAAAG,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,OAbPiB;AAaO"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","StyleProp","ViewStyle","DateValue","CalendarProps","StatelyCalendarProps","createCalendar","View","useCalendarState","CalendarFrame","visibleMonthOf","stylesOf","useLocaleOf","useTheme","composeStyles","Pick","T","locale","ref","showMonthYearMenus","style","testID","Calendar","t0","$","_c","ariaLabel","props","t1","undefined","writtenIn","own","t2","state","t3","month","T0","t4","t5","t6","root","t7","firstDayOfWeek","t8","_c"],"sources":["../../../src/components/calendar/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type { StyleProp, ViewStyle } from 'react-native'\nimport type {\n DateValue,\n CalendarProps as StatelyCalendarProps,\n} from 'react-stately/useCalendarState'\n\nimport { createCalendar } from '@internationalized/date'\nimport { View } from 'react-native'\nimport { useCalendarState } from 'react-stately/useCalendarState'\n\nimport { CalendarFrame, visibleMonthOf } from '../../calendar'\nimport { stylesOf } from '../../calendar/styles'\nimport { useLocaleOf } from '../../i18n/provider'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles } from '../../theme/styles'\n\n// kanso-ui's Calendar, the date pickers page's docked calendar: a month grid\n// with a circle on the selected date and an outline on today. Its values are\n// that page's: a 360dp container on the high surface container, 48dp date\n// cells with a 40dp state layer inside them, body large for both the weekday\n// row and the dates, and primary for the selected circle and for today's\n// outline. The parts are in src/calendar.\n//\n// The state is React Stately's `useCalendarState`, which web's React Aria\n// calendar is built on, over `@internationalized/date`, so the selection,\n// the bounds and the locale's calendar, first day of the week and digits\n// behave as they do on web.\n//\n// The page's container is 456dp tall, which this does not take: that height\n// is a picker's, counting a headline and an action row the calendar itself\n// does not draw. What is held instead is the grid, at six weeks, the most any\n// month occupies, so the calendar keeps its height as the month moves and a\n// shorter month leaves its last rows empty.\n//\n// `showMonthYearMenus` draws the page's docked header instead of one heading:\n// the month's menu button between the chevrons that step it and the year's\n// after them, each opening its list where the grid was, as web's does. The\n// page draws the lists there, and a calendar inside a picker is already in\n// a panel, so a menu over it would be a panel over a panel.\n//\n// Five things are this component's own, as on web.\n//\n// **The year menu has no chevrons of its own.** The page draws a pair either\n// side of it that step a year; the year list reaches any year within a\n// century of the one shown in one press, or any the bounds allow where they\n// are closer.\n//\n// **The cell is a circle in a square.** The page gives the date a 48dp\n// container and a 40dp state layer, which is a 40dp circle with 4dp of room\n// around it. The circle is the pressable, centred in a 48dp column and a 48dp\n// row, and its `hitSlop` reaches the 4dp past it on every side, so the whole\n// square takes the press. The chevrons and the menu buttons reach a 48dp\n// target the same way.\n//\n// **It narrows to its container.** The page's docked calendar is 360dp, and\n// a compact window leaves 328dp between its margins, so the calendar is 360\n// at most and the columns share whatever is left below that.\n//\n// **A date from the month either side is faded because it is disabled**, as\n// React Aria disables those dates: the page's 38% either way. A date\n// `isDateUnavailable` rules out is struck through at full contrast instead,\n// since a reader can still land on it and has to read it.\n//\n// **Today reads as today whether or not it is selected.** The page gives it\n// an outline and the primary label; selected gives it a filled circle and\n// the on-primary label. A selected today takes the fill.\n//\n// Web's month changes at once. Here **the weeks slide in** from the side the\n// new month comes from, Material Design's shared axis transition, and change\n// at once under reduced motion.\n//\n// **The locale is the `I18nProvider`'s**, as web reads it from React Aria's,\n// unless the `locale` prop names another, and the device's under neither. The\n// words the calendar writes, its chevrons' names and its dates', are React\n// Aria's in that locale.\n\ntype CalendarProps<T extends DateValue = DateValue> = Pick<\n StatelyCalendarProps<T>,\n | 'defaultFocusedValue'\n | 'defaultValue'\n | 'firstDayOfWeek'\n | 'focusedValue'\n | 'isDateUnavailable'\n | 'isDisabled'\n | 'isReadOnly'\n | 'maxValue'\n | 'minValue'\n | 'onChange'\n | 'onFocusChange'\n | 'value'\n> & {\n /**\n * The calendar's name. The month shown is added to it, as React Aria adds\n * it on web.\n */\n readonly 'aria-label'?: string\n /**\n * The BCP 47 locale the calendar is written in: its month and weekday\n * names, its digits, its first day of the week and its calendar system.\n * Defaults to the `I18nProvider`'s, or the device's outside one.\n */\n readonly locale?: string\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether the header draws the month and the year as menu buttons, each\n * opening a list of them in the grid's place, as the docked date picker's\n * header does, rather than one heading between the chevrons. For a date\n * far from the one shown, such as a date of birth: the year list runs a\n * century either side of the year shown, or to `minValue` and `maxValue`\n * where they are closer.\n * @default false\n */\n readonly showMonthYearMenus?: boolean\n readonly style?: StyleProp<ViewStyle>\n readonly testID?: string\n}\n\n/**\n * A month calendar for picking a date. The value is an\n * `@internationalized/date` value, as on web: pass `value` with `onChange` to\n * control it, or `defaultValue` to let it keep its own.\n *\n * ```tsx\n * import { getLocalTimeZone, today } from '@internationalized/date'\n *\n * <Calendar aria-label=\"Label\" defaultValue={today(getLocalTimeZone())} />\n * ```\n *\n * `minValue` and `maxValue` bound it, and `isDateUnavailable` rules\n * individual dates out. Name it with `aria-label`; the month shown is added\n * to the name.\n *\n * `style`, `ref` and `testID` land on the container.\n */\nfunction Calendar<T extends DateValue = DateValue>({\n 'aria-label': ariaLabel,\n locale,\n ref,\n showMonthYearMenus = false,\n style,\n testID,\n ...props\n}: CalendarProps<T>) {\n const writtenIn = useLocaleOf(locale)\n const own = stylesOf(useTheme())\n const state = useCalendarState<T>({\n ...props,\n createCalendar,\n locale: writtenIn,\n })\n const month = visibleMonthOf(state, writtenIn)\n\n return (\n <View\n aria-label={ariaLabel === undefined ? month : `${ariaLabel}, ${month}`}\n ref={ref}\n role=\"group\"\n style={composeStyles<ViewStyle>(own.root, style)}\n testID={testID}\n >\n <CalendarFrame\n firstDayOfWeek={props.firstDayOfWeek}\n locale={writtenIn}\n showMonthYearMenus={showMonthYearMenus}\n state={state}\n />\n </View>\n )\n}\n\nexport type { CalendarProps }\n\nexport { Calendar }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuIA,SAAAuB,SAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAT;CAAA,IAAAU;CAAA,IAAAT;CAAA,IAAAE;CAAA,IAAAQ;CAAA,IAAAP;CAAA,IAAAG,EAAA,OAAAD,IAAA;EAAmD,CAAA,CAAA,cAAAG,WAAAT,QAAAC,KAAAC,oBAAAS,IAAAR,OAAAC,QAAA,GAAAM,SAAAJ;EAQhCC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAP;EAAAO,EAAA,KAAAG;EAAAH,EAAA,KAAAN;EAAAM,EAAA,KAAAJ;EAAAI,EAAA,KAAAI;EAAAJ,EAAA,KAAAH;CAAA,OAAA;EAAAK,YAAAF,EAAA;EAAAP,SAAAO,EAAA;EAAAG,QAAAH,EAAA;EAAAN,MAAAM,EAAA;EAAAJ,QAAAI,EAAA;EAAAI,KAAAJ,EAAA;EAAAH,SAAAG,EAAA;CAAA;CAJjB,MAAAL,qBAAAS,OAAAC,KAAAA,IAAA,QAAAD;CAKA,MAAAE,YAAkBlB,YAAYK,MAAM;CACpC,MAAAc,MAAYpB,SAASE,SAAS,CAAC;CAAC,IAAAmB;CAAA,IAAAR,EAAA,OAAAG,SAAAH,EAAA,OAAAM,WAAA;EACEE,KAAA;GAAA,GAC7BL;GAAKrB;GAAAW,QAEAa;EACV;EAACN,EAAA,KAAAG;EAAAH,EAAA,KAAAM;EAAAN,EAAA,MAAAQ;CAAA,OAAAA,KAAAR,EAAA;CAJD,MAAAS,QAAczB,iBAAoBwB,EAIjC;CAAC,IAAAE;CAAA,IAAAV,EAAA,QAAAS,SAAAT,EAAA,QAAAM,WAAA;EACYI,KAAAxB,eAAeuB,OAAOH,SAAS;EAACN,EAAA,MAAAS;EAAAT,EAAA,MAAAM;EAAAN,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAA9C,MAAAW,QAAcD;CAGX,MAAAE,KAAA7B;CACa,MAAA8B,KAAAX,cAAcG,KAAAA,IAAdM,QAAA,GAAqCT,UAAS,IAAKS;CAE1D,MAAAG,KAAA;CACE,MAAAC,KAAAzB,cAAyBiB,IAAGS,MAAOpB,KAAK;CAAC,IAAAqB;CAAA,IAAAjB,EAAA,QAAAG,MAAAe,kBAAAlB,EAAA,QAAAL,sBAAAK,EAAA,QAAAS,SAAAT,EAAA,QAAAM,WAAA;EAGhDW,KAAA,oBAAC,eAAD;GACkB,gBAAAd,MAAKe;GACbZ,QAAAA;GACYX;GACbc;EAAK,CAAA;EACZT,EAAA,MAAAG,MAAAe;EAAAlB,EAAA,MAAAL;EAAAK,EAAA,MAAAS;EAAAT,EAAA,MAAAM;EAAAN,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,IAAAmB;CAAA,IAAAnB,EAAA,QAAAY,MAAAZ,EAAA,QAAAN,OAAAM,EAAA,QAAAa,MAAAb,EAAA,QAAAe,MAAAf,EAAA,QAAAiB,MAAAjB,EAAA,QAAAH,QAAA;EAZJsB,KAAA,oBAAC,IAAD;GACc,cAAAN;GACPnB;GACA,MAAAoB;GACE,OAAAC;GACClB;GAERoB,UAAAA;EAPG,CAAA;EAaEjB,EAAA,MAAAY;EAAAZ,EAAA,MAAAN;EAAAM,EAAA,MAAAa;EAAAb,EAAA,MAAAe;EAAAf,EAAA,MAAAiB;EAAAjB,EAAA,MAAAH;EAAAG,EAAA,MAAAmB;CAAA,OAAAA,KAAAnB,EAAA;CAAA,OAbPmB;AAaO"}
@@ -49,6 +49,12 @@ type CheckboxProps = Omit<ViewProps, 'children' | 'style'> & {
49
49
  readonly onChange?: (isSelected: boolean) => void;
50
50
  readonly ref?: Ref<ComponentRef<typeof View>>;
51
51
  readonly style?: StyleProp<ViewStyle>;
52
+ /**
53
+ * The entry this checkbox stands for inside a `CheckboxGroup`, which the
54
+ * group's value holds while it is selected. Required there, and unused
55
+ * outside one.
56
+ */
57
+ readonly value?: string;
52
58
  };
53
59
  /**
54
60
  * A checkbox with its label, and optionally a description or an error under
@@ -70,7 +76,7 @@ type CheckboxProps = Omit<ViewProps, 'children' | 'style'> & {
70
76
  * holding the row and the line under it, which is the element a layout
71
77
  * positions.
72
78
  */
73
- declare function Checkbox({ 'aria-label': ariaLabel, children, defaultSelected, description, error, isDisabled, isIndeterminate, isReadOnly, isSelected, onChange, style, ...props }: CheckboxProps): import("react").JSX.Element;
79
+ declare function Checkbox({ 'aria-label': ariaLabel, children, defaultSelected, description, error, isDisabled: ownDisabled, isIndeterminate, isReadOnly: ownReadOnly, isSelected, onChange, style, value, ...props }: CheckboxProps): import("react").JSX.Element;
74
80
  //#endregion
75
81
  export { Checkbox, type CheckboxProps };
76
82
  //# sourceMappingURL=index.d.ts.map
@@ -4,9 +4,10 @@ import { hitSlop, usePressFeedback } from "../../press/index.js";
4
4
  import { controlStylesOf } from "../../control/styles.js";
5
5
  import { ControlLabel, ControlMessage, describedBy, messageOf } from "../../control/index.js";
6
6
  import { CheckboxBox } from "../../control/checkbox-box.js";
7
+ import { CheckboxGroupContext } from "../../control/group.js";
7
8
  import { c } from "react/compiler-runtime";
8
9
  import { Pressable, View } from "react-native";
9
- import { useId } from "react";
10
+ import { use, useEffect, useId, useRef } from "react";
10
11
  import { jsx, jsxs } from "react/jsx-runtime";
11
12
  import { useToggleState } from "react-stately/useToggleState";
12
13
  //#region src/components/checkbox/index.tsx
@@ -45,7 +46,7 @@ const LAYERS = {
45
46
  * positions.
46
47
  */
47
48
  function Checkbox(t0) {
48
- const $ = c(69);
49
+ const $ = c(76);
49
50
  let ariaLabel;
50
51
  let children;
51
52
  let defaultSelected;
@@ -58,8 +59,9 @@ function Checkbox(t0) {
58
59
  let t1;
59
60
  let t2;
60
61
  let t3;
62
+ let value;
61
63
  if ($[0] !== t0) {
62
- ({"aria-label": ariaLabel, children, defaultSelected, description, error, isDisabled: t1, isIndeterminate: t2, isReadOnly: t3, isSelected, onChange, style, ...props} = t0);
64
+ ({"aria-label": ariaLabel, children, defaultSelected, description, error, isDisabled: t1, isIndeterminate: t2, isReadOnly: t3, isSelected, onChange, style, value, ...props} = t0);
63
65
  $[0] = t0;
64
66
  $[1] = ariaLabel;
65
67
  $[2] = children;
@@ -73,6 +75,7 @@ function Checkbox(t0) {
73
75
  $[10] = t1;
74
76
  $[11] = t2;
75
77
  $[12] = t3;
78
+ $[13] = value;
76
79
  } else {
77
80
  ariaLabel = $[1];
78
81
  children = $[2];
@@ -86,95 +89,126 @@ function Checkbox(t0) {
86
89
  t1 = $[10];
87
90
  t2 = $[11];
88
91
  t3 = $[12];
92
+ value = $[13];
89
93
  }
90
- const isDisabled = t1 === void 0 ? false : t1;
94
+ const ownDisabled = t1 === void 0 ? false : t1;
91
95
  const isIndeterminate = t2 === void 0 ? false : t2;
92
- const isReadOnly = t3 === void 0 ? false : t3;
96
+ const ownReadOnly = t3 === void 0 ? false : t3;
93
97
  const theme = useTheme();
98
+ const group = use(CheckboxGroupContext);
99
+ const messageId = useId();
100
+ const control = useRef(null);
101
+ const members = group?.members;
102
+ if (group !== null && value === void 0) throw new Error("A Checkbox inside a CheckboxGroup names the entry it stands for with `value`.");
103
+ const isDisabled = ownDisabled || (group?.isDisabled ?? false);
104
+ const isReadOnly = ownReadOnly || (group?.isReadOnly ?? false);
94
105
  let t4;
95
- if ($[13] !== defaultSelected || $[14] !== isReadOnly || $[15] !== isSelected || $[16] !== onChange) {
96
- t4 = {
106
+ if ($[14] !== defaultSelected || $[15] !== group || $[16] !== isReadOnly || $[17] !== isSelected || $[18] !== onChange || $[19] !== value) {
107
+ t4 = group === null || value === void 0 ? {
97
108
  defaultSelected,
98
109
  isReadOnly,
99
110
  isSelected,
100
111
  onChange
101
- };
102
- $[13] = defaultSelected;
103
- $[14] = isReadOnly;
104
- $[15] = isSelected;
105
- $[16] = onChange;
106
- $[17] = t4;
107
- } else t4 = $[17];
112
+ } : memberOf(group, value, {
113
+ isReadOnly,
114
+ onChange
115
+ });
116
+ $[14] = defaultSelected;
117
+ $[15] = group;
118
+ $[16] = isReadOnly;
119
+ $[17] = isSelected;
120
+ $[18] = onChange;
121
+ $[19] = value;
122
+ $[20] = t4;
123
+ } else t4 = $[20];
108
124
  const state = useToggleState(t4);
109
- const messageId = useId();
125
+ let t5;
126
+ let t6;
127
+ if ($[21] !== members || $[22] !== messageId) {
128
+ t5 = () => {
129
+ members?.add(messageId, control);
130
+ return () => {
131
+ members?.remove(messageId);
132
+ };
133
+ };
134
+ t6 = [members, messageId];
135
+ $[21] = members;
136
+ $[22] = messageId;
137
+ $[23] = t5;
138
+ $[24] = t6;
139
+ } else {
140
+ t5 = $[23];
141
+ t6 = $[24];
142
+ }
143
+ useEffect(t5, t6);
110
144
  const { colors, radii } = theme;
111
145
  const marked = state.isSelected || isIndeterminate;
112
146
  const interactive = !isDisabled && !isReadOnly;
113
- const tone = error === void 0 ? marked ? "marked" : "unmarked" : "error";
114
- const t5 = colors[LAYERS[tone].hover];
115
- let t6;
116
- if ($[18] !== radii.circle) {
117
- t6 = { borderRadius: radii.circle };
118
- $[18] = radii.circle;
119
- $[19] = t6;
120
- } else t6 = $[19];
121
- const t7 = !interactive;
122
- const t8 = colors[LAYERS[tone].pressed];
123
- let t9;
124
- if ($[20] !== t5 || $[21] !== t6 || $[22] !== t7 || $[23] !== t8) {
125
- t9 = {
126
- color: t5,
127
- corners: t6,
128
- disabled: t7,
147
+ const tone = error !== void 0 || (group?.isInvalid ?? false) ? "error" : marked ? "marked" : "unmarked";
148
+ const t7 = colors[LAYERS[tone].hover];
149
+ let t8;
150
+ if ($[25] !== radii.circle) {
151
+ t8 = { borderRadius: radii.circle };
152
+ $[25] = radii.circle;
153
+ $[26] = t8;
154
+ } else t8 = $[26];
155
+ const t9 = !interactive;
156
+ const t10 = colors[LAYERS[tone].pressed];
157
+ let t11;
158
+ if ($[27] !== t10 || $[28] !== t7 || $[29] !== t8 || $[30] !== t9) {
159
+ t11 = {
160
+ color: t7,
161
+ corners: t8,
162
+ disabled: t9,
129
163
  disc: 40,
130
- pressedColor: t8
164
+ pressedColor: t10
131
165
  };
132
- $[20] = t5;
133
- $[21] = t6;
134
- $[22] = t7;
135
- $[23] = t8;
136
- $[24] = t9;
137
- } else t9 = $[24];
138
- const feedback = usePressFeedback(t9);
166
+ $[27] = t10;
167
+ $[28] = t7;
168
+ $[29] = t8;
169
+ $[30] = t9;
170
+ $[31] = t11;
171
+ } else t11 = $[31];
172
+ const feedback = usePressFeedback(t11);
139
173
  const active = feedback.hovered || feedback.pressed || feedback.ring !== void 0;
140
- const t10 = isIndeterminate ? "mixed" : state.isSelected;
141
- let t11;
142
- if ($[25] !== description || $[26] !== error || $[27] !== messageId) {
143
- t11 = describedBy(messageId, messageOf(description, error));
144
- $[25] = description;
145
- $[26] = error;
146
- $[27] = messageId;
147
- $[28] = t11;
148
- } else t11 = $[28];
149
- const t12 = feedback.handlers;
174
+ const t12 = isIndeterminate ? "mixed" : state.isSelected;
150
175
  let t13;
151
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
152
- t13 = hitSlop(40, 40);
153
- $[29] = t13;
154
- } else t13 = $[29];
155
- let t14;
156
- if ($[30] !== state) {
157
- t14 = toggleOf(state);
158
- $[30] = state;
159
- $[31] = t14;
160
- } else t14 = $[31];
176
+ if ($[32] !== description || $[33] !== error || $[34] !== messageId) {
177
+ t13 = describedBy(messageId, messageOf(description, error));
178
+ $[32] = description;
179
+ $[33] = error;
180
+ $[34] = messageId;
181
+ $[35] = t13;
182
+ } else t13 = $[35];
183
+ const t14 = feedback.handlers;
161
184
  let t15;
162
- if ($[32] !== theme) {
163
- t15 = controlStylesOf(theme);
164
- $[32] = theme;
165
- $[33] = t15;
166
- } else t15 = $[33];
167
- const t16 = t15.row;
185
+ if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
186
+ t15 = hitSlop(40, 40);
187
+ $[36] = t15;
188
+ } else t15 = $[36];
189
+ let t16;
190
+ if ($[37] !== state) {
191
+ t16 = toggleOf(state);
192
+ $[37] = state;
193
+ $[38] = t16;
194
+ } else t16 = $[38];
168
195
  let t17;
169
- if ($[34] !== feedback.ring || $[35] !== theme) {
170
- t17 = composeStyles(controlStylesOf(theme).disc, feedback.ring);
171
- $[34] = feedback.ring;
172
- $[35] = theme;
173
- $[36] = t17;
174
- } else t17 = $[36];
175
- let t18;
176
- if ($[37] !== active || $[38] !== isDisabled || $[39] !== isIndeterminate || $[40] !== state.isSelected || $[41] !== tone) {
177
- t18 = /* @__PURE__ */ jsx(CheckboxBox, {
196
+ if ($[39] !== theme) {
197
+ t17 = controlStylesOf(theme);
198
+ $[39] = theme;
199
+ $[40] = t17;
200
+ } else t17 = $[40];
201
+ const t18 = t17.row;
202
+ let t19;
203
+ if ($[41] !== feedback.ring || $[42] !== theme) {
204
+ t19 = composeStyles(controlStylesOf(theme).disc, feedback.ring);
205
+ $[41] = feedback.ring;
206
+ $[42] = theme;
207
+ $[43] = t19;
208
+ } else t19 = $[43];
209
+ let t20;
210
+ if ($[44] !== active || $[45] !== isDisabled || $[46] !== isIndeterminate || $[47] !== state.isSelected || $[48] !== tone) {
211
+ t20 = /* @__PURE__ */ jsx(CheckboxBox, {
178
212
  active,
179
213
  isDisabled,
180
214
  isIndeterminate,
@@ -182,85 +216,96 @@ function Checkbox(t0) {
182
216
  tone,
183
217
  within: 40
184
218
  });
185
- $[37] = active;
186
- $[38] = isDisabled;
187
- $[39] = isIndeterminate;
188
- $[40] = state.isSelected;
189
- $[41] = tone;
190
- $[42] = t18;
191
- } else t18 = $[42];
192
- let t19;
193
- if ($[43] !== feedback.layer || $[44] !== t17 || $[45] !== t18) {
194
- t19 = /* @__PURE__ */ jsxs(View, {
195
- style: t17,
196
- children: [feedback.layer, t18]
219
+ $[44] = active;
220
+ $[45] = isDisabled;
221
+ $[46] = isIndeterminate;
222
+ $[47] = state.isSelected;
223
+ $[48] = tone;
224
+ $[49] = t20;
225
+ } else t20 = $[49];
226
+ let t21;
227
+ if ($[50] !== feedback.layer || $[51] !== t19 || $[52] !== t20) {
228
+ t21 = /* @__PURE__ */ jsxs(View, {
229
+ style: t19,
230
+ children: [feedback.layer, t20]
197
231
  });
198
- $[43] = feedback.layer;
199
- $[44] = t17;
200
- $[45] = t18;
201
- $[46] = t19;
202
- } else t19 = $[46];
203
- let t20;
204
- if ($[47] !== children || $[48] !== isDisabled) {
205
- t20 = /* @__PURE__ */ jsx(ControlLabel, {
232
+ $[50] = feedback.layer;
233
+ $[51] = t19;
234
+ $[52] = t20;
235
+ $[53] = t21;
236
+ } else t21 = $[53];
237
+ let t22;
238
+ if ($[54] !== children || $[55] !== isDisabled) {
239
+ t22 = /* @__PURE__ */ jsx(ControlLabel, {
206
240
  isDisabled,
207
241
  children
208
242
  });
209
- $[47] = children;
210
- $[48] = isDisabled;
211
- $[49] = t20;
212
- } else t20 = $[49];
213
- let t21;
214
- if ($[50] !== ariaLabel || $[51] !== feedback.handlers || $[52] !== isDisabled || $[53] !== t10 || $[54] !== t11 || $[55] !== t14 || $[56] !== t15.row || $[57] !== t19 || $[58] !== t20) {
215
- t21 = /* @__PURE__ */ jsxs(Pressable, {
216
- "aria-checked": t10,
243
+ $[54] = children;
244
+ $[55] = isDisabled;
245
+ $[56] = t22;
246
+ } else t22 = $[56];
247
+ let t23;
248
+ if ($[57] !== ariaLabel || $[58] !== feedback.handlers || $[59] !== isDisabled || $[60] !== t12 || $[61] !== t13 || $[62] !== t16 || $[63] !== t17.row || $[64] !== t21 || $[65] !== t22) {
249
+ t23 = /* @__PURE__ */ jsxs(Pressable, {
250
+ "aria-checked": t12,
217
251
  "aria-label": ariaLabel,
218
252
  role: "checkbox",
219
- ...t11,
220
- ...t12,
253
+ ...t13,
254
+ ...t14,
221
255
  disabled: isDisabled,
222
- hitSlop: t13,
223
- onPress: t14,
224
- style: t16,
225
- children: [t19, t20]
256
+ hitSlop: t15,
257
+ onPress: t16,
258
+ ref: control,
259
+ style: t18,
260
+ children: [t21, t22]
226
261
  });
227
- $[50] = ariaLabel;
228
- $[51] = feedback.handlers;
229
- $[52] = isDisabled;
230
- $[53] = t10;
231
- $[54] = t11;
232
- $[55] = t14;
233
- $[56] = t15.row;
234
- $[57] = t19;
235
- $[58] = t20;
236
- $[59] = t21;
237
- } else t21 = $[59];
238
- let t22;
239
- if ($[60] !== description || $[61] !== error || $[62] !== messageId) {
240
- t22 = /* @__PURE__ */ jsx(ControlMessage, {
262
+ $[57] = ariaLabel;
263
+ $[58] = feedback.handlers;
264
+ $[59] = isDisabled;
265
+ $[60] = t12;
266
+ $[61] = t13;
267
+ $[62] = t16;
268
+ $[63] = t17.row;
269
+ $[64] = t21;
270
+ $[65] = t22;
271
+ $[66] = t23;
272
+ } else t23 = $[66];
273
+ let t24;
274
+ if ($[67] !== description || $[68] !== error || $[69] !== messageId) {
275
+ t24 = /* @__PURE__ */ jsx(ControlMessage, {
241
276
  description,
242
277
  error,
243
278
  id: messageId
244
279
  });
245
- $[60] = description;
246
- $[61] = error;
247
- $[62] = messageId;
248
- $[63] = t22;
249
- } else t22 = $[63];
250
- let t23;
251
- if ($[64] !== props || $[65] !== style || $[66] !== t21 || $[67] !== t22) {
252
- t23 = /* @__PURE__ */ jsxs(View, {
280
+ $[67] = description;
281
+ $[68] = error;
282
+ $[69] = messageId;
283
+ $[70] = t24;
284
+ } else t24 = $[70];
285
+ let t25;
286
+ if ($[71] !== props || $[72] !== style || $[73] !== t23 || $[74] !== t24) {
287
+ t25 = /* @__PURE__ */ jsxs(View, {
253
288
  ...props,
254
289
  style,
255
- children: [t21, t22]
290
+ children: [t23, t24]
256
291
  });
257
- $[64] = props;
258
- $[65] = style;
259
- $[66] = t21;
260
- $[67] = t22;
261
- $[68] = t23;
262
- } else t23 = $[68];
263
- return t23;
292
+ $[71] = props;
293
+ $[72] = style;
294
+ $[73] = t23;
295
+ $[74] = t24;
296
+ $[75] = t25;
297
+ } else t25 = $[75];
298
+ return t25;
299
+ }
300
+ function memberOf(group, value, { isReadOnly, onChange }) {
301
+ return {
302
+ isReadOnly,
303
+ isSelected: group.isSelected(value),
304
+ onChange: (isSelected) => {
305
+ group.set(value, isSelected);
306
+ onChange?.(isSelected);
307
+ }
308
+ };
264
309
  }
265
310
  function toggleOf(state) {
266
311
  return () => {