@versini/sassysaint 5.4.3 → 5.4.5

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.
@@ -0,0 +1,99 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useMergeRefs as _, FloatingPortal as C, FloatingOverlay as E, FloatingFocusManager as O, useFloating as R, useClick as k, useDismiss as x, useRole as y, useInteractions as F } from "@floating-ui/react";
3
+ import L from "clsx";
4
+ import * as t from "react";
5
+ import { useId as h } from "react";
6
+ const b = t.createContext(null);
7
+ function S({
8
+ initialOpen: n = !1,
9
+ open: s,
10
+ onOpenChange: o
11
+ } = {}) {
12
+ const [e, r] = t.useState(n), [i, a] = t.useState(), [c, I] = t.useState(), u = s ?? e, f = o ?? r, p = R({
13
+ open: u,
14
+ onOpenChange: f
15
+ }), m = p.context, M = k(m, {
16
+ enabled: s == null
17
+ }), v = x(m, {
18
+ outsidePress: !1,
19
+ outsidePressEvent: "mousedown"
20
+ }), w = y(m), g = F([M, v, w]);
21
+ return t.useMemo(
22
+ () => ({
23
+ open: u,
24
+ setOpen: f,
25
+ ...g,
26
+ ...p,
27
+ labelId: i,
28
+ descriptionId: c,
29
+ setLabelId: a,
30
+ setDescriptionId: I
31
+ }),
32
+ [u, f, g, p, i, c]
33
+ );
34
+ }
35
+ const d = () => {
36
+ const n = t.useContext(b);
37
+ if (n == null)
38
+ throw new Error("Modal components must be wrapped in <Modal />");
39
+ return n;
40
+ };
41
+ function A({
42
+ children: n,
43
+ ...s
44
+ }) {
45
+ const o = S(s);
46
+ return /* @__PURE__ */ l(b.Provider, { value: o, children: n });
47
+ }
48
+ const U = t.forwardRef(function(n, s) {
49
+ const { context: o, ...e } = d(), r = _([e.refs.setFloating, s]);
50
+ if (!o.open)
51
+ return null;
52
+ const { overlayBackground: i, ...a } = n, c = L("grid place-items-center", {
53
+ [`${i}`]: i,
54
+ "bg-black sm:bg-black/[.8]": !i
55
+ });
56
+ return /* @__PURE__ */ l(C, { children: /* @__PURE__ */ l(E, { className: c, lockScroll: !0, children: /* @__PURE__ */ l(O, { context: o, children: /* @__PURE__ */ l(
57
+ "div",
58
+ {
59
+ ref: r,
60
+ "aria-labelledby": e.labelId,
61
+ "aria-describedby": e.descriptionId,
62
+ ...e.getFloatingProps(a),
63
+ children: a.children
64
+ }
65
+ ) }) }) });
66
+ }), V = t.forwardRef(function({ children: n, ...s }, o) {
67
+ const { setLabelId: e } = d(), r = h();
68
+ return t.useLayoutEffect(() => (e(r), () => e(void 0)), [r, e]), /* @__PURE__ */ l("h1", { ...s, ref: o, id: r, children: n });
69
+ }), $ = t.forwardRef(function({ children: n, ...s }, o) {
70
+ const { setDescriptionId: e } = d(), r = h();
71
+ return t.useLayoutEffect(() => (e(r), () => e(void 0)), [r, e]), /* @__PURE__ */ l("div", { ...s, ref: o, id: r, children: n });
72
+ }), j = t.forwardRef(function(n, s) {
73
+ const { setOpen: o } = d(), { trigger: e, className: r, ...i } = n, a = t.useCallback(() => o(!1), [o]);
74
+ return /* @__PURE__ */ l("div", { className: r, children: t.cloneElement(e, {
75
+ ref: s,
76
+ onClick: a,
77
+ ...i
78
+ }) });
79
+ });
80
+ /*!
81
+ @versini/ui-modal v1.1.0
82
+ © 2024 gizmette.com
83
+ */
84
+ try {
85
+ window.__VERSINI_UI_MODAL__ || (window.__VERSINI_UI_MODAL__ = {
86
+ version: "1.1.0",
87
+ buildTime: "12/26/2024 06:05 PM EST",
88
+ homepage: "https://github.com/aversini/ui-components",
89
+ license: "MIT"
90
+ });
91
+ } catch {
92
+ }
93
+ export {
94
+ A as Modal,
95
+ j as ModalClose,
96
+ U as ModalContent,
97
+ $ as ModalDescription,
98
+ V as ModalHeading
99
+ };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { SassySaint as a } from "../../chunks/index.C2RuFHK-.js";
2
+ import { SassySaint as a } from "../../chunks/index.Cul7Y08v.js";
3
3
  export {
4
4
  a as SassySaint
5
5
  };
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { SassySaint as r } from "./chunks/index.C2RuFHK-.js";
1
+ import { SassySaint as r } from "./chunks/index.Cul7Y08v.js";
2
2
  /*!
3
- @sassysaint/client v5.8.0
3
+ @sassysaint/client v5.8.2
4
4
  © 2024 gizmette.com
5
5
  */
6
6
  try {
7
7
  window.__VERSINI_SASSY_GLOBAL__ || (window.__VERSINI_SASSY_GLOBAL__ = {
8
- version: "5.8.0",
9
- buildTime: "12/21/2024 06:50 PM EST",
8
+ version: "5.8.2",
9
+ buildTime: "12/27/2024 02:51 PM EST",
10
10
  license: "MIT"
11
11
  });
12
12
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/sassysaint",
3
- "version": "5.4.3",
3
+ "version": "5.4.5",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -30,8 +30,8 @@
30
30
  "react-dom": "^18.3.1 || ^19.0.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@sassysaint/client": "5.8.0",
34
- "@versini/ui-styles": "1.12.0"
33
+ "@sassysaint/client": "5.8.2",
34
+ "@versini/ui-styles": "1.14.0"
35
35
  },
36
36
  "dependencies": {
37
37
  "@versini/ui-hooks": "4.3.0",
@@ -41,5 +41,5 @@
41
41
  "sideEffects": [
42
42
  "**/*.css"
43
43
  ],
44
- "gitHead": "b687ed32fe9f47b29479044ecb854129994a052f"
44
+ "gitHead": "2729eceec0e55741375858c686b39d844bbb2d40"
45
45
  }
@@ -1,258 +0,0 @@
1
- import { jsx as i, jsxs as E, Fragment as M } from "react/jsx-runtime";
2
- import y from "clsx";
3
- import * as c from "react";
4
- import { useRef as A, useReducer as _, useEffect as D, useId as w } from "react";
5
- import { useMergeRefs as x, FloatingPortal as $, FloatingOverlay as S, FloatingFocusManager as F, useFloating as O, useClick as P, useDismiss as k, useRole as L, useInteractions as V } from "@floating-ui/react";
6
- const I = "SET_ANNOUNCEMENT", R = "CLEAR_ANNOUNCEMENT", B = {
7
- alert: null,
8
- alertdialog: null,
9
- log: "polite",
10
- marquee: null,
11
- progressbar: null,
12
- status: "polite",
13
- timer: "assertive"
14
- }, j = (e, n) => {
15
- switch (n == null ? void 0 : n.type) {
16
- case I:
17
- return {
18
- ...e,
19
- announcement: n.payload
20
- };
21
- case R:
22
- return {
23
- ...e,
24
- announcement: null
25
- };
26
- default:
27
- return e;
28
- }
29
- }, U = ({
30
- onAnnouncementClear: e,
31
- dispatch: n
32
- }) => {
33
- n({
34
- type: R
35
- }), typeof e == "function" && e();
36
- }, C = ({
37
- children: e,
38
- clearAnnouncementDelay: n,
39
- clearAnnouncementTimeoutRef: t,
40
- onAnnouncementClear: o,
41
- dispatch: l
42
- }) => {
43
- clearTimeout(t.current), e !== null && l({
44
- type: I,
45
- payload: e
46
- }), n && (t.current = setTimeout(
47
- () => U({
48
- onAnnouncementClear: o,
49
- dispatch: l
50
- }),
51
- n
52
- ));
53
- }, q = ({
54
- children: e,
55
- announcementTimeoutRef: n,
56
- announcementDelay: t,
57
- clearAnnouncementDelay: o,
58
- clearAnnouncementTimeoutRef: l,
59
- onAnnouncementClear: r,
60
- dispatch: a
61
- }) => {
62
- clearTimeout(n.current), t ? n.current = setTimeout(C, t, {
63
- children: e,
64
- clearAnnouncementDelay: o,
65
- clearAnnouncementTimeoutRef: l,
66
- onAnnouncementClear: r,
67
- dispatch: a
68
- }) : C({
69
- children: e,
70
- clearAnnouncementDelay: o,
71
- clearAnnouncementTimeoutRef: l,
72
- onAnnouncementClear: r,
73
- dispatch: a
74
- });
75
- };
76
- function G({
77
- children: e,
78
- className: n,
79
- politeness: t,
80
- role: o = null,
81
- announcementDelay: l,
82
- clearAnnouncementDelay: r,
83
- onAnnouncementClear: a,
84
- visible: s,
85
- ...f
86
- }) {
87
- const u = A(null), d = A(null), [m, p] = _(j, {
88
- announcement: null
89
- });
90
- let h = t;
91
- typeof h > "u" && (h = o ? B[o] : "assertive"), D(() => {
92
- q({
93
- announcementTimeoutRef: u,
94
- announcementDelay: l,
95
- children: e,
96
- clearAnnouncementDelay: r,
97
- clearAnnouncementTimeoutRef: d,
98
- onAnnouncementClear: a,
99
- dispatch: p
100
- });
101
- }, [
102
- e,
103
- l,
104
- r,
105
- a
106
- ]);
107
- const v = y(n, {
108
- "sr-only": !s
109
- });
110
- return /* @__PURE__ */ i(
111
- "div",
112
- {
113
- "aria-live": h,
114
- ...o && { role: o },
115
- className: v,
116
- ...f,
117
- children: m.announcement
118
- }
119
- );
120
- }
121
- const N = c.createContext(null);
122
- function H({
123
- initialOpen: e = !1,
124
- open: n,
125
- onOpenChange: t
126
- } = {}) {
127
- const [o, l] = c.useState(e), [r, a] = c.useState(), [s, f] = c.useState(), u = n ?? o, d = t ?? l, m = O({
128
- open: u,
129
- onOpenChange: d
130
- }), p = m.context, h = P(p, {
131
- enabled: n == null
132
- }), v = k(p, {
133
- outsidePress: !1,
134
- outsidePressEvent: "mousedown"
135
- }), T = L(p), b = V([h, v, T]);
136
- return c.useMemo(
137
- () => ({
138
- open: u,
139
- setOpen: d,
140
- ...b,
141
- ...m,
142
- labelId: r,
143
- descriptionId: s,
144
- setLabelId: a,
145
- setDescriptionId: f
146
- }),
147
- [u, d, b, m, r, s]
148
- );
149
- }
150
- const g = () => {
151
- const e = c.useContext(N);
152
- if (e == null)
153
- throw new Error("Modal components must be wrapped in <Modal />");
154
- return e;
155
- };
156
- function J({
157
- children: e,
158
- ...n
159
- }) {
160
- const t = H(n);
161
- return /* @__PURE__ */ i(N.Provider, { value: t, children: e });
162
- }
163
- const K = c.forwardRef(function(e, n) {
164
- const { context: t, ...o } = g(), l = x([o.refs.setFloating, n]);
165
- if (!t.open)
166
- return null;
167
- const { overlayBackground: r, ...a } = e, s = y("grid place-items-center", {
168
- [`${r}`]: r,
169
- "bg-black sm:bg-black/[.8]": !r
170
- });
171
- return /* @__PURE__ */ i($, { children: /* @__PURE__ */ i(S, { className: s, lockScroll: !0, children: /* @__PURE__ */ i(F, { context: t, children: /* @__PURE__ */ i(
172
- "div",
173
- {
174
- ref: l,
175
- "aria-labelledby": o.labelId,
176
- "aria-describedby": o.descriptionId,
177
- ...o.getFloatingProps(a),
178
- children: a.children
179
- }
180
- ) }) }) });
181
- }), Q = c.forwardRef(function({ children: e, ...n }, t) {
182
- const { setLabelId: o } = g(), l = w();
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 = w();
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, {
190
- ref: n,
191
- onClick: a,
192
- ...r
193
- }) });
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 = ({
204
- children: e,
205
- fill: n,
206
- viewBox: t,
207
- className: o,
208
- defaultViewBox: l,
209
- defaultClassName: r,
210
- spacing: a,
211
- title: s,
212
- semantic: f = !1,
213
- ...u
214
- }) => {
215
- const d = z(a), m = y(
216
- d,
217
- o || r
218
- );
219
- return /* @__PURE__ */ E(M, { children: [
220
- /* @__PURE__ */ i(
221
- "svg",
222
- {
223
- xmlns: "http://www.w3.org/2000/svg",
224
- className: m,
225
- viewBox: t || l,
226
- fill: n || "currentColor",
227
- role: "img",
228
- "aria-hidden": !f,
229
- focusable: !1,
230
- ...u,
231
- children: e
232
- }
233
- ),
234
- s && f && /* @__PURE__ */ i("span", { className: "sr-only", children: s })
235
- ] });
236
- };
237
- /*!
238
- @versini/ui-private v1.5.1
239
- © 2024 gizmette.com
240
- */
241
- try {
242
- window.__VERSINI_UI_PRIVATE__ || (window.__VERSINI_UI_PRIVATE__ = {
243
- version: "1.5.1",
244
- buildTime: "12/18/2024 01:22 PM EST",
245
- homepage: "https://github.com/aversini/ui-components",
246
- license: "MIT"
247
- });
248
- } catch {
249
- }
250
- export {
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
258
- };