Skip to content

Commit

Permalink
Merge branch 'master' into pass-timezone-when-formatting-time
Browse files Browse the repository at this point in the history
  • Loading branch information
NyxinU authored Nov 23, 2024
2 parents 77576d6 + b78faa0 commit 2597dc2
Show file tree
Hide file tree
Showing 265 changed files with 10,668 additions and 8,315 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ apps/mantine.dev/.cache
apps/mantine.dev/out
apps/mantine.dev/.next
apps/mantine.dev/src/.docgen/
.samples
Empty file added .npmignore
Empty file.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22.1.0
v22.11.0
15 changes: 10 additions & 5 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ const storiesPath = !argv._[1]

export default {
stories: storiesPath,
core: {
disableWhatsNewNotifications: true,
disableTelemetry: true,
enableCrashReports: false,
},

addons: [
getAbsolutePath('storybook-dark-mode'),
Expand All @@ -42,7 +47,11 @@ export default {
{
test: /\.css$/,
sideEffects: true,
use: ['style-loader', 'css-loader', 'postcss-loader'],
use: [
'style-loader',
{ loader: 'css-loader', options: { modules: { namedExport: false } } },
'postcss-loader',
],
},
],
},
Expand Down Expand Up @@ -90,10 +99,6 @@ export default {
autodocs: false,
},

core: {
disableTelemetry: true,
},

typescript: {
reactDocgen: false,
},
Expand Down
4 changes: 3 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import { Notifications } from '@mantine/notifications';
import { ShikiProvider } from '@mantinex/shiki';
import { theme } from '../apps/mantine.dev/theme';

export const parameters = { layout: 'fullscreen' };
export const parameters = {
layout: 'fullscreen',
};

const channel = addons.getChannel();

Expand Down
725 changes: 367 additions & 358 deletions .yarn/releases/yarn-4.5.0.cjs → .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.0.cjs
yarnPath: .yarn/releases/yarn-4.5.1.cjs
12 changes: 6 additions & 6 deletions apps/help.mantine.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
"@mdx-js/react": "^3.0.0",
"@next/mdx": "^14.0.2",
"@tabler/icons-react": "^3.3.0",
"dayjs": "^1.11.10",
"dayjs": "^1.11.13",
"fuse.js": "7.0.0",
"next": "14.2.12",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-imask": "^7.1.3",
"react-imask": "^7.6.1",
"remark-slug": "^7.0.1",
"shiki": "^1.1.7"
"shiki": "^1.23.1"
},
"devDependencies": {
"@mdx-js/loader": "^3.0.0",
"@types/mdx": "2.0.10",
"@types/node": "^20.9.0",
"@types/react": "18.3.1",
"@types/react-dom": "18.2.15",
"typescript": "5.3.3"
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"typescript": "5.6.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const h = (order: 1 | 2 | 3 | 4 | 5 | 6) => (props: any) => (
);

function getLanguage(children: any) {
// @ts-ignore
const matches = (children.props.className || '').match(/language-(?<lang>.*)/);
return matches && matches.groups && matches.groups.lang ? matches.groups.lang : 'tsx';
}
Expand Down
108 changes: 108 additions & 0 deletions apps/help.mantine.dev/src/demos/NestedPopovers.demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import { Button, Popover, Select } from '@mantine/core';
import { MantineDemo } from '@mantinex/demo';

const codeWithIssue = `
import { Button, Popover, Select } from '@mantine/core';
import { InputBase } from '@mantine/core';
function Demo() {
return (
<Popover width={200} position="bottom" withArrow shadow="md">
<Popover.Target>
<Button>Toggle popover</Button>
</Popover.Target>
<Popover.Dropdown>
<Select
placeholder="Choose your framework"
data={[
{ value: 'react', label: 'React' },
{ value: 'vue', label: 'Vue' },
{ value: 'angular', label: 'Angular' },
]}
/>
</Popover.Dropdown>
</Popover>
);
}
`;

function DemoWithIssue() {
return (
<Popover width={200} position="bottom" withArrow shadow="md">
<Popover.Target>
<Button>Toggle popover</Button>
</Popover.Target>
<Popover.Dropdown>
<Select
data={[
{ value: 'react', label: 'React' },
{ value: 'vue', label: 'Vue' },
{ value: 'angular', label: 'Angular' },
]}
placeholder="Choose your framework"
/>
</Popover.Dropdown>
</Popover>
);
}

export const NestedPopovers: MantineDemo = {
type: 'code',
component: DemoWithIssue,
code: codeWithIssue,
centered: true,
};

const codeWithoutIssue = `
import { Button, Popover, Select } from '@mantine/core';
import { InputBase } from '@mantine/core';
function Demo() {
return (
<Popover width={200} position="bottom" withArrow shadow="md">
<Popover.Target>
<Button>Toggle popover</Button>
</Popover.Target>
<Popover.Dropdown>
<Select
comboboxProps={{ withinPortal: false }}
placeholder="Choose your framework"
data={[
{ value: 'react', label: 'React' },
{ value: 'vue', label: 'Vue' },
{ value: 'angular', label: 'Angular' },
]}
/>
</Popover.Dropdown>
</Popover>
);
}
`;

function DemoWithoutIssue() {
return (
<Popover width={200} position="bottom" withArrow shadow="md">
<Popover.Target>
<Button>Toggle popover</Button>
</Popover.Target>
<Popover.Dropdown>
<Select
comboboxProps={{ withinPortal: false }}
data={[
{ value: 'react', label: 'React' },
{ value: 'vue', label: 'Vue' },
{ value: 'angular', label: 'Angular' },
]}
placeholder="Choose your framework"
/>
</Popover.Dropdown>
</Popover>
);
}

export const NestedPopoversWorking: MantineDemo = {
type: 'code',
component: DemoWithoutIssue,
code: codeWithoutIssue,
centered: true,
};
14 changes: 14 additions & 0 deletions apps/help.mantine.dev/src/mdx.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { meta as alignInputButton } from './pages/q/align-input-button.mdx';
import { meta as areMantineComponentsAccessible } from './pages/q/are-mantine-components-accessible.mdx';
import { meta as autocompleteValueLabel } from './pages/q/autocomplete-value-label.mdx';
import { meta as bodyBackground } from './pages/q/body-background.mdx';
import { meta as browserZoomsOnFocus } from './pages/q/browser-zooms-on-focus.mdx';
import { meta as canIUseMantineWithAstro } from './pages/q/can-i-use-mantine-with-astro.mdx';
import { meta as canIUseMantineWithCra } from './pages/q/can-i-use-mantine-with-cra.mdx';
import { meta as carouselMissingStyles } from './pages/q/carousel-missing-styles.mdx';
import { meta as colorSchemeColor } from './pages/q/color-scheme-color.mdx';
import { meta as comboboxTesting } from './pages/q/combobox-testing.mdx';
import { meta as customInputUseForm } from './pages/q/custom-input-use-form.mdx';
Expand Down Expand Up @@ -31,12 +33,16 @@ import { meta as lightDarkIsNotEnough } from './pages/q/light-dark-is-not-enough
import { meta as listOfStringsInUseForm } from './pages/q/list-of-strings-in-use-form.mdx';
import { meta as mantineProviderMissing } from './pages/q/mantine-provider-missing.mdx';
import { meta as multiselectValuePlaceholder } from './pages/q/multiselect-value-placeholder.mdx';
import { meta as nestedInlineStyles } from './pages/q/nested-inline-styles.mdx';
import { meta as nestedPopoverCloses } from './pages/q/nested-popover-closes.mdx';
import { meta as nextLoadFonts } from './pages/q/next-load-fonts.mdx';
import { meta as notificationsEmptyScreen } from './pages/q/notifications-empty-screen.mdx';
import { meta as notificationsMissingStyles } from './pages/q/notifications-missing-styles.mdx';
import { meta as otherLibs } from './pages/q/other-libs.mdx';
import { meta as pinchToZoomModal } from './pages/q/pinch-to-zoom-modal.mdx';
import { meta as polymorphicInPolymorphic } from './pages/q/polymorphic-in-polymorphic.mdx';
import { meta as postcssFnsInline } from './pages/q/postcss-fns-inline.mdx';
import { meta as primaryVirtualColor } from './pages/q/primary-virtual-color.mdx';
import { meta as privateCssVariables } from './pages/q/private-css-variables.mdx';
import { meta as remixLoadFonts } from './pages/q/remix-load-fonts.mdx';
import { meta as roadmap } from './pages/q/roadmap.mdx';
Expand All @@ -47,6 +53,7 @@ import { meta as serverComponents } from './pages/q/server-components.mdx';
import { meta as stylesOrder } from './pages/q/styles-order.mdx';
import { meta as tabsBorderColor } from './pages/q/tabs-border-color.mdx';
import { meta as thirdPartyStyles } from './pages/q/third-party-styles.mdx';
import { meta as transparentButtons } from './pages/q/transparent-buttons.mdx';
import { meta as viteLoadFonts } from './pages/q/vite-load-fonts.mdx';
import { meta as vueSvelteAngular } from './pages/q/vue-svelte-angular.mdx';
import { meta as whyVscodeCannotAutoimportText } from './pages/q/why-vscode-cannot-autoimport-text.mdx';
Expand All @@ -55,9 +62,11 @@ export const MDX_DATA = [
alignInputButton,
areMantineComponentsAccessible,
autocompleteValueLabel,
bodyBackground,
browserZoomsOnFocus,
canIUseMantineWithAstro,
canIUseMantineWithCra,
carouselMissingStyles,
colorSchemeColor,
comboboxTesting,
customInputUseForm,
Expand Down Expand Up @@ -85,12 +94,16 @@ export const MDX_DATA = [
listOfStringsInUseForm,
mantineProviderMissing,
multiselectValuePlaceholder,
nestedInlineStyles,
nestedPopoverCloses,
nextLoadFonts,
notificationsEmptyScreen,
notificationsMissingStyles,
otherLibs,
pinchToZoomModal,
polymorphicInPolymorphic,
postcssFnsInline,
primaryVirtualColor,
privateCssVariables,
remixLoadFonts,
roadmap,
Expand All @@ -101,6 +114,7 @@ export const MDX_DATA = [
stylesOrder,
tabsBorderColor,
thirdPartyStyles,
transparentButtons,
viteLoadFonts,
vueSvelteAngular,
whyVscodeCannotAutoimportText,
Expand Down
42 changes: 42 additions & 0 deletions apps/help.mantine.dev/src/pages/q/body-background.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Layout } from '@/layout';

export const meta = {
title: 'How can I change body background color?',
description: 'Use CSS to change body background color',
slug: 'body-background',
category: 'styles',
tags: ['body', 'html', 'global styles'],
created_at: 'September 8, 2024',
last_updated_at: 'September 8, 2024',
};

export default Layout(meta);

## Change body background with CSS

To change `body` background color you can use CSS. To do that, create `styles.css`
file in your project and import it at the root of your application:

```css
body {
background-color: #f9f9f9;
}
```

## Change body background with CSS variable

`--mantine-color-body` CSS variable is used for body background and
as background color of some components ([Modal](https://mantine.dev/core/modal/), [Paper](https://mantine.dev/core/paper/), etc.).
To override this variable, create `styles.css` file in your project and import it at the root of your application:

```scss
:root {
@mixin light {
--mantine-color-body: #f9f9f9;
}

@mixin dark {
--mantine-color-body: #333;
}
}
```
30 changes: 30 additions & 0 deletions apps/help.mantine.dev/src/pages/q/carousel-missing-styles.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Layout } from '@/layout';

export const meta = {
title: 'Why my Carousel slides are in vertical orientation?',
description: 'You forgot to import carousel styles',
slug: 'carousel-missing-styles',
category: 'styles',
tags: ['carousel', '@mantine/carousel', 'broken'],
created_at: 'September 7, 2024',
last_updated_at: 'September 7, 2024',
};

export default Layout(meta);

## Carousel component looks broken

If your [Carousel](https://mantine.dev/x/carousel/) component renders slides in vertical orientation
or has incorrect controls/indicators position, you forgot to import carousel styles.
Follow [@mantine/carousel](https://mantine.dev/x/carousel/#installation) installation
instructions to fix the issue. Import `@mantine/core` and `@mantine/carousel` styles at
the root of your application:

```tsx
import '@mantine/core/styles.css';
import '@mantine/carousel/styles.css';
```

## That's it! It works now!

Nice! 👍
Loading

0 comments on commit 2597dc2

Please sign in to comment.