@woesh/baseflow-platform-sdk
v2.2.0
Published
Angular SDK for the Baseflow Platform, providing authentication, API clients, and UI components.
Readme
@woesh/baseflow-platform-sdk
Angular SDK for the Baseflow Platform, providing authentication, API clients, and UI components.
Installation
npm install @woesh/baseflow-platform-sdk
# or
yarn add @woesh/baseflow-platform-sdkStyles
The SDK ships a precompiled, minified CSS file containing all Tailwind utilities used by the library's components. You must include it in your application — no Tailwind setup is required on your end.
Angular CLI / Angular workspace
Add the file to the styles array in your angular.json:
"styles": [
"node_modules/@woesh/baseflow-platform-sdk/styles/baseflow-platform.css"
]Nx workspace
Same as above — add it to the styles array of the relevant application target in project.json or angular.json:
"styles": [
"node_modules/@woesh/baseflow-platform-sdk/styles/baseflow-platform.css"
]Dark mode
The SDK components support Tailwind's dark variant, driven by a dark class on the <html> element.
ThemeService
Inject ThemeService to control the theme. It toggles the dark class, persists the choice to localStorage, and falls back to the operating system preference when nothing is stored. The header's profile menu already ships a light/dark toggle wired to this service.
import { inject } from '@angular/core';
import { ThemeService } from '@woesh/baseflow-platform-sdk';
const theme = inject(ThemeService);
theme.theme(); // signal: 'light' | 'dark'
theme.setTheme('dark');
theme.toggleTheme();Reading the setting without the class
If you don't use the dark class strategy and want to drive your own theming, read the current setting from the service instead. theme is a signal and theme$ is an observable that emits the current value on subscribe and on every change:
theme.theme(); // synchronous read
theme.theme$.subscribe((mode) => { // 'light' | 'dark'
// apply your own theming
});To set the dark class yourself instead of using the service, add it directly:
<html class="dark"></html>Compiling from source
The shipped precompiled CSS is already class-based, so it needs no setup. If your app compiles the SDK component templates with its own Tailwind build, set darkMode: 'selector' in your tailwind.config.js so the dark: variants respond to the class instead of the OS media query.
Running unit tests
nx test baseflow-platform-sdkBuilding
yarn sdk:buildThis runs the ng-packagr build followed by the Tailwind CSS compilation step, outputting the compiled CSS to dist/libs/baseflow-platform-sdk/styles/baseflow-platform.css.
