@versini/ui-truncate 0.0.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Arno Versini
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @versini/ui-truncate
2
+
3
+ A simple truncate component for React.
@@ -0,0 +1,392 @@
1
+ import { jsx as h, jsxs as x } from "react/jsx-runtime";
2
+ import o from "clsx";
3
+ import k, { useState as j } from "react";
4
+ const p = "av-button", U = (e) => {
5
+ let t = "";
6
+ if (typeof e == "number" || typeof e == "string")
7
+ t = "m-" + e;
8
+ else {
9
+ const r = [];
10
+ (e == null ? void 0 : e.t) !== void 0 && r.push(`mt-${e.t}`), (e == null ? void 0 : e.r) !== void 0 && r.push(`mr-${e.r}`), (e == null ? void 0 : e.b) !== void 0 && r.push(`mb-${e.b}`), (e == null ? void 0 : e.l) !== void 0 && r.push(`ml-${e.l}`), t = r.join(" ");
11
+ }
12
+ return t;
13
+ }, T = "icon", w = "button", S = "link", C = ({
14
+ type: e,
15
+ size: t,
16
+ labelRight: r,
17
+ labelLeft: a,
18
+ align: i
19
+ }) => {
20
+ const d = "text-sm font-medium max-h-8 py-0", l = "text-base font-medium max-h-9 py-1", n = "text-lg font-medium max-h-12 py-2";
21
+ switch (e) {
22
+ case w:
23
+ return o("px-4", {
24
+ [d]: t === "small",
25
+ [l]: t === "medium",
26
+ [n]: t === "large"
27
+ });
28
+ case S:
29
+ return o("px-4 text-center", {
30
+ [d]: t === "small",
31
+ [l]: t === "medium",
32
+ [n]: t === "large"
33
+ });
34
+ case T:
35
+ return o("inline-flex items-center", {
36
+ "justify-center": i === "center",
37
+ "justify-start": i === "left",
38
+ "justify-end": i === "right",
39
+ "h-6 w-6 p-0": t === "small" && !(r || a),
40
+ "h-6 px-4 text-sm font-medium": t === "small" && (r || a),
41
+ "h-8 w-8 p-1": t === "medium" && !(r || a),
42
+ "h-8 px-4 text-base font-medium": t === "medium" && (r || a),
43
+ "h-12 w-12 p-2": t === "large" && !(r || a),
44
+ "h-12 px-4 text-lg font-medium": t === "large" && (r || a)
45
+ });
46
+ }
47
+ }, W = ({
48
+ mode: e,
49
+ noBackground: t,
50
+ noTruncate: r,
51
+ variant: a
52
+ }) => {
53
+ if (t)
54
+ return "not-prose rounded-full";
55
+ if (a === "primary")
56
+ return o("not-prose rounded-full", {
57
+ truncate: !r,
58
+ "bg-action-dark text-copy-light": e === "dark",
59
+ "bg-action-light text-copy-lighter": e === "light",
60
+ "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "system",
61
+ "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "alt-system"
62
+ });
63
+ if (a === "secondary")
64
+ return o("not-prose rounded-full", {
65
+ truncate: !r,
66
+ "bg-action-dark text-copy-light": e === "light",
67
+ "bg-action-light text-copy-lighter": e === "dark",
68
+ "bg-action-dark text-copy-light dark:bg-action-light dark:text-copy-lighter": e === "alt-system",
69
+ "bg-action-light text-copy-lighter dark:bg-action-dark dark:text-copy-light": e === "system"
70
+ });
71
+ if (a === "danger")
72
+ return o("not-prose rounded-full", {
73
+ truncate: !r,
74
+ "bg-action-danger-dark text-copy-light": e === "dark",
75
+ "bg-action-danger-light text-copy-lighter": e === "light",
76
+ "bg-action-danger-dark text-copy-light dark:bg-action-danger-light dark:text-copy-lighter": e === "system",
77
+ "bg-action-danger-light text-copy-lighter dark:bg-action-danger-dark dark:text-copy-light": e === "alt-system"
78
+ });
79
+ }, D = ({
80
+ mode: e,
81
+ disabled: t,
82
+ variant: r
83
+ }) => {
84
+ if (t)
85
+ return "";
86
+ if (r === "primary")
87
+ return o("hover:text-copy-light-hover", {
88
+ "hover:bg-action-dark-hover": e === "dark",
89
+ "hover:bg-action-light-hover": e === "light",
90
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "system",
91
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "alt-system"
92
+ });
93
+ if (r === "secondary")
94
+ return o("hover:text-copy-light-hover", {
95
+ "hover:bg-action-dark-hover": e === "light",
96
+ "hover:bg-action-light-hover": e === "dark",
97
+ "hover:bg-action-dark-hover dark:hover:bg-action-light-hover": e === "alt-system",
98
+ "hover:bg-action-light-hover dark:hover:bg-action-dark-hover": e === "system"
99
+ });
100
+ if (r === "danger")
101
+ return o("hover:text-copy-light-hover", {
102
+ "hover:bg-action-danger-dark-hover": e === "dark",
103
+ "hover:bg-action-danger-light-hover": e === "light",
104
+ "hover:bg-action-danger-dark-hover dark:hover:bg-action-danger-light-hover": e === "system",
105
+ "hover:bg-action-danger-light-hover dark:hover:bg-action-danger-dark-hover": e === "alt-system"
106
+ });
107
+ }, O = ({
108
+ mode: e,
109
+ disabled: t,
110
+ variant: r
111
+ }) => {
112
+ if (t)
113
+ return "";
114
+ if (r === "primary")
115
+ return o("active:text-copy-light-active", {
116
+ "active:bg-action-dark-active": e === "dark",
117
+ "active:bg-action-light-active": e === "light",
118
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "system",
119
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "alt-system"
120
+ });
121
+ if (r === "secondary")
122
+ return o("active:text-copy-light-active", {
123
+ "active:bg-action-dark-active": e === "light",
124
+ "active:bg-action-light-active": e === "dark",
125
+ "active:bg-action-dark-active dark:active:bg-action-light-active": e === "alt-system",
126
+ "active:bg-action-light-active dark:active:bg-action-dark-active": e === "system"
127
+ });
128
+ if (r === "danger")
129
+ return o("active:text-copy-lighter-active", {
130
+ "active:bg-action-danger-dark-active": e === "dark",
131
+ "active:bg-action-danger-light-active": e === "light",
132
+ "active:bg-action-danger-dark-active dark:active:bg-action-danger-light-active": e === "system",
133
+ "active:bg-action-danger-light-active dark:active:bg-action-danger-dark-active": e === "alt-system"
134
+ });
135
+ }, $ = ({
136
+ mode: e,
137
+ noBorder: t,
138
+ variant: r
139
+ }) => {
140
+ if (t)
141
+ return "border border-transparent";
142
+ if (r === "primary")
143
+ return o("border", {
144
+ "border-border-dark": e === "dark",
145
+ "border-border-accent": e === "light",
146
+ "border-border-dark dark:border-border-accent": e === "system",
147
+ "border-border-accent dark:border-border-dark": e === "alt-system"
148
+ });
149
+ if (r === "secondary")
150
+ return o("border", {
151
+ "border-border-dark": e === "light",
152
+ "border-border-accent": e === "dark",
153
+ "border-border-dark dark:border-border-accent": e === "alt-system",
154
+ "border-border-accent dark:border-border-dark": e === "system"
155
+ });
156
+ if (r === "danger")
157
+ return o("border", {
158
+ "border-border-danger-dark": e === "dark",
159
+ "border-border-danger-medium": e === "light",
160
+ "border-border-danger-dark dark:border-border-danger-medium": e === "system",
161
+ "border-border-danger-medium dark:border-border-danger-dark": e === "alt-system"
162
+ });
163
+ }, A = ({ focusMode: e }) => o("focus:outline", "focus:outline-2", "focus:outline-offset-2", {
164
+ "focus:outline-focus-dark": e === "dark",
165
+ "focus:outline-focus-light": e === "light",
166
+ "focus:outline-focus-light dark:focus:outline-focus-dark": e === "alt-system",
167
+ "focus:outline-focus-dark dark:focus:outline-focus-light": e === "system"
168
+ }), B = ({
169
+ type: e,
170
+ className: t,
171
+ raw: r,
172
+ mode: a,
173
+ focusMode: i,
174
+ disabled: d,
175
+ fullWidth: l,
176
+ size: n,
177
+ noBorder: u,
178
+ labelRight: s,
179
+ labelLeft: b,
180
+ spacing: m,
181
+ noBackground: g,
182
+ variant: c,
183
+ noTruncate: v,
184
+ align: f
185
+ }) => (c || (c = "primary"), r ? o(p, t) : o(
186
+ p,
187
+ t,
188
+ U(m),
189
+ W({ mode: a, variant: c, noBackground: g, noTruncate: v }),
190
+ C({ type: e, size: n, labelRight: s, labelLeft: b, align: f }),
191
+ $({ mode: a, variant: c, noBorder: u }),
192
+ A({ focusMode: i }),
193
+ D({ mode: a, variant: c, disabled: d }),
194
+ O({ mode: a, variant: c, disabled: d }),
195
+ {
196
+ "w-full": l,
197
+ "disabled:cursor-not-allowed disabled:opacity-50": d
198
+ }
199
+ )), F = (e, t, r) => {
200
+ var a;
201
+ !t && (!document.activeElement || document.activeElement !== e.currentTarget) && typeof ((a = e == null ? void 0 : e.currentTarget) == null ? void 0 : a.focus) == "function" && e.currentTarget.focus(), typeof r == "function" && r(e);
202
+ }, y = k.forwardRef((e, t) => {
203
+ const { onClick: r, noInternalClick: a = !1, ...i } = e;
204
+ return /* @__PURE__ */ h(
205
+ "button",
206
+ {
207
+ ref: t,
208
+ onClick: (d) => {
209
+ F(d, a, r);
210
+ },
211
+ ...i
212
+ }
213
+ );
214
+ });
215
+ y.displayName = "BaseButton";
216
+ const N = k.forwardRef(
217
+ ({
218
+ children: e,
219
+ disabled: t = !1,
220
+ mode: r = "system",
221
+ focusMode: a = "system",
222
+ fullWidth: i = !1,
223
+ className: d,
224
+ size: l = "medium",
225
+ raw: n = !1,
226
+ noBorder: u = !1,
227
+ spacing: s,
228
+ variant: b = "primary",
229
+ noTruncate: m = !1,
230
+ ...g
231
+ }, c) => {
232
+ const v = B({
233
+ type: w,
234
+ mode: r,
235
+ focusMode: a,
236
+ fullWidth: i,
237
+ disabled: t,
238
+ raw: n,
239
+ className: d,
240
+ size: l,
241
+ noBorder: u,
242
+ spacing: s,
243
+ variant: b,
244
+ noTruncate: m
245
+ });
246
+ return /* @__PURE__ */ h(
247
+ y,
248
+ {
249
+ ref: c,
250
+ className: v,
251
+ disabled: t,
252
+ ...g,
253
+ children: e
254
+ }
255
+ );
256
+ }
257
+ );
258
+ N.displayName = "Button";
259
+ /*!
260
+ @versini/ui-button v1.1.2
261
+ © 2024 gizmette.com
262
+ */
263
+ try {
264
+ window.__VERSINI_UI_BUTTON__ || (window.__VERSINI_UI_BUTTON__ = {
265
+ version: "1.1.2",
266
+ buildTime: "09/21/2024 06:56 PM EDT",
267
+ homepage: "https://github.com/aversini/ui-components",
268
+ license: "MIT"
269
+ });
270
+ } catch {
271
+ }
272
+ const V = k.forwardRef(
273
+ ({
274
+ children: e,
275
+ disabled: t = !1,
276
+ mode: r = "system",
277
+ focusMode: a = "system",
278
+ fullWidth: i = !1,
279
+ className: d,
280
+ type: l = "button",
281
+ raw: n = !1,
282
+ noBorder: u = !1,
283
+ "aria-label": s,
284
+ label: b,
285
+ size: m = "medium",
286
+ labelRight: g,
287
+ labelLeft: c,
288
+ spacing: v,
289
+ noBackground: f = !1,
290
+ align: _ = "center",
291
+ active: E = !1,
292
+ ...I
293
+ }, R) => {
294
+ const M = B({
295
+ type: T,
296
+ mode: r,
297
+ focusMode: a,
298
+ fullWidth: i,
299
+ disabled: t,
300
+ raw: n,
301
+ className: d,
302
+ noBorder: u,
303
+ size: m,
304
+ labelRight: g,
305
+ labelLeft: c,
306
+ spacing: v,
307
+ noBackground: f,
308
+ align: _
309
+ }), L = o({
310
+ "text-copy-accent-dark": r === "light" && !n,
311
+ "text-copy-light": r === "dark" && !n,
312
+ "text-copy-accent-dark dark:text-copy-light": r === "alt-system" && !n,
313
+ "text-copy-light dark:text-copy-accent-dark": r === "system" && !n
314
+ }), z = E ? o(
315
+ "relative",
316
+ "focus-within:static",
317
+ "focus-within:after:border-transparent",
318
+ "after:absolute",
319
+ "after:content-['']",
320
+ "after:border-b-2",
321
+ "after:bottom-[-4px]",
322
+ "after:left-0",
323
+ "after:right-0",
324
+ {
325
+ "after:border-table-dark": r === "dark",
326
+ "after:border-table-light": r === "light",
327
+ "after:border-table-dark dark:after:border-table-light": r === "system",
328
+ "after:border-table-light dark:after:border-table-dark": r === "alt-system"
329
+ }
330
+ ) : "";
331
+ return /* @__PURE__ */ h("div", { className: z, children: /* @__PURE__ */ x(
332
+ y,
333
+ {
334
+ ref: R,
335
+ className: M,
336
+ disabled: t,
337
+ type: l,
338
+ "aria-label": s || b,
339
+ ...I,
340
+ children: [
341
+ c && /* @__PURE__ */ h("span", { className: "pr-2", children: c }),
342
+ /* @__PURE__ */ h("div", { className: L, children: e }),
343
+ g && /* @__PURE__ */ h("span", { className: "pl-2", children: g })
344
+ ]
345
+ }
346
+ ) });
347
+ }
348
+ );
349
+ V.displayName = "ButtonSort";
350
+ const G = 200, H = "===+-av-+===", P = ({
351
+ string: e,
352
+ length: t = G,
353
+ omission: r = H
354
+ }) => {
355
+ const a = e.length;
356
+ if (t >= a)
357
+ return { string: e, isTruncated: !1 };
358
+ const i = t - r.length;
359
+ return i < 1 ? { string: "", isTruncated: !0 } : { string: e.slice(0, i), isTruncated: !0 };
360
+ }, Q = ({
361
+ children: e,
362
+ length: t = 200,
363
+ mode: r = "system",
364
+ focusMode: a = "system"
365
+ }) => {
366
+ const [i, d] = j(!1);
367
+ if (typeof e != "string")
368
+ return e;
369
+ const { string: l, isTruncated: n } = P({
370
+ string: e,
371
+ length: t
372
+ });
373
+ return /* @__PURE__ */ x("span", { children: [
374
+ i ? e : l,
375
+ n && /* @__PURE__ */ h(
376
+ N,
377
+ {
378
+ mode: r,
379
+ focusMode: a,
380
+ spacing: { l: 2 },
381
+ size: "small",
382
+ onClick: (s) => {
383
+ s.preventDefault(), d(!i);
384
+ },
385
+ children: i ? "less..." : "more..."
386
+ }
387
+ )
388
+ ] });
389
+ };
390
+ export {
391
+ Q as Truncate
392
+ };
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+
4
+ type TruncateProps = {
5
+ /**
6
+ * The children to render.
7
+ */
8
+ children: React.ReactNode;
9
+ /**
10
+ * The maximum length of the text.
11
+ */
12
+ length?: number;
13
+ /**
14
+ * The mode of Button. This will change the color of the Button.
15
+ */
16
+ mode?: "dark" | "light" | "system" | "alt-system";
17
+ /**
18
+ * The type of focus for the Button. This will change the color
19
+ * of the focus ring around the Button.
20
+ */
21
+ focusMode?: "dark" | "light" | "system" | "alt-system";
22
+ };
23
+
24
+ declare const Truncate: ({ children, length, mode, focusMode, }: TruncateProps) => number | boolean | Iterable<react.ReactNode> | react_jsx_runtime.JSX.Element | null | undefined;
25
+
26
+ export { Truncate };
package/dist/index.js ADDED
@@ -0,0 +1,17 @@
1
+ import { Truncate as o } from "./components/Truncate/Truncate.js";
2
+ /*!
3
+ @versini/ui-truncate v0.0.0
4
+ © 2024 gizmette.com
5
+ */
6
+ try {
7
+ window.__VERSINI_UI_TRUNCATE__ || (window.__VERSINI_UI_TRUNCATE__ = {
8
+ version: "0.0.0",
9
+ buildTime: "09/21/2024 06:56 PM EDT",
10
+ homepage: "https://github.com/aversini/ui-components",
11
+ license: "MIT"
12
+ });
13
+ } catch {
14
+ }
15
+ export {
16
+ o as Truncate
17
+ };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::-ms-backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-ms-input-placeholder,textarea::-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}@keyframes blink{50%{fill:transparent}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.relative{position:relative}.m-0{margin:0}.m-1{margin:.25rem}.m-10{margin:2.5rem}.m-11{margin:2.75rem}.m-12{margin:3rem}.m-14{margin:3.5rem}.m-16{margin:4rem}.m-2{margin:.5rem}.m-20{margin:5rem}.m-24{margin:6rem}.m-28{margin:7rem}.m-3{margin:.75rem}.m-32{margin:8rem}.m-36{margin:9rem}.m-4{margin:1rem}.m-44{margin:11rem}.m-48{margin:12rem}.m-5{margin:1.25rem}.m-52{margin:13rem}.m-56{margin:14rem}.m-6{margin:1.5rem}.m-60{margin:15rem}.m-64{margin:16rem}.m-7{margin:1.75rem}.m-72{margin:18rem}.m-8{margin:2rem}.m-80{margin:20rem}.m-9{margin:2.25rem}.m-96{margin:24rem}.mb-0{margin-bottom:0}.mb-1{margin-bottom:.25rem}.mb-10{margin-bottom:2.5rem}.mb-11{margin-bottom:2.75rem}.mb-12{margin-bottom:3rem}.mb-14{margin-bottom:3.5rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-28{margin-bottom:7rem}.mb-3{margin-bottom:.75rem}.mb-32{margin-bottom:8rem}.mb-36{margin-bottom:9rem}.mb-4{margin-bottom:1rem}.mb-44{margin-bottom:11rem}.mb-48{margin-bottom:12rem}.mb-5{margin-bottom:1.25rem}.mb-52{margin-bottom:13rem}.mb-56{margin-bottom:14rem}.mb-6{margin-bottom:1.5rem}.mb-60{margin-bottom:15rem}.mb-64{margin-bottom:16rem}.mb-7{margin-bottom:1.75rem}.mb-72{margin-bottom:18rem}.mb-8{margin-bottom:2rem}.mb-80{margin-bottom:20rem}.mb-9{margin-bottom:2.25rem}.mb-96{margin-bottom:24rem}.ml-0{margin-left:0}.ml-1{margin-left:.25rem}.ml-10{margin-left:2.5rem}.ml-11{margin-left:2.75rem}.ml-12{margin-left:3rem}.ml-14{margin-left:3.5rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-20{margin-left:5rem}.ml-24{margin-left:6rem}.ml-28{margin-left:7rem}.ml-3{margin-left:.75rem}.ml-32{margin-left:8rem}.ml-36{margin-left:9rem}.ml-4{margin-left:1rem}.ml-44{margin-left:11rem}.ml-48{margin-left:12rem}.ml-5{margin-left:1.25rem}.ml-52{margin-left:13rem}.ml-56{margin-left:14rem}.ml-6{margin-left:1.5rem}.ml-60{margin-left:15rem}.ml-64{margin-left:16rem}.ml-7{margin-left:1.75rem}.ml-72{margin-left:18rem}.ml-8{margin-left:2rem}.ml-80{margin-left:20rem}.ml-9{margin-left:2.25rem}.ml-96{margin-left:24rem}.mr-0{margin-right:0}.mr-1{margin-right:.25rem}.mr-10{margin-right:2.5rem}.mr-11{margin-right:2.75rem}.mr-12{margin-right:3rem}.mr-14{margin-right:3.5rem}.mr-16{margin-right:4rem}.mr-2{margin-right:.5rem}.mr-20{margin-right:5rem}.mr-24{margin-right:6rem}.mr-28{margin-right:7rem}.mr-3{margin-right:.75rem}.mr-32{margin-right:8rem}.mr-36{margin-right:9rem}.mr-4{margin-right:1rem}.mr-44{margin-right:11rem}.mr-48{margin-right:12rem}.mr-5{margin-right:1.25rem}.mr-52{margin-right:13rem}.mr-56{margin-right:14rem}.mr-6{margin-right:1.5rem}.mr-60{margin-right:15rem}.mr-64{margin-right:16rem}.mr-7{margin-right:1.75rem}.mr-72{margin-right:18rem}.mr-8{margin-right:2rem}.mr-80{margin-right:20rem}.mr-9{margin-right:2.25rem}.mr-96{margin-right:24rem}.mt-0{margin-top:0}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-11{margin-top:2.75rem}.mt-12{margin-top:3rem}.mt-14{margin-top:3.5rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-20{margin-top:5rem}.mt-24{margin-top:6rem}.mt-28{margin-top:7rem}.mt-3{margin-top:.75rem}.mt-32{margin-top:8rem}.mt-36{margin-top:9rem}.mt-4{margin-top:1rem}.mt-44{margin-top:11rem}.mt-48{margin-top:12rem}.mt-5{margin-top:1.25rem}.mt-52{margin-top:13rem}.mt-56{margin-top:14rem}.mt-6{margin-top:1.5rem}.mt-60{margin-top:15rem}.mt-64{margin-top:16rem}.mt-7{margin-top:1.75rem}.mt-72{margin-top:18rem}.mt-8{margin-top:2rem}.mt-80{margin-top:20rem}.mt-9{margin-top:2.25rem}.mt-96{margin-top:24rem}.flex{display:flex}.inline-flex{display:inline-flex}.size-4{width:1rem;height:1rem}.h-12{height:3rem}.h-6{height:1.5rem}.h-8{height:2rem}.max-h-12{max-height:3rem}.max-h-8{max-height:2rem}.max-h-9{max-height:2.25rem}.w-12{width:3rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-full{width:100%}.basis-11\/12{flex-basis:91.666667%}.basis-4{flex-basis:1rem}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-border-accent{--tw-border-opacity: 1;border-color:var(--av-border-accent, rgb(169 185 173 / var(--tw-border-opacity)))}.border-border-danger-dark{--tw-border-opacity: 1;border-color:var(--av-border-danger-dark, rgb(127 29 29 / var(--tw-border-opacity)))}.border-border-danger-medium{--tw-border-opacity: 1;border-color:var(--av-border-danger-medium, rgb(248 113 113 / var(--tw-border-opacity)))}.border-border-dark{--tw-border-opacity: 1;border-color:var(--av-border-dark, rgb(15 23 42 / var(--tw-border-opacity)))}.border-table-dark{--tw-border-opacity: 1;border-color:var(--av-table-dark, rgb(55 65 81 / var(--tw-border-opacity)))}.border-table-light{--tw-border-opacity: 1;border-color:var(--av-table-light, rgb(243 244 246 / var(--tw-border-opacity)))}.border-transparent{border-color:transparent}.bg-action-danger-dark{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark, rgb(127 29 29 / var(--tw-bg-opacity)))}.bg-action-danger-dark-active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-active, rgb(220 38 38 / var(--tw-bg-opacity)))}.bg-action-danger-dark-hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.bg-action-danger-light{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light, rgb(220 38 38 / var(--tw-bg-opacity)))}.bg-action-danger-light-active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-active, rgb(153 27 27 / var(--tw-bg-opacity)))}.bg-action-danger-light-hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.bg-action-dark{--tw-bg-opacity: 1;background-color:var(--av-action-dark, rgb(15 23 42 / var(--tw-bg-opacity)))}.bg-action-dark-active{--tw-bg-opacity: 1;background-color:var(--av-action-dark-active, rgb(71 85 105 / var(--tw-bg-opacity)))}.bg-action-dark-hover{--tw-bg-opacity: 1;background-color:var(--av-action-dark-hover, rgb(51 65 85 / var(--tw-bg-opacity)))}.bg-action-light{--tw-bg-opacity: 1;background-color:var(--av-action-light, rgb(100 116 139 / var(--tw-bg-opacity)))}.bg-action-light-active{--tw-bg-opacity: 1;background-color:var(--av-action-light-active, rgb(51 65 85 / var(--tw-bg-opacity)))}.bg-action-light-hover{--tw-bg-opacity: 1;background-color:var(--av-action-light-hover, rgb(71 85 105 / var(--tw-bg-opacity)))}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-0{padding-top:0;padding-bottom:0}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.text-copy-accent-dark{--tw-text-opacity: 1;color:var(--av-copy-accent-dark, rgb(205 232 212 / var(--tw-text-opacity)))}.text-copy-light{--tw-text-opacity: 1;color:var(--av-copy-light, rgb(226 232 240 / var(--tw-text-opacity)))}.text-copy-lighter{--tw-text-opacity: 1;color:var(--av-copy-lighter, rgb(255 255 255 / var(--tw-text-opacity)))}.opacity-50{opacity:.5}.outline-focus-dark{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.outline-focus-light{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bottom-\[-4px\]:after{content:var(--tw-content);bottom:-4px}.after\:left-0:after{content:var(--tw-content);left:0}.after\:right-0:after{content:var(--tw-content);right:0}.after\:border-b-2:after{content:var(--tw-content);border-bottom-width:2px}.after\:border-table-dark:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:var(--av-table-dark, rgb(55 65 81 / var(--tw-border-opacity)))}.after\:border-table-light:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:var(--av-table-light, rgb(243 244 246 / var(--tw-border-opacity)))}.after\:content-\[\'\'\]:after{--tw-content: "";content:var(--tw-content)}.focus-within\:static:focus-within{position:static}.focus-within\:after\:border-transparent:focus-within:after{content:var(--tw-content);border-color:transparent}.hover\:bg-action-danger-dark-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.hover\:bg-action-danger-light-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.hover\:bg-action-dark-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-dark-hover, rgb(51 65 85 / var(--tw-bg-opacity)))}.hover\:bg-action-light-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-light-hover, rgb(71 85 105 / var(--tw-bg-opacity)))}.hover\:text-copy-light-hover:hover{--tw-text-opacity: 1;color:var(--av-copy-light-hover, rgb(226 232 240 / var(--tw-text-opacity)))}.focus\:outline:focus{outline-style:solid}.focus\:outline-2:focus{outline-width:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:outline-focus-dark:focus{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.focus\:outline-focus-light:focus{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.active\:bg-action-danger-dark-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-active, rgb(220 38 38 / var(--tw-bg-opacity)))}.active\:bg-action-danger-light-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-active, rgb(153 27 27 / var(--tw-bg-opacity)))}.active\:bg-action-dark-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-dark-active, rgb(71 85 105 / var(--tw-bg-opacity)))}.active\:bg-action-light-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-light-active, rgb(51 65 85 / var(--tw-bg-opacity)))}.active\:text-copy-light-active:active{--tw-text-opacity: 1;color:var(--av-copy-light-active, rgb(148 163 184 / var(--tw-text-opacity)))}.active\:text-copy-lighter-active:active{--tw-text-opacity: 1;color:var(--av-copy-lighter-active, rgb(255 255 255 / var(--tw-text-opacity)))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}@media (prefers-color-scheme: dark){.dark\:border-border-accent{--tw-border-opacity: 1;border-color:var(--av-border-accent, rgb(169 185 173 / var(--tw-border-opacity)))}.dark\:border-border-danger-dark{--tw-border-opacity: 1;border-color:var(--av-border-danger-dark, rgb(127 29 29 / var(--tw-border-opacity)))}.dark\:border-border-danger-medium{--tw-border-opacity: 1;border-color:var(--av-border-danger-medium, rgb(248 113 113 / var(--tw-border-opacity)))}.dark\:border-border-dark{--tw-border-opacity: 1;border-color:var(--av-border-dark, rgb(15 23 42 / var(--tw-border-opacity)))}.dark\:bg-action-danger-dark{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark, rgb(127 29 29 / var(--tw-bg-opacity)))}.dark\:bg-action-danger-light{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light, rgb(220 38 38 / var(--tw-bg-opacity)))}.dark\:bg-action-dark{--tw-bg-opacity: 1;background-color:var(--av-action-dark, rgb(15 23 42 / var(--tw-bg-opacity)))}.dark\:bg-action-light{--tw-bg-opacity: 1;background-color:var(--av-action-light, rgb(100 116 139 / var(--tw-bg-opacity)))}.dark\:text-copy-accent-dark{--tw-text-opacity: 1;color:var(--av-copy-accent-dark, rgb(205 232 212 / var(--tw-text-opacity)))}.dark\:text-copy-light{--tw-text-opacity: 1;color:var(--av-copy-light, rgb(226 232 240 / var(--tw-text-opacity)))}.dark\:text-copy-lighter{--tw-text-opacity: 1;color:var(--av-copy-lighter, rgb(255 255 255 / var(--tw-text-opacity)))}.dark\:after\:border-table-dark:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:var(--av-table-dark, rgb(55 65 81 / var(--tw-border-opacity)))}.dark\:after\:border-table-light:after{content:var(--tw-content);--tw-border-opacity: 1;border-color:var(--av-table-light, rgb(243 244 246 / var(--tw-border-opacity)))}.dark\:hover\:bg-action-danger-dark-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.dark\:hover\:bg-action-danger-light-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-hover, rgb(185 28 28 / var(--tw-bg-opacity)))}.dark\:hover\:bg-action-dark-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-dark-hover, rgb(51 65 85 / var(--tw-bg-opacity)))}.dark\:hover\:bg-action-light-hover:hover{--tw-bg-opacity: 1;background-color:var(--av-action-light-hover, rgb(71 85 105 / var(--tw-bg-opacity)))}.dark\:focus\:outline-focus-dark:focus{outline-color:var(--av-focus-dark, rgb(21 128 61 / 1))}.dark\:focus\:outline-focus-light:focus{outline-color:var(--av-focus-light, rgb(134 239 172 / 1))}.dark\:active\:bg-action-danger-dark-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-dark-active, rgb(220 38 38 / var(--tw-bg-opacity)))}.dark\:active\:bg-action-danger-light-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-danger-light-active, rgb(153 27 27 / var(--tw-bg-opacity)))}.dark\:active\:bg-action-dark-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-dark-active, rgb(71 85 105 / var(--tw-bg-opacity)))}.dark\:active\:bg-action-light-active:active{--tw-bg-opacity: 1;background-color:var(--av-action-light-active, rgb(51 65 85 / var(--tw-bg-opacity)))}}
package/dist/style.js ADDED
File without changes
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@versini/ui-truncate",
3
+ "version": "0.0.0",
4
+ "license": "MIT",
5
+ "author": "Arno Versini",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "homepage": "https://github.com/aversini/ui-components",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git@github.com:aversini/ui-components.git"
13
+ },
14
+ "type": "module",
15
+ "main": "dist/index.js",
16
+ "types": "dist/index.d.ts",
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "scripts": {
21
+ "build:check": "tsc",
22
+ "build:js": "vite build",
23
+ "build:types": "tsup",
24
+ "build": "npm-run-all --serial clean build:check build:js build:types",
25
+ "clean": "rimraf dist tmp",
26
+ "dev:js": "vite build --watch --mode development",
27
+ "dev:types": "tsup --watch src",
28
+ "dev": "npm-run-all clean --parallel dev:js dev:types",
29
+ "lint": "biome lint src",
30
+ "start": "static-server dist --port 5173",
31
+ "test:coverage:ui": "vitest --coverage --ui",
32
+ "test:coverage": "vitest run --coverage",
33
+ "test:watch": "vitest",
34
+ "test": "vitest run"
35
+ },
36
+ "peerDependencies": {
37
+ "react": "^18.3.1",
38
+ "react-dom": "^18.3.1"
39
+ },
40
+ "devDependencies": {
41
+ "@versini/ui-styles": "1.9.9"
42
+ },
43
+ "dependencies": {
44
+ "@tailwindcss/typography": "0.5.15",
45
+ "@versini/ui-button": "1.1.2",
46
+ "tailwindcss": "3.4.12"
47
+ },
48
+ "sideEffects": [
49
+ "**/*.css"
50
+ ],
51
+ "gitHead": "882b63b27dba050b5dbac1d2d82c949acfa5b830"
52
+ }