@nypl/design-system-react-components 1.1.0 → 1.1.1
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/CHANGELOG.md +14 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/design-system-react-components.cjs.development.js +31 -12
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +31 -12
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/theme/components/button.d.ts +19 -7
- package/dist/theme/components/header/headerSearchButton.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,20 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
|
|
|
8
8
|
|
|
9
9
|
## Prerelease
|
|
10
10
|
|
|
11
|
+
## 1.1.1 (September 19, 2022)
|
|
12
|
+
|
|
13
|
+
### Adds
|
|
14
|
+
|
|
15
|
+
- Adds the `text` variant in the `Button` component.
|
|
16
|
+
|
|
17
|
+
### Fixes
|
|
18
|
+
|
|
19
|
+
- Fixes a bug where the `defaultValue` for a `TextInput` component was not being passed correctly to the Chakra input element.
|
|
20
|
+
|
|
21
|
+
### Deprecates
|
|
22
|
+
|
|
23
|
+
- Deprecates the `link` variant in the `Button` component.
|
|
24
|
+
|
|
11
25
|
## 1.1.0 (Ausut 30, 2022)
|
|
12
26
|
|
|
13
27
|
This release is exactly the same as the `1.1.0-rc5` release candidate which was published and reviewed. Minor bug fixes, listed below, were made.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare type ButtonElementType = "submit" | "button" | "reset";
|
|
3
|
-
export declare type ButtonTypes = "primary" | "secondary" | "callout" | "pill" | "
|
|
3
|
+
export declare type ButtonTypes = "primary" | "secondary" | "text" | "callout" | "pill" | "noBrand" | "link";
|
|
4
4
|
interface ButtonProps {
|
|
5
5
|
/** The button variation to render based on the `ButtonTypes` type.*/
|
|
6
6
|
buttonType?: ButtonTypes;
|
|
@@ -1924,6 +1924,10 @@ var Button = /*#__PURE__*/react.chakra( /*#__PURE__*/React.forwardRef(function (
|
|
|
1924
1924
|
console.warn("NYPL Reservoir Button: This component's required `id` prop was not passed.");
|
|
1925
1925
|
}
|
|
1926
1926
|
|
|
1927
|
+
if (buttonType === "link") {
|
|
1928
|
+
console.warn("NYPL Reservoir Button: The 'link' value for the 'buttonType' prop has been deprecated.");
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1927
1931
|
React__default.Children.map(children, function (child) {
|
|
1928
1932
|
childCount++;
|
|
1929
1933
|
|
|
@@ -3817,6 +3821,7 @@ var TextInput = /*#__PURE__*/react.chakra( /*#__PURE__*/React.forwardRef(functio
|
|
|
3817
3821
|
|
|
3818
3822
|
|
|
3819
3823
|
options = isHidden ? {
|
|
3824
|
+
defaultValue: defaultValue,
|
|
3820
3825
|
id: id,
|
|
3821
3826
|
"aria-hidden": isHidden,
|
|
3822
3827
|
name: name,
|
|
@@ -4924,6 +4929,7 @@ var baseStyle = {
|
|
|
4924
4929
|
display: "flex",
|
|
4925
4930
|
cursor: "pointer",
|
|
4926
4931
|
color: "ui.white",
|
|
4932
|
+
fontWeight: "button.default",
|
|
4927
4933
|
height: "10",
|
|
4928
4934
|
justifyContent: "center",
|
|
4929
4935
|
lineHeight: "1.5",
|
|
@@ -4936,7 +4942,6 @@ var baseStyle = {
|
|
|
4936
4942
|
px: "inset.default",
|
|
4937
4943
|
textDecoration: "none",
|
|
4938
4944
|
wordWrap: "normal",
|
|
4939
|
-
fontWeight: "button.default",
|
|
4940
4945
|
svg: {
|
|
4941
4946
|
fill: "currentColor"
|
|
4942
4947
|
},
|
|
@@ -4949,17 +4954,17 @@ var baseStyle = {
|
|
|
4949
4954
|
_disabled: {
|
|
4950
4955
|
bg: "ui.gray.light-cool",
|
|
4951
4956
|
color: "ui.gray.dark",
|
|
4952
|
-
|
|
4953
|
-
|
|
4957
|
+
opacity: "1",
|
|
4958
|
+
pointerEvents: "none"
|
|
4954
4959
|
}
|
|
4955
4960
|
}; // Styles for different visual variants:
|
|
4956
4961
|
// primary, secondary, link, pill, iconOnly, callout, searchbar, noBrand
|
|
4957
4962
|
|
|
4958
4963
|
var primary = {
|
|
4959
4964
|
bg: "ui.link.primary",
|
|
4960
|
-
minWidth: "none",
|
|
4961
4965
|
height: "none",
|
|
4962
|
-
fontSize: "button.default"
|
|
4966
|
+
fontSize: "button.default",
|
|
4967
|
+
minWidth: "none"
|
|
4963
4968
|
};
|
|
4964
4969
|
var secondary = {
|
|
4965
4970
|
bg: "ui.white",
|
|
@@ -4977,8 +4982,8 @@ var secondary = {
|
|
|
4977
4982
|
};
|
|
4978
4983
|
var link = {
|
|
4979
4984
|
bg: "transparent",
|
|
4980
|
-
lineHeight: "2.5",
|
|
4981
4985
|
color: "ui.link.primary",
|
|
4986
|
+
lineHeight: "2.5",
|
|
4982
4987
|
textDecoration: "underline",
|
|
4983
4988
|
_disabled: {
|
|
4984
4989
|
bg: "transparent"
|
|
@@ -4988,15 +4993,27 @@ var link = {
|
|
|
4988
4993
|
color: "ui.link.secondary"
|
|
4989
4994
|
}
|
|
4990
4995
|
};
|
|
4996
|
+
var text = {
|
|
4997
|
+
bg: "transparent",
|
|
4998
|
+
color: "ui.link.primary",
|
|
4999
|
+
fontSize: "button.default",
|
|
5000
|
+
_disabled: {
|
|
5001
|
+
bg: "transparent"
|
|
5002
|
+
},
|
|
5003
|
+
_hover: {
|
|
5004
|
+
bg: "transparent",
|
|
5005
|
+
color: "ui.link.secondary"
|
|
5006
|
+
}
|
|
5007
|
+
};
|
|
4991
5008
|
var pill = {
|
|
4992
5009
|
bg: "ui.white",
|
|
4993
5010
|
border: "1px solid",
|
|
4994
5011
|
borderColor: "ui.gray.light-cool",
|
|
4995
|
-
color: "inherit",
|
|
4996
5012
|
borderRadius: "pill",
|
|
5013
|
+
color: "inherit",
|
|
5014
|
+
fontSize: "button.default",
|
|
4997
5015
|
py: "inset.narrow",
|
|
4998
5016
|
px: "inset.wide",
|
|
4999
|
-
fontSize: "button.default",
|
|
5000
5017
|
_hover: {
|
|
5001
5018
|
bg: "ui.gray.xx-light-cool",
|
|
5002
5019
|
borderColor: "ui.gray.medium"
|
|
@@ -5042,6 +5059,7 @@ var Button$1 = {
|
|
|
5042
5059
|
variants: {
|
|
5043
5060
|
primary: primary,
|
|
5044
5061
|
secondary: secondary,
|
|
5062
|
+
text: text,
|
|
5045
5063
|
link: link,
|
|
5046
5064
|
pill: pill,
|
|
5047
5065
|
iconOnly: iconOnly,
|
|
@@ -6529,6 +6547,7 @@ var HeaderSearchButton = {
|
|
|
6529
6547
|
minWidth: {
|
|
6530
6548
|
md: "80px"
|
|
6531
6549
|
},
|
|
6550
|
+
px: "0",
|
|
6532
6551
|
textDecoration: "none",
|
|
6533
6552
|
span: {
|
|
6534
6553
|
alignItems: "center",
|
|
@@ -12487,7 +12506,7 @@ var HeaderSearchButton$1 = /*#__PURE__*/react.chakra(function (_ref) {
|
|
|
12487
12506
|
"aria-haspopup": "true",
|
|
12488
12507
|
"aria-label": labelText,
|
|
12489
12508
|
"aria-expanded": isOpen ? true : null,
|
|
12490
|
-
buttonType: "
|
|
12509
|
+
buttonType: "text",
|
|
12491
12510
|
id: "searchButton",
|
|
12492
12511
|
onClick: function onClick() {
|
|
12493
12512
|
gaUtils.trackEvent(gaAction, gaLabel);
|
|
@@ -12697,7 +12716,7 @@ var HeaderLoginButton$1 = /*#__PURE__*/react.chakra(function (_ref) {
|
|
|
12697
12716
|
isDisabled: !isOpen
|
|
12698
12717
|
}, React__default.createElement(Button, {
|
|
12699
12718
|
"aria-label": desktopButtonLabel,
|
|
12700
|
-
buttonType: "
|
|
12719
|
+
buttonType: "text",
|
|
12701
12720
|
id: "loginButton",
|
|
12702
12721
|
onClick: function onClick() {
|
|
12703
12722
|
gaUtils.trackEvent(gaAction, gaLabel);
|
|
@@ -12824,7 +12843,7 @@ var HeaderMobileNavButton$1 = /*#__PURE__*/react.chakra(function () {
|
|
|
12824
12843
|
"aria-haspopup": "true",
|
|
12825
12844
|
"aria-label": isOpen ? "Close Navigation" : "Open Navigation",
|
|
12826
12845
|
"aria-expanded": isOpen ? true : null,
|
|
12827
|
-
buttonType: "
|
|
12846
|
+
buttonType: "text",
|
|
12828
12847
|
id: "mobileNav-btn",
|
|
12829
12848
|
onClick: function onClick() {
|
|
12830
12849
|
gaUtils.trackEvent("Click", "Mobile mobileMenu");
|
|
@@ -12991,7 +13010,7 @@ var Notification$1 = /*#__PURE__*/react.chakra( /*#__PURE__*/React.forwardRef(fu
|
|
|
12991
13010
|
|
|
12992
13011
|
var dismissibleButton = dismissible && React__default.createElement(Button, {
|
|
12993
13012
|
"aria-label": "Close the notification",
|
|
12994
|
-
buttonType: "
|
|
13013
|
+
buttonType: "text",
|
|
12995
13014
|
id: id + "-notification-dismissible-button",
|
|
12996
13015
|
onClick: handleClose,
|
|
12997
13016
|
__css: styles.dismissibleButton
|