@tedi-design-system/react 18.0.0-rc.18 → 18.0.0-rc.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tedi-design-system/react",
3
- "version": "18.0.0-rc.18",
3
+ "version": "18.0.0-rc.19",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),S=require("../../../../../../external/classnames/index.cjs.js"),x=require("../../checkbox/checkbox.cjs.js"),l=require("../select.module.scss.cjs.js"),t=require("./select-bulk-helpers.cjs.js"),g=require("../../../../../../external/react-select/dist/index-641ee5b8.esm.cjs.js"),A=({renderOption:f,...e})=>{var b;const u=e.data.value===t.SELECT_ALL_VALUE,r=t.isGroupSentinel(e.data),E=!!((b=e.data.customData)!=null&&b.__tediInGroup);let o=e.isSelected,_=!1;if(u){const i=t.getEnabledOptions(e.options).filter(n=>n.value!==t.SELECT_ALL_VALUE),a=(e.getValue()??[]).filter(n=>n.value!==t.SELECT_ALL_VALUE);o=t.areAllSelected(a,i),_=t.isIndeterminate(a,i)}else if(r){const i=e.options,L=i.findIndex(d=>d.value===e.data.value),a=[];for(let d=L+1;d<i.length;d++){const s=i[d];if(!s||typeof s.value=="string"&&(s.value.startsWith(t.GROUP_OPTION_PREFIX)||s.value===t.SELECT_ALL_VALUE))break;s.isDisabled||a.push(s)}const n=e.getValue()??[];o=t.areAllSelected(n,a),_=t.isIndeterminate(n,a)}const h=S.default(l.default["tedi-select__option"],{[l.default["tedi-select__option--disabled"]]:e.isDisabled},{[l.default["tedi-select__option--focused"]]:e.isFocused},{[l.default["tedi-select__option--select-all"]]:u},{[l.default["tedi-select__option--group"]]:r},{[l.default["tedi-select__option--indented"]]:E}),{tabIndex:m,...v}=e.innerProps;return c.jsx(g.c.Option,{...e,innerProps:{...v,tabIndex:m,role:"option","aria-selected":o},className:h,children:f&&!u&&!r?f(e):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"sr-only",children:e.label}),c.jsx(x.Checkbox,{id:e.data.value,label:e.label,"aria-hidden":!0,className:l.default["tedi-select__checkbox"],value:e.data.value,name:e.data.value,checked:o,indeterminate:_,onChange:()=>null,disabled:e.isDisabled,hover:e.isFocused})]})})};exports.SelectMultiOption=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),I=require("../../../../../../external/classnames/index.cjs.js"),E=require("../../../misc/option-content/option-content.cjs.js"),a=require("../select.module.scss.cjs.js"),t=require("./select-bulk-helpers.cjs.js"),O=require("../../../../../../external/react-select/dist/index-641ee5b8.esm.cjs.js"),g=({renderOption:f,...e})=>{var L;const o=e.data.value===t.SELECT_ALL_VALUE,u=t.isGroupSentinel(e.data),S=!!((L=e.data.customData)!=null&&L.__tediInGroup);let c=e.isSelected,r=!1;if(o){const i=t.getEnabledOptions(e.options).filter(n=>n.value!==t.SELECT_ALL_VALUE),l=(e.getValue()??[]).filter(n=>n.value!==t.SELECT_ALL_VALUE);c=t.areAllSelected(l,i),r=t.isIndeterminate(l,i)}else if(u){const i=e.options,b=i.findIndex(d=>d.value===e.data.value),l=[];for(let d=b+1;d<i.length;d++){const s=i[d];if(!s||typeof s.value=="string"&&(s.value.startsWith(t.GROUP_OPTION_PREFIX)||s.value===t.SELECT_ALL_VALUE))break;s.isDisabled||l.push(s)}const n=e.getValue()??[];c=t.areAllSelected(n,l),r=t.isIndeterminate(n,l)}const m=I.default(a.default["tedi-select__option"],{[a.default["tedi-select__option--disabled"]]:e.isDisabled},{[a.default["tedi-select__option--focused"]]:e.isFocused},{[a.default["tedi-select__option--select-all"]]:o},{[a.default["tedi-select__option--group"]]:u},{[a.default["tedi-select__option--indented"]]:S}),{tabIndex:A,...x}=e.innerProps;return _.jsx(O.c.Option,{...e,innerProps:{...x,tabIndex:A,role:"option","aria-selected":c},className:m,children:f&&!o&&!u?f(e):_.jsx(E.OptionContent,{type:"checkbox",indicatorSemantics:"control",selected:c,indeterminate:r,disabled:e.isDisabled,children:_.jsx(E.OptionContent.Label,{children:e.children})})})};exports.SelectMultiOption=g;
@@ -1,63 +1,55 @@
1
- import { jsx as m, jsxs as k, Fragment as E } from "react/jsx-runtime";
2
- import O from "../../../../../../external/classnames/index.es.js";
3
- import { Checkbox as P } from "../../checkbox/checkbox.es.js";
4
- import t from "../select.module.scss.es.js";
5
- import { SELECT_ALL_VALUE as o, isGroupSentinel as y, getEnabledOptions as G, areAllSelected as h, isIndeterminate as v, GROUP_OPTION_PREFIX as N } from "./select-bulk-helpers.es.js";
6
- import { c as A } from "../../../../../../external/react-select/dist/index-641ee5b8.esm.es.js";
7
- const M = ({ renderOption: _, ...e }) => {
8
- var f;
9
- const c = e.data.value === o, u = y(e.data), g = !!((f = e.data.customData) != null && f.__tediInGroup);
10
- let d = e.isSelected, r = !1;
11
- if (c) {
12
- const l = G(e.options).filter((a) => a.value !== o), i = (e.getValue() ?? []).filter((a) => a.value !== o);
13
- d = h(i, l), r = v(i, l);
14
- } else if (u) {
15
- const l = e.options, b = l.findIndex((s) => s.value === e.data.value), i = [];
16
- for (let s = b + 1; s < l.length; s++) {
17
- const n = l[s];
18
- if (!n || typeof n.value == "string" && (n.value.startsWith(N) || n.value === o))
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import E from "../../../../../../external/classnames/index.es.js";
3
+ import { OptionContent as h } from "../../../misc/option-content/option-content.es.js";
4
+ import s from "../select.module.scss.es.js";
5
+ import { SELECT_ALL_VALUE as c, isGroupSentinel as P, getEnabledOptions as y, areAllSelected as I, isIndeterminate as v, GROUP_OPTION_PREFIX as G } from "./select-bulk-helpers.es.js";
6
+ import { c as L } from "../../../../../../external/react-select/dist/index-641ee5b8.esm.es.js";
7
+ const V = ({ renderOption: f, ...e }) => {
8
+ var _;
9
+ const d = e.data.value === c, r = P(e.data), S = !!((_ = e.data.customData) != null && _.__tediInGroup);
10
+ let a = e.isSelected, u = !1;
11
+ if (d) {
12
+ const t = y(e.options).filter((l) => l.value !== c), i = (e.getValue() ?? []).filter((l) => l.value !== c);
13
+ a = I(i, t), u = v(i, t);
14
+ } else if (r) {
15
+ const t = e.options, b = t.findIndex((o) => o.value === e.data.value), i = [];
16
+ for (let o = b + 1; o < t.length; o++) {
17
+ const n = t[o];
18
+ if (!n || typeof n.value == "string" && (n.value.startsWith(G) || n.value === c))
19
19
  break;
20
20
  n.isDisabled || i.push(n);
21
21
  }
22
- const a = e.getValue() ?? [];
23
- d = h(a, i), r = v(a, i);
22
+ const l = e.getValue() ?? [];
23
+ a = I(l, i), u = v(l, i);
24
24
  }
25
- const I = O(
26
- t["tedi-select__option"],
27
- { [t["tedi-select__option--disabled"]]: e.isDisabled },
28
- { [t["tedi-select__option--focused"]]: e.isFocused },
29
- { [t["tedi-select__option--select-all"]]: c },
30
- { [t["tedi-select__option--group"]]: u },
31
- { [t["tedi-select__option--indented"]]: g }
32
- ), { tabIndex: x, ...S } = e.innerProps;
25
+ const g = E(
26
+ s["tedi-select__option"],
27
+ { [s["tedi-select__option--disabled"]]: e.isDisabled },
28
+ { [s["tedi-select__option--focused"]]: e.isFocused },
29
+ { [s["tedi-select__option--select-all"]]: d },
30
+ { [s["tedi-select__option--group"]]: r },
31
+ { [s["tedi-select__option--indented"]]: S }
32
+ ), { tabIndex: O, ...x } = e.innerProps;
33
33
  return /* @__PURE__ */ m(
34
- A.Option,
34
+ L.Option,
35
35
  {
36
36
  ...e,
37
- innerProps: { ...S, tabIndex: x, role: "option", "aria-selected": d },
38
- className: I,
39
- children: _ && !c && !u ? _(e) : /* @__PURE__ */ k(E, { children: [
40
- /* @__PURE__ */ m("span", { className: "sr-only", children: e.label }),
41
- /* @__PURE__ */ m(
42
- P,
43
- {
44
- id: e.data.value,
45
- label: e.label,
46
- "aria-hidden": !0,
47
- className: t["tedi-select__checkbox"],
48
- value: e.data.value,
49
- name: e.data.value,
50
- checked: d,
51
- indeterminate: r,
52
- onChange: () => null,
53
- disabled: e.isDisabled,
54
- hover: e.isFocused
55
- }
56
- )
57
- ] })
37
+ innerProps: { ...x, tabIndex: O, role: "option", "aria-selected": a },
38
+ className: g,
39
+ children: f && !d && !r ? f(e) : /* @__PURE__ */ m(
40
+ h,
41
+ {
42
+ type: "checkbox",
43
+ indicatorSemantics: "control",
44
+ selected: a,
45
+ indeterminate: u,
46
+ disabled: e.isDisabled,
47
+ children: /* @__PURE__ */ m(h.Label, { children: e.children })
48
+ }
49
+ )
58
50
  }
59
51
  );
60
52
  };
61
53
  export {
62
- M as SelectMultiOption
54
+ V as SelectMultiOption
63
55
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("../../../../../../external/classnames/index.cjs.js"),c=require("../../radio/radio.cjs.js"),i=require("../select.module.scss.cjs.js"),s=require("../../../../../../external/react-select/dist/index-641ee5b8.esm.cjs.js"),u=({showRadioButtons:t,renderOption:a,...e})=>{const d=n.default(i.default["tedi-select__option"],{[i.default["tedi-select__option--disabled"]]:e.isDisabled},{[i.default["tedi-select__option--selected"]]:e.isSelected&&!t},{[i.default["tedi-select__option--focused"]]:e.isFocused});return l.jsx(s.c.Option,{...e,innerProps:{role:"option","aria-selected":e.isSelected,"aria-disabled":e.isDisabled,...e.innerProps},className:d,children:t?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"sr-only",children:e.label}),l.jsx(c.Radio,{label:e.label,id:e.data.value,name:e.data.value,className:i.default["tedi-select__radio"],value:e.data.value,checked:e.isSelected,disabled:e.isDisabled,onChange:()=>null})]}):a?a(e):e.children})};exports.SelectSingleOption=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("../../../../../../external/classnames/index.cjs.js"),d=require("../../../misc/option-content/option-content.cjs.js"),t=require("../select.module.scss.cjs.js"),o=require("../../../../../../external/react-select/dist/index-641ee5b8.esm.cjs.js"),a=({showRadioButtons:n,renderOption:l,...e})=>{const c=s.default(t.default["tedi-select__option"],{[t.default["tedi-select__option--disabled"]]:e.isDisabled},{[t.default["tedi-select__option--selected"]]:e.isSelected&&!n},{[t.default["tedi-select__option--focused"]]:e.isFocused});return i.jsx(o.c.Option,{...e,innerProps:{role:"option","aria-selected":e.isSelected,"aria-disabled":e.isDisabled,...e.innerProps},className:c,children:n?i.jsx(d.OptionContent,{type:"radio",indicatorSemantics:"control",selected:e.isSelected,disabled:e.isDisabled,children:i.jsx(d.OptionContent.Label,{children:e.children})}):l?l(e):e.children})};exports.SelectSingleOption=a;
@@ -1,17 +1,17 @@
1
- import { jsx as l, jsxs as c, Fragment as s } from "react/jsx-runtime";
2
- import n from "../../../../../../external/classnames/index.es.js";
3
- import { Radio as o } from "../../radio/radio.es.js";
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import o from "../../../../../../external/classnames/index.es.js";
3
+ import { OptionContent as d } from "../../../misc/option-content/option-content.es.js";
4
4
  import i from "../select.module.scss.es.js";
5
- import { c as m } from "../../../../../../external/react-select/dist/index-641ee5b8.esm.es.js";
6
- const h = ({ showRadioButtons: a, renderOption: t, ...e }) => {
7
- const d = n(
5
+ import { c as s } from "../../../../../../external/react-select/dist/index-641ee5b8.esm.es.js";
6
+ const f = ({ showRadioButtons: l, renderOption: c, ...e }) => {
7
+ const n = o(
8
8
  i["tedi-select__option"],
9
9
  { [i["tedi-select__option--disabled"]]: e.isDisabled },
10
- { [i["tedi-select__option--selected"]]: e.isSelected && !a },
10
+ { [i["tedi-select__option--selected"]]: e.isSelected && !l },
11
11
  { [i["tedi-select__option--focused"]]: e.isFocused }
12
12
  );
13
- return /* @__PURE__ */ l(
14
- m.Option,
13
+ return /* @__PURE__ */ t(
14
+ s.Option,
15
15
  {
16
16
  ...e,
17
17
  innerProps: {
@@ -20,26 +20,20 @@ const h = ({ showRadioButtons: a, renderOption: t, ...e }) => {
20
20
  "aria-disabled": e.isDisabled,
21
21
  ...e.innerProps
22
22
  },
23
- className: d,
24
- children: a ? /* @__PURE__ */ c(s, { children: [
25
- /* @__PURE__ */ l("span", { className: "sr-only", children: e.label }),
26
- /* @__PURE__ */ l(
27
- o,
28
- {
29
- label: e.label,
30
- id: e.data.value,
31
- name: e.data.value,
32
- className: i["tedi-select__radio"],
33
- value: e.data.value,
34
- checked: e.isSelected,
35
- disabled: e.isDisabled,
36
- onChange: () => null
37
- }
38
- )
39
- ] }) : t ? t(e) : e.children
23
+ className: n,
24
+ children: l ? /* @__PURE__ */ t(
25
+ d,
26
+ {
27
+ type: "radio",
28
+ indicatorSemantics: "control",
29
+ selected: e.isSelected,
30
+ disabled: e.isDisabled,
31
+ children: /* @__PURE__ */ t(d.Label, { children: e.children })
32
+ }
33
+ ) : c ? c(e) : e.children
40
34
  }
41
35
  );
42
36
  };
43
37
  export {
44
- h as SelectSingleOption
38
+ f as SelectSingleOption
45
39
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-select__control":"tedi-select__control-dbce8bb7","tedi-select__value-container":"tedi-select__value-container-253d079a","tedi-select__indicators-container":"tedi-select__indicators-container-0fc8fa2a","tedi-select__input":"tedi-select__input-5525b622","tedi-select":"tedi-select-8b014852","tedi-select--disabled":"tedi-select--disabled-2d4b8ddd","tedi-select--invalid":"tedi-select--invalid-3901c89c","tedi-select--valid":"tedi-select--valid-969c0297","tedi-select__control--focused":"tedi-select__control--focused-0e632efe","tedi-select__arrow":"tedi-select__arrow-94b5ef4a","tedi-select__loading-indicator":"tedi-select__loading-indicator-a35a63ca","tedi-select__dropdown-indicator":"tedi-select__dropdown-indicator-5a948baa","tedi-select__clear-indicator":"tedi-select__clear-indicator-68b60b12","tedi-select__menu-portal":"tedi-select__menu-portal-d5349f37","tedi-select__menu":"tedi-select__menu-bf54b75b","tedi-select__menu-list--grid":"tedi-select__menu-list--grid-393f3232","tedi-select__menu-list":"tedi-select__menu-list-0aa06e24","tedi-select__menu-list-inner":"tedi-select__menu-list-inner-471e5cf8","tedi-select__menu-list-footer":"tedi-select__menu-list-footer-eb1d3bbc","tedi-select__option":"tedi-select__option-6f811381","tedi-select__option--disabled":"tedi-select__option--disabled-d3aff112","tedi-select__option--focused":"tedi-select__option--focused-1d972ff1","tedi-select__option--selected":"tedi-select__option--selected-a93e5fb0","tedi-select--small":"tedi-select--small-2659608b","tedi-select__multi-value-item":"tedi-select__multi-value-item-b8ec59ae","tedi-select__checkbox":"tedi-select__checkbox-e4f94b67","tedi-select__group":"tedi-select__group-b275e954","tedi-select__group-heading":"tedi-select__group-heading-02b3d9bc","tedi-select__group-heading--selectable":"tedi-select__group-heading--selectable-c84cd617","tedi-select__option--indented":"tedi-select__option--indented-bf4a1661","tedi-select__multi-value-clear":"tedi-select__multi-value-clear-d231f7de","tedi-select--tags-row":"tedi-select--tags-row-c9f33e4b","tedi-select__overflow-tag":"tedi-select__overflow-tag-c0391df2","tedi-select__menu-list--keyboard":"tedi-select__menu-list--keyboard-3d066942","tedi-select__select-all":"tedi-select__select-all-12c3e7f1","tedi-select__group-heading-toggle":"tedi-select__group-heading-toggle-34296a63","tedi-select--tags-stack":"tedi-select--tags-stack-ddb929a9","tedi-select__separator":"tedi-select__separator-b1045f3f","tedi-select--searchable":"tedi-select--searchable-d56eb325"};exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e={"tedi-select__control":"tedi-select__control-dbce8bb7","tedi-select__value-container":"tedi-select__value-container-253d079a","tedi-select__indicators-container":"tedi-select__indicators-container-0fc8fa2a","tedi-select__input":"tedi-select__input-5525b622","tedi-select":"tedi-select-8b014852","tedi-select--disabled":"tedi-select--disabled-2d4b8ddd","tedi-select--invalid":"tedi-select--invalid-3901c89c","tedi-select--valid":"tedi-select--valid-969c0297","tedi-select__control--focused":"tedi-select__control--focused-0e632efe","tedi-select__arrow":"tedi-select__arrow-94b5ef4a","tedi-select__loading-indicator":"tedi-select__loading-indicator-a35a63ca","tedi-select__dropdown-indicator":"tedi-select__dropdown-indicator-5a948baa","tedi-select__clear-indicator":"tedi-select__clear-indicator-68b60b12","tedi-select__menu-portal":"tedi-select__menu-portal-d5349f37","tedi-select__menu":"tedi-select__menu-bf54b75b","tedi-select__menu-list--grid":"tedi-select__menu-list--grid-393f3232","tedi-select__menu-list":"tedi-select__menu-list-0aa06e24","tedi-select__menu-list-inner":"tedi-select__menu-list-inner-471e5cf8","tedi-select__menu-list-footer":"tedi-select__menu-list-footer-eb1d3bbc","tedi-select__option":"tedi-select__option-6f811381","tedi-select__option--disabled":"tedi-select__option--disabled-d3aff112","tedi-select__option--focused":"tedi-select__option--focused-1d972ff1","tedi-select__option--selected":"tedi-select__option--selected-a93e5fb0","tedi-select--small":"tedi-select--small-2659608b","tedi-select__multi-value-item":"tedi-select__multi-value-item-b8ec59ae","tedi-select__group":"tedi-select__group-b275e954","tedi-select__group-heading":"tedi-select__group-heading-02b3d9bc","tedi-select__group-heading--selectable":"tedi-select__group-heading--selectable-c84cd617","tedi-select__option--indented":"tedi-select__option--indented-bf4a1661","tedi-select__multi-value-clear":"tedi-select__multi-value-clear-d231f7de","tedi-select--tags-row":"tedi-select--tags-row-c9f33e4b","tedi-select__overflow-tag":"tedi-select__overflow-tag-c0391df2","tedi-select__menu-list--keyboard":"tedi-select__menu-list--keyboard-3d066942","tedi-select__select-all":"tedi-select__select-all-12c3e7f1","tedi-select__group-heading-toggle":"tedi-select__group-heading-toggle-34296a63","tedi-select--tags-stack":"tedi-select--tags-stack-ddb929a9","tedi-select__separator":"tedi-select__separator-b1045f3f","tedi-select--searchable":"tedi-select--searchable-d56eb325"};exports.default=e;
@@ -24,7 +24,6 @@ const e = {
24
24
  "tedi-select__option--selected": "tedi-select__option--selected-a93e5fb0",
25
25
  "tedi-select--small": "tedi-select--small-2659608b",
26
26
  "tedi-select__multi-value-item": "tedi-select__multi-value-item-b8ec59ae",
27
- "tedi-select__checkbox": "tedi-select__checkbox-e4f94b67",
28
27
  "tedi-select__group": "tedi-select__group-b275e954",
29
28
  "tedi-select__group-heading": "tedi-select__group-heading-02b3d9bc",
30
29
  "tedi-select__group-heading--selectable": "tedi-select__group-heading--selectable-c84cd617",
@@ -65,6 +65,11 @@ export interface TextFieldProps extends BreakpointSupport<TextFieldBreakpointPro
65
65
  * Also used to generate `aria-describedby` and helper IDs automatically.
66
66
  */
67
67
  id?: string;
68
+ /**
69
+ * The text or React node that serves as the label for the text field.
70
+ * If `hideLabel` is `true`, the label will be visually hidden but still accessible to screen readers.
71
+ * If `hideLabel` is `'keep-space'`, the label will be hidden but the space it occupies will be preserved.
72
+ */
68
73
  label?: React.ReactNode;
69
74
  /**
70
75
  * Name attribute for the underlying input/textarea element.
@@ -104,7 +109,13 @@ export interface TextFieldProps extends BreakpointSupport<TextFieldBreakpointPro
104
109
  * Note: These are **not** attached to the input/textarea directly, but to the surrounding container.
105
110
  */
106
111
  onKeyPress?: React.KeyboardEventHandler<HTMLDivElement>;
112
+ /**
113
+ * Key-down handler attached to the field's surrounding container (not the input directly).
114
+ */
107
115
  onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
116
+ /**
117
+ * Key-up handler attached to the field's surrounding container (not the input directly).
118
+ */
108
119
  onKeyUp?: React.KeyboardEventHandler<HTMLDivElement>;
109
120
  /**
110
121
  * Default value for **uncontrolled** usage.
@@ -209,6 +220,9 @@ export interface TextFieldProps extends BreakpointSupport<TextFieldBreakpointPro
209
220
  * Additional attributes for the input element.
210
221
  */
211
222
  input?: React.InputHTMLAttributes<HTMLInputElement> | React.TextareaHTMLAttributes<HTMLTextAreaElement>;
223
+ /**
224
+ * Optional start slot element to render inside the input container, before the input field.
225
+ */
212
226
  startSlot?: React.ReactNode;
213
227
  /**
214
228
  * Optional end slot element to render inside the input container, after the input field.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),l=require("../../../../../external/classnames/index.cjs.js"),o=require("react"),f=require("../../base/icon/icon.cjs.js"),e=require("./option-content.module.scss.cjs.js"),s=o.forwardRef(({children:t,className:n,id:i},c)=>a.jsx("span",{ref:c,id:i,className:l.default(e.default["tedi-option-content__label"],n),children:t}));s.displayName="OptionContentLabel";const _=o.forwardRef(({children:t,className:n},i)=>a.jsx("span",{ref:i,className:l.default(e.default["tedi-option-content__meta"],n),children:t}));_.displayName="OptionContentMeta";const M=(t,n)=>{const i=typeof t=="string"?{name:t}:t;return a.jsx(f.Icon,{size:18,...i,className:l.default(n,i.className)})},k=o.forwardRef(({children:t,type:n="default",layout:i="horizontal",selected:c=!1,indeterminate:r=!1,disabled:u=!1,icon:m,indicatorSemantics:N="presentation",className:j},O)=>{const b=o.useId(),p=N==="control",x=p&&n!=="default"&&o.Children.toArray(t).some(d=>o.isValidElement(d)&&d.type===s),h=x?b:void 0,v=p?{role:"checkbox","aria-checked":r?"mixed":c,"aria-disabled":u||void 0,"aria-labelledby":h}:{"aria-hidden":!0},y=p?{role:"radio","aria-checked":c,"aria-disabled":u||void 0,"aria-labelledby":h}:{"aria-hidden":!0},I=x?o.Children.map(t,d=>o.isValidElement(d)&&d.type===s?o.cloneElement(d,{id:b}):d):t;return a.jsxs("div",{ref:O,className:l.default(e.default["tedi-option-content"],e.default[`tedi-option-content--${i}`],{[e.default["tedi-option-content--checkbox"]]:n==="checkbox",[e.default["tedi-option-content--radio"]]:n==="radio",[e.default["tedi-option-content--disabled"]]:u},j),children:[n==="checkbox"&&a.jsx("span",{...v,className:l.default(e.default["tedi-option-content__indicator"],e.default["tedi-option-content__checkbox"],{[e.default["tedi-option-content__checkbox--checked"]]:c||r}),children:r?a.jsx(f.Icon,{name:"remove",size:16,className:e.default["tedi-option-content__check-icon"]}):c?a.jsx(f.Icon,{name:"check",size:16,className:e.default["tedi-option-content__check-icon"]}):null}),n==="radio"&&a.jsx("span",{...y,className:l.default(e.default["tedi-option-content__indicator"],e.default["tedi-option-content__radio"],{[e.default["tedi-option-content__radio--checked"]]:c})}),m&&M(m,e.default["tedi-option-content__icon"]),a.jsx("div",{className:e.default["tedi-option-content__content"],children:I})]})});k.displayName="OptionContent";const C=Object.assign(k,{Label:s,Meta:_});exports.OptionContent=C;exports.OptionContentLabel=s;exports.OptionContentMeta=_;exports.default=C;
@@ -0,0 +1,71 @@
1
+ import { IconProps } from '../../base/icon/icon';
2
+ export type OptionContentType = 'default' | 'checkbox' | 'radio';
3
+ export type OptionContentLayout = 'horizontal' | 'vertical';
4
+ export interface OptionContentSlotProps {
5
+ children?: React.ReactNode;
6
+ /** Additional class name. */
7
+ className?: string;
8
+ /** @internal id wired up by `OptionContent` to link the indicator's `aria-labelledby`. */
9
+ id?: string;
10
+ }
11
+ export declare const OptionContentLabel: import('react').ForwardRefExoticComponent<OptionContentSlotProps & import('react').RefAttributes<HTMLSpanElement>>;
12
+ export declare const OptionContentMeta: import('react').ForwardRefExoticComponent<OptionContentSlotProps & import('react').RefAttributes<HTMLSpanElement>>;
13
+ export interface OptionContentProps {
14
+ /**
15
+ * Content of the value row — typically `OptionContent.Label` and
16
+ * optionally `OptionContent.Meta`, but any node is allowed.
17
+ */
18
+ children?: React.ReactNode;
19
+ /**
20
+ * Selection-indicator type:
21
+ * - `default` — no indicator
22
+ * - `checkbox` — checkbox indicator (multi-select)
23
+ * - `radio` — radio indicator (single-select listbox)
24
+ * @default default
25
+ */
26
+ type?: OptionContentType;
27
+ /**
28
+ * Arrange the label and meta side-by-side (`horizontal`) or stacked
29
+ * (`vertical`, e.g. a title with a description below).
30
+ * @default horizontal
31
+ */
32
+ layout?: OptionContentLayout;
33
+ /**
34
+ * Whether the indicator renders as selected (checked).
35
+ * @default false
36
+ */
37
+ selected?: boolean;
38
+ /**
39
+ * Whether the checkbox indicator renders as indeterminate. Ignored for other types.
40
+ * @default false
41
+ */
42
+ indeterminate?: boolean;
43
+ /**
44
+ * Whether the row renders as disabled (dims the indicator and text).
45
+ * @default false
46
+ */
47
+ disabled?: boolean;
48
+ /**
49
+ * Leading icon, rendered before the content. Accepts an icon name or full `IconProps`.
50
+ */
51
+ icon?: string | IconProps;
52
+ /**
53
+ * How the selection indicator is exposed to assistive tech:
54
+ * - `presentation` (default) — the indicator is `aria-hidden`; the interactive
55
+ * parent owns selection (menu pattern: `aria-checked` on the `DropdownItem`).
56
+ * - `control` — the indicator itself carries `role="checkbox"`/`"radio"`,
57
+ * `aria-checked` and is named via `aria-labelledby` from `OptionContent.Label`
58
+ * (listbox pattern, e.g. inside a `Select` option). Requires a `Label` child.
59
+ * @default presentation
60
+ */
61
+ indicatorSemantics?: 'presentation' | 'control';
62
+ /**
63
+ * Additional class name.
64
+ */
65
+ className?: string;
66
+ }
67
+ export declare const OptionContent: import('react').ForwardRefExoticComponent<OptionContentProps & import('react').RefAttributes<HTMLDivElement>> & {
68
+ Label: import('react').ForwardRefExoticComponent<OptionContentSlotProps & import('react').RefAttributes<HTMLSpanElement>>;
69
+ Meta: import('react').ForwardRefExoticComponent<OptionContentSlotProps & import('react').RefAttributes<HTMLSpanElement>>;
70
+ };
71
+ export default OptionContent;
@@ -0,0 +1,92 @@
1
+ import { jsx as a, jsxs as j } from "react/jsx-runtime";
2
+ import s from "../../../../../external/classnames/index.es.js";
3
+ import { forwardRef as _, useId as A, Children as N, isValidElement as x, cloneElement as M } from "react";
4
+ import { Icon as m } from "../../base/icon/icon.es.js";
5
+ import o from "./option-content.module.scss.es.js";
6
+ const r = _(
7
+ ({ children: t, className: n, id: e }, i) => /* @__PURE__ */ a("span", { ref: i, id: e, className: s(o["tedi-option-content__label"], n), children: t })
8
+ );
9
+ r.displayName = "OptionContentLabel";
10
+ const u = _(({ children: t, className: n }, e) => /* @__PURE__ */ a("span", { ref: e, className: s(o["tedi-option-content__meta"], n), children: t }));
11
+ u.displayName = "OptionContentMeta";
12
+ const g = (t, n) => {
13
+ const e = typeof t == "string" ? { name: t } : t;
14
+ return /* @__PURE__ */ a(m, { size: 18, ...e, className: s(n, e.className) });
15
+ }, C = _(
16
+ ({
17
+ children: t,
18
+ type: n = "default",
19
+ layout: e = "horizontal",
20
+ selected: i = !1,
21
+ indeterminate: d = !1,
22
+ disabled: l = !1,
23
+ icon: b,
24
+ indicatorSemantics: O = "presentation",
25
+ className: y
26
+ }, v) => {
27
+ const h = A(), p = O === "control", f = p && n !== "default" && N.toArray(t).some((c) => x(c) && c.type === r), k = f ? h : void 0, I = p ? {
28
+ role: "checkbox",
29
+ "aria-checked": d ? "mixed" : i,
30
+ "aria-disabled": l || void 0,
31
+ "aria-labelledby": k
32
+ } : { "aria-hidden": !0 }, z = p ? {
33
+ role: "radio",
34
+ "aria-checked": i,
35
+ "aria-disabled": l || void 0,
36
+ "aria-labelledby": k
37
+ } : { "aria-hidden": !0 }, L = f ? N.map(
38
+ t,
39
+ (c) => x(c) && c.type === r ? M(c, { id: h }) : c
40
+ ) : t;
41
+ return /* @__PURE__ */ j(
42
+ "div",
43
+ {
44
+ ref: v,
45
+ className: s(
46
+ o["tedi-option-content"],
47
+ o[`tedi-option-content--${e}`],
48
+ {
49
+ [o["tedi-option-content--checkbox"]]: n === "checkbox",
50
+ [o["tedi-option-content--radio"]]: n === "radio",
51
+ [o["tedi-option-content--disabled"]]: l
52
+ },
53
+ y
54
+ ),
55
+ children: [
56
+ n === "checkbox" && /* @__PURE__ */ a(
57
+ "span",
58
+ {
59
+ ...I,
60
+ className: s(o["tedi-option-content__indicator"], o["tedi-option-content__checkbox"], {
61
+ [o["tedi-option-content__checkbox--checked"]]: i || d
62
+ }),
63
+ children: d ? /* @__PURE__ */ a(m, { name: "remove", size: 16, className: o["tedi-option-content__check-icon"] }) : i ? /* @__PURE__ */ a(m, { name: "check", size: 16, className: o["tedi-option-content__check-icon"] }) : null
64
+ }
65
+ ),
66
+ n === "radio" && /* @__PURE__ */ a(
67
+ "span",
68
+ {
69
+ ...z,
70
+ className: s(o["tedi-option-content__indicator"], o["tedi-option-content__radio"], {
71
+ [o["tedi-option-content__radio--checked"]]: i
72
+ })
73
+ }
74
+ ),
75
+ b && g(b, o["tedi-option-content__icon"]),
76
+ /* @__PURE__ */ a("div", { className: o["tedi-option-content__content"], children: L })
77
+ ]
78
+ }
79
+ );
80
+ }
81
+ );
82
+ C.displayName = "OptionContent";
83
+ const $ = Object.assign(C, {
84
+ Label: r,
85
+ Meta: u
86
+ });
87
+ export {
88
+ $ as OptionContent,
89
+ r as OptionContentLabel,
90
+ u as OptionContentMeta,
91
+ $ as default
92
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t={"tedi-option-content":"tedi-option-content-a433cd53","tedi-option-content--radio":"tedi-option-content--radio-63324c27","tedi-option-content--vertical":"tedi-option-content--vertical-f90f3336","tedi-option-content--checkbox":"tedi-option-content--checkbox-6d08b76f","tedi-option-content__indicator":"tedi-option-content__indicator-cbae42a3","tedi-option-content__icon":"tedi-option-content__icon-919cf745","tedi-option-content--disabled":"tedi-option-content--disabled-947cc3ca","tedi-option-content__label":"tedi-option-content__label-db712a00","tedi-option-content__meta":"tedi-option-content__meta-22706c1d","tedi-option-content__checkbox":"tedi-option-content__checkbox-114cba52","tedi-option-content__checkbox--checked":"tedi-option-content__checkbox--checked-dc7bff22","tedi-option-content__check-icon":"tedi-option-content__check-icon-2c8a9173","tedi-option-content__radio":"tedi-option-content__radio-05184514","tedi-option-content__radio--checked":"tedi-option-content__radio--checked-1980c552","tedi-option-content__content":"tedi-option-content__content-202040f6","tedi-option-content--horizontal":"tedi-option-content--horizontal-292043e8"};exports.default=t;
@@ -0,0 +1,21 @@
1
+ const t = {
2
+ "tedi-option-content": "tedi-option-content-a433cd53",
3
+ "tedi-option-content--radio": "tedi-option-content--radio-63324c27",
4
+ "tedi-option-content--vertical": "tedi-option-content--vertical-f90f3336",
5
+ "tedi-option-content--checkbox": "tedi-option-content--checkbox-6d08b76f",
6
+ "tedi-option-content__indicator": "tedi-option-content__indicator-cbae42a3",
7
+ "tedi-option-content__icon": "tedi-option-content__icon-919cf745",
8
+ "tedi-option-content--disabled": "tedi-option-content--disabled-947cc3ca",
9
+ "tedi-option-content__label": "tedi-option-content__label-db712a00",
10
+ "tedi-option-content__meta": "tedi-option-content__meta-22706c1d",
11
+ "tedi-option-content__checkbox": "tedi-option-content__checkbox-114cba52",
12
+ "tedi-option-content__checkbox--checked": "tedi-option-content__checkbox--checked-dc7bff22",
13
+ "tedi-option-content__check-icon": "tedi-option-content__check-icon-2c8a9173",
14
+ "tedi-option-content__radio": "tedi-option-content__radio-05184514",
15
+ "tedi-option-content__radio--checked": "tedi-option-content__radio--checked-1980c552",
16
+ "tedi-option-content__content": "tedi-option-content__content-202040f6",
17
+ "tedi-option-content--horizontal": "tedi-option-content--horizontal-292043e8"
18
+ };
19
+ export {
20
+ t as default
21
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react/jsx-runtime"),j=require("../../../../../../external/classnames/index.cjs.js"),T=require("../dropdown-context.cjs.js"),r=require("./dropdown-item.module.scss.cjs.js"),K=({children:m,onClick:t,disabled:n,active:c,index:u,indent:i,asChild:o=!1,closeOnSelect:p=!0,isParent:w=!1,className:y})=>{const{getItemProps:_,listItemsRef:l,setOpen:s,activeIndex:v,divided:b,variant:f}=T.useDropdownContext(),x=o?"div":"button",I=e=>typeof e!="number"?{}:{"--dropdown-indent-level":e,"--dropdown-indent":`${e}rem`},g=e=>{if(n)return;const d=e.currentTarget.querySelector('input[type="checkbox"], input[type="radio"]');if(d){d.click();return}o?t==null||t(e):(t==null||t(e),p&&s(!1))},q=e=>{if(!n&&(e.key==="Enter"||e.key===" ")){e.preventDefault();const d=e.currentTarget.querySelector('input[type="checkbox"], input[type="radio"]');d?d.click():t==null||t(e),!o&&p&&s(!1)}},a={ref(e){typeof u=="number"&&(l.current[u]=e)},tabIndex:v===u?0:-1,className:j.default(r.default["tedi-dropdown__item"],{[r.default["tedi-dropdown__item--active"]]:c,[r.default["tedi-dropdown__item--disabled"]]:n,[r.default["tedi-dropdown__item--divided"]]:b,[r.default["tedi-dropdown__item--indent"]]:i,[r.default["tedi-dropdown__item--tree-item"]]:f==="tree"&&i,[r.default["tedi-dropdown__item--tree-parent"]]:f==="tree"&&w},y),style:I(i),onClick:g,onKeyDown:q},D=o&&p===!1?a:_({role:"menuitem",disabled:o?void 0:n,...a});return P.jsx(x,{...D,children:m})};exports.DropdownItem=K;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react/jsx-runtime"),K=require("../../../../../../external/classnames/index.cjs.js"),R=require("../dropdown-context.cjs.js"),r=require("./dropdown-item.module.scss.cjs.js"),S=({children:c,onClick:t,disabled:n,active:w,index:u,indent:i,asChild:o=!1,closeOnSelect:p=!0,isParent:y=!1,className:_,role:s,...l})=>{const{getItemProps:v,listItemsRef:b,setOpen:f,activeIndex:x,divided:I,variant:a}=R.useDropdownContext(),g=o?"div":"button",q=e=>typeof e!="number"||e<=0?{}:{"--dropdown-indent-level":e,"--dropdown-indent":`${e}rem`},D=e=>{if(n)return;const d=e.currentTarget.querySelector('input[type="checkbox"], input[type="radio"]');if(d){d.click();return}o?t==null||t(e):(t==null||t(e),p&&f(!1))},P=e=>{if(!n&&(e.key==="Enter"||e.key===" ")){e.preventDefault();const d=e.currentTarget.querySelector('input[type="checkbox"], input[type="radio"]');d?d.click():t==null||t(e),!o&&p&&f(!1)}},m={ref(e){typeof u=="number"&&(b.current[u]=e)},tabIndex:x===u?0:-1,className:K.default(r.default["tedi-dropdown__item"],{[r.default["tedi-dropdown__item--active"]]:w,[r.default["tedi-dropdown__item--disabled"]]:n,[r.default["tedi-dropdown__item--divided"]]:I,[r.default["tedi-dropdown__item--indent"]]:i,[r.default["tedi-dropdown__item--tree-item"]]:a==="tree"&&i,[r.default["tedi-dropdown__item--tree-parent"]]:a==="tree"&&y},_),style:q(i),onClick:D,onKeyDown:P,...l},j=o&&p===!1?{...m,role:s}:v({role:s??"menuitem",disabled:o?void 0:n,...m});return T.jsx(g,{...j,children:c})};exports.DropdownItem=S;
@@ -63,5 +63,12 @@ export type DropdownItemProps = {
63
63
  */
64
64
  isParent?: boolean;
65
65
  className?: string;
66
- };
67
- export declare const DropdownItem: ({ children, onClick, disabled, active, index, indent, asChild, closeOnSelect, isParent, className, }: DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
66
+ /**
67
+ * ARIA role for the item. Defaults to `menuitem`; override to convey selection
68
+ * semantics (e.g. `menuitemcheckbox` / `menuitemradio` / `option`) and pair it
69
+ * with the matching `aria-checked` / `aria-selected`.
70
+ * @default menuitem
71
+ */
72
+ role?: React.AriaRole;
73
+ } & React.AriaAttributes;
74
+ export declare const DropdownItem: ({ children, onClick, disabled, active, index, indent, asChild, closeOnSelect, isParent, className, role, ...aria }: DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,67 +1,70 @@
1
- import { jsx as K } from "react/jsx-runtime";
2
- import N from "../../../../../../external/classnames/index.es.js";
3
- import { useDropdownContext as T } from "../dropdown-context.es.js";
1
+ import { jsx as T } from "react/jsx-runtime";
2
+ import j from "../../../../../../external/classnames/index.es.js";
3
+ import { useDropdownContext as E } from "../dropdown-context.es.js";
4
4
  import r from "./dropdown-item.module.scss.es.js";
5
- const V = ({
6
- children: a,
5
+ const l = ({
6
+ children: y,
7
7
  onClick: t,
8
- disabled: p,
9
- active: y,
8
+ disabled: n,
9
+ active: _,
10
10
  index: d,
11
11
  indent: i,
12
12
  asChild: o = !1,
13
13
  closeOnSelect: s = !0,
14
- isParent: _ = !1,
15
- className: w
14
+ isParent: w = !1,
15
+ className: c,
16
+ role: m,
17
+ ...v
16
18
  }) => {
17
- const { getItemProps: c, listItemsRef: v, setOpen: m, activeIndex: b, divided: x, variant: f } = T(), D = o ? "div" : "button", I = (e) => typeof e != "number" ? {} : {
19
+ const { getItemProps: b, listItemsRef: x, setOpen: f, activeIndex: D, divided: I, variant: u } = E(), g = o ? "div" : "button", P = (e) => typeof e != "number" || e <= 0 ? {} : {
18
20
  "--dropdown-indent-level": e,
19
21
  "--dropdown-indent": `${e}rem`
20
- }, g = (e) => {
21
- if (p) return;
22
- const n = e.currentTarget.querySelector(
22
+ }, q = (e) => {
23
+ if (n) return;
24
+ const p = e.currentTarget.querySelector(
23
25
  'input[type="checkbox"], input[type="radio"]'
24
26
  );
25
- if (n) {
26
- n.click();
27
+ if (p) {
28
+ p.click();
27
29
  return;
28
30
  }
29
- o ? t == null || t(e) : (t == null || t(e), s && m(!1));
30
- }, P = (e) => {
31
- if (!p && (e.key === "Enter" || e.key === " ")) {
31
+ o ? t == null || t(e) : (t == null || t(e), s && f(!1));
32
+ }, K = (e) => {
33
+ if (!n && (e.key === "Enter" || e.key === " ")) {
32
34
  e.preventDefault();
33
- const n = e.currentTarget.querySelector(
35
+ const p = e.currentTarget.querySelector(
34
36
  'input[type="checkbox"], input[type="radio"]'
35
37
  );
36
- n ? n.click() : t == null || t(e), !o && s && m(!1);
38
+ p ? p.click() : t == null || t(e), !o && s && f(!1);
37
39
  }
38
- }, u = {
40
+ }, a = {
39
41
  ref(e) {
40
- typeof d == "number" && (v.current[d] = e);
42
+ typeof d == "number" && (x.current[d] = e);
41
43
  },
42
- tabIndex: b === d ? 0 : -1,
43
- className: N(
44
+ tabIndex: D === d ? 0 : -1,
45
+ className: j(
44
46
  r["tedi-dropdown__item"],
45
47
  {
46
- [r["tedi-dropdown__item--active"]]: y,
47
- [r["tedi-dropdown__item--disabled"]]: p,
48
- [r["tedi-dropdown__item--divided"]]: x,
48
+ [r["tedi-dropdown__item--active"]]: _,
49
+ [r["tedi-dropdown__item--disabled"]]: n,
50
+ [r["tedi-dropdown__item--divided"]]: I,
49
51
  [r["tedi-dropdown__item--indent"]]: i,
50
- [r["tedi-dropdown__item--tree-item"]]: f === "tree" && i,
51
- [r["tedi-dropdown__item--tree-parent"]]: f === "tree" && _
52
+ [r["tedi-dropdown__item--tree-item"]]: u === "tree" && i,
53
+ [r["tedi-dropdown__item--tree-parent"]]: u === "tree" && w
52
54
  },
53
- w
55
+ c
54
56
  ),
55
- style: I(i),
56
- onClick: g,
57
- onKeyDown: P
58
- }, q = o && s === !1 ? u : c({
59
- role: "menuitem",
60
- disabled: o ? void 0 : p,
61
- ...u
57
+ style: P(i),
58
+ onClick: q,
59
+ onKeyDown: K,
60
+ ...v
61
+ }, N = o && s === !1 ? { ...a, role: m } : b({
62
+ role: m ?? "menuitem",
63
+ disabled: o ? void 0 : n,
64
+ ...a
62
65
  });
63
- return /* @__PURE__ */ K(D, { ...q, children: a });
66
+ return /* @__PURE__ */ T(g, { ...N, children: y });
64
67
  };
65
68
  export {
66
- V as DropdownItem
69
+ l as DropdownItem
67
70
  };
@@ -78,7 +78,7 @@ export declare const Dropdown: {
78
78
  Content: ({ children }: {
79
79
  children: React.ReactNode;
80
80
  }) => null;
81
- Item: ({ children, onClick, disabled, active, index, indent, asChild, closeOnSelect, isParent, className, }: import('./dropdown-item/dropdown-item').DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
81
+ Item: ({ children, onClick, disabled, active, index, indent, asChild, closeOnSelect, isParent, className, role, ...aria }: import('./dropdown-item/dropdown-item').DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
82
82
  Separator: () => import("react/jsx-runtime").JSX.Element;
83
83
  };
84
84
  export {};