@campfire-interactive/ui 0.7.0 → 0.8.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/dist/index.d.ts CHANGED
@@ -1168,20 +1168,27 @@ declare function TableCaption({ className, ...rest }: React.HTMLAttributes<HTMLT
1168
1168
  declare const Tabs: react.ForwardRefExoticComponent<RadixTabs.TabsProps & react.RefAttributes<HTMLDivElement>>;
1169
1169
  /** @deprecated Use `Tabs`. Kept so existing imports keep working. */
1170
1170
  declare const TabsRoot: react.ForwardRefExoticComponent<RadixTabs.TabsProps & react.RefAttributes<HTMLDivElement>>;
1171
- interface TabsListProps extends React.ComponentPropsWithoutRef<typeof RadixTabs.List> {
1172
- /**
1173
- * `pill` is a segmented control — a rounded tray with the active tab raised.
1174
- * `underline` is the page-level look: a row of tabs under a heading with the
1175
- * active one underscored.
1176
- *
1177
- * Defaults to `pill` because that is what the vendored shadcn TabsList
1178
- * rendered, and eleven apps use `<TabsList>` bare. Defaulting to `underline`
1179
- * would restyle every tab row in the fleet on adoption — a design decision
1180
- * dressed up as a migration. Opt into `underline` per call site.
1181
- */
1182
- variant?: 'pill' | 'underline';
1183
- }
1184
- declare const TabsList: react.ForwardRefExoticComponent<TabsListProps & react.RefAttributes<HTMLDivElement>>;
1171
+ /**
1172
+ * THERE IS ONE TAB LOOK: the segmented pill tray, with the active tab raised
1173
+ * on white.
1174
+ *
1175
+ * There were two. `underline` — a row of tabs under a heading with the active
1176
+ * one underscored — shipped alongside it as an opt-in for page-level strips,
1177
+ * and the fleet answered by never opting in. A sweep found exactly one caller
1178
+ * in one app (pm's Timeline sub-tabs), where its only effect was to make two
1179
+ * of the four strips on those pages disagree with the other two. Nine repos
1180
+ * are not on this package and carry their own vendored pill-only tabs;
1181
+ * master-data's twelve `TabSet` call sites and analytics' two all took the
1182
+ * default. A variant that one screen in the fleet used, and used to look
1183
+ * inconsistent with its neighbours, is not a variant — it is a way to get the
1184
+ * design wrong, so it is gone rather than deprecated.
1185
+ *
1186
+ * `data-variant="pill"` stays on the element. Nothing reads it as a choice any
1187
+ * more, but the stylesheet still selects on it, and rewriting every selector
1188
+ * to drop one attribute would risk the look this change is meant to preserve.
1189
+ */
1190
+ type TabsListProps = React.ComponentPropsWithoutRef<typeof RadixTabs.List>;
1191
+ declare const TabsList: react.ForwardRefExoticComponent<Omit<RadixTabs.TabsListProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
1185
1192
  interface TabsTriggerProps extends React.ComponentPropsWithoutRef<typeof RadixTabs.Trigger> {
1186
1193
  icon?: React.ReactNode;
1187
1194
  /** A count beside the label — rows in the tab, unread items. Hidden at zero. */
@@ -1202,7 +1209,6 @@ interface TabSetProps {
1202
1209
  value?: string;
1203
1210
  onValueChange?: (value: string) => void;
1204
1211
  defaultValue?: string;
1205
- variant?: 'pill' | 'underline';
1206
1212
  className?: string;
1207
1213
  }
1208
1214
  /**
@@ -1215,7 +1221,7 @@ interface TabSetProps {
1215
1221
  * `defaultValue` falls back to the first tab: Radix renders no panel at all
1216
1222
  * when neither is set, which reads as a blank screen.
1217
1223
  */
1218
- declare function TabSet({ tabs, value, onValueChange, defaultValue, variant, className }: TabSetProps): react.JSX.Element;
1224
+ declare function TabSet({ tabs, value, onValueChange, defaultValue, className }: TabSetProps): react.JSX.Element;
1219
1225
 
1220
1226
  interface SeparatorProps extends React.HTMLAttributes<HTMLDivElement> {
1221
1227
  orientation?: 'horizontal' | 'vertical';
package/dist/index.js CHANGED
@@ -1726,19 +1726,19 @@ import { forwardRef as forwardRef15 } from "react";
1726
1726
  import * as RadixTabs from "@radix-ui/react-tabs";
1727
1727
 
1728
1728
  // src/Tabs.css
1729
- 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=underline] {\n gap: var(--cfi-ui-space-md);\n border-bottom: 1px solid var(--cfi-ui-border);\n }\n .cfi-ui-tabs__list[data-variant=underline] .cfi-ui-tabs__trigger {\n padding: 0.5rem 0.125rem;\n border-bottom: 2px solid transparent;\n margin-bottom: -1px;\n }\n .cfi-ui-tabs__list[data-variant=underline] .cfi-ui-tabs__trigger:hover:not(:disabled) {\n color: var(--cfi-ui-content);\n }\n .cfi-ui-tabs__list[data-variant=underline] .cfi-ui-tabs__trigger[data-state=active] {\n color: var(--cfi-ui-content);\n border-bottom-color: var(--cfi-ui-accent);\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");
1729
+ 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");
1730
1730
 
1731
1731
  // src/Tabs.tsx
1732
1732
  import { jsx as jsx22, jsxs as jsxs22 } from "react/jsx-runtime";
1733
1733
  var Tabs = RadixTabs.Root;
1734
1734
  var TabsRoot = RadixTabs.Root;
1735
1735
  var TabsList = forwardRef15(
1736
- function TabsList2({ variant = "pill", className, ...rest }, ref) {
1736
+ function TabsList2({ className, ...rest }, ref) {
1737
1737
  return /* @__PURE__ */ jsx22(
1738
1738
  RadixTabs.List,
1739
1739
  {
1740
1740
  ref,
1741
- "data-variant": variant,
1741
+ "data-variant": "pill",
1742
1742
  className: cn("cfi-ui", "cfi-ui-tabs__list", className),
1743
1743
  ...rest
1744
1744
  }
@@ -1757,7 +1757,7 @@ var TabsTrigger = forwardRef15(
1757
1757
  var TabsContent = forwardRef15(function TabsContent2({ className, ...rest }, ref) {
1758
1758
  return /* @__PURE__ */ jsx22(RadixTabs.Content, { ref, className: cn("cfi-ui-tabs__content", className), ...rest });
1759
1759
  });
1760
- function TabSet({ tabs, value, onValueChange, defaultValue, variant, className }) {
1760
+ function TabSet({ tabs, value, onValueChange, defaultValue, className }) {
1761
1761
  return /* @__PURE__ */ jsxs22(
1762
1762
  Tabs,
1763
1763
  {
@@ -1766,7 +1766,7 @@ function TabSet({ tabs, value, onValueChange, defaultValue, variant, className }
1766
1766
  defaultValue: defaultValue ?? tabs[0]?.value,
1767
1767
  className: cn("cfi-ui", "cfi-ui-tabs", className),
1768
1768
  children: [
1769
- /* @__PURE__ */ jsx22(TabsList, { variant, children: tabs.map((tab) => /* @__PURE__ */ jsx22(
1769
+ /* @__PURE__ */ jsx22(TabsList, { children: tabs.map((tab) => /* @__PURE__ */ jsx22(
1770
1770
  TabsTrigger,
1771
1771
  {
1772
1772
  value: tab.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campfire-interactive/ui",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
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",