@canonical/react-ds-app-portal 0.47.0 → 0.49.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.
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "./styles.css";
3
+ const componentCssClassName = "ds button";
3
4
  /** Buttons are clickable elements used to perform an action. */
4
- const Button = ({ id, className, children, style, appearance, ...props }) => {
5
- return (_jsx("button", { id: id, className: ["ds", "button", appearance, className]
5
+ const Button = ({ className, children, appearance, ...props }) => {
6
+ return (_jsx("button", { className: [componentCssClassName, appearance, className]
6
7
  .filter(Boolean)
7
- .join(" "), style: style, "aria-label": props["aria-label"] ||
8
+ .join(" "), "aria-label": props["aria-label"] ||
8
9
  (typeof children === "string" ? children : undefined), ...props, children: children }));
9
10
  };
10
11
  export default Button;
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/lib/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,CAAC;AAEtB,gEAAgE;AAChE,MAAM,MAAM,GAAG,CAAC,EACd,EAAE,EACF,SAAS,EACT,QAAQ,EACR,KAAK,EACL,UAAU,EACV,GAAG,KAAK,EACF,EAAsB,EAAE;IAC9B,OAAO,CACL,iBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC;aAC/C,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,EACZ,KAAK,EAAE,KAAK,gBAKV,KAAK,CAAC,YAAY,CAAC;YACnB,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAEnD,KAAK,YAER,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/lib/Button/Button.tsx"],"names":[],"mappings":";AACA,OAAO,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAE1C,gEAAgE;AAChE,MAAM,MAAM,GAAG,CAAC,EACd,SAAS,EACT,QAAQ,EACR,UAAU,EACV,GAAG,KAAK,EACF,EAAsB,EAAE;IAC9B,OAAO,CACL,iBACE,SAAS,EAAE,CAAC,qBAAqB,EAAE,UAAU,EAAE,SAAS,CAAC;aACtD,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,gBAKV,KAAK,CAAC,YAAY,CAAC;YACnB,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAEnD,KAAK,YAER,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type Props from "./types.js";
2
2
  import "./styles.css";
3
3
  /** Buttons are clickable elements used to perform an action. */
4
- declare const Button: ({ id, className, children, style, appearance, ...props }: Props) => React.ReactElement;
4
+ declare const Button: ({ className, children, appearance, ...props }: Props) => React.ReactElement;
5
5
  export default Button;
6
6
  //# sourceMappingURL=Button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,cAAc,CAAC;AAEtB,gEAAgE;AAChE,QAAA,MAAM,MAAM,6DAOT,KAAK,KAAG,KAAK,CAAC,YAoBhB,CAAC;eAEa,MAAM"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,cAAc,CAAC;AAItB,gEAAgE;AAChE,QAAA,MAAM,MAAM,kDAKT,KAAK,KAAG,KAAK,CAAC,YAkBhB,CAAC;eAEa,MAAM"}
@@ -1,3 +1,3 @@
1
1
  export { default as Button } from "./Button.js";
2
- export type { BaseProps as ButtonBaseProps, default as ButtonProps, } from "./types.js";
2
+ export type { default as ButtonProps } from "./types.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EACV,SAAS,IAAI,eAAe,EAC5B,OAAO,IAAI,WAAW,GACvB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AAChD,YAAY,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,YAAY,CAAC"}
@@ -1,8 +1,11 @@
1
- import type { ButtonHTMLAttributes, ReactNode } from "react";
2
- export interface BaseProps {
3
- id?: string;
4
- /** Additional CSS classes */
5
- className?: string;
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ /**
3
+ * The Button's DS-owned props. Native `<button>` attributes (`id`, `className`,
4
+ * `type`, `disabled`, event handlers, …) come from `ComponentProps<"button">`
5
+ * in {@link default | ButtonProps}, so only genuinely design-system-specific
6
+ * members live here.
7
+ */
8
+ type OwnProps = {
6
9
  /**
7
10
  * Button contents.
8
11
  * String children are also applied as the button's `aria-label`. For
@@ -12,7 +15,7 @@ export interface BaseProps {
12
15
  children: ReactNode;
13
16
  /** The visual style of the button */
14
17
  appearance?: "neutral" | "base" | "positive" | "negative" | "link";
15
- }
16
- type Props = BaseProps & ButtonHTMLAttributes<HTMLButtonElement>;
18
+ };
19
+ type Props = OwnProps & Omit<ComponentProps<"button">, keyof OwnProps>;
17
20
  export type { Props as default };
18
21
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,SAAS;IAExB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;SAKK;IACL,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;CACpE;AAED,KAAK,KAAK,GAAG,SAAS,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEjE,YAAY,EAAE,KAAK,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Button/types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD;;;;;GAKG;AACH,KAAK,QAAQ,GAAG;IACd;;;;;SAKK;IACL,QAAQ,EAAE,SAAS,CAAC;IACpB,qCAAqC;IACrC,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;CACpE,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,MAAM,QAAQ,CAAC,CAAC;AAEvE,YAAY,EAAE,KAAK,IAAI,OAAO,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@canonical/react-ds-app-portal",
3
3
  "description": "Portal-specific components for the Pragma design system",
4
- "version": "0.47.0",
4
+ "version": "0.49.0",
5
5
  "type": "module",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/types/index.d.ts",
@@ -43,20 +43,20 @@
43
43
  "test:vitest:watch": "vitest"
44
44
  },
45
45
  "dependencies": {
46
- "@canonical/react-ds-global": "^0.47.0",
47
- "@canonical/storybook-config": "^0.47.0",
48
- "@canonical/styles": "^0.47.0",
46
+ "@canonical/react-ds-global": "^0.49.0",
47
+ "@canonical/styles": "^0.49.0",
49
48
  "react": "^19.2.4",
50
49
  "react-dom": "^19.2.4"
51
50
  },
52
51
  "devDependencies": {
53
- "@biomejs/biome": "2.5.15",
54
- "@canonical/biome-config": "0.43.0",
55
- "@canonical/design-tokens": "0.44.0",
56
- "@canonical/storybook-helpers": "^0.47.0",
57
- "@canonical/typescript-config-react": "^0.47.0",
58
- "@canonical/vitest-config-react": "^0.47.0",
59
- "@canonical/webarchitect": "0.44.0",
52
+ "@biomejs/biome": "2.6.9",
53
+ "@canonical/biome-config": "0.47.0",
54
+ "@canonical/design-tokens": "0.46.0",
55
+ "@canonical/storybook-config": "^0.49.0",
56
+ "@canonical/storybook-helpers": "^0.49.0",
57
+ "@canonical/typescript-config-react": "^0.49.0",
58
+ "@canonical/vitest-config-react": "^0.49.0",
59
+ "@canonical/webarchitect": "0.46.0",
60
60
  "@chromatic-com/storybook": "^5.0.1",
61
61
  "@storybook/addon-docs": "^10.6.0",
62
62
  "@storybook/react-vite": "^10.6.0",
@@ -68,11 +68,11 @@
68
68
  "@vitejs/plugin-react": "^6.0.0",
69
69
  "copyfiles": "^2.4.1",
70
70
  "globals": "^17.4.0",
71
- "jsdom": "^28.1.0",
71
+ "jsdom": "^31.0.0",
72
72
  "storybook": "^10.6.0",
73
73
  "typescript": "^7.0.2",
74
74
  "vite": "^8.0.1",
75
75
  "vitest": "^5.0.0"
76
76
  },
77
- "gitHead": "f846e7e21001a0fcbc4cd9f28c14a55cea7f4974"
77
+ "gitHead": "9b71099ded16351ee14432246e3d8190f48767ed"
78
78
  }