@openfin/ui-library 0.26.1-alpha.1719517981 → 0.26.1-alpha.1721400154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { IconSizeType, IconType } from '../../system/ThemeProvider/lib/types';
|
|
3
3
|
export type PropsWithIcon = {
|
|
4
4
|
icon: IconType;
|
|
@@ -15,4 +15,4 @@ export type IconSizeProps = {
|
|
|
15
15
|
export type IconProps = HTMLAttributes<HTMLDivElement> & (PropsWithIcon | PropsWithChild) & IconSizeProps & {
|
|
16
16
|
'data-testid'?: string;
|
|
17
17
|
};
|
|
18
|
-
export declare const Icon: import("styled-components").StyledComponent<
|
|
18
|
+
export declare const Icon: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
|
package/dist/index.js
CHANGED
|
@@ -633,7 +633,7 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
633
633
|
`},7261:function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTooltip=t.isElementOverflown=t.OptionTitle=void 0;const i=n(5893),a=n(6689),l=n(7769),c=n(9507),u=o(n(7518));t.OptionTitle=e=>{var{children:n}=e,o=r(e,["children"]);return(0,i.jsx)(s,Object.assign({ref:(0,t.useTooltip)(n)},o,{children:(0,i.jsx)("div",{children:n})}))};const s=(0,u.default)(l.Text)`
|
|
634
634
|
${c.Mixins.textOverflow};
|
|
635
635
|
margin-left: ${({theme:e})=>e.px.xsmall};
|
|
636
|
-
`;function f(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}t.isElementOverflown=f,t.useTooltip=e=>(0,a.useCallback)((t=>{t&&e&&f(t)&&(t.title=e)}),[])},7006:function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Icon=void 0;const i=n(5893),a=o(n(7518)),
|
|
636
|
+
`;function f(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}t.isElementOverflown=f,t.useTooltip=e=>(0,a.useCallback)((t=>{t&&e&&f(t)&&(t.title=e)}),[])},7006:function(e,t,n){var r=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Icon=void 0;const i=n(5893),a=n(6689),l=o(n(7518)),c=n(1335),u=n(9507),s=n(3471),f=n(9669),d=(0,a.forwardRef)(((e,t)=>{var{tabIndex:n,icon:o,children:a,size:l="base",containerSize:c,"data-testid":u}=e,s=r(e,["tabIndex","icon","children","size","containerSize","data-testid"]);return(0,i.jsx)(C,Object.assign({},s,{iconSize:l,containerSize:c||l,justifyContent:"center",alignItems:"center","data-testid":u,tabIndex:n,ref:t},{children:o?(0,i.jsx)(p,Object.assign({ariaLabel:s["aria-label"],icon:o},s)):a}))}));d.displayName="Icon",t.Icon=(0,l.default)(d)``;const p=(0,l.default)((e=>{var{icon:t,ariaLabel:n}=e,o=r(e,["icon","ariaLabel"]);const a=s.IconSet[t];return(0,i.jsx)(a,Object.assign({role:"img","aria-label":n},o))}))``,C=(0,l.default)(c.Box)`
|
|
637
637
|
/**
|
|
638
638
|
* 1. Initialize local variables with reasonable defaults
|
|
639
639
|
*/
|
|
@@ -642,15 +642,16 @@ var e={8594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=/^((children|dangerouslySetInnerHTM
|
|
|
642
642
|
/**
|
|
643
643
|
* 2. Inject variants -- ? What are Variants
|
|
644
644
|
*/
|
|
645
|
-
${(0,
|
|
646
|
-
${(0,
|
|
645
|
+
${(0,u.getVariantCSS)(f.variants,f.Variant.containerSize)}
|
|
646
|
+
${(0,u.getVariantCSS)(f.variants,f.Variant.iconSize)}
|
|
647
647
|
|
|
648
648
|
width: var(--px-container, var(--px-default));
|
|
649
649
|
height: var(--px-container, var(--px-default));
|
|
650
650
|
|
|
651
651
|
/* SVG Asset */
|
|
652
|
+
|
|
652
653
|
& > *,
|
|
653
|
-
${
|
|
654
|
+
${p} {
|
|
654
655
|
display: block;
|
|
655
656
|
width: var(--px-icon, var(--px-default));
|
|
656
657
|
height: var(--px-icon, var(--px-default));
|
package/package.json
CHANGED