@canonical/react-ds-global 0.42.0 → 0.43.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
@@ -9,10 +9,16 @@ Universal React components for the Pragma design system. This package provides f
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- bun add @canonical/react-ds-global
12
+ bun add @canonical/react-ds-global @canonical/styles
13
13
  ```
14
14
 
15
- The package depends on `@canonical/styles` for CSS.
15
+ Import the design system's styles **first** in your application's entry, before anything that imports a component:
16
+
17
+ ```ts
18
+ import "@canonical/styles";
19
+ ```
20
+
21
+ Each component brings its own stylesheet when you import it.
16
22
 
17
23
  ## Usage
18
24
 
@@ -49,12 +55,6 @@ The modifier classes integrate with CSS custom properties defined in `@canonical
49
55
 
50
56
  ## Styles
51
57
 
52
- Import the main styles package in your application entry point:
53
-
54
- ```tsx
55
- import "@canonical/styles";
56
- ```
57
-
58
58
  `@canonical/styles` provides the global design tokens (colour, spacing, typography). Each component in this package co-locates its own component-level tokens in a `styles.css` file next to the component source. These component tokens reference the global tokens from `@canonical/design-tokens` and are included automatically when the component is imported.
59
59
 
60
60
  ### How component CSS reaches the page
@@ -71,6 +71,8 @@
71
71
  }
72
72
 
73
73
  .ds.accordion-item {
74
+ box-sizing: border-box;
75
+
74
76
  /* Inline (side) borders — off by default, see the token above. */
75
77
  border-inline: var(--accordion-item-border-inline);
76
78
 
@@ -84,6 +86,7 @@
84
86
  chevron column keeps all headings left-aligned; align-items:center centres
85
87
  the fixed chevron on the header line. */
86
88
  .ds.accordion-item > .header {
89
+ box-sizing: border-box;
87
90
  display: flex;
88
91
  flex-direction: row;
89
92
  align-items: center;
@@ -228,11 +231,19 @@
228
231
  }
229
232
  }
230
233
 
234
+ /* Chromium 131+ wraps non-<summary> children in an internal ::details-content
235
+ pseudo-element. Seal its box model so child elements inheriting box-sizing
236
+ (e.g. Vanilla components or host resets) receive border-box. */
237
+ .ds.accordion-item::details-content {
238
+ box-sizing: border-box;
239
+ }
240
+
231
241
  /* Content panel. Uses `.editorial` (a prose context) rather than `.p`, so the
232
242
  wrapper doesn't add baseline padding that would double up with content that
233
243
  is already `.p`. The wrapper owns its own vertical padding in baseline
234
244
  multiples, and is indented inline to align under the heading. */
235
245
  .ds.accordion-item > .content {
246
+ box-sizing: border-box;
236
247
  color: var(--accordion-item-color-text);
237
248
 
238
249
  padding-block: var(--accordion-item-content-padding-block);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonical/react-ds-global",
3
- "version": "0.42.0",
3
+ "version": "0.43.0",
4
4
  "type": "module",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
27
- "url": "https://github.com/canonical/pragma"
27
+ "url": "https://github.com/canonical/pragma-web"
28
28
  },
29
29
  "license": "LGPL-3.0",
30
30
  "bugs": {
31
- "url": "https://github.com/canonical/pragma/issues"
31
+ "url": "https://github.com/canonical/pragma-web/issues"
32
32
  },
33
- "homepage": "https://github.com/canonical/pragma#readme",
33
+ "homepage": "https://github.com/canonical/pragma-web#readme",
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
@@ -53,26 +53,26 @@
53
53
  "test:vitest:watch": "vitest"
54
54
  },
55
55
  "dependencies": {
56
- "@canonical/design-tokens": "0.10.0",
57
- "@canonical/ds-assets": "^0.42.0",
58
- "@canonical/ds-utils": "^0.42.0",
59
- "@canonical/react-hooks": "^0.42.0",
60
- "@canonical/storybook-config": "^0.42.0",
61
- "@canonical/styles": "^0.42.0",
56
+ "@canonical/design-tokens": "0.43.0",
57
+ "@canonical/ds-assets": "^0.43.0",
58
+ "@canonical/ds-utils": "^0.43.0",
59
+ "@canonical/react-hooks": "^0.43.0",
60
+ "@canonical/storybook-config": "^0.43.0",
61
+ "@canonical/styles": "^0.43.0",
62
62
  "react": "^19.2.4",
63
63
  "react-dom": "^19.2.4"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@biomejs/biome": "2.5.14",
67
- "@canonical/biome-config": "^0.42.0",
68
- "@canonical/ds-types": "^0.42.0",
69
- "@canonical/router-core": "^0.42.0",
70
- "@canonical/router-react": "^0.42.0",
71
- "@canonical/storybook-addon-utils": "^0.42.0",
72
- "@canonical/storybook-helpers": "^0.42.0",
73
- "@canonical/typescript-config-react": "^0.42.0",
74
- "@canonical/vitest-config-react": "^0.42.0",
75
- "@canonical/webarchitect": "^0.42.0",
67
+ "@canonical/biome-config": "0.43.0",
68
+ "@canonical/ds-types": "^0.43.0",
69
+ "@canonical/router-core": "^0.43.0",
70
+ "@canonical/router-react": "^0.43.0",
71
+ "@canonical/storybook-addon-utils": "^0.43.0",
72
+ "@canonical/storybook-helpers": "^0.43.0",
73
+ "@canonical/typescript-config-react": "^0.43.0",
74
+ "@canonical/vitest-config-react": "^0.43.0",
75
+ "@canonical/webarchitect": "0.43.0",
76
76
  "@chromatic-com/storybook": "^5.0.1",
77
77
  "@storybook/addon-docs": "^10.6.0",
78
78
  "@storybook/react-vite": "^10.6.0",
@@ -88,7 +88,7 @@
88
88
  "storybook": "^10.6.0",
89
89
  "typescript": "^7.0.2",
90
90
  "vite": "^8.0.1",
91
- "vitest": "^4.0.18"
91
+ "vitest": "^5.0.0"
92
92
  },
93
- "gitHead": "75c2b17029ba899be3fa645be28290ac6fcb83a9"
93
+ "gitHead": "581682464ef71de3f77dc2dc8bbe2b7e493bb05e"
94
94
  }