@selectwin/kit 0.1.257 → 0.1.259

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.
Files changed (67) hide show
  1. package/README.md +75 -0
  2. package/dist/SelectActionBar.d.ts +29 -0
  3. package/dist/SelectActionBar.js +101 -0
  4. package/dist/SelectActionList.d.ts +5 -0
  5. package/dist/SelectActionList.js +55 -39
  6. package/dist/SelectAppFrame.d.ts +8 -2
  7. package/dist/SelectAppFrame.js +124 -119
  8. package/dist/SelectAvatarGroup.d.ts +31 -0
  9. package/dist/SelectAvatarGroup.js +39 -0
  10. package/dist/SelectBadge.d.ts +10 -1
  11. package/dist/SelectBadge.js +26 -12
  12. package/dist/SelectBulkBar.d.ts +21 -0
  13. package/dist/SelectBulkBar.js +40 -0
  14. package/dist/SelectChannelPreview.d.ts +35 -5
  15. package/dist/SelectChannelPreview.js +127 -60
  16. package/dist/SelectColorField.d.ts +1 -5
  17. package/dist/SelectColorField.js +83 -101
  18. package/dist/SelectCombobox.d.ts +5 -0
  19. package/dist/SelectCombobox.js +52 -49
  20. package/dist/SelectDataTable.d.ts +17 -1
  21. package/dist/SelectDataTable.js +100 -90
  22. package/dist/SelectDeadlineBadge.d.ts +32 -0
  23. package/dist/SelectDeadlineBadge.js +73 -0
  24. package/dist/SelectFieldset.d.ts +14 -0
  25. package/dist/SelectFieldset.js +27 -0
  26. package/dist/SelectFilterBar.d.ts +6 -1
  27. package/dist/SelectFilterBar.js +155 -125
  28. package/dist/SelectImageUploadField.d.ts +5 -3
  29. package/dist/SelectImageUploadField.js +26 -26
  30. package/dist/SelectKanban.d.ts +13 -1
  31. package/dist/SelectKanban.js +72 -50
  32. package/dist/SelectListCard.d.ts +27 -1
  33. package/dist/SelectListCard.js +47 -22
  34. package/dist/SelectLocale.d.ts +96 -0
  35. package/dist/SelectLocale.js +733 -521
  36. package/dist/SelectMail.d.ts +9 -1
  37. package/dist/SelectMail.js +234 -207
  38. package/dist/SelectModal.d.ts +10 -4
  39. package/dist/SelectModal.js +158 -137
  40. package/dist/SelectSection.d.ts +4 -4
  41. package/dist/SelectSection.js +77 -8
  42. package/dist/SelectSegmented.d.ts +7 -0
  43. package/dist/SelectSegmented.js +51 -43
  44. package/dist/SelectSideNav.d.ts +2 -1
  45. package/dist/SelectSideNav.js +156 -135
  46. package/dist/SelectSortable.d.ts +47 -1
  47. package/dist/SelectSortable.js +138 -19
  48. package/dist/SelectSteps.d.ts +3 -0
  49. package/dist/SelectSteps.js +42 -31
  50. package/dist/SelectTable.d.ts +13 -1
  51. package/dist/SelectTable.js +88 -79
  52. package/dist/SelectTabs.d.ts +10 -0
  53. package/dist/SelectTabs.js +68 -30
  54. package/dist/SelectTimeline.d.ts +4 -0
  55. package/dist/SelectTimeline.js +20 -9
  56. package/dist/SelectWeekHours.d.ts +64 -0
  57. package/dist/SelectWeekHours.js +338 -0
  58. package/dist/index.d.ts +19 -2
  59. package/dist/index.js +191 -184
  60. package/dist/internal/color.d.ts +15 -0
  61. package/dist/internal/color.js +40 -0
  62. package/dist/internal/navCount.d.ts +21 -0
  63. package/dist/internal/navCount.js +27 -0
  64. package/dist/internal/safeHref.d.ts +7 -0
  65. package/dist/internal/safeHref.js +12 -1
  66. package/dist/style.css +1 -1
  67. package/package.json +1 -1
@@ -2,161 +2,166 @@ import { ChevronDownIcon as e, CloseIcon as t, MenuIcon as n } from "./icons.js"
2
2
  import { useSelectMessages as r } from "./SelectLocale.js";
3
3
  import { SelectIconButton as i } from "./SelectIconButton.js";
4
4
  import { selectScrollClass as a } from "./SelectScrollArea.js";
5
- import { createContext as o, forwardRef as s, useContext as c, useEffect as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
6
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
7
- import { Link as g } from "react-router-dom";
5
+ import { NavCount as o, useNavCountName as s } from "./internal/navCount.js";
6
+ import { createContext as c, forwardRef as l, useContext as u, useEffect as d, useLayoutEffect as f, useRef as p, useState as m } from "react";
7
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
8
+ import { Link as v } from "react-router-dom";
8
9
  //#region src/SelectAppFrame.tsx
9
- var _ = (...e) => e.filter(Boolean).join(" "), v = o(!1);
10
- function y({ skip: e, contained: t = !1, className: n, children: r, ...i }) {
11
- return /* @__PURE__ */ h("div", {
10
+ var y = (...e) => e.filter(Boolean).join(" "), b = c(!1);
11
+ function x({ skip: e, contained: t = !1, className: n, children: r, ...i }) {
12
+ return /* @__PURE__ */ _("div", {
12
13
  ...i,
13
- className: _("select-appframe", t && "select-appframe--contained", n),
14
- children: [e && /* @__PURE__ */ m("a", {
14
+ className: y("select-appframe", t && "select-appframe--contained", n),
15
+ children: [e && /* @__PURE__ */ g("a", {
15
16
  href: e.to,
16
17
  className: "select-appframe__skip",
17
18
  children: e.label
18
- }), t ? /* @__PURE__ */ m(v.Provider, {
19
+ }), t ? /* @__PURE__ */ g(b.Provider, {
19
20
  value: !0,
20
21
  children: r
21
22
  }) : r]
22
23
  });
23
24
  }
24
- function b({ rail: e, scrollRef: t, fill: n = !1, className: r, children: i, ...o }) {
25
- let s = c(v);
26
- return /* @__PURE__ */ h("div", {
25
+ function S({ rail: e, scrollRef: t, fill: n = !1, className: r, children: i, ...o }) {
26
+ let s = u(b);
27
+ return /* @__PURE__ */ _("div", {
27
28
  ...o,
28
- className: _("select-appframe__panel", r),
29
- children: [e, s ? /* @__PURE__ */ m("div", {
29
+ className: y("select-appframe__panel", r),
30
+ children: [e, s ? /* @__PURE__ */ g("div", {
30
31
  ref: t,
31
- className: _("select-appframe__scroll", a("y"), n && "select-appframe__scroll--fill"),
32
+ className: y("select-appframe__scroll", a("y"), n && "select-appframe__scroll--fill"),
32
33
  children: i
33
34
  }) : i]
34
35
  });
35
36
  }
36
- var x = s(function({ aside: e, asideCompact: t, className: n, children: r, ...i }, a) {
37
+ var C = l(function({ aside: e, asideCompact: t, className: n, children: r, ...i }, a) {
37
38
  let o = e != null || t != null;
38
- return /* @__PURE__ */ h("main", {
39
+ return /* @__PURE__ */ _("main", {
39
40
  ref: a,
40
41
  ...i,
41
- className: _("select-appframe__main", o && "select-appframe__main--aside", n),
42
- children: [o && /* @__PURE__ */ h("div", {
42
+ className: y("select-appframe__main", o && "select-appframe__main--aside", n),
43
+ children: [o && /* @__PURE__ */ _("div", {
43
44
  className: "select-appframe__aside",
44
- children: [e != null && /* @__PURE__ */ m("div", {
45
+ children: [e != null && /* @__PURE__ */ g("div", {
45
46
  className: "select-appframe__asidenav",
46
47
  children: e
47
- }), t != null && /* @__PURE__ */ m("div", {
48
+ }), t != null && /* @__PURE__ */ g("div", {
48
49
  className: "select-appframe__asidecompact",
49
50
  children: t
50
51
  })]
51
52
  }), r]
52
53
  });
53
54
  });
54
- function S({ pages: e, onPick: t }) {
55
- return /* @__PURE__ */ m(p, { children: e.map((e) => /* @__PURE__ */ m(g, {
55
+ function w({ pages: e, onPick: t }) {
56
+ return /* @__PURE__ */ g(h, { children: e.map((e) => /* @__PURE__ */ _(v, {
56
57
  to: e.to,
57
- className: _("select-apprail__page", e.current && "is-active"),
58
+ className: y("select-apprail__page", e.current && "is-active"),
58
59
  "aria-current": e.current ? "page" : void 0,
59
60
  onClick: t,
60
- children: e.label
61
+ children: [e.label, /* @__PURE__ */ g(o, { item: e })]
61
62
  }, e.id)) });
62
63
  }
63
- function C({ items: t, wide: n, open: r, setOpen: i, flyout: a, setFlyout: o, up: s = !1, t: c }) {
64
- var f, p;
65
- let v = t.findIndex((e) => e.active), y = d(0);
66
- v >= 0 && (y.current = v);
67
- let b = n ? t.findIndex((e) => {
64
+ function T({ items: t, wide: n, open: r, setOpen: i, flyout: a, setFlyout: c, up: l = !1, t: u }) {
65
+ var m, h;
66
+ let b = t.findIndex((e) => e.active), x = p(0);
67
+ b >= 0 && (x.current = b);
68
+ let S = n ? t.findIndex((e) => {
68
69
  var t;
69
70
  return e.id === r && (((t = e.pages) == null ? void 0 : t.length) ?? 0) > 0;
70
- }) : -1, x = b >= 0 && b < y.current ? ((f = t[b].pages) == null ? void 0 : f.length) ?? 0 : 0, C = d(null), w = d(null), T = (p = t.flatMap((e) => e.pages ?? []).find((e) => e.current)) == null ? void 0 : p.id;
71
- return u(() => {
72
- let e = w.current;
73
- e && (e.style.setProperty("--rail-i", String(y.current)), e.style.setProperty("--rail-pn", String(x)), e.style.setProperty("--rail-pb", x > 0 ? "1" : "0"));
74
- }), l(() => {
71
+ }) : -1, C = S >= 0 && S < x.current ? ((m = t[S].pages) == null ? void 0 : m.length) ?? 0 : 0, T = p(null), E = p(null), D = (h = t.flatMap((e) => e.pages ?? []).find((e) => e.current)) == null ? void 0 : h.id, O = s();
72
+ return f(() => {
73
+ let e = E.current;
74
+ e && (e.style.setProperty("--rail-i", String(x.current)), e.style.setProperty("--rail-pn", String(C)), e.style.setProperty("--rail-pb", C > 0 ? "1" : "0"));
75
+ }), d(() => {
75
76
  var e, t;
76
- n && ((e = C.current) == null || (e = e.querySelector(".select-apprail__page[aria-current=\"page\"]")) == null || (t = e.scrollIntoView) == null || t.call(e, { block: "nearest" }));
77
+ n && ((e = T.current) == null || (e = e.querySelector(".select-apprail__page[aria-current=\"page\"]")) == null || (t = e.scrollIntoView) == null || t.call(e, { block: "nearest" }));
77
78
  }, [
78
- T,
79
+ D,
79
80
  r,
80
81
  n
81
- ]), /* @__PURE__ */ h("div", {
82
- ref: C,
83
- className: _("select-apprail__pill", n && "is-wide"),
84
- children: [/* @__PURE__ */ m("span", {
85
- ref: w,
86
- className: _("select-apprail__ind", v >= 0 && "is-on"),
82
+ ]), /* @__PURE__ */ _("div", {
83
+ ref: T,
84
+ className: y("select-apprail__pill", n && "is-wide"),
85
+ children: [/* @__PURE__ */ g("span", {
86
+ ref: E,
87
+ className: y("select-apprail__ind", b >= 0 && "is-on"),
87
88
  "aria-hidden": "true"
88
89
  }), t.map((t) => {
89
- let l = t.pages ?? [], u = l.length > 0, d = n && u && r === t.id, f = !n && u && a === t.id;
90
- return /* @__PURE__ */ h("div", {
90
+ let s = t.pages ?? [], d = s.length > 0, f = n && d && r === t.id, p = !n && d && a === t.id;
91
+ return /* @__PURE__ */ _("div", {
91
92
  className: "select-apprail__slot",
92
93
  children: [
93
- /* @__PURE__ */ h(g, {
94
+ /* @__PURE__ */ _(v, {
94
95
  to: t.to,
95
- className: _("select-apprail__btn", t.active && "is-active"),
96
- "aria-label": t.label,
96
+ className: y("select-apprail__btn", t.active && "is-active"),
97
+ "aria-label": O(t.label, t),
97
98
  "aria-current": t.active ? "true" : void 0,
98
- "aria-expanded": u ? d || f : void 0,
99
+ "aria-expanded": d ? f || p : void 0,
99
100
  onClick: (e) => {
100
- if (!u) {
101
- o(null);
101
+ if (!d) {
102
+ c(null);
102
103
  return;
103
104
  }
104
105
  if (!n) {
105
- e.preventDefault(), o(f ? null : t.id);
106
+ e.preventDefault(), c(p ? null : t.id);
106
107
  return;
107
108
  }
108
- d && t.active && e.preventDefault(), i(d ? null : t.id);
109
+ f && t.active && e.preventDefault(), i(f ? null : t.id);
109
110
  },
110
111
  children: [
111
- /* @__PURE__ */ m("span", {
112
+ /* @__PURE__ */ _("span", {
112
113
  className: "select-apprail__icon",
113
114
  "aria-hidden": "true",
114
- children: t.icon
115
+ children: [t.icon, /* @__PURE__ */ g(o, {
116
+ item: t,
117
+ corner: !0,
118
+ spoken: !1
119
+ })]
115
120
  }),
116
- /* @__PURE__ */ m("span", {
121
+ /* @__PURE__ */ g("span", {
117
122
  className: "select-apprail__label",
118
123
  "aria-hidden": "true",
119
124
  children: t.label
120
125
  }),
121
- u && /* @__PURE__ */ m("span", {
122
- className: _("select-apprail__chev", d && "is-open"),
126
+ d && /* @__PURE__ */ g("span", {
127
+ className: y("select-apprail__chev", f && "is-open"),
123
128
  "aria-hidden": "true",
124
- children: /* @__PURE__ */ m(e, {})
129
+ children: /* @__PURE__ */ g(e, {})
125
130
  }),
126
- !n && !f && /* @__PURE__ */ h("span", {
131
+ !n && !p && /* @__PURE__ */ _("span", {
127
132
  className: "select-apprail__tip",
128
133
  "aria-hidden": "true",
129
- children: [/* @__PURE__ */ m("span", {
134
+ children: [/* @__PURE__ */ g("span", {
130
135
  className: "select-apprail__name",
131
136
  children: t.label
132
- }), u && /* @__PURE__ */ m("span", {
137
+ }), d && /* @__PURE__ */ g("span", {
133
138
  className: "select-apprail__hint",
134
- children: c.seePages
139
+ children: u.seePages
135
140
  })]
136
141
  })
137
142
  ]
138
143
  }),
139
- f && /* @__PURE__ */ h("div", {
140
- className: _("select-apprail__fly", s && "select-apprail__fly--up"),
144
+ p && /* @__PURE__ */ _("div", {
145
+ className: y("select-apprail__fly", l && "select-apprail__fly--up"),
141
146
  role: "group",
142
- "aria-label": c.sectionPages(t.label),
143
- children: [/* @__PURE__ */ m("span", {
147
+ "aria-label": u.sectionPages(t.label),
148
+ children: [/* @__PURE__ */ g("span", {
144
149
  className: "select-apprail__flytitle",
145
150
  children: t.label
146
- }), /* @__PURE__ */ m(S, {
147
- pages: l,
148
- onPick: () => o(null)
151
+ }), /* @__PURE__ */ g(w, {
152
+ pages: s,
153
+ onPick: () => c(null)
149
154
  })]
150
155
  }),
151
- u && /* @__PURE__ */ m("div", {
152
- className: _("select-apprail__pagesw", d && "is-open"),
153
- children: /* @__PURE__ */ m("div", {
156
+ d && /* @__PURE__ */ g("div", {
157
+ className: y("select-apprail__pagesw", f && "is-open"),
158
+ children: /* @__PURE__ */ g("div", {
154
159
  className: "select-apprail__pagesclip",
155
- children: /* @__PURE__ */ m("div", {
160
+ children: /* @__PURE__ */ g("div", {
156
161
  className: "select-apprail__pages",
157
162
  role: "group",
158
- "aria-label": c.sectionPages(t.label),
159
- children: /* @__PURE__ */ m(S, { pages: l })
163
+ "aria-label": u.sectionPages(t.label),
164
+ children: /* @__PURE__ */ g(w, { pages: s })
160
165
  })
161
166
  })
162
167
  })
@@ -165,20 +170,20 @@ function C({ items: t, wide: n, open: r, setOpen: i, flyout: a, setFlyout: o, up
165
170
  })]
166
171
  });
167
172
  }
168
- function w({ label: e, wide: t, onToggle: i, items: a, bottom: o = [], shortcutKey: s = "[", toggleIcon: c, messages: u }) {
169
- var p, g;
170
- let v = {
173
+ function E({ label: e, wide: t, onToggle: i, items: a, bottom: o = [], shortcutKey: s = "[", toggleIcon: c, messages: l }) {
174
+ var u, f;
175
+ let h = {
171
176
  ...r().appFrame.rail,
172
- ...u
173
- }, y = [...a, ...o], b = ((p = y.find((e) => e.active)) == null ? void 0 : p.id) ?? null, x = ((g = y.flatMap((e) => e.pages ?? []).find((e) => e.current)) == null ? void 0 : g.id) ?? null, [S, w] = f(b);
174
- l(() => w(b), [b]);
175
- let [T, E] = f(null), D = d(null);
176
- l(() => E(null), [
177
+ ...l
178
+ }, v = [...a, ...o], b = ((u = v.find((e) => e.active)) == null ? void 0 : u.id) ?? null, x = ((f = v.flatMap((e) => e.pages ?? []).find((e) => e.current)) == null ? void 0 : f.id) ?? null, [S, C] = m(b);
179
+ d(() => C(b), [b]);
180
+ let [w, E] = m(null), D = p(null);
181
+ d(() => E(null), [
177
182
  b,
178
183
  x,
179
184
  t
180
- ]), l(() => {
181
- if (!T) return;
185
+ ]), d(() => {
186
+ if (!w) return;
182
187
  let e = (e) => {
183
188
  var t;
184
189
  (t = D.current) != null && t.contains(e.target) || E(null);
@@ -188,9 +193,9 @@ function w({ label: e, wide: t, onToggle: i, items: a, bottom: o = [], shortcutK
188
193
  return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
189
194
  document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
190
195
  };
191
- }, [T]);
192
- let O = d(i);
193
- O.current = i, l(() => {
196
+ }, [w]);
197
+ let O = p(i);
198
+ O.current = i, d(() => {
194
199
  if (!s) return;
195
200
  let e = (e) => {
196
201
  if (e.key !== s || e.metaKey || e.ctrlKey || e.altKey) return;
@@ -199,50 +204,50 @@ function w({ label: e, wide: t, onToggle: i, items: a, bottom: o = [], shortcutK
199
204
  };
200
205
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
201
206
  }, [s]);
202
- let k = t ? v.collapse : v.expand, A = (e, n = !1) => /* @__PURE__ */ m(C, {
207
+ let k = t ? h.collapse : h.expand, A = (e, n = !1) => /* @__PURE__ */ g(T, {
203
208
  items: e,
204
209
  wide: t,
205
210
  open: S,
206
- setOpen: w,
207
- flyout: T,
211
+ setOpen: C,
212
+ flyout: w,
208
213
  setFlyout: E,
209
214
  up: n,
210
- t: v
215
+ t: h
211
216
  });
212
- return /* @__PURE__ */ h("nav", {
217
+ return /* @__PURE__ */ _("nav", {
213
218
  ref: D,
214
219
  "aria-label": e,
215
- className: _("select-apprail", t && "is-wide"),
216
- children: [/* @__PURE__ */ h("div", {
220
+ className: y("select-apprail", t && "is-wide"),
221
+ children: [/* @__PURE__ */ _("div", {
217
222
  className: "select-apprail__top",
218
- children: [/* @__PURE__ */ h("button", {
223
+ children: [/* @__PURE__ */ _("button", {
219
224
  type: "button",
220
225
  className: "select-apprail__toggle",
221
226
  "aria-expanded": t,
222
227
  "aria-label": k,
223
228
  onClick: i,
224
229
  children: [
225
- /* @__PURE__ */ m("span", {
230
+ /* @__PURE__ */ g("span", {
226
231
  className: "select-apprail__icon",
227
232
  "aria-hidden": "true",
228
- children: c ?? /* @__PURE__ */ m(n, {})
233
+ children: c ?? /* @__PURE__ */ g(n, {})
229
234
  }),
230
- /* @__PURE__ */ m("span", {
235
+ /* @__PURE__ */ g("span", {
231
236
  className: "select-apprail__label",
232
237
  "aria-hidden": "true",
233
238
  children: k
234
239
  }),
235
- s && /* @__PURE__ */ m("kbd", {
240
+ s && /* @__PURE__ */ g("kbd", {
236
241
  className: "select-apprail__kbd",
237
242
  "aria-hidden": "true",
238
243
  children: s
239
244
  }),
240
- !t && /* @__PURE__ */ m("span", {
245
+ !t && /* @__PURE__ */ g("span", {
241
246
  className: "select-apprail__tip",
242
247
  "aria-hidden": "true",
243
- children: /* @__PURE__ */ m("span", {
248
+ children: /* @__PURE__ */ g("span", {
244
249
  className: "select-apprail__name",
245
- children: s ? v.shortcut(k, s) : k
250
+ children: s ? h.shortcut(k, s) : k
246
251
  })
247
252
  })
248
253
  ]
@@ -250,40 +255,40 @@ function w({ label: e, wide: t, onToggle: i, items: a, bottom: o = [], shortcutK
250
255
  }), o.length > 0 && A(o, !0)]
251
256
  });
252
257
  }
253
- function T({ id: e, open: n, onClose: a, label: o, logo: s, closeLabel: c, closeIcon: u, context: f, children: p }) {
254
- let g = r().appFrame, _ = d(null);
255
- return l(() => {
258
+ function D({ id: e, open: n, onClose: a, label: o, logo: s, closeLabel: c, closeIcon: l, context: u, children: f }) {
259
+ let m = r().appFrame, h = p(null);
260
+ return d(() => {
256
261
  var e, t;
257
- let r = _.current;
262
+ let r = h.current;
258
263
  r && (n && !r.open ? (e = r.showModal) == null || e.call(r) : !n && r.open && ((t = r.close) == null || t.call(r)));
259
- }, [n]), /* @__PURE__ */ m("dialog", {
260
- ref: _,
264
+ }, [n]), /* @__PURE__ */ g("dialog", {
265
+ ref: h,
261
266
  id: e,
262
267
  "aria-label": o,
263
268
  className: "select-appdrawer",
264
269
  onClose: a,
265
270
  onClick: (e) => e.target === e.currentTarget && a(),
266
- children: /* @__PURE__ */ h("div", {
271
+ children: /* @__PURE__ */ _("div", {
267
272
  className: "select-appdrawer__box",
268
273
  children: [
269
- /* @__PURE__ */ h("div", {
274
+ /* @__PURE__ */ _("div", {
270
275
  className: "select-appdrawer__head",
271
- children: [s, /* @__PURE__ */ m(i, {
272
- label: c ?? g.drawerClose,
273
- icon: u ?? /* @__PURE__ */ m(t, {}),
276
+ children: [s, /* @__PURE__ */ g(i, {
277
+ label: c ?? m.drawerClose,
278
+ icon: l ?? /* @__PURE__ */ g(t, {}),
274
279
  onClick: a
275
280
  })]
276
281
  }),
277
- f != null && /* @__PURE__ */ m("div", {
282
+ u != null && /* @__PURE__ */ g("div", {
278
283
  className: "select-appdrawer__context",
279
- children: f
284
+ children: u
280
285
  }),
281
- p
286
+ f
282
287
  ]
283
288
  })
284
289
  });
285
290
  }
286
291
  //#endregion
287
- export { T as SelectAppDrawer, y as SelectAppFrame, x as SelectAppMain, b as SelectAppPanel, w as SelectAppRail };
292
+ export { D as SelectAppDrawer, x as SelectAppFrame, C as SelectAppMain, S as SelectAppPanel, E as SelectAppRail };
288
293
 
289
294
  //# sourceMappingURL=SelectAppFrame.js.map
@@ -0,0 +1,31 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ export interface SelectAvatarGroupPerson {
3
+ /** O nome: as iniciais do rosto e o rótulo do grupo. */
4
+ name: string;
5
+ /** A foto; sem ela (ou quando ela não carrega), as iniciais. */
6
+ src?: string;
7
+ /** A sigla pronta, até 3 letras (vence o nome no rosto). */
8
+ monogram?: string;
9
+ /** A chave da lista (padrão: a posição e o nome). */
10
+ id?: string;
11
+ }
12
+ type SelectAvatarGroupOwnProps = {
13
+ /** As pessoas, na ordem em que aparecem. */
14
+ people: readonly SelectAvatarGroupPerson[];
15
+ /** O máximo de círculos, contando o "+N" (padrão 4; no mínimo 1). */
16
+ max?: number;
17
+ /** Quantas pessoas são, quando `people` é só uma amostra (padrão: o tamanho de `people`). */
18
+ total?: number;
19
+ /** O tamanho do `SelectAvatar`: `sm` (20px), `md` (36px, o padrão) ou `lg` (60px). */
20
+ size?: 'sm' | 'md' | 'lg';
21
+ /** O rótulo para o leitor de tela (padrão: "Ana, Bruno e mais 3"). */
22
+ label?: string;
23
+ };
24
+ export type SelectAvatarGroupProps = SelectAvatarGroupOwnProps & Omit<ComponentPropsWithoutRef<'span'>, keyof SelectAvatarGroupOwnProps | 'children'>;
25
+ /** Os rostos à vista e quantos ficam no "+N", pelo `max` e pelo `total`. */
26
+ export declare function avatarGroupSlots(count: number, people: number, max: number): {
27
+ faces: number;
28
+ rest: number;
29
+ };
30
+ export declare const SelectAvatarGroup: import('react').ForwardRefExoticComponent<SelectAvatarGroupOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, "children" | keyof SelectAvatarGroupOwnProps> & import('react').RefAttributes<HTMLSpanElement>>;
31
+ export {};
@@ -0,0 +1,39 @@
1
+ import { formatSelectNumber as e, useSelectLocale as t, useSelectMessages as n } from "./SelectLocale.js";
2
+ import { SelectAvatar as r } from "./SelectAvatar.js";
3
+ import { forwardRef as i } from "react";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ //#region src/SelectAvatarGroup.tsx
6
+ function s(e, t, n) {
7
+ let r = Number.isFinite(n) ? Math.max(1, Math.floor(n)) : Infinity, i = Math.max(e, t), a = Math.min(t, i <= r ? r : r - 1);
8
+ return {
9
+ faces: a,
10
+ rest: i - a
11
+ };
12
+ }
13
+ var c = i(function({ people: i, max: c = 4, total: l, size: u = "md", label: d, className: f, ...p }, m) {
14
+ let h = n().avatarGroup, g = t(), { faces: _, rest: v } = s(l ?? i.length, i.length, c);
15
+ if (_ + v === 0) return null;
16
+ let y = i.slice(0, _), b = y.map((e) => e.name.trim()).filter(Boolean), x = d ?? h.label(b, v + (y.length - b.length));
17
+ return /* @__PURE__ */ o("span", {
18
+ ref: m,
19
+ role: "img",
20
+ "aria-label": x,
21
+ ...p,
22
+ className: `select-avatargroup select-avatargroup--${u}${f ? ` ${f}` : ""}`,
23
+ children: [y.map((e, t) => /* @__PURE__ */ a(r, {
24
+ name: e.name,
25
+ src: e.src,
26
+ monogram: e.monogram,
27
+ initials: u === "sm" ? 1 : 2,
28
+ size: u
29
+ }, e.id ?? `${t}:${e.name}`)), v > 0 && /* @__PURE__ */ o("span", {
30
+ className: "select-avatargroup__more",
31
+ "aria-hidden": "true",
32
+ children: ["+", e(v, g)]
33
+ })]
34
+ });
35
+ });
36
+ //#endregion
37
+ export { c as SelectAvatarGroup, s as avatarGroupSlots };
38
+
39
+ //# sourceMappingURL=SelectAvatarGroup.js.map
@@ -1,7 +1,7 @@
1
1
  import { ReactNode, ComponentPropsWithoutRef } from 'react';
2
2
  type SelectBadgeOwnProps = {
3
3
  children: ReactNode;
4
- tone?: 'neutral' | 'brand' | 'pro' | 'success' | 'info' | 'warning' | 'critical' | 'outline';
4
+ tone?: 'neutral' | 'brand' | 'pro' | 'success' | 'info' | 'warning' | 'critical' | 'outline' | 'teal' | 'amber';
5
5
  icon?: ReactNode;
6
6
  /** 'sm' compacts the pill for dense surfaces. Cells of .select-datatable adopt the
7
7
  * compact metrics automatically — pass 'sm' only for dense chrome OUTSIDE tables. */
@@ -11,6 +11,15 @@ type SelectBadgeOwnProps = {
11
11
  * peso do texto: o selo de um estado lê o tom; o de um valor lê o que está escrito.
12
12
  */
13
13
  mono?: boolean;
14
+ /**
15
+ * 0.1.259: tirar a etiqueta. O "x" entra no fim do selo, como um botão (o Tab chega nele, o Enter e o Espaço tiram), e
16
+ * no toque o alvo cresce para 40px sem mudar o desenho. Sem ele, o selo de sempre.
17
+ */
18
+ onRemove?: () => void;
19
+ /** 0.1.259: o nome do "x". Padrão: "Tirar <texto do selo>"; com um nó no lugar do texto, passe o nome aqui. */
20
+ removeLabel?: string;
21
+ /** 0.1.259: o "x" apagado (enquanto a mudança grava). */
22
+ removeDisabled?: boolean;
14
23
  };
15
24
  export type SelectBadgeProps = SelectBadgeOwnProps & Omit<ComponentPropsWithoutRef<'span'>, keyof SelectBadgeOwnProps>;
16
25
  export declare const SelectBadge: import('react').ForwardRefExoticComponent<SelectBadgeOwnProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref">, keyof SelectBadgeOwnProps> & import('react').RefAttributes<HTMLSpanElement>>;
@@ -1,18 +1,32 @@
1
- import { forwardRef as e } from "react";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
1
+ import { CloseIcon as e } from "./icons.js";
2
+ import { useSelectMessages as t } from "./SelectLocale.js";
3
+ import { forwardRef as n } from "react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
5
  //#region src/SelectBadge.tsx
4
- var r = e(function({ children: e, tone: r = "neutral", icon: i, size: a = "md", mono: o = !1, className: s, ...c }, l) {
5
- return /* @__PURE__ */ n("span", {
6
- ref: l,
7
- ...c,
8
- className: `select-badge select-badge--${r}${a === "sm" ? " select-badge--sm" : ""}${o ? " select-badge--mono" : ""}${s ? " " + s : ""}`,
9
- children: [i && /* @__PURE__ */ t("span", {
10
- className: "select-badge__icon",
11
- children: i
12
- }), e]
6
+ var a = (e) => typeof e == "string" || typeof e == "number" ? String(e).trim() : "", o = n(function({ children: n, tone: o = "neutral", icon: s, size: c = "md", mono: l = !1, onRemove: u, removeLabel: d, removeDisabled: f = !1, className: p, ...m }, h) {
7
+ let g = t().badge;
8
+ return /* @__PURE__ */ i("span", {
9
+ ref: h,
10
+ ...m,
11
+ className: `select-badge select-badge--${o}${c === "sm" ? " select-badge--sm" : ""}${l ? " select-badge--mono" : ""}${u ? " select-badge--removable" : ""}${p ? " " + p : ""}`,
12
+ children: [
13
+ s && /* @__PURE__ */ r("span", {
14
+ className: "select-badge__icon",
15
+ children: s
16
+ }),
17
+ n,
18
+ u ? /* @__PURE__ */ r("button", {
19
+ type: "button",
20
+ className: "select-badge__remove",
21
+ "aria-label": d ?? g.remove(a(n)),
22
+ disabled: f,
23
+ onClick: u,
24
+ children: /* @__PURE__ */ r(e, {})
25
+ }) : null
26
+ ]
13
27
  });
14
28
  });
15
29
  //#endregion
16
- export { r as SelectBadge };
30
+ export { o as SelectBadge };
17
31
 
18
32
  //# sourceMappingURL=SelectBadge.js.map
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SelectBulkBarProps {
3
+ /** Quantos estão marcados. Sem nenhum, a barra não aparece. */
4
+ count: number;
5
+ /** As ações do lote (os botões do kit: "Resolver os 3", "Transferir"). */
6
+ children?: ReactNode;
7
+ /** O "Limpar a seleção". */
8
+ onClear: () => void;
9
+ /** O texto da conta (padrão "3 selecionados"). */
10
+ countLabel?: (count: number) => string;
11
+ /** O nome do "Limpar a seleção". */
12
+ clearLabel?: string;
13
+ /** A nota miúda depois das ações ("Em lote: até 100 por vez, e fica na trilha"). */
14
+ hint?: ReactNode;
15
+ /** Presa ao pé da área que rola: `true` sempre, `'phone'` só no celular; sem ela, no lugar dela. */
16
+ sticky?: boolean | 'phone';
17
+ /** O nome da região para o leitor de tela (padrão "Ações em lote"). */
18
+ label?: string;
19
+ className?: string;
20
+ }
21
+ export declare function SelectBulkBar({ count, children, onClear, countLabel, clearLabel, hint, sticky, label, className }: SelectBulkBarProps): import("react").JSX.Element | null;
@@ -0,0 +1,40 @@
1
+ import { SelectButton as e } from "./SelectButton.js";
2
+ import { useSelectMessages as t } from "./SelectLocale.js";
3
+ import { SelectBadge as n } from "./SelectBadge.js";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/SelectBulkBar.tsx
6
+ function a({ count: a, children: o, onClear: s, countLabel: c, clearLabel: l, hint: u, sticky: d = !1, label: f, className: p }) {
7
+ let m = t().bulkBar;
8
+ return a <= 0 ? null : /* @__PURE__ */ i("div", {
9
+ className: `select-bulkbar${d === "phone" ? " select-bulkbar--sticky-phone" : d ? " select-bulkbar--sticky" : ""}${p ? " " + p : ""}`,
10
+ role: "region",
11
+ "aria-label": f ?? m.label,
12
+ children: [
13
+ /* @__PURE__ */ r(n, {
14
+ tone: "brand",
15
+ className: "select-bulkbar__count",
16
+ "aria-live": "polite",
17
+ children: (c ?? m.count)(a)
18
+ }),
19
+ o == null ? null : /* @__PURE__ */ r("div", {
20
+ className: "select-bulkbar__actions",
21
+ children: o
22
+ }),
23
+ /* @__PURE__ */ r(e, {
24
+ variant: "ghost",
25
+ size: "sm",
26
+ inline: !0,
27
+ onClick: s,
28
+ children: l ?? m.clear
29
+ }),
30
+ u != null && u !== "" ? /* @__PURE__ */ r("span", {
31
+ className: "select-bulkbar__hint",
32
+ children: u
33
+ }) : null
34
+ ]
35
+ });
36
+ }
37
+ //#endregion
38
+ export { a as SelectBulkBar };
39
+
40
+ //# sourceMappingURL=SelectBulkBar.js.map