Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 committed May 30, 2023
2 parents 13a033f + 957215c commit 62a1eef
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
6 changes: 6 additions & 0 deletions packages/itwinui-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.11.3

### Patch Changes

- [#1309](https://github.com/iTwin/iTwinUI/pull/1309): Fixed missing CSS imports in `FileUploadCard` and `FileUpoadTemplate`.

## 2.11.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/itwinui-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itwin/itwinui-react",
"version": "2.11.2",
"version": "2.11.3",
"author": "Bentley Systems",
"license": "MIT",
"main": "cjs/index.js",
Expand Down
20 changes: 8 additions & 12 deletions packages/itwinui-react/src/core/FileUpload/FileUploadCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import {
mergeEventHandlers,
polymorphic,
Box,
VisuallyHidden,
} from '../utils/index.js';
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
import cx from 'classnames';
import { FileEmptyCard } from './FileEmptyCard.js';
import { Anchor } from '../Typography/Anchor/Anchor.js';
import '@itwin/itwinui-css/css/file-upload.css';

const toBytes = (bytes: number) => {
const units = [' bytes', 'KB', 'MB', 'GB', 'TB'];
Expand Down Expand Up @@ -107,18 +110,12 @@ FileUploadCardAction.displayName = 'FileUploadCard.Action';
// FileUploadCard.InputLabel component

const FileUploadCardInputLabel = React.forwardRef((props, ref) => {
const { children, className, ...rest } = props;
const { children, ...rest } = props;
const { inputId } = useSafeContext(FileUploadCardContext);
return (
<Box
as='label'
className={cx('iui-anchor', className)}
ref={ref}
htmlFor={inputId}
{...rest}
>
<Anchor as='label' ref={ref} htmlFor={inputId} {...rest}>
{children}
</Box>
</Anchor>
);
}) as PolymorphicForwardRefComponent<'label'>;
FileUploadCardInputLabel.displayName = 'FileUploadCard.InputLabel';
Expand All @@ -127,7 +124,7 @@ FileUploadCardInputLabel.displayName = 'FileUploadCard.InputLabel';
// FileUploadCard.Input component

const FileUploadCardInput = React.forwardRef((props, ref) => {
const { children, className, onChange, id, ...rest } = props;
const { children, onChange, id, ...rest } = props;
const { files, onFilesChange, setInternalFiles, inputId, setInputId } =
useSafeContext(FileUploadCardContext);

Expand Down Expand Up @@ -155,9 +152,8 @@ const FileUploadCardInput = React.forwardRef((props, ref) => {

return (
<>
<Box
<VisuallyHidden
as='input'
className={cx('iui-visually-hidden', className)}
type='file'
onChange={mergeEventHandlers(onChange, (e) => {
const _files = Array.from(e.currentTarget.files || []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import cx from 'classnames';
import { SvgUpload, Box } from '../utils/index.js';
import type { PolymorphicForwardRefComponent } from '../utils/index.js';
import '@itwin/itwinui-css/css/file-upload.css';
import { Anchor } from '../Typography/Anchor/Anchor.js';

type FileUploadTemplateProps = {
/**
Expand Down Expand Up @@ -66,7 +67,7 @@ export const FileUploadTemplate = React.forwardRef((props, ref) => {
>
<SvgUpload className='iui-template-icon' aria-hidden />
<Box className='iui-template-text'>
<Box as='label' className='iui-anchor'>
<Anchor as='label'>
<Box
as='input'
className='iui-browse-input'
Expand All @@ -76,7 +77,7 @@ export const FileUploadTemplate = React.forwardRef((props, ref) => {
accept={acceptType}
/>
{label}
</Box>
</Anchor>
<div>{subtitle}</div>
{children}
</Box>
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@astrojs/react": "^2.0.2",
"@itwin/itwinui-react": "2.11.2",
"@itwin/itwinui-react": "2.11.3",
"astro": "^2.0.13",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"clean": "rimraf .turbo && rimraf node_modules && rimraf .next"
},
"dependencies": {
"@itwin/itwinui-react": "2.11.2",
"@itwin/itwinui-react": "2.11.3",
"@types/node": "^18.11.9",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
Expand Down
2 changes: 1 addition & 1 deletion playgrounds/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"clean": "rimraf .turbo && rimraf node_modules && rimraf dist"
},
"dependencies": {
"@itwin/itwinui-react": "2.11.2",
"@itwin/itwinui-react": "2.11.3",
"@itwin/itwinui-icons-react": "2",
"react": "^18.0.0",
"react-dom": "^18.0.0"
Expand Down

0 comments on commit 62a1eef

Please sign in to comment.