Skip to content

Commit

Permalink
Merge branch 'master' into fix-default-value-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Aug 27, 2024
2 parents f00aaaa + 25f67f9 commit a15fc02
Show file tree
Hide file tree
Showing 163 changed files with 5,435 additions and 417 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ jobs:
<<: *default-job
resource_class: 'medium+'
docker:
- image: mcr.microsoft.com/playwright:v1.45.3-focal
- image: mcr.microsoft.com/playwright:v1.46.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
Expand Down Expand Up @@ -350,7 +350,7 @@ jobs:
test_profile:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.45.3-focal
- image: mcr.microsoft.com/playwright:v1.46.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
Expand Down Expand Up @@ -378,7 +378,7 @@ jobs:
test_regressions:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.45.3-focal
- image: mcr.microsoft.com/playwright:v1.46.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
Expand All @@ -395,7 +395,7 @@ jobs:
test_e2e:
<<: *default-job
docker:
- image: mcr.microsoft.com/playwright:v1.45.3-focal
- image: mcr.microsoft.com/playwright:v1.46.1-focal
environment:
NODE_ENV: development # Needed if playwright is in `devDependencies`
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
contact_links:
- name: Support ❔
url: https://mui.com/getting-started/support/
url: https://mui.com/base-ui/getting-started/support/
about: I need support with Base UI.
6 changes: 3 additions & 3 deletions .github/workflows/support-stackoverflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
# Comment to post on issues marked as support requests. Add a link
# to a support page, or set to `false` to disable
issue-comment: |
👋 Thanks for using MUI Core!
👋 Thanks for using this project!
We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.
For support, please check out https://mui.com/getting-started/support/. Thanks!
For support with Base UI please check out https://mui.com/base-ui/getting-started/support/. Thanks!
If you have a question on Stack Overflow, you are welcome to link to it here, it might help others.
If you have a question on Stack Overflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.
close-issue: true
lock-issue: false
80 changes: 80 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,85 @@
# Versions

## v1.0.0-alpha.2

_Aug 19, 2024_

A big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:

⭐ We added many new components: AlertDialog, Dialog, Field, Menu, Popover, PreviewCard, Progress, Slider, and Tooltip.

### `@base_ui/react@1.0.0-alpha.2`

- [Checkbox] Fix checked change when clicking button with wrapping label (#467) @atomiks
- [Dialog] Create new component and hook (#372) @michaldudak
- [Field] Create new Field components (#477) @atomiks
- [Menu] Overhaul the component API (#468) @michaldudak
- [NumberField] Fix tests on non-English locale machines (#524) @michaldudak
- [NumberField] Rename `onChange` prop to `onValueChange` (#464) @atomiks
- [Popover] Component and Hook (#381) @atomiks
- [Popover] Fix `keepMounted` focus management (#489) @atomiks
- [Popover] Wait for focus to settle in tests (#491) @michaldudak
- [PreviewCard] Create new component (#469) @atomiks
- [PreviewCard] Fix Firefox browser hang (#490) @atomiks
- [Progress] New `Progress` components (#470) @mj12albert
- [Slider] improve `disabled` prop description (#527) @sai6855
- [Slider] New Slider components and hook (#373) @mj12albert
- [Switch/Checkbox] Rename `onChange` prop to `onCheckedChange` (#465) @atomiks
- [Tabs] Fix indicator tests (#379) @michaldudak
- [Tooltip] Component and Hook (#264) @atomiks
- [Tooltip] Fix animations (#426) @atomiks
- [useCompoundParent] Display `displayName` only in dev (#525) @sai6855

### Docs

- [docs] Add badges like in Material UI @oliviertassinari
- [docs] Add the logo to the README (#448) @danilo-leal
- [docs] Convert alpha component docs to new docs template (#392) @colmtuite
- [docs] Correct Bundlephobia links (#419) @michaldudak
- [docs] Fix page description line break @oliviertassinari
- [docs] Fix the X link (#450) @michaldudak
- [docs] Fix Vale errors (#492) @oliviertassinari
- [docs] Prepare security table for once it has its first release (#536) @oliviertassinari
- [docs] Update twitter.com to x.com @oliviertassinari
- [docs][Tooltip] Use the correct version of ComponentLinkHeader (#425) @michaldudak

### Core

- [code-infra] Fix pnpm version in package.json engines (#409) @Janpot
- [code-infra] Propagate API docs builder package interface changes (#478) @LukasTy
- [code-infra] Remove raw-loader (#404) @michaldudak
- [code-infra] Use shared .stylelintrc.js config (#415) @oliviertassinari
- [core] Add `trackAnchor` prop for anchor positioning (#519) @atomiks
- [core] Add `useAnchorPositioning` Hook (#461) @atomiks
- [core] Add `useTransitionStatus` and `useExecuteIfNotAnimated` Hooks (#396) @atomiks
- [core] Add codeowners file (#447) @michaldudak
- [core] Allow Renovate to update pnpm (#446) @michaldudak
- [core] Encapsulate the common rendering logic in `useComponentRenderer` (#408) @michaldudak
- [core] Fix event naming convention @oliviertassinari
- [core] Improve performance of `mergeReactProps` (#456) @marcpachecog
- [core] Improve Tooltip and Popover consistency (#463) @atomiks
- [core] Link GH issue for import/prefer-default-export @oliviertassinari
- [core] Make pnpm version permissive (#529) @atomiks
- [core] Move hooks under component directories (#405) @michaldudak
- [core] Move legacy components to a subdirectory (#410) @michaldudak
- [core] Normalize rest / other to match the most common used @oliviertassinari
- [core] Refactor animation hooks (#417) @atomiks
- [core] Remove sources of old components we don't intend to support (#474) @michaldudak
- [core] Simpler pnpm dedupe error message to act on @oliviertassinari
- [core] Upgrade to core-js v3 (#418) @atomiks
- [core] Verify types in test code (#457) @michaldudak
- [dependencies] Do not try to update eslint (#515) @michaldudak
- [docs-infra] Fix a stylelint issue (#421) @oliviertassinari
- [docs-infra] Integrate the latest @mui/docs (#378) @michaldudak
- [test] Clean up and unify test code (#532) @michaldudak
- [test] Update test-utils and remove enzyme (#473) @michaldudak
- [test] Use internal-test-utils from npm (#424) @michaldudak
- [typescript] Add `type` to export statements (#544) @michaldudak
- [website] Fix /base-ui/ code duplication (#416) @oliviertassinari- [infra] Add support donation button @oliviertassinari
- [website] Redirect to an existing page on dev (#445) @michaldudak

All contributors of this release in alphabetical order: @atomiks, @colmtuite, @danilo-leal, @Janpot, @LukasTy, @marcpachecog, @michaldudak, @mj12albert, @oliviertassinari, @sai6855

## v1.0.0-alpha.1

<!-- generated comparing v1.0.0-alpha.0..master -->
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to Base UI

## Base UI vs. Material UI
## Base UI vs. MUI organization

Base UI is an open-source project of the MUI organization. The repositories are part of the same codebase.
`mui/base-ui` imports the code infrastructure from [`mui/material-ui`](https://github.com/mui/material-ui).
Expand Down
6 changes: 0 additions & 6 deletions docs/.link-check-errors.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
Broken links found by `pnpm docs:link-check` that exist:

- https://mui.com/material-ui/customization/css-theme-variables/configuration/#advanced-configuration
- https://mui.com/material-ui/customization/css-theme-variables/configuration/#changing-variable-prefixes
- https://mui.com/material-ui/customization/theme-components/#creating-new-component-variants
- https://mui.com/material-ui/customization/theme-components/#overrides-based-on-props
- https://mui.com/material-ui/migrating-to-v6/
- https://mui.com/material-ui/react-grid2/#whats-changed
149 changes: 149 additions & 0 deletions docs/data/base/components/field/UnstyledFieldAsync.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
import * as React from 'react';
import * as Field from '@base_ui/react/Field';
import { styled } from '@mui/system';

const cache = new Map();

function checkAvailability(name) {
const takenNames = ['admin', 'root', 'superuser'];
return new Promise((resolve) => {
setTimeout(() => {
const result = takenNames.includes(name) ? 'Name taken' : null;
cache.set(name, result);
resolve(result);
}, 500);
});
}

export default function UnstyledFieldAsync() {
const [loading, setLoading] = React.useState(false);

async function handleValidate(value) {
const name = value;

if (name === '') {
return null;
}

const isCached = cache.has(name);
if (isCached) {
return cache.get(name);
}

setLoading(true);

try {
const error = await checkAvailability(name);
setLoading(false);
return error;
} catch (e) {
setLoading(false);
return 'Failed to fetch name availability';
}
}

return (
<div>
<h3>Handle availability checker</h3>
<FieldRoot
validate={handleValidate}
validateOnChange
validateDebounceTime={500}
>
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<Field.Label>@</Field.Label>
<Field.Validity>
{(state) => (
<FieldControl
data-pending={state.value === '' || loading || undefined}
/>
)}
</Field.Validity>
</div>
<Field.Validity>
{(state) => {
if (loading) {
return <FieldDescription>Checking availability...</FieldDescription>;
}

if (state.value === '') {
return <FieldDescription>Enter a name</FieldDescription>;
}

if (!state.validity.customError) {
return (
<FieldDescription
data-type="success"
role="alert"
aria-live="polite"
>
<strong>@{state.value}</strong> is available
</FieldDescription>
);
}

return <FieldError show="customError" />;
}}
</Field.Validity>
</FieldRoot>
</div>
);
}

const FieldRoot = styled(Field.Root)`
width: 275px;
`;

const FieldControl = styled(Field.Control)`
border: 1px solid #ccc;
border-radius: 4px;
width: 100%;
padding: 6px;
font-size: 100%;
&[data-field='invalid']:not([data-pending]) {
border-color: red;
background-color: rgb(255 0 0 / 0.1);
}
&[data-field='valid']:not([data-pending]) {
border-color: green;
background-color: rgb(0 255 0 / 0.1);
}
&:focus {
outline: 0;
border-color: #0078d4;
box-shadow: 0 0 0 3px rgba(0 100 255 / 0.3);
&[data-field='invalid']:not([data-pending]) {
border-color: red;
box-shadow: 0 0 0 3px rgba(255 0 0 / 0.3);
}
&[data-field='valid']:not([data-pending]) {
box-shadow: 0 0 0 3px rgba(100 200 100 / 0.3);
}
}
`;

const FieldDescription = styled(Field.Description)`
font-size: 90%;
margin: 0;
margin-top: 4px;
line-height: 1.1;
color: grey;
&[data-type='success'] {
color: green;
}
`;

const FieldError = styled(Field.Error)`
display: block;
font-size: 90%;
margin: 0;
margin-top: 4px;
line-height: 1.1;
color: red;
`;
Loading

0 comments on commit a15fc02

Please sign in to comment.