Skip to content

Commit

Permalink
match previous styles
Browse files Browse the repository at this point in the history
  • Loading branch information
jjisabi committed Apr 26, 2024
1 parent d2b063c commit 5241dca
Show file tree
Hide file tree
Showing 87 changed files with 5,883 additions and 11 deletions.
58 changes: 47 additions & 11 deletions packages/mui-material/src/SpeedDialAction/SpeedDialAction.js
Expand Up @@ -8,7 +8,7 @@ import { emphasize } from '@mui/system/colorManipulator';
import styled from '../styles/styled';
import useThemeProps from '../styles/useThemeProps';
import Fab from '../Fab';
import Tooltip from '../Tooltip';
import Tooltip, { tooltipClasses } from '../Tooltip';
import { getSpeedDialActionUtilityClass } from './speedDialActionClasses';

const useUtilityClasses = (ownerState) => {
Expand Down Expand Up @@ -39,10 +39,37 @@ const SpeedDialActionFab = styled(Fab, {
? theme.vars.palette.SpeedDialAction.fabHoverBg
: emphasize(theme.palette.background.paper, 0.15),
},
transition: `${theme.transitions.create('transform', {
duration: theme.transitions.duration.shorter,
})}, opacity 0.8s`,
opacity: 1,
...(!ownerState.open && {
opacity: 0,
transform: 'scale(0)',
}),
...(!ownerState.open &&
ownerState.tooltipOpen && {
opacity: 0,
transform: 'scale(1)',
}),
...((ownerState.tooltipPlacement.startsWith('top') ||
ownerState.tooltipPlacement.startsWith('bottom')) && {
margin: 20,
}),
}));

const PersistentTooltip = styled(({ className, ...props }) => (
<Tooltip {...props} classes={{ popper: className }} />
))(({ theme }) => ({
[`& .${tooltipClasses.tooltip}`]: {
...theme.typography.body1,
backgroundColor: (theme.vars || theme).palette.background.paper,
borderRadius: (theme.vars || theme).shape.borderRadius,
boxShadow: (theme.vars || theme).shadows[1],
color: (theme.vars || theme).palette.text.secondary,
padding: '4px 16px',
wordBreak: 'keep-all',
},
}));

const SpeedDialAction = React.forwardRef(function SpeedDialAction(inProps, ref) {
Expand Down Expand Up @@ -93,6 +120,24 @@ const SpeedDialAction = React.forwardRef(function SpeedDialAction(inProps, ref)
</SpeedDialActionFab>
);

if (tooltipOpenProp) {
return (
<PersistentTooltip
id={id}
ref={ref}
title={tooltipTitle}
placement={tooltipPlacement}
onClose={handleTooltipClose}
onOpen={handleTooltipOpen}
open={open && tooltipOpenProp}
classes={TooltipClasses}
{...other}
>
{fab}
</PersistentTooltip>
);
}

if (!open && tooltipOpen) {
setTooltipOpen(false);
}
Expand All @@ -105,16 +150,7 @@ const SpeedDialAction = React.forwardRef(function SpeedDialAction(inProps, ref)
placement={tooltipPlacement}
onClose={handleTooltipClose}
onOpen={handleTooltipOpen}
open={open && (tooltipOpen || tooltipOpenProp)}
slotProps={{
tooltip: {
sx: (theme) => ({
backgroundColor:
tooltipOpenProp === true ? (theme.vars || theme).palette.background.paper : '',
color: tooltipOpenProp === true ? (theme.vars || theme).palette.text.secondary : '',
}),
},
}}
open={open && tooltipOpen}
classes={TooltipClasses}
{...other}
>
Expand Down
21 changes: 21 additions & 0 deletions packages/pigment-css-nextjs-plugin/LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Call-Em-All

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions packages/pigment-css-react/LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Call-Em-All

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions packages/pigment-css-react/private-runtime/index.d.mts
@@ -0,0 +1,5 @@
import * as React from 'react';

declare const ForwardSx: React.ForwardRefExoticComponent<React.RefAttributes<any>>;

export { ForwardSx };
5 changes: 5 additions & 0 deletions packages/pigment-css-react/private-runtime/index.d.ts
@@ -0,0 +1,5 @@
import * as React from 'react';

declare const ForwardSx: React.ForwardRefExoticComponent<React.RefAttributes<any>>;

export { ForwardSx };
105 changes: 105 additions & 0 deletions packages/pigment-css-react/private-runtime/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/pigment-css-react/private-runtime/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions packages/pigment-css-react/private-runtime/index.mjs
@@ -0,0 +1,70 @@
/* eslint-disable */
import * as React from 'react';
import clsx from 'clsx';

/**
* @pigment-css/react v0.0.7
*
* @license MIT
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) =>
key in obj
? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value })
: (obj[key] = value);
var __spreadValues = (a, b) => {
for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
}
return a;
};
var __objRest = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) target[prop] = source[prop];
if (source != null && __getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop];
}
return target;
};
function useSx(sx, className, style) {
const sxClass = typeof sx === 'string' ? sx : sx == null ? void 0 : sx.className;
const sxVars = sx && typeof sx !== 'string' ? sx.vars : void 0;
const varStyles = {};
if (sxVars) {
Object.entries(sxVars).forEach(([cssVariable, [value, isUnitLess]]) => {
if (typeof value === 'string' || isUnitLess) {
varStyles[`--${cssVariable}`] = value;
} else {
varStyles[`--${cssVariable}`] = `${value}px`;
}
});
}
return {
className: clsx(sxClass, className),
style: __spreadValues(__spreadValues({}, varStyles), style),
};
}
var ForwardSx = React.forwardRef((_a, ref) => {
var _b = _a,
{ sx, sxComponent, className, style } = _b,
rest = __objRest(_b, ['sx', 'sxComponent', 'className', 'style']);
const Component = sxComponent;
return /* @__PURE__ */ React.createElement(
Component,
__spreadValues(__spreadValues({ ref }, rest), useSx(sx, className, style)),
);
});

export { ForwardSx };
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.mjs.map
1 change: 1 addition & 0 deletions packages/pigment-css-react/private-runtime/index.mjs.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -0,0 +1,10 @@
import { IVariableContext } from '@wyw-in-js/shared';
import { BaseProcessor as BaseProcessor$1 } from '@wyw-in-js/processor-utils';

declare abstract class BaseProcessor extends BaseProcessor$1 {
variableIdx: number;
protected getCustomVariableId(cssKey: string, source: string, hasUnit: boolean): string;
protected getVariableContext(cssKey: string, source: string, hasUnit: boolean): IVariableContext;
}

export { BaseProcessor as B };
10 changes: 10 additions & 0 deletions packages/pigment-css-react/processors/base-processor-C9d_kFM7.d.ts
@@ -0,0 +1,10 @@
import { IVariableContext } from '@wyw-in-js/shared';
import { BaseProcessor as BaseProcessor$1 } from '@wyw-in-js/processor-utils';

declare abstract class BaseProcessor extends BaseProcessor$1 {
variableIdx: number;
protected getCustomVariableId(cssKey: string, source: string, hasUnit: boolean): string;
protected getVariableContext(cssKey: string, source: string, hasUnit: boolean): IVariableContext;
}

export { BaseProcessor as B };

0 comments on commit 5241dca

Please sign in to comment.