@nexub/mcp 1.9.0 → 2.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/README.md CHANGED
@@ -35,6 +35,7 @@ claude plugin install nexub-ds@nexub
35
35
  | `list_components` | Every component and pattern, optionally filtered (`query: "table"`) |
36
36
  | `get_component` | Props, import, examples, when to use and accessibility for one component (`name: "DatePicker"`) |
37
37
  | `get_tokens` | Color roles, typography, spacing, shape, elevation, motion, with Tailwind utilities (`section: "Motion"`) |
38
+ | `get_react_native` | Mobile apps: `@nexub/react-native` setup, components, screen patterns and mobile rules |
38
39
 
39
40
  ## Staying current
40
41
 
@@ -13,6 +13,7 @@ Reference files (read only what the task needs):
13
13
  - [references/components.md](references/components.md): every component and pattern, grouped by category. Start here.
14
14
  - `references/components/<slug>.md`: props, examples, when to use and accessibility for one component. Read it before using a component you have not used yet in this session.
15
15
  - [references/tokens.md](references/tokens.md): color roles, type roles, spacing, shape, elevation, motion, z-index.
16
+ - [references/react-native.md](references/react-native.md): **mobile apps** (Expo / React Native). Use `@nexub/react-native` and `@nexub/react-native/patterns` there, never `@nexub/react`.
16
17
 
17
18
  ## 1. Check the setup first
18
19
 
@@ -1,6 +1,6 @@
1
1
  # Component index
2
2
 
3
- Nexub DS v1.9.0. Open `components/<slug>.md` for props, examples and accessibility notes.
3
+ Nexub DS v2.1.0. Open `components/<slug>.md` for props, examples and accessibility notes.
4
4
  Never use a component marked deprecated.
5
5
 
6
6
  ## Components — Actions
@@ -0,0 +1,112 @@
1
+ # @nexub/react-native
2
+
3
+ React Native components and screen patterns for Nexub Design System. They use the same tokens, brands and prop names as `@nexub/react` on the web.
4
+
5
+ **Native chrome, Nexub content.** The system draws the tab bar, stack header, back gesture, action sheets, pickers and iOS 26 Liquid Glass; Nexub themes them. Everything inside a screen (lists, cards, buttons, inputs, money) is drawn by Nexub, so it looks the same on iOS, Android and the web.
6
+
7
+ Status: **alpha**. Built for Expo SDK 57+ / React Native 0.86+ (New Architecture). Works in Expo apps and bare React Native apps.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npx expo install @nexub/react-native react-native-reanimated react-native-worklets react-native-svg react-native-safe-area-context expo-font
13
+ ```
14
+
15
+ Optional peers. Add only what you use; without them the feature is a no-op or the component tells you what to install:
16
+
17
+ | Package | Used by |
18
+ |---|---|
19
+ | `expo-haptics` | Semantic haptics on every control |
20
+ | `expo-glass-effect` | Native Liquid Glass (`Surface material="glass"`) on iOS 26+ |
21
+ | `expo-screen-capture` | `PrivacyShield preventCapture` |
22
+ | `@react-native-community/datetimepicker` | `DateTimeField` |
23
+
24
+ `@nexub/tokens`, `@nexub/core`, `@nexub/icons` and the fonts (Inter, Plus Jakarta Sans, Geist Mono; OFL) come with the package.
25
+
26
+ ## Set up
27
+
28
+ ```tsx
29
+ import { useFonts } from 'expo-font';
30
+ import { Stack } from 'expo-router';
31
+ import { NexubNativeProvider, ToastProvider, nexubFonts, useNexubNavigation } from '@nexub/react-native';
32
+
33
+ function Screens() {
34
+ const nav = useNexubNavigation(); // native stack in Nexub colours and type
35
+ return <Stack screenOptions={nav.stack} />;
36
+ }
37
+
38
+ export default function RootLayout() {
39
+ const [ready] = useFonts(nexubFonts);
40
+ if (!ready) return null;
41
+ return (
42
+ <NexubNativeProvider product="payub">
43
+ <ToastProvider>
44
+ <Screens />
45
+ </ToastProvider>
46
+ </NexubNativeProvider>
47
+ );
48
+ }
49
+ ```
50
+
51
+ `NexubNativeProvider` props:
52
+
53
+ | Prop | Default | |
54
+ |---|---|---|
55
+ | `scheme` | `'system'` | `'light'`, `'dark'` or follow the OS |
56
+ | `contrast` | `'system'` | follows iOS Increase Contrast / Android high-contrast text (re-read on foreground) |
57
+ | `product` | none | `'leap' \| 'bookub' \| 'payub' \| 'founderub'`: remaps the tertiary family |
58
+ | `seed`, `seedTarget` | none | white-label colour: regenerates the primary (or tertiary) family with contrast-safe tones |
59
+ | `glass` | `'balanced'` | the user's glass dial; forced `'off'` under Reduce Transparency |
60
+ | `haptics` | `true` | the user's haptics setting |
61
+ | `fonts` | `'nexub'` | `'system'` to use the platform font |
62
+ | `locale`, `dir`, `messages` | `'en'` | Intl locale, RTL (derived from the locale) and translated strings, same as web `NexubProvider` |
63
+
64
+ Hooks: `useTheme()`, `useRoles()`, `useHaptics()`, `useNexubMessages()`, `useNexubNavigation()`.
65
+
66
+ ## Components
67
+
68
+ Names and props match `@nexub/react` where a web twin exists.
69
+
70
+ - **Primitives:** `Text`, `Heading`, `Pressable` (state layer, 0.97 press spring, haptic), `Surface` (tonal tiers, elevation, glass), `Box`, `Stack`, `Inline`, `Icon`, `ScreenContainer`.
71
+ - **Actions:** `Button`, `IconButton`, `ButtonGroup`, `Link`.
72
+ - **Data:** `Amount`, `Badge`, `Avatar`, `AvatarGroup`, `Divider`.
73
+ - **Inputs:** `TextField`, `PasswordInput`, `SearchField`, `MoneyInput`, `Stepper`, `Checkbox`, `RadioGroup` / `Radio`, `Switch` (the platform switch), `SegmentedControl`, `Slider`, `Chip`, `FilterChip`, `Select`, `DateTimeField`, `OTPInput`, `NumericKeypad`, `ExpressiveMoneyInput`.
74
+ - **Containers:** `Card`, `ListItem` (navigation, switch, checkbox, radio, button and value rows), `ListSection`, `Accordion`.
75
+ - **Overlays:** `BottomSheet` (detents), `ActionSheet` (system sheet on iOS), `ContextMenu`, `Dialog`.
76
+ - **Feedback:** `Banner`, `ToastProvider` / `useToast`, `Progress`, `LoadingIndicator`, `Skeleton`, `EmptyState`, `ErrorState`, `OfflineBanner`, `Coachmark`.
77
+ - **Mobile:** `SwipeableRow`, `RefreshControl`, `Carousel`, `PageIndicator`, `StickyFooter`, `SensitiveValue`, `PrivacyShield`, `FAB` (Android only by default).
78
+ - **Navigation helpers:** `nexubStackOptions`, `nexubNavigationTheme`, `nexubTabsOptions`.
79
+
80
+ Icons: `import { Search } from '@nexub/icons/native'`. These are the same names as `@nexub/icons`. Colour them with `<Icon icon={Search} color="primary" />`.
81
+
82
+ ## Patterns
83
+
84
+ `import { SignInScreen, AmountStep, ActivityList } from '@nexub/react-native/patterns'`. Each pattern is a screen template that takes data and callbacks, so it works with any router.
85
+
86
+ - **Auth:** `AuthScreen`, `SignInScreen`, `VerifyCodeScreen`, `LockScreen`.
87
+ - **Money:** `FlowStep`, `AmountStep`, `ReviewStep`, `ActivityList`, `TransactionDetail`, `ResultScreen`.
88
+ - **App:** `OnboardingScreen`, `PermissionPrimer`, `SettingsScreen`, `ProfileHeader`, `AppearanceSection`, `NotificationsInbox`, `SearchScreen`, `ChatScreen`, `PaywallScreen`, `AppSwitcherSheet`.
89
+
90
+ ## Rules the components follow
91
+
92
+ - **Touch targets:** every control reaches 44pt (`hitSlop` on smaller visuals). Primary actions use `size="lg"` (48).
93
+ - **Text scaling:** every role scales with the system text size. iOS follows Apple's Dynamic Type curve per role, and display and headline roles are capped so they don't push content off screen.
94
+ - **Screen readers:**
95
+ - A list row is one element ("Amazon, −$42.50, today").
96
+ - Swipe and long-press actions are also accessibility actions.
97
+ - Masked values read as "hidden".
98
+ - Toasts are announced.
99
+ - **Haptics are semantic** (`selection`, `toggleOn`/`toggleOff`, `confirm`, `reject`, `warning`, `snap`), never on plain taps, and never the only feedback.
100
+ - **Motion:** M3 springs (no overshoot by default), off under Reduce Motion.
101
+ - **Glass:** for the control layer only, never content. It is native Liquid Glass on iOS 26+, solid elsewhere and whenever the user turns transparency down.
102
+ - **Security:** `OTPInput` uses one field, so SMS autofill works. `PasswordInput` sets the platform autofill hints. `SensitiveValue` re-masks when the app backgrounds. `PrivacyShield` covers the app-switcher snapshot. The library makes no network calls and stores nothing.
103
+
104
+ ## Testing your app
105
+
106
+ The library's own tests use Jest (jest-expo) and React Native Testing Library. In your Jest setup, stub `react-native-reanimated`'s APIs and use `react-native-safe-area-context/jest/mock`; `packages/react-native/jest.setup.js` in the repo shows the pattern.
107
+
108
+ ## Links
109
+
110
+ - Docs: https://nexub-ds-docs.pages.dev/getting-started/react-native
111
+ - Plan and decisions: [MOBILE_PLAN.md](https://github.com/Nexub-AI/nexub-ds/blob/development/MOBILE_PLAN.md)
112
+ - Web components: `@nexub/react`
@@ -1,6 +1,6 @@
1
1
  # Tokens
2
2
 
3
- Nexub DS v1.9.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
3
+ Nexub DS v2.1.0. Every token is a CSS custom property from `@nexub/tokens/css` (loaded by `@nexub/themes/base`).
4
4
  The Tailwind preset (`@nexub/tokens/tailwind`) maps them to utilities. Never hardcode a hex, px spacing or shadow that a token covers.
5
5
 
6
6
  ## Color roles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexub/mcp",
3
- "version": "1.9.0",
3
+ "version": "2.1.0",
4
4
  "description": "MCP server for Nexub Design System: gives Claude, Cursor and any MCP client the components, patterns, tokens and design rules of the installed release.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/server.js CHANGED
@@ -92,6 +92,16 @@ export function createServer() {
92
92
  },
93
93
  );
94
94
 
95
+ server.registerTool(
96
+ 'get_react_native',
97
+ {
98
+ title: 'Nexub for React Native',
99
+ description:
100
+ 'Mobile apps (Expo / React Native): install, NexubNativeProvider, every @nexub/react-native component and @nexub/react-native/patterns screen, and the mobile rules. Call this instead of the web references when building a mobile app.',
101
+ },
102
+ async () => text(read('references/react-native.md')),
103
+ );
104
+
95
105
  return server;
96
106
  }
97
107