@fangxinyan/lumina 0.9.1 → 0.9.2

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.
@@ -1,13 +1,12 @@
1
1
  import { Tag } from './chunk-OGMI3TO5.js';
2
2
  import { useFloating } from './chunk-3QXP2ZNP.js';
3
- import { Input } from './chunk-TUXF2G2O.js';
4
3
  import { useOverlayLayer } from './chunk-2A4GYSN4.js';
5
4
  import { Icon, renderIconSlot } from './chunk-2BM65ITV.js';
6
5
  import { withComponentTheme, useComponentPortalTheme, InternalComponentThemePart } from './chunk-5HLNFDV4.js';
7
6
  import { usePortalContainer } from './chunk-CPVUDSIY.js';
8
7
  import './tokens-223RYVVS.css';
9
8
  import './shared-NJHRNLRH.css';
10
- import './Select-QPBB73KA.css';
9
+ import './Select-Y3X3ZJTC.css';
11
10
  import * as React from 'react';
12
11
  import { createPortal } from 'react-dom';
13
12
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -29,6 +28,10 @@ var defaultFilter = (input, opt, optionFilterProp) => {
29
28
  const txt = propValue != null ? String(propValue) : opt.text ?? (typeof opt.label === "string" ? opt.label : String(opt.value));
30
29
  return txt.toLowerCase().includes(q);
31
30
  };
31
+ var getSearchInputDisplayWidth = (value) => Array.from(value).reduce(
32
+ (width, character) => width + ((character.codePointAt(0) ?? 0) > 255 ? 2 : 1),
33
+ 0
34
+ );
32
35
  var getOptionAriaLabel = (option) => {
33
36
  if (option.ariaLabel) return option.ariaLabel;
34
37
  if (typeof option.label === "string" || typeof option.label === "number") {
@@ -47,6 +50,9 @@ var SelectInner = (props, forwardedRef) => {
47
50
  allowClear,
48
51
  searchable,
49
52
  showSearch,
53
+ searchValue: searchValueProp,
54
+ defaultSearchValue,
55
+ onSearch,
50
56
  filterOption,
51
57
  optionFilterProp,
52
58
  loading,
@@ -95,7 +101,7 @@ var SelectInner = (props, forwardedRef) => {
95
101
  isMulti && Array.isArray(props.defaultValue) ? props.defaultValue : []
96
102
  );
97
103
  const [innerOpen, setInnerOpen] = React.useState(defaultOpen ?? false);
98
- const [query, setQuery] = React.useState("");
104
+ const [innerSearchValue, setInnerSearchValue] = React.useState(defaultSearchValue ?? "");
99
105
  const [activeIdx, setActiveIdx] = React.useState(-1);
100
106
  const searchRef = React.useRef(null);
101
107
  const portalContainer = usePortalContainer();
@@ -114,12 +120,29 @@ var SelectInner = (props, forwardedRef) => {
114
120
  const openControlled = openProp !== void 0;
115
121
  const requestedOpen = openControlled ? openProp : innerOpen;
116
122
  const open = !disabled && requestedOpen;
117
- const setOpen = (v) => {
118
- if (disabled && v) return;
119
- if (!openControlled) setInnerOpen(v);
120
- onOpenChange?.(v);
121
- if (!v) setQuery("");
122
- };
123
+ const requestedOpenRef = React.useRef(requestedOpen);
124
+ requestedOpenRef.current = requestedOpen;
125
+ const searchControlled = searchValueProp !== void 0;
126
+ const searchValue = searchControlled ? searchValueProp : innerSearchValue;
127
+ const hasInlineSearch = mergedSearchable;
128
+ const showsInlineSearchInput = hasInlineSearch && (isMulti || open);
129
+ const updateSearchValue = React.useCallback((nextValue) => {
130
+ if (!searchControlled) setInnerSearchValue(nextValue);
131
+ onSearch?.(nextValue);
132
+ }, [onSearch, searchControlled]);
133
+ const resetSearchValue = React.useCallback(() => {
134
+ if (!searchValue) return;
135
+ if (!searchControlled) setInnerSearchValue("");
136
+ onSearch?.("");
137
+ }, [onSearch, searchControlled, searchValue]);
138
+ const setOpen = React.useCallback((nextOpen) => {
139
+ if (disabled && nextOpen) return;
140
+ if (nextOpen === requestedOpenRef.current) return;
141
+ requestedOpenRef.current = nextOpen;
142
+ if (!openControlled) setInnerOpen(nextOpen);
143
+ onOpenChange?.(nextOpen);
144
+ if (!nextOpen) resetSearchValue();
145
+ }, [disabled, onOpenChange, openControlled, resetSearchValue]);
123
146
  React.useEffect(() => {
124
147
  if (!disabled || openControlled || !innerOpen) return;
125
148
  setInnerOpen(false);
@@ -130,7 +153,7 @@ var SelectInner = (props, forwardedRef) => {
130
153
  placement: "bottom",
131
154
  matchTriggerWidth: !hasCustomPopupWidth,
132
155
  panelWidth: typeof resolvedPopupWidth === "number" ? resolvedPopupWidth : 360,
133
- panelHeight: mergedListHeight + (mergedSearchable ? 58 : 12)
156
+ panelHeight: mergedListHeight + 12
134
157
  });
135
158
  useOverlayLayer({
136
159
  open: open && portalContainer != null,
@@ -172,7 +195,7 @@ var SelectInner = (props, forwardedRef) => {
172
195
  };
173
196
  document.addEventListener("mousedown", h);
174
197
  return () => document.removeEventListener("mousedown", h);
175
- }, [open]);
198
+ }, [menuRef, open, setOpen, triggerRef]);
176
199
  React.useEffect(() => {
177
200
  if (open && mergedSearchable) {
178
201
  requestAnimationFrame(() => searchRef.current?.focus());
@@ -184,14 +207,32 @@ var SelectInner = (props, forwardedRef) => {
184
207
  [options]
185
208
  );
186
209
  const allFlat = React.useMemo(() => flatten(orderedItems), [orderedItems]);
210
+ const optionByValue = React.useMemo(() => {
211
+ const index = /* @__PURE__ */ new Map();
212
+ allFlat.forEach((option) => index.set(option.value, option));
213
+ return index;
214
+ }, [allFlat]);
215
+ const selectedOptionCacheRef = React.useRef(/* @__PURE__ */ new Map());
216
+ React.useEffect(() => {
217
+ selectedValues.forEach((selectedValue) => {
218
+ const option = optionByValue.get(selectedValue);
219
+ if (option) selectedOptionCacheRef.current.set(selectedValue, option);
220
+ });
221
+ }, [optionByValue, selectedValues]);
222
+ const selectedOptions = React.useMemo(
223
+ () => selectedValues.map(
224
+ (selectedValue) => optionByValue.get(selectedValue) ?? selectedOptionCacheRef.current.get(selectedValue)
225
+ ).filter((option) => option !== void 0),
226
+ [optionByValue, selectedValues]
227
+ );
187
228
  const filteredFlat = React.useMemo(() => {
188
- if (!query.trim()) return allFlat;
229
+ if (!searchValue.trim()) return allFlat;
189
230
  if (filterOption === false) return allFlat;
190
231
  const f = typeof filterOption === "function" ? filterOption : (input, option) => defaultFilter(input, option, optionFilterProp);
191
- return allFlat.filter((o) => f(query, o));
192
- }, [allFlat, query, filterOption, optionFilterProp]);
232
+ return allFlat.filter((o) => f(searchValue, o));
233
+ }, [allFlat, filterOption, optionFilterProp, searchValue]);
193
234
  const filteredItems = React.useMemo(() => {
194
- if (!query.trim()) {
235
+ if (!searchValue.trim()) {
195
236
  return orderedItems.filter((item) => !isGroup(item) || item.options.length > 0);
196
237
  }
197
238
  return orderedItems.map((it) => {
@@ -201,7 +242,7 @@ var SelectInner = (props, forwardedRef) => {
201
242
  const kept = it.options.filter((o) => filteredFlat.includes(o));
202
243
  return kept.length ? { ...it, options: kept } : null;
203
244
  }).filter((x) => x !== null);
204
- }, [orderedItems, filteredFlat, query]);
245
+ }, [orderedItems, filteredFlat, searchValue]);
205
246
  React.useEffect(() => {
206
247
  setActiveIdx((current) => {
207
248
  if (current >= 0 && current < filteredFlat.length && !isOptionDisabled(filteredFlat[current])) {
@@ -212,6 +253,7 @@ var SelectInner = (props, forwardedRef) => {
212
253
  }, [filteredFlat, isOptionDisabled]);
213
254
  const pickSingle = (opt) => {
214
255
  if (disabled || isOptionDisabled(opt)) return;
256
+ selectedOptionCacheRef.current.set(opt.value, opt);
215
257
  if (!singleControlled) setInnerSingle(opt.value);
216
258
  props.onChange?.(opt.value);
217
259
  setOpen(false);
@@ -220,8 +262,17 @@ var SelectInner = (props, forwardedRef) => {
220
262
  if (disabled || isOptionDisabled(opt)) return;
221
263
  const cur = multiValue ?? [];
222
264
  const next = cur.includes(opt.value) ? cur.filter((v) => v !== opt.value) : [...cur, opt.value];
265
+ selectedOptionCacheRef.current.set(opt.value, opt);
266
+ if (!multiControlled) setInnerMulti(next);
267
+ props.onChange?.(next);
268
+ if (hasInlineSearch) requestAnimationFrame(() => searchRef.current?.focus());
269
+ };
270
+ const removeMultiValue = (removedValue) => {
271
+ if (disabled) return;
272
+ const next = (multiValue ?? []).filter((value) => value !== removedValue);
223
273
  if (!multiControlled) setInnerMulti(next);
224
274
  props.onChange?.(next);
275
+ if (hasInlineSearch) requestAnimationFrame(() => searchRef.current?.focus());
225
276
  };
226
277
  const clearAll = () => {
227
278
  if (disabled) return;
@@ -237,13 +288,20 @@ var SelectInner = (props, forwardedRef) => {
237
288
  };
238
289
  const isSelected = (val) => isMulti ? (multiValue ?? []).includes(val) : singleValue === val;
239
290
  const onKeyDown = (e) => {
240
- if ((e.key === "Backspace" || e.key === "Delete") && showClear) {
291
+ const fromSearchInput = e.target === searchRef.current;
292
+ if (e.nativeEvent.isComposing || e.keyCode === 229) return;
293
+ if (fromSearchInput && e.key === "Backspace" && !searchValue && isMulti && multiValue.length > 0) {
294
+ e.preventDefault();
295
+ removeMultiValue(multiValue[multiValue.length - 1]);
296
+ return;
297
+ }
298
+ if (!fromSearchInput && (e.key === "Backspace" || e.key === "Delete") && showClear) {
241
299
  e.preventDefault();
242
300
  clearAll();
243
301
  return;
244
302
  }
245
303
  if (!open) {
246
- if (e.key === "Enter" || e.key === " " || e.key === "ArrowDown") {
304
+ if (e.key === "Enter" || !fromSearchInput && e.key === " " || e.key === "ArrowDown") {
247
305
  e.preventDefault();
248
306
  setOpen(true);
249
307
  }
@@ -286,13 +344,47 @@ var SelectInner = (props, forwardedRef) => {
286
344
  return;
287
345
  }
288
346
  };
347
+ const renderInlineSearchInput = () => {
348
+ if (!showsInlineSearchInput) return null;
349
+ const multiHasSelection = isMulti && multiValue.length > 0;
350
+ const searchDisplayWidth = getSearchInputDisplayWidth(searchValue);
351
+ return /* @__PURE__ */ jsx(
352
+ "input",
353
+ {
354
+ ref: searchRef,
355
+ id: fieldId,
356
+ className: `select-search-input ${multiHasSelection ? "with-selection" : "empty"}`,
357
+ type: "search",
358
+ value: searchValue,
359
+ style: multiHasSelection ? { width: `${Math.min(Math.max(searchDisplayWidth + 1, 2), 32)}ch` } : void 0,
360
+ placeholder: isMulti ? multiValue.length === 0 ? placeholder : void 0 : "\u641C\u7D22...",
361
+ disabled,
362
+ autoComplete: "off",
363
+ role: "combobox",
364
+ "aria-autocomplete": "list",
365
+ "aria-label": ariaLabel,
366
+ "aria-labelledby": ariaLabelledBy,
367
+ "aria-invalid": ariaInvalid,
368
+ "aria-required": ariaRequired,
369
+ "aria-describedby": ariaDescribedBy,
370
+ "aria-haspopup": "listbox",
371
+ "aria-expanded": open,
372
+ "aria-controls": open ? listboxId : void 0,
373
+ "aria-activedescendant": open && activeIdx >= 0 ? `${listboxId}-option-${activeIdx}` : void 0,
374
+ onChange: (event) => {
375
+ updateSearchValue(event.target.value);
376
+ if (!open) setOpen(true);
377
+ }
378
+ }
379
+ );
380
+ };
289
381
  const renderTrigger = () => {
290
382
  if (isMulti) {
291
- const selected = (multiValue ?? []).map((v) => allFlat.find((o) => o.value === v)).filter((o) => !!o);
383
+ const selected = selectedOptions;
292
384
  const max = maxTagCount;
293
385
  const shown = max != null ? selected.slice(0, max) : selected;
294
386
  const overflow = selected.length - shown.length;
295
- if (selected.length === 0) {
387
+ if (selected.length === 0 && !hasInlineSearch) {
296
388
  return /* @__PURE__ */ jsx("span", { className: "placeholder", children: placeholder });
297
389
  }
298
390
  return /* @__PURE__ */ jsx(InternalComponentThemePart, { components: "Tag", children: /* @__PURE__ */ jsxs("span", { className: "select-tags", children: [
@@ -301,24 +393,25 @@ var SelectInner = (props, forwardedRef) => {
301
393
  {
302
394
  tone: "accent",
303
395
  removable: !disabled,
304
- onRemove: () => {
305
- const cur = multiValue ?? [];
306
- const next = cur.filter((v) => v !== o.value);
307
- if (!multiControlled) setInnerMulti(next);
308
- props.onChange?.(next);
396
+ onRemove: () => removeMultiValue(o.value),
397
+ onMouseDown: (event) => {
398
+ event.preventDefault();
399
+ event.stopPropagation();
309
400
  },
310
401
  onClick: (e) => e.stopPropagation(),
311
- children: selectedRender?.(o, { value: o.value, multiple: true }) ?? o.label
402
+ children: /* @__PURE__ */ jsx("span", { className: "select-tag-label", children: selectedRender?.(o, { value: o.value, multiple: true }) ?? o.label })
312
403
  },
313
404
  String(o.value)
314
405
  )),
315
- overflow > 0 && /* @__PURE__ */ jsxs(Tag, { tone: "neutral", children: [
406
+ overflow > 0 && /* @__PURE__ */ jsxs(Tag, { className: "select-tag-overflow", tone: "neutral", children: [
316
407
  "+",
317
408
  overflow
318
- ] })
409
+ ] }),
410
+ renderInlineSearchInput()
319
411
  ] }) });
320
412
  }
321
- const current = allFlat.find((o) => o.value === singleValue);
413
+ if (showsInlineSearchInput) return renderInlineSearchInput();
414
+ const current = selectedOptions[0];
322
415
  if (!current) return /* @__PURE__ */ jsx("span", { className: "placeholder", children: placeholder });
323
416
  if (selectedRender) {
324
417
  return /* @__PURE__ */ jsx("span", { className: "select-value select-value-custom", children: selectedRender(current, { value: current.value, multiple: false }) });
@@ -365,6 +458,9 @@ var SelectInner = (props, forwardedRef) => {
365
458
  "aria-label": getOptionAriaLabel(o),
366
459
  disabled: optionDisabled,
367
460
  className: `menu-item ${sel ? "active" : ""} ${active ? "highlight" : ""}`,
461
+ onMouseDown: (event) => {
462
+ if (hasInlineSearch) event.preventDefault();
463
+ },
368
464
  onClick: () => isMulti ? toggleMulti(o) : pickSingle(o),
369
465
  children: [
370
466
  isMulti && /* @__PURE__ */ jsx("span", { className: `menu-check ${sel ? "on" : ""}`, "aria-hidden": true, children: sel && /* @__PURE__ */ jsx(Icon, { name: "check", size: 11, stroke: 3 }) }),
@@ -391,15 +487,32 @@ var SelectInner = (props, forwardedRef) => {
391
487
  item.options.map((option) => renderOption(option, !!item.pinned))
392
488
  ] }, `g-${groupIndex}-${item.pinned ? "pinned" : "regular"}`) : renderOption(item)
393
489
  );
490
+ const handleTriggerClick = (event) => {
491
+ if (disabled) return;
492
+ if (!hasInlineSearch) {
493
+ setOpen(!open);
494
+ return;
495
+ }
496
+ const target = event.target;
497
+ if (target.closest(".select-caret")) {
498
+ setOpen(!open);
499
+ return;
500
+ }
501
+ setOpen(true);
502
+ searchRef.current?.focus();
503
+ };
394
504
  return /* @__PURE__ */ jsxs(
395
505
  "div",
396
506
  {
397
507
  ref: setTriggerRef,
398
508
  ...rest,
399
- className: `select ${size} ${isMulti ? "multi" : ""} ${open ? "open" : ""} ${disabled ? "disabled" : ""} ${invalid ? "invalid" : ""} ${className}`,
509
+ className: `select ${size} ${isMulti ? "multi" : ""} ${hasInlineSearch ? "searchable" : ""} ${open ? "open" : ""} ${disabled ? "disabled" : ""} ${invalid ? "invalid" : ""} ${className}`,
400
510
  onKeyDown: (e) => {
401
511
  onRootKeyDown?.(e);
402
- if (!e.defaultPrevented && e.target.classList.contains("select-trigger")) onKeyDown(e);
512
+ const target = e.target;
513
+ if (!e.defaultPrevented && (target.classList.contains("select-trigger") || target === searchRef.current)) {
514
+ onKeyDown(e);
515
+ }
403
516
  },
404
517
  onBlur: (event) => {
405
518
  onRootBlur?.(event);
@@ -424,20 +537,20 @@ var SelectInner = (props, forwardedRef) => {
424
537
  "div",
425
538
  {
426
539
  className: "select-trigger",
427
- onClick: () => !disabled && setOpen(!open),
428
- tabIndex: disabled ? -1 : triggerTabIndex ?? 0,
429
- id: fieldId,
430
- role: "combobox",
431
- "aria-disabled": disabled || void 0,
432
- "aria-label": ariaLabel,
433
- "aria-labelledby": ariaLabelledBy,
434
- "aria-invalid": ariaInvalid,
435
- "aria-required": ariaRequired,
436
- "aria-describedby": ariaDescribedBy,
437
- "aria-haspopup": "listbox",
438
- "aria-expanded": open,
439
- "aria-controls": open ? listboxId : void 0,
440
- "aria-activedescendant": open && activeIdx >= 0 ? `${listboxId}-option-${activeIdx}` : void 0,
540
+ onClick: handleTriggerClick,
541
+ tabIndex: showsInlineSearchInput || disabled ? -1 : triggerTabIndex ?? 0,
542
+ id: showsInlineSearchInput ? void 0 : fieldId,
543
+ role: showsInlineSearchInput ? void 0 : "combobox",
544
+ "aria-disabled": showsInlineSearchInput ? void 0 : disabled || void 0,
545
+ "aria-label": showsInlineSearchInput ? void 0 : ariaLabel,
546
+ "aria-labelledby": showsInlineSearchInput ? void 0 : ariaLabelledBy,
547
+ "aria-invalid": showsInlineSearchInput ? void 0 : ariaInvalid,
548
+ "aria-required": showsInlineSearchInput ? void 0 : ariaRequired,
549
+ "aria-describedby": showsInlineSearchInput ? void 0 : ariaDescribedBy,
550
+ "aria-haspopup": showsInlineSearchInput ? void 0 : "listbox",
551
+ "aria-expanded": showsInlineSearchInput ? void 0 : open,
552
+ "aria-controls": showsInlineSearchInput ? void 0 : open ? listboxId : void 0,
553
+ "aria-activedescendant": showsInlineSearchInput ? void 0 : open && activeIdx >= 0 ? `${listboxId}-option-${activeIdx}` : void 0,
441
554
  children: [
442
555
  renderTrigger(),
443
556
  /* @__PURE__ */ jsx(Icon, { name: "chevDown", size: 14, className: "select-caret" })
@@ -451,7 +564,10 @@ var SelectInner = (props, forwardedRef) => {
451
564
  className: "select-clear",
452
565
  "aria-label": "Clear",
453
566
  onPointerDown: (event) => event.stopPropagation(),
454
- onMouseDown: (event) => event.stopPropagation(),
567
+ onMouseDown: (event) => {
568
+ if (hasInlineSearch) event.preventDefault();
569
+ event.stopPropagation();
570
+ },
455
571
  onClick: (event) => {
456
572
  event.stopPropagation();
457
573
  clearAll();
@@ -460,7 +576,7 @@ var SelectInner = (props, forwardedRef) => {
460
576
  }
461
577
  ),
462
578
  open && portalContainer && createPortal(
463
- /* @__PURE__ */ jsxs(
579
+ /* @__PURE__ */ jsx(
464
580
  "div",
465
581
  {
466
582
  ref: menuRef,
@@ -475,44 +591,20 @@ var SelectInner = (props, forwardedRef) => {
475
591
  ...portalTheme.styles.popup,
476
592
  ...popupStyle
477
593
  },
478
- children: [
479
- mergedSearchable && /* @__PURE__ */ jsx("div", { className: "menu-search", children: /* @__PURE__ */ jsx(InternalComponentThemePart, { components: "Input", children: /* @__PURE__ */ jsx(
480
- Input,
481
- {
482
- ref: searchRef,
483
- size: "sm",
484
- leadingIcon: "search",
485
- value: query,
486
- placeholder: "\u641C\u7D22...",
487
- role: "combobox",
488
- "aria-autocomplete": "list",
489
- "aria-expanded": open,
490
- "aria-controls": listboxId,
491
- "aria-activedescendant": activeIdx >= 0 ? `${listboxId}-option-${activeIdx}` : void 0,
492
- onValueChange: setQuery,
493
- onKeyDown: (e) => {
494
- if (e.key === "Escape" || e.key === "ArrowDown" || e.key === "ArrowUp" || e.key === "Enter") {
495
- e.preventDefault();
496
- onKeyDown(e);
497
- }
498
- }
499
- }
500
- ) }) }),
501
- /* @__PURE__ */ jsx(
502
- "div",
503
- {
504
- className: "menu-options",
505
- style: { maxHeight: mergedListHeight },
506
- children: loading ? /* @__PURE__ */ jsxs("div", { className: "menu-state", children: [
507
- /* @__PURE__ */ jsx("span", { className: "menu-state-ico", children: /* @__PURE__ */ jsx("span", { className: "spinner" }) }),
508
- /* @__PURE__ */ jsx("span", { children: "\u52A0\u8F7D\u4E2D..." })
509
- ] }) : filteredFlat.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "menu-state", children: [
510
- /* @__PURE__ */ jsx("span", { className: "menu-state-ico", children: /* @__PURE__ */ jsx(Icon, { name: "search", size: 16 }) }),
511
- /* @__PURE__ */ jsx("span", { children: emptyContent ?? "\u6682\u65E0\u5339\u914D\u9879" })
512
- ] }) : renderMenuItems(filteredItems)
513
- }
514
- )
515
- ]
594
+ children: /* @__PURE__ */ jsx(
595
+ "div",
596
+ {
597
+ className: "menu-options",
598
+ style: { maxHeight: mergedListHeight },
599
+ children: loading ? /* @__PURE__ */ jsxs("div", { className: "menu-state", children: [
600
+ /* @__PURE__ */ jsx("span", { className: "menu-state-ico", children: /* @__PURE__ */ jsx("span", { className: "spinner" }) }),
601
+ /* @__PURE__ */ jsx("span", { children: "\u52A0\u8F7D\u4E2D..." })
602
+ ] }) : filteredFlat.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "menu-state", children: [
603
+ /* @__PURE__ */ jsx("span", { className: "menu-state-ico", children: /* @__PURE__ */ jsx(Icon, { name: "search", size: 16 }) }),
604
+ /* @__PURE__ */ jsx("span", { children: emptyContent ?? "\u6682\u65E0\u5339\u914D\u9879" })
605
+ ] }) : renderMenuItems(filteredItems)
606
+ }
607
+ )
516
608
  }
517
609
  ),
518
610
  portalContainer
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkK3KHQ77L_cjs = require('./chunk-K3KHQ77L.cjs');
3
+ var chunkCDT2QCBL_cjs = require('./chunk-CDT2QCBL.cjs');
4
4
  var chunkGFGMGJ5A_cjs = require('./chunk-GFGMGJ5A.cjs');
5
5
  var chunkVDVKY2IX_cjs = require('./chunk-VDVKY2IX.cjs');
6
6
  var chunkV6BLBIY6_cjs = require('./chunk-V6BLBIY6.cjs');
@@ -137,7 +137,7 @@ var PaginationBase = React__namespace.forwardRef(({
137
137
  }
138
138
  ),
139
139
  showSizeChanger && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pg-size-changer", children: /* @__PURE__ */ jsxRuntime.jsx(
140
- chunkK3KHQ77L_cjs.Select,
140
+ chunkCDT2QCBL_cjs.Select,
141
141
  {
142
142
  value: normalizedPageSize,
143
143
  size: "sm",
@@ -1,4 +1,4 @@
1
- import { Pagination } from './chunk-UCE53RYR.js';
1
+ import { Pagination } from './chunk-LZXJN3XA.js';
2
2
  import { Checkbox } from './chunk-QSLXUNLM.js';
3
3
  import { useFloating } from './chunk-3QXP2ZNP.js';
4
4
  import { useOverlayLayer } from './chunk-2A4GYSN4.js';
@@ -1,4 +1,4 @@
1
- import { Table } from './chunk-JMYUO7V7.js';
1
+ import { Table } from './chunk-RM6JIM6O.js';
2
2
  import { withComponentTheme, InternalComponentThemePart } from './chunk-5HLNFDV4.js';
3
3
  import './tokens-223RYVVS.css';
4
4
  import './shared-NJHRNLRH.css';
package/dist/index.cjs CHANGED
@@ -3,8 +3,8 @@
3
3
  var chunkRXITGNPX_cjs = require('./chunk-RXITGNPX.cjs');
4
4
  var chunkXHKSUKKL_cjs = require('./chunk-XHKSUKKL.cjs');
5
5
  var chunk3D5RJA7R_cjs = require('./chunk-3D5RJA7R.cjs');
6
- var chunkHMN65CDW_cjs = require('./chunk-HMN65CDW.cjs');
7
- var chunk7KA5D37Z_cjs = require('./chunk-7KA5D37Z.cjs');
6
+ var chunkIDEE7PP5_cjs = require('./chunk-IDEE7PP5.cjs');
7
+ var chunkMJYMPK5K_cjs = require('./chunk-MJYMPK5K.cjs');
8
8
  var chunkAEY76EAH_cjs = require('./chunk-AEY76EAH.cjs');
9
9
  require('./chunk-HYJSMFZA.cjs');
10
10
  var chunkAQN3PD24_cjs = require('./chunk-AQN3PD24.cjs');
@@ -20,8 +20,8 @@ var chunk6WEXRX7K_cjs = require('./chunk-6WEXRX7K.cjs');
20
20
  var chunkZ6AG7O4B_cjs = require('./chunk-Z6AG7O4B.cjs');
21
21
  var chunkTPFY5SKB_cjs = require('./chunk-TPFY5SKB.cjs');
22
22
  var chunkSOAGRYM3_cjs = require('./chunk-SOAGRYM3.cjs');
23
- var chunkVTN6YLRJ_cjs = require('./chunk-VTN6YLRJ.cjs');
24
- var chunkK3KHQ77L_cjs = require('./chunk-K3KHQ77L.cjs');
23
+ var chunkQZ2AAQBX_cjs = require('./chunk-QZ2AAQBX.cjs');
24
+ var chunkCDT2QCBL_cjs = require('./chunk-CDT2QCBL.cjs');
25
25
  var chunkVNP5WB6M_cjs = require('./chunk-VNP5WB6M.cjs');
26
26
  var chunk3J7HOTD6_cjs = require('./chunk-3J7HOTD6.cjs');
27
27
  var chunkPYCAGTO7_cjs = require('./chunk-PYCAGTO7.cjs');
@@ -58,7 +58,7 @@ require('./chunk-V6BLBIY6.cjs');
58
58
  var chunkI4GJZLJU_cjs = require('./chunk-I4GJZLJU.cjs');
59
59
 
60
60
  // src/index.ts
61
- var VERSION = "0.9.1";
61
+ var VERSION = "0.9.2";
62
62
 
63
63
  Object.defineProperty(exports, "Timeline", {
64
64
  enumerable: true,
@@ -90,11 +90,11 @@ Object.defineProperty(exports, "Typography", {
90
90
  });
91
91
  Object.defineProperty(exports, "TablePro", {
92
92
  enumerable: true,
93
- get: function () { return chunkHMN65CDW_cjs.TablePro; }
93
+ get: function () { return chunkIDEE7PP5_cjs.TablePro; }
94
94
  });
95
95
  Object.defineProperty(exports, "Table", {
96
96
  enumerable: true,
97
- get: function () { return chunk7KA5D37Z_cjs.Table; }
97
+ get: function () { return chunkMJYMPK5K_cjs.Table; }
98
98
  });
99
99
  Object.defineProperty(exports, "Tabs", {
100
100
  enumerable: true,
@@ -190,11 +190,11 @@ Object.defineProperty(exports, "Modal", {
190
190
  });
191
191
  Object.defineProperty(exports, "Pagination", {
192
192
  enumerable: true,
193
- get: function () { return chunkVTN6YLRJ_cjs.Pagination; }
193
+ get: function () { return chunkQZ2AAQBX_cjs.Pagination; }
194
194
  });
195
195
  Object.defineProperty(exports, "Select", {
196
196
  enumerable: true,
197
- get: function () { return chunkK3KHQ77L_cjs.Select; }
197
+ get: function () { return chunkCDT2QCBL_cjs.Select; }
198
198
  });
199
199
  Object.defineProperty(exports, "Tag", {
200
200
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -54,6 +54,6 @@ import 'react/jsx-runtime';
54
54
  import 'react';
55
55
 
56
56
  /** Package version — bumped by release scripts. */
57
- declare const VERSION = "0.9.1";
57
+ declare const VERSION = "0.9.2";
58
58
 
59
59
  export { VERSION };
package/dist/index.d.ts CHANGED
@@ -54,6 +54,6 @@ import 'react/jsx-runtime';
54
54
  import 'react';
55
55
 
56
56
  /** Package version — bumped by release scripts. */
57
- declare const VERSION = "0.9.1";
57
+ declare const VERSION = "0.9.2";
58
58
 
59
59
  export { VERSION };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export { Timeline } from './chunk-U7V2FOIM.js';
2
2
  export { Tooltip } from './chunk-TALNKJQ2.js';
3
3
  export { Link, Paragraph, Text, Title, Typography } from './chunk-2COQYOVG.js';
4
- export { TablePro } from './chunk-2NECDEAJ.js';
5
- export { Table } from './chunk-JMYUO7V7.js';
4
+ export { TablePro } from './chunk-U3T6RC6U.js';
5
+ export { Table } from './chunk-RM6JIM6O.js';
6
6
  export { Tabs } from './chunk-4JANYBXO.js';
7
7
  import './chunk-EE7IJ3MB.js';
8
8
  export { THEME_PANEL_DEFAULT_PRESET_OPTIONS, THEME_PANEL_DEFAULT_THEME_PRESETS, ThemePanel } from './chunk-IU6PLLEL.js';
@@ -18,8 +18,8 @@ export { InputNumber } from './chunk-RYF5ADJW.js';
18
18
  export { List } from './chunk-LACXN5CI.js';
19
19
  export { MessageContainer, ToastContainer, message, toast } from './chunk-2V6RQQRI.js';
20
20
  export { Modal } from './chunk-RJCPXAZ3.js';
21
- export { Pagination } from './chunk-UCE53RYR.js';
22
- export { Select } from './chunk-AL2PYVVP.js';
21
+ export { Pagination } from './chunk-LZXJN3XA.js';
22
+ export { Select } from './chunk-MSWWABXP.js';
23
23
  export { Tag } from './chunk-OGMI3TO5.js';
24
24
  export { Popover } from './chunk-A34P5CU7.js';
25
25
  export { Progress } from './chunk-BOBT7JUB.js';
@@ -56,6 +56,6 @@ import './chunk-5HLNFDV4.js';
56
56
  export { ACCENT_PRESETS, ACCENT_PRESETS_DARK, DEFAULT_THEME_COLORS, FONT_STACKS, ThemeProvider, applyTheme, componentTokensToStyle, deriveThemeColors, normalizeAccentInput, resolveThemeColorScheme, resolveThemeColors, resolveThemeMode, resolveVisualThemeSnapshot, themeColorsToStyle, themeTokenToKebabCase, useTheme, useThemeOptional, visualThemeToStyle } from './chunk-CPVUDSIY.js';
57
57
 
58
58
  // src/index.ts
59
- var VERSION = "0.9.1";
59
+ var VERSION = "0.9.2";
60
60
 
61
61
  export { VERSION };
package/dist/styles.css CHANGED
@@ -1689,19 +1689,71 @@ button.collapse-chev {
1689
1689
  flex: 1;
1690
1690
  min-width: 0;
1691
1691
  align-items: center;
1692
+ width: 100%;
1692
1693
  }
1693
1694
  .select.multi .select-trigger > .placeholder {
1694
1695
  padding-left: 6px;
1695
1696
  line-height: calc(var(--ctrl-h) - 8px);
1696
1697
  }
1697
1698
  .select.multi .select-tags > .tag {
1698
- max-width: 160px;
1699
+ max-width: min(160px, 100%);
1700
+ min-width: 0;
1701
+ flex-shrink: 1;
1699
1702
  }
1700
- .select.multi .select-tags > .tag > span:not(.dot):not(.x) {
1703
+ .select.multi .select-tag-label {
1704
+ display: block;
1705
+ min-width: 0;
1701
1706
  white-space: nowrap;
1702
1707
  overflow: hidden;
1703
1708
  text-overflow: ellipsis;
1704
1709
  }
1710
+ .select.multi .select-tag-label > * {
1711
+ min-width: 0;
1712
+ max-width: 100%;
1713
+ }
1714
+ .select.multi .select-tag-overflow {
1715
+ flex-shrink: 0;
1716
+ }
1717
+ .select.multi.searchable .select-trigger {
1718
+ cursor: text;
1719
+ }
1720
+ .select-search-input {
1721
+ min-width: 0;
1722
+ height: 24px;
1723
+ padding: 0 2px;
1724
+ border: 0;
1725
+ outline: 0;
1726
+ appearance: none;
1727
+ background: transparent;
1728
+ color: var(--lmn-select-fg, var(--fg));
1729
+ font: inherit;
1730
+ line-height: 24px;
1731
+ }
1732
+ .select-search-input.empty {
1733
+ flex: 1 1 auto;
1734
+ width: 100%;
1735
+ }
1736
+ .select-search-input.with-selection {
1737
+ flex: 0 1 auto;
1738
+ min-width: 2ch;
1739
+ max-width: 100%;
1740
+ field-sizing: content;
1741
+ }
1742
+ .select-search-input::placeholder {
1743
+ color: var(--lmn-select-fg-subtle, var(--fg-subtle));
1744
+ }
1745
+ .select-search-input::-webkit-search-cancel-button {
1746
+ appearance: none;
1747
+ }
1748
+ .select-search-input:focus-visible {
1749
+ box-shadow: none;
1750
+ }
1751
+ .select.searchable:focus-within .select-trigger {
1752
+ box-shadow: var(--lmn-select-neu-shadow-inset, var(--neu-shadow-inset)), 0 0 0 3px var(--lmn-select-accent-glow, var(--accent-glow));
1753
+ }
1754
+ .select.multi.searchable .select-caret {
1755
+ cursor: pointer;
1756
+ }
1705
1757
  .select-clear {
1706
1758
  position: absolute;
1707
1759
  right: 30px;
@@ -1742,14 +1794,6 @@ button.collapse-chev {
1742
1794
  background: var(--lmn-select-accent, var(--accent));
1743
1795
  box-shadow: var(--lmn-select-neu-shadow-control, var(--neu-shadow-control)), 0 1px 4px var(--lmn-select-accent-glow, var(--accent-glow));
1744
1796
  }
1745
- /* Menu search — flush with menu, single subtle separator (no nested frame) */
1746
- .menu-search {
1747
- display: block;
1748
- padding: 4px 2px 8px;
1749
- margin: -2px -2px 4px;
1750
- border-bottom: 1px solid var(--lmn-select-divider, var(--divider));
1751
- }
1752
- .menu-search .input-wrap { width: 100%; }
1753
1797
  /* Menu state (loading / empty) */
1754
1798
  .menu-state {
1755
1799
  display: flex;