@you-agent-factory/components 0.0.0 → 0.0.2

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 (182) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +38 -7
  3. package/dist/category-paths.d.ts +3 -0
  4. package/dist/charts/chart-state-panel.d.ts +11 -0
  5. package/dist/charts/chart.d.ts +35 -0
  6. package/dist/charts/index.d.ts +5 -0
  7. package/dist/charts/index.js +287 -0
  8. package/dist/chunks/action-row.js +39 -0
  9. package/dist/chunks/alert-panel.js +182 -0
  10. package/dist/chunks/button.js +193 -0
  11. package/dist/chunks/cn.js +6 -0
  12. package/dist/chunks/factory-emulator-controls.js +123 -0
  13. package/dist/chunks/package-form-field.js +546 -0
  14. package/dist/chunks/scroll-area.js +261 -0
  15. package/dist/chunks/surface-panel.js +73 -0
  16. package/dist/chunks/table-layout.js +292 -0
  17. package/dist/chunks/typography-roles.js +26 -0
  18. package/dist/chunks/typography.js +129 -0
  19. package/dist/chunks/widget-frame.js +344 -0
  20. package/dist/data-display/code-panel.d.ts +12 -0
  21. package/dist/data-display/data-table.d.ts +27 -0
  22. package/dist/data-display/description-list.d.ts +4 -0
  23. package/{src/data-display/index.ts → dist/data-display/index.d.ts} +4 -26
  24. package/dist/data-display/index.js +20 -0
  25. package/dist/data-display/table-layout.d.ts +8 -0
  26. package/dist/data-display/table.d.ts +14 -0
  27. package/dist/factory-emulator/factory-emulator-controls.d.ts +23 -0
  28. package/dist/factory-emulator/index.d.ts +6 -0
  29. package/dist/factory-emulator/index.js +6 -0
  30. package/dist/feedback/alert-panel-semantics.d.ts +11 -0
  31. package/dist/feedback/alert-panel.d.ts +29 -0
  32. package/dist/feedback/index.d.ts +6 -0
  33. package/dist/feedback/index.js +10 -0
  34. package/dist/feedback/skeleton.d.ts +2 -0
  35. package/dist/forms/index.d.ts +19 -0
  36. package/dist/forms/index.js +37 -0
  37. package/dist/forms/package-checkbox.d.ts +3 -0
  38. package/dist/forms/package-enum-select.d.ts +42 -0
  39. package/dist/forms/package-file-input.d.ts +3 -0
  40. package/dist/forms/package-form-field.d.ts +49 -0
  41. package/dist/forms/package-input.d.ts +6 -0
  42. package/dist/forms/package-native-select.d.ts +3 -0
  43. package/dist/forms/package-select.d.ts +32 -0
  44. package/dist/forms/package-textarea.d.ts +10 -0
  45. package/dist/forms/select-icons.d.ts +3 -0
  46. package/dist/graphs/graph-edge-path.d.ts +18 -0
  47. package/dist/graphs/graph-edge.d.ts +15 -0
  48. package/dist/graphs/graph-node-button.d.ts +11 -0
  49. package/dist/graphs/graph-node-handle-badge.d.ts +5 -0
  50. package/dist/graphs/graph-node-handle.d.ts +18 -0
  51. package/dist/graphs/graph-node-shell.d.ts +13 -0
  52. package/dist/graphs/graph-node-state-indicator.d.ts +6 -0
  53. package/dist/graphs/graph-node-state.d.ts +23 -0
  54. package/dist/graphs/graph-viewport-surface.d.ts +5 -0
  55. package/dist/graphs/index.d.ts +13 -0
  56. package/dist/graphs/index.js +614 -0
  57. package/{src/icons/index.ts → dist/icons/index.d.ts} +1 -2
  58. package/dist/icons/index.js +4 -0
  59. package/dist/index.d.ts +26 -0
  60. package/dist/index.js +145 -0
  61. package/dist/layout/action-row.d.ts +8 -0
  62. package/{src/layout/index.ts → dist/layout/index.d.ts} +1 -3
  63. package/dist/layout/index.js +9 -0
  64. package/dist/layout/surface-panel.d.ts +15 -0
  65. package/{src/navigation/index.ts → dist/navigation/index.d.ts} +1 -2
  66. package/dist/navigation/index.js +4 -0
  67. package/dist/overlays/collapsible.d.ts +5 -0
  68. package/dist/overlays/dialog.d.ts +16 -0
  69. package/dist/overlays/index.d.ts +10 -0
  70. package/dist/overlays/index.js +27 -0
  71. package/dist/overlays/overlay-layout.d.ts +6 -0
  72. package/dist/overlays/popover.d.ts +6 -0
  73. package/dist/overlays/scroll-area.d.ts +9 -0
  74. package/dist/primitives/button-link.d.ts +5 -0
  75. package/dist/primitives/button.d.ts +9 -0
  76. package/dist/primitives/icon-button-shell.d.ts +10 -0
  77. package/{src/primitives/index.ts → dist/primitives/index.d.ts} +2 -19
  78. package/dist/primitives/index.js +49 -0
  79. package/dist/primitives/package-text.d.ts +6 -0
  80. package/dist/primitives/typography-roles.d.ts +12 -0
  81. package/dist/primitives/typography.d.ts +36 -0
  82. package/dist/recipes/index.d.ts +14 -0
  83. package/dist/recipes/index.js +32 -0
  84. package/dist/recipes/widget-frame-content.d.ts +24 -0
  85. package/dist/recipes/widget-frame-disclosure.d.ts +33 -0
  86. package/dist/recipes/widget-frame-layout.d.ts +12 -0
  87. package/dist/recipes/widget-frame-skeleton.d.ts +2 -0
  88. package/dist/recipes/widget-frame-states.d.ts +15 -0
  89. package/dist/recipes/widget-frame-typography.d.ts +10 -0
  90. package/dist/recipes/widget-frame.d.ts +12 -0
  91. package/{src → dist}/styles.css +36 -0
  92. package/dist/testing/index.d.ts +4 -0
  93. package/dist/testing/index.js +16 -0
  94. package/dist/testing/render.d.ts +5 -0
  95. package/{src/tokens/index.ts → dist/tokens/index.d.ts} +1 -2
  96. package/dist/tokens/index.js +4 -0
  97. package/dist/utilities/cn.d.ts +1 -0
  98. package/{src/utilities/index.ts → dist/utilities/index.d.ts} +1 -3
  99. package/dist/utilities/index.js +6 -0
  100. package/package.json +65 -64
  101. package/docs/README.md +0 -83
  102. package/docs/button.md +0 -119
  103. package/docs/charts.md +0 -325
  104. package/docs/data-display-code-panel.md +0 -120
  105. package/docs/feedback-alert-panel.md +0 -117
  106. package/docs/feedback-skeleton.md +0 -54
  107. package/docs/forms-form-field.md +0 -490
  108. package/docs/forms-input-primitives.md +0 -311
  109. package/docs/forms-select-primitives.md +0 -362
  110. package/docs/graphs.md +0 -250
  111. package/docs/layout-display-primitives.md +0 -211
  112. package/docs/overlays.md +0 -414
  113. package/docs/table-data-table.md +0 -331
  114. package/docs/typography-roles.md +0 -182
  115. package/docs/widget-frame-recipes.md +0 -273
  116. package/src/category-paths.ts +0 -20
  117. package/src/charts/chart-state-panel.tsx +0 -103
  118. package/src/charts/chart.tsx +0 -287
  119. package/src/charts/index.ts +0 -21
  120. package/src/data-display/code-panel.tsx +0 -67
  121. package/src/data-display/data-table.tsx +0 -180
  122. package/src/data-display/description-list.tsx +0 -24
  123. package/src/data-display/table-layout.ts +0 -12
  124. package/src/data-display/table.tsx +0 -131
  125. package/src/feedback/alert-panel-semantics.ts +0 -75
  126. package/src/feedback/alert-panel.tsx +0 -187
  127. package/src/feedback/index.ts +0 -21
  128. package/src/feedback/skeleton.tsx +0 -16
  129. package/src/forms/index.ts +0 -73
  130. package/src/forms/package-checkbox.tsx +0 -50
  131. package/src/forms/package-enum-select.tsx +0 -185
  132. package/src/forms/package-file-input.tsx +0 -25
  133. package/src/forms/package-form-field.tsx +0 -202
  134. package/src/forms/package-input.tsx +0 -25
  135. package/src/forms/package-native-select.tsx +0 -25
  136. package/src/forms/package-select.tsx +0 -209
  137. package/src/forms/package-textarea.tsx +0 -35
  138. package/src/forms/select-icons.tsx +0 -35
  139. package/src/graphs/graph-edge-path.ts +0 -241
  140. package/src/graphs/graph-edge.tsx +0 -130
  141. package/src/graphs/graph-interactive-example.tsx +0 -187
  142. package/src/graphs/graph-node-button.tsx +0 -51
  143. package/src/graphs/graph-node-handle-badge.tsx +0 -108
  144. package/src/graphs/graph-node-handle.ts +0 -28
  145. package/src/graphs/graph-node-shell.tsx +0 -111
  146. package/src/graphs/graph-node-state-indicator.tsx +0 -47
  147. package/src/graphs/graph-node-state.ts +0 -111
  148. package/src/graphs/graph-viewport-surface.tsx +0 -27
  149. package/src/graphs/index.ts +0 -41
  150. package/src/index.ts +0 -209
  151. package/src/layout/action-row.tsx +0 -53
  152. package/src/layout/surface-panel.tsx +0 -91
  153. package/src/overlays/collapsible.tsx +0 -22
  154. package/src/overlays/dialog.tsx +0 -148
  155. package/src/overlays/index.ts +0 -31
  156. package/src/overlays/overlay-layout.ts +0 -9
  157. package/src/overlays/popover.tsx +0 -29
  158. package/src/overlays/scroll-area.tsx +0 -78
  159. package/src/primitives/button-link.tsx +0 -22
  160. package/src/primitives/button.tsx +0 -258
  161. package/src/primitives/icon-button-shell.tsx +0 -49
  162. package/src/primitives/package-text.tsx +0 -29
  163. package/src/primitives/typography-roles.ts +0 -12
  164. package/src/primitives/typography.tsx +0 -165
  165. package/src/recipes/index.ts +0 -61
  166. package/src/recipes/widget-frame-content.tsx +0 -114
  167. package/src/recipes/widget-frame-disclosure.tsx +0 -161
  168. package/src/recipes/widget-frame-layout.ts +0 -40
  169. package/src/recipes/widget-frame-skeleton.tsx +0 -16
  170. package/src/recipes/widget-frame-states.tsx +0 -99
  171. package/src/recipes/widget-frame-typography.ts +0 -19
  172. package/src/recipes/widget-frame.tsx +0 -84
  173. package/src/testing/index.ts +0 -13
  174. package/src/testing/render.tsx +0 -16
  175. package/src/utilities/cn.ts +0 -5
  176. /package/{src → dist}/styles/color-palette-presets.css +0 -0
  177. /package/{src → dist}/styles/color-role-tokens.css +0 -0
  178. /package/{src → dist}/styles/layout-role-tokens.css +0 -0
  179. /package/{src → dist}/styles/text-color-role-tokens.css +0 -0
  180. /package/{src → dist}/styles/typography-role-tokens.css +0 -0
  181. /package/{src → dist}/styles/typography-role-utilities.css +0 -0
  182. /package/{src → dist}/styles/typography-roles.css +0 -0
@@ -11,6 +11,42 @@
11
11
  @import "./styles/typography-roles.css";
12
12
  @import "./styles/layout-role-tokens.css";
13
13
 
14
+ .factory-emulator-playback,
15
+ .factory-emulator-playback__actions,
16
+ .factory-emulator-playback__speed {
17
+ display: flex;
18
+ align-items: center;
19
+ gap: 0.5rem;
20
+ }
21
+
22
+ .factory-emulator-playback,
23
+ .factory-emulator-playback__actions {
24
+ flex-wrap: wrap;
25
+ }
26
+
27
+ .factory-emulator-playback {
28
+ inline-size: 100%;
29
+ }
30
+
31
+ .factory-emulator-playback__action,
32
+ .factory-emulator-playback__speed-select,
33
+ .factory-emulator-playback__status {
34
+ min-block-size: 2.25rem;
35
+ }
36
+
37
+ .factory-emulator-playback__action {
38
+ padding: 0.5rem 0.75rem;
39
+ }
40
+
41
+ .factory-emulator-playback__speed {
42
+ margin-inline-start: auto;
43
+ }
44
+
45
+ .factory-emulator-playback__speed-select,
46
+ .factory-emulator-playback__status {
47
+ padding: 0.5rem;
48
+ }
49
+
14
50
  @keyframes overlay-collapsible-down {
15
51
  from {
16
52
  height: 0;
@@ -0,0 +1,4 @@
1
+ /** Stable category path for `@you-agent-factory/components/testing`. */
2
+ export declare const COMPONENTS_CATEGORY: "testing";
3
+ export type ComponentsCategory = typeof COMPONENTS_CATEGORY;
4
+ export { render, renderPackageComponent, screen, userEvent, waitFor, within, } from "./render";
@@ -0,0 +1,16 @@
1
+ import { render } from "@testing-library/react";
2
+ import { render as render2, screen, waitFor, within } from "@testing-library/react";
3
+ import { default as default2 } from "@testing-library/user-event";
4
+ function renderPackageComponent(ui, options) {
5
+ return render(ui, options);
6
+ }
7
+ const COMPONENTS_CATEGORY = "testing";
8
+ export {
9
+ COMPONENTS_CATEGORY,
10
+ render2 as render,
11
+ renderPackageComponent,
12
+ screen,
13
+ default2 as userEvent,
14
+ waitFor,
15
+ within
16
+ };
@@ -0,0 +1,5 @@
1
+ import { type RenderOptions, type RenderResult } from "@testing-library/react";
2
+ import type { ReactElement } from "react";
3
+ export declare function renderPackageComponent(ui: ReactElement, options?: Omit<RenderOptions, "wrapper">): RenderResult;
4
+ export { fireEvent, render, screen, within, waitFor } from "@testing-library/react";
5
+ export { default as userEvent } from "@testing-library/user-event";
@@ -1,4 +1,3 @@
1
1
  /** Stable category path for `@you-agent-factory/components/tokens`. */
2
- export const COMPONENTS_CATEGORY = "tokens" as const;
3
-
2
+ export declare const COMPONENTS_CATEGORY: "tokens";
4
3
  export type ComponentsCategory = typeof COMPONENTS_CATEGORY;
@@ -0,0 +1,4 @@
1
+ const COMPONENTS_CATEGORY = "tokens";
2
+ export {
3
+ COMPONENTS_CATEGORY
4
+ };
@@ -0,0 +1 @@
1
+ export declare function cn(...classes: Array<false | null | string | undefined>): string;
@@ -1,6 +1,4 @@
1
1
  /** Stable category path for `@you-agent-factory/components/utilities`. */
2
- export const COMPONENTS_CATEGORY = "utilities" as const;
3
-
2
+ export declare const COMPONENTS_CATEGORY: "utilities";
4
3
  export type ComponentsCategory = typeof COMPONENTS_CATEGORY;
5
-
6
4
  export { cn } from "./cn";
@@ -0,0 +1,6 @@
1
+ import { c } from "../chunks/cn.js";
2
+ const COMPONENTS_CATEGORY = "utilities";
3
+ export {
4
+ COMPONENTS_CATEGORY,
5
+ c as cn
6
+ };
package/package.json CHANGED
@@ -1,122 +1,123 @@
1
1
  {
2
2
  "name": "@you-agent-factory/components",
3
- "description": "Reusable presentation components, design tokens, and docs for You Agent Factory UIs.",
4
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
+ "description": "Domain-free React components, design tokens, and utilities for public visualizers.",
5
5
  "license": "MIT",
6
- "type": "module",
7
- "homepage": "https://github.com/portpowered/you-agent-factory#readme",
8
6
  "repository": {
9
7
  "type": "git",
10
8
  "url": "git+https://github.com/portpowered/you-agent-factory.git",
11
9
  "directory": "ui/packages/components"
12
10
  },
13
- "bugs": {
14
- "url": "https://github.com/portpowered/you-agent-factory/issues"
15
- },
16
11
  "publishConfig": {
17
12
  "access": "public"
18
13
  },
19
14
  "files": [
20
- "README.md",
21
- "docs/**/*.md",
22
- "src/**/*.css",
23
- "src/**/*.ts",
24
- "src/**/*.tsx",
25
- "!src/**/*.test.ts",
26
- "!src/**/*.test.tsx",
27
- "!src/**/*.stories.ts",
28
- "!src/**/*.stories.tsx",
29
- "!src/**/*.harness.test.ts",
30
- "!src/**/*.integration.test.tsx",
31
- "!src/**/storybook-*.ts",
32
- "!src/**/storybook-*.tsx",
33
- "!src/**/package-*-story-support.tsx",
34
- "!src/**/*story-fixtures.ts",
35
- "!src/**/overlay-story*.ts",
36
- "!src/**/compile-package-token-styles.ts",
37
- "!src/**/package-token-fixture-usage.ts",
38
- "!src/**/package-token-styles-fixture.css",
39
- "!src/testing/package-browser-shims.ts",
40
- "!src/testing/react-flow-test-shims.ts",
41
- "!src/testing/vitest.setup.ts",
42
- "!src/vite-aliases.ts"
15
+ "dist",
16
+ "LICENSE.md",
17
+ "README.md"
43
18
  ],
19
+ "type": "module",
44
20
  "sideEffects": [
45
21
  "*.css",
46
22
  "**/*.css"
47
23
  ],
48
24
  "exports": {
49
25
  ".": {
50
- "types": "./src/index.ts",
51
- "default": "./src/index.ts"
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js",
28
+ "default": "./dist/index.js"
52
29
  },
53
- "./styles.css": "./src/styles.css",
30
+ "./styles.css": "./dist/styles.css",
54
31
  "./primitives": {
55
- "types": "./src/primitives/index.ts",
56
- "default": "./src/primitives/index.ts"
32
+ "types": "./dist/primitives/index.d.ts",
33
+ "import": "./dist/primitives/index.js",
34
+ "default": "./dist/primitives/index.js"
57
35
  },
58
36
  "./forms": {
59
- "types": "./src/forms/index.ts",
60
- "default": "./src/forms/index.ts"
37
+ "types": "./dist/forms/index.d.ts",
38
+ "import": "./dist/forms/index.js",
39
+ "default": "./dist/forms/index.js"
61
40
  },
62
41
  "./layout": {
63
- "types": "./src/layout/index.ts",
64
- "default": "./src/layout/index.ts"
42
+ "types": "./dist/layout/index.d.ts",
43
+ "import": "./dist/layout/index.js",
44
+ "default": "./dist/layout/index.js"
65
45
  },
66
46
  "./feedback": {
67
- "types": "./src/feedback/index.ts",
68
- "default": "./src/feedback/index.ts"
47
+ "types": "./dist/feedback/index.d.ts",
48
+ "import": "./dist/feedback/index.js",
49
+ "default": "./dist/feedback/index.js"
69
50
  },
70
51
  "./data-display": {
71
- "types": "./src/data-display/index.ts",
72
- "default": "./src/data-display/index.ts"
52
+ "types": "./dist/data-display/index.d.ts",
53
+ "import": "./dist/data-display/index.js",
54
+ "default": "./dist/data-display/index.js"
73
55
  },
74
56
  "./navigation": {
75
- "types": "./src/navigation/index.ts",
76
- "default": "./src/navigation/index.ts"
57
+ "types": "./dist/navigation/index.d.ts",
58
+ "import": "./dist/navigation/index.js",
59
+ "default": "./dist/navigation/index.js"
77
60
  },
78
61
  "./overlays": {
79
- "types": "./src/overlays/index.ts",
80
- "default": "./src/overlays/index.ts"
62
+ "types": "./dist/overlays/index.d.ts",
63
+ "import": "./dist/overlays/index.js",
64
+ "default": "./dist/overlays/index.js"
81
65
  },
82
66
  "./charts": {
83
- "types": "./src/charts/index.ts",
84
- "default": "./src/charts/index.ts"
67
+ "types": "./dist/charts/index.d.ts",
68
+ "import": "./dist/charts/index.js",
69
+ "default": "./dist/charts/index.js"
70
+ },
71
+ "./factory-emulator": {
72
+ "types": "./dist/factory-emulator/index.d.ts",
73
+ "import": "./dist/factory-emulator/index.js",
74
+ "default": "./dist/factory-emulator/index.js"
85
75
  },
86
76
  "./graphs": {
87
- "types": "./src/graphs/index.ts",
88
- "default": "./src/graphs/index.ts"
77
+ "types": "./dist/graphs/index.d.ts",
78
+ "import": "./dist/graphs/index.js",
79
+ "default": "./dist/graphs/index.js"
89
80
  },
90
81
  "./recipes": {
91
- "types": "./src/recipes/index.ts",
92
- "default": "./src/recipes/index.ts"
82
+ "types": "./dist/recipes/index.d.ts",
83
+ "import": "./dist/recipes/index.js",
84
+ "default": "./dist/recipes/index.js"
93
85
  },
94
86
  "./icons": {
95
- "types": "./src/icons/index.ts",
96
- "default": "./src/icons/index.ts"
87
+ "types": "./dist/icons/index.d.ts",
88
+ "import": "./dist/icons/index.js",
89
+ "default": "./dist/icons/index.js"
97
90
  },
98
91
  "./utilities": {
99
- "types": "./src/utilities/index.ts",
100
- "default": "./src/utilities/index.ts"
92
+ "types": "./dist/utilities/index.d.ts",
93
+ "import": "./dist/utilities/index.js",
94
+ "default": "./dist/utilities/index.js"
101
95
  },
102
96
  "./testing": {
103
- "types": "./src/testing/index.ts",
104
- "default": "./src/testing/index.ts"
97
+ "types": "./dist/testing/index.d.ts",
98
+ "import": "./dist/testing/index.js",
99
+ "default": "./dist/testing/index.js"
105
100
  },
106
101
  "./tokens": {
107
- "types": "./src/tokens/index.ts",
108
- "default": "./src/tokens/index.ts"
102
+ "types": "./dist/tokens/index.d.ts",
103
+ "import": "./dist/tokens/index.js",
104
+ "default": "./dist/tokens/index.js"
109
105
  }
110
106
  },
111
107
  "scripts": {
108
+ "build": "node scripts/build-package.mjs",
112
109
  "build-storybook": "storybook build --loglevel warn",
110
+ "check:installed-consumer": "node scripts/verify-installed-consumer.mjs",
111
+ "check:pack": "node scripts/verify-package-pack.mjs",
113
112
  "check:package-boundary": "node scripts/check-package-boundary.mjs",
114
113
  "check:package-dependency-direction": "node scripts/check-package-dependency-direction.mjs",
114
+ "prepack": "bun run build",
115
115
  "storybook": "storybook dev -p 6017",
116
116
  "test": "bun run test:unit && bun run check:package-boundary && bun run check:package-dependency-direction",
117
+ "test:build": "bun run build && vitest run --config vitest.build.config.ts",
117
118
  "test:unit": "vitest run --config vitest.config.ts",
118
119
  "typecheck": "tsc -b --noEmit --pretty false",
119
- "verify": "bun run typecheck && bun run test:unit && bun run build-storybook && bun run check:package-boundary && bun run check:package-dependency-direction",
120
+ "verify": "bun run build && bun run typecheck && bun run test:unit && bun run build-storybook && bun run check:package-boundary && bun run check:package-dependency-direction && bun run check:pack && bun run check:installed-consumer",
120
121
  "verify:form-field-storybook-browser": "node scripts/verify-package-form-field-storybook-browser.mjs",
121
122
  "verify:graph-storybook-viewport-browser": "node scripts/verify-graph-storybook-viewport-browser.mjs",
122
123
  "verify:storybook-browser": "node scripts/verify-package-storybook-browser.mjs",
@@ -131,6 +132,8 @@
131
132
  "@radix-ui/react-scroll-area": "^1.2.10",
132
133
  "@radix-ui/react-select": "^2.3.0",
133
134
  "@radix-ui/react-slot": "^1.2.3",
135
+ "@testing-library/react": "^16.3.0",
136
+ "@testing-library/user-event": "^14.6.1",
134
137
  "@xyflow/react": "^12.10.2",
135
138
  "recharts": "^3.8.1"
136
139
  },
@@ -144,8 +147,6 @@
144
147
  "@tailwindcss/vite": "^4.2.2",
145
148
  "@vitejs/plugin-react-swc": "^4.1.0",
146
149
  "@testing-library/jest-dom": "^6.9.1",
147
- "@testing-library/react": "^16.3.0",
148
- "@testing-library/user-event": "^14.6.1",
149
150
  "@types/react": "^19.2.2",
150
151
  "@types/react-dom": "^19.2.2",
151
152
  "happy-dom": "^20.9.0",
package/docs/README.md DELETED
@@ -1,83 +0,0 @@
1
- # Component package documentation
2
-
3
- Per-component usage notes, props tables, and examples belong in this
4
- directory. Add one markdown file per component (or small component group) as
5
- those surfaces are documented.
6
-
7
- ## What belongs here
8
-
9
- - Import paths and category entrypoints for a component
10
- - Props, variants, and accessibility notes
11
- - Short usage examples that do not depend on dashboard routes or API clients
12
-
13
- ## What does not belong here
14
-
15
- - Dashboard-only wiring, data fetching, or business workflow guides
16
- - Generated docs registries, docs-site routes, or build-time documentation
17
- tooling
18
-
19
- This docs shell is plain markdown kept under version control. Host applications
20
- read it directly from the package; no docs-site implementation is required.
21
-
22
- ## Documented components
23
-
24
- - [Button primitives](./button.md) — `Button`, `ButtonLink`, `IconButtonShell`,
25
- semantic variants, loading behavior, and icon-only accessibility labels.
26
- - [Typography roles](./typography-roles.md) — `Text`, `Heading`, `Label`,
27
- `Code`, dense text, truncation, and wrapping
28
- - [Layout and display primitives](./layout-display-primitives.md) —
29
- `SurfacePanel`, `ActionRow`, `DescriptionList`, and responsive layout guidance
30
- - [Form select primitives](./forms-select-primitives.md) — `Select`,
31
- `NativeSelect`, `EnumSelect`, keyboard behavior, and option contracts
32
- - [Form field structure and messaging](./forms-form-field.md) — `FormField`,
33
- labels, descriptions, helper text, warnings, errors, success messages,
34
- grouped-control semantics, and host validation responsibilities
35
- - [Overlay and disclosure primitives](./overlays.md) — Dialog, Popover,
36
- Collapsible, and ScrollArea accessibility, labeling, focus, and overflow
37
- guidance.
38
-
39
- ## Getting started
40
-
41
- See the package [README](../README.md) for install, CSS import setup, theming,
42
- and consumer dependency boundaries. Link new component docs from that README or
43
- from sibling files in this directory as the library grows.
44
-
45
- ## Component guides
46
-
47
- - [Charts](./charts.md) — `ChartContainer`, tooltip and legend content, state
48
- panels, config types, and host-owned data boundaries
49
-
50
- ## Form input primitives
51
-
52
- - [Form input primitives](./forms-input-primitives.md) — import paths, controlled
53
- versus uncontrolled usage, host accessibility responsibilities, and
54
- presentation-only boundaries for text input, textarea, checkbox, and file input.
55
- - [Form field structure and messaging](./forms-form-field.md) — `FormField`,
56
- labels, descriptions, helper text, warnings, errors, success messages,
57
- grouped-control semantics, `buildFormFieldAriaDescribedBy`, and host validation
58
- responsibilities.
59
-
60
- ## Feedback and code display
61
-
62
- - [AlertPanel](./feedback-alert-panel.md) — semantic feedback variants, token
63
- mapping, accessibility, and Storybook references
64
- - [Skeleton](./feedback-skeleton.md) — loading placeholders, busy regions, and
65
- empty vs loading feedback
66
- - [CodePanel](./data-display-code-panel.md) — long-line and long-block
67
- containment, scrolling, and responsive layout expectations
68
-
69
- ## Table data display
70
-
71
- - [Table primitives and DataTable](./table-data-table.md) — generic row contract,
72
- explicit data states, density and responsive layout helpers, accessibility,
73
- and Storybook references for domain-free tabular data display.
74
-
75
- ## Widget layout recipes
76
-
77
- - [Graph primitives](./graphs.md) — `@you-agent-factory/components/graphs`
78
- contracts, React Flow boundary, host responsibilities, and Storybook example
79
- map
80
- - [Widget frame and layout recipes](./widget-frame-recipes.md) — import paths,
81
- state ownership, accessibility, Storybook references, and source-copy guidance
82
- for domain-free framed panels.
83
-
package/docs/button.md DELETED
@@ -1,119 +0,0 @@
1
- # Button primitives
2
-
3
- `Button`, `ButtonLink`, and `IconButtonShell` are the reusable action primitives in
4
- `@you-agent-factory/components`. They provide semantic tones, loading behavior,
5
- icon-only sizing, and shared focus-visible treatment without dashboard routes,
6
- providers, API clients, or generated OpenAPI types.
7
-
8
- ## Import paths
9
-
10
- ```ts
11
- import {
12
- Button,
13
- ButtonLink,
14
- IconButtonShell,
15
- buttonVariants,
16
- type ButtonProps,
17
- type ButtonLinkProps,
18
- type IconButtonShellProps,
19
- } from "@you-agent-factory/components";
20
-
21
- import {
22
- Button as PrimitiveButton,
23
- ButtonLink as PrimitiveButtonLink,
24
- IconButtonShell as PrimitiveIconButtonShell,
25
- } from "@you-agent-factory/components/primitives";
26
- ```
27
-
28
- Import `@you-agent-factory/components/styles.css` once in the host application
29
- before rendering buttons. See the package [README](../README.md) for CSS setup.
30
-
31
- ## Button vs ButtonLink
32
-
33
- | Primitive | Renders | Use when |
34
- | --- | --- | --- |
35
- | `Button` | `<button>` (or child via `asChild`) | The action stays on the current view: submit forms, open dialogs, trigger async work, or run in-place commands. |
36
- | `ButtonLink` | `<a>` styled with shared button tokens | Navigation should use a real link: route changes, external URLs, or downloads where anchor semantics and `href` behavior are required. |
37
-
38
- `ButtonLink` does not support `loading` because anchor elements do not expose the
39
- same busy/disabled interaction model as buttons. Show progress elsewhere when a
40
- navigation target is not yet ready.
41
-
42
- `Button` supports `asChild` for composition, but prefer `ButtonLink` when the
43
- rendered element must be an anchor.
44
-
45
- ## Semantic button variants
46
-
47
- Set `tone` on `Button` and `ButtonLink`, or on `IconButtonShell` for toolbar
48
- actions. Variants map to semantic roles rather than dashboard feature styling.
49
-
50
- | `tone` | Role | When to use |
51
- | --- | --- | --- |
52
- | `default` | Primary | The single most important action in a section or dialog footer. |
53
- | `secondary` | Secondary | Supporting actions that still need button emphasis, such as "Save draft". |
54
- | `outline` | Outline | Neutral actions on busy surfaces or paired secondary controls in toolbars. |
55
- | `ghost` | Ghost | Low-emphasis actions on dense panels where borders would add noise. |
56
- | `destructive` | Destructive | Irreversible or high-risk operations such as delete or remove. Keep the label specific; do not rely on color alone. |
57
- | `warning` | Warning | Actions that need caution but are not strictly destructive, such as "Review warnings". |
58
-
59
- `IconButtonShell` also supports `tone="dangerGhost"` for compact destructive icon
60
- actions. It keeps icon-button sizing while applying destructive hover treatment.
61
-
62
- ### Sizes
63
-
64
- `Button` and `ButtonLink` accept `size` values such as `default`, `sm`, `lg`,
65
- `pill`, `icon`, and `iconPill`. `IconButtonShell` fixes toolbar-friendly
66
- `h-10 w-10` icon sizing and should be used for compact icon-only controls.
67
-
68
- ## Loading buttons
69
-
70
- Pass `loading` to `Button` (including `IconButtonShell`) when an action is in
71
- progress:
72
-
73
- - Sets `aria-busy="true"` and disables the control to prevent duplicate activation.
74
- - Preserves the accessible name from visible text or `aria-label`.
75
- - Renders a centered spinner overlay while keeping label content in the accessibility tree.
76
-
77
- Do not attach separate click handlers that ignore the disabled state while
78
- `loading` is true.
79
-
80
- ## Icon-only accessibility
81
-
82
- Icon-only buttons must expose a clear accessible name:
83
-
84
- - Prefer visible text when space allows.
85
- - Otherwise provide `aria-label` with a specific action name such as
86
- `"Refresh jobs"` or `"Export dashboard"`.
87
- - Mark decorative icons with `aria-hidden="true"` so screen readers use the
88
- button label only.
89
-
90
- `IconButtonShell` inherits the `h-11 w-11` / toolbar touch target from the
91
- shared button size tokens. Avoid shrinking icon-only controls below the package
92
- defaults unless the host design system documents an exception.
93
-
94
- ## Host application responsibilities
95
-
96
- The component package owns presentation: markup, semantic tones, focus rings,
97
- loading overlays, and token-backed styling.
98
-
99
- Host applications own:
100
-
101
- - **Action copy** — button labels, `aria-label` text, and confirmation messaging.
102
- - **Click handlers** — business logic, validation, and error handling.
103
- - **Routing** — `href` values, client-side navigation, and download targets for `ButtonLink`.
104
- - **Domain workflows** — when an action is enabled, loading, or destructive in product context.
105
-
106
- Pass data and callbacks into button primitives as props. Do not expect the
107
- package to read app stores, routers, or API layers.
108
-
109
- ## Storybook examples
110
-
111
- Package Storybook stories demonstrate expected states with package imports only:
112
-
113
- - `Primitives/Button/Semantic variants` — normal, disabled, destructive, warning,
114
- and link-like examples.
115
- - `Primitives/Button/Loading and icon only` — loading, focus-visible, icon-only,
116
- and destructive icon shell examples.
117
-
118
- Run `bun run storybook` from `ui/packages/components` or inspect the static
119
- build with `bun run build-storybook`.