@skyscanner/backpack-web 34.1.1 → 34.3.0

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.
Files changed (68) hide show
  1. package/bpk-component-autosuggest/src/BpkAutosuggest.module.css +1 -1
  2. package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +3 -5
  3. package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +3 -5
  4. package/bpk-component-button/BpkButtonDestructive.d.ts +4 -0
  5. package/bpk-component-button/BpkButtonDestructive.js +9 -1
  6. package/bpk-component-button/BpkButtonFeatured.d.ts +4 -0
  7. package/bpk-component-button/BpkButtonFeatured.js +9 -1
  8. package/bpk-component-button/BpkButtonLink.d.ts +4 -0
  9. package/bpk-component-button/BpkButtonLink.js +9 -1
  10. package/bpk-component-button/BpkButtonLinkOnDark.d.ts +4 -0
  11. package/bpk-component-button/BpkButtonLinkOnDark.js +8 -1
  12. package/bpk-component-button/BpkButtonPrimary.d.ts +4 -0
  13. package/bpk-component-button/BpkButtonPrimary.js +8 -1
  14. package/bpk-component-button/BpkButtonPrimaryOnDark.d.ts +4 -0
  15. package/bpk-component-button/BpkButtonPrimaryOnDark.js +9 -1
  16. package/bpk-component-button/BpkButtonPrimaryOnLight.d.ts +4 -0
  17. package/bpk-component-button/BpkButtonPrimaryOnLight.js +9 -1
  18. package/bpk-component-button/BpkButtonSecondary.d.ts +4 -0
  19. package/bpk-component-button/BpkButtonSecondary.js +9 -1
  20. package/bpk-component-button/BpkButtonSecondaryOnDark.d.ts +4 -0
  21. package/bpk-component-button/BpkButtonSecondaryOnDark.js +9 -1
  22. package/bpk-component-button/index.d.ts +9 -9
  23. package/bpk-component-button/index.js +10 -20
  24. package/bpk-component-button/src/BpkButton.d.ts +56 -0
  25. package/bpk-component-button/src/BpkButton.js +31 -24
  26. package/bpk-component-button/src/BpkButtonBase.d.ts +53 -0
  27. package/bpk-component-button/src/BpkButtonBase.js +70 -43
  28. package/bpk-component-button/src/BpkButtonBase.module.css +1 -1
  29. package/bpk-component-button/src/common-types.d.ts +37 -0
  30. package/bpk-component-button/src/common-types.js +16 -15
  31. package/bpk-component-card/src/BpkCard.d.ts +1 -1
  32. package/bpk-component-card/src/BpkCard.js +4 -1
  33. package/bpk-component-card/src/BpkCard.module.css +1 -1
  34. package/bpk-component-card/src/BpkCardWrapper.js +18 -12
  35. package/bpk-component-card/src/BpkDividedCard.d.ts +1 -1
  36. package/bpk-component-card/src/BpkDividedCard.js +26 -19
  37. package/bpk-component-card/src/BpkDividedCard.module.css +1 -1
  38. package/bpk-component-card/src/CardContext.d.ts +14 -0
  39. package/{bpk-component-button/src/BpkButtonPrimary.js → bpk-component-card/src/CardContext.js} +11 -15
  40. package/bpk-component-dialog/src/BpkDialogInner.js +3 -5
  41. package/bpk-component-dialog/src/BpkDialogInner.module.css +1 -1
  42. package/bpk-component-popover/src/BpkPopover.js +1 -0
  43. package/bpk-component-popover/src/BpkPopover.module.css +1 -1
  44. package/bpk-component-text/src/BpkText.d.ts +3 -0
  45. package/bpk-component-text/src/BpkText.js +4 -1
  46. package/bpk-component-text/src/BpkText.module.css +1 -1
  47. package/bpk-mixins/_typography.scss +51 -0
  48. package/bpk-stylesheets/larken.css +18 -0
  49. package/bpk-stylesheets/larken.js +19 -0
  50. package/bpk-stylesheets/larken.scss +37 -0
  51. package/package.json +2 -2
  52. package/unstable__bpk-mixins/_typography.scss +51 -0
  53. package/bpk-component-button/src/BpkButtonDestructive.js +0 -48
  54. package/bpk-component-button/src/BpkButtonDestructive.module.css +0 -18
  55. package/bpk-component-button/src/BpkButtonFeatured.js +0 -48
  56. package/bpk-component-button/src/BpkButtonFeatured.module.css +0 -18
  57. package/bpk-component-button/src/BpkButtonLink.js +0 -53
  58. package/bpk-component-button/src/BpkButtonLink.module.css +0 -18
  59. package/bpk-component-button/src/BpkButtonLinkOnDark.js +0 -53
  60. package/bpk-component-button/src/BpkButtonLinkOnDark.module.css +0 -18
  61. package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +0 -48
  62. package/bpk-component-button/src/BpkButtonPrimaryOnDark.module.css +0 -18
  63. package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +0 -48
  64. package/bpk-component-button/src/BpkButtonPrimaryOnLight.module.css +0 -18
  65. package/bpk-component-button/src/BpkButtonSecondary.js +0 -47
  66. package/bpk-component-button/src/BpkButtonSecondary.module.css +0 -18
  67. package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +0 -48
  68. package/bpk-component-button/src/BpkButtonSecondaryOnDark.module.css +0 -18
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-autosuggest__container--open{position:relative}.bpk-autosuggest__suggestions-container{display:none}.bpk-autosuggest__suggestions-container--open{position:absolute;top:100%;display:block;z-index:900;width:100%;margin-top:.75rem}.bpk-autosuggest__suggestions-container--open::before{position:absolute;bottom:100%;left:50%;content:" ";display:block;margin-bottom:-0.0625rem;margin-left:-0.8125rem;border:.8125rem solid rgba(0,0,0,0);border-bottom-color:#e0e4e9;pointer-events:none}.bpk-autosuggest__suggestions-container--open::after{position:absolute;bottom:100%;left:50%;content:" ";display:block;margin-bottom:-0.0625rem;margin-left:-0.75rem;border:.75rem solid rgba(0,0,0,0);border-bottom-color:#fff;pointer-events:none}.bpk-autosuggest__suggestions-list{min-width:fit-content;margin:0;padding:0;list-style:none;overflow:hidden;border:.0625rem solid #e0e4e9;background-color:#fff;border-radius:.5rem;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}.bpk-autosuggest__suggestion-item{cursor:pointer;margin:0;font-size:1rem;line-height:1.5rem;font-weight:400}.bpk-autosuggest__suggestion-item:not(:last-child){box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-autosuggest__suggestion-item:active{background-color:#eff3f8}.bpk-autosuggest__suggestion-item--highlighted{background-color:#eff3f8}.bpk-autosuggest__suggestion{display:table;width:100%;padding:1rem}.bpk-autosuggest__suggestion--indent{padding-left:2rem}.bpk-autosuggest__suggestion-icon{display:table-cell;margin-right:.5rem;vertical-align:top;fill:#626971}html[dir=rtl] .bpk-autosuggest__suggestion-icon{margin-right:0;margin-left:.5rem}.bpk-autosuggest__suggestion-content{display:table-cell;width:100%;vertical-align:top}.bpk-autosuggest__suggestion-inner{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.bpk-autosuggest__suggestion-value{display:block}.bpk-autosuggest__suggestion-sub-heading{display:table-cell;width:100%;vertical-align:top;margin:0;font-size:.75rem;line-height:1rem;font-weight:400}.bpk-autosuggest__suggestion-tertiary-label{display:table-cell;align-self:center;color:#626971;vertical-align:top;word-break:keep-all;margin:0;font-size:.75rem;line-height:1rem;font-weight:400}
18
+ .bpk-autosuggest__container--open{position:relative}.bpk-autosuggest__suggestions-container{display:none}.bpk-autosuggest__suggestions-container--open{position:absolute;top:100%;display:block;z-index:900;width:100%;margin-top:.75rem}.bpk-autosuggest__suggestions-container--open::before{position:absolute;bottom:100%;left:50%;content:" ";display:block;margin-bottom:-0.0625rem;margin-left:-0.8125rem;border:.8125rem solid rgba(0,0,0,0);border-bottom-color:#e0e4e9;pointer-events:none}.bpk-autosuggest__suggestions-container--open::after{position:absolute;bottom:100%;left:50%;content:" ";display:block;margin-bottom:-0.0625rem;margin-left:-0.75rem;border:.75rem solid rgba(0,0,0,0);border-bottom-color:#fff;pointer-events:none}.bpk-autosuggest__suggestions-list{min-width:fit-content;margin:0;padding:0;list-style:none;overflow:hidden;border:.0625rem solid #e0e4e9;background-color:#fff;border-radius:.5rem;box-shadow:0px 4px 14px 0px rgba(37,32,31,.25)}.bpk-autosuggest__suggestion-item{cursor:pointer;margin:0;font-size:1rem;line-height:1.5rem;font-weight:400}.bpk-autosuggest__suggestion-item:not(:last-child){box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-autosuggest__suggestion-item:active{background-color:#eff3f8}.bpk-autosuggest__suggestion-item--highlighted{background-color:#eff3f8}.bpk-autosuggest__suggestion{display:table;width:100%;padding:1rem}.bpk-autosuggest__suggestion--indent{padding-left:2rem}.bpk-autosuggest__suggestion-icon{display:flex;margin-right:.5rem;vertical-align:top;fill:#626971}html[dir=rtl] .bpk-autosuggest__suggestion-icon{margin-right:0;margin-left:.5rem}.bpk-autosuggest__suggestion-content{display:table-cell;width:100%;vertical-align:top}.bpk-autosuggest__suggestion-inner{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.bpk-autosuggest__suggestion-value{display:block}.bpk-autosuggest__suggestion-sub-heading{display:table-cell;width:100%;vertical-align:top;margin:0;font-size:.75rem;line-height:1rem;font-weight:400}.bpk-autosuggest__suggestion-tertiary-label{display:table-cell;align-self:center;color:#626971;vertical-align:top;word-break:keep-all;margin:0;font-size:.75rem;line-height:1rem;font-weight:400}
@@ -43,11 +43,9 @@ const BpkAutosuggestSuggestion = props => {
43
43
  _jsxs("section", {
44
44
  className: classNames.join(' '),
45
45
  ...rest,
46
- children: [icon ? /*#__PURE__*/_jsx(Icon
47
- // TODO: className to be removed
48
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
49
- , {
50
- className: getClassName('bpk-autosuggest__suggestion-icon')
46
+ children: [icon ? /*#__PURE__*/_jsx("div", {
47
+ className: getClassName('bpk-autosuggest__suggestion-icon'),
48
+ children: /*#__PURE__*/_jsx(Icon, {})
51
49
  }) : null, /*#__PURE__*/_jsx("div", {
52
50
  className: getClassName('bpk-autosuggest__suggestion-content'),
53
51
  children: /*#__PURE__*/_jsxs("div", {
@@ -60,11 +60,9 @@ const getIconForType = (type, CustomIcon) => {
60
60
  };
61
61
  const Icon = CustomIcon || componentMap[type];
62
62
  const AlignedIcon = withButtonAlignment(Icon);
63
-
64
- // TODO: className to be removed
65
- // eslint-disable-next-line @skyscanner/rules/forbid-component-props
66
- return /*#__PURE__*/_jsx(AlignedIcon, {
67
- className: className
63
+ return /*#__PURE__*/_jsx("span", {
64
+ className: className,
65
+ children: /*#__PURE__*/_jsx(AlignedIcon, {})
68
66
  });
69
67
  };
70
68
  const ToggleButton = props => {
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonDestructive: (props: Props) => JSX.Element;
4
+ export default BpkButtonDestructive;
@@ -14,4 +14,12 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonDestructive";
17
+ */
18
+
19
+ import BpkButton from "./src/BpkButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkButtonDestructive = props => /*#__PURE__*/_jsx(BpkButton, {
22
+ ...props,
23
+ destructive: true
24
+ });
25
+ export default BpkButtonDestructive;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonFeatured: (props: Props) => JSX.Element;
4
+ export default BpkButtonFeatured;
@@ -14,4 +14,12 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonFeatured";
17
+ */
18
+
19
+ import BpkButton from "./src/BpkButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkButtonFeatured = props => /*#__PURE__*/_jsx(BpkButton, {
22
+ ...props,
23
+ featured: true
24
+ });
25
+ export default BpkButtonFeatured;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonLink: (props: Props) => JSX.Element;
4
+ export default BpkButtonLink;
@@ -14,4 +14,12 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonLink";
17
+ */
18
+
19
+ import BpkButton from "./src/BpkButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkButtonLink = props => /*#__PURE__*/_jsx(BpkButton, {
22
+ ...props,
23
+ link: true
24
+ });
25
+ export default BpkButtonLink;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonLinkOnDark: (props: Props) => JSX.Element;
4
+ export default BpkButtonLinkOnDark;
@@ -14,4 +14,11 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonLinkOnDark";
17
+ */
18
+ import BpkButton from "./src/BpkButton";
19
+ import { jsx as _jsx } from "react/jsx-runtime";
20
+ const BpkButtonLinkOnDark = props => /*#__PURE__*/_jsx(BpkButton, {
21
+ ...props,
22
+ linkOnDark: true
23
+ });
24
+ export default BpkButtonLinkOnDark;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonPrimary: (props: Props) => JSX.Element;
4
+ export default BpkButtonPrimary;
@@ -14,4 +14,11 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonPrimary";
17
+ */
18
+
19
+ import BpkButton from "./src/BpkButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkButtonPrimary = props => /*#__PURE__*/_jsx(BpkButton, {
22
+ ...props
23
+ });
24
+ export default BpkButtonPrimary;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonPrimaryOnDark: (props: Props) => JSX.Element;
4
+ export default BpkButtonPrimaryOnDark;
@@ -14,4 +14,12 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonPrimaryOnDark";
17
+ */
18
+
19
+ import BpkButton from "./src/BpkButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkButtonPrimaryOnDark = props => /*#__PURE__*/_jsx(BpkButton, {
22
+ ...props,
23
+ primaryOnDark: true
24
+ });
25
+ export default BpkButtonPrimaryOnDark;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonPrimaryOnLight: (props: Props) => JSX.Element;
4
+ export default BpkButtonPrimaryOnLight;
@@ -14,4 +14,12 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonPrimaryOnLight";
17
+ */
18
+
19
+ import BpkButton from "./src/BpkButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkButtonPrimaryOnLight = props => /*#__PURE__*/_jsx(BpkButton, {
22
+ ...props,
23
+ primaryOnLight: true
24
+ });
25
+ export default BpkButtonPrimaryOnLight;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonSecondary: (props: Props) => JSX.Element;
4
+ export default BpkButtonSecondary;
@@ -14,4 +14,12 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonSecondary";
17
+ */
18
+
19
+ import BpkButton from "./src/BpkButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkButtonSecondary = props => /*#__PURE__*/_jsx(BpkButton, {
22
+ ...props,
23
+ secondary: true
24
+ });
25
+ export default BpkButtonSecondary;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './src/BpkButton';
3
+ declare const BpkButtonSecondaryOnDark: (props: Props) => JSX.Element;
4
+ export default BpkButtonSecondaryOnDark;
@@ -14,4 +14,12 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */export { default } from "./src/BpkButtonSecondaryOnDark";
17
+ */
18
+
19
+ import BpkButton from "./src/BpkButton";
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ const BpkButtonSecondaryOnDark = props => /*#__PURE__*/_jsx(BpkButton, {
22
+ ...props,
23
+ secondaryOnDark: true
24
+ });
25
+ export default BpkButtonSecondaryOnDark;
@@ -1,13 +1,13 @@
1
+ import BpkButtonDestructive from './BpkButtonDestructive';
2
+ import BpkButtonFeatured from './BpkButtonFeatured';
3
+ import BpkButtonLink from './BpkButtonLink';
4
+ import BpkButtonLinkOnDark from './BpkButtonLinkOnDark';
5
+ import BpkButtonPrimary from './BpkButtonPrimary';
6
+ import BpkButtonPrimaryOnDark from './BpkButtonPrimaryOnDark';
7
+ import BpkButtonPrimaryOnLight from './BpkButtonPrimaryOnLight';
8
+ import BpkButtonSecondary from './BpkButtonSecondary';
9
+ import BpkButtonSecondaryOnDark from './BpkButtonSecondaryOnDark';
1
10
  import BpkButton from './src/BpkButton';
2
- import BpkButtonDestructive from './src/BpkButtonDestructive';
3
- import BpkButtonFeatured from './src/BpkButtonFeatured';
4
- import BpkButtonLink from './src/BpkButtonLink';
5
- import BpkButtonLinkOnDark from './src/BpkButtonLinkOnDark';
6
- import BpkButtonPrimary from './src/BpkButtonPrimary';
7
- import BpkButtonPrimaryOnDark from './src/BpkButtonPrimaryOnDark';
8
- import BpkButtonPrimaryOnLight from './src/BpkButtonPrimaryOnLight';
9
- import BpkButtonSecondary from './src/BpkButtonSecondary';
10
- import BpkButtonSecondaryOnDark from './src/BpkButtonSecondaryOnDark';
11
11
  import { BpkButtonV2 } from './src/BpkButtonV2/BpkButton';
12
12
  export { BUTTON_TYPES, SIZE_TYPES } from './src/BpkButtonV2/common-types';
13
13
  export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes, } from './themeAttributes';
@@ -16,26 +16,16 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
20
- import BpkButton from "./src/BpkButton"; // eslint-disable-line import/no-named-as-default, import/no-named-as-default-member
21
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
- import BpkButtonDestructive from "./src/BpkButtonDestructive";
23
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
24
- import BpkButtonFeatured from "./src/BpkButtonFeatured";
25
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
26
- import BpkButtonLink from "./src/BpkButtonLink"; // eslint-disable-line import/no-named-as-default, import/no-named-as-default-member
27
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
28
- import BpkButtonLinkOnDark from "./src/BpkButtonLinkOnDark"; // eslint-disable-line import/no-named-as-default, import/no-named-as-default-member
29
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
30
- import BpkButtonPrimary from "./src/BpkButtonPrimary";
31
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
32
- import BpkButtonPrimaryOnDark from "./src/BpkButtonPrimaryOnDark";
33
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
34
- import BpkButtonPrimaryOnLight from "./src/BpkButtonPrimaryOnLight";
35
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
36
- import BpkButtonSecondary from "./src/BpkButtonSecondary";
37
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
38
- import BpkButtonSecondaryOnDark from "./src/BpkButtonSecondaryOnDark";
19
+ import BpkButtonDestructive from "./BpkButtonDestructive";
20
+ import BpkButtonFeatured from "./BpkButtonFeatured";
21
+ import BpkButtonLink from "./BpkButtonLink";
22
+ import BpkButtonLinkOnDark from "./BpkButtonLinkOnDark";
23
+ import BpkButtonPrimary from "./BpkButtonPrimary";
24
+ import BpkButtonPrimaryOnDark from "./BpkButtonPrimaryOnDark";
25
+ import BpkButtonPrimaryOnLight from "./BpkButtonPrimaryOnLight";
26
+ import BpkButtonSecondary from "./BpkButtonSecondary";
27
+ import BpkButtonSecondaryOnDark from "./BpkButtonSecondaryOnDark";
28
+ import BpkButton from "./src/BpkButton";
39
29
  import { BpkButtonV2 } from "./src/BpkButtonV2/BpkButton";
40
30
  export { BUTTON_TYPES, SIZE_TYPES } from "./src/BpkButtonV2/common-types";
41
31
  export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes } from "./themeAttributes";
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ import { type Props as CommonProps } from './common-types';
4
+ export type Props = CommonProps & {
5
+ primaryOnDark?: boolean;
6
+ primaryOnLight?: boolean;
7
+ secondary?: boolean;
8
+ secondaryOnDark?: boolean;
9
+ destructive?: boolean;
10
+ featured?: boolean;
11
+ link?: boolean;
12
+ linkOnDark?: boolean;
13
+ };
14
+ declare const BpkButton: {
15
+ (props: Props): JSX.Element;
16
+ defaultProps: {
17
+ primaryOnDark: boolean;
18
+ primaryOnLight: boolean;
19
+ secondary: boolean;
20
+ secondaryOnDark: boolean;
21
+ destructive: boolean;
22
+ featured: boolean;
23
+ link: boolean;
24
+ linkOnDark: boolean;
25
+ href: null;
26
+ className: null;
27
+ disabled: boolean;
28
+ onClick: null;
29
+ submit: boolean;
30
+ large: boolean;
31
+ iconOnly: boolean;
32
+ blank: boolean;
33
+ rel: null;
34
+ };
35
+ propTypes: {
36
+ primaryOnDark: PropTypes.Requireable<boolean>;
37
+ primaryOnLight: PropTypes.Requireable<boolean>;
38
+ secondary: PropTypes.Requireable<boolean>;
39
+ secondaryOnDark: PropTypes.Requireable<boolean>;
40
+ destructive: PropTypes.Requireable<boolean>;
41
+ featured: PropTypes.Requireable<boolean>;
42
+ link: PropTypes.Requireable<boolean>;
43
+ linkOnDark: PropTypes.Requireable<boolean>;
44
+ children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
45
+ href: PropTypes.Requireable<string>;
46
+ className: PropTypes.Requireable<string>;
47
+ disabled: PropTypes.Requireable<boolean>;
48
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
49
+ submit: PropTypes.Requireable<boolean>;
50
+ large: PropTypes.Requireable<boolean>;
51
+ iconOnly: PropTypes.Requireable<boolean>;
52
+ blank: PropTypes.Requireable<boolean>;
53
+ rel: PropTypes.Requireable<string>;
54
+ };
55
+ };
56
+ export default BpkButton;
@@ -14,10 +14,9 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
18
-
19
- // eslint-disable-next-line import/no-cycle
20
- import { BpkButtonPrimary, BpkButtonPrimaryOnDark, BpkButtonPrimaryOnLight, BpkButtonSecondary, BpkButtonSecondaryOnDark, BpkButtonDestructive, BpkButtonLink, BpkButtonLinkOnDark, BpkButtonFeatured } from "../index";
17
+ */
18
+ import PropTypes from 'prop-types';
19
+ import BpkButtonBase, { BUTTON_TYPES } from "./BpkButtonBase";
21
20
  import { propTypes, defaultProps } from "./common-types";
22
21
  import { jsx as _jsx } from "react/jsx-runtime";
23
22
  const BpkButton = props => {
@@ -33,60 +32,57 @@ const BpkButton = props => {
33
32
  ...rest
34
33
  } = props;
35
34
  if (primaryOnDark) {
36
- return /*#__PURE__*/_jsx(BpkButtonPrimaryOnDark, {
35
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
36
+ type: BUTTON_TYPES.primaryOnDark,
37
37
  ...rest
38
38
  });
39
39
  }
40
40
  if (primaryOnLight) {
41
- return /*#__PURE__*/_jsx(BpkButtonPrimaryOnLight, {
41
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
42
+ type: BUTTON_TYPES.primaryOnLight,
42
43
  ...rest
43
44
  });
44
45
  }
45
46
  if (secondary) {
46
- return /*#__PURE__*/_jsx(BpkButtonSecondary, {
47
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
48
+ type: BUTTON_TYPES.secondary,
47
49
  ...rest
48
50
  });
49
51
  }
50
52
  if (secondaryOnDark) {
51
- return /*#__PURE__*/_jsx(BpkButtonSecondaryOnDark, {
53
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
54
+ type: BUTTON_TYPES.secondaryOnDark,
52
55
  ...rest
53
56
  });
54
57
  }
55
58
  if (destructive) {
56
- return /*#__PURE__*/_jsx(BpkButtonDestructive, {
59
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
60
+ type: BUTTON_TYPES.destructive,
57
61
  ...rest
58
62
  });
59
63
  }
60
64
  if (featured) {
61
- return /*#__PURE__*/_jsx(BpkButtonFeatured, {
65
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
66
+ type: BUTTON_TYPES.featured,
62
67
  ...rest
63
68
  });
64
69
  }
65
70
  if (link) {
66
- return /*#__PURE__*/_jsx(BpkButtonLink, {
71
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
72
+ type: BUTTON_TYPES.link,
67
73
  ...rest
68
74
  });
69
75
  }
70
76
  if (linkOnDark) {
71
- return /*#__PURE__*/_jsx(BpkButtonLinkOnDark, {
77
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
78
+ type: BUTTON_TYPES.linkOnDark,
72
79
  ...rest
73
80
  });
74
81
  }
75
- return /*#__PURE__*/_jsx(BpkButtonPrimary, {
82
+ return /*#__PURE__*/_jsx(BpkButtonBase, {
76
83
  ...rest
77
84
  });
78
85
  };
79
- BpkButton.propTypes = {
80
- ...propTypes,
81
- primaryOnDark: PropTypes.bool,
82
- primaryOnLight: PropTypes.bool,
83
- secondary: PropTypes.bool,
84
- secondaryOnDark: PropTypes.bool,
85
- destructive: PropTypes.bool,
86
- featured: PropTypes.bool,
87
- link: PropTypes.bool,
88
- linkOnDark: PropTypes.bool
89
- };
90
86
  BpkButton.defaultProps = {
91
87
  ...defaultProps,
92
88
  primaryOnDark: false,
@@ -98,4 +94,15 @@ BpkButton.defaultProps = {
98
94
  link: false,
99
95
  linkOnDark: false
100
96
  };
97
+ BpkButton.propTypes = {
98
+ ...propTypes,
99
+ primaryOnDark: PropTypes.bool,
100
+ primaryOnLight: PropTypes.bool,
101
+ secondary: PropTypes.bool,
102
+ secondaryOnDark: PropTypes.bool,
103
+ destructive: PropTypes.bool,
104
+ featured: PropTypes.bool,
105
+ link: PropTypes.bool,
106
+ linkOnDark: PropTypes.bool
107
+ };
101
108
  export default BpkButton;
@@ -0,0 +1,53 @@
1
+ /// <reference types="react" />
2
+ import { type Props } from './common-types';
3
+ export declare const BUTTON_TYPES: {
4
+ readonly primary: "primary";
5
+ readonly primaryOnDark: "primary-on-dark";
6
+ readonly primaryOnLight: "primary-on-light";
7
+ readonly secondary: "secondary";
8
+ readonly secondaryOnDark: "secondary-on-dark";
9
+ readonly destructive: "destructive";
10
+ readonly featured: "featured";
11
+ readonly link: "link";
12
+ readonly linkOnDark: "link-on-dark";
13
+ };
14
+ type ValueOf<T> = T[keyof T];
15
+ declare const BpkButtonBase: {
16
+ (props: Props & {
17
+ type?: ValueOf<{
18
+ readonly primary: "primary";
19
+ readonly primaryOnDark: "primary-on-dark";
20
+ readonly primaryOnLight: "primary-on-light";
21
+ readonly secondary: "secondary";
22
+ readonly secondaryOnDark: "secondary-on-dark";
23
+ readonly destructive: "destructive";
24
+ readonly featured: "featured";
25
+ readonly link: "link";
26
+ readonly linkOnDark: "link-on-dark";
27
+ }> | undefined;
28
+ }): JSX.Element;
29
+ propTypes: {
30
+ children: import("prop-types").Validator<NonNullable<import("prop-types").ReactNodeLike>>;
31
+ href: import("prop-types").Requireable<string>;
32
+ className: import("prop-types").Requireable<string>;
33
+ disabled: import("prop-types").Requireable<boolean>;
34
+ onClick: import("prop-types").Requireable<(...args: any[]) => any>;
35
+ submit: import("prop-types").Requireable<boolean>;
36
+ large: import("prop-types").Requireable<boolean>;
37
+ iconOnly: import("prop-types").Requireable<boolean>;
38
+ blank: import("prop-types").Requireable<boolean>;
39
+ rel: import("prop-types").Requireable<string>;
40
+ };
41
+ defaultProps: {
42
+ href: null;
43
+ className: null;
44
+ disabled: boolean;
45
+ onClick: null;
46
+ submit: boolean;
47
+ large: boolean;
48
+ iconOnly: boolean;
49
+ blank: boolean;
50
+ rel: null;
51
+ };
52
+ };
53
+ export default BpkButtonBase;