Skip to content

Commit a12348d

Browse files
committed
fix: package update and styling adjustments
1 parent 5c04d3e commit a12348d

9 files changed

Lines changed: 603 additions & 268 deletions

File tree

sbp-frontend-style/README.md

Lines changed: 196 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,60 @@
11
# SBP Frontend Style
22

3-
Finally it has arrived! A common design component library for all front-end platforms in the making. Are you using **ReactJS**...Let's go! Running **NextJS**... no sweat! ~~Are you using **VueJS** _(or Nuxt)_... We've got you coverd aswell. :grin:~~
3+
A comprehensive React component library built with TypeScript and styled-components. This library provides a complete set of pre-styled, customizable UI components following atomic design principles, designed for internal Schuberg Philis projects.
44

5-
With this platform it's easy to use and re-use default components without having to maintain them yourself. This platform will give you freedom by using a lot of pre-styled components for you website together with the ease of use of conventional platforms.
5+
With this library, you can quickly build consistent, accessible user interfaces without maintaining component code yourself. All components are fully themed and support both light and dark modes out of the box.
66

7-
We've chosen to style everything for internal use and projects that need styling as default. But don't judge a book by its cover. It's possible to use a lot of predefined style variants and customize the components with use styling variables. _(do not mistake them with css-variables)_
7+
## Features
88

9-
## Platforms
9+
- 🎨 Complete theming system with light/dark mode support
10+
- ♿ Accessibility-focused components
11+
- 📦 TypeScript support with full type definitions
12+
- 🎯 Atomic design architecture (atoms, molecules, organisms)
13+
- 🔧 Highly customizable via theme tokens
14+
- 📱 Responsive and scalable components
15+
- ⚡ Built with modern React (v19) and styled-components (v6)
1016

11-
This project is running on ReactJS together with some react based packages needed for styling. But our goal is that this can be used on multiple platforms:
17+
## Platforms
1218

13-
| Platform | native | extra | supported |
14-
| -------- | ------ | --------------------------------------------------------- | --------- |
15-
| ReactJS | true | | true |
16-
| NextJS | true | | true |
17-
| VueJS | false | use: [vuera]("https://npmjs.org/package/vuera", '_blank') | false |
18-
| NuxtJS | false | use: [vuera]("http://npmjs.org/package/vuera", '_blank') | false |
19+
This library is built for React-based applications:
1920

20-
## Implementation
21+
| Platform | Supported | Notes |
22+
| -------- | --------- | ----------------------------------------- |
23+
| ReactJS || Native support |
24+
| NextJS || Works seamlessly with Next.js applications |
2125

22-
Using these components you only need to add this package to your project
26+
## Installation
2327

24-
### Install
28+
Install the package using your preferred package manager:
2529

2630
```bash
2731
pnpm add @schubergphilis/sbp-frontend-style
2832

2933
# Or with npm:
30-
3134
npm install @schubergphilis/sbp-frontend-style
3235
```
3336

34-
### React
37+
### Peer Dependencies
38+
39+
This library requires React 19+ as a peer dependency:
40+
41+
```json
42+
"peerDependencies": {
43+
"react": "^19.2.3",
44+
"react-dom": "^19.2.3"
45+
}
46+
```
47+
48+
## Quick Start
3549

36-
Within the base of the application it needs a Style wrapper **\<CloudStyle\>** to set the default styling and this will also be the input for customizing the components for your needs.
50+
Wrap your application with the `<CloudStyle>` component to enable theming and default styles:
3751

3852
```jsx
3953
import { ActionButton, CloudStyle } from '@schubergphilis/sbp-frontend-style'
4054

4155
const App = () => {
4256
return (
43-
<CloudStyle>
57+
<CloudStyle isDarkMode={false} isLargeMode={false}>
4458
<ActionButton variant="cta" isRounded>
4559
Welcome
4660
</ActionButton>
@@ -51,52 +65,185 @@ const App = () => {
5165
export default App
5266
```
5367

54-
### VueJS (not supported)
68+
## CloudStyle Configuration
69+
70+
The `<CloudStyle>` component provides theme configuration for all child components. It applies global styles and CSS resets based on [Josh Comeau's CSS Reset](https://www.joshwcomeau.com/css/custom-css-reset/).
71+
72+
### Props
73+
74+
| Property | Type | Default | Description |
75+
| ----------- | --------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- |
76+
| isDarkMode | boolean | false | Toggle between dark mode and light mode |
77+
| isLargeMode | boolean | false | Increase base font size from 16px to 24px. All components use em/rem units and scale accordingly |
78+
| lightStyle | DefaultStyleWithCustomVars | undefined | Override default light theme tokens (colors, spacing, fonts, etc.) |
79+
| darkStyle | DefaultStyleWithCustomVars | undefined | Override default dark theme tokens. Inherits from lightStyle overrides if provided |
80+
| fonts | DefaultFonts | undefined | Customize font families used throughout components |
81+
| isDebug | boolean | false | Enable debug mode for development |
82+
| children | ReactNode | required | Child components to be themed |
83+
84+
### Custom Theme Example
85+
86+
```jsx
87+
import { CloudStyle } from '@schubergphilis/sbp-frontend-style'
88+
89+
const customLightTheme = {
90+
colorPrimary: '#0066cc',
91+
colorBg: '#ffffff',
92+
fontSize: '16px',
93+
// ... other theme tokens
94+
}
95+
96+
const App = () => {
97+
return (
98+
<CloudStyle isDarkMode={false} lightStyle={customLightTheme}>
99+
{/* Your app components */}
100+
</CloudStyle>
101+
)
102+
}
103+
```
104+
105+
## Components
106+
107+
The library follows atomic design principles, organizing components into three categories:
108+
109+
### Atoms (Basic Building Blocks)
110+
111+
#### Buttons
112+
- **ActionButton** - Primary action button with variants (cta, ghost, etc.), loading states, and badge support
113+
- **DragButton** - Button for drag-and-drop interactions
114+
- **TextLink** - Styled link component
115+
- **ToggleButton** - Toggle/switch button component
116+
117+
#### Forms
118+
- **TextInput** - Text input field with label and validation states
119+
- **SelectInput** - Dropdown select component
120+
- **CheckboxInput** - Checkbox with label
121+
- **RadioInput** - Radio button with label
122+
123+
#### Avatars & Badges
124+
- **Avatar** - User avatar with badge support, name abbreviation, and color generation
125+
- **Badge** - Notification badge (supports count display with 999+ cap)
126+
- **ChipBadge** - Chip-style badge component
127+
128+
#### Loaders & Progress
129+
- **Loader** - Loading spinner component
130+
- **ProgressBar** - Linear progress indicator
131+
- **ProgressTimer** - Countdown timer with visual progress
132+
133+
#### Tooltips
134+
- **Tooltip** - Contextual tooltip with multiple placement options (top, bottom, left, right)
135+
136+
### Molecules (Composed Components)
137+
138+
#### Cards
139+
- **Card** - Base card component with header, content, and footer subcomponents
140+
- **CardHeader** - Card header section
141+
- **CardContent** - Card content section
142+
- **CardFooter** - Card footer section
143+
144+
#### Tables
145+
- **DynamicTable** - Feature-rich data table with sorting, sticky headers, zebra striping, column resizing, row selection, and pagination support
146+
147+
#### Modals & Notifications
148+
- **Modal** - Modal dialog with backdrop and close functionality
149+
- **Notification** - Toast notification with types (info, warning, success, error), auto-close, and expandable descriptions
150+
151+
#### Charts
152+
- **DonutChart** - Circular progress/donut chart visualization
153+
154+
### Organisms (Complex Composed UI)
155+
156+
- **Accordion** - Expandable/collapsible panels with multiple items
157+
- **NavigationBar** - Top-level navigation component
158+
- **TabBar** - Tabbed interface component
159+
160+
### Helpers & Utilities
161+
162+
The library includes several helper utilities:
163+
164+
- **ProgressHelper** - Donut/circle progress visualization utilities
165+
- **FunctionHelpers** - String manipulation, date validation, formatting utilities
166+
- **ColorpickerHelper** - Color generation and manipulation
167+
- **ConditionalWrapperHelper** - Conditional component wrapping utility
168+
- **HtmlHelper** - HTML/JSX utilities
169+
- **DeviceHelper** - Device detection utilities
170+
171+
## Development
172+
173+
### Running the Demo App
174+
175+
The library includes a live demo/playground application built with Vite:
176+
177+
```bash
178+
pnpm dev
179+
# or
180+
npm run dev
181+
```
182+
183+
Open [http://localhost:3005](http://localhost:3005) to view the interactive component showcase.
55184

56-
The basis of this style package is based upon React together wiht Styled-Components. When using this package inside a VueJS application there are some small differences and additional packages needed to format the properies towards the correct state.
185+
### Building the Library
57186

58-
## CloudStyle settings
187+
Build the library for distribution:
59188

60-
Within the CloudStyle component it is possible to make changes to the overall components. It also contains some base styling rules and it will reset/normalize all HTML components to a base setup.
61-
["CSS Reset / Normalize"]("https://www.joshwcomeau.com/css/custom-css-reset/", '_blank')
189+
```bash
190+
pnpm build
191+
# or
192+
npm run build
193+
```
62194

63-
| Property | type | Default | Optional | Description |
64-
| ----------- | ----------------------------------------------- | --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
65-
| isDarkMode | boolean | false | true | Changing the styling between dark mode and light mode |
66-
| isLargeMode | boolean | false | true | Changing the base font size from **16px** to **24px**. All components are based on **em** and **rem** and will scale up accordingly |
67-
| lightStyle | DefaultStyle | undefined | true | based upon **DefaultStyle** interface it's possible to overwrite the default styling of each component |
68-
| darkStyle | DefaultStyle | undefined | true | based upon **DefaultStyle** interface it's possible to overwrite the default darkStyle. It will keep in mind the overall styling and the changes that've been done within **lightStyle** property. |
69-
| Childeren | JSX.Element \| JSX.Element[] \| React.ReactNode | null | false | Children are mandatory and can can be all types of components |
195+
This uses Rollup to create optimized ESM and CJS bundles in the `dist` folder.
70196

71-
## Startup Development
197+
### Running Tests
72198

73-
In the project directory, you can run:
199+
Launch the Jest test runner:
74200

75-
### `pnpm start`
201+
```bash
202+
pnpm test
203+
# or
204+
npm test
205+
```
76206

77-
Runs the app in the development mode.\
78-
Open [https://localhost:3005](https://localhost:3005) to view it in the browser.
207+
For debugging tests:
79208

80-
The page will reload if you make edits.\
81-
You will also see any lint errors in the console.
209+
```bash
210+
pnpm test:debug
211+
```
212+
213+
### Linting
82214

83-
### `pnpm test`
215+
```bash
216+
pnpm lint
217+
```
84218

85-
Launches the test runner in the interactive watch mode.\
86-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
219+
## Package Exports
87220

88-
### `pnpm build`
221+
The library provides both ESM and CommonJS exports:
222+
223+
```json
224+
{
225+
"exports": {
226+
"types": "./dist/index.d.ts",
227+
"import": "./dist/esm/index.mjs.js",
228+
"require": "./dist/cjs/index.js"
229+
}
230+
}
231+
```
89232

90-
Builds the app for production to the `build` folder.\
91-
It correctly bundles React in production mode and optimizes the build for the best performance.
233+
## Contributing
92234

93-
The build is minified and the filenames include the hashes.\
94-
Your app is ready to be deployed!
235+
This library uses:
236+
- **TypeScript** for type safety
237+
- **styled-components** for styling
238+
- **Rollup** for library bundling
239+
- **Vite** for development
240+
- **Jest** for testing
241+
- **ESLint** and **Prettier** for code quality
95242

96-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
243+
## License
97244

98-
## Learn More
245+
MIT
99246

100-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
247+
## Repository
101248

102-
To learn React, check out the [React documentation](https://reactjs.org/).
249+
[https://github.com/schubergphilis/sbp-frontend-style](https://github.com/schubergphilis/sbp-frontend-style)

sbp-frontend-style/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@
3434
"test:clear": "jest --clearCache"
3535
},
3636
"peerDependencies": {
37-
"react": "^19.2.3",
38-
"react-dom": "^19.2.3"
37+
"react": "^19.2.4",
38+
"react-dom": "^19.2.4"
3939
},
4040
"dependencies": {
41-
"styled-components": "6.3.5"
41+
"@rollup/plugin-terser": "^1.0.0",
42+
"styled-components": "6.3.12"
4243
},
4344
"devDependencies": {
4445
"@eslint/compat": "^2.0.1",
@@ -86,16 +87,15 @@
8687
"react-router-dom": "^7.12.0",
8788
"react-syntax-highlighter": "^16.1.0",
8889
"rimraf": "^6.1.2",
89-
"rollup": "^4.55.1",
90+
"rollup": "^4.60.1",
9091
"rollup-plugin-delete": "^3.0.2",
9192
"rollup-plugin-dts": "^6.3.0",
9293
"rollup-plugin-peer-deps-external": "^2.2.4",
93-
"rollup-plugin-terser": "^7.0.2",
9494
"rollup-plugin-tsconfig-paths": "^1.5.2",
9595
"standard-version": "^9.5.0",
9696
"ts-jest": "^29.4.6",
9797
"typescript": "5.9.3",
98-
"vite": "^7.3.1",
98+
"vite": "^7.3.2",
9999
"vite-tsconfig-paths": "^6.0.4",
100100
"web-vitals": "^5.1.0"
101101
},

0 commit comments

Comments
 (0)