Skip to content

Commit

Permalink
fix(various): update various files based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronDWall committed Jan 13, 2025
1 parent 94e53b0 commit 479b49c
Show file tree
Hide file tree
Showing 105 changed files with 116 additions and 298 deletions.
1 change: 0 additions & 1 deletion design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@commercetools-uikit/hooks": "19.20.1",
"@emotion/react": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react": "19.0.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions design-system/src/theme-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ const ThemeProvider = ({
...props
}: ThemeProviderProps) => {
const parentSelectorRef = useRef(parentSelector);
const themeNameRef = useRef<string>(null);
const themeOverridesRef = useRef<Record<string, string>>(null);
const themeNameRef = useRef<string>(undefined);
const themeOverridesRef = useRef<Record<string, string>>(undefined);

useLayoutEffect(() => {
// We want to make sure we don't really apply the change when the props
Expand All @@ -88,7 +88,7 @@ const ThemeProvider = ({
!isEqual(themeOverridesRef.current, props.themeOverrides)
) {
themeNameRef.current = theme;
themeOverridesRef.current = props.themeOverrides ?? null;
themeOverridesRef.current = props.themeOverrides;

applyTheme({
newTheme: theme,
Expand Down
1 change: 0 additions & 1 deletion packages/calendar-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-select": "5.9.0"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/components/accessible-hidden/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"dependencies": {
"@babel/runtime": "^7.20.13",
"@babel/runtime-corejs3": "^7.20.13",
"@emotion/react": "^11.10.5",
"prop-types": "15.8.1"
"@emotion/react": "^11.10.5"
},
"devDependencies": {
"react": "19.0.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/components/avatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1"
"lodash": "4.17.21"
},
"devDependencies": {
"react": "19.0.0"
Expand Down
1 change: 0 additions & 1 deletion packages/components/buttons/accessible-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"@emotion/styled": "^11.10.5",
"@types/react-is": "^19.0.0",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-is": "19.0.0"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/components/buttons/flat-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/components/buttons/icon-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/components/buttons/link-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1"
"lodash": "4.17.21"
},
"devDependencies": {
"react": "19.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/components/buttons/primary-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/components/buttons/secondary-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1"
"lodash": "4.17.21"
},
"devDependencies": {
"react": "19.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/components/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@types/react-router-dom": "^5.3.3",
"prop-types": "15.8.1"
"@types/react-router-dom": "^5.3.3"
},
"devDependencies": {
"react": "19.0.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/components/collapsible-motion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1"
"lodash": "4.17.21"
},
"devDependencies": {
"react": "19.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const useToggleAnimation = (
minHeight = 0
) => {
const nodeRef = useRef<TNodeRefObject>(null);
const animationRef = useRef<ReturnType<typeof keyframes> | null>(null);
const animationRef = useRef<ReturnType<typeof keyframes>>(null);
const prevIsOpen = usePrevious(isOpen);

useEffect(
Expand Down
1 change: 0 additions & 1 deletion packages/components/collapsible-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
18 changes: 7 additions & 11 deletions packages/components/collapsible-panel/src/collapsible-panel.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode, cloneElement } from 'react';
import { ReactNode, ReactElement, cloneElement, isValidElement } from 'react';
import isNil from 'lodash/isNil';
import styled from '@emotion/styled';
import {
Expand Down Expand Up @@ -41,7 +41,7 @@ export type TCollapsiblePanel = {
/**
* The title being rendered at top left of the panel
*/
header: ReactNode;
header: ReactElement<{ isCondensed?: boolean }> | ReactNode;
/**
* A secondary header for the panel (only pass if needed)
*/
Expand Down Expand Up @@ -139,15 +139,11 @@ const HeadLineText = (

return (
<Text.Subheadline as="h4" truncate>
{/* TODO: this is a temporary fix, which will be refactored after we align with the desing team on how to proceed */}
{typeof props.header === 'string'
? props.header
: cloneElement(
props.header as React.ReactElement<{ isCondensed?: boolean }>,
{
isCondensed: props.condensed,
}
)}
{isValidElement<{ isCondensed?: boolean }>(props.header)
? cloneElement(props.header, {
isCondensed: props.condensed,
})
: props.header}
</Text.Subheadline>
);
};
Expand Down
3 changes: 1 addition & 2 deletions packages/components/collapsible/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1"
"lodash": "4.17.21"
},
"devDependencies": {
"react": "19.0.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/components/constraints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"@commercetools-uikit/design-system": "19.20.1",
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1"
"@emotion/styled": "^11.10.5"
},
"devDependencies": {
"react": "19.0.0"
Expand Down
1 change: 0 additions & 1 deletion packages/components/data-table-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
"@types/react-beautiful-dnd": "^13.1.3",
"debounce-promise": "^3.1.2",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-beautiful-dnd": "13.1.1"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ const DataTableManager = <Row extends TRow = TRow>(
selectedColumns={selectedColumns ?? []}
customColumnManager={customColumnManager ?? undefined}
/>
{(props.children as TDataTableManagerProps<Row>['children']) &&
isValidElement(props.children)
{props.children && isValidElement(props.children)
? cloneElement(props.children, {
columns,
customColumns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ it('should render the column tag when rendering a column', () => {
<DragDropContext>
<Droppable
droppableId="droppableId"
isDropDisabled={false}
isCombineEnabled={false}
ignoreContainerClipping={false}
// isDropDisabled={false}
// isCombineEnabled={false}
// ignoreContainerClipping={false}
>
{(provided) => (
<div ref={provided.innerRef}>
Expand Down
1 change: 0 additions & 1 deletion packages/components/data-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"lodash": "4.17.21",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/data-table/src/header-cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export type THeaderCell = {
onColumnResized?: (args: TColumn[]) => void;
disableHeaderStickiness: boolean;
horizontalCellAlignment: 'left' | 'center' | 'right';
iconComponent?: ReactNode | Function;
iconComponent?: ReactNode | (() => ReactNode);
};

const HeaderCell = ({
Expand Down
1 change: 0 additions & 1 deletion packages/components/dropdowns/dropdown-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function DropdownMenu({
...props
}: TDropdownMenuProps) {
const [isOpen, toggle] = useToggleState(false);
const triggerRef = useRef<HTMLDivElement>(null as unknown as HTMLDivElement);
const triggerRef = useRef<HTMLDivElement>(null);

// We use the context so children can toggle the dropdown
const context = useMemo(
Expand All @@ -119,7 +119,7 @@ function DropdownMenu({

// Close the dropdown when clicking outside of it
const handleGlobalClick: EventListener = useCallback(
(event: Event) => {
(event) => {
const triggerElement = triggerRef.current;
if (
isOpen &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type TDropdownBaseMenuProps = {
isOpen: boolean;
menuPosition: 'left' | 'right';
menuMaxHeight?: number;
triggerElementRef: RefObject<HTMLElement>;
triggerElementRef: RefObject<HTMLElement | null>;
};
function DropdownBaseMenu(props: TDropdownBaseMenuProps) {
const menuRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -198,7 +198,7 @@ export type TDropdownContentMenuProps = {
menuPosition: 'left' | 'right';
menuMaxHeight?: number;
isOpen: boolean;
triggerElementRef: RefObject<HTMLElement>;
triggerElementRef: RefObject<HTMLElement | null>;
};
export const DropdownContentMenu = (props: TDropdownContentMenuProps) => {
return (
Expand All @@ -224,7 +224,7 @@ export type TDropdownListMenuProps = {
menuPosition: 'left' | 'right';
menuMaxHeight?: number;
isOpen: boolean;
triggerElementRef: RefObject<HTMLElement>;
triggerElementRef: RefObject<HTMLElement | null>;
};
export const DropdownListMenu = (props: TDropdownListMenuProps) => {
return (
Expand Down
3 changes: 1 addition & 2 deletions packages/components/field-errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"@babel/runtime-corejs3": "^7.20.13",
"@commercetools-uikit/messages": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1"
"@emotion/styled": "^11.10.5"
},
"devDependencies": {
"react": "19.0.0",
Expand Down
1 change: 0 additions & 1 deletion packages/components/field-label/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/components/field-warnings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"@babel/runtime-corejs3": "^7.20.13",
"@commercetools-uikit/messages": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1"
"@emotion/styled": "^11.10.5"
},
"devDependencies": {
"react": "19.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/components/fields/async-select-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/components/fields/date-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/components/fields/date-range-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/components/fields/date-time-field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"@commercetools-uikit/utils": "19.20.1",
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"prop-types": "15.8.1",
"react-intl": "6.3.2"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 479b49c

Please sign in to comment.