@pibit.ai/cure-design-system 0.3.20 → 0.3.21
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 +1 -0
- package/dist/applications/schedule-calendar/schedule-calendar.d.ts.map +1 -1
- package/dist/applications/schedule-calendar/schedule-calendar.js +24 -22
- package/dist/applications/schedule-calendar/utils.d.ts +13 -3
- package/dist/applications/schedule-calendar/utils.d.ts.map +1 -1
- package/dist/applications/schedule-calendar/utils.js +136 -117
- package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
- package/dist/patterns/table/TableWrapper.js +776 -661
- package/dist/patterns/table/table.d.ts.map +1 -1
- package/dist/patterns/table/table.js +44 -43
- package/dist/patterns/table/toolbar/AlignDropdown.js +14 -14
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +9 -0
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +115 -81
- package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/SummaryFooter.js +34 -27
- package/dist/patterns/table/toolbar/index.d.ts +1 -1
- package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
- package/dist/patterns/table/toolbar/tableToolbarHelpers.js +1 -1
- package/dist/primitives/select/searchable-select.d.ts +5 -3
- package/dist/primitives/select/searchable-select.d.ts.map +1 -1
- package/dist/primitives/select/searchable-select.js +196 -177
- package/dist/primitives/select/select-item.d.ts.map +1 -1
- package/dist/primitives/select/select-item.js +70 -54
- package/dist/primitives/select/select.d.ts +7 -2
- package/dist/primitives/select/select.d.ts.map +1 -1
- package/dist/primitives/select/select.js +161 -137
- package/dist/primitives/tooltip/ellipsis-content.d.ts.map +1 -1
- package/dist/primitives/tooltip/ellipsis-content.js +46 -43
- package/dist/styles/components.css +1 -1
- package/package.json +1 -1
|
@@ -1,52 +1,68 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { Check as
|
|
4
|
-
import { ListBoxItem as
|
|
5
|
-
import { Avatar as
|
|
6
|
-
import { SelectContext as
|
|
7
|
-
import { cx as
|
|
8
|
-
import { isReactComponent as
|
|
9
|
-
const
|
|
1
|
+
import { jsx as n, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as k, isValidElement as N } from "react";
|
|
3
|
+
import { Check as R } from "@untitledui/icons";
|
|
4
|
+
import { ListBoxItem as V, Text as w } from "react-aria-components";
|
|
5
|
+
import { Avatar as j } from "../avatar/avatar.js";
|
|
6
|
+
import { SelectContext as q, fontSizes as C } from "./select.js";
|
|
7
|
+
import { cx as l } from "../../utils/cn.js";
|
|
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
|
-
},
|
|
14
|
-
label:
|
|
15
|
-
id:
|
|
16
|
-
value:
|
|
17
|
-
avatarUrl:
|
|
13
|
+
}, J = ({
|
|
14
|
+
label: d,
|
|
15
|
+
id: s,
|
|
16
|
+
value: v,
|
|
17
|
+
avatarUrl: m,
|
|
18
18
|
supportingText: r,
|
|
19
|
-
isDisabled:
|
|
20
|
-
icon:
|
|
21
|
-
className:
|
|
22
|
-
children:
|
|
23
|
-
textStyles:
|
|
24
|
-
...
|
|
19
|
+
isDisabled: c,
|
|
20
|
+
icon: o,
|
|
21
|
+
className: u,
|
|
22
|
+
children: a,
|
|
23
|
+
textStyles: D,
|
|
24
|
+
...t
|
|
25
25
|
}) => {
|
|
26
|
-
const { size:
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const { size: f, isDeselectable: P, selectedKey: b, onReselectCurrent: h } = k(q), y = P && b != null && s != null && String(s) === String(b), S = (e) => {
|
|
27
|
+
!y || c || (e.preventDefault(), e.stopPropagation());
|
|
28
|
+
}, g = (e) => {
|
|
29
|
+
!y || c || !h || ("preventDefault" in e && (e.preventDefault(), e.stopPropagation()), h());
|
|
30
|
+
}, x = d || (typeof a == "string" ? a : ""), z = r ? x + " " + r : x;
|
|
31
|
+
return /* @__PURE__ */ n(
|
|
32
|
+
V,
|
|
29
33
|
{
|
|
30
|
-
id:
|
|
31
|
-
value:
|
|
32
|
-
id:
|
|
33
|
-
label:
|
|
34
|
-
avatarUrl:
|
|
34
|
+
id: s,
|
|
35
|
+
value: v ?? {
|
|
36
|
+
id: s,
|
|
37
|
+
label: x,
|
|
38
|
+
avatarUrl: m,
|
|
35
39
|
supportingText: r,
|
|
36
|
-
isDisabled:
|
|
37
|
-
icon:
|
|
40
|
+
isDisabled: c,
|
|
41
|
+
icon: o
|
|
38
42
|
},
|
|
39
|
-
textValue:
|
|
40
|
-
isDisabled:
|
|
41
|
-
...
|
|
42
|
-
|
|
43
|
+
textValue: z,
|
|
44
|
+
isDisabled: c,
|
|
45
|
+
...t,
|
|
46
|
+
onPointerDownCapture: (e) => {
|
|
47
|
+
var i;
|
|
48
|
+
(i = t.onPointerDownCapture) == null || i.call(t, e), S(e);
|
|
49
|
+
},
|
|
50
|
+
onPointerUpCapture: (e) => {
|
|
51
|
+
var i;
|
|
52
|
+
(i = t.onPointerUpCapture) == null || i.call(t, e), g(e);
|
|
53
|
+
},
|
|
54
|
+
onPress: (e) => {
|
|
55
|
+
var i;
|
|
56
|
+
(i = t.onPress) == null || i.call(t, e), e.pointerType === "keyboard" && g(e);
|
|
57
|
+
},
|
|
58
|
+
className: (e) => l(
|
|
43
59
|
"w-full px-1.5 py-px outline-hidden",
|
|
44
|
-
typeof
|
|
60
|
+
typeof u == "function" ? u(e) : u
|
|
45
61
|
),
|
|
46
|
-
children: (e) => /* @__PURE__ */
|
|
62
|
+
children: (e) => /* @__PURE__ */ p(
|
|
47
63
|
"div",
|
|
48
64
|
{
|
|
49
|
-
className:
|
|
65
|
+
className: l(
|
|
50
66
|
"flex cursor-pointer items-center gap-2 rounded-md outline-hidden select-none hover:bg-primary_hover",
|
|
51
67
|
e.isSelected && "bg-brand-primary text-brand-600 hover:bg-brand-primary hover:text-brand-600",
|
|
52
68
|
e.isDisabled && "cursor-not-allowed",
|
|
@@ -55,42 +71,42 @@ const V = {
|
|
|
55
71
|
"*:data-icon:size-5 *:data-icon:shrink-0 *:data-icon:text-fg-quaternary",
|
|
56
72
|
e.isDisabled && "*:data-icon:text-fg-disabled",
|
|
57
73
|
// @ts-ignore
|
|
58
|
-
|
|
74
|
+
B[f]
|
|
59
75
|
),
|
|
60
76
|
children: [
|
|
61
|
-
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
77
|
+
m ? /* @__PURE__ */ n(j, { "aria-hidden": "true", size: "sm", src: m, alt: d }) : A(o) ? /* @__PURE__ */ n(o, { "data-icon": !0, "aria-hidden": "true" }) : N(o) ? o : null,
|
|
78
|
+
/* @__PURE__ */ p("div", { className: "flex w-full min-w-0 flex-1 flex-wrap gap-x-2", children: [
|
|
79
|
+
/* @__PURE__ */ n(
|
|
80
|
+
w,
|
|
65
81
|
{
|
|
66
82
|
slot: "label",
|
|
67
|
-
className:
|
|
83
|
+
className: l(
|
|
68
84
|
"truncate font-medium whitespace-nowrap text-primary",
|
|
69
85
|
e.isDisabled && "text-disabled",
|
|
70
|
-
|
|
71
|
-
|
|
86
|
+
D,
|
|
87
|
+
C[f]
|
|
72
88
|
),
|
|
73
|
-
children:
|
|
89
|
+
children: d || (typeof a == "function" ? a(e) : a)
|
|
74
90
|
}
|
|
75
91
|
),
|
|
76
|
-
r && /* @__PURE__ */
|
|
77
|
-
|
|
92
|
+
r && /* @__PURE__ */ n(
|
|
93
|
+
w,
|
|
78
94
|
{
|
|
79
95
|
slot: "description",
|
|
80
|
-
className:
|
|
96
|
+
className: l(
|
|
81
97
|
"whitespace-nowrap text-tertiary",
|
|
82
|
-
|
|
98
|
+
C[f],
|
|
83
99
|
e.isDisabled && "text-disabled"
|
|
84
100
|
),
|
|
85
101
|
children: r
|
|
86
102
|
}
|
|
87
103
|
)
|
|
88
104
|
] }),
|
|
89
|
-
e.isSelected && /* @__PURE__ */
|
|
90
|
-
|
|
105
|
+
e.isSelected && /* @__PURE__ */ n(
|
|
106
|
+
R,
|
|
91
107
|
{
|
|
92
108
|
"aria-hidden": "true",
|
|
93
|
-
className:
|
|
109
|
+
className: l(
|
|
94
110
|
"ml-auto text-fg-brand-primary",
|
|
95
111
|
e.isDisabled && "text-fg-disabled"
|
|
96
112
|
),
|
|
@@ -104,5 +120,5 @@ const V = {
|
|
|
104
120
|
);
|
|
105
121
|
};
|
|
106
122
|
export {
|
|
107
|
-
|
|
123
|
+
J as SelectItem
|
|
108
124
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode, RefAttributes } from 'react';
|
|
2
|
-
import { SelectProps as AriaSelectProps } from 'react-aria-components';
|
|
2
|
+
import { Key, SelectProps as AriaSelectProps } from 'react-aria-components';
|
|
3
3
|
import { ComboBox } from './combobox';
|
|
4
4
|
import { SelectItem } from './select-item';
|
|
5
5
|
import { SearchableSelect } from './searchable-select';
|
|
@@ -28,6 +28,8 @@ export interface SelectProps extends Omit<AriaSelectProps<SelectItemType>, "chil
|
|
|
28
28
|
showChevron?: boolean;
|
|
29
29
|
/** When true, shows a clear button when a value is selected. Clearing calls onSelectionChange(null). Default false. */
|
|
30
30
|
isClearable?: boolean;
|
|
31
|
+
/** When true, clicking the already-selected option in the dropdown clears the selection. Default false. */
|
|
32
|
+
isDeselectable?: boolean;
|
|
31
33
|
}
|
|
32
34
|
export declare const sizes: {
|
|
33
35
|
sm: {
|
|
@@ -50,8 +52,11 @@ export declare const fontSizes: {
|
|
|
50
52
|
};
|
|
51
53
|
export declare const SelectContext: import('react').Context<{
|
|
52
54
|
size: "sm" | "md" | "lg";
|
|
55
|
+
isDeselectable?: boolean;
|
|
56
|
+
selectedKey?: Key | null;
|
|
57
|
+
onReselectCurrent?: () => void;
|
|
53
58
|
}>;
|
|
54
|
-
declare const Select: ({ placeholder, placeholderIcon, size, children, items, label, hint, tooltip, className, textStyles, showChevron, isClearable, ...rest }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
declare const Select: ({ placeholder, placeholderIcon, size, children, items, label, hint, tooltip, className, textStyles, showChevron, isClearable, isDeselectable, ...rest }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
60
|
declare const _Select: typeof Select & {
|
|
56
61
|
ComboBox: typeof ComboBox;
|
|
57
62
|
Item: typeof SelectItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAO,aAAa,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAO,aAAa,EAAE,MAAM,OAAO,CAAC;AAG/D,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAUjF,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WACf,SACE,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,EAC3D,aAAa,CAAC,cAAc,CAAC,EAC7B,WAAW;IACb,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,EAAE,GAAG,SAAS,CAAC;IACjC,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,cAAc,KAAK,SAAS,CAAC,CAAC;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uHAAuH;IACvH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2GAA2G;IAC3G,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAiBD,eAAO,MAAM,KAAK;;;;;;;;;;;;;CAIjB,CAAC;AAQF,eAAO,MAAM,SAAS;;;;CAIrB,CAAC;AA4IF,eAAO,MAAM,aAAa;UAClB,IAAI,GAAG,IAAI,GAAG,IAAI;qBACP,OAAO;kBACV,GAAG,GAAG,IAAI;wBACJ,MAAM,IAAI;EACd,CAAC;AAEnB,QAAA,MAAM,MAAM,GAAI,yJAeb,WAAW,4CA+Fb,CAAC;AAEF,QAAA,MAAM,OAAO,EAAa,OAAO,MAAM,GAAG;IACxC,QAAQ,EAAE,OAAO,QAAQ,CAAC;IAC1B,IAAI,EAAE,OAAO,UAAU,CAAC;IACxB,UAAU,EAAE,OAAO,gBAAgB,CAAC;CACrC,CAAC;AAKF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
import { Select as
|
|
5
|
-
import { Avatar as
|
|
6
|
-
import { HintText as
|
|
7
|
-
import { Label as
|
|
8
|
-
import { ComboBox as
|
|
9
|
-
import { Popover as
|
|
10
|
-
import { SelectItem as
|
|
11
|
-
import { SearchableSelect as
|
|
12
|
-
import { cx as
|
|
13
|
-
import { isReactComponent as
|
|
14
|
-
const
|
|
1
|
+
import { jsx as e, jsxs as b, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as T, useCallback as j, createContext as V, isValidElement as _ } from "react";
|
|
3
|
+
import { ChevronDown as k, XClose as z } from "@untitledui/icons";
|
|
4
|
+
import { Select as L, ListBox as O, Button as P, SelectValue as U } from "react-aria-components";
|
|
5
|
+
import { Avatar as $ } from "../avatar/avatar.js";
|
|
6
|
+
import { HintText as A } from "../input/hint-text.js";
|
|
7
|
+
import { Label as E } from "../input/label.js";
|
|
8
|
+
import { ComboBox as F } from "./combobox.js";
|
|
9
|
+
import { Popover as H } from "./popover.js";
|
|
10
|
+
import { SelectItem as M } from "./select-item.js";
|
|
11
|
+
import { SearchableSelect as X } from "./searchable-select.js";
|
|
12
|
+
import { cx as i } from "../../utils/cn.js";
|
|
13
|
+
import { isReactComponent as G } from "../../utils/is-react-component.js";
|
|
14
|
+
const J = {
|
|
15
15
|
sm: { root: "py-1.5 px-2 h-8", shortcut: "pr-2" },
|
|
16
16
|
md: { root: "py-1.5 px-3 h-9", shortcut: "pr-2.5" },
|
|
17
17
|
lg: { root: "py-2.5 px-3.5 h-11", shortcut: "pr-3" }
|
|
18
|
-
},
|
|
18
|
+
}, Q = {
|
|
19
19
|
sm: "rounded-md",
|
|
20
20
|
md: "rounded-md",
|
|
21
21
|
lg: "rounded-lg"
|
|
22
|
-
},
|
|
22
|
+
}, w = {
|
|
23
23
|
sm: "text-xs",
|
|
24
24
|
md: "text-sm",
|
|
25
25
|
lg: "text-md"
|
|
26
|
-
},
|
|
26
|
+
}, R = {
|
|
27
27
|
sm: "size-4",
|
|
28
28
|
md: "size-4",
|
|
29
29
|
lg: "size-5"
|
|
30
|
-
},
|
|
30
|
+
}, W = {
|
|
31
31
|
sm: "text-xs",
|
|
32
32
|
md: "text-xs",
|
|
33
33
|
lg: "text-sm"
|
|
34
|
-
},
|
|
35
|
-
isOpen:
|
|
36
|
-
isFocused:
|
|
37
|
-
isDisabled:
|
|
38
|
-
size:
|
|
39
|
-
placeholder:
|
|
40
|
-
placeholderIcon:
|
|
41
|
-
ref:
|
|
42
|
-
textStyles:
|
|
43
|
-
showChevron:
|
|
44
|
-
isClearable:
|
|
45
|
-
onClear:
|
|
46
|
-
selectedItem:
|
|
34
|
+
}, Y = "relative flex w-full cursor-pointer items-center bg-primary ring-1 ring-secondary outline-hidden transition duration-100 ease-linear ring-inset", Z = ({
|
|
35
|
+
isOpen: y,
|
|
36
|
+
isFocused: B,
|
|
37
|
+
isDisabled: c,
|
|
38
|
+
size: n,
|
|
39
|
+
placeholder: u,
|
|
40
|
+
placeholderIcon: p,
|
|
41
|
+
ref: x,
|
|
42
|
+
textStyles: I,
|
|
43
|
+
showChevron: f = !0,
|
|
44
|
+
isClearable: N = !1,
|
|
45
|
+
onClear: a,
|
|
46
|
+
selectedItem: h
|
|
47
47
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
|
|
48
|
+
const d = N && h && !c && a, g = /* @__PURE__ */ e(
|
|
49
|
+
P,
|
|
50
50
|
{
|
|
51
|
-
ref:
|
|
52
|
-
className:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
|
|
51
|
+
ref: x,
|
|
52
|
+
className: i(
|
|
53
|
+
Y,
|
|
54
|
+
Q[n],
|
|
55
|
+
(B || y) && "ring-1 ring-brand",
|
|
56
|
+
c && "cursor-not-allowed bg-disabled_subtle text-disabled"
|
|
57
57
|
),
|
|
58
58
|
children: /* @__PURE__ */ e(
|
|
59
|
-
|
|
59
|
+
U,
|
|
60
60
|
{
|
|
61
|
-
className:
|
|
61
|
+
className: i(
|
|
62
62
|
"flex h-max w-full items-center justify-start gap-2 truncate text-left align-middle",
|
|
63
63
|
// Icon styles
|
|
64
64
|
"*:data-icon:size-5 *:data-icon:shrink-0 *:data-icon:text-fg-quaternary in-disabled:*:data-icon:text-fg-disabled",
|
|
65
|
-
|
|
65
|
+
J[n].root
|
|
66
66
|
),
|
|
67
|
-
children: (
|
|
68
|
-
var
|
|
69
|
-
const
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
(
|
|
72
|
-
|
|
67
|
+
children: (r) => {
|
|
68
|
+
var o, m, s, v, S;
|
|
69
|
+
const t = ((o = r.selectedItem) == null ? void 0 : o.icon) || p;
|
|
70
|
+
return /* @__PURE__ */ b(K, { children: [
|
|
71
|
+
(m = r.selectedItem) != null && m.avatarUrl ? /* @__PURE__ */ e(
|
|
72
|
+
$,
|
|
73
73
|
{
|
|
74
74
|
size: "sm",
|
|
75
|
-
src:
|
|
76
|
-
alt:
|
|
75
|
+
src: r.selectedItem.avatarUrl,
|
|
76
|
+
alt: r.selectedItem.label
|
|
77
77
|
}
|
|
78
|
-
) :
|
|
79
|
-
|
|
78
|
+
) : G(t) ? /* @__PURE__ */ e(
|
|
79
|
+
t,
|
|
80
80
|
{
|
|
81
81
|
"data-icon": !0,
|
|
82
82
|
"aria-hidden": "true",
|
|
83
|
-
className:
|
|
83
|
+
className: R[n]
|
|
84
84
|
}
|
|
85
|
-
) :
|
|
86
|
-
|
|
85
|
+
) : _(t) ? t : null,
|
|
86
|
+
r.selectedItem ? /* @__PURE__ */ b("section", { className: "flex w-full gap-2 truncate", children: [
|
|
87
87
|
/* @__PURE__ */ e(
|
|
88
88
|
"p",
|
|
89
89
|
{
|
|
90
|
-
className:
|
|
90
|
+
className: i(
|
|
91
91
|
"truncate font-medium text-primary",
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
w[n],
|
|
93
|
+
I
|
|
94
94
|
),
|
|
95
|
-
children: (
|
|
95
|
+
children: (s = r.selectedItem) == null ? void 0 : s.label
|
|
96
96
|
}
|
|
97
97
|
),
|
|
98
|
-
((
|
|
98
|
+
((v = r.selectedItem) == null ? void 0 : v.supportingText) && /* @__PURE__ */ e("p", { className: i("text-tertiary", w[n]), children: (S = r.selectedItem) == null ? void 0 : S.supportingText })
|
|
99
99
|
] }) : /* @__PURE__ */ e(
|
|
100
100
|
"p",
|
|
101
101
|
{
|
|
102
|
-
className:
|
|
102
|
+
className: i(
|
|
103
103
|
"text-placeholder_subtle",
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
w[n],
|
|
105
|
+
c && "text-disabled"
|
|
106
106
|
),
|
|
107
|
-
children:
|
|
107
|
+
children: u
|
|
108
108
|
}
|
|
109
109
|
),
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
f && /* @__PURE__ */ e(
|
|
111
|
+
k,
|
|
112
112
|
{
|
|
113
113
|
"aria-hidden": "true",
|
|
114
|
-
className:
|
|
114
|
+
className: i(
|
|
115
115
|
"ml-auto shrink-0 text-fg-quaternary",
|
|
116
|
-
|
|
116
|
+
R[n]
|
|
117
117
|
)
|
|
118
118
|
}
|
|
119
119
|
)
|
|
@@ -123,86 +123,110 @@ const X = {
|
|
|
123
123
|
)
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
|
-
return
|
|
127
|
-
|
|
126
|
+
return d ? /* @__PURE__ */ b("div", { className: "relative flex w-full items-stretch", children: [
|
|
127
|
+
g,
|
|
128
128
|
/* @__PURE__ */ e(
|
|
129
129
|
"button",
|
|
130
130
|
{
|
|
131
131
|
type: "button",
|
|
132
132
|
tabIndex: -1,
|
|
133
133
|
"aria-label": "Clear selection",
|
|
134
|
-
onClick: () =>
|
|
135
|
-
className:
|
|
134
|
+
onClick: () => a == null ? void 0 : a(),
|
|
135
|
+
className: i(
|
|
136
136
|
"absolute right-8 top-1/2 cursor-pointer flex -translate-y-1/2 items-center justify-center rounded-md p-1 text-fg-quaternary outline-hidden transition hover:bg-primary_hover focus-visible:outline-2 focus-visible:outline-offset-0 focus-visible:outline-focus-ring"
|
|
137
137
|
),
|
|
138
|
-
children: /* @__PURE__ */ e(
|
|
138
|
+
children: /* @__PURE__ */ e(z, { "aria-hidden": !0, className: R[n] })
|
|
139
139
|
}
|
|
140
140
|
)
|
|
141
|
-
] }) :
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
141
|
+
] }) : g;
|
|
142
|
+
}, D = V({ size: "sm" }), ee = ({
|
|
143
|
+
placeholder: y = "Select",
|
|
144
|
+
placeholderIcon: B,
|
|
145
|
+
size: c = "sm",
|
|
146
|
+
children: n,
|
|
147
|
+
items: u,
|
|
148
|
+
label: p,
|
|
149
|
+
hint: x,
|
|
150
|
+
tooltip: I,
|
|
151
|
+
className: f,
|
|
152
|
+
textStyles: N,
|
|
153
|
+
showChevron: a = !0,
|
|
154
|
+
isClearable: h = !1,
|
|
155
|
+
isDeselectable: d = !1,
|
|
156
|
+
...g
|
|
157
|
+
}) => {
|
|
158
|
+
const { selectedKey: r, onSelectionChange: t, ...o } = g, m = T(!1), s = r === void 0 ? void 0 : r == null || String(r) === "" ? null : r, v = j(() => {
|
|
159
|
+
var l;
|
|
160
|
+
!d || s == null || (m.current = !0, t == null || t(null), (l = o.onOpenChange) == null || l.call(o, !1), queueMicrotask(() => {
|
|
161
|
+
m.current = !1;
|
|
162
|
+
}));
|
|
163
|
+
}, [o.onOpenChange, d, t, s]), S = j(
|
|
164
|
+
(l) => {
|
|
165
|
+
if (m.current) return;
|
|
166
|
+
const C = l == null || String(l) === "" ? null : l;
|
|
167
|
+
t == null || t(C);
|
|
168
|
+
},
|
|
169
|
+
[t]
|
|
170
|
+
);
|
|
171
|
+
return /* @__PURE__ */ e(
|
|
172
|
+
D.Provider,
|
|
173
|
+
{
|
|
174
|
+
value: {
|
|
175
|
+
size: c,
|
|
176
|
+
isDeselectable: d,
|
|
177
|
+
selectedKey: s,
|
|
178
|
+
onReselectCurrent: d ? v : void 0
|
|
179
|
+
},
|
|
180
|
+
children: /* @__PURE__ */ e(
|
|
181
|
+
L,
|
|
178
182
|
{
|
|
179
|
-
...
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
183
|
+
...o,
|
|
184
|
+
selectedKey: s,
|
|
185
|
+
onSelectionChange: S,
|
|
186
|
+
className: (l) => i(
|
|
187
|
+
"flex flex-col gap-1.5",
|
|
188
|
+
typeof f == "function" ? f(l) : f
|
|
189
|
+
),
|
|
190
|
+
children: (l) => /* @__PURE__ */ b(K, { children: [
|
|
191
|
+
p && /* @__PURE__ */ e(
|
|
192
|
+
E,
|
|
193
|
+
{
|
|
194
|
+
isRequired: l.isRequired,
|
|
195
|
+
tooltip: I,
|
|
196
|
+
className: W[c],
|
|
197
|
+
children: p
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ e(
|
|
201
|
+
Z,
|
|
202
|
+
{
|
|
203
|
+
...l,
|
|
204
|
+
size: c,
|
|
205
|
+
placeholder: y,
|
|
206
|
+
placeholderIcon: null,
|
|
207
|
+
textStyles: N,
|
|
208
|
+
showChevron: a,
|
|
209
|
+
isClearable: h,
|
|
210
|
+
onClear: h && t ? () => t(null) : void 0,
|
|
211
|
+
selectedItem: s != null && u ? u.find(
|
|
212
|
+
(C) => String(C.id) === String(s)
|
|
213
|
+
) ?? null : null
|
|
214
|
+
}
|
|
215
|
+
),
|
|
216
|
+
/* @__PURE__ */ e(H, { size: c, className: i(o.popoverClassName), children: /* @__PURE__ */ e(O, { items: u, className: "size-full outline-hidden ", children: n }) }),
|
|
217
|
+
x && /* @__PURE__ */ e(A, { isInvalid: l.isInvalid, children: x })
|
|
218
|
+
] })
|
|
193
219
|
}
|
|
194
|
-
)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
v.Item = E;
|
|
202
|
-
v.Searchable = F;
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}, q = ee;
|
|
224
|
+
q.ComboBox = F;
|
|
225
|
+
q.Item = M;
|
|
226
|
+
q.Searchable = X;
|
|
203
227
|
export {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
228
|
+
q as Select,
|
|
229
|
+
D as SelectContext,
|
|
230
|
+
w as fontSizes,
|
|
231
|
+
J as sizes
|
|
208
232
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ellipsis-content.d.ts","sourceRoot":"","sources":["../../../src/primitives/tooltip/ellipsis-content.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ellipsis-content.d.ts","sourceRoot":"","sources":["../../../src/primitives/tooltip/ellipsis-content.tsx"],"names":[],"mappings":"AAsBA,MAAM,MAAM,+BAA+B,GAAG;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IAC7C,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,gEAMxC,+BAA+B,4CA4HjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAChC,SAAS,MAAM,EACf,YAAW,MAAW,EACtB,OAAO,OAAO,EACd,kBAAiB,OAAO,GAAG,QAAQ,GAAG,KAAe,EACrD,cAAc,OAAO,GAAG,OAAO,EAC/B,cAAc,MAAM,EACpB,gBAAgB,MAAM,EACtB,mBAAmB,MAAM,4CAmB1B,CAAC"}
|