@commercetools-uikit/primary-button
Advanced tools
Comparing version 0.0.0-preview-fec-155-react-19-20250108172010 to 0.0.0-preview-fec-155-react-19-20250113184401
@@ -14,6 +14,4 @@ 'use strict'; | ||
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties'); | ||
require('prop-types'); | ||
var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of'); | ||
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys'); | ||
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat'); | ||
var react$1 = require('react'); | ||
@@ -39,3 +37,2 @@ var omit = require('lodash/omit'); | ||
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys); | ||
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty); | ||
var omit__default = /*#__PURE__*/_interopDefault(omit); | ||
@@ -119,3 +116,3 @@ var Inline__default = /*#__PURE__*/_interopDefault(Inline); | ||
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; } | ||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; } | ||
const propsToOmit = ['type']; | ||
@@ -132,6 +129,2 @@ | ||
/** | ||
* Props for child icons | ||
*/ | ||
/** | ||
* Mapping of legacy sizes to new sizes. | ||
@@ -162,3 +155,3 @@ */ | ||
const PrimaryButton = _ref3 => { | ||
var _context, _context2; | ||
var _context; | ||
let _ref3$type = _ref3.type, | ||
@@ -185,3 +178,3 @@ type = _ref3$type === void 0 ? 'button' : _ref3$type, | ||
}); | ||
utils.useWarning(!Boolean(_indexOfInstanceProperty__default["default"](_context = _Object$keys__default["default"](sizeMapping)).call(_context, size) > -1), _concatInstanceProperty__default["default"](_context2 = "PrimaryButton '".concat(size, "' value for 'size' property has been deprecated in favor of '")).call(_context2, sizeMapping[size], "' Please update that value when using this component")); | ||
utils.useWarning(!Boolean(_indexOfInstanceProperty__default["default"](_context = _Object$keys__default["default"](sizeMapping)).call(_context, size) > -1), `PrimaryButton '${size}' value for 'size' property has been deprecated in favor of '${sizeMapping[size]}' Please update that value when using this component`); | ||
const isActive = Boolean(isToggleButton && props.isToggled); | ||
@@ -215,3 +208,2 @@ return jsxRuntime.jsx(AccessibleButton__default["default"], { | ||
}; | ||
PrimaryButton.propTypes = {}; | ||
PrimaryButton.displayName = 'PrimaryButton'; | ||
@@ -218,0 +210,0 @@ var PrimaryButton$1 = PrimaryButton; |
export type { TPrimaryButtonProps } from "./primary-button.js"; | ||
export type { TIconProps } from '@commercetools-uikit/design-system'; |
import { MouseEvent, KeyboardEvent, ElementType, ReactElement, ComponentPropsWithRef } from 'react'; | ||
import { type TIconProps } from '@commercetools-uikit/design-system'; | ||
/** | ||
@@ -10,8 +11,2 @@ * @deprecated Use sizes from `TSizes` instead. | ||
type TSizes = '10' | '20'; | ||
/** | ||
* Props for child icons | ||
*/ | ||
type TButtonIconProps = { | ||
color?: string; | ||
} & Record<string, unknown>; | ||
export type TPrimaryButtonProps<TStringOrComponent extends ElementType = 'button'> = { | ||
@@ -36,7 +31,7 @@ /** | ||
*/ | ||
iconLeft?: ReactElement<TButtonIconProps>; | ||
iconLeft?: ReactElement<TIconProps>; | ||
/** | ||
* The right icon displayed within the button. | ||
* The right icon displayed within the . | ||
*/ | ||
iconRight?: ReactElement<TButtonIconProps>; | ||
iconRight?: ReactElement<TIconProps>; | ||
/** | ||
@@ -43,0 +38,0 @@ * If this is active, it means the button will persist in an "active" state when toggled (see `isToggled`), and back to normal state when untoggled |
{ | ||
"name": "@commercetools-uikit/primary-button", | ||
"description": "Primary buttons are used for a primary action on a page. You must also pass a label for accessibility reasons.", | ||
"version": "0.0.0-preview-fec-155-react-19-20250108172010", | ||
"version": "0.0.0-preview-fec-155-react-19-20250113184401", | ||
"bugs": "https://github.com/commercetools/ui-kit/issues", | ||
@@ -32,12 +32,11 @@ "repository": { | ||
"@babel/runtime-corejs3": "^7.20.13", | ||
"@commercetools-uikit/accessible-button": "0.0.0-preview-fec-155-react-19-20250108172010", | ||
"@commercetools-uikit/design-system": "0.0.0-preview-fec-155-react-19-20250108172010", | ||
"@commercetools-uikit/spacings-inline": "0.0.0-preview-fec-155-react-19-20250108172010", | ||
"@commercetools-uikit/text": "0.0.0-preview-fec-155-react-19-20250108172010", | ||
"@commercetools-uikit/utils": "0.0.0-preview-fec-155-react-19-20250108172010", | ||
"@commercetools-uikit/accessible-button": "0.0.0-preview-fec-155-react-19-20250113184401", | ||
"@commercetools-uikit/design-system": "0.0.0-preview-fec-155-react-19-20250113184401", | ||
"@commercetools-uikit/spacings-inline": "0.0.0-preview-fec-155-react-19-20250113184401", | ||
"@commercetools-uikit/text": "0.0.0-preview-fec-155-react-19-20250113184401", | ||
"@commercetools-uikit/utils": "0.0.0-preview-fec-155-react-19-20250113184401", | ||
"@emotion/react": "^11.10.5", | ||
"@emotion/styled": "^11.10.5", | ||
"lodash": "4.17.21", | ||
"prop-types": "15.8.1", | ||
"react-intl": "^7.1.0" | ||
"react-intl": "6.3.2" | ||
}, | ||
@@ -44,0 +43,0 @@ "devDependencies": { |
@@ -56,3 +56,3 @@ <!-- THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. --> | ||
| `iconLeft` | `ReactElement` | | | The left icon displayed within the button. | | ||
| `iconRight` | `ReactElement` | | | The right icon displayed within the button. | | ||
| `iconRight` | `ReactElement` | | | The right icon displayed within the . | | ||
| `isToggleButton` | `boolean` | | `false` | If this is active, it means the button will persist in an "active" state when toggled (see `isToggled`), and back to normal state when untoggled | | ||
@@ -59,0 +59,0 @@ | `isToggled` | `boolean` | | | Tells when the button should present a toggled state. It does not have any effect when `isToggleButton` is `false`. | |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
12
79
265896
1562
+ Added@commercetools-uikit/accessible-button@0.0.0-preview-fec-155-react-19-20250113184401(transitive)
+ Added@commercetools-uikit/design-system@0.0.0-preview-fec-155-react-19-20250113184401(transitive)
+ Added@commercetools-uikit/hooks@0.0.0-preview-fec-155-react-19-20250113184401(transitive)
+ Added@commercetools-uikit/spacings-inline@0.0.0-preview-fec-155-react-19-20250113184401(transitive)
+ Added@commercetools-uikit/text@0.0.0-preview-fec-155-react-19-20250113184401(transitive)
+ Added@commercetools-uikit/utils@0.0.0-preview-fec-155-react-19-20250113184401(transitive)
+ Added@formatjs/ecma402-abstract@1.14.3(transitive)
+ Added@formatjs/fast-memoize@2.0.1(transitive)
+ Added@formatjs/icu-messageformat-parser@2.3.0(transitive)
+ Added@formatjs/icu-skeleton-parser@1.3.18(transitive)
+ Added@formatjs/intl@2.6.9(transitive)
+ Added@formatjs/intl-displaynames@6.2.6(transitive)
+ Added@formatjs/intl-listformat@7.1.9(transitive)
+ Added@formatjs/intl-localematcher@0.2.32(transitive)
+ Addedintl-messageformat@10.3.3(transitive)
+ Addedreact-intl@6.3.2(transitive)
- Removedprop-types@15.8.1
- Removed@commercetools-uikit/accessible-button@0.0.0-preview-fec-155-react-19-20250108172010(transitive)
- Removed@commercetools-uikit/design-system@0.0.0-preview-fec-155-react-19-20250108172010(transitive)
- Removed@commercetools-uikit/hooks@0.0.0-preview-fec-155-react-19-20250108172010(transitive)
- Removed@commercetools-uikit/spacings-inline@0.0.0-preview-fec-155-react-19-20250108172010(transitive)
- Removed@commercetools-uikit/text@0.0.0-preview-fec-155-react-19-20250108172010(transitive)
- Removed@commercetools-uikit/utils@0.0.0-preview-fec-155-react-19-20250108172010(transitive)
- Removed@formatjs/ecma402-abstract@2.3.2(transitive)
- Removed@formatjs/fast-memoize@2.2.6(transitive)
- Removed@formatjs/icu-messageformat-parser@2.9.8(transitive)
- Removed@formatjs/icu-skeleton-parser@1.8.12(transitive)
- Removed@formatjs/intl@3.1.0(transitive)
- Removed@formatjs/intl-localematcher@0.5.10(transitive)
- Removeddecimal.js@10.4.3(transitive)
- Removedintl-messageformat@10.7.11(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact-intl@7.1.0(transitive)
Updated@commercetools-uikit/accessible-button@0.0.0-preview-fec-155-react-19-20250113184401
Updated@commercetools-uikit/design-system@0.0.0-preview-fec-155-react-19-20250113184401
Updated@commercetools-uikit/spacings-inline@0.0.0-preview-fec-155-react-19-20250113184401
Updated@commercetools-uikit/text@0.0.0-preview-fec-155-react-19-20250113184401
Updated@commercetools-uikit/utils@0.0.0-preview-fec-155-react-19-20250113184401
Updatedreact-intl@6.3.2