@jfrader/ui 0.7.1 → 0.7.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.
Files changed (30) hide show
  1. package/README.md +13 -28
  2. package/dist/editable-details-BndqEnYF.js +365 -0
  3. package/dist/editable-details.js +2 -0
  4. package/dist/{flip-game-card-xmcR_QSq.js → flip-game-card-BOJIhBrh.js} +8 -4
  5. package/dist/flip-game-card.js +1 -1
  6. package/dist/index.js +92 -93
  7. package/dist/{locale-switcher-DTkySKsM.js → locale-switcher-Ce_tN4Gb.js} +2 -2
  8. package/dist/locale-switcher.js +1 -1
  9. package/dist/{billing-toggle-CgC7yxxo.js → toggle-subscription-Ytz7ew1q.js} +19 -19
  10. package/dist/toggle-subscription.js +2 -0
  11. package/dist/types/components/editable-details/editable-details.d.ts +58 -0
  12. package/dist/types/components/editable-details/index.d.ts +2 -0
  13. package/dist/types/components/locale-switcher/locale-switcher.d.ts +2 -2
  14. package/dist/types/components/toggle-subscription/index.d.ts +2 -0
  15. package/dist/types/components/toggle-subscription/toggle-subscription.d.ts +57 -0
  16. package/dist/types/index.d.ts +2 -3
  17. package/dist/types/styling/motion-timings.d.ts +8 -0
  18. package/dist/types/styling/theme.d.ts +2 -0
  19. package/package.json +10 -14
  20. package/dist/billing-toggle.js +0 -2
  21. package/dist/in-view-title-BUZCMqge.js +0 -225
  22. package/dist/in-view-title.js +0 -2
  23. package/dist/shortcut-recorder-VgTQdjjn.js +0 -688
  24. package/dist/shortcut-recorder.js +0 -2
  25. package/dist/types/components/billing-toggle/billing-toggle.d.ts +0 -57
  26. package/dist/types/components/billing-toggle/index.d.ts +0 -2
  27. package/dist/types/components/in-view-title/in-view-title.d.ts +0 -23
  28. package/dist/types/components/in-view-title/index.d.ts +0 -1
  29. package/dist/types/components/shortcut-recorder/index.d.ts +0 -2
  30. package/dist/types/components/shortcut-recorder/shortcut-recorder.d.ts +0 -117
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jfrader/ui",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "React components styled with Emotion and themed through CSS custom properties.",
5
5
  "keywords": [
6
6
  "react",
@@ -54,10 +54,6 @@
54
54
  "types": "./dist/types/components/badge/index.d.ts",
55
55
  "import": "./dist/badge.js"
56
56
  },
57
- "./billing-toggle": {
58
- "types": "./dist/types/components/billing-toggle/index.d.ts",
59
- "import": "./dist/billing-toggle.js"
60
- },
61
57
  "./bottom-sheet": {
62
58
  "types": "./dist/types/components/bottom-sheet/index.d.ts",
63
59
  "import": "./dist/bottom-sheet.js"
@@ -154,6 +150,10 @@
154
150
  "types": "./dist/types/components/drawer/index.d.ts",
155
151
  "import": "./dist/drawer.js"
156
152
  },
153
+ "./editable-details": {
154
+ "types": "./dist/types/components/editable-details/index.d.ts",
155
+ "import": "./dist/editable-details.js"
156
+ },
157
157
  "./emblem": {
158
158
  "types": "./dist/types/components/emblem/index.d.ts",
159
159
  "import": "./dist/emblem.js"
@@ -198,10 +198,6 @@
198
198
  "types": "./dist/types/components/image-compare/index.d.ts",
199
199
  "import": "./dist/image-compare.js"
200
200
  },
201
- "./in-view-title": {
202
- "types": "./dist/types/components/in-view-title/index.d.ts",
203
- "import": "./dist/in-view-title.js"
204
- },
205
201
  "./inline-edit": {
206
202
  "types": "./dist/types/components/inline-edit/index.d.ts",
207
203
  "import": "./dist/inline-edit.js"
@@ -318,10 +314,6 @@
318
314
  "types": "./dist/types/components/sheet-stack/index.d.ts",
319
315
  "import": "./dist/sheet-stack.js"
320
316
  },
321
- "./shortcut-recorder": {
322
- "types": "./dist/types/components/shortcut-recorder/index.d.ts",
323
- "import": "./dist/shortcut-recorder.js"
324
- },
325
317
  "./signature-pad": {
326
318
  "types": "./dist/types/components/signature-pad/index.d.ts",
327
319
  "import": "./dist/signature-pad.js"
@@ -410,6 +402,10 @@
410
402
  "types": "./dist/types/components/toggle-group/index.d.ts",
411
403
  "import": "./dist/toggle-group.js"
412
404
  },
405
+ "./toggle-subscription": {
406
+ "types": "./dist/types/components/toggle-subscription/index.d.ts",
407
+ "import": "./dist/toggle-subscription.js"
408
+ },
413
409
  "./tooltip": {
414
410
  "types": "./dist/types/components/tooltip/index.d.ts",
415
411
  "import": "./dist/tooltip.js"
@@ -439,7 +435,7 @@
439
435
  "@emotion/styled": "^11.14.0",
440
436
  "@floating-ui/react": "^0.27.20",
441
437
  "motion": "^14.1.0",
442
- "@jfrader/tokens": "0.7.1"
438
+ "@jfrader/tokens": "0.7.3"
443
439
  },
444
440
  "peerDependencies": {
445
441
  "@emotion/cache": "^11.14.0",
@@ -1,2 +0,0 @@
1
- 'use client';
2
- export { t as BillingToggle } from "./billing-toggle-CgC7yxxo.js";
@@ -1,225 +0,0 @@
1
- 'use client';
2
- import { a as e, i as t } from "./css-BYJhdGh-.js";
3
- import { n, r } from "./media-8yrN85VT.js";
4
- import { t as i } from "./sx-BJXJ2xJK.js";
5
- import { t as a } from "./visually-hidden-DgVO3NaB.js";
6
- import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
7
- import { vars as u } from "@jfrader/tokens/vars";
8
- import { jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
9
- //#region src/components/in-view-title/in-view-title.tsx
10
- var p = {
11
- 1: "h1",
12
- 2: "h2",
13
- 3: "h3",
14
- 4: "h4",
15
- 5: "h5",
16
- 6: "h6"
17
- }, m = .45, h = "0.15em", g = e({
18
- from: { transform: "translateY(0.6em)" },
19
- to: { transform: "none" }
20
- }), _ = e({
21
- from: { opacity: 0 },
22
- to: { opacity: 1 }
23
- }), v = e({
24
- from: { filter: "blur(0.12em)" },
25
- to: { filter: "none" }
26
- }), y = e({
27
- from: { letterSpacing: "-0.04em" },
28
- to: { letterSpacing: "inherit" }
29
- }), b = e({
30
- from: {
31
- maskImage: `linear-gradient(to right, ${u.color.text} 50%, transparent 50%)`,
32
- maskSize: "200% 100%",
33
- maskPosition: "100% 0"
34
- },
35
- to: {
36
- maskImage: `linear-gradient(to right, ${u.color.text} 50%, transparent 50%)`,
37
- maskSize: "200% 100%",
38
- maskPosition: "0% 0"
39
- }
40
- }), x = e({
41
- from: {
42
- maskImage: `linear-gradient(to left, ${u.color.text} 50%, transparent 50%)`,
43
- maskSize: "200% 100%",
44
- maskPosition: "0% 0"
45
- },
46
- to: {
47
- maskImage: `linear-gradient(to left, ${u.color.text} 50%, transparent 50%)`,
48
- maskSize: "200% 100%",
49
- maskPosition: "100% 0"
50
- }
51
- }), S = (e, t) => `${e} ${t} ${u.motion.easeStandard} var(--in-view-delay, 0ms) backwards`, C = {
52
- word: t({ animation: `${S(g, u.motion.duration.slow)}, ${S(_, u.motion.duration.fast)}` }),
53
- line: t({ animation: `${S(g, u.motion.duration.slow)}, ${S(_, u.motion.duration.fast)}` }),
54
- blur: t({ animation: `${S(g, u.motion.duration.base)}, ${S(v, u.motion.duration.base)}, ${S(_, u.motion.duration.fast)}` }),
55
- tracking: t({ animation: `${S(y, u.motion.duration.base)}, ${S(_, u.motion.duration.fast)}` }),
56
- wipe: t({
57
- animation: S(b, u.motion.duration.slow),
58
- "&:dir(rtl)": { animation: S(x, u.motion.duration.slow) }
59
- })
60
- }, w = t({
61
- position: "relative",
62
- margin: 0,
63
- minInlineSize: 0,
64
- maxInlineSize: "100%",
65
- color: u.color.text,
66
- font: "inherit",
67
- "& [data-in-view-plain]": { display: "none" },
68
- "&:not([data-state=\"revealing\"]) [data-in-view-segment]": { animation: "none" },
69
- [r]: {
70
- "& [data-in-view-parts]": { display: "none" },
71
- "& [data-in-view-plain]": {
72
- display: "inline",
73
- whiteSpace: "pre-wrap"
74
- },
75
- "& [data-in-view-segment]": {
76
- animation: "none",
77
- transform: "none",
78
- filter: "none",
79
- maskImage: "none",
80
- opacity: 1
81
- }
82
- },
83
- [n]: {
84
- color: "CanvasText",
85
- "& [data-in-view-parts]": { display: "none" },
86
- "& [data-in-view-plain]": {
87
- display: "inline",
88
- whiteSpace: "pre-wrap"
89
- },
90
- "& [data-in-view-segment]": {
91
- animation: "none",
92
- transform: "none",
93
- filter: "none",
94
- maskImage: "none",
95
- opacity: 1
96
- }
97
- }
98
- }), T = t({
99
- whiteSpace: "pre-wrap",
100
- overflowWrap: "anywhere"
101
- }), E = t({
102
- display: "block",
103
- minInlineSize: 0,
104
- maxInlineSize: "100%"
105
- }), D = {
106
- word: !0,
107
- line: !0,
108
- blur: !0,
109
- tracking: !1,
110
- wipe: !1
111
- }, O = t({
112
- display: "inline-block",
113
- verticalAlign: "bottom",
114
- maxInlineSize: "100%",
115
- overflowX: "visible",
116
- overflowY: "clip",
117
- paddingBlock: h,
118
- marginBlock: `-${h}`
119
- }), k = t({
120
- display: "inline-block",
121
- maxInlineSize: "100%",
122
- verticalAlign: "bottom"
123
- });
124
- function A({ text: e, level: t = 2, variant: n = "blur", once: r = !0, locale: h, slotProps: g, ref: v, className: y, sx: b, ...x }) {
125
- let [S, A] = l(null), j = o((e) => {
126
- A(e);
127
- let t = typeof v == "function" ? v(e) : void 0;
128
- return v && typeof v != "function" && (v.current = e), () => {
129
- A(null), typeof t == "function" ? t() : typeof v == "function" ? v(null) : v && (v.current = null);
130
- };
131
- }, [v]);
132
- s(() => {
133
- if (!S) return;
134
- let t = S.ownerDocument.defaultView;
135
- if (S.dataset.state = "settled", !t) return;
136
- let n = !0, i = !1, a, o = !1, s = S.getBoundingClientRect().top > t.innerHeight, c = !s, l, u, d = () => {
137
- n && (S.dataset.state = "settled");
138
- }, f = () => {
139
- d(), a?.disconnect(), s = !1, i = !0;
140
- }, p = (e) => {
141
- let n = e.target;
142
- n instanceof t.HTMLElement && n.hasAttribute("data-in-view-last") && S.dataset.state === "revealing" && e.animationName !== _.name && (d(), r && a?.disconnect());
143
- }, h = () => {
144
- (l?.matches || u?.matches) && f();
145
- }, g = () => {
146
- S.id && t.location.hash.slice(1) === S.id && f();
147
- }, v = () => {
148
- let e = S.ownerDocument.getSelection();
149
- e?.anchorNode && S.contains(e.anchorNode) && f();
150
- };
151
- try {
152
- if (l = t.matchMedia("(prefers-reduced-motion: reduce)"), u = t.matchMedia("(forced-colors: active)"), !e.trim() || !t.IntersectionObserver || !t.CSS?.supports("animation-name", "none") || l.matches || u.matches || (g(), i || !s && r)) return;
153
- a = new t.IntersectionObserver((e) => {
154
- if (n && !i) for (let t of e) t.target === S && (!t.isIntersecting || t.intersectionRatio === 0 ? (c && (d(), r ? o && a?.disconnect() : s = !0), o = !1) : (c = !0, t.intersectionRatio >= m && !o && (o = !0, s &&= (S.dataset.state = "revealing", !1))));
155
- }, { threshold: [0, m] }), s && (S.dataset.state = "idle"), a.observe(S), S.addEventListener("animationend", p), S.addEventListener("focusin", f), S.ownerDocument.addEventListener("selectionchange", v), t.addEventListener("hashchange", g), l.addEventListener("change", h), u.addEventListener("change", h);
156
- } catch {
157
- f();
158
- }
159
- return () => {
160
- n = !1, a?.disconnect(), S.removeEventListener("animationend", p), S.removeEventListener("focusin", f), S.ownerDocument.removeEventListener("selectionchange", v), t.removeEventListener("hashchange", g), l?.removeEventListener("change", h), u?.removeEventListener("change", h);
161
- };
162
- }, [
163
- S,
164
- e,
165
- n,
166
- r,
167
- h
168
- ]);
169
- let M = p[t], N = n === "tracking" || n === "wipe", P = c(() => typeof Intl.Segmenter == "function" ? new Intl.Segmenter(h, { granularity: "word" }) : void 0, [h]), F = (N ? [e] : e.split("\n")).map((e) => n === "line" || N || !P ? [e] : Array.from(P.segment(e), ({ segment: e }) => e)), I = F.flat().filter((e) => e.trim()).length;
170
- return /* @__PURE__ */ d(i, {
171
- className: y,
172
- styles: w,
173
- sx: b,
174
- children: (t) => {
175
- let r = 0;
176
- return /* @__PURE__ */ f(M, {
177
- ...x,
178
- ref: j,
179
- "data-ui": "in-view-title",
180
- "data-state": "settled",
181
- className: t,
182
- children: [/* @__PURE__ */ d("span", {
183
- css: a,
184
- children: e.replace(/\s+/gu, " ").trim()
185
- }), /* @__PURE__ */ f("span", {
186
- "data-ui": "in-view-title-visual",
187
- "aria-hidden": "true",
188
- className: g?.visual?.className,
189
- css: [T, g?.visual?.css],
190
- children: [/* @__PURE__ */ d("span", {
191
- "data-in-view-plain": "",
192
- children: e
193
- }), /* @__PURE__ */ d("span", {
194
- "data-in-view-parts": "",
195
- children: F.map((e, t) => /* @__PURE__ */ d("span", {
196
- css: !N && E,
197
- children: e.map((e, t) => {
198
- if (!e.trim()) return /* @__PURE__ */ d("span", { children: e || "​" }, t);
199
- let i = r++;
200
- return /* @__PURE__ */ d("span", {
201
- css: D[n] && O,
202
- children: /* @__PURE__ */ d("span", {
203
- "data-in-view-segment": "",
204
- "data-in-view-last": i === I - 1 ? "" : void 0,
205
- className: g?.segment?.className,
206
- style: { "--in-view-delay": `calc(${u.motion.duration.slow} * ${I > 1 ? i / (I - 1) : 0})` },
207
- css: [
208
- k,
209
- C[n],
210
- g?.segment?.css
211
- ],
212
- children: e
213
- })
214
- }, t);
215
- })
216
- }, t))
217
- })]
218
- })]
219
- });
220
- }
221
- });
222
- }
223
- A.displayName = "InViewTitle";
224
- //#endregion
225
- export { A as t };
@@ -1,2 +0,0 @@
1
- 'use client';
2
- export { t as InViewTitle } from "./in-view-title-BUZCMqge.js";