@coopdigital/react 1.26.0 → 1.26.1
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/dist/components/Author/Author.js +1 -1
- package/dist/components/Button/Button.d.ts +2 -1
- package/dist/components/Combobox/Combobox.d.ts +2 -1
- package/dist/components/Pill/Pill.js +1 -1
- package/dist/components/Section/Section.d.ts +3 -3
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TextInput/TextInput.js +1 -1
- package/dist/components/Wrapper/Wrapper.d.ts +3 -3
- package/package.json +2 -2
- package/src/components/Author/Author.tsx +1 -1
- package/src/components/Button/Button.tsx +2 -1
- package/src/components/Combobox/Combobox.tsx +2 -1
- package/src/components/Pill/Pill.tsx +1 -1
- package/src/components/Section/Section.tsx +3 -3
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/TextInput/TextInput.tsx +1 -1
- package/src/components/Wrapper/Wrapper.tsx +3 -3
|
@@ -12,7 +12,7 @@ const Author = ({ author = "Co-op team", className, date, datePrefix = "", image
|
|
|
12
12
|
};
|
|
13
13
|
const componentProps = {
|
|
14
14
|
className: clsx("coop-author", className),
|
|
15
|
-
"data-size": size
|
|
15
|
+
"data-size": size ?? void 0,
|
|
16
16
|
...props
|
|
17
17
|
};
|
|
18
18
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StandardSizes } from "../../types/index.js";
|
|
1
2
|
import React, { ButtonHTMLAttributes, ForwardRefExoticComponent, JSX, Ref } from "react";
|
|
2
3
|
//#region src/components/Button/Button.d.ts
|
|
3
4
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -25,7 +26,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
25
26
|
/** Specify a custom React ref for this component. */
|
|
26
27
|
ref?: Ref<HTMLElement>;
|
|
27
28
|
/** Specify the component size. */
|
|
28
|
-
size?:
|
|
29
|
+
size?: StandardSizes;
|
|
29
30
|
/** Specify the component variant. */
|
|
30
31
|
variant?: "solid" | "ghost" | "text";
|
|
31
32
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StandardSizes } from "../../types/index.js";
|
|
1
2
|
import { ComboboxItem, ComboboxOption } from "./combobox-utils.js";
|
|
2
3
|
import { TextInputProps } from "../TextInput/TextInput.js";
|
|
3
4
|
import "../TextInput/index.js";
|
|
@@ -75,7 +76,7 @@ export interface ComboboxProps extends Omit<HTMLAttributes<HTMLDivElement>, "onC
|
|
|
75
76
|
/** Specify a custom React ref for this component. */
|
|
76
77
|
ref?: Ref<HTMLDivElement>;
|
|
77
78
|
/** Specify the component size. */
|
|
78
|
-
size?:
|
|
79
|
+
size?: StandardSizes;
|
|
79
80
|
}
|
|
80
81
|
export interface ComboboxControlsProps extends HTMLAttributes<HTMLDivElement> {
|
|
81
82
|
/** Content inside the component.
|
|
@@ -13,7 +13,7 @@ const Pill = ({ as, children, className, href, ref, size, ...props }) => {
|
|
|
13
13
|
const slots = useSlots(componentSlots, children);
|
|
14
14
|
const componentProps = {
|
|
15
15
|
className: clsx("coop-pill", !hasUserBg(className) && "bg-tint-grey", className),
|
|
16
|
-
"data-size": size
|
|
16
|
+
"data-size": size ?? void 0,
|
|
17
17
|
href,
|
|
18
18
|
...props
|
|
19
19
|
};
|
|
@@ -6,11 +6,11 @@ export interface SectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
* Default: `<section>`
|
|
7
7
|
*/
|
|
8
8
|
as?: React.FC<any> | string;
|
|
9
|
-
/**
|
|
9
|
+
/** Content inside the component. */
|
|
10
10
|
children?: ReactNode;
|
|
11
|
-
/**
|
|
11
|
+
/** Specify additional CSS classes. */
|
|
12
12
|
className?: string;
|
|
13
|
-
/**
|
|
13
|
+
/** Specify a custom React ref for this component. */
|
|
14
14
|
ref?: Ref<HTMLDivElement>;
|
|
15
15
|
}
|
|
16
16
|
export declare const Section: ({ as, children, className, ref, ...props }: SectionProps) => JSX.Element;
|
|
@@ -6,7 +6,7 @@ const Tag = ({ as, children, className, href, ref, size, ...props }) => {
|
|
|
6
6
|
const element = as ?? (href ? "a" : "span");
|
|
7
7
|
const componentProps = {
|
|
8
8
|
className: clsx("coop-tag", !hasUserBg(className) && "bg-tint-grey", className),
|
|
9
|
-
"data-size": size
|
|
9
|
+
"data-size": size ?? void 0,
|
|
10
10
|
href,
|
|
11
11
|
...props
|
|
12
12
|
};
|
|
@@ -9,7 +9,7 @@ const TextInput = ({ className, disabled, error = false, fit = false, id, name,
|
|
|
9
9
|
className: clsx("coop-text-input", className),
|
|
10
10
|
"data-error": error || void 0,
|
|
11
11
|
"data-fit": fit || void 0,
|
|
12
|
-
"data-size": size
|
|
12
|
+
"data-size": size ?? void 0,
|
|
13
13
|
disabled,
|
|
14
14
|
id: id ?? field?.id,
|
|
15
15
|
name,
|
|
@@ -6,11 +6,11 @@ export interface WrapperProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
* Default: `<div>`
|
|
7
7
|
*/
|
|
8
8
|
as?: React.FC<any> | string;
|
|
9
|
-
/**
|
|
9
|
+
/** Content inside the component. */
|
|
10
10
|
children?: ReactNode;
|
|
11
|
-
/**
|
|
11
|
+
/** Specify additional CSS classes. */
|
|
12
12
|
className?: string;
|
|
13
|
-
/**
|
|
13
|
+
/** Specify a custom React ref for this component. */
|
|
14
14
|
ref?: Ref<HTMLDivElement>;
|
|
15
15
|
}
|
|
16
16
|
export declare const Wrapper: ({ as, children, className, ref, ...props }: WrapperProps) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopdigital/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.26.
|
|
4
|
+
"version": "1.26.1",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"merge-refs": "^2.0.0",
|
|
117
117
|
"react-day-picker": "^10.0.1"
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "d973a1436fe2245a6af205621b69762c3d7f7d09"
|
|
120
120
|
}
|
|
@@ -6,6 +6,7 @@ import clsx from "clsx"
|
|
|
6
6
|
import React, { useCallback, useState } from "react"
|
|
7
7
|
|
|
8
8
|
import { LoadingSpinner } from "@/components/LoadingSpinner"
|
|
9
|
+
import { StandardSizes } from "@/types"
|
|
9
10
|
import { hasUserBg } from "@/utils"
|
|
10
11
|
|
|
11
12
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -34,7 +35,7 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
34
35
|
/** Specify a custom React ref for this component. */
|
|
35
36
|
ref?: Ref<HTMLElement>
|
|
36
37
|
/** Specify the component size. */
|
|
37
|
-
size?:
|
|
38
|
+
size?: StandardSizes
|
|
38
39
|
/** Specify the component variant. */
|
|
39
40
|
variant?: "solid" | "ghost" | "text"
|
|
40
41
|
}
|
|
@@ -25,6 +25,7 @@ import { useField } from "@/components/Field/Field.context"
|
|
|
25
25
|
import { ChevronDownIcon } from "@/components/icons"
|
|
26
26
|
import { TextInput, TextInputProps } from "@/components/TextInput"
|
|
27
27
|
import { useSlots } from "@/hooks"
|
|
28
|
+
import { StandardSizes } from "@/types"
|
|
28
29
|
import { getSlotProp } from "@/utils"
|
|
29
30
|
|
|
30
31
|
export interface ComboboxProps extends Omit<
|
|
@@ -101,7 +102,7 @@ export interface ComboboxProps extends Omit<
|
|
|
101
102
|
/** Specify a custom React ref for this component. */
|
|
102
103
|
ref?: Ref<HTMLDivElement>
|
|
103
104
|
/** Specify the component size. */
|
|
104
|
-
size?:
|
|
105
|
+
size?: StandardSizes
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
export interface ComboboxControlsProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -47,7 +47,7 @@ const Pill = ({ as, children, className, href, ref, size, ...props }: PillProps)
|
|
|
47
47
|
|
|
48
48
|
const componentProps = {
|
|
49
49
|
className: clsx("coop-pill", !hasUserBg(className) && "bg-tint-grey", className),
|
|
50
|
-
"data-size": size
|
|
50
|
+
"data-size": size ?? undefined,
|
|
51
51
|
href,
|
|
52
52
|
...props,
|
|
53
53
|
}
|
|
@@ -10,11 +10,11 @@ export interface SectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
*/
|
|
11
11
|
// oxlint-disable-next-line typescript/no-explicit-any
|
|
12
12
|
as?: React.FC<any> | string
|
|
13
|
-
/**
|
|
13
|
+
/** Content inside the component. */
|
|
14
14
|
children?: ReactNode
|
|
15
|
-
/**
|
|
15
|
+
/** Specify additional CSS classes. */
|
|
16
16
|
className?: string
|
|
17
|
-
/**
|
|
17
|
+
/** Specify a custom React ref for this component. */
|
|
18
18
|
ref?: Ref<HTMLDivElement>
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -29,7 +29,7 @@ const Tag = ({ as, children, className, href, ref, size, ...props }: TagProps):
|
|
|
29
29
|
|
|
30
30
|
const componentProps = {
|
|
31
31
|
className: clsx("coop-tag", !hasUserBg(className) && "bg-tint-grey", className),
|
|
32
|
-
"data-size": size
|
|
32
|
+
"data-size": size ?? undefined,
|
|
33
33
|
href,
|
|
34
34
|
...props,
|
|
35
35
|
}
|
|
@@ -80,7 +80,7 @@ const TextInput = ({
|
|
|
80
80
|
className: clsx("coop-text-input", className),
|
|
81
81
|
"data-error": error || undefined,
|
|
82
82
|
"data-fit": fit || undefined,
|
|
83
|
-
"data-size": size
|
|
83
|
+
"data-size": size ?? undefined,
|
|
84
84
|
disabled,
|
|
85
85
|
id: id ?? field?.id,
|
|
86
86
|
name,
|
|
@@ -10,11 +10,11 @@ export interface WrapperProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
*/
|
|
11
11
|
// oxlint-disable-next-line typescript/no-explicit-any
|
|
12
12
|
as?: React.FC<any> | string
|
|
13
|
-
/**
|
|
13
|
+
/** Content inside the component. */
|
|
14
14
|
children?: ReactNode
|
|
15
|
-
/**
|
|
15
|
+
/** Specify additional CSS classes. */
|
|
16
16
|
className?: string
|
|
17
|
-
/**
|
|
17
|
+
/** Specify a custom React ref for this component. */
|
|
18
18
|
ref?: Ref<HTMLDivElement>
|
|
19
19
|
}
|
|
20
20
|
|