@salemcobalt/ui 0.2.0-rc.1 → 0.2.0-rc.2

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/dist/index.js CHANGED
@@ -196,12 +196,18 @@ function ArchiveIcon(props) {
196
196
  /* @__PURE__ */ jsx5("path", { d: "M3.25 5.75v6.5a1 1 0 0 0 1 1h7.5a1 1 0 0 0 1-1v-6.5M6.5 8.75h3" })
197
197
  ] });
198
198
  }
199
+ function ArrowDownIcon(props) {
200
+ return /* @__PURE__ */ jsx5(Icon, { ...props, children: /* @__PURE__ */ jsx5("path", { d: "M8 3v10M4 9l4 4 4-4" }) });
201
+ }
199
202
  function ArrowLeftIcon(props) {
200
203
  return /* @__PURE__ */ jsx5(Icon, { ...props, children: /* @__PURE__ */ jsx5("path", { d: "M13 8H3M7 4 3 8l4 4" }) });
201
204
  }
202
205
  function ArrowRightIcon(props) {
203
206
  return /* @__PURE__ */ jsx5(Icon, { ...props, children: /* @__PURE__ */ jsx5("path", { d: "M3 8h10M9 4l4 4-4 4" }) });
204
207
  }
208
+ function ArrowUpIcon(props) {
209
+ return /* @__PURE__ */ jsx5(Icon, { ...props, children: /* @__PURE__ */ jsx5("path", { d: "M8 13V3M4 7l4-4 4 4" }) });
210
+ }
205
211
  function BellIcon(props) {
206
212
  return /* @__PURE__ */ jsxs4(Icon, { ...props, children: [
207
213
  /* @__PURE__ */ jsx5("path", { d: "M4 6.5a4 4 0 0 1 8 0v3l1.25 2H2.75L4 9.5z" }),
@@ -489,8 +495,10 @@ var Dialog = { Root, Trigger, Content, Title, Description, Body, Actions, Close
489
495
  // src/icons/icon-names.gen.ts
490
496
  var iconNames = [
491
497
  "archive",
498
+ "arrow-down",
492
499
  "arrow-left",
493
500
  "arrow-right",
501
+ "arrow-up",
494
502
  "bell",
495
503
  "briefcase",
496
504
  "calendar",
@@ -1293,12 +1301,172 @@ function Text({
1293
1301
  });
1294
1302
  }
1295
1303
 
1304
+ // src/components/Table/Table.tsx
1305
+ import { jsx as jsx21 } from "react/jsx-runtime";
1306
+ function Root5({
1307
+ stickyHeader = false,
1308
+ maxHeight,
1309
+ density,
1310
+ divided = true,
1311
+ layout = "auto",
1312
+ wrapperClassName,
1313
+ wrapperStyle,
1314
+ className,
1315
+ style,
1316
+ children,
1317
+ ...rest
1318
+ }) {
1319
+ return /* @__PURE__ */ jsx21(
1320
+ "div",
1321
+ {
1322
+ className: cx("sc-table-wrap", wrapperClassName),
1323
+ "data-sticky-header": stickyHeader || void 0,
1324
+ "data-scroll": maxHeight ? "" : void 0,
1325
+ style: maxHeight ? { ...wrapperStyle, maxBlockSize: maxHeight } : wrapperStyle,
1326
+ children: /* @__PURE__ */ jsx21(
1327
+ "table",
1328
+ {
1329
+ className: cx("sc-table", className),
1330
+ "data-density": density,
1331
+ "data-divided": divided || void 0,
1332
+ "data-layout": layout,
1333
+ style,
1334
+ ...rest,
1335
+ children
1336
+ }
1337
+ )
1338
+ }
1339
+ );
1340
+ }
1341
+ function Caption({ className, ...rest }) {
1342
+ return /* @__PURE__ */ jsx21("caption", { className: cx("sc-table__caption", className), ...rest });
1343
+ }
1344
+ function Head({ className, ...rest }) {
1345
+ return /* @__PURE__ */ jsx21("thead", { className: cx("sc-table__head", className), ...rest });
1346
+ }
1347
+ function Body2({ className, ...rest }) {
1348
+ return /* @__PURE__ */ jsx21("tbody", { className: cx("sc-table__body", className), ...rest });
1349
+ }
1350
+ function Foot({ className, ...rest }) {
1351
+ return /* @__PURE__ */ jsx21("tfoot", { className: cx("sc-table__foot", className), ...rest });
1352
+ }
1353
+ function Row({ selected = false, interactive = false, className, ...rest }) {
1354
+ return /* @__PURE__ */ jsx21(
1355
+ "tr",
1356
+ {
1357
+ className: cx("sc-table__row", className),
1358
+ "data-selected": selected || void 0,
1359
+ "data-interactive": interactive || void 0,
1360
+ "aria-selected": selected || void 0,
1361
+ ...rest
1362
+ }
1363
+ );
1364
+ }
1365
+ function Header({
1366
+ align,
1367
+ numeric = false,
1368
+ nowrap = false,
1369
+ truncate = false,
1370
+ width,
1371
+ scope = "col",
1372
+ className,
1373
+ style,
1374
+ ...rest
1375
+ }) {
1376
+ return /* @__PURE__ */ jsx21(
1377
+ "th",
1378
+ {
1379
+ scope,
1380
+ className: cx("sc-table__header", className),
1381
+ "data-align": align ?? (numeric ? "end" : void 0),
1382
+ "data-numeric": numeric || void 0,
1383
+ "data-nowrap": nowrap || void 0,
1384
+ "data-truncate": truncate || void 0,
1385
+ style: width ? { ...style, inlineSize: width } : style,
1386
+ ...rest
1387
+ }
1388
+ );
1389
+ }
1390
+ function Cell({
1391
+ align,
1392
+ numeric = false,
1393
+ nowrap = false,
1394
+ truncate = false,
1395
+ width,
1396
+ className,
1397
+ style,
1398
+ ...rest
1399
+ }) {
1400
+ return /* @__PURE__ */ jsx21(
1401
+ "td",
1402
+ {
1403
+ className: cx("sc-table__cell", className),
1404
+ "data-align": align ?? (numeric ? "end" : void 0),
1405
+ "data-numeric": numeric || void 0,
1406
+ "data-nowrap": nowrap || void 0,
1407
+ "data-truncate": truncate || void 0,
1408
+ style: width ? { ...style, inlineSize: width } : style,
1409
+ ...rest
1410
+ }
1411
+ );
1412
+ }
1413
+ var Table = { Root: Root5, Caption, Head, Body: Body2, Foot, Row, Header, Cell };
1414
+
1415
+ // src/components/Stat/Stat.tsx
1416
+ import { createElement as createElement5 } from "react";
1417
+ import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
1418
+ var trendIcons = {
1419
+ up: /* @__PURE__ */ jsx22(ArrowUpIcon, { size: "xs" }),
1420
+ down: /* @__PURE__ */ jsx22(ArrowDownIcon, { size: "xs" }),
1421
+ flat: /* @__PURE__ */ jsx22(ArrowRightIcon, { size: "xs" })
1422
+ };
1423
+ function Stat({
1424
+ label,
1425
+ value,
1426
+ delta,
1427
+ deltaTone = "neutral",
1428
+ trend,
1429
+ hint,
1430
+ icon,
1431
+ variant = "outlined",
1432
+ size = "md",
1433
+ as = "div",
1434
+ className,
1435
+ ...rest
1436
+ }) {
1437
+ return createElement5(
1438
+ as,
1439
+ {
1440
+ className: cx("sc-stat", className),
1441
+ "data-variant": variant,
1442
+ "data-size": size,
1443
+ ...rest
1444
+ },
1445
+ /* @__PURE__ */ jsxs18(Fragment4, { children: [
1446
+ /* @__PURE__ */ jsx22("div", { className: "sc-stat__label", children: label }),
1447
+ icon ? /* @__PURE__ */ jsx22("span", { className: "sc-stat__icon", "aria-hidden": "true", children: icon }) : null,
1448
+ /* @__PURE__ */ jsx22("div", { className: "sc-stat__value", children: value }),
1449
+ delta != null ? /* @__PURE__ */ jsxs18("div", { className: "sc-stat__delta", "data-tone": deltaTone, children: [
1450
+ trend ? /* @__PURE__ */ jsx22("span", { className: "sc-stat__trend", "aria-hidden": "true", children: trendIcons[trend] }) : null,
1451
+ trend ? /* @__PURE__ */ jsxs18("span", { className: "sc-visually-hidden", children: [
1452
+ trend === "flat" ? "unchanged" : trend,
1453
+ " "
1454
+ ] }) : null,
1455
+ delta
1456
+ ] }) : null,
1457
+ hint != null ? /* @__PURE__ */ jsx22("div", { className: "sc-stat__hint", children: hint }) : null
1458
+ ] })
1459
+ );
1460
+ }
1461
+
1296
1462
  // src/index.ts
1297
1463
  var version = "0.1.1";
1298
1464
  export {
1299
1465
  ArchiveIcon,
1466
+ ArrowDownIcon,
1300
1467
  ArrowLeftIcon,
1301
1468
  ArrowRightIcon,
1469
+ ArrowUpIcon,
1302
1470
  Badge,
1303
1471
  Banner,
1304
1472
  BellIcon,
@@ -1352,8 +1520,10 @@ export {
1352
1520
  Spinner,
1353
1521
  Stack,
1354
1522
  StarIcon,
1523
+ Stat,
1355
1524
  SunIcon,
1356
1525
  Switch,
1526
+ Table,
1357
1527
  Tabs,
1358
1528
  Text,
1359
1529
  Textarea,