@skyscanner/backpack-web 41.17.0 → 41.19.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 (62) hide show
  1. package/bpk-component-badge/index.d.ts +2 -2
  2. package/bpk-component-badge/index.js +2 -2
  3. package/bpk-component-badge/src/BpkBadge.module.css +1 -1
  4. package/bpk-component-badge/src/themeAttributes.d.ts +25 -2
  5. package/bpk-component-badge/src/themeAttributes.js +27 -1
  6. package/bpk-component-button/index.d.ts +2 -2
  7. package/bpk-component-button/index.js +1 -1
  8. package/bpk-component-button/src/BpkButtonV2/BpkButton.d.ts +1 -1
  9. package/bpk-component-button/src/BpkButtonV2/BpkButton.js +38 -6
  10. package/bpk-component-button/src/BpkButtonV2/BpkButton.module.css +1 -1
  11. package/bpk-component-button/src/BpkButtonV2/common-types.d.ts +2 -0
  12. package/bpk-component-button/src/themeAttributes.d.ts +1 -0
  13. package/bpk-component-button/src/themeAttributes.js +3 -2
  14. package/bpk-component-chat-notification/index.d.ts +2 -0
  15. package/bpk-component-chat-notification/index.js +19 -0
  16. package/bpk-component-chat-notification/src/BpkChatNotification.d.ts +9 -0
  17. package/bpk-component-chat-notification/src/BpkChatNotification.js +43 -0
  18. package/bpk-component-chat-notification/src/BpkChatNotification.module.css +18 -0
  19. package/bpk-component-chat-thought-bubble/index.d.ts +3 -0
  20. package/bpk-component-chat-thought-bubble/index.js +20 -0
  21. package/bpk-component-chat-thought-bubble/src/BpkChatThoughtBubble.d.ts +8 -0
  22. package/bpk-component-chat-thought-bubble/src/BpkChatThoughtBubble.js +46 -0
  23. package/bpk-component-chat-thought-bubble/src/BpkChatThoughtBubble.module.css +18 -0
  24. package/bpk-component-chip/index.d.ts +2 -2
  25. package/bpk-component-chip/index.js +2 -2
  26. package/bpk-component-chip/src/BpkSelectableChip.module.css +1 -1
  27. package/bpk-component-chip/src/themeAttributes.d.ts +4 -0
  28. package/bpk-component-chip/src/themeAttributes.js +7 -1
  29. package/bpk-component-pagination/src/BpkPaginationPage.module.css +1 -1
  30. package/bpk-component-scrollable-calendar/src/utils.d.ts +1 -1
  31. package/bpk-component-segmented-control/index.d.ts +2 -0
  32. package/bpk-component-segmented-control/index.js +2 -1
  33. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.d.ts +19 -0
  34. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.js +81 -0
  35. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.module.css +18 -0
  36. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/common-types.d.ts +57 -0
  37. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/common-types.js +24 -0
  38. package/bpk-component-table/index.d.ts +13 -0
  39. package/bpk-component-table/index.js +3 -1
  40. package/bpk-component-table/src/BpkTable.d.ts +8 -0
  41. package/bpk-component-table/src/BpkTable.js +7 -14
  42. package/bpk-component-table/src/BpkTableBody.d.ts +7 -0
  43. package/bpk-component-table/src/BpkTableBody.js +3 -5
  44. package/bpk-component-table/src/BpkTableCell.d.ts +9 -0
  45. package/bpk-component-table/src/BpkTableCell.js +7 -15
  46. package/bpk-component-table/src/BpkTableHead.d.ts +7 -0
  47. package/bpk-component-table/src/BpkTableHead.js +3 -5
  48. package/bpk-component-table/src/BpkTableHeadCell.d.ts +9 -0
  49. package/bpk-component-table/src/BpkTableHeadCell.js +2 -6
  50. package/bpk-component-table/src/BpkTableRow.d.ts +7 -0
  51. package/bpk-component-table/src/BpkTableRow.js +3 -5
  52. package/bpk-component-thumb-button/index.d.ts +3 -0
  53. package/bpk-component-thumb-button/index.js +20 -0
  54. package/bpk-component-thumb-button/src/BpkThumbButton.d.ts +21 -0
  55. package/bpk-component-thumb-button/src/BpkThumbButton.js +52 -0
  56. package/bpk-component-thumb-button/src/BpkThumbButton.module.css +18 -0
  57. package/bpk-mixins/_badges.scss +147 -25
  58. package/bpk-mixins/_buttons.scss +173 -79
  59. package/bpk-mixins/_chips.scss +104 -18
  60. package/bpk-mixins/_index.scss +1 -0
  61. package/bpk-mixins/_segmented-control.scss +263 -0
  62. package/package.json +2 -1
@@ -16,4 +16,10 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- export default ['chipDefaultSelectedBackgroundColor', 'chipDefaultSelectedTextColor', 'chipOnDarkSelectedBackgroundColor', 'chipOnDarkSelectedTextColor', 'chipOnImageSelectedBackgroundColor', 'chipOnImageSelectedHoverBackgroundColor', 'chipOnImageSelectedActiveBackgroundColor', 'chipOnImageSelectedTextColor'];
19
+ // Backward-compatible: original 8 selected-state attributes.
20
+ // Do not modify — existing consumers depend on this exact list.
21
+ export default ['chipDefaultSelectedBackgroundColor', 'chipDefaultSelectedTextColor', 'chipOnDarkSelectedBackgroundColor', 'chipOnDarkSelectedTextColor', 'chipOnImageSelectedBackgroundColor', 'chipOnImageSelectedHoverBackgroundColor', 'chipOnImageSelectedActiveBackgroundColor', 'chipOnImageSelectedTextColor'];
22
+ export const chipBorderRadiusThemeAttributes = ['chipBorderRadius'];
23
+ export const chipDefaultThemeAttributes = ['chipDefaultBackgroundColor', 'chipDefaultTextColor', 'chipDefaultBorderColor', 'chipDefaultHoverBackgroundColor', 'chipDefaultHoverBorderColor', 'chipDefaultActiveBorderColor', 'chipDefaultSelectedBackgroundColor', 'chipDefaultSelectedTextColor', 'chipDefaultSelectedHoverBackgroundColor', 'chipDefaultSelectedActiveBackgroundColor'];
24
+ export const chipOnDarkThemeAttributes = ['chipOnDarkBackgroundColor', 'chipOnDarkTextColor', 'chipOnDarkBorderColor', 'chipOnDarkHoverBorderColor', 'chipOnDarkActiveBorderColor', 'chipOnDarkSelectedBackgroundColor', 'chipOnDarkSelectedTextColor', 'chipOnDarkSelectedHoverBackgroundColor', 'chipOnDarkSelectedActiveBackgroundColor'];
25
+ export const chipOnImageThemeAttributes = ['chipOnImageBackgroundColor', 'chipOnImageTextColor', 'chipOnImageHoverBackgroundColor', 'chipOnImageActiveBackgroundColor', 'chipOnImageSelectedBackgroundColor', 'chipOnImageSelectedTextColor', 'chipOnImageSelectedHoverBackgroundColor', 'chipOnImageSelectedActiveBackgroundColor'];
@@ -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-pagination-page{display:inline-block;min-height:2.25rem;margin:0;padding:.375rem 1rem;border:0;border-radius:.5rem;text-align:center;text-decoration:none;cursor:pointer;vertical-align:middle;user-select:none;font-size:1rem;line-height:1.5rem;font-weight:700;color:#fff;color:var(--bpk-button-primary-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-pagination-page:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-pagination-page:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}.bpk-pagination-page:active{color:#fff;color:var(--bpk-button-primary-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-active-background-color, rgb(21, 70, 121))}.bpk-pagination-page:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-no-touch-support .bpk-pagination-page:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0);color:#161616;box-shadow:0 0 0 1px #05203c inset}:global(.bpk-no-touch-support) .bpk-pagination-page:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0);color:#161616;box-shadow:0 0 0 1px #05203c inset}.bpk-pagination-page--not-selected{color:#161616;color:var(--bpk-button-primary-on-dark-text-color, rgb(22, 22, 22));background-color:#fff;background-color:var(--bpk-button-primary-on-dark-background-color, rgb(255, 255, 255));box-shadow:0 0 0 1px var(--bpk-pagination-selected-background-color, rgb(193, 199, 207)) inset}.bpk-no-touch-support .bpk-pagination-page--not-selected:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-pagination-page--not-selected:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}.bpk-pagination-page--not-selected:active{color:#161616;color:var(--bpk-button-primary-on-dark-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-active-background-color, rgb(193, 199, 207))}.bpk-pagination-page--not-selected:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-no-touch-support .bpk-pagination-page--not-selected:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0);color:#161616}:global(.bpk-no-touch-support) .bpk-pagination-page--not-selected:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0);color:#161616}
18
+ .bpk-pagination-page{display:inline-block;min-height:2.25rem;margin:0;padding:.375rem 1rem;border:0;text-align:center;text-decoration:none;cursor:pointer;vertical-align:middle;user-select:none;border-radius:.5rem;border-radius:var(--bpk-button-border-radius, 0.5rem);font-size:1rem;line-height:1.5rem;font-weight:700;color:#fff;color:var(--bpk-button-primary-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-pagination-page:hover:not(:active):not(:disabled){background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121));color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255))}:global(.bpk-no-touch-support) .bpk-pagination-page:hover:not(:active):not(:disabled){background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121));color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255))}.bpk-pagination-page:active{color:#fff;color:var(--bpk-button-primary-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-active-background-color, rgb(21, 70, 121))}.bpk-pagination-page:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-pagination-page.bpk-button--loading:disabled{background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121));color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255))}.bpk-no-touch-support .bpk-pagination-page:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0);color:#161616;box-shadow:0 0 0 1px #05203c inset}:global(.bpk-no-touch-support) .bpk-pagination-page:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0);color:#161616;box-shadow:0 0 0 1px #05203c inset}.bpk-pagination-page--not-selected{color:#161616;color:var(--bpk-button-primary-on-dark-text-color, rgb(22, 22, 22));background-color:#fff;background-color:var(--bpk-button-primary-on-dark-background-color, rgb(255, 255, 255));box-shadow:0 0 0 1px var(--bpk-pagination-selected-background-color, rgb(193, 199, 207)) inset}.bpk-no-touch-support .bpk-pagination-page--not-selected:hover:not(:active):not(:disabled){background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207));color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-pagination-page--not-selected:hover:not(:active):not(:disabled){background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207));color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22))}.bpk-pagination-page--not-selected:active{color:#161616;color:var(--bpk-button-primary-on-dark-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-active-background-color, rgb(193, 199, 207))}.bpk-pagination-page--not-selected:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-pagination-page--not-selected.bpk-button--loading:disabled{background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207));color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22))}.bpk-no-touch-support .bpk-pagination-page--not-selected:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0);color:#161616}:global(.bpk-no-touch-support) .bpk-pagination-page--not-selected:hover:not(:active):not(:disabled){background-color:rgba(0,0,0,0);color:#161616}
@@ -1,3 +1,3 @@
1
- declare const getMonthsArray: (startDate: Date, count: number) => Date[];
1
+ declare const getMonthsArray: (startDate: Date, count: number) => any[];
2
2
  declare const getMonthItemHeights: (months: Date[], weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6, columnCount: number, rowHeight: number, baseMonthItemHeight: number) => number[];
3
3
  export { getMonthsArray, getMonthItemHeights };
@@ -2,3 +2,5 @@ import BpkSegmentedControl, { useSegmentedControlPanels, type Props as BpkSegmen
2
2
  export type { BpkSegmentControlProps, TabPanelProps };
3
3
  export { useSegmentedControlPanels };
4
4
  export default BpkSegmentedControl;
5
+ export { default as BpkSegmentedControlV2, SEGMENT_TYPES_V2 } from './src/BpkSegmentedControlV2/BpkSegmentedControlV2';
6
+ export type { BpkSegmentedControlV2RootProps, BpkSegmentedControlV2ItemProps, BpkSegmentedControlV2ItemTextProps, SegmentTypesV2, } from './src/BpkSegmentedControlV2/common-types';
@@ -18,4 +18,5 @@
18
18
 
19
19
  import BpkSegmentedControl, { useSegmentedControlPanels } from "./src/BpkSegmentedControl";
20
20
  export { useSegmentedControlPanels };
21
- export default BpkSegmentedControl;
21
+ export default BpkSegmentedControl;
22
+ export { default as BpkSegmentedControlV2, SEGMENT_TYPES_V2 } from "./src/BpkSegmentedControlV2/BpkSegmentedControlV2";
@@ -0,0 +1,19 @@
1
+ import { SEGMENT_TYPES_V2 } from './common-types';
2
+ import type { BpkSegmentedControlV2ItemProps, BpkSegmentedControlV2ItemTextProps, BpkSegmentedControlV2RootProps } from './common-types';
3
+ declare const BpkSegmentedControlV2Root: ({ children, defaultValue, label, onChange, shadow, type, value, }: BpkSegmentedControlV2RootProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const BpkSegmentedControlV2Item: ({ children, value, }: BpkSegmentedControlV2ItemProps) => import("react/jsx-runtime").JSX.Element;
5
+ declare const BpkSegmentedControlV2ItemText: ({ children, }: BpkSegmentedControlV2ItemTextProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const BpkSegmentedControlV2ItemControl: () => import("react/jsx-runtime").JSX.Element;
7
+ declare const BpkSegmentedControlV2ItemHiddenInput: () => import("react/jsx-runtime").JSX.Element;
8
+ declare const BpkSegmentedControlV2Indicator: () => import("react/jsx-runtime").JSX.Element;
9
+ declare const BpkSegmentedControlV2: {
10
+ Root: ({ children, defaultValue, label, onChange, shadow, type, value, }: BpkSegmentedControlV2RootProps) => import("react/jsx-runtime").JSX.Element;
11
+ Item: ({ children, value, }: BpkSegmentedControlV2ItemProps) => import("react/jsx-runtime").JSX.Element;
12
+ ItemText: ({ children, }: BpkSegmentedControlV2ItemTextProps) => import("react/jsx-runtime").JSX.Element;
13
+ ItemControl: () => import("react/jsx-runtime").JSX.Element;
14
+ ItemHiddenInput: () => import("react/jsx-runtime").JSX.Element;
15
+ Indicator: () => import("react/jsx-runtime").JSX.Element;
16
+ };
17
+ export default BpkSegmentedControlV2;
18
+ export { BpkSegmentedControlV2Root, BpkSegmentedControlV2Item, BpkSegmentedControlV2ItemText, BpkSegmentedControlV2ItemControl, BpkSegmentedControlV2ItemHiddenInput, BpkSegmentedControlV2Indicator, SEGMENT_TYPES_V2, };
19
+ export type { BpkSegmentedControlV2RootProps, BpkSegmentedControlV2ItemProps, BpkSegmentedControlV2ItemTextProps, };
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import { SegmentGroup } from '@ark-ui/react';
20
+ import { cssModules, getDataComponentAttribute } from "../../../bpk-react-utils";
21
+ import { SEGMENT_TYPES_V2 } from "./common-types";
22
+ import STYLES from "./BpkSegmentedControlV2.module.css";
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ const getClassName = cssModules(STYLES);
25
+ const BpkSegmentedControlV2Root = ({
26
+ children,
27
+ defaultValue,
28
+ label,
29
+ onChange,
30
+ shadow = false,
31
+ type = SEGMENT_TYPES_V2.CanvasDefault,
32
+ value
33
+ }) => {
34
+ const containerClass = getClassName('bpk-segmented-control-v2', `bpk-segmented-control-v2--${type}`, shadow && 'bpk-segmented-control-v2--shadow');
35
+ return /*#__PURE__*/_jsxs(SegmentGroup.Root, {
36
+ className: containerClass,
37
+ value: value,
38
+ defaultValue: defaultValue,
39
+ onValueChange: onChange ? ({
40
+ value: selectedValue
41
+ }) => {
42
+ if (selectedValue !== null) onChange(selectedValue);
43
+ } : undefined,
44
+ orientation: "horizontal",
45
+ ...getDataComponentAttribute('SegmentedControlV2'),
46
+ children: [/*#__PURE__*/_jsx(SegmentGroup.Label, {
47
+ children: label
48
+ }), children]
49
+ });
50
+ };
51
+ const BpkSegmentedControlV2Item = ({
52
+ children,
53
+ value
54
+ }) => /*#__PURE__*/_jsx(SegmentGroup.Item, {
55
+ value: value,
56
+ className: getClassName('bpk-segmented-control-v2__item'),
57
+ children: children
58
+ });
59
+ const BpkSegmentedControlV2ItemText = ({
60
+ children
61
+ }) => /*#__PURE__*/_jsx(SegmentGroup.ItemText, {
62
+ className: getClassName('bpk-segmented-control-v2__item-text'),
63
+ children: children
64
+ });
65
+ const BpkSegmentedControlV2ItemControl = () => /*#__PURE__*/_jsx(SegmentGroup.ItemControl, {
66
+ className: getClassName('bpk-segmented-control-v2__item-control')
67
+ });
68
+ const BpkSegmentedControlV2ItemHiddenInput = () => /*#__PURE__*/_jsx(SegmentGroup.ItemHiddenInput, {});
69
+ const BpkSegmentedControlV2Indicator = () => /*#__PURE__*/_jsx(SegmentGroup.Indicator, {
70
+ className: getClassName('bpk-segmented-control-v2__indicator')
71
+ });
72
+ const BpkSegmentedControlV2 = {
73
+ Root: BpkSegmentedControlV2Root,
74
+ Item: BpkSegmentedControlV2Item,
75
+ ItemText: BpkSegmentedControlV2ItemText,
76
+ ItemControl: BpkSegmentedControlV2ItemControl,
77
+ ItemHiddenInput: BpkSegmentedControlV2ItemHiddenInput,
78
+ Indicator: BpkSegmentedControlV2Indicator
79
+ };
80
+ export default BpkSegmentedControlV2;
81
+ export { BpkSegmentedControlV2Root, BpkSegmentedControlV2Item, BpkSegmentedControlV2ItemText, BpkSegmentedControlV2ItemControl, BpkSegmentedControlV2ItemHiddenInput, BpkSegmentedControlV2Indicator, SEGMENT_TYPES_V2 };
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ .bpk-segmented-control-v2{position:relative;display:grid;grid-auto-columns:1fr;grid-auto-flow:column;border-radius:.5rem;background-color:#eff3f8;overflow:hidden}.bpk-segmented-control-v2--canvas-default{background-color:#eff3f8}.bpk-segmented-control-v2--canvas-contrast{background-color:#fff}.bpk-segmented-control-v2--canvas-contrast .bpk-segmented-control-v2__indicator{background-color:#fff}.bpk-segmented-control-v2--surface-default{background-color:#eff3f8}.bpk-segmented-control-v2--surface-default .bpk-segmented-control-v2__indicator{background-color:#eff3f8}.bpk-segmented-control-v2--surface-contrast{background-color:hsla(0,0%,100%,.1)}.bpk-segmented-control-v2--surface-contrast .bpk-segmented-control-v2__indicator{background-color:#024daf}.bpk-segmented-control-v2--surface-contrast .bpk-segmented-control-v2__item-text{color:#fff;border-inline-start-color:hsla(0,0%,100%,.5)}.bpk-segmented-control-v2--shadow{box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-segmented-control-v2>[data-part=label]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;overflow:hidden;clip:rect(0 0 0 0)}.bpk-segmented-control-v2__indicator{position:absolute;top:var(--top);left:var(--left);width:var(--width);height:var(--height);background-color:#05203c;--transition-duration: 0ms}.bpk-segmented-control-v2__item{display:grid;cursor:pointer}.bpk-segmented-control-v2__item:first-of-type .bpk-segmented-control-v2__item-text{border-inline-start:none}.bpk-segmented-control-v2__item:has([data-state=checked]) .bpk-segmented-control-v2__item-text{border-inline-start-color:rgba(0,0,0,0)}.bpk-segmented-control-v2__item:has([data-state=checked])+.bpk-segmented-control-v2__item .bpk-segmented-control-v2__item-text{border-inline-start-color:rgba(0,0,0,0)}.bpk-segmented-control-v2__item:has(:focus-visible){z-index:1;outline:.125rem solid #0062e3;outline-offset:-0.125rem}.bpk-segmented-control-v2__item-control{display:none}.bpk-segmented-control-v2__item-text{padding:.25rem .5rem;display:flex;z-index:1;min-height:2rem;grid-area:1/1;justify-content:center;align-items:center;transition:color 50ms ease-in-out;color:#161616;overflow:hidden;border-inline-start:1px solid #c1c7cf;pointer-events:none;font-size:.875rem;line-height:1.25rem;font-weight:700}.bpk-segmented-control-v2__item-text svg{fill:currentcolor}.bpk-segmented-control-v2__item-text[data-state=checked]{color:#fff}
@@ -0,0 +1,57 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare const SEGMENT_TYPES_V2: {
3
+ readonly CanvasDefault: "canvas-default";
4
+ readonly CanvasContrast: "canvas-contrast";
5
+ readonly SurfaceDefault: "surface-default";
6
+ readonly SurfaceContrast: "surface-contrast";
7
+ };
8
+ export type SegmentTypesV2 = (typeof SEGMENT_TYPES_V2)[keyof typeof SEGMENT_TYPES_V2];
9
+ export type BpkSegmentedControlV2RootProps = {
10
+ /**
11
+ * Slot content — one or more BpkSegmentedControlV2.Item elements.
12
+ */
13
+ children: ReactNode;
14
+ /**
15
+ * Controlled selected value. When provided, onChange must also be provided.
16
+ */
17
+ value?: string;
18
+ /**
19
+ * Initial selected value for uncontrolled usage.
20
+ */
21
+ defaultValue?: string;
22
+ /**
23
+ * Called when the selected segment changes. Receives the value of the newly selected item.
24
+ */
25
+ onChange?: (value: string) => void;
26
+ /**
27
+ * Pre-defined surface theme controlling default token values.
28
+ * @default 'canvas-default'
29
+ */
30
+ type?: SegmentTypesV2;
31
+ /**
32
+ * Applies a box shadow to the group container.
33
+ * @default false
34
+ */
35
+ shadow?: boolean;
36
+ /**
37
+ * Accessible label for the radiogroup. Always required to satisfy WCAG 4.1.2
38
+ * (the role="radiogroup" element must have an accessible name).
39
+ */
40
+ label: string;
41
+ };
42
+ export type BpkSegmentedControlV2ItemProps = {
43
+ /**
44
+ * Unique identifier for this segment within the group.
45
+ */
46
+ value: string;
47
+ /**
48
+ * Slot content — typically ItemText + ItemControl + ItemHiddenInput.
49
+ */
50
+ children: ReactNode;
51
+ };
52
+ export type BpkSegmentedControlV2ItemTextProps = {
53
+ /**
54
+ * Visible content of the segment — text, icons, or a combination.
55
+ */
56
+ children: ReactNode;
57
+ };
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ export const SEGMENT_TYPES_V2 = {
20
+ CanvasDefault: 'canvas-default',
21
+ CanvasContrast: 'canvas-contrast',
22
+ SurfaceDefault: 'surface-default',
23
+ SurfaceContrast: 'surface-contrast'
24
+ };
@@ -0,0 +1,13 @@
1
+ import BpkTable from './src/BpkTable';
2
+ import BpkTableBody from './src/BpkTableBody';
3
+ import BpkTableCell from './src/BpkTableCell';
4
+ import BpkTableHead from './src/BpkTableHead';
5
+ import BpkTableHeadCell from './src/BpkTableHeadCell';
6
+ import BpkTableRow from './src/BpkTableRow';
7
+ export type { BpkTableProps } from './src/BpkTable';
8
+ export type { BpkTableHeadProps } from './src/BpkTableHead';
9
+ export type { BpkTableBodyProps } from './src/BpkTableBody';
10
+ export type { BpkTableRowProps } from './src/BpkTableRow';
11
+ export type { BpkTableCellProps } from './src/BpkTableCell';
12
+ export type { BpkTableHeadCellProps } from './src/BpkTableHeadCell';
13
+ export { BpkTable, BpkTableHead, BpkTableBody, BpkTableRow, BpkTableCell, BpkTableHeadCell, };
@@ -14,7 +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 BpkTable from "./src/BpkTable";
17
+ */
18
+
19
+ import BpkTable from "./src/BpkTable";
18
20
  import BpkTableBody from "./src/BpkTableBody";
19
21
  import BpkTableCell from "./src/BpkTableCell";
20
22
  import BpkTableHead from "./src/BpkTableHead";
@@ -0,0 +1,8 @@
1
+ import type { ReactNode, HTMLAttributes } from 'react';
2
+ export interface BpkTableProps extends Omit<HTMLAttributes<HTMLTableElement>, 'className'> {
3
+ /** The content of the table */
4
+ children: ReactNode;
5
+ className?: string | null;
6
+ }
7
+ declare const BpkTable: ({ children, className, ...rest }: BpkTableProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default BpkTable;
@@ -14,7 +14,8 @@
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';
17
+ */
18
+
18
19
  import { cssModules } from "../../bpk-react-utils";
19
20
  import STYLES from "./BpkTable.module.css";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -25,18 +26,10 @@ const BpkTable = ({
25
26
  ...rest
26
27
  }) => {
27
28
  const classNames = getClassName('bpk-table', className);
28
- return (
29
- /*#__PURE__*/
30
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
31
- _jsx("table", {
32
- className: classNames,
33
- ...rest,
34
- children: children
35
- })
36
- );
37
- };
38
- BpkTable.propTypes = {
39
- children: PropTypes.node.isRequired,
40
- className: PropTypes.string
29
+ return /*#__PURE__*/_jsx("table", {
30
+ className: classNames,
31
+ ...rest,
32
+ children: children
33
+ });
41
34
  };
42
35
  export default BpkTable;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode, HTMLAttributes } from 'react';
2
+ export interface BpkTableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
3
+ /** The content of the table */
4
+ children: ReactNode;
5
+ }
6
+ declare const BpkTableBody: (props: BpkTableBodyProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default BpkTableBody;
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  /*
2
3
  * Backpack - Skyscanner's Design System
3
4
  *
@@ -14,12 +15,9 @@
14
15
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
16
  * See the License for the specific language governing permissions and
16
17
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
18
- import { jsx as _jsx } from "react/jsx-runtime";
18
+ */
19
+
19
20
  const BpkTableBody = props => /*#__PURE__*/_jsx("tbody", {
20
21
  ...props
21
22
  });
22
- BpkTableBody.propTypes = {
23
- children: PropTypes.node.isRequired
24
- };
25
23
  export default BpkTableBody;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode, HTMLAttributes } from 'react';
2
+ export interface BpkTableCellProps extends Omit<HTMLAttributes<HTMLTableCellElement>, 'className'> {
3
+ /** The content of the table */
4
+ children: ReactNode;
5
+ className?: string | null;
6
+ wordBreak?: boolean;
7
+ }
8
+ declare const BpkTableCell: ({ children, className, wordBreak, ...rest }: BpkTableCellProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default BpkTableCell;
@@ -14,7 +14,8 @@
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';
17
+ */
18
+
18
19
  import { cssModules } from "../../bpk-react-utils";
19
20
  import STYLES from "./BpkTable.module.css";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -27,19 +28,10 @@ const BpkTableCell = ({
27
28
  }) => {
28
29
  const classes = ['bpk-table__cell', wordBreak && 'bpk-table__cell--wordBreak', className];
29
30
  const classNames = getClassName(...classes);
30
- return (
31
- /*#__PURE__*/
32
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
33
- _jsx("td", {
34
- className: classNames,
35
- ...rest,
36
- children: children
37
- })
38
- );
39
- };
40
- BpkTableCell.propTypes = {
41
- className: PropTypes.string,
42
- children: PropTypes.node.isRequired,
43
- wordBreak: PropTypes.bool
31
+ return /*#__PURE__*/_jsx("td", {
32
+ className: classNames,
33
+ ...rest,
34
+ children: children
35
+ });
44
36
  };
45
37
  export default BpkTableCell;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode, HTMLAttributes } from 'react';
2
+ export interface BpkTableHeadProps extends HTMLAttributes<HTMLTableSectionElement> {
3
+ /** The content of the table */
4
+ children: ReactNode;
5
+ }
6
+ declare const BpkTableHead: (props: BpkTableHeadProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default BpkTableHead;
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  /*
2
3
  * Backpack - Skyscanner's Design System
3
4
  *
@@ -14,12 +15,9 @@
14
15
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
16
  * See the License for the specific language governing permissions and
16
17
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
18
- import { jsx as _jsx } from "react/jsx-runtime";
18
+ */
19
+
19
20
  const BpkTableHead = props => /*#__PURE__*/_jsx("thead", {
20
21
  ...props
21
22
  });
22
- BpkTableHead.propTypes = {
23
- children: PropTypes.node.isRequired
24
- };
25
23
  export default BpkTableHead;
@@ -0,0 +1,9 @@
1
+ import type { ReactNode, HTMLAttributes } from 'react';
2
+ export interface BpkTableHeadCellProps extends Omit<HTMLAttributes<HTMLTableCellElement>, 'className'> {
3
+ /** The content of the table */
4
+ children: ReactNode;
5
+ className?: string | null;
6
+ wordBreak?: boolean;
7
+ }
8
+ declare const BpkTableHeadCell: ({ children, className, wordBreak, ...rest }: BpkTableHeadCellProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default BpkTableHeadCell;
@@ -14,7 +14,8 @@
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';
17
+ */
18
+
18
19
  import { cssModules } from "../../bpk-react-utils";
19
20
  import STYLES from "./BpkTable.module.css";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -33,9 +34,4 @@ const BpkTableHeadCell = ({
33
34
  children: children
34
35
  });
35
36
  };
36
- BpkTableHeadCell.propTypes = {
37
- children: PropTypes.node.isRequired,
38
- className: PropTypes.string,
39
- wordBreak: PropTypes.bool
40
- };
41
37
  export default BpkTableHeadCell;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode, HTMLAttributes } from 'react';
2
+ export interface BpkTableRowProps extends HTMLAttributes<HTMLTableRowElement> {
3
+ /** The content of the table */
4
+ children: ReactNode;
5
+ }
6
+ declare const BpkTableRow: (props: BpkTableRowProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default BpkTableRow;
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  /*
2
3
  * Backpack - Skyscanner's Design System
3
4
  *
@@ -14,12 +15,9 @@
14
15
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
16
  * See the License for the specific language governing permissions and
16
17
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
18
- import { jsx as _jsx } from "react/jsx-runtime";
18
+ */
19
+
19
20
  const BpkTableRow = props => /*#__PURE__*/_jsx("tr", {
20
21
  ...props
21
22
  });
22
- BpkTableRow.propTypes = {
23
- children: PropTypes.node.isRequired
24
- };
25
23
  export default BpkTableRow;
@@ -0,0 +1,3 @@
1
+ import BpkThumbButton from './src/BpkThumbButton';
2
+ export type { BpkThumbButtonProps, ThumbsButtonType } from './src/BpkThumbButton';
3
+ export default BpkThumbButton;
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import BpkThumbButton from "./src/BpkThumbButton";
20
+ export default BpkThumbButton;
@@ -0,0 +1,21 @@
1
+ export type ThumbsButtonType = 'up' | 'down';
2
+ export type BpkThumbButtonProps = {
3
+ /**
4
+ * Accessibility label for screen readers (REQUIRED).
5
+ */
6
+ accessibilityLabel: string;
7
+ /**
8
+ * Click handler callback.
9
+ */
10
+ onClick: (type: ThumbsButtonType) => void;
11
+ /**
12
+ * Whether the thumb is in selected state.
13
+ */
14
+ selected?: boolean;
15
+ /**
16
+ * Type of thumb icon to display.
17
+ */
18
+ type: ThumbsButtonType;
19
+ };
20
+ declare const BpkThumbButton: ({ accessibilityLabel, onClick, selected, type, }: BpkThumbButtonProps) => import("react/jsx-runtime").JSX.Element;
21
+ export default BpkThumbButton;
@@ -0,0 +1,52 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import ThumbsDownIcon from "../../bpk-component-icon/lg/thumbs-down";
20
+ import ThumbsUpIcon from "../../bpk-component-icon/lg/thumbs-up";
21
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
22
+ import STYLES from "./BpkThumbButton.module.css";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ const getClassName = cssModules(STYLES);
25
+ const BpkThumbButton = ({
26
+ accessibilityLabel,
27
+ onClick,
28
+ selected = false,
29
+ type
30
+ }) => {
31
+ const Icon = type === 'up' ? ThumbsUpIcon : ThumbsDownIcon;
32
+ const classNames = getClassName('bpk-thumb-button', selected && 'bpk-thumb-button--selected');
33
+ const handleClick = event => {
34
+ event.stopPropagation();
35
+ onClick(type);
36
+ };
37
+ const iconClassNames = getClassName('bpk-thumb-button__icon');
38
+ return /*#__PURE__*/_jsx("button", {
39
+ type: "button",
40
+ className: classNames,
41
+ onClick: handleClick,
42
+ "aria-label": accessibilityLabel,
43
+ "aria-pressed": selected,
44
+ "data-testid": `bpk-thumb-button-${type}`,
45
+ ...getDataComponentAttribute('ThumbButton'),
46
+ children: /*#__PURE__*/_jsx("span", {
47
+ className: iconClassNames,
48
+ children: /*#__PURE__*/_jsx(Icon, {})
49
+ })
50
+ });
51
+ };
52
+ export default BpkThumbButton;
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ .bpk-thumb-button{display:flex;width:1.5rem;height:1.5rem;padding:0;justify-content:center;align-items:center;transition:all 200ms ease-in-out;border:none;background:rgba(0,0,0,0);color:rgba(0,0,0,.2);cursor:pointer;appearance:none;position:relative}.bpk-thumb-button::before{position:absolute;top:calc(-2.75rem/2 + 50%);left:calc(-2.75rem/2 + 50%);content:"";width:2.75rem;height:2.75rem}.bpk-no-touch-support .bpk-thumb-button:hover:not(:active):not(:disabled){color:#626971}:global(.bpk-no-touch-support) .bpk-thumb-button:hover:not(:active):not(:disabled){color:#626971}@media(prefers-reduced-motion: reduce){.bpk-thumb-button{transition:none}}.bpk-thumb-button--selected{color:#0062e3}.bpk-no-touch-support .bpk-thumb-button--selected:hover:not(:active):not(:disabled){color:#0062e3}:global(.bpk-no-touch-support) .bpk-thumb-button--selected:hover:not(:active):not(:disabled){color:#0062e3}.bpk-thumb-button__icon{display:flex;fill:currentcolor}