@app-studio/components 0.11.9 → 0.11.11
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/dist/apple-touch-icon.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.svg +4 -0
- package/dist/icon-512.png +0 -0
- package/dist/index.d.ts +4 -0
- package/dist/indexnow-key.txt +1 -0
- package/dist/manifest.json +9 -9
- package/dist/native/components/Modal/Modal/Modal.props.d.ts +2 -0
- package/dist/native/design-system/DesignSystemProvider.d.ts +2 -0
- package/dist/native/design-system/DesignSystemProvider.js +2 -2
- package/dist/native/design-system/DesignSystemProvider.js.map +1 -1
- package/dist/robots.txt +7 -2
- package/dist/web.cjs.js +1 -1
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.esm.js +12 -10
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.js +1 -1
- package/dist/web.umd.js.map +1 -1
- package/docs/README.md +81 -3
- package/docs/guides/accessibility.mdx +51 -0
- package/docs/guides/ai-assistants.mdx +43 -0
- package/docs/guides/animation.mdx +58 -0
- package/docs/guides/core.mdx +68 -0
- package/docs/guides/forms.mdx +79 -0
- package/docs/guides/hooks.mdx +92 -0
- package/docs/guides/installation.mdx +96 -0
- package/docs/guides/overview.mdx +53 -0
- package/docs/guides/providers.mdx +51 -0
- package/docs/guides/quick-start.mdx +71 -0
- package/docs/guides/react-native.mdx +53 -0
- package/docs/guides/responsive.mdx +65 -0
- package/docs/guides/styling.mdx +115 -0
- package/docs/guides/theming.mdx +70 -0
- package/docs/guides/troubleshooting.mdx +45 -0
- package/docs/seo-geo.md +53 -0
- package/package.json +8 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Providers
|
|
2
|
+
|
|
3
|
+
Providers share configuration through React context. Start with the theme and responsive providers; add optional contexts only when your app consumes them.
|
|
4
|
+
|
|
5
|
+
## The usual starting point
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { ThemeProvider, ResponsiveProvider, Vertical, Text } from 'app-studio';
|
|
10
|
+
|
|
11
|
+
export function ProviderSetup() {
|
|
12
|
+
return (
|
|
13
|
+
<ThemeProvider mode="light" theme={{ primary: 'color-blue-900' }}>
|
|
14
|
+
<ResponsiveProvider>
|
|
15
|
+
<Vertical padding={24} gap={12}>
|
|
16
|
+
<Text color="theme-primary" fontWeight="bold">
|
|
17
|
+
Shared configuration
|
|
18
|
+
</Text>
|
|
19
|
+
<Text>Your application's screens belong inside these providers.</Text>
|
|
20
|
+
</Vertical>
|
|
21
|
+
</ResponsiveProvider>
|
|
22
|
+
</ThemeProvider>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Keep this setup near your app's root. Your router, state, and data providers remain ordinary React providers alongside it.
|
|
28
|
+
|
|
29
|
+
## ThemeProvider
|
|
30
|
+
|
|
31
|
+
`theme` maps semantic tokens such as `primary` to colors. `mode` selects `light` or `dark`. The optional `light` and `dark` props customize palette configuration.
|
|
32
|
+
|
|
33
|
+
The hook API uses different names: `useTheme()` returns `themeMode` and `setThemeMode`, as well as color resolution helpers. See [Colors & theming](/docs/theming) and [Hooks](/docs/hooks).
|
|
34
|
+
|
|
35
|
+
## ResponsiveProvider
|
|
36
|
+
|
|
37
|
+
`breakpoints` defines screen sizes and `devices` groups them into names such as `mobile`. Descendants use that configuration through `media` or `useResponsive()`.
|
|
38
|
+
|
|
39
|
+
Keep device names consistent with the rules in your components. See [Responsive layouts](/docs/responsive).
|
|
40
|
+
|
|
41
|
+
## Optional providers
|
|
42
|
+
|
|
43
|
+
**`WindowSizeProvider`** supplies dimensions to `useWindowSize()`. Add it around the consumers that need window measurements. Responsive styling does not require you to add window measurements to every component.
|
|
44
|
+
|
|
45
|
+
**`AnalyticsProvider`** accepts a `trackEvent` callback. Wire it only if your application needs event tracking; it is not required for basic styling or component rendering.
|
|
46
|
+
|
|
47
|
+
## Scope configuration deliberately
|
|
48
|
+
|
|
49
|
+
React context follows the component tree. Keep shared configuration at the root and use nested providers for a deliberate local variation. Test portaled controls, such as dialogs, when a local theme differs from the surrounding app.
|
|
50
|
+
|
|
51
|
+
The native build exposes the corresponding providers with platform-specific dimension tracking. See [React Native](/docs/react-native).
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Quick start
|
|
2
|
+
|
|
3
|
+
Build a small interface with real React state. Complete [Installation](/docs/installation) first; this example needs both packages and their web peers.
|
|
4
|
+
|
|
5
|
+
## Start with a working screen
|
|
6
|
+
|
|
7
|
+
Copy this into your app's entry component. Edit the name, toggle notifications, and press the button. This example updates local state only; it does not save data to a server.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { ThemeProvider, ResponsiveProvider, Vertical, Text } from 'app-studio';
|
|
12
|
+
import { Button, TextField, Switch } from '@app-studio/components';
|
|
13
|
+
|
|
14
|
+
export default function App() {
|
|
15
|
+
const [name, setName] = React.useState('My project');
|
|
16
|
+
const [notifications, setNotifications] = React.useState(true);
|
|
17
|
+
const [message, setMessage] = React.useState('');
|
|
18
|
+
return (
|
|
19
|
+
<ThemeProvider theme={{ primary: 'color-blue-900' }}>
|
|
20
|
+
<ResponsiveProvider>
|
|
21
|
+
<Vertical
|
|
22
|
+
gap={16}
|
|
23
|
+
padding={32}
|
|
24
|
+
maxWidth={480}
|
|
25
|
+
media={{ mobile: { padding: 16 } }}
|
|
26
|
+
>
|
|
27
|
+
<Text as="h2" fontSize={28} fontWeight="bold">
|
|
28
|
+
Your first interface
|
|
29
|
+
</Text>
|
|
30
|
+
<TextField label="Project name" value={name} onChange={setName} />
|
|
31
|
+
<Switch
|
|
32
|
+
label="Enable notifications"
|
|
33
|
+
isChecked={notifications}
|
|
34
|
+
onChange={setNotifications}
|
|
35
|
+
/>
|
|
36
|
+
<Button
|
|
37
|
+
isDisabled={!name.trim()}
|
|
38
|
+
onClick={() =>
|
|
39
|
+
setMessage(
|
|
40
|
+
`${name.trim()}: notifications ${notifications ? 'on' : 'off'}.`
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
>
|
|
44
|
+
Preview settings
|
|
45
|
+
</Button>
|
|
46
|
+
<Text role="status">{message}</Text>
|
|
47
|
+
</Vertical>
|
|
48
|
+
</ResponsiveProvider>
|
|
49
|
+
</ThemeProvider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Understand the imports
|
|
55
|
+
|
|
56
|
+
`ThemeProvider`, `ResponsiveProvider`, `Vertical`, and `Text` come from the framework. `Button`, `TextField`, and `Switch` come from the ready-made component library.
|
|
57
|
+
|
|
58
|
+
`Vertical` stacks children. `gap` sets space between them. `padding` and the `media` override describe the layout alongside its structure.
|
|
59
|
+
|
|
60
|
+
## Connect state with values
|
|
61
|
+
|
|
62
|
+
`TextField` calls `onChange` with the new string. `Switch` and `Checkbox` call it with a boolean. Pass your setter directly, or transform the value in your callback. These callbacks do not pass a DOM change event.
|
|
63
|
+
|
|
64
|
+
The empty-name check disables the button. Your app remains responsible for validation and persistence; a styled control does not save data automatically.
|
|
65
|
+
|
|
66
|
+
## Make one change at a time
|
|
67
|
+
|
|
68
|
+
- Change `theme.primary` in [Colors & theming](/docs/theming).
|
|
69
|
+
- Choose variants or customize internal views in [Styling & composition](/docs/styling).
|
|
70
|
+
- Connect a complete form in [Forms & validation](/docs/forms).
|
|
71
|
+
- Use the [component browser](/docs/components) to find your next building block.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# React Native
|
|
2
|
+
|
|
3
|
+
Both packages ship dedicated native builds. Sharing an API reduces repetition, but each platform still needs its own setup and verification.
|
|
4
|
+
|
|
5
|
+
## Requirements and installation
|
|
6
|
+
|
|
7
|
+
Use an existing React Native project with package exports enabled. The current core package declares React Native 0.79 or newer. Keep the React version required by your native project.
|
|
8
|
+
|
|
9
|
+
For the framework alone:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install app-studio
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For the ready-made component library:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install app-studio @app-studio/components lucide-react-native
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The native app provides `react` and `react-native`. Do not add React DOM or React Router just to use native primitives.
|
|
22
|
+
|
|
23
|
+
## Package resolution
|
|
24
|
+
|
|
25
|
+
Import from `app-studio` and `@app-studio/components` as usual. Metro uses the `react-native` export condition to choose native implementations. Do not import browser bundle paths into a native screen.
|
|
26
|
+
|
|
27
|
+
For a native TypeScript consumer, follow your framework's configuration and the libraries' native guide. If the wrong typings are selected, check package-export support and the `react-native` custom condition rather than suppressing errors.
|
|
28
|
+
|
|
29
|
+
## Providers
|
|
30
|
+
|
|
31
|
+
Use `ThemeProvider` for tokens and `ResponsiveProvider` for responsive rules, as on web. Put them near your native app's root. Text content should use the library's text components rather than assuming a DOM container can render text.
|
|
32
|
+
|
|
33
|
+
## Optional native features
|
|
34
|
+
|
|
35
|
+
- `react-native-reanimated` enables supported animation presets.
|
|
36
|
+
- `react-native-svg` is used by components that render SVG.
|
|
37
|
+
- `react-native-linear-gradient` supports native gradients.
|
|
38
|
+
- `lucide-react-native` supplies native icons where used.
|
|
39
|
+
|
|
40
|
+
Install only the peers required by the components you use. Follow their version-specific setup and run pod installation when your iOS project requires it.
|
|
41
|
+
|
|
42
|
+
## Differences to plan for
|
|
43
|
+
|
|
44
|
+
- **Availability:** some components are web-only. Check the compatibility matrix before importing a screen's controls.
|
|
45
|
+
- **Layout:** CSS Grid maps to supported fixed-column native layouts, not the entire CSS Grid feature set.
|
|
46
|
+
- **Interaction:** browser hover selectors and pseudo-elements do not apply to touch interfaces.
|
|
47
|
+
- **Forms:** submission, return keys, and focus need explicit native wiring.
|
|
48
|
+
- **Navigation:** use your native navigation setup; browser link behavior is not a native route model.
|
|
49
|
+
- **Accessibility:** test native labels, roles, focus, and screen-reader behavior separately.
|
|
50
|
+
|
|
51
|
+
## Compatibility reference
|
|
52
|
+
|
|
53
|
+
Use the [component compatibility matrix and setup guide](https://github.com/rize-network/app-studio-components/blob/main/docs/getting-started/react-native.md) and the [framework native mappings](https://github.com/rize-network/app-studio/blob/main/docs/Native.md). The previews on this documentation site run in a browser and do not prove native compatibility.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Responsive layouts
|
|
2
|
+
|
|
3
|
+
Use the `media` prop for layout and style changes. Use responsive hooks when the rendered behavior or content must change. Configure both through `ResponsiveProvider`.
|
|
4
|
+
|
|
5
|
+
## Adapt a layout with media
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { Horizontal, Vertical, Text } from 'app-studio';
|
|
10
|
+
import { Button } from '@app-studio/components';
|
|
11
|
+
|
|
12
|
+
export function ResponsiveActions() {
|
|
13
|
+
return (
|
|
14
|
+
<Horizontal
|
|
15
|
+
gap={24}
|
|
16
|
+
padding={24}
|
|
17
|
+
alignItems="center"
|
|
18
|
+
justifyContent="space-between"
|
|
19
|
+
media={{
|
|
20
|
+
mobile: { flexDirection: 'column', alignItems: 'stretch', padding: 16 },
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
<Vertical gap={8}>
|
|
24
|
+
<Text fontSize={22} fontWeight="bold">
|
|
25
|
+
Ready for any screen
|
|
26
|
+
</Text>
|
|
27
|
+
<Text>Resize the viewport to change the layout.</Text>
|
|
28
|
+
</Vertical>
|
|
29
|
+
<Button>Continue</Button>
|
|
30
|
+
</Horizontal>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Named devices such as `mobile` depend on your provider configuration. They are not independent magic widths. On web, style overrides use media queries rather than requiring a hook-driven render.
|
|
36
|
+
|
|
37
|
+
## Configure breakpoints
|
|
38
|
+
|
|
39
|
+
The shipped defaults use `xs: 0`, `sm: 340`, `md: 560`, `lg: 1080`, and `xl: 1300`. You can supply explicit project breakpoints and device groups:
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const breakpoints = { xs: 0, sm: 480, md: 768, lg: 1024, xl: 1440 };
|
|
43
|
+
const devices = {
|
|
44
|
+
mobile: ['xs', 'sm'],
|
|
45
|
+
tablet: ['md'],
|
|
46
|
+
desktop: ['lg', 'xl'],
|
|
47
|
+
};
|
|
48
|
+
// Pass both objects to ResponsiveProvider near the root.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Keep this configuration shared across screens. Changing it changes every named-device rule beneath that provider.
|
|
52
|
+
|
|
53
|
+
## When to use a hook
|
|
54
|
+
|
|
55
|
+
`useResponsive()` exposes helpers such as `on('mobile')` for device-aware logic. Hook-driven decisions re-render when the responsive state changes. Prefer `media` for purely visual changes and avoid hiding essential content on small screens.
|
|
56
|
+
|
|
57
|
+
## Native and constrained layouts
|
|
58
|
+
|
|
59
|
+
Native responsive state follows window dimensions, including rotation and split-screen. CSS Grid does not exist on native: use a fixed integer column count for the supported mapping or explicit Flexbox layouts.
|
|
60
|
+
|
|
61
|
+
A browser-window breakpoint is not the same as the width of a narrow panel. The framework's [responsive reference](https://github.com/rize-network/app-studio/blob/main/docs/Responsive.md) also covers container-scoped responsiveness.
|
|
62
|
+
|
|
63
|
+
## Verify the result
|
|
64
|
+
|
|
65
|
+
Test a narrow phone, a tablet-sized viewport, a wide screen, and enlarged text. Check focus visibility and code overflow as well as visual alignment.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Styling & composition
|
|
2
|
+
|
|
3
|
+
Use the same styling foundation across your own primitives and the ready-made library. Keep layout close to the component and customize only what you need.
|
|
4
|
+
|
|
5
|
+
## Start with style props
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { View, Text } from 'app-studio';
|
|
10
|
+
|
|
11
|
+
export function Callout() {
|
|
12
|
+
return (
|
|
13
|
+
<View
|
|
14
|
+
padding={24}
|
|
15
|
+
borderRadius={12}
|
|
16
|
+
backgroundColor="color-blue-50"
|
|
17
|
+
borderWidth={1}
|
|
18
|
+
borderStyle="solid"
|
|
19
|
+
borderColor="color-blue-200"
|
|
20
|
+
>
|
|
21
|
+
<Text color="color-blue-900">
|
|
22
|
+
A consistent foundation, with room for your design.
|
|
23
|
+
</Text>
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Resolve tokens through `ThemeProvider`. Numeric spacing values represent pixels on web and native layout units on React Native.
|
|
30
|
+
|
|
31
|
+
## Choose a built-in variant
|
|
32
|
+
|
|
33
|
+
Before overriding internal styles, check the component's `variant`, `size`, and other documented props.
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import React from 'react';
|
|
37
|
+
import { Horizontal } from 'app-studio';
|
|
38
|
+
import { Button } from '@app-studio/components';
|
|
39
|
+
|
|
40
|
+
export function Actions() {
|
|
41
|
+
return (
|
|
42
|
+
<Horizontal gap={12} flexWrap="wrap">
|
|
43
|
+
<Button variant="filled" size="sm">
|
|
44
|
+
Save
|
|
45
|
+
</Button>
|
|
46
|
+
<Button variant="outline" size="sm">
|
|
47
|
+
Cancel
|
|
48
|
+
</Button>
|
|
49
|
+
<Button variant="ghost" size="sm">
|
|
50
|
+
More options
|
|
51
|
+
</Button>
|
|
52
|
+
</Horizontal>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Variant names differ between components. Use each component's TypeScript props and examples rather than assuming every control accepts the same names.
|
|
58
|
+
|
|
59
|
+
## Customize internal views
|
|
60
|
+
|
|
61
|
+
`views` exposes named internal parts. Button exposes `container`, `content`, and icon and loader parts. The available names are component-specific.
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
import React from 'react';
|
|
65
|
+
import { Button } from '@app-studio/components';
|
|
66
|
+
|
|
67
|
+
export function CustomButton() {
|
|
68
|
+
return (
|
|
69
|
+
<Button
|
|
70
|
+
variant="outline"
|
|
71
|
+
views={{
|
|
72
|
+
container: { borderRadius: 12 },
|
|
73
|
+
content: { letterSpacing: 0.5 },
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
Your brand
|
|
77
|
+
</Button>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Preserve labels, focus indicators, disabled behavior, and hit areas when overriding views.
|
|
83
|
+
|
|
84
|
+
## Interaction states on the web
|
|
85
|
+
|
|
86
|
+
Primitives support state styles such as `_hover`, `_active`, and `_focus`. Use a semantic interactive element and keep keyboard focus visible.
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import React from 'react';
|
|
90
|
+
import { View } from 'app-studio';
|
|
91
|
+
|
|
92
|
+
export function StateExample() {
|
|
93
|
+
return (
|
|
94
|
+
<View
|
|
95
|
+
as="button"
|
|
96
|
+
padding={12}
|
|
97
|
+
borderRadius={8}
|
|
98
|
+
backgroundColor="color-blue-900"
|
|
99
|
+
color="color-white"
|
|
100
|
+
_hover={{ backgroundColor: 'color-blue-800' }}
|
|
101
|
+
_focus={{ outline: '3px solid #93c5fd', outlineOffset: 3 }}
|
|
102
|
+
>
|
|
103
|
+
Focus or hover me
|
|
104
|
+
</View>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Browser selectors and pseudo-elements are web-only. On native, use supported platform events and accessibility behavior. See [platform differences](/docs/react-native).
|
|
110
|
+
|
|
111
|
+
## Compose ordinary React components
|
|
112
|
+
|
|
113
|
+
Extract a component when layout or behavior repeats. A single visual adjustment can stay as props at the call site. Configure [theme tokens](/docs/theming) before copying raw colors across your app.
|
|
114
|
+
|
|
115
|
+
The [framework styling reference](https://github.com/rize-network/app-studio/blob/main/docs/Styling.md) documents more states and selectors.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Colors & theming
|
|
2
|
+
|
|
3
|
+
Connect your interface to shared color tokens. Put `ThemeProvider` near the root so primitives and ready-made components resolve the same palette.
|
|
4
|
+
|
|
5
|
+
## Theme tokens and palette tokens
|
|
6
|
+
|
|
7
|
+
`theme-primary` is a semantic role. You decide which palette entry it points to. `color-blue-900` is a specific palette entry. Both are resolved through the provider.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { ThemeProvider, Vertical, Text } from 'app-studio';
|
|
12
|
+
import { Button } from '@app-studio/components';
|
|
13
|
+
|
|
14
|
+
export function BrandExample() {
|
|
15
|
+
return (
|
|
16
|
+
<ThemeProvider theme={{ primary: 'color-violet-700' }}>
|
|
17
|
+
<Vertical gap={16} padding={24}>
|
|
18
|
+
<Text color="theme-primary" fontWeight="bold">
|
|
19
|
+
Your brand, shared.
|
|
20
|
+
</Text>
|
|
21
|
+
<Button>Primary action</Button>
|
|
22
|
+
<Button variant="outline">Secondary action</Button>
|
|
23
|
+
</Vertical>
|
|
24
|
+
</ThemeProvider>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use semantic tokens for roles that should change together. Use palette tokens when a deliberate fixed color is appropriate.
|
|
30
|
+
|
|
31
|
+
## Light and dark mode
|
|
32
|
+
|
|
33
|
+
Control the provider's `mode` prop with React state. It selects the light or dark palette; it does not automatically redesign every custom color or browser document style in your application.
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import React from 'react';
|
|
37
|
+
import { ThemeProvider, Vertical, Text } from 'app-studio';
|
|
38
|
+
import { Button } from '@app-studio/components';
|
|
39
|
+
|
|
40
|
+
export function ThemeExample() {
|
|
41
|
+
const [dark, setDark] = React.useState(false);
|
|
42
|
+
return (
|
|
43
|
+
<ThemeProvider mode={dark ? 'dark' : 'light'}>
|
|
44
|
+
<Vertical
|
|
45
|
+
padding={24}
|
|
46
|
+
gap={16}
|
|
47
|
+
backgroundColor="color-white"
|
|
48
|
+
borderRadius={12}
|
|
49
|
+
>
|
|
50
|
+
<Text color="color-gray-900">A shared color system.</Text>
|
|
51
|
+
<Button onClick={() => setDark(!dark)}>
|
|
52
|
+
Switch to {dark ? 'light' : 'dark'} mode
|
|
53
|
+
</Button>
|
|
54
|
+
</Vertical>
|
|
55
|
+
</ThemeProvider>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Check text contrast, surfaces, borders, disabled states, and focus rings in each mode. Raw hex colors keep their literal value rather than following the palette.
|
|
61
|
+
|
|
62
|
+
## Per-component colors
|
|
63
|
+
|
|
64
|
+
Button supports `backgroundColor` for its surface and `textColor` for explicit content color. Other components have their own color props and internal `views` parts. Check the current TypeScript props before copying an override across components.
|
|
65
|
+
|
|
66
|
+
## Custom palettes and external tools
|
|
67
|
+
|
|
68
|
+
The provider also accepts `light` and `dark` palette configurations. `useTheme` exposes helpers such as `getColor` for CSS variables and `getColorHex` when another library needs a literal color.
|
|
69
|
+
|
|
70
|
+
See the [full theming reference](https://github.com/rize-network/app-studio/blob/main/docs/Theming.md) for palette structure and resolution rules. Start with a few semantic tokens before replacing the entire palette.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
Start with the smallest component that reproduces the issue. Check the installed package versions and your provider setup before adding overrides.
|
|
4
|
+
|
|
5
|
+
## Colors are missing
|
|
6
|
+
|
|
7
|
+
Confirm that `ThemeProvider` wraps the component and the token exists. `theme-primary` and `color-*` props resolve through the provider's variables. A raw color and a token follow different resolution paths.
|
|
8
|
+
|
|
9
|
+
Inspect the rendered element and its computed color. Check whether a local `views` override or surrounding stylesheet changes the value. See [Colors & theming](/docs/theming).
|
|
10
|
+
|
|
11
|
+
## Responsive props do nothing
|
|
12
|
+
|
|
13
|
+
Mount `ResponsiveProvider`. Check its breakpoint and device configuration, and confirm which viewport or container drives the rule. Do not assume a narrow panel automatically counts as the `mobile` device.
|
|
14
|
+
|
|
15
|
+
See [Responsive layouts](/docs/responsive).
|
|
16
|
+
|
|
17
|
+
## Input state does not update
|
|
18
|
+
|
|
19
|
+
Use value-first handlers. `TextField` returns a string; `Checkbox` and `Switch` return booleans. Use `onChange={setValue}` for controlled state rather than reading `event.target.value` from these component callbacks.
|
|
20
|
+
|
|
21
|
+
Keep the controlled value and handler on the same component. See [Forms & validation](/docs/forms).
|
|
22
|
+
|
|
23
|
+
## An import or peer dependency fails
|
|
24
|
+
|
|
25
|
+
Check the package's exported entry points and the peer versions used by your app. Install compatible peers instead of forcing an incompatible dependency tree. Keep React and its renderer compatible.
|
|
26
|
+
|
|
27
|
+
If you develop these repositories locally, build the sibling `app-studio` package before consuming its generated entry points. That source-checkout step is separate from installing the published package in an application.
|
|
28
|
+
|
|
29
|
+
## A routing component throws
|
|
30
|
+
|
|
31
|
+
Check whether the component depends on React Router and whether it is inside your application's router. A component's navigation behavior is different from a simple action button with an `onClick` handler.
|
|
32
|
+
|
|
33
|
+
## Native rendering differs from the web preview
|
|
34
|
+
|
|
35
|
+
The site's previews are browser examples. Check component availability, Metro export resolution, optional native peers, and native-specific setup. Browser selectors, form semantics, and navigation do not map directly to native.
|
|
36
|
+
|
|
37
|
+
Start with [React Native](/docs/react-native) and the linked compatibility matrix.
|
|
38
|
+
|
|
39
|
+
## An older reference differs from the API
|
|
40
|
+
|
|
41
|
+
Individual component pages contain existing reference material. Confirm the current TypeScript props and compare the [interactive examples](/docs/components) before copying an older prop value. Report the exact page, package versions, platform, and minimal reproduction when opening an issue.
|
|
42
|
+
|
|
43
|
+
## Where to ask or contribute
|
|
44
|
+
|
|
45
|
+
Use the [component repository](https://github.com/rize-network/app-studio-components/issues) for ready-made UI issues and the [framework repository](https://github.com/rize-network/app-studio/issues) for primitives and styling behavior. Include the error message and a small reproduction without credentials or private application data.
|
package/docs/seo-geo.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# SEO et documentation pour les IA
|
|
2
|
+
|
|
3
|
+
Configuration vérifiée le 21 octobre 2026. Le site public est `https://app-studio-6167b.web.app` ; sa source reste dans ce dépôt et son déploiement Firebase dans `../landing`.
|
|
4
|
+
|
|
5
|
+
## Ce que le build publie
|
|
6
|
+
|
|
7
|
+
- Le HTML complet des deux landing pages, des guides et des 77 références, avec titres, descriptions et URL canoniques propres à chaque page.
|
|
8
|
+
- Le code des exemples dans le HTML initial, accessible dans l'onglet Code. Les démonstrations restent interactives après hydratation.
|
|
9
|
+
- `/llms.txt` : index Markdown des packages, des guides et des références ; le framework est présenté en premier.
|
|
10
|
+
- `/llms-full.txt` : export complet. Il est volontairement plus volumineux ; les agents doivent privilégier les pages individuelles pour une tâche ciblée.
|
|
11
|
+
- Une alternative Markdown pour chaque page : `/index.md`, `/components.md`, `/docs.md`, `/docs/installation.md`, `/docs/Button.md`, etc. Les liens et exemples proviennent du même rendu que la documentation humaine.
|
|
12
|
+
- Des liens HTML `alternate` vers le Markdown et `describedby` vers l'index, ainsi qu'un en-tête HTTP de découverte.
|
|
13
|
+
- Des données structurées WebSite, WebPage/TechArticle/CollectionPage, SoftwareSourceCode et BreadcrumbList, correspondant aux produits et à la navigation visibles. Aucun avis, prix, auteur ou historique de mise à jour n'est inventé.
|
|
14
|
+
- Un sitemap contenant les URL HTML canoniques. Les exports Markdown et texte restent consultables par les agents, avec `X-Robots-Tag: noindex, follow` pour éviter des résultats dupliqués dans la recherche.
|
|
15
|
+
|
|
16
|
+
Les exports sont créés par `scripts/prerender.mjs` et `scripts/ai-docs.mjs`. Ne pas les modifier directement dans `build`. Modifier les guides, références ou pages, puis reconstruire.
|
|
17
|
+
|
|
18
|
+
`robots.txt` autorise tous les robots, ce qui inclut Googlebot, bingbot, OAI-SearchBot, Claude-SearchBot et PerplexityBot. Cette politique existante reste ouverte ; aucune préférence d'entraînement distincte n'a été ajoutée. Un user-agent simulé peut vérifier l'accès HTTP, mais ne prouve pas le passage ou l'indexation d'un vrai robot.
|
|
19
|
+
|
|
20
|
+
## Vérifier et publier
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
npm run test:ai-docs
|
|
24
|
+
npm run test:unwatch -- src/__tests__/seo.test.tsx src/__tests__/documentation.test.tsx src/__tests__/marketing.test.tsx
|
|
25
|
+
npm run typecheck
|
|
26
|
+
npm --prefix ../landing run deploy
|
|
27
|
+
npm run seo:indexnow
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Exécuter IndexNow après un déploiement qui modifie les pages : le script vérifie que le fichier public de propriété est bien en ligne, puis soumet les URL du sitemap. `public/indexnow-key.txt` est une preuve publique de propriété pour ce protocole, pas un secret. Un reçu HTTP 200 ou 202 signifie que la notification a été reçue, sans garantir une indexation. IndexNow concerne les moteurs participants ; ce n'est pas une soumission à Google.
|
|
31
|
+
|
|
32
|
+
## Mesurer ce qui reste externe au site
|
|
33
|
+
|
|
34
|
+
Vérification du 21 octobre 2026 : 110 tests de l'application, 3 tests d'export et TypeScript réussis ; les 95 pages HTML, leurs 95 alternatives Markdown et les trois fichiers de découverte ont été comparés au build en production (193 ressources). L'accès HTTP a aussi été testé avec cinq user-agents de recherche simulés. Le guide IA a été contrôlé à 390 px, sans débordement horizontal ni erreur dans la console. IndexNow a reçu les 95 URL avec un statut HTTP 202 ; cela ne constate pas leur indexation.
|
|
35
|
+
|
|
36
|
+
Dans Google Search Console et Bing Webmaster Tools, vérifier la propriété du domaine, envoyer `/sitemap.xml`, inspecter les landing pages et quelques références, puis suivre l'indexation et les citations sur plusieurs semaines. Bing propose un rapport AI Performance ; utiliser les rapports officiels disponibles sur la propriété plutôt qu'un score GEO inventé. Aucune connexion à ces comptes ni donnée de visibilité n'a été établie dans ce travail.
|
|
37
|
+
|
|
38
|
+
Si des statistiques de trafic sont ajoutées, suivre les visites provenant de ChatGPT, Claude, Perplexity et Copilot, ainsi que les visites et conversions utiles. Une visite de robot et une citation dans une réponse ne sont pas la même mesure. Ne pas ajouter de tracking tiers uniquement pour prétendre mesurer le GEO.
|
|
39
|
+
|
|
40
|
+
Le contenu doit rester précis : imports vérifiables, API réelles, limites natives, dépendances et licences propres à chaque package. Les sources publiques et des exemples fonctionnels sont plus utiles qu'une multiplication de pages de mots-clés. Des mentions externes authentiques et une adoption réelle ne peuvent pas être fabriquées dans les métadonnées du site.
|
|
41
|
+
|
|
42
|
+
## Références officielles consultées
|
|
43
|
+
|
|
44
|
+
- [Google : optimisation pour les fonctionnalités de recherche générative](https://developers.google.com/search/docs/fundamentals/ai-optimization-guide) — fondamentaux SEO, contenu utile et limites des tactiques GEO. Google indique ne pas utiliser llms.txt comme signal spécial de classement.
|
|
45
|
+
- [Google : fonctionnalités IA et sites web](https://developers.google.com/search/docs/appearance/ai-features) — accès aux robots, indexation, extraits, liens internes et correspondance entre contenu visible et balisage.
|
|
46
|
+
- [Proposition llms.txt v2](https://llmstxt.org/) — index concis, alternatives Markdown et liens de découverte. Il s'agit d'une proposition, pas d'une obligation commune à tous les moteurs.
|
|
47
|
+
- [OpenAI : robots](https://developers.openai.com/api/docs/bots) — distinction entre OAI-SearchBot, récupération à la demande et entraînement.
|
|
48
|
+
- [Anthropic : robots](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler) — Claude-SearchBot, Claude-User et ClaudeBot ont des usages distincts.
|
|
49
|
+
- [Perplexity : robots](https://docs.perplexity.ai/docs/resources/perplexity-crawlers) — accès aux contenus et identification des robots.
|
|
50
|
+
- [IndexNow : protocole](https://www.indexnow.org/documentation) — notification des URL modifiées, vérification de propriété et signification des réponses HTTP.
|
|
51
|
+
- [Bing : AI Performance](https://blogs.bing.com/webmaster/2026/2/Introducing-AI-Performance-in-Bing-Webmaster-Tools-Public-Preview/) — suivi des citations dans les expériences IA prises en charge.
|
|
52
|
+
|
|
53
|
+
Ces améliorations rendent le contenu accessible et plus facile à exploiter ; elles ne garantissent ni classement, ni recommandation, ni citation par un assistant.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-studio/components",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.11",
|
|
4
4
|
"main": "dist/web.cjs.js",
|
|
5
5
|
"module": "dist/web.esm.js",
|
|
6
6
|
"react-native": "dist/native/components/index.js",
|
|
@@ -40,13 +40,19 @@
|
|
|
40
40
|
"node": ">=10"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
|
+
"docs:api": "node scripts/generate-component-api.mjs",
|
|
44
|
+
"docs:api:check": "node scripts/generate-component-api.mjs --check",
|
|
45
|
+
"prestart": "npm run docs:api",
|
|
43
46
|
"start": "vite --port 3300",
|
|
47
|
+
"prebuild:web": "npm run docs:api",
|
|
44
48
|
"build:web": "vite build && vite build --config vite.ssr.config.ts && node scripts/prerender.mjs",
|
|
45
49
|
"prerender": "vite build --config vite.ssr.config.ts && node scripts/prerender.mjs",
|
|
46
50
|
"prelighthouse": "npm run build:web",
|
|
47
51
|
"build": "vite build --config vite.lib.config.ts",
|
|
48
52
|
"test": "vitest",
|
|
49
53
|
"test:unwatch": "vitest run",
|
|
54
|
+
"test:ai-docs": "node --test scripts/ai-docs.test.mjs",
|
|
55
|
+
"seo:indexnow": "node scripts/submit-indexnow.mjs",
|
|
50
56
|
"preview": "vite preview",
|
|
51
57
|
"storybook": "start-storybook -p 6006 -s public",
|
|
52
58
|
"build-storybook": "build-storybook -s public",
|
|
@@ -182,6 +188,7 @@
|
|
|
182
188
|
"react-native-svg": "^15.15.5",
|
|
183
189
|
"react-router-dom": "^6.11.1",
|
|
184
190
|
"react-test-renderer": "^19.0.0",
|
|
191
|
+
"refractor": "^5.0.0",
|
|
185
192
|
"release-it": "^16.2.1",
|
|
186
193
|
"replicate": "^1.0.1",
|
|
187
194
|
"simple-git": "^3.22.0",
|