@rufous/ui 0.3.21 → 0.3.22

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/dist/main.cjs CHANGED
@@ -9088,6 +9088,14 @@ function getTopLevelSelected(nodes, selected) {
9088
9088
  }
9089
9089
  return result;
9090
9090
  }
9091
+ function getAllSelected(nodes, selected) {
9092
+ const result = [];
9093
+ for (const node of nodes) {
9094
+ if (selected.has(String(node.id))) result.push(node);
9095
+ if (node.children?.length) result.push(...getAllSelected(node.children, selected));
9096
+ }
9097
+ return result;
9098
+ }
9091
9099
  function filterTree(nodes, query) {
9092
9100
  if (!query) return nodes;
9093
9101
  const q = query.toLowerCase();
@@ -9116,6 +9124,7 @@ function TreeNodeItem({
9116
9124
  selected,
9117
9125
  expanded,
9118
9126
  selectionMode,
9127
+ allowChildSelection,
9119
9128
  onToggleExpand,
9120
9129
  onSelect,
9121
9130
  isFiltering
@@ -9123,7 +9132,7 @@ function TreeNodeItem({
9123
9132
  const nodeId = String(node.id);
9124
9133
  const hasChildren = !!node.children?.length;
9125
9134
  const isExpanded = isFiltering || expanded.has(nodeId);
9126
- const state = getNodeState(node, selected);
9135
+ const state = allowChildSelection ? getNodeState(node, selected) : selected.has(nodeId) ? "checked" : "unchecked";
9127
9136
  return /* @__PURE__ */ import_react49.default.createElement("div", { className: "rf-tsn" }, /* @__PURE__ */ import_react49.default.createElement(
9128
9137
  "div",
9129
9138
  {
@@ -9143,16 +9152,8 @@ function TreeNodeItem({
9143
9152
  },
9144
9153
  isExpanded ? /* @__PURE__ */ import_react49.default.createElement(import_lucide_react3.ChevronDown, { size: 14 }) : /* @__PURE__ */ import_react49.default.createElement(import_lucide_react3.ChevronRight, { size: 14 })
9145
9154
  ) : /* @__PURE__ */ import_react49.default.createElement("span", { className: "rf-tsn__expand-ph" }),
9146
- selectionMode === "multiple" && /* @__PURE__ */ import_react49.default.createElement(
9147
- "span",
9148
- {
9149
- className: `rf-tsn__cb${state === "checked" ? " rf-tsn__cb--checked" : state === "partial" ? " rf-tsn__cb--partial" : ""}`
9150
- },
9151
- state === "checked" && /* @__PURE__ */ import_react49.default.createElement(import_lucide_react3.Check, { size: 10, strokeWidth: 3 }),
9152
- state === "partial" && /* @__PURE__ */ import_react49.default.createElement("span", { className: "rf-tsn__cb-dash" })
9153
- ),
9154
- selectionMode === "single" && /* @__PURE__ */ import_react49.default.createElement("span", { className: `rf-tsn__radio${state === "checked" ? " rf-tsn__radio--checked" : ""}` }),
9155
- /* @__PURE__ */ import_react49.default.createElement("span", { className: "rf-tsn__label" }, node.label)
9155
+ /* @__PURE__ */ import_react49.default.createElement("span", { className: "rf-tsn__label" }, node.label),
9156
+ /* @__PURE__ */ import_react49.default.createElement("span", { className: "rf-tsn__check", "aria-hidden": "true" }, state === "partial" ? /* @__PURE__ */ import_react49.default.createElement(import_lucide_react3.Minus, { size: 13, strokeWidth: 2.5 }) : /* @__PURE__ */ import_react49.default.createElement(import_lucide_react3.Check, { size: 13, strokeWidth: 2.5 }))
9156
9157
  ), hasChildren && isExpanded && /* @__PURE__ */ import_react49.default.createElement("div", null, node.children.map((child) => /* @__PURE__ */ import_react49.default.createElement(
9157
9158
  TreeNodeItem,
9158
9159
  {
@@ -9162,6 +9163,7 @@ function TreeNodeItem({
9162
9163
  selected,
9163
9164
  expanded,
9164
9165
  selectionMode,
9166
+ allowChildSelection,
9165
9167
  onToggleExpand,
9166
9168
  onSelect,
9167
9169
  isFiltering
@@ -9175,6 +9177,7 @@ function TreeSelect({
9175
9177
  onNodeSelect,
9176
9178
  onNodeUnselect,
9177
9179
  selectionMode = "single",
9180
+ allowChildSelection = false,
9178
9181
  placeholder = "Select",
9179
9182
  filter = false,
9180
9183
  filterInputAutoFocus = false,
@@ -9295,15 +9298,25 @@ function TreeSelect({
9295
9298
  const handleSelect = (node) => {
9296
9299
  const nodeId = String(node.id);
9297
9300
  if (isMultiple) {
9298
- const state = getNodeState(node, selectedSet);
9299
- const descendants = collectDescendants(node);
9300
9301
  const newSet = new Set(selectedSet);
9301
- if (state === "checked" || state === "partial") {
9302
- descendants.forEach((id) => newSet.delete(id));
9303
- onNodeUnselect?.({ node });
9302
+ if (allowChildSelection) {
9303
+ const state = getNodeState(node, selectedSet);
9304
+ const descendants = collectDescendants(node);
9305
+ if (state === "checked" || state === "partial") {
9306
+ descendants.forEach((id) => newSet.delete(id));
9307
+ onNodeUnselect?.({ node });
9308
+ } else {
9309
+ descendants.forEach((id) => newSet.add(id));
9310
+ onNodeSelect?.({ node });
9311
+ }
9304
9312
  } else {
9305
- descendants.forEach((id) => newSet.add(id));
9306
- onNodeSelect?.({ node });
9313
+ if (newSet.has(nodeId)) {
9314
+ newSet.delete(nodeId);
9315
+ onNodeUnselect?.({ node });
9316
+ } else {
9317
+ newSet.add(nodeId);
9318
+ onNodeSelect?.({ node });
9319
+ }
9307
9320
  }
9308
9321
  onChange?.({ value: setToRecord(newSet) });
9309
9322
  } else {
@@ -9336,7 +9349,7 @@ function TreeSelect({
9336
9349
  onNodeUnselect?.({ node });
9337
9350
  };
9338
9351
  const filteredTree = filterTree(options, filterQuery);
9339
- const tagNodes = isMultiple ? getTopLevelSelected(options, selectedSet) : value != null ? findNodeById(options, String(value)) ? [findNodeById(options, String(value))] : [] : [];
9352
+ const tagNodes = isMultiple ? allowChildSelection ? getTopLevelSelected(options, selectedSet) : getAllSelected(options, selectedSet) : value != null ? findNodeById(options, String(value)) ? [findNodeById(options, String(value))] : [] : [];
9340
9353
  const hasValue = tagNodes.length > 0;
9341
9354
  const isFloating = open || hasValue || focused;
9342
9355
  const rootClasses = [
@@ -9434,6 +9447,7 @@ function TreeSelect({
9434
9447
  selected: selectedSet,
9435
9448
  expanded: expandedKeys,
9436
9449
  selectionMode,
9450
+ allowChildSelection,
9437
9451
  onToggleExpand: handleToggleExpand,
9438
9452
  onSelect: handleSelect,
9439
9453
  isFiltering: !!filterQuery
@@ -9704,34 +9718,28 @@ function SmartSelect({
9704
9718
  {
9705
9719
  key,
9706
9720
  ...rest,
9707
- className: muiClass,
9721
+ className: [
9722
+ muiClass,
9723
+ "rf-select__option",
9724
+ isSelected ? "rf-select__option--selected" : ""
9725
+ ].filter(Boolean).join(" "),
9708
9726
  style: {
9709
9727
  ...muiStyle,
9710
- display: "flex",
9711
- alignItems: "center",
9712
- gap: 10,
9713
- padding: "8px 16px",
9714
9728
  paddingLeft: 16 + depth * 20,
9715
- fontSize: "0.9rem",
9716
- color: "rgba(0,0,0,0.87)",
9717
- cursor: "pointer",
9718
- userSelect: "none",
9719
- minHeight: 40,
9720
- boxSizing: "border-box",
9721
- fontWeight: isSelected ? 500 : void 0,
9722
- backgroundColor: isSelected ? "rgba(164,27,6,0.08)" : void 0,
9723
- listStyle: "none"
9729
+ listStyle: "none",
9730
+ alignItems: subLabel ? "flex-start" : void 0
9724
9731
  }
9725
9732
  },
9726
- /* @__PURE__ */ import_react51.default.createElement("span", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" } }, /* @__PURE__ */ import_react51.default.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.3 } }, getOptionLabel(option)), subLabel && /* @__PURE__ */ import_react51.default.createElement("span", { style: { fontSize: "0.75rem", color: "var(--text-secondary)", lineHeight: 1.3, marginTop: 1 } }, subLabel)),
9727
- /* @__PURE__ */ import_react51.default.createElement("span", { style: {
9728
- color: "var(--primary-color, #a41b06)",
9729
- flexShrink: 0,
9730
- display: "flex",
9731
- alignItems: "center",
9732
- opacity: isSelected ? 1 : 0,
9733
- transition: "opacity 0.1s"
9734
- } }, /* @__PURE__ */ import_react51.default.createElement(CheckIcon3, null))
9733
+ /* @__PURE__ */ import_react51.default.createElement(
9734
+ "span",
9735
+ {
9736
+ className: "rf-select__option-label",
9737
+ style: subLabel ? { display: "flex", flexDirection: "column", whiteSpace: "normal" } : void 0
9738
+ },
9739
+ /* @__PURE__ */ import_react51.default.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.3 } }, getOptionLabel(option)),
9740
+ subLabel && /* @__PURE__ */ import_react51.default.createElement("span", { style: { fontSize: "0.75rem", color: "var(--text-secondary)", lineHeight: 1.3, marginTop: 1 } }, subLabel)
9741
+ ),
9742
+ /* @__PURE__ */ import_react51.default.createElement("span", { className: "rf-select__option-check", "aria-hidden": "true" }, /* @__PURE__ */ import_react51.default.createElement(CheckIcon3, null))
9735
9743
  );
9736
9744
  }, [depthMap, getValue, getOptionLabel, getOptionSubLabel, selectedKeys]);
9737
9745
  const computedFilterOptions = (0, import_react51.useCallback)((opts, inputValue) => {
package/dist/main.css CHANGED
@@ -1370,6 +1370,12 @@ pre {
1370
1370
  .rf-tsn__row:hover {
1371
1371
  background: rgba(241, 91, 36, 0.06);
1372
1372
  }
1373
+ .rf-tsn__row--active {
1374
+ background: rgba(164, 27, 6, 0.08);
1375
+ }
1376
+ .rf-tsn__row--active:hover {
1377
+ background: rgba(164, 27, 6, 0.12);
1378
+ }
1373
1379
  .rf-tsn__row--active .rf-tsn__label {
1374
1380
  color: rgba(0, 0, 0, 0.87);
1375
1381
  font-weight: 500;
@@ -1397,56 +1403,17 @@ pre {
1397
1403
  flex-shrink: 0;
1398
1404
  display: inline-block;
1399
1405
  }
1400
- .rf-tsn__cb {
1401
- width: 16px;
1402
- height: 16px;
1403
- border: 2px solid var(--border-color);
1404
- border-radius: 4px;
1406
+ .rf-tsn__check {
1407
+ color: var(--primary-color, #a41b06);
1408
+ flex-shrink: 0;
1405
1409
  display: flex;
1406
1410
  align-items: center;
1407
- justify-content: center;
1408
- flex-shrink: 0;
1409
- transition: border-color 0.15s, background 0.15s;
1410
- background: var(--surface-color);
1411
- color: transparent;
1412
- }
1413
- .rf-tsn__cb--checked {
1414
- background: var(--primary-color);
1415
- border-color: var(--primary-color);
1416
- color: #fff;
1417
- }
1418
- .rf-tsn__cb--partial {
1419
- border-color: var(--primary-color);
1420
- }
1421
- .rf-tsn__cb-dash {
1422
- display: block;
1423
- width: 8px;
1424
- height: 2px;
1425
- background: var(--primary-color);
1426
- border-radius: 1px;
1427
- }
1428
- .rf-tsn__radio {
1429
- width: 16px;
1430
- height: 16px;
1431
- border: 2px solid var(--border-color);
1432
- border-radius: 50%;
1433
- flex-shrink: 0;
1434
- transition: border-color 0.15s;
1435
- position: relative;
1436
- }
1437
- .rf-tsn__radio--checked {
1438
- border-color: var(--primary-color);
1411
+ margin-left: auto;
1412
+ opacity: 0;
1413
+ transition: opacity 0.1s;
1439
1414
  }
1440
- .rf-tsn__radio--checked::after {
1441
- content: "";
1442
- position: absolute;
1443
- top: 50%;
1444
- left: 50%;
1445
- transform: translate(-50%, -50%);
1446
- width: 8px;
1447
- height: 8px;
1448
- background: var(--primary-color);
1449
- border-radius: 50%;
1415
+ .rf-tsn__row--active .rf-tsn__check {
1416
+ opacity: 1;
1450
1417
  }
1451
1418
  .rf-tsn__label {
1452
1419
  font-size: 0.875rem;
package/dist/main.d.cts CHANGED
@@ -1830,7 +1830,13 @@ interface TreeSelectProps {
1830
1830
  filterInputAutoFocus?: boolean;
1831
1831
  /** Clear filter text when the dropdown closes */
1832
1832
  resetFilterOnHide?: boolean;
1833
- /** PrimeReact compat — accepted but not used (checkboxes handle multi-select) */
1833
+ /**
1834
+ * When **true**, selecting a parent selects all its descendants and vice-versa (cascade).
1835
+ * When **false** (default), every node is selected/deselected independently — no cascade.
1836
+ * Only relevant in `multiple` mode.
1837
+ */
1838
+ allowChildSelection?: boolean;
1839
+ /** PrimeReact compat — accepted but not used */
1834
1840
  metaKeySelection?: boolean;
1835
1841
  /** Disable the whole control */
1836
1842
  disabled?: boolean;
@@ -1854,7 +1860,7 @@ interface TreeSelectProps {
1854
1860
  className?: string;
1855
1861
  sx?: SxProp;
1856
1862
  }
1857
- declare function TreeSelect({ options, value, onChange, onNodeSelect, onNodeUnselect, selectionMode, placeholder, filter, filterInputAutoFocus, resetFilterOnHide, metaKeySelection: _metaKeySelection, disabled, label, variant, size, error, helperText, fullWidth, clearable, required, style, className, sx, }: TreeSelectProps): React__default.JSX.Element;
1863
+ declare function TreeSelect({ options, value, onChange, onNodeSelect, onNodeUnselect, selectionMode, allowChildSelection, placeholder, filter, filterInputAutoFocus, resetFilterOnHide, metaKeySelection: _metaKeySelection, disabled, label, variant, size, error, helperText, fullWidth, clearable, required, style, className, sx, }: TreeSelectProps): React__default.JSX.Element;
1858
1864
 
1859
1865
  interface UserOption {
1860
1866
  id?: string | number;
package/dist/main.d.ts CHANGED
@@ -1830,7 +1830,13 @@ interface TreeSelectProps {
1830
1830
  filterInputAutoFocus?: boolean;
1831
1831
  /** Clear filter text when the dropdown closes */
1832
1832
  resetFilterOnHide?: boolean;
1833
- /** PrimeReact compat — accepted but not used (checkboxes handle multi-select) */
1833
+ /**
1834
+ * When **true**, selecting a parent selects all its descendants and vice-versa (cascade).
1835
+ * When **false** (default), every node is selected/deselected independently — no cascade.
1836
+ * Only relevant in `multiple` mode.
1837
+ */
1838
+ allowChildSelection?: boolean;
1839
+ /** PrimeReact compat — accepted but not used */
1834
1840
  metaKeySelection?: boolean;
1835
1841
  /** Disable the whole control */
1836
1842
  disabled?: boolean;
@@ -1854,7 +1860,7 @@ interface TreeSelectProps {
1854
1860
  className?: string;
1855
1861
  sx?: SxProp;
1856
1862
  }
1857
- declare function TreeSelect({ options, value, onChange, onNodeSelect, onNodeUnselect, selectionMode, placeholder, filter, filterInputAutoFocus, resetFilterOnHide, metaKeySelection: _metaKeySelection, disabled, label, variant, size, error, helperText, fullWidth, clearable, required, style, className, sx, }: TreeSelectProps): React__default.JSX.Element;
1863
+ declare function TreeSelect({ options, value, onChange, onNodeSelect, onNodeUnselect, selectionMode, allowChildSelection, placeholder, filter, filterInputAutoFocus, resetFilterOnHide, metaKeySelection: _metaKeySelection, disabled, label, variant, size, error, helperText, fullWidth, clearable, required, style, className, sx, }: TreeSelectProps): React__default.JSX.Element;
1858
1864
 
1859
1865
  interface UserOption {
1860
1866
  id?: string | number;
package/dist/main.js CHANGED
@@ -8978,7 +8978,7 @@ import React106, {
8978
8978
  useCallback as useCallback10
8979
8979
  } from "react";
8980
8980
  import ReactDOM10 from "react-dom";
8981
- import { ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, X as X3, Search as Search2, Check } from "lucide-react";
8981
+ import { ChevronDown as ChevronDown2, ChevronRight as ChevronRight2, X as X3, Search as Search2, Check, Minus } from "lucide-react";
8982
8982
  function collectDescendants(node) {
8983
8983
  const ids = [String(node.id)];
8984
8984
  node.children?.forEach((c) => ids.push(...collectDescendants(c)));
@@ -9012,6 +9012,14 @@ function getTopLevelSelected(nodes, selected) {
9012
9012
  }
9013
9013
  return result;
9014
9014
  }
9015
+ function getAllSelected(nodes, selected) {
9016
+ const result = [];
9017
+ for (const node of nodes) {
9018
+ if (selected.has(String(node.id))) result.push(node);
9019
+ if (node.children?.length) result.push(...getAllSelected(node.children, selected));
9020
+ }
9021
+ return result;
9022
+ }
9015
9023
  function filterTree(nodes, query) {
9016
9024
  if (!query) return nodes;
9017
9025
  const q = query.toLowerCase();
@@ -9040,6 +9048,7 @@ function TreeNodeItem({
9040
9048
  selected,
9041
9049
  expanded,
9042
9050
  selectionMode,
9051
+ allowChildSelection,
9043
9052
  onToggleExpand,
9044
9053
  onSelect,
9045
9054
  isFiltering
@@ -9047,7 +9056,7 @@ function TreeNodeItem({
9047
9056
  const nodeId = String(node.id);
9048
9057
  const hasChildren = !!node.children?.length;
9049
9058
  const isExpanded = isFiltering || expanded.has(nodeId);
9050
- const state = getNodeState(node, selected);
9059
+ const state = allowChildSelection ? getNodeState(node, selected) : selected.has(nodeId) ? "checked" : "unchecked";
9051
9060
  return /* @__PURE__ */ React106.createElement("div", { className: "rf-tsn" }, /* @__PURE__ */ React106.createElement(
9052
9061
  "div",
9053
9062
  {
@@ -9067,16 +9076,8 @@ function TreeNodeItem({
9067
9076
  },
9068
9077
  isExpanded ? /* @__PURE__ */ React106.createElement(ChevronDown2, { size: 14 }) : /* @__PURE__ */ React106.createElement(ChevronRight2, { size: 14 })
9069
9078
  ) : /* @__PURE__ */ React106.createElement("span", { className: "rf-tsn__expand-ph" }),
9070
- selectionMode === "multiple" && /* @__PURE__ */ React106.createElement(
9071
- "span",
9072
- {
9073
- className: `rf-tsn__cb${state === "checked" ? " rf-tsn__cb--checked" : state === "partial" ? " rf-tsn__cb--partial" : ""}`
9074
- },
9075
- state === "checked" && /* @__PURE__ */ React106.createElement(Check, { size: 10, strokeWidth: 3 }),
9076
- state === "partial" && /* @__PURE__ */ React106.createElement("span", { className: "rf-tsn__cb-dash" })
9077
- ),
9078
- selectionMode === "single" && /* @__PURE__ */ React106.createElement("span", { className: `rf-tsn__radio${state === "checked" ? " rf-tsn__radio--checked" : ""}` }),
9079
- /* @__PURE__ */ React106.createElement("span", { className: "rf-tsn__label" }, node.label)
9079
+ /* @__PURE__ */ React106.createElement("span", { className: "rf-tsn__label" }, node.label),
9080
+ /* @__PURE__ */ React106.createElement("span", { className: "rf-tsn__check", "aria-hidden": "true" }, state === "partial" ? /* @__PURE__ */ React106.createElement(Minus, { size: 13, strokeWidth: 2.5 }) : /* @__PURE__ */ React106.createElement(Check, { size: 13, strokeWidth: 2.5 }))
9080
9081
  ), hasChildren && isExpanded && /* @__PURE__ */ React106.createElement("div", null, node.children.map((child) => /* @__PURE__ */ React106.createElement(
9081
9082
  TreeNodeItem,
9082
9083
  {
@@ -9086,6 +9087,7 @@ function TreeNodeItem({
9086
9087
  selected,
9087
9088
  expanded,
9088
9089
  selectionMode,
9090
+ allowChildSelection,
9089
9091
  onToggleExpand,
9090
9092
  onSelect,
9091
9093
  isFiltering
@@ -9099,6 +9101,7 @@ function TreeSelect({
9099
9101
  onNodeSelect,
9100
9102
  onNodeUnselect,
9101
9103
  selectionMode = "single",
9104
+ allowChildSelection = false,
9102
9105
  placeholder = "Select",
9103
9106
  filter = false,
9104
9107
  filterInputAutoFocus = false,
@@ -9219,15 +9222,25 @@ function TreeSelect({
9219
9222
  const handleSelect = (node) => {
9220
9223
  const nodeId = String(node.id);
9221
9224
  if (isMultiple) {
9222
- const state = getNodeState(node, selectedSet);
9223
- const descendants = collectDescendants(node);
9224
9225
  const newSet = new Set(selectedSet);
9225
- if (state === "checked" || state === "partial") {
9226
- descendants.forEach((id) => newSet.delete(id));
9227
- onNodeUnselect?.({ node });
9226
+ if (allowChildSelection) {
9227
+ const state = getNodeState(node, selectedSet);
9228
+ const descendants = collectDescendants(node);
9229
+ if (state === "checked" || state === "partial") {
9230
+ descendants.forEach((id) => newSet.delete(id));
9231
+ onNodeUnselect?.({ node });
9232
+ } else {
9233
+ descendants.forEach((id) => newSet.add(id));
9234
+ onNodeSelect?.({ node });
9235
+ }
9228
9236
  } else {
9229
- descendants.forEach((id) => newSet.add(id));
9230
- onNodeSelect?.({ node });
9237
+ if (newSet.has(nodeId)) {
9238
+ newSet.delete(nodeId);
9239
+ onNodeUnselect?.({ node });
9240
+ } else {
9241
+ newSet.add(nodeId);
9242
+ onNodeSelect?.({ node });
9243
+ }
9231
9244
  }
9232
9245
  onChange?.({ value: setToRecord(newSet) });
9233
9246
  } else {
@@ -9260,7 +9273,7 @@ function TreeSelect({
9260
9273
  onNodeUnselect?.({ node });
9261
9274
  };
9262
9275
  const filteredTree = filterTree(options, filterQuery);
9263
- const tagNodes = isMultiple ? getTopLevelSelected(options, selectedSet) : value != null ? findNodeById(options, String(value)) ? [findNodeById(options, String(value))] : [] : [];
9276
+ const tagNodes = isMultiple ? allowChildSelection ? getTopLevelSelected(options, selectedSet) : getAllSelected(options, selectedSet) : value != null ? findNodeById(options, String(value)) ? [findNodeById(options, String(value))] : [] : [];
9264
9277
  const hasValue = tagNodes.length > 0;
9265
9278
  const isFloating = open || hasValue || focused;
9266
9279
  const rootClasses = [
@@ -9358,6 +9371,7 @@ function TreeSelect({
9358
9371
  selected: selectedSet,
9359
9372
  expanded: expandedKeys,
9360
9373
  selectionMode,
9374
+ allowChildSelection,
9361
9375
  onToggleExpand: handleToggleExpand,
9362
9376
  onSelect: handleSelect,
9363
9377
  isFiltering: !!filterQuery
@@ -9628,34 +9642,28 @@ function SmartSelect({
9628
9642
  {
9629
9643
  key,
9630
9644
  ...rest,
9631
- className: muiClass,
9645
+ className: [
9646
+ muiClass,
9647
+ "rf-select__option",
9648
+ isSelected ? "rf-select__option--selected" : ""
9649
+ ].filter(Boolean).join(" "),
9632
9650
  style: {
9633
9651
  ...muiStyle,
9634
- display: "flex",
9635
- alignItems: "center",
9636
- gap: 10,
9637
- padding: "8px 16px",
9638
9652
  paddingLeft: 16 + depth * 20,
9639
- fontSize: "0.9rem",
9640
- color: "rgba(0,0,0,0.87)",
9641
- cursor: "pointer",
9642
- userSelect: "none",
9643
- minHeight: 40,
9644
- boxSizing: "border-box",
9645
- fontWeight: isSelected ? 500 : void 0,
9646
- backgroundColor: isSelected ? "rgba(164,27,6,0.08)" : void 0,
9647
- listStyle: "none"
9653
+ listStyle: "none",
9654
+ alignItems: subLabel ? "flex-start" : void 0
9648
9655
  }
9649
9656
  },
9650
- /* @__PURE__ */ React108.createElement("span", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" } }, /* @__PURE__ */ React108.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.3 } }, getOptionLabel(option)), subLabel && /* @__PURE__ */ React108.createElement("span", { style: { fontSize: "0.75rem", color: "var(--text-secondary)", lineHeight: 1.3, marginTop: 1 } }, subLabel)),
9651
- /* @__PURE__ */ React108.createElement("span", { style: {
9652
- color: "var(--primary-color, #a41b06)",
9653
- flexShrink: 0,
9654
- display: "flex",
9655
- alignItems: "center",
9656
- opacity: isSelected ? 1 : 0,
9657
- transition: "opacity 0.1s"
9658
- } }, /* @__PURE__ */ React108.createElement(CheckIcon3, null))
9657
+ /* @__PURE__ */ React108.createElement(
9658
+ "span",
9659
+ {
9660
+ className: "rf-select__option-label",
9661
+ style: subLabel ? { display: "flex", flexDirection: "column", whiteSpace: "normal" } : void 0
9662
+ },
9663
+ /* @__PURE__ */ React108.createElement("span", { style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.3 } }, getOptionLabel(option)),
9664
+ subLabel && /* @__PURE__ */ React108.createElement("span", { style: { fontSize: "0.75rem", color: "var(--text-secondary)", lineHeight: 1.3, marginTop: 1 } }, subLabel)
9665
+ ),
9666
+ /* @__PURE__ */ React108.createElement("span", { className: "rf-select__option-check", "aria-hidden": "true" }, /* @__PURE__ */ React108.createElement(CheckIcon3, null))
9659
9667
  );
9660
9668
  }, [depthMap, getValue, getOptionLabel, getOptionSubLabel, selectedKeys]);
9661
9669
  const computedFilterOptions = useCallback11((opts, inputValue) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rufous/ui",
3
3
  "private": false,
4
- "version": "0.3.21",
4
+ "version": "0.3.22",
5
5
  "type": "module",
6
6
  "description": "Experimental: A lightweight React UI component library (Beta)",
7
7
  "style": "./dist/main.css",