design-system-silkhaus 3.3.0-beta.listing-card-rtl.7 → 3.3.0-beta.listing-card-rtl.8

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/app/index.js CHANGED
@@ -1 +1,446 @@
1
- "use strict";var X=Object.defineProperty,Y=Object.defineProperties;var Z=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var V=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var P=(e,t,d)=>t in e?X(e,t,{enumerable:!0,configurable:!0,writable:!0,value:d}):e[t]=d,v=(e,t)=>{for(var d in t||(t={}))V.call(t,d)&&P(e,d,t[d]);if(S)for(var d of S(t))W.call(t,d)&&P(e,d,t[d]);return e},w=(e,t)=>Y(e,Z(t));var z=(e,t)=>{var d={};for(var r in e)V.call(e,r)&&t.indexOf(r)<0&&(d[r]=e[r]);if(e!=null&&S)for(var r of S(e))t.indexOf(r)<0&&W.call(e,r)&&(d[r]=e[r]);return d};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../Checkbox-CUV4lv2I.cjs"),m=require("react"),T=({children:e,size:t="small"})=>s.jsxRuntimeExports.jsx("div",{className:`ds-flex ds-items-center ds-justify-center ${t==="small"?"ds-h-5 ds-w-5":"ds-h-6 ds-w-6"}`,children:e}),ss={primary:"ds-bg-Background-accentEggplant-100 ds-text-Text-textPrimaryDark ds-rounded-sm hover:ds-text-Text-textPrimaryDark hover:ds-bg-Background-accentEggplant-highlight hover:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] active:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] active:ds-bg-Background-accentEggplant-darkened focus:ds-bg-Background-accentEggplant-100 focus:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] disabled:focus:ds-shadow-none disabled:ds-bg-Background-accentEggplant-20 ds-text-mediumFootnoteEmphasized",secondary:"ds-bg-white ds-text-black ds-rounded-sm ds-border ds-border-Fills-terciary hover:ds-bg-[#F6F8FC] hover:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] active:ds-bg-[#F6F8FC] active:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] focus:ds-bg-[#F6F8FC] focus:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] disabled:ds-border disabled:ds-border-Fills-terciary disabled:ds-text-Text-tertiary disabled:ds-bg-transparent ds-text-mediumFootnoteEmphasized"},es={primary:"ds-rounded-sm ds-border ds-text-black ds-border-Fills-terciary ds-bg-[#F6F8FC] ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] ds-text-mediumFootnoteEmphasized",secondary:"ds-rounded-sm ds-bg-Background-accentEggplant-100 ds-text-Text-textPrimaryDark ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] ds-text-mediumFootnoteEmphasized"},N=m.forwardRef((E,g)=>{var u=E,{color:e="primary",disabled:t=!1,className:d,children:r,startIcon:i,selected:c,endIcon:n,trackingId:o,helperText:x,helpterTextClassName:f,buttonClassName:h}=u,b=z(u,["color","disabled","className","children","startIcon","selected","endIcon","trackingId","helperText","helpterTextClassName","buttonClassName"]);return s.jsxRuntimeExports.jsxs("div",{className:s.cn("ds-flex ds-flex-col ds-gap-1",d),children:[s.jsxRuntimeExports.jsxs("button",w(v({"data-tracking-id":o,ref:g,disabled:t,className:s.twMerge(s.clsx({[es[e]]:c,[ss[e]]:!c},"ds-px-2 ds-py-1","ds-flex ds-w-full ds-flex-1 ds-items-center ds-justify-center",h))},b),{children:[i&&s.jsxRuntimeExports.jsx(T,{children:i}),r&&s.jsxRuntimeExports.jsx("div",{className:`${i?"ds-ml-1":""} ${n?"ds-mr-1":""}`,children:r}),n&&s.jsxRuntimeExports.jsx(T,{children:n})]})),x&&s.jsxRuntimeExports.jsx("div",{className:s.cn("ds-w-full ds-text-right ds-text-mediumFootnoteRegular",f),children:x})]})});N.displayName="Button";const U=m.forwardRef((e,t)=>{const R=e,{value:d,options:r,onSelectionChange:i=()=>{},isMultiSelect:c,noDataError:n,buttonMinWidth:o,buttonWidth:x,minSelectionError:f,buttonsContainerClassName:h,buttonClassName:b}=R,g=z(R,["value","options","onSelectionChange","isMultiSelect","noDataError","buttonMinWidth","buttonWidth","minSelectionError","buttonsContainerClassName","buttonClassName"]),[E,u]=m.useState([]),[p,y]=m.useState("");m.useEffect(()=>{d&&d.length?u(d):u([])},[d]);const F=(a,j)=>{j.currentTarget.blur();const l=[...E],k=l.findIndex(B=>B.value===a.value);k!==-1?l.length>1?(l.splice(k,1),y("")):y(f):(l.push(a),y("")),u(l),i(l)},_=(a,j)=>{j.currentTarget.blur();const l=[a];u(l),i(l)};return s.jsxRuntimeExports.jsxs("div",w(v({ref:t},g),{children:[s.jsxRuntimeExports.jsx("div",{className:s.cn("ds-flex ds-flex-wrap ds-items-center ds-gap-2",h),children:r.length>0?r.map((a,j)=>a.type==="separator"?s.jsxRuntimeExports.jsx(m.Fragment,{children:a.component?a.component:s.jsxRuntimeExports.jsx("div",{className:"ds-h-full ds-min-h-[30px] ds-w-[1px] ds-bg-Fills-terciary"})},`separator-${j}`):s.jsxRuntimeExports.jsx(m.Fragment,{children:c?s.jsxRuntimeExports.jsx(N,{selected:E.some(l=>l.value===a.value),onClick:l=>F(a,l),color:"secondary",style:{minWidth:o,width:x},className:b,startIcon:a.startIcon,endIcon:a.endIcon,children:a.label}):s.jsxRuntimeExports.jsx(N,{selected:E.some(l=>l.value===a.value),onClick:l=>_(a,l),color:"secondary",style:{minWidth:o,width:x},className:b,startIcon:a.startIcon,endIcon:a.endIcon,children:a.label})},a.value)):s.jsxRuntimeExports.jsx("div",{className:"ds_xSmallSubheadRegular ds-p-2 ds-text-System-red",children:n})}),p&&s.jsxRuntimeExports.jsx("div",{className:"ds_xSmallSubheadRegular ds-p-2 ds-text-System-red",children:p})]}))});U.displayName="ButtonsGroupSelector";const $=e=>window.innerWidth<s.tabletMinWidth?s.jsxRuntimeExports.jsx(M,v({},e)):s.jsxRuntimeExports.jsx(I,v({},e));$.displayName="Dropdown";const I=({placement:e="bottom-start",trigger:t,triggerContainerClassName:d,disabled:r,onOpenChange:i,adjustHeight:c=!0,adjustWidth:n=!0,options:o,getSelectedValueDisplayText:x=J,placeholder:f,value:h,isMultiSelect:b,onChange:g})=>{const[E,u]=m.useState(),p=typeof h=="undefined"?E:h,y=typeof h=="undefined"?u:()=>{},[F,_]=m.useState(!1),{refs:R,floatingStyles:a,context:j}=s.useFloating({open:F,onOpenChange:D=>{_(D),i&&i(D)},middleware:[s.offset(8),s.flip({crossAxis:e.includes("-"),fallbackAxisSideDirection:"end"}),s.shift({padding:4}),s.size({apply({availableWidth:D,availableHeight:Q,elements:A}){c&&(A.floating.style.maxHeight=`${Q-4}px`),n&&(A.floating.style.maxWidth=`${D-4}px`)}})],whileElementsMounted:s.autoUpdate,placement:e}),l=s.useClick(j),k=s.useFocus(j),B=s.useDismiss(j),K=s.useRole(j),{getReferenceProps:L,getFloatingProps:O}=s.useInteractions([l,k,B,K]);return t||(t=s.jsxRuntimeExports.jsx(q,{selectedOption:C(p,o),getSelectedValueDisplayText:x,placeholder:f})),r?s.jsxRuntimeExports.jsx("div",{className:d,children:t}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("div",w(v({className:s.cn("ds-cursor-pointer",d),ref:R.setReference},L()),{children:t})),F&&s.jsxRuntimeExports.jsx(s.FloatingPortal,{children:s.jsxRuntimeExports.jsx("div",w(v({ref:R.setFloating,style:a},O()),{className:s.cn("ds-z-[29999] ds-flex ds-min-w-[200px] ds-flex-col ds-gap-1 ds-rounded ds-bg-white ds-p-2 ds-shadow-md",c&&"ds-overflow-y-auto",n&&"ds-overflow-x-auto"),children:s.jsxRuntimeExports.jsx(H,{isMultiSelect:b,options:o,value:p,setValue:y,setIsOpen:_,onChange:g})}))})]})};I.displayName="DesktopDropdown";const M=({trigger:e,triggerContainerClassName:t,disabled:d,onOpenChange:r,getSelectedValueDisplayText:i=J,placeholder:c,value:n,options:o,isMultiSelect:x,onChange:f})=>{const[h,b]=m.useState(),g=typeof n=="undefined"?h:n,E=typeof n=="undefined"?b:()=>{},[u,p]=m.useState(!1);return e||(e=s.jsxRuntimeExports.jsx(q,{selectedOption:C(g,o),getSelectedValueDisplayText:i,placeholder:c})),d?s.jsxRuntimeExports.jsx("div",{className:t,children:e}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[s.jsxRuntimeExports.jsx("div",{className:t,onClick:()=>{p(!0),r&&r(!0)},children:e}),s.jsxRuntimeExports.jsx(s.AnimatedModal,{animation:"slideUp",show:u,handleClose:()=>{p(!1),r&&r(!1)},contentClassName:s.cn("ds-absolute ds-mb-0 ds-w-full"),className:"ds-z-[29999]",children:s.jsxRuntimeExports.jsx(G,{onClose:()=>{p(!1),r&&r(!1)},children:s.jsxRuntimeExports.jsx(H,{isMultiSelect:x,options:o,value:g,setValue:E,setIsOpen:p,onChange:f})})})]})};M.displayName="MobileDropdown";const G=({onClose:e,children:t})=>s.jsxRuntimeExports.jsxs("div",{className:"ds-mb-0 ds-flex ds-max-h-dvh ds-w-full ds-flex-col ds-bg-white",children:[s.jsxRuntimeExports.jsxs("div",{className:"ds-flex ds-shrink-0 ds-items-center ds-justify-between ds-px-8 ds-py-4",children:[s.jsxRuntimeExports.jsx("div",{onClick:e,className:"ds-flex ds-size-5 ds-cursor-pointer ds-items-center ds-justify-center",children:s.jsxRuntimeExports.jsx(s.CloseIcon,{className:"ds-size-4"})}),s.jsxRuntimeExports.jsx("div",{className:"ds-size-5"})]}),s.jsxRuntimeExports.jsx("div",{className:"ds-grow ds-overflow-y-auto ds-p-4 ds-text-xSmallCalloutRegular",children:t}),s.jsxRuntimeExports.jsx("div",{className:"ds-px-8 ds-py-4",children:s.jsxRuntimeExports.jsx(s.Button,{buttonClassName:"ds-py-3",onClick:e,children:"Close"})})]});G.displayName="MobilePopoverContentWrapper";const q=({selectedOption:e,getSelectedValueDisplayText:t,placeholder:d})=>{const r=!e||Array.isArray(e)&&e.length===0?d||"":t(e);return s.jsxRuntimeExports.jsx(N,{color:"secondary",endIcon:s.jsxRuntimeExports.jsx(s.ChevronDownRegularIcon,{className:"ds-size-4"}),buttonClassName:"ds-justify-between",children:r})},H=({options:e,isMultiSelect:t,value:d,setValue:r,setIsOpen:i,onChange:c})=>e&&e.map(n=>s.jsxRuntimeExports.jsx(ts,{onClick:()=>{let o;if(t){const x=d||[];x.includes(n.value)?o=x.filter(f=>f!==n.value):o=[...x,n.value]}else o=n.value,i(!1);r(o),c&&c(C(o,e))},option:n,isSelected:Array.isArray(d)?d.some(o=>o===n.value):d===n.value,showCheckbox:t},n.value)),ts=({onClick:e,option:t,isSelected:d,showCheckbox:r})=>s.jsxRuntimeExports.jsxs("div",{onClick:t.disabled?void 0:e,className:s.cn("ds-group ds-flex ds-min-h-[72px] ds-cursor-pointer ds-items-center ds-gap-4 ds-rounded ds-px-4 ds-py-2 ds-text-smallFootnoteEmphasized hover:ds-bg-[#F6F8FC] ds-tablet:ds-min-h-[auto] ds-tablet:ds-gap-2 ds-tablet:ds-px-2 ds-desktop:ds-text-mediumFootnoteEmphasized",!r&&"ds-transition-[padding] ds-duration-300 hover:ds-px-4"),children:[t.thumbnailUrl&&s.jsxRuntimeExports.jsx("img",{src:t.thumbnailUrl,className:"ds-h-14 ds-w-14 ds-shrink-0 ds-rounded ds-object-cover group-hover:ds-pr-0 ds-tablet:ds-h-6 ds-tablet:ds-w-9 ds-tablet:ds-rounded-sm"}),t.icon,s.jsxRuntimeExports.jsx("div",{className:s.cn("ds-flex-grow",!r&&"ds-transition-[padding] ds-duration-300 group-hover:ds-pr-0 ds-tablet:ds-pr-4"),children:t.label}),d&&!r&&s.jsxRuntimeExports.jsx(s.CheckmarkIcon,{className:"ds-size-4 ds-shrink-0"}),r&&s.jsxRuntimeExports.jsx(s.Checkbox,{isChecked:d,disabled:t.disabled})]}),C=(e,t)=>Array.isArray(e)?t.filter(d=>e.includes(d.value)):t.find(d=>d.value===e),J=e=>Array.isArray(e)?e.map(t=>t.label).join(", "):e.label;exports.Button=N;exports.ButtonsGroupSelector=U;exports.DesktopDropdown=I;exports.Dropdown=$;exports.MobileDropdown=M;exports.findOptionByValue=C;
1
+ var Y = Object.defineProperty, Z = Object.defineProperties;
2
+ var O = Object.getOwnPropertyDescriptors;
3
+ var S = Object.getOwnPropertySymbols;
4
+ var P = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
5
+ var W = (s, d, a) => d in s ? Y(s, d, { enumerable: !0, configurable: !0, writable: !0, value: a }) : s[d] = a, j = (s, d) => {
6
+ for (var a in d || (d = {}))
7
+ P.call(d, a) && W(s, a, d[a]);
8
+ if (S)
9
+ for (var a of S(d))
10
+ V.call(d, a) && W(s, a, d[a]);
11
+ return s;
12
+ }, _ = (s, d) => Z(s, O(d));
13
+ var I = (s, d) => {
14
+ var a = {};
15
+ for (var t in s)
16
+ P.call(s, t) && d.indexOf(t) < 0 && (a[t] = s[t]);
17
+ if (s != null && S)
18
+ for (var t of S(s))
19
+ d.indexOf(t) < 0 && V.call(s, t) && (a[t] = s[t]);
20
+ return a;
21
+ };
22
+ import { j as e, a as y, t as ss, c as es, p as ds, u as as, o as ts, h as ls, s as rs, r as ns, i as cs, v as is, d as os, e as us, f as xs, g as ms, F as ps, A as fs, C as hs, l as bs, w as gs, k as vs, n as ys } from "../Checkbox-DwGmxWYP.js";
23
+ import A, { forwardRef as js, useState as w, useEffect as ws } from "react";
24
+ const T = ({ children: s, size: d = "small" }) => /* @__PURE__ */ e.jsx(
25
+ "div",
26
+ {
27
+ className: `ds-flex ds-items-center ds-justify-center ${d === "small" ? "ds-h-5 ds-w-5" : "ds-h-6 ds-w-6"}`,
28
+ children: s
29
+ }
30
+ ), Ns = {
31
+ primary: "ds-bg-Background-accentEggplant-100 ds-text-Text-textPrimaryDark ds-rounded-sm hover:ds-text-Text-textPrimaryDark hover:ds-bg-Background-accentEggplant-highlight hover:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] active:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] active:ds-bg-Background-accentEggplant-darkened focus:ds-bg-Background-accentEggplant-100 focus:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] disabled:focus:ds-shadow-none disabled:ds-bg-Background-accentEggplant-20 ds-text-mediumFootnoteEmphasized",
32
+ secondary: "ds-bg-white ds-text-black ds-rounded-sm ds-border ds-border-Fills-terciary hover:ds-bg-[#F6F8FC] hover:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] active:ds-bg-[#F6F8FC] active:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] focus:ds-bg-[#F6F8FC] focus:ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] disabled:ds-border disabled:ds-border-Fills-terciary disabled:ds-text-Text-tertiary disabled:ds-bg-transparent ds-text-mediumFootnoteEmphasized"
33
+ }, Fs = {
34
+ primary: "ds-rounded-sm ds-border ds-text-black ds-border-Fills-terciary ds-bg-[#F6F8FC] ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] ds-text-mediumFootnoteEmphasized",
35
+ secondary: "ds-rounded-sm ds-bg-Background-accentEggplant-100 ds-text-Text-textPrimaryDark ds-shadow-[0px_1px_4px_0px_rgba(0,0,0,0.16)] ds-text-mediumFootnoteEmphasized"
36
+ }, z = A.forwardRef(
37
+ (v, g) => {
38
+ var x = v, {
39
+ color: s = "primary",
40
+ disabled: d = !1,
41
+ className: a,
42
+ children: t,
43
+ startIcon: i,
44
+ selected: u,
45
+ endIcon: l,
46
+ trackingId: c,
47
+ helperText: o,
48
+ helpterTextClassName: f,
49
+ buttonClassName: h
50
+ } = x, b = I(x, [
51
+ "color",
52
+ "disabled",
53
+ "className",
54
+ "children",
55
+ "startIcon",
56
+ "selected",
57
+ "endIcon",
58
+ "trackingId",
59
+ "helperText",
60
+ "helpterTextClassName",
61
+ "buttonClassName"
62
+ ]);
63
+ return /* @__PURE__ */ e.jsxs("div", { className: y("ds-flex ds-flex-col ds-gap-1", a), children: [
64
+ /* @__PURE__ */ e.jsxs(
65
+ "button",
66
+ _(j({
67
+ "data-tracking-id": c,
68
+ ref: g,
69
+ disabled: d,
70
+ className: ss(
71
+ es(
72
+ { [Fs[s]]: u, [Ns[s]]: !u },
73
+ "ds-px-2 ds-py-1",
74
+ "ds-flex ds-w-full ds-flex-1 ds-items-center ds-justify-center",
75
+ h
76
+ )
77
+ )
78
+ }, b), {
79
+ children: [
80
+ i && /* @__PURE__ */ e.jsx(T, { children: i }),
81
+ t && /* @__PURE__ */ e.jsx("div", { className: `${i ? "ds-ml-1" : ""} ${l ? "ds-mr-1" : ""}`, children: t }),
82
+ l && /* @__PURE__ */ e.jsx(T, { children: l })
83
+ ]
84
+ })
85
+ ),
86
+ o && /* @__PURE__ */ e.jsx(
87
+ "div",
88
+ {
89
+ className: y(
90
+ "ds-w-full ds-text-right ds-text-mediumFootnoteRegular",
91
+ f
92
+ ),
93
+ children: o
94
+ }
95
+ )
96
+ ] });
97
+ }
98
+ );
99
+ z.displayName = "Button";
100
+ const _s = js(
101
+ (s, d) => {
102
+ const F = s, {
103
+ value: a,
104
+ options: t,
105
+ onSelectionChange: i = () => {
106
+ },
107
+ isMultiSelect: u,
108
+ noDataError: l,
109
+ buttonMinWidth: c,
110
+ buttonWidth: o,
111
+ minSelectionError: f,
112
+ buttonsContainerClassName: h,
113
+ buttonClassName: b
114
+ } = F, g = I(F, [
115
+ "value",
116
+ "options",
117
+ "onSelectionChange",
118
+ "isMultiSelect",
119
+ "noDataError",
120
+ "buttonMinWidth",
121
+ "buttonWidth",
122
+ "minSelectionError",
123
+ "buttonsContainerClassName",
124
+ "buttonClassName"
125
+ ]), [v, x] = w([]), [m, N] = w("");
126
+ ws(() => {
127
+ a && a.length ? x(a) : x([]);
128
+ }, [a]);
129
+ const k = (r, p) => {
130
+ p.currentTarget.blur();
131
+ const n = [...v], C = n.findIndex((B) => B.value === r.value);
132
+ C !== -1 ? n.length > 1 ? (n.splice(C, 1), N("")) : N(f) : (n.push(r), N("")), x(n), i(n);
133
+ }, D = (r, p) => {
134
+ p.currentTarget.blur();
135
+ const n = [r];
136
+ x(n), i(n);
137
+ };
138
+ return /* @__PURE__ */ e.jsxs(
139
+ "div",
140
+ _(j({
141
+ ref: d
142
+ }, g), {
143
+ children: [
144
+ /* @__PURE__ */ e.jsx(
145
+ "div",
146
+ {
147
+ className: y("ds-flex ds-flex-wrap ds-items-center ds-gap-2", h),
148
+ children: t.length > 0 ? t.map((r, p) => r.type === "separator" ? /* @__PURE__ */ e.jsx(A.Fragment, { children: r.component ? r.component : /* @__PURE__ */ e.jsx("div", { className: "ds-h-full ds-min-h-[30px] ds-w-[1px] ds-bg-Fills-terciary" }) }, `separator-${p}`) : /* @__PURE__ */ e.jsx(A.Fragment, { children: u ? /* @__PURE__ */ e.jsx(
149
+ z,
150
+ {
151
+ selected: v.some((n) => n.value === r.value),
152
+ onClick: (n) => k(r, n),
153
+ color: "secondary",
154
+ style: { minWidth: c, width: o },
155
+ className: b,
156
+ startIcon: r.startIcon,
157
+ endIcon: r.endIcon,
158
+ children: r.label
159
+ }
160
+ ) : /* @__PURE__ */ e.jsx(
161
+ z,
162
+ {
163
+ selected: v.some((n) => n.value === r.value),
164
+ onClick: (n) => D(r, n),
165
+ color: "secondary",
166
+ style: { minWidth: c, width: o },
167
+ className: b,
168
+ startIcon: r.startIcon,
169
+ endIcon: r.endIcon,
170
+ children: r.label
171
+ }
172
+ ) }, r.value)) : /* @__PURE__ */ e.jsx("div", { className: "ds_xSmallSubheadRegular ds-p-2 ds-text-System-red", children: l })
173
+ }
174
+ ),
175
+ m && /* @__PURE__ */ e.jsx("div", { className: "ds_xSmallSubheadRegular ds-p-2 ds-text-System-red", children: m })
176
+ ]
177
+ })
178
+ );
179
+ }
180
+ );
181
+ _s.displayName = "ButtonsGroupSelector";
182
+ const ks = (s) => window.innerWidth < ds ? /* @__PURE__ */ e.jsx(U, j({}, s)) : /* @__PURE__ */ e.jsx($, j({}, s));
183
+ ks.displayName = "Dropdown";
184
+ const $ = ({
185
+ placement: s = "bottom-start",
186
+ trigger: d,
187
+ triggerContainerClassName: a,
188
+ disabled: t,
189
+ onOpenChange: i,
190
+ adjustHeight: u = !0,
191
+ adjustWidth: l = !0,
192
+ options: c,
193
+ getSelectedValueDisplayText: o = J,
194
+ placeholder: f,
195
+ value: h,
196
+ isMultiSelect: b,
197
+ onChange: g
198
+ }) => {
199
+ const [v, x] = w(), m = typeof h == "undefined" ? v : h, N = typeof h == "undefined" ? x : () => {
200
+ }, [k, D] = w(!1), { refs: F, floatingStyles: r, context: p } = as({
201
+ open: k,
202
+ onOpenChange: (E) => {
203
+ D(E), i && i(E);
204
+ },
205
+ middleware: [
206
+ ts(8),
207
+ ls({
208
+ crossAxis: s.includes("-"),
209
+ fallbackAxisSideDirection: "end"
210
+ }),
211
+ rs({ padding: 4 }),
212
+ ns({
213
+ apply({ availableWidth: E, availableHeight: X, elements: M }) {
214
+ u && (M.floating.style.maxHeight = `${X - 4}px`), l && (M.floating.style.maxWidth = `${E - 4}px`);
215
+ }
216
+ })
217
+ ],
218
+ whileElementsMounted: cs,
219
+ placement: s
220
+ }), n = is(p), C = os(p), B = us(p), K = xs(p), { getReferenceProps: L, getFloatingProps: Q } = ms([n, C, B, K]);
221
+ return d || (d = /* @__PURE__ */ e.jsx(
222
+ q,
223
+ {
224
+ selectedOption: R(m, c),
225
+ getSelectedValueDisplayText: o,
226
+ placeholder: f
227
+ }
228
+ )), t ? /* @__PURE__ */ e.jsx("div", { className: a, children: d }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
229
+ /* @__PURE__ */ e.jsx(
230
+ "div",
231
+ _(j({
232
+ className: y("ds-cursor-pointer", a),
233
+ ref: F.setReference
234
+ }, L()), {
235
+ children: d
236
+ })
237
+ ),
238
+ k && /* @__PURE__ */ e.jsx(ps, { children: /* @__PURE__ */ e.jsx(
239
+ "div",
240
+ _(j({
241
+ ref: F.setFloating,
242
+ style: r
243
+ }, Q()), {
244
+ className: y(
245
+ "ds-z-[29999] ds-flex ds-min-w-[200px] ds-flex-col ds-gap-1 ds-rounded ds-bg-white ds-p-2 ds-shadow-md",
246
+ u && "ds-overflow-y-auto",
247
+ l && "ds-overflow-x-auto"
248
+ ),
249
+ children: /* @__PURE__ */ e.jsx(
250
+ H,
251
+ {
252
+ isMultiSelect: b,
253
+ options: c,
254
+ value: m,
255
+ setValue: N,
256
+ setIsOpen: D,
257
+ onChange: g
258
+ }
259
+ )
260
+ })
261
+ ) })
262
+ ] });
263
+ };
264
+ $.displayName = "DesktopDropdown";
265
+ const U = ({
266
+ trigger: s,
267
+ triggerContainerClassName: d,
268
+ disabled: a,
269
+ onOpenChange: t,
270
+ getSelectedValueDisplayText: i = J,
271
+ placeholder: u,
272
+ value: l,
273
+ options: c,
274
+ isMultiSelect: o,
275
+ onChange: f
276
+ }) => {
277
+ const [h, b] = w(), g = typeof l == "undefined" ? h : l, v = typeof l == "undefined" ? b : () => {
278
+ }, [x, m] = w(!1);
279
+ return s || (s = /* @__PURE__ */ e.jsx(
280
+ q,
281
+ {
282
+ selectedOption: R(g, c),
283
+ getSelectedValueDisplayText: i,
284
+ placeholder: u
285
+ }
286
+ )), a ? /* @__PURE__ */ e.jsx("div", { className: d, children: s }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
287
+ /* @__PURE__ */ e.jsx(
288
+ "div",
289
+ {
290
+ className: d,
291
+ onClick: () => {
292
+ m(!0), t && t(!0);
293
+ },
294
+ children: s
295
+ }
296
+ ),
297
+ /* @__PURE__ */ e.jsx(
298
+ fs,
299
+ {
300
+ animation: "slideUp",
301
+ show: x,
302
+ handleClose: () => {
303
+ m(!1), t && t(!1);
304
+ },
305
+ contentClassName: y("ds-absolute ds-mb-0 ds-w-full"),
306
+ className: "ds-z-[29999]",
307
+ children: /* @__PURE__ */ e.jsx(
308
+ G,
309
+ {
310
+ onClose: () => {
311
+ m(!1), t && t(!1);
312
+ },
313
+ children: /* @__PURE__ */ e.jsx(
314
+ H,
315
+ {
316
+ isMultiSelect: o,
317
+ options: c,
318
+ value: g,
319
+ setValue: v,
320
+ setIsOpen: m,
321
+ onChange: f
322
+ }
323
+ )
324
+ }
325
+ )
326
+ }
327
+ )
328
+ ] });
329
+ };
330
+ U.displayName = "MobileDropdown";
331
+ const G = ({
332
+ onClose: s,
333
+ children: d
334
+ }) => /* @__PURE__ */ e.jsxs("div", { className: "ds-mb-0 ds-flex ds-max-h-dvh ds-w-full ds-flex-col ds-bg-white", children: [
335
+ /* @__PURE__ */ e.jsxs("div", { className: "ds-flex ds-shrink-0 ds-items-center ds-justify-between ds-px-8 ds-py-4", children: [
336
+ /* @__PURE__ */ e.jsx(
337
+ "div",
338
+ {
339
+ onClick: s,
340
+ className: "ds-flex ds-size-5 ds-cursor-pointer ds-items-center ds-justify-center",
341
+ children: /* @__PURE__ */ e.jsx(hs, { className: "ds-size-4" })
342
+ }
343
+ ),
344
+ /* @__PURE__ */ e.jsx("div", { className: "ds-size-5" })
345
+ ] }),
346
+ /* @__PURE__ */ e.jsx("div", { className: "ds-grow ds-overflow-y-auto ds-p-4 ds-text-xSmallCalloutRegular", children: d }),
347
+ /* @__PURE__ */ e.jsx("div", { className: "ds-px-8 ds-py-4", children: /* @__PURE__ */ e.jsx(
348
+ bs,
349
+ {
350
+ buttonClassName: "ds-py-3",
351
+ onClick: s,
352
+ children: "Close"
353
+ }
354
+ ) })
355
+ ] });
356
+ G.displayName = "MobilePopoverContentWrapper";
357
+ const q = ({
358
+ selectedOption: s,
359
+ getSelectedValueDisplayText: d,
360
+ placeholder: a
361
+ }) => {
362
+ const t = !s || Array.isArray(s) && s.length === 0 ? a || "" : d(s);
363
+ return /* @__PURE__ */ e.jsx(
364
+ z,
365
+ {
366
+ color: "secondary",
367
+ endIcon: /* @__PURE__ */ e.jsx(gs, { className: "ds-size-4" }),
368
+ buttonClassName: "ds-justify-between",
369
+ children: t
370
+ }
371
+ );
372
+ }, H = ({
373
+ options: s,
374
+ isMultiSelect: d,
375
+ value: a,
376
+ setValue: t,
377
+ setIsOpen: i,
378
+ onChange: u
379
+ }) => s && s.map((l) => /* @__PURE__ */ e.jsx(
380
+ Ds,
381
+ {
382
+ onClick: () => {
383
+ let c;
384
+ if (d) {
385
+ const o = a || [];
386
+ o.includes(l.value) ? c = o.filter((f) => f !== l.value) : c = [...o, l.value];
387
+ } else
388
+ c = l.value, i(!1);
389
+ t(c), u && u(R(c, s));
390
+ },
391
+ option: l,
392
+ isSelected: Array.isArray(a) ? a.some((c) => c === l.value) : a === l.value,
393
+ showCheckbox: d
394
+ },
395
+ l.value
396
+ )), Ds = ({
397
+ onClick: s,
398
+ option: d,
399
+ isSelected: a,
400
+ showCheckbox: t
401
+ }) => /* @__PURE__ */ e.jsxs(
402
+ "div",
403
+ {
404
+ onClick: d.disabled ? void 0 : s,
405
+ className: y(
406
+ "ds-group ds-flex ds-min-h-[72px] ds-cursor-pointer ds-items-center ds-gap-4 ds-rounded ds-px-4 ds-py-2 ds-text-smallFootnoteEmphasized hover:ds-bg-[#F6F8FC] ds-tablet:ds-min-h-[auto] ds-tablet:ds-gap-2 ds-tablet:ds-px-2 ds-desktop:ds-text-mediumFootnoteEmphasized",
407
+ !t && "ds-transition-[padding] ds-duration-300 hover:ds-px-4"
408
+ ),
409
+ children: [
410
+ d.thumbnailUrl && /* @__PURE__ */ e.jsx(
411
+ "img",
412
+ {
413
+ src: d.thumbnailUrl,
414
+ className: "ds-h-14 ds-w-14 ds-shrink-0 ds-rounded ds-object-cover group-hover:ds-pr-0 ds-tablet:ds-h-6 ds-tablet:ds-w-9 ds-tablet:ds-rounded-sm"
415
+ }
416
+ ),
417
+ d.icon,
418
+ /* @__PURE__ */ e.jsx(
419
+ "div",
420
+ {
421
+ className: y(
422
+ "ds-flex-grow",
423
+ !t && "ds-transition-[padding] ds-duration-300 group-hover:ds-pr-0 ds-tablet:ds-pr-4"
424
+ ),
425
+ children: d.label
426
+ }
427
+ ),
428
+ a && !t && /* @__PURE__ */ e.jsx(vs, { className: "ds-size-4 ds-shrink-0" }),
429
+ t && /* @__PURE__ */ e.jsx(
430
+ ys,
431
+ {
432
+ isChecked: a,
433
+ disabled: d.disabled
434
+ }
435
+ )
436
+ ]
437
+ }
438
+ ), R = (s, d) => Array.isArray(s) ? d.filter((a) => s.includes(a.value)) : d.find((a) => a.value === s), J = (s) => Array.isArray(s) ? s.map((d) => d.label).join(", ") : s.label;
439
+ export {
440
+ z as Button,
441
+ _s as ButtonsGroupSelector,
442
+ $ as DesktopDropdown,
443
+ ks as Dropdown,
444
+ U as MobileDropdown,
445
+ R as findOptionByValue
446
+ };