@solibo/solibo-ui 1.0.4 → 1.0.6
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/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index47.css +1 -1
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/components/aside/index.cjs +1 -1
- package/dist/components/aside/index.js +15 -15
- package/dist/components/button/index.cjs +1 -1
- package/dist/components/button/index.js +10 -10
- package/dist/components/card/index.cjs +1 -1
- package/dist/components/card/index.cjs.map +1 -1
- package/dist/components/card/index.js +44 -34
- package/dist/components/card/index.js.map +1 -1
- package/dist/components/checkbox/index.cjs +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/dropdown/index.cjs +1 -1
- package/dist/components/dropdown/index.js +101 -101
- package/dist/components/editor/index.cjs +21 -21
- package/dist/components/editor/index.cjs.map +1 -1
- package/dist/components/editor/index.js +1646 -1636
- package/dist/components/editor/index.js.map +1 -1
- package/dist/components/header/index.cjs +1 -1
- package/dist/components/header/index.js +10 -10
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +2 -2
- package/dist/components/menu/index.cjs +1 -1
- package/dist/components/menu/index.cjs.map +1 -1
- package/dist/components/menu/index.js +14 -13
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/message/index.cjs +1 -1
- package/dist/components/message/index.cjs.map +1 -1
- package/dist/components/message/index.js +22 -21
- package/dist/components/message/index.js.map +1 -1
- package/dist/components/messages/index.cjs +1 -1
- package/dist/components/messages/index.cjs.map +1 -1
- package/dist/components/messages/index.js +34 -31
- package/dist/components/messages/index.js.map +1 -1
- package/dist/components/nav/index.cjs +1 -1
- package/dist/components/nav/index.cjs.map +1 -1
- package/dist/components/nav/index.js +34 -29
- package/dist/components/nav/index.js.map +1 -1
- package/dist/components/object/index.cjs +1 -1
- package/dist/components/object/index.js +1 -1
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.cjs.map +1 -1
- package/dist/components/popover/index.js +83 -39
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/portal/index.cjs +1 -1
- package/dist/components/portal/index.js +17 -17
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +37 -37
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +2 -2
- package/dist/components/sortable/index.cjs +1 -1
- package/dist/components/sortable/index.js +1 -1
- package/dist/components/table/index.cjs +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/textarea/index.cjs +1 -1
- package/dist/components/textarea/index.js +1 -1
- package/dist/components/toast/index.cjs +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toasts/index.cjs +1 -1
- package/dist/components/toasts/index.js +1 -1
- package/dist/components/toggle/index.cjs +1 -1
- package/dist/components/toggle/index.js +1 -1
- package/dist/components/tooltip/index.cjs +1 -1
- package/dist/components/tooltip/index.js +6 -6
- package/dist/{icons-DYCSlAoX.cjs → icons-BoBeAmLe.cjs} +2 -2
- package/dist/{icons-DYCSlAoX.cjs.map → icons-BoBeAmLe.cjs.map} +1 -1
- package/dist/{icons-CKzd_L4D.js → icons-Dhj9mAkR.js} +9 -2
- package/dist/{icons-CKzd_L4D.js.map → icons-Dhj9mAkR.js.map} +1 -1
- package/dist/{index-N4IMha5Q.cjs → index-Ct0mJ-KK.cjs} +2 -2
- package/dist/{index-N4IMha5Q.cjs.map → index-Ct0mJ-KK.cjs.map} +1 -1
- package/dist/{index-DFXqYJat.js → index-D4LZQ-JF.js} +2 -2
- package/dist/{index-DFXqYJat.js.map → index-D4LZQ-JF.js.map} +1 -1
- package/dist/{index-CP5A_BGJ.cjs → index-D9Hq7ewF.cjs} +2 -2
- package/dist/{index-CP5A_BGJ.cjs.map → index-D9Hq7ewF.cjs.map} +1 -1
- package/dist/{index-B9xtLe2w.js → index-uQRsVtP-.js} +2 -2
- package/dist/{index-B9xtLe2w.js.map → index-uQRsVtP-.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +37 -11
- package/dist/index.js +39 -38
- package/dist/tokens.css +7 -2
- package/dist/tokens.json +105 -33
- package/package.json +1 -1
|
@@ -1,49 +1,59 @@
|
|
|
1
|
-
import { jsxs as d, jsx as
|
|
2
|
-
import { t as
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { Checkbox as
|
|
5
|
-
import { Figure as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import '../../assets/index32.css';const y = "
|
|
8
|
-
card:
|
|
9
|
-
head:
|
|
10
|
-
center:
|
|
11
|
-
content:
|
|
1
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { t as s } from "../../classix-DG18itHa.js";
|
|
3
|
+
import { Badge as z } from "../badge/index.js";
|
|
4
|
+
import { Checkbox as w } from "../checkbox/index.js";
|
|
5
|
+
import { Figure as u } from "../figure/index.js";
|
|
6
|
+
import { Icon as v } from "../icon/index.js";
|
|
7
|
+
import '../../assets/index32.css';const N = "_card_zhirg_1", y = "_head_zhirg_27", j = "_center_zhirg_39", D = "_content_zhirg_51", E = "_preview_zhirg_57", I = "_margin_zhirg_97", T = "_clickable_zhirg_142", $ = "_muted_zhirg_157", k = "_selected_zhirg_162", e = {
|
|
8
|
+
card: N,
|
|
9
|
+
head: y,
|
|
10
|
+
center: j,
|
|
11
|
+
content: D,
|
|
12
|
+
preview: E,
|
|
13
|
+
"preview-leading": "_preview-leading_zhirg_68",
|
|
14
|
+
"preview-trailing": "_preview-trailing_zhirg_69",
|
|
15
|
+
"preview-content": "_preview-content_zhirg_89",
|
|
12
16
|
margin: I,
|
|
13
17
|
clickable: T,
|
|
14
18
|
muted: $,
|
|
15
19
|
selected: k,
|
|
16
|
-
"image-top": "_image-
|
|
17
|
-
"image-left": "_image-
|
|
18
|
-
},
|
|
19
|
-
actions:
|
|
20
|
-
badge:
|
|
21
|
-
checkbox:
|
|
22
|
-
children:
|
|
23
|
-
emphasis:
|
|
24
|
-
header:
|
|
25
|
-
icon:
|
|
20
|
+
"image-top": "_image-top_zhirg_167",
|
|
21
|
+
"image-left": "_image-left_zhirg_178"
|
|
22
|
+
}, G = ({
|
|
23
|
+
actions: f,
|
|
24
|
+
badge: g,
|
|
25
|
+
checkbox: n,
|
|
26
|
+
children: o,
|
|
27
|
+
emphasis: p = "default",
|
|
28
|
+
header: _,
|
|
29
|
+
icon: h,
|
|
26
30
|
image: a,
|
|
27
31
|
imagePosition: c = "top",
|
|
28
32
|
onClick: l,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
preview: m,
|
|
34
|
+
variant: t = "default"
|
|
35
|
+
}) => /* @__PURE__ */ d("article", { className: s(e.card, p === "muted" && e.muted, l && e.clickable, (n == null ? void 0 : n.checked) && e.selected), "data-emphasis": p, "data-minimal": t === "minimal", onClick: l, onKeyDown: (i) => {
|
|
36
|
+
l && i.currentTarget === document.activeElement && (i.key === "Enter" || i.key === " ") && (i.preventDefault(), i.currentTarget.click());
|
|
32
37
|
}, tabIndex: l ? 0 : -1, "data-component": "card", children: [
|
|
33
|
-
a &&
|
|
38
|
+
a && t !== "minimal" && c === "top" && /* @__PURE__ */ r(u, { className: e[`image-${c}`], children: a }),
|
|
34
39
|
/* @__PURE__ */ d("section", { children: [
|
|
35
|
-
/* @__PURE__ */ d("div", { className:
|
|
36
|
-
|
|
37
|
-
a &&
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
/* @__PURE__ */ d("div", { className: s(e.head, t === "minimal" && e.center), children: [
|
|
41
|
+
n && /* @__PURE__ */ r("span", { onClick: (i) => i.stopPropagation(), children: /* @__PURE__ */ r(w, { ...n }) }),
|
|
42
|
+
a && t !== "minimal" && c === "left" && /* @__PURE__ */ r(u, { className: e[`image-${c}`], children: a }),
|
|
43
|
+
_,
|
|
44
|
+
g && /* @__PURE__ */ r(z, { ...g }),
|
|
45
|
+
h && /* @__PURE__ */ r(v, { name: h, size: "medium" }),
|
|
46
|
+
f
|
|
42
47
|
] }),
|
|
43
|
-
|
|
48
|
+
o && t !== "minimal" && /* @__PURE__ */ r("div", { className: s(e.content, !!_ && e.margin), children: o }),
|
|
49
|
+
m && t !== "minimal" && /* @__PURE__ */ d("div", { className: s(e.preview, !!_ && e.margin), children: [
|
|
50
|
+
/* @__PURE__ */ r("span", { className: e["preview-leading"], children: m.leading }),
|
|
51
|
+
/* @__PURE__ */ r("span", { className: e["preview-content"], children: m.children }),
|
|
52
|
+
/* @__PURE__ */ r("span", { className: e["preview-trailing"], children: m.trailing })
|
|
53
|
+
] })
|
|
44
54
|
] })
|
|
45
55
|
] });
|
|
46
56
|
export {
|
|
47
|
-
|
|
57
|
+
G as Card
|
|
48
58
|
};
|
|
49
59
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/card/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { Badge, BadgeProps } from '@/components/badge';\nimport { Checkbox, CheckboxProps } from '@/components/checkbox';\nimport { Figure } from '@/components/figure';\nimport { Icon } from '@/components/icon';\nimport { IconName } from '@/components/icon/icons.ts';\n\nimport styles from './styles.module.css';\n\ntype BaseCardProps = {\n actions?: React.ReactNode;\n badge?: BadgeProps;\n checkbox?: CheckboxProps;\n emphasis?: 'default' | 'muted';\n icon?: IconName;\n onClick?: React.MouseEventHandler<HTMLElement>;\n};\n\ntype DefaultCardProps = BaseCardProps & {\n children?: React.ReactNode;\n header?: React.ReactNode;\n image?: React.ReactNode;\n imagePosition?: 'top' | 'left';\n variant?: 'default';\n};\n\ntype MinimalCardProps = BaseCardProps & {\n children?: never;\n header: React.ReactNode;\n image?: never;\n imagePosition?: never;\n variant: 'minimal';\n};\n\nexport type CardProps = DefaultCardProps | MinimalCardProps;\n\nexport const Card = ({\n actions,\n badge,\n checkbox,\n children,\n emphasis = 'default',\n header,\n icon,\n image,\n imagePosition = 'top',\n onClick,\n variant = 'default',\n}: CardProps) => {\n return (\n <article\n className={cx(\n styles.card,\n emphasis === 'muted' && styles.muted,\n onClick && styles.clickable,\n checkbox?.checked && styles.selected\n )}\n data-emphasis={emphasis}\n data-minimal={variant === 'minimal'}\n onClick={onClick}\n onKeyDown={(e) => {\n if (!onClick) return;\n\n if (e.currentTarget !== document.activeElement) {\n return;\n }\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.currentTarget.click();\n }\n }}\n tabIndex={onClick ? 0 : -1}\n >\n {image && variant !== 'minimal' && imagePosition === 'top' && (\n <Figure className={styles[`image-${imagePosition}`]}>{image}</Figure>\n )}\n <section>\n <div className={cx(styles.head, variant === 'minimal' && styles.center)}>\n {checkbox && (\n <span onClick={(e) => e.stopPropagation()}>\n <Checkbox {...checkbox} />\n </span>\n )}\n {image && variant !== 'minimal' && imagePosition === 'left' && (\n <Figure className={styles[`image-${imagePosition}`]}>{image}</Figure>\n )}\n {header}\n {badge && <Badge {...badge} />}\n {icon && (\n <Icon\n name={icon}\n size='medium'\n />\n )}\n {actions}\n </div>\n {children && variant !== 'minimal' && (\n <div className={cx(styles.content, !!header && styles.margin)}>{children}</div>\n )}\n </section>\n </article>\n );\n};\n"],"names":["Card","actions","badge","checkbox","children","emphasis","header","icon","image","imagePosition","onClick","variant","jsxs","cx","styles","card","muted","clickable","checked","selected","e","currentTarget","document","activeElement","key","preventDefault","click","jsx","Figure","head","center","stopPropagation","Checkbox","Badge","Icon","content","margin"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/card/index.tsx"],"sourcesContent":["import cx from 'classix';\n\nimport { Badge, BadgeProps } from '@/components/badge';\nimport { Checkbox, CheckboxProps } from '@/components/checkbox';\nimport { Figure } from '@/components/figure';\nimport { Icon } from '@/components/icon';\nimport { IconName } from '@/components/icon/icons.ts';\n\nimport styles from './styles.module.css';\n\ntype BaseCardProps = {\n actions?: React.ReactNode;\n badge?: BadgeProps;\n checkbox?: CheckboxProps;\n emphasis?: 'default' | 'muted';\n icon?: IconName;\n onClick?: React.MouseEventHandler<HTMLElement>;\n};\n\nexport type CardPreviewProps = {\n children: React.ReactNode;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n};\n\ntype DefaultCardProps = BaseCardProps & {\n children?: React.ReactNode;\n header?: React.ReactNode;\n image?: React.ReactNode;\n imagePosition?: 'top' | 'left';\n preview?: CardPreviewProps;\n variant?: 'default';\n};\n\ntype MinimalCardProps = BaseCardProps & {\n children?: never;\n header: React.ReactNode;\n image?: never;\n imagePosition?: never;\n preview?: never;\n variant: 'minimal';\n};\n\nexport type CardProps = DefaultCardProps | MinimalCardProps;\n\nexport const Card = ({\n actions,\n badge,\n checkbox,\n children,\n emphasis = 'default',\n header,\n icon,\n image,\n imagePosition = 'top',\n onClick,\n preview,\n variant = 'default',\n}: CardProps) => {\n return (\n <article\n className={cx(\n styles.card,\n emphasis === 'muted' && styles.muted,\n onClick && styles.clickable,\n checkbox?.checked && styles.selected\n )}\n data-emphasis={emphasis}\n data-minimal={variant === 'minimal'}\n onClick={onClick}\n onKeyDown={(e) => {\n if (!onClick) return;\n\n if (e.currentTarget !== document.activeElement) {\n return;\n }\n\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.currentTarget.click();\n }\n }}\n tabIndex={onClick ? 0 : -1}\n >\n {image && variant !== 'minimal' && imagePosition === 'top' && (\n <Figure className={styles[`image-${imagePosition}`]}>{image}</Figure>\n )}\n <section>\n <div className={cx(styles.head, variant === 'minimal' && styles.center)}>\n {checkbox && (\n <span onClick={(e) => e.stopPropagation()}>\n <Checkbox {...checkbox} />\n </span>\n )}\n {image && variant !== 'minimal' && imagePosition === 'left' && (\n <Figure className={styles[`image-${imagePosition}`]}>{image}</Figure>\n )}\n {header}\n {badge && <Badge {...badge} />}\n {icon && (\n <Icon\n name={icon}\n size='medium'\n />\n )}\n {actions}\n </div>\n {children && variant !== 'minimal' && (\n <div className={cx(styles.content, !!header && styles.margin)}>{children}</div>\n )}\n {preview && variant !== 'minimal' && (\n <div className={cx(styles.preview, !!header && styles.margin)}>\n <span className={styles['preview-leading']}>{preview.leading}</span>\n <span className={styles['preview-content']}>{preview.children}</span>\n <span className={styles['preview-trailing']}>{preview.trailing}</span>\n </div>\n )}\n </section>\n </article>\n );\n};\n"],"names":["Card","actions","badge","checkbox","children","emphasis","header","icon","image","imagePosition","onClick","preview","variant","jsxs","cx","styles","card","muted","clickable","checked","selected","e","currentTarget","document","activeElement","key","preventDefault","click","jsx","Figure","head","center","stopPropagation","Checkbox","Badge","Icon","content","margin","leading","trailing"],"mappings":";;;;;;;;;;;;;;;;;;;;;GA6CaA,IAAOA,CAAC;AAAA,EACnBC,SAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,QAAAA;AAAAA,EACAC,MAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,eAAAA,IAAgB;AAAA,EAChBC,SAAAA;AAAAA,EACAC,SAAAA;AAAAA,EACAC,SAAAA,IAAU;AACD,MAEP,gBAAAC,EAAC,WAAA,EACC,WAAWC,EACTC,EAAOC,MACPX,MAAa,WAAWU,EAAOE,OAC/BP,KAAWK,EAAOG,YAClBf,KAAAA,gBAAAA,EAAUgB,YAAWJ,EAAOK,QAC9B,GACA,iBAAef,GACf,gBAAcO,MAAY,WAC1B,SAAAF,GACA,WAAYW,CAAAA,MAAM;AAChB,EAAKX,KAEDW,EAAEC,kBAAkBC,SAASC,kBAI7BH,EAAEI,QAAQ,WAAWJ,EAAEI,QAAQ,SACjCJ,EAAEK,eAAAA,GACFL,EAAEC,cAAcK,MAAAA;AAEpB,GACA,UAAUjB,IAAU,IAAI,IAAG,kBAAA,QAE1BF,UAAAA;AAAAA,EAAAA,KAASI,MAAY,aAAaH,MAAkB,SACnD,gBAAAmB,EAACC,GAAA,EAAO,WAAWd,EAAO,SAASN,CAAa,EAAE,GAAID,UAAAA,GAAM;AAAA,oBAE7D,WAAA,EACC,UAAA;AAAA,IAAA,gBAAAK,EAAC,OAAA,EAAI,WAAWC,EAAGC,EAAOe,MAAMlB,MAAY,aAAaG,EAAOgB,MAAM,GACnE5B,UAAAA;AAAAA,MAAAA,KACC,gBAAAyB,EAAC,QAAA,EAAK,SAAUP,CAAAA,MAAMA,EAAEW,gBAAAA,GACtB,UAAA,gBAAAJ,EAACK,GAAA,EAAS,GAAI9B,EAAAA,CAAS,GACzB;AAAA,MAEDK,KAASI,MAAY,aAAaH,MAAkB,UACnD,gBAAAmB,EAACC,GAAA,EAAO,WAAWd,EAAO,SAASN,CAAa,EAAE,GAAID,UAAAA,GAAM;AAAA,MAE7DF;AAAAA,MACAJ,KAAS,gBAAA0B,EAACM,GAAA,EAAM,GAAIhC,EAAAA,CAAM;AAAA,MAC1BK,KACC,gBAAAqB,EAACO,GAAA,EACC,MAAM5B,GACN,MAAK,UAAQ;AAAA,MAGhBN;AAAAA,IAAAA,GACH;AAAA,IACCG,KAAYQ,MAAY,aACvB,gBAAAgB,EAAC,SAAI,WAAWd,EAAGC,EAAOqB,SAAS,CAAC,CAAC9B,KAAUS,EAAOsB,MAAM,GAAIjC,UAAAA,GAAS;AAAA,IAE1EO,KAAWC,MAAY,aACtB,gBAAAC,EAAC,SAAI,WAAWC,EAAGC,EAAOJ,SAAS,CAAC,CAACL,KAAUS,EAAOsB,MAAM,GAC1D,UAAA;AAAA,MAAA,gBAAAT,EAAC,UAAK,WAAWb,EAAO,iBAAiB,GAAIJ,YAAQ2B,SAAQ;AAAA,wBAC5D,QAAA,EAAK,WAAWvB,EAAO,iBAAiB,GAAIJ,YAAQP,UAAS;AAAA,wBAC7D,QAAA,EAAK,WAAWW,EAAO,kBAAkB,GAAIJ,YAAQ4B,SAAAA,CAAS;AAAA,IAAA,EAAA,CACjE;AAAA,EAAA,EAAA,CAEJ;AAAA,GACF;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index33.css');const e=require("react/jsx-runtime"),x=require("../../icons-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index33.css');const e=require("react/jsx-runtime"),x=require("../../icons-BoBeAmLe.cjs"),b=require("../loading/index.cjs"),h="_checkbox_1glqu_3",u={checkbox:h},k=({checked:s,disabled:t,isLoading:c,label:o,onChange:n,...i})=>{const r={"--icon-svg":x.iconSVG("check")};return e.jsxs("label",{className:u.checkbox,"data-component":"checkbox",children:[e.jsx("input",{checked:s,disabled:t||c,onChange:n,type:"checkbox",style:r,...i}),c&&e.jsx(b.Loading,{size:16,sticky:!0}),o&&o]})};exports.Checkbox=k;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { i as x } from "../../icons-
|
|
2
|
+
import { i as x } from "../../icons-Dhj9mAkR.js";
|
|
3
3
|
import { Loading as k } from "../loading/index.js";
|
|
4
4
|
import '../../assets/index33.css';const b = "_checkbox_1glqu_3", m = {
|
|
5
5
|
checkbox: b
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('../../assets/index39.css');const s=require("react/jsx-runtime"),N=require("../../classix-5H4IWnMA.cjs"),a=require("react"),F=require("../button/index.cjs"),ce=require("../../icons-BoBeAmLe.cjs"),X=require("../../index-D9Hq7ewF.cjs"),ue=require("../list/index.cjs"),V=require("../../index-Ct0mJ-KK.cjs");function L(t){return typeof t=="string"||typeof t=="number"?String(t):Array.isArray(t)?t.map(L).join(" "):a.isValidElement(t)?L(t.props.children):""}function de(t){return a.isValidElement(t)&&t.type==="option"}function pe(t){return a.isValidElement(t)&&t.type==="optgroup"}function fe(t){return a.isValidElement(t)&&t.type===a.Fragment}function me(t){return a.isValidElement(t)&&t.type===V.Select}function W(t,i,r=!1){const l=[];return a.Children.forEach(t,n=>{if(fe(n))l.push(...W(n.props.children,i,r));else if(de(n)){const c=L(n.props.children).trim(),f=n.props.value!=null?String(n.props.value):c;l.push({disabled:r||!!n.props.disabled,groupLabel:i,hidden:!!n.props.hidden,isPlaceholder:!!(n.props.hidden&&f===""),label:n.props.children,selected:!!n.props.selected,text:c,value:f})}else pe(n)&&l.push(...W(n.props.children,n.props.label,r||!!n.props.disabled))}),l}function xe(t){const i=t.trim();if(!i)return null;const l=[.../[*?]/.test(i)?i:`*${i}*`].map(n=>n==="*"?".*":n==="?"?".":n.replace(/[|\\{}()[\]^$+.,]/g,"\\$&")).join("");return new RegExp(`^${l}$`,"i")}function ge(t,i){const r=xe(i),l=t.filter(n=>!n.hidden&&!n.isPlaceholder);return r?l.filter(n=>r.test([n.groupLabel,n.text,n.value].filter(Boolean).join(" "))):l}function _e(t,i){return t.find(r=>r.value===i)??t.find(r=>r.isPlaceholder)??t[0]}function he(t,i,r){var l,n;return i!=null?String(i):r!=null?String(r):((l=t.find(c=>c.selected))==null?void 0:l.value)??((n=t[0])==null?void 0:n.value)??""}function be(t){if(me(t)){const{children:i,placeholder:r,...l}=t.props;return{children:s.jsxs(s.Fragment,{children:[r&&s.jsx("option",{hidden:!0,value:"",children:r}),i]}),props:l}}return{children:t.props.children,props:t.props}}const ve="_combobox_1x1gr_3",ye="_dropdown_1x1gr_27",je="_empty_1x1gr_30",we="_group_1x1gr_31",Se="_placeholder_1x1gr_32",Ce="_filter_1x1gr_40",Ee="_native_1x1gr_52",Ne="_option_1x1gr_62",Ve="_options_1x1gr_84",Le="_panel_1x1gr_108",Re="_selected_1x1gr_132",$e="_text_1x1gr_136",Be="_trigger_1x1gr_145",Ie="_minimal_1x1gr_164",qe="_inline_1x1gr_219",De="_label_1x1gr_251",o={combobox:ve,"combobox-input":"_combobox-input_1x1gr_12",dropdown:ye,empty:je,group:we,placeholder:Se,filter:Ce,native:Ee,option:Ne,options:Ve,panel:Le,selected:Re,text:$e,trigger:Be,minimal:Ie,inline:qe,label:De,"inline-field":"_inline-field_1x1gr_257"};function Y(t,i){return{"--icon-svg":ce.iconSVG(t).replace("currentColor",i)}}const Pe=({children:t,className:i,combobox:r=!1,createOption:l,emptyLabel:n="No matches found",label:c,renderOption:f,searchPlaceholder:R="Filter",selectedItems:Z,variant:_="default",...ee})=>{const $=be(t),{defaultValue:te,onChange:B,value:I,...ne}=$.props,v=V.sanitizeSelectProps(ne),M=a.useRef(null),Q=a.useRef(null),y=a.useId(),z=a.useRef(null),m=a.useRef(null),h=W($.children),b=I!=null,q=he(h,I,te),[D,P]=a.useState(()=>q),[u,p]=a.useState(!1),[j,w]=a.useState(""),S=b?String(I):D,O={default:V.resolveColor("--colors-semantic-content-secondary"),white:V.resolveColor("--color-white","white")},T=_==="minimal"?O.white:O.default,C=_e(h,S),re=Y("chevron",T),le=Y("search",T),A=ge(h,j),x=j.trim(),E=!!(r&&l&&x&&l.isValid(x)),se=c&&_==="inline"?X.formatInlineLabel(c):c,G=e=>e?(f==null?void 0:f({groupLabel:e.groupLabel,isSelected:e.value===S,label:e.label,text:e.text,value:e.value}))??e.label:"Select an option";a.useEffect(()=>{!b&&!h.some(e=>e.value===D)&&P(q)},[q,D,b,h]),a.useEffect(()=>{var e;if(!u){w("");return}(e=m.current)==null||e.focus()},[u]),a.useEffect(()=>{if(!u)return;const e=d=>{var g;(g=Q.current)!=null&&g.contains(d.target)||p(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);const oe=e=>{b||P(e.target.value),B==null||B(e)},k=()=>{var e;p(!1),r||(e=M.current)==null||e.focus()},K=()=>{var e;w(""),p(!0),(e=m.current)==null||e.focus()},H=()=>{!l||!E||(l.onCreate(x),K())},ie=e=>{var U;b||P(e);const d=z.current;if(!d){k();return}const g=(U=Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype,"value"))==null?void 0:U.set;g==null||g.call(d,e),d.dispatchEvent(new Event("change",{bubbles:!0})),r?K():k()},ae=e=>{e.key==="Escape"&&k(),e.key==="Enter"&&e.target===m.current&&E&&(e.preventDefault(),H())},J=s.jsxs("div",{className:N.t(o.dropdown,_==="inline"&&o.inline,_==="minimal"&&o.minimal,i),onKeyDown:ae,ref:Q,...ee,children:[s.jsx("select",{...v,"aria-hidden":"true",className:o.native,onChange:oe,ref:z,tabIndex:-1,value:S,children:$.children}),r?s.jsxs("div",{className:o.combobox,onClick:()=>{var e;return(e=m.current)==null?void 0:e.focus()},children:[Z,s.jsx("input",{"aria-autocomplete":"list","aria-expanded":u,"aria-label":v["aria-label"]??c??R,className:o["combobox-input"],disabled:v.disabled,onChange:e=>{w(e.target.value),p(!0)},onClick:()=>p(!0),onFocus:()=>p(!0),placeholder:R||void 0,ref:m,role:"combobox",type:"text",value:j})]}):s.jsx(F.Button,{"aria-expanded":u,"aria-haspopup":"dialog","aria-labelledby":c?`${y} ${y}-value`:void 0,className:N.t(o.trigger,(C==null?void 0:C.isPlaceholder)&&o.placeholder),"data-open":u?"true":void 0,disabled:v.disabled,onClick:()=>p(e=>!e),ref:M,style:re,variant:"tertiary",children:s.jsx("span",{className:o.text,id:`${y}-value`,children:G(C)})}),u&&s.jsxs("div",{className:o.panel,children:[!r&&s.jsx(X.Input,{"aria-label":"Filter",className:o.filter,icon:"search",onChange:e=>w(e.target.value),placeholder:R,ref:m,style:le,type:"search",value:j}),s.jsxs(ue.List,{"aria-label":"Dropdown",className:o.options,children:[A.map(e=>{const d=e.value===S;return s.jsx("li",{"data-component":"dropdown",children:s.jsxs(F.Button,{"aria-label":d?`${e.text}, selected`:e.text,className:N.t(o.option,d&&o.selected),disabled:e.disabled,onClick:()=>ie(e.value),variant:"tertiary",children:[s.jsx("span",{className:o.text,children:G(e)}),e.groupLabel&&s.jsx("small",{className:o.group,children:e.groupLabel})]})},`${e.groupLabel??"root"}-${e.value}`)}),E&&l&&s.jsx("li",{children:s.jsx(F.Button,{"aria-label":L(l.render(x))||x,className:o.option,onClick:H,variant:"tertiary",children:s.jsx("span",{className:o.text,children:l.render(x)})})}),A.length===0&&!E&&s.jsx("li",{className:o.empty,children:n})]})]})]});return c?s.jsxs("div",{className:N.t(o.label,_==="inline"&&o["inline-field"]),"data-component":"dropdown",children:[s.jsx("span",{id:y,children:se}),J]}):J};exports.Dropdown=Pe;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as p, Fragment as pe, jsx as
|
|
2
|
-
import { t as
|
|
3
|
-
import fe, { Children as me, isValidElement as v, useRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { i as
|
|
6
|
-
import { f as
|
|
7
|
-
import { List as
|
|
8
|
-
import { S as ve, s as
|
|
9
|
-
import '../../assets/index39.css';function
|
|
10
|
-
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map(
|
|
1
|
+
import { jsxs as p, Fragment as pe, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { t as I } from "../../classix-DG18itHa.js";
|
|
3
|
+
import fe, { Children as me, isValidElement as v, useRef as L, useId as ge, useState as Q, useEffect as z } from "react";
|
|
4
|
+
import { Button as M } from "../button/index.js";
|
|
5
|
+
import { i as he } from "../../icons-Dhj9mAkR.js";
|
|
6
|
+
import { f as _e, I as be } from "../../index-D4LZQ-JF.js";
|
|
7
|
+
import { List as xe } from "../list/index.js";
|
|
8
|
+
import { S as ve, s as ye, r as ee } from "../../index-uQRsVtP-.js";
|
|
9
|
+
import '../../assets/index39.css';function $(t) {
|
|
10
|
+
return typeof t == "string" || typeof t == "number" ? String(t) : Array.isArray(t) ? t.map($).join(" ") : v(t) ? $(t.props.children) : "";
|
|
11
11
|
}
|
|
12
12
|
function we(t) {
|
|
13
13
|
return v(t) && t.type === "option";
|
|
@@ -15,22 +15,22 @@ function we(t) {
|
|
|
15
15
|
function Se(t) {
|
|
16
16
|
return v(t) && t.type === "optgroup";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Ne(t) {
|
|
19
19
|
return v(t) && t.type === fe.Fragment;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Ce(t) {
|
|
22
22
|
return v(t) && t.type === ve;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function A(t, i, r = !1) {
|
|
25
25
|
const l = [];
|
|
26
26
|
return me.forEach(t, (n) => {
|
|
27
|
-
if (
|
|
28
|
-
l.push(...
|
|
27
|
+
if (Ne(n))
|
|
28
|
+
l.push(...A(n.props.children, i, r));
|
|
29
29
|
else if (we(n)) {
|
|
30
|
-
const a =
|
|
30
|
+
const a = $(n.props.children).trim(), f = n.props.value != null ? String(n.props.value) : a;
|
|
31
31
|
l.push({
|
|
32
32
|
disabled: r || !!n.props.disabled,
|
|
33
|
-
groupLabel:
|
|
33
|
+
groupLabel: i,
|
|
34
34
|
hidden: !!n.props.hidden,
|
|
35
35
|
isPlaceholder: !!(n.props.hidden && f === ""),
|
|
36
36
|
label: n.props.children,
|
|
@@ -38,37 +38,37 @@ function M(t, o, r = !1) {
|
|
|
38
38
|
text: a,
|
|
39
39
|
value: f
|
|
40
40
|
});
|
|
41
|
-
} else Se(n) && l.push(...
|
|
41
|
+
} else Se(n) && l.push(...A(n.props.children, n.props.label, r || !!n.props.disabled));
|
|
42
42
|
}), l;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
46
|
-
if (!
|
|
47
|
-
const l = [.../[*?]/.test(
|
|
44
|
+
function Ee(t) {
|
|
45
|
+
const i = t.trim();
|
|
46
|
+
if (!i) return null;
|
|
47
|
+
const l = [.../[*?]/.test(i) ? i : `*${i}*`].map((n) => n === "*" ? ".*" : n === "?" ? "." : n.replace(/[|\\{}()[\]^$+.,]/g, "\\$&")).join("");
|
|
48
48
|
return new RegExp(`^${l}$`, "i");
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
const r =
|
|
50
|
+
function Ve(t, i) {
|
|
51
|
+
const r = Ee(i), l = t.filter((n) => !n.hidden && !n.isPlaceholder);
|
|
52
52
|
return r ? l.filter((n) => r.test([n.groupLabel, n.text, n.value].filter(Boolean).join(" "))) : l;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return t.find((r) => r.value ===
|
|
54
|
+
function Ie(t, i) {
|
|
55
|
+
return t.find((r) => r.value === i) ?? t.find((r) => r.isPlaceholder) ?? t[0];
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function Le(t, i, r) {
|
|
58
58
|
var l, n;
|
|
59
|
-
return
|
|
59
|
+
return i != null ? String(i) : r != null ? String(r) : ((l = t.find((a) => a.selected)) == null ? void 0 : l.value) ?? ((n = t[0]) == null ? void 0 : n.value) ?? "";
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
61
|
+
function $e(t) {
|
|
62
|
+
if (Ce(t)) {
|
|
63
63
|
const {
|
|
64
|
-
children:
|
|
64
|
+
children: i,
|
|
65
65
|
placeholder: r,
|
|
66
66
|
...l
|
|
67
67
|
} = t.props;
|
|
68
68
|
return {
|
|
69
69
|
children: /* @__PURE__ */ p(pe, { children: [
|
|
70
|
-
r && /* @__PURE__ */
|
|
71
|
-
|
|
70
|
+
r && /* @__PURE__ */ s("option", { hidden: !0, value: "", children: r }),
|
|
71
|
+
i
|
|
72
72
|
] }),
|
|
73
73
|
props: l
|
|
74
74
|
};
|
|
@@ -78,131 +78,131 @@ function Le(t) {
|
|
|
78
78
|
props: t.props
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
const
|
|
82
|
-
combobox:
|
|
83
|
-
"combobox-input": "_combobox-
|
|
84
|
-
dropdown:
|
|
85
|
-
empty:
|
|
86
|
-
group:
|
|
87
|
-
placeholder:
|
|
88
|
-
filter:
|
|
89
|
-
native:
|
|
90
|
-
option:
|
|
91
|
-
options:
|
|
92
|
-
panel:
|
|
93
|
-
selected:
|
|
94
|
-
text:
|
|
95
|
-
trigger:
|
|
96
|
-
minimal:
|
|
97
|
-
inline:
|
|
98
|
-
label:
|
|
99
|
-
"inline-field": "_inline-
|
|
81
|
+
const Be = "_combobox_1x1gr_3", ke = "_dropdown_1x1gr_27", De = "_empty_1x1gr_30", Pe = "_group_1x1gr_31", Re = "_placeholder_1x1gr_32", je = "_filter_1x1gr_40", Fe = "_native_1x1gr_52", We = "_option_1x1gr_62", Qe = "_options_1x1gr_84", ze = "_panel_1x1gr_108", Me = "_selected_1x1gr_132", Ae = "_text_1x1gr_136", Ge = "_trigger_1x1gr_145", Ke = "_minimal_1x1gr_164", Oe = "_inline_1x1gr_219", Te = "_label_1x1gr_251", o = {
|
|
82
|
+
combobox: Be,
|
|
83
|
+
"combobox-input": "_combobox-input_1x1gr_12",
|
|
84
|
+
dropdown: ke,
|
|
85
|
+
empty: De,
|
|
86
|
+
group: Pe,
|
|
87
|
+
placeholder: Re,
|
|
88
|
+
filter: je,
|
|
89
|
+
native: Fe,
|
|
90
|
+
option: We,
|
|
91
|
+
options: Qe,
|
|
92
|
+
panel: ze,
|
|
93
|
+
selected: Me,
|
|
94
|
+
text: Ae,
|
|
95
|
+
trigger: Ge,
|
|
96
|
+
minimal: Ke,
|
|
97
|
+
inline: Oe,
|
|
98
|
+
label: Te,
|
|
99
|
+
"inline-field": "_inline-field_1x1gr_257"
|
|
100
100
|
};
|
|
101
|
-
function te(t,
|
|
101
|
+
function te(t, i) {
|
|
102
102
|
return {
|
|
103
|
-
"--icon-svg":
|
|
103
|
+
"--icon-svg": he(t).replace("currentColor", i)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
const tt = ({
|
|
107
107
|
children: t,
|
|
108
|
-
className:
|
|
108
|
+
className: i,
|
|
109
109
|
combobox: r = !1,
|
|
110
110
|
createOption: l,
|
|
111
111
|
emptyLabel: n = "No matches found",
|
|
112
112
|
label: a,
|
|
113
113
|
renderOption: f,
|
|
114
|
-
searchPlaceholder:
|
|
114
|
+
searchPlaceholder: B = "Filter",
|
|
115
115
|
selectedItems: ne,
|
|
116
|
-
variant:
|
|
116
|
+
variant: _ = "default",
|
|
117
117
|
...re
|
|
118
118
|
}) => {
|
|
119
|
-
const
|
|
119
|
+
const k = $e(t), {
|
|
120
120
|
defaultValue: le,
|
|
121
|
-
onChange:
|
|
122
|
-
value:
|
|
123
|
-
...
|
|
124
|
-
} =
|
|
121
|
+
onChange: D,
|
|
122
|
+
value: P,
|
|
123
|
+
...oe
|
|
124
|
+
} = k.props, y = ye(oe), G = L(null), K = L(null), w = ge(), O = L(null), m = L(null), b = A(k.children), x = P != null, R = Le(b, P, le), [j, F] = Q(() => R), [c, d] = Q(!1), [S, N] = Q(""), C = x ? String(P) : j, T = {
|
|
125
125
|
default: ee("--colors-semantic-content-secondary"),
|
|
126
126
|
white: ee("--color-white", "white")
|
|
127
|
-
},
|
|
127
|
+
}, q = _ === "minimal" ? T.white : T.default, E = Ie(b, C), ie = te("chevron", q), se = te("search", q), H = Ve(b, S), g = S.trim(), V = !!(r && l && g && l.isValid(g)), ae = a && _ === "inline" ? _e(a) : a, J = (e) => e ? (f == null ? void 0 : f({
|
|
128
128
|
groupLabel: e.groupLabel,
|
|
129
|
-
isSelected: e.value ===
|
|
129
|
+
isSelected: e.value === C,
|
|
130
130
|
label: e.label,
|
|
131
131
|
text: e.text,
|
|
132
132
|
value: e.value
|
|
133
133
|
})) ?? e.label : "Select an option";
|
|
134
|
-
|
|
135
|
-
!
|
|
136
|
-
}, [
|
|
134
|
+
z(() => {
|
|
135
|
+
!x && !b.some((e) => e.value === j) && F(R);
|
|
136
|
+
}, [R, j, x, b]), z(() => {
|
|
137
137
|
var e;
|
|
138
138
|
if (!c) {
|
|
139
|
-
|
|
139
|
+
N("");
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
(e = m.current) == null || e.focus();
|
|
143
|
-
}, [c]),
|
|
143
|
+
}, [c]), z(() => {
|
|
144
144
|
if (!c)
|
|
145
145
|
return;
|
|
146
146
|
const e = (u) => {
|
|
147
|
-
var
|
|
148
|
-
(
|
|
147
|
+
var h;
|
|
148
|
+
(h = K.current) != null && h.contains(u.target) || d(!1);
|
|
149
149
|
};
|
|
150
150
|
return document.addEventListener("mousedown", e), () => {
|
|
151
151
|
document.removeEventListener("mousedown", e);
|
|
152
152
|
};
|
|
153
153
|
}, [c]);
|
|
154
154
|
const ce = (e) => {
|
|
155
|
-
|
|
156
|
-
},
|
|
155
|
+
x || F(e.target.value), D == null || D(e);
|
|
156
|
+
}, W = () => {
|
|
157
157
|
var e;
|
|
158
|
-
d(!1), r || (e =
|
|
158
|
+
d(!1), r || (e = G.current) == null || e.focus();
|
|
159
159
|
}, U = () => {
|
|
160
160
|
var e;
|
|
161
|
-
|
|
161
|
+
N(""), d(!0), (e = m.current) == null || e.focus();
|
|
162
162
|
}, X = () => {
|
|
163
|
-
!l || !
|
|
163
|
+
!l || !V || (l.onCreate(g), U());
|
|
164
164
|
}, ue = (e) => {
|
|
165
165
|
var Z;
|
|
166
|
-
|
|
167
|
-
const u =
|
|
166
|
+
x || F(e);
|
|
167
|
+
const u = O.current;
|
|
168
168
|
if (!u) {
|
|
169
|
-
|
|
169
|
+
W();
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
172
|
+
const h = (Z = Object.getOwnPropertyDescriptor(HTMLSelectElement.prototype, "value")) == null ? void 0 : Z.set;
|
|
173
|
+
h == null || h.call(u, e), u.dispatchEvent(new Event("change", {
|
|
174
174
|
bubbles: !0
|
|
175
|
-
})), r ? U() :
|
|
175
|
+
})), r ? U() : W();
|
|
176
176
|
}, de = (e) => {
|
|
177
|
-
e.key === "Escape" &&
|
|
178
|
-
}, Y = /* @__PURE__ */ p("div", { className:
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
r ? /* @__PURE__ */ p("div", { className:
|
|
177
|
+
e.key === "Escape" && W(), e.key === "Enter" && e.target === m.current && V && (e.preventDefault(), X());
|
|
178
|
+
}, Y = /* @__PURE__ */ p("div", { className: I(o.dropdown, _ === "inline" && o.inline, _ === "minimal" && o.minimal, i), onKeyDown: de, ref: K, ...re, children: [
|
|
179
|
+
/* @__PURE__ */ s("select", { ...y, "aria-hidden": "true", className: o.native, onChange: ce, ref: O, tabIndex: -1, value: C, children: k.children }),
|
|
180
|
+
r ? /* @__PURE__ */ p("div", { className: o.combobox, onClick: () => {
|
|
181
181
|
var e;
|
|
182
182
|
return (e = m.current) == null ? void 0 : e.focus();
|
|
183
183
|
}, children: [
|
|
184
184
|
ne,
|
|
185
|
-
/* @__PURE__ */
|
|
186
|
-
|
|
187
|
-
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder:
|
|
188
|
-
] }) : /* @__PURE__ */
|
|
189
|
-
c && /* @__PURE__ */ p("div", { className:
|
|
190
|
-
!r && /* @__PURE__ */
|
|
191
|
-
/* @__PURE__ */ p(
|
|
185
|
+
/* @__PURE__ */ s("input", { "aria-autocomplete": "list", "aria-expanded": c, "aria-label": y["aria-label"] ?? a ?? B, className: o["combobox-input"], disabled: y.disabled, onChange: (e) => {
|
|
186
|
+
N(e.target.value), d(!0);
|
|
187
|
+
}, onClick: () => d(!0), onFocus: () => d(!0), placeholder: B || void 0, ref: m, role: "combobox", type: "text", value: S })
|
|
188
|
+
] }) : /* @__PURE__ */ s(M, { "aria-expanded": c, "aria-haspopup": "dialog", "aria-labelledby": a ? `${w} ${w}-value` : void 0, className: I(o.trigger, (E == null ? void 0 : E.isPlaceholder) && o.placeholder), "data-open": c ? "true" : void 0, disabled: y.disabled, onClick: () => d((e) => !e), ref: G, style: ie, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, id: `${w}-value`, children: J(E) }) }),
|
|
189
|
+
c && /* @__PURE__ */ p("div", { className: o.panel, children: [
|
|
190
|
+
!r && /* @__PURE__ */ s(be, { "aria-label": "Filter", className: o.filter, icon: "search", onChange: (e) => N(e.target.value), placeholder: B, ref: m, style: se, type: "search", value: S }),
|
|
191
|
+
/* @__PURE__ */ p(xe, { "aria-label": "Dropdown", className: o.options, children: [
|
|
192
192
|
H.map((e) => {
|
|
193
|
-
const u = e.value ===
|
|
194
|
-
return /* @__PURE__ */
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
e.groupLabel && /* @__PURE__ */
|
|
193
|
+
const u = e.value === C;
|
|
194
|
+
return /* @__PURE__ */ s("li", { "data-component": "dropdown", children: /* @__PURE__ */ p(M, { "aria-label": u ? `${e.text}, selected` : e.text, className: I(o.option, u && o.selected), disabled: e.disabled, onClick: () => ue(e.value), variant: "tertiary", children: [
|
|
195
|
+
/* @__PURE__ */ s("span", { className: o.text, children: J(e) }),
|
|
196
|
+
e.groupLabel && /* @__PURE__ */ s("small", { className: o.group, children: e.groupLabel })
|
|
197
197
|
] }) }, `${e.groupLabel ?? "root"}-${e.value}`);
|
|
198
198
|
}),
|
|
199
|
-
|
|
200
|
-
H.length === 0 && !
|
|
199
|
+
V && l && /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(M, { "aria-label": $(l.render(g)) || g, className: o.option, onClick: X, variant: "tertiary", children: /* @__PURE__ */ s("span", { className: o.text, children: l.render(g) }) }) }),
|
|
200
|
+
H.length === 0 && !V && /* @__PURE__ */ s("li", { className: o.empty, children: n })
|
|
201
201
|
] })
|
|
202
202
|
] })
|
|
203
203
|
] });
|
|
204
|
-
return a ? /* @__PURE__ */ p("div", { className:
|
|
205
|
-
/* @__PURE__ */
|
|
204
|
+
return a ? /* @__PURE__ */ p("div", { className: I(o.label, _ === "inline" && o["inline-field"]), "data-component": "dropdown", children: [
|
|
205
|
+
/* @__PURE__ */ s("span", { id: w, children: ae }),
|
|
206
206
|
Y
|
|
207
207
|
] }) : Y;
|
|
208
208
|
};
|