@versini/sassysaint 5.0.1 → 5.1.3

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,10 +1,9 @@
1
1
  import { jsx as i, jsxs as E, Fragment as D } from "react/jsx-runtime";
2
2
  import y from "clsx";
3
3
  import * as c from "react";
4
- import { useRef as C, useReducer as M, useEffect as _, useId as x } from "react";
5
- import { useMergeRefs as S, FloatingPortal as F, FloatingOverlay as O, FloatingFocusManager as P, useFloating as k, useClick as L, useDismiss as V, useRole as B, useInteractions as U } from "@floating-ui/react";
6
- import { S as j } from "./index.CMDql_8l.js";
7
- const b = "SET_ANNOUNCEMENT", w = "CLEAR_ANNOUNCEMENT", q = {
4
+ import { useRef as A, useReducer as M, useEffect as _, useId as R } from "react";
5
+ import { useMergeRefs as x, FloatingPortal as F, FloatingOverlay as O, FloatingFocusManager as P, useFloating as S, useClick as k, useDismiss as L, useRole as V, useInteractions as $ } from "@floating-ui/react";
6
+ const I = "SET_ANNOUNCEMENT", w = "CLEAR_ANNOUNCEMENT", B = {
8
7
  alert: null,
9
8
  alertdialog: null,
10
9
  log: "polite",
@@ -12,9 +11,9 @@ const b = "SET_ANNOUNCEMENT", w = "CLEAR_ANNOUNCEMENT", q = {
12
11
  progressbar: null,
13
12
  status: "polite",
14
13
  timer: "assertive"
15
- }, H = (e, n) => {
14
+ }, j = (e, n) => {
16
15
  switch (n == null ? void 0 : n.type) {
17
- case b:
16
+ case I:
18
17
  return {
19
18
  ...e,
20
19
  announcement: n.payload
@@ -27,70 +26,70 @@ const b = "SET_ANNOUNCEMENT", w = "CLEAR_ANNOUNCEMENT", q = {
27
26
  default:
28
27
  return e;
29
28
  }
30
- }, z = ({
29
+ }, U = ({
31
30
  onAnnouncementClear: e,
32
31
  dispatch: n
33
32
  }) => {
34
33
  n({
35
34
  type: w
36
35
  }), typeof e == "function" && e();
37
- }, R = ({
36
+ }, C = ({
38
37
  children: e,
39
38
  clearAnnouncementDelay: n,
40
- clearAnnouncementTimeoutRef: o,
41
- onAnnouncementClear: t,
39
+ clearAnnouncementTimeoutRef: t,
40
+ onAnnouncementClear: o,
42
41
  dispatch: l
43
42
  }) => {
44
- (o == null ? void 0 : o.current) !== null && clearTimeout(o.current), e !== null && l({
45
- type: b,
43
+ (t == null ? void 0 : t.current) !== null && clearTimeout(t.current), e !== null && l({
44
+ type: I,
46
45
  payload: e
47
- }), n && (o.current = setTimeout(
48
- () => z({
49
- onAnnouncementClear: t,
46
+ }), n && (t.current = setTimeout(
47
+ () => U({
48
+ onAnnouncementClear: o,
50
49
  dispatch: l
51
50
  }),
52
51
  n
53
52
  ));
54
- }, G = ({
53
+ }, q = ({
55
54
  children: e,
56
55
  announcementTimeoutRef: n,
57
- announcementDelay: o,
58
- clearAnnouncementDelay: t,
56
+ announcementDelay: t,
57
+ clearAnnouncementDelay: o,
59
58
  clearAnnouncementTimeoutRef: l,
60
59
  onAnnouncementClear: r,
61
60
  dispatch: a
62
61
  }) => {
63
- clearTimeout(n.current), o ? n.current = setTimeout(R, o, {
62
+ clearTimeout(n.current), t ? n.current = setTimeout(C, t, {
64
63
  children: e,
65
- clearAnnouncementDelay: t,
64
+ clearAnnouncementDelay: o,
66
65
  clearAnnouncementTimeoutRef: l,
67
66
  onAnnouncementClear: r,
68
67
  dispatch: a
69
- }) : R({
68
+ }) : C({
70
69
  children: e,
71
- clearAnnouncementDelay: t,
70
+ clearAnnouncementDelay: o,
72
71
  clearAnnouncementTimeoutRef: l,
73
72
  onAnnouncementClear: r,
74
73
  dispatch: a
75
74
  });
76
75
  };
77
- function W({
76
+ function G({
78
77
  children: e,
79
78
  className: n,
80
- politeness: o,
81
- role: t = null,
79
+ politeness: t,
80
+ role: o = null,
82
81
  announcementDelay: l,
83
82
  clearAnnouncementDelay: r,
84
83
  onAnnouncementClear: a,
85
84
  visible: s,
86
85
  ...f
87
86
  }) {
88
- const u = C(), d = C(), [m, p] = M(H, {
87
+ const u = A(), d = A(), [m, p] = M(j, {
89
88
  announcement: null
90
89
  });
91
- let h = o;
92
- typeof h > "u" && (h = t ? q[t] : "assertive"), _(() => {
93
- G({
90
+ let h = t;
91
+ typeof h > "u" && (h = o ? B[o] : "assertive"), _(() => {
92
+ q({
94
93
  announcementTimeoutRef: u,
95
94
  announcementDelay: l,
96
95
  children: e,
@@ -112,94 +111,100 @@ function W({
112
111
  "div",
113
112
  {
114
113
  "aria-live": h,
115
- ...t && { role: t },
114
+ ...o && { role: o },
116
115
  className: v,
117
116
  ...f,
118
117
  children: m.announcement
119
118
  }
120
119
  );
121
120
  }
122
- const I = c.createContext(null);
123
- function Y({
121
+ const T = c.createContext(null);
122
+ function H({
124
123
  initialOpen: e = !1,
125
124
  open: n,
126
- onOpenChange: o
125
+ onOpenChange: t
127
126
  } = {}) {
128
- const [t, l] = c.useState(e), [r, a] = c.useState(), [s, f] = c.useState(), u = n ?? t, d = o ?? l, m = k({
127
+ const [o, l] = c.useState(e), [r, a] = c.useState(), [s, f] = c.useState(), u = n ?? o, d = t ?? l, m = S({
129
128
  open: u,
130
129
  onOpenChange: d
131
- }), p = m.context, h = L(p, {
130
+ }), p = m.context, h = k(p, {
132
131
  enabled: n == null
133
- }), v = V(p, {
132
+ }), v = L(p, {
134
133
  outsidePress: !1,
135
134
  outsidePressEvent: "mousedown"
136
- }), N = B(p), A = U([h, v, N]);
135
+ }), N = V(p), b = $([h, v, N]);
137
136
  return c.useMemo(
138
137
  () => ({
139
138
  open: u,
140
139
  setOpen: d,
141
- ...A,
140
+ ...b,
142
141
  ...m,
143
142
  labelId: r,
144
143
  descriptionId: s,
145
144
  setLabelId: a,
146
145
  setDescriptionId: f
147
146
  }),
148
- [u, d, A, m, r, s]
147
+ [u, d, b, m, r, s]
149
148
  );
150
149
  }
151
150
  const g = () => {
152
- const e = c.useContext(I);
151
+ const e = c.useContext(T);
153
152
  if (e == null)
154
153
  throw new Error("Modal components must be wrapped in <Modal />");
155
154
  return e;
156
155
  };
157
- function T(e) {
158
- return x();
159
- }
160
- function X({
156
+ function J({
161
157
  children: e,
162
158
  ...n
163
159
  }) {
164
- const o = Y(n);
165
- return /* @__PURE__ */ i(I.Provider, { value: o, children: e });
160
+ const t = H(n);
161
+ return /* @__PURE__ */ i(T.Provider, { value: t, children: e });
166
162
  }
167
- const ee = c.forwardRef(function(e, n) {
168
- const { context: o, ...t } = g(), l = S([t.refs.setFloating, n]);
169
- if (!o.open)
163
+ const K = c.forwardRef(function(e, n) {
164
+ const { context: t, ...o } = g(), l = x([o.refs.setFloating, n]);
165
+ if (!t.open)
170
166
  return null;
171
167
  const { overlayBackground: r, ...a } = e, s = y("grid place-items-center", {
172
168
  [`${r}`]: r,
173
169
  "bg-black sm:bg-black/[.8]": !r
174
170
  });
175
- return /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(O, { className: s, lockScroll: !0, children: /* @__PURE__ */ i(P, { context: o, children: /* @__PURE__ */ i(
171
+ return /* @__PURE__ */ i(F, { children: /* @__PURE__ */ i(O, { className: s, lockScroll: !0, children: /* @__PURE__ */ i(P, { context: t, children: /* @__PURE__ */ i(
176
172
  "div",
177
173
  {
178
174
  ref: l,
179
- "aria-labelledby": t.labelId,
180
- "aria-describedby": t.descriptionId,
181
- ...t.getFloatingProps(a),
175
+ "aria-labelledby": o.labelId,
176
+ "aria-describedby": o.descriptionId,
177
+ ...o.getFloatingProps(a),
182
178
  children: a.children
183
179
  }
184
180
  ) }) }) });
185
- }), ne = c.forwardRef(function({ children: e, ...n }, o) {
186
- const { setLabelId: t } = g(), l = T();
187
- return c.useLayoutEffect(() => (t(l), () => t(void 0)), [l, t]), /* @__PURE__ */ i("h1", { ...n, ref: o, id: l, children: e });
188
- }), te = c.forwardRef(function({ children: e, ...n }, o) {
189
- const { setDescriptionId: t } = g(), l = T();
190
- return c.useLayoutEffect(() => (t(l), () => t(void 0)), [l, t]), /* @__PURE__ */ i("div", { ...n, ref: o, id: l, children: e });
191
- }), oe = c.forwardRef(function(e, n) {
192
- const { setOpen: o } = g(), { trigger: t, className: l, ...r } = e, a = c.useCallback(() => o(!1), [o]);
193
- return /* @__PURE__ */ i("div", { className: l, children: c.cloneElement(t, {
181
+ }), Q = c.forwardRef(function({ children: e, ...n }, t) {
182
+ const { setLabelId: o } = g(), l = R();
183
+ return c.useLayoutEffect(() => (o(l), () => o(void 0)), [l, o]), /* @__PURE__ */ i("h1", { ...n, ref: t, id: l, children: e });
184
+ }), ee = c.forwardRef(function({ children: e, ...n }, t) {
185
+ const { setDescriptionId: o } = g(), l = R();
186
+ return c.useLayoutEffect(() => (o(l), () => o(void 0)), [l, o]), /* @__PURE__ */ i("div", { ...n, ref: t, id: l, children: e });
187
+ }), ne = c.forwardRef(function(e, n) {
188
+ const { setOpen: t } = g(), { trigger: o, className: l, ...r } = e, a = c.useCallback(() => t(!1), [t]);
189
+ return /* @__PURE__ */ i("div", { className: l, children: c.cloneElement(o, {
194
190
  ref: n,
195
191
  onClick: a,
196
192
  ...r
197
193
  }) });
198
- }), le = ({
194
+ }), z = (e) => {
195
+ let n = "";
196
+ if (typeof e == "number" || typeof e == "string")
197
+ n = "m-" + e;
198
+ else {
199
+ const t = [];
200
+ (e == null ? void 0 : e.t) !== void 0 && t.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && t.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && t.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && t.push(`ml-${e.l}`), n = t.join(" ");
201
+ }
202
+ return n;
203
+ }, te = ({
199
204
  children: e,
200
205
  fill: n,
201
- viewBox: o,
202
- className: t,
206
+ viewBox: t,
207
+ className: o,
203
208
  defaultViewBox: l,
204
209
  defaultClassName: r,
205
210
  spacing: a,
@@ -207,9 +212,9 @@ const ee = c.forwardRef(function(e, n) {
207
212
  semantic: f = !1,
208
213
  ...u
209
214
  }) => {
210
- const d = j(a), m = y(
215
+ const d = z(a), m = y(
211
216
  d,
212
- t || r
217
+ o || r
213
218
  );
214
219
  return /* @__PURE__ */ E(D, { children: [
215
220
  /* @__PURE__ */ i(
@@ -217,7 +222,7 @@ const ee = c.forwardRef(function(e, n) {
217
222
  {
218
223
  xmlns: "http://www.w3.org/2000/svg",
219
224
  className: m,
220
- viewBox: o || l,
225
+ viewBox: t || l,
221
226
  fill: n || "currentColor",
222
227
  role: "img",
223
228
  "aria-hidden": !f,
@@ -230,24 +235,24 @@ const ee = c.forwardRef(function(e, n) {
230
235
  ] });
231
236
  };
232
237
  /*!
233
- @versini/ui-private v1.4.8
238
+ @versini/ui-private v1.4.17
234
239
  © 2024 gizmette.com
235
240
  */
236
241
  try {
237
242
  window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
238
- version: "1.4.8",
239
- buildTime: "09/09/2024 06:39 PM EDT",
243
+ version: "1.4.17",
244
+ buildTime: "09/28/2024 06:29 PM EDT",
240
245
  homepage: "https://github.com/aversini/ui-components",
241
246
  license: "MIT"
242
247
  });
243
248
  } catch {
244
249
  }
245
250
  export {
246
- W as LiveRegion,
247
- X as Modal,
248
- oe as ModalClose,
249
- ee as ModalContent,
250
- te as ModalDescription,
251
- ne as ModalHeading,
252
- le as SvgIcon
251
+ G as LiveRegion,
252
+ J as Modal,
253
+ ne as ModalClose,
254
+ K as ModalContent,
255
+ ee as ModalDescription,
256
+ Q as ModalHeading,
257
+ te as SvgIcon
253
258
  };