@coopdigital/react 1.16.1 → 1.17.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.
@@ -0,0 +1,28 @@
1
+ import { StandardSizes } from "../../types/index.js";
2
+ import { HTMLAttributes, JSX, ReactNode, Ref } from "react";
3
+ //#region src/components/Prose/Prose.d.ts
4
+ interface ProseProps extends HTMLAttributes<HTMLDivElement> {
5
+ /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
6
+ children?: string | ReactNode;
7
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
8
+ className?: string;
9
+ /** **(Optional)** Specify if the Prose container should stretch to 100% width.
10
+ *
11
+ * If this not set, the container will be 100% width up to a maximum of 864px / 54rem */
12
+ full?: boolean;
13
+ /** **(Optional)** Specify a custom React ref for this component. */
14
+ ref?: Ref<HTMLDivElement>;
15
+ /** **(Optional)** Specify font size behaviour. When set to `lg`, body copy will increase to 20px on larger screens.
16
+ *
17
+ * Default: `md`
18
+ */
19
+ size?: "md" | "lg";
20
+ /** **(Optional)** Specify the Prose spacing.
21
+ *
22
+ * Default: `md`
23
+ */
24
+ spacing?: StandardSizes;
25
+ }
26
+ declare const Prose: ({ children, className, full, ref, size, spacing, ...props }: ProseProps) => JSX.Element;
27
+ //#endregion
28
+ export { Prose, Prose as default, ProseProps };
@@ -0,0 +1,16 @@
1
+ import clsx from "clsx";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/Prose/Prose.tsx
4
+ const Prose = ({ children, className, full, ref, size, spacing, ...props }) => {
5
+ return /* @__PURE__ */ jsx("div", {
6
+ className: clsx("coop-prose ", className),
7
+ "data-full": full ?? void 0,
8
+ "data-size": size ?? void 0,
9
+ "data-spacing": spacing ?? void 0,
10
+ ...props,
11
+ ref,
12
+ children
13
+ });
14
+ };
15
+ //#endregion
16
+ export { Prose, Prose as default };
@@ -0,0 +1,2 @@
1
+ import { Prose, ProseProps } from "./Prose.js";
2
+ export { Prose, Prose as default, ProseProps };
@@ -0,0 +1,5 @@
1
+ import { Prose } from "./Prose.js";
2
+ //#region src/components/Prose/index.ts
3
+ var Prose_default = Prose;
4
+ //#endregion
5
+ export { Prose, Prose_default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopdigital/react",
3
3
  "type": "module",
4
- "version": "1.16.1",
4
+ "version": "1.17.0",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -65,11 +65,11 @@
65
65
  "devDependencies": {
66
66
  "@axe-core/playwright": "^4.12.1",
67
67
  "@playwright/test": "^1.62.1",
68
- "@storybook/addon-a11y": "^10.5.5",
69
- "@storybook/addon-docs": "^10.5.5",
70
- "@storybook/addon-onboarding": "^10.5.5",
71
- "@storybook/react-vite": "^10.5.5",
72
- "@testing-library/jest-dom": "^7.0.0",
68
+ "@storybook/addon-a11y": "^10.5.7",
69
+ "@storybook/addon-docs": "^10.5.7",
70
+ "@storybook/addon-onboarding": "^10.5.7",
71
+ "@storybook/react-vite": "^10.5.7",
72
+ "@testing-library/jest-dom": "^7.0.1",
73
73
  "@testing-library/react": "^16.3.2",
74
74
  "@types/react": "^19.2.18",
75
75
  "@types/react-dom": "^19.2.4",
@@ -78,7 +78,7 @@
78
78
  "react-dom": "^19.2.8",
79
79
  "resize-observer-polyfill": "^1.5.1",
80
80
  "serve": "^14.2.6",
81
- "storybook": "^10.5.5",
81
+ "storybook": "^10.5.7",
82
82
  "storybook-addon-tag-badges": "^3.1.0"
83
83
  },
84
84
  "peerDependencies": {
@@ -102,12 +102,12 @@
102
102
  "storybook": "$storybook"
103
103
  },
104
104
  "dependencies": {
105
- "@coopdigital/styles": "^1.12.1",
105
+ "@coopdigital/styles": "^1.12.2",
106
106
  "@radix-ui/react-popover": "^1.1.23",
107
107
  "clsx": "^2.1.1",
108
108
  "date-fns": "^4.4.0",
109
109
  "merge-refs": "^2.0.0",
110
110
  "react-day-picker": "^10.0.1"
111
111
  },
112
- "gitHead": "f55d477f98dd57a88d7527a208b33abbf8be3ef8"
112
+ "gitHead": "05cd33769f67dfa31c83096a5386c1817e9ab850"
113
113
  }
@@ -0,0 +1,54 @@
1
+ import type { HTMLAttributes, JSX, ReactNode, Ref } from "react"
2
+
3
+ import clsx from "clsx"
4
+
5
+ import { StandardSizes } from "../../types"
6
+
7
+ export interface ProseProps extends HTMLAttributes<HTMLDivElement> {
8
+ /** **(Optional)** Main content inside the component. It can be any valid JSX or string. */
9
+ children?: string | ReactNode
10
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
11
+ className?: string
12
+ /** **(Optional)** Specify if the Prose container should stretch to 100% width.
13
+ *
14
+ * If this not set, the container will be 100% width up to a maximum of 864px / 54rem */
15
+ full?: boolean
16
+ /** **(Optional)** Specify a custom React ref for this component. */
17
+ ref?: Ref<HTMLDivElement>
18
+ /** **(Optional)** Specify font size behaviour. When set to `lg`, body copy will increase to 20px on larger screens.
19
+ *
20
+ * Default: `md`
21
+ */
22
+ size?: "md" | "lg"
23
+ /** **(Optional)** Specify the Prose spacing.
24
+ *
25
+ * Default: `md`
26
+ */
27
+ spacing?: StandardSizes
28
+ }
29
+
30
+ export const Prose = ({
31
+ children,
32
+ className,
33
+ full,
34
+ ref,
35
+ size,
36
+ spacing,
37
+ ...props
38
+ }: ProseProps): JSX.Element => {
39
+ const componentProps = {
40
+ className: clsx("coop-prose ", className),
41
+ "data-full": full ?? undefined,
42
+ "data-size": size ?? undefined,
43
+ "data-spacing": spacing ?? undefined,
44
+ ...props,
45
+ }
46
+
47
+ return (
48
+ <div {...componentProps} ref={ref}>
49
+ {children}
50
+ </div>
51
+ )
52
+ }
53
+
54
+ export default Prose
@@ -0,0 +1,5 @@
1
+ import Prose from "./Prose"
2
+
3
+ export default Prose
4
+ export { Prose }
5
+ export * from "./Prose"