@khanacademy/wonder-blocks-icon-button
Advanced tools
Comparing version 0.0.0-PR2224-20240523172344 to 0.0.0-PR2225-20240715160419
# @khanacademy/wonder-blocks-icon-button | ||
## 0.0.0-PR2224-20240523172344 | ||
## 0.0.0-PR2225-20240715160419 | ||
### Minor Changes | ||
- fa952500: Add onMouseDown prop | ||
## 5.3.0 | ||
### Minor Changes | ||
- 16e1635a: IconButton: Add option for `large` value for `size` prop (24x24 icon size with target area of 48x48) | ||
## 5.2.2 | ||
### Patch Changes | ||
- Updated dependencies [5dfac06e] | ||
- @khanacademy/wonder-blocks-core@0.0.0-PR2224-20240523172344 | ||
- @khanacademy/wonder-blocks-clickable@0.0.0-PR2224-20240523172344 | ||
- @khanacademy/wonder-blocks-icon@0.0.0-PR2224-20240523172344 | ||
- @khanacademy/wonder-blocks-core@6.4.1 | ||
- @khanacademy/wonder-blocks-clickable@4.2.2 | ||
- @khanacademy/wonder-blocks-icon@4.1.1 | ||
@@ -12,0 +24,0 @@ ## 5.2.1 |
@@ -5,3 +5,3 @@ import * as React from "react"; | ||
import { Link } from "react-router-dom"; | ||
export type IconButtonSize = "xsmall" | "small" | "medium"; | ||
export type IconButtonSize = "xsmall" | "small" | "medium" | "large"; | ||
export type SharedProps = Partial<Omit<AriaProps, "aria-disabled">> & { | ||
@@ -41,3 +41,4 @@ /** | ||
* Size of the icon button. | ||
* One of `xsmall` (16 icon, 20 target), `small` (24, 32), or `medium (24, 40). | ||
* One of `xsmall` (16 icon, 20 target), `small` (24, 32), `medium` (24, 40), | ||
* or `large` (24, 48). | ||
* Defaults to `medium`. | ||
@@ -101,2 +102,6 @@ */ | ||
onClick?: (e: React.SyntheticEvent) => unknown; | ||
/** | ||
* Function to call when the mouse down event is triggered. | ||
*/ | ||
onMouseDown?: (e: React.MouseEvent) => void; | ||
}; | ||
@@ -103,0 +108,0 @@ /** |
@@ -47,2 +47,4 @@ import * as React from 'react'; | ||
return "medium"; | ||
case "large": | ||
return "medium"; | ||
} | ||
@@ -53,3 +55,4 @@ }; | ||
small: 32, | ||
medium: 40 | ||
medium: 40, | ||
large: 48 | ||
})[size]; | ||
@@ -56,0 +59,0 @@ |
@@ -70,2 +70,4 @@ 'use strict'; | ||
return "medium"; | ||
case "large": | ||
return "medium"; | ||
} | ||
@@ -76,3 +78,4 @@ }; | ||
small: 32, | ||
medium: 40 | ||
medium: 40, | ||
large: 48 | ||
})[size]; | ||
@@ -79,0 +82,0 @@ |
{ | ||
"name": "@khanacademy/wonder-blocks-icon-button", | ||
"version": "0.0.0-PR2224-20240523172344", | ||
"version": "0.0.0-PR2225-20240715160419", | ||
"design": "v1", | ||
@@ -19,5 +19,5 @@ "publishConfig": { | ||
"@babel/runtime": "^7.18.6", | ||
"@khanacademy/wonder-blocks-clickable": "0.0.0-PR2224-20240523172344", | ||
"@khanacademy/wonder-blocks-core": "0.0.0-PR2224-20240523172344", | ||
"@khanacademy/wonder-blocks-icon": "0.0.0-PR2224-20240523172344", | ||
"@khanacademy/wonder-blocks-clickable": "^4.2.2", | ||
"@khanacademy/wonder-blocks-core": "^6.4.1", | ||
"@khanacademy/wonder-blocks-icon": "^4.1.1", | ||
"@khanacademy/wonder-blocks-theming": "^2.0.2", | ||
@@ -24,0 +24,0 @@ "@khanacademy/wonder-blocks-tokens": "^1.3.0" |
@@ -9,2 +9,3 @@ import {iconSizeForButtonSize, targetPixelsForSize} from "./icon-button-util"; | ||
${"medium"} | ${"medium"} | ||
${"large"} | ${"medium"} | ||
`( | ||
@@ -24,2 +25,3 @@ "should return $expectedIconSize icon for $buttonSize icon button", | ||
${"medium"} | ${40} | ||
${"large"} | ${48} | ||
`( | ||
@@ -26,0 +28,0 @@ "should return $expectedTargetPixels for $size icon button", |
@@ -15,2 +15,4 @@ import {IconSize} from "@khanacademy/wonder-blocks-icon"; | ||
return "medium"; | ||
case "large": | ||
return "medium"; | ||
} | ||
@@ -23,2 +25,2 @@ }; | ||
export const targetPixelsForSize = (size: IconButtonSize): number => | ||
({xsmall: 24, small: 32, medium: 40}[size]); | ||
({xsmall: 24, small: 32, medium: 40, large: 48}[size]); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2641
196298
+ Added@khanacademy/wonder-blocks-clickable@4.2.8(transitive)
+ Added@khanacademy/wonder-blocks-core@6.4.37.0.1(transitive)
+ Added@khanacademy/wonder-blocks-icon@4.1.5(transitive)
+ Added@khanacademy/wonder-blocks-tokens@2.0.1(transitive)
- Removed@khanacademy/wonder-blocks-clickable@0.0.0-PR2224-20240523172344(transitive)
- Removed@khanacademy/wonder-blocks-core@0.0.0-PR2224-20240523172344(transitive)
- Removed@khanacademy/wonder-blocks-icon@0.0.0-PR2224-20240523172344(transitive)