@catiarodrigues/goldfinch 1.0.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/LICENSE +15 -0
- package/README.md +119 -0
- package/dist/alert-Iba34Kfr.js +72 -0
- package/dist/badge-dMKK_Gm2.js +147 -0
- package/dist/breadcrumbs-CHev-E0K.js +148 -0
- package/dist/button-DDhP5P56.js +40 -0
- package/dist/card-CVUWZOar.js +42 -0
- package/dist/checkbox-BubMDtGW.js +149 -0
- package/dist/collapsible-Bk5IP_KI.js +55 -0
- package/dist/components/alert.mjs +2 -0
- package/dist/components/badge.mjs +2 -0
- package/dist/components/breadcrumbs.mjs +2 -0
- package/dist/components/button.mjs +2 -0
- package/dist/components/card.mjs +2 -0
- package/dist/components/checkbox.mjs +2 -0
- package/dist/components/collapsible.mjs +2 -0
- package/dist/components/copy-to-clipboard.mjs +2 -0
- package/dist/components/dropdown.mjs +2 -0
- package/dist/components/empty-state.mjs +2 -0
- package/dist/components/field.mjs +2 -0
- package/dist/components/grid.mjs +2 -0
- package/dist/components/input-group.mjs +2 -0
- package/dist/components/input.mjs +4 -0
- package/dist/components/label.mjs +2 -0
- package/dist/components/link.mjs +58 -0
- package/dist/components/menubar.mjs +2 -0
- package/dist/components/modal.mjs +2 -0
- package/dist/components/page.mjs +2 -0
- package/dist/components/pagination.mjs +2 -0
- package/dist/components/popover.mjs +2 -0
- package/dist/components/progress.mjs +2 -0
- package/dist/components/radio.mjs +2 -0
- package/dist/components/select.mjs +2 -0
- package/dist/components/sensitive-input.mjs +2 -0
- package/dist/components/sidebar.mjs +2 -0
- package/dist/components/spinner.mjs +3 -0
- package/dist/components/table-of-contents.mjs +2 -0
- package/dist/components/table.mjs +2 -0
- package/dist/components/tabs.mjs +2 -0
- package/dist/components/text.mjs +2 -0
- package/dist/components/toast.mjs +2 -0
- package/dist/components/toggle.mjs +2 -0
- package/dist/components/toolbar.mjs +2 -0
- package/dist/components/tooltip.mjs +2 -0
- package/dist/components/top-navigation.mjs +2 -0
- package/dist/copy-to-clipboard-KXU8jo6k.js +139 -0
- package/dist/dropdown-A5hLlUjr.js +172 -0
- package/dist/empty-state-DuugAIN_.js +76 -0
- package/dist/field-CZb7PLTY.js +47 -0
- package/dist/grid-BFkQ5cmR.js +101 -0
- package/dist/index.mjs +47 -0
- package/dist/input-6C_-SelY.js +48 -0
- package/dist/input-Bo8XL6_f.js +43 -0
- package/dist/input-group-Dm4hKEhq.js +302 -0
- package/dist/input-variants-CZevxTd8.js +41 -0
- package/dist/label-7oCakbyx.js +43 -0
- package/dist/link-provider-H0J4aZPH.js +21 -0
- package/dist/menubar-DyXmaeKZ.js +59 -0
- package/dist/modal-BYQ8MRMy.js +132 -0
- package/dist/page-DOevDFqd.js +60 -0
- package/dist/pagination-C3f16UOC.js +239 -0
- package/dist/popover-3kcRy9HX.js +120 -0
- package/dist/portal-provider-CWX8j9O1.js +15 -0
- package/dist/progress-Ac96hU_C.js +26 -0
- package/dist/radio-C8rcmsbS.js +144 -0
- package/dist/resolve-variant-DWiDeQhX.js +7 -0
- package/dist/select-DaJRanrs.js +178 -0
- package/dist/sensitive-input-BEAOu1A6.js +181 -0
- package/dist/sidebar-CkZxFt33.js +703 -0
- package/dist/skeleton-line-Dh4TDbeq.js +32 -0
- package/dist/spinner-DKzSES7b.js +79 -0
- package/dist/src/components/alert/alert.d.ts +105 -0
- package/dist/src/components/alert/index.d.ts +1 -0
- package/dist/src/components/badge/badge.d.ts +204 -0
- package/dist/src/components/badge/index.d.ts +1 -0
- package/dist/src/components/breadcrumbs/breadcrumbs.d.ts +94 -0
- package/dist/src/components/breadcrumbs/index.d.ts +1 -0
- package/dist/src/components/button/button.d.ts +37 -0
- package/dist/src/components/button/index.d.ts +2 -0
- package/dist/src/components/card/card.d.ts +31 -0
- package/dist/src/components/card/index.d.ts +1 -0
- package/dist/src/components/checkbox/checkbox.d.ts +196 -0
- package/dist/src/components/checkbox/index.d.ts +1 -0
- package/dist/src/components/collapsible/collapsible.d.ts +108 -0
- package/dist/src/components/collapsible/index.d.ts +1 -0
- package/dist/src/components/copy-to-clipboard/copy-to-clipboard.d.ts +86 -0
- package/dist/src/components/copy-to-clipboard/index.d.ts +1 -0
- package/dist/src/components/dropdown/dropdown.d.ts +115 -0
- package/dist/src/components/dropdown/index.d.ts +1 -0
- package/dist/src/components/empty-state/empty-state.d.ts +68 -0
- package/dist/src/components/empty-state/index.d.ts +1 -0
- package/dist/src/components/field/field.d.ts +88 -0
- package/dist/src/components/field/index.d.ts +1 -0
- package/dist/src/components/grid/grid.d.ts +134 -0
- package/dist/src/components/grid/index.d.ts +1 -0
- package/dist/src/components/input/index.d.ts +30 -0
- package/dist/src/components/input/input-area.d.ts +64 -0
- package/dist/src/components/input/input-variants.d.ts +58 -0
- package/dist/src/components/input/input.d.ts +67 -0
- package/dist/src/components/input-group/context.d.ts +95 -0
- package/dist/src/components/input-group/index.d.ts +1 -0
- package/dist/src/components/input-group/input-group-addon.d.ts +14 -0
- package/dist/src/components/input-group/input-group-button.d.ts +35 -0
- package/dist/src/components/input-group/input-group-input.d.ts +8 -0
- package/dist/src/components/input-group/input-group-suffix.d.ts +12 -0
- package/dist/src/components/input-group/input-group.d.ts +42 -0
- package/dist/src/components/label/index.d.ts +1 -0
- package/dist/src/components/label/label.d.ts +66 -0
- package/dist/src/components/link/index.d.ts +1 -0
- package/dist/src/components/link/link.d.ts +65 -0
- package/dist/src/components/menubar/index.d.ts +2 -0
- package/dist/src/components/menubar/menubar.d.ts +65 -0
- package/dist/src/components/menubar/use-menu-navigation.d.ts +7 -0
- package/dist/src/components/modal/index.d.ts +1 -0
- package/dist/src/components/modal/modal.d.ts +204 -0
- package/dist/src/components/page/index.d.ts +1 -0
- package/dist/src/components/page/page.d.ts +65 -0
- package/dist/src/components/pagination/index.d.ts +1 -0
- package/dist/src/components/pagination/pagination.d.ts +240 -0
- package/dist/src/components/popover/index.d.ts +2 -0
- package/dist/src/components/popover/popover.d.ts +177 -0
- package/dist/src/components/progress/index.d.ts +1 -0
- package/dist/src/components/progress/progress.d.ts +43 -0
- package/dist/src/components/radio/index.d.ts +1 -0
- package/dist/src/components/radio/radio.d.ts +276 -0
- package/dist/src/components/select/index.d.ts +1 -0
- package/dist/src/components/select/select.d.ts +283 -0
- package/dist/src/components/sensitive-input/index.d.ts +1 -0
- package/dist/src/components/sensitive-input/sensitive-input.d.ts +93 -0
- package/dist/src/components/sidebar/index.d.ts +1 -0
- package/dist/src/components/sidebar/sidebar.d.ts +579 -0
- package/dist/src/components/spinner/index.d.ts +2 -0
- package/dist/src/components/spinner/skeleton-line.d.ts +11 -0
- package/dist/src/components/spinner/spinner.d.ts +69 -0
- package/dist/src/components/table/index.d.ts +1 -0
- package/dist/src/components/table/table.d.ts +137 -0
- package/dist/src/components/table-of-contents/index.d.ts +1 -0
- package/dist/src/components/table-of-contents/table-of-contents.d.ts +71 -0
- package/dist/src/components/tabs/index.d.ts +2 -0
- package/dist/src/components/tabs/tabs.d.ts +115 -0
- package/dist/src/components/text/index.d.ts +1 -0
- package/dist/src/components/text/text.d.ts +213 -0
- package/dist/src/components/toast/index.d.ts +4 -0
- package/dist/src/components/toast/toast.d.ts +196 -0
- package/dist/src/components/toggle/index.d.ts +1 -0
- package/dist/src/components/toggle/toggle.d.ts +101 -0
- package/dist/src/components/toolbar/index.d.ts +1 -0
- package/dist/src/components/toolbar/toolbar.d.ts +49 -0
- package/dist/src/components/tooltip/index.d.ts +1 -0
- package/dist/src/components/tooltip/tooltip.d.ts +107 -0
- package/dist/src/components/top-navigation/index.d.ts +1 -0
- package/dist/src/components/top-navigation/top-navigation.d.ts +47 -0
- package/dist/src/index.d.ts +67 -0
- package/dist/src/utils/cn.d.ts +3 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/link-provider.d.ts +11 -0
- package/dist/src/utils/portal-provider.d.ts +7 -0
- package/dist/src/utils/resolve-variant.d.ts +1 -0
- package/dist/styles/index.css +294 -0
- package/dist/table-CKmEd0O5.js +135 -0
- package/dist/table-of-contents-CuE1aDKE.js +91 -0
- package/dist/tabs-JX7xyFcA.js +101 -0
- package/dist/text-B0EvLge5.js +88 -0
- package/dist/toast-pSr7cFVU.js +274 -0
- package/dist/toggle-C72Skv4q.js +179 -0
- package/dist/toolbar-DtT4MUHB.js +109 -0
- package/dist/tooltip-QfSb4wnI.js +59 -0
- package/dist/top-navigation-DoTeFaXD.js +45 -0
- package/dist/utils.mjs +11 -0
- package/package.json +228 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { CheckboxChangeEventDetails } from '../checkbox';
|
|
2
|
+
/** Table layout and row variant definitions mapping names to their Tailwind classes. */
|
|
3
|
+
export declare const GOLDFINCH_TABLE_VARIANTS: {
|
|
4
|
+
readonly layout: {
|
|
5
|
+
readonly auto: {
|
|
6
|
+
readonly classes: "";
|
|
7
|
+
readonly description: "Auto table layout - columns resize based on content";
|
|
8
|
+
};
|
|
9
|
+
readonly fixed: {
|
|
10
|
+
readonly classes: "table-fixed";
|
|
11
|
+
readonly description: "Fixed table layout - columns have equal width, controlled via colgroup";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly variant: {
|
|
15
|
+
readonly default: {
|
|
16
|
+
readonly classes: "";
|
|
17
|
+
readonly description: "Default row variant";
|
|
18
|
+
};
|
|
19
|
+
readonly selected: {
|
|
20
|
+
readonly classes: "bg-goldfinch-tint";
|
|
21
|
+
readonly description: "Selected row variant";
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
readonly sticky: {
|
|
25
|
+
readonly left: {
|
|
26
|
+
readonly classes: "sticky left-0";
|
|
27
|
+
readonly description: "Pin column to the left edge of the scroll container";
|
|
28
|
+
};
|
|
29
|
+
readonly right: {
|
|
30
|
+
readonly classes: "sticky right-0";
|
|
31
|
+
readonly description: "Pin column to the right edge of the scroll container";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type GoldfinchTableStickyColumn = keyof typeof GOLDFINCH_TABLE_VARIANTS.sticky;
|
|
36
|
+
export declare const GOLDFINCH_TABLE_DEFAULT_VARIANTS: {
|
|
37
|
+
readonly layout: "auto";
|
|
38
|
+
readonly variant: "default";
|
|
39
|
+
};
|
|
40
|
+
export type GoldfinchTableRowVariant = keyof typeof GOLDFINCH_TABLE_VARIANTS.variant;
|
|
41
|
+
export type GoldfinchTableLayout = keyof typeof GOLDFINCH_TABLE_VARIANTS.layout;
|
|
42
|
+
/**
|
|
43
|
+
* Table — semantic HTML table with styled rows, cells, and selection support.
|
|
44
|
+
*
|
|
45
|
+
* Compound component: `Table` (Root), `.Header`, `.Head`, `.Body`, `.Row`,
|
|
46
|
+
* `.Cell`, `.Footer`, `.CheckCell`, `.CheckHead`, `.ResizeHandle`.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Table>
|
|
51
|
+
* <Table.Header>
|
|
52
|
+
* <Table.Row>
|
|
53
|
+
* <Table.CheckHead checked={allSelected} onCheckedChange={toggleAll} />
|
|
54
|
+
* <Table.Head>Name</Table.Head>
|
|
55
|
+
* </Table.Row>
|
|
56
|
+
* </Table.Header>
|
|
57
|
+
* <Table.Body>
|
|
58
|
+
* {rows.map((row) => (
|
|
59
|
+
* <Table.Row key={row.id} variant={selected.has(row.id) ? "selected" : "default"}>
|
|
60
|
+
* <Table.CheckCell checked={selected.has(row.id)} onCheckedChange={() => toggle(row.id)} />
|
|
61
|
+
* <Table.Cell>{row.name}</Table.Cell>
|
|
62
|
+
* </Table.Row>
|
|
63
|
+
* ))}
|
|
64
|
+
* </Table.Body>
|
|
65
|
+
* </Table>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare const Table: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLTableElement> & {
|
|
69
|
+
/**
|
|
70
|
+
* Table layout algorithm.
|
|
71
|
+
* - `"auto"` — columns resize based on content
|
|
72
|
+
* - `"fixed"` — equal-width columns, controlled via `<colgroup>`
|
|
73
|
+
* @default "auto"
|
|
74
|
+
*/
|
|
75
|
+
layout?: GoldfinchTableLayout;
|
|
76
|
+
} & import('react').RefAttributes<HTMLTableElement>> & {
|
|
77
|
+
Header: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLTableSectionElement> & {
|
|
78
|
+
variant?: "default" | "compact";
|
|
79
|
+
/**
|
|
80
|
+
* Make the header row stick to the top of the scroll container.
|
|
81
|
+
* Requires the table's parent to have a constrained height with
|
|
82
|
+
* `overflow-y: auto`.
|
|
83
|
+
*/
|
|
84
|
+
sticky?: boolean;
|
|
85
|
+
} & import('react').RefAttributes<HTMLTableSectionElement>>;
|
|
86
|
+
Head: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLTableCellElement> & {
|
|
87
|
+
/**
|
|
88
|
+
* Pin this header cell to the left or right edge of the scroll container.
|
|
89
|
+
* Adds `position: sticky`, an opaque background, and a gradient fade on the
|
|
90
|
+
* inner edge. Sticky header columns render at `z-2` so they sit above both
|
|
91
|
+
* normal cells and sticky body cells (`z-1`).
|
|
92
|
+
*/
|
|
93
|
+
sticky?: GoldfinchTableStickyColumn;
|
|
94
|
+
} & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
95
|
+
Row: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLTableRowElement> & {
|
|
96
|
+
variant?: GoldfinchTableRowVariant;
|
|
97
|
+
} & import('react').RefAttributes<HTMLTableRowElement>>;
|
|
98
|
+
Body: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLTableSectionElement> & import('react').RefAttributes<HTMLTableSectionElement>>;
|
|
99
|
+
Cell: import('react').ForwardRefExoticComponent<import('react').TdHTMLAttributes<HTMLTableCellElement> & {
|
|
100
|
+
/**
|
|
101
|
+
* Pin this cell to the left or right edge of the scroll container.
|
|
102
|
+
* Adds `position: sticky`, an opaque background, and a gradient fade on
|
|
103
|
+
* the inner edge. Requires the table's parent to have `overflow-x: auto`.
|
|
104
|
+
*/
|
|
105
|
+
sticky?: GoldfinchTableStickyColumn;
|
|
106
|
+
} & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
107
|
+
CheckCell: import('react').ForwardRefExoticComponent<import('react').TdHTMLAttributes<HTMLTableCellElement> & {
|
|
108
|
+
checked?: boolean;
|
|
109
|
+
indeterminate?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Called when the checkbox's checked state changes. The optional second
|
|
112
|
+
* argument exposes event details from the underlying Checkbox, matching
|
|
113
|
+
* the Checkbox component's signature.
|
|
114
|
+
*/
|
|
115
|
+
onCheckedChange?: (checked: boolean, eventDetails?: CheckboxChangeEventDetails) => void;
|
|
116
|
+
/** @deprecated Use `onCheckedChange` instead. Will be removed in a future major version. */
|
|
117
|
+
onValueChange?: (checked: boolean) => void;
|
|
118
|
+
label?: string;
|
|
119
|
+
disabled?: boolean;
|
|
120
|
+
} & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
121
|
+
CheckHead: import('react').ForwardRefExoticComponent<import('react').ThHTMLAttributes<HTMLTableCellElement> & {
|
|
122
|
+
checked?: boolean;
|
|
123
|
+
indeterminate?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Called when the checkbox's checked state changes. The optional second
|
|
126
|
+
* argument exposes event details from the underlying Checkbox, matching
|
|
127
|
+
* the Checkbox component's signature.
|
|
128
|
+
*/
|
|
129
|
+
onCheckedChange?: (checked: boolean, eventDetails?: CheckboxChangeEventDetails) => void;
|
|
130
|
+
/** @deprecated Use `onCheckedChange` instead. Will be removed in a future major version. */
|
|
131
|
+
onValueChange?: (checked: boolean) => void;
|
|
132
|
+
label?: string;
|
|
133
|
+
disabled?: boolean;
|
|
134
|
+
} & import('react').RefAttributes<HTMLTableCellElement>>;
|
|
135
|
+
Footer: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLTableSectionElement> & import('react').RefAttributes<HTMLTableSectionElement>>;
|
|
136
|
+
ResizeHandle: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLButtonElement> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
137
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableOfContents, type TableOfContentsProps, type TableOfContentsTitleProps, type TableOfContentsListProps, type TableOfContentsItemProps, type TableOfContentsGroupProps, GOLDFINCH_TABLE_OF_CONTENTS_VARIANTS, GOLDFINCH_TABLE_OF_CONTENTS_DEFAULT_VARIANTS, type GoldfinchTableOfContentsState, } from './table-of-contents';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/** TableOfContents item state variant definitions. */
|
|
2
|
+
export declare const GOLDFINCH_TABLE_OF_CONTENTS_VARIANTS: {
|
|
3
|
+
readonly state: {
|
|
4
|
+
readonly default: {
|
|
5
|
+
readonly classes: "text-goldfinch-subtle hover:border-goldfinch-line hover:text-goldfinch-default hover:font-medium";
|
|
6
|
+
readonly description: "Inactive section link";
|
|
7
|
+
};
|
|
8
|
+
readonly active: {
|
|
9
|
+
readonly classes: "border-goldfinch-brand font-medium text-goldfinch-default";
|
|
10
|
+
readonly description: "Currently visible / active section";
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const GOLDFINCH_TABLE_OF_CONTENTS_DEFAULT_VARIANTS: {
|
|
15
|
+
readonly state: "default";
|
|
16
|
+
};
|
|
17
|
+
export type GoldfinchTableOfContentsState = keyof typeof GOLDFINCH_TABLE_OF_CONTENTS_VARIANTS.state;
|
|
18
|
+
export type TableOfContentsProps = React.HTMLAttributes<HTMLElement>;
|
|
19
|
+
export type TableOfContentsTitleProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
20
|
+
export type TableOfContentsListProps = React.HTMLAttributes<HTMLUListElement>;
|
|
21
|
+
export interface TableOfContentsItemProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
22
|
+
/** Whether this item represents the currently active section. */
|
|
23
|
+
active?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Custom element to render as the link. Use this to integrate with
|
|
26
|
+
* framework routers (e.g., Next.js `<Link>`, React Router `<NavLink>`).
|
|
27
|
+
* The element receives all anchor props including `href`, `className`, and `children`.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <TableOfContents.Item render={<Link />} href="/intro" active>
|
|
32
|
+
* Introduction
|
|
33
|
+
* </TableOfContents.Item>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
render?: React.ReactElement;
|
|
37
|
+
}
|
|
38
|
+
export interface TableOfContentsGroupProps extends Omit<React.HTMLAttributes<HTMLLIElement>, "title"> {
|
|
39
|
+
/** Label displayed above the group's items. */
|
|
40
|
+
label: string;
|
|
41
|
+
/** URL the group label links to. When provided, the label renders as a clickable link with item styling. */
|
|
42
|
+
href?: string;
|
|
43
|
+
/** Whether this group's label represents the currently active section. Only applies when `href` is provided. */
|
|
44
|
+
active?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* TableOfContents — presentational compound component for section navigation.
|
|
48
|
+
*
|
|
49
|
+
* Purely visual; all interaction logic (scroll tracking, active state management)
|
|
50
|
+
* is left to the consumer.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <TableOfContents>
|
|
55
|
+
* <TableOfContents.Title>On this page</TableOfContents.Title>
|
|
56
|
+
* <TableOfContents.List>
|
|
57
|
+
* <TableOfContents.Item href="#intro" active>Introduction</TableOfContents.Item>
|
|
58
|
+
* <TableOfContents.Group label="Getting Started">
|
|
59
|
+
* <TableOfContents.Item href="#install">Installation</TableOfContents.Item>
|
|
60
|
+
* <TableOfContents.Item href="#setup">Setup</TableOfContents.Item>
|
|
61
|
+
* </TableOfContents.Group>
|
|
62
|
+
* </TableOfContents.List>
|
|
63
|
+
* </TableOfContents>
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare const TableOfContents: import('react').ForwardRefExoticComponent<TableOfContentsProps & import('react').RefAttributes<HTMLElement>> & {
|
|
67
|
+
Title: import('react').ForwardRefExoticComponent<TableOfContentsTitleProps & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
68
|
+
List: import('react').ForwardRefExoticComponent<TableOfContentsListProps & import('react').RefAttributes<HTMLUListElement>>;
|
|
69
|
+
Item: import('react').ForwardRefExoticComponent<TableOfContentsItemProps & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
70
|
+
Group: import('react').ForwardRefExoticComponent<TableOfContentsGroupProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
71
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TabsTab } from '@base-ui/react/tabs';
|
|
3
|
+
/** Tabs variant definitions. */
|
|
4
|
+
export declare const GOLDFINCH_TABS_VARIANTS: {
|
|
5
|
+
readonly variant: readonly ["segmented", "underline"];
|
|
6
|
+
readonly size: readonly ["base", "sm"];
|
|
7
|
+
};
|
|
8
|
+
export declare const GOLDFINCH_TABS_DEFAULT_VARIANTS: {
|
|
9
|
+
readonly variant: "segmented";
|
|
10
|
+
readonly size: "base";
|
|
11
|
+
};
|
|
12
|
+
export declare const GOLDFINCH_TABS_STYLING: {
|
|
13
|
+
readonly container: {
|
|
14
|
+
readonly height: 34;
|
|
15
|
+
readonly borderRadius: 8;
|
|
16
|
+
readonly background: "color-accent";
|
|
17
|
+
readonly padding: 1;
|
|
18
|
+
};
|
|
19
|
+
readonly tab: {
|
|
20
|
+
readonly paddingX: 10;
|
|
21
|
+
readonly verticalMargin: 1;
|
|
22
|
+
readonly fontSize: 16;
|
|
23
|
+
readonly fontWeight: 500;
|
|
24
|
+
readonly borderRadius: 8;
|
|
25
|
+
readonly activeColor: "text-color-surface";
|
|
26
|
+
readonly inactiveColor: "text-color-label";
|
|
27
|
+
};
|
|
28
|
+
readonly indicator: {
|
|
29
|
+
readonly background: "color-surface-secondary";
|
|
30
|
+
readonly ring: "color-color-2";
|
|
31
|
+
readonly borderRadius: 6;
|
|
32
|
+
readonly shadow: "shadow-sm";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export interface GoldfinchTabsVariantsProps {
|
|
36
|
+
/**
|
|
37
|
+
* Tab style.
|
|
38
|
+
* - `"segmented"` — Pill-shaped indicator on a filled track
|
|
39
|
+
* - `"underline"` — Underline indicator below tab text
|
|
40
|
+
* @default "segmented"
|
|
41
|
+
*/
|
|
42
|
+
variant?: (typeof GOLDFINCH_TABS_VARIANTS.variant)[number];
|
|
43
|
+
/**
|
|
44
|
+
* Tab size.
|
|
45
|
+
* - `"base"` — Default size (h-9, text-base)
|
|
46
|
+
* - `"sm"` — Compact size (h-6.5, text-xs) — matches Input size="sm"
|
|
47
|
+
* @default "base"
|
|
48
|
+
*/
|
|
49
|
+
size?: (typeof GOLDFINCH_TABS_VARIANTS.size)[number];
|
|
50
|
+
}
|
|
51
|
+
/** Configuration for a single tab within the Tabs component. */
|
|
52
|
+
export type TabsItem = {
|
|
53
|
+
/** Unique identifier for the tab, used as the controlled value. */
|
|
54
|
+
value: string;
|
|
55
|
+
/** Display content for the tab trigger. */
|
|
56
|
+
label: ReactNode;
|
|
57
|
+
/** Additional CSS classes for this tab trigger. */
|
|
58
|
+
className?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Custom render function or element to replace the tab element (e.g. for link-based tabs).
|
|
61
|
+
* When using a function, it receives the props to spread on the element and the tab's state.
|
|
62
|
+
*/
|
|
63
|
+
render?: TabsTab.Props["render"];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Tabs component props.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* <Tabs
|
|
71
|
+
* tabs={[
|
|
72
|
+
* { value: "overview", label: "Overview" },
|
|
73
|
+
* { value: "settings", label: "Settings" },
|
|
74
|
+
* ]}
|
|
75
|
+
* value={activeTab}
|
|
76
|
+
* onValueChange={setActiveTab}
|
|
77
|
+
* />
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export type TabsProps = GoldfinchTabsVariantsProps & {
|
|
81
|
+
/** Array of tab items to render. */
|
|
82
|
+
tabs?: TabsItem[];
|
|
83
|
+
/** Controlled value. When set, component becomes controlled. */
|
|
84
|
+
value?: string;
|
|
85
|
+
/** Default selected value for uncontrolled mode. Ignored when `value` is set. */
|
|
86
|
+
selectedValue?: string;
|
|
87
|
+
/** Callback fired when the active tab changes. */
|
|
88
|
+
onValueChange?: (value: string) => void;
|
|
89
|
+
/**
|
|
90
|
+
* When `true`, tabs are activated immediately upon receiving focus via arrow keys.
|
|
91
|
+
* When `false` (default), tabs receive focus but require Enter/Space to activate.
|
|
92
|
+
*/
|
|
93
|
+
activateOnFocus?: boolean;
|
|
94
|
+
/** Additional CSS classes for the root element. */
|
|
95
|
+
className?: string;
|
|
96
|
+
/** Additional CSS classes for the tab list element. */
|
|
97
|
+
listClassName?: string;
|
|
98
|
+
/** Additional CSS classes for the indicator element. */
|
|
99
|
+
indicatorClassName?: string;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Tab navigation component with segmented or underline style.
|
|
103
|
+
* Built on Base UI Tabs with animated active indicator.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* <Tabs
|
|
108
|
+
* variant="segmented"
|
|
109
|
+
* tabs={[{ value: "tab1", label: "Tab 1" }, { value: "tab2", label: "Tab 2" }]}
|
|
110
|
+
* value={active}
|
|
111
|
+
* onValueChange={setActive}
|
|
112
|
+
* />
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare function Tabs({ tabs, value, selectedValue, onValueChange, activateOnFocus, className, listClassName, indicatorClassName, variant, size, }: TabsProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Text } from './text';
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { CSSProperties, ComponentPropsWithoutRef, ElementRef, ForwardedRef } from 'react';
|
|
2
|
+
/** Text variant and size definitions mapping names to their Tailwind classes. */
|
|
3
|
+
export declare const GOLDFINCH_TEXT_VARIANTS: {
|
|
4
|
+
readonly variant: {
|
|
5
|
+
readonly heading1: {
|
|
6
|
+
readonly classes: "text-3xl font-semibold";
|
|
7
|
+
readonly description: "Large heading for page titles";
|
|
8
|
+
};
|
|
9
|
+
readonly heading2: {
|
|
10
|
+
readonly classes: "text-2xl font-semibold";
|
|
11
|
+
readonly description: "Medium heading for section titles";
|
|
12
|
+
};
|
|
13
|
+
readonly heading3: {
|
|
14
|
+
readonly classes: "text-lg font-semibold";
|
|
15
|
+
readonly description: "Small heading for subsections";
|
|
16
|
+
};
|
|
17
|
+
readonly body: {
|
|
18
|
+
readonly classes: "text-goldfinch-default";
|
|
19
|
+
readonly description: "Default body text";
|
|
20
|
+
};
|
|
21
|
+
readonly secondary: {
|
|
22
|
+
readonly classes: "text-goldfinch-subtle";
|
|
23
|
+
readonly description: "Muted text for secondary information";
|
|
24
|
+
};
|
|
25
|
+
readonly success: {
|
|
26
|
+
readonly classes: "text-goldfinch-link";
|
|
27
|
+
readonly description: "Success state text";
|
|
28
|
+
};
|
|
29
|
+
readonly error: {
|
|
30
|
+
readonly classes: "text-goldfinch-danger";
|
|
31
|
+
readonly description: "Error state text";
|
|
32
|
+
};
|
|
33
|
+
readonly mono: {
|
|
34
|
+
readonly classes: "font-mono";
|
|
35
|
+
readonly description: "Monospace text for code";
|
|
36
|
+
};
|
|
37
|
+
readonly "mono-secondary": {
|
|
38
|
+
readonly classes: "font-mono text-goldfinch-subtle";
|
|
39
|
+
readonly description: "Muted monospace text";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly size: {
|
|
43
|
+
readonly xs: {
|
|
44
|
+
readonly classes: "text-xs";
|
|
45
|
+
readonly description: "Extra small text";
|
|
46
|
+
};
|
|
47
|
+
readonly sm: {
|
|
48
|
+
readonly classes: "text-sm";
|
|
49
|
+
readonly description: "Small text";
|
|
50
|
+
};
|
|
51
|
+
readonly base: {
|
|
52
|
+
readonly classes: "text-base";
|
|
53
|
+
readonly description: "Default text size";
|
|
54
|
+
};
|
|
55
|
+
readonly lg: {
|
|
56
|
+
readonly classes: "text-lg";
|
|
57
|
+
readonly description: "Large text";
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export declare const GOLDFINCH_TEXT_DEFAULT_VARIANTS: {
|
|
62
|
+
readonly variant: "body";
|
|
63
|
+
readonly size: "base";
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* GOLDFINCH_TEXT_STYLING - Typography metadata for Figma generator
|
|
67
|
+
*
|
|
68
|
+
* This export provides structured styling information extracted from text.tsx
|
|
69
|
+
* for use by the Figma plugin generator. It documents font sizes, weights,
|
|
70
|
+
* colors, and font families used across all Text variants.
|
|
71
|
+
*
|
|
72
|
+
* Source of truth chain:
|
|
73
|
+
* text.tsx (this file) → component-registry.json → text.ts (Figma generator)
|
|
74
|
+
*/
|
|
75
|
+
export declare const GOLDFINCH_TEXT_STYLING: {
|
|
76
|
+
readonly fontSizes: {
|
|
77
|
+
readonly xs: 12;
|
|
78
|
+
readonly sm: 14;
|
|
79
|
+
readonly base: 16;
|
|
80
|
+
readonly lg: 18;
|
|
81
|
+
readonly xl: 20;
|
|
82
|
+
readonly "2xl": 24;
|
|
83
|
+
readonly "3xl": 30;
|
|
84
|
+
};
|
|
85
|
+
readonly fontWeights: {
|
|
86
|
+
readonly normal: 400;
|
|
87
|
+
readonly medium: 500;
|
|
88
|
+
readonly semibold: 600;
|
|
89
|
+
};
|
|
90
|
+
readonly baseColor: "text-goldfinch-default";
|
|
91
|
+
readonly variantColors: {
|
|
92
|
+
readonly body: "text-goldfinch-default";
|
|
93
|
+
readonly secondary: "text-goldfinch-subtle";
|
|
94
|
+
readonly success: "text-goldfinch-link";
|
|
95
|
+
readonly error: "text-goldfinch-danger";
|
|
96
|
+
readonly mono: "text-goldfinch-default";
|
|
97
|
+
readonly "mono-secondary": "text-goldfinch-subtle";
|
|
98
|
+
};
|
|
99
|
+
readonly fontFamilies: {
|
|
100
|
+
readonly default: "sans-serif";
|
|
101
|
+
readonly mono: "monospace";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
export type GoldfinchTextVariant = keyof typeof GOLDFINCH_TEXT_VARIANTS.variant;
|
|
105
|
+
export type GoldfinchTextSize = keyof typeof GOLDFINCH_TEXT_VARIANTS.size;
|
|
106
|
+
export interface GoldfinchTextVariantsProps {
|
|
107
|
+
variant?: GoldfinchTextVariant;
|
|
108
|
+
size?: GoldfinchTextSize;
|
|
109
|
+
}
|
|
110
|
+
export declare function textVariants({ variant, size, }?: GoldfinchTextVariantsProps): string;
|
|
111
|
+
type Heading = "heading1" | "heading2" | "heading3";
|
|
112
|
+
type Copy = "body" | "secondary" | "success" | "error";
|
|
113
|
+
type Monospace = "mono" | "mono-secondary";
|
|
114
|
+
type TextSize = GoldfinchTextSize;
|
|
115
|
+
type TextVariant = GoldfinchTextVariant;
|
|
116
|
+
/** Valid HTML elements for the Text component's `as` prop. */
|
|
117
|
+
export type TextElement = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "label" | "dt" | "dd" | "li" | "figcaption" | "legend" | "pre" | "code" | "em" | "strong" | "small" | "abbr" | "time";
|
|
118
|
+
type BaseTextProps = Omit<ComponentPropsWithoutRef<"span">, "className" | "style"> & {
|
|
119
|
+
DANGEROUS_className?: string;
|
|
120
|
+
DANGEROUS_style?: CSSProperties;
|
|
121
|
+
};
|
|
122
|
+
type TextPropsInternal<Variant extends TextVariant = "body"> = BaseTextProps & (Variant extends Copy ? {
|
|
123
|
+
variant?: Variant;
|
|
124
|
+
bold?: boolean;
|
|
125
|
+
size?: TextSize;
|
|
126
|
+
truncate?: boolean;
|
|
127
|
+
/** Optional element override. Defaults to `<p>`. */
|
|
128
|
+
as?: TextElement;
|
|
129
|
+
} : Variant extends Monospace ? {
|
|
130
|
+
variant?: Variant;
|
|
131
|
+
bold?: never;
|
|
132
|
+
size?: "lg";
|
|
133
|
+
truncate?: boolean;
|
|
134
|
+
/** Optional element override. Defaults to `<span>`. */
|
|
135
|
+
as?: TextElement;
|
|
136
|
+
} : Variant extends Heading ? {
|
|
137
|
+
variant: Variant;
|
|
138
|
+
bold?: never;
|
|
139
|
+
size?: never;
|
|
140
|
+
truncate?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Required for heading variants. Pick the element that reflects
|
|
143
|
+
* this text's place in the document outline (`"h1"` for a page
|
|
144
|
+
* title, `"h2"` for a section title, etc.) or `"span"` for
|
|
145
|
+
* decorative heading-styled text that is NOT a section heading.
|
|
146
|
+
*
|
|
147
|
+
* Previously optional (defaulted to `<span>`), which silently
|
|
148
|
+
* excluded real section headings from the document outline.
|
|
149
|
+
* Making it required surfaces the decision at the type level.
|
|
150
|
+
*/
|
|
151
|
+
as: TextElement;
|
|
152
|
+
} : never);
|
|
153
|
+
/**
|
|
154
|
+
* Text component props.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```tsx
|
|
158
|
+
* <Text variant="heading1" as="h1">Page Title</Text>
|
|
159
|
+
* <Text variant="body">Default paragraph text.</Text>
|
|
160
|
+
* <Text variant="secondary" size="sm">Muted helper text</Text>
|
|
161
|
+
* <Text variant="error">Something went wrong</Text>
|
|
162
|
+
* <Text variant="mono">console.log("code")</Text>
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
export interface TextProps {
|
|
166
|
+
/**
|
|
167
|
+
* Text style variant. Determines color, font, and weight.
|
|
168
|
+
* - `"heading1"` — Large page title (30px, semibold)
|
|
169
|
+
* - `"heading2"` — Section title (24px, semibold)
|
|
170
|
+
* - `"heading3"` — Subsection title (18px, semibold)
|
|
171
|
+
* - `"body"` — Default body text
|
|
172
|
+
* - `"secondary"` — Muted text for secondary information
|
|
173
|
+
* - `"success"` — Success state text
|
|
174
|
+
* - `"error"` — Error state text
|
|
175
|
+
* - `"mono"` — Monospace text for code
|
|
176
|
+
* - `"mono-secondary"` — Muted monospace text
|
|
177
|
+
* @default "body"
|
|
178
|
+
*/
|
|
179
|
+
variant?: GoldfinchTextVariant;
|
|
180
|
+
/**
|
|
181
|
+
* Text size (only applies to body/secondary/success/error variants).
|
|
182
|
+
* - `"xs"` — 12px
|
|
183
|
+
* - `"sm"` — 14px
|
|
184
|
+
* - `"base"` — 16px
|
|
185
|
+
* - `"lg"` — 18px
|
|
186
|
+
* @default "base"
|
|
187
|
+
*/
|
|
188
|
+
size?: GoldfinchTextSize;
|
|
189
|
+
/** Whether to use bold font weight (only applies to body variants). */
|
|
190
|
+
bold?: boolean;
|
|
191
|
+
/** Whether to truncate overflowing text with an ellipsis. Adds `truncate min-w-0` classes. */
|
|
192
|
+
truncate?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* The HTML element to render. Accepts headings (`"h1"`–`"h6"`), block text
|
|
195
|
+
* (`"p"`, `"pre"`), inline text (`"span"`, `"code"`, `"em"`, `"strong"`,
|
|
196
|
+
* `"small"`, `"abbr"`, `"time"`), form-related (`"label"`, `"legend"`),
|
|
197
|
+
* list/definition (`"dt"`, `"dd"`, `"li"`), and `"figcaption"`.
|
|
198
|
+
*
|
|
199
|
+
* - **Required** for heading variants (`"heading1"`, `"heading2"`,
|
|
200
|
+
* `"heading3"`) — pick the element that reflects this text's place in
|
|
201
|
+
* the document outline, or `"span"` for decorative heading-styled text
|
|
202
|
+
* that is not a section heading.
|
|
203
|
+
* - **Optional** for body variants (defaults to `"p"`) and monospace
|
|
204
|
+
* variants (defaults to `"span"`).
|
|
205
|
+
*/
|
|
206
|
+
as?: TextElement;
|
|
207
|
+
/** Text content. */
|
|
208
|
+
children?: React.ReactNode;
|
|
209
|
+
}
|
|
210
|
+
export declare const Text: <Variant extends TextVariant = "body">(props: TextPropsInternal<Variant> & {
|
|
211
|
+
ref?: ForwardedRef<ElementRef<"span">>;
|
|
212
|
+
}) => React.ReactElement;
|
|
213
|
+
export {};
|