@structuralists/scaffolding 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +1 -1
- package/.storybook/preview.tsx +5 -1
- package/CLAUDE.md +25 -0
- package/bun.lock +211 -202
- package/eslint.config.mjs +85 -84
- package/package.json +21 -20
- package/roadmap.md +27 -0
- package/src/components/Chat/ChatComposer/ChatComposer.stories.tsx +1 -1
- package/src/components/Chat/ChatMessage/ChatMessage.stories.tsx +1 -1
- package/src/components/Chat/ChatRecipientsHeader/ChatRecipientsHeader.stories.tsx +1 -1
- package/src/components/Chat/ChatShell/ChatShell.stories.tsx +1 -1
- package/src/components/Chat/PillCombobox/PillCombobox.stories.tsx +1 -1
- package/src/components/Content/Badge/Badge.stories.tsx +1 -1
- package/src/components/Content/Card/Card.stories.tsx +1 -1
- package/src/components/Content/EditableMarkdown/EditableMarkdown.stories.tsx +1 -1
- package/src/components/Content/Heading/Heading.stories.tsx +1 -1
- package/src/components/Content/Link/Link.stories.tsx +1 -1
- package/src/components/Content/List/List.stories.tsx +1 -1
- package/src/components/Content/LoadingContainer/LoadingContainer.stories.tsx +1 -1
- package/src/components/Content/Markdown/Markdown.stories.tsx +1 -1
- package/src/components/Content/Menu/Menu.stories.tsx +1 -1
- package/src/components/Content/Text/Text.stories.tsx +1 -1
- package/src/components/Forms/Button/Button.stories.tsx +1 -1
- package/src/components/Forms/Field/Field.stories.tsx +1 -1
- package/src/components/Forms/IconButton/IconButton.stories.tsx +1 -1
- package/src/components/Forms/Input/Input.stories.tsx +1 -1
- package/src/components/Forms/Select/MultiSelect/MultiSelect.stories.tsx +1 -1
- package/src/components/Forms/Select/SingleSelect/SingleSelect.stories.tsx +1 -1
- package/src/components/Forms/Textarea/Textarea.stories.tsx +1 -1
- package/src/components/Json/Json/Json.stories.tsx +1 -1
- package/src/components/Json/JsonTable/JsonTable.stories.tsx +1 -1
- package/src/components/Layout/Bar/Bar.stories.tsx +1 -1
- package/src/components/Layout/Debug/Debug.stories.tsx +1 -1
- package/src/components/Layout/Divider/Divider.stories.tsx +1 -1
- package/src/components/Layout/Grid/Grid.stories.tsx +1 -1
- package/src/components/Layout/Panels/Panels.stories.tsx +47 -1
- package/src/components/Layout/Panels/index.tsx +17 -1
- package/src/components/Layout/Panels/types.ts +5 -0
- package/src/components/Layout/Stack/Stack.stories.tsx +1 -1
- package/src/components/Modals/ConfirmModal/ConfirmModal.stories.tsx +1 -1
- package/src/components/Modals/LargeModal/LargeModal.stories.tsx +1 -1
- package/src/components/Modals/MediumModal/MediumModal.stories.tsx +1 -1
- package/src/components/Navigation/TabBar/TabBar.stories.tsx +1 -1
- package/src/components/Navigation/VerticalNav/VerticalNav.stories.tsx +1 -1
- package/src/components/Overlays/Popover/Popover.stories.tsx +1 -1
- package/src/components/Overlays/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/Primitives/EmptyValue/EmptyValue.stories.tsx +1 -1
- package/src/components/Primitives/LinedStack/LinedStack.stories.tsx +1 -1
- package/src/components/Primitives/LongText/LongText.stories.tsx +1 -1
- package/src/components/Primitives/Num/Num.stories.tsx +1 -1
- package/src/components/Primitives/Percent/Percent.stories.tsx +1 -1
- package/src/components/Primitives/RelativeTime/RelativeTime.stories.tsx +1 -1
- package/src/components/Tables/BigTable/BigTable.stories.tsx +1 -1
- package/src/components/Tables/QuickTable/QuickTable.stories.tsx +1 -1
- package/src/forms/CLAUDE.md +144 -0
- package/src/forms/path/path.ts +50 -0
- package/src/forms/path/types.test-d.ts +175 -0
- package/src/forms/path/types.ts +35 -0
- package/src/forms/useFormState/types.ts +13 -0
- package/src/forms/useFormState/useFormState.ts +14 -0
- package/src/forms/validations/types.test-d.ts +26 -0
- package/src/forms/validations/types.ts +15 -0
- package/src/hooks/useClickOutside/index.ts +57 -0
- package/src/hooks/useStableCallback/index.ts +36 -0
- package/src/index.ts +2 -0
- package/src/storybook/Composition.stories.tsx +1 -1
- package/src/storybook/_StoryUtils.stories.tsx +1 -1
package/.storybook/main.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { StorybookConfig } from '@storybook/react-vite';
|
|
|
3
3
|
const config: StorybookConfig = {
|
|
4
4
|
framework: '@storybook/react-vite',
|
|
5
5
|
stories: ['../src/**/*.stories.@(ts|tsx)'],
|
|
6
|
-
addons: ['@storybook/addon-
|
|
6
|
+
addons: ['@storybook/addon-docs'],
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export default config;
|
package/.storybook/preview.tsx
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import type { Preview } from '@storybook/react';
|
|
1
|
+
import type { Preview } from '@storybook/react-vite';
|
|
2
2
|
import { MemoryRouter } from 'react-router';
|
|
3
3
|
import '../tokens.css';
|
|
4
4
|
|
|
5
5
|
const preview: Preview = {
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: 'padded',
|
|
8
|
+
|
|
9
|
+
docs: {
|
|
10
|
+
codePanel: true
|
|
11
|
+
}
|
|
8
12
|
},
|
|
9
13
|
decorators: [
|
|
10
14
|
(Story) => (
|
package/CLAUDE.md
CHANGED
|
@@ -28,3 +28,28 @@ export const Foo = ({ a, b, c }: FooProps) => {
|
|
|
28
28
|
Why: the destructuring line at the top of the body acts as a quick legend
|
|
29
29
|
of what the component reads from its props, scannable without parsing the
|
|
30
30
|
function signature. Keeps the call shape uniform across the package.
|
|
31
|
+
|
|
32
|
+
### Custom hook arguments
|
|
33
|
+
|
|
34
|
+
Project-defined hooks must take a single argument named `args` (an object)
|
|
35
|
+
and destructure on the first line of the function body — same shape as the
|
|
36
|
+
component-prop rule above.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
// ✅ correct
|
|
40
|
+
export const useFoo = (args: UseFooArgs) => {
|
|
41
|
+
const { a, b, c } = args;
|
|
42
|
+
// ...
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// ❌ wrong — positional args
|
|
46
|
+
export const useFoo = (a: string, b: number, c?: boolean) => {
|
|
47
|
+
// ...
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Why: named args read clearly at the call site (`useFoo({ a, b })`), survive
|
|
52
|
+
reordering, and let new optional fields be added without breaking callers.
|
|
53
|
+
Built-in React hooks (`useState`, `useEffect`, etc.) keep their stock
|
|
54
|
+
positional signatures — this rule applies only to hooks defined in this
|
|
55
|
+
package.
|