@salemcobalt/ui 0.2.0-rc.14 → 0.2.0-rc.15
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/README.md +8 -3
- package/dist/index.d.ts +387 -10
- package/dist/index.js +127 -10
- package/dist/index.js.map +1 -1
- package/dist/styles.css +314 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1342,19 +1342,11 @@ var sizeByLevel = {
|
|
|
1342
1342
|
5: "md",
|
|
1343
1343
|
6: "sm"
|
|
1344
1344
|
};
|
|
1345
|
-
function Heading({
|
|
1346
|
-
level = 2,
|
|
1347
|
-
size,
|
|
1348
|
-
as,
|
|
1349
|
-
tone = "default",
|
|
1350
|
-
truncate = false,
|
|
1351
|
-
className,
|
|
1352
|
-
...rest
|
|
1353
|
-
}) {
|
|
1345
|
+
function Heading({ level = 2, size, as, tone, truncate = false, className, ...rest }) {
|
|
1354
1346
|
return createElement3(as ?? `h${level}`, {
|
|
1355
1347
|
className: cx("sc-heading", className),
|
|
1356
1348
|
"data-size": size ?? sizeByLevel[level],
|
|
1357
|
-
"data-tone": tone,
|
|
1349
|
+
"data-tone": tone ?? (size === "overline" ? "muted" : "default"),
|
|
1358
1350
|
"data-truncate": truncate || void 0,
|
|
1359
1351
|
...rest
|
|
1360
1352
|
});
|
|
@@ -1370,6 +1362,7 @@ function Text({
|
|
|
1370
1362
|
align,
|
|
1371
1363
|
truncate = false,
|
|
1372
1364
|
numeric = false,
|
|
1365
|
+
family = "sans",
|
|
1373
1366
|
className,
|
|
1374
1367
|
style,
|
|
1375
1368
|
...rest
|
|
@@ -1383,6 +1376,7 @@ function Text({
|
|
|
1383
1376
|
"data-align": align,
|
|
1384
1377
|
"data-truncate": truncate === true ? "" : clamp2 !== void 0 ? "clamp" : void 0,
|
|
1385
1378
|
"data-numeric": numeric || void 0,
|
|
1379
|
+
"data-family": family === "mono" ? "mono" : void 0,
|
|
1386
1380
|
style: clamp2 !== void 0 ? { ...style, "--sc-text-lines": clamp2 } : style,
|
|
1387
1381
|
...rest
|
|
1388
1382
|
});
|
|
@@ -3476,6 +3470,125 @@ var FullScreenFlow = {
|
|
|
3476
3470
|
Footer
|
|
3477
3471
|
};
|
|
3478
3472
|
|
|
3473
|
+
// src/components/Score/Score.tsx
|
|
3474
|
+
import { jsx as jsx35, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3475
|
+
function Score({
|
|
3476
|
+
value,
|
|
3477
|
+
max = 100,
|
|
3478
|
+
tone = "accent",
|
|
3479
|
+
variant = "tile",
|
|
3480
|
+
size = "sm",
|
|
3481
|
+
caption,
|
|
3482
|
+
label = "Score",
|
|
3483
|
+
valueText,
|
|
3484
|
+
selected = false,
|
|
3485
|
+
className,
|
|
3486
|
+
style,
|
|
3487
|
+
...rest
|
|
3488
|
+
}) {
|
|
3489
|
+
const fraction = max > 0 ? Math.min(1, Math.max(0, value / max)) : 0;
|
|
3490
|
+
return /* @__PURE__ */ jsxs30(
|
|
3491
|
+
"span",
|
|
3492
|
+
{
|
|
3493
|
+
className: cx("sc-score", className),
|
|
3494
|
+
"data-variant": variant,
|
|
3495
|
+
"data-size": variant === "tile" ? size : void 0,
|
|
3496
|
+
"data-tone": tone,
|
|
3497
|
+
"data-selected": selected || void 0,
|
|
3498
|
+
style: variant === "ring" ? { ...style, "--sc-score-fill": (fraction * 100).toFixed(2) } : style,
|
|
3499
|
+
...rest,
|
|
3500
|
+
children: [
|
|
3501
|
+
/* @__PURE__ */ jsx35("span", { className: "sc-visually-hidden", children: valueText ?? `${label} ${value} out of ${max}` }),
|
|
3502
|
+
variant === "ring" ? /* @__PURE__ */ jsxs30("svg", { className: "sc-score__ring", viewBox: "0 0 64 64", "aria-hidden": "true", focusable: "false", children: [
|
|
3503
|
+
/* @__PURE__ */ jsx35("circle", { className: "sc-score__track", cx: "32", cy: "32", r: "29", pathLength: 100 }),
|
|
3504
|
+
fraction > 0 ? /* @__PURE__ */ jsx35("circle", { className: "sc-score__arc", cx: "32", cy: "32", r: "29", pathLength: 100 }) : null
|
|
3505
|
+
] }) : null,
|
|
3506
|
+
/* @__PURE__ */ jsxs30("span", { className: "sc-score__body", "aria-hidden": "true", children: [
|
|
3507
|
+
/* @__PURE__ */ jsx35("span", { className: "sc-score__value", children: value }),
|
|
3508
|
+
caption != null ? /* @__PURE__ */ jsx35("span", { className: "sc-score__caption", children: caption }) : null
|
|
3509
|
+
] })
|
|
3510
|
+
]
|
|
3511
|
+
}
|
|
3512
|
+
);
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
// src/components/ReasonList/ReasonList.tsx
|
|
3516
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3517
|
+
function ReasonListRoot({ tone, size = "md", divider = false, className, ...rest }) {
|
|
3518
|
+
return /* @__PURE__ */ jsx36(
|
|
3519
|
+
"ul",
|
|
3520
|
+
{
|
|
3521
|
+
className: cx("sc-reason-list", className),
|
|
3522
|
+
"data-tone": tone,
|
|
3523
|
+
"data-size": size,
|
|
3524
|
+
"data-divider": divider || void 0,
|
|
3525
|
+
...rest
|
|
3526
|
+
}
|
|
3527
|
+
);
|
|
3528
|
+
}
|
|
3529
|
+
function ReasonListItem({ className, ...rest }) {
|
|
3530
|
+
return /* @__PURE__ */ jsx36("li", { className: cx("sc-reason-list__item", className), ...rest });
|
|
3531
|
+
}
|
|
3532
|
+
var ReasonList = Object.assign(ReasonListRoot, { Item: ReasonListItem });
|
|
3533
|
+
|
|
3534
|
+
// src/components/WordDiff/WordDiff.tsx
|
|
3535
|
+
import { createElement as createElement7, Fragment as Fragment9 } from "react";
|
|
3536
|
+
import { Fragment as Fragment10, jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3537
|
+
var edges = /^(\s*)([\s\S]*?)(\s*)$/;
|
|
3538
|
+
function Change({ kind, text, label }) {
|
|
3539
|
+
const [, lead = "", core = "", trail = ""] = edges.exec(text) ?? [];
|
|
3540
|
+
if (!core) return /* @__PURE__ */ jsx37(Fragment10, { children: text });
|
|
3541
|
+
const Tag = kind === "added" ? "ins" : "del";
|
|
3542
|
+
return /* @__PURE__ */ jsxs31(Fragment10, { children: [
|
|
3543
|
+
lead,
|
|
3544
|
+
/* @__PURE__ */ jsxs31(Tag, { className: `sc-word-diff__${kind}`, children: [
|
|
3545
|
+
/* @__PURE__ */ jsxs31("span", { className: "sc-visually-hidden", children: [
|
|
3546
|
+
"[",
|
|
3547
|
+
label,
|
|
3548
|
+
": "
|
|
3549
|
+
] }),
|
|
3550
|
+
core,
|
|
3551
|
+
/* @__PURE__ */ jsx37("span", { className: "sc-visually-hidden", children: "]" })
|
|
3552
|
+
] }),
|
|
3553
|
+
trail
|
|
3554
|
+
] });
|
|
3555
|
+
}
|
|
3556
|
+
function WordDiff({
|
|
3557
|
+
parts,
|
|
3558
|
+
as = "p",
|
|
3559
|
+
size = "sm",
|
|
3560
|
+
addedLabel = "added",
|
|
3561
|
+
removedLabel = "removed",
|
|
3562
|
+
className,
|
|
3563
|
+
...rest
|
|
3564
|
+
}) {
|
|
3565
|
+
const children = parts.map(
|
|
3566
|
+
(part, i) => part.kind === "same" ? /* @__PURE__ */ jsx37(Fragment9, { children: part.text }, i) : /* @__PURE__ */ jsx37(
|
|
3567
|
+
Change,
|
|
3568
|
+
{
|
|
3569
|
+
kind: part.kind,
|
|
3570
|
+
text: part.text,
|
|
3571
|
+
label: part.kind === "added" ? addedLabel : removedLabel
|
|
3572
|
+
},
|
|
3573
|
+
i
|
|
3574
|
+
)
|
|
3575
|
+
);
|
|
3576
|
+
return createElement7(
|
|
3577
|
+
as,
|
|
3578
|
+
{ className: cx("sc-word-diff", className), "data-size": size, ...rest },
|
|
3579
|
+
children
|
|
3580
|
+
);
|
|
3581
|
+
}
|
|
3582
|
+
|
|
3583
|
+
// src/components/Quote/Quote.tsx
|
|
3584
|
+
import { jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3585
|
+
function Quote({ label, className, children, ...rest }) {
|
|
3586
|
+
return /* @__PURE__ */ jsxs32("figure", { className: cx("sc-quote", className), ...rest, children: [
|
|
3587
|
+
/* @__PURE__ */ jsx38("figcaption", { className: "sc-quote__label", children: label }),
|
|
3588
|
+
/* @__PURE__ */ jsx38("blockquote", { className: "sc-quote__text", children })
|
|
3589
|
+
] });
|
|
3590
|
+
}
|
|
3591
|
+
|
|
3479
3592
|
// src/index.ts
|
|
3480
3593
|
var version = "0.1.1";
|
|
3481
3594
|
export {
|
|
@@ -3539,7 +3652,10 @@ export {
|
|
|
3539
3652
|
Popover,
|
|
3540
3653
|
PriorityNav,
|
|
3541
3654
|
Progress,
|
|
3655
|
+
Quote,
|
|
3656
|
+
ReasonList,
|
|
3542
3657
|
RefreshIcon,
|
|
3658
|
+
Score,
|
|
3543
3659
|
SearchIcon,
|
|
3544
3660
|
Select,
|
|
3545
3661
|
SelectionBar,
|
|
@@ -3564,6 +3680,7 @@ export {
|
|
|
3564
3680
|
UndoIcon,
|
|
3565
3681
|
UserIcon,
|
|
3566
3682
|
WarningIcon,
|
|
3683
|
+
WordDiff,
|
|
3567
3684
|
XIcon,
|
|
3568
3685
|
iconNames,
|
|
3569
3686
|
useRowSelection,
|