@campfire-interactive/ui 0.10.1 → 0.10.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.
- package/dist/index.d.ts +9 -2
- package/dist/index.js +8 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1126,7 +1126,13 @@ interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
|
1126
1126
|
/** Adds hover feedback. Set it when the row itself navigates or opens something. */
|
|
1127
1127
|
interactive?: boolean;
|
|
1128
1128
|
}
|
|
1129
|
-
|
|
1129
|
+
/**
|
|
1130
|
+
* Forwards its ref. Under React 18 a plain function component drops a ref
|
|
1131
|
+
* outright, and rows are what callers hold one to: a drag handle's connect
|
|
1132
|
+
* function, scroll-into-view on the selected row. omsf had both, and every
|
|
1133
|
+
* one of them would have received null.
|
|
1134
|
+
*/
|
|
1135
|
+
declare const TableRow: react.ForwardRefExoticComponent<TableRowProps & react.RefAttributes<HTMLTableRowElement>>;
|
|
1130
1136
|
type SortDirection = 'asc' | 'desc';
|
|
1131
1137
|
interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
1132
1138
|
/** Right-aligns and tabular-aligns the column. Use for every numeric column. */
|
|
@@ -1167,7 +1173,8 @@ interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
|
1167
1173
|
*/
|
|
1168
1174
|
mono?: boolean;
|
|
1169
1175
|
}
|
|
1170
|
-
|
|
1176
|
+
/** Forwards its ref, for the same reason as TableRow. */
|
|
1177
|
+
declare const TableCell: react.ForwardRefExoticComponent<TableCellProps & react.RefAttributes<HTMLTableCellElement>>;
|
|
1171
1178
|
interface TableEmptyProps {
|
|
1172
1179
|
/** Must match the table's column count, or the message will not span the width. */
|
|
1173
1180
|
colSpan: number;
|
package/dist/index.js
CHANGED
|
@@ -1686,10 +1686,11 @@ function TableFooter({ className, ...rest }) {
|
|
|
1686
1686
|
return /* @__PURE__ */ jsx21("tfoot", { className: cn("cfi-ui-table__foot", className), ...rest });
|
|
1687
1687
|
}
|
|
1688
1688
|
var TableFoot = TableFooter;
|
|
1689
|
-
|
|
1689
|
+
var TableRow = forwardRef14(function TableRow2({ selected, interactive, className, ...rest }, ref) {
|
|
1690
1690
|
return /* @__PURE__ */ jsx21(
|
|
1691
1691
|
"tr",
|
|
1692
1692
|
{
|
|
1693
|
+
ref,
|
|
1693
1694
|
"data-selected": selected || void 0,
|
|
1694
1695
|
"data-interactive": interactive || void 0,
|
|
1695
1696
|
"aria-selected": selected || void 0,
|
|
@@ -1697,7 +1698,7 @@ function TableRow({ selected, interactive, className, ...rest }) {
|
|
|
1697
1698
|
...rest
|
|
1698
1699
|
}
|
|
1699
1700
|
);
|
|
1700
|
-
}
|
|
1701
|
+
});
|
|
1701
1702
|
function TableHead({
|
|
1702
1703
|
numeric,
|
|
1703
1704
|
sortable,
|
|
@@ -1726,10 +1727,11 @@ function TableHead({
|
|
|
1726
1727
|
}
|
|
1727
1728
|
);
|
|
1728
1729
|
}
|
|
1729
|
-
|
|
1730
|
+
var TableCell = forwardRef14(function TableCell2({ numeric, truncate, mono, className, ...rest }, ref) {
|
|
1730
1731
|
return /* @__PURE__ */ jsx21(
|
|
1731
1732
|
"td",
|
|
1732
1733
|
{
|
|
1734
|
+
ref,
|
|
1733
1735
|
"data-numeric": numeric || void 0,
|
|
1734
1736
|
"data-truncate": truncate || void 0,
|
|
1735
1737
|
"data-mono": mono || void 0,
|
|
@@ -1737,7 +1739,7 @@ function TableCell({ numeric, truncate, mono, className, ...rest }) {
|
|
|
1737
1739
|
...rest
|
|
1738
1740
|
}
|
|
1739
1741
|
);
|
|
1740
|
-
}
|
|
1742
|
+
});
|
|
1741
1743
|
function TableEmpty({ colSpan, children }) {
|
|
1742
1744
|
return /* @__PURE__ */ jsx21("tr", { className: "cfi-ui-table__row", children: /* @__PURE__ */ jsx21("td", { colSpan, className: "cfi-ui-table__empty", children }) });
|
|
1743
1745
|
}
|
|
@@ -1750,7 +1752,7 @@ import { forwardRef as forwardRef15 } from "react";
|
|
|
1750
1752
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
1751
1753
|
|
|
1752
1754
|
// src/Tabs.css
|
|
1753
|
-
styleInject("@layer components {\n .cfi-ui-tabs {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n :where(.cfi-ui-tabs__list) {\n display: flex;\n align-items: center;\n gap: var(--cfi-ui-space-xs);\n overflow-x: auto;\n scrollbar-width: none;\n }\n .cfi-ui-tabs__list::-webkit-scrollbar {\n display: none;\n }\n :where(.cfi-ui-tabs__trigger) {\n display: inline-flex;\n align-items: center;\n gap: var(--cfi-ui-space-xs);\n flex: none;\n border: 0;\n background: none;\n color: var(--cfi-ui-content-muted);\n font-family: var(--cfi-ui-font);\n font-size: var(--cfi-ui-text-sm);\n font-weight: var(--cfi-ui-weight-medium);\n cursor: pointer;\n transition:\n color var(--cfi-ui-transition-fast),\n background-color var(--cfi-ui-transition-fast),\n border-color var(--cfi-ui-transition-fast);\n }\n .cfi-ui-tabs__trigger:disabled {\n color: var(--cfi-ui-content-disabled);\n cursor: not-allowed;\n }\n .cfi-ui-tabs__icon {\n display: inline-flex;\n flex: none;\n }\n .cfi-ui-tabs__icon > svg {\n width: 0.875rem;\n height: 0.875rem;\n display: block;\n }\n .cfi-ui-tabs__list[data-variant=pill] {\n gap: 0;\n padding: 0.1875rem;\n background: var(--cfi-ui-surface-muted);\n border: 0;\n border-radius: 14px;\n align-self: flex-start;\n }\n .cfi-ui-tabs__list[data-variant=pill] .cfi-ui-tabs__trigger {\n padding: 0.25rem 0.75rem;\n border-radius: 14px;\n color: var(--cfi-ui-content);\n }\n .cfi-ui-tabs__list[data-variant=pill] .cfi-ui-tabs__trigger:hover:not(:disabled) {\n color: var(--cfi-ui-content);\n }\n .cfi-ui-tabs__list[data-variant=pill] .cfi-ui-tabs__trigger[data-state=active] {\n background: var(--cfi-ui-surface);\n color: var(--cfi-ui-content);\n box-shadow: var(--cfi-ui-shadow-xs);\n }\n :where(.cfi-ui-tabs__content) {\n min-width: 0;\n padding-top: var(--cfi-ui-space-md);\n }\n .cfi-ui-tabs__content:focus-visible {\n outline: none;\n }\n}\n");
|
|
1755
|
+
styleInject("@layer components {\n .cfi-ui-tabs {\n display: flex;\n flex-direction: column;\n min-width: 0;\n }\n :where(.cfi-ui-tabs__list) {\n display: flex;\n align-items: center;\n gap: var(--cfi-ui-space-xs);\n overflow-x: auto;\n scrollbar-width: none;\n }\n .cfi-ui-tabs__list::-webkit-scrollbar {\n display: none;\n }\n :where(.cfi-ui-tabs__trigger) {\n display: inline-flex;\n align-items: center;\n gap: var(--cfi-ui-space-xs);\n flex: none;\n border: 0;\n background: none;\n color: var(--cfi-ui-content-muted);\n font-family: var(--cfi-ui-font);\n font-size: var(--cfi-ui-text-sm);\n font-weight: var(--cfi-ui-weight-medium);\n cursor: pointer;\n transition:\n color var(--cfi-ui-transition-fast),\n background-color var(--cfi-ui-transition-fast),\n border-color var(--cfi-ui-transition-fast);\n }\n .cfi-ui-tabs__trigger:disabled {\n color: var(--cfi-ui-content-disabled);\n cursor: not-allowed;\n }\n .cfi-ui-tabs__label {\n display: inline-flex;\n align-items: center;\n gap: var(--cfi-ui-space-xs);\n white-space: nowrap;\n }\n .cfi-ui-tabs__icon {\n display: inline-flex;\n flex: none;\n }\n .cfi-ui-tabs__icon > svg {\n width: 0.875rem;\n height: 0.875rem;\n display: block;\n }\n .cfi-ui-tabs__list[data-variant=pill] {\n gap: 0;\n padding: 0.1875rem;\n background: var(--cfi-ui-surface-muted);\n border: 0;\n border-radius: 14px;\n align-self: flex-start;\n }\n .cfi-ui-tabs__list[data-variant=pill] .cfi-ui-tabs__trigger {\n padding: 0.25rem 0.75rem;\n border-radius: 14px;\n color: var(--cfi-ui-content);\n }\n .cfi-ui-tabs__list[data-variant=pill] .cfi-ui-tabs__trigger:hover:not(:disabled) {\n color: var(--cfi-ui-content);\n }\n .cfi-ui-tabs__list[data-variant=pill] .cfi-ui-tabs__trigger[data-state=active] {\n background: var(--cfi-ui-surface);\n color: var(--cfi-ui-content);\n box-shadow: var(--cfi-ui-shadow-xs);\n }\n :where(.cfi-ui-tabs__content) {\n min-width: 0;\n padding-top: var(--cfi-ui-space-md);\n }\n .cfi-ui-tabs__content:focus-visible {\n outline: none;\n }\n}\n");
|
|
1754
1756
|
|
|
1755
1757
|
// src/Tabs.tsx
|
|
1756
1758
|
import { jsx as jsx22, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
@@ -1773,7 +1775,7 @@ var TabsTrigger = forwardRef15(
|
|
|
1773
1775
|
function TabsTrigger2({ icon, count, className, children, ...rest }, ref) {
|
|
1774
1776
|
return /* @__PURE__ */ jsxs22(RadixTabs.Trigger, { ref, className: cn("cfi-ui-tabs__trigger", className), ...rest, children: [
|
|
1775
1777
|
icon && /* @__PURE__ */ jsx22("span", { className: "cfi-ui-tabs__icon", children: icon }),
|
|
1776
|
-
/* @__PURE__ */ jsx22("span", { children }),
|
|
1778
|
+
/* @__PURE__ */ jsx22("span", { className: "cfi-ui-tabs__label", children }),
|
|
1777
1779
|
count !== void 0 && /* @__PURE__ */ jsx22(CountBadge, { count, size: "sm" })
|
|
1778
1780
|
] });
|
|
1779
1781
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campfire-interactive/ui",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "Shared UI primitives for the Campfire Suite — Radix behavior, plain CSS styled entirely from the design tokens, no Tailwind required",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|