@magic-circle/styles
Advanced tools
Comparing version 0.3.0-alpha.2 to 0.3.0-alpha.3
@@ -16,6 +16,8 @@ export declare enum Breakpoint { | ||
extraLarge: number; | ||
ipad: number; | ||
ipadPro: number; | ||
}; | ||
declare const query: (size: number, direction?: string) => (content: any, ...args: any[]) => import("styled-components").RuleSet<object>; | ||
type breakpointGroup = Record<Breakpoint, ReturnType<typeof query>>; | ||
declare const breakpoints: { | ||
declare const breakpoints: breakpointGroup & { | ||
min: breakpointGroup; | ||
@@ -22,0 +24,0 @@ max: breakpointGroup; |
@@ -5,2 +5,13 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { | ||
}; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
@@ -33,2 +44,4 @@ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
_a[Breakpoint.EXTRA_LARGE] = 1600, | ||
_a[Breakpoint.IPAD] = 1024, | ||
_a[Breakpoint.IPAD_PRO] = 1366, | ||
_a); | ||
@@ -45,15 +58,15 @@ var query = function (size, direction) { | ||
}; | ||
var emptyGroup = function () { | ||
var createGroup = function (set) { | ||
var _a; | ||
return _a = {}, | ||
_a[Breakpoint.EXTRA_SMALL] = null, | ||
_a[Breakpoint.SMALL] = null, | ||
_a[Breakpoint.MEDIUM] = null, | ||
_a[Breakpoint.LARGE] = null, | ||
_a[Breakpoint.EXTRA_LARGE] = null, | ||
_a[Breakpoint.IPAD] = null, | ||
_a[Breakpoint.IPAD_PRO] = null, | ||
_a[Breakpoint.EXTRA_SMALL] = query(breakpointSize[Breakpoint.EXTRA_SMALL], set), | ||
_a[Breakpoint.SMALL] = query(breakpointSize[Breakpoint.SMALL], set), | ||
_a[Breakpoint.MEDIUM] = query(breakpointSize[Breakpoint.MEDIUM], set), | ||
_a[Breakpoint.LARGE] = query(breakpointSize[Breakpoint.LARGE], set), | ||
_a[Breakpoint.EXTRA_LARGE] = query(breakpointSize[Breakpoint.EXTRA_LARGE], set), | ||
_a[Breakpoint.IPAD] = query(breakpointSize[Breakpoint.IPAD], set), | ||
_a[Breakpoint.IPAD_PRO] = query(breakpointSize[Breakpoint.IPAD_PRO], set), | ||
_a; | ||
}; | ||
var breakpoints = { min: emptyGroup(), max: emptyGroup(), custom: null }; | ||
var breakpoints = __assign(__assign({}, createGroup()), { min: createGroup('min'), max: createGroup('max'), custom: query }); | ||
Object.values(Breakpoint).forEach(function (key) { | ||
@@ -65,3 +78,2 @@ // default (max) | ||
}); | ||
breakpoints.custom = query; | ||
// USAGE EXAMPLE | ||
@@ -68,0 +80,0 @@ // breakpoints.small`-css here-` |
@@ -127,3 +127,3 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
var c1 = this.value; | ||
var c2 = typeof color2 === 'string' ? new Color(color2) : color2.value; | ||
var c2 = typeof color2 === 'string' ? new Color(color2).value : color2.value; | ||
return c1[0] === c2[0] && c1[1] === c2[1] && c1[2] === c2[2]; | ||
@@ -130,0 +130,0 @@ }; |
@@ -21,6 +21,6 @@ import type { ReactNode } from 'react'; | ||
export declare const Container: ({ hasChanges, reset, children, select, ...props }: ContainerProps) => import("react").JSX.Element; | ||
export declare const Label: ({ children, ...props }: { | ||
[x: string]: any; | ||
children: any; | ||
}) => import("react").JSX.Element; | ||
type LabelProps = { | ||
children?: React.ReactNode; | ||
}; | ||
export declare const Label: ({ children, ...props }: LabelProps) => import("react").JSX.Element; | ||
export declare const Inside: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>; | ||
@@ -27,0 +27,0 @@ type ValueProps = { |
@@ -19,3 +19,3 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { | ||
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-height: ", ";\n transition: max-height ", "ms ease;\n overflow: hidden;\n"], ["\n max-height: ", ";\n transition: max-height ", "ms ease;\n overflow: hidden;\n"])), function (props) { | ||
if (props.height === null) | ||
if (props.height === undefined) | ||
return 'auto'; | ||
@@ -27,3 +27,3 @@ return props.expand ? "".concat(props.height, "px") : 0; | ||
var ref = useRef(null); | ||
var _c = useState(null), height = _c[0], setHeight = _c[1]; | ||
var _c = useState(), height = _c[0], setHeight = _c[1]; | ||
useLayoutEffect(function () { | ||
@@ -30,0 +30,0 @@ if (ref.current) { |
@@ -24,3 +24,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
if (registry.has(name)) { | ||
Comp = registry.get(name); | ||
Comp = registry.get(name) || 'div'; | ||
} | ||
@@ -27,0 +27,0 @@ else { |
@@ -56,3 +56,5 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { | ||
<Close onClick={function () { | ||
app.layoutHooks.set(__assign(__assign({}, app.layoutHooks.value), { inner: undefined })); | ||
if (app) { | ||
app.layoutHooks.set(__assign(__assign({}, app.layoutHooks.value), { inner: undefined })); | ||
} | ||
if (onClose) | ||
@@ -59,0 +61,0 @@ onClose(); |
@@ -73,3 +73,5 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { | ||
} | ||
}} disabled={item.disabled} key={item.key || (typeof item.label === 'string' && item.label)} checked={item.type === MenuItemType.CHECKBOX && item.checked} active={item.active}> | ||
}} disabled={item.disabled} key={item.key || | ||
(typeof item.label === 'string' ? item.label : '') || | ||
''} checked={item.type === MenuItemType.CHECKBOX && item.checked} active={item.active}> | ||
<IconPart> | ||
@@ -76,0 +78,0 @@ {item.icon && (<Icon name={item.icon} width={SPACING(1.5)} height={SPACING(1.5)}/>)} |
@@ -18,4 +18,7 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
var menu = _a.menu, props = __rest(_a, ["menu"]); | ||
return (<Popover showOnClick placement={Placement.BOTTOM} alignment={Alignment.CENTER} background={COLORS.shades.s500.css} content={function (toggle) { return <MenuList menu={menu} close={function () { return toggle(); }}/>; }} {...props}/>); | ||
return (<Popover showOnClick placement={Placement.BOTTOM} alignment={Alignment.CENTER} background={COLORS.shades.s500.css} content={function (toggle) { return (<MenuList menu={menu} close={function () { | ||
if (toggle) | ||
toggle(); | ||
}}/>); }} {...props}/>); | ||
}; | ||
export default memo(MenuPortal); |
@@ -7,3 +7,3 @@ /// <reference types="react" /> | ||
}; | ||
declare const Shortcut: ({ shortcut, color, backgroundColor, }: ShortcutProps) => import("react").JSX.Element; | ||
declare const Shortcut: ({ shortcut, color, backgroundColor, }: ShortcutProps) => import("react").JSX.Element | null; | ||
export default Shortcut; |
{ | ||
"name": "@magic-circle/styles", | ||
"version": "0.3.0-alpha.2", | ||
"version": "0.3.0-alpha.3", | ||
"description": "Magic Circle style helpers", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@magic-circle/state": "^0.3.0-alpha.2", | ||
"@magic-circle/state": "^0.3.0-alpha.3", | ||
"@types/color-string": "^1.5.5", | ||
@@ -50,3 +50,3 @@ "@types/styled-components": "^5.1.34", | ||
}, | ||
"gitHead": "c11e89a1fa4acf875e59c6cc8b7ba543d34739d6" | ||
"gitHead": "5952c33d6c745020ab0ca53808c33300fa1b8b8d" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1585176
2320