foldkit-mixins-ui 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,7 +31,7 @@ Three kinds of thing live here:
31
31
  - **Stateless views** draw a vocabulary from what the application passes and
32
32
  keep nothing: Card, Badge, Item, Avatar, Command, Slider, PasswordInput.
33
33
  - **Components with a small Model of their own**: Menu, Menubar, Toast,
34
- Sheet, Drawer, TagsInput, TreeView, Carousel, Resizable, ColorPicker, InputCopy,
34
+ Sheet, Picker, WindowList, Drawer, TagsInput, TreeView, Carousel, Resizable, ColorPicker, InputCopy,
35
35
  MessageScroller, Questionnaire, AngleSlider, Timer, Marquee, ImageCropper,
36
36
  SignaturePad, Chart, CascadeSelect, FloatingPanel and Tour.
37
37
  The Model holds interaction state only (what is open, a drag, a countdown,
@@ -473,7 +473,7 @@ adapter.
473
473
 
474
474
  These views take no `@foldkit/ui` bundle. Call `X.view(options, h)`. Most own no
475
475
  Model and no Message; the components among them that keep a small Model
476
- (Menu, Menubar, Toast, Sheet, Drawer, TagsInput, TreeView, Carousel, Resizable,
476
+ (Menu, Menubar, Toast, Sheet, Picker, WindowList, Drawer, TagsInput, TreeView, Carousel, Resizable,
477
477
  ColorPicker, InputCopy, MessageScroller, Questionnaire, AngleSlider, Timer,
478
478
  Marquee, ImageCropper, SignaturePad, Chart, CascadeSelect, FloatingPanel,
479
479
  Tour) say so, with its `init` and `update`.
@@ -557,6 +557,7 @@ glyph with it, so the recipe's size is the drawing's.
557
557
  | `Separator` | `{ orientation?, label?, decorative? }`, horizontal by default. A `label` sits between two drawn rules and is read as text; `decorative` is `role="none"`. The rule and a label's frame carry `data-orientation`, which the recipe reads, so one style draws both orientations. A vertical rule stretches across a flex or grid row, short of it by the inset, and elsewhere (running text) stands as tall as the letters. | `line`: `solid`, `dashed`, `dotted`; `thickness`: `thin`, `thick`; `spacing`: `none`, `sm`, `md`, `lg`; `inset`: `none`, `sm`, `md`. The line is a border in `outline.default`, which a dark page shows. Slots `rule`, `root`, `label`. |
558
558
  | `Drawer` | A panel docked to the bottom of the screen that peeks or opens beside the page, not over it: no focus trap, backdrop or scroll lock, so the page under it stays live (a modal one is the `Sheet`). `Drawer.init({ id, open?, swipe? })` (down by default), folded with `Drawer.update`, opened with `Drawer.open` and `Drawer.close`, drawn with `Drawer.view({ model, onMessage, labels: { open, closed }, style?, mixins?, draw }, h)`, `draw` laying out `panel`, `handle`, `body` (the body may sit below what else peeks with the handle) and, optionally, `grip`, more to drag it by (a row of tabs: vertical swipes drag it, sideways ones still scroll). A drag follows the finger and lets go open or down by its speed, then by how far it came. `swipe: { from?, flickSpeed?, closeShare? }` says how it is swiped: a finger drags it from anywhere on the panel (`from: 'panel'`, the default), yielding to content that can still scroll its way, so a long one scrolls back to its top and then goes, and a field or `data-no-swipe` starts no drag; a mouse drags it by the handle, and `from: 'handle'` keeps every pointer there. A release faster than `flickSpeed` (0.4px/ms) is a flick, and a slow one goes once dragged `closeShare` (a quarter) of the panel. A click or Enter on the handle toggles it, and the click a browser sends after a drag does not. The panel's inline style is the drag's: set `--fk-drawer-peek` (default 5rem) and `--fk-drawer-height` (default 70dvh) on an ancestor or in a style. | `Recipes.Drawer`: `dock`: `always` (default), `below-lg` or `below-xl`, above which the panel is the column it sits in, with no handle. The handle's bar bends into a chevron going down, with the finger while dragged. Slots `panel`, `handle`, `body`, `grip`. The handle is a 44px target drawn tight to its bar, and the peek stays above the home indicator. |
559
559
  | `Sheet` | A Dialog a finger drags, vaul's Drawer: `Sheet.init({ id, side?, points?, opensAt?, dismissible?, isAnimated?, swipe? })`, folded with `Sheet.update` and opened with `Sheet.open` and `Sheet.close` (each also reporting the Dialog's `Opened` or `Closed`), drawn with `Sheet.view({ model, onMessage, mixins, hasDescription?, covered?, scalesPage?, draw }, h)`, `draw` laying out `DialogSlots`' bundles with `h.div(sheet.handle)` in the panel. The panel stands on `side`'s edge (`data-side`); a drag follows the pointer and settles at the nearest of `points` (the share of the panel shown, ascending; a top or bottom sheet with a point below 1 takes its `size`'s full height, so a short one still shows its start, and below its highest point its content holds still, so a swipe up raises it), or, flicked or dragged far enough past the first, closes it, unless `dismissible: false`. `swipe: { from?, flickSpeed?, closeShare? }` says how it is swiped: a finger drags it from anywhere on the panel (`from: 'panel'`, the default), yielding to content that can still scroll its way, so a long one scrolls back to its top and then goes, and a field or `data-no-swipe` starts no drag; a mouse drags it by the handle, and `from: 'handle'` keeps every pointer there. A release faster than `flickSpeed` (0.4px/ms) is a flick, and a slow one goes once dragged `closeShare` (a quarter) of the panel. The Dialog keeps focus, Escape and scroll lock. `scalesPage` with `Recipes.sheetPage` on the page beside the sheet, never around it, steps the page back while it is open. | `Recipes.Sheet`: `size`: `sm`, `md` (default), `lg`, `full`; `handle`: `bar` (default) or `none`. Slots are `DialogSlots`. |
560
+ | `Picker` | A select that is a dropdown on a desktop and a bottom sheet on a phone, with one Model and one set of Messages whatever the width: `Picker.init({ id, sheet? })` (upstream's Listbox Model and a `Sheet`'s), folded with `Picker.update`, which returns `Picker.OutMessage.Chose({ value })` for a choice made either way, drawn with `Picker.view({ model, onMessage, label, options, value, placeholder, anchor?, style?, mixins?, listbox?, sheet? }, h)`. The application keeps the value (`Option`), as with the Listbox; `options` are `{ value, label, description?, icon? }`, `Value` inferred from them. Both halves are drawn and the recipe shows one, so nothing reads the width: the Listbox (its panel kept in place) at or above the breakpoint, and below it an opener whose Sheet lists the options as a listbox, the chosen one (or the first) focused, the arrows, Home and End moving focus, Enter, Space or a tap choosing and closing it. Opening the Sheet closes a Listbox left open. `listbox` takes `Recipes.Listbox`, which also draws the options' and the trigger's content (`Listbox.parts`), and `sheet` takes `Recipes.Sheet`. | `Recipes.Picker`: `sheetBelow`: `sm`, `md` (default) or `lg`, the theme's breakpoint below which the Sheet's half shows; `trigger`: `outline` (default), `filled`, `ghost`, the opener's look, as the Listbox's; `size`: `sm`, `md`, `lg`. Slots `root`, `dropdown`, `opener`, `list`, `option`. |
560
561
  | `Sidebar` | shadcn's sidebar with Fluid's collapse, keeping a Model: `Sidebar.init({ id, rows, open?, collapsed?, side?, width? })` (a Tooltip per row id, and the phone's Sheet), folded with `Sidebar.update`, drawn with `Sidebar.view({ model, onMessage, label, groups, header?, footer?, direction?, collapse?, style?, mixins?, tooltip?, sheet? }, h)`. `groups` are `{ id, title?, collapsible?, action?, rows }`, a row a `SidebarLink` (`{ id, label, href, current?, icon?, badge?, action? }`) or a `SidebarBranch` of nested links (`items`). An `action` (`SidebarAction`: `{ label, icon, message }`) is a button at a titled group's heading or beside a link, where it takes the badge's place under the pointer (both show on a touch screen). Groups and branches open like an accordion's, several at once; the current page is `aria-current` and `Sidebar.fluid` glides a marker to it. `collapse: 'offcanvas'` (default) takes the whole column off the page; `'icons'` leaves a rail of icons named in Tooltips (`tooltip`, a Tooltip style). With `sheet` (a Sheet style), an opener shows it in a Sheet on a phone. Shut groups and a collapsed column stay drawn and `inert`. `Sidebar.init({ width: { size?, min?, max? } })` makes the column resizable, its width in the Model: a `resize` handle on its edge drags it, the arrows step it, Enter or a double-click collapses it, and dragged below half `min` it collapses, coming back at the width the drag began at. | `variant`: `sidebar` (flush with the page's edge, the default), `floating` (a card lifted off it), `inset` (no edge, on the surface it stands on, for a page drawn as a card beside it); on a phone with a Sheet the column is its opener alone. Slots `root`, `header`, `footer`, `opener`, `title`, `toggle`, `nav`, `section`, `heading`, `trigger`, `chevron`, `links`, `item`, `branch`, `link`, `icon`, `mark`, `detail`, `label`, `badge`, `action`, `tip`, `indicator`, `highlight`, `resize`. |
561
562
  | `SignaturePad` | After Zag's: strokes drawn by one pointer over a dashed line and "Sign here", undo, clear, and a typed name instead. `SignaturePad.init({ id, pen? })` holds the strokes (points with pressure, in the pad's coordinates), folded with `SignaturePad.update`. Drawn with `SignaturePad.view({ model, onMessage, label, fallback?, labels?, disabled?, style? }, h)`. `pathOf(stroke, pen)` and `toSvg(model, { color?, font? })` are pure; `RequestedPng({ scale, background })` returns `ExportPng`, answered by `ExportedPng({ url, width, height })` or `FailedExport`. | `surface` (`plain`, `muted`, `dashed`), `size`. Slots `root`, `label`, `control`, `segments`, `stroke`, `guide`, `placeholder`, `typedName`, `controls`, `undo`, `clear`, `fallback`, `fallbackLabel`, `input`. |
562
563
  | `Skeleton` | `{ label? }`, `role="status"`, a bar a film of the text. `Skeleton.lines({ lines, label? })`, `avatarRow`, `card` and `tableRow({ columns })` draw the shapes content takes, in a `group`. | `shape`: `bar` (default), `circle`; `animation`: `pulse` (default), `shimmer`, `none`. Slots `bar`, `group`. |
@@ -573,6 +574,7 @@ glyph with it, so the recipe's size is the drawing's.
573
574
  | `TreeView` | The APG's and Zag's tree view, a small Model of its own: `TreeView.init({ id, open?, checked? })`, folded with `TreeView.update(nodes, { checkable? })` (curried over the tree, flattened once), drawn with `TreeView.view({ label, model, nodes, onMessage, direction?, style?, mixins? }, h)` over nodes `{ id, label, children?, disabled?, icon?, openIcon? }`. `checkable` (on the view and `update`) gives each row a box: the Model's `checked` holds the leaves, a branch reads checked, mixed or not from them (`TreeView.checksOf`), and Space checks the current row in `update`. One tab stop; Up/Down move through the rows showing, stepping over shut and disabled ones; Right opens or steps in, Left shuts or steps out (swapped under `direction: 'rtl'`, drawn as the root's `dir`); Home/End; a character moves to the next showing row that starts with it; Enter, Space or a click chooses a row and opens or shuts a branch. Keys reach `update`, which decides from its own Model and sends a focus Command. Each item carries `--fk-tree-level`; a shut group stays drawn and `inert`. | `guides`: `none` (default) or `lines`, a guide down each open branch; `data-state` on a branch `item` and its `group`. Slots `root`, `item`, `row`, `chevron`, `checkbox`, `icon`, `label`, `group`. |
574
575
  | `Typography` | `{ level, text }`. The level chooses the element (`h1`–`h4`, `lead`, `body`, `small`, `muted`, `quote`, `code`, and the interface roles `display`, `title`, `subtitle`, `caption`, `micro` as paragraphs). | `level`, same set; a role is its size and leading on the size ladder. Defaults to `body`. Slot `text`. |
575
576
  | `VirtualList` | `@foldkit/ui`'s virtual list: `VirtualList.view({ model, items, itemToKey, itemToView, onMessage, overscan?, itemToRowHeightPx? \| dynamicRowHeights?, style?, mixins? }, h)` draws only the rows in view. Its Model is upstream's (`@foldkit/ui/virtualList`'s `init`), kept by the application and folded with that module's `update`. A row's mixins may style it, not handle its events, since it is drawn inside the list's submodel. A bar is drawn beside the list, and `VirtualList.overlayBars` lays it over the list's edge: `root` runs `ScrollBars` for upstream's list, which holds a Mount of its own. | No axis. Slots `root` (the box it scrolls within: 18rem tall by default and as wide as its container, offering 20rem where the container takes its width from it, so the rows drawn as it scrolls never resize it), `row`, `bar`, `thumb`. |
577
+ | `WindowList` | A virtual list that scrolls with the window: `WindowList.init({ id, estimatedHeight, unmeasured?, overscan?, viewportHeight?, from? })`, folded with `WindowList.update`, drawn with `WindowList.view({ model, items, itemToKey, itemToView, onMessage, label?, style?, mixins? }, h)`. It draws the rows in view of the document's viewport between spacers as tall as the rest, so the page keeps its own scrolling: the browser restores its offset, a `sticky` header above the list sticks, and Space and End move it. Its one Mount on `root`, `WindowList.Track`, reads where the viewport lies over the list on every scroll, resize and resize of the page (`WindowViewport`), so content above it, or growing above it, counts, and measures each drawn row's border box (`MeasureRows`; space rows with padding: a row is `flow-root`). The rows already drawn when it starts are read at once, so no row leaves before its height is known. A row not yet measured counts `estimatedHeight`, or with `unmeasured: 'mean'` the mean of the rows measured above 0: for rows whose height the window's width decides, which `init` cannot know. A Scene test of a page drawing the list resolves it with `Scene.Mount.resolveAll(WindowList.resolveTrack(onMessage, WindowList.Message.Placed({ top, height })))`, the reading going through the view's own `onMessage`. `WindowList.windowOf(model, keys)` is which rows are drawn, for loading what is in view, and `WindowList.keep(model, keys)` drops the heights of rows that left; a row still drawn is measured again only when it resizes, so keep the keys of the rows drawn. A server's page opens the list at a row with `from` (a page's `?from=`): the window starts at that row, with no overscan above it, and the rows above take no room until `Track` places the list, which gives them their room and scrolls the window by what that moved the first row drawn, so a reader sees the same rows before and after the runtime takes the page over. The first `Placed` sets `from` back to 0, and the list follows the window. For a page without scripts, `WindowList.pageOf(model, keys)` is `{ start, end, previous, next }`: the rows drawn and, as `Option`s, the rows the pages either side open at (`previous` the first whose window reaches this one's start), for links that set `?from=`. Use `VirtualList` for a list in a box of its own. | `Recipes.WindowList`: no look, only the spacers hidden where no script runs (`@media (scripting: none)`), so the rows a server drew lie in the page's flow; `.extend` it with the list's look. Slots `root` (`role="list"`), `spacer` (`data-edge` `start` or `end`, hidden from assistive technology), `row` (`role="listitem"`). |
576
578
 
577
579
  ## Recipes
578
580
 
@@ -89,7 +89,7 @@ const computeRender = (model, viewInputs, h, behavior) => {
89
89
  onSome: (index) => [h.AriaActiveDescendant(itemId(id, index))]
90
90
  });
91
91
  const onInputAttributes = isReadOnly ? [] : [h.OnInput((value) => Message.UpdatedInputValue({ value }))];
92
- const input = childAttributes([
92
+ const input = [...childAttributes([
93
93
  h.Id(`${id}-input`),
94
94
  h.Role("combobox"),
95
95
  h.AriaExpanded(isItemsPanelVisible),
@@ -122,9 +122,8 @@ const computeRender = (model, viewInputs, h, behavior) => {
122
122
  ...isInvalid ? [h.AriaInvalid(true), h.DataAttribute("invalid", "")] : [],
123
123
  ...isVisible ? [h.DataAttribute("open", "")] : [],
124
124
  ...model.selectInputOnFocus ? [h.OnMount(UpstreamCombobox.AttachComboboxSelectOnFocus())] : [],
125
- ...inputClassName ? [h.Class(inputClassName)] : [],
126
- ...inputAttributes
127
- ]);
125
+ ...inputClassName ? [h.Class(inputClassName)] : []
126
+ ]), ...inputAttributes];
128
127
  const placed = {
129
128
  position: "absolute",
130
129
  margin: "0",
@@ -144,22 +143,17 @@ const computeRender = (model, viewInputs, h, behavior) => {
144
143
  buttonId: `${id}-input-wrapper`,
145
144
  anchor
146
145
  }))]];
147
- const inputWrapper = childAttributes([
148
- h.Id(`${id}-input-wrapper`),
149
- ...inputWrapperClassName ? [h.Class(inputWrapperClassName)] : [],
150
- ...inputWrapperAttributes
151
- ]);
152
- const wrapper = childAttributes([
146
+ const inputWrapper = [...childAttributes([h.Id(`${id}-input-wrapper`), ...inputWrapperClassName ? [h.Class(inputWrapperClassName)] : []]), ...inputWrapperAttributes];
147
+ const wrapper = [...childAttributes([
153
148
  ...className ? [h.Class(className)] : [],
154
- ...attributes,
155
149
  ...isVisible ? [h.DataAttribute("open", "")] : [],
156
150
  ...isDisabled ? [h.DataAttribute("disabled", "")] : [],
157
151
  ...isReadOnly ? [h.DataAttribute("readonly", "")] : [],
158
152
  ...isInvalid ? [h.DataAttribute("invalid", "")] : []
159
- ]);
153
+ ]), ...attributes];
160
154
  const toggleButton = buttonContent === void 0 ? void 0 : {
161
155
  key: `${id}-button`,
162
- attributes: childAttributes([
156
+ attributes: [...childAttributes([
163
157
  h.Id(`${id}-button`),
164
158
  h.Type("button"),
165
159
  h.Tabindex(-1),
@@ -172,9 +166,8 @@ const computeRender = (model, viewInputs, h, behavior) => {
172
166
  }))],
173
167
  ...isReadOnly ? [h.DataAttribute("readonly", "")] : [],
174
168
  h.OnMount(UpstreamCombobox.AttachComboboxPreventBlur()),
175
- ...buttonClassName ? [h.Class(buttonClassName)] : [],
176
- ...buttonAttributes
177
- ]),
169
+ ...buttonClassName ? [h.Class(buttonClassName)] : []
170
+ ]), ...buttonAttributes],
178
171
  content: buttonContent
179
172
  };
180
173
  const chipRenders = chips === void 0 ? [] : Array.map(selectedValues, (value) => {
@@ -222,20 +215,19 @@ const computeRender = (model, viewInputs, h, behavior) => {
222
215
  };
223
216
  const backdrop = isBackdropVisible ? {
224
217
  key: `${id}-backdrop`,
225
- attributes: childAttributes([
218
+ attributes: [...childAttributes([
226
219
  h.Id(`${id}-backdrop`),
227
220
  h.OnMount(UpstreamCombobox.PortalComboboxBackdrop()),
228
221
  ...isLeaving ? [] : [h.OnClick(Message.Closed({
229
222
  restingInputValue,
230
223
  isClearable: !isReadOnly
231
224
  }))],
232
- ...backdropClassName ? [h.Class(backdropClassName)] : [],
233
- ...backdropAttributes
234
- ])
225
+ ...backdropClassName ? [h.Class(backdropClassName)] : []
226
+ ]), ...backdropAttributes]
235
227
  } : void 0;
236
228
  const itemsContainer = isItemsPanelVisible ? {
237
229
  key: `${id}-items-container`,
238
- attributes: childAttributes([
230
+ attributes: [...childAttributes([
239
231
  h.Id(`${id}-items`),
240
232
  h.Role("listbox"),
241
233
  ...behavior.ariaMultiSelectable ? [h.AriaMultiSelectable(true)] : [],
@@ -244,11 +236,10 @@ const computeRender = (model, viewInputs, h, behavior) => {
244
236
  ...isReadOnly ? [h.AriaReadonly(true), h.DataAttribute("readonly", "")] : [],
245
237
  ...anchorAttributes,
246
238
  ...animationAttributes,
247
- ...itemsClassName ? [h.Class(itemsClassName)] : [],
248
- ...itemsAttributes
249
- ])
239
+ ...itemsClassName ? [h.Class(itemsClassName)] : []
240
+ ]), ...itemsAttributes]
250
241
  } : void 0;
251
- const scroll = itemsScrollClassName || Array.isReadonlyArrayNonEmpty(itemsScrollAttributes) ? childAttributes([...itemsScrollClassName ? [h.Class(itemsScrollClassName)] : [], ...itemsScrollAttributes]) : void 0;
242
+ const scroll = itemsScrollClassName || Array.isReadonlyArrayNonEmpty(itemsScrollAttributes) ? [...childAttributes(itemsScrollClassName ? [h.Class(itemsScrollClassName)] : []), ...itemsScrollAttributes] : void 0;
252
243
  const itemRenders = Array.map(items, (item, index) => {
253
244
  const isActiveItem = Option.exists(maybeActiveItemIndex, (activeIndex) => activeIndex === index);
254
245
  const isDisabledItem = isDisabledAtIndex(index);
@@ -319,20 +310,15 @@ const computeRender = (model, viewInputs, h, behavior) => {
319
310
  heading,
320
311
  group: {
321
312
  key: `${id}-group-${segment.key}`,
322
- attributes: childAttributes([
313
+ attributes: [...childAttributes([
323
314
  h.Role("group"),
324
315
  ...heading ? [h.AriaLabelledBy(headingId)] : [],
325
- ...groupClassName ? [h.Class(groupClassName)] : [],
326
- ...groupAttributes
327
- ])
316
+ ...groupClassName ? [h.Class(groupClassName)] : []
317
+ ]), ...groupAttributes]
328
318
  },
329
319
  separator: segmentIndex > 0 && (separatorClassName || Array.isReadonlyArrayNonEmpty(separatorAttributes)) ? {
330
320
  key: `${id}-separator-${segmentIndex}`,
331
- attributes: childAttributes([
332
- h.Role("separator"),
333
- ...separatorClassName ? [h.Class(separatorClassName)] : [],
334
- ...separatorAttributes
335
- ])
321
+ attributes: [...childAttributes([h.Role("separator"), ...separatorClassName ? [h.Class(separatorClassName)] : []]), ...separatorAttributes]
336
322
  } : void 0,
337
323
  items: segment.items
338
324
  }];
@@ -1 +1 @@
1
- {"version":3,"file":"comboboxShared.js","names":["when"],"sources":["../src/comboboxShared.ts"],"sourcesContent":["/**\n * Shared combobox markup assembly with the consumer `toView` seam.\n * Transcribed from `@foldkit/ui@0.165.0` (`packages/ui/src/combobox/shared.ts`,\n * MIT (c) 2025 Devin Jameson). Assembly lives in `./comboboxView.js`.\n */\nimport { Array, Match, Option, Predicate, pipe } from 'effect'\nimport * as UpstreamCombobox from '@foldkit/ui/combobox'\nimport { Message } from '@foldkit/ui/combobox'\nimport type { Model as SingleModel } from '@foldkit/ui/combobox'\nimport type { BaseViewInputsCommon, GroupHeading, ItemConfig } from '@foldkit/ui/combobox'\nimport { childAttributes, type ChildAttribute, type Html, type HtmlBuilder } from 'foldkit/html'\nimport {\n findFirstEnabledIndex,\n groupContiguous,\n keyToIndex,\n whenOption as when,\n} from './menuUtils.js'\nimport { topLayer } from './anchor.js'\n\nexport type ComboboxItemRender = Readonly<{\n key: string\n attributes: ReadonlyArray<ChildAttribute>\n content: Html\n}>\n\nexport type ComboboxHeadingRender = Readonly<{\n id: string\n attributes: ReadonlyArray<ChildAttribute>\n content: Html\n}>\n\nexport type ComboboxGroupRender = Readonly<{\n key: string\n heading: ComboboxHeadingRender | undefined\n group: { key: string; attributes: ReadonlyArray<ChildAttribute> } | undefined\n separator: { key: string; attributes: ReadonlyArray<ChildAttribute> } | undefined\n items: ReadonlyArray<ComboboxItemRender>\n}>\n\nexport type ComboboxRenderInfo = Readonly<{\n id: string\n isVisible: boolean\n wrapper: ReadonlyArray<ChildAttribute>\n inputWrapper: ReadonlyArray<ChildAttribute>\n input: ReadonlyArray<ChildAttribute>\n toggleButton:\n | { key: string; attributes: ReadonlyArray<ChildAttribute>; content: Html }\n | undefined\n backdrop: { key: string; attributes: ReadonlyArray<ChildAttribute> } | undefined\n items: { key: string; attributes: ReadonlyArray<ChildAttribute> } | undefined\n scroll: ReadonlyArray<ChildAttribute> | undefined\n groups: ReadonlyArray<ComboboxGroupRender>\n hiddenInputs: ReadonlyArray<Html>\n /** This package's: the chosen values as chips, each with a remove button, while `chips` is given. */\n chips: ReadonlyArray<ComboboxChipRender>\n /** This package's: the button that empties the field, while it has text and `clearContent` is given. */\n clearButton: { key: string; attributes: ReadonlyArray<ChildAttribute>; content: Html } | undefined\n /** This package's: the panel shown in place of the list while open with no items. */\n empty: { key: string; attributes: ReadonlyArray<ChildAttribute>; content: Html } | undefined\n}>\n\n/** One chosen value drawn as a chip: its label, and its remove button's bundle. */\nexport type ComboboxChipRender = Readonly<{\n key: string\n label: string\n remove: ReadonlyArray<ChildAttribute>\n}>\n\n/** The view inputs this package adds beside upstream's. */\nexport type ExtraInputs = Readonly<{\n /**\n * Shown, in the panel's place, while open with no items: \"No results\", or\n * a loading line while the application fetches them. A polite status.\n */\n empty?: Html | undefined\n /** The clear button's content; the button shows while the field has text. */\n clearContent?: Html | undefined\n /** The clear button's name; default `Clear`. */\n clearLabel?: string | undefined\n /**\n * Draws each chosen value as a chip in the field, its remove button\n * sending `SelectedItem` for it, which a multiple combobox toggles off.\n */\n chips?:\n | {\n readonly label?: ((value: string) => string) | undefined\n /** Default `Remove <label>`. */\n readonly removeLabel?: ((label: string) => string) | undefined\n }\n | undefined\n}>\n\nexport type NormalizedInputs<Item extends string> = BaseViewInputsCommon<Item> &\n Readonly<{ selectedValues: ReadonlyArray<Item> }> &\n ExtraInputs\n\nconst itemId = (id: string, index: number): string => `${id}-item-${index}`\n\nexport const computeRender = (\n model: SingleModel,\n viewInputs: NormalizedInputs<string>,\n h: HtmlBuilder<Message>,\n behavior: Readonly<{ ariaMultiSelectable: boolean }>,\n): ComboboxRenderInfo => {\n const {\n id,\n isOpen,\n immediate,\n animation: { transitionState },\n maybeActiveItemIndex,\n } = model\n\n const {\n items,\n selectedValues,\n restingInputValue,\n itemToConfig,\n itemToValue,\n itemToDisplayText,\n isItemDisabled,\n inputClassName,\n inputAttributes = [],\n inputPlaceholder,\n inputWrapperClassName,\n inputWrapperAttributes = [],\n itemsClassName,\n itemsAttributes = [],\n itemsScrollClassName,\n itemsScrollAttributes = [],\n backdropClassName,\n backdropAttributes = [],\n className,\n attributes = [],\n buttonContent,\n buttonClassName,\n buttonAttributes = [],\n formName,\n isDisabled,\n isReadOnly = false,\n isInvalid,\n openOnFocus,\n itemGroupKey,\n groupToHeading,\n groupClassName,\n groupAttributes = [],\n separatorClassName,\n separatorAttributes = [],\n anchor = {},\n ariaLabel,\n ariaLabelledBy,\n empty,\n clearContent,\n clearLabel,\n chips,\n } = viewInputs\n\n const resolveInputLabel = () => {\n if (Predicate.isNotUndefined(ariaLabel)) {\n return [h.AriaLabel(ariaLabel)]\n } else if (Predicate.isNotUndefined(ariaLabelledBy)) {\n return [h.AriaLabelledBy(ariaLabelledBy)]\n } else {\n return []\n }\n }\n\n const inputLabelAttributes = resolveInputLabel()\n\n const isValueSelected = (itemValue: string): boolean => Array.contains(selectedValues, itemValue)\n\n const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating'\n const isVisible = isOpen || isLeaving\n const isItemsPanelVisible = isVisible && Array.isReadonlyArrayNonEmpty(items)\n const isBackdropVisible = isItemsPanelVisible || (isVisible && model.isModal)\n\n const animationAttributes = Match.value(transitionState).pipe(\n Match.when('EnterStart', () => [\n h.DataAttribute('closed', ''),\n h.DataAttribute('enter', ''),\n h.DataAttribute('transition', ''),\n ]),\n Match.when('EnterAnimating', () => [\n h.DataAttribute('enter', ''),\n h.DataAttribute('transition', ''),\n ]),\n Match.when('LeaveStart', () => [\n h.DataAttribute('leave', ''),\n h.DataAttribute('transition', ''),\n ]),\n Match.when('LeaveAnimating', () => [\n h.DataAttribute('closed', ''),\n h.DataAttribute('leave', ''),\n h.DataAttribute('transition', ''),\n ]),\n Match.orElse(() => []),\n )\n\n const isDisabledAtIndex = (index: number): boolean =>\n Predicate.isNotUndefined(isItemDisabled) &&\n pipe(\n items,\n Array.get(index),\n Option.exists(item => isItemDisabled(item, index)),\n )\n\n const firstEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabledAtIndex)(0, 1)\n\n const lastEnabledIndex = findFirstEnabledIndex(\n items.length,\n 0,\n isDisabledAtIndex,\n )(items.length - 1, -1)\n\n const resolveActiveIndex = keyToIndex(\n 'ArrowDown',\n 'ArrowUp',\n items.length,\n Option.getOrElse(maybeActiveItemIndex, () => -1),\n isDisabledAtIndex,\n )\n\n const resolveImmediateSelection = (targetIndex: number): Option.Option<{ item: string }> => {\n if (isReadOnly) {\n return Option.none()\n } else {\n return pipe(\n when(immediate, targetIndex),\n Option.flatMap(index => Array.get(items, index)),\n Option.map(targetItem => ({\n item: itemToValue(targetItem, targetIndex),\n })),\n )\n }\n }\n\n const maybeValidActiveItemIndex = Option.flatMap(maybeActiveItemIndex, index =>\n Option.as(Array.get(items, index), index),\n )\n\n const resolveCommitMessage = (): Option.Option<Message> => {\n if (isReadOnly) {\n return Option.as(maybeValidActiveItemIndex, Message.SuppressedItemCommit())\n } else {\n return Option.map(maybeValidActiveItemIndex, index => Message.RequestedItemClick({ index }))\n }\n }\n\n const handleInputKeyDown = (key: string): Option.Option<Message> =>\n Match.value(key).pipe(\n Match.when('ArrowDown', () => {\n if (Array.isReadonlyArrayEmpty(items)) {\n return Option.some(Message.SuppressedEmptyItemNavigation())\n }\n\n if (!isOpen) {\n return Option.some(\n Message.Opened({\n maybeActiveItemIndex: Option.some(firstEnabledIndex),\n }),\n )\n }\n const targetIndex = resolveActiveIndex('ArrowDown')\n return Option.some(\n Message.ActivatedItem({\n index: targetIndex,\n activationTrigger: 'Keyboard',\n maybeImmediateSelection: resolveImmediateSelection(targetIndex),\n }),\n )\n }),\n Match.when('ArrowUp', () => {\n if (Array.isReadonlyArrayEmpty(items)) {\n return Option.some(Message.SuppressedEmptyItemNavigation())\n }\n\n if (!isOpen) {\n return Option.some(\n Message.Opened({\n maybeActiveItemIndex: Option.some(lastEnabledIndex),\n }),\n )\n }\n const targetIndex = resolveActiveIndex('ArrowUp')\n return Option.some(\n Message.ActivatedItem({\n index: targetIndex,\n activationTrigger: 'Keyboard',\n maybeImmediateSelection: resolveImmediateSelection(targetIndex),\n }),\n )\n }),\n Match.when('Enter', () => {\n if (!isOpen) {\n return Option.none()\n }\n return resolveCommitMessage()\n }),\n Match.when('Escape', () => {\n if (!isOpen) {\n return Option.none()\n }\n return Option.some(Message.Closed({ restingInputValue, isClearable: !isReadOnly }))\n }),\n Match.whenOr('Home', 'End', () => {\n if (!isOpen) {\n return Option.none()\n }\n\n if (Array.isReadonlyArrayEmpty(items)) {\n return Option.some(Message.SuppressedEmptyItemNavigation())\n }\n\n const targetIndex = resolveActiveIndex(key)\n return Option.some(\n Message.ActivatedItem({\n index: targetIndex,\n activationTrigger: 'Keyboard',\n maybeImmediateSelection: resolveImmediateSelection(targetIndex),\n }),\n )\n }),\n Match.orElse(() => Option.none()),\n )\n\n const maybeActiveDescendant = Option.match(maybeValidActiveItemIndex, {\n onNone: () => [],\n onSome: index => [h.AriaActiveDescendant(itemId(id, index))],\n })\n\n const onInputAttributes = isReadOnly\n ? []\n : [h.OnInput(value => Message.UpdatedInputValue({ value }))]\n\n const input: ReadonlyArray<ChildAttribute> = childAttributes([\n h.Id(`${id}-input`),\n h.Role('combobox'),\n h.AriaExpanded(isItemsPanelVisible),\n ...(isItemsPanelVisible ? [h.AriaControls(`${id}-items`)] : []),\n h.Attribute('aria-autocomplete', 'list'),\n h.Attribute('aria-haspopup', 'listbox'),\n ...inputLabelAttributes,\n h.Autocomplete('off'),\n // What is typed filters: a phone's keyboard capitalizing and correcting it filters\n // on a word nobody typed, and its Enter key says it searches.\n h.Attribute('autocapitalize', 'none'),\n h.Attribute('autocorrect', 'off'),\n h.Attribute('spellcheck', 'false'),\n h.Attribute('enterkeyhint', 'search'),\n h.Value(model.inputValue),\n ...(isItemsPanelVisible ? maybeActiveDescendant : []),\n ...(inputPlaceholder ? [h.Placeholder(inputPlaceholder)] : []),\n ...(isDisabled\n ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]\n : [\n ...onInputAttributes,\n h.OnKeyDownPreventDefault(handleInputKeyDown),\n h.OnBlur(\n Message.BlurredInput({\n restingInputValue,\n isClearable: !isReadOnly,\n }),\n ),\n ...(openOnFocus\n ? [h.OnFocus(Message.Opened({ maybeActiveItemIndex: Option.none() }))]\n : []),\n ]),\n ...(isReadOnly\n ? [h.Readonly(true), h.AriaReadonly(true), h.DataAttribute('readonly', '')]\n : []),\n ...(isInvalid ? [h.AriaInvalid(true), h.DataAttribute('invalid', '')] : []),\n ...(isVisible ? [h.DataAttribute('open', '')] : []),\n ...(model.selectInputOnFocus\n ? [h.OnMount(UpstreamCombobox.AttachComboboxSelectOnFocus())]\n : []),\n ...(inputClassName ? [h.Class(inputClassName)] : []),\n ...inputAttributes,\n ])\n\n const placed = { position: 'absolute', margin: '0', visibility: 'hidden' }\n const anchorAttributes = [\n // Only with an in-place panel: portal relocation moves a panel after the\n // Mount acquires, and moving a shown popover hides it again. The panel\n // then draws in the top layer, out of every stacking context and overflow\n // box; the anchor positions it as before, and light dismiss stays the\n // application's Messages closing it. A popover keeps the browser's\n // `inset: 0`, of which the anchor overwrites only `left` and `top`: right\n // to left, `right: 0` won and the panel opened at the viewport's far edge.\n ...(anchor.portal === false\n ? [\n h.Attribute('popover', 'manual'),\n h.Style({ ...placed, inset: 'auto' }),\n h.OnMount(\n topLayer(\n UpstreamCombobox.AnchorCombobox({\n buttonId: `${id}-input-wrapper`,\n anchor,\n }),\n ),\n ),\n ]\n : [\n h.Style(placed),\n h.OnMount(\n UpstreamCombobox.AnchorCombobox({\n buttonId: `${id}-input-wrapper`,\n anchor,\n }),\n ),\n ]),\n ]\n\n const inputWrapper: ReadonlyArray<ChildAttribute> = childAttributes([\n h.Id(`${id}-input-wrapper`),\n ...(inputWrapperClassName ? [h.Class(inputWrapperClassName)] : []),\n ...inputWrapperAttributes,\n ])\n\n const wrapper: ReadonlyArray<ChildAttribute> = childAttributes([\n ...(className ? [h.Class(className)] : []),\n ...attributes,\n ...(isVisible ? [h.DataAttribute('open', '')] : []),\n ...(isDisabled ? [h.DataAttribute('disabled', '')] : []),\n ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),\n ...(isInvalid ? [h.DataAttribute('invalid', '')] : []),\n ])\n\n const toggleButton =\n buttonContent === undefined\n ? undefined\n : {\n key: `${id}-button`,\n attributes: childAttributes([\n h.Id(`${id}-button`),\n h.Type('button'),\n h.Tabindex(-1),\n ...(isItemsPanelVisible ? [h.AriaControls(`${id}-items`)] : []),\n h.AriaExpanded(isItemsPanelVisible),\n h.Attribute('aria-haspopup', 'listbox'),\n ...(isDisabled\n ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]\n : [\n h.OnClick(\n Message.PressedToggleButton({\n restingInputValue,\n isClearable: !isReadOnly,\n }),\n ),\n ]),\n ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),\n h.OnMount(UpstreamCombobox.AttachComboboxPreventBlur()),\n ...(buttonClassName ? [h.Class(buttonClassName)] : []),\n ...buttonAttributes,\n ]),\n content: buttonContent,\n }\n\n const chipRenders: ReadonlyArray<ComboboxChipRender> =\n chips === undefined\n ? []\n : Array.map(selectedValues, value => {\n const label = chips.label?.(value) ?? value\n return {\n key: `${id}-chip-${value}`,\n label,\n remove: childAttributes([\n h.Type('button'),\n h.AriaLabel(chips.removeLabel?.(label) ?? `Remove ${label}`),\n ...(isDisabled || isReadOnly\n ? [h.Disabled(true)]\n : [\n h.OnClick(\n Message.SelectedItem({ item: value, displayText: label, wasSelected: true }),\n ),\n ]),\n ]),\n }\n })\n\n const clearButton =\n clearContent === undefined || model.inputValue === '' || isDisabled || isReadOnly\n ? undefined\n : {\n key: `${id}-clear`,\n attributes: childAttributes([\n h.Type('button'),\n h.Tabindex(-1),\n h.AriaLabel(clearLabel ?? 'Clear'),\n h.OnClick(Message.UpdatedInputValue({ value: '' })),\n // The field keeps the focus, as with the toggle.\n h.OnMount(UpstreamCombobox.AttachComboboxPreventBlur()),\n ]),\n content: clearContent,\n }\n\n if (!isVisible) {\n return {\n id,\n isVisible,\n wrapper,\n inputWrapper,\n input,\n toggleButton,\n backdrop: undefined,\n items: undefined,\n scroll: undefined,\n groups: [],\n hiddenInputs: [],\n chips: chipRenders,\n clearButton,\n empty: undefined,\n }\n }\n\n const backdrop = isBackdropVisible\n ? {\n key: `${id}-backdrop`,\n attributes: childAttributes([\n h.Id(`${id}-backdrop`),\n h.OnMount(UpstreamCombobox.PortalComboboxBackdrop()),\n ...(isLeaving\n ? []\n : [h.OnClick(Message.Closed({ restingInputValue, isClearable: !isReadOnly }))]),\n ...(backdropClassName ? [h.Class(backdropClassName)] : []),\n ...backdropAttributes,\n ]),\n }\n : undefined\n\n const itemsContainer = isItemsPanelVisible\n ? {\n key: `${id}-items-container`,\n attributes: childAttributes([\n h.Id(`${id}-items`),\n h.Role('listbox'),\n ...(behavior.ariaMultiSelectable ? [h.AriaMultiSelectable(true)] : []),\n h.AriaLabelledBy(`${id}-input`),\n h.Tabindex(-1),\n ...(isReadOnly ? [h.AriaReadonly(true), h.DataAttribute('readonly', '')] : []),\n ...anchorAttributes,\n ...animationAttributes,\n ...(itemsClassName ? [h.Class(itemsClassName)] : []),\n ...itemsAttributes,\n ]),\n }\n : undefined\n\n const scroll =\n itemsScrollClassName || Array.isReadonlyArrayNonEmpty(itemsScrollAttributes)\n ? childAttributes([\n ...(itemsScrollClassName ? [h.Class(itemsScrollClassName)] : []),\n ...itemsScrollAttributes,\n ])\n : undefined\n\n const itemRenders: ReadonlyArray<ComboboxItemRender> = Array.map(items, (item, index) => {\n const isActiveItem = Option.exists(maybeActiveItemIndex, activeIndex => activeIndex === index)\n const isDisabledItem = isDisabledAtIndex(index)\n const isSelectedItem = isValueSelected(itemToValue(item, index))\n const itemConfig: ItemConfig = itemToConfig(item, {\n isActive: isActiveItem,\n isDisabled: isDisabledItem,\n isReadOnly,\n isSelected: isSelectedItem,\n })\n\n const isHoverable = !isDisabledItem && !isLeaving\n const isClickable = isHoverable && !isReadOnly\n\n return {\n key: itemId(id, index),\n attributes: childAttributes([\n h.Id(itemId(id, index)),\n h.Role('option'),\n h.AriaSelected(isSelectedItem),\n ...(isActiveItem ? [h.DataAttribute('active', '')] : []),\n ...(isSelectedItem ? [h.DataAttribute('selected', '')] : []),\n ...(isDisabledItem ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')] : []),\n ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),\n ...(isClickable\n ? [\n h.OnClick(\n Message.SelectedItem({\n item: itemToValue(item, index),\n displayText: itemToDisplayText(item, index),\n wasSelected: isValueSelected(itemToValue(item, index)),\n }),\n ),\n ]\n : []),\n ...(isHoverable\n ? [\n ...(isActiveItem\n ? []\n : [\n h.OnPointerMove((screenX, screenY, pointerType) =>\n when(\n pointerType !== 'touch',\n Message.MovedPointerOverItem({ index, screenX, screenY }),\n ),\n ),\n ]),\n h.OnPointerLeave(pointerType =>\n when(pointerType !== 'touch', Message.DeactivatedItem()),\n ),\n ]\n : []),\n ...(itemConfig.className ? [h.Class(itemConfig.className)] : []),\n ]),\n content: itemConfig.content,\n }\n })\n\n const groups: ReadonlyArray<ComboboxGroupRender> = itemGroupKey\n ? Array.flatMap(\n groupContiguous(itemRenders, (_render, index) =>\n Array.get(items, index).pipe(\n Option.match({\n onNone: () => '',\n onSome: item => itemGroupKey(item, index),\n }),\n ),\n ),\n (segment, segmentIndex) => {\n const maybeHeading = Option.fromNullishOr(groupToHeading?.(segment.key))\n\n const headingId = `${id}-heading-${segment.key}`\n\n const heading: ComboboxHeadingRender | undefined = Option.match(maybeHeading, {\n onNone: () => undefined,\n onSome: (headingValue: GroupHeading) => ({\n id: headingId,\n attributes: childAttributes([\n h.Id(headingId),\n h.Role('presentation'),\n ...(headingValue.className ? [h.Class(headingValue.className)] : []),\n ]),\n content: headingValue.content,\n }),\n })\n\n return [\n {\n key: `${id}-group-${segment.key}`,\n heading,\n group: {\n key: `${id}-group-${segment.key}`,\n attributes: childAttributes([\n h.Role('group'),\n ...(heading ? [h.AriaLabelledBy(headingId)] : []),\n ...(groupClassName ? [h.Class(groupClassName)] : []),\n ...groupAttributes,\n ]),\n },\n separator:\n segmentIndex > 0 &&\n (separatorClassName || Array.isReadonlyArrayNonEmpty(separatorAttributes))\n ? {\n key: `${id}-separator-${segmentIndex}`,\n attributes: childAttributes([\n h.Role('separator'),\n ...(separatorClassName ? [h.Class(separatorClassName)] : []),\n ...separatorAttributes,\n ]),\n }\n : undefined,\n items: segment.items,\n },\n ]\n },\n )\n : [\n {\n key: `${id}-group`,\n heading: undefined,\n group: undefined,\n separator: undefined,\n items: itemRenders,\n },\n ]\n\n const hiddenInputs: ReadonlyArray<Html> = formName\n ? Array.match(selectedValues, {\n onEmpty: () => [h.input([h.Type('hidden'), h.Name(formName)])],\n onNonEmpty: Array.map(selectedValue =>\n h.input([h.Type('hidden'), h.Name(formName), h.Value(selectedValue)]),\n ),\n })\n : []\n\n // Anchored as the list is, which is not drawn beside it: one Mount per element.\n const emptyPanel =\n isVisible && !isItemsPanelVisible && empty !== undefined\n ? {\n key: `${id}-empty`,\n attributes: childAttributes([\n h.Id(`${id}-empty`),\n h.Role('status'),\n ...anchorAttributes,\n ...animationAttributes,\n ]),\n content: empty,\n }\n : undefined\n\n return {\n id,\n isVisible,\n wrapper,\n inputWrapper,\n input,\n toggleButton,\n backdrop,\n items: itemsContainer,\n scroll,\n groups,\n hiddenInputs,\n chips: chipRenders,\n clearButton,\n empty: emptyPanel,\n }\n}\n"],"mappings":";;;;;;;;;;;;AAgGA,MAAM,UAAU,IAAY,UAA0B,GAAG,GAAG,Q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CAAC;MAC/C,GAAI,iBAAiB,CAAC,EAAE,MAAM,cAAc,CAAC,IAAI,CAAC;MAClD,GAAG;KACL,CAAC;IACH;IACA,WACE,eAAe,MACd,sBAAsB,MAAM,wBAAwB,mBAAmB,KACpE;KACE,KAAK,GAAG,GAAG,aAAa;KACxB,YAAY,gBAAgB;MAC1B,EAAE,KAAK,WAAW;MAClB,GAAI,qBAAqB,CAAC,EAAE,MAAM,kBAAkB,CAAC,IAAI,CAAC;MAC1D,GAAG;KACL,CAAC;IACH,IACA,KAAA;IACN,OAAO,QAAQ;GACjB,CACF;EACF,CACF,IACA,CACE;GACE,KAAK,GAAG,GAAG;GACX,SAAS,KAAA;GACT,OAAO,KAAA;GACP,WAAW,KAAA;GACX,OAAO;EACT,CACF;EAqCF,cAnCwC,WACtC,MAAM,MAAM,gBAAgB;GAC1B,eAAe,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,QAAQ,GAAG,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC;GAC7D,YAAY,MAAM,KAAI,kBACpB,EAAE,MAAM;IAAC,EAAE,KAAK,QAAQ;IAAG,EAAE,KAAK,QAAQ;IAAG,EAAE,MAAM,aAAa;GAAC,CAAC,CACtE;EACF,CAAC,IACD,CAAC;EA6BH,OAAO;EACP;EACA,OA3BA,aAAa,CAAC,uBAAuB,UAAU,KAAA,IAC3C;GACE,KAAK,GAAG,GAAG;GACX,YAAY,gBAAgB;IAC1B,EAAE,GAAG,GAAG,GAAG,OAAO;IAClB,EAAE,KAAK,QAAQ;IACf,GAAG;IACH,GAAG;GACL,CAAC;GACD,SAAS;EACX,IACA,KAAA;CAiBN;AACF"}
1
+ {"version":3,"file":"comboboxShared.js","names":["when"],"sources":["../src/comboboxShared.ts"],"sourcesContent":["/**\n * Shared combobox markup assembly with the consumer `toView` seam.\n * Transcribed from `@foldkit/ui@0.165.0` (`packages/ui/src/combobox/shared.ts`,\n * MIT (c) 2025 Devin Jameson). Assembly lives in `./comboboxView.js`.\n */\nimport { Array, Match, Option, Predicate, pipe } from 'effect'\nimport * as UpstreamCombobox from '@foldkit/ui/combobox'\nimport { Message } from '@foldkit/ui/combobox'\nimport type { Model as SingleModel } from '@foldkit/ui/combobox'\nimport type { BaseViewInputsCommon, GroupHeading, ItemConfig } from '@foldkit/ui/combobox'\nimport { childAttributes, type ChildAttribute, type Html, type HtmlBuilder } from 'foldkit/html'\nimport {\n findFirstEnabledIndex,\n groupContiguous,\n keyToIndex,\n whenOption as when,\n} from './menuUtils.js'\nimport { topLayer } from './anchor.js'\n\nexport type ComboboxItemRender = Readonly<{\n key: string\n attributes: ReadonlyArray<ChildAttribute>\n content: Html\n}>\n\nexport type ComboboxHeadingRender = Readonly<{\n id: string\n attributes: ReadonlyArray<ChildAttribute>\n content: Html\n}>\n\nexport type ComboboxGroupRender = Readonly<{\n key: string\n heading: ComboboxHeadingRender | undefined\n group: { key: string; attributes: ReadonlyArray<ChildAttribute> } | undefined\n separator: { key: string; attributes: ReadonlyArray<ChildAttribute> } | undefined\n items: ReadonlyArray<ComboboxItemRender>\n}>\n\nexport type ComboboxRenderInfo = Readonly<{\n id: string\n isVisible: boolean\n wrapper: ReadonlyArray<ChildAttribute>\n inputWrapper: ReadonlyArray<ChildAttribute>\n input: ReadonlyArray<ChildAttribute>\n toggleButton:\n | { key: string; attributes: ReadonlyArray<ChildAttribute>; content: Html }\n | undefined\n backdrop: { key: string; attributes: ReadonlyArray<ChildAttribute> } | undefined\n items: { key: string; attributes: ReadonlyArray<ChildAttribute> } | undefined\n scroll: ReadonlyArray<ChildAttribute> | undefined\n groups: ReadonlyArray<ComboboxGroupRender>\n hiddenInputs: ReadonlyArray<Html>\n /** This package's: the chosen values as chips, each with a remove button, while `chips` is given. */\n chips: ReadonlyArray<ComboboxChipRender>\n /** This package's: the button that empties the field, while it has text and `clearContent` is given. */\n clearButton: { key: string; attributes: ReadonlyArray<ChildAttribute>; content: Html } | undefined\n /** This package's: the panel shown in place of the list while open with no items. */\n empty: { key: string; attributes: ReadonlyArray<ChildAttribute>; content: Html } | undefined\n}>\n\n/** One chosen value drawn as a chip: its label, and its remove button's bundle. */\nexport type ComboboxChipRender = Readonly<{\n key: string\n label: string\n remove: ReadonlyArray<ChildAttribute>\n}>\n\n/** The view inputs this package adds beside upstream's. */\nexport type ExtraInputs = Readonly<{\n /**\n * Shown, in the panel's place, while open with no items: \"No results\", or\n * a loading line while the application fetches them. A polite status.\n */\n empty?: Html | undefined\n /** The clear button's content; the button shows while the field has text. */\n clearContent?: Html | undefined\n /** The clear button's name; default `Clear`. */\n clearLabel?: string | undefined\n /**\n * Draws each chosen value as a chip in the field, its remove button\n * sending `SelectedItem` for it, which a multiple combobox toggles off.\n */\n chips?:\n | {\n readonly label?: ((value: string) => string) | undefined\n /** Default `Remove <label>`. */\n readonly removeLabel?: ((label: string) => string) | undefined\n }\n | undefined\n}>\n\nexport type NormalizedInputs<Item extends string> = BaseViewInputsCommon<Item> &\n Readonly<{ selectedValues: ReadonlyArray<Item> }> &\n ExtraInputs\n\nconst itemId = (id: string, index: number): string => `${id}-item-${index}`\n\nexport const computeRender = (\n model: SingleModel,\n viewInputs: NormalizedInputs<string>,\n h: HtmlBuilder<Message>,\n behavior: Readonly<{ ariaMultiSelectable: boolean }>,\n): ComboboxRenderInfo => {\n const {\n id,\n isOpen,\n immediate,\n animation: { transitionState },\n maybeActiveItemIndex,\n } = model\n\n const {\n items,\n selectedValues,\n restingInputValue,\n itemToConfig,\n itemToValue,\n itemToDisplayText,\n isItemDisabled,\n inputClassName,\n inputAttributes = [],\n inputPlaceholder,\n inputWrapperClassName,\n inputWrapperAttributes = [],\n itemsClassName,\n itemsAttributes = [],\n itemsScrollClassName,\n itemsScrollAttributes = [],\n backdropClassName,\n backdropAttributes = [],\n className,\n attributes = [],\n buttonContent,\n buttonClassName,\n buttonAttributes = [],\n formName,\n isDisabled,\n isReadOnly = false,\n isInvalid,\n openOnFocus,\n itemGroupKey,\n groupToHeading,\n groupClassName,\n groupAttributes = [],\n separatorClassName,\n separatorAttributes = [],\n anchor = {},\n ariaLabel,\n ariaLabelledBy,\n empty,\n clearContent,\n clearLabel,\n chips,\n } = viewInputs\n\n const resolveInputLabel = () => {\n if (Predicate.isNotUndefined(ariaLabel)) {\n return [h.AriaLabel(ariaLabel)]\n } else if (Predicate.isNotUndefined(ariaLabelledBy)) {\n return [h.AriaLabelledBy(ariaLabelledBy)]\n } else {\n return []\n }\n }\n\n const inputLabelAttributes = resolveInputLabel()\n\n const isValueSelected = (itemValue: string): boolean => Array.contains(selectedValues, itemValue)\n\n const isLeaving = transitionState === 'LeaveStart' || transitionState === 'LeaveAnimating'\n const isVisible = isOpen || isLeaving\n const isItemsPanelVisible = isVisible && Array.isReadonlyArrayNonEmpty(items)\n const isBackdropVisible = isItemsPanelVisible || (isVisible && model.isModal)\n\n const animationAttributes = Match.value(transitionState).pipe(\n Match.when('EnterStart', () => [\n h.DataAttribute('closed', ''),\n h.DataAttribute('enter', ''),\n h.DataAttribute('transition', ''),\n ]),\n Match.when('EnterAnimating', () => [\n h.DataAttribute('enter', ''),\n h.DataAttribute('transition', ''),\n ]),\n Match.when('LeaveStart', () => [\n h.DataAttribute('leave', ''),\n h.DataAttribute('transition', ''),\n ]),\n Match.when('LeaveAnimating', () => [\n h.DataAttribute('closed', ''),\n h.DataAttribute('leave', ''),\n h.DataAttribute('transition', ''),\n ]),\n Match.orElse(() => []),\n )\n\n const isDisabledAtIndex = (index: number): boolean =>\n Predicate.isNotUndefined(isItemDisabled) &&\n pipe(\n items,\n Array.get(index),\n Option.exists(item => isItemDisabled(item, index)),\n )\n\n const firstEnabledIndex = findFirstEnabledIndex(items.length, 0, isDisabledAtIndex)(0, 1)\n\n const lastEnabledIndex = findFirstEnabledIndex(\n items.length,\n 0,\n isDisabledAtIndex,\n )(items.length - 1, -1)\n\n const resolveActiveIndex = keyToIndex(\n 'ArrowDown',\n 'ArrowUp',\n items.length,\n Option.getOrElse(maybeActiveItemIndex, () => -1),\n isDisabledAtIndex,\n )\n\n const resolveImmediateSelection = (targetIndex: number): Option.Option<{ item: string }> => {\n if (isReadOnly) {\n return Option.none()\n } else {\n return pipe(\n when(immediate, targetIndex),\n Option.flatMap(index => Array.get(items, index)),\n Option.map(targetItem => ({\n item: itemToValue(targetItem, targetIndex),\n })),\n )\n }\n }\n\n const maybeValidActiveItemIndex = Option.flatMap(maybeActiveItemIndex, index =>\n Option.as(Array.get(items, index), index),\n )\n\n const resolveCommitMessage = (): Option.Option<Message> => {\n if (isReadOnly) {\n return Option.as(maybeValidActiveItemIndex, Message.SuppressedItemCommit())\n } else {\n return Option.map(maybeValidActiveItemIndex, index => Message.RequestedItemClick({ index }))\n }\n }\n\n const handleInputKeyDown = (key: string): Option.Option<Message> =>\n Match.value(key).pipe(\n Match.when('ArrowDown', () => {\n if (Array.isReadonlyArrayEmpty(items)) {\n return Option.some(Message.SuppressedEmptyItemNavigation())\n }\n\n if (!isOpen) {\n return Option.some(\n Message.Opened({\n maybeActiveItemIndex: Option.some(firstEnabledIndex),\n }),\n )\n }\n const targetIndex = resolveActiveIndex('ArrowDown')\n return Option.some(\n Message.ActivatedItem({\n index: targetIndex,\n activationTrigger: 'Keyboard',\n maybeImmediateSelection: resolveImmediateSelection(targetIndex),\n }),\n )\n }),\n Match.when('ArrowUp', () => {\n if (Array.isReadonlyArrayEmpty(items)) {\n return Option.some(Message.SuppressedEmptyItemNavigation())\n }\n\n if (!isOpen) {\n return Option.some(\n Message.Opened({\n maybeActiveItemIndex: Option.some(lastEnabledIndex),\n }),\n )\n }\n const targetIndex = resolveActiveIndex('ArrowUp')\n return Option.some(\n Message.ActivatedItem({\n index: targetIndex,\n activationTrigger: 'Keyboard',\n maybeImmediateSelection: resolveImmediateSelection(targetIndex),\n }),\n )\n }),\n Match.when('Enter', () => {\n if (!isOpen) {\n return Option.none()\n }\n return resolveCommitMessage()\n }),\n Match.when('Escape', () => {\n if (!isOpen) {\n return Option.none()\n }\n return Option.some(Message.Closed({ restingInputValue, isClearable: !isReadOnly }))\n }),\n Match.whenOr('Home', 'End', () => {\n if (!isOpen) {\n return Option.none()\n }\n\n if (Array.isReadonlyArrayEmpty(items)) {\n return Option.some(Message.SuppressedEmptyItemNavigation())\n }\n\n const targetIndex = resolveActiveIndex(key)\n return Option.some(\n Message.ActivatedItem({\n index: targetIndex,\n activationTrigger: 'Keyboard',\n maybeImmediateSelection: resolveImmediateSelection(targetIndex),\n }),\n )\n }),\n Match.orElse(() => Option.none()),\n )\n\n const maybeActiveDescendant = Option.match(maybeValidActiveItemIndex, {\n onNone: () => [],\n onSome: index => [h.AriaActiveDescendant(itemId(id, index))],\n })\n\n const onInputAttributes = isReadOnly\n ? []\n : [h.OnInput(value => Message.UpdatedInputValue({ value }))]\n\n const input: ReadonlyArray<ChildAttribute> = [\n ...childAttributes([\n h.Id(`${id}-input`),\n h.Role('combobox'),\n h.AriaExpanded(isItemsPanelVisible),\n ...(isItemsPanelVisible ? [h.AriaControls(`${id}-items`)] : []),\n h.Attribute('aria-autocomplete', 'list'),\n h.Attribute('aria-haspopup', 'listbox'),\n ...inputLabelAttributes,\n h.Autocomplete('off'),\n // What is typed filters: a phone's keyboard capitalizing and correcting it filters\n // on a word nobody typed, and its Enter key says it searches.\n h.Attribute('autocapitalize', 'none'),\n h.Attribute('autocorrect', 'off'),\n h.Attribute('spellcheck', 'false'),\n h.Attribute('enterkeyhint', 'search'),\n h.Value(model.inputValue),\n ...(isItemsPanelVisible ? maybeActiveDescendant : []),\n ...(inputPlaceholder ? [h.Placeholder(inputPlaceholder)] : []),\n ...(isDisabled\n ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]\n : [\n ...onInputAttributes,\n h.OnKeyDownPreventDefault(handleInputKeyDown),\n h.OnBlur(\n Message.BlurredInput({\n restingInputValue,\n isClearable: !isReadOnly,\n }),\n ),\n ...(openOnFocus\n ? [h.OnFocus(Message.Opened({ maybeActiveItemIndex: Option.none() }))]\n : []),\n ]),\n ...(isReadOnly\n ? [h.Readonly(true), h.AriaReadonly(true), h.DataAttribute('readonly', '')]\n : []),\n ...(isInvalid ? [h.AriaInvalid(true), h.DataAttribute('invalid', '')] : []),\n ...(isVisible ? [h.DataAttribute('open', '')] : []),\n ...(model.selectInputOnFocus\n ? [h.OnMount(UpstreamCombobox.AttachComboboxSelectOnFocus())]\n : []),\n ...(inputClassName ? [h.Class(inputClassName)] : []),\n ]),\n ...inputAttributes,\n ]\n\n const placed = { position: 'absolute', margin: '0', visibility: 'hidden' }\n const anchorAttributes = [\n // Only with an in-place panel: portal relocation moves a panel after the\n // Mount acquires, and moving a shown popover hides it again. The panel\n // then draws in the top layer, out of every stacking context and overflow\n // box; the anchor positions it as before, and light dismiss stays the\n // application's Messages closing it. A popover keeps the browser's\n // `inset: 0`, of which the anchor overwrites only `left` and `top`: right\n // to left, `right: 0` won and the panel opened at the viewport's far edge.\n ...(anchor.portal === false\n ? [\n h.Attribute('popover', 'manual'),\n h.Style({ ...placed, inset: 'auto' }),\n h.OnMount(\n topLayer(\n UpstreamCombobox.AnchorCombobox({\n buttonId: `${id}-input-wrapper`,\n anchor,\n }),\n ),\n ),\n ]\n : [\n h.Style(placed),\n h.OnMount(\n UpstreamCombobox.AnchorCombobox({\n buttonId: `${id}-input-wrapper`,\n anchor,\n }),\n ),\n ]),\n ]\n\n const inputWrapper: ReadonlyArray<ChildAttribute> = [\n ...childAttributes([\n h.Id(`${id}-input-wrapper`),\n ...(inputWrapperClassName ? [h.Class(inputWrapperClassName)] : []),\n ]),\n ...inputWrapperAttributes,\n ]\n\n const wrapper: ReadonlyArray<ChildAttribute> = [\n ...childAttributes([\n ...(className ? [h.Class(className)] : []),\n ...(isVisible ? [h.DataAttribute('open', '')] : []),\n ...(isDisabled ? [h.DataAttribute('disabled', '')] : []),\n ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),\n ...(isInvalid ? [h.DataAttribute('invalid', '')] : []),\n ]),\n ...attributes,\n ]\n\n const toggleButton =\n buttonContent === undefined\n ? undefined\n : {\n key: `${id}-button`,\n attributes: [\n ...childAttributes([\n h.Id(`${id}-button`),\n h.Type('button'),\n h.Tabindex(-1),\n ...(isItemsPanelVisible ? [h.AriaControls(`${id}-items`)] : []),\n h.AriaExpanded(isItemsPanelVisible),\n h.Attribute('aria-haspopup', 'listbox'),\n ...(isDisabled\n ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')]\n : [\n h.OnClick(\n Message.PressedToggleButton({\n restingInputValue,\n isClearable: !isReadOnly,\n }),\n ),\n ]),\n ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),\n h.OnMount(UpstreamCombobox.AttachComboboxPreventBlur()),\n ...(buttonClassName ? [h.Class(buttonClassName)] : []),\n ]),\n ...buttonAttributes,\n ],\n content: buttonContent,\n }\n\n const chipRenders: ReadonlyArray<ComboboxChipRender> =\n chips === undefined\n ? []\n : Array.map(selectedValues, value => {\n const label = chips.label?.(value) ?? value\n return {\n key: `${id}-chip-${value}`,\n label,\n remove: childAttributes([\n h.Type('button'),\n h.AriaLabel(chips.removeLabel?.(label) ?? `Remove ${label}`),\n ...(isDisabled || isReadOnly\n ? [h.Disabled(true)]\n : [\n h.OnClick(\n Message.SelectedItem({ item: value, displayText: label, wasSelected: true }),\n ),\n ]),\n ]),\n }\n })\n\n const clearButton =\n clearContent === undefined || model.inputValue === '' || isDisabled || isReadOnly\n ? undefined\n : {\n key: `${id}-clear`,\n attributes: childAttributes([\n h.Type('button'),\n h.Tabindex(-1),\n h.AriaLabel(clearLabel ?? 'Clear'),\n h.OnClick(Message.UpdatedInputValue({ value: '' })),\n // The field keeps the focus, as with the toggle.\n h.OnMount(UpstreamCombobox.AttachComboboxPreventBlur()),\n ]),\n content: clearContent,\n }\n\n if (!isVisible) {\n return {\n id,\n isVisible,\n wrapper,\n inputWrapper,\n input,\n toggleButton,\n backdrop: undefined,\n items: undefined,\n scroll: undefined,\n groups: [],\n hiddenInputs: [],\n chips: chipRenders,\n clearButton,\n empty: undefined,\n }\n }\n\n const backdrop = isBackdropVisible\n ? {\n key: `${id}-backdrop`,\n attributes: [\n ...childAttributes([\n h.Id(`${id}-backdrop`),\n h.OnMount(UpstreamCombobox.PortalComboboxBackdrop()),\n ...(isLeaving\n ? []\n : [h.OnClick(Message.Closed({ restingInputValue, isClearable: !isReadOnly }))]),\n ...(backdropClassName ? [h.Class(backdropClassName)] : []),\n ]),\n ...backdropAttributes,\n ],\n }\n : undefined\n\n const itemsContainer = isItemsPanelVisible\n ? {\n key: `${id}-items-container`,\n attributes: [\n ...childAttributes([\n h.Id(`${id}-items`),\n h.Role('listbox'),\n ...(behavior.ariaMultiSelectable ? [h.AriaMultiSelectable(true)] : []),\n h.AriaLabelledBy(`${id}-input`),\n h.Tabindex(-1),\n ...(isReadOnly ? [h.AriaReadonly(true), h.DataAttribute('readonly', '')] : []),\n ...anchorAttributes,\n ...animationAttributes,\n ...(itemsClassName ? [h.Class(itemsClassName)] : []),\n ]),\n ...itemsAttributes,\n ],\n }\n : undefined\n\n const scroll =\n itemsScrollClassName || Array.isReadonlyArrayNonEmpty(itemsScrollAttributes)\n ? [\n ...childAttributes(itemsScrollClassName ? [h.Class(itemsScrollClassName)] : []),\n ...itemsScrollAttributes,\n ]\n : undefined\n\n const itemRenders: ReadonlyArray<ComboboxItemRender> = Array.map(items, (item, index) => {\n const isActiveItem = Option.exists(maybeActiveItemIndex, activeIndex => activeIndex === index)\n const isDisabledItem = isDisabledAtIndex(index)\n const isSelectedItem = isValueSelected(itemToValue(item, index))\n const itemConfig: ItemConfig = itemToConfig(item, {\n isActive: isActiveItem,\n isDisabled: isDisabledItem,\n isReadOnly,\n isSelected: isSelectedItem,\n })\n\n const isHoverable = !isDisabledItem && !isLeaving\n const isClickable = isHoverable && !isReadOnly\n\n return {\n key: itemId(id, index),\n attributes: childAttributes([\n h.Id(itemId(id, index)),\n h.Role('option'),\n h.AriaSelected(isSelectedItem),\n ...(isActiveItem ? [h.DataAttribute('active', '')] : []),\n ...(isSelectedItem ? [h.DataAttribute('selected', '')] : []),\n ...(isDisabledItem ? [h.AriaDisabled(true), h.DataAttribute('disabled', '')] : []),\n ...(isReadOnly ? [h.DataAttribute('readonly', '')] : []),\n ...(isClickable\n ? [\n h.OnClick(\n Message.SelectedItem({\n item: itemToValue(item, index),\n displayText: itemToDisplayText(item, index),\n wasSelected: isValueSelected(itemToValue(item, index)),\n }),\n ),\n ]\n : []),\n ...(isHoverable\n ? [\n ...(isActiveItem\n ? []\n : [\n h.OnPointerMove((screenX, screenY, pointerType) =>\n when(\n pointerType !== 'touch',\n Message.MovedPointerOverItem({ index, screenX, screenY }),\n ),\n ),\n ]),\n h.OnPointerLeave(pointerType =>\n when(pointerType !== 'touch', Message.DeactivatedItem()),\n ),\n ]\n : []),\n ...(itemConfig.className ? [h.Class(itemConfig.className)] : []),\n ]),\n content: itemConfig.content,\n }\n })\n\n const groups: ReadonlyArray<ComboboxGroupRender> = itemGroupKey\n ? Array.flatMap(\n groupContiguous(itemRenders, (_render, index) =>\n Array.get(items, index).pipe(\n Option.match({\n onNone: () => '',\n onSome: item => itemGroupKey(item, index),\n }),\n ),\n ),\n (segment, segmentIndex) => {\n const maybeHeading = Option.fromNullishOr(groupToHeading?.(segment.key))\n\n const headingId = `${id}-heading-${segment.key}`\n\n const heading: ComboboxHeadingRender | undefined = Option.match(maybeHeading, {\n onNone: () => undefined,\n onSome: (headingValue: GroupHeading) => ({\n id: headingId,\n attributes: childAttributes([\n h.Id(headingId),\n h.Role('presentation'),\n ...(headingValue.className ? [h.Class(headingValue.className)] : []),\n ]),\n content: headingValue.content,\n }),\n })\n\n return [\n {\n key: `${id}-group-${segment.key}`,\n heading,\n group: {\n key: `${id}-group-${segment.key}`,\n attributes: [\n ...childAttributes([\n h.Role('group'),\n ...(heading ? [h.AriaLabelledBy(headingId)] : []),\n ...(groupClassName ? [h.Class(groupClassName)] : []),\n ]),\n ...groupAttributes,\n ],\n },\n separator:\n segmentIndex > 0 &&\n (separatorClassName || Array.isReadonlyArrayNonEmpty(separatorAttributes))\n ? {\n key: `${id}-separator-${segmentIndex}`,\n attributes: [\n ...childAttributes([\n h.Role('separator'),\n ...(separatorClassName ? [h.Class(separatorClassName)] : []),\n ]),\n ...separatorAttributes,\n ],\n }\n : undefined,\n items: segment.items,\n },\n ]\n },\n )\n : [\n {\n key: `${id}-group`,\n heading: undefined,\n group: undefined,\n separator: undefined,\n items: itemRenders,\n },\n ]\n\n const hiddenInputs: ReadonlyArray<Html> = formName\n ? Array.match(selectedValues, {\n onEmpty: () => [h.input([h.Type('hidden'), h.Name(formName)])],\n onNonEmpty: Array.map(selectedValue =>\n h.input([h.Type('hidden'), h.Name(formName), h.Value(selectedValue)]),\n ),\n })\n : []\n\n // Anchored as the list is, which is not drawn beside it: one Mount per element.\n const emptyPanel =\n isVisible && !isItemsPanelVisible && empty !== undefined\n ? {\n key: `${id}-empty`,\n attributes: childAttributes([\n h.Id(`${id}-empty`),\n h.Role('status'),\n ...anchorAttributes,\n ...animationAttributes,\n ]),\n content: empty,\n }\n : undefined\n\n return {\n id,\n isVisible,\n wrapper,\n inputWrapper,\n input,\n toggleButton,\n backdrop,\n items: itemsContainer,\n scroll,\n groups,\n hiddenInputs,\n chips: chipRenders,\n clearButton,\n empty: emptyPanel,\n }\n}\n"],"mappings":";;;;;;;;;;;;AAgGA,MAAM,UAAU,IAAY,UAA0B,GAAG,GAAG,QAAQ;AAEpE,MAAa,iBACX,OACA,YACA,GACA,aACuB;CACvB,MAAM,EACJ,IACA,QACA,WACA,WAAW,EAAE,mBACb,yBACE;CAEJ,MAAM,EACJ,OACA,gBACA,mBACA,cACA,aACA,mBACA,gBACA,gBACA,kBAAkB,CAAC,GACnB,kBACA,uBACA,yBAAyB,CAAC,GAC1B,gBACA,kBAAkB,CAAC,GACnB,sBACA,wBAAwB,CAAC,GACzB,mBACA,qBAAqB,CAAC,GACtB,WACA,aAAa,CAAC,GACd,eACA,iBACA,mBAAmB,CAAC,GACpB,UACA,YACA,aAAa,OACb,WACA,aACA,cACA,gBACA,g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kBAAkB,CAAC,IAAI,CAAC,CAC5D,CAAC,GACD,GAAG,mBACL;IACF,IACA,KAAA;IACN,OAAO,QAAQ;GACjB,CACF;EACF,CACF,IACA,CACE;GACE,KAAK,GAAG,GAAG;GACX,SAAS,KAAA;GACT,OAAO,KAAA;GACP,WAAW,KAAA;GACX,OAAO;EACT,CACF;EAqCF,cAnCwC,WACtC,MAAM,MAAM,gBAAgB;GAC1B,eAAe,CAAC,EAAE,MAAM,CAAC,EAAE,KAAK,QAAQ,GAAG,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC;GAC7D,YAAY,MAAM,KAAI,kBACpB,EAAE,MAAM;IAAC,EAAE,KAAK,QAAQ;IAAG,EAAE,KAAK,QAAQ;IAAG,EAAE,MAAM,aAAa;GAAC,CAAC,CACtE;EACF,CAAC,IACD,CAAC;EA6BH,OAAO;EACP;EACA,OA3BA,aAAa,CAAC,uBAAuB,UAAU,KAAA,IAC3C;GACE,KAAK,GAAG,GAAG;GACX,YAAY,gBAAgB;IAC1B,EAAE,GAAG,GAAG,GAAG,OAAO;IAClB,EAAE,KAAK,QAAQ;IACf,GAAG;IACH,GAAG;GACL,CAAC;GACD,SAAS;EACX,IACA,KAAA;CAiBN;AACF"}
@@ -259,9 +259,11 @@ export declare const view: import("foldkit/submodel").View<{
259
259
  readonly maybeLastButtonPointerType: Option.Option<string>;
260
260
  };
261
261
  }, {
262
+ readonly _tag: "Cleared";
263
+ } | {
262
264
  readonly _tag: "Closed";
263
265
  } | {
264
- readonly _tag: "Cleared";
266
+ readonly _tag: "Opened";
265
267
  } | {
266
268
  readonly _tag: "GotCalendarMessage";
267
269
  readonly message: {
@@ -322,6 +324,10 @@ export declare const view: import("foldkit/submodel").View<{
322
324
  readonly _tag: "IgnoredMouseClick";
323
325
  } | {
324
326
  readonly _tag: "SuppressedSpaceScroll";
327
+ } | {
328
+ readonly _tag: "RequestedClose";
329
+ } | {
330
+ readonly _tag: "RequestedOpen";
325
331
  } | {
326
332
  readonly _tag: "BlurredPanel";
327
333
  } | {
@@ -333,27 +339,21 @@ export declare const view: import("foldkit/submodel").View<{
333
339
  } | {
334
340
  readonly _tag: "GotAnimationMessage";
335
341
  readonly message: {
342
+ readonly _tag: "Hid";
343
+ } | {
344
+ readonly _tag: "Showed";
345
+ } | {
336
346
  readonly _tag: "CompletedWaitForPaint";
337
347
  readonly generation: number;
338
348
  } | {
339
349
  readonly _tag: "EndedAnimation";
340
350
  readonly generation: number;
341
- } | {
342
- readonly _tag: "Hid";
343
- } | {
344
- readonly _tag: "Showed";
345
351
  };
346
352
  } | {
347
353
  readonly _tag: "PressedPointerOnButton";
348
354
  readonly pointerType: string;
349
355
  readonly button: number;
350
- } | {
351
- readonly _tag: "RequestedClose";
352
- } | {
353
- readonly _tag: "RequestedOpen";
354
356
  };
355
- } | {
356
- readonly _tag: "Opened";
357
357
  } | {
358
358
  readonly _tag: "RequestedSelectDate";
359
359
  readonly date: {
package/dist/index.d.ts CHANGED
@@ -65,6 +65,8 @@ import * as Steps from "./steps.js";
65
65
  import { Step, StepsSlots, StepsView } from "./steps.js";
66
66
  import * as VirtualList from "./virtualList.js";
67
67
  import { VirtualListSlots } from "./virtualList.js";
68
+ import * as WindowList from "./windowList.js";
69
+ import { WindowListSlots, WindowListView } from "./windowList.js";
68
70
  import * as Progress from "./progress.js";
69
71
  import { ProgressSection, ProgressSlots, ProgressTone, ProgressView } from "./progress.js";
70
72
  import * as NumberField from "./numberField.js";
@@ -122,6 +124,8 @@ import * as Select from "./select.js";
122
124
  import { ResolvedSelect, SelectSlots } from "./select.js";
123
125
  import * as Separator from "./separator.js";
124
126
  import { SeparatorSlots } from "./separator.js";
127
+ import * as Picker from "./picker.js";
128
+ import { PickerOption, PickerSlots, PickerView } from "./picker.js";
125
129
  import * as Drawer from "./drawer.js";
126
130
  import { DrawerSlots } from "./drawer.js";
127
131
  import * as Segmented from "./segmented.js";
@@ -180,4 +184,4 @@ import { FloatingPanelSlots, FloatingPanelView } from "./floatingPanel.js";
180
184
  import * as Tour from "./tour.js";
181
185
  import { TourSlots, TourView } from "./tour.js";
182
186
  import { FieldParts } from "./field.js";
183
- export { Accordion, type AccordionItem, AccordionSlots, type AccordionView, Alert, type AlertAction, AlertSlots, type AlertView, Anchor, type AngleMark, AngleSlider, type AngleSliderLayout, AngleSliderSlots, type AngleSliderView, AppShell, AppShellSlots, AspectRatio, AspectRatioSlots, Avatar, AvatarGroupSlots, type AvatarGroupView, type AvatarPicture, type AvatarSize, AvatarSlots, type AvatarStatus, Badge, BadgeSlots, type BannerAlert, Breadcrumb, type BreadcrumbCollapse, type BreadcrumbExpand, type BreadcrumbMenu, BreadcrumbSlots, Button, ButtonGroup, ButtonGroupSlots, ButtonSlots, type ButtonView, Calendar, type CalendarOptions, type CalendarPreset, type CalendarPreview, CalendarSlots, Card, CardGroupSlots, CardSlots, Carousel, CarouselSlots, type CarouselView, type CartesianChart, CascadeSelect, CascadeSelectSlots, type CascadeSelectView, Chart, type ChartColor, ChartSlots, type ChartView, ChatMessage, type ChatMessageAction, type ChatMessageFrom, ChatMessageGroupSlots, type ChatMessageGroupView, type ChatMessageItem, ChatMessageSlots, type ChatMessageStatus, type ChatMessageTime, type ChatMessageView, Checkbox, CheckboxGroup, type CheckboxGroupOption, CheckboxGroupSlots, type CheckboxGroupView, CheckboxSlots, CodeBlock, CodeBlockSlots, ColorPicker, type ColorPickerLabels, type ColorPickerPopover, type ColorPickerPreset, ColorPickerSlots, type ColorPickerView, Combobox, type ComboboxChipRender, type ComboboxExtraInputs, type ComboboxGroupRender, type ComboboxHeadingRender, type ComboboxItemRender, type ComboboxMultiBundle, type ComboboxMultiViewInputs, type ComboboxRenderInfo, type ComboboxSingleBundle, type ComboboxSingleViewInputs, ComboboxSlots, ComboboxView, Command, type CommandGroup, type CommandHint, type CommandItem, type CommandPage, CommandSlots, type CommandView, DatePicker, type DatePickerRenderInfo, DatePickerSlots, DatePickerView, type DatePickerViewInputs, Dialog, type DialogContext, DialogSlots, Disclosure, DisclosureSlots, type DonutChart, Drawer, DrawerSlots, type DropdownOption, type Dropdowns, Empty, EmptySlots, type FieldParts, Fieldset, FieldsetSlots, Figure, FigureSlots, type FigureView, FileDrop, FileDropSlots, FloatingPanel, FloatingPanelSlots, type FloatingPanelView, HoverIntent, type HoverIntentContext, HoverIntentSlots, Icon, IconSlots, Icons, Image, ImageCropper, type ImageCropperLabels, ImageCropperSlots, type ImageCropperView, ImageSlots, type ImageView, type InlineAlert, Input, InputCopy, InputCopySlots, type InputCopyView, type InputField, InputSlots, type InputView, Item, ItemGroupSlots, type ItemGroupView, ItemSlots, Kbd, KbdSlots, Label, LabelSlots, Listbox, type ListboxGroupRender, type ListboxHeadingRender, type ListboxItemRender, type ListboxRenderInfo, ListboxSlots, ListboxView, Marquee, type MarqueeSide, MarqueeSlots, type MarqueeView, Menu, type MenuBundle, type MenuGroupRender, type MenuHeadingRender, type MenuItemRender, type MenuRenderInfo, MenuSlots, MenuView, type MenuViewInputs, Menubar, MenubarSlots, MessageScroller, MessageScrollerSlots, type MessageScrollerView, Meter, MeterSlots, type MixinList, type MultiBundle, type MultiViewInputs, Nav, type NavEntry, type NavLink, type NavPanel, type NavPanelGroup, type NavPanelLink, NavSlots, type NavView, NumberField, NumberFieldSlots, type NumberFieldView, OtpField, OtpFieldSlots, type OtpFieldView, Pagination, PaginationSlots, PasswordInput, PasswordInputSlots, type PasswordRequirement, Patterns, Popover, PopoverSlots, type PresetsView, Progress, type ProgressSection, ProgressSlots, type ProgressTone, type ProgressView, QrCode, QrCodeSlots, type QrCodeView, Questionnaire, QuestionnaireSlots, type QuestionnaireView, RadioGroup, RadioGroupSlots, Rating, type RatingDisplay, type RatingInput, RatingSlots, type RatingView, Recipes, Resizable, ResizableSlots, type ResizableView, type ResolveContext, type Resolved, type ResolvedButton, type ResolvedCalendar, type ResolvedCaption, type ResolvedCheckbox, type ResolvedColumnHeader, type ResolvedCombobox, type ResolvedComboboxGroup, type ResolvedComboboxHeading, type ResolvedComboboxItem, type ResolvedComboboxToggle, type ResolvedDatePicker, type ResolvedDayCell, type ResolvedDays, type ResolvedDialog, type ResolvedDisclosure, type ResolvedDropdown, type ResolvedFieldset, type ResolvedFileDrop, type ResolvedHoverIntent, type ResolvedInput, type ResolvedListbox, type ResolvedListboxGroup, type ResolvedListboxHeading, type ResolvedListboxItem, type ResolvedMenu, type ResolvedMenuGroup, type ResolvedMenuHeading, type ResolvedMenuItem, type ResolvedMonthCell, type ResolvedMonths, type ResolvedNav, type ResolvedPopover, type ResolvedRadioGroup, type ResolvedRadioOption, type ResolvedSelect, type ResolvedSlots, type ResolvedSwitch, type ResolvedTab, type ResolvedTabs, type ResolvedTextarea, type ResolvedToast, type ResolvedToastEntry, type ResolvedTooltip, type ResolvedWeek, type ResolvedYearCell, type ResolvedYears, ScrollArea, ScrollAreaSlots, Segmented, type SegmentedOption, SegmentedSlots, type SegmentedView, Select, SelectSlots, Separator, SeparatorSlots, Sheet, Sidebar, type SidebarAction, type SidebarBranch, type SidebarEnd, type SidebarGroup, type SidebarLeaf, type SidebarLink, type SidebarRow, SidebarSlots, type SidebarView, SignaturePad, type SignaturePadLabels, SignaturePadSlots, type SignaturePadView, type SingleBundle, type SingleViewInputs, Skeleton, type SkeletonLinesView, SkeletonSlots, type SkeletonTableRowView, Slider, type SliderMark, SliderSlots, type SliderView, Spinner, SpinnerSlots, type StateWords, type Step, type StepState, Steps, StepsSlots, type StepsView, Switch, SwitchSlots, Table, type TableColumn, type TableExpansion, type TableSelection, TableSlots, type TableSort, type TableView, Tabs, type TabsClose, type TabsContext, TabsSlots, TagsInput, TagsInputSlots, type TagsInputView, Textarea, type TextareaField, type TextareaParts, TextareaSlots, type TextareaView, ThinkingIndicator, ThinkingIndicatorSlots, type ThinkingIndicatorView, type ThinkingStep, ThinkingSteps, ThinkingStepsSlots, type ThinkingStepsView, type TimePart, Timer, type TimerLabels, TimerSlots, type TimerView, Toast, type ToastEntryRender, type ToastRenderInfo, ToastSlots, ToastView, Tooltip, type TooltipContext, TooltipSlots, Touch, Tour, TourSlots, type TourView, type TreeNode, TreeView, TreeViewSlots, type TreeViewView, Typography, TypographySlots, VirtualList, VirtualListSlots, resolve };
187
+ export { Accordion, type AccordionItem, AccordionSlots, type AccordionView, Alert, type AlertAction, AlertSlots, type AlertView, Anchor, type AngleMark, AngleSlider, type AngleSliderLayout, AngleSliderSlots, type AngleSliderView, AppShell, AppShellSlots, AspectRatio, AspectRatioSlots, Avatar, AvatarGroupSlots, type AvatarGroupView, type AvatarPicture, type AvatarSize, AvatarSlots, type AvatarStatus, Badge, BadgeSlots, type BannerAlert, Breadcrumb, type BreadcrumbCollapse, type BreadcrumbExpand, type BreadcrumbMenu, BreadcrumbSlots, Button, ButtonGroup, ButtonGroupSlots, ButtonSlots, type ButtonView, Calendar, type CalendarOptions, type CalendarPreset, type CalendarPreview, CalendarSlots, Card, CardGroupSlots, CardSlots, Carousel, CarouselSlots, type CarouselView, type CartesianChart, CascadeSelect, CascadeSelectSlots, type CascadeSelectView, Chart, type ChartColor, ChartSlots, type ChartView, ChatMessage, type ChatMessageAction, type ChatMessageFrom, ChatMessageGroupSlots, type ChatMessageGroupView, type ChatMessageItem, ChatMessageSlots, type ChatMessageStatus, type ChatMessageTime, type ChatMessageView, Checkbox, CheckboxGroup, type CheckboxGroupOption, CheckboxGroupSlots, type CheckboxGroupView, CheckboxSlots, CodeBlock, CodeBlockSlots, ColorPicker, type ColorPickerLabels, type ColorPickerPopover, type ColorPickerPreset, ColorPickerSlots, type ColorPickerView, Combobox, type ComboboxChipRender, type ComboboxExtraInputs, type ComboboxGroupRender, type ComboboxHeadingRender, type ComboboxItemRender, type ComboboxMultiBundle, type ComboboxMultiViewInputs, type ComboboxRenderInfo, type ComboboxSingleBundle, type ComboboxSingleViewInputs, ComboboxSlots, ComboboxView, Command, type CommandGroup, type CommandHint, type CommandItem, type CommandPage, CommandSlots, type CommandView, DatePicker, type DatePickerRenderInfo, DatePickerSlots, DatePickerView, type DatePickerViewInputs, Dialog, type DialogContext, DialogSlots, Disclosure, DisclosureSlots, type DonutChart, Drawer, DrawerSlots, type DropdownOption, type Dropdowns, Empty, EmptySlots, type FieldParts, Fieldset, FieldsetSlots, Figure, FigureSlots, type FigureView, FileDrop, FileDropSlots, FloatingPanel, FloatingPanelSlots, type FloatingPanelView, HoverIntent, type HoverIntentContext, HoverIntentSlots, Icon, IconSlots, Icons, Image, ImageCropper, type ImageCropperLabels, ImageCropperSlots, type ImageCropperView, ImageSlots, type ImageView, type InlineAlert, Input, InputCopy, InputCopySlots, type InputCopyView, type InputField, InputSlots, type InputView, Item, ItemGroupSlots, type ItemGroupView, ItemSlots, Kbd, KbdSlots, Label, LabelSlots, Listbox, type ListboxGroupRender, type ListboxHeadingRender, type ListboxItemRender, type ListboxRenderInfo, ListboxSlots, ListboxView, Marquee, type MarqueeSide, MarqueeSlots, type MarqueeView, Menu, type MenuBundle, type MenuGroupRender, type MenuHeadingRender, type MenuItemRender, type MenuRenderInfo, MenuSlots, MenuView, type MenuViewInputs, Menubar, MenubarSlots, MessageScroller, MessageScrollerSlots, type MessageScrollerView, Meter, MeterSlots, type MixinList, type MultiBundle, type MultiViewInputs, Nav, type NavEntry, type NavLink, type NavPanel, type NavPanelGroup, type NavPanelLink, NavSlots, type NavView, NumberField, NumberFieldSlots, type NumberFieldView, OtpField, OtpFieldSlots, type OtpFieldView, Pagination, PaginationSlots, PasswordInput, PasswordInputSlots, type PasswordRequirement, Patterns, Picker, type PickerOption, PickerSlots, type PickerView, Popover, PopoverSlots, type PresetsView, Progress, type ProgressSection, ProgressSlots, type ProgressTone, type ProgressView, QrCode, QrCodeSlots, type QrCodeView, Questionnaire, QuestionnaireSlots, type QuestionnaireView, RadioGroup, RadioGroupSlots, Rating, type RatingDisplay, type RatingInput, RatingSlots, type RatingView, Recipes, Resizable, ResizableSlots, type ResizableView, type ResolveContext, type Resolved, type ResolvedButton, type ResolvedCalendar, type ResolvedCaption, type ResolvedCheckbox, type ResolvedColumnHeader, type ResolvedCombobox, type ResolvedComboboxGroup, type ResolvedComboboxHeading, type ResolvedComboboxItem, type ResolvedComboboxToggle, type ResolvedDatePicker, type ResolvedDayCell, type ResolvedDays, type ResolvedDialog, type ResolvedDisclosure, type ResolvedDropdown, type ResolvedFieldset, type ResolvedFileDrop, type ResolvedHoverIntent, type ResolvedInput, type ResolvedListbox, type ResolvedListboxGroup, type ResolvedListboxHeading, type ResolvedListboxItem, type ResolvedMenu, type ResolvedMenuGroup, type ResolvedMenuHeading, type ResolvedMenuItem, type ResolvedMonthCell, type ResolvedMonths, type ResolvedNav, type ResolvedPopover, type ResolvedRadioGroup, type ResolvedRadioOption, type ResolvedSelect, type ResolvedSlots, type ResolvedSwitch, type ResolvedTab, type ResolvedTabs, type ResolvedTextarea, type ResolvedToast, type ResolvedToastEntry, type ResolvedTooltip, type ResolvedWeek, type ResolvedYearCell, type ResolvedYears, ScrollArea, ScrollAreaSlots, Segmented, type SegmentedOption, SegmentedSlots, type SegmentedView, Select, SelectSlots, Separator, SeparatorSlots, Sheet, Sidebar, type SidebarAction, type SidebarBranch, type SidebarEnd, type SidebarGroup, type SidebarLeaf, type SidebarLink, type SidebarRow, SidebarSlots, type SidebarView, SignaturePad, type SignaturePadLabels, SignaturePadSlots, type SignaturePadView, type SingleBundle, type SingleViewInputs, Skeleton, type SkeletonLinesView, SkeletonSlots, type SkeletonTableRowView, Slider, type SliderMark, SliderSlots, type SliderView, Spinner, SpinnerSlots, type StateWords, type Step, type StepState, Steps, StepsSlots, type StepsView, Switch, SwitchSlots, Table, type TableColumn, type TableExpansion, type TableSelection, TableSlots, type TableSort, type TableView, Tabs, type TabsClose, type TabsContext, TabsSlots, TagsInput, TagsInputSlots, type TagsInputView, Textarea, type TextareaField, type TextareaParts, TextareaSlots, type TextareaView, ThinkingIndicator, ThinkingIndicatorSlots, type ThinkingIndicatorView, type ThinkingStep, ThinkingSteps, ThinkingStepsSlots, type ThinkingStepsView, type TimePart, Timer, type TimerLabels, TimerSlots, type TimerView, Toast, type ToastEntryRender, type ToastRenderInfo, ToastSlots, ToastView, Tooltip, type TooltipContext, TooltipSlots, Touch, Tour, TourSlots, type TourView, type TreeNode, TreeView, TreeViewSlots, type TreeViewView, Typography, TypographySlots, VirtualList, VirtualListSlots, WindowList, WindowListSlots, type WindowListView, resolve };
package/dist/index.js CHANGED
@@ -64,6 +64,8 @@ import * as Steps from "./steps.js";
64
64
  import { StepsSlots } from "./steps.js";
65
65
  import * as VirtualList from "./virtualList.js";
66
66
  import { VirtualListSlots } from "./virtualList.js";
67
+ import * as WindowList from "./windowList.js";
68
+ import { WindowListSlots } from "./windowList.js";
67
69
  import * as Progress from "./progress.js";
68
70
  import { ProgressSlots } from "./progress.js";
69
71
  import * as NumberField from "./numberField.js";
@@ -118,6 +120,8 @@ import * as Select from "./select.js";
118
120
  import { SelectSlots } from "./select.js";
119
121
  import * as Separator from "./separator.js";
120
122
  import { SeparatorSlots } from "./separator.js";
123
+ import * as Picker from "./picker.js";
124
+ import { PickerSlots } from "./picker.js";
121
125
  import * as Drawer from "./drawer.js";
122
126
  import { DrawerSlots } from "./drawer.js";
123
127
  import * as Segmented from "./segmented.js";
@@ -174,4 +178,4 @@ import * as FloatingPanel from "./floatingPanel.js";
174
178
  import { FloatingPanelSlots } from "./floatingPanel.js";
175
179
  import * as Tour from "./tour.js";
176
180
  import { TourSlots } from "./tour.js";
177
- export { Accordion, AccordionSlots, Alert, AlertSlots, Anchor, AngleSlider, AngleSliderSlots, AppShell, AppShellSlots, AspectRatio, AspectRatioSlots, Avatar, AvatarGroupSlots, AvatarSlots, Badge, BadgeSlots, Breadcrumb, BreadcrumbSlots, Button, ButtonGroup, ButtonGroupSlots, ButtonSlots, Calendar, CalendarSlots, Card, CardGroupSlots, CardSlots, Carousel, CarouselSlots, CascadeSelect, CascadeSelectSlots, Chart, ChartSlots, ChatMessage, ChatMessageGroupSlots, ChatMessageSlots, Checkbox, CheckboxGroup, CheckboxGroupSlots, CheckboxSlots, CodeBlock, CodeBlockSlots, ColorPicker, ColorPickerSlots, Combobox, ComboboxSlots, ComboboxView, Command, CommandSlots, DatePicker, DatePickerSlots, DatePickerView, Dialog, DialogSlots, Disclosure, DisclosureSlots, Drawer, DrawerSlots, Empty, EmptySlots, Fieldset, FieldsetSlots, Figure, FigureSlots, FileDrop, FileDropSlots, FloatingPanel, FloatingPanelSlots, HoverIntent, HoverIntentSlots, Icon, IconSlots, Icons, Image, ImageCropper, ImageCropperSlots, ImageSlots, Input, InputCopy, InputCopySlots, InputSlots, Item, ItemGroupSlots, ItemSlots, Kbd, KbdSlots, Label, LabelSlots, Listbox, ListboxSlots, ListboxView, Marquee, MarqueeSlots, Menu, MenuSlots, MenuView, Menubar, MenubarSlots, MessageScroller, MessageScrollerSlots, Meter, MeterSlots, Nav, NavSlots, NumberField, NumberFieldSlots, OtpField, OtpFieldSlots, Pagination, PaginationSlots, PasswordInput, PasswordInputSlots, Patterns, Popover, PopoverSlots, Progress, ProgressSlots, QrCode, QrCodeSlots, Questionnaire, QuestionnaireSlots, RadioGroup, RadioGroupSlots, Rating, RatingSlots, Recipes, Resizable, ResizableSlots, ScrollArea, ScrollAreaSlots, Segmented, SegmentedSlots, Select, SelectSlots, Separator, SeparatorSlots, Sheet, Sidebar, SidebarSlots, SignaturePad, SignaturePadSlots, Skeleton, SkeletonSlots, Slider, SliderSlots, Spinner, SpinnerSlots, Steps, StepsSlots, Switch, SwitchSlots, Table, TableSlots, Tabs, TabsSlots, TagsInput, TagsInputSlots, Textarea, TextareaSlots, ThinkingIndicator, ThinkingIndicatorSlots, ThinkingSteps, ThinkingStepsSlots, Timer, TimerSlots, Toast, ToastSlots, ToastView, Tooltip, TooltipSlots, Touch, Tour, TourSlots, TreeView, TreeViewSlots, Typography, TypographySlots, VirtualList, VirtualListSlots, resolve };
181
+ export { Accordion, AccordionSlots, Alert, AlertSlots, Anchor, AngleSlider, AngleSliderSlots, AppShell, AppShellSlots, AspectRatio, AspectRatioSlots, Avatar, AvatarGroupSlots, AvatarSlots, Badge, BadgeSlots, Breadcrumb, BreadcrumbSlots, Button, ButtonGroup, ButtonGroupSlots, ButtonSlots, Calendar, CalendarSlots, Card, CardGroupSlots, CardSlots, Carousel, CarouselSlots, CascadeSelect, CascadeSelectSlots, Chart, ChartSlots, ChatMessage, ChatMessageGroupSlots, ChatMessageSlots, Checkbox, CheckboxGroup, CheckboxGroupSlots, CheckboxSlots, CodeBlock, CodeBlockSlots, ColorPicker, ColorPickerSlots, Combobox, ComboboxSlots, ComboboxView, Command, CommandSlots, DatePicker, DatePickerSlots, DatePickerView, Dialog, DialogSlots, Disclosure, DisclosureSlots, Drawer, DrawerSlots, Empty, EmptySlots, Fieldset, FieldsetSlots, Figure, FigureSlots, FileDrop, FileDropSlots, FloatingPanel, FloatingPanelSlots, HoverIntent, HoverIntentSlots, Icon, IconSlots, Icons, Image, ImageCropper, ImageCropperSlots, ImageSlots, Input, InputCopy, InputCopySlots, InputSlots, Item, ItemGroupSlots, ItemSlots, Kbd, KbdSlots, Label, LabelSlots, Listbox, ListboxSlots, ListboxView, Marquee, MarqueeSlots, Menu, MenuSlots, MenuView, Menubar, MenubarSlots, MessageScroller, MessageScrollerSlots, Meter, MeterSlots, Nav, NavSlots, NumberField, NumberFieldSlots, OtpField, OtpFieldSlots, Pagination, PaginationSlots, PasswordInput, PasswordInputSlots, Patterns, Picker, PickerSlots, Popover, PopoverSlots, Progress, ProgressSlots, QrCode, QrCodeSlots, Questionnaire, QuestionnaireSlots, RadioGroup, RadioGroupSlots, Rating, RatingSlots, Recipes, Resizable, ResizableSlots, ScrollArea, ScrollAreaSlots, Segmented, SegmentedSlots, Select, SelectSlots, Separator, SeparatorSlots, Sheet, Sidebar, SidebarSlots, SignaturePad, SignaturePadSlots, Skeleton, SkeletonSlots, Slider, SliderSlots, Spinner, SpinnerSlots, Steps, StepsSlots, Switch, SwitchSlots, Table, TableSlots, Tabs, TabsSlots, TagsInput, TagsInputSlots, Textarea, TextareaSlots, ThinkingIndicator, ThinkingIndicatorSlots, ThinkingSteps, ThinkingStepsSlots, Timer, TimerSlots, Toast, ToastSlots, ToastView, Tooltip, TooltipSlots, Touch, Tour, TourSlots, TreeView, TreeViewSlots, Typography, TypographySlots, VirtualList, VirtualListSlots, WindowList, WindowListSlots, resolve };
@@ -98,7 +98,7 @@ const computeRender = (model, viewInputs, h, behavior) => {
98
98
  else if (Predicate.isNotUndefined(ariaLabelledBy)) return [h.AriaLabelledBy(ariaLabelledBy)];
99
99
  else return [];
100
100
  };
101
- const button = childAttributes([
101
+ const button = [...childAttributes([
102
102
  h.Id(`${id}-button`),
103
103
  h.Type("button"),
104
104
  h.AriaHasPopup("listbox"),
@@ -117,9 +117,8 @@ const computeRender = (model, viewInputs, h, behavior) => {
117
117
  })] : [],
118
118
  ...isReadOnly ? [h.DataAttribute("readonly", "")] : [],
119
119
  ...isInvalid ? [h.DataAttribute("invalid", "")] : [],
120
- ...buttonClassName ? [h.Class(buttonClassName)] : [],
121
- ...buttonAttributes
122
- ]);
120
+ ...buttonClassName ? [h.Class(buttonClassName)] : []
121
+ ]), ...buttonAttributes];
123
122
  const maybeActiveDescendant = Option.match(maybeActiveItemIndex, {
124
123
  onNone: () => [],
125
124
  onSome: (index) => [h.AriaActiveDescendant(itemId(id, index))]
@@ -143,15 +142,14 @@ const computeRender = (model, viewInputs, h, behavior) => {
143
142
  buttonId: `${id}-button`,
144
143
  anchor
145
144
  }))]];
146
- const wrapper = childAttributes([
145
+ const wrapper = [...childAttributes([
147
146
  ...direction === void 0 ? [] : [h.Dir(direction)],
148
147
  ...className ? [h.Class(className)] : [],
149
- ...attributes,
150
148
  ...isVisible ? [h.DataAttribute("open", "")] : [],
151
149
  ...isDisabled ? [h.DataAttribute("disabled", "")] : [],
152
150
  ...isReadOnly ? [h.DataAttribute("readonly", "")] : [],
153
151
  ...isInvalid ? [h.DataAttribute("invalid", "")] : []
154
- ]);
152
+ ]), ...attributes];
155
153
  if (!isVisible) return {
156
154
  id,
157
155
  isVisible,
@@ -166,16 +164,15 @@ const computeRender = (model, viewInputs, h, behavior) => {
166
164
  };
167
165
  const backdrop = {
168
166
  key: `${id}-backdrop`,
169
- attributes: childAttributes([
167
+ attributes: [...childAttributes([
170
168
  h.OnMount(UpstreamListbox.PortalListboxBackdrop()),
171
169
  ...isLeaving ? [] : [h.OnClick(Message.Closed())],
172
- ...backdropClassName ? [h.Class(backdropClassName)] : [],
173
- ...backdropAttributes
174
- ])
170
+ ...backdropClassName ? [h.Class(backdropClassName)] : []
171
+ ]), ...backdropAttributes]
175
172
  };
176
173
  const itemsContainer = {
177
174
  key: `${id}-items-container`,
178
- attributes: childAttributes([
175
+ attributes: [...childAttributes([
179
176
  h.Id(`${id}-items`),
180
177
  h.Role("listbox"),
181
178
  h.AriaOrientation(String.toLowerCase(orientation)),
@@ -191,11 +188,10 @@ const computeRender = (model, viewInputs, h, behavior) => {
191
188
  h.OnKeyUpPreventDefault(handleSpaceKeyUp),
192
189
  h.OnBlur(Message.BlurredItems())
193
190
  ],
194
- ...itemsClassName ? [h.Class(itemsClassName)] : [],
195
- ...itemsAttributes
196
- ])
191
+ ...itemsClassName ? [h.Class(itemsClassName)] : []
192
+ ]), ...itemsAttributes]
197
193
  };
198
- const scroll = itemsScrollClassName || Array.isReadonlyArrayNonEmpty(itemsScrollAttributes) ? childAttributes([...itemsScrollClassName ? [h.Class(itemsScrollClassName)] : [], ...itemsScrollAttributes]) : void 0;
194
+ const scroll = itemsScrollClassName || Array.isReadonlyArrayNonEmpty(itemsScrollAttributes) ? [...childAttributes(itemsScrollClassName ? [h.Class(itemsScrollClassName)] : []), ...itemsScrollAttributes] : void 0;
199
195
  const itemRenders = Array.map(items, (item, index) => {
200
196
  const isActiveItem = Option.exists(maybeActiveItemIndex, (activeIndex) => activeIndex === index);
201
197
  const isDisabledItem = isItemDisabledByIndex(index);
@@ -252,20 +248,15 @@ const computeRender = (model, viewInputs, h, behavior) => {
252
248
  heading,
253
249
  group: {
254
250
  key: `${id}-group-${segment.key}`,
255
- attributes: childAttributes([
251
+ attributes: [...childAttributes([
256
252
  h.Role("group"),
257
253
  ...heading ? [h.AriaLabelledBy(headingId)] : [],
258
- ...groupClassName ? [h.Class(groupClassName)] : [],
259
- ...groupAttributes
260
- ])
254
+ ...groupClassName ? [h.Class(groupClassName)] : []
255
+ ]), ...groupAttributes]
261
256
  },
262
257
  separator: segmentIndex > 0 && (separatorClassName || Array.isReadonlyArrayNonEmpty(separatorAttributes)) ? {
263
258
  key: `${id}-separator-${segmentIndex}`,
264
- attributes: childAttributes([
265
- h.Role("separator"),
266
- ...separatorClassName ? [h.Class(separatorClassName)] : [],
267
- ...separatorAttributes
268
- ])
259
+ attributes: [...childAttributes([h.Role("separator"), ...separatorClassName ? [h.Class(separatorClassName)] : []]), ...separatorAttributes]
269
260
  } : void 0,
270
261
  items: segment.items
271
262
  }];