Skip to content

Commit

Permalink
Merge branch 'main' into exportTypes_DatePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
tay1orjones authored Jun 7, 2024
2 parents 1a73b34 + 16f0daf commit f91a31e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
uses: github/codeql-action/init@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
with:
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
uses: github/codeql-action/analyze@2e230e8fe0ad3a14a340ad0815ddb96d599d2aff # v3.25.8
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,35 @@
*/

import PropTypes from 'prop-types';
import React from 'react';
import React, { ReactNode } from 'react';
import cx from 'classnames';
import { usePrefix } from '../../internal/usePrefix';
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
import setupGetInstanceId from '../../tools/setupGetInstanceId';

const getInstanceId = setupGetInstanceId();

function CheckboxGroup({
export interface CheckboxGroupProps {
children?: ReactNode;
className?: string;
helperText?: ReactNode;
invalid?: boolean;
invalidText?: ReactNode;
legendId?: ReactNode;
orientation?: 'horizontal' | 'vertical';
legendText: ReactNode;
readOnly?: boolean;
slug?: ReactNode;
warn?: boolean;
warnText?: ReactNode;
}

export interface CustomType {
size: string;
kind: string;
}

const CheckboxGroup: React.FC<CheckboxGroupProps> = ({
children,
className,
helperText,
Expand All @@ -28,7 +48,7 @@ function CheckboxGroup({
slug,
orientation = 'vertical',
...rest
}) {
}) => {
const prefix = usePrefix();

const showWarning = !readOnly && !invalid && warn;
Expand Down Expand Up @@ -56,20 +76,21 @@ function CheckboxGroup({

// Slug is always size `mini`
let normalizedSlug;
if (slug && slug['type']?.displayName === 'Slug') {
if (
React.isValidElement(slug) &&
(slug['type'] as any)?.displayName === 'Slug'
) {
normalizedSlug = React.cloneElement(slug, {
size: 'mini',
kind: 'default',
});
} as CustomType);
}

return (
<fieldset
className={fieldsetClasses}
data-invalid={invalid ? true : undefined}
aria-labelledby={rest['aria-labelledby'] || legendId}
aria-readonly={readOnly}
orientation="vertical"
aria-describedby={!invalid && !warn && helper ? helperId : undefined}
{...rest}>
<legend
Expand Down Expand Up @@ -98,7 +119,7 @@ function CheckboxGroup({
{showHelper && helper}
</fieldset>
);
}
};

CheckboxGroup.propTypes = {
/**
Expand Down Expand Up @@ -141,7 +162,6 @@ CheckboxGroup.propTypes = {
* Provide the orientation for how the checkbox should be displayed
*/
orientation: PropTypes.oneOf(['horizontal', 'vertical']),

/**
* Whether the CheckboxGroup should be read-only
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/ComboBox/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,9 @@ const ComboBox = forwardRef(
type="text"
tabIndex={0}
aria-haspopup="listbox"
aria-owns={getMenuProps().id}
title={textInput?.current?.value}
{...getInputProps({
'aria-controls': isOpen ? undefined : getMenuProps().id,
placeholder,
ref: { ...mergeRefs(textInput, ref) },
onKeyDown: (
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12453,13 +12453,13 @@ __metadata:
linkType: hard

"ejs@npm:^3.1.7, ejs@npm:^3.1.8":
version: 3.1.9
resolution: "ejs@npm:3.1.9"
version: 3.1.10
resolution: "ejs@npm:3.1.10"
dependencies:
jake: "npm:^10.8.5"
bin:
ejs: bin/cli.js
checksum: 10/71f56d37540d2c2d71701f0116710c676f75314a3e997ef8b83515d5d4d2b111c5a72725377caeecb928671bacb84a0d38135f345904812e989847057d59f21a
checksum: 10/a9cb7d7cd13b7b1cd0be5c4788e44dd10d92f7285d2f65b942f33e127230c054f99a42db4d99f766d8dbc6c57e94799593ee66a14efd7c8dd70c4812bf6aa384
languageName: node
linkType: hard

Expand Down

0 comments on commit f91a31e

Please sign in to comment.