@coopdigital/react 0.30.2 → 0.31.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,12 @@
1
+ import type { JSX, ReactNode, SVGProps } from "react";
2
+ import { Darks, Lights } from "../../types/colors";
3
+ export interface FlourishProps extends SVGProps<SVGSVGElement> {
4
+ /** Specify the text to be highlighted by the Flourish. */
5
+ children: string | ReactNode;
6
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
7
+ className?: string;
8
+ /** **(Optional)** Specify the Flourish color. */
9
+ fill?: Darks | Lights;
10
+ }
11
+ export declare const Flourish: ({ children, className, fill, ...props }: FlourishProps) => JSX.Element;
12
+ export default Flourish;
@@ -0,0 +1,13 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { clsx } from '../../node_modules/clsx/dist/clsx.js';
3
+
4
+ const Flourish = ({ children, className, fill = "light-yellow", ...props }) => {
5
+ const componentProps = {
6
+ className: clsx("coop-flourish ", className),
7
+ fill: `var(--color-${fill})`,
8
+ ...props,
9
+ };
10
+ return (jsxs("span", { style: { position: "relative" }, children: [children, jsx("svg", { ...componentProps, height: "10", viewBox: "0 0 276 10", width: "276", children: jsx("path", { d: "M275.9 8.6c.1-1.6.2-1.8-.4-2.9.3-1-.3-1.2-1.8-1.1v-.3c.6-.4.2-.2 1.4-.1-.9-2.3-5.6-1.8-8.5-2.3C259 .5 246.3.7 237.4.5L185 .4l-33-.2-26.1-.2-67.4 1.2-44.3.5C10.7 2.1 1.5.4 0 3.3l1 .2L0 4v.5C8.2 7.9 26.6 7.2 35.6 7c5 0 13.5 1.6 16.5-.6C53.4 8 59.5 8 62 7.7l45 .1 42.8.3 30.7.3 44.2.6 27.8-.5 23 .8c.1-.8-.3-.5.5-.7ZM219 2.8v-.2l.8-.2h.4l.3.4H219Zm30-.1h1.2c-.8.4-.5.3-1.2 0Zm6.2.6.2-.4h.3l-.5.4Z" }) })] }));
11
+ };
12
+
13
+ export { Flourish, Flourish as default };
@@ -0,0 +1,4 @@
1
+ import Flourish from "./Flourish";
2
+ export default Flourish;
3
+ export { Flourish };
4
+ export * from "./Flourish";
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./components/Author";
3
3
  export * from "./components/Button";
4
4
  export * from "./components/Card";
5
5
  export * from "./components/Expandable";
6
+ export * from "./components/Flourish";
6
7
  export * from "./components/Image";
7
8
  export * from "./components/Pill";
8
9
  export * from "./components/RootSVG";
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export { Author } from './components/Author/Author.js';
3
3
  export { Button } from './components/Button/Button.js';
4
4
  export { Card } from './components/Card/Card.js';
5
5
  export { Expandable } from './components/Expandable/Expandable.js';
6
+ export { Flourish } from './components/Flourish/Flourish.js';
6
7
  export { Image } from './components/Image/Image.js';
7
8
  export { Pill } from './components/Pill/Pill.js';
8
9
  export { RootSVG } from './components/RootSVG/RootSVG.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopdigital/react",
3
3
  "type": "module",
4
- "version": "0.30.2",
4
+ "version": "0.31.0",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -57,19 +57,19 @@
57
57
  "devDependencies": {
58
58
  "@axe-core/playwright": "^4.10.2",
59
59
  "@playwright/test": "^1.54.2",
60
- "@storybook/addon-a11y": "^9.1.1",
61
- "@storybook/addon-docs": "^9.1.1",
62
- "@storybook/addon-onboarding": "^9.1.1",
63
- "@storybook/react-vite": "^9.1.1",
64
- "@testing-library/jest-dom": "^6.6.4",
60
+ "@storybook/addon-a11y": "^9.1.2",
61
+ "@storybook/addon-docs": "^9.1.2",
62
+ "@storybook/addon-onboarding": "^9.1.2",
63
+ "@storybook/react-vite": "^9.1.2",
64
+ "@testing-library/jest-dom": "^6.7.0",
65
65
  "@testing-library/react": "^16.3.0",
66
- "@types/react": "^19.1.9",
66
+ "@types/react": "^19.1.10",
67
67
  "@types/react-dom": "^19.1.7",
68
68
  "clsx": "^2.1.1",
69
69
  "react": "^19.1.1",
70
70
  "react-dom": "^19.1.1",
71
71
  "serve": "^14.2.4",
72
- "storybook": "^9.1.1"
72
+ "storybook": "^9.1.2"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "clsx": "^2.1.1",
@@ -80,7 +80,7 @@
80
80
  "storybook": "$storybook"
81
81
  },
82
82
  "dependencies": {
83
- "@coopdigital/styles": "^0.26.1"
83
+ "@coopdigital/styles": "^0.27.0"
84
84
  },
85
- "gitHead": "0893d2c258c7fd02aa00a3340edcf1f1aec81a0a"
85
+ "gitHead": "fce3f35446116384dabdd8553404d9e933261264"
86
86
  }
@@ -0,0 +1,38 @@
1
+ import type { JSX, ReactNode, SVGProps } from "react"
2
+
3
+ import clsx from "clsx"
4
+
5
+ import { Darks, Lights } from "../../types/colors"
6
+
7
+ export interface FlourishProps extends SVGProps<SVGSVGElement> {
8
+ /** Specify the text to be highlighted by the Flourish. */
9
+ children: string | ReactNode
10
+ /** **(Optional)** Specify additional CSS classes to be applied to the component. */
11
+ className?: string
12
+ /** **(Optional)** Specify the Flourish color. */
13
+ fill?: Darks | Lights
14
+ }
15
+
16
+ export const Flourish = ({
17
+ children,
18
+ className,
19
+ fill = "light-yellow",
20
+ ...props
21
+ }: FlourishProps): JSX.Element => {
22
+ const componentProps = {
23
+ className: clsx("coop-flourish ", className),
24
+ fill: `var(--color-${fill})`,
25
+ ...props,
26
+ }
27
+
28
+ return (
29
+ <span style={{ position: "relative" }}>
30
+ {children}
31
+ <svg {...componentProps} height="10" viewBox="0 0 276 10" width="276">
32
+ <path d="M275.9 8.6c.1-1.6.2-1.8-.4-2.9.3-1-.3-1.2-1.8-1.1v-.3c.6-.4.2-.2 1.4-.1-.9-2.3-5.6-1.8-8.5-2.3C259 .5 246.3.7 237.4.5L185 .4l-33-.2-26.1-.2-67.4 1.2-44.3.5C10.7 2.1 1.5.4 0 3.3l1 .2L0 4v.5C8.2 7.9 26.6 7.2 35.6 7c5 0 13.5 1.6 16.5-.6C53.4 8 59.5 8 62 7.7l45 .1 42.8.3 30.7.3 44.2.6 27.8-.5 23 .8c.1-.8-.3-.5.5-.7ZM219 2.8v-.2l.8-.2h.4l.3.4H219Zm30-.1h1.2c-.8.4-.5.3-1.2 0Zm6.2.6.2-.4h.3l-.5.4Z" />
33
+ </svg>
34
+ </span>
35
+ )
36
+ }
37
+
38
+ export default Flourish
@@ -0,0 +1,5 @@
1
+ import Flourish from "./Flourish"
2
+
3
+ export default Flourish
4
+ export { Flourish }
5
+ export * from "./Flourish"
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ export * from "./components/Author"
3
3
  export * from "./components/Button"
4
4
  export * from "./components/Card"
5
5
  export * from "./components/Expandable"
6
+ export * from "./components/Flourish"
6
7
  export * from "./components/Image"
7
8
  export * from "./components/Pill"
8
9
  export * from "./components/RootSVG"