@kanso-labs/kanso-ui 0.43.7 → 0.44.1

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 (161) hide show
  1. package/README.md +1 -0
  2. package/dist/calendar/index.js +34 -10
  3. package/dist/calendar/index.js.map +1 -1
  4. package/dist/calendar/styles.js +30 -0
  5. package/dist/calendar/styles.js.map +1 -1
  6. package/dist/chip/index.js +27 -18
  7. package/dist/chip/index.js.map +1 -1
  8. package/dist/chip/label.js +32 -0
  9. package/dist/chip/label.js.map +1 -0
  10. package/dist/chip/styles.js +32 -2
  11. package/dist/chip/styles.js.map +1 -1
  12. package/dist/collection/text.js +24 -3
  13. package/dist/collection/text.js.map +1 -1
  14. package/dist/components/app-bar/index.d.ts +9 -5
  15. package/dist/components/app-bar/index.js +400 -170
  16. package/dist/components/app-bar/index.js.map +1 -1
  17. package/dist/components/button/index.js.map +1 -1
  18. package/dist/components/calendar/index.d.ts +8 -1
  19. package/dist/components/calendar/index.js +129 -73
  20. package/dist/components/calendar/index.js.map +1 -1
  21. package/dist/components/checkbox/index.js +31 -31
  22. package/dist/components/checkbox/index.js.map +1 -1
  23. package/dist/components/checkbox-group/index.js +4 -2
  24. package/dist/components/checkbox-group/index.js.map +1 -1
  25. package/dist/components/chip/index.js +1 -1
  26. package/dist/components/chip/index.js.map +1 -1
  27. package/dist/components/chip-group/index.d.ts +35 -5
  28. package/dist/components/chip-group/index.js +137 -97
  29. package/dist/components/chip-group/index.js.map +1 -1
  30. package/dist/components/copy-field/index.js +1 -1
  31. package/dist/components/copy-field/index.js.map +1 -1
  32. package/dist/components/currency/index.d.ts +64 -6
  33. package/dist/components/currency/index.js +117 -40
  34. package/dist/components/currency/index.js.map +1 -1
  35. package/dist/components/date-picker/index.js +1 -1
  36. package/dist/components/dialog/index.d.ts +3 -1
  37. package/dist/components/dialog/index.js +115 -81
  38. package/dist/components/dialog/index.js.map +1 -1
  39. package/dist/components/disclosure-group/index.js +1 -1
  40. package/dist/components/disclosure-group/index.js.map +1 -1
  41. package/dist/components/icon-button/index.js +18 -1
  42. package/dist/components/icon-button/index.js.map +1 -1
  43. package/dist/components/index.d.ts +2 -2
  44. package/dist/components/keycap/index.d.ts +3 -0
  45. package/dist/components/keycap/index.js +30 -44
  46. package/dist/components/keycap/index.js.map +1 -1
  47. package/dist/components/list/index.d.ts +16 -2
  48. package/dist/components/list/index.js +124 -69
  49. package/dist/components/list/index.js.map +1 -1
  50. package/dist/components/list-detail/index.d.ts +11 -3
  51. package/dist/components/list-detail/index.js +13 -6
  52. package/dist/components/list-detail/index.js.map +1 -1
  53. package/dist/components/list-item/index.d.ts +16 -1
  54. package/dist/components/list-item/index.js.map +1 -1
  55. package/dist/components/menu/index.d.ts +6 -2
  56. package/dist/components/menu/index.js +22 -15
  57. package/dist/components/menu/index.js.map +1 -1
  58. package/dist/components/meter/index.d.ts +4 -1
  59. package/dist/components/meter/index.js +6 -0
  60. package/dist/components/meter/index.js.map +1 -1
  61. package/dist/components/navigation-bar/index.d.ts +14 -4
  62. package/dist/components/navigation-bar/index.js +77 -50
  63. package/dist/components/navigation-bar/index.js.map +1 -1
  64. package/dist/components/navigation-rail/index.d.ts +3 -2
  65. package/dist/components/navigation-rail/index.js +59 -52
  66. package/dist/components/navigation-rail/index.js.map +1 -1
  67. package/dist/components/navigation-tree/index.js +4 -1
  68. package/dist/components/navigation-tree/index.js.map +1 -1
  69. package/dist/components/number-field/index.d.ts +3 -2
  70. package/dist/components/number-field/index.js +91 -115
  71. package/dist/components/number-field/index.js.map +1 -1
  72. package/dist/components/popover/index.d.ts +3 -1
  73. package/dist/components/popover/index.js +102 -100
  74. package/dist/components/popover/index.js.map +1 -1
  75. package/dist/components/progress-indicator/index.d.ts +4 -2
  76. package/dist/components/progress-indicator/index.js +4 -3
  77. package/dist/components/progress-indicator/index.js.map +1 -1
  78. package/dist/components/radio-group/index.js +34 -24
  79. package/dist/components/radio-group/index.js.map +1 -1
  80. package/dist/components/search-field/index.d.ts +11 -1
  81. package/dist/components/search-field/index.js +32 -28
  82. package/dist/components/search-field/index.js.map +1 -1
  83. package/dist/components/segmented-button/index.d.ts +9 -2
  84. package/dist/components/segmented-button/index.js +1 -1
  85. package/dist/components/segmented-button/index.js.map +1 -1
  86. package/dist/components/separator/index.d.ts +19 -7
  87. package/dist/components/separator/index.js +36 -13
  88. package/dist/components/separator/index.js.map +1 -1
  89. package/dist/components/sheet/index.js +29 -25
  90. package/dist/components/sheet/index.js.map +1 -1
  91. package/dist/components/snackbar/index.d.ts +4 -1
  92. package/dist/components/snackbar/index.js +140 -55
  93. package/dist/components/snackbar/index.js.map +1 -1
  94. package/dist/components/stack/index.d.ts +6 -3
  95. package/dist/components/stack/index.js +48 -31
  96. package/dist/components/stack/index.js.map +1 -1
  97. package/dist/components/switch/index.d.ts +16 -6
  98. package/dist/components/switch/index.js +116 -62
  99. package/dist/components/switch/index.js.map +1 -1
  100. package/dist/components/text-area/index.d.ts +10 -1
  101. package/dist/components/text-area/index.js +21 -19
  102. package/dist/components/text-area/index.js.map +1 -1
  103. package/dist/components/text-field/index.d.ts +16 -2
  104. package/dist/components/text-field/index.js +49 -43
  105. package/dist/components/text-field/index.js.map +1 -1
  106. package/dist/components/time-picker/index.js +1 -1
  107. package/dist/components/tooltip/index.d.ts +3 -1
  108. package/dist/components/tooltip/index.js.map +1 -1
  109. package/dist/components/tree/index.d.ts +15 -3
  110. package/dist/components/tree/index.js +41 -28
  111. package/dist/components/tree/index.js.map +1 -1
  112. package/dist/control/index.js +26 -23
  113. package/dist/control/index.js.map +1 -1
  114. package/dist/control/styles.js +7 -1
  115. package/dist/control/styles.js.map +1 -1
  116. package/dist/field/index.js +220 -193
  117. package/dist/field/index.js.map +1 -1
  118. package/dist/field/styles.js +64 -8
  119. package/dist/field/styles.js.map +1 -1
  120. package/dist/glyphs/index.js +37 -1
  121. package/dist/glyphs/index.js.map +1 -1
  122. package/dist/hooks/useClippedTitle.js +44 -0
  123. package/dist/hooks/useClippedTitle.js.map +1 -0
  124. package/dist/hooks/useRipple.js +7 -6
  125. package/dist/hooks/useRipple.js.map +1 -1
  126. package/dist/hooks/useScrollStop.js +133 -0
  127. package/dist/hooks/useScrollStop.js.map +1 -0
  128. package/dist/i18n/index.js +1 -0
  129. package/dist/i18n/index.js.map +1 -1
  130. package/dist/i18n/messages.js +34 -0
  131. package/dist/i18n/messages.js.map +1 -1
  132. package/dist/index.d.ts +2 -2
  133. package/dist/indicator/index.js +18 -16
  134. package/dist/indicator/index.js.map +1 -1
  135. package/dist/indicator/styles.js +3 -0
  136. package/dist/indicator/styles.js.map +1 -1
  137. package/dist/keycap/context.js +7 -0
  138. package/dist/keycap/context.js.map +1 -0
  139. package/dist/layout.d.ts +4 -1
  140. package/dist/layout.js +4 -1
  141. package/dist/layout.js.map +1 -1
  142. package/dist/navigation/index.d.ts +16 -2
  143. package/dist/navigation/index.js +145 -44
  144. package/dist/navigation/index.js.map +1 -1
  145. package/dist/navigation/styles.js +79 -16
  146. package/dist/navigation/styles.js.map +1 -1
  147. package/dist/row/index.js +92 -89
  148. package/dist/row/index.js.map +1 -1
  149. package/dist/row/styles.js +26 -2
  150. package/dist/row/styles.js.map +1 -1
  151. package/dist/styles/overlay.d.ts +6 -2
  152. package/dist/styles/overlay.js +4 -1
  153. package/dist/styles/overlay.js.map +1 -1
  154. package/dist/styles.css +296 -38
  155. package/dist/theme-scope.d.ts +5 -1
  156. package/dist/theme-scope.js +100 -51
  157. package/dist/theme-scope.js.map +1 -1
  158. package/dist/tokens/design.tokens.stylex.js.map +1 -1
  159. package/package.json +21 -20
  160. package/dist/hooks/useScrollable.js +0 -69
  161. package/dist/hooks/useScrollable.js.map +0 -1
package/README.md CHANGED
@@ -333,6 +333,7 @@ the icon inherits it:
333
333
  | `IconButton` | 20px, 24px, 24px, 32px and 40px across `xs` to `xxl` |
334
334
  | A field's `leadingIcon` and `trailingIcon` | 24px |
335
335
  | `SegmentedButton.Segment`'s `icon` | 18px |
336
+ | `Switch`'s `icon` and `unselectedIcon` | 16px |
336
337
  | `Tabs.Tab`'s `icon` | 24px |
337
338
 
338
339
  **The `leading` and `trailing` slots on a row are different.** A list item, a
@@ -46,14 +46,27 @@ function CalendarFrame(t0) {
46
46
  } else t2 = $[4];
47
47
  return t2;
48
48
  }
49
+ /**
50
+ * The weekday row, faded with the rest of a calendar that is disabled. The
51
+ * state comes from React Aria's context rather than a prop, so the two
52
+ * calendars draw it the same way without either passing anything down.
53
+ *
54
+ * The narrow letters are for the eye alone. React Aria hides the row from
55
+ * assistive technology, since every date's name opens with its weekday in
56
+ * full, so a letter that two days share is never read out.
57
+ */
49
58
  function CalendarGridHeader$1() {
50
- const $ = c(1);
51
- let t0;
52
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
53
- t0 = /* @__PURE__ */ jsx(CalendarGridHeader, { children: calendarHeaderCell });
59
+ const $ = c(2);
60
+ const single = useContext(CalendarStateContext);
61
+ const range = useContext(RangeCalendarStateContext);
62
+ const t0 = (single ?? range)?.isDisabled ?? false ? disabledHeaderCell : calendarHeaderCell;
63
+ let t1;
64
+ if ($[0] !== t0) {
65
+ t1 = /* @__PURE__ */ jsx(CalendarGridHeader, { children: t0 });
54
66
  $[0] = t0;
55
- } else t0 = $[0];
56
- return t0;
67
+ $[1] = t1;
68
+ } else t1 = $[1];
69
+ return t1;
57
70
  }
58
71
  /**
59
72
  * The two chevrons with the month between them. React Aria wires
@@ -65,6 +78,11 @@ function CalendarGridHeader$1() {
65
78
  * A plain element rather than a `<header>`: a header is a banner landmark,
66
79
  * landmarks may not nest, and React Aria puts a calendar in
67
80
  * `role="application"` — axe fails the page on it.
81
+ *
82
+ * React Aria hides the heading between the chevrons from assistive
83
+ * technology. The one a reader reaches is React Aria's own, out of sight,
84
+ * naming the calendar's label with the month, so a calendar adds one heading
85
+ * to the page's outline rather than two.
68
86
  */
69
87
  function CalendarHeader() {
70
88
  const $ = c(4);
@@ -107,10 +125,7 @@ function CalendarHeader() {
107
125
  }
108
126
  /** The weekday row, in the type the page gives both it and the dates. */
109
127
  function calendarHeaderCell(day) {
110
- return /* @__PURE__ */ jsx(CalendarHeaderCell, {
111
- ...props(calendarStyles.headerCell),
112
- children: day
113
- });
128
+ return headerCell(day, false);
114
129
  }
115
130
  /**
116
131
  * The docked header: the month's menu button between the chevrons that step
@@ -371,6 +386,15 @@ function chevronClassName(state, isHidden = false) {
371
386
  function chevronClassNameWhile(isListOpen) {
372
387
  return (state) => chevronClassName(state, isListOpen);
373
388
  }
389
+ function disabledHeaderCell(day) {
390
+ return headerCell(day, true);
391
+ }
392
+ function headerCell(day, isDisabled) {
393
+ return /* @__PURE__ */ jsx(CalendarHeaderCell, {
394
+ ...props(calendarStyles.headerCell, isDisabled && calendarStyles.headerCellDisabled),
395
+ children: day
396
+ });
397
+ }
374
398
  /**
375
399
  * The month or the year as the page's menu button, opening its list. Named
376
400
  * by what it shows and then by what it is — "Sep month" — which keeps the
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CalendarDate","ReactElement","ReactNode","Ref","Key","Selection","endOfMonth","startOfMonth","stylex","useCallback","useContext","useId","useMemo","useRef","useState","ButtonContext","CalendarStateContext","Button","RACButton","CalendarGridHeader","RACCalendarGridHeader","CalendarHeaderCell","RACCalendarHeaderCell","CalendarMonthPicker","RACCalendarMonthPicker","CalendarYearPicker","RACCalendarYearPicker","Heading","RACHeading","ListBox","RACListBox","ListBoxItem","RACListBoxItem","RangeCalendarStateContext","ArrowDropDownGlyph","CheckGlyph","ChevronEndGlyph","focus","iconButton","calendarStyles","dateLayers","menuLayers","MenuEntry","date","formatted","id","MenuPicker","items","onChange","key","value","OpenMenu","LISTED_YEARS","CalendarFrame","t0","$","_c","children","months","showMonthYearMenus","t1","Symbol","for","t2","calendarHeaderCell","CalendarHeader","props","header","chevronClassName","chevronGlyph","chevronGlyphPrevious","heading","t3","day","headerCell","CalendarMenus","single","range","state","open","setOpen","listId","monthButton","yearButton","button","requestAnimationFrame","current","close","_temp","toggleMonth","_temp2","toggleYear","isDisabled","t4","picker","filter","entry","maxValue","compare","minValue","map","_temp3","outsideBounds","t5","t6","headerGroup","t7","t8","chevronClassNameWhile","t9","t10","t11","picker_0","t12","t13","t14","t15","t16","t17","picker_1","t18","t19","t20","picker_2","t21","picker_3","t22","entry_0","current_0","centreInList","check","SVGSVGElement","closest","list","HTMLElement","scrollTop","getBoundingClientRect","top","clientHeight","offsetHeight","isHovered","isPressed","isHidden","chrome","chevron","ring","chromeHovered","chromePressed","chromeDisabled","chevronHidden","className","isListOpen","MenuButton","controls","isExpanded","onPress","ref","valueId","nameId","find","shown","undefined","menuArrow","menuArrowExpanded","menuButtonClassName","menuButton","menuEntry","menuItemClassName","menuEntryContent","label","isSelected","menuCheck","isFocusVisible","menuItem","menuItemSelected","selectedHovered","plainHovered","selectedPressed","plainPressed","menuItemFocused","menuItemDisabled","MenuList","disabledKeys","onClose","selected","keys","choose","menuList","_c","CalendarGridHeader","RACCalendarGridHeader","stylex.props","RACButton","RACHeading","RACCalendarHeaderCell","RACCalendarMonthPicker","RACCalendarYearPicker","RACListBoxItem","RACListBox"],"sources":["../../src/calendar/index.tsx"],"sourcesContent":["import type { CalendarDate } from '@internationalized/date';\nimport type { ReactElement, ReactNode, Ref } from 'react';\nimport type { Key, Selection } from 'react-aria-components';\nimport { endOfMonth, startOfMonth } from '@internationalized/date';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useContext, useId, useMemo, useRef, useState } from 'react';\nimport { ButtonContext, CalendarStateContext, Button as RACButton, CalendarGridHeader as RACCalendarGridHeader, CalendarHeaderCell as RACCalendarHeaderCell, CalendarMonthPicker as RACCalendarMonthPicker, CalendarYearPicker as RACCalendarYearPicker, Heading as RACHeading, ListBox as RACListBox, ListBoxItem as RACListBoxItem, RangeCalendarStateContext } from 'react-aria-components';\nimport { ArrowDropDownGlyph, CheckGlyph, ChevronEndGlyph } from '../glyphs';\nimport { focus } from '../styles/focus';\nimport { iconButton } from '../styles/icon-button';\nimport { calendarStyles, dateLayers, menuLayers } from './styles';\n\n// The parts Calendar and RangeCalendar both render: the row that moves the\n// month, the weekday header, and the offsets that put more than one month\n// side by side. Apart from either component so the two cannot drift, and\n// outside `src/components` for the reason ./styles.ts gives.\n\n/** One entry of React Aria's month or year picker, as either lists it. */\ntype MenuEntry = {\n date: CalendarDate;\n formatted: string;\n id: number;\n};\n\n/** What React Aria's month and year pickers hand the element they render. */\ntype MenuPicker = {\n 'aria-label': string;\n items: MenuEntry[];\n onChange: (key: Key | null) => void;\n value: Key;\n};\ntype OpenMenu = 'month' | 'year';\n\n// How many years the open year list holds: a century either side of the year\n// shown, and that year. Material Design's own list scrolls a whole range of\n// years rather than a window that moves with each choice, and Compose's\n// default range is two centuries. Bounds cut it short where they fall inside.\nconst LISTED_YEARS = 201;\n\n/**\n * What a calendar draws above its months, and the months themselves. With\n * `showMonthYearMenus` the header is the date pickers page's docked one —\n * the month and the year as menu buttons — and while either is open its list\n * takes the months' place.\n *\n * The menus are for one visible month. They name and pick the first month\n * alone, so a second grid beside it would have no visible month or year of\n * its own; with more than one month the header is the plain one, whose\n * heading names the whole range, both years included where it spans two.\n */\nfunction CalendarFrame({\n children,\n months,\n showMonthYearMenus\n}: {\n children: ReactNode;\n /** How many months the calendar shows side by side. */\n months: number;\n showMonthYearMenus: boolean;\n}): ReactElement {\n if (showMonthYearMenus && months <= 1) {\n return <CalendarMenus>{children}</CalendarMenus>;\n }\n return <>\n <CalendarHeader />\n {children}\n </>;\n}\nfunction CalendarGridHeader(): ReactElement {\n return <RACCalendarGridHeader>{calendarHeaderCell}</RACCalendarGridHeader>;\n}\n\n/**\n * The two chevrons with the month between them. React Aria wires\n * `slot=\"previous\"` and `slot=\"next\"` on its own `Button`, and `IconButton`\n * renders React Aria's `Button` too — so nesting one inside a slot would put\n * two buttons where the date pickers page draws one. The chevrons take the\n * icon buttons page's 40dp square and its state layer instead.\n *\n * A plain element rather than a `<header>`: a header is a banner landmark,\n * landmarks may not nest, and React Aria puts a calendar in\n * `role=\"application\"` — axe fails the page on it.\n */\nfunction CalendarHeader(): ReactElement {\n return <div {...stylex.props(calendarStyles.header)}>\n <RACButton className={chevronClassName} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACHeading {...stylex.props(calendarStyles.heading)} />\n <RACButton className={chevronClassName} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>;\n}\n\n/** The weekday row, in the type the page gives both it and the dates. */\nfunction calendarHeaderCell(day: string): ReactElement {\n return <RACCalendarHeaderCell {...stylex.props(calendarStyles.headerCell)}>\n {day}\n </RACCalendarHeaderCell>;\n}\n\n/**\n * The docked header: the month's menu button between the chevrons that step\n * it, and the year's menu button at the end. A press opens the button's list\n * in the months' place, where the page draws it, rather than in a popover over\n * them; a calendar inside a picker is already in one. While a list is open\n * the chevrons are hidden and the other menu is disabled, as the page draws\n * them, and choosing an entry — or pressing the one already checked, or\n * Escape — closes the list and puts focus back on its button.\n *\n * The lists are React Aria's month and year pickers, rendered twice: the\n * header names the month short, as the page's button does, and the list in\n * full. The year list runs a century either side of the year shown — React\n * Aria's own default is ten, which took several passes through the list to\n * reach a date of birth — and `minValue` and `maxValue` cut it short, which\n * React Aria does itself. A month with no day inside them is disabled here.\n */\nfunction CalendarMenus({\n children\n}: {\n children: ReactNode;\n}): ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const state = single ?? range;\n const [open, setOpen] = useState<null | OpenMenu>(null);\n const listId = useId();\n const monthButton = useRef<HTMLButtonElement>(null);\n const yearButton = useRef<HTMLButtonElement>(null);\n\n // A frame after the choice, and focus back on the button before the list\n // goes, rather than lost with it. The key that chose still has a keypress\n // to deliver: React Aria leaves Enter's default alone on a Mac, and with\n // focus already moved the keypress pressed the menu button and opened the\n // list again. A frame later it has landed on the list instead, as the\n // click after a pointer's choice has.\n const close = useCallback(() => {\n const button = open === 'month' ? monthButton : yearButton;\n requestAnimationFrame(() => {\n button.current?.focus();\n setOpen(null);\n });\n }, [open]);\n const toggleMonth = useCallback(() => {\n setOpen(current => current === 'month' ? null : 'month');\n }, []);\n const toggleYear = useCallback(() => {\n setOpen(current => current === 'year' ? null : 'year');\n }, []);\n const isDisabled = state?.isDisabled ?? false;\n const outsideBounds = (picker: MenuPicker) => picker.items.filter(entry => state?.maxValue != null && startOfMonth(entry.date).compare(state.maxValue) > 0 || state?.minValue != null && endOfMonth(entry.date).compare(state.minValue) < 0).map(entry => entry.id);\n return <>\n <div {...stylex.props(calendarStyles.header)}>\n <div {...stylex.props(calendarStyles.headerGroup)}>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACCalendarMonthPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'year'} isExpanded={open === 'month'} onPress={toggleMonth} picker={picker} ref={monthButton} />}\n </RACCalendarMonthPicker>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>\n <RACCalendarYearPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'month'} isExpanded={open === 'year'} onPress={toggleYear} picker={picker} ref={yearButton} />}\n </RACCalendarYearPicker>\n </div>\n {open === null ? children : null}\n {open === 'month' ? <RACCalendarMonthPicker format=\"long\">\n {picker => <MenuList disabledKeys={outsideBounds(picker)} id={listId} onClose={close} picker={picker} />}\n </RACCalendarMonthPicker> : null}\n {open === 'year' ? <RACCalendarYearPicker visibleYears={LISTED_YEARS}>\n {picker => <MenuList id={listId} onClose={close} picker={picker} />}\n </RACCalendarYearPicker> : null}\n </>;\n}\n\n/**\n * Scrolls an open list so its checked entry sits in the middle, as the page\n * draws it, with the entries either side of it in view. React Aria scrolls\n * the entry it focuses only as far as the nearest edge, which left the year\n * shown at the bottom with every later year out of sight; with it already\n * centred, that scroll has nothing to do.\n *\n * A ref on the checked entry's check rather than an effect on the list,\n * because React Aria builds its entries in a render of its own, after the\n * list's effects have run: the ref is called as the entry is attached,\n * before the first paint, so the list never draws a frame at its top and\n * then jumps. The list's own scroll alone moves, where `scrollIntoView` would\n * move the page around it too. A check rendered anywhere but an attached\n * list — React Aria renders its entries once out of the document to collect\n * them — finds no list and does nothing.\n */\nfunction centreInList(check: null | SVGSVGElement) {\n const entry = check?.closest('[role=\"option\"]');\n const list = check?.closest('[role=\"listbox\"]');\n if (!(entry instanceof HTMLElement) || !(list instanceof HTMLElement)) {\n return;\n }\n list.scrollTop += entry.getBoundingClientRect().top - list.getBoundingClientRect().top - (list.clientHeight - entry.offsetHeight) / 2;\n}\n\n// A chevron's classes, from React Aria's own render state. React Aria\n// disables one when the month it would move to is outside `minValue` and\n// `maxValue`, or the whole calendar is disabled, and a press on it then does\n// nothing — so it takes the shared fade, which drops the state layer too.\nfunction chevronClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}, isHidden = false) {\n return stylex.props(iconButton.chrome, calendarStyles.chevron, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled, isHidden && calendarStyles.chevronHidden).className ?? '';\n}\n\n// The same, hidden while a month or year list is open.\nfunction chevronClassNameWhile(isListOpen: boolean) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => chevronClassName(state, isListOpen);\n}\n\n/**\n * The month or the year as the page's menu button, opening its list. Named\n * by what it shows and then by what it is — \"Sep month\" — which keeps the\n * visible text the start of the name, so a reader who says what they see\n * reaches it.\n *\n * Outside React Aria's button context, which a calendar fills with its\n * `previous` and `next` slots alone: a button with no slot inside it is an\n * error, and these are not either chevron.\n */\nfunction MenuButton({\n controls,\n isDisabled,\n isExpanded,\n onPress,\n picker,\n ref\n}: {\n controls: string;\n isDisabled: boolean;\n isExpanded: boolean;\n onPress: () => void;\n picker: MenuPicker;\n ref: Ref<HTMLButtonElement>;\n}): ReactElement {\n const valueId = useId();\n const nameId = useId();\n const shown = picker.items.find(entry => entry.id === picker.value);\n return <ButtonContext value={null}>\n <RACButton aria-controls={isExpanded ? controls : undefined} aria-expanded={isExpanded} aria-haspopup=\"listbox\" aria-labelledby={`${valueId} ${nameId}`} className={menuButtonClassName} isDisabled={isDisabled} onPress={onPress} ref={ref}>\n <span id={valueId}>{shown?.formatted}</span>\n <span hidden id={nameId}>\n {picker['aria-label']}\n </span>\n <ArrowDropDownGlyph {...stylex.props(calendarStyles.menuArrow, isExpanded && calendarStyles.menuArrowExpanded)} />\n </RACButton>\n </ButtonContext>;\n}\n\n// A menu button's classes, from React Aria's render state, with the icon\n// buttons' state layers and fade — see `menuButton`.\nfunction menuButtonClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}) {\n return stylex.props(calendarStyles.menuButton, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled).className ?? '';\n}\n\n// One row of an open list: the check where the row is the one shown, the\n// room it takes where it is not, then the month or the year. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction menuEntry(entry: MenuEntry): ReactElement {\n return <RACListBoxItem className={menuItemClassName} id={entry.id} textValue={entry.formatted}>\n {menuEntryContent(entry.formatted)}\n </RACListBoxItem>;\n}\nfunction menuEntryContent(label: string) {\n return ({\n isSelected\n }: {\n isSelected: boolean;\n }) => <>\n {isSelected ? <CheckGlyph ref={centreInList} {...stylex.props(calendarStyles.menuCheck)} /> : <span {...stylex.props(calendarStyles.menuCheck)} />}\n {label}\n </>;\n}\n\n// A row's classes, from React Aria's render state. The layers come after the\n// checked row's surface variant, written for whichever ground the row has,\n// and the fade last, which StyleX lets drop them by replacing a property\n// whole.\nfunction menuItemClassName(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}) {\n return stylex.props(calendarStyles.menuItem, state.isSelected && calendarStyles.menuItemSelected, state.isHovered && (state.isSelected ? menuLayers.selectedHovered : dateLayers.plainHovered), state.isPressed && (state.isSelected ? menuLayers.selectedPressed : dateLayers.plainPressed), state.isFocusVisible && calendarStyles.menuItemFocused, state.isDisabled && calendarStyles.menuItemDisabled).className ?? '';\n}\n\n/**\n * An open month or year list, in the months' place. React Aria's list box,\n * with the entry the calendar shows selected and focused when it opens.\n *\n * Choosing closes it, and so does pressing the checked entry or Escape. A\n * single selection that may empty is what tells those apart: choosing\n * replaces the selection, while the checked entry toggles it off and Escape\n * clears it — and the clearing is what stops Escape there rather than letting\n * it close a picker's dialog around the calendar.\n */\nfunction MenuList({\n disabledKeys,\n id,\n onClose,\n picker\n}: {\n disabledKeys?: Key[];\n id: string;\n onClose: () => void;\n picker: MenuPicker;\n}): ReactElement {\n const selected = useMemo(() => [picker.value], [picker.value]);\n const choose = useCallback((keys: Selection) => {\n // The one entry a single selection holds after a choice, and none\n // after the checked entry is pressed again or Escape clears it.\n if (keys !== 'all') {\n for (const key of keys) {\n picker.onChange(key);\n }\n }\n onClose();\n }, [onClose, picker]);\n return <RACListBox aria-label={picker['aria-label']}\n // oxlint-disable-next-line jsx-a11y/no-autofocus -- a list opened from its button takes focus, as a select's does\n autoFocus disabledKeys={disabledKeys} id={id} items={picker.items} onSelectionChange={choose} selectedKeys={selected} selectionMode=\"single\"\n // On the release rather than the press, so the pointer is done with the\n // list before it closes: chosen on the press, the release landed on\n // whatever the closing list uncovered beneath it.\n shouldSelectOnPressUp {...stylex.props(calendarStyles.menuList)}>\n {menuEntry}\n </RACListBox>;\n}\nexport { CalendarFrame, CalendarGridHeader };"],"mappings":";;;;;;;;;;;AAqCA,MAAMoD,eAAe;;;;;;;;;;;;AAarB,SAAAC,cAAAC,IA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AxI,OAAawI,MAChB3F,OAAM9C,SAAUC,GAAG;GAGvBsI,QAAQ;EAAC;EACVhI,EAAA,KAAAgI;EAAAhI,EAAA,KAAAuC;EAAAvC,EAAA,KAAAQ;CAAA,OAAAA,KAAAR,EAAA;CATD,MAAAmI,SAAe3H;CAUgB,MAAAS,KAAAsB,OAAO;CAEe,MAAAD,KAAAC,OAAM/C;CAAM,IAAAwD;CAAA,IAAAhD,EAAA,OAAAM,OAAAC,IAAA,2BAAA,GAAA;EAIvCyC,KAAA/F,MAAa+B,eAAcoJ,QAAS;EAACpI,EAAA,KAAAgD;CAAA,OAAAA,KAAAhD,EAAA;CAAA,IAAAiD;CAAA,IAAAjD,EAAA,OAAAmI,UAAAnI,EAAA,OAAA+H,gBAAA/H,EAAA,OAAAV,MAAAU,EAAA,OAAAuC,OAAA/C,SAAAQ,EAAA,QAAAiI,YAAAjI,EAAA,QAAAiB,IAAA;EANxDgC,KAAA,oBAAC8F,SAAD;GAAwB,cAAA9H;GAE/B,WAAA;GAAwB8G;GAAkBzI;GAAW,OAAAgD;GAAiC6F,mBAAAA;GAAsBF,cAAAA;GAAwB,eAAA;GAIpI,uBAAA;GAAqB,GAAKjF;GACrB+D,UAAAA;EAPa,CAAA;EAQH/G,EAAA,KAAAmI;EAAAnI,EAAA,KAAA+H;EAAA/H,EAAA,KAAAV;EAAAU,EAAA,KAAAuC,OAAA/C;EAAAQ,EAAA,MAAAiI;EAAAjI,EAAA,MAAAiB;EAAAjB,EAAA,MAAAiD;CAAA,OAAAA,KAAAjD,EAAA;CAAA,OARRiD;AAQQ"}
1
+ {"version":3,"file":"index.js","names":["CalendarDate","ReactElement","ReactNode","Ref","Key","Selection","endOfMonth","startOfMonth","stylex","useCallback","useContext","useId","useMemo","useRef","useState","ButtonContext","CalendarStateContext","Button","RACButton","CalendarGridHeader","RACCalendarGridHeader","CalendarHeaderCell","RACCalendarHeaderCell","CalendarMonthPicker","RACCalendarMonthPicker","CalendarYearPicker","RACCalendarYearPicker","Heading","RACHeading","ListBox","RACListBox","ListBoxItem","RACListBoxItem","RangeCalendarStateContext","ArrowDropDownGlyph","CheckGlyph","ChevronEndGlyph","focus","iconButton","calendarStyles","dateLayers","menuLayers","MenuEntry","date","formatted","id","MenuPicker","items","onChange","key","value","OpenMenu","LISTED_YEARS","CalendarFrame","t0","$","_c","children","months","showMonthYearMenus","t1","Symbol","for","t2","single","range","isDisabled","disabledHeaderCell","calendarHeaderCell","CalendarHeader","props","header","chevronClassName","chevronGlyph","chevronGlyphPrevious","heading","t3","day","headerCell","CalendarMenus","state","open","setOpen","listId","monthButton","yearButton","button","requestAnimationFrame","current","close","_temp","toggleMonth","_temp2","toggleYear","t4","picker","filter","entry","maxValue","compare","minValue","map","_temp3","outsideBounds","t5","t6","headerGroup","t7","t8","chevronClassNameWhile","t9","t10","t11","picker_0","t12","t13","t14","t15","t16","t17","picker_1","t18","t19","t20","picker_2","t21","picker_3","t22","entry_0","current_0","centreInList","check","SVGSVGElement","closest","list","HTMLElement","scrollTop","getBoundingClientRect","top","clientHeight","offsetHeight","isHovered","isPressed","isHidden","chrome","chevron","ring","chromeHovered","chromePressed","chromeDisabled","chevronHidden","className","isListOpen","headerCellDisabled","MenuButton","controls","isExpanded","onPress","ref","valueId","nameId","find","shown","undefined","menuArrow","menuArrowExpanded","menuButtonClassName","menuButton","menuEntry","menuItemClassName","menuEntryContent","label","isSelected","menuCheck","isFocusVisible","menuItem","menuItemSelected","selectedHovered","plainHovered","selectedPressed","plainPressed","menuItemFocused","menuItemDisabled","MenuList","disabledKeys","onClose","selected","keys","choose","menuList","_c","CalendarGridHeader","RACCalendarGridHeader","stylex.props","RACButton","RACHeading","RACCalendarMonthPicker","RACCalendarYearPicker","RACCalendarHeaderCell","RACListBoxItem","RACListBox"],"sources":["../../src/calendar/index.tsx"],"sourcesContent":["import type { CalendarDate } from '@internationalized/date';\nimport type { ReactElement, ReactNode, Ref } from 'react';\nimport type { Key, Selection } from 'react-aria-components';\nimport { endOfMonth, startOfMonth } from '@internationalized/date';\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useContext, useId, useMemo, useRef, useState } from 'react';\nimport { ButtonContext, CalendarStateContext, Button as RACButton, CalendarGridHeader as RACCalendarGridHeader, CalendarHeaderCell as RACCalendarHeaderCell, CalendarMonthPicker as RACCalendarMonthPicker, CalendarYearPicker as RACCalendarYearPicker, Heading as RACHeading, ListBox as RACListBox, ListBoxItem as RACListBoxItem, RangeCalendarStateContext } from 'react-aria-components';\nimport { ArrowDropDownGlyph, CheckGlyph, ChevronEndGlyph } from '../glyphs';\nimport { focus } from '../styles/focus';\nimport { iconButton } from '../styles/icon-button';\nimport { calendarStyles, dateLayers, menuLayers } from './styles';\n\n// The parts Calendar and RangeCalendar both render: the row that moves the\n// month, the weekday header, and the offsets that put more than one month\n// side by side. Apart from either component so the two cannot drift, and\n// outside `src/components` for the reason ./styles.ts gives.\n\n/** One entry of React Aria's month or year picker, as either lists it. */\ntype MenuEntry = {\n date: CalendarDate;\n formatted: string;\n id: number;\n};\n\n/** What React Aria's month and year pickers hand the element they render. */\ntype MenuPicker = {\n 'aria-label': string;\n items: MenuEntry[];\n onChange: (key: Key | null) => void;\n value: Key;\n};\ntype OpenMenu = 'month' | 'year';\n\n// How many years the open year list holds: a century either side of the year\n// shown, and that year. Material Design's own list scrolls a whole range of\n// years rather than a window that moves with each choice, and Compose's\n// default range is two centuries. Bounds cut it short where they fall inside.\nconst LISTED_YEARS = 201;\n\n/**\n * What a calendar draws above its months, and the months themselves. With\n * `showMonthYearMenus` the header is the date pickers page's docked one —\n * the month and the year as menu buttons — and while either is open its list\n * takes the months' place.\n *\n * The menus are for one visible month. They name and pick the first month\n * alone, so a second grid beside it would have no visible month or year of\n * its own; with more than one month the header is the plain one, whose\n * heading names the whole range, both years included where it spans two.\n */\nfunction CalendarFrame({\n children,\n months,\n showMonthYearMenus\n}: {\n children: ReactNode;\n /** How many months the calendar shows side by side. */\n months: number;\n showMonthYearMenus: boolean;\n}): ReactElement {\n if (showMonthYearMenus && months <= 1) {\n return <CalendarMenus>{children}</CalendarMenus>;\n }\n return <>\n <CalendarHeader />\n {children}\n </>;\n}\n\n/**\n * The weekday row, faded with the rest of a calendar that is disabled. The\n * state comes from React Aria's context rather than a prop, so the two\n * calendars draw it the same way without either passing anything down.\n *\n * The narrow letters are for the eye alone. React Aria hides the row from\n * assistive technology, since every date's name opens with its weekday in\n * full, so a letter that two days share is never read out.\n */\nfunction CalendarGridHeader(): ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const isDisabled = (single ?? range)?.isDisabled ?? false;\n return <RACCalendarGridHeader>\n {isDisabled ? disabledHeaderCell : calendarHeaderCell}\n </RACCalendarGridHeader>;\n}\n\n/**\n * The two chevrons with the month between them. React Aria wires\n * `slot=\"previous\"` and `slot=\"next\"` on its own `Button`, and `IconButton`\n * renders React Aria's `Button` too — so nesting one inside a slot would put\n * two buttons where the date pickers page draws one. The chevrons take the\n * icon buttons page's 40dp square and its state layer instead.\n *\n * A plain element rather than a `<header>`: a header is a banner landmark,\n * landmarks may not nest, and React Aria puts a calendar in\n * `role=\"application\"` — axe fails the page on it.\n *\n * React Aria hides the heading between the chevrons from assistive\n * technology. The one a reader reaches is React Aria's own, out of sight,\n * naming the calendar's label with the month, so a calendar adds one heading\n * to the page's outline rather than two.\n */\nfunction CalendarHeader(): ReactElement {\n return <div {...stylex.props(calendarStyles.header)}>\n <RACButton className={chevronClassName} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACHeading {...stylex.props(calendarStyles.heading)} />\n <RACButton className={chevronClassName} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>;\n}\n\n/** The weekday row, in the type the page gives both it and the dates. */\nfunction calendarHeaderCell(day: string): ReactElement {\n return headerCell(day, false);\n}\n\n/**\n * The docked header: the month's menu button between the chevrons that step\n * it, and the year's menu button at the end. A press opens the button's list\n * in the months' place, where the page draws it, rather than in a popover over\n * them; a calendar inside a picker is already in one. While a list is open\n * the chevrons are hidden and the other menu is disabled, as the page draws\n * them, and choosing an entry — or pressing the one already checked, or\n * Escape — closes the list and puts focus back on its button.\n *\n * The lists are React Aria's month and year pickers, rendered twice: the\n * header names the month short, as the page's button does, and the list in\n * full. The year list runs a century either side of the year shown — React\n * Aria's own default is ten, which took several passes through the list to\n * reach a date of birth — and `minValue` and `maxValue` cut it short, which\n * React Aria does itself. A month with no day inside them is disabled here.\n */\nfunction CalendarMenus({\n children\n}: {\n children: ReactNode;\n}): ReactElement {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n const state = single ?? range;\n const [open, setOpen] = useState<null | OpenMenu>(null);\n const listId = useId();\n const monthButton = useRef<HTMLButtonElement>(null);\n const yearButton = useRef<HTMLButtonElement>(null);\n\n // A frame after the choice, and focus back on the button before the list\n // goes, rather than lost with it. The key that chose still has a keypress\n // to deliver: React Aria leaves Enter's default alone on a Mac, and with\n // focus already moved the keypress pressed the menu button and opened the\n // list again. A frame later it has landed on the list instead, as the\n // click after a pointer's choice has.\n const close = useCallback(() => {\n const button = open === 'month' ? monthButton : yearButton;\n requestAnimationFrame(() => {\n button.current?.focus();\n setOpen(null);\n });\n }, [open]);\n const toggleMonth = useCallback(() => {\n setOpen(current => current === 'month' ? null : 'month');\n }, []);\n const toggleYear = useCallback(() => {\n setOpen(current => current === 'year' ? null : 'year');\n }, []);\n const isDisabled = state?.isDisabled ?? false;\n const outsideBounds = (picker: MenuPicker) => picker.items.filter(entry => state?.maxValue != null && startOfMonth(entry.date).compare(state.maxValue) > 0 || state?.minValue != null && endOfMonth(entry.date).compare(state.minValue) < 0).map(entry => entry.id);\n return <>\n <div {...stylex.props(calendarStyles.header)}>\n <div {...stylex.props(calendarStyles.headerGroup)}>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"previous\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph, calendarStyles.chevronGlyphPrevious)} />\n </RACButton>\n <RACCalendarMonthPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'year'} isExpanded={open === 'month'} onPress={toggleMonth} picker={picker} ref={monthButton} />}\n </RACCalendarMonthPicker>\n <RACButton className={chevronClassNameWhile(open !== null)} slot=\"next\">\n <ChevronEndGlyph {...stylex.props(calendarStyles.chevronGlyph)} />\n </RACButton>\n </div>\n <RACCalendarYearPicker>\n {picker => <MenuButton controls={listId} isDisabled={isDisabled || open === 'month'} isExpanded={open === 'year'} onPress={toggleYear} picker={picker} ref={yearButton} />}\n </RACCalendarYearPicker>\n </div>\n {open === null ? children : null}\n {open === 'month' ? <RACCalendarMonthPicker format=\"long\">\n {picker => <MenuList disabledKeys={outsideBounds(picker)} id={listId} onClose={close} picker={picker} />}\n </RACCalendarMonthPicker> : null}\n {open === 'year' ? <RACCalendarYearPicker visibleYears={LISTED_YEARS}>\n {picker => <MenuList id={listId} onClose={close} picker={picker} />}\n </RACCalendarYearPicker> : null}\n </>;\n}\n\n/**\n * Scrolls an open list so its checked entry sits in the middle, as the page\n * draws it, with the entries either side of it in view. React Aria scrolls\n * the entry it focuses only as far as the nearest edge, which left the year\n * shown at the bottom with every later year out of sight; with it already\n * centred, that scroll has nothing to do.\n *\n * A ref on the checked entry's check rather than an effect on the list,\n * because React Aria builds its entries in a render of its own, after the\n * list's effects have run: the ref is called as the entry is attached,\n * before the first paint, so the list never draws a frame at its top and\n * then jumps. The list's own scroll alone moves, where `scrollIntoView` would\n * move the page around it too. A check rendered anywhere but an attached\n * list — React Aria renders its entries once out of the document to collect\n * them — finds no list and does nothing.\n */\nfunction centreInList(check: null | SVGSVGElement) {\n const entry = check?.closest('[role=\"option\"]');\n const list = check?.closest('[role=\"listbox\"]');\n if (!(entry instanceof HTMLElement) || !(list instanceof HTMLElement)) {\n return;\n }\n list.scrollTop += entry.getBoundingClientRect().top - list.getBoundingClientRect().top - (list.clientHeight - entry.offsetHeight) / 2;\n}\n\n// A chevron's classes, from React Aria's own render state. React Aria\n// disables one when the month it would move to is outside `minValue` and\n// `maxValue`, or the whole calendar is disabled, and a press on it then does\n// nothing — so it takes the shared fade, which drops the state layer too.\nfunction chevronClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}, isHidden = false) {\n return stylex.props(iconButton.chrome, calendarStyles.chevron, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled, isHidden && calendarStyles.chevronHidden).className ?? '';\n}\n\n// The same, hidden while a month or year list is open.\nfunction chevronClassNameWhile(isListOpen: boolean) {\n return (state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n }) => chevronClassName(state, isListOpen);\n}\n\n// A weekday in a disabled calendar, at the fade its dates take.\nfunction disabledHeaderCell(day: string): ReactElement {\n return headerCell(day, true);\n}\nfunction headerCell(day: string, isDisabled: boolean): ReactElement {\n return <RACCalendarHeaderCell {...stylex.props(calendarStyles.headerCell, isDisabled && calendarStyles.headerCellDisabled)}>\n {day}\n </RACCalendarHeaderCell>;\n}\n\n/**\n * The month or the year as the page's menu button, opening its list. Named\n * by what it shows and then by what it is — \"Sep month\" — which keeps the\n * visible text the start of the name, so a reader who says what they see\n * reaches it.\n *\n * Outside React Aria's button context, which a calendar fills with its\n * `previous` and `next` slots alone: a button with no slot inside it is an\n * error, and these are not either chevron.\n */\nfunction MenuButton({\n controls,\n isDisabled,\n isExpanded,\n onPress,\n picker,\n ref\n}: {\n controls: string;\n isDisabled: boolean;\n isExpanded: boolean;\n onPress: () => void;\n picker: MenuPicker;\n ref: Ref<HTMLButtonElement>;\n}): ReactElement {\n const valueId = useId();\n const nameId = useId();\n const shown = picker.items.find(entry => entry.id === picker.value);\n return <ButtonContext value={null}>\n <RACButton aria-controls={isExpanded ? controls : undefined} aria-expanded={isExpanded} aria-haspopup=\"listbox\" aria-labelledby={`${valueId} ${nameId}`} className={menuButtonClassName} isDisabled={isDisabled} onPress={onPress} ref={ref}>\n <span id={valueId}>{shown?.formatted}</span>\n <span hidden id={nameId}>\n {picker['aria-label']}\n </span>\n <ArrowDropDownGlyph {...stylex.props(calendarStyles.menuArrow, isExpanded && calendarStyles.menuArrowExpanded)} />\n </RACButton>\n </ButtonContext>;\n}\n\n// A menu button's classes, from React Aria's render state, with the icon\n// buttons' state layers and fade — see `menuButton`.\nfunction menuButtonClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}) {\n return stylex.props(calendarStyles.menuButton, focus.ring, state.isHovered && iconButton.chromeHovered, state.isPressed && iconButton.chromePressed, state.isDisabled && iconButton.chromeDisabled).className ?? '';\n}\n\n// One row of an open list: the check where the row is the one shown, the\n// room it takes where it is not, then the month or the year. Built by a call\n// rather than written inline at the prop, which is what react-perf's\n// no-new-function-as-prop is after.\nfunction menuEntry(entry: MenuEntry): ReactElement {\n return <RACListBoxItem className={menuItemClassName} id={entry.id} textValue={entry.formatted}>\n {menuEntryContent(entry.formatted)}\n </RACListBoxItem>;\n}\nfunction menuEntryContent(label: string) {\n return ({\n isSelected\n }: {\n isSelected: boolean;\n }) => <>\n {isSelected ? <CheckGlyph ref={centreInList} {...stylex.props(calendarStyles.menuCheck)} /> : <span {...stylex.props(calendarStyles.menuCheck)} />}\n {label}\n </>;\n}\n\n// A row's classes, from React Aria's render state. The layers come after the\n// checked row's surface variant, written for whichever ground the row has,\n// and the fade last, which StyleX lets drop them by replacing a property\n// whole.\nfunction menuItemClassName(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}) {\n return stylex.props(calendarStyles.menuItem, state.isSelected && calendarStyles.menuItemSelected, state.isHovered && (state.isSelected ? menuLayers.selectedHovered : dateLayers.plainHovered), state.isPressed && (state.isSelected ? menuLayers.selectedPressed : dateLayers.plainPressed), state.isFocusVisible && calendarStyles.menuItemFocused, state.isDisabled && calendarStyles.menuItemDisabled).className ?? '';\n}\n\n/**\n * An open month or year list, in the months' place. React Aria's list box,\n * with the entry the calendar shows selected and focused when it opens.\n *\n * Choosing closes it, and so does pressing the checked entry or Escape. A\n * single selection that may empty is what tells those apart: choosing\n * replaces the selection, while the checked entry toggles it off and Escape\n * clears it — and the clearing is what stops Escape there rather than letting\n * it close a picker's dialog around the calendar.\n */\nfunction MenuList({\n disabledKeys,\n id,\n onClose,\n picker\n}: {\n disabledKeys?: Key[];\n id: string;\n onClose: () => void;\n picker: MenuPicker;\n}): ReactElement {\n const selected = useMemo(() => [picker.value], [picker.value]);\n const choose = useCallback((keys: Selection) => {\n // The one entry a single selection holds after a choice, and none\n // after the checked entry is pressed again or Escape clears it.\n if (keys !== 'all') {\n for (const key of keys) {\n picker.onChange(key);\n }\n }\n onClose();\n }, [onClose, picker]);\n return <RACListBox aria-label={picker['aria-label']}\n // oxlint-disable-next-line jsx-a11y/no-autofocus -- a list opened from its button takes focus, as a select's does\n autoFocus disabledKeys={disabledKeys} id={id} items={picker.items} onSelectionChange={choose} selectedKeys={selected} selectionMode=\"single\"\n // On the release rather than the press, so the pointer is done with the\n // list before it closes: chosen on the press, the release landed on\n // whatever the closing list uncovered beneath it.\n shouldSelectOnPressUp {...stylex.props(calendarStyles.menuList)}>\n {menuEntry}\n </RACListBox>;\n}\nexport { CalendarFrame, CalendarGridHeader };"],"mappings":";;;;;;;;;;;AAqCA,MAAMoD,eAAe;;;;;;;;;;;;AAarB,SAAAC,cAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAuB,MAAA,EAAAC,UAAAC,QAAAC,uBAAAL;CAUrB,IAAIK,sBAAsBD,UAAU,GAAC;EAAA,IAAAE;EAAA,IAAAL,EAAA,OAAAE,UAAA;GAC5BG,KAAA,oBAAC,eAAD,EAAgBH,SAAF,CAAA;GAA2BF,EAAA,KAAAE;GAAAF,EAAA,KAAAK;EAAA,OAAAA,KAAAL,E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@@ const calendarStyles = {
42
43
  kjBf7l: "xrgy624 x3teovq",
43
44
  $$css: true
44
45
  },
46
+ cellInvalid: {
47
+ kWkggS: "x1skwi6t x1jzqe4",
48
+ kVAM5u: "xpdgbdc x1n2ykn",
49
+ kMwMTN: "x16elhoc x1k5gbb1",
50
+ $$css: true
51
+ },
45
52
  cellRangeEnd: {
46
53
  kT0f0o: "x187kppt",
47
54
  kfmiAY: "x1fpsnkq",
@@ -52,6 +59,10 @@ const calendarStyles = {
52
59
  krdFHd: "x1uni95s",
53
60
  $$css: true
54
61
  },
62
+ cellReadOnly: {
63
+ kkrTdU: "xt0e3qv",
64
+ $$css: true
65
+ },
55
66
  cellSelected: {
56
67
  kWkggS: "xnety89 x1jzqe4",
57
68
  kVAM5u: "x1uajy3w x1n2ykn",
@@ -60,6 +71,13 @@ const calendarStyles = {
60
71
  kjBf7l: "xrgy624 x3teovq",
61
72
  $$css: true
62
73
  },
74
+ cellSelectedDisabled: {
75
+ kWkggS: "x19v6zzp x1o55y2u",
76
+ kVAM5u: "x9r1u3d xmnqt3w",
77
+ kMwMTN: "x9w6zvh x1a46atw",
78
+ kAXs8y: "x1g12otp",
79
+ $$css: true
80
+ },
63
81
  cellToday: {
64
82
  kVAM5u: "x1uajy3w",
65
83
  ksu8eU: "x1y0btm7",
@@ -121,6 +139,10 @@ const calendarStyles = {
121
139
  kLWn49: "xh7dzej",
122
140
  $$css: true
123
141
  },
142
+ headerCellDisabled: {
143
+ kMwMTN: "x9w6zvh",
144
+ $$css: true
145
+ },
124
146
  headerGroup: {
125
147
  kGNEyG: "x6s0dn4",
126
148
  k1xSpc: "x78zum5",
@@ -264,6 +286,14 @@ const dateLayers = {
264
286
  kWkggS: "x1as5h4c x1jzqe4",
265
287
  $$css: true
266
288
  },
289
+ invalidHovered: {
290
+ kWkggS: "xbw18ef x1jzqe4",
291
+ $$css: true
292
+ },
293
+ invalidPressed: {
294
+ kWkggS: "xld5jmv x1jzqe4",
295
+ $$css: true
296
+ },
267
297
  plainHovered: {
268
298
  kWkggS: "x1b18xnh",
269
299
  $$css: true
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","names":["stylex","colors","media","radii","sizing","spacing","stateLayerOpacity","typography","ROW_BLOCK_SIZE","DATE_SIZE","DATE_ROOM","WEEK_INLINE_SIZE","TARGET_REACH","WEEKS_HELD","FORCED_COLORS","calendarStyles","cell","kgeoSG","kFcpXp","kEoFBp","kGNEyG","kWkggS","kZKoxP","kaIpWk","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kzqmXN","kjj79g","kb6lSQ","kLWn49","kqGvvJ","kUOVxO","kVAEAm","$$css","cellDisabled","kAXs8y","cellInRange","kVAM5u","kjBf7l","cellRangeEnd","kT0f0o","kfmiAY","cellRangeStart","kVL7Gh","krdFHd","cellSelected","cellToday","ksu8eU","kMzoRj","cellUnavailable","kMnn75","chevron","chevronGlyph","k3aq6I","chevronGlyphPrevious","chevronHidden","k33iCy","grid","kLvRdT","kheTzg","kPzzVL","header","kOIVth","kAzted","headerCell","headerGroup","heading","kogj98","k9WMMc","menuArrow","kmuXW","menuArrowExpanded","menuButton","kGOzcv","kpsdNU","kg3NbH","menuCheck","menuItem","k3XXqK","menuItemDisabled","menuItemFocused","kInvED","kMeerF","menuItemSelected","menuList","kLZC3w","kPef9Z","kEafiO","kORKVm","month","ks0D6T","months","kJBjZk","kumcoG","root","kXwgrk","k7Eaqz","kmVPX3","dateLayers","inRangeHovered","inRangePressed","plainHovered","plainPressed","selectedHovered","selectedPressed","menuLayers"],"sources":["../../src/calendar/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, radii, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The styles Calendar and RangeCalendar both draw. Apart from either\n// component so the two cannot drift, and outside `src/components` because a\n// directory there is a public component with stories, a barrel entry and a\n// `styling.test.tsx` case — which shared styles are none of.\n//\n// The values are the date pickers page's docked calendar, named in\n// `src/components/calendar/index.tsx` along with the departures from it. What\n// is only a range's — the band between the two ends — takes its colours from\n// the modal date picker's range-selection tokens instead, since the docked\n// token set stops at the selected date; see `cellInRange`.\n//\n// Under forced colours a selected date and a range's band are fills, which\n// that mode paints in a system colour, so a calendar showed no selection and\n// no range there, only today's outline. Both take `Highlight` with\n// `HighlightText` over it, the pair the mode gives whatever is chosen, which\n// draws a range as one run from its first day to its last.\n//\n// They take the pair with `forced-color-adjust: none`. Left to adjust, the\n// mode lays a `Canvas` backplate behind every run of text, and a date in\n// `HighlightText` on that backplate is a blank box. With it off nothing is\n// forced on those cells, so they name a system colour for everything they\n// draw — the fill, the date, today's outline and the focus ring. A day ruled\n// out or disabled names none, so it hands itself back to the mode.\n\n// One row of the grid. The weekday row and every week of dates are the same\n// 48dp, the page's date container and Compose's own row, so `headerCell`, the\n// room around each date and the room `months` reserves all follow this one\n// number — a row resized without the reservation following it would put the\n// calendar's height back on its month.\nconst ROW_BLOCK_SIZE = '48px';\n\n// The date's state layer: the 40dp circle a selected date fills and a hover\n// tints, inside the 48dp row and column it sits in.\nconst DATE_SIZE = '40px';\n\n// The room either side of a date's circle, which is the difference between\n// the two: the circle sits in the middle of its 48dp square.\nconst DATE_ROOM = `calc((${ROW_BLOCK_SIZE} - ${DATE_SIZE}) / 2)`;\n\n// A whole column: the page's 48dp date container, seven to a week. The grid\n// is at most seven of them and narrows with its container below that.\nconst WEEK_INLINE_SIZE = `calc(${ROW_BLOCK_SIZE} * 7)`;\n\n// What every press target in the calendar reaches to: the page's 48dp, for\n// controls drawn at 40.\nconst TARGET_REACH = `calc((${DATE_SIZE} - ${ROW_BLOCK_SIZE}) / 2)`;\n\n// The weeks the grid holds room for, which is the most any month occupies: a\n// 31-day month beginning on the last day of a week runs one day, then four\n// whole weeks, then two days. February 2026 is the other end at four. Holding\n// six draws every month in the box the longest one fills.\nconst WEEKS_HELD = 6;\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst calendarStyles = {\n cell: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kzqmXN: \"x100vrsf\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n kqGvvJ: \"x8yh5r3\",\n kUOVxO: \"xvueqy4\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n cellDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x9w6zvh\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n cellInRange: {\n kWkggS: \"x15dekr4 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n kaIpWk: \"x2u8bby\",\n kMwMTN: \"x1sawysd x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xrxpjvj\",\n kjBf7l: \"xrgy624 x3teovq\",\n $$css: true\n },\n cellRangeEnd: {\n kT0f0o: \"x187kppt\",\n kfmiAY: \"x1fpsnkq\",\n $$css: true\n },\n cellRangeStart: {\n kVL7Gh: \"x17kgqx\",\n krdFHd: \"x1uni95s\",\n $$css: true\n },\n cellSelected: {\n kWkggS: \"xnety89 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n kjBf7l: \"xrgy624 x3teovq\",\n $$css: true\n },\n cellToday: {\n kVAM5u: \"x1uajy3w\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n cellUnavailable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n kMnn75: \"x5lhwog\",\n $$css: true\n },\n chevron: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n kUOVxO: \"x34s64n\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n chevronGlyph: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n k3aq6I: \"x19axjrm x1c071of\",\n $$css: true\n },\n chevronGlyphPrevious: {\n k3aq6I: \"xdg80k9 xpk2tj9\",\n $$css: true\n },\n chevronHidden: {\n k33iCy: \"xlshs6z\",\n $$css: true\n },\n grid: {\n kLvRdT: \"x1vathgz\",\n kheTzg: \"x1gukg7c\",\n kzqmXN: \"xh8yej3\",\n kPzzVL: \"x140o2bo\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"x126z3so\",\n kjj79g: \"x1qughib\",\n kAzted: \"x1ba4aug\",\n $$css: true\n },\n headerCell: {\n kZKoxP: \"xsdox4t\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n headerGroup: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n heading: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kogj98: \"x1ghz6dp\",\n k9WMMc: \"x2b8uid\",\n $$css: true\n },\n menuArrow: {\n kZKoxP: \"xmix8c7\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1xp8n7a\",\n $$css: true\n },\n menuArrowExpanded: {\n k3aq6I: \"x19jd1h0\",\n $$css: true\n },\n menuButton: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1sk10ar\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"xzoy561\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kg3NbH: \"xn60lsn\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n menuCheck: {\n kZKoxP: \"xxk0z11\",\n kMwMTN: \"x139gbkf\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n menuItem: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"xbg5kjn\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n k3XXqK: \"x1t137rt\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n menuItemDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x9w6zvh\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n menuItemFocused: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n menuItemSelected: {\n kWkggS: \"xkrgufg\",\n $$css: true\n },\n menuList: {\n kZKoxP: \"xmmrubu\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n kB7OPa: \"x9f619\",\n kUOVxO: \"xnx04jz\",\n k3XXqK: \"x1t137rt\",\n kORKVm: \"x1odjw0f\",\n $$css: true\n },\n month: {\n kB7OPa: \"x9f619\",\n kzqmXN: \"x1url4ad\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n months: {\n kGNEyG: \"x7a106z\",\n k1xSpc: \"x78zum5 x1yrkhk\",\n kOIVth: \"xj2l1yv\",\n kJBjZk: \"x17udjhq\",\n kumcoG: \"x1kji8p3\",\n kAzted: \"x8chfrn\",\n $$css: true\n },\n root: {\n kWkggS: \"xvkjz1l\",\n kaIpWk: \"xhpdng0\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x1gka490\",\n kzqmXN: \"xeq5yr9\",\n ks0D6T: \"x193iq5w\",\n k7Eaqz: \"xjrddbv\",\n kmVPX3: \"xa36j16\",\n $$css: true\n }\n};\n\n// A date's hover and pressed layers, one pair per ground it sits on: nothing,\n// the range band, and the selected circle. From React Aria's render state rather than `:hover` and `:active`, for Button's\n// reasons — see its header: a hover layer stayed on after a tap, and no\n// pressed layer showed for a press made from the keyboard.\n// Each layer is written whole for its ground because StyleX replaces a\n// property whole, and the band and the circle keep their forced-colours\n// `Highlight` under the layer.\nconst dateLayers = {\n inRangeHovered: {\n kWkggS: \"x3zumxv x1jzqe4\",\n $$css: true\n },\n inRangePressed: {\n kWkggS: \"x1as5h4c x1jzqe4\",\n $$css: true\n },\n plainHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n plainPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n selectedHovered: {\n kWkggS: \"xo1ct44 x1jzqe4\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"x7b25lv x1jzqe4\",\n $$css: true\n }\n};\n\n// A list row's hover and pressed layers over the checked row's surface\n// variant. Over nothing a row takes a date's own pair, `dateLayers.plain*`,\n// since the page gives both the same on-surface layer.\nconst menuLayers = {\n selectedHovered: {\n kWkggS: \"xgw93rf\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"x113d7pk\",\n $$css: true\n }\n};\nexport { calendarStyles, dateLayers, menuLayers };"],"mappings":";AA8DA,MAAMe,iBAAiB;CACrBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,cAAc;EACZlB,QAAQ;EACRI,QAAQ;EACRC,QAAQ;EACRc,QAAQ;EACRF,OAAO;CACT;CACAG,aAAa;EACXpB,QAAQ;EACRqB,QAAQ;EACRnB,QAAQ;EACRE,QAAQ;EACRe,QAAQ;EACRT,QAAQ;EACRK,QAAQ;EACRO,QAAQ;EACRL,OAAO;CACT;CACAM,cAAc;EACZC,QAAQ;EACRC,QAAQ;EACRR,OAAO;CACT;CACAS,gBAAgB;EACdC,QAAQ;EACRC,QAAQ;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;EACRyE,QAAQ;EACRjC,QAAQ;EACRpC,QAAQ;EACRgE,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRhE,OAAO;CACT;AACF;AASA,MAAMiE,aAAa;CACjBC,gBAAgB;EACdnF,QAAQ;EACRiB,OAAO;CACT;CACAmE,gBAAgB;EACdpF,QAAQ;EACRiB,OAAO;CACT;CACAoE,cAAc;EACZrF,QAAQ;EACRiB,OAAO;CACT;CACAqE,cAAc;EACZtF,QAAQ;EACRiB,OAAO;CACT;CACAsE,iBAAiB;EACfvF,QAAQ;EACRiB,OAAO;CACT;CACAuE,iBAAiB;EACfxF,QAAQ;EACRiB,OAAO;CACT;AACF;AAKA,MAAMwE,aAAa;CACjBF,iBAAiB;EACfvF,QAAQ;EACRiB,OAAO;CACT;CACAuE,iBAAiB;EACfxF,QAAQ;EACRiB,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"styles.js","names":["stylex","colors","media","radii","sizing","spacing","stateLayerOpacity","typography","ROW_BLOCK_SIZE","DATE_SIZE","DATE_ROOM","WEEK_INLINE_SIZE","TARGET_REACH","WEEKS_HELD","FORCED_COLORS","calendarStyles","cell","kgeoSG","kFcpXp","kEoFBp","kGNEyG","kWkggS","kZKoxP","kaIpWk","kB7OPa","kMwMTN","kkrTdU","k1xSpc","kMv6JI","kGuDYH","k63SB2","kzqmXN","kjj79g","kb6lSQ","kLWn49","kqGvvJ","kUOVxO","kVAEAm","$$css","cellDisabled","kVAM5u","kAXs8y","cellInRange","kjBf7l","cellInvalid","cellRangeEnd","kT0f0o","kfmiAY","cellRangeStart","kVL7Gh","krdFHd","cellReadOnly","cellSelected","cellSelectedDisabled","cellToday","ksu8eU","kMzoRj","cellUnavailable","kMnn75","chevron","chevronGlyph","k3aq6I","chevronGlyphPrevious","chevronHidden","k33iCy","grid","kLvRdT","kheTzg","kPzzVL","header","kOIVth","kAzted","headerCell","headerCellDisabled","headerGroup","heading","kogj98","k9WMMc","menuArrow","kmuXW","menuArrowExpanded","menuButton","kGOzcv","kpsdNU","kg3NbH","menuCheck","menuItem","k3XXqK","menuItemDisabled","menuItemFocused","kInvED","kMeerF","menuItemSelected","menuList","kLZC3w","kPef9Z","kEafiO","kORKVm","month","ks0D6T","months","kJBjZk","kumcoG","root","kXwgrk","k7Eaqz","kmVPX3","dateLayers","inRangeHovered","inRangePressed","invalidHovered","invalidPressed","plainHovered","plainPressed","selectedHovered","selectedPressed","menuLayers"],"sources":["../../src/calendar/styles.ts"],"sourcesContent":["import * as stylex from '@stylexjs/stylex';\nimport '../tokens/design.tokens.stylex';\nimport { colors, media, radii, sizing, spacing, stateLayerOpacity, typography } from '../tokens/design.tokens.stylex';\n\n// The styles Calendar and RangeCalendar both draw. Apart from either\n// component so the two cannot drift, and outside `src/components` because a\n// directory there is a public component with stories, a barrel entry and a\n// `styling.test.tsx` case — which shared styles are none of.\n//\n// The values are the date pickers page's docked calendar, named in\n// `src/components/calendar/index.tsx` along with the departures from it. What\n// is only a range's — the band between the two ends — takes its colours from\n// the modal date picker's range-selection tokens instead, since the docked\n// token set stops at the selected date; see `cellInRange`.\n//\n// Under forced colours a selected date and a range's band are fills, which\n// that mode paints in a system colour, so a calendar showed no selection and\n// no range there, only today's outline. Both take `Highlight` with\n// `HighlightText` over it, the pair the mode gives whatever is chosen, which\n// draws a range as one run from its first day to its last.\n//\n// They take the pair with `forced-color-adjust: none`. Left to adjust, the\n// mode lays a `Canvas` backplate behind every run of text, and a date in\n// `HighlightText` on that backplate is a blank box. With it off nothing is\n// forced on those cells, so they name a system colour for everything they\n// draw — the fill, the date, today's outline and the focus ring. A day ruled\n// out or disabled names none, so it hands itself back to the mode, apart from\n// the date a disabled calendar holds, which takes `GrayText` as its fill in\n// the same way; see `cellSelectedDisabled`.\n\n// One row of the grid. The weekday row and every week of dates are the same\n// 48dp, the page's date container and Compose's own row, so `headerCell`, the\n// room around each date and the room `months` reserves all follow this one\n// number — a row resized without the reservation following it would put the\n// calendar's height back on its month.\nconst ROW_BLOCK_SIZE = '48px';\n\n// The date's state layer: the 40dp circle a selected date fills and a hover\n// tints, inside the 48dp row and column it sits in.\nconst DATE_SIZE = '40px';\n\n// The room either side of a date's circle, which is the difference between\n// the two: the circle sits in the middle of its 48dp square.\nconst DATE_ROOM = `calc((${ROW_BLOCK_SIZE} - ${DATE_SIZE}) / 2)`;\n\n// A whole column: the page's 48dp date container, seven to a week. The grid\n// is at most seven of them and narrows with its container below that.\nconst WEEK_INLINE_SIZE = `calc(${ROW_BLOCK_SIZE} * 7)`;\n\n// What every press target in the calendar reaches to: the page's 48dp, for\n// controls drawn at 40.\nconst TARGET_REACH = `calc((${DATE_SIZE} - ${ROW_BLOCK_SIZE}) / 2)`;\n\n// The weeks the grid holds room for, which is the most any month occupies: a\n// 31-day month beginning on the last day of a week runs one day, then four\n// whole weeks, then two days. February 2026 is the other end at four. Holding\n// six draws every month in the box the longest one fills.\nconst WEEKS_HELD = 6;\n\n// Windows High Contrast and the rest of the forced-colours modes. Spelled\n// here rather than imported, for the reason src/field/styles.ts records: the\n// StyleX compiler resolves a constant across files only out of a `.stylex.ts`\n// module, and the generated one holds design tokens rather than queries.\nconst FORCED_COLORS = '@media (forced-colors: active)';\nconst calendarStyles = {\n cell: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1vqgdyp\",\n kaIpWk: \"x16fbrrb\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kzqmXN: \"x100vrsf\",\n kjj79g: \"xl56j7k\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n kqGvvJ: \"x8yh5r3\",\n kUOVxO: \"xvueqy4\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n cellDisabled: {\n kWkggS: \"xjbqb8w\",\n kVAM5u: \"x1pojj9x\",\n kMwMTN: \"x9w6zvh\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n $$css: true\n },\n cellInRange: {\n kWkggS: \"x15dekr4 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n kaIpWk: \"x2u8bby\",\n kMwMTN: \"x1sawysd x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n kzqmXN: \"xh8yej3\",\n kUOVxO: \"xrxpjvj\",\n kjBf7l: \"xrgy624 x3teovq\",\n $$css: true\n },\n cellInvalid: {\n kWkggS: \"x1skwi6t x1jzqe4\",\n kVAM5u: \"xpdgbdc x1n2ykn\",\n kMwMTN: \"x16elhoc x1k5gbb1\",\n $$css: true\n },\n cellRangeEnd: {\n kT0f0o: \"x187kppt\",\n kfmiAY: \"x1fpsnkq\",\n $$css: true\n },\n cellRangeStart: {\n kVL7Gh: \"x17kgqx\",\n krdFHd: \"x1uni95s\",\n $$css: true\n },\n cellReadOnly: {\n kkrTdU: \"xt0e3qv\",\n $$css: true\n },\n cellSelected: {\n kWkggS: \"xnety89 x1jzqe4\",\n kVAM5u: \"x1uajy3w x1n2ykn\",\n kMwMTN: \"xwjo7ld x1k5gbb1\",\n kAXs8y: \"x1g12otp\",\n kjBf7l: \"xrgy624 x3teovq\",\n $$css: true\n },\n cellSelectedDisabled: {\n kWkggS: \"x19v6zzp x1o55y2u\",\n kVAM5u: \"x9r1u3d xmnqt3w\",\n kMwMTN: \"x9w6zvh x1a46atw\",\n kAXs8y: \"x1g12otp\",\n $$css: true\n },\n cellToday: {\n kVAM5u: \"x1uajy3w\",\n ksu8eU: \"x1y0btm7\",\n kMzoRj: \"xmkeg23\",\n kMwMTN: \"x1mxwv8y\",\n $$css: true\n },\n cellUnavailable: {\n kWkggS: \"xjbqb8w\",\n kkrTdU: \"x1h6gzvc\",\n kAXs8y: \"xr5dkdi\",\n kMnn75: \"x5lhwog\",\n $$css: true\n },\n chevron: {\n kgeoSG: \"x1cpjm7i\",\n kFcpXp: \"x15kbrqr\",\n kEoFBp: \"x1hmns74\",\n kUOVxO: \"x34s64n\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n chevronGlyph: {\n kZKoxP: \"xxk0z11\",\n kzqmXN: \"xvy4d1p\",\n k3aq6I: \"x19axjrm x1c071of\",\n $$css: true\n },\n chevronGlyphPrevious: {\n k3aq6I: \"xdg80k9 xpk2tj9\",\n $$css: true\n },\n chevronHidden: {\n k33iCy: \"xlshs6z\",\n $$css: true\n },\n grid: {\n kLvRdT: \"x1vathgz\",\n kheTzg: \"x1gukg7c\",\n kzqmXN: \"xh8yej3\",\n kPzzVL: \"x140o2bo\",\n $$css: true\n },\n header: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n kOIVth: \"x126z3so\",\n kjj79g: \"x1qughib\",\n kAzted: \"x1ba4aug\",\n $$css: true\n },\n headerCell: {\n kZKoxP: \"xsdox4t\",\n kMwMTN: \"x139gbkf\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n $$css: true\n },\n headerCellDisabled: {\n kMwMTN: \"x9w6zvh\",\n $$css: true\n },\n headerGroup: {\n kGNEyG: \"x6s0dn4\",\n k1xSpc: \"x78zum5\",\n $$css: true\n },\n heading: {\n kMwMTN: \"x1w5n3ug\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kogj98: \"x1ghz6dp\",\n k9WMMc: \"x2b8uid\",\n $$css: true\n },\n menuArrow: {\n kZKoxP: \"xmix8c7\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"x1xp8n7a\",\n $$css: true\n },\n menuArrowExpanded: {\n k3aq6I: \"x19jd1h0\",\n $$css: true\n },\n menuButton: {\n kgeoSG: \"x1cpjm7i\",\n kGOzcv: \"x1sk10ar\",\n kpsdNU: \"xm4btww\",\n kEoFBp: \"x1hmns74\",\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"x1rv7mn0\",\n kaIpWk: \"x1dkaolv\",\n kMzoRj: \"xc342km\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x1w5n3ug\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kmuXW: \"x2lah0s\",\n kMv6JI: \"xkknnkr\",\n kGuDYH: \"x14zspaw\",\n k63SB2: \"x1v9cpvo\",\n kOIVth: \"xzoy561\",\n kb6lSQ: \"x155f00i\",\n kLWn49: \"x1lz68p4\",\n kg3NbH: \"xn60lsn\",\n kVAEAm: \"x1n2onr6\",\n $$css: true\n },\n menuCheck: {\n kZKoxP: \"xxk0z11\",\n kMwMTN: \"x139gbkf\",\n kmuXW: \"x2lah0s\",\n kzqmXN: \"xvy4d1p\",\n $$css: true\n },\n menuItem: {\n kGNEyG: \"x6s0dn4\",\n kWkggS: \"xjbqb8w\",\n kZKoxP: \"xbg5kjn\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n kkrTdU: \"x1ypdohk\",\n k1xSpc: \"x78zum5\",\n kMv6JI: \"x16svsjw\",\n kGuDYH: \"x1848etk\",\n k63SB2: \"x1c52epr\",\n kOIVth: \"xxj4525\",\n kb6lSQ: \"x1qn8t5l\",\n kLWn49: \"xh7dzej\",\n k3XXqK: \"x1t137rt\",\n kg3NbH: \"x790zyz\",\n $$css: true\n },\n menuItemDisabled: {\n kWkggS: \"xjbqb8w\",\n kMwMTN: \"x9w6zvh\",\n kkrTdU: \"x1h6gzvc\",\n $$css: true\n },\n menuItemFocused: {\n kjBf7l: \"xrgy624\",\n kInvED: \"x2ssjo2\",\n k3XXqK: \"xaatb59\",\n kMeerF: \"x1de99jn\",\n $$css: true\n },\n menuItemSelected: {\n kWkggS: \"xkrgufg\",\n $$css: true\n },\n menuList: {\n kZKoxP: \"xmmrubu\",\n kLZC3w: \"x12smttz\",\n kPef9Z: \"x13fuv20\",\n kEafiO: \"x178xt8z\",\n kB7OPa: \"x9f619\",\n kUOVxO: \"xnx04jz\",\n k3XXqK: \"x1t137rt\",\n kORKVm: \"x1odjw0f\",\n $$css: true\n },\n month: {\n kB7OPa: \"x9f619\",\n kzqmXN: \"x1url4ad\",\n ks0D6T: \"x193iq5w\",\n $$css: true\n },\n months: {\n kGNEyG: \"x7a106z\",\n k1xSpc: \"x78zum5 x1yrkhk\",\n kOIVth: \"xj2l1yv\",\n kJBjZk: \"x17udjhq\",\n kumcoG: \"x1kji8p3\",\n kAzted: \"x8chfrn\",\n $$css: true\n },\n root: {\n kWkggS: \"xvkjz1l\",\n kaIpWk: \"xhpdng0\",\n kB7OPa: \"x9f619\",\n kMwMTN: \"x139gbkf\",\n k1xSpc: \"x78zum5\",\n kXwgrk: \"xdt5ytf\",\n kOIVth: \"x1gka490\",\n kzqmXN: \"xeq5yr9\",\n ks0D6T: \"x193iq5w\",\n k7Eaqz: \"xjrddbv\",\n kmVPX3: \"xa36j16\",\n $$css: true\n }\n};\n\n// A date's hover and pressed layers, one pair per ground it sits on: nothing,\n// the range band, the selected circle, and the invalid one. From React Aria's\n// render state rather than `:hover` and `:active`, for Button's reasons — see\n// its header: a hover layer stayed on after a tap, and no pressed layer\n// showed for a press made from the keyboard.\n// Each layer is written whole for its ground because StyleX replaces a\n// property whole, and the band and the circles keep their forced-colours\n// `Highlight` under the layer.\nconst dateLayers = {\n inRangeHovered: {\n kWkggS: \"x3zumxv x1jzqe4\",\n $$css: true\n },\n inRangePressed: {\n kWkggS: \"x1as5h4c x1jzqe4\",\n $$css: true\n },\n invalidHovered: {\n kWkggS: \"xbw18ef x1jzqe4\",\n $$css: true\n },\n invalidPressed: {\n kWkggS: \"xld5jmv x1jzqe4\",\n $$css: true\n },\n plainHovered: {\n kWkggS: \"x1b18xnh\",\n $$css: true\n },\n plainPressed: {\n kWkggS: \"xjeeohs\",\n $$css: true\n },\n selectedHovered: {\n kWkggS: \"xo1ct44 x1jzqe4\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"x7b25lv x1jzqe4\",\n $$css: true\n }\n};\n\n// A list row's hover and pressed layers over the checked row's surface\n// variant. Over nothing a row takes a date's own pair, `dateLayers.plain*`,\n// since the page gives both the same on-surface layer.\nconst menuLayers = {\n selectedHovered: {\n kWkggS: \"xgw93rf\",\n $$css: true\n },\n selectedPressed: {\n kWkggS: \"x113d7pk\",\n $$css: true\n }\n};\nexport { calendarStyles, dateLayers, menuLayers };"],"mappings":";AAgEA,MAAMe,iBAAiB;CACrBC,MAAM;EACJC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRC,OAAO;CACT;CACAC,cAAc;EACZlB,QAAQ;EACRmB,QAAQ;EACRf,QAAQ;EACRC,QAAQ;EACRe,QAAQ;EACRH,OAAO;CACT;CACAI,aAAa;EACXrB,QAAQ;EACRmB,QAAQ;EACRjB,QAAQ;EACRE,QAAQ;EACRgB,QAAQ;EACRV,QAAQ;EACRK,QAAQ;EACRO,QAAQ;EACRL,OAAO;CACT;CACAM,aAAa;EACXvB,QAAQ;EACRmB,QAAQ;EACRf,QAAQ;EACRa,OAAO;CACT;CACAO,cAAc;EACZC,QAAQ;EACRC,QAAQ;EACRT,OAAO;CACT;CACAU,gBAAgB;EACdC,QAAQ;EACRC,QAAQ;EACRZ,OAAO;CACT;CACAa,cAAc;EACZzB,QA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Q;EACR+B,QAAQ;EACRC,QAAQ;EACR/B,QAAQ;EACRjC,OAAO;CACT;CACAiE,MAAM;EACJlF,QAAQ;EACRE,QAAQ;EACRC,QAAQ;EACRC,QAAQ;EACRE,QAAQ;EACR6E,QAAQ;EACRlC,QAAQ;EACRvC,QAAQ;EACRoE,QAAQ;EACRM,QAAQ;EACRC,QAAQ;EACRpE,OAAO;CACT;AACF;AAUA,MAAMqE,aAAa;CACjBC,gBAAgB;EACdvF,QAAQ;EACRiB,OAAO;CACT;CACAuE,gBAAgB;EACdxF,QAAQ;EACRiB,OAAO;CACT;CACAwE,gBAAgB;EACdzF,QAAQ;EACRiB,OAAO;CACT;CACAyE,gBAAgB;EACd1F,QAAQ;EACRiB,OAAO;CACT;CACA0E,cAAc;EACZ3F,QAAQ;EACRiB,OAAO;CACT;CACA2E,cAAc;EACZ5F,QAAQ;EACRiB,OAAO;CACT;CACA4E,iBAAiB;EACf7F,QAAQ;EACRiB,OAAO;CACT;CACA6E,iBAAiB;EACf9F,QAAQ;EACRiB,OAAO;CACT;AACF;AAKA,MAAM8E,aAAa;CACjBF,iBAAiB;EACf7F,QAAQ;EACRiB,OAAO;CACT;CACA6E,iBAAiB;EACf9F,QAAQ;EACRiB,OAAO;CACT;AACF"}
@@ -2,18 +2,22 @@ import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
2
  import { CheckGlyph } from "../glyphs/index.js";
3
3
  import { focus } from "../styles/focus.js";
4
4
  import { chipLayers, chipStyles } from "./styles.js";
5
+ import { ChipLabel } from "./label.js";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  //#region src/chip/index.tsx
7
8
  /**
8
9
  * What a chip draws before its label: the check while it is selected, its own
9
- * icon while it is not, and nothing for an unselected chip with no icon.
10
- * Returns a node rather than letting the type be inferred, since `ReactNode`
11
- * is a union that includes a promise and an inferred one has to be `async`.
10
+ * icon while it is not, and for an unselected chip with no icon, a slot folded
11
+ * to nothing that opens when it is selected. A chip that can never be selected
12
+ * passes `selectable` as false and draws nothing there. Returns a node rather
13
+ * than letting the type be inferred, since `ReactNode` is a union that
14
+ * includes a promise and an inferred one has to be `async`.
12
15
  *
13
16
  * The check takes the icon's place rather than joining it, as the chips page
14
17
  * draws a filter chip and as a segmented button's segments do. So a chip with
15
18
  * an icon keeps its width when it is chosen, where one without grows by the
16
- * slot.
19
+ * slot, and the slot is kept mounted while folded so that growth has a width
20
+ * to transition from; see the header of `./styles`.
17
21
  *
18
22
  * Shared rather than written at each of the two call sites: Chip and
19
23
  * ChipGroup's chip draw the same pill from `./styles`, and a check written
@@ -21,12 +25,17 @@ import { jsx } from "react/jsx-runtime";
21
25
  * library's own and not exported from the package; see `src/row` for the
22
26
  * same arrangement around a list's row.
23
27
  */
24
- function chipGlyph(state, icon) {
28
+ function chipGlyph(state, icon, selectable = true) {
29
+ const hasIcon = icon !== void 0 && icon !== null;
30
+ if (!hasIcon && (selectable || state.isSelected)) return /* @__PURE__ */ jsx("span", {
31
+ ...props(chipStyles.glyph, chipStyles.glyphOpening, !state.isSelected && chipStyles.glyphFolded),
32
+ children: /* @__PURE__ */ jsx(CheckGlyph, { ...props(chipStyles.glyphSvg) })
33
+ });
25
34
  if (state.isSelected) return /* @__PURE__ */ jsx("span", {
26
35
  ...props(chipStyles.glyph),
27
36
  children: /* @__PURE__ */ jsx(CheckGlyph, { ...props(chipStyles.glyphSvg) })
28
37
  });
29
- if (icon === void 0 || icon === null) return null;
38
+ if (!hasIcon) return null;
30
39
  return /* @__PURE__ */ jsx("span", {
31
40
  ...props(chipStyles.glyph, !state.isDisabled && chipStyles.icon),
32
41
  children: icon
@@ -35,14 +44,12 @@ function chipGlyph(state, icon) {
35
44
  /**
36
45
  * The label a chip draws, in a span of its own so it can be cut short with an
37
46
  * ellipsis rather than wrapped out of the pill; see the header of `./styles`.
38
- * Shared for the reason `chipGlyph` is, by all three components that draw the
39
- * pill.
47
+ * A label cut short shows its full text in the browser's tooltip on hover —
48
+ * see `useClippedTitle`. Shared for the reason `chipGlyph` is, by all three
49
+ * components that draw the pill.
40
50
  */
41
51
  function chipLabel(children) {
42
- return /* @__PURE__ */ jsx("span", {
43
- ...props(chipStyles.label),
44
- children
45
- });
52
+ return /* @__PURE__ */ jsx(ChipLabel, { children });
46
53
  }
47
54
  const CONTAINERS = {
48
55
  elevated: {
@@ -78,21 +85,23 @@ const CONTAINERS = {
78
85
  *
79
86
  * `elevated` raises the chip off the page on a container of its own, and
80
87
  * `kind` names which of the page's chips it is, which decides the label's
81
- * role.
88
+ * role. `inert` marks a chip a press does nothing to, which draws the arrow
89
+ * rather than the pointer.
82
90
  */
83
- function chipPropsFor(state, { elevated = false, kind = "filter" } = {}) {
91
+ function chipPropsFor(state, { elevated = false, inert = false, kind = "filter" } = {}) {
84
92
  const roles = CONTAINERS[containerOf(state.isSelected, elevated)];
85
93
  const raised = elevated && !state.isDisabled;
86
- return props(chipStyles.base, chipStyles.target, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, elevated && !state.isSelected && chipStyles.elevated, kind === "assist" && chipStyles.assist, raised && chipStyles.raised, state.isHovered && roles.hovered, raised && state.isHovered && chipStyles.raisedHovered, state.isFocusVisible && roles.focused, state.isPressed && roles.pressed, state.isDisabled && chipStyles.disabled, state.isDisabled && roles.disabled);
94
+ return props(chipStyles.base, inert && chipStyles.inert, chipStyles.target, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, elevated && !state.isSelected && chipStyles.elevated, kind === "assist" && chipStyles.assist, raised && chipStyles.raised, state.isHovered && roles.hovered, raised && state.isHovered && chipStyles.raisedHovered, state.isFocusVisible && roles.focused, state.isPressed && roles.pressed, state.isDisabled && chipStyles.disabled, state.isDisabled && roles.disabled);
87
95
  }
88
96
  /**
89
97
  * The close target's class, from its button's own render state, so its
90
98
  * hover and pressed layers follow React Aria's report rather than `:hover`
91
- * and `:active` — see `chipLayers`. A function, which React Aria's
92
- * `className` takes alongside a string.
99
+ * and `:active` — see `chipLayers` — and a disabled chip's close target
100
+ * takes the chip's cursor. A function, which React Aria's `className` takes
101
+ * alongside a string.
93
102
  */
94
103
  function chipRemoveClassName(state) {
95
- return props(chipStyles.remove, state.isHovered && chipLayers.removeHovered, state.isPressed && chipLayers.removePressed).className ?? "";
104
+ return props(chipStyles.remove, state.isHovered && chipLayers.removeHovered, state.isPressed && chipLayers.removePressed, state.isDisabled && chipStyles.removeDisabled).className ?? "";
96
105
  }
97
106
  function containerOf(isSelected, elevated) {
98
107
  if (isSelected) return "selected";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ReactNode","stylex","CheckGlyph","focus","chipLayers","chipStyles","chipGlyph","state","isDisabled","isSelected","icon","props","glyph","glyphSvg","undefined","chipLabel","children","label","CONTAINERS","elevated","disabled","elevatedDisabled","focused","elevatedFocused","hovered","elevatedHovered","pressed","elevatedPressed","selected","disabledSelected","selectedFocused","selectedHovered","selectedPressed","unselected","disabledUnselected","unselectedFocused","unselectedHovered","unselectedPressed","ChipKind","chipPropsFor","isFocusVisible","isHovered","isPressed","kind","roles","containerOf","raised","base","target","ring","assist","raisedHovered","chipRemoveClassName","remove","removeHovered","removePressed","className","stylex.props"],"sources":["../../src/chip/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { CheckGlyph } from '../glyphs';\nimport { focus } from '../styles/focus';\nimport { chipLayers, chipStyles } from './styles';\n\n/**\n * What a chip draws before its label: the check while it is selected, its own\n * icon while it is not, and nothing for an unselected chip with no icon.\n * Returns a node rather than letting the type be inferred, since `ReactNode`\n * is a union that includes a promise and an inferred one has to be `async`.\n *\n * The check takes the icon's place rather than joining it, as the chips page\n * draws a filter chip and as a segmented button's segments do. So a chip with\n * an icon keeps its width when it is chosen, where one without grows by the\n * slot.\n *\n * Shared rather than written at each of the two call sites: Chip and\n * ChipGroup's chip draw the same pill from `./styles`, and a check written\n * twice is the drift that module exists to stop. Not a component of the\n * library's own and not exported from the package; see `src/row` for the\n * same arrangement around a list's row.\n */\nfunction chipGlyph(state: {\n isDisabled: boolean;\n isSelected: boolean;\n}, icon?: ReactNode): ReactNode {\n if (state.isSelected) {\n return <span {...stylex.props(chipStyles.glyph)}>\n <CheckGlyph {...stylex.props(chipStyles.glyphSvg)} />\n </span>;\n }\n if (icon === undefined || icon === null) {\n return null;\n }\n return <span {...stylex.props(chipStyles.glyph, !state.isDisabled && chipStyles.icon)}>\n {icon}\n </span>;\n}\n\n/**\n * The label a chip draws, in a span of its own so it can be cut short with an\n * ellipsis rather than wrapped out of the pill; see the header of `./styles`.\n * Shared for the reason `chipGlyph` is, by all three components that draw the\n * pill.\n */\nfunction chipLabel(children: ReactNode): ReactNode {\n return <span {...stylex.props(chipStyles.label)}>{children}</span>;\n}\n\n// The three containers a chip can be on, with the layers and the disabled\n// treatment each takes. A table rather than a branch per state, so the\n// containers cannot differ in which states they answer.\nconst CONTAINERS = {\n elevated: {\n disabled: chipStyles.elevatedDisabled,\n focused: chipLayers.elevatedFocused,\n hovered: chipLayers.elevatedHovered,\n pressed: chipLayers.elevatedPressed\n },\n selected: {\n disabled: chipStyles.disabledSelected,\n focused: chipLayers.selectedFocused,\n hovered: chipLayers.selectedHovered,\n pressed: chipLayers.selectedPressed\n },\n unselected: {\n disabled: chipStyles.disabledUnselected,\n focused: chipLayers.unselectedFocused,\n hovered: chipLayers.unselectedHovered,\n pressed: chipLayers.unselectedPressed\n }\n};\n\n/** Which of the page's chips a pill is drawn as. */\ntype ChipKind = 'assist' | 'filter' | 'suggestion';\n\n/**\n * The pill's styles in the render state React Aria hands a chip's\n * `className`, for Chip's two buttons and ChipGroup's tag alike. StyleX\n * cannot target `[data-selected]` on the element it is styling, so the\n * container is chosen here rather than in CSS — which is also why an\n * uncontrolled chip styles itself without keeping a copy of its state.\n *\n * Shared for the reason `chipGlyph` is: the order is the precedence. The\n * hover, focus and pressed layers come from the render state over the\n * container — focus over hover, and a press over both — and disabled comes\n * last so it wins over all of them, since StyleX replaces a property whole.\n *\n * `elevated` raises the chip off the page on a container of its own, and\n * `kind` names which of the page's chips it is, which decides the label's\n * role.\n */\nfunction chipPropsFor(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}, {\n elevated = false,\n kind = 'filter'\n}: {\n elevated?: boolean;\n kind?: ChipKind;\n} = {}) {\n const roles = CONTAINERS[containerOf(state.isSelected, elevated)];\n const raised = elevated && !state.isDisabled;\n return stylex.props(chipStyles.base, chipStyles.target, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, elevated && !state.isSelected && chipStyles.elevated, kind === 'assist' && chipStyles.assist, raised && chipStyles.raised, state.isHovered && roles.hovered, raised && state.isHovered && chipStyles.raisedHovered, state.isFocusVisible && roles.focused, state.isPressed && roles.pressed, state.isDisabled && chipStyles.disabled, state.isDisabled && roles.disabled);\n}\n\n/**\n * The close target's class, from its button's own render state, so its\n * hover and pressed layers follow React Aria's report rather than `:hover`\n * and `:active` — see `chipLayers`. A function, which React Aria's\n * `className` takes alongside a string.\n */\nfunction chipRemoveClassName(state: {\n isHovered: boolean;\n isPressed: boolean;\n}) {\n return stylex.props(chipStyles.remove, state.isHovered && chipLayers.removeHovered, state.isPressed && chipLayers.removePressed).className ?? '';\n}\n\n// Which container a chip is on: the secondary container while selected,\n// elevated or not, and otherwise the elevated one or the outline.\nfunction containerOf(isSelected: boolean, elevated: boolean) {\n if (isSelected) {\n return 'selected';\n }\n return elevated ? 'elevated' : 'unselected';\n}\nexport type { ChipKind };\nexport { chipGlyph, chipLabel, chipPropsFor, chipRemoveClassName };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAASM,UAAUC,OAGhBG,MAA6B;CAC9B,IAAIH,MAAME,YACR,OAAO,oBAAC,QAAD;EAAM,GAAIR,MAAaI,WAAWO,KAAK;EAC1C,UAAA,oBAAC,YAAD,EAAY,GAAIX,MAAaI,WAAWQ,QAAQ,EAAE,CAAA;CAC9C,CAAA;CAEV,IA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xB,QAAQ;AAC9e;;;;;;;AAQA,SAASgC,oBAAoB7C,OAG1B;CACD,OAAON,MAAaI,WAAWgD,QAAQ9C,MAAMkC,aAAarC,WAAWkD,eAAe/C,MAAMmC,aAAatC,WAAWmD,aAAa,CAAC,CAACC,aAAa;AAChJ;AAIA,SAASX,YAAYpC,YAAqBU,UAAmB;CAC3D,IAAIV,YACF,OAAO;CAET,OAAOU,WAAW,aAAa;AACjC"}
1
+ {"version":3,"file":"index.js","names":["ReactNode","stylex","CheckGlyph","focus","ChipLabel","chipLayers","chipStyles","chipGlyph","state","isDisabled","isSelected","icon","selectable","hasIcon","undefined","props","glyph","glyphOpening","glyphFolded","glyphSvg","chipLabel","children","CONTAINERS","elevated","disabled","elevatedDisabled","focused","elevatedFocused","hovered","elevatedHovered","pressed","elevatedPressed","selected","disabledSelected","selectedFocused","selectedHovered","selectedPressed","unselected","disabledUnselected","unselectedFocused","unselectedHovered","unselectedPressed","ChipKind","chipPropsFor","isFocusVisible","isHovered","isPressed","inert","kind","roles","containerOf","raised","base","target","ring","assist","raisedHovered","chipRemoveClassName","remove","removeHovered","removePressed","removeDisabled","className","stylex.props"],"sources":["../../src/chip/index.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { CheckGlyph } from '../glyphs';\nimport { focus } from '../styles/focus';\nimport { ChipLabel } from './label';\nimport { chipLayers, chipStyles } from './styles';\n\n/**\n * What a chip draws before its label: the check while it is selected, its own\n * icon while it is not, and for an unselected chip with no icon, a slot folded\n * to nothing that opens when it is selected. A chip that can never be selected\n * passes `selectable` as false and draws nothing there. Returns a node rather\n * than letting the type be inferred, since `ReactNode` is a union that\n * includes a promise and an inferred one has to be `async`.\n *\n * The check takes the icon's place rather than joining it, as the chips page\n * draws a filter chip and as a segmented button's segments do. So a chip with\n * an icon keeps its width when it is chosen, where one without grows by the\n * slot, and the slot is kept mounted while folded so that growth has a width\n * to transition from; see the header of `./styles`.\n *\n * Shared rather than written at each of the two call sites: Chip and\n * ChipGroup's chip draw the same pill from `./styles`, and a check written\n * twice is the drift that module exists to stop. Not a component of the\n * library's own and not exported from the package; see `src/row` for the\n * same arrangement around a list's row.\n */\nfunction chipGlyph(state: {\n isDisabled: boolean;\n isSelected: boolean;\n}, icon?: ReactNode, selectable = true): ReactNode {\n const hasIcon = icon !== undefined && icon !== null;\n if (!hasIcon && (selectable || state.isSelected)) {\n return <span {...stylex.props(chipStyles.glyph, chipStyles.glyphOpening, !state.isSelected && chipStyles.glyphFolded)}>\n <CheckGlyph {...stylex.props(chipStyles.glyphSvg)} />\n </span>;\n }\n if (state.isSelected) {\n return <span {...stylex.props(chipStyles.glyph)}>\n <CheckGlyph {...stylex.props(chipStyles.glyphSvg)} />\n </span>;\n }\n if (!hasIcon) {\n return null;\n }\n return <span {...stylex.props(chipStyles.glyph, !state.isDisabled && chipStyles.icon)}>\n {icon}\n </span>;\n}\n\n/**\n * The label a chip draws, in a span of its own so it can be cut short with an\n * ellipsis rather than wrapped out of the pill; see the header of `./styles`.\n * A label cut short shows its full text in the browser's tooltip on hover —\n * see `useClippedTitle`. Shared for the reason `chipGlyph` is, by all three\n * components that draw the pill.\n */\nfunction chipLabel(children: ReactNode): ReactNode {\n return <ChipLabel>{children}</ChipLabel>;\n}\n\n// The three containers a chip can be on, with the layers and the disabled\n// treatment each takes. A table rather than a branch per state, so the\n// containers cannot differ in which states they answer.\nconst CONTAINERS = {\n elevated: {\n disabled: chipStyles.elevatedDisabled,\n focused: chipLayers.elevatedFocused,\n hovered: chipLayers.elevatedHovered,\n pressed: chipLayers.elevatedPressed\n },\n selected: {\n disabled: chipStyles.disabledSelected,\n focused: chipLayers.selectedFocused,\n hovered: chipLayers.selectedHovered,\n pressed: chipLayers.selectedPressed\n },\n unselected: {\n disabled: chipStyles.disabledUnselected,\n focused: chipLayers.unselectedFocused,\n hovered: chipLayers.unselectedHovered,\n pressed: chipLayers.unselectedPressed\n }\n};\n\n/** Which of the page's chips a pill is drawn as. */\ntype ChipKind = 'assist' | 'filter' | 'suggestion';\n\n/**\n * The pill's styles in the render state React Aria hands a chip's\n * `className`, for Chip's two buttons and ChipGroup's tag alike. StyleX\n * cannot target `[data-selected]` on the element it is styling, so the\n * container is chosen here rather than in CSS — which is also why an\n * uncontrolled chip styles itself without keeping a copy of its state.\n *\n * Shared for the reason `chipGlyph` is: the order is the precedence. The\n * hover, focus and pressed layers come from the render state over the\n * container — focus over hover, and a press over both — and disabled comes\n * last so it wins over all of them, since StyleX replaces a property whole.\n *\n * `elevated` raises the chip off the page on a container of its own, and\n * `kind` names which of the page's chips it is, which decides the label's\n * role. `inert` marks a chip a press does nothing to, which draws the arrow\n * rather than the pointer.\n */\nfunction chipPropsFor(state: {\n isDisabled: boolean;\n isFocusVisible: boolean;\n isHovered: boolean;\n isPressed: boolean;\n isSelected: boolean;\n}, {\n elevated = false,\n inert = false,\n kind = 'filter'\n}: {\n elevated?: boolean;\n inert?: boolean;\n kind?: ChipKind;\n} = {}) {\n const roles = CONTAINERS[containerOf(state.isSelected, elevated)];\n const raised = elevated && !state.isDisabled;\n return stylex.props(chipStyles.base, inert && chipStyles.inert, chipStyles.target, focus.ring, state.isSelected ? chipStyles.selected : chipStyles.unselected, elevated && !state.isSelected && chipStyles.elevated, kind === 'assist' && chipStyles.assist, raised && chipStyles.raised, state.isHovered && roles.hovered, raised && state.isHovered && chipStyles.raisedHovered, state.isFocusVisible && roles.focused, state.isPressed && roles.pressed, state.isDisabled && chipStyles.disabled, state.isDisabled && roles.disabled);\n}\n\n/**\n * The close target's class, from its button's own render state, so its\n * hover and pressed layers follow React Aria's report rather than `:hover`\n * and `:active` — see `chipLayers` — and a disabled chip's close target\n * takes the chip's cursor. A function, which React Aria's `className` takes\n * alongside a string.\n */\nfunction chipRemoveClassName(state: {\n isDisabled: boolean;\n isHovered: boolean;\n isPressed: boolean;\n}) {\n return stylex.props(chipStyles.remove, state.isHovered && chipLayers.removeHovered, state.isPressed && chipLayers.removePressed, state.isDisabled && chipStyles.removeDisabled).className ?? '';\n}\n\n// Which container a chip is on: the secondary container while selected,\n// elevated or not, and otherwise the elevated one or the outline.\nfunction containerOf(isSelected: boolean, elevated: boolean) {\n if (isSelected) {\n return 'selected';\n }\n return elevated ? 'elevated' : 'unselected';\n}\nexport type { ChipKind };\nexport { chipGlyph, chipLabel, chipPropsFor, chipRemoveClassName };"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAASO,UAAUC,OAGhBG,MAAkBC,aAAa,MAAiB;CACjD,MAAMC,UAAUF,SAASG,KAAAA,KAAaH,SAAS;CAC/C,IAAI,CAACE,YAAYD,cAAcJ,MAAME,aACnC,OAAO,oBAAC,QAAD;EAAM,GAAIT,MAAaK,WAAWU,OAAOV,WAAWW,cAAc,CAACT,MAAME,cAAcJ,WAAWY,WAAW;EAChH,UAAA,oBAAC,YAAD,EAAY,GAAIjB,MAAaK,WAAWa,QAAQ,EAAE,CAAA;CAC9C,CAAA;CAEV,IAAIX,MAAME,YACR,OAAO,oBAAC,QAAD;EAAM,GAAIT,MAAaK,WAAWU,KAAK;EAC1C,UAAA,oBAAC,YAAD,EAAY,GAAIf,MAAaK,WAAWa,QAAQ,EAAE,CAAA;CAC9C,CAAA;CAEV,IAAI,CAACN,SACH,OAAO;CAET,OAAO,oBAAC,QAAD;EAAM,GAAIZ,MAAaK,WAAWU,OAAO,CAACR,MAAMC,cAAcH,WAAWK,IAAI;EAC/EA,UAAAA;CACG,CAAA;AACV;;;;;;;;AASA,SAASS,UAAUC,UAAgC;CACjD,OAAO,oBAAC,WAAD,EAAYA,SAAoB,CAAA;AACzC;AAKA,MAAMC,aAAa;CACjBC,UAAU;EACRC,UAAUlB,WAAWmB;EACrBC,SAASrB,WAAWsB;EACpBC,SAASvB,WAAWwB;EACpBC,SAASzB,WAAW0B;CACtB;CACAC,UAAU;EACRR,UAAUlB,WAAW2B;EACrBP,SAASrB,WAAW6B;EACpBN,SAASvB,WAAW8B;EACpBL,SAASzB,WAAW+B;CACtB;CACAC,YAAY;EACVb,UAAUlB,WAAWgC;EACrBZ,SAASrB,WAAWkC;EACpBX,SAASvB,WAAWmC;EACpBV,SAASzB,WAAWoC;CACtB;AACF;;;;;;;;;;;;;;;;;;AAsBA,SAASE,aAAanC,OAMnB,EACDe,WAAW,OACXwB,QAAQ,OACRC,OAAO,aAKL,CAAC,GAAG;CACN,MAAMC,QAAQ3B,WAAW4B,YAAY1C,MAAME,YAAYa,QAAQ;CAC/D,MAAM4B,SAAS5B,YAAY,CAACf,MAAMC;CAClC,OAAOR,MAAaK,WAAW8C,MAAML,SAASzC,WAAWyC,OAAOzC,WAAW+C,QAAQlD,MAAMmD,MAAM9C,MAAME,aAAaJ,WAAW0B,WAAW1B,WAAW+B,YAAYd,YAAY,CAACf,MAAME,cAAcJ,WAAWiB,UAAUyB,SAAS,YAAY1C,WAAWiD,QAAQJ,UAAU7C,WAAW6C,QAAQ3C,MAAMqC,aAAaI,MAAMrB,SAASuB,UAAU3C,MAAMqC,aAAavC,WAAWkD,eAAehD,MAAMoC,kBAAkBK,MAAMvB,SAASlB,MAAMsC,aAAaG,MAAMnB,SAAStB,MAAMC,cAAcH,WAAWkB,UAAUhB,MAAMC,cAAcwC,MAAMzB,QAAQ;AACzgB;;;;;;;;AASA,SAASiC,oBAAoBjD,OAI1B;CACD,OAAOP,MAAaK,WAAWoD,QAAQlD,MAAMqC,aAAaxC,WAAWsD,eAAenD,MAAMsC,aAAazC,WAAWuD,eAAepD,MAAMC,cAAcH,WAAWuD,cAAc,CAAC,CAACC,aAAa;AAC/L;AAIA,SAASZ,YAAYxC,YAAqBa,UAAmB;CAC3D,IAAIb,YACF,OAAO;CAET,OAAOa,WAAW,aAAa;AACjC"}
@@ -0,0 +1,32 @@
1
+ import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
2
+ import { useClippedTitle } from "../hooks/useClippedTitle.js";
3
+ import { chipStyles } from "./styles.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/chip/label.tsx
7
+ function ChipLabel(t0) {
8
+ const $ = c(4);
9
+ const { children } = t0;
10
+ const clipped = useClippedTitle(children);
11
+ let t1;
12
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
13
+ t1 = props(chipStyles.label);
14
+ $[0] = t1;
15
+ } else t1 = $[0];
16
+ let t2;
17
+ if ($[1] !== children || $[2] !== clipped) {
18
+ t2 = /* @__PURE__ */ jsx("span", {
19
+ ...clipped,
20
+ ...t1,
21
+ children
22
+ });
23
+ $[1] = children;
24
+ $[2] = clipped;
25
+ $[3] = t2;
26
+ } else t2 = $[3];
27
+ return t2;
28
+ }
29
+ //#endregion
30
+ export { ChipLabel };
31
+
32
+ //# sourceMappingURL=label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.js","names":["ReactNode","stylex","useClippedTitle","chipStyles","ChipLabel","t0","$","_c","children","clipped","t1","Symbol","for","props","label","t2","_c","stylex.props"],"sources":["../../src/chip/label.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport * as stylex from '@stylexjs/stylex';\nimport { useClippedTitle } from '../hooks/useClippedTitle';\nimport { chipStyles } from './styles';\n\n// Apart from ./index.tsx so that file keeps to the helpers it shares and this\n// one to the component, which is what keeps fast refresh working for both.\n\n// The span `chipLabel` draws, as a component, since the title is state and\n// `chipLabel` is called from React Aria's render functions.\nfunction ChipLabel({\n children\n}: {\n children: ReactNode;\n}) {\n const clipped = useClippedTitle(children);\n return <span {...clipped} {...stylex.props(chipStyles.label)}>\n {children}\n </span>;\n}\nexport { ChipLabel };"],"mappings":";;;;;;AAUA,SAAAI,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAmB,MAAA,EAAAC,aAAAH;CAKjB,MAAAI,UAAgBP,gBAAgBM,QAAQ;CAAE,IAAAE;CAAA,IAAAJ,EAAA,OAAAK,OAAAC,IAAA,2BAAA,GAAA;EACZF,KAAAT,MAAaE,WAAUW,KAAM;EAACR,EAAA,KAAAI;CAAA,OAAAA,KAAAJ,EAAA;CAAA,IAAAS;CAAA,IAAAT,EAAA,OAAAE,YAAAF,EAAA,OAAAG,SAAA;EAArDM,KAAA,oBAAA,QAAA;GAEE,GAFQN;GAAO,GAAMC;GACzBF;EACI,CAAA;EAAAF,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OAFFS;AAEE"}