Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 19 #293

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
387 changes: 175 additions & 212 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@
"@malloydata/query-composer": "*",
"@malloydata/render": "0.0.232",
"@popperjs/core": "^2.11.4",
"@tanstack/react-query": "^5.66.0",
"cors": "^2.8.5",
"duckdb": "^0.9.2",
"express": "^4.21.2",
"mdast-comment-marker": "^2.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-hotkeys": "^2.0.0",
"react-query": "^3.34.16",
"react-router-dom": "^6.4.3",
"remark-parse": "^10.0.1",
"shiki": "^1.1.6",
"styled-components": "^5.3.3",
"styled-components": "^6.1.5",
"unified": "^10.1.2",
"url": "^0.11.0",
"web-vitals": "^2.1.0"
Expand All @@ -66,8 +66,8 @@
"@types/lodash": "^4.17.14",
"@types/node": "^18.11.11",
"@types/node-fetch": "^2.6.2",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"@types/styled-components": "^5.1.19",
"@types/tar-stream": "^2.2.2",
"@typescript-eslint/eslint-plugin": "v6.21.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/query-composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
"shiki": "^1.1.6"
},
"devDependencies": {
"@testing-library/react": "^16.0.1",
"@testing-library/react": "^16.2.0",
"@types/lodash": "^4.17.14",
"@types/moment": "^2.13.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"@vitejs/plugin-react": "^4.3.1",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand All @@ -53,8 +53,8 @@
"peerDependencies": {
"@malloydata/malloy": ">=0.0.232",
"@malloydata/render": ">=0.0.232",
"react": ">=18",
"react-dom": ">=18",
"styled-components": "^5.3.3"
"react": ">=19",
"react-dom": ">=19",
"styled-components": "^6.1.15"
}
}
24 changes: 12 additions & 12 deletions packages/query-composer/src/components/ActionIcon/ActionIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ export const ActionIcon: React.FC<ActionIconProps> = ({
return (
<IconWrapper
className={className}
color={color}
doHover={onClick !== undefined}
$color={color}
$doHover={onClick !== undefined}
title={title}
>
<Icon {...props} />
Expand All @@ -155,33 +155,33 @@ export const ActionIcon: React.FC<ActionIconProps> = ({
};

export const IconWrapper = styled.div<{
color: ColorKey | undefined;
doHover: boolean;
$color: ColorKey | undefined;
$doHover: boolean;
}>`
display: flex;
${({color, doHover}) => {
if (color === undefined) return '';
${({$color, $doHover}) => {
if ($color === undefined) return '';
return `
svg .hoverfill {
fill: transparent;
}
${
color !== undefined &&
$color !== undefined &&
`
svg .primaryfill {
fill: ${COLORS[color].fillStrong};
fill: ${COLORS[$color].fillStrong};
}
svg .primarystroke {
stroke: ${COLORS[color].fillStrong};
stroke: ${COLORS[$color].fillStrong};
}
`
}
${
color !== undefined &&
doHover &&
$color !== undefined &&
$doHover &&
`
svg:hover .hoverfill {
fill: var(--malloy-composer-form-focusBackground, ${COLORS[color].fillLight});
fill: var(--malloy-composer-form-focusBackground, ${COLORS[$color].fillLight});
}
`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const AddFilter: React.FC<AddFilterProps> = ({
<ContextMenuTitle style={{padding: '15px', paddingBottom: 0}}>
Filter
<FieldLabel>
<FieldIcon color="dimension">
<FieldIcon $color="dimension">
<TypeIcon type={type} kind={kind}></TypeIcon>
</FieldIcon>
<SmallFieldName>{field.name}</SmallFieldName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import * as React from 'react';
import {useContext, useEffect, useMemo, useState} from 'react';
import {ReactElement, useContext, useEffect, useMemo, useState} from 'react';
import {CodeInput, CodeTextArea} from '../CodeInput';
import {
Button,
Expand Down Expand Up @@ -273,7 +273,7 @@ export const AddNewMeasure: React.FC<AddMeasureProps> = ({
const flattened = useMemo(
() =>
sortFlatFields(flatFields(source)).reduce<
Array<{label: JSX.Element; value: FlatField}>
Array<{label: ReactElement; value: FlatField}>
>((acc, {path, field}) => {
const type = typeOfField(field);
const kind = kindOfField(field);
Expand Down
8 changes: 4 additions & 4 deletions packages/query-composer/src/components/CommonElements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,20 @@ export const SmallFieldName = styled(FieldName)`
`;

export const FieldIcon = styled.div<{
color: ColorKey;
$color: ColorKey;
}>`
flex-shrink: 0;
align-items: center;
justify-content: center;
display: flex;

${({color}) => {
${({$color}) => {
return `
svg .primaryfill {
fill: ${COLORS[color].fillStrong};
fill: ${COLORS[$color].fillStrong};
}
svg .primarystroke {
stroke: ${COLORS[color].fillStrong};
stroke: ${COLORS[$color].fillStrong};
}
`;
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const EditOrderBy: React.FC<EditOrderByProps> = ({
<ContextMenuTitle>
Order By
<FieldLabel>
<FieldIcon color="dimension">
<FieldIcon $color="dimension">
<TypeIcon
type={typeOfField(byField)}
kind={kindOfField(byField)}
Expand Down
44 changes: 22 additions & 22 deletions packages/query-composer/src/components/FieldButton/FieldButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export const FieldButton: React.FC<FieldButtonProps> = ({
return (
<FieldButtonRaw
onClick={onClick}
color={color}
active={active}
disableHover={disableHover}
$color={color}
$active={active}
$disableHover={disableHover}
onMouseDown={e => {
if (trapMouseDown) {
// Allows PillInputs to accept a search value
Expand All @@ -71,14 +71,14 @@ export const FieldButton: React.FC<FieldButtonProps> = ({
}}
>
<FrontPart>
<FieldIcon color={color}>{icon}</FieldIcon>
<FieldIcon $color={color}>{icon}</FieldIcon>
<FieldName>{name}</FieldName>
{unsaved ? <UnsavedIndicator color={color} /> : ''}
{unsaved ? <UnsavedIndicator $color={color} /> : ''}
</FrontPart>
{canRemove && (
<BackPart className="back" title="Remove">
<CloseIconStyled
color={color}
$color={color}
width="20px"
height="20px"
className="close"
Expand All @@ -99,7 +99,7 @@ export const FieldButton: React.FC<FieldButtonProps> = ({
};

export const UnsavedIndicator = styled.div<{
color: ColorKey;
$color: ColorKey;
}>`
width: 8px;
margin-top: 3px;
Expand All @@ -108,9 +108,9 @@ export const UnsavedIndicator = styled.div<{
min-height: 8px;
border-radius: 100px;

${({color}) => {
${({$color}) => {
return `
background-color: ${COLORS[color].fillStrong};
background-color: ${COLORS[$color].fillStrong};
`;
}}
`;
Expand Down Expand Up @@ -150,9 +150,9 @@ export const DetailPart = styled.div<{
`;

export const FieldButtonRaw = styled.div<{
color: ColorKey;
active: boolean;
disableHover: boolean;
$color: ColorKey;
$active: boolean;
$disableHover: boolean;
}>`
border: none;
background-color: transparent;
Expand All @@ -169,10 +169,10 @@ export const FieldButtonRaw = styled.div<{
align-items: center;
font-family: var(--malloy-composer-code-fontFamily, monospace);

${({active, color}) => {
if (active) {
${({$active, $color}) => {
if ($active) {
return `
background-color: ${COLORS[color].fillMedium};
background-color: ${COLORS[$color].fillMedium};
.back {
display: flex;
}
Expand All @@ -192,11 +192,11 @@ export const FieldButtonRaw = styled.div<{
display: none;
}

${({color, disableHover}) => {
if (!disableHover) {
${({$color, $disableHover}) => {
if (!$disableHover) {
return `
&:hover {
background-color: ${COLORS[color].fillMedium};
background-color: ${COLORS[$color].fillMedium};
}
`;
}
Expand All @@ -205,16 +205,16 @@ export const FieldButtonRaw = styled.div<{
`;

export const CloseIconStyled = styled(CloseIcon)<{
color: ColorKey;
$color: ColorKey;
}>`
cursor: pointer;
${({color}) => {
${({$color}) => {
return `
.cross {
fill: ${COLORS[color].fillStrong};
fill: ${COLORS[$color].fillStrong};
}
.circle {
fill: ${COLORS[color].fillMedium};
fill: ${COLORS[$color].fillMedium};
}
`;
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const PillInput: React.FC<PillInputProps> = ({
<OuterInput
onKeyUp={onKeyUp}
onClick={() => inp.current?.focus()}
isFocused={focused || selectedPill !== undefined}
$isFocused={focused || selectedPill !== undefined}
ref={ref}
>
{pills}
Expand Down Expand Up @@ -232,7 +232,7 @@ const PillInner = ({
};

const OuterInput = styled.div<{
isFocused: boolean;
$isFocused: boolean;
}>`
font-family: var(--malloy-composer-fontFamily, sans-serif);
font-size: var(--malloy-composer-fontSize, 14px);
Expand All @@ -247,7 +247,7 @@ const OuterInput = styled.div<{
gap: 3px;
flex-wrap: wrap;

${({isFocused}) => (isFocused ? `border-color: #4285F4;` : '')}
${({$isFocused}) => ($isFocused ? `border-color: #4285F4;` : '')}
`;

const Pill = styled(PillInner)<{
Expand Down
10 changes: 5 additions & 5 deletions packages/query-composer/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface PopoverProps {
width?: number | string;
maxHeight?: number;
placement?: Placement;
referenceDiv?: RefObject<HTMLDivElement>;
referenceDiv?: RefObject<HTMLDivElement | null>;
zIndex?: number;
xOffset?: number;
yOffset?: number;
Expand All @@ -42,17 +42,17 @@ interface PopoverProps {

export const PopoverBox = styled.div<{
width: number | string;
zIndex: number;
$zIndex: number;
}>`
border: 1px solid var(--malloy-composer-menu-border, #ececed);
border-radius: 4px;
position: fixed;
box-shadow: 0px 1px 5px 1px #0000001a;
background-color: var(--malloy-composer-menu-background, white);
font-size: var(--malloy-composer-menu-fontSize, 14px);
${({width, zIndex}) => `
${({width, $zIndex}) => `
width: ${typeof width === 'string' ? width : `${width}px`};
z-index: ${zIndex};
z-index: ${$zIndex};
`}
`;

Expand Down Expand Up @@ -115,7 +115,7 @@ export const Popover: React.FC<PopoverProps> = ({
ref={setTooltipRef}
style={{...styles.popper, position: 'fixed'}}
{...attributes.popper}
zIndex={zIndex}
$zIndex={zIndex}
>
{children}
</PopoverBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const QuerySummaryPanel: React.FC<QuerySummaryPanelProps> = ({
Stage {stageIndex + 1} - {stageSummary.type}
<BackPart className="back">
<CloseIconStyled
color="other"
$color="other"
width="20px"
height="20px"
className="close"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ export const SummaryItem: React.FC<SummaryItemProps> = ({
Stage {stageIndex + 1} - {stageSummary.type}
<BackPart className="back">
<CloseIconStyled
color="other"
$color="other"
width="20px"
height="20px"
className="close"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import * as React from 'react';
import {ReactElement} from 'react';
import styled from 'styled-components';
import {FieldDef} from '@malloydata/malloy';
import {QuerySummaryItem} from '../../types';
Expand All @@ -46,7 +47,7 @@ interface SearchListProps {
}

interface UseSearchListResult {
searchList: JSX.Element;
searchList: ReactElement;
count: number;
}

Expand Down
Loading
Loading