rk-designsystem 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 danieltunetek
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # Design System Component Library (Norwegian Red Cross)
2
+
3
+ **Live Storybook URL:** [https://norwegianredcross.github.io/DesignSystem/storybook/](https://norwegianredcross.github.io/DesignSystem/storybook/)
4
+
5
+ ## Overview
6
+
7
+ This repository contains a library of reusable UI components built with React and Vite, specifically tailored for Norwegian Red Cross digital projects. It leverages components and styling principles from [Digdir's Designsystemet](https://www.designsystemet.no/) while also including custom components to meet specific Red Cross requirements.
8
+
9
+ The primary goal is to ensure brand consistency, improve development efficiency, and maintain high accessibility standards across applications.
10
+
11
+ [Storybook](https://norwegianredcross.github.io/DesignSystem/storybook/) serves as the interactive documentation and development environment for viewing and testing these components.
12
+
13
+ ## Features
14
+
15
+ * **React Components:** Modern, functional React components.
16
+ * **Vite Tooling:** Fast development and build process powered by Vite.
17
+ * **TypeScript:** Enhanced code quality and maintainability.
18
+ * **Digdir Designsystemet Integration:** Uses foundational components and styles from the national design system.
19
+ * **Custom NRC Components:** Includes components built specifically for Norwegian Red Cross needs.
20
+ * **Storybook:** Provides interactive documentation, visual testing, and component showcasing.
21
+ * **Accessibility:** Built with accessibility (WCAG) considerations.
22
+
23
+ ## Prerequisites
24
+
25
+ * [Node.js](https://nodejs.org/) (LTS version recommended, e.g., v18 or v20+)
26
+ * [npm](https://www.npmjs.com/) (comes with Node.js) or [yarn](https://yarnpkg.com/) or [pnpm](https://pnpm.io/)
27
+
28
+ ## Getting Started
29
+
30
+ 1. **Clone the Repository:**
31
+ ```bash
32
+ git clone https://github.com/norwegianredcross/DesignSystem.git
33
+ cd DesignSystem
34
+ ```
35
+
36
+ 2. **Switch to the correct branch:**
37
+ The component library source code lives on the `Storybook-Demo` branch.
38
+ ```bash
39
+ git switch Storybook-Demo
40
+ # Or git checkout Storybook-Demo
41
+ ```
42
+ *(Note: The root of this branch contains the component library project).*
43
+
44
+ 3. **Install Dependencies:**
45
+ ```bash
46
+ npm install
47
+ # or: yarn install
48
+ # or: pnpm install
49
+ ```
50
+
51
+ ## Available Scripts
52
+
53
+ In the project directory, you can run several commands:
54
+
55
+ * ### `npm run storybook` or `yarn storybook` or `pnpm storybook`
56
+
57
+ Runs the Storybook development server locally. Open [http://localhost:6006](http://localhost:6006) (or the specified port) to view the components interactively in your browser. This is the primary way to view and develop components.
58
+
59
+ * ### `npm run build-storybook` or `yarn build-storybook` or `pnpm build-storybook`
60
+
61
+ Builds the static Storybook site for deployment (outputs to the `storybook-static` directory). This is configured with the correct base path for deployment to GitHub Pages.
62
+
63
+ * ### `npm run build` or `yarn build` or `pnpm build`
64
+
65
+ Builds the component library itself for production (using `tsc` and `vite build`). The output is typically placed in the `dist` directory. This is used if you intend to publish the library as a package or consume its build artifacts directly.
66
+
67
+ * ### `npm run lint` or `yarn lint` or `pnpm lint`
68
+
69
+ Runs the ESLint checker to find potential issues in the code.
70
+
71
+ * ### `npm run dev` or `yarn dev` or `pnpm dev`
72
+
73
+ Runs the Vite development server. This might be configured for library development mode or a minimal test app within the library project.
74
+
75
+ * ### `npm run preview` or `yarn preview` or `pnpm preview`
76
+
77
+ Locally previews the production build of the *library* (from the `dist` directory), not Storybook.
78
+
79
+ The Storybook documentation site, showcasing all components and assets, is deployed to GitHub Pages.
80
+
81
+ * **Source Branch for Storybook Code:** `Storybook-Demo`
82
+ * **Deployment Target:** `gh-pages` branch, under the `/storybook` subdirectory.
83
+
84
+
85
+ Deployment is typically handled via manual `npx gh-pages` commands or could be automated with GitHub Actions (check `.github/workflows/` on the `main` branch for relevant workflows).
86
+
87
+ ## Consuming This Library
88
+
89
+ *(Placeholder: This section needs to detail how other projects, like the Next.js demo app on the `main` branch, will consume this component library. Options include:*
90
+ * *Publishing as an npm package (to npmjs.com or GitHub Packages).*
91
+ * *Setting up monorepo workspaces (e.g., with npm, yarn, or pnpm) within the `DesignSystem` repository if both the library and consumer apps are to be developed in lockstep.*
92
+ * *Using local path references (e.g., `file:...`) during development, with a more robust solution for production builds.)*
93
+