import{CodeBlock as o,InstallCommand as i}from"@contractspec/lib.design-system";import a from"@contractspec/lib.ui-link";import{ChevronRight as l}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var r=`import { DataTable } from '@contractspec/lib.ui-kit/ui/data-table';
import { useContractTable } from '@contractspec/lib.presentation-runtime-react';

import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
import {
  ExpandedRowContent,
  ShowcaseToolbar,
} from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';

export function NativeAccountGrid() {
  const columns = useShowcaseColumns();

  const controller = useContractTable({
    data: SHOWCASE_ROWS,
    columns,
    selectionMode: 'single',
    initialState: {
      sorting: [{ id: 'arr', desc: true }],
      pagination: { pageIndex: 0, pageSize: 4 },
      columnVisibility: { notes: false },
      columnPinning: { left: ['account'], right: [] },
    },
    renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
    getCanExpand: () => true,
  });

  return (
    <DataTable
      controller={controller}
      toolbar={
        <ShowcaseToolbar
          controller={controller}
          label="Native primitive"
          primaryColumnId="account"
          toggleColumnId="notes"
          pinColumnId="owner"
          sortColumnIds={['arr', 'renewalDate']}
        />
      }
      loading={false}
      footer={\`Rows \${controller.rows.length}\`}
    />
  );
}`;function s(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit"}),t("p",{className:"text-muted-foreground",children:["Universal UI components for React Native and Web, built on top of",e("code",{children:"nativewind"})," and ",e("code",{children:"@rn-primitives"}),"."]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(i,{package:"@contractspec/lib.ui-kit"})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Key Features"}),t("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:[e("strong",{children:"Universal"}),": Components render natively on iOS/Android and as standard HTML on web"]}),t("li",{children:[e("strong",{children:"Styled with NativeWind"}),": Uses Tailwind CSS classes for styling"]}),t("li",{children:[e("strong",{children:"Accessible"}),": Leverages ",e("code",{children:"@rn-primitives"})," ","(Radix UI for Native)"]}),t("li",{children:[e("strong",{children:"Atomic Design"}),": Exports atoms, molecules, and organisms"]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Data table example"}),t("p",{className:"text-muted-foreground",children:["The canonical"," ",e(a,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"})," ","uses ",e("code",{children:"@contractspec/lib.ui-kit/ui/data-table"})," as the native-first primitive lane. It shares the same controller model as the web renderer while keeping the React Native / Expo surface explicit."]}),e(o,{language:"tsx",code:r})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Core Components"}),t("div",{className:"grid gap-4 md:grid-cols-3",children:[t("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Form Controls"}),t("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"Button"}),e("li",{children:"Input"}),e("li",{children:"Checkbox"}),e("li",{children:"Switch"}),e("li",{children:"Select"})]})]}),t("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Layout"}),t("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"Card"}),e("li",{children:"Stack"}),e("li",{children:"Separator"}),e("li",{children:"Sheet"})]})]}),t("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Feedback"}),t("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"Alert"}),e("li",{children:"Skeleton"}),e("li",{children:"Progress"}),e("li",{children:"Tooltip"})]})]})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[e(a,{href:"/docs/libraries/schema",className:"btn-ghost",children:"Previous: Schema"}),t(a,{href:"/docs/libraries/ui-kit-web",className:"btn-primary",children:["Next: UI Kit Web ",e(l,{size:16})]})]})]})}export{s as LibrariesUIKitPage};
