@digitalservicebund/ris-ui 0.0.1 → 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/README.md +18 -4
- package/dist/fonts/.gitkeep +8 -0
- package/dist/fonts/BundesSansCondWeb.woff +0 -0
- package/dist/fonts/BundesSansCondWeb.woff2 +0 -0
- package/dist/fonts/BundesSansWeb-Bold.woff +0 -0
- package/dist/fonts/BundesSansWeb-Bold.woff2 +0 -0
- package/dist/fonts/BundesSansWeb-BoldItalic.woff +0 -0
- package/dist/fonts/BundesSansWeb-BoldItalic.woff2 +0 -0
- package/dist/fonts/BundesSansWeb-Italic.woff +0 -0
- package/dist/fonts/BundesSansWeb-Italic.woff2 +0 -0
- package/dist/fonts/BundesSansWeb-Regular.woff +0 -0
- package/dist/fonts/BundesSansWeb-Regular.woff2 +0 -0
- package/dist/fonts/BundesSerifWeb-Bold.woff +0 -0
- package/dist/fonts/BundesSerifWeb-Bold.woff2 +0 -0
- package/dist/fonts/BundesSerifWeb-BoldItalic.woff +0 -0
- package/dist/fonts/BundesSerifWeb-BoldItalic.woff2 +0 -0
- package/dist/fonts/BundesSerifWeb-Italic.woff +0 -0
- package/dist/fonts/BundesSerifWeb-Italic.woff2 +0 -0
- package/dist/fonts/BundesSerifWeb-Regular.woff +0 -0
- package/dist/fonts/BundesSerifWeb-Regular.woff2 +0 -0
- package/dist/fonts.css +92 -0
- package/dist/lib/tags.d.ts +1 -1
- package/dist/primevue/index.cjs +1 -1
- package/dist/primevue/index.d.ts +1 -1
- package/dist/primevue/index.js +48 -52
- package/dist/style.css +1 -1
- package/package.json +13 -7
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# RIS UI
|
2
2
|
|
3
|
-
**Component library for NeuRIS** | 👀 [Demo](https://digitalservicebund.github.io/ris-ui) | 🤖 [PrimeVue Docs](https://primevue.org)
|
3
|
+
**Component library for NeuRIS** | 👀 [Demo](https://digitalservicebund.github.io/ris-ui) | 📦 [npm](https://www.npmjs.com/package/@digitalservicebund/ris-ui) | 🤖 [PrimeVue Docs](https://primevue.org)
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -21,7 +21,7 @@ npm install @digitalservicebund/ris-ui
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
Import and apply the RIS UI theme and
|
24
|
+
Import and apply the RIS UI theme, styling, and fonts where you set up your application (typically `main.ts`):
|
25
25
|
|
26
26
|
```diff
|
27
27
|
// main.ts
|
@@ -29,6 +29,7 @@ Import and apply the RIS UI theme and styling where you set up your application
|
|
29
29
|
import PrimeVue from "primevue/config";
|
30
30
|
+ import { RisUiTheme } from "@digitalservicebund/ris-ui/primevue";
|
31
31
|
+ import "@digitalservicebund/ris-ui/primevue/style.css";
|
32
|
+
+ import "@digitalservicebund/ris-ui/fonts.css";
|
32
33
|
|
33
34
|
const app = createApp().use(PrimeVue, {
|
34
35
|
+ unstyled: true,
|
@@ -52,7 +53,7 @@ If you want, also install the Tailwind preset (for colors, spacings, etc.) and p
|
|
52
53
|
|
53
54
|
## Development
|
54
55
|
|
55
|
-
|
56
|
+
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.
|
56
57
|
|
57
58
|
To get started, first clone this repository:
|
58
59
|
|
@@ -64,6 +65,10 @@ Then install dependencies:
|
|
64
65
|
|
65
66
|
```sh
|
66
67
|
npm install
|
68
|
+
|
69
|
+
# This will populate the public/fonts folder. See public/fonts/.gitkeep
|
70
|
+
# for more information.
|
71
|
+
npm run sync-fonts
|
67
72
|
```
|
68
73
|
|
69
74
|
You can now run a local preview to see any changes you make to the code:
|
@@ -141,9 +146,18 @@ When you make a commit now, Lefthook will ensure your changes and commit message
|
|
141
146
|
- ESLint passes without warnings
|
142
147
|
- The commit message follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. If you're making changes to a component, please use the component name as the scope (multiple scopes are allowed).
|
143
148
|
|
149
|
+
Keep in mind that your commit messages will be used for generating changelogs and inferring version numbers when making a release. If you made multiple changes, please consider squashing them to keep the history, as well as the changelogs, tidy and readable.
|
150
|
+
|
144
151
|
### Making a release
|
145
152
|
|
146
|
-
|
153
|
+
To release a new version, run the ["Release to npm"](https://github.com/digitalservicebund/ris-ui/actions/workflows/release.yml) action. This will:
|
154
|
+
|
155
|
+
- Build the project
|
156
|
+
- Publish the build to npm
|
157
|
+
- Create a Git tag and GitHub release
|
158
|
+
- Generate a changelog based on the commits since the last release
|
159
|
+
|
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.
|
147
161
|
|
148
162
|
## Contributing
|
149
163
|
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Fonts are provided by @digitalservicebund/angie. But we need to copy
|
2
|
+
them here rather than bundling them with the rest of the CSS since
|
3
|
+
Vite would otherwise base64-encode and inline them in the CSS. Because
|
4
|
+
we don't need all those fonts, the CSS would be unnecessarily big and
|
5
|
+
slow.
|
6
|
+
|
7
|
+
Also see:
|
8
|
+
https://github.com/vitejs/vite/issues/3295#issuecomment-1353409889
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
package/dist/fonts.css
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
/* BundesSans */
|
2
|
+
@font-face {
|
3
|
+
font-family: BundesSansWeb;
|
4
|
+
font-style: normal;
|
5
|
+
font-weight: 400;
|
6
|
+
font-display: swap;
|
7
|
+
src:
|
8
|
+
url("./fonts/BundesSansWeb-Regular.woff2") format("woff2"),
|
9
|
+
url("./fonts/BundesSansWeb-Regular.woff") format("woff");
|
10
|
+
}
|
11
|
+
|
12
|
+
@font-face {
|
13
|
+
font-family: BundesSansWeb;
|
14
|
+
font-style: italic;
|
15
|
+
font-weight: 400;
|
16
|
+
font-display: swap;
|
17
|
+
src:
|
18
|
+
url("./fonts/BundesSansWeb-Italic.woff2") format("woff2"),
|
19
|
+
url("./fonts/BundesSansWeb-Italic.woff") format("woff");
|
20
|
+
}
|
21
|
+
|
22
|
+
@font-face {
|
23
|
+
font-family: BundesSansWeb;
|
24
|
+
font-style: normal;
|
25
|
+
font-weight: 700;
|
26
|
+
font-display: swap;
|
27
|
+
src:
|
28
|
+
url("./fonts/BundesSansWeb-Bold.woff2") format("woff2"),
|
29
|
+
url("./fonts/BundesSansWeb-Bold.woff") format("woff");
|
30
|
+
}
|
31
|
+
|
32
|
+
@font-face {
|
33
|
+
font-family: BundesSansWeb;
|
34
|
+
font-style: italic;
|
35
|
+
font-weight: 700;
|
36
|
+
font-display: swap;
|
37
|
+
src:
|
38
|
+
url("./fonts/BundesSansWeb-BoldItalic.woff2") format("woff2"),
|
39
|
+
url("./fonts/BundesSansWeb-BoldItalic.woff") format("woff");
|
40
|
+
}
|
41
|
+
|
42
|
+
/* BundesSerif */
|
43
|
+
@font-face {
|
44
|
+
font-family: BundesSerifWeb;
|
45
|
+
font-style: normal;
|
46
|
+
font-weight: 400;
|
47
|
+
font-display: swap;
|
48
|
+
src:
|
49
|
+
url("./fonts/BundesSerifWeb-Regular.woff2") format("woff2"),
|
50
|
+
url("./fonts/BundesSerifWeb-Regular.woff") format("woff");
|
51
|
+
}
|
52
|
+
|
53
|
+
@font-face {
|
54
|
+
font-family: BundesSerifWeb;
|
55
|
+
font-style: italic;
|
56
|
+
font-weight: 400;
|
57
|
+
font-display: swap;
|
58
|
+
src:
|
59
|
+
url("./fonts/BundesSerifWeb-Italic.woff2") format("woff2"),
|
60
|
+
url("./fonts/BundesSerifWeb-Italic.woff") format("woff");
|
61
|
+
}
|
62
|
+
|
63
|
+
@font-face {
|
64
|
+
font-family: BundesSerifWeb;
|
65
|
+
font-style: normal;
|
66
|
+
font-weight: 700;
|
67
|
+
font-display: swap;
|
68
|
+
src:
|
69
|
+
url("./fonts/BundesSerifWeb-Bold.woff2") format("woff2"),
|
70
|
+
url("./fonts/BundesSerifWeb-Bold.woff") format("woff");
|
71
|
+
}
|
72
|
+
|
73
|
+
@font-face {
|
74
|
+
font-family: BundesSerifWeb;
|
75
|
+
font-style: italic;
|
76
|
+
font-weight: 700;
|
77
|
+
font-display: swap;
|
78
|
+
src:
|
79
|
+
url("./fonts/BundesSerifWeb-BoldItalic.woff2") format("woff2"),
|
80
|
+
url("./fonts/BundesSerifWeb-BoldItalic.woff") format("woff");
|
81
|
+
}
|
82
|
+
|
83
|
+
/* BundesSans Condensed */
|
84
|
+
@font-face {
|
85
|
+
font-family: BundesSansCondWeb;
|
86
|
+
font-style: normal;
|
87
|
+
font-weight: 400;
|
88
|
+
font-display: swap;
|
89
|
+
src:
|
90
|
+
url("./fonts/BundesSansCondWeb.woff2") format("woff2"),
|
91
|
+
url("./fonts/BundesSansCondWeb.woff") format("woff");
|
92
|
+
}
|
package/dist/lib/tags.d.ts
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
*/
|
10
10
|
export declare const html: (strings: TemplateStringsArray, ...expressions: unknown[]) => string;
|
11
11
|
/**
|
12
|
-
*
|
12
|
+
* Tagged template string for Tailwind classes. The tag itself doesn't do
|
13
13
|
* anything, but using it will allow your editor to provide Tailwind
|
14
14
|
* Intellisense for template strings in scripts, as well as automatic class
|
15
15
|
* sorting via Prettier.
|
package/dist/primevue/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c={root:({props:e,
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=(e,...n)=>{let o=e[0];for(let a=1,i=e.length;a<i;a++)o+=n[a-1],o+=e[a];return o},t=c,h={root:({props:e,instance:n})=>{const o=t`relative inline-flex max-w-full items-center justify-center gap-8 rounded-none text-center outline-4 outline-offset-4 outline-blue-800 focus:outline active:outline-none disabled:cursor-not-allowed disabled:outline-none`,a=e.severity??"primary",i=t`bg-blue-800 text-white hover:bg-blue-700 active:bg-blue-500 active:text-blue-800 disabled:bg-gray-400 disabled:text-gray-600`,b=t`border-2 border-blue-800 bg-white text-blue-800 hover:bg-gray-200 focus:bg-gray-200 active:border-white active:bg-white disabled:border-blue-500 disabled:text-blue-500 disabled:hover:bg-white`,u=t`border-2 border-transparent bg-transparent text-blue-800 underline hover:border-gray-500 hover:bg-white focus:border-gray-500 active:border-white active:bg-white disabled:bg-transparent disabled:text-gray-500`,s=e.size??"small";let l=t`ris-body2-bold h-48 py-4`,r=t`ris-body1-bold h-64 py-4`;const d=e.iconPos??"left";return n.hasIcon&&e.label?d==="left"?(l=t`${l} pl-8 pr-16`,r=t`${r} pl-20 pr-24`):d==="right"&&(l=t`${l} pl-16 pr-8`,r=t`${r} pl-24 pr-20`):n.hasIcon&&!e.label?(l=t`${l} w-48 px-4`,r=t`${r} w-64 px-4`):(l=t`${l} px-16`,r=t`${r} px-24`),{class:{[o]:!0,[l]:s==="small",[r]:s==="large",[i]:!e.text&&a==="primary",[b]:!e.text&&a==="secondary",[u]:e.text&&a==="primary"}}},label:({props:e})=>({class:{hidden:!e.label,[t`-order-1`]:e.iconPos==="right"}}),loadingIcon:({props:e})=>({class:{[t`animate-spin`]:!0,[t`h-24 w-24`]:e.size==="large",[t`h-[1.34em] w-[1.34em]`]:!e.size||e.size==="small"}})},g={root:{class:t`has-[input:read-only]:curser-not-allowed inline-flex items-center gap-4 border-2 border-blue-800 bg-white px-16 py-0 outline-4 -outline-offset-4 outline-blue-800 has-[[aria-invalid]]:border-red-800 has-[input:disabled]:border-blue-500 has-[input:read-only]:border-blue-300 has-[[aria-invalid]]:bg-red-200 has-[input:disabled]:bg-white has-[input:read-only]:bg-blue-300 has-[[data-size=large]]:px-24 has-[input:disabled]:text-blue-500 has-[input:disabled]:outline-none has-[:focus]:outline has-[:hover]:outline has-[[aria-invalid]]:outline-red-800`}},y={root:{class:t`m-0 p-0`}},p={root:({props:e,parent:n})=>{const o=t`border-2 border-blue-800 bg-white outline-4 -outline-offset-4 outline-blue-800 placeholder:text-gray-900 read-only:cursor-not-allowed read-only:border-blue-300 read-only:bg-blue-300 hover:outline focus:outline disabled:border-blue-500 disabled:bg-white disabled:text-blue-500 disabled:outline-none aria-[invalid]:border-red-800 aria-[invalid]:bg-red-200 aria-[invalid]:outline-red-800 aria-[invalid]:disabled:outline-none`,a=t`[&[type=password]:not(:placeholder-shown)]:text-[28px] [&[type=password]:not(:placeholder-shown)]:tracking-[4px] [&[type=password]]:w-full`,i=n.instance.$name==="InputGroup",b=t`bg-transparent placeholder:text-gray-900 focus:outline-none`,u=t`w-full`,s=t`ris-body2-regular h-48 px-16 py-4`,l=t`ris-body1-regular h-64 px-24 py-4`,r=t`ris-body2-regular h-[44px] p-0`,d=t`ris-body1-regular h-[60px] p-0`;return{class:{[o]:!i,[b]:i,[u]:!!e.fluid,[a]:!0,[s]:(!e.size||e.size==="small")&&!i,[r]:(!e.size||e.size==="small")&&i,[l]:e.size==="large"&&!i,[d]:e.size==="large"&&i},"data-size":e.size??"small"}}},x={},w={button:h,inputText:p,inputGroup:g,inputGroupAddon:y,password:x};exports.RisUiTheme=w;
|
package/dist/primevue/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import "./global.css";
|
2
|
-
export declare const
|
2
|
+
export declare const RisUiTheme: {
|
3
3
|
button: import("primevue/button").ButtonPassThroughOptions<any>;
|
4
4
|
inputText: import("primevue/inputtext").InputTextPassThroughOptions<any>;
|
5
5
|
inputGroup: import("primevue/inputgroup").InputGroupPassThroughOptions;
|
package/dist/primevue/index.js
CHANGED
@@ -1,62 +1,58 @@
|
|
1
|
-
const c = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
"
|
15
|
-
"
|
16
|
-
"
|
17
|
-
!
|
18
|
-
|
19
|
-
|
20
|
-
t,
|
21
|
-
n,
|
22
|
-
a,
|
23
|
-
s,
|
24
|
-
u
|
25
|
-
]
|
1
|
+
const c = (e, ...n) => {
|
2
|
+
let o = e[0];
|
3
|
+
for (let a = 1, i = e.length; a < i; a++)
|
4
|
+
o += n[a - 1], o += e[a];
|
5
|
+
return o;
|
6
|
+
}, t = c, h = {
|
7
|
+
root: ({ props: e, instance: n }) => {
|
8
|
+
const o = t`relative inline-flex max-w-full items-center justify-center gap-8 rounded-none text-center outline-4 outline-offset-4 outline-blue-800 focus:outline active:outline-none disabled:cursor-not-allowed disabled:outline-none`, a = e.severity ?? "primary", i = t`bg-blue-800 text-white hover:bg-blue-700 active:bg-blue-500 active:text-blue-800 disabled:bg-gray-400 disabled:text-gray-600`, b = t`border-2 border-blue-800 bg-white text-blue-800 hover:bg-gray-200 focus:bg-gray-200 active:border-white active:bg-white disabled:border-blue-500 disabled:text-blue-500 disabled:hover:bg-white`, u = t`border-2 border-transparent bg-transparent text-blue-800 underline hover:border-gray-500 hover:bg-white focus:border-gray-500 active:border-white active:bg-white disabled:bg-transparent disabled:text-gray-500`, s = e.size ?? "small";
|
9
|
+
let l = t`ris-body2-bold h-48 py-4`, r = t`ris-body1-bold h-64 py-4`;
|
10
|
+
const d = e.iconPos ?? "left";
|
11
|
+
return n.hasIcon && e.label ? d === "left" ? (l = t`${l} pl-8 pr-16`, r = t`${r} pl-20 pr-24`) : d === "right" && (l = t`${l} pl-16 pr-8`, r = t`${r} pl-24 pr-20`) : n.hasIcon && !e.label ? (l = t`${l} w-48 px-4`, r = t`${r} w-64 px-4`) : (l = t`${l} px-16`, r = t`${r} px-24`), {
|
12
|
+
class: {
|
13
|
+
[o]: !0,
|
14
|
+
[l]: s === "small",
|
15
|
+
[r]: s === "large",
|
16
|
+
[i]: !e.text && a === "primary",
|
17
|
+
[b]: !e.text && a === "secondary",
|
18
|
+
[u]: e.text && a === "primary"
|
19
|
+
}
|
26
20
|
};
|
27
21
|
},
|
28
22
|
label: ({ props: e }) => ({
|
29
|
-
class:
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
class: {
|
24
|
+
hidden: !e.label,
|
25
|
+
[t`-order-1`]: e.iconPos === "right"
|
26
|
+
}
|
27
|
+
}),
|
28
|
+
loadingIcon: ({ props: e }) => ({
|
29
|
+
class: {
|
30
|
+
[t`animate-spin`]: !0,
|
31
|
+
[t`h-24 w-24`]: e.size === "large",
|
32
|
+
[t`h-[1.34em] w-[1.34em]`]: !e.size || e.size === "small"
|
33
|
+
}
|
33
34
|
})
|
34
|
-
}, g =
|
35
|
-
let l = e[0];
|
36
|
-
for (let r = 1, t = e.length; r < t; r++)
|
37
|
-
l += o[r - 1], l += e[r];
|
38
|
-
return l;
|
39
|
-
}, i = g, f = {
|
35
|
+
}, g = {
|
40
36
|
root: {
|
41
|
-
class:
|
37
|
+
class: t`has-[input:read-only]:curser-not-allowed inline-flex items-center gap-4 border-2 border-blue-800 bg-white px-16 py-0 outline-4 -outline-offset-4 outline-blue-800 has-[[aria-invalid]]:border-red-800 has-[input:disabled]:border-blue-500 has-[input:read-only]:border-blue-300 has-[[aria-invalid]]:bg-red-200 has-[input:disabled]:bg-white has-[input:read-only]:bg-blue-300 has-[[data-size=large]]:px-24 has-[input:disabled]:text-blue-500 has-[input:disabled]:outline-none has-[:focus]:outline has-[:hover]:outline has-[[aria-invalid]]:outline-red-800`
|
42
38
|
}
|
43
|
-
},
|
39
|
+
}, p = {
|
44
40
|
root: {
|
45
|
-
class:
|
41
|
+
class: t`m-0 p-0`
|
46
42
|
}
|
47
43
|
}, y = {
|
48
|
-
root: ({ props: e, parent:
|
49
|
-
const
|
44
|
+
root: ({ props: e, parent: n }) => {
|
45
|
+
const o = t`border-2 border-blue-800 bg-white outline-4 -outline-offset-4 outline-blue-800 placeholder:text-gray-900 read-only:cursor-not-allowed read-only:border-blue-300 read-only:bg-blue-300 hover:outline focus:outline disabled:border-blue-500 disabled:bg-white disabled:text-blue-500 disabled:outline-none aria-[invalid]:border-red-800 aria-[invalid]:bg-red-200 aria-[invalid]:outline-red-800 aria-[invalid]:disabled:outline-none`, a = t`[&[type=password]:not(:placeholder-shown)]:text-[28px] [&[type=password]:not(:placeholder-shown)]:tracking-[4px] [&[type=password]]:w-full`, i = n.instance.$name === "InputGroup", b = t`bg-transparent placeholder:text-gray-900 focus:outline-none`, u = t`w-full`, s = t`ris-body2-regular h-48 px-16 py-4`, l = t`ris-body1-regular h-64 px-24 py-4`, r = t`ris-body2-regular h-[44px] p-0`, d = t`ris-body1-regular h-[60px] p-0`;
|
50
46
|
return {
|
51
47
|
class: {
|
52
|
-
[
|
53
|
-
[
|
54
|
-
[
|
55
|
-
[
|
56
|
-
[s]: (!e.size || e.size === "small") && !
|
57
|
-
[
|
58
|
-
[
|
59
|
-
[
|
48
|
+
[o]: !i,
|
49
|
+
[b]: i,
|
50
|
+
[u]: !!e.fluid,
|
51
|
+
[a]: !0,
|
52
|
+
[s]: (!e.size || e.size === "small") && !i,
|
53
|
+
[r]: (!e.size || e.size === "small") && i,
|
54
|
+
[l]: e.size === "large" && !i,
|
55
|
+
[d]: e.size === "large" && i
|
60
56
|
},
|
61
57
|
"data-size": e.size ?? "small"
|
62
58
|
};
|
@@ -64,12 +60,12 @@ const c = {
|
|
64
60
|
}, x = {
|
65
61
|
// All styling moved to inputText.ts
|
66
62
|
}, w = {
|
67
|
-
button:
|
63
|
+
button: h,
|
68
64
|
inputText: y,
|
69
|
-
inputGroup:
|
70
|
-
inputGroupAddon:
|
65
|
+
inputGroup: g,
|
66
|
+
inputGroupAddon: p,
|
71
67
|
password: x
|
72
68
|
};
|
73
69
|
export {
|
74
|
-
w as
|
70
|
+
w as RisUiTheme
|
75
71
|
};
|