@versini/ui-panel 1.0.8 → 1.0.9

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.
@@ -1,9 +1,9 @@
1
1
  import { jsx as i, jsxs as D, Fragment as M } from "react/jsx-runtime";
2
2
  import y from "clsx";
3
3
  import * as c from "react";
4
- import { useRef as b, useReducer as N, useEffect as _, useId as x } from "react";
5
- import { useFloating as $, useClick as S, useDismiss as O, useRole as F, useInteractions as P, useMergeRefs as k, FloatingPortal as L, FloatingOverlay as U, FloatingFocusManager as V } from "@floating-ui/react";
6
- const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
4
+ import { useRef as b, useReducer as N, useEffect as _, useId as w } from "react";
5
+ import { useFloating as x, useClick as $, useDismiss as S, useRole as O, useInteractions as F, useMergeRefs as k, FloatingPortal as L, FloatingOverlay as P, FloatingFocusManager as U } from "@floating-ui/react";
6
+ const I = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", V = {
7
7
  alert: null,
8
8
  alertdialog: null,
9
9
  log: "polite",
@@ -11,9 +11,9 @@ const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
11
11
  progressbar: null,
12
12
  status: "polite",
13
13
  timer: "assertive"
14
- }, B = (e, n) => {
14
+ }, j = (e, n) => {
15
15
  switch (n == null ? void 0 : n.type) {
16
- case w:
16
+ case I:
17
17
  return {
18
18
  ...e,
19
19
  announcement: n.payload
@@ -26,7 +26,7 @@ const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
26
26
  default:
27
27
  return e;
28
28
  }
29
- }, q = ({
29
+ }, B = ({
30
30
  onAnnouncementClear: e,
31
31
  dispatch: n
32
32
  }) => {
@@ -41,16 +41,16 @@ const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
41
41
  dispatch: l
42
42
  }) => {
43
43
  (o == null ? void 0 : o.current) !== null && clearTimeout(o.current), e !== null && l({
44
- type: w,
44
+ type: I,
45
45
  payload: e
46
46
  }), n && (o.current = setTimeout(
47
- () => q({
47
+ () => B({
48
48
  onAnnouncementClear: t,
49
49
  dispatch: l
50
50
  }),
51
51
  n
52
52
  ));
53
- }, H = ({
53
+ }, q = ({
54
54
  children: e,
55
55
  announcementTimeoutRef: n,
56
56
  announcementDelay: o,
@@ -73,7 +73,7 @@ const w = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", j = {
73
73
  dispatch: a
74
74
  });
75
75
  };
76
- function X({
76
+ function W({
77
77
  children: e,
78
78
  className: n,
79
79
  politeness: o,
@@ -82,21 +82,21 @@ function X({
82
82
  clearAnnouncementDelay: r,
83
83
  onAnnouncementClear: a,
84
84
  visible: s,
85
- ...f
85
+ ...p
86
86
  }) {
87
- const u = b(), d = b(), [m, p] = N(B, {
87
+ const u = b(), d = b(), [m, f] = N(j, {
88
88
  announcement: null
89
89
  });
90
90
  let h = o;
91
- typeof h > "u" && (h = t ? j[t] : "assertive"), _(() => {
92
- H({
91
+ typeof h > "u" && (h = t ? V[t] : "assertive"), _(() => {
92
+ q({
93
93
  announcementTimeoutRef: u,
94
94
  announcementDelay: l,
95
95
  children: e,
96
96
  clearAnnouncementDelay: r,
97
97
  clearAnnouncementTimeoutRef: d,
98
98
  onAnnouncementClear: a,
99
- dispatch: p
99
+ dispatch: f
100
100
  });
101
101
  }, [
102
102
  e,
@@ -113,26 +113,26 @@ function X({
113
113
  "aria-live": h,
114
114
  ...t && { role: t },
115
115
  className: g,
116
- ...f,
116
+ ...p,
117
117
  children: m.announcement
118
118
  }
119
119
  );
120
120
  }
121
121
  const E = c.createContext(null);
122
- function z({
122
+ function H({
123
123
  initialOpen: e = !1,
124
124
  open: n,
125
125
  onOpenChange: o
126
126
  } = {}) {
127
- const [t, l] = c.useState(e), [r, a] = c.useState(), [s, f] = c.useState(), u = n ?? t, d = o ?? l, m = $({
127
+ const [t, l] = c.useState(e), [r, a] = c.useState(), [s, p] = c.useState(), u = n ?? t, d = o ?? l, m = x({
128
128
  open: u,
129
129
  onOpenChange: d
130
- }), p = m.context, h = S(p, {
130
+ }), f = m.context, h = $(f, {
131
131
  enabled: n == null
132
- }), g = O(p, {
132
+ }), g = S(f, {
133
133
  outsidePress: !1,
134
134
  outsidePressEvent: "mousedown"
135
- }), T = F(p), A = P([h, g, T]);
135
+ }), T = O(f), A = F([h, g, T]);
136
136
  return c.useMemo(
137
137
  () => ({
138
138
  open: u,
@@ -142,7 +142,7 @@ function z({
142
142
  labelId: r,
143
143
  descriptionId: s,
144
144
  setLabelId: a,
145
- setDescriptionId: f
145
+ setDescriptionId: p
146
146
  }),
147
147
  [u, d, A, m, r, s]
148
148
  );
@@ -153,17 +153,14 @@ const v = () => {
153
153
  throw new Error("Modal components must be wrapped in <Modal />");
154
154
  return e;
155
155
  };
156
- function I(e) {
157
- return x();
158
- }
159
- function Y({
156
+ function X({
160
157
  children: e,
161
158
  ...n
162
159
  }) {
163
- const o = z(n);
160
+ const o = H(n);
164
161
  return /* @__PURE__ */ i(E.Provider, { value: o, children: e });
165
162
  }
166
- const Z = c.forwardRef(function(e, n) {
163
+ const Y = c.forwardRef(function(e, n) {
167
164
  const { context: o, ...t } = v(), l = k([t.refs.setFloating, n]);
168
165
  if (!o.open)
169
166
  return null;
@@ -171,7 +168,7 @@ const Z = c.forwardRef(function(e, n) {
171
168
  [`${r}`]: r,
172
169
  "bg-black sm:bg-black/[.8]": !r
173
170
  });
174
- return /* @__PURE__ */ i(L, { children: /* @__PURE__ */ i(U, { className: s, lockScroll: !0, children: /* @__PURE__ */ i(V, { context: o, children: /* @__PURE__ */ i(
171
+ return /* @__PURE__ */ i(L, { children: /* @__PURE__ */ i(P, { className: s, lockScroll: !0, children: /* @__PURE__ */ i(U, { context: o, children: /* @__PURE__ */ i(
175
172
  "div",
176
173
  {
177
174
  ref: l,
@@ -181,20 +178,20 @@ const Z = c.forwardRef(function(e, n) {
181
178
  children: a.children
182
179
  }
183
180
  ) }) }) });
184
- }), ee = c.forwardRef(function({ children: e, ...n }, o) {
185
- const { setLabelId: t } = v(), l = I();
181
+ }), Z = c.forwardRef(function({ children: e, ...n }, o) {
182
+ const { setLabelId: t } = v(), l = w();
186
183
  return c.useLayoutEffect(() => (t(l), () => t(void 0)), [l, t]), /* @__PURE__ */ i("h1", { ...n, ref: o, id: l, children: e });
187
- }), ne = c.forwardRef(function({ children: e, ...n }, o) {
188
- const { setDescriptionId: t } = v(), l = I();
184
+ }), ee = c.forwardRef(function({ children: e, ...n }, o) {
185
+ const { setDescriptionId: t } = v(), l = w();
189
186
  return c.useLayoutEffect(() => (t(l), () => t(void 0)), [l, t]), /* @__PURE__ */ i("div", { ...n, ref: o, id: l, children: e });
190
- }), oe = c.forwardRef(function(e, n) {
187
+ }), ne = c.forwardRef(function(e, n) {
191
188
  const { setOpen: o } = v(), { trigger: t, className: l, ...r } = e, a = c.useCallback(() => o(!1), [o]);
192
189
  return /* @__PURE__ */ i("div", { className: l, children: c.cloneElement(t, {
193
190
  ref: n,
194
191
  onClick: a,
195
192
  ...r
196
193
  }) });
197
- }), G = (e) => {
194
+ }), z = (e) => {
198
195
  let n = "";
199
196
  if (typeof e == "number" || typeof e == "string")
200
197
  n = "m-" + e;
@@ -203,7 +200,7 @@ const Z = c.forwardRef(function(e, n) {
203
200
  (e == null ? void 0 : e.t) !== void 0 && o.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && o.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && o.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && o.push(`ml-${e.l}`), n = o.join(" ");
204
201
  }
205
202
  return n;
206
- }, te = ({
203
+ }, oe = ({
207
204
  children: e,
208
205
  fill: n,
209
206
  viewBox: o,
@@ -212,10 +209,10 @@ const Z = c.forwardRef(function(e, n) {
212
209
  defaultClassName: r,
213
210
  spacing: a,
214
211
  title: s,
215
- semantic: f = !1,
212
+ semantic: p = !1,
216
213
  ...u
217
214
  }) => {
218
- const d = G(a), m = y(
215
+ const d = z(a), m = y(
219
216
  d,
220
217
  t || r
221
218
  );
@@ -228,34 +225,34 @@ const Z = c.forwardRef(function(e, n) {
228
225
  viewBox: o || l,
229
226
  fill: n || "currentColor",
230
227
  role: "img",
231
- "aria-hidden": !f,
228
+ "aria-hidden": !p,
232
229
  focusable: !1,
233
230
  ...u,
234
231
  children: e
235
232
  }
236
233
  ),
237
- s && f && /* @__PURE__ */ i("span", { className: "sr-only", children: s })
234
+ s && p && /* @__PURE__ */ i("span", { className: "sr-only", children: s })
238
235
  ] });
239
236
  };
240
237
  /*!
241
- @versini/ui-private v1.4.16
238
+ @versini/ui-private v1.4.17
242
239
  © 2024 gizmette.com
243
240
  */
244
241
  try {
245
242
  window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
246
- version: "1.4.16",
247
- buildTime: "09/27/2024 10:43 AM EDT",
243
+ version: "1.4.17",
244
+ buildTime: "09/27/2024 11:55 AM EDT",
248
245
  homepage: "https://github.com/aversini/ui-components",
249
246
  license: "MIT"
250
247
  });
251
248
  } catch {
252
249
  }
253
250
  export {
254
- X as LiveRegion,
255
- Y as Modal,
256
- oe as ModalClose,
257
- Z as ModalContent,
258
- ne as ModalDescription,
259
- ee as ModalHeading,
260
- te as SvgIcon
251
+ W as LiveRegion,
252
+ X as Modal,
253
+ ne as ModalClose,
254
+ Y as ModalContent,
255
+ ee as ModalDescription,
256
+ Z as ModalHeading,
257
+ oe as SvgIcon
261
258
  };
package/dist/index.js CHANGED
@@ -2,13 +2,13 @@ import { jsx as l, jsxs as y, Fragment as z } from "react/jsx-runtime";
2
2
  import o from "clsx";
3
3
  import E, { lazy as U, useRef as P, useEffect as j, Suspense as O } from "react";
4
4
  /*!
5
- @versini/ui-panel v1.0.8
5
+ @versini/ui-panel v1.0.9
6
6
  © 2024 gizmette.com
7
7
  */
8
8
  try {
9
9
  window.__VERSINI_UI_PANEL__ || (window.__VERSINI_UI_PANEL__ = {
10
- version: "1.0.8",
11
- buildTime: "09/27/2024 10:44 AM EDT",
10
+ version: "1.0.9",
11
+ buildTime: "09/27/2024 11:56 AM EDT",
12
12
  homepage: "https://github.com/aversini/ui-components",
13
13
  license: "MIT"
14
14
  });
@@ -288,13 +288,13 @@ const $ = E.forwardRef(
288
288
  );
289
289
  $.displayName = "ButtonIcon";
290
290
  /*!
291
- @versini/ui-button v1.1.8
291
+ @versini/ui-button v1.1.9
292
292
  © 2024 gizmette.com
293
293
  */
294
294
  try {
295
295
  window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
296
- version: "1.1.8",
297
- buildTime: "09/27/2024 10:43 AM EDT",
296
+ version: "1.1.9",
297
+ buildTime: "09/27/2024 11:56 AM EDT",
298
298
  homepage: "https://github.com/aversini/ui-components",
299
299
  license: "MIT"
300
300
  });
@@ -422,13 +422,13 @@ const Z = (e) => {
422
422
  ] });
423
423
  };
424
424
  /*!
425
- @versini/ui-private v1.4.16
425
+ @versini/ui-private v1.4.17
426
426
  © 2024 gizmette.com
427
427
  */
428
428
  try {
429
429
  window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
430
- version: "1.4.16",
431
- buildTime: "09/27/2024 10:43 AM EDT",
430
+ version: "1.4.17",
431
+ buildTime: "09/27/2024 11:55 AM EDT",
432
432
  homepage: "https://github.com/aversini/ui-components",
433
433
  license: "MIT"
434
434
  });
@@ -455,13 +455,13 @@ const re = ({
455
455
  }
456
456
  );
457
457
  /*!
458
- @versini/ui-icons v1.13.0
458
+ @versini/ui-icons v1.13.1
459
459
  © 2024 gizmette.com
460
460
  */
461
461
  try {
462
462
  window.__VERSINI_UI_ICONS__ || (window.__VERSINI_UI_ICONS__ = {
463
- version: "1.13.0",
464
- buildTime: "09/27/2024 10:43 AM EDT",
463
+ version: "1.13.1",
464
+ buildTime: "09/27/2024 11:55 AM EDT",
465
465
  homepage: "https://github.com/aversini/ui-components",
466
466
  license: "MIT"
467
467
  });
@@ -488,7 +488,7 @@ const p = "panel", x = "messagebox", te = ({
488
488
  header: "sm:p-4 mb-0 p-2",
489
489
  close: "sm:p-4 p-2"
490
490
  }), k = (e) => U(
491
- () => import("./chunks/index.CM2ohLS2.js").then((t) => ({
491
+ () => import("./chunks/index.Ck8u72rb.js").then((t) => ({
492
492
  default: t[e]
493
493
  }))
494
494
  ), ae = k("Modal"), oe = k("ModalClose"), ie = k("ModalContent"), le = k("ModalDescription"), de = k("ModalHeading"), ge = ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-panel",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -42,14 +42,14 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@tailwindcss/typography": "0.5.15",
45
- "@versini/ui-button": "1.1.8",
46
- "@versini/ui-icons": "1.13.0",
47
- "@versini/ui-private": "1.4.16",
45
+ "@versini/ui-button": "1.1.9",
46
+ "@versini/ui-icons": "1.13.1",
47
+ "@versini/ui-private": "1.4.17",
48
48
  "clsx": "2.1.1",
49
49
  "tailwindcss": "3.4.13"
50
50
  },
51
51
  "sideEffects": [
52
52
  "**/*.css"
53
53
  ],
54
- "gitHead": "04197d90dcc3ff0223fe3fbcaa663b62c76439fa"
54
+ "gitHead": "59a50c5bf72988d53a6b7d23afaf87c38bfb1e8f"
55
55
  }