@ably/ui 14.7.7 → 14.7.8
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.
- package/core/Icon/EncapsulatedIcon.js +1 -1
- package/index.d.ts +5 -3
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from"react";import Icon from"../Icon";import useTheming from"../hooks/useTheming";const EncapsulatedIcon=({theme="dark",size="40px",iconSize,className,innerClassName,...iconProps})=>{const{themeColor}=useTheming({baseTheme:"dark",theme});
|
|
1
|
+
import React from"react";import Icon from"../Icon";import useTheming from"../hooks/useTheming";const ICON_SIZE_REDUCTION=12;const ICON_HEIGHT_REDUCTION=2;const EncapsulatedIcon=({theme="dark",size="40px",iconSize,className,innerClassName,...iconProps})=>{const{themeColor}=useTheming({baseTheme:"dark",theme});let computedIconSize=size,computedIconHeight=size;if(iconSize){computedIconSize=iconSize}else if(size.toString().endsWith("px")){const numericalSize=parseInt(size,10);computedIconSize=`${numericalSize-ICON_SIZE_REDUCTION}px`;computedIconHeight=`${numericalSize-ICON_HEIGHT_REDUCTION}px`}else{console.warn(`EncapsulatedIcon: Non-pixel units might not behave as expected`)}return /*#__PURE__*/React.createElement("div",{className:`p-1 rounded-lg ${theme==="light"?"bg-gradient-to-t":"bg-gradient-to-b"} ${themeColor("from-neutral-900")} ${className??""}`,style:{width:size,height:size}},/*#__PURE__*/React.createElement("div",{className:`flex items-center justify-center rounded-lg ${themeColor("bg-neutral-1100")} ${innerClassName??""}`,style:{height:computedIconHeight}},/*#__PURE__*/React.createElement(Icon,{size:computedIconSize,...iconProps})))};export default EncapsulatedIcon;
|
package/index.d.ts
CHANGED
|
@@ -232,11 +232,12 @@ export default Footer;
|
|
|
232
232
|
declare module '@ably/ui/core/Icon/EncapsulatedIcon' {
|
|
233
233
|
import { IconProps } from ".@ably/ui/core/Icon";
|
|
234
234
|
import { Theme } from ".@ably/ui/core/styles/colors/types";
|
|
235
|
+
import { IconSize } from "@ably/ui/core/types";
|
|
235
236
|
type EncapsulatedIconProps = {
|
|
236
237
|
theme?: Theme;
|
|
237
238
|
className?: string;
|
|
238
239
|
innerClassName?: string;
|
|
239
|
-
iconSize?:
|
|
240
|
+
iconSize?: IconSize;
|
|
240
241
|
} & IconProps;
|
|
241
242
|
const EncapsulatedIcon: ({ theme, size, iconSize, className, innerClassName, ...iconProps }: EncapsulatedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
242
243
|
export default EncapsulatedIcon;
|
|
@@ -271,15 +272,16 @@ export const iconNames: {
|
|
|
271
272
|
product: readonly ["icon-product-asset-tracking", "icon-product-chat", "icon-product-liveobjects", "icon-product-livesync", "icon-product-pubsub", "icon-product-spaces"];
|
|
272
273
|
};
|
|
273
274
|
export type IconName = (typeof iconNames.gui)[number] | (typeof iconNames.display)[number] | (typeof iconNames.social)[number] | (typeof iconNames.other)[number] | (typeof iconNames.tech)[number] | (typeof iconNames.product)[number];
|
|
275
|
+
export type IconSize = `${number}px` | `${number}em` | `${number}rem` | `calc(${string})`;
|
|
274
276
|
//# sourceMappingURL=types.d.ts.map
|
|
275
277
|
}
|
|
276
278
|
|
|
277
279
|
declare module '@ably/ui/core/Icon' {
|
|
278
|
-
import { IconName } from "@ably/ui/core/Icon/types";
|
|
280
|
+
import { IconName, IconSize } from "@ably/ui/core/Icon/types";
|
|
279
281
|
import { ColorClass } from "@ably/ui/core/styles/colors/types";
|
|
280
282
|
export type IconProps = {
|
|
281
283
|
name: IconName;
|
|
282
|
-
size?:
|
|
284
|
+
size?: IconSize;
|
|
283
285
|
color?: ColorClass;
|
|
284
286
|
secondaryColor?: ColorClass;
|
|
285
287
|
additionalCSS?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ably/ui",
|
|
3
|
-
"version": "14.7.
|
|
3
|
+
"version": "14.7.8",
|
|
4
4
|
"description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,15 +16,15 @@
|
|
|
16
16
|
],
|
|
17
17
|
"types": "index.d.ts",
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@storybook/addon-a11y": "^8.
|
|
20
|
-
"@storybook/addon-essentials": "^8.
|
|
21
|
-
"@storybook/addon-interactions": "^8.
|
|
22
|
-
"@storybook/addon-links": "^8.
|
|
23
|
-
"@storybook/blocks": "^8.
|
|
24
|
-
"@storybook/react-vite": "^8.
|
|
25
|
-
"@storybook/test": "^8.
|
|
19
|
+
"@storybook/addon-a11y": "^8.4.0",
|
|
20
|
+
"@storybook/addon-essentials": "^8.4.0",
|
|
21
|
+
"@storybook/addon-interactions": "^8.4.0",
|
|
22
|
+
"@storybook/addon-links": "^8.4.0",
|
|
23
|
+
"@storybook/blocks": "^8.4.0",
|
|
24
|
+
"@storybook/react-vite": "^8.4.0",
|
|
25
|
+
"@storybook/test": "^8.4.0",
|
|
26
26
|
"@storybook/test-runner": "^0.19.1",
|
|
27
|
-
"@swc/cli": "^0.
|
|
27
|
+
"@swc/cli": "^0.5.0",
|
|
28
28
|
"@swc/core": "^1.4.11",
|
|
29
29
|
"@tailwindcss/container-queries": "^0.1.1",
|
|
30
30
|
"@types/dompurify": "^3.0.5",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"msw": "2.6.0",
|
|
45
45
|
"msw-storybook-addon": "^2.0.2",
|
|
46
46
|
"prettier": "^3.2.5",
|
|
47
|
-
"storybook": "^8.
|
|
47
|
+
"storybook": "^8.4.0",
|
|
48
48
|
"storybook-dark-mode": "^4.0.2",
|
|
49
49
|
"svg-sprite": "^2.0.4",
|
|
50
50
|
"tailwindcss": "^3.3.6",
|