@box-kite/react 2.2.14 → 2.2.16

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.
Files changed (136) hide show
  1. package/.claude/rules/box-kite-rules.md +1 -1
  2. package/.claude/skills/box-kite/SKILL.md +1 -1
  3. package/.claude/skills/box-kite/references/styling.md +1 -1
  4. package/.cursor/rules/box-kite.mdc +1 -1
  5. package/AGENTS.md +1 -1
  6. package/BOX_AI_CONTEXT.md +16 -0
  7. package/BOX_KITE_AI_CONTEXT.md +16 -0
  8. package/behavior.cjs +1 -1
  9. package/behavior.mjs +16 -16
  10. package/catalog.cjs +1 -1
  11. package/catalog.mjs +1 -1
  12. package/client.cjs +1 -1
  13. package/client.mjs +10 -10
  14. package/components/accordion.cjs +1 -1
  15. package/components/accordion.mjs +95 -91
  16. package/components/calendar.cjs +1 -1
  17. package/components/calendar.mjs +212 -210
  18. package/components/chart.cjs +1 -1
  19. package/components/chart.d.ts +8 -3
  20. package/components/chart.mjs +70 -65
  21. package/components/combobox.cjs +1 -1
  22. package/components/combobox.mjs +187 -186
  23. package/components/dashboard.cjs +1 -1
  24. package/components/dashboard.d.ts +1 -44
  25. package/components/dashboard.mjs +202 -201
  26. package/components/dataGrid/components/dataGridListLayout.d.ts +1 -1
  27. package/components/dataGrid/contracts/dataGridContract.d.ts +1 -1
  28. package/components/dataGrid/models/gridModel.d.ts +1 -1
  29. package/components/dataGrid.cjs +2 -2
  30. package/components/dataGrid.mjs +10 -10
  31. package/components/dateField.cjs +1 -1
  32. package/components/dateField.mjs +96 -96
  33. package/components/datePicker.cjs +1 -1
  34. package/components/datePicker.mjs +177 -179
  35. package/components/dialog.cjs +1 -1
  36. package/components/dialog.d.ts +2 -64
  37. package/components/dialog.mjs +130 -126
  38. package/components/form.cjs +1 -1
  39. package/components/form.d.ts +4 -3
  40. package/components/form.mjs +25 -22
  41. package/components/menu.cjs +1 -1
  42. package/components/menu.d.ts +2 -73
  43. package/components/menu.mjs +222 -218
  44. package/components/overlay.cjs +1 -1
  45. package/components/overlay.mjs +43 -43
  46. package/components/popover.cjs +1 -1
  47. package/components/popover.d.ts +1 -41
  48. package/components/popover.mjs +55 -51
  49. package/components/radioGroup.cjs +1 -1
  50. package/components/radioGroup.mjs +59 -55
  51. package/components/slider.cjs +1 -1
  52. package/components/slider.d.ts +1 -55
  53. package/components/slider.mjs +92 -90
  54. package/components/sortableList.cjs +1 -1
  55. package/components/sortableList.mjs +149 -148
  56. package/components/swipeItem.cjs +1 -1
  57. package/components/swipeItem.mjs +100 -100
  58. package/components/tabs.cjs +1 -1
  59. package/components/tabs.mjs +135 -132
  60. package/components/toaster.cjs +1 -1
  61. package/components/toaster.d.ts +1 -37
  62. package/components/toaster.mjs +130 -128
  63. package/components/tooltip.cjs +1 -1
  64. package/components/tooltip.d.ts +1 -34
  65. package/components/tooltip.mjs +73 -69
  66. package/components/virtualList.cjs +1 -1
  67. package/components/virtualList.mjs +88 -87
  68. package/interactionListening.cjs +1 -1
  69. package/interactionListening.mjs +3 -3
  70. package/layer.cjs +1 -1
  71. package/layer.mjs +1 -1
  72. package/package.json +31 -30
  73. package/placement.cjs +1 -1
  74. package/placement.mjs +1 -1
  75. package/platform.cjs +1 -1
  76. package/platform.mjs +17 -14
  77. package/react/componentsContext.d.ts +1 -1
  78. package/react-shared.cjs +1 -1
  79. package/react-shared.mjs +1 -1
  80. package/scrolling.cjs +1 -1
  81. package/scrolling.mjs +1 -1
  82. package/utils/chart/chartUtils.d.ts +3 -2
  83. package/utils/dashboard/dashboardUtils.d.ts +1 -1
  84. package/utils/dom/domUtils.d.ts +6 -0
  85. package/create/src/agents.d.ts +0 -22
  86. package/create/src/agents.test.d.ts +0 -1
  87. package/create/src/index.d.ts +0 -1
  88. package/create/src/options.d.ts +0 -31
  89. package/create/src/options.test.d.ts +0 -1
  90. package/create/src/packageManager.d.ts +0 -5
  91. package/create/src/project.d.ts +0 -27
  92. package/create/src/project.test.d.ts +0 -1
  93. package/create/templates/ts/designs/azure.d.ts +0 -5
  94. package/create/templates/ts/designs/ember.d.ts +0 -5
  95. package/create/templates/ts/designs/mono.d.ts +0 -5
  96. package/create/templates/ts/src/App.d.ts +0 -2
  97. package/create/templates/ts/src/design.d.ts +0 -5
  98. package/create/templates/ts/src/main.d.ts +0 -0
  99. package/mcp/src/data.d.ts +0 -90
  100. package/mcp/src/data.test.d.ts +0 -1
  101. package/mcp/src/engine.d.ts +0 -23
  102. package/mcp/src/index.d.ts +0 -1
  103. package/mcp/src/search.d.ts +0 -26
  104. package/mcp/src/search.test.d.ts +0 -1
  105. package/mcp/src/server.d.ts +0 -18
  106. package/mcp/src/server.test.d.ts +0 -1
  107. package/mcp/src/styles.d.ts +0 -27
  108. package/mcp/src/styles.test.d.ts +0 -1
  109. package/mcp/src/tools.d.ts +0 -18
  110. package/mcp/src/vocabulary.d.ts +0 -41
  111. package/registry/blocks/dashboard-shell/dashboard-shell.d.ts +0 -24
  112. package/registry/blocks/dashboard-shell/dashboard-stats.d.ts +0 -13
  113. package/registry/blocks/data-grid/invoice-rows.d.ts +0 -15
  114. package/registry/blocks/data-grid/invoices-grid.d.ts +0 -1
  115. package/registry/blocks/settings-form/settings-form.d.ts +0 -17
  116. package/registry/designs/store/address-form.d.ts +0 -11
  117. package/registry/designs/store/cart-items.d.ts +0 -10
  118. package/registry/designs/store/cart-page.d.ts +0 -4
  119. package/registry/designs/store/checkout-page.d.ts +0 -7
  120. package/registry/designs/store/credit-card-form.d.ts +0 -10
  121. package/registry/designs/store/form-field.d.ts +0 -19
  122. package/registry/designs/store/order-summary.d.ts +0 -18
  123. package/registry/designs/store/product-art.d.ts +0 -26
  124. package/registry/designs/store/product-card.d.ts +0 -11
  125. package/registry/designs/store/product-gallery.d.ts +0 -11
  126. package/registry/designs/store/product-grid.d.ts +0 -10
  127. package/registry/designs/store/product-page.d.ts +0 -5
  128. package/registry/designs/store/quantity-stepper.d.ts +0 -13
  129. package/registry/designs/store/shipping-method.d.ts +0 -14
  130. package/registry/designs/store/store-data.d.ts +0 -53
  131. package/registry/designs/store/store-design.d.ts +0 -63
  132. package/registry/designs/store/store-shell.d.ts +0 -12
  133. package/registry/designs/store/storefront-page.d.ts +0 -4
  134. package/registry/designs/store/variant-picker.d.ts +0 -15
  135. package/supabase/functions/collect/index.d.ts +0 -30
  136. package/supabase/functions/collect/index.test.d.ts +0 -1
package/mcp/src/data.d.ts DELETED
@@ -1,90 +0,0 @@
1
- import { RegistryItem } from '../../pages/site/registry';
2
- /**
3
- * The corpora, all of them generated somewhere else in this repository: the prop reference F3
4
- * measures off the engine, the component reference G4 extracts from the sources, the rules file AI3
5
- * installs as a skill, and F4's registry items. Nothing here is written down a second time — a
6
- * transcribed fact is the one an agent trusts over its priors and the one that goes stale.
7
- */
8
- export interface PropExample {
9
- value: unknown;
10
- css: string;
11
- }
12
- export interface PropRecord {
13
- name: string;
14
- description: string;
15
- /** The CSS properties it writes. More than one when the prop composes (`shadow`, the filters). */
16
- properties: string[];
17
- example: PropExample;
18
- /** Whether a number is accepted, and whether values outside the listed set are. */
19
- numeric: boolean;
20
- open: boolean;
21
- /** The listed values, or a count alone where the reference cut a long list short. Numeric scales list numbers. */
22
- values?: (string | number)[];
23
- valueCount?: number;
24
- }
25
- export interface ComponentProp {
26
- name: string;
27
- type: string;
28
- required: boolean;
29
- default: string | null;
30
- description: string;
31
- }
32
- export interface ComponentPart {
33
- name: string;
34
- description: string;
35
- props: ComponentProp[];
36
- }
37
- export interface ComponentKey {
38
- mode: string | null;
39
- keys: string;
40
- action: string;
41
- }
42
- export interface ComponentRecord {
43
- name: string;
44
- route: string;
45
- import: string;
46
- description: string;
47
- pattern?: string;
48
- props: ComponentProp[];
49
- parts?: ComponentPart[];
50
- keyboard?: ComponentKey[];
51
- a11y?: string[];
52
- styleTree?: string[];
53
- }
54
- export interface RuleRecord {
55
- number: number;
56
- /** The bolded lead sentence — what the rule is about, without its 300 words of detail. */
57
- heading: string;
58
- body: string;
59
- }
60
- export declare const packageName: string;
61
- export declare const packageVersion: string;
62
- export declare const siteUrl = "https://www.box-kite.dev";
63
- export declare const props: readonly PropRecord[];
64
- export declare const prop: (name: string) => PropRecord | undefined;
65
- export declare const components: readonly ComponentRecord[];
66
- /** Case-insensitive, because a model asks for `datagrid` as readily as `DataGrid`. */
67
- export declare const component: (name: string) => ComponentRecord | undefined;
68
- export declare const rules: readonly RuleRecord[];
69
- /**
70
- * Those bullets, verbatim — the server's `instructions`, which a client puts in front of the model
71
- * before it calls anything. `scripts/agentSources.mjs` reads the same block for `llms.txt` and the
72
- * skill; `data.test.ts` pins this reader to that one, because two parsers of one file is how a fact
73
- * comes to be stated two ways.
74
- */
75
- export declare const priorFacts: readonly string[];
76
- export declare const blocks: readonly RegistryItem[];
77
- export declare const blockInstall: (name: string) => string;
78
- /** The page a registry item is shown on — running in light and dark, with every file — if it has one. */
79
- export declare const blockPage: (name: string) => string | undefined;
80
- /**
81
- * A fresh engine with readable class names, no DOM and no console: what `check_styles` judges a value with. One
82
- * per call rather than one for the process, so a caller's `vars` or `css` cannot leak into the next
83
- * answer through the rule registry.
84
- */
85
- export declare const styleEngine: () => import('../../src/core').StyleEngine;
86
- /**
87
- * Every style prop's accepted values, live off the registry rather than out of `props.json`, which
88
- * cuts a list over 40 short — and a colour prop's 295 tokens are exactly the list worth having.
89
- */
90
- export declare function acceptedValues(name: string): string[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,23 +0,0 @@
1
- /**
2
- * What one prop writes, measured. Every answer this server gives about a value — the example, the
3
- * scale, the verdict — comes through here rather than out of a table, so a changed divider changes
4
- * the documentation in the same commit and a rejected value is reported as what it is: nothing.
5
- */
6
- /**
7
- * The sheet as a list of top-level rules. A brace counter rather than a split on `}`, because a
8
- * `@media`, `@container` or `@scope` block carries rules of its own and a nested one must stay with
9
- * its wrapper — and because the sink writes several rules to a line, so a line is not a rule.
10
- */
11
- export declare function splitRules(css: string): string[];
12
- export interface Measured {
13
- /** The rules this prop added, at-rules included — empty when the value was not accepted. */
14
- css: string;
15
- /** The class names it produced, without the base class every Box carries. */
16
- classNames: string[];
17
- }
18
- /** One prop resolved on an engine of its own, so nothing it writes can hide behind another prop's class. */
19
- export declare function measure(name: string, value: unknown): Measured;
20
- /** Just the declarations, for a table where the selector is noise: `padding:1rem`. */
21
- export declare function declarations(name: string, value: unknown): string;
22
- /** How a value is written in JSX — a string in quotes, everything else in braces. */
23
- export declare const written: (name: string, value: unknown) => string;
@@ -1 +0,0 @@
1
- export {};
@@ -1,26 +0,0 @@
1
- /**
2
- * One entry point over the four corpora, because an agent mid-task knows what it wants the UI to do
3
- * and not which of them holds the answer. Ranked rather than filtered: a query with no exact hit
4
- * should still come back with the three things most worth reading, since an empty result sends the
5
- * model back to its priors — which is the failure this whole package exists to prevent.
6
- */
7
- export type HitKind = 'prop' | 'component' | 'nesting' | 'rule';
8
- export interface Hit {
9
- kind: HitKind;
10
- /** What to pass to `get_props`, `get_component` or `get_rules` for the whole record. */
11
- name: string;
12
- summary: string;
13
- score: number;
14
- }
15
- /** The four corpora, ranked together. `kind` narrows it when the caller already knows which it wants. */
16
- export declare function search(query: string, options?: {
17
- kind?: HitKind;
18
- limit?: number;
19
- }): Hit[];
20
- /**
21
- * The components whose own props a name belongs to — what a search for `onValueChange` should answer
22
- * with, since the same prop name lives on six widgets and none of them is in the prop registry.
23
- */
24
- export declare function componentsWithProp(name: string): string[];
25
- /** Case-insensitive component lookup that also answers for a part (`Tabs.Tab` → `Tabs`). */
26
- export declare function resolveComponent(name: string): import('./data').ComponentRecord | undefined;
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- /**
3
- * `@box-kite/mcp` — the retrieval channel for an agent mid-task.
4
- *
5
- * Deliberately six tools at *capability* level rather than one per document: what may I write, what
6
- * does this component take, and — the one no docs mirror can answer — does this value actually work.
7
- * The package is built from this repository, so every answer is the reference the same commit
8
- * generated: `api/props.json` measured off the engine, `api/components/*.json` extracted from the
9
- * sources, the rules file the skill installs, and the engine itself for `check_styles`.
10
- */
11
- /**
12
- * What a client puts in front of the model before it calls anything. The facts are `AGENTS.md`'s own
13
- * lead block — the four a model's memory of a library with these prop names gets wrong — because an
14
- * agent that never calls a tool should still be told the dividers differ.
15
- */
16
- export declare const instructions: string;
17
- /** The server, transport-free so a test can drive it over an in-memory pair. */
18
- export declare function createServer(): McpServer;
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- /**
2
- * `check_styles`: the answer an agent cannot get from prose. A value this library does not accept
3
- * produces **no rule and no class name** — silently, by design — so the only honest way to say
4
- * whether `bgColor="blue-550"` works is to hand it to the engine and look at what came back.
5
- *
6
- * Each prop is measured on its own, because one bag would let a rejected value hide behind an
7
- * accepted one in the same class list.
8
- */
9
- export type Verdict = 'ok' | 'misread' | 'rejected-value' | 'unknown-prop' | 'html-attribute' | 'reserved';
10
- export interface PropCheck {
11
- name: string;
12
- verdict: Verdict;
13
- /** The rules this prop wrote, at-rules included. Empty unless `ok` or `misread`. */
14
- css: string;
15
- /** What to do about it, when the verdict is not `ok`. */
16
- note?: string;
17
- /** Prop names worth trying instead, closest first. */
18
- suggestions?: string[];
19
- }
20
- export interface StyleCheck {
21
- checks: PropCheck[];
22
- /** The class attribute the whole bag resolves to — what `<Box {...props}>` would render. */
23
- className: string;
24
- ok: boolean;
25
- }
26
- /** Judge a whole prop bag: one verdict per prop, plus the class attribute the bag as a whole resolves to. */
27
- export declare function checkStyles(bag: Record<string, unknown>): StyleCheck;
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- import { ComponentRecord } from './data';
2
- import { Hit } from './search';
3
- /** `search_docs` — the entry point when the caller knows the goal and not the name. */
4
- export declare function searchDocs(query: string, kind?: Hit['kind'], limit?: number): string;
5
- /** `get_props` — the record for named style props, with the scale measured rather than stated. */
6
- export declare function getProps(names: string[]): string;
7
- export type ComponentSection = 'props' | 'parts' | 'keyboard' | 'a11y' | 'styles';
8
- /** `get_component` — one component's whole contract: props, parts, the keyboard map and the ARIA. */
9
- export declare function getComponent(name: string, include?: ComponentSection[]): string;
10
- /** `check_styles` — the engine's own answer, which is the only one that counts. */
11
- export declare function checkStylesTool(bag: Record<string, unknown>): string;
12
- /** `get_rules` — the numbered rules, or the index of them. */
13
- export declare function getRules(numbers?: number[]): string;
14
- /** `get_blocks` — F4's registry: whole sections the shadcn CLI installs, wired and compiling. */
15
- export declare function getBlocks(name?: string): string;
16
- /** Every nesting key, for the tool description's "what else can I write" — small enough to state whole. */
17
- export declare const nestingSummary: () => string;
18
- export type { ComponentRecord };
@@ -1,41 +0,0 @@
1
- /**
2
- * Every key a Box takes that is *not* one of the 235 style props: the nesting keys, and the four
3
- * reserved names. Imported from the engine's own records rather than listed here, so a key added to
4
- * the library is in the MCP server the same day — the whole reason this package lives in this repo.
5
- */
6
- /** What a nesting key is for, in one line — the engine's records carry the selector, not the reason. */
7
- declare const KINDS: {
8
- readonly pseudoClass: "a state of this element";
9
- readonly pseudoElement: "a pseudo-element of this element (one per Box)";
10
- readonly breakpoint: "a viewport width, min-width and up";
11
- readonly media: "a reader preference or input device";
12
- readonly container: "the width of the nearest query container";
13
- readonly variant: "an attribute or position on this element's own selector";
14
- readonly group: "an ancestor's or a preceding sibling's state";
15
- readonly theme: "one named theme";
16
- readonly startingStyle: "what these props start from, the first time the element is styled";
17
- };
18
- export type NestingKind = keyof typeof KINDS;
19
- export interface NestingKey {
20
- key: string;
21
- kind: NestingKind;
22
- /** What it compiles to — a selector fragment, an at-rule prelude, or a width in px. */
23
- compiles: string;
24
- deprecated: boolean;
25
- }
26
- /** Every nesting key the engine dispatches on, in the order a reader meets them. */
27
- export declare const nestingKeys: readonly NestingKey[];
28
- export declare const nestingKey: (key: string) => NestingKey | undefined;
29
- export declare const nestingKindLabel: (kind: NestingKind) => string;
30
- /**
31
- * The four names a Box takes that are neither a style prop nor a nesting key. `props` is the one an
32
- * agent gets wrong most often: an HTML attribute written at the top level typechecks and is dropped.
33
- */
34
- export declare const reservedProps: Readonly<Record<string, string>>;
35
- /**
36
- * HTML attributes an agent most often writes at the top level, where Box drops them. Names the engine
37
- * already claims are filtered out rather than listed away: `checked` and `placeholder` are nesting
38
- * keys on a Box, and a hint that contradicted the engine would be worse than no hint.
39
- */
40
- export declare const attributeNames: ReadonlySet<string>;
41
- export {};
@@ -1,24 +0,0 @@
1
- import { ReactElement, ReactNode } from 'react';
2
- /**
3
- * The frame an admin app hangs off: a sidebar, a header with search, a theme toggle and an account
4
- * menu, and the page itself. The sidebar sticks to the top of its column and folds away below the `md`
5
- * breakpoint; nothing here is measured or positioned by script.
6
- *
7
- * `Box.Theme` is `use="local"` here, so the theme lands on this element and the block can sit inside a
8
- * page that has its own. Move it to your root layout as `use="global"` for an app-wide switch.
9
- */
10
- export interface NavItem {
11
- id: string;
12
- label: string;
13
- href: string;
14
- icon: ReactElement;
15
- }
16
- export interface DashboardShellProps {
17
- /** The heading above the page, and the `id` of the nav item that is marked as current. */
18
- title: string;
19
- current?: string;
20
- /** The theme to open in. Without it the shell follows the reader's saved choice, then their system. */
21
- theme?: string;
22
- children: ReactNode;
23
- }
24
- export default function DashboardShell({ title, current, theme, children }: DashboardShellProps): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- /**
2
- * The row of tiles above a dashboard. The shapes are `components/chart` primitives — an SVG each, no
3
- * chart library — and there is no `'use client'` here on purpose: nothing in this file holds state, so
4
- * it renders in a Server Component, styles and all.
5
- */
6
- export interface Stat {
7
- label: string;
8
- value: string;
9
- delta: string;
10
- up: boolean;
11
- trend: number[];
12
- }
13
- export default function DashboardStats(): import("react").JSX.Element;
@@ -1,15 +0,0 @@
1
- /** The rows the block is wired to. Replace this file with your own fetch — the grid reads plain objects. */
2
- export interface Invoice {
3
- id: number;
4
- reference: string;
5
- customer: string;
6
- team: string;
7
- status: 'paid' | 'pending' | 'overdue';
8
- amount: number;
9
- issued: string;
10
- }
11
- /**
12
- * Two hundred invoices generated from the index, so the block has something to sort, filter, group and
13
- * total without shipping a data file — and every reload shows the same table.
14
- */
15
- export declare const invoices: Invoice[];
@@ -1 +0,0 @@
1
- export default function InvoicesGrid(): import("react").JSX.Element;
@@ -1,17 +0,0 @@
1
- /**
2
- * A settings panel: text fields, a searchable select, a radio group, a slider and a switch, each a real
3
- * form control. `Form` reads its own fields when it submits, so none of this needs state — `values` is
4
- * built from the elements carrying a `name`.
5
- *
6
- * `<Toaster />` has to be mounted once near the root of the app for the confirmation to show.
7
- */
8
- export interface Settings {
9
- name: string;
10
- email: string;
11
- bio: string;
12
- timezone: string;
13
- theme: string;
14
- density: string;
15
- notify: boolean;
16
- }
17
- export default function SettingsForm(): import("react").JSX.Element;
@@ -1,11 +0,0 @@
1
- export interface AddressFormProps {
2
- /** The fieldset's caption, and the prefix every field submits under: `shipping.city`, `billing.city`. */
3
- legend?: string;
4
- prefix?: string;
5
- }
6
- /**
7
- * A postal address as a `<fieldset>`: name, two street lines, city, postcode, country and a phone. Every
8
- * field carries the `autocomplete` token a browser fills it from, which on a phone is most of the typing.
9
- * Drop two into one form, with different prefixes, for a shipping and a billing address.
10
- */
11
- export default function AddressForm({ legend, prefix }: AddressFormProps): import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { CartLine } from './store-data';
2
- export interface CartItemsProps {
3
- lines: readonly CartLine[];
4
- onLinesChange: (lines: CartLine[]) => void;
5
- }
6
- /**
7
- * The lines of a cart: picture, name, the options chosen, a quantity stepper, the line's price and a way
8
- * out. It holds no state — the cart is the page's, so the summary beside it reads the same list.
9
- */
10
- export default function CartItems({ lines, onLinesChange }: CartItemsProps): import("react").JSX.Element;
@@ -1,4 +0,0 @@
1
- /** The cart: its lines beside the summary, both reading one list, and an empty state once it is cleared. */
2
- export default function CartPage({ theme }: {
3
- theme?: string;
4
- }): import("react").JSX.Element;
@@ -1,7 +0,0 @@
1
- /**
2
- * The checkout: one form of contact, address, delivery and payment, beside the order it pays for. The
3
- * sections are separate blocks, each a `<fieldset>`, so the form reads every field by name on submit.
4
- */
5
- export default function CheckoutPage({ theme }: {
6
- theme?: string;
7
- }): import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- /**
2
- * A card payment fieldset: number, name, expiry and security code, formatted as they are typed and checked
3
- * when a field is left, with a card drawn above that fills in as they go. It is a `<fieldset>`, not a form,
4
- * so it drops into a checkout form beside the address; the fields submit as `cardNumber`, `cardName`,
5
- * `cardExpiry` and `cardCvc`, with the `autocomplete` tokens a browser fills a saved card from.
6
- *
7
- * This only shapes the input. Sending a raw card number to your own server puts you in scope for PCI DSS —
8
- * in production these fields are usually your payment provider's hosted inputs, laid out the same way.
9
- */
10
- export default function CreditCardForm(): import("react").JSX.Element;
@@ -1,19 +0,0 @@
1
- import { ReactNode } from 'react';
2
- /** What a field's control is handed: its `id`, and the two attributes that tie an error to it. */
3
- export interface FieldControl {
4
- id: string;
5
- 'aria-invalid'?: true;
6
- 'aria-describedby'?: string;
7
- }
8
- export interface FormFieldProps {
9
- label: string;
10
- /** Shown under the control and read with it; the control is marked invalid while there is one. */
11
- error?: string;
12
- hint?: string;
13
- children: (control: FieldControl) => ReactNode;
14
- }
15
- /**
16
- * A label, a control and what is wrong with it. The control is a render prop so the field can hand it the
17
- * ids — a message the screen reader is not pointed at is a message only the sighted get.
18
- */
19
- export default function FormField({ label, error, hint, children }: FormFieldProps): import("react").JSX.Element;
@@ -1,18 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { CartLine } from './store-data';
3
- export interface OrderSummaryProps {
4
- lines: readonly CartLine[];
5
- /** The shipping price once a method is chosen. Left out, the summary says it is worked out at checkout. */
6
- shipping?: number;
7
- /** List the objects themselves — what a checkout page shows, where the cart is no longer on screen. */
8
- showLines?: boolean;
9
- /** The button underneath: "Checkout" on the cart page, nothing on the checkout. */
10
- action?: ReactNode;
11
- /** Told the discount once a code is accepted, for a page that shows the total somewhere else too. */
12
- onDiscountChange?: (amount: number) => void;
13
- }
14
- /**
15
- * Subtotal, discount, shipping, tax and the total, with a discount-code field and how far the cart is from
16
- * free shipping. Every figure is computed from `lines`, so it can never disagree with the cart beside it.
17
- */
18
- export default function OrderSummary({ lines, shipping, showLines, action, onDiscountChange }: OrderSummaryProps): import("react").JSX.Element;
@@ -1,26 +0,0 @@
1
- import { Shape } from './store-data';
2
- export type ArtView = 'front' | 'set';
3
- export interface ProductArtProps {
4
- shape: Shape;
5
- finish: string;
6
- /** For the `set` view: more finishes, each on its own tile beside the first. */
7
- also?: readonly string[];
8
- view?: ArtView;
9
- /** Names the picture; without one it is decoration, hidden from assistive technology. */
10
- label?: string;
11
- /** The line's width in the icon's own 24-unit grid: thinner on a large tile, heavier on a thumbnail. */
12
- stroke?: 0.5 | 0.75 | 1 | 1.25 | 1.5;
13
- /** Rounds the picture’s corners, on the ÷4 scale: the tiles clip themselves, so nothing around them has to. */
14
- radius?: 2 | 3 | 4 | 6;
15
- }
16
- /** Fills its parent: give the parent a size or an aspect ratio, and the picture takes the rest. */
17
- export default function ProductArt({ shape, finish, also, view, label, stroke, radius }: ProductArtProps): import("react").JSX.Element;
18
- /** A flat dot of the finish, for the colour swatches. */
19
- export declare function finishSwatch(id: string): {
20
- vars: {
21
- swatch: string;
22
- };
23
- css: {
24
- backgroundColor: string;
25
- };
26
- };
@@ -1,11 +0,0 @@
1
- import { Product } from './store-data';
2
- export interface ProductCardProps {
3
- product: Product;
4
- /** The heading level the card's name takes in the page around it. */
5
- level?: 'h2' | 'h3';
6
- }
7
- /**
8
- * One product in a grid. The whole card is the link, and its name is the link's text: the picture is
9
- * decoration beside it, and the finish swatches are spelled out for a screen reader in one sentence.
10
- */
11
- export default function ProductCard({ product, level }: ProductCardProps): import("react").JSX.Element;
@@ -1,11 +0,0 @@
1
- import { Product } from './store-data';
2
- export interface ProductGalleryProps {
3
- product?: Product;
4
- /** The finish on show — the variant picker beside the gallery owns it. */
5
- finish?: string;
6
- }
7
- /**
8
- * A product's pictures: one large view and a row of thumbnails that choose it. The thumbnails are tabs
9
- * (APG's tabbed carousel), so the arrow keys move between them and each picture is named by its tab.
10
- */
11
- export default function ProductGallery({ product, finish }: ProductGalleryProps): import("react").JSX.Element;
@@ -1,10 +0,0 @@
1
- import { Product } from './store-data';
2
- export interface ProductGridProps {
3
- products?: readonly Product[];
4
- title?: string;
5
- }
6
- /**
7
- * A product grid with filters: categories and finishes as checkboxes, a sort, and a count that is announced
8
- * as it changes. Filtering is a `useMemo` over the list it is given — hand it the page your API returned.
9
- */
10
- export default function ProductGrid({ products, title }: ProductGridProps): import("react").JSX.Element;
@@ -1,5 +0,0 @@
1
- /** One product: the gallery and the picker share the finish, and adding to the cart moves the header's count. */
2
- export default function ProductPage({ slug, theme }: {
3
- slug?: string;
4
- theme?: string;
5
- }): import("react").JSX.Element;
@@ -1,13 +0,0 @@
1
- export interface QuantityStepperProps {
2
- value: number;
3
- onChange: (value: number) => void;
4
- /** What is being counted, for the buttons' names: "Add one Bolt the robot". */
5
- item: string;
6
- min?: number;
7
- max?: number;
8
- }
9
- /**
10
- * Two buttons and the count between them. The count is an `<output>`, which is a polite live region of its
11
- * own, so a screen reader hears the new number after each press with nothing wired up.
12
- */
13
- export default function QuantityStepper({ value, onChange, item, min, max }: QuantityStepperProps): import("react").JSX.Element;
@@ -1,14 +0,0 @@
1
- import { ShippingMethod as Method } from './store-data';
2
- export interface ShippingMethodProps {
3
- methods?: readonly Method[];
4
- value?: string;
5
- onValueChange?: (id: string) => void;
6
- /** Standard shipping is free above this subtotal. */
7
- freeStandard?: boolean;
8
- }
9
- /**
10
- * Delivery options as cards. Each card is the `<label>` of a native radio, so the whole card is the
11
- * target, the set is one tab stop with the arrow keys inside it, and the chosen card is styled with
12
- * `:has(:checked)` — the radio itself stays visible, because it is what says this is a choice of one.
13
- */
14
- export default function ShippingMethod({ methods, value, onValueChange, freeStandard }: ShippingMethodProps): import("react").JSX.Element;
@@ -1,53 +0,0 @@
1
- /**
2
- * The catalogue the store pages render: plain objects, so swapping in your own fetch changes nothing else.
3
- * A finish is the object's colour, the wash its picture sits on, and the ink the picture is drawn in.
4
- */
5
- export type Shape = 'lamp' | 'clock' | 'vase' | 'speaker' | 'mug' | 'chair' | 'glass' | 'desk-lamp';
6
- export interface Finish {
7
- id: string;
8
- name: string;
9
- /** The swatch, as any CSS colour: the finishes are muted on purpose, between the palette's steps. */
10
- color: string;
11
- /** The wash behind the picture: the finish, lightened. */
12
- tile: string;
13
- /** The picture's line: a deep tone of the same hue, or a light one on a dark finish. */
14
- ink: string;
15
- }
16
- export interface Product {
17
- slug: string;
18
- name: string;
19
- shape: Shape;
20
- category: string;
21
- price: number;
22
- finishes: readonly string[];
23
- sizes?: readonly string[];
24
- badge?: string;
25
- summary: string;
26
- }
27
- export interface CartLine {
28
- id: string;
29
- slug: string;
30
- finish: string;
31
- size?: string;
32
- quantity: number;
33
- }
34
- export interface ShippingMethod {
35
- id: string;
36
- name: string;
37
- detail: string;
38
- price: number;
39
- }
40
- export declare const STORE_NAME = "Still";
41
- export declare const finishes: Record<string, Finish>;
42
- export declare const products: readonly Product[];
43
- export declare const categories: string[];
44
- export declare const sampleCart: readonly CartLine[];
45
- export declare const shippingMethods: readonly ShippingMethod[];
46
- /** Orders over this ship free on the standard service. */
47
- export declare const FREE_SHIPPING_FROM = 250;
48
- export declare const TAX_RATE = 0.08;
49
- /** A price as a tag prints it: $240, with cents only when there are some. */
50
- export declare const formatPrice: (amount: number) => string;
51
- export declare const productBySlug: (slug: string) => Product;
52
- export declare const subtotalOf: (lines: readonly CartLine[]) => number;
53
- export declare const countOf: (lines: readonly CartLine[]) => number;