Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into jm/use-common-space-type
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmockett committed May 28, 2024
2 parents baa7406 + 546f021 commit ee350ef
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"//": "sub-package to match the `exports` field in the parent package.json",
"private": true,
"type": "module",
"main": "../dist/react-components.js"
"main": "../dist/react-components.js",
"//": "sub-package to match the `exports` field in the parent package.json"
}
6 changes: 6 additions & 0 deletions libs/@guardian/source/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @guardian/source

## 1.0.3

### Patch Changes

- 957cbac: call react hook useId before conditional

## 1.0.2

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions libs/@guardian/source/foundations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"//": "sub-package to match the `exports` field in the parent package.json",
"private": true,
"type": "module",
"main": "../dist/foundations.js"
"main": "../dist/foundations.js",
"//": "sub-package to match the `exports` field in the parent package.json"
}
2 changes: 1 addition & 1 deletion libs/@guardian/source/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@guardian/source",
"version": "1.0.2",
"version": "1.0.3",
"license": "Apache-2.0",
"sideEffects": false,
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions libs/@guardian/source/react-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"//": "sub-package to match the `exports` field in the parent package.json",
"private": true,
"type": "module",
"main": "../dist/react-components.js"
"main": "../dist/react-components.js",
"//": "sub-package to match the `exports` field in the parent package.json"
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export const Checkbox = ({
theme,
...props
}: CheckboxProps) => {
const checkboxId = id ?? useId();
const defaultId = useId();
const checkboxId = id ?? defaultId;
const isChecked = (): boolean => {
if (checked != null) {
return checked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ export const CheckboxGroup = ({
theme,
...props
}: CheckboxGroupProps) => {
const groupId = id ?? useId();
const defaultId = useId();
const groupId = id ?? defaultId;
const legend = label ? (
<Legend
text={label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export const ChoiceCardGroup = ({
theme,
...props
}: ChoiceCardGroupProps) => {
const groupId = id ?? useId();
const defaultId = useId();
const groupId = id ?? defaultId;
const showLabel = !!(label && !hideLabel);
const topMargin =
(showLabel || supporting) ?? error ? containerTopMargin : '';
Expand Down
3 changes: 2 additions & 1 deletion libs/@guardian/source/src/react-components/radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export const Radio = ({
theme,
...props
}: RadioProps) => {
const radioId = id ?? useId();
const defaultId = useId();
const radioId = id ?? defaultId;
const isChecked = (): boolean => {
if (checked != null) {
return checked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export const RadioGroup = ({
theme,
...props
}: RadioGroupProps) => {
const groupId = id ?? useId();
const defaultId = useId();
const groupId = id ?? defaultId;
const legend = label ? (
<Legend
text={label}
Expand Down
3 changes: 2 additions & 1 deletion libs/@guardian/source/src/react-components/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export const Select = ({
theme,
...props
}: SelectProps) => {
const selectId = id ?? useId();
const defaultId = useId();
const selectId = id ?? defaultId;
const mergedTheme = (providerTheme: Theme['select']) =>
mergeThemes<ThemeSelect, Theme['select']>(
defaultTheme,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export const TextArea = ({
theme,
...props
}: TextAreaProps) => {
const textAreaId = id ?? useId();
const defaultId = useId();
const textAreaId = id ?? defaultId;
const getClassName = () => {
const HAS_VALUE_CLASS = 'src-has-value';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export const TextInput = ({
cssOverrides,
...props
}: TextInputProps) => {
const textInputId = id ?? useId();
const defaultId = useId();
const textInputId = id ?? defaultId;
const mergedTheme = (providerTheme: Theme) =>
mergeThemes<ThemeTextInput, Theme['textInput']>(
themeTextInput,
Expand Down

0 comments on commit ee350ef

Please sign in to comment.