@digitalservicebund/ris-ui 1.7.0 → 2.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/README.md CHANGED
@@ -10,10 +10,10 @@ RUI UI contains three things:
10
10
  - [custom components](./src/components/);
11
11
  - a [preset and plugin](./src/tailwind/) for [Tailwind](https://tailwindcss.com) that sets some global styling and exposes the design tokens used by the theme, so you can build custom UI that looks consistent with the components.
12
12
 
13
- Vue and PrimeVue 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). Tailwind is optional. To get started, install:
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 and PrimeVue if you haven't installed them already. Tailwind is optional.
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
@@ -33,8 +33,8 @@ Import and apply the RIS UI theme, styling, and fonts where you set up your appl
33
33
  import { createApp } from "vue";
34
34
  import PrimeVue from "primevue/config";
35
35
  + import { RisUiTheme, RisUiLocale } from "@digitalservicebund/ris-ui/primevue";
36
- + import "@digitalservicebund/ris-ui/primevue/style.css";
37
36
  + import "@digitalservicebund/ris-ui/fonts.css";
37
+ + import "@digitalservicebund/ris-ui/primevue/style.css"
38
38
 
39
39
  const app = createApp().use(PrimeVue, {
40
40
  + unstyled: true,
@@ -92,17 +92,21 @@ Finally, add the styles (e.g. `assets/main.css`):
92
92
  /* Your other CSS */
93
93
  ```
94
94
 
95
- If not using Tailwind, you may also add these styles directly to the `css` section of `nuxt.config.ts`.
95
+ ## Tailwind setup
96
96
 
97
- ## With Tailwind
98
-
99
- If you want, also install the Tailwind preset (for colors, spacings, etc.) and plugin (for typography classes, etc.):
97
+ - Add the `RisUiPreset` (for colors, spacings, etc.) and the `RisUiPlugin` (for typography classes, etc.)
98
+ - Ensure the path to the RIS-UI files is included in the content array of your Tailwind config (e.g., `"./node_modules/@digitalservicebund/ris-ui/dist/**/*.{js,vue,ts}"`). This ensures all necessary classes from RIS UI are generated.
100
99
 
101
100
  ```diff
102
101
  // tailwind.config.js
103
102
  + import { RisUiPreset, RisUiPlugin } from "@digitalservicebund/ris-ui/tailwind";
104
103
 
105
104
  export default {
105
+ content: [
106
+ + "./node_modules/@digitalservicebund/ris-ui/dist/**/*.{js,vue,ts}",
107
+ // Other content sources
108
+ ],
109
+
106
110
  + presets: [RisUiPreset],
107
111
  + plugins: [RisUiPlugin],
108
112
 
@@ -110,6 +114,17 @@ If you want, also install the Tailwind preset (for colors, spacings, etc.) and p
110
114
  };
111
115
  ```
112
116
 
117
+ Ensure Tailwind is included in your main stylesheet (e.g., `style.css`):
118
+
119
+ ```diff
120
+ // style.css
121
+ @tailwind base;
122
+ @tailwind components;
123
+ @tailwind utilities;
124
+ ```
125
+
126
+ ### Important Note for Nuxt Projects
127
+
113
128
  To avoid issues with conflicting `@layer` directives, make sure to integrate the `postcss-import` module in your PostCSS configuration:
114
129
 
115
130
  See [Adding custom styles - Tailwind CSS](https://tailwindcss.com/docs/adding-custom-styles#using-multiple-css-files).
@@ -127,6 +142,36 @@ If you're using Nuxt, you may add the `postcss-import` module to your `nuxt.conf
127
142
  },
128
143
  ```
129
144
 
145
+ ## Get started with a button
146
+
147
+ 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`:
148
+
149
+ ```bash
150
+ <script lang="ts" setup>
151
+ import { useRouter } from 'vue-router'
152
+ import Button from 'primevue/button'
153
+ import IconAdd from '~icons/material-symbols/add'
154
+
155
+ const router = useRouter()
156
+ </script>
157
+
158
+ <template>
159
+ <Button
160
+ :disabled="false"
161
+ label="Neue Dokumentationseinheit"
162
+ :loading="false"
163
+ :text="false"
164
+ @click="router.push({ path: '/documentUnit/new' })"
165
+ >
166
+ <template #icon>
167
+ <IconAdd />
168
+ </template>
169
+ </Button>
170
+ </template>
171
+ ```
172
+
173
+ In addition to the installation steps, the icon is being provided by [unplugin-icons](https://www.npmjs.com/package/unplugin-icons) in conjunction with [@iconify-json/material-symbols](https://www.npmjs.com/package/@iconify-json/material-symbols).
174
+
130
175
  ## Development
131
176
 
132
177
  To make changes to RIS UI, you'll need the current [Node.js LTS](https://nodejs.org/en/download/package-manager) along with npm installed on your machine.
@@ -18,5 +18,14 @@ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {
18
18
  'update:modelValue': (value: string) => any;
19
19
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
20
20
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
21
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {
22
+ autoCompleteRef: import("vue").CreateComponentPublicInstanceWithMixins<{}, {}, {}, {}, import("vue").MethodOptions, {}, {}, ((e: "update:modelValue", value: any) => void) & ((e: "change", event: import("primevue/autocomplete").AutoCompleteChangeEvent) => void) & ((e: "focus", event: Event) => void) & ((e: "blur", event: Event) => void) & ((e: "item-select", event: import("primevue/autocomplete").AutoCompleteOptionSelectEvent) => void) & ((e: "item-unselect", event: import("primevue/autocomplete").AutoCompleteOptionUnselectEvent) => void) & ((e: "option-select", event: import("primevue/autocomplete").AutoCompleteOptionSelectEvent) => void) & ((e: "option-unselect", event: import("primevue/autocomplete").AutoCompleteOptionUnselectEvent) => void) & ((e: "dropdown-click", event: import("primevue/autocomplete").AutoCompleteDropdownClickEvent) => void) & ((e: "clear") => void) & ((e: "complete", event: import("primevue/autocomplete").AutoCompleteCompleteEvent) => void) & ((e: "before-show") => void) & ((e: "before-hide") => void) & ((e: "show") => void) & ((e: "hide") => void) & import("vue").ObjectEmitsOptions, {}, {}, true, {}, import("primevue/autocomplete").AutoCompleteSlots & import("vue").SlotsType, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
23
+ P: {};
24
+ B: {};
25
+ D: {};
26
+ C: {};
27
+ M: {};
28
+ Defaults: {};
29
+ }, {}, {}, {}, {}, import("vue").MethodOptions, {}> | null;
30
+ }, any>;
22
31
  export default _default;