@blakesteve/roster 4.0.0 → 4.1.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.
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Label and value pairs: a spec sheet, a metadata panel, a case study sidebar.
3
+ *
4
+ * `sm` is the default because this component's usual home is a sidebar panel,
5
+ * where the list is reference material rather than reading material.
6
+ */
7
+ export declare const descriptionListVariants: (props?: ({
8
+ layout?: "split" | "inline" | "stacked" | null | undefined;
9
+ size?: "sm" | "md" | null | undefined;
10
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -0,0 +1,22 @@
1
+ import { default as React } from 'react';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { pullquoteVariants } from './pullquote-variants';
4
+ export interface PullquoteProps extends Omit<React.HTMLAttributes<HTMLElement>, "cite">, VariantProps<typeof pullquoteVariants> {
5
+ children: React.ReactNode;
6
+ /**
7
+ * Attribution, rendered beneath the quote. Works as a source ("Why it took a
8
+ * while to spot") as well as a speaker.
9
+ */
10
+ cite?: React.ReactNode;
11
+ /** URL for the quote's source, passed to the underlying blockquote. */
12
+ citeUrl?: string;
13
+ }
14
+ /**
15
+ * A line lifted out of running prose and given room.
16
+ *
17
+ * Uses `<figure>` + `<blockquote>` + `<figcaption>` rather than a styled div:
18
+ * that is the pairing the HTML spec has for quote-with-attribution, and it
19
+ * keeps the citation associated with the quote for assistive tech.
20
+ */
21
+ declare const Pullquote: React.ForwardRefExoticComponent<PullquoteProps & React.RefAttributes<HTMLElement>>;
22
+ export { Pullquote };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A line lifted out of running prose and given room.
3
+ *
4
+ * The scheme colors the rule only; the quote text stays at full contrast in
5
+ * every case. A pullquote is body copy that has been promoted, and tinting it
6
+ * would demote it again.
7
+ */
8
+ export declare const pullquoteVariants: (props?: ({
9
+ variant?: "rule" | "plain" | "centered" | null | undefined;
10
+ colorScheme?: "primary" | "amber" | "success" | "error" | "neutral" | "current" | null | undefined;
11
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Table-CPAcmkIV.cjs"),j=require("react"),n=require("@tanstack/react-table"),p=n.tableFeatures({rowSortingFeature:n.rowSortingFeature,rowPaginationFeature:n.rowPaginationFeature,sortedRowModel:n.createSortedRowModel(),paginatedRowModel:n.createPaginatedRowModel(),sortFns:n.sortFns});function R({columns:a,data:r,className:i,tableClassName:l,paginationClassName:x,variant:c="default",size:u="md",hoverable:g=!1}){const[m,d]=j.useState([]),t=n.useTable({features:p,data:r,columns:a,onSortingChange:d,state:{sorting:m},initialState:{pagination:{pageIndex:0,pageSize:10}}});return e.jsxRuntimeExports.jsxs("div",{className:e.cn("flex flex-col gap-4",i),children:[e.jsxRuntimeExports.jsxs(e.Table,{variant:c,size:u,hoverable:g,className:l,children:[e.jsxRuntimeExports.jsx(e.TableHeader,{children:t.getHeaderGroups().map(o=>e.jsxRuntimeExports.jsx(e.TableRow,{children:o.headers.map(s=>e.jsxRuntimeExports.jsx(e.TableHead,{children:s.isPlaceholder?null:e.jsxRuntimeExports.jsxs("div",{className:e.cn("flex items-center gap-2 transition-opacity",s.column.getCanSort()&&"cursor-pointer select-none opacity-80 hover:opacity-100"),onClick:s.column.getToggleSortingHandler(),children:[n.flexRender(s.column.columnDef.header,s.getContext()),s.column.getCanSort()&&e.jsxRuntimeExports.jsx("span",{className:"w-4 flex justify-center text-primary-500",children:s.column.getIsSorted()==="asc"?e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faCaretUp}):s.column.getIsSorted()==="desc"?e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faCaretDown}):null})]})},s.id))},o.id))}),e.jsxRuntimeExports.jsx(e.TableBody,{children:t.getRowModel().rows?.length?t.getRowModel().rows.map(o=>e.jsxRuntimeExports.jsx(e.TableRow,{children:o.getAllCells().map(s=>e.jsxRuntimeExports.jsx(e.TableCell,{children:n.flexRender(s.column.columnDef.cell,s.getContext())},s.id))},o.id)):e.jsxRuntimeExports.jsx(e.TableRow,{children:e.jsxRuntimeExports.jsx(e.TableCell,{colSpan:a.length,className:"h-24 text-center text-gray-500 dark:text-gray-400 italic",children:"No results found."})})})]}),e.jsxRuntimeExports.jsxs("div",{className:e.cn("flex flex-col sm:flex-row items-center justify-between gap-4 px-2",x),children:[e.jsxRuntimeExports.jsxs("div",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:["Page"," ",e.jsxRuntimeExports.jsx("strong",{className:"text-gray-900 dark:text-gray-100",children:t.state.pagination.pageIndex+1})," ","of"," ",e.jsxRuntimeExports.jsx("strong",{className:"text-gray-900 dark:text-gray-100",children:t.getPageCount()})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),"aria-label":"Go to first page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAnglesLeft})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),"aria-label":"Go to previous page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAngleLeft})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),"aria-label":"Go to next page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAngleRight})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),"aria-label":"Go to last page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAnglesRight})})]})]})]})}exports.DataTable=R;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Table-DN9b_g1N.cjs"),j=require("react"),n=require("@tanstack/react-table"),p=n.tableFeatures({rowSortingFeature:n.rowSortingFeature,rowPaginationFeature:n.rowPaginationFeature,sortedRowModel:n.createSortedRowModel(),paginatedRowModel:n.createPaginatedRowModel(),sortFns:n.sortFns});function R({columns:a,data:r,className:i,tableClassName:l,paginationClassName:x,variant:c="default",size:u="md",hoverable:g=!1}){const[m,d]=j.useState([]),t=n.useTable({features:p,data:r,columns:a,onSortingChange:d,state:{sorting:m},initialState:{pagination:{pageIndex:0,pageSize:10}}});return e.jsxRuntimeExports.jsxs("div",{className:e.cn("flex flex-col gap-4",i),children:[e.jsxRuntimeExports.jsxs(e.Table,{variant:c,size:u,hoverable:g,className:l,children:[e.jsxRuntimeExports.jsx(e.TableHeader,{children:t.getHeaderGroups().map(o=>e.jsxRuntimeExports.jsx(e.TableRow,{children:o.headers.map(s=>e.jsxRuntimeExports.jsx(e.TableHead,{children:s.isPlaceholder?null:e.jsxRuntimeExports.jsxs("div",{className:e.cn("flex items-center gap-2 transition-opacity",s.column.getCanSort()&&"cursor-pointer select-none opacity-80 hover:opacity-100"),onClick:s.column.getToggleSortingHandler(),children:[n.flexRender(s.column.columnDef.header,s.getContext()),s.column.getCanSort()&&e.jsxRuntimeExports.jsx("span",{className:"w-4 flex justify-center text-primary-500",children:s.column.getIsSorted()==="asc"?e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faCaretUp}):s.column.getIsSorted()==="desc"?e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faCaretDown}):null})]})},s.id))},o.id))}),e.jsxRuntimeExports.jsx(e.TableBody,{children:t.getRowModel().rows?.length?t.getRowModel().rows.map(o=>e.jsxRuntimeExports.jsx(e.TableRow,{children:o.getAllCells().map(s=>e.jsxRuntimeExports.jsx(e.TableCell,{children:n.flexRender(s.column.columnDef.cell,s.getContext())},s.id))},o.id)):e.jsxRuntimeExports.jsx(e.TableRow,{children:e.jsxRuntimeExports.jsx(e.TableCell,{colSpan:a.length,className:"h-24 text-center text-gray-500 dark:text-gray-400 italic",children:"No results found."})})})]}),e.jsxRuntimeExports.jsxs("div",{className:e.cn("flex flex-col sm:flex-row items-center justify-between gap-4 px-2",x),children:[e.jsxRuntimeExports.jsxs("div",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:["Page"," ",e.jsxRuntimeExports.jsx("strong",{className:"text-gray-900 dark:text-gray-100",children:t.state.pagination.pageIndex+1})," ","of"," ",e.jsxRuntimeExports.jsx("strong",{className:"text-gray-900 dark:text-gray-100",children:t.getPageCount()})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),"aria-label":"Go to first page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAnglesLeft})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),"aria-label":"Go to previous page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAngleLeft})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),"aria-label":"Go to next page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAngleRight})}),e.jsxRuntimeExports.jsx(e.Button,{variant:"outline",colorScheme:"neutral",size:"sm",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),"aria-label":"Go to last page",children:e.jsxRuntimeExports.jsx(e.FontAwesomeIcon,{icon:e.faAnglesRight})})]})]})]})}exports.DataTable=R;
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { q as e, T as C, a0 as S, a1 as o, _ as P, F as s, a9 as v, aa as w, v as i, U as y, X as c, N as l, ab as N, ac as R, ad as T, ae as k } from "./Table-CG6Z6c1A.js";
2
+ import { q as e, U as C, a1 as S, a2 as o, a0 as P, F as s, aa as v, ab as w, v as i, W as y, Z as c, G as l, ac as N, ad as R, ae as T, af as k } from "./Table-DNbzjCZM.js";
3
3
  import { useState as F } from "react";
4
- import { tableFeatures as I, sortFns as A, rowPaginationFeature as M, rowSortingFeature as z, createPaginatedRowModel as D, createSortedRowModel as G, useTable as H, flexRender as g } from "@tanstack/react-table";
4
+ import { tableFeatures as I, sortFns as A, rowPaginationFeature as M, rowSortingFeature as z, createPaginatedRowModel as G, createSortedRowModel as D, useTable as H, flexRender as g } from "@tanstack/react-table";
5
5
  const B = I({
6
6
  rowSortingFeature: z,
7
7
  rowPaginationFeature: M,
8
- sortedRowModel: G(),
9
- paginatedRowModel: D(),
8
+ sortedRowModel: D(),
9
+ paginatedRowModel: G(),
10
10
  // The whole built-in registry, not a subset: DataTable is generic over
11
11
  // consumer data, so auto sort detection has to be able to reach any of them.
12
12
  sortFns: A
@@ -0,0 +1,39 @@
1
+ export interface UseKeySequenceOptions {
2
+ /**
3
+ * Milliseconds allowed between keys before progress resets. Without this a
4
+ * sequence can be completed across an arbitrarily long span, which is rarely
5
+ * what anyone means. Set to 0 to disable the timeout entirely.
6
+ */
7
+ timeout?: number;
8
+ /** Match keys case-insensitively. On by default: users hold shift by accident. */
9
+ ignoreCase?: boolean;
10
+ /** Calls preventDefault on keys that advance the sequence. */
11
+ preventDefault?: boolean;
12
+ /** Turns the listener off without unmounting the component. */
13
+ enabled?: boolean;
14
+ /**
15
+ * Ignore keystrokes typed into inputs, textareas, and contenteditable.
16
+ * On by default: a shortcut that fires while someone is filling in a form is
17
+ * a bug, not a feature.
18
+ */
19
+ ignoreWhenTyping?: boolean;
20
+ }
21
+ /** The Konami code, for the one time in your life you need it. */
22
+ export declare const KONAMI_CODE: readonly ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a", "Enter"];
23
+ /**
24
+ * Fires `onMatch` when a sequence of `KeyboardEvent.key` values is typed in
25
+ * order.
26
+ *
27
+ * Useful for keyboard navigation chords (`g` then `i`), debug shortcuts, and
28
+ * easter eggs. Call it more than once to register more than one sequence.
29
+ *
30
+ * ```tsx
31
+ * useKeySequence(["g", "i"], () => router.push("/inbox"));
32
+ * useKeySequence(KONAMI_CODE, () => setPartyMode(true));
33
+ * ```
34
+ *
35
+ * A wrong key resets progress, except when that key is itself the start of the
36
+ * sequence, which begins a fresh attempt rather than costing one. That is what
37
+ * makes a doubled first key ("g g i") still work.
38
+ */
39
+ export declare function useKeySequence(sequence: readonly string[], onMatch: () => void, options?: UseKeySequenceOptions): void;
package/dist/index.d.ts CHANGED
@@ -17,6 +17,14 @@ export * from './components/atoms/Link/link-variants';
17
17
  export * from './components/atoms/PasswordInput/PasswordInput';
18
18
  export * from './components/atoms/Pill/Pill';
19
19
  export * from './components/atoms/Pill/pill-variants';
20
+ export * from './components/atoms/Eyebrow/Eyebrow';
21
+ export * from './components/atoms/Eyebrow/eyebrow-variants';
22
+ export * from './components/atoms/InlineCode/InlineCode';
23
+ export * from './components/atoms/InlineCode/inline-code-variants';
24
+ export * from './components/atoms/LabeledDivider/LabeledDivider';
25
+ export * from './components/atoms/Stat/Stat';
26
+ export * from './components/atoms/Stat/stat-variants';
27
+ export * from './components/atoms/ThemeToggle/ThemeToggle';
20
28
  export * from './components/atoms/Select/Select';
21
29
  export * from './components/atoms/Select/select-variants';
22
30
  export * from './components/atoms/Spinner/Spinner';
@@ -32,6 +40,10 @@ export * from './components/atoms/SegmentBar/SegmentBar';
32
40
  export * from './components/molecules/Alert/Alert';
33
41
  export * from './components/molecules/Alert/alert-variants';
34
42
  export * from './components/molecules/Accordion/Accordion';
43
+ export * from './components/molecules/DescriptionList/DescriptionList';
44
+ export * from './components/molecules/DescriptionList/description-list-variants';
45
+ export * from './components/molecules/Pullquote/Pullquote';
46
+ export * from './components/molecules/Pullquote/pullquote-variants';
35
47
  export * from './components/molecules/Breadcrumbs/Breadcrumbs';
36
48
  export * from './components/molecules/Breadcrumbs/breadcrumb-variants';
37
49
  export * from './components/molecules/CallToAction/CallToAction';
@@ -51,4 +63,5 @@ export * from './components/organisms/Navbar/navbar-variants';
51
63
  export * from './components/organisms/Table/Table';
52
64
  export * from './components/organisms/Table/table-variants';
53
65
  export * from './hooks/useCountdown';
66
+ export * from './hooks/useKeySequence';
54
67
  export * from './lib/utils';