Compare commits

...

No commits in common. "e14630ab42089c559cb5871bc267678b08c17c21" and "26584d54823331652f2d0f368a3c39575b521be2" have entirely different histories.

69 changed files with 5087 additions and 2850 deletions

View File

@ -1,8 +0,0 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
insert_final_newline = true

View File

@ -1 +0,0 @@
build/

95
.eslintrc.js Normal file
View File

@ -0,0 +1,95 @@
const prettierConfig = require('./.prettierrc.js');
module.exports = {
env: {
browser: true,
commonjs: true,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'next/core-web-vitals',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react'],
rules: {
// Possible errors
'no-console': 'warn',
// Best practices
'dot-notation': 'error',
'no-else-return': 'error',
'no-floating-decimal': 'error',
'no-sequences': 'error',
// Stylistic
'array-bracket-spacing': 'error',
'computed-property-spacing': ['error', 'never'],
curly: 'error',
'no-lonely-if': 'error',
'no-unneeded-ternary': 'error',
'one-var-declaration-per-line': 'error',
quotes: [
'error',
'single',
{
allowTemplateLiterals: false,
avoidEscape: true,
},
],
// ES6
'array-callback-return': 'off',
'prefer-const': 'error',
// Imports
'import/prefer-default-export': 'off',
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
'no-unused-expressions': 'off',
'no-prototype-builtins': 'off',
// REACT
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'jsx-a11y/href-no-hash': [0],
'react/display-name': 0,
'react/no-deprecated': 'error',
'react/no-unsafe': [
'error',
{
checkAliases: true,
},
],
'react/jsx-sort-props': [
'error',
{
ignoreCase: true,
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 0,
// Prettier
// eslint looks for the prettier config at the top level of the package/app
// but the config lives in the `config/` directory. Passing the config here
// to get around this.
'prettier/prettier': ['error', prettierConfig],
},
settings: {
react: {
version: 'detect',
},
},
};

View File

@ -1,3 +0,0 @@
{
"extends": "./node_modules/gts/"
}

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<option name="fix-on-save" value="true" />
</component>
</project>

View File

@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="ProjectModuleManager"> <component name="ProjectModuleManager">
<modules> <modules>
<module fileurl="file://$PROJECT_DIR$/.idea/google_m3_ui_kit.iml" filepath="$PROJECT_DIR$/.idea/google_m3_ui_kit.iml" /> <module fileurl="file://$PROJECT_DIR$/.idea/google-material-you-ui.iml" filepath="$PROJECT_DIR$/.idea/google-material-you-ui.iml" />
</modules> </modules>
</component> </component>
</project> </project>

View File

@ -1,3 +1,7 @@
module.exports = { module.exports = {
...require('gts/.prettierrc.json') arrowParens: 'avoid',
} singleQuote: true,
trailingComma: 'all',
tabWidth: 4,
endOfLine: 'auto',
};

View File

@ -1,5 +1,7 @@
# React/Next.js Material You UI kit (pre-alpha) # React/Next.js Material You UI kit (pre-alpha)
This repository is including and will be including components, enumerates in table: This repository is including and will be including components, enumerates in table:
- [x] Buttons - [x] Buttons
- [x] Default - [x] Default
- [x] Icon - [x] Icon
@ -29,12 +31,19 @@ This repository is including and will be including components, enumerates in tab
- [ ] Bottom app bars - [ ] Bottom app bars
~~and including preview page for test.~~ ~~and including preview page for test.~~
Preview page on stage WIP. Preview page on stage WIP.
# Status # Status
Nowadays, this UI kit have base kinds of components and you could make everything. For example - general forms (without select field and etc.) Nowadays, this UI kit have base kinds of components and you could make everything. For example - general forms (without select field and etc.)
# Roadmap # Roadmap
1. Full implementation components; 1. Full implementation components;
2. Release NPM package; 2. Release NPM package;
3. Custom theaming. 3. Custom theaming.
## Did you find the bug? Make sure to [leave an issue](https://github.com/doryan04/DSS/issues/new) in case of any problems. ## Did you find the bug? Make sure to [leave an issue](https://github.com/doryan04/DSS/issues/new) in case of any problems.
## If you want help to the project, please, advise your idea in Pull request and don't forget [send issue](https://github.com/doryan04/DSS/issues/new) ## If you want help to the project, please, advise your idea in Pull request and don't forget [send issue](https://github.com/doryan04/DSS/issues/new)
### Check out actual news on Telegram. [https://t.me/doryanProjects](https://t.me/doryanProjects) ### Check out actual news on Telegram. [https://t.me/doryanProjects](https://t.me/doryanProjects)

View File

@ -8,7 +8,7 @@ export default function Buttons() {
const callback = useCallback( const callback = useCallback(
() => setState(prevState => prevState + 1), () => setState(prevState => prevState + 1),
[state] [state],
); );
return ( return (
@ -26,13 +26,13 @@ export default function Buttons() {
}} }}
> >
<Button <Button
variant={'filled'}
onClick={callback}
centralRipple centralRipple
onClick={callback}
variant={'filled'}
> >
Label + {state} Label + {state}
</Button> </Button>
<Button variant={'elevated'} /> <Button variant={'outlined'}>Label</Button>
<Button variant={'tonal'}>Label</Button> <Button variant={'tonal'}>Label</Button>
<Button variant={'elevated'}>Label</Button> <Button variant={'elevated'}>Label</Button>
<Button variant={'text'}>Label</Button> <Button variant={'text'}>Label</Button>
@ -48,19 +48,19 @@ export default function Buttons() {
gap: '0.5em', gap: '0.5em',
}} }}
> >
<Button variant={'filled'} icon={'add'}> <Button icon={'add'} variant={'filled'}>
Label Label
</Button> </Button>
<Button variant={'outlined'} icon={'add'}> <Button icon={'add'} variant={'outlined'}>
Label Label
</Button> </Button>
<Button variant={'tonal'} icon={'add'}> <Button icon={'add'} variant={'tonal'}>
Label Label
</Button> </Button>
<Button variant={'elevated'} icon={'add'}> <Button icon={'add'} variant={'elevated'}>
Label Label
</Button> </Button>
<Button variant={'text'} icon={'add'}> <Button icon={'add'} variant={'text'}>
Label Label
</Button> </Button>
</div> </div>

View File

@ -38,7 +38,7 @@ export default function Checkboxes() {
<h2> Disabled </h2> <h2> Disabled </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<Checkbox disabled /> <Checkbox disabled />
<Checkbox disabled defaultChecked /> <Checkbox defaultChecked disabled />
</div> </div>
</div> </div>
</div> </div>
@ -59,8 +59,8 @@ export default function Checkboxes() {
}} }}
> >
<Checkbox required /> <Checkbox required />
<Checkbox required defaultChecked /> <Checkbox defaultChecked required />
<Checkbox required indeterminate={true} /> <Checkbox indeterminate={true} required />
</div> </div>
<div <div
style={{ style={{
@ -69,16 +69,16 @@ export default function Checkboxes() {
flexDirection: 'row', flexDirection: 'row',
}} }}
> >
<Checkbox required className={'m3-error'} /> <Checkbox className={'m3-error'} required />
<Checkbox <Checkbox
required
defaultChecked
className={'m3-error'} className={'m3-error'}
defaultChecked
required
/> />
<Checkbox <Checkbox
required
indeterminate={true}
className={'m3-error'} className={'m3-error'}
indeterminate={true}
required
/> />
</div> </div>
<Button type={'submit'}>Send</Button> <Button type={'submit'}>Send</Button>

View File

@ -19,103 +19,103 @@ export default function Fabs() {
<h2> Small </h2> <h2> Small </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<FAB <FAB
size={'small'}
icon={'edit'}
elevated
centralRipple centralRipple
elevated
icon={'edit'}
size={'small'}
/> />
<FAB <FAB
elevated
icon={'edit'}
size={'small'}
variant={'primary'} variant={'primary'}
size={'small'}
icon={'edit'}
elevated
/> />
<FAB <FAB
elevated
icon={'edit'}
size={'small'}
variant={'secondary'} variant={'secondary'}
size={'small'}
icon={'edit'}
elevated
/> />
<FAB <FAB
variant={'tertiary'}
size={'small'}
icon={'edit'}
elevated elevated
icon={'edit'}
size={'small'}
variant={'tertiary'}
/> />
</div> </div>
</div> </div>
<div> <div>
<h2> Default </h2> <h2> Default </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<FAB icon={'edit'} elevated /> <FAB elevated icon={'edit'} />
<FAB <FAB
elevated
icon={'edit'}
variant={'primary'} variant={'primary'}
icon={'edit'}
elevated
/> />
<FAB <FAB
elevated
icon={'edit'}
variant={'secondary'} variant={'secondary'}
icon={'edit'}
elevated
/> />
<FAB <FAB
variant={'tertiary'}
icon={'edit'}
elevated elevated
icon={'edit'}
variant={'tertiary'}
/> />
</div> </div>
</div> </div>
<div> <div>
<h2> Large </h2> <h2> Large </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<FAB size={'large'} icon={'edit'} /> <FAB elevated icon={'edit'} size={'large'} />
<FAB <FAB
elevated
icon={'edit'}
size={'large'}
variant={'primary'} variant={'primary'}
size={'large'}
icon={'edit'}
elevated
/> />
<FAB <FAB
elevated
icon={'edit'}
size={'large'}
variant={'secondary'} variant={'secondary'}
size={'large'}
icon={'edit'}
elevated
/> />
<FAB <FAB
variant={'tertiary'}
size={'large'}
icon={'edit'}
elevated elevated
icon={'edit'}
size={'large'}
variant={'tertiary'}
/> />
</div> </div>
</div> </div>
<div> <div>
<h2> Extended </h2> <h2> Extended </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<FAB size={'extended'} icon={'edit'} elevated> <FAB elevated icon={'edit'} size={'extended'}>
<span className={'label-large'}>Label</span> <span className={'label-large'}>Label</span>
</FAB> </FAB>
<FAB <FAB
elevated
icon={'edit'}
size={'extended'}
variant={'primary'} variant={'primary'}
size={'extended'}
icon={'edit'}
elevated
> >
<span className={'label-large'}>Label</span> <span className={'label-large'}>Label</span>
</FAB> </FAB>
<FAB <FAB
elevated
icon={'edit'}
size={'extended'}
variant={'secondary'} variant={'secondary'}
size={'extended'}
icon={'edit'}
elevated
> >
<span className={'label-large'}>Label</span> <span className={'label-large'}>Label</span>
</FAB> </FAB>
<FAB <FAB
variant={'tertiary'}
size={'extended'}
icon={'edit'}
elevated elevated
icon={'edit'}
size={'extended'}
variant={'tertiary'}
> >
<span className={'label-large'}>Label</span> <span className={'label-large'}>Label</span>
</FAB> </FAB>
@ -136,20 +136,21 @@ export default function Fabs() {
<div> <div>
<h2> Small </h2> <h2> Small </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<FAB icon={'edit'} size={'small'} />
<FAB <FAB
size={'small'}
icon={'edit'} icon={'edit'}
size={'small'}
variant={'primary'} variant={'primary'}
/> />
<FAB <FAB
variant={'secondary'}
size={'small'}
icon={'edit'} icon={'edit'}
size={'small'}
variant={'secondary'}
/> />
<FAB <FAB
variant={'tertiary'}
size={'small'}
icon={'edit'} icon={'edit'}
size={'small'}
variant={'tertiary'}
/> />
</div> </div>
</div> </div>
@ -157,56 +158,56 @@ export default function Fabs() {
<h2> Default </h2> <h2> Default </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<FAB icon={'edit'} /> <FAB icon={'edit'} />
<FAB variant={'primary'} icon={'edit'} /> <FAB icon={'edit'} variant={'primary'} />
<FAB variant={'secondary'} icon={'edit'} /> <FAB icon={'edit'} variant={'secondary'} />
<FAB variant={'tertiary'} icon={'edit'} /> <FAB icon={'edit'} variant={'tertiary'} />
</div> </div>
</div> </div>
<div> <div>
<h2> Large </h2> <h2> Large </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<FAB size={'large'} icon={'edit'} /> <FAB icon={'edit'} size={'large'} />
<FAB <FAB
icon={'edit'}
size={'large'}
variant={'primary'} variant={'primary'}
size={'large'}
icon={'edit'}
/> />
<FAB <FAB
icon={'edit'}
size={'large'}
variant={'secondary'} variant={'secondary'}
size={'large'}
icon={'edit'}
/> />
<FAB <FAB
variant={'tertiary'}
size={'large'}
icon={'edit'} icon={'edit'}
size={'large'}
variant={'tertiary'}
/> />
</div> </div>
</div> </div>
<div> <div>
<h2> Extended </h2> <h2> Extended </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<FAB size={'extended'} icon={'edit'}> <FAB icon={'edit'} size={'extended'}>
<span className={'label-large'}>Label</span> <span className={'label-large'}>Label</span>
</FAB> </FAB>
<FAB <FAB
icon={'edit'}
size={'extended'}
variant={'primary'} variant={'primary'}
size={'extended'}
icon={'edit'}
> >
<span className={'label-large'}>Label</span> <span className={'label-large'}>Label</span>
</FAB> </FAB>
<FAB <FAB
icon={'edit'}
size={'extended'}
variant={'secondary'} variant={'secondary'}
size={'extended'}
icon={'edit'}
> >
<span className={'label-large'}>Label</span> <span className={'label-large'}>Label</span>
</FAB> </FAB>
<FAB <FAB
variant={'tertiary'}
size={'extended'}
icon={'edit'} icon={'edit'}
size={'extended'}
variant={'tertiary'}
> >
<span className={'label-large'}>Label</span> <span className={'label-large'}>Label</span>
</FAB> </FAB>

View File

@ -17,7 +17,7 @@ function IconButtons() {
gap: '0.5em', gap: '0.5em',
}} }}
> >
<IconButton icon={'settings'} centralRipple /> <IconButton centralRipple icon={'settings'} />
<IconButton icon={'settings'} variant={'filled'} /> <IconButton icon={'settings'} variant={'filled'} />
<IconButton icon={'settings'} variant={'tonal'} /> <IconButton icon={'settings'} variant={'tonal'} />
<IconButton icon={'settings'} variant={'outlined'} /> <IconButton icon={'settings'} variant={'outlined'} />
@ -30,21 +30,21 @@ function IconButtons() {
gap: '0.5em', gap: '0.5em',
}} }}
> >
<IconButton icon={'settings'} disabled /> <IconButton disabled icon={'settings'} />
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
variant={'filled'} variant={'filled'}
disabled
/> />
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
variant={'tonal'} variant={'tonal'}
disabled
/> />
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
variant={'outlined'} variant={'outlined'}
disabled
/> />
</div> </div>
</div> </div>
@ -66,27 +66,27 @@ function IconButtons() {
/> />
<IconButton <IconButton
icon={'settings'} icon={'settings'}
toggled={{
selected: 'settings',
unselected: 'settings',
}}
variant={'filled'} variant={'filled'}
/>
<IconButton
icon={'settings'}
toggled={{ toggled={{
selected: 'settings', selected: 'settings',
unselected: 'settings', unselected: 'settings',
}} }}
/>
<IconButton
icon={'settings'}
variant={'tonal'} variant={'tonal'}
toggled={{
selected: 'settings',
unselected: 'settings',
}}
/> />
<IconButton <IconButton
icon={'settings'} icon={'settings'}
variant={'outlined'}
toggled={{ toggled={{
selected: 'settings', selected: 'settings',
unselected: 'settings', unselected: 'settings',
}} }}
variant={'outlined'}
/> />
</div> </div>
<h2> Disabled toggle buttons </h2> <h2> Disabled toggle buttons </h2>
@ -98,39 +98,39 @@ function IconButtons() {
}} }}
> >
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
toggled={{ toggled={{
selected: 'settings', selected: 'settings',
unselected: 'settings', unselected: 'settings',
}} }}
disabled
/> />
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
toggled={{
selected: 'settings',
unselected: 'settings',
}}
variant={'filled'} variant={'filled'}
/>
<IconButton
disabled
icon={'settings'}
toggled={{ toggled={{
selected: 'settings', selected: 'settings',
unselected: 'settings', unselected: 'settings',
}} }}
disabled
/>
<IconButton
icon={'settings'}
variant={'tonal'} variant={'tonal'}
toggled={{
selected: 'settings',
unselected: 'settings',
}}
disabled
/> />
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
variant={'outlined'}
toggled={{ toggled={{
selected: 'settings', selected: 'settings',
unselected: 'settings', unselected: 'settings',
}} }}
disabled variant={'outlined'}
/> />
</div> </div>
<h2> Disabled selected toggle buttons </h2> <h2> Disabled selected toggle buttons </h2>
@ -142,43 +142,43 @@ function IconButtons() {
}} }}
> >
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
selected
toggled={{ toggled={{
selected: 'settings', selected: 'settings',
unselected: 'settings', unselected: 'settings',
}} }}
disabled
selected
/> />
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
selected
toggled={{
selected: 'settings',
unselected: 'settings',
}}
variant={'filled'} variant={'filled'}
/>
<IconButton
disabled
icon={'settings'}
selected
toggled={{ toggled={{
selected: 'settings', selected: 'settings',
unselected: 'settings', unselected: 'settings',
}} }}
disabled
selected
/>
<IconButton
icon={'settings'}
variant={'tonal'} variant={'tonal'}
toggled={{
selected: 'settings',
unselected: 'settings',
}}
disabled
selected
/> />
<IconButton <IconButton
disabled
icon={'settings'} icon={'settings'}
variant={'outlined'} selected
toggled={{ toggled={{
selected: 'settings', selected: 'settings',
unselected: 'settings', unselected: 'settings',
}} }}
disabled variant={'outlined'}
selected
/> />
</div> </div>
</div> </div>

View File

@ -25,7 +25,7 @@ export default function Radios() {
<h2> Disabled </h2> <h2> Disabled </h2>
<div style={{ display: 'flex', gap: '2em' }}> <div style={{ display: 'flex', gap: '2em' }}>
<Radio disabled /> <Radio disabled />
<Radio disabled defaultChecked /> <Radio defaultChecked disabled />
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,3 +1,5 @@
'use client';
import React from 'react'; import React from 'react';
import { Switch } from '../../src/primitive-components/material-you-components'; import { Switch } from '../../src/primitive-components/material-you-components';
@ -27,7 +29,7 @@ export default function Switches() {
<div> <div>
<h2> Disabled </h2> <h2> Disabled </h2>
<Switch disabled /> <Switch disabled />
<Switch disabled defaultChecked /> <Switch defaultChecked disabled />
</div> </div>
</div> </div>
</div> </div>
@ -49,7 +51,7 @@ export default function Switches() {
<div> <div>
<h2> Disabled </h2> <h2> Disabled </h2>
<Switch disabled icon /> <Switch disabled icon />
<Switch disabled defaultChecked icon /> <Switch defaultChecked disabled icon />
</div> </div>
</div> </div>
</div> </div>
@ -65,13 +67,13 @@ export default function Switches() {
> >
<div> <div>
<h2> Default </h2> <h2> Default </h2>
<Switch selected icon /> <Switch icon selected />
<Switch selected defaultChecked icon /> <Switch defaultChecked icon selected />
</div> </div>
<div> <div>
<h2> Disabled </h2> <h2> Disabled </h2>
<Switch selected disabled icon /> <Switch disabled icon selected />
<Switch selected disabled defaultChecked icon /> <Switch defaultChecked disabled icon selected />
</div> </div>
</div> </div>
</div> </div>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,4 @@
import '../src/styles/generics.css'; import '../src/styles/generics.css';
import '../src/styles/button.css';
import '../src/styles/ripple.css';
import { Metadata, Viewport } from 'next'; import { Metadata, Viewport } from 'next';
export const metadata: Metadata = { export const metadata: Metadata = {
@ -15,7 +13,11 @@ export const viewport: Viewport = {
userScalable: false, userScalable: false,
}; };
export default function RootLayout({children}: {children: React.ReactNode}) { export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return ( return (
<html lang="en"> <html lang="en">
<body>{children}</body> <body>{children}</body>

3699
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -4,27 +4,38 @@
"dev": "next dev --turbo", "dev": "next dev --turbo",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "gts lint", "lint": "lint",
"clean": "gts clean",
"compile": "tsc", "compile": "tsc",
"fix": "gts fix",
"prepare": "npm run compile", "prepare": "npm run compile",
"pretest": "npm run compile", "pretest": "npm run compile",
"posttest": "npm run lint" "posttest": "npm run lint"
}, },
"dependencies": { "dependencies": {
"eslint-plugin-prettier": "^5.1.3",
"install": "^0.13.0", "install": "^0.13.0",
"next": "latest", "next": "latest",
"npm": "^10.4.0",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0" "react-dom": "^18.2.0"
}, },
"devDependencies": { "devDependencies": {
"@next/eslint-plugin-next": "^14.1.0",
"@types/node": "20.8.2", "@types/node": "20.8.2",
"@types/react": "18.2.33", "@types/react": "18.2.33",
"@types/react-dom": "18.2.14", "@types/react-dom": "18.2.14",
"gts": "^5.2.0", "@typescript-eslint/eslint-plugin": "^6.20.0",
"eslint": "^8.56.0",
"eslint-config-next": "^14.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"i": "^0.3.7",
"npm": "^10.4.0",
"prettier": "3.2.4",
"typescript": "~5.2.0" "typescript": "~5.2.0"
} }
} }

View File

@ -1,33 +0,0 @@
console.log('Try npm run lint/fix!');
const longString =
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut aliquet diam.';
const trailing = 'Semicolon';
const why = {am: 'I tabbed?'};
const iWish = "I didn't have a trailing space...";
const sicilian = true;
const vizzini = sicilian ? !sicilian : sicilian;
const re = /foo {3}bar/;
export function doSomeStuff(
withThis: string,
andThat: string,
andThose: string[]
) {
//function on one line
if (!andThose.length) {
return false;
}
console.log(withThis);
console.log(andThat);
console.dir(andThose);
console.log(longString, trailing, why, iWish, vizzini, re);
return;
}
// TODO: more examples

View File

@ -1,28 +1,23 @@
import React, {ForwardedRef, forwardRef, PropsWithChildren} from 'react'; import { BadgeProps } from './badges.types';
import { bool, number, string } from 'prop-types'; import { bool, number, string } from 'prop-types';
import React, { forwardRef } from 'react';
interface BadgeProps extends PropsWithChildren<any> { const Badge = forwardRef<SVGSVGElement, BadgeProps>(function Badge(
disableValue?: boolean; { disableValue = false, ...props },
} ref,
) {
const Badge = forwardRef(
({disableValue = false, ...props}: BadgeProps, ref: ForwardedRef<any>) => {
const digitLength = props.children const digitLength = props.children
? 16 + (props.children.length - 1) * 6 ? 16 + (props.children.length - 1) * 6
: 6, : 6,
disableValueClassName = disableValueClassName =
disableValue || (!props.children ?? true) disableValue || (!props.children ?? true) ? 'disable-value' : '';
? 'disable-value'
: '';
return ( return (
<svg <svg
{...props} {...props}
className={`m3 m3-badge ${'' ?? props.className}${disableValueClassName}`.trimEnd()}
ref={ref} ref={ref}
width={`${digitLength}px`} width={`${digitLength}px`}
className={`m3 m3-badge ${
'' ?? props.className
}${disableValueClassName}`.trimEnd()}
> >
{props.children && ( {props.children && (
<text x={'50%'} y={'50%'}> <text x={'50%'} y={'50%'}>
@ -31,8 +26,7 @@ const Badge = forwardRef(
)} )}
</svg> </svg>
); );
} });
);
Badge.propTypes = { Badge.propTypes = {
children: number, children: number,

View File

@ -0,0 +1,5 @@
import { PropsWithChildren } from 'react';
export interface BadgeProps extends PropsWithChildren<any> {
disableValue?: boolean;
}

View File

@ -1,6 +1,8 @@
'use client'; 'use client';
import { RippleArea } from '../ripple/ripple-area'; import { RippleArea } from '../ripple/ripple-area';
import { IRippleProps } from '../ripple/ripple.types';
import useRippleEffect from '../ripple/hooks/useRippleEffect';
import React, { import React, {
forwardRef, forwardRef,
PropsWithChildren, PropsWithChildren,
@ -8,17 +10,11 @@ import React, {
useRef, useRef,
useState, useState,
} from 'react'; } from 'react';
import useRippleEffect from '../ripple/hooks/useRippleEffect';
import {IRippleProps} from '../ripple/ripple.types';
const ButtonLayout = forwardRef( const ButtonLayout = forwardRef<
( HTMLButtonElement,
{ PropsWithChildren<any> & IRippleProps
centralRipple = false, >(function ButtonBase({ centralRipple = false, ...props }, ref) {
...props
}: PropsWithChildren<any> & IRippleProps,
ref
) => {
const [isActive, setIsActive] = useState<boolean>(false), const [isActive, setIsActive] = useState<boolean>(false),
ripplesRef = useRef(null), ripplesRef = useRef(null),
buttonId = useId(), buttonId = useId(),
@ -34,20 +30,19 @@ const ButtonLayout = forwardRef(
<button <button
{...props} {...props}
{...events} {...events}
ref={ref}
id={buttonId}
className={classes} className={classes}
disabled={disabled} disabled={disabled}
id={buttonId}
ref={ref}
> >
{props.children} {props.children}
<RippleArea <RippleArea
ref={ripplesRef}
central={centralRipple}
callback={setIsActive} callback={setIsActive}
central={centralRipple}
ref={ripplesRef}
/> />
</button> </button>
); );
} });
);
export { ButtonLayout }; export { ButtonLayout };

View File

@ -1,11 +1,11 @@
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
type toggleButtonType = { type ToggleButtonType = {
selected: string; selected: string;
unselected: string; unselected: string;
}; };
export interface buttonMainProps extends PropsWithChildren<any> { export interface ButtonMainProps extends PropsWithChildren<any> {
disabled?: boolean; disabled?: boolean;
variant?: 'filled' | 'outlined' | 'elevated' | 'tonal' | 'text'; variant?: 'filled' | 'outlined' | 'elevated' | 'tonal' | 'text';
} }
@ -17,9 +17,9 @@ export interface FABMainProps extends PropsWithChildren<any> {
variant?: 'surface' | 'primary' | 'secondary' | 'tertiary'; variant?: 'surface' | 'primary' | 'secondary' | 'tertiary';
} }
export interface iconButtonMainProps extends PropsWithChildren<any> { export interface IconButtonMainProps extends PropsWithChildren<any> {
icon: string; icon: string;
toggled?: false | toggleButtonType; toggled?: false | ToggleButtonType;
disabled?: boolean; disabled?: boolean;
variant?: 'default' | 'filled' | 'tonal' | 'outlined'; variant?: 'default' | 'filled' | 'tonal' | 'outlined';
} }

View File

@ -1,34 +1,33 @@
'use client';
import { forwardRef } from 'react'; import { forwardRef } from 'react';
import { Icon } from '../material-you-components'; import { Icon } from '../material-you-components';
import { IRippleProps } from '../ripple/ripple.types'; import { IRippleProps } from '../ripple/ripple.types';
import { ButtonLayout } from '../button-layout/button-layout'; import { ButtonLayout } from '../button-layout/button-layout';
import {buttonMainProps} from '../button-layout/button.types'; import { ButtonMainProps } from '../button-layout/button.types';
/** /**
* Button component * Button component
** description ** description
*/ */
export const Button = forwardRef( export const Button = forwardRef<
HTMLButtonElement,
ButtonMainProps & IRippleProps
>(
( (
{ { centralRipple = false, variant, disabled = false, icon, ...props },
centralRipple = false, ref,
variant,
disabled,
icon,
...props
}: buttonMainProps & IRippleProps,
ref
) => ( ) => (
<ButtonLayout <ButtonLayout
{...props} {...props}
ref={ref}
disabled={disabled}
centralRipple={centralRipple} centralRipple={centralRipple}
disabled={disabled}
ref={ref}
variant={variant ? variant : 'filled'} variant={variant ? variant : 'filled'}
> >
{icon ? <Icon iconSize={20}>{icon}</Icon> : <></>} {icon ? <Icon iconSize={20}>{icon}</Icon> : <></>}
<span className={'label-large'}>{props.children}</span> <span className={'label-large'}>{props.children}</span>
</ButtonLayout> </ButtonLayout>
) ),
); );

View File

@ -1,13 +1,17 @@
'use client'; 'use client';
import React, {forwardRef, useEffect, useImperativeHandle, useRef} from 'react'; import React, {
forwardRef,
useEffect,
useImperativeHandle,
useRef,
} from 'react';
import { CheckboxLayoutProps } from './checkbox-layout.types'; import { CheckboxLayoutProps } from './checkbox-layout.types';
export const CheckBoxLayout = forwardRef( export const CheckBoxLayout = forwardRef(function CheckBoxBase(
(
{ indeterminate, typeInput, type, ...props }: CheckboxLayoutProps, { indeterminate, typeInput, type, ...props }: CheckboxLayoutProps,
ref ref,
): JSX.Element => { ): JSX.Element {
const checkboxRef = useRef<any>(null); const checkboxRef = useRef<any>(null);
useEffect(() => { useEffect(() => {
@ -27,9 +31,8 @@ export const CheckBoxLayout = forwardRef(
<input <input
ref={checkboxRef} ref={checkboxRef}
{...props} {...props}
type={type}
className={classes.trimEnd()} className={classes.trimEnd()}
type={type}
/> />
); );
} });
);

View File

@ -1,9 +1,12 @@
'use client';
import { RippleArea } from '../ripple/ripple-area'; import { RippleArea } from '../ripple/ripple-area';
import { IRippleProps } from '../ripple/ripple.types'; import { IRippleProps } from '../ripple/ripple.types';
import useRippleEffect from '../ripple/hooks/useRippleEffect'; import useRippleEffect from '../ripple/hooks/useRippleEffect';
import { CheckBoxLayout } from '../checkbox-layout/check-box-layout'; import { CheckBoxLayout } from '../checkbox-layout/check-box-layout';
import { import {
forwardRef, forwardRef,
PropsWithChildren,
useEffect, useEffect,
useImperativeHandle, useImperativeHandle,
useRef, useRef,
@ -15,17 +18,18 @@ import {
** description ** description
*/ */
export const Checkbox = forwardRef( export const Checkbox = forwardRef<
({centralRipple, ...props}: any & IRippleProps, ref) => { HTMLInputElement,
PropsWithChildren<any> & IRippleProps
>(({ centralRipple, ...props }, ref) => {
const [isActive, setIsActive] = useState<boolean>(false), const [isActive, setIsActive] = useState<boolean>(false),
[checked, setChecked] = useState<boolean>(props.checked ?? false), [checked, setChecked] = useState<boolean>(props.checked ?? false),
ripplesRef = useRef(null), ripplesRef = useRef(null),
checkboxRef = useRef(null), checkboxRef = useRef(null),
events = useRippleEffect(ripplesRef, setIsActive); events = useRippleEffect(ripplesRef, setIsActive);
const classes = `m3 m3-checkbox-label ${ const classes =
isActive === true ? 'visible' : '' `m3 m3-checkbox-label ${isActive === true ? 'visible' : ''}`.trimEnd();
}`.trimEnd();
const indeterminate = (props.indeterminate === true).toString(); const indeterminate = (props.indeterminate === true).toString();
useImperativeHandle(ref, () => checkboxRef.current); useImperativeHandle(ref, () => checkboxRef.current);
@ -38,19 +42,18 @@ export const Checkbox = forwardRef(
<label {...events} className={classes}> <label {...events} className={classes}>
<CheckBoxLayout <CheckBoxLayout
{...props} {...props}
ref={checkboxRef}
indeterminate={indeterminate} indeterminate={indeterminate}
ref={checkboxRef}
type={'checkbox'} type={'checkbox'}
/> />
<span className={'m3 m3-checkbox-state-layer'} /> <span className={'m3 m3-checkbox-state-layer'} />
<RippleArea <RippleArea
callback={setIsActive}
central={centralRipple}
className={'m3-checkbox-ripple-layer'} className={'m3-checkbox-ripple-layer'}
ref={ripplesRef} ref={ripplesRef}
central={centralRipple}
callback={setIsActive}
/> />
{props.children} {props.children}
</label> </label>
); );
} });
);

View File

@ -1,25 +1,18 @@
import React, {ForwardedRef, forwardRef, PropsWithChildren} from 'react'; import React, { forwardRef, PropsWithChildren } from 'react';
interface DividerProps extends PropsWithChildren<any> { interface DividerProps extends PropsWithChildren<any> {
orientation?: 'vertical' | 'horizontal'; orientation?: 'vertical' | 'horizontal';
variant?: 'full-width' | 'inset' | 'middle-inset'; variant?: 'full-width' | 'inset' | 'middle-inset';
} }
const Divider = forwardRef( const Divider = forwardRef<HTMLHRElement, DividerProps>(
( ({ orientation, variant, ...props }, ref) => (
{orientation, variant, ...props}: DividerProps,
ref: ForwardedRef<any>
) => {
return (
<hr <hr
{...props} {...props}
className={`m3 m3-divider ${orientation ?? 'horizontal'} ${variant ?? 'full-width'}`.trimEnd()}
ref={ref} ref={ref}
className={`m3 m3-divider ${orientation ?? 'horizontal'} ${
variant ?? 'full-width'
}`.trimEnd()}
/> />
); ),
}
); );
export { Divider }; export { Divider };

View File

@ -1,8 +1,10 @@
'use client';
import { forwardRef } from 'react'; import { forwardRef } from 'react';
import { Icon } from '../material-you-components';
import { IRippleProps } from '../ripple/ripple.types';
import { FABMainProps } from '../button-layout/button.types'; import { FABMainProps } from '../button-layout/button.types';
import { ButtonLayout } from '../button-layout/button-layout'; import { ButtonLayout } from '../button-layout/button-layout';
import {IRippleProps} from '../ripple/ripple.types';
import {Icon} from '../material-you-components';
/** /**
* FABs component * FABs component
@ -16,7 +18,7 @@ const sizes = {
extended: 24, extended: 24,
}; };
export const FAB = forwardRef( export const FAB = forwardRef<HTMLButtonElement, FABMainProps & IRippleProps>(
( (
{ {
variant, variant,
@ -26,17 +28,16 @@ export const FAB = forwardRef(
size = 'default', size = 'default',
elevated, elevated,
...props ...props
}: FABMainProps & IRippleProps, },
ref ref,
) => ( ) => (
<ButtonLayout <ButtonLayout
{...props} {...props}
ref={ref}
centralRipple={centralRipple} centralRipple={centralRipple}
className={`m3-fab m3-${size}-fab ${!(elevated ?? false) && 'without-elevation'}`}
disabled={disabled}
ref={ref}
variant={variant ? variant : 'surface'} variant={variant ? variant : 'surface'}
className={`m3-fab m3-${size}-fab ${
!(elevated ?? false) && 'without-elevation'
}`}
> >
<Icon iconSize={sizes[size]} svgSize={sizes[size]}> <Icon iconSize={sizes[size]} svgSize={sizes[size]}>
{icon} {icon}
@ -47,5 +48,5 @@ export const FAB = forwardRef(
<></> <></>
)} )}
</ButtonLayout> </ButtonLayout>
) ),
); );

View File

@ -1,5 +1,10 @@
'use client';
import { Icon } from '../material-you-components';
import { toggleIconType } from './icon-button.types';
import { IRippleProps } from '../ripple/ripple.types';
import { ButtonLayout } from '../button-layout/button-layout'; import { ButtonLayout } from '../button-layout/button-layout';
import {iconButtonMainProps} from '../button-layout/button.types'; import { IconButtonMainProps } from '../button-layout/button.types';
import { import {
forwardRef, forwardRef,
useCallback, useCallback,
@ -7,15 +12,16 @@ import {
useRef, useRef,
useState, useState,
} from 'react'; } from 'react';
import {IRippleProps} from '../ripple/ripple.types';
import {Icon} from '../material-you-components';
/** /**
* Icon button-layout component * Icon button-layout component
** description ** description
*/ */
export const IconButton = forwardRef( export const IconButton = forwardRef<
HTMLButtonElement,
IconButtonMainProps & IRippleProps
>(
( (
{ {
icon, icon,
@ -25,11 +31,11 @@ export const IconButton = forwardRef(
toggled = false, toggled = false,
centralRipple, centralRipple,
...props ...props
}: iconButtonMainProps & IRippleProps, },
ref ref,
) => { ) => {
const [toggleIcon, setToggleIcon] = useState<any>({ const [toggleIcon, setToggleIcon] = useState<toggleIconType>({
state: selected === true ? 'selected' : 'unselected', state: selected == true ? 'selected' : 'unselected',
icon: toggled ? toggled.unselected ?? 'add_circle' : 'add_circle', icon: toggled ? toggled.unselected ?? 'add_circle' : 'add_circle',
}); });
@ -44,35 +50,37 @@ export const IconButton = forwardRef(
const callback = useCallback(() => { const callback = useCallback(() => {
if (toggled) { if (toggled) {
if (toggleIcon.state === 'selected') if (toggleIcon.state === 'selected') {
toggle('', toggled.unselected ?? 'add_circle'); toggle('', toggled.unselected ?? 'add_circle');
else toggle('selected', toggled.selected ?? 'add_circle'); } else {
toggle('selected', toggled.selected ?? 'add_circle');
}
}
if (props.onClick) {
props.onClick();
} }
if (props.onClick) props.onClick();
}, [toggleIcon]); }, [toggleIcon]);
useImperativeHandle(ref, () => buttonRef); useImperativeHandle(ref, () => buttonRef.current);
return ( return (
<ButtonLayout <ButtonLayout
{...props} {...props}
ref={buttonRef}
onClick={callback}
centralRipple={centralRipple} centralRipple={centralRipple}
className={`m3-icon-button ${toggleIcon.state} ${toggled ? 'toggled' : ''}`.trimEnd()}
disabled={disabled} disabled={disabled}
className={`m3-icon-button ${toggleIcon.state} ${ onClick={callback}
toggled ? 'toggled' : '' ref={buttonRef}
}`.trimEnd()}
variant={variant ? variant : 'default'} variant={variant ? variant : 'default'}
> >
<Icon <Icon
svgSize={40}
iconSize={28}
fill={toggleIcon.state === 'selected' ? 1 : 0} fill={toggleIcon.state === 'selected' ? 1 : 0}
iconSize={28}
svgSize={40}
> >
{toggled ? toggleIcon.icon : icon ? icon : undefined} {toggled ? toggleIcon.icon : icon ? icon : undefined}
</Icon> </Icon>
</ButtonLayout> </ButtonLayout>
); );
} },
); );

View File

@ -0,0 +1,4 @@
export type toggleIconType = {
state: string;
icon: string;
};

View File

@ -1,9 +1,8 @@
import React, {ForwardedRef, forwardRef} from 'react';
import { IconProps } from './icon.types'; import { IconProps } from './icon.types';
import { bool, number, string } from 'prop-types'; import { bool, number, string } from 'prop-types';
import React, { ForwardedRef, forwardRef } from 'react';
const Icon = forwardRef( const Icon = forwardRef(function Icon(
(
{ {
grade = 0, grade = 0,
weight = 500, weight = 500,
@ -14,26 +13,22 @@ const Icon = forwardRef(
type = 'outlined', type = 'outlined',
...props ...props
}: IconProps, }: IconProps,
ref: ForwardedRef<any> ref: ForwardedRef<any>,
) => { ) {
const fontVariation = { const fontVariation = {
fontVariationSettings: `'FILL' ${ fontVariationSettings: `'FILL' ${fill ? 1 : 0}, 'wght' ${weight}, 'GRAD' ${grade}, 'optz' ${opticalSize}`,
fill ? 1 : 0
}, 'wght' ${weight}, 'GRAD' ${grade}, 'optz' ${opticalSize}`,
}; };
return ( return (
<svg <svg
{...props} {...props}
ref={ref}
className={`m3 m3-svg-icon ${props.className ?? ''}`.trim()} className={`m3 m3-svg-icon ${props.className ?? ''}`.trim()}
width={svgSize}
height={svgSize} height={svgSize}
ref={ref}
width={svgSize}
> >
<text <text
className={`m3-${ className={`m3-${type[0].toUpperCase() + type.slice(1)} m3-size-${iconSize}px`}
type[0].toUpperCase() + type.slice(1)
} m3-size-${iconSize}px`}
style={fontVariation} style={fontVariation}
x={'50%'} x={'50%'}
y={'50%'} y={'50%'}
@ -42,8 +37,7 @@ const Icon = forwardRef(
</text> </text>
</svg> </svg>
); );
} });
);
Icon.propTypes = { Icon.propTypes = {
fill: bool, fill: bool,

View File

@ -1,36 +1,38 @@
'use client';
import { RippleArea } from '../ripple/ripple-area'; import { RippleArea } from '../ripple/ripple-area';
import {forwardRef, useRef, useState} from 'react'; import { IRippleProps } from '../ripple/ripple.types';
import useRippleEffect from '../ripple/hooks/useRippleEffect'; import useRippleEffect from '../ripple/hooks/useRippleEffect';
import { CheckBoxLayout } from '../checkbox-layout/check-box-layout'; import { CheckBoxLayout } from '../checkbox-layout/check-box-layout';
import {IRippleProps} from '../ripple/ripple.types'; import { forwardRef, PropsWithChildren, useRef, useState } from 'react';
/** /**
* Radio component * Radio component
** description ** description
*/ */
export const Radio = forwardRef( export const Radio = forwardRef<
({centralRipple, ...props}: any & IRippleProps, ref) => { HTMLInputElement,
PropsWithChildren<HTMLElement> & IRippleProps
>(({ centralRipple, ...props }, ref) => {
const [isActive, setIsActive] = useState<boolean>(false), const [isActive, setIsActive] = useState<boolean>(false),
ripplesRef = useRef(null), ripplesRef = useRef(null),
events = useRippleEffect(ripplesRef, setIsActive); events = useRippleEffect(ripplesRef, setIsActive);
const classes = `m3 m3-radio-label ${ const classes =
isActive === true ? 'visible' : '' `m3 m3-radio-label ${isActive === true ? 'visible' : ''}`.trimEnd();
}`.trimEnd();
return ( return (
<label {...events} className={classes}> <label {...events} className={classes}>
<CheckBoxLayout {...props} ref={ref} type={'radio'} /> <CheckBoxLayout {...props} ref={ref} type={'radio'} />
<span className={'m3 m3-radio-state-layer'} /> <span className={'m3 m3-radio-state-layer'} />
<RippleArea <RippleArea
callback={setIsActive}
central={centralRipple}
className={'m3-checkbox-ripple-layer'} className={'m3-checkbox-ripple-layer'}
ref={ripplesRef} ref={ripplesRef}
central={centralRipple}
callback={setIsActive}
/> />
{props.children} {props.children}
</label> </label>
); );
} });
);

View File

@ -12,30 +12,18 @@ interface RippleEventHandlers {
onTouchStart: React.TouchEventHandler; onTouchStart: React.TouchEventHandler;
} }
export type EventHandlerType<T> = const UseRippleEffect = (ref, callback): undefined | RippleEventHandlers => {
| React.FocusEvent<T>
| React.DragEvent<T>
| React.MouseEvent<T>
| React.TouchEvent<T>;
interface RefImperativeType {
current: {
start: (event: EventHandlerType<Element>, callback: () => void) => void;
stop: (event: EventHandlerType<Element>, callback: () => void) => void;
};
}
const UseRippleEffect = (
ref: RefImperativeType,
callback: () => void
): undefined | RippleEventHandlers => {
const [mounted, setMounted] = useState<boolean>(false); const [mounted, setMounted] = useState<boolean>(false);
useEffect(() => { useEffect(() => {
if (!mounted) setMounted(true); if (!mounted) {
setMounted(true);
}
}); });
if (!mounted) return; if (!mounted) {
return;
}
const { start, stop } = ref.current; const { start, stop } = ref.current;

View File

@ -1,22 +1,24 @@
'use client'; 'use client';
import React, { import React, {
useId,
useRef,
useState,
forwardRef, forwardRef,
useCallback, useCallback,
useId,
useImperativeHandle, useImperativeHandle,
useRef,
useState,
} from 'react'; } from 'react';
import { Ripple } from './ripple'; import { Ripple } from './ripple';
import { Ripples } from './ripple'; import { Ripples } from './ripple';
import { RippleAreaProps } from './ripple.types'; import { RippleAreaProps } from './ripple.types';
const TIMEOUT = 550; const TIMEOUT: number = 550;
const rippleAreaContext = React.createContext(false); const rippleAreaContext = React.createContext(false);
const RippleArea = forwardRef( const RippleArea = forwardRef(function RippleArea(
({central = false, callback, ...props}: RippleAreaProps, ref) => { { central = false, callback, ...props }: RippleAreaProps,
ref,
) {
const [ripples, setRipples] = useState<Array<JSX.Element>>([]), const [ripples, setRipples] = useState<Array<JSX.Element>>([]),
rippleDomain = useRef<any>(null), rippleDomain = useRef<any>(null),
clicked = useRef<boolean>(false), clicked = useRef<boolean>(false),
@ -50,53 +52,50 @@ const RippleArea = forwardRef(
rippleSizeX: number = rippleSizeX: number =
Math.max( Math.max(
Math.abs(rippleDomainChar.width - rippleX), Math.abs(rippleDomainChar.width - rippleX),
rippleX rippleX,
) * ) *
2 + 2 +
2, 2,
rippleSizeY: number = rippleSizeY: number =
Math.max( Math.max(
Math.abs(rippleDomainChar.height - rippleY), Math.abs(rippleDomainChar.height - rippleY),
rippleY rippleY,
) * ) *
2 + 2 +
2, 2,
rippleS: number = rippleS: number = (rippleSizeX ** 2 + rippleSizeY ** 2) ** 0.5;
(rippleSizeX ** 2 + rippleSizeY ** 2) ** 0.5;
setRipples((prevRipples: Array<JSX.Element>) => { setRipples((prevRipples: Array<JSX.Element>) => {
if (prevRipples.length === 0) { if (prevRipples.length === 0) {
return [ return [
<Ripple <Ripple
rippleX={rippleX}
rippleY={rippleY}
rippleS={rippleS}
key={uniqueKey.current} key={uniqueKey.current}
lifetime={TIMEOUT} lifetime={TIMEOUT}
rippleS={rippleS}
rippleX={rippleX}
rippleY={rippleY}
/>, />,
]; ];
} else { }
const old = [...prevRipples]; const old = [...prevRipples];
old.push( old.push(
<Ripple <Ripple
rippleX={rippleX}
rippleY={rippleY}
rippleS={rippleS}
key={uniqueKey.current} key={uniqueKey.current}
lifetime={TIMEOUT} lifetime={TIMEOUT}
/> rippleS={rippleS}
rippleX={rippleX}
rippleY={rippleY}
/>,
); );
return old; return old;
}
}); });
uniqueKey.current += 1; uniqueKey.current += 1;
}, },
[] [],
); );
const stop = useCallback( const stop = useCallback((_event: any, cb: (state: boolean) => void) => {
(_event: any, cb: (state: boolean) => void) => {
clicked.current = false; clicked.current = false;
cb(clicked.current); cb(clicked.current);
@ -108,9 +107,7 @@ const RippleArea = forwardRef(
} }
return prevRipples; return prevRipples;
}); });
}, }, []);
[]
);
useImperativeHandle( useImperativeHandle(
ref, ref,
@ -118,8 +115,9 @@ const RippleArea = forwardRef(
start, start,
stop, stop,
}), }),
[start, stop] [start, stop],
); );
return ( return (
<span className={classes} id={uniqueId} ref={rippleDomain}> <span className={classes} id={uniqueId} ref={rippleDomain}>
<rippleAreaContext.Provider value={clicked.current}> <rippleAreaContext.Provider value={clicked.current}>
@ -127,7 +125,6 @@ const RippleArea = forwardRef(
</rippleAreaContext.Provider> </rippleAreaContext.Provider>
</span> </span>
); );
} });
);
export { rippleAreaContext, RippleArea }; export { rippleAreaContext, RippleArea };

View File

@ -5,18 +5,21 @@ import {rippleProps} from './ripple.types';
import { rippleAreaContext } from './ripple-area'; import { rippleAreaContext } from './ripple-area';
import RippleEffectBuild from './utils/ripple-effect-builder'; import RippleEffectBuild from './utils/ripple-effect-builder';
import React, { import React, {
ForwardedRef,
forwardRef,
JSX,
useCallback,
useContext,
useEffect,
useRef, useRef,
useState, useState,
useEffect,
forwardRef,
useContext,
useCallback,
ForwardedRef,
useTransition, useTransition,
JSX,
} from 'react'; } from 'react';
const Ripples = forwardRef((props: any, ref: ForwardedRef<any>) => { const Ripples = forwardRef(function Ripples(
props: any,
ref: ForwardedRef<any>,
) {
const [ripples, setRipples] = useState({}); const [ripples, setRipples] = useState({});
const firstRender = useRef<boolean>(true); const firstRender = useRef<boolean>(true);
const [pending, startTransition] = useTransition(); const [pending, startTransition] = useTransition();
@ -41,7 +44,7 @@ const Ripples = forwardRef((props: any, ref: ForwardedRef<any>) => {
firstRender.current = false; firstRender.current = false;
} else { } else {
setRipples( setRipples(
RippleEffectBuild(props.children, LifetimeEnd, ripples) RippleEffectBuild(props.children, LifetimeEnd, ripples),
); );
} }
}); });
@ -51,7 +54,10 @@ const Ripples = forwardRef((props: any, ref: ForwardedRef<any>) => {
return <>{Object.values(ripples)}</>; return <>{Object.values(ripples)}</>;
}); });
const Ripple = forwardRef((props: rippleProps, ref: ForwardedRef<any>) => { const Ripple = forwardRef(function Ripple(
props: rippleProps,
ref: ForwardedRef<any>,
) {
const { rippleX, rippleY, rippleS, endLifetime, lifetime } = props; const { rippleX, rippleY, rippleS, endLifetime, lifetime } = props;
const clicked = useContext<boolean>(rippleAreaContext); const clicked = useContext<boolean>(rippleAreaContext);

View File

@ -1,6 +1,6 @@
import {Dispatch, SetStateAction, PropsWithChildren} from 'react'; import { Dispatch, SetStateAction } from 'react';
export interface IRippleProps { export interface IRippleProps extends PropsWithChildren<any> {
centralRipple?: boolean; centralRipple?: boolean;
} }
@ -13,7 +13,9 @@ export type rippleProps = {
rippleX: number; rippleX: number;
rippleY: number; rippleY: number;
rippleS: number; rippleS: number;
endLifetime?: any; endLifetime?: () => void;
lifetime: number; lifetime: number;
key?: number; key?: number;
}; };
import { PropsWithChildren } from 'react';

View File

@ -3,13 +3,13 @@ import {cloneElement, ReactElement} from 'react';
export default function ArrayConvertToObj( export default function ArrayConvertToObj(
obj: Object, obj: Object,
nextChildren: ReactElement[], nextChildren: ReactElement[],
callback: (child: any) => void callback: (child: any) => void,
): void { ): void {
Object.values(nextChildren).forEach( Object.values(nextChildren).forEach(
(child: JSX.Element) => (child: JSX.Element) =>
(obj[child.key] = cloneElement(child, { (obj[child.key] = cloneElement(child, {
...child.props, ...child.props,
endLifetime: callback.bind(null, child), endLifetime: callback.bind(null, child),
})) })),
); );
} }

View File

@ -1,27 +1,26 @@
import isEmpty from './utils';
import {cloneElement, ReactElement} from 'react';
import ArrayConvertToObj from './array-convert-to-obj'; import ArrayConvertToObj from './array-convert-to-obj';
import { cloneElement, ReactElement } from 'react';
import isEmpty from './utils';
export default function RippleEffectBuild( export default function RippleEffectBuild(
nextRipples: ReactElement[], nextRipples: ReactElement[],
callback: (child: any) => void, callback: (child: any) => void,
prevRipples?: any | null prevRipples?: any | null,
) { ) {
const next: object = {};
const empty: boolean = isEmpty(prevRipples); const empty: boolean = isEmpty(prevRipples);
const preparedRipples: object = empty ? {} : prevRipples; const preparedRipples: object = empty ? {} : prevRipples;
console.log(preparedRipples);
switch (empty) { switch (empty) {
case true: case true:
ArrayConvertToObj(preparedRipples, nextRipples, callback); ArrayConvertToObj(preparedRipples, nextRipples, callback);
break; break;
case false: case false:
// eslint-disable-next-line no-case-declarations
const next: object = {};
ArrayConvertToObj(next, nextRipples, callback); ArrayConvertToObj(next, nextRipples, callback);
for (const rippleKey of Object.keys(next)) { for (const rippleKey of Object.keys(next)) {
if (preparedRipples[rippleKey] === undefined) { if (preparedRipples[rippleKey] == undefined) {
preparedRipples[rippleKey] = cloneElement(next[rippleKey], { preparedRipples[rippleKey] = cloneElement(next[rippleKey], {
...next[rippleKey].props, ...next[rippleKey].props,
endLifetime: callback.bind(null, next[rippleKey]), endLifetime: callback.bind(null, next[rippleKey]),
@ -30,5 +29,6 @@ export default function RippleEffectBuild(
} }
break; break;
} }
return preparedRipples; return preparedRipples;
} }

View File

@ -1,4 +1,6 @@
export default function isEmpty(obj: Object): boolean { export default function isEmpty(obj: Object): boolean {
for (const _i in obj) return false; for (const _i in obj) {
return false;
}
return true; return true;
} }

View File

@ -1,5 +1,7 @@
import React, {ForwardedRef, forwardRef} from 'react'; 'use client';
import {switchMainProps} from './switch.types';
import React, { forwardRef } from 'react';
import { SwitchMainProps } from './switch.types';
import { CheckBoxLayout } from '../checkbox-layout/check-box-layout'; import { CheckBoxLayout } from '../checkbox-layout/check-box-layout';
/** /**
@ -7,18 +9,14 @@ import {CheckBoxLayout} from '../checkbox-layout/check-box-layout';
** description ** description
*/ */
export const Switch = forwardRef( export const Switch = forwardRef<HTMLInputElement, SwitchMainProps>(
( ({ icon, disabled, selected = false, ...props }, ref) => (
{icon, disabled, selected = false, ...props}: switchMainProps, <div className={'m3 m3-switch-exp'} ref={ref}>
ref: ForwardedRef<HTMLInputElement>
) => (
<div className={'m3 m3-switch-exp'}>
<CheckBoxLayout <CheckBoxLayout
{...props} {...props}
ref={ref}
type={'checkbox'}
disabled={disabled}
className={`m3 ${props.className ?? ''}`.trimEnd()} className={`m3 ${props.className ?? ''}`.trimEnd()}
disabled={disabled}
type={'checkbox'}
/> />
<svg> <svg>
<rect className={'m3 m3-switch-track'} /> <rect className={'m3 m3-switch-track'} />
@ -34,5 +32,5 @@ export const Switch = forwardRef(
</g> </g>
</svg> </svg>
</div> </div>
) ),
); );

View File

@ -1,6 +1,6 @@
import { PropsWithChildren } from 'react'; import { PropsWithChildren } from 'react';
export interface switchMainProps extends PropsWithChildren<any> { export interface SwitchMainProps extends PropsWithChildren<any> {
disabled?: boolean; disabled?: boolean;
icon?: boolean; icon?: boolean;
selected?: boolean; selected?: boolean;

View File

@ -1,26 +1,34 @@
'use client'; 'use client';
import React, {useState} from 'react'; import React, { forwardRef, useState } from 'react';
import { bool, string } from 'prop-types'; import { bool, string } from 'prop-types';
import { type TextFieldInterface } from './text-field.types'; import { type TextFieldInterface } from './text-field.types';
export function TextField({ export const TextField = forwardRef<HTMLInputElement, TextFieldInterface>(
(
{
variant = 'filled', variant = 'filled',
withAfterIcon, withAfterIcon,
withBeforeIcon, withBeforeIcon,
supportingText, supportingText,
...props ...props
}: TextFieldInterface) { },
const [raised, setRaised] = useState<boolean>(props.placeholder ?? false); ref,
) => {
const [raised, setRaised] = useState<boolean>(
props.placeholder ?? false,
);
const callback = (e: any) => { const callback = (e: any): void => {
if ( if (
e.type === 'blur' && e.type === 'blur' &&
e.target.value.length === 0 && e.target.value.length === 0 &&
!props.placeholder !props.placeholder
) ) {
setRaised(false); setRaised(false);
else if (e.type === 'focus') setRaised(true); } else if (e.type === 'focus') {
setRaised(true);
}
}; };
const iconStyles = const iconStyles =
@ -48,15 +56,20 @@ export function TextField({
</span> </span>
)} )}
<input <input
ref={ref}
{...props} {...props}
className={`${props.className ?? ''} ${iconStyles}`.trim()} className={`${props.className ?? ''} ${iconStyles}`.trim()}
onFocus={event => {
callback(event);
if (props.onFocus) props.onFocus(event);
}}
onBlur={event => { onBlur={event => {
callback(event); callback(event);
if (props.onBlur) props.onBlur(event); if (props.onBlur) {
props.onBlur(event);
}
}}
onFocus={event => {
callback(event);
if (props.onFocus) {
props.onFocus(event);
}
}} }}
/> />
<label className={raised ? 'raised' : ''}> <label className={raised ? 'raised' : ''}>
@ -69,14 +82,15 @@ export function TextField({
</span> </span>
)} )}
</div> </div>
{supportingText && ( {supportingText !== '' && (
<span className={'m3-text-field-supporting-text'}> <span className={'m3-text-field-supporting-text'}>
{supportingText} {supportingText}
</span> </span>
)} )}
</span> </span>
); );
} },
);
TextField.propTypes = { TextField.propTypes = {
children: string, children: string,

View File

@ -1,5 +1,8 @@
button:not(.m3-fab, .m3-icon-button) { button:not(.m3-fab, .m3-icon-button) {
transition: background-color, box-shadow, 0.2s cubic-bezier(0.2, 0, 0, 1) !important; transition:
background-color,
box-shadow,
0.2s cubic-bezier(0.2, 0, 0, 1) !important;
font-family: var(--md-sys-typescale-label-large-font-family-name); font-family: var(--md-sys-typescale-label-large-font-family-name);
font-size: var(--md-sys-typescale-label-large-font-size); font-size: var(--md-sys-typescale-label-large-font-size);
font-weight: var(--md-sys-typescale-label-large-font-weight); font-weight: var(--md-sys-typescale-label-large-font-weight);
@ -22,7 +25,8 @@ button:not(.m3-fab, .m3-icon-button).m3 {
button:not(.m3-fab, .m3-icon-button).filled { button:not(.m3-fab, .m3-icon-button).filled {
background-color: var(--md-sys-color-primary); background-color: var(--md-sys-color-primary);
} }
button:not(.m3-fab, .m3-icon-button).filled, button:not(.m3-fab, .m3-icon-button).filled > svg.m3-svg-icon { button:not(.m3-fab, .m3-icon-button).filled,
button:not(.m3-fab, .m3-icon-button).filled > svg.m3-svg-icon {
color: var(--md-sys-color-on-primary); color: var(--md-sys-color-on-primary);
fill: var(--md-sys-color-on-primary); fill: var(--md-sys-color-on-primary);
} }
@ -44,7 +48,9 @@ button:not(.m3-fab, .m3-icon-button).text > svg.m3-svg-icon {
fill: var(--md-sys-color-primary); fill: var(--md-sys-color-primary);
} }
button:not(.m3-fab, .m3-icon-button).elevated { button:not(.m3-fab, .m3-icon-button).elevated {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3); box-shadow:
0 1px 3px 1px rgba(0, 0, 0, 0.15),
0 1px 2px 0 rgba(0, 0, 0, 0.3);
background-color: var(--md-sys-color-surface-container-low); background-color: var(--md-sys-color-surface-container-low);
color: var(--md-sys-color-primary); color: var(--md-sys-color-primary);
} }
@ -59,7 +65,10 @@ button:not(.m3-fab, .m3-icon-button).tonal > svg.m3-svg-icon {
fill: var(--md-sys-color-on-secondary-container); fill: var(--md-sys-color-on-secondary-container);
} }
button:not(.m3-fab, .m3-icon-button)::before { button:not(.m3-fab, .m3-icon-button)::before {
transition: background-color, box-shadow, 0.2s cubic-bezier(0.2, 0, 0, 1) !important; transition:
background-color,
box-shadow,
0.2s cubic-bezier(0.2, 0, 0, 1) !important;
content: ""; content: "";
top: 0; top: 0;
bottom: 0; bottom: 0;
@ -68,65 +77,130 @@ button:not(.m3-fab, .m3-icon-button)::before {
position: absolute; position: absolute;
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
} }
button:not(.m3-fab, .m3-icon-button).filled > .m3.m3-ripple-domain > .m3.ripple { button:not(.m3-fab, .m3-icon-button).filled
background: color-mix(in srgb, var(--md-sys-color-on-primary) 12%, transparent); > .m3.m3-ripple-domain
> .m3.ripple {
background: color-mix(
in srgb,
var(--md-sys-color-on-primary) 12%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):is(.outlined, .text, .elevated) > .m3.m3-ripple-domain > .m3.ripple { button:not(.m3-fab, .m3-icon-button):is(.outlined, .text, .elevated)
> .m3.m3-ripple-domain
> .m3.ripple {
background: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); background: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
} }
button:not(.m3-fab, .m3-icon-button).tonal > .m3.m3-ripple-domain > .m3.ripple { button:not(.m3-fab, .m3-icon-button).tonal > .m3.m3-ripple-domain > .m3.ripple {
background: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 12%, transparent); background: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 12%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):active:is(.filled, .tonal) { button:not(.m3-fab, .m3-icon-button):active:is(.filled, .tonal) {
box-shadow: none !important; box-shadow: none !important;
} }
button:not(.m3-fab, .m3-icon-button):active.elevated { button:not(.m3-fab, .m3-icon-button):active.elevated {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3) !important; box-shadow:
0 1px 3px 1px rgba(0, 0, 0, 0.15),
0 1px 2px 0 rgba(0, 0, 0, 0.3) !important;
} }
button:not(.m3-fab, .m3-icon-button):active.tonal::before { button:not(.m3-fab, .m3-icon-button):active.tonal::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 12%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):focus-visible.outlined { button:not(.m3-fab, .m3-icon-button):focus-visible.outlined {
border-color: var(--md-sys-color-primary) !important; border-color: var(--md-sys-color-primary) !important;
} }
button:not(.m3-fab, .m3-icon-button):focus-visible.filled::before { button:not(.m3-fab, .m3-icon-button):focus-visible.filled::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-primary) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-primary) 12%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):focus-visible:is(.outlined, .text, .elevated)::before { button:not(.m3-fab, .m3-icon-button):focus-visible:is(
background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); .outlined,
.text,
.elevated
)::before {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 12%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):focus-visible.tonal::before { button:not(.m3-fab, .m3-icon-button):focus-visible.tonal::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 12%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):hover:is(.filled, .tonal) { button:not(.m3-fab, .m3-icon-button):hover:is(.filled, .tonal) {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3); box-shadow:
0 1px 3px 1px rgba(0, 0, 0, 0.15),
0 1px 2px 0 rgba(0, 0, 0, 0.3);
} }
button:not(.m3-fab, .m3-icon-button):hover.elevated { button:not(.m3-fab, .m3-icon-button):hover.elevated {
box-shadow: 0 2px 6px 2px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3); box-shadow:
0 2px 6px 2px rgba(0, 0, 0, 0.15),
0 1px 2px 0 rgba(0, 0, 0, 0.3);
} }
button:not(.m3-fab, .m3-icon-button):hover.filled::before { button:not(.m3-fab, .m3-icon-button):hover.filled::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-primary) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-primary) 8%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):hover:is(.outlined, .text, .elevated)::before { button:not(.m3-fab, .m3-icon-button):hover:is(
background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); .outlined,
.text,
.elevated
)::before {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 8%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):hover.tonal::before { button:not(.m3-fab, .m3-icon-button):hover.tonal::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 8%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):disabled { button:not(.m3-fab, .m3-icon-button):disabled {
pointer-events: none; pointer-events: none;
} }
button:not(.m3-fab, .m3-icon-button):disabled:is(.filled, .elevated, .tonal, .outlined, .text) { button:not(.m3-fab, .m3-icon-button):disabled:is(
.filled,
.elevated,
.tonal,
.outlined,
.text
) {
color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
} }
button:not(.m3-fab, .m3-icon-button):disabled:is(.filled, .elevated, .tonal) { button:not(.m3-fab, .m3-icon-button):disabled:is(.filled, .elevated, .tonal) {
background: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); background: color-mix(
in srgb,
var(--md-sys-color-on-surface) 12%,
transparent
);
} }
button:not(.m3-fab, .m3-icon-button):disabled.elevated { button:not(.m3-fab, .m3-icon-button):disabled.elevated {
box-shadow: none; box-shadow: none;
} }
button:not(.m3-fab, .m3-icon-button):disabled.outlined { button:not(.m3-fab, .m3-icon-button):disabled.outlined {
outline: 1px solid color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent) !important; outline: 1px solid
color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent) !important;
} }
/*# sourceMappingURL=button.css.map */ /*# sourceMappingURL=button.css.map */

View File

@ -22,7 +22,7 @@ span.m3.m3-checkbox-ripple-layer {
height: 2.5rem; height: 2.5rem;
} }
input[type=checkbox].m3.m3-checkbox { input[type="checkbox"].m3.m3-checkbox {
appearance: none; appearance: none;
display: flex; display: flex;
align-items: center; align-items: center;
@ -37,67 +37,154 @@ input[type=checkbox].m3.m3-checkbox {
outline: 0.14rem solid var(--md-sys-color-on-surface-variant); outline: 0.14rem solid var(--md-sys-color-on-surface-variant);
transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1); transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1);
} }
input[type=checkbox].m3.m3-checkbox:is(:user-invalid:is(:checked, :indeterminate), .m3.m3-error:is(:checked, :indeterminate)) { input[type="checkbox"].m3.m3-checkbox:is(
:user-invalid:is(:checked, :indeterminate),
.m3.m3-error:is(:checked, :indeterminate)
) {
outline-color: var(--md-sys-color-error); outline-color: var(--md-sys-color-error);
background-color: var(--md-sys-color-error); background-color: var(--md-sys-color-error);
} }
input[type=checkbox].m3.m3-checkbox:is(.m3.m3-error, :user-invalid) { input[type="checkbox"].m3.m3-checkbox:is(.m3.m3-error, :user-invalid) {
outline-color: var(--md-sys-color-error); outline-color: var(--md-sys-color-error);
} }
input[type=checkbox].m3.m3-checkbox:is(:checked:is(:hover, input[type=checkbox].m3.m3-checkbox):not(.m3.m3-error, :disabled), :indeterminate:is(:hover, input[type=checkbox].m3.m3-checkbox):not(.m3.m3-error, :disabled)) { input[type="checkbox"].m3.m3-checkbox:is(
:checked:is(:hover, input[type="checkbox"].m3.m3-checkbox):not(
.m3.m3-error,
:disabled
),
:indeterminate:is(:hover, input[type="checkbox"].m3.m3-checkbox):not(
.m3.m3-error,
:disabled
)
) {
outline-color: var(--md-sys-color-primary); outline-color: var(--md-sys-color-primary);
background-color: var(--md-sys-color-primary); background-color: var(--md-sys-color-primary);
} }
input[type=checkbox].m3.m3-checkbox:disabled:is(:hover, input[type=checkbox].m3.m3-checkbox:disabled) { input[type="checkbox"].m3.m3-checkbox:disabled:is(
:hover,
input[type="checkbox"].m3.m3-checkbox:disabled
) {
opacity: 38%; opacity: 38%;
border: 2px solid var(--md-sys-color-on-surface); border: 2px solid var(--md-sys-color-on-surface);
} }
input[type=checkbox].m3.m3-checkbox:disabled:checked:is(:hover, input[type=checkbox].m3.m3-checkbox:disabled) { input[type="checkbox"].m3.m3-checkbox:disabled:checked:is(
:hover,
input[type="checkbox"].m3.m3-checkbox:disabled
) {
opacity: 38%; opacity: 38%;
background-color: var(--md-sys-color-on-surface); background-color: var(--md-sys-color-on-surface);
} }
input[type=checkbox].m3.m3-checkbox::after { input[type="checkbox"].m3.m3-checkbox::after {
line-height: 1.125rem; line-height: 1.125rem;
font-family: Material-Symbols-Outlined-Regular, sans-serif; font-family: Material-Symbols-Outlined-Regular, sans-serif;
font-weight: 700; font-weight: 700;
font-size: 1.125rem; font-size: 1.125rem;
color: var(--md-sys-color-on-primary); color: var(--md-sys-color-on-primary);
} }
input[type=checkbox].m3.m3-checkbox:checked::after { input[type="checkbox"].m3.m3-checkbox:checked::after {
content: "done"; content: "done";
} }
input[type=checkbox].m3.m3-checkbox:indeterminate::after { input[type="checkbox"].m3.m3-checkbox:indeterminate::after {
content: "check_indeterminate_small"; content: "check_indeterminate_small";
} }
input[type=checkbox].m3.m3-checkbox:hover { input[type="checkbox"].m3.m3-checkbox:hover {
outline-color: var(--md-sys-color-on-surface); outline-color: var(--md-sys-color-on-surface);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):is(:user-invalid:is(:hover, :indeterminate:hover), .m3.m3-error:hover) + span.m3.m3-checkbox-state-layer { input[type="checkbox"].m3.m3-checkbox:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-error) 8%, transparent); :user-invalid:is(:hover, :indeterminate:hover),
.m3.m3-error:hover
)
+ span.m3.m3-checkbox-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-error) 8%,
transparent
);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):is(:user-invalid:is(:active, :indeterminate:active), .m3.m3-error:active) + span.m3.m3-checkbox-state-layer { input[type="checkbox"].m3.m3-checkbox:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-error) 12%, transparent); :user-invalid:is(:active, :indeterminate:active),
.m3.m3-error:active
)
+ span.m3.m3-checkbox-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-error) 12%,
transparent
);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):is(:user-invalid:is(:active, :indeterminate:active), .m3.m3-error:active) + span.m3.m3-checkbox-state-layer + span.m3-ripple-domain > .m3.ripple { input[type="checkbox"].m3.m3-checkbox:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-error) 20%, transparent); :user-invalid:is(:active, :indeterminate:active),
.m3.m3-error:active
)
+ span.m3.m3-checkbox-state-layer
+ span.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-error) 20%,
transparent
);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):is(:checked:hover, :indeterminate:hover) + span.m3.m3-checkbox-state-layer { input[type="checkbox"].m3.m3-checkbox:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); :checked:hover,
:indeterminate:hover
)
+ span.m3.m3-checkbox-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 8%,
transparent
);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):is(:checked:active, :indeterminate:active) + span.m3.m3-checkbox-state-layer { input[type="checkbox"].m3.m3-checkbox:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); :checked:active,
:indeterminate:active
)
+ span.m3.m3-checkbox-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 12%,
transparent
);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):is(:checked:active, :indeterminate:active) + span.m3.m3-checkbox-state-layer + span.m3-ripple-domain > .m3.ripple { input[type="checkbox"].m3.m3-checkbox:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 20%, transparent); :checked:active,
:indeterminate:active
)
+ span.m3.m3-checkbox-state-layer
+ span.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 20%,
transparent
);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):hover + span.m3-checkbox-state-layer { input[type="checkbox"].m3.m3-checkbox:not(:disabled):hover
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + span.m3-checkbox-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 8%,
transparent
);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):active + span.m3.m3-checkbox-state-layer { input[type="checkbox"].m3.m3-checkbox:not(:disabled):active
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); + span.m3.m3-checkbox-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 12%,
transparent
);
} }
input[type=checkbox].m3.m3-checkbox:not(:disabled):active + span.m3.m3-checkbox-state-layer + span.m3-ripple-domain > .m3.ripple { input[type="checkbox"].m3.m3-checkbox:not(:disabled):active
background-color: color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent); + span.m3.m3-checkbox-state-layer
+ span.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 20%,
transparent
);
} }
/*# sourceMappingURL=checkbox.css.map */ /*# sourceMappingURL=checkbox.css.map */

View File

@ -9,7 +9,8 @@ hr.m3.m3-divider {
hr.m3.m3-divider.vertical { hr.m3.m3-divider.vertical {
writing-mode: tb-rl; writing-mode: tb-rl;
} }
hr.m3.m3-divider.vertical, hr.m3.m3-divider.vertical.full-width { hr.m3.m3-divider.vertical,
hr.m3.m3-divider.vertical.full-width {
height: 100%; height: 100%;
} }
hr.m3.m3-divider.vertical.inset { hr.m3.m3-divider.vertical.inset {
@ -19,7 +20,8 @@ hr.m3.m3-divider.vertical.inset {
hr.m3.m3-divider.vertical.middle-inset { hr.m3.m3-divider.vertical.middle-inset {
height: calc(100% - 32px); height: calc(100% - 32px);
} }
hr.m3.m3-divider.horizontal, hr.m3.m3-divider.horizontal.full-width { hr.m3.m3-divider.horizontal,
hr.m3.m3-divider.horizontal.full-width {
width: 100%; width: 100%;
} }
hr.m3.m3-divider.horizontal.inset { hr.m3.m3-divider.horizontal.inset {

View File

@ -1,21 +1,31 @@
.elevation-1 { .elevation-1 {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3); box-shadow:
0 1px 3px 1px rgba(0, 0, 0, 0.15),
0 1px 2px 0 rgba(0, 0, 0, 0.3);
} }
.elevation-2 { .elevation-2 {
box-shadow: 0 2px 6px 2px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3); box-shadow:
0 2px 6px 2px rgba(0, 0, 0, 0.15),
0 1px 2px 0 rgba(0, 0, 0, 0.3);
} }
.elevation-3 { .elevation-3 {
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15); box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.3),
0 4px 8px 3px rgba(0, 0, 0, 0.15);
} }
.elevation-4 { .elevation-4 {
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.3), 0 6px 10px 4px rgba(0, 0, 0, 0.15); box-shadow:
0 2px 3px 0 rgba(0, 0, 0, 0.3),
0 6px 10px 4px rgba(0, 0, 0, 0.15);
} }
.elevation-5 { .elevation-5 {
box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.3), 0 8px 12px 6px rgba(0, 0, 0, 0.15); box-shadow:
0 4px 4px 0 rgba(0, 0, 0, 0.3),
0 8px 12px 6px rgba(0, 0, 0, 0.15);
} }
/*# sourceMappingURL=elevation.css.map */ /*# sourceMappingURL=elevation.css.map */

View File

@ -1,5 +1,8 @@
button.m3.m3-fab { button.m3.m3-fab {
transition: background-color, box-shadow, 0.2s cubic-bezier(0.2, 0, 0, 1) !important; transition:
background-color,
box-shadow,
0.2s cubic-bezier(0.2, 0, 0, 1) !important;
} }
button.m3.m3-fab > span.m3-icon { button.m3.m3-fab > span.m3-icon {
font-family: Material-Symbols-Outlined-Regular, sans-serif; font-family: Material-Symbols-Outlined-Regular, sans-serif;
@ -16,7 +19,10 @@ button.m3.m3-fab.m3 {
gap: 12px; gap: 12px;
} }
button.m3.m3-fab::before { button.m3.m3-fab::before {
transition: background-color, box-shadow, 0.2s cubic-bezier(0.2, 0, 0, 1) !important; transition:
background-color,
box-shadow,
0.2s cubic-bezier(0.2, 0, 0, 1) !important;
content: ""; content: "";
top: 0; top: 0;
bottom: 0; bottom: 0;
@ -30,7 +36,9 @@ button.m3.m3-fab.surface {
color: var(--md-sys-color-primary); color: var(--md-sys-color-primary);
} }
button.m3.m3-fab.surface:not(.without-elevation) { button.m3.m3-fab.surface:not(.without-elevation) {
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15); box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.3),
0 4px 8px 3px rgba(0, 0, 0, 0.15);
} }
button.m3.m3-fab.surface > svg.m3-svg-icon { button.m3.m3-fab.surface > svg.m3-svg-icon {
fill: var(--md-sys-color-primary); fill: var(--md-sys-color-primary);
@ -43,39 +51,57 @@ button.m3.m3-fab.primary {
color: var(--md-sys-color-on-primary-container); color: var(--md-sys-color-on-primary-container);
} }
button.m3.m3-fab.primary:not(.without-elevation) { button.m3.m3-fab.primary:not(.without-elevation) {
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15); box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.3),
0 4px 8px 3px rgba(0, 0, 0, 0.15);
} }
button.m3.m3-fab.primary > svg.m3-svg-icon { button.m3.m3-fab.primary > svg.m3-svg-icon {
fill: var(--md-sys-color-on-primary-container); fill: var(--md-sys-color-on-primary-container);
} }
button.m3.m3-fab.primary > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-fab.primary > .m3.m3-ripple-domain > .m3.ripple {
background: color-mix(in srgb, var(--md-sys-color-on-primary-container) 12%, transparent); background: color-mix(
in srgb,
var(--md-sys-color-on-primary-container) 12%,
transparent
);
} }
button.m3.m3-fab.secondary { button.m3.m3-fab.secondary {
background-color: var(--md-sys-color-secondary-container); background-color: var(--md-sys-color-secondary-container);
color: var(--md-sys-color-on-secondary-container); color: var(--md-sys-color-on-secondary-container);
} }
button.m3.m3-fab.secondary:not(.without-elevation) { button.m3.m3-fab.secondary:not(.without-elevation) {
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15); box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.3),
0 4px 8px 3px rgba(0, 0, 0, 0.15);
} }
button.m3.m3-fab.secondary > svg.m3-svg-icon { button.m3.m3-fab.secondary > svg.m3-svg-icon {
fill: var(--md-sys-color-on-secondary-container); fill: var(--md-sys-color-on-secondary-container);
} }
button.m3.m3-fab.secondary > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-fab.secondary > .m3.m3-ripple-domain > .m3.ripple {
background: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 12%, transparent); background: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 12%,
transparent
);
} }
button.m3.m3-fab.tertiary { button.m3.m3-fab.tertiary {
background-color: var(--md-sys-color-tertiary-container); background-color: var(--md-sys-color-tertiary-container);
color: var(--md-sys-color-on-tertiary-container); color: var(--md-sys-color-on-tertiary-container);
} }
button.m3.m3-fab.tertiary:not(.without-elevation) { button.m3.m3-fab.tertiary:not(.without-elevation) {
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15); box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.3),
0 4px 8px 3px rgba(0, 0, 0, 0.15);
} }
button.m3.m3-fab.tertiary > svg.m3-svg-icon { button.m3.m3-fab.tertiary > svg.m3-svg-icon {
fill: var(--md-sys-color-on-tertiary-container); fill: var(--md-sys-color-on-tertiary-container);
} }
button.m3.m3-fab.tertiary > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-fab.tertiary > .m3.m3-ripple-domain > .m3.ripple {
background: color-mix(in srgb, var(--md-sys-color-on-tertiary-container) 12%, transparent); background: color-mix(
in srgb,
var(--md-sys-color-on-tertiary-container) 12%,
transparent
);
} }
button.m3.m3-fab.m3-small-fab { button.m3.m3-fab.m3-small-fab {
width: 40px; width: 40px;
@ -105,35 +131,81 @@ button.m3.m3-fab.m3-extended-fab {
padding: 19px; padding: 19px;
font-size: 24px; font-size: 24px;
} }
button.m3.m3-fab:not(.without-elevation):is(.surface, .primary, .secondary, .tertiary):hover { button.m3.m3-fab:not(.without-elevation):is(
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.3), 0 6px 10px 4px rgba(0, 0, 0, 0.15); .surface,
.primary,
.secondary,
.tertiary
):hover {
box-shadow:
0 2px 3px 0 rgba(0, 0, 0, 0.3),
0 6px 10px 4px rgba(0, 0, 0, 0.15);
} }
button.m3.m3-fab:not(.without-elevation):is(.surface, .primary, .secondary, .tertiary):active { button.m3.m3-fab:not(.without-elevation):is(
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 4px 8px 3px rgba(0, 0, 0, 0.15) !important; .surface,
.primary,
.secondary,
.tertiary
):active {
box-shadow:
0 1px 3px 0 rgba(0, 0, 0, 0.3),
0 4px 8px 3px rgba(0, 0, 0, 0.15) !important;
} }
button.m3.m3-fab:hover.surface::before { button.m3.m3-fab:hover.surface::before {
background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 8%,
transparent
);
} }
button.m3.m3-fab:hover.primary::before { button.m3.m3-fab:hover.primary::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-primary-container) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-primary-container) 8%,
transparent
);
} }
button.m3.m3-fab:hover.secondary::before { button.m3.m3-fab:hover.secondary::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 8%,
transparent
);
} }
button.m3.m3-fab:hover.tertiary::before { button.m3.m3-fab:hover.tertiary::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-tertiary-container) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-tertiary-container) 8%,
transparent
);
} }
button.m3.m3-fab:focus-visible.surface::before { button.m3.m3-fab:focus-visible.surface::before {
background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 12%,
transparent
);
} }
button.m3.m3-fab:focus-visible.primary::before { button.m3.m3-fab:focus-visible.primary::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-primary-container) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-primary-container) 12%,
transparent
);
} }
button.m3.m3-fab:focus-visible.secondary::before { button.m3.m3-fab:focus-visible.secondary::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 12%,
transparent
);
} }
button.m3.m3-fab:focus-visible.tertiary::before { button.m3.m3-fab:focus-visible.tertiary::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-tertiary-container) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-tertiary-container) 12%,
transparent
);
} }
/*# sourceMappingURL=fabs.css.map */ /*# sourceMappingURL=fabs.css.map */

View File

@ -6,23 +6,32 @@ The recommended way to use the Material Icons font is by linking to the web font
```html ```html
<!-- https://material.io/resources/icons/?style=baseline --> <!-- https://material.io/resources/icons/?style=baseline -->
<link href="https://fonts.googleapis.com/css2?family=Material+Icons" <link
rel="stylesheet"> href="https://fonts.googleapis.com/css2?family=Material+Icons"
rel="stylesheet"
/>
<!-- https://material.io/resources/icons/?style=outline --> <!-- https://material.io/resources/icons/?style=outline -->
<link href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined" <link
rel="stylesheet"> href="https://fonts.googleapis.com/css2?family=Material+Icons+Outlined"
rel="stylesheet"
/>
<!-- https://material.io/resources/icons/?style=round --> <!-- https://material.io/resources/icons/?style=round -->
<link href="https://fonts.googleapis.com/css2?family=Material+Icons+Round" <link
rel="stylesheet"> href="https://fonts.googleapis.com/css2?family=Material+Icons+Round"
rel="stylesheet"
/>
<!-- https://material.io/resources/icons/?style=sharp --> <!-- https://material.io/resources/icons/?style=sharp -->
<link href="https://fonts.googleapis.com/css2?family=Material+Icons+Sharp" <link
rel="stylesheet"> href="https://fonts.googleapis.com/css2?family=Material+Icons+Sharp"
rel="stylesheet"
/>
<!-- https://material.io/resources/icons/?style=twotone --> <!-- https://material.io/resources/icons/?style=twotone -->
<link href="https://fonts.googleapis.com/css2?family=Material+Icons+Two+Tone" <link
rel="stylesheet"> href="https://fonts.googleapis.com/css2?family=Material+Icons+Two+Tone"
rel="stylesheet"
/>
``` ```

View File

@ -1,17 +1,20 @@
@font-face { @font-face {
font-family: Material-Symbols-Rounded-Regular; font-family: Material-Symbols-Rounded-Regular;
src: url("./font/MaterialSymbolsRounded[FILL,GRAD,opsz,wght].ttf"); src: url("./font/MaterialSymbolsRounded[FILL,GRAD,opsz,wght].ttf");
src: url("./font/MaterialSymbolsRounded[FILL,GRAD,opsz,wght].woff2") format("woff2"); src: url("./font/MaterialSymbolsRounded[FILL,GRAD,opsz,wght].woff2")
format("woff2");
} }
@font-face { @font-face {
font-family: Material-Symbols-Outlined-Regular; font-family: Material-Symbols-Outlined-Regular;
src: url("./font/MaterialSymbolsOutlined[FILL,GRAD,opsz,wght].ttf"); src: url("./font/MaterialSymbolsOutlined[FILL,GRAD,opsz,wght].ttf");
src: url("./font/MaterialSymbolsOutlined[FILL,GRAD,opsz,wght].woff2") format("woff2"); src: url("./font/MaterialSymbolsOutlined[FILL,GRAD,opsz,wght].woff2")
format("woff2");
} }
@font-face { @font-face {
font-family: Material-Symbols-Sharp-Regular; font-family: Material-Symbols-Sharp-Regular;
src: url("./font/MaterialSymbolsSharp[FILL,GRAD,opsz,wght].ttf"); src: url("./font/MaterialSymbolsSharp[FILL,GRAD,opsz,wght].ttf");
src: url("./font/MaterialSymbolsSharp[FILL,GRAD,opsz,wght].woff2") format("woff2"); src: url("./font/MaterialSymbolsSharp[FILL,GRAD,opsz,wght].woff2")
format("woff2");
} }
@font-face { @font-face {
font-family: Roboto; font-family: Roboto;

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,8 @@
button.m3.m3-icon-button { button.m3.m3-icon-button {
transition: background-color, box-shadow, 0.2s cubic-bezier(0.2, 0, 0, 1) !important; transition:
background-color,
box-shadow,
0.2s cubic-bezier(0.2, 0, 0, 1) !important;
contain: content; contain: content;
border-radius: 50%; border-radius: 50%;
position: relative; position: relative;
@ -13,7 +16,10 @@ button.m3.m3-icon-button {
padding: 0; padding: 0;
} }
button.m3.m3-icon-button::before { button.m3.m3-icon-button::before {
transition: background-color, box-shadow, 0.2s cubic-bezier(0.2, 0, 0, 1) !important; transition:
background-color,
box-shadow,
0.2s cubic-bezier(0.2, 0, 0, 1) !important;
content: ""; content: "";
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -22,14 +28,24 @@ button.m3.m3-icon-button::before {
button.m3.m3-icon-button > span.m3-icon { button.m3.m3-icon-button > span.m3-icon {
z-index: 25; z-index: 25;
font-size: 2em; font-size: 2em;
font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 48; font-variation-settings:
"FILL" 0,
"wght" 500,
"GRAD" 0,
"opsz" 48;
} }
button.m3.m3-icon-button.default { button.m3.m3-icon-button.default {
fill: var(--md-sys-color-on-surface-variant); fill: var(--md-sys-color-on-surface-variant);
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
} }
button.m3.m3-icon-button.default:disabled, button.m3.m3-icon-button.default.selected:disabled, button.m3.m3-icon-button.default.selected.toggled:disabled { button.m3.m3-icon-button.default:disabled,
fill: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 38%, transparent); button.m3.m3-icon-button.default.selected:disabled,
button.m3.m3-icon-button.default.selected.toggled:disabled {
fill: color-mix(
in srgb,
var(--md-sys-color-on-surface-variant) 38%,
transparent
);
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
} }
button.m3.m3-icon-button.default.selected.toggled { button.m3.m3-icon-button.default.selected.toggled {
@ -51,13 +67,18 @@ button.m3.m3-icon-button.tonal.toggled {
fill: var(--md-sys-color-on-surface-variant); fill: var(--md-sys-color-on-surface-variant);
background-color: var(--md-sys-color-surface-container-highest); background-color: var(--md-sys-color-surface-container-highest);
} }
button.m3.m3-icon-button.tonal.selected.toggled, button.m3.m3-icon-button.tonal { button.m3.m3-icon-button.tonal.selected.toggled,
button.m3.m3-icon-button.tonal {
fill: var(--md-sys-color-on-secondary-container); fill: var(--md-sys-color-on-secondary-container);
background-color: var(--md-sys-color-secondary-container); background-color: var(--md-sys-color-secondary-container);
} }
button.m3.m3-icon-button:is(.tonal, .filled, .toggled.selected):disabled { button.m3.m3-icon-button:is(.tonal, .filled, .toggled.selected):disabled {
fill: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); fill: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 12%,
transparent
);
} }
button.m3.m3-icon-button.outlined { button.m3.m3-icon-button.outlined {
border: 1px solid var(--md-sys-color-outline); border: 1px solid var(--md-sys-color-outline);
@ -65,70 +86,183 @@ button.m3.m3-icon-button.outlined {
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
} }
button.m3.m3-icon-button.outlined:disabled { button.m3.m3-icon-button.outlined:disabled {
border: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 12%, transparent); border: 1px solid
fill: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 38%, transparent); color-mix(in srgb, var(--md-sys-color-outline) 12%, transparent);
fill: color-mix(
in srgb,
var(--md-sys-color-on-surface-variant) 38%,
transparent
);
background-color: rgba(0, 0, 0, 0); background-color: rgba(0, 0, 0, 0);
} }
button.m3.m3-icon-button.outlined.toggled.selected:disabled { button.m3.m3-icon-button.outlined.toggled.selected:disabled {
border: 1px solid color-mix(in srgb, var(--md-sys-color-outline) 0%, transparent); border: 1px solid
color-mix(in srgb, var(--md-sys-color-outline) 0%, transparent);
fill: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); fill: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 12%,
transparent
);
} }
button.m3.m3-icon-button.outlined.selected.toggled { button.m3.m3-icon-button.outlined.selected.toggled {
border: 1px solid rgba(0, 0, 0, 0); border: 1px solid rgba(0, 0, 0, 0);
background-color: var(--md-sys-color-inverse-surface); background-color: var(--md-sys-color-inverse-surface);
fill: var(--md-sys-color-inverse-on-surface); fill: var(--md-sys-color-inverse-on-surface);
} }
button.m3.m3-icon-button.filled:not(:disabled) > .m3.m3-ripple-domain > .m3.ripple, button.m3.m3-icon-button.filled:not(:disabled).selected.toggled > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-icon-button.filled:not(:disabled)
background-color: color-mix(in srgb, var(--md-sys-color-on-primary) 12%, transparent); > .m3.m3-ripple-domain
> .m3.ripple,
button.m3.m3-icon-button.filled:not(:disabled).selected.toggled
> .m3.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-primary) 12%,
transparent
);
} }
button.m3.m3-icon-button.filled:not(:disabled).toggled > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-icon-button.filled:not(:disabled).toggled
background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); > .m3.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 12%,
transparent
);
} }
button.m3.m3-icon-button:is(.outlined, .default):not(:disabled) > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-icon-button:is(.outlined, .default):not(:disabled)
background-color: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 12%, transparent); > .m3.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface-variant) 12%,
transparent
);
} }
button.m3.m3-icon-button:is(.outlined, .default):not(:disabled):not(.outlined).toggled.selected > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-icon-button:is(.outlined, .default):not(:disabled):not(
background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); .outlined
).toggled.selected
> .m3.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 12%,
transparent
);
} }
button.m3.m3-icon-button:is(.outlined, .default):not(:disabled):not(.default).toggled.selected > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-icon-button:is(.outlined, .default):not(:disabled):not(
background-color: color-mix(in srgb, var(--md-sys-color-inverse-on-surface) 12%, transparent); .default
).toggled.selected
> .m3.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-inverse-on-surface) 12%,
transparent
);
} }
button.m3.m3-icon-button.tonal:not(:disabled) > .m3.m3-ripple-domain > .m3.ripple, button.m3.m3-icon-button.tonal:not(:disabled).selected.toggled > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-icon-button.tonal:not(:disabled)
background-color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 12%, transparent); > .m3.m3-ripple-domain
> .m3.ripple,
button.m3.m3-icon-button.tonal:not(:disabled).selected.toggled
> .m3.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 12%,
transparent
);
} }
button.m3.m3-icon-button.tonal:not(:disabled).toggled > .m3.m3-ripple-domain > .m3.ripple { button.m3.m3-icon-button.tonal:not(:disabled).toggled
background-color: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 12%, transparent); > .m3.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface-variant) 12%,
transparent
);
} }
button.m3.m3-icon-button:hover:not(:disabled):is(.default, .outlined)::before { button.m3.m3-icon-button:hover:not(:disabled):is(.default, .outlined)::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface-variant) 8%,
transparent
);
} }
button.m3.m3-icon-button:hover:not(:disabled).filled::before, button.m3.m3-icon-button:hover:not(:disabled).filled.toggled.selected::before { button.m3.m3-icon-button:hover:not(:disabled).filled::before,
background-color: color-mix(in srgb, var(--md-sys-color-on-primary) 8%, transparent); button.m3.m3-icon-button:hover:not(:disabled).filled.toggled.selected::before {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-primary) 8%,
transparent
);
} }
button.m3.m3-icon-button:hover:not(:disabled).filled.toggled::before { button.m3.m3-icon-button:hover:not(:disabled).filled.toggled::before {
background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 8%,
transparent
);
} }
button.m3.m3-icon-button:hover:not(:disabled).tonal::before, button.m3.m3-icon-button:hover:not(:disabled).tonal.toggled.selected::before { button.m3.m3-icon-button:hover:not(:disabled).tonal::before,
background-color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 8%, transparent); button.m3.m3-icon-button:hover:not(:disabled).tonal.toggled.selected::before {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 8%,
transparent
);
} }
button.m3.m3-icon-button:hover:not(:disabled).tonal.toggled::before { button.m3.m3-icon-button:hover:not(:disabled).tonal.toggled::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface-variant) 8%,
transparent
);
} }
button.m3.m3-icon-button:focus-visible:not(:disabled):is(.default, .outlined)::before { button.m3.m3-icon-button:focus-visible:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 12%, transparent); .default,
.outlined
)::before {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface-variant) 12%,
transparent
);
} }
button.m3.m3-icon-button:focus-visible:not(:disabled).filled::before, button.m3.m3-icon-button:focus-visible:not(:disabled).filled.toggled.selected::before { button.m3.m3-icon-button:focus-visible:not(:disabled).filled::before,
background-color: color-mix(in srgb, var(--md-sys-color-on-primary) 12%, transparent); button.m3.m3-icon-button:focus-visible:not(
:disabled
).filled.toggled.selected::before {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-primary) 12%,
transparent
);
} }
button.m3.m3-icon-button:focus-visible:not(:disabled).filled.toggled::before { button.m3.m3-icon-button:focus-visible:not(:disabled).filled.toggled::before {
background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 12%,
transparent
);
} }
button.m3.m3-icon-button:focus-visible:not(:disabled).tonal::before, button.m3.m3-icon-button:focus-visible:not(:disabled).tonal.toggled.selected::before { button.m3.m3-icon-button:focus-visible:not(:disabled).tonal::before,
background-color: color-mix(in srgb, var(--md-sys-color-on-secondary-container) 12%, transparent); button.m3.m3-icon-button:focus-visible:not(
:disabled
).tonal.toggled.selected::before {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-secondary-container) 12%,
transparent
);
} }
button.m3.m3-icon-button:focus-visible:not(:disabled).tonal.toggled::before { button.m3.m3-icon-button:focus-visible:not(:disabled).tonal.toggled::before {
background-color: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 12%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface-variant) 12%,
transparent
);
} }
/*# sourceMappingURL=icon-button.css.map */ /*# sourceMappingURL=icon-button.css.map */

View File

@ -1,3 +1 @@
/*# sourceMappingURL=m3-mixins.css.map */ /*# sourceMappingURL=m3-mixins.css.map */

View File

@ -13,7 +13,7 @@ label.m3.m3-radio-label > span.m3.m3-radio-state-layer {
transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1); transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1);
} }
input[type=radio].m3.m3-radio { input[type="radio"].m3.m3-radio {
appearance: none; appearance: none;
display: flex; display: flex;
align-items: center; align-items: center;
@ -26,44 +26,90 @@ input[type=radio].m3.m3-radio {
border: 2px solid var(--md-sys-color-on-surface-variant); border: 2px solid var(--md-sys-color-on-surface-variant);
transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1); transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1);
} }
input[type=radio].m3.m3-radio::after { input[type="radio"].m3.m3-radio::after {
content: ""; content: "";
width: 10px; width: 10px;
aspect-ratio: 1; aspect-ratio: 1;
border-radius: 50%; border-radius: 50%;
} }
input[type=radio].m3.m3-radio:disabled { input[type="radio"].m3.m3-radio:disabled {
border: 2px solid color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); border: 2px solid
color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
} }
input[type=radio].m3.m3-radio:checked { input[type="radio"].m3.m3-radio:checked {
border: 2px solid var(--md-sys-color-primary); border: 2px solid var(--md-sys-color-primary);
} }
input[type=radio].m3.m3-radio:checked::after { input[type="radio"].m3.m3-radio:checked::after {
background-color: var(--md-sys-color-primary); background-color: var(--md-sys-color-primary);
} }
input[type=radio].m3.m3-radio:checked:disabled { input[type="radio"].m3.m3-radio:checked:disabled {
border: 2px solid color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); border: 2px solid
color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
} }
input[type=radio].m3.m3-radio:checked:disabled::after { input[type="radio"].m3.m3-radio:checked:disabled::after {
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 38%,
transparent
);
} }
input[type=radio].m3.m3-radio:not(:disabled):checked:hover + span.m3.m3-radio-state-layer { input[type="radio"].m3.m3-radio:not(:disabled):checked:hover
background-color: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent); + span.m3.m3-radio-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 8%,
transparent
);
} }
input[type=radio].m3.m3-radio:not(:disabled):is(:checked:active, :indeterminate:active) + span.m3.m3-radio-state-layer { input[type="radio"].m3.m3-radio:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent); :checked:active,
:indeterminate:active
)
+ span.m3.m3-radio-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 12%,
transparent
);
} }
input[type=radio].m3.m3-radio:not(:disabled):is(:checked:active, :indeterminate:active) + span.m3.m3-radio-state-layer + span.m3-ripple-domain > .m3.ripple { input[type="radio"].m3.m3-radio:not(:disabled):is(
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 20%, transparent); :checked:active,
:indeterminate:active
)
+ span.m3.m3-radio-state-layer
+ span.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 20%,
transparent
);
} }
input[type=radio].m3.m3-radio:not(:disabled):hover + span.m3.m3-radio-state-layer { input[type="radio"].m3.m3-radio:not(:disabled):hover
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); + span.m3.m3-radio-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 8%,
transparent
);
} }
input[type=radio].m3.m3-radio:not(:disabled):active + span.m3.m3-radio-state-layer { input[type="radio"].m3.m3-radio:not(:disabled):active
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); + span.m3.m3-radio-state-layer {
background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 12%,
transparent
);
} }
input[type=radio].m3.m3-radio:not(:disabled):active + span.m3.m3-radio-state-layer + span.m3-ripple-domain > .m3.ripple { input[type="radio"].m3.m3-radio:not(:disabled):active
background-color: color-mix(in srgb, var(--md-sys-color-primary) 20%, transparent); + span.m3.m3-radio-state-layer
+ span.m3-ripple-domain
> .m3.ripple {
background-color: color-mix(
in srgb,
var(--md-sys-color-primary) 20%,
transparent
);
} }
/*# sourceMappingURL=radio.css.map */ /*# sourceMappingURL=radio.css.map */

View File

@ -18,7 +18,11 @@
animation-name: rippleAppearanceAnimation; animation-name: rippleAppearanceAnimation;
animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
animation-duration: 0.55s; animation-duration: 0.55s;
transition: opacity, background, background-color, 0.55s cubic-bezier(0.4, 0, 0.2, 1); transition:
opacity,
background,
background-color,
0.55s cubic-bezier(0.4, 0, 0.2, 1);
} }
.m3.ripple.visible { .m3.ripple.visible {
opacity: 1 !important; opacity: 1 !important;

View File

@ -21,7 +21,8 @@ div.m3.m3-switch-exp > svg > g > text {
font-family: Material-Symbols-Outlined-Regular; font-family: Material-Symbols-Outlined-Regular;
font-size: 20px; font-size: 20px;
} }
div.m3.m3-switch-exp > svg > circle.m3.m3-switch-handler-state-layer, div.m3.m3-switch-exp > svg > circle.m3.m3-switch-handler { div.m3.m3-switch-exp > svg > circle.m3.m3-switch-handler-state-layer,
div.m3.m3-switch-exp > svg > circle.m3.m3-switch-handler {
transition: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); transition: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
cy: 50%; cy: 50%;
cx: 16px; cx: 16px;
@ -53,72 +54,136 @@ div.m3.m3-switch-exp > input.m3 {
div.m3.m3-switch-exp > input.m3:disabled { div.m3.m3-switch-exp > input.m3:disabled {
cursor: not-allowed; cursor: not-allowed;
} }
div.m3.m3-switch-exp > input.m3:not(:checked, :disabled) + svg > circle.m3.m3-switch-handler { div.m3.m3-switch-exp
> input.m3:not(:checked, :disabled)
+ svg
> circle.m3.m3-switch-handler {
fill: var(--md-sys-color-outline); fill: var(--md-sys-color-outline);
} }
div.m3.m3-switch-exp > input.m3:checked:not(:disabled) + svg > g { div.m3.m3-switch-exp > input.m3:checked:not(:disabled) + svg > g {
transform: translate(50%, 81%); transform: translate(50%, 81%);
} }
div.m3.m3-switch-exp > input.m3:checked:not(:disabled) + svg > circle.m3.m3-switch-handler { div.m3.m3-switch-exp
> input.m3:checked:not(:disabled)
+ svg
> circle.m3.m3-switch-handler {
fill: var(--md-sys-color-on-primary); fill: var(--md-sys-color-on-primary);
} }
div.m3.m3-switch-exp > input.m3:not(:disabled) + svg > g > text.m3.m3-icon-unchecked { div.m3.m3-switch-exp
> input.m3:not(:disabled)
+ svg
> g
> text.m3.m3-icon-unchecked {
fill: var(--md-sys-color-on-primary); fill: var(--md-sys-color-on-primary);
} }
div.m3.m3-switch-exp > input.m3:not(:disabled) + svg > g > text.m3.m3-icon-checked { div.m3.m3-switch-exp
> input.m3:not(:disabled)
+ svg
> g
> text.m3.m3-icon-checked {
fill: var(--md-sys-color-on-primary-container); fill: var(--md-sys-color-on-primary-container);
} }
div.m3.m3-switch-exp > input.m3:checked:disabled + svg > circle.m3.m3-switch-handler { div.m3.m3-switch-exp
> input.m3:checked:disabled
+ svg
> circle.m3.m3-switch-handler {
fill: var(--md-sys-color-surface); fill: var(--md-sys-color-surface);
} }
div.m3.m3-switch-exp > input.m3:checked + svg > circle.m3.m3-switch-handler, div.m3.m3-switch-exp > input.m3 + svg:has(text.m3.m3-icon-unchecked) > circle.m3.m3-switch-handler { div.m3.m3-switch-exp > input.m3:checked + svg > circle.m3.m3-switch-handler,
div.m3.m3-switch-exp
> input.m3
+ svg:has(text.m3.m3-icon-unchecked)
> circle.m3.m3-switch-handler {
r: 12px; r: 12px;
} }
div.m3.m3-switch-exp > input.m3:checked + svg > g > text.m3.m3-icon-unchecked { div.m3.m3-switch-exp > input.m3:checked + svg > g > text.m3.m3-icon-unchecked {
opacity: 0; opacity: 0;
} }
div.m3.m3-switch-exp > input.m3:checked + svg > circle.m3:is(.m3-switch-handler, .m3-switch-handler-state-layer) { div.m3.m3-switch-exp
> input.m3:checked
+ svg
> circle.m3:is(.m3-switch-handler, .m3-switch-handler-state-layer) {
cx: calc(100% - 16px); cx: calc(100% - 16px);
} }
div.m3.m3-switch-exp > input.m3:not(:checked) + svg > g > text.m3.m3-icon-checked { div.m3.m3-switch-exp
> input.m3:not(:checked)
+ svg
> g
> text.m3.m3-icon-checked {
opacity: 0; opacity: 0;
} }
div.m3.m3-switch-exp > input.m3:is(div.m3.m3-switch-exp > input.m3:checked, div.m3.m3-switch-exp > input.m3):not(:disabled):active + svg > circle.m3.m3-switch-handler { div.m3.m3-switch-exp
> input.m3:is(
div.m3.m3-switch-exp > input.m3:checked,
div.m3.m3-switch-exp > input.m3
):not(:disabled):active
+ svg
> circle.m3.m3-switch-handler {
r: 14px; r: 14px;
} }
div.m3.m3-switch-exp > input.m3:not(:checked):disabled + svg > circle.m3.m3-switch-handler { div.m3.m3-switch-exp
> input.m3:not(:checked):disabled
+ svg
> circle.m3.m3-switch-handler {
fill: var(--md-sys-color-on-surface); fill: var(--md-sys-color-on-surface);
fill-opacity: 38%; fill-opacity: 38%;
} }
div.m3.m3-switch-exp > input.m3:hover:not(:disabled):checked + svg > circle.m3.m3-switch-handler { div.m3.m3-switch-exp
> input.m3:hover:not(:disabled):checked
+ svg
> circle.m3.m3-switch-handler {
fill: var(--md-sys-color-primary-container); fill: var(--md-sys-color-primary-container);
} }
div.m3.m3-switch-exp > input.m3:hover:not(:disabled):checked + svg > circle.m3.m3-switch-handler-state-layer { div.m3.m3-switch-exp
> input.m3:hover:not(:disabled):checked
+ svg
> circle.m3.m3-switch-handler-state-layer {
fill: var(--md-sys-color-primary); fill: var(--md-sys-color-primary);
fill-opacity: 8%; fill-opacity: 8%;
} }
div.m3.m3-switch-exp > input.m3:hover:not(:disabled):not(:checked) + svg > circle.m3.m3-switch-handler { div.m3.m3-switch-exp
> input.m3:hover:not(:disabled):not(:checked)
+ svg
> circle.m3.m3-switch-handler {
fill: var(--md-sys-color-on-surface-variant); fill: var(--md-sys-color-on-surface-variant);
} }
div.m3.m3-switch-exp > input.m3:hover:not(:disabled):not(:checked) + svg > circle.m3.m3-switch-handler-state-layer { div.m3.m3-switch-exp
> input.m3:hover:not(:disabled):not(:checked)
+ svg
> circle.m3.m3-switch-handler-state-layer {
fill: var(--md-sys-color-on-surface); fill: var(--md-sys-color-on-surface);
fill-opacity: 8%; fill-opacity: 8%;
} }
div.m3.m3-switch-exp > input.m3:active:not(:disabled):checked + svg > circle.m3.m3-switch-handler-state-layer { div.m3.m3-switch-exp
> input.m3:active:not(:disabled):checked
+ svg
> circle.m3.m3-switch-handler-state-layer {
fill: var(--md-sys-color-primary); fill: var(--md-sys-color-primary);
fill-opacity: 12%; fill-opacity: 12%;
} }
div.m3.m3-switch-exp > input.m3:active:not(:disabled):not(:checked) + svg > circle.m3.m3-switch-handler-state-layer { div.m3.m3-switch-exp
> input.m3:active:not(:disabled):not(:checked)
+ svg
> circle.m3.m3-switch-handler-state-layer {
fill: var(--md-sys-color-on-surface); fill: var(--md-sys-color-on-surface);
fill-opacity: 12%; fill-opacity: 12%;
} }
div.m3.m3-switch-exp > input.m3:is(:checked, :checked:disabled) + svg > rect.m3.m3-switch-track { div.m3.m3-switch-exp
> input.m3:is(:checked, :checked:disabled)
+ svg
> rect.m3.m3-switch-track {
rx: 16px; rx: 16px;
width: 52px; width: 52px;
height: 32px; height: 32px;
stroke-width: 0; stroke-width: 0;
} }
div.m3.m3-switch-exp > input.m3:is(div.m3.m3-switch-exp > input.m3:not(:checked), div.m3.m3-switch-exp > input.m3:not(:checked):disabled) + svg > rect.m3.m3-switch-track { div.m3.m3-switch-exp
> input.m3:is(
div.m3.m3-switch-exp > input.m3:not(:checked),
div.m3.m3-switch-exp > input.m3:not(:checked):disabled
)
+ svg
> rect.m3.m3-switch-track {
x: 1px; x: 1px;
y: 1px; y: 1px;
} }
@ -131,17 +196,28 @@ div.m3.m3-switch-exp > input.m3:checked + svg > rect.m3.m3-switch-track {
fill: var(--md-sys-color-primary); fill: var(--md-sys-color-primary);
} }
div.m3.m3-switch-exp > input.m3:disabled + svg > g > text.m3 { div.m3.m3-switch-exp > input.m3:disabled + svg > g > text.m3 {
fill: color-mix(in srgb, var(--md-sys-color-surface-container-highest) 38%, transparent); fill: color-mix(
in srgb,
var(--md-sys-color-surface-container-highest) 38%,
transparent
);
} }
div.m3.m3-switch-exp > input.m3:disabled + svg > rect.m3.m3-switch-track { div.m3.m3-switch-exp > input.m3:disabled + svg > rect.m3.m3-switch-track {
stroke: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); stroke: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
fill: color-mix(in srgb, var(--md-sys-color-surface-variant) 12%, transparent); fill: color-mix(
in srgb,
var(--md-sys-color-surface-variant) 12%,
transparent
);
} }
div.m3.m3-switch-exp > input.m3:checked:disabled + svg > g > text.m3 { div.m3.m3-switch-exp > input.m3:checked:disabled + svg > g > text.m3 {
transform: translateX(38.5%); transform: translateX(38.5%);
fill: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent); fill: color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent);
} }
div.m3.m3-switch-exp > input.m3:checked:disabled + svg > rect.m3.m3-switch-track { div.m3.m3-switch-exp
> input.m3:checked:disabled
+ svg
> rect.m3.m3-switch-track {
stroke: color-mix(in srgb, var(--md-sys-color-on-surface) 0%, transparent); stroke: color-mix(in srgb, var(--md-sys-color-on-surface) 0%, transparent);
fill: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent); fill: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
} }

View File

@ -9,7 +9,9 @@ div.m3.m3-text-field {
div.m3.m3-text-field span.m3-icon.icon-before { div.m3.m3-text-field span.m3-icon.icon-before {
align-self: start; align-self: start;
} }
div.m3.m3-text-field:is(.filled, .outlined) > input::placeholder, div.m3.m3-text-field > input, div.m3.m3-text-field > label { div.m3.m3-text-field:is(.filled, .outlined) > input::placeholder,
div.m3.m3-text-field > input,
div.m3.m3-text-field > label {
line-height: var(--md-sys-typescale-body-large-line-height); line-height: var(--md-sys-typescale-body-large-line-height);
font-size: var(--md-sys-typescale-body-large-font-size); font-size: var(--md-sys-typescale-body-large-font-size);
} }
@ -52,7 +54,8 @@ div.m3.m3-text-field > span.m3-text-field-state-layer {
pointer-events: none; pointer-events: none;
position: absolute; position: absolute;
} }
div.m3.m3-text-field > input, div.m3.m3-text-field > label { div.m3.m3-text-field > input,
div.m3.m3-text-field > label {
color: var(--md-sys-color-on-surface); color: var(--md-sys-color-on-surface);
} }
div.m3.m3-text-field:is(.filled, .outlined) > input::placeholder { div.m3.m3-text-field:is(.filled, .outlined) > input::placeholder {
@ -62,7 +65,9 @@ div.m3.m3-text-field:is(.filled, .outlined) > input:focus-visible {
outline: none; outline: none;
caret-color: var(--md-sys-color-primary); caret-color: var(--md-sys-color-primary);
} }
div.m3.m3-text-field:is(.filled, .outlined):has(input:disabled) > *, div.m3.m3-text-field:is(.filled, .outlined):has(input:disabled) + span.m3-text-field-supporting-text { div.m3.m3-text-field:is(.filled, .outlined):has(input:disabled) > *,
div.m3.m3-text-field:is(.filled, .outlined):has(input:disabled)
+ span.m3-text-field-supporting-text {
opacity: 38%; opacity: 38%;
} }
div.m3.m3-text-field.filled { div.m3.m3-text-field.filled {
@ -106,7 +111,10 @@ div.m3.m3-text-field.filled > input:required:user-invalid:focus-visible {
div.m3.m3-text-field.filled > input:required:user-invalid { div.m3.m3-text-field.filled > input:required:user-invalid {
box-shadow: inset 0 -1px 0 var(--md-sys-color-error); box-shadow: inset 0 -1px 0 var(--md-sys-color-error);
} }
div.m3.m3-text-field.filled:has(input:required:user-invalid) > *:not(input):nth-last-child(-n+3), div.m3.m3-text-field.filled:has(input:required:user-invalid) + span.m3-text-field-supporting-text { div.m3.m3-text-field.filled:has(input:required:user-invalid)
> *:not(input):nth-last-child(-n + 3),
div.m3.m3-text-field.filled:has(input:required:user-invalid)
+ span.m3-text-field-supporting-text {
color: var(--md-sys-color-error); color: var(--md-sys-color-error);
} }
div.m3.m3-text-field.filled > input:focus-visible { div.m3.m3-text-field.filled > input:focus-visible {
@ -116,9 +124,15 @@ div.m3.m3-text-field.filled > input:focus-visible {
div.m3.m3-text-field.filled > input:focus-visible + label { div.m3.m3-text-field.filled > input:focus-visible + label {
color: var(--md-sys-color-primary); color: var(--md-sys-color-primary);
} }
div.m3.m3-text-field.filled:hover > input:not(:disabled) ~ span.m3-text-field-state-layer { div.m3.m3-text-field.filled:hover
> input:not(:disabled)
~ span.m3-text-field-state-layer {
transition: 0.2s cubic-bezier(0.2, 0, 0, 1); transition: 0.2s cubic-bezier(0.2, 0, 0, 1);
background-color: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent); background-color: color-mix(
in srgb,
var(--md-sys-color-on-surface) 8%,
transparent
);
} }
div.m3.m3-text-field.outlined > fieldset { div.m3.m3-text-field.outlined > fieldset {
margin: 0; margin: 0;
@ -170,14 +184,22 @@ div.m3.m3-text-field.outlined > input.with-after-icon.with-before-icon {
div.m3.m3-text-field.outlined:has(input:focus-visible) > fieldset { div.m3.m3-text-field.outlined:has(input:focus-visible) > fieldset {
border: 3px solid var(--md-sys-color-primary); border: 3px solid var(--md-sys-color-primary);
} }
div.m3.m3-text-field.outlined:not(div.m3.m3-text-field.outlined:has(label.raised)):has(input:focus-visible) > fieldset > legend { div.m3.m3-text-field.outlined:not(
div.m3.m3-text-field.outlined:has(label.raised)
):has(input:focus-visible)
> fieldset
> legend {
border-top-width: 0; border-top-width: 0;
border-bottom-width: 0; border-bottom-width: 0;
border-inline-width: 5.5px; border-inline-width: 5.5px;
border-style: solid; border-style: solid;
border-color: transparent; border-color: transparent;
} }
div.m3.m3-text-field.outlined:not(div.m3.m3-text-field.outlined:has(input:focus-visible)):has(label.raised) > fieldset > legend { div.m3.m3-text-field.outlined:not(
div.m3.m3-text-field.outlined:has(input:focus-visible)
):has(label.raised)
> fieldset
> legend {
border-top-width: 0; border-top-width: 0;
border-bottom-width: 0; border-bottom-width: 0;
border-inline-width: 7.5px; border-inline-width: 7.5px;
@ -187,7 +209,8 @@ div.m3.m3-text-field.outlined:not(div.m3.m3-text-field.outlined:has(input:focus-
div.m3.m3-text-field.outlined > input:focus-visible + label { div.m3.m3-text-field.outlined > input:focus-visible + label {
color: var(--md-sys-color-primary); color: var(--md-sys-color-primary);
} }
div.m3.m3-text-field.outlined > label.raised, div.m3.m3-text-field.outlined > fieldset > * { div.m3.m3-text-field.outlined > label.raised,
div.m3.m3-text-field.outlined > fieldset > * {
line-height: var(--md-sys-typescale-body-small-line-height); line-height: var(--md-sys-typescale-body-small-line-height);
font-size: var(--md-sys-typescale-body-small-font-size); font-size: var(--md-sys-typescale-body-small-font-size);
} }
@ -197,16 +220,30 @@ div.m3.m3-text-field.outlined > label.raised {
div.m3.m3-text-field.outlined > input:required:user-invalid { div.m3.m3-text-field.outlined > input:required:user-invalid {
caret-color: var(--md-sys-color-error); caret-color: var(--md-sys-color-error);
} }
div.m3.m3-text-field.outlined:has(input:required:user-invalid) > *:not(input):nth-last-child(-n+3), div.m3.m3-text-field.outlined:has(input:required:user-invalid) + span.m3-text-field-supporting-text { div.m3.m3-text-field.outlined:has(input:required:user-invalid)
> *:not(input):nth-last-child(-n + 3),
div.m3.m3-text-field.outlined:has(input:required:user-invalid)
+ span.m3-text-field-supporting-text {
color: var(--md-sys-color-error); color: var(--md-sys-color-error);
} }
div.m3.m3-text-field.outlined:has(input:required:user-invalid) > fieldset { div.m3.m3-text-field.outlined:has(input:required:user-invalid) > fieldset {
border: 3px solid var(--md-sys-color-error); border: 3px solid var(--md-sys-color-error);
} }
div.m3.m3-text-field.outlined:has(input:required:user-invalid:not(:focus-visible)) > fieldset { div.m3.m3-text-field.outlined:has(
input:required:user-invalid:not(:focus-visible)
)
> fieldset {
border: 1px solid var(--md-sys-color-error); border: 1px solid var(--md-sys-color-error);
} }
div.m3.m3-text-field.outlined:hover:not(div.m3.m3-text-field.outlined:hover:has(input:disabled, input:focus-visible, label.raised, input:required:user-invalid)) > fieldset { div.m3.m3-text-field.outlined:hover:not(
div.m3.m3-text-field.outlined:hover:has(
input:disabled,
input:focus-visible,
label.raised,
input:required:user-invalid
)
)
> fieldset {
transition: 0.2s cubic-bezier(0.2, 0, 0, 1); transition: 0.2s cubic-bezier(0.2, 0, 0, 1);
border-color: var(--md-sys-color-on-surface); border-color: var(--md-sys-color-on-surface);
} }

View File

@ -47,7 +47,7 @@
--md-sys-typescale-body-large-font-weight: 400; --md-sys-typescale-body-large-font-weight: 400;
--md-sys-typescale-body-large-font-size: 16px; --md-sys-typescale-body-large-font-size: 16px;
--md-sys-typescale-body-large-line-height: 24px; --md-sys-typescale-body-large-line-height: 24px;
--md-sys-typescale-body-large-letter-spacing: 0.50px; --md-sys-typescale-body-large-letter-spacing: 0.5px;
/* body - medium */ /* body - medium */
--md-sys-typescale-body-medium-font-family-name: Roboto; --md-sys-typescale-body-medium-font-family-name: Roboto;
--md-sys-typescale-body-medium-font-family-style: Regular; --md-sys-typescale-body-medium-font-family-style: Regular;
@ -61,28 +61,28 @@
--md-sys-typescale-body-small-font-weight: 400; --md-sys-typescale-body-small-font-weight: 400;
--md-sys-typescale-body-small-font-size: 12px; --md-sys-typescale-body-small-font-size: 12px;
--md-sys-typescale-body-small-line-height: 16px; --md-sys-typescale-body-small-line-height: 16px;
--md-sys-typescale-body-small-letter-spacing: 0.40px; --md-sys-typescale-body-small-letter-spacing: 0.4px;
/* label - large */ /* label - large */
--md-sys-typescale-label-large-font-family-name: Roboto; --md-sys-typescale-label-large-font-family-name: Roboto;
--md-sys-typescale-label-large-font-family-style: Medium; --md-sys-typescale-label-large-font-family-style: Medium;
--md-sys-typescale-label-large-font-weight: 500; --md-sys-typescale-label-large-font-weight: 500;
--md-sys-typescale-label-large-font-size: 14px; --md-sys-typescale-label-large-font-size: 14px;
--md-sys-typescale-label-large-line-height: 20px; --md-sys-typescale-label-large-line-height: 20px;
--md-sys-typescale-label-large-letter-spacing: 0.10px; --md-sys-typescale-label-large-letter-spacing: 0.1px;
/* label - medium */ /* label - medium */
--md-sys-typescale-label-medium-font-family-name: Roboto; --md-sys-typescale-label-medium-font-family-name: Roboto;
--md-sys-typescale-label-medium-font-family-style: Medium; --md-sys-typescale-label-medium-font-family-style: Medium;
--md-sys-typescale-label-medium-font-weight: 500; --md-sys-typescale-label-medium-font-weight: 500;
--md-sys-typescale-label-medium-font-size: 12px; --md-sys-typescale-label-medium-font-size: 12px;
--md-sys-typescale-label-medium-line-height: 16px; --md-sys-typescale-label-medium-line-height: 16px;
--md-sys-typescale-label-medium-letter-spacing: 0.50px; --md-sys-typescale-label-medium-letter-spacing: 0.5px;
/* label - small */ /* label - small */
--md-sys-typescale-label-small-font-family-name: Roboto; --md-sys-typescale-label-small-font-family-name: Roboto;
--md-sys-typescale-label-small-font-family-style: Medium; --md-sys-typescale-label-small-font-family-style: Medium;
--md-sys-typescale-label-small-font-weight: 500; --md-sys-typescale-label-small-font-weight: 500;
--md-sys-typescale-label-small-font-size: 11px; --md-sys-typescale-label-small-font-size: 11px;
--md-sys-typescale-label-small-line-height: 16px; --md-sys-typescale-label-small-line-height: 16px;
--md-sys-typescale-label-small-letter-spacing: 0.50px; --md-sys-typescale-label-small-letter-spacing: 0.5px;
/* title - large */ /* title - large */
--md-sys-typescale-title-large-font-family-name: Roboto; --md-sys-typescale-title-large-font-family-name: Roboto;
--md-sys-typescale-title-large-font-family-style: Regular; --md-sys-typescale-title-large-font-family-style: Regular;
@ -103,5 +103,5 @@
--md-sys-typescale-title-small-font-weight: 500; --md-sys-typescale-title-small-font-weight: 500;
--md-sys-typescale-title-small-font-size: 14px; --md-sys-typescale-title-small-font-size: 14px;
--md-sys-typescale-title-small-line-height: 20px; --md-sys-typescale-title-small-line-height: 20px;
--md-sys-typescale-title-small-letter-spacing: 0.10px; --md-sys-typescale-title-small-letter-spacing: 0.1px;
} }

View File

@ -1,18 +1,23 @@
{ {
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "target": "es5",
"outDir": "build", "lib": [
"allowSyntheticDefaultImports": true, "dom",
"dom.iterable",
"esnext"
],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true, "noEmit": true,
"incremental": true,
"esModuleInterop": true, "esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"jsx": "preserve", "jsx": "preserve",
"incremental": true,
"plugins": [ "plugins": [
{ {
"name": "next" "name": "next"
@ -20,8 +25,12 @@
] ]
}, },
"include": [ "include": [
"src/**/*.ts", "next-env.d.ts",
"test/**/*.ts", "**/*.ts",
"**/*.tsx",
".next/types/**/*.ts" ".next/types/**/*.ts"
],
"exclude": [
"node_modules"
] ]
} }