@digitalservicebund/ris-ui 1.0.1 → 1.2.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
@@ -19,7 +19,7 @@ npm install vue primevue tailwindcss
19
19
  npm install @digitalservicebund/ris-ui
20
20
  ```
21
21
 
22
- ## Usage
22
+ ### Vue setup
23
23
 
24
24
  Import and apply the RIS UI theme, styling, and fonts where you set up your application (typically `main.ts`):
25
25
 
@@ -27,16 +27,70 @@ Import and apply the RIS UI theme, styling, and fonts where you set up your appl
27
27
  // main.ts
28
28
  import { createApp } from "vue";
29
29
  import PrimeVue from "primevue/config";
30
- + import { RisUiTheme } from "@digitalservicebund/ris-ui/primevue";
30
+ + import { RisUiTheme, RisUiLocale } from "@digitalservicebund/ris-ui/primevue";
31
31
  + import "@digitalservicebund/ris-ui/primevue/style.css";
32
32
  + import "@digitalservicebund/ris-ui/fonts.css";
33
33
 
34
34
  const app = createApp().use(PrimeVue, {
35
35
  + unstyled: true,
36
36
  + pt: RisUiTheme,
37
+ + locale: RisUiLocale.deDE
37
38
  })
38
39
  ```
39
40
 
41
+ ### Nuxt setup
42
+
43
+ If using Nuxt, skip the Vue setup above.
44
+
45
+ Install the Nuxt PrimeVue module:
46
+
47
+ ```sh
48
+ npm install @primevue/nuxt-module
49
+ ```
50
+
51
+ Add the PrimeVue module and configure it in `nuxt.config.ts`:
52
+
53
+ ```diff
54
+ // nuxt.config.ts
55
+ export default defineNuxtConfig({
56
+ // your other configuration
57
+ modules: [
58
+ + "@primevue/nuxt-module",
59
+ ],
60
+ + primevue: {
61
+ + usePrimeVue: false, // configured in plugins/ris-ui.ts
62
+ + },
63
+ })
64
+ ```
65
+
66
+ Add a new Nuxt plugin to configure PrimeVue:
67
+
68
+ ```typescript
69
+ // plugins/ris-ui.ts
70
+ import { RisUiTheme } from "@digitalservicebund/ris-ui/primevue";
71
+ import PrimeVue from "primevue/config";
72
+
73
+ export default defineNuxtPlugin((nuxtApp) => {
74
+ nuxtApp.vueApp.use(PrimeVue, {
75
+ pt: RisUiTheme,
76
+ unstyled: true,
77
+ });
78
+ });
79
+ ```
80
+
81
+ Finally, add the styles (e.g. `assets/main.css`):
82
+
83
+ ```css
84
+ @import "@digitalservicebund/ris-ui/primevue/style.css";
85
+ @import "@digitalservicebund/ris-ui/fonts.css";
86
+
87
+ /* Your other CSS */
88
+ ```
89
+
90
+ If not using Tailwind, you may also add these styles directly to the `css` section of `nuxt.config.ts`.
91
+
92
+ ## Tailwind usage
93
+
40
94
  If you want, also install the Tailwind preset (for colors, spacings, etc.) and plugin (for typography classes, etc.):
41
95
 
42
96
  ```diff
@@ -51,6 +105,25 @@ If you want, also install the Tailwind preset (for colors, spacings, etc.) and p
51
105
  };
52
106
  ```
53
107
 
108
+ To avoid issues with conflicting `@layer` directives, make sure to integrate the `postcss-import` module in your PostCSS configuration:
109
+
110
+ See https://tailwindcss.com/docs/adding-custom-styles#using-multiple-css-files
111
+
112
+ ### Using Nuxt
113
+
114
+ You may add the `postcss-import` module to your `nuxt.config.ts` file:
115
+
116
+ ```diff
117
+ // nuxt.config.ts
118
+ postcss: {
119
+ plugins: {
120
+ + "postcss-import": {},
121
+ tailwindcss: {},
122
+ autoprefixer: {},
123
+ },
124
+ },
125
+ ```
126
+
54
127
  ## Development
55
128
 
56
129
  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.
@@ -157,8 +230,8 @@ To release a new version, run the ["Release to npm"](https://github.com/digitals
157
230
  - Create a Git tag and GitHub release
158
231
  - Generate a changelog based on the commits since the last release
159
232
 
160
- 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.
233
+ 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.
161
234
 
162
235
  ## Contributing
163
236
 
164
- See [CONTRIBUTING.md](./CONTRIBUTING.md).
237
+ See [CONTRIBUTING.md](./CONTRIBUTING.md).
@@ -0,0 +1,20 @@
1
+ import { type AutoCompleteProps } from "primevue/autocomplete";
2
+ export interface AutoCompleteSuggestion {
3
+ id: string;
4
+ label: string;
5
+ secondaryLabel?: string;
6
+ }
7
+ export type Props = Pick<AutoCompleteProps, "dropdown" | "ariaLabel" | "ariaLabelledby" | "delay" | "completeOnFocus" | "optionDisabled" | "typeahead" | "scrollHeight" | "dropdownMode" | "placeholder" | "loading" | "invalid" | "disabled" | "forceSelection" | "autoOptionFocus" | "selectOnFocus"> & {
8
+ suggestions?: AutoCompleteSuggestion[];
9
+ initialLabel?: string;
10
+ };
11
+ declare let __VLS_typeProps: Props;
12
+ type __VLS_PublicProps = {
13
+ modelValue?: string;
14
+ } & typeof __VLS_typeProps;
15
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ 'update:modelValue': (modelValue: string) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
+ "onUpdate:modelValue"?: ((modelValue: string) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import RisAutoComplete from "./RisAutoComplete.vue";
2
+ export default RisAutoComplete;
@@ -0,0 +1,23 @@
1
+ declare let __VLS_typeProps: {
2
+ headerCollapsed: string;
3
+ headerExpanded: string;
4
+ };
5
+ type __VLS_PublicProps = {
6
+ modelValue?: boolean;
7
+ } & typeof __VLS_typeProps;
8
+ declare function __VLS_template(): {
9
+ default?(_: {}): any;
10
+ };
11
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ 'update:modelValue': (modelValue: boolean) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
14
+ "onUpdate:modelValue"?: ((modelValue: boolean) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
17
+ export default _default;
18
+
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,2 @@
1
+ import RisSingleAccordion from "./RisSingleAccordion.vue";
2
+ export default RisSingleAccordion;