@digitalservicebund/ris-ui 3.4.1 → 3.4.3

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
@@ -13,24 +13,20 @@ RIS UI contains three things:
13
13
  Vue, PrimeVue and Tailwind are required for RIS UI to work (you'll see a warning about missing peer dependencies if you're trying to use RIS UI without them). To get started, install:
14
14
 
15
15
  ```sh
16
- # Vue, PrimeVue, and Tailwind if you haven't installed them already.
16
+ # Vue, PrimeVue, and Tailwind if you haven't installed them already
17
17
  npm install vue primevue tailwindcss
18
18
 
19
19
  # RIS UI
20
20
  npm install @digitalservicebund/ris-ui
21
21
  ```
22
22
 
23
- ### Vue setup
23
+ ### Vue (SPA with Vite, Vue CLI or similar)
24
24
 
25
25
  > [!NOTE]
26
26
  >
27
27
  > If you're using Nuxt, follow the instructions for [Nuxt](#nuxt-setup) below instead.
28
28
 
29
- Import and apply the RIS UI theme, styling, and fonts where you set up your application (typically `main.ts`):
30
-
31
- > [!TIP]
32
- >
33
- > As of Tailwind V4. The style is now integrated through the global CSS file, simplifying the setup.
29
+ Import and apply the RIS UI theme and fonts where you set up your application (typically `main.ts`):
34
30
 
35
31
  ```diff
36
32
  // main.ts
@@ -46,6 +42,19 @@ Import and apply the RIS UI theme, styling, and fonts where you set up your appl
46
42
  })
47
43
  ```
48
44
 
45
+ Then, extend your Tailwind configuration for RIS UI:
46
+
47
+ ```diff
48
+ /* import Tailwind and RIS UI styles */
49
+ @import "tailwindcss";
50
+ + @import "@digitalservicebund/ris-ui/style.css";
51
+
52
+ + /* source the RIS UI components for Tailwind class generation */
53
+ + @source "../node_modules/@digitalservicebund/ris-ui/dist/**/*.{js,vue,ts}";
54
+
55
+ /* other config and styles */
56
+ ```
57
+
49
58
  ### Nuxt setup
50
59
 
51
60
  If using Nuxt, skip the Vue setup above.
@@ -60,6 +69,7 @@ Add the PrimeVue module and configure it in `nuxt.config.ts`:
60
69
 
61
70
  ```diff
62
71
  // nuxt.config.ts
72
+ + import tailwindcss from "@tailwindcss/vite";
63
73
  export default defineNuxtConfig({
64
74
  // your other configuration
65
75
  modules: [
@@ -68,6 +78,11 @@ Add the PrimeVue module and configure it in `nuxt.config.ts`:
68
78
  + primevue: {
69
79
  + usePrimeVue: false, // configured in plugins/ris-ui.ts
70
80
  + },
81
+ vite: {
82
+ plugins: [
83
+ + tailwindcss(),
84
+ ],
85
+ }
71
86
  })
72
87
  ```
73
88
 
@@ -75,93 +90,39 @@ Add a new Nuxt plugin to configure PrimeVue:
75
90
 
76
91
  ```typescript
77
92
  // plugins/ris-ui.ts
78
- import { RisUiTheme } from "@digitalservicebund/ris-ui/primevue";
93
+ import { RisUiTheme, RisUiLocale } from "@digitalservicebund/ris-ui/primevue";
79
94
  import PrimeVue from "primevue/config";
80
95
 
81
96
  export default defineNuxtPlugin((nuxtApp) => {
82
97
  nuxtApp.vueApp.use(PrimeVue, {
83
98
  pt: RisUiTheme,
84
99
  unstyled: true,
100
+ locale: RisUiLocale.deDE,
85
101
  });
86
102
  });
87
103
  ```
88
104
 
89
- Finally, add the styles (e.g. `assets/main.css`):
90
-
91
- ```css
92
- @import "@digitalservicebund/ris-ui/style.css";
93
- @import "@digitalservicebund/ris-ui/fonts.css";
94
-
95
- /* Your other CSS */
96
- ```
97
-
98
- ## Tailwind CSS Configuration
99
-
100
- With Tailwind CSS v4, the setup has transitioned to a CSS-based configuration, eliminating the need for a separate tailwind.config.js file. All configuration is now handled directly in your main stylesheet (e.g., style.css).
101
-
102
- ```diff
103
- /* style.css */
104
-
105
- /* 1. Import Tailwind and RIS UI styles */
106
- @import "tailwindcss";
107
- @import "@digitalservicebund/ris-ui/style.css";
108
-
109
- /* 2. Source the RIS UI components for Tailwind class generation */
110
- @source "../node_modules/@digitalservicebund/ris-ui/dist/**/*.{js,vue,ts}";
111
-
112
- /* 3. Optional: Add your custom CSS*/
113
- body {
114
- background-color: #f3f4f6; /* Example: Set default background color */
115
- }
116
-
117
- /* 4. Optional: Define custom theme variables */
118
- @theme {
119
- --highlight-default-default: #d6f7fe;
120
- --highlight-default-hover: #94e8fe;
121
- --highlight-default-selected: #94e8fe;
122
-
123
- /* Add additional variables as needed */
124
- }
125
- ```
126
-
127
- ### Important Note for Nuxt Projects
105
+ Continue with the next step, _Tailwind CSS Configuration_.
128
106
 
129
- To avoid issues with conflicting `@layer` directives, make sure to integrate the `postcss-import` module in your PostCSS configuration:
107
+ ## Getting started
130
108
 
131
- See [Adding custom styles - Tailwind CSS](https://tailwindcss.com/docs/adding-custom-styles#using-multiple-css-files).
109
+ To get you started, here's an example how to use a RIS UI button in your ui component. The Storybook code snippet is hiding some essential parts from you. Here is an an example `StartPage.vue`:
132
110
 
133
- If you're using Nuxt, you may add the `postcss-import` module to your `nuxt.config.ts` file:
134
-
135
- ```diff
136
- // nuxt.config.ts
137
- postcss: {
138
- plugins: {
139
- + "postcss-import": {},
140
- tailwindcss: {},
141
- autoprefixer: {},
142
- },
143
- },
144
- ```
145
-
146
- ## Get started with a button
147
-
148
- To get you started, here's an example how to import a ris-ui button into your ui-component. The Storybook code snippet is hiding some essential parts from you. Here is an an example `StartPage.vue`:
149
-
150
- ```bash
111
+ ```vue
151
112
  <script lang="ts" setup>
152
- import { useRouter } from 'vue-router'
153
- import Button from 'primevue/button'
154
- import IconAdd from '~icons/material-symbols/add'
113
+ import { useRouter } from "vue-router";
114
+ import Button from "primevue/button";
115
+ import IconAdd from "~icons/material-symbols/add";
155
116
 
156
- const router = useRouter()
117
+ const router = useRouter();
157
118
  </script>
158
119
 
159
120
  <template>
160
121
  <Button
161
122
  :disabled="false"
162
- label="Neue Dokumentationseinheit"
163
123
  :loading="false"
164
124
  :text="false"
125
+ label="Neue Dokumentationseinheit"
165
126
  @click="router.push({ path: '/documentUnit/new' })"
166
127
  >
167
128
  <template #icon>
@@ -234,7 +195,8 @@ If you're using VS Code with the [official Tailwind extension](https://tailwindc
234
195
  ```jsonc
235
196
  {
236
197
  // other settings
237
- "tailwindCSS.experimental.classRegex": ["tw`([^`]*)`"],
198
+ "tailwindCSS.classFunctions": ["tw"],
199
+ "tailwindCSS.experimental.configFile": "./src/tailwind/global.css",
238
200
  }
239
201
  ```
240
202
 
@@ -246,7 +208,7 @@ import { tw } from "@/lib/tags";
246
208
  const classes = tw`bg-blue-200 px-16`;
247
209
  ```
248
210
 
249
- See [tags.ts](./src/lib/tags.ts) for more information.
211
+ See [tags.ts](./src/lib/tags.ts) for more information. A similar configuration should work for other IDEs, too.
250
212
 
251
213
  ### Committing
252
214
 
@@ -281,7 +243,11 @@ To release a new version, run the ["Release to npm"](https://github.com/digitals
281
243
  - Create a Git tag and GitHub release
282
244
  - Generate a changelog based on the commits since the last release
283
245
 
284
- Releases are created automatically by [semantic-release](https://github.com/semantic-release/semantic-release?tab=readme-ov-file). Please refer to their documentation to learn more about how version numbers are inferred and how changelogs are created.
246
+ Releases are created automatically by [semantic-release](https://github.com/semantic-release/semantic-release?tab=readme-ov-file). Please refer to their documentation to learn more about how version numbers are inferred and how changelogs are created. In short:
247
+
248
+ - If the commits since the last release only include `fix` type commits, a patch release will be created.
249
+ - If at least one `feat` type commit exists, a minor release will be created.
250
+ - [Breaking changes](https://www.conventionalcommits.org/en/v1.0.0/#commit-message-with-description-and-breaking-change-footer) cause a new major release.
285
251
 
286
252
  ## Contributing
287
253