@db-ux/ngx-core-components 4.9.0 → 4.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @db-ux/ngx-core-components
2
2
 
3
+ ## 4.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat(`DBAccordionItem`): add `open` prop to control the expanded state of an accordion item programmatically. - [see commit 8e7c85d](https://github.com/db-ux-design-system/core-web/commit/8e7c85dfba9e0b013fce9db2151545b8f336a29a)
8
+
9
+ - refactor(form components): replace hard 25ch label width limit with customizable CSS variable `--db-label-max-size` (defaults to `100%`). To restore the previous behavior, set `--db-label-max-size: 25ch;` in your project styles. - [see commit 08b1234](https://github.com/db-ux-design-system/core-web/commit/08b1234342e3c0d622116d528a979ff53d7e2356)
10
+
11
+ ## 4.9.1
12
+
13
+ ### Patch Changes
14
+
15
+ - fix(switch): use `2lh` unit and add `min-inline-size` to prevent track from shrinking - [see commit 78c9fde](https://github.com/db-ux-design-system/core-web/commit/78c9fde67d9677f61eaa41761a088b9c1a9773a1)
16
+
17
+ - fix(notification): remove empty grid gap when icon is hidden - [see commit 96f94c6](https://github.com/db-ux-design-system/core-web/commit/96f94c651391f014e2d073402c2700b524ccbf5e)
18
+
3
19
  ## 4.9.0
4
20
 
5
21
  ### Minor Changes
@@ -199,7 +215,7 @@ _version bump_
199
215
 
200
216
  - fix: set DBTabItem internal state `_selected` correctly - [see commit f7625cb](https://github.com/db-ux-design-system/core-web/commit/f7625cbd9d64513527e826c9d2c1ef42b2734a4b):
201
217
 
202
- - Now also sets aria-selected=true|false correctly which improves screen reader behaviour
218
+ - Now also sets aria-selected=true|false correctly which improves screen reader behaviour
203
219
 
204
220
  ## 4.2.1
205
221
 
package/README.md CHANGED
@@ -6,52 +6,55 @@
6
6
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)
7
7
 
8
8
  An Angular library containing all styles & components of [DB UX Design System (technical components)](https://github.com/db-ux-design-system/core-web).
9
-
10
- > **Note:** Find more information about specific components [here](https://design-system.deutschebahn.com/core-web/review/main)
9
+ We also provide more information about specific components. This information is in our [Design System documentation](https://design-system.deutschebahn.com/documentation/get-started/).
11
10
 
12
11
  ## Install
13
12
 
14
13
  ```shell
15
- npm i @db-ux/ngx-core-components
14
+ pnpm add @db-ux/ngx-core-components @db-ux/core-components @db-ux/core-foundations --save-dev
16
15
  ```
17
16
 
18
- > **Note:** This will install [`@db-ux/core-foundations`](https://www.npmjs.com/package/@db-ux/core-foundations) and [`@db-ux/core-components`](https://www.npmjs.com/package/@db-ux/core-components) as well which contains the `css`/`scss` files
19
-
20
17
  ## Styling Dependencies
21
18
 
22
- Import the styles in `scss` or `css`. Based on your technology the file names could be different.
19
+ Import the styles in your main CSS file:
20
+
21
+ ```css
22
+ /* styles.css */
23
+ @layer whitelabel-theme, db-ux;
24
+ /* You may want to include another theme here, this is a whitelabel theme! So instead of including the following line of code, please have a look at the DB Theme section */
25
+ @import "@db-ux/core-foundations/build/styles/theme/rollup.css"
26
+ layer(whitelabel-theme);
27
+
28
+ @import "@db-ux/core-components/build/styles/bundle.css" layer(db-ux);
29
+ ```
23
30
 
24
- - Default (relative): points to `../assets`
25
- - Rollup (rollup): points to `@db-ux/core-foundations/assets`
26
- - Webpack (webpack): points to `~@db-ux/core-foundations/assets`
31
+ ### PostCSS Plugin (recommended)
27
32
 
28
- <details>
29
- <summary><strong>SCSS</strong></summary>
33
+ We recommend using the [`@db-ux/core-postcss-plugin`](https://www.npmjs.com/package/@db-ux/core-postcss-plugin) to reduce your bundle size. It flattens CSS custom properties by resolving `var()`, `calc()`, `color-mix()`, and `light-dark()` at build time, removing unused declarations.
30
34
 
31
- ```scss styles.scss
32
- // styles.scss
33
- @forward "@db-ux/core-components/build/styles/rollup";
35
+ ```shell
36
+ pnpm add @db-ux/core-postcss-plugin --save-dev
34
37
  ```
35
38
 
36
- </details>
37
- <details>
38
- <summary><strong>CSS</strong></summary>
39
+ Create a `postcss.config.json` in your project root:
39
40
 
40
- ```css styles.css
41
- /* styles.css */
42
- @import "@db-ux/core-components/build/styles/rollup.css";
41
+ ```json
42
+ {
43
+ "plugins": {
44
+ "@db-ux/core-postcss-plugin": {}
45
+ }
46
+ }
43
47
  ```
44
48
 
45
- </details>
49
+ > Angular CLI (`@angular/build:application`) only supports JSON-based PostCSS configs and loads plugins by name via `require()`. Works in both `ng build` and `ng serve`.
46
50
 
47
- > **Note:** The `relative` file contains optional and all components styles. If you consider performance issues see [@db-ux/core-components](https://www.npmjs.com/package/@db-ux/core-components) for more information.
51
+ 📖 **[Learn more about `@db-ux/core-postcss-plugin` node package](https://www.npmjs.com/package/@db-ux/core-postcss-plugin)**
48
52
 
49
53
  ### Resolve assets
50
54
 
51
55
  The current default development config in `angular.json` doesn't use output hashing. This may cause an issue loading the fonts. Look at [this](https://github.com/angular/angular-cli/issues/26347) for more information.
52
56
 
53
- As a solution add `
54
- "outputHashing": "media"` to `configurations/development` in`angular.json`.
57
+ As a solution add `"outputHashing": "media"` to `configurations/development` in `angular.json`.
55
58
 
56
59
  ### DB Theme
57
60
 
@@ -59,8 +62,8 @@ In case that you're building a website or application for Deutsche Bahn, you'll
59
62
 
60
63
  ## Usage
61
64
 
62
- ```ts app.component.ts
63
- //app.component.ts
65
+ ```ts
66
+ // app.component.ts
64
67
  import { DBButton } from '@db-ux/ngx-core-components';
65
68
 
66
69
  @Component({
@@ -68,13 +71,13 @@ import { DBButton } from '@db-ux/ngx-core-components';
68
71
  imports: [
69
72
  // ...,
70
73
  DBButton
71
- ],
74
+ ],
72
75
  standalone: true
73
76
  // ...
74
77
  })
75
78
  ```
76
79
 
77
- ```html app.component.html
80
+ ```html
78
81
  <!-- app.component.html -->
79
82
  <db-button variant="brand">Button</db-button>
80
83
  ```
@@ -83,7 +86,7 @@ import { DBButton } from '@db-ux/ngx-core-components';
83
86
 
84
87
  There are 3 ways to use Events in Angular:
85
88
 
86
- **[ngModel](https://angular.io/api/forms/NgModel)**
89
+ **[ngModel](https://angular.dev/api/forms/NgModel)**
87
90
 
88
91
  ```html
89
92
  <db-input
@@ -93,7 +96,7 @@ There are 3 ways to use Events in Angular:
93
96
  ></db-input>
94
97
  ```
95
98
 
96
- **[FormControl](https://angular.io/api/forms/FormControl)**
99
+ **[FormControl](https://angular.dev/api/forms/FormControl)**
97
100
 
98
101
  ```html
99
102
  <db-input
@@ -103,7 +106,7 @@ There are 3 ways to use Events in Angular:
103
106
  ></db-input>
104
107
  ```
105
108
 
106
- **[change](https://developer.mozilla.org/de/docs/Web/API/HTMLElement/change_event)**
109
+ **[change](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)**
107
110
 
108
111
  ```html
109
112
  <db-input
@@ -127,7 +130,7 @@ npx @db-ux/agent-cli
127
130
 
128
131
  This will create or update `.github/copilot-instructions.md` with component documentation based on your installed `@db-ux` packages, helping AI agents provide better suggestions.
129
132
 
130
- 📖 **[Learn more about `@db-ux/agent-cli` node package](packages/agent-cli/README.md)**
133
+ 📖 **[Learn more about `@db-ux/agent-cli` node package](https://www.npmjs.com/package/@db-ux/agent-cli)**
131
134
 
132
135
  ## Code Quality
133
136
 
@@ -136,7 +139,7 @@ To enforce correct usage of DB UX Design System components in your Angular templ
136
139
  ### Installation
137
140
 
138
141
  ```shell
139
- npm install eslint @db-ux/core-eslint-plugin @angular-eslint/template-parser --save-dev
142
+ pnpm add eslint @db-ux/core-eslint-plugin @angular-eslint/template-parser --save-dev
140
143
  ```
141
144
 
142
145
  ### Setup
@@ -162,6 +165,35 @@ export default [
162
165
 
163
166
  📖 **[Learn more about `@db-ux/core-eslint-plugin` node package](https://www.npmjs.com/package/@db-ux/core-eslint-plugin)**
164
167
 
168
+ ## Stylelint
169
+
170
+ To validate correct usage of DB UX Design System tokens in your CSS/SCSS, use the [`@db-ux/core-stylelint`](https://www.npmjs.com/package/@db-ux/core-stylelint) plugin.
171
+
172
+ ### Installation
173
+
174
+ ```shell
175
+ pnpm add stylelint @db-ux/core-stylelint --save-dev
176
+ ```
177
+
178
+ ### Setup
179
+
180
+ Add to your `.stylelintrc.json`:
181
+
182
+ ```json
183
+ {
184
+ "plugins": ["@db-ux/core-stylelint"],
185
+ "rules": {
186
+ "db-ux/use-spacings": [true],
187
+ "db-ux/use-sizing": [true],
188
+ "db-ux/use-border-width": [true],
189
+ "db-ux/use-border-radius": [true],
190
+ "db-ux/use-border-color": [true]
191
+ }
192
+ }
193
+ ```
194
+
195
+ 📖 **[Learn more about `@db-ux/core-stylelint` node package](https://www.npmjs.com/package/@db-ux/core-stylelint)**
196
+
165
197
  ## Deutsche Bahn brand
166
198
 
167
199
  As we'd like to perfectly support our users and customers on their digital journey, the usage of Deutsche Bahn brand and trademarks are bound of clear guidelines and restrictions even if being used with the code that we're providing with this product; Deutsche Bahn fully reserves all rights regarding the Deutsche Bahn brand, even though that we're providing the code of DB UX Design System products free to use and release it under the Apache 2.0 license.