@peerproblem/sw3-ui 0.0.0-stage → 0.3.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.
Files changed (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +109 -2
  3. package/agent/components/accordion.md +95 -0
  4. package/agent/components/action-square.md +106 -0
  5. package/agent/components/agent-bridge.md +87 -0
  6. package/agent/components/agent-console.md +123 -0
  7. package/agent/components/alert-dialog.md +82 -0
  8. package/agent/components/app-shell.md +105 -0
  9. package/agent/components/area-chart.md +56 -0
  10. package/agent/components/async-options.md +47 -0
  11. package/agent/components/autocomplete.md +69 -0
  12. package/agent/components/avatar.md +88 -0
  13. package/agent/components/badge.md +51 -0
  14. package/agent/components/bar-chart.md +56 -0
  15. package/agent/components/bar-list.md +49 -0
  16. package/agent/components/breadcrumbs.md +43 -0
  17. package/agent/components/button.md +109 -0
  18. package/agent/components/calendar.md +114 -0
  19. package/agent/components/canvas.md +105 -0
  20. package/agent/components/card.md +78 -0
  21. package/agent/components/carousel.md +113 -0
  22. package/agent/components/chart-card.md +41 -0
  23. package/agent/components/chart-surface.md +56 -0
  24. package/agent/components/checkbox.md +88 -0
  25. package/agent/components/citation-chip.md +61 -0
  26. package/agent/components/collapsible.md +69 -0
  27. package/agent/components/color-picker.md +82 -0
  28. package/agent/components/combobox.md +104 -0
  29. package/agent/components/command.md +92 -0
  30. package/agent/components/dashboard-grid.md +73 -0
  31. package/agent/components/date-input.md +87 -0
  32. package/agent/components/date-picker.md +122 -0
  33. package/agent/components/dialog.md +97 -0
  34. package/agent/components/donut-chart.md +50 -0
  35. package/agent/components/drawer.md +101 -0
  36. package/agent/components/empty-state.md +52 -0
  37. package/agent/components/field.md +80 -0
  38. package/agent/components/file-input.md +84 -0
  39. package/agent/components/hover-card.md +64 -0
  40. package/agent/components/image-cropper.md +77 -0
  41. package/agent/components/input.md +49 -0
  42. package/agent/components/label.md +53 -0
  43. package/agent/components/line-chart.md +60 -0
  44. package/agent/components/listbox.md +84 -0
  45. package/agent/components/map-view.md +104 -0
  46. package/agent/components/menu.md +117 -0
  47. package/agent/components/menubar.md +67 -0
  48. package/agent/components/meter.md +59 -0
  49. package/agent/components/navigation-menu.md +98 -0
  50. package/agent/components/number-input.md +81 -0
  51. package/agent/components/otp-input.md +67 -0
  52. package/agent/components/pagination.md +80 -0
  53. package/agent/components/password-input.md +67 -0
  54. package/agent/components/pill-button.md +116 -0
  55. package/agent/components/popover.md +85 -0
  56. package/agent/components/poster-card.md +61 -0
  57. package/agent/components/preferences.md +92 -0
  58. package/agent/components/progress.md +63 -0
  59. package/agent/components/provider.md +47 -0
  60. package/agent/components/radio.md +91 -0
  61. package/agent/components/rating.md +66 -0
  62. package/agent/components/reorder.md +61 -0
  63. package/agent/components/resizable.md +87 -0
  64. package/agent/components/scatter-chart.md +49 -0
  65. package/agent/components/scroll-area.md +81 -0
  66. package/agent/components/segmented-control.md +56 -0
  67. package/agent/components/select.md +130 -0
  68. package/agent/components/separator.md +60 -0
  69. package/agent/components/shortcuts.md +50 -0
  70. package/agent/components/sidebar-nav.md +68 -0
  71. package/agent/components/skeleton.md +58 -0
  72. package/agent/components/slider.md +79 -0
  73. package/agent/components/sparkline.md +39 -0
  74. package/agent/components/squircle.md +58 -0
  75. package/agent/components/stat.md +58 -0
  76. package/agent/components/switch.md +48 -0
  77. package/agent/components/table.md +58 -0
  78. package/agent/components/tabs.md +108 -0
  79. package/agent/components/textarea.md +68 -0
  80. package/agent/components/time-input.md +84 -0
  81. package/agent/components/timeline.md +91 -0
  82. package/agent/components/toast.md +85 -0
  83. package/agent/components/toggle.md +76 -0
  84. package/agent/components/token-input.md +66 -0
  85. package/agent/components/toolbar.md +76 -0
  86. package/agent/components/tooltip.md +83 -0
  87. package/agent/components/tracker.md +47 -0
  88. package/agent/components/tree.md +87 -0
  89. package/agent/components/treemap.md +72 -0
  90. package/agent/components/trend-chart.md +80 -0
  91. package/agent/components/trigger-menu.md +67 -0
  92. package/agent/components/typography.md +51 -0
  93. package/agent/components/waterfall.md +78 -0
  94. package/agent/components/week-schedule.md +113 -0
  95. package/agent/llms/actions-and-layout.txt +1749 -0
  96. package/agent/llms/agents.txt +505 -0
  97. package/agent/llms/charts.txt +778 -0
  98. package/agent/llms/dashboards.txt +457 -0
  99. package/agent/llms/extend.txt +132 -0
  100. package/agent/llms/extras.txt +527 -0
  101. package/agent/llms/forms.txt +2152 -0
  102. package/agent/llms/foundations.txt +674 -0
  103. package/agent/llms/hooks.txt +178 -0
  104. package/agent/llms/maps.txt +229 -0
  105. package/agent/llms/overlays-and-navigation.txt +1167 -0
  106. package/agent/llms-full.txt +8717 -0
  107. package/agent/llms.txt +145 -0
  108. package/agent/registry.json +11289 -0
  109. package/agent/tokens.md +66 -0
  110. package/dist/agent/index.d.ts +235 -0
  111. package/dist/agent/index.js +21 -0
  112. package/dist/card-Ipm-Cj5f.d.ts +490 -0
  113. package/dist/charts/index.d.ts +289 -0
  114. package/dist/charts/index.js +815 -0
  115. package/dist/check/cli.d.ts +1 -0
  116. package/dist/check/cli.js +48 -0
  117. package/dist/check/rendered.d.ts +11 -0
  118. package/dist/check/rendered.js +77 -0
  119. package/dist/check/source.d.ts +13 -0
  120. package/dist/check/source.js +182 -0
  121. package/dist/chunk-3DXBM65D.js +65 -0
  122. package/dist/chunk-3H5X4ZP6.js +55 -0
  123. package/dist/chunk-6XC4BC5C.js +92 -0
  124. package/dist/chunk-7H6TEAWD.js +507 -0
  125. package/dist/chunk-I63ZTJOI.js +1089 -0
  126. package/dist/chunk-JCIRUM4W.js +33 -0
  127. package/dist/chunk-LTBEHZ3P.js +25 -0
  128. package/dist/chunk-QDPPLO4U.js +60 -0
  129. package/dist/chunk-U2XFBPU4.js +56 -0
  130. package/dist/chunk-UY2WH5AY.js +681 -0
  131. package/dist/extras.d.ts +203 -0
  132. package/dist/extras.js +904 -0
  133. package/dist/icons-BJiGEAnU.d.ts +68 -0
  134. package/dist/index.d.ts +3737 -0
  135. package/dist/index.js +14477 -0
  136. package/dist/map/index.d.ts +115 -0
  137. package/dist/map/index.js +394 -0
  138. package/dist/meta/index.d.ts +3314 -0
  139. package/dist/meta/index.js +5106 -0
  140. package/dist/rules-1RIZ_JZr.d.ts +38 -0
  141. package/dist/styles.css +4037 -0
  142. package/dist/themes/calm.css +42 -0
  143. package/dist/themes/frost.css +40 -0
  144. package/package.json +142 -4
@@ -0,0 +1,203 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, HTMLAttributes } from 'react';
3
+ import { CardProps, RadiusValue, SmoothingValue } from './index.js';
4
+ import { HTMLMotionProps } from 'motion/react';
5
+ import { Recipe, VariantProps, IconName } from './index.js';
6
+
7
+ type PosterOutline = 'first' | 'last' | 'none' | 'all' | 'muted-first';
8
+ interface PosterCardProps extends Omit<CardProps, 'title' | 'children'> {
9
+ /** Display words. A string is split on spaces; pass an array to control lines. */
10
+ title: string | string[];
11
+ /** Which words render as outlined (stroked) type. */
12
+ outline?: PosterOutline;
13
+ /** 1–3 short lines of mono uppercase instructions, e.g. ["Pick a color", "Drag or type a value"]. */
14
+ caption?: string[];
15
+ /** The live demo / content shown in the poster. */
16
+ children?: ReactNode;
17
+ /** A control in the top-right corner, such as a link to the item's page. Keep the card itself inert so the demo stays usable. */
18
+ action?: ReactNode;
19
+ }
20
+ /**
21
+ * PosterCard — a gallery tile: tight display words
22
+ * top-left (sized to the card with container queries), a mono caption under them,
23
+ * and the live component below. Height follows the content.
24
+ */
25
+ declare const PosterCard: react.ForwardRefExoticComponent<Omit<PosterCardProps, "ref"> & react.RefAttributes<HTMLDivElement>>;
26
+
27
+ /**
28
+ * Recipe for ActionSquare. `schema` is read by the agent registry.
29
+ * Adjust with CSS: `.my-hero { --sw-action-square-tile-bg: #fff }`.
30
+ */
31
+ declare const actionSquareRecipe: Recipe<{
32
+ /** light = pale tile on light media · ink = dark tile (Close) · glass = translucent on dark/photo */
33
+ readonly tone: readonly ["light", "ink", "glass"];
34
+ /** md = 48px tile · lg = 60px tile */
35
+ readonly size: readonly ["md", "lg"];
36
+ }>;
37
+ /**
38
+ * Recipe for PillButton. `schema` is read by the agent registry.
39
+ * Adjust with CSS: `.toolbar { --sw-pill-button-bg: #222; --sw-pill-button-radius: 16px }`.
40
+ */
41
+ declare const pillButtonRecipe: Recipe<{
42
+ /**
43
+ * night = raised grey on near-black · ink = black on light · soft = muted fill on light ·
44
+ * glass = 50% white + blur over imagery, turns black on hover
45
+ */
46
+ readonly tone: readonly ["night", "ink", "soft", "glass"];
47
+ /** sm = 36px · md = 48px · lg = 60px · fluid = 48→100px with the viewport (hero navigation) */
48
+ readonly size: readonly ["sm", "md", "lg", "fluid"];
49
+ }>;
50
+
51
+ type OwnProps$1 = VariantProps<typeof actionSquareRecipe> & {
52
+ /** Visible text next to the tile, e.g. "Learn more". Keep it 1–3 words. */
53
+ label: string;
54
+ /** Icon inside the tile. Default `corner`. */
55
+ icon?: IconName;
56
+ /** Put the tile before the label instead of after. */
57
+ iconFirst?: boolean;
58
+ /** Hide the label visually (it stays the accessible name). */
59
+ hideLabel?: boolean;
60
+ /** Squircle radius of the tile. Defaults per size. */
61
+ radius?: RadiusValue;
62
+ smoothing?: SmoothingValue;
63
+ /** Render a non-interactive span — use inside another clickable surface (e.g. a media card). */
64
+ decorative?: boolean;
65
+ };
66
+ type ActionSquareProps = OwnProps$1 & Omit<HTMLMotionProps<'button'>, keyof OwnProps$1 | 'children'>;
67
+ /**
68
+ * ActionSquare — a text label paired with a squircle icon tile ("Learn more [+]", "Close [−]").
69
+ * The whole row is the hit target; the tile carries the hover/press feedback.
70
+ */
71
+ declare const ActionSquare: react.ForwardRefExoticComponent<Omit<ActionSquareProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
72
+
73
+ type OwnProps = VariantProps<typeof pillButtonRecipe> & {
74
+ /** Leading icon: an `IconName` or any node (24px works best). */
75
+ icon?: IconName | ReactNode;
76
+ /** Trailing icon, e.g. `chevron-down` for a menu trigger. */
77
+ trailingIcon?: IconName | ReactNode;
78
+ /** Render as a link. */
79
+ href?: string;
80
+ /** Open the link with the browser's download behaviour. */
81
+ download?: boolean | string;
82
+ children: ReactNode;
83
+ };
84
+ type PillButtonProps = OwnProps & Omit<HTMLMotionProps<'button'>, keyof OwnProps>;
85
+ /**
86
+ * PillButton — fully rounded action with an optional leading icon ("Export", "View tasks", "Services ▾").
87
+ * Pass `href` for a link. `aria-expanded` / `aria-pressed` keep the hover fill so toggles read as on.
88
+ */
89
+ declare const PillButton: react.ForwardRefExoticComponent<Omit<PillButtonProps, "ref"> & react.RefAttributes<HTMLButtonElement>>;
90
+
91
+ type CanvasShapeType = 'rect' | 'ellipse' | 'text';
92
+ type CanvasFill = 'ink' | 'gray' | 'white' | 'hatch';
93
+ interface CanvasShape {
94
+ id: string;
95
+ type: CanvasShapeType;
96
+ /** Layer name, also the shape's accessible name ("Ellipse"). */
97
+ name: string;
98
+ /** Position and size in artboard units (the artboard is `width` × `height`). */
99
+ x: number;
100
+ y: number;
101
+ w: number;
102
+ h: number;
103
+ /** ink = background with an outline, gray = mid tone, white = foreground, hatch = diagonal lines with an outline. */
104
+ fill: CanvasFill;
105
+ /** 10–100. */
106
+ opacity: number;
107
+ /** Text shapes only. Rendered in the display face, sized from `h`. */
108
+ text?: string;
109
+ }
110
+ type CanvasShapePatch = Partial<Pick<CanvasShape, 'x' | 'y' | 'w' | 'h' | 'fill' | 'opacity' | 'text' | 'name'>>;
111
+ interface CanvasProps extends Omit<HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'> {
112
+ /** Shapes, bottom to top. Controlled. */
113
+ shapes?: CanvasShape[];
114
+ defaultShapes?: CanvasShape[];
115
+ /** Every change: each drag frame, key press and inspector edit. */
116
+ onShapesChange?: (shapes: CanvasShape[]) => void;
117
+ /** Once an interaction ends (pointer up, key, inspector commit). For saving. */
118
+ onShapesCommit?: (shapes: CanvasShape[]) => void;
119
+ /** Id of the selected shape, `null` for none. Controlled. */
120
+ selectedId?: string | null;
121
+ defaultSelectedId?: string | null;
122
+ onSelectedIdChange?: (id: string | null) => void;
123
+ /** Artboard size in units. It scales to the container width and keeps this aspect ratio. Default 560 × 320. */
124
+ width?: number;
125
+ height?: number;
126
+ /** Show the layers / position / fill / opacity panel under the artboard. Default true. */
127
+ inspector?: boolean;
128
+ /** Draw a surface around the artboard and inspector. Set false inside an existing surface. Default true. */
129
+ framed?: boolean;
130
+ /** Drag snap in artboard units. Default 1. */
131
+ snap?: number;
132
+ /** Outer frame radius. Default 'lg'. */
133
+ radius?: RadiusValue;
134
+ }
135
+ /** A small design canvas: an artboard of rectangles, ellipses and text to select, drag and resize, with a layers / position / fill / opacity inspector. */
136
+ declare function Canvas({ shapes: shapesProp, defaultShapes, onShapesChange, onShapesCommit, selectedId: selectedProp, defaultSelectedId, onSelectedIdChange, width: W, height: H, inspector, framed, snap, radius, className, style, onKeyDown, ...rest }: CanvasProps): react.JSX.Element;
137
+
138
+ type WeekEventKind = 'meeting' | 'focus' | 'away';
139
+ type WeekHourFormat = '24h' | '12h';
140
+ interface WeekEvent {
141
+ id: string;
142
+ title: string;
143
+ /** Column index, 0-based into `days`. */
144
+ day: number;
145
+ /** Minutes from midnight, e.g. 9:30 → 570. */
146
+ start: number;
147
+ /** Minutes from midnight. Must be after `start`. */
148
+ end: number;
149
+ /** meeting = outlined, focus = solid, away = outlined + hatched. Default 'meeting'. Away time is not counted as booked. */
150
+ kind?: WeekEventKind;
151
+ }
152
+ interface WeekScheduleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'defaultValue'> {
153
+ /** Controlled events. */
154
+ events?: WeekEvent[];
155
+ defaultEvents?: WeekEvent[];
156
+ /** Every change: each drag frame, key press and agent action. */
157
+ onEventsChange?(events: WeekEvent[]): void;
158
+ /** Once a move or resize ends (pointer up, key handled, agent action). Save here. */
159
+ onEventCommit?(event: WeekEvent, events: WeekEvent[]): void;
160
+ /** Click (without dragging), Enter or Space on an event. */
161
+ onEventActivate?(event: WeekEvent): void;
162
+ /** Column labels. Default Mon–Fri. */
163
+ days?: string[];
164
+ /** First visible hour (0–23). Default 9. */
165
+ startHour?: number;
166
+ /** Hour the board ends at (exclusive, 1–24). Default 17. */
167
+ endHour?: number;
168
+ /** Snap and arrow-key step in minutes. Default 15. */
169
+ step?: number;
170
+ /** Pixels per hour. Default 60. */
171
+ hourHeight?: number;
172
+ hourFormat?: WeekHourFormat;
173
+ defaultHourFormat?: WeekHourFormat;
174
+ onHourFormatChange?(format: WeekHourFormat): void;
175
+ /** Show the big "hours booked" total. Default true. */
176
+ summary?: boolean;
177
+ /** Label under the total. Default 'Hours booked'. */
178
+ summaryLabel?: string;
179
+ /** Show the 24h / 12h switch in the footer. Default true. */
180
+ clockToggle?: boolean;
181
+ /** Show the meeting / focus / away legend. Default true. */
182
+ legend?: boolean;
183
+ /** Events can be read and activated but not moved. */
184
+ readOnly?: boolean;
185
+ /** Frame radius. Default 'lg'. */
186
+ radius?: RadiusValue;
187
+ }
188
+ /** "09:30" — the stable form agents read and write. */
189
+ declare const toHHMM: (min: number) => string;
190
+ /** "9:30", "14:00" / "9:30 AM", "2 PM". */
191
+ declare function formatClock(min: number, format?: WeekHourFormat): string;
192
+ /** "10:00–12:00" / "10–12 PM", "11:30 AM–1 PM". */
193
+ declare function formatRange(start: number, end: number, format?: WeekHourFormat): string;
194
+ /** Parse "9:30", "09:30", "2pm", "2:15 PM" or a number of minutes. */
195
+ declare function parseTime(v: unknown): number | null;
196
+ /**
197
+ * WeekSchedule — a week board: day columns × hour rows with meeting / focus / away blocks
198
+ * that move by drag or arrow keys and resize from their bottom edge.
199
+ */
200
+ declare function WeekSchedule({ events: eventsProp, defaultEvents, onEventsChange, onEventCommit, onEventActivate, days, startHour, endHour, step, hourHeight, hourFormat: formatProp, defaultHourFormat, onHourFormatChange, summary, summaryLabel, clockToggle, legend, readOnly, radius, className, style, ...rest }: WeekScheduleProps): react.JSX.Element;
201
+
202
+ export { ActionSquare, Canvas, PillButton, PosterCard, WeekSchedule, actionSquareRecipe, formatClock, formatRange, parseTime, pillButtonRecipe, toHHMM };
203
+ export type { ActionSquareProps, CanvasFill, CanvasProps, CanvasShape, CanvasShapePatch, CanvasShapeType, PillButtonProps, PosterCardProps, PosterOutline, WeekEvent, WeekEventKind, WeekHourFormat, WeekScheduleProps };