@pibit.ai/cure-design-system 0.6.2 → 0.6.3

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 +1 @@
1
- {"version":3,"file":"select-item.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/select-item.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAMtF,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAUhF,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,EAAE,cAAc;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,GAAI,+JAcxB,eAAe,4CAkJjB,CAAC"}
1
+ {"version":3,"file":"select-item.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/select-item.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAMtF,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAUhF,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,EAAE,IAAI,CAAC,EAAE,cAAc;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,eAAO,MAAM,UAAU,GAAI,+JAcxB,eAAe,4CAsJjB,CAAC"}
@@ -3,45 +3,45 @@ import { useContext as N, isValidElement as R } from "react";
3
3
  import { Check as j } from "@untitledui/icons";
4
4
  import { ListBoxItem as E, Text as D } from "react-aria-components";
5
5
  import { Avatar as V } from "../avatar/avatar.js";
6
- import { SelectContext as _, fontSizes as P } from "./select-shared.js";
6
+ import { SelectContext as q, fontSizes as S } from "./select-shared.js";
7
7
  import { cx as o } from "../../utils/cn.js";
8
- import { isReactComponent as q } from "../../utils/is-react-component.js";
9
- const A = {
8
+ import { isReactComponent as A } from "../../utils/is-react-component.js";
9
+ const B = {
10
10
  sm: "p-2 pr-2.5",
11
11
  md: "p-2.5 pl-2",
12
12
  xs: "p-1.5"
13
13
  }, Q = ({
14
14
  label: m,
15
15
  id: d,
16
- value: S,
16
+ value: P,
17
17
  avatarUrl: s,
18
18
  supportingText: i,
19
19
  supportingTextClassName: y,
20
20
  isDisabled: c,
21
- icon: a,
21
+ icon: l,
22
22
  className: f,
23
- children: l,
23
+ children: a,
24
24
  textStyles: p,
25
25
  stackDescription: u = !1,
26
26
  ...t
27
27
  }) => {
28
- const { size: x, isDeselectable: z, selectedKey: h, onReselectCurrent: w } = N(_), g = z && h != null && d != null && String(d) === String(h), k = (e) => {
28
+ const { size: x, isDeselectable: z, selectedKey: h, onReselectCurrent: w } = N(q), g = z && h != null && d != null && String(d) === String(h), k = (e) => {
29
29
  !g || c || (e.preventDefault(), e.stopPropagation());
30
30
  }, C = (e) => {
31
31
  !g || c || !w || (e.preventDefault(), e.stopPropagation(), w());
32
- }, b = m || (typeof l == "string" ? l : ""), K = i ? b + " " + i : b;
32
+ }, b = m || (typeof a == "string" ? a : ""), K = i ? b + " " + i : b;
33
33
  return /* @__PURE__ */ r(
34
34
  E,
35
35
  {
36
36
  id: d,
37
- value: S ?? {
37
+ value: P ?? {
38
38
  id: d,
39
39
  label: b,
40
40
  avatarUrl: s,
41
41
  supportingText: i,
42
42
  supportingTextClassName: y,
43
43
  isDisabled: c,
44
- icon: a
44
+ icon: l
45
45
  },
46
46
  textValue: K,
47
47
  isDisabled: c,
@@ -64,24 +64,25 @@ const A = {
64
64
  },
65
65
  className: (e) => o(
66
66
  "w-full px-1.5 py-px outline-hidden",
67
+ e.isDisabled ? "cursor-not-allowed" : "cursor-pointer",
67
68
  typeof f == "function" ? f(e) : f
68
69
  ),
69
70
  children: (e) => /* @__PURE__ */ v(
70
71
  "div",
71
72
  {
72
73
  className: o(
73
- "flex cursor-pointer items-center gap-2 rounded-md outline-hidden select-none hover:bg-primary_hover",
74
- e.isFocused && !e.isDisabled && "bg-primary_hover",
74
+ // Let pointer events hit the ListBoxItem root so the full row toggles selection.
75
+ "pointer-events-none flex w-full items-center gap-2 rounded-md outline-hidden select-none",
76
+ (e.isHovered || e.isFocused) && !e.isDisabled && !e.isSelected && "bg-primary_hover",
75
77
  e.isSelected && "bg-brand-primary text-brand-600 hover:bg-brand-primary hover:text-brand-600",
76
- e.isDisabled && "cursor-not-allowed",
77
78
  // Icon styles
78
79
  "*:data-icon:size-5 *:data-icon:shrink-0 *:data-icon:text-fg-quaternary",
79
80
  e.isDisabled && "*:data-icon:text-fg-disabled",
80
81
  // @ts-ignore
81
- A[x]
82
+ B[x]
82
83
  ),
83
84
  children: [
84
- s ? /* @__PURE__ */ r(V, { "aria-hidden": "true", size: "xs", src: s, alt: m }) : q(a) ? /* @__PURE__ */ r(a, { "data-icon": !0, "aria-hidden": "true" }) : R(a) ? a : null,
85
+ s ? /* @__PURE__ */ r(V, { "aria-hidden": "true", size: "xs", src: s, alt: m }) : A(l) ? /* @__PURE__ */ r(l, { "data-icon": !0, "aria-hidden": "true" }) : R(l) ? l : null,
85
86
  /* @__PURE__ */ v(
86
87
  "div",
87
88
  {
@@ -99,9 +100,9 @@ const A = {
99
100
  !u && "whitespace-nowrap",
100
101
  e.isDisabled && "text-disabled",
101
102
  p,
102
- P[x]
103
+ S[x]
103
104
  ),
104
- children: m || (typeof l == "function" ? l(e) : l)
105
+ children: m || (typeof a == "function" ? a(e) : a)
105
106
  }
106
107
  ),
107
108
  i && /* @__PURE__ */ r(
@@ -111,7 +112,7 @@ const A = {
111
112
  className: o(
112
113
  y ?? "text-tertiary",
113
114
  u ? "line-clamp-2" : "whitespace-nowrap",
114
- P[x],
115
+ S[x],
115
116
  e.isDisabled && "text-disabled"
116
117
  ),
117
118
  children: i
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pibit.ai/cure-design-system",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "CURE Design System - React component library",
5
5
  "author": "Pibit",
6
6
  "license": "MIT",