@oaknational/oak-components 3.22.0 → 3.22.2
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/dist/npm/bin/migrate/cli.js +1 -1
- package/dist/npm/bin/migrate/index.js +1 -1
- package/dist/npm/cjs/index.js +273 -253
- package/dist/npm/cjs/types.d.ts +1242 -953
- package/dist/npm/es/components/form-elements/OakCheckBox/OakCheckBox.js +2 -2
- package/dist/npm/es/components/form-elements/OakMultilineText/OakMultilineText.js +1 -1
- package/dist/npm/es/components/form-elements/OakSearchFilterCheckBox/OakSearchFilterCheckBox.js +1 -2
- package/dist/npm/es/components/form-elements/OakSelect/NativeSelect.js +1 -1
- package/dist/npm/es/components/images-and-icons/OakImage/OakImage.js +1 -1
- package/dist/npm/es/components/internal-components/InternalCheckBoxLabel/InternalCheckBoxLabel.js +1 -1
- package/dist/npm/es/components/internal-components/InternalChevronAccordion/InternalChevronAccordion.js +3 -3
- package/dist/npm/es/components/internal-components/InternalModalTransition/InternalModalTransition.js +2 -2
- package/dist/npm/es/components/internal-components/InternalShadowIconButton/InternalShadowIconButton.js +1 -1
- package/dist/npm/es/components/internal-components/InternalShadowRoundButton/InternalShadowRoundButton.js +2 -3
- package/dist/npm/es/components/internal-components/InternalSlideInFlex/InternalSlideInFlex.js +8 -8
- package/dist/npm/es/components/internal-components/InternalTextInput/InternalTextInput.js +1 -1
- package/dist/npm/es/components/layout-and-structure/OakBox/OakBox.js +1 -1
- package/dist/npm/es/components/layout-and-structure/OakGrid/OakGrid.js +1 -1
- package/dist/npm/es/components/messaging-and-feedback/OakFocusIndicator/OakFocusIndicator.js +7 -5
- package/dist/npm/es/components/messaging-and-feedback/OakLoadingSpinner/OakLoadingSpinner.js +13 -7
- package/dist/npm/es/components/messaging-and-feedback/OakTagFunctional/OakTagFunctional.js +4 -4
- package/dist/npm/es/components/navigation/OakLink/OakLink.js +7 -3
- package/dist/npm/es/components/navigation/OakPagination/OakPagination.js +9 -9
- package/dist/npm/es/components/owa/OakHomepageTabButton/OakHomepageTabButton.js +1 -1
- package/dist/npm/es/components/owa/OakLinkCard/OakLinkCard.js +3 -3
- package/dist/npm/es/components/owa/OakMediaClip/OakMediaClip.js +1 -1
- package/dist/npm/es/components/owa/OakSaveCount/OakSaveCount.js +1 -1
- package/dist/npm/es/components/owa/OakSideMenuNavLink/OakSideMenuNavLink.js +6 -6
- package/dist/npm/es/components/owa/pupil/OakUnitListItem/OakUnitListItem.js +7 -3
- package/dist/npm/es/components/owa/pupil/OakUnitListOptionalityItem/OakUnitListOptionalityItem.js +1 -1
- package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyLayout/OakPupilJourneyLayout.js +2 -2
- package/dist/npm/es/components/owa/pupil/browse/OakPupilJourneyListItem/OakPupilJourneyListItem.js +1 -1
- package/dist/npm/es/components/owa/pupil/lesson/OakLessonLayout/OakLessonLayout.js +2 -2
- package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewItem/OakPupilLessonReviewItem.js +3 -3
- package/dist/npm/es/components/owa/pupil/lesson/OakLessonReviewQuiz/OakPupilLessonReviewQuiz.js +9 -9
- package/dist/npm/es/components/owa/pupil/quiz/OakQuizCheckBox/OakQuizCheckBox.js +1 -1
- package/dist/npm/es/components/owa/teacher/OakInlineRegistrationBanner/OakInlineRegistrationBanner.js +5 -2
- package/dist/npm/es/styles/utils/borderStyle.js +1 -1
- package/dist/npm/es/styles/utils/colorFilterStyle.js +1 -1
- package/dist/npm/es/styles/utils/responsiveStyle.js +9 -4
- package/dist/npm/es/types.d.ts +1242 -953
- package/package.json +5 -4
|
@@ -45,7 +45,7 @@ var OakCheckBox = function (props) {
|
|
|
45
45
|
/**
|
|
46
46
|
* The outer border color of the checkbox when checked.
|
|
47
47
|
*/
|
|
48
|
-
checkedBorderColor = _k === void 0 ? "border-primary" : _k, _l = props.disabledColor, disabledColor = _l === void 0 ? "text-disabled" : _l, _m = props
|
|
48
|
+
checkedBorderColor = _k === void 0 ? "border-primary" : _k, _l = props.disabledColor, disabledColor = _l === void 0 ? "text-disabled" : _l, _m = props.$labelGap, $labelGap = _m === void 0 ? "spacing-16" : _m, _o = props.$labelAlignItems, $labelAlignItems = _o === void 0 ? "center" : _o, _p = props.checkedBackgroundFill, checkedBackgroundFill = _p === void 0 ? true : _p, checkedIcon = props.checkedIcon, dataTestId = props["data-testid"], rest = __rest(props, ["id", "value", "displayValue", "disabled", "defaultChecked", "checked", "onChange", "onFocus", "onBlur", "onHovered", "iconPadding", "hoverBorderRadius", "checkboxSize", "checkboxBorder", "checkboxBorderRadius", "defaultColor", "uncheckedBorderColor", "checkedBorderColor", "disabledColor", "$labelGap", "$labelAlignItems", "checkedBackgroundFill", "checkedIcon", "data-testid"]);
|
|
49
49
|
var hoverStart = useRef(Date.now());
|
|
50
50
|
var handleMouseEnter = function () {
|
|
51
51
|
hoverStart.current = Date.now();
|
|
@@ -63,7 +63,7 @@ var OakCheckBox = function (props) {
|
|
|
63
63
|
var currentCheckedBorderColor = disabled
|
|
64
64
|
? disabledColor
|
|
65
65
|
: checkedBorderColor;
|
|
66
|
-
return (React.createElement(InternalCheckBoxLabel, { htmlFor: id, labelGap: labelGap, labelAlignItems: labelAlignItems, "$color": currentColor, disabled: disabled, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
66
|
+
return (React.createElement(InternalCheckBoxLabel, { htmlFor: id, "$labelGap": $labelGap, "$labelAlignItems": $labelAlignItems, "$color": currentColor, disabled: disabled, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
67
67
|
React.createElement(InternalCheckBoxWrapper, { size: checkboxSize, internalCheckbox: React.createElement(InternalCheckBoxHoverFocus, __assign({ id: id, value: value, "$width": checkboxSize, "$height": checkboxSize, "$ba": checkboxBorder, "$borderRadius": checkboxBorderRadius, "$borderColor": defaultColor, "$checkedBackground": checkedBackgroundFill ? currentCheckedBackgroundFill : null, "$checkedBorderColor": currentCheckedBorderColor, "$uncheckedBorderColor": uncheckedBorderColor, "$hoverBorderRadius": hoverBorderRadius, onChange: onChange, onFocus: onFocus, onBlur: onBlur, defaultChecked: defaultChecked, checked: checked, disabled: disabled, "data-testid": dataTestId }, rest)), checkedIcon: checkedIcon, iconPadding: iconPadding }),
|
|
68
68
|
displayValue));
|
|
69
69
|
};
|
|
@@ -13,7 +13,7 @@ import { parseColor } from '../../../styles/helpers/parseColor.js';
|
|
|
13
13
|
import { useMediaQuery } from '../../../hooks/useMediaQuery.js';
|
|
14
14
|
import '../../../styles/utils/responsiveStyle.js';
|
|
15
15
|
|
|
16
|
-
var StyledOakTextArea = styled(OakTextArea)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:focus-visible {\n border-color: ", ";\n }\n\n &:hover {\n background: ", ";\n border-color: ", ";\n }\n\n
|
|
16
|
+
var StyledOakTextArea = styled(OakTextArea)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:focus-visible {\n border-color: ", ";\n }\n\n &:hover {\n background: ", ";\n border-color: ", ";\n }\n\n &::placeholder {\n color: ", ";\n }\n"], ["\n &:focus-visible {\n border-color: ", ";\n }\n\n &:hover {\n background: ", ";\n border-color: ", ";\n }\n\n &::placeholder {\n color: ", ";\n }\n"])), parseColor("border-primary"), parseColor("bg-btn-secondary-hover"), function (props) {
|
|
17
17
|
return props.disabled ? "" : parseColor("border-neutral");
|
|
18
18
|
}, parseColor("text-subdued"));
|
|
19
19
|
var UnstyledComponent = forwardRef(function (_a, ref) {
|
package/dist/npm/es/components/form-elements/OakSearchFilterCheckBox/OakSearchFilterCheckBox.js
CHANGED
|
@@ -10,9 +10,8 @@ import { parseBorder } from '../../../styles/helpers/parseBorder.js';
|
|
|
10
10
|
import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
|
|
11
11
|
import { parseColorFilter } from '../../../styles/helpers/parseColorFilter.js';
|
|
12
12
|
|
|
13
|
-
// Converted to styled-component so it can be used in '&:checked:not(:disabled) + ${StyledOakIcon}' to change svg color.
|
|
14
13
|
var StyledOakIcon = styled(OakIcon)(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
15
|
-
var StyledInternalCheckBox = styled(InternalCheckBox)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n opacity: 0;\n pointer-events: none;\n\n &:checked:not(:disabled) +
|
|
14
|
+
var StyledInternalCheckBox = styled(InternalCheckBox)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: absolute;\n opacity: 0;\n pointer-events: none;\n\n &:checked:not(:disabled) + span {\n filter: ", ";\n }\n\n &:checked:not(:disabled) {\n border: ", ";\n border-color: ", ";\n }\n\n &:checked:disabled {\n border: ", ";\n border-color: ", ";\n }\n\n &:hover:not(:disabled) {\n background: ", ";\n }\n"], ["\n position: absolute;\n opacity: 0;\n pointer-events: none;\n\n &:checked:not(:disabled) + span {\n filter: ", ";\n }\n\n &:checked:not(:disabled) {\n border: ", ";\n border-color: ", ";\n }\n\n &:checked:disabled {\n border: ", ";\n border-color: ", ";\n }\n\n &:hover:not(:disabled) {\n background: ", ";\n }\n"])), function (props) {
|
|
16
15
|
return props.$keepIconColor ? "none" : parseColorFilter("icon-inverted");
|
|
17
16
|
}, parseBorder("border-solid-l"), parseColor("border-primary"), parseBorder("border-solid-l"), parseColor("text-disabled"), parseColor("bg-primary"));
|
|
18
17
|
var StyledFlexBox = styled(OakFlex)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n &:has(input:not(:disabled)) {\n cursor: pointer;\n }\n\n &:has(input:disabled) {\n pointer-events: none;\n cursor: none;\n }\n\n &:hover:has(input:not(:disabled)) ", " {\n text-decoration: underline;\n }\n\n &:hover:has(input:not(:disabled)) {\n background-color: ", ";\n }\n\n &:focus-within {\n box-shadow:\n ", ",\n ", ";\n }\n\n &:has(input:checked:not(:disabled)) {\n background-color: ", ";\n color: ", ";\n }\n"], ["\n &:has(input:not(:disabled)) {\n cursor: pointer;\n }\n\n &:has(input:disabled) {\n pointer-events: none;\n cursor: none;\n }\n\n &:hover:has(input:not(:disabled)) ", " {\n text-decoration: underline;\n }\n\n &:hover:has(input:not(:disabled)) {\n background-color: ", ";\n }\n\n &:focus-within {\n box-shadow:\n ", ",\n ", ";\n }\n\n &:has(input:checked:not(:disabled)) {\n background-color: ", ";\n color: ", ";\n }\n"])), InternalCheckBoxLabelHoverDecor, parseColor("bg-neutral"), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), parseColor("bg-inverted"), parseColor("text-inverted"));
|
|
@@ -7,7 +7,7 @@ import { paddingStyle } from '../../../styles/utils/spacingStyle.js';
|
|
|
7
7
|
import { parseBorderRadius } from '../../../styles/helpers/parseBorderRadius.js';
|
|
8
8
|
import { colorStyle } from '../../../styles/utils/colorStyle.js';
|
|
9
9
|
|
|
10
|
-
var NativeSelect = styled("select")(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: none;\n outline: none;\n width: 100%;\n\n appearance: none;\n appearance: base-select;\n\n ", "\n\n ", "\n\n ", "\n\n border-radius: ", ";\n\n &:focus {\n box-shadow: ", ";\n }\n\n &::picker(select) {\n appearance: none;\n appearance: base-select;\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n overflow: visible;\n ", ";\n ", ";\n border-top: none;\n }\n\n
|
|
10
|
+
var NativeSelect = styled("select")(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: none;\n outline: none;\n width: 100%;\n\n appearance: none;\n appearance: base-select;\n\n ", "\n\n ", "\n\n ", "\n\n border-radius: ", ";\n\n &:focus {\n box-shadow: ", ";\n }\n\n &::picker(select) {\n appearance: none;\n appearance: base-select;\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n overflow: visible;\n ", ";\n ", ";\n border-top: none;\n }\n\n &::picker(select) {\n top: calc(anchor(bottom) - 2px);\n left: anchor(0);\n }\n\n &::picker-icon {\n display: none;\n }\n\n ", ";\n ", ";\n ", ";\n\n &:open {\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n\n &::picker(select) {\n border-top-left-radius: 0px;\n border-top-right-radius: 0px;\n }\n }\n"], ["\n border: none;\n outline: none;\n width: 100%;\n\n appearance: none;\n appearance: base-select;\n\n ", "\n\n ", "\n\n ", "\n\n border-radius: ", ";\n\n &:focus {\n box-shadow: ", ";\n }\n\n &::picker(select) {\n appearance: none;\n appearance: base-select;\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n overflow: visible;\n ", ";\n ", ";\n border-top: none;\n }\n\n &::picker(select) {\n top: calc(anchor(bottom) - 2px);\n left: anchor(0);\n }\n\n &::picker-icon {\n display: none;\n }\n\n ", ";\n ", ";\n ", ";\n\n &:open {\n border-bottom-left-radius: 0px;\n border-bottom-right-radius: 0px;\n\n &::picker(select) {\n border-top-left-radius: 0px;\n border-top-right-radius: 0px;\n }\n }\n"])), function (props) {
|
|
11
11
|
return !props.$readOnly && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n @media (hover: hover) {\n &:hover:not(:focus-within) {\n background: ", ";\n }\n }\n "], ["\n @media (hover: hover) {\n &:hover:not(:focus-within) {\n background: ", ";\n }\n }\n "])), parseColor(props.$hoverBackground));
|
|
12
12
|
}, function (props) {
|
|
13
13
|
return props.$readOnly && css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border-color: ", ";\n color: ", ";\n "], ["\n border-color: ", ";\n color: ", ";\n "])), parseColor(props.$readOnlyBorderColor), parseColor(props.$readOnlyColor));
|
|
@@ -11,7 +11,7 @@ import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
|
|
|
11
11
|
var oakPlaceholder = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA2NCA2NCI+PHBhdGggZmlsbD0iIzIyMiIgZD0iTTI4Ljc3OSAxOS4xNzZhMjcuMTkxIDI3LjE5MSAwIDAgMC0zLjggMS42IDE2LjcgMTYuNyAwIDAgMC03LjEgOC40YzAgLjEtLjEuMi0uMS4zLS43IDIuNC0uNiAyIDEuMyAyLjMgMS45LjMgMSAuNSAxIDEuMy0uMSA4LjggNC4xIDE1LjEgMTEuNCAxOS42YTEuNSAxLjUgMCAwIDAgMS43LjJjNS43LTIuNiA5LjMtNyAxMC4zLTEzLjJhMSAxIDAgMCAxIDEtMWwzLS4yYy44IDAgMS4zLjIgMS4yIDEuMmExNy45IDE3LjkgMCAwIDEtMy4yIDkuMiAyMy43IDIzLjcgMCAwIDEtMTAuOSA5LjEgNS40MDEgNS40MDEgMCAwIDEtNC41LS4yIDI2LjI5OCAyNi4yOTggMCAwIDEtOC41LTYuNiAyNS45IDI1LjkgMCAwIDEtNi40LTE0LjRjMC0uNi0uMi0uNy0uOC0uOC0yLjUtLjQtMi41LS4xLTIuMy0yLjlhMTkuMyAxOS4zIDAgMCAxIDEwLjgtMTYuNiAzOC45OTkgMzguOTk5IDAgMCAxIDUuNy0yLjEgMi4xIDIuMSAwIDAgMCAuOS0xLjMgMTQuMSAxNC4xIDAgMCAxIDMuNS02LjNsLjMtLjNjMS45LTIgMi42LTIgNC4zLjJsLjQuNWMxLjEgMS4xIDEgMS41LS4xIDIuNmExMS45IDExLjkgMCAwIDAtMy4yIDQuNCAxNi45IDE2LjkgMCAwIDEgNy41IDIuM2M1LjcgMy41IDkuMiA4LjMgOS45IDE1IC4wMTYuOTAxLS4wMTcgMS44MDItLjEgMi43IDAgLjgtLjYgMS0xLjIgMS4yYTE2LjEgMTYuMSAwIDAgMS0xMS0uNyAxNy45MDEgMTcuOTAxIDAgMCAxLTEwLjktMTMuNiA5Ljc5NiA5Ljc5NiAwIDAgMS0uMS0xLjlabTE4LjEgMTIuMmMuNC01LjUtNi45LTEyLjYtMTMtMTIuMS41IDYuNSA3LjYgMTIuOCAxMyAxMi4xWiIgb3BhY2l0eT0iLjEiLz48L3N2Zz4=";
|
|
12
12
|
var clickStyles = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
13
13
|
/* onClick might be passed in the useClickableCard pattern */
|
|
14
|
-
return props.onClick && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
14
|
+
return props.onClick && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover {\n cursor: pointer;\n }\n "], ["\n &:hover {\n cursor: pointer;\n }\n "])));
|
|
15
15
|
});
|
|
16
16
|
var placeholderStyles = css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
17
17
|
return props.$showOakPlaceholder && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-image: url(", ");\n background-color: ", ";\n background-size: ", ";\n background-position: center;\n background-repeat: no-repeat;\n "], ["\n background-image: url(", ");\n background-color: ", ";\n background-size: ", ";\n background-position: center;\n background-repeat: no-repeat;\n "])), oakPlaceholder, parseColor("bg-decorative2-very-subdued"), parseSpacing("spacing-64"));
|
package/dist/npm/es/components/internal-components/InternalCheckBoxLabel/InternalCheckBoxLabel.js
CHANGED
|
@@ -9,7 +9,7 @@ import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
|
|
|
9
9
|
* Specialised Label Component can be used and extended to create various different versions of CheckboxLabels
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
var InternalCheckBoxLabel = styled(OakLabel)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n ", "\n ", "\n"], ["\n display: flex;\n align-items: center;\n ", "\n ", "\n"])), responsiveStyle("gap", function (props) { return props
|
|
12
|
+
var InternalCheckBoxLabel = styled(OakLabel)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n ", "\n ", "\n"], ["\n display: flex;\n align-items: center;\n ", "\n ", "\n"])), responsiveStyle("gap", function (props) { return props.$labelGap; }, parseSpacing), responsiveStyle("align-items", function (props) { return props.$labelAlignItems; }));
|
|
13
13
|
var InternalCheckBoxLabelHoverDecor = styled(InternalCheckBoxLabel)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n @media (hover: hover) {\n &:hover {\n text-decoration: ", ";\n }\n }\n"], ["\n ", "\n @media (hover: hover) {\n &:hover {\n text-decoration: ", ";\n }\n }\n"])), function (props) { return "\n ".concat(props.pointerEvents ? "pointer-events: ".concat(props.pointerEvents, ";") : "", "\n ").concat(props.disabled ? "pointer-events: none;" : "cursor: pointer;", "\n "); }, function (props) { return (props.disabled ? "none" : "underline"); });
|
|
14
14
|
var templateObject_1, templateObject_2;
|
|
15
15
|
|
|
@@ -17,7 +17,7 @@ var StyledAccordionUnderline = styled(OakHandDrawnFocusUnderline)(templateObject
|
|
|
17
17
|
var StyledAccordionButton = styled(InternalAccordionButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n ", "\n position: relative;\n &:hover {\n text-decoration: underline;\n }\n &:focus-visible {\n .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n }\n"], ["\n ", "\n ", "\n position: relative;\n &:hover {\n text-decoration: underline;\n }\n &:focus-visible {\n .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n }\n"])), flexStyle, oakBoxCss, parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"));
|
|
18
18
|
var StyledContainer = styled(OakFlex)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", " {\n visibility: hidden;\n }\n ", ":focus-visible ~ ", " {\n visibility: visible;\n }\n ", "\n ", "\n"], ["\n ", " {\n visibility: hidden;\n }\n ", ":focus-visible ~ ", " {\n visibility: visible;\n }\n ", "\n ", "\n"])), StyledAccordionUnderline, StyledAccordionButton, StyledAccordionUnderline, oakBoxCss, flexStyle);
|
|
19
19
|
var BottomBoxShadow = styled(OakBox)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 50px;\n opacity: ", ";\n z-index: 100;\n -webkit-box-shadow: inset 0px -55px 30px -30px rgba(255, 255, 255, 1);\n -moz-box-shadow: inset 0px -55px 30px -30px rgba(255, 255, 255, 1);\n box-shadow: inset 0px -55px 30px -30px rgba(255, 255, 255, 1);\n padding: 2px;\n"], ["\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 50px;\n opacity: ", ";\n z-index: 100;\n -webkit-box-shadow: inset 0px -55px 30px -30px rgba(255, 255, 255, 1);\n -moz-box-shadow: inset 0px -55px 30px -30px rgba(255, 255, 255, 1);\n box-shadow: inset 0px -55px 30px -30px rgba(255, 255, 255, 1);\n padding: 2px;\n"])), function (props) {
|
|
20
|
-
return props
|
|
20
|
+
return props.$shouldDisplayShadow
|
|
21
21
|
? parseOpacity("opaque")
|
|
22
22
|
: parseOpacity("transparent");
|
|
23
23
|
});
|
|
@@ -25,7 +25,7 @@ var BottomBoxShadow = styled(OakBox)(templateObject_4 || (templateObject_4 = __m
|
|
|
25
25
|
* An accordion component that can be used to show/hide content
|
|
26
26
|
*/
|
|
27
27
|
var Accordion = function (_a) {
|
|
28
|
-
var header = _a.header, children = _a.children, id = _a.id, subheading = _a.subheading
|
|
28
|
+
var header = _a.header, children = _a.children, id = _a.id, subheading = _a.subheading; _a.initialOpen; var styleProps = __rest(_a, ["header", "children", "id", "subheading", "initialOpen"]);
|
|
29
29
|
var _b = __read(useState(false), 2), shouldDisplayShadow = _b[0], setShouldDisplayShadow = _b[1];
|
|
30
30
|
var scrollBox = useRef(null);
|
|
31
31
|
useEffect(function () {
|
|
@@ -68,7 +68,7 @@ var Accordion = function (_a) {
|
|
|
68
68
|
React.createElement(OakBox, { ref: scrollBox, "$position": "relative", "$overflow": "auto", onScroll: handleScroll, "data-testid": "scrollable-content" },
|
|
69
69
|
React.createElement(InternalAccordionContent, { "aria-labelledby": id }, children)),
|
|
70
70
|
React.createElement(StyledAccordionUnderline, { "$fill": "border-decorative5-stronger" }),
|
|
71
|
-
isOpen && (React.createElement(BottomBoxShadow, { shouldDisplayShadow: shouldDisplayShadow, "data-testid": "bottom-box-shadow", "$pointerEvents": "none" }))));
|
|
71
|
+
isOpen && (React.createElement(BottomBoxShadow, { "$shouldDisplayShadow": shouldDisplayShadow, "data-testid": "bottom-box-shadow", "$pointerEvents": "none" }))));
|
|
72
72
|
};
|
|
73
73
|
/**
|
|
74
74
|
* InternalChevronAccordion has a chevron icon that rotates when the accordion is open
|
|
@@ -18,13 +18,13 @@ var FadeOutBox = styled(OakBox)(templateObject_1 || (templateObject_1 = __makeTe
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
var InternalModalTransition = function (_a) {
|
|
21
|
-
var children = _a.children, isOpen = _a.isOpen, transitionRef = _a.transitionRef, onClose = _a.onClose, finalZIndex = _a.finalZIndex,
|
|
21
|
+
var children = _a.children, isOpen = _a.isOpen, transitionRef = _a.transitionRef, onClose = _a.onClose, finalZIndex = _a.finalZIndex, _b = _a.isLeftHandSide, isLeftHandSide = _b === void 0 ? false : _b, _c = _a.closeOnBackgroundClick, closeOnBackgroundClick = _c === void 0 ? false : _c, largeScreenMaxWidth = _a.largeScreenMaxWidth, rest = __rest(_a, ["children", "isOpen", "transitionRef", "onClose", "finalZIndex", "isLeftHandSide", "closeOnBackgroundClick", "largeScreenMaxWidth"]);
|
|
22
22
|
return (React.createElement(Transition, { in: isOpen, nodeRef: transitionRef, addEndListener: function (done) {
|
|
23
23
|
var _a;
|
|
24
24
|
(_a = transitionRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener("transitionend", done);
|
|
25
25
|
}, timeout: 500, mountOnEnter: true, unmountOnExit: true }, function (state) { return (React.createElement(FocusOn, { onEscapeKey: onClose, returnFocus: true, autoFocus: true, preventScrollOnFocus: true },
|
|
26
26
|
React.createElement(FadeOutBox, { "$zIndex": finalZIndex, "$state": state, onClick: closeOnBackgroundClick ? onClose : undefined }),
|
|
27
|
-
React.createElement(InternalSlideInFlex, __assign({ isLeftHandSide: isLeftHandSide, ref: transitionRef, "$zIndex": finalZIndex,
|
|
27
|
+
React.createElement(InternalSlideInFlex, __assign({ isLeftHandSide: isLeftHandSide, ref: transitionRef, "$zIndex": finalZIndex, state: state, "aria-modal": true, largeScreenMaxWidth: largeScreenMaxWidth }, rest), children))); }));
|
|
28
28
|
};
|
|
29
29
|
var templateObject_1;
|
|
30
30
|
|
|
@@ -16,7 +16,7 @@ import { sizeStyle } from '../../../styles/utils/sizeStyle.js';
|
|
|
16
16
|
var StyledInternalButton = styled(InternalButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-block;\n ", "\n ", "\n ", "\n"], ["\n display: inline-block;\n ", "\n ", "\n ", "\n"])), positionStyle, sizeStyle, function (props) { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover {\n text-decoration: underline;\n color: ", ";\n\n &:not(:active) [data-icon-for=\"button\"] img {\n filter: ", ";\n }\n }\n &:active {\n color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n "], ["\n &:hover {\n text-decoration: underline;\n color: ", ";\n\n &:not(:active) [data-icon-for=\"button\"] img {\n filter: ", ";\n }\n }\n &:active {\n color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n "])), parseColor(props.$hoverTextColor), props.$hoverIconColor
|
|
17
17
|
? parseColorFilter(props.$hoverIconColor)
|
|
18
18
|
: undefined, parseColor(props.$defaultTextColor), parseColor(props.$disabledTextColor)); });
|
|
19
|
-
var StyledButtonWrapper = styled(OakFlex)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n > :first-
|
|
19
|
+
var StyledButtonWrapper = styled(OakFlex)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n > :first-of-type:hover .highlight {\n display: block;\n }\n > :first-of-type:active .highlight {\n display: block;\n }\n > :first-of-type:active .shadow {\n display: block;\n }\n > :first-of-type:focus-visible {\n box-shadow:\n ", ",\n ", ";\n background: white;\n }\n"], ["\n > :first-of-type:hover .highlight {\n display: block;\n }\n > :first-of-type:active .highlight {\n display: block;\n }\n > :first-of-type:active .shadow {\n display: block;\n }\n > :first-of-type:focus-visible {\n box-shadow:\n ", ",\n ", ";\n background: white;\n }\n"])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"));
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
* A styled button with round icons, not intended to be used directly.
|
|
@@ -11,12 +11,11 @@ import { OakLoadingSpinner } from '../../messaging-and-feedback/OakLoadingSpinne
|
|
|
11
11
|
import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
|
|
12
12
|
import { positionStyle } from '../../../styles/utils/positionStyle.js';
|
|
13
13
|
import { parseColor } from '../../../styles/helpers/parseColor.js';
|
|
14
|
-
import { sizeStyle } from '../../../styles/utils/sizeStyle.js';
|
|
15
14
|
|
|
16
|
-
var StyledInternalButton = styled(InternalButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-block;\n ", "\n ", "\n
|
|
15
|
+
var StyledInternalButton = styled(InternalButton)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-block;\n ", "\n ", "\n"], ["\n display: inline-block;\n ", "\n ", "\n"])), positionStyle, function (props) { return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover {\n text-decoration: underline;\n color: ", ";\n\n &:not(:active) [data-icon-for=\"button\"] img {\n filter: ", ";\n }\n }\n &:active {\n color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n "], ["\n &:hover {\n text-decoration: underline;\n color: ", ";\n\n &:not(:active) [data-icon-for=\"button\"] img {\n filter: ", ";\n }\n }\n &:active {\n color: ", ";\n }\n &:disabled {\n color: ", ";\n }\n "])), parseColor(props.$hoverTextColor), props.$hoverIconColor
|
|
17
16
|
? parseColorFilter(props.$hoverIconColor)
|
|
18
17
|
: undefined, parseColor(props.$defaultTextColor), parseColor(props.$disabledTextColor)); });
|
|
19
|
-
var StyledButtonWrapper = styled(OakFlex)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (props) { return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n > :first-
|
|
18
|
+
var StyledButtonWrapper = styled(OakFlex)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (props) { return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n > :first-of-type:focus-visible .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n > :first-of-type:hover .shadow {\n box-shadow: ", ";\n }\n > :first-of-type:active .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n "], ["\n > :first-of-type:focus-visible .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n > :first-of-type:hover .shadow {\n box-shadow: ", ";\n }\n > :first-of-type:active .shadow {\n box-shadow:\n ", ",\n ", ";\n }\n "])), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), parseDropShadow(props.$hoverDropShadow /*"drop-shadow-lemon"*/), parseDropShadow("drop-shadow-lemon"), parseDropShadow("drop-shadow-grey")); }, function (props) { return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n > :first-of-type:disabled .icon-container {\n background: ", ";\n }\n > :first-of-type:hover .icon-container {\n background: ", ";\n }\n > :first-of-type:active .icon-container {\n background: ", ";\n }\n "], ["\n > :first-of-type:disabled .icon-container {\n background: ", ";\n }\n > :first-of-type:hover .icon-container {\n background: ", ";\n }\n > :first-of-type:active .icon-container {\n background: ", ";\n }\n "])), parseColor(props.$disabledIconBackground), parseColor(props.$hoverIconBackground), parseColor(props.$defaultIconBackground)); });
|
|
20
19
|
/**
|
|
21
20
|
*
|
|
22
21
|
* A styled button with round icons, not intended to be used directly.
|
package/dist/npm/es/components/internal-components/InternalSlideInFlex/InternalSlideInFlex.js
CHANGED
|
@@ -5,25 +5,25 @@ import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
|
|
|
5
5
|
import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
|
|
6
6
|
|
|
7
7
|
var SlideInFlex = styled(OakFlex)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n max-width: ", ";\n transform: ", ";\n ", "\n"], ["\n max-width: ", ";\n transform: ", ";\n ", "\n"])), function (_a) {
|
|
8
|
-
var isLeftHandSide = _a
|
|
9
|
-
return isLeftHandSide ? "calc(100vw - ".concat(parseSpacing("spacing-20"), ")") : "100vw";
|
|
8
|
+
var $isLeftHandSide = _a.$isLeftHandSide;
|
|
9
|
+
return $isLeftHandSide ? "calc(100vw - ".concat(parseSpacing("spacing-20"), ")") : "100vw";
|
|
10
10
|
}, function (_a) {
|
|
11
|
-
var $state = _a.$state, isLeftHandSide = _a
|
|
11
|
+
var $state = _a.$state, $isLeftHandSide = _a.$isLeftHandSide;
|
|
12
12
|
switch ($state) {
|
|
13
13
|
case "entered":
|
|
14
14
|
case "entering":
|
|
15
15
|
return "translateX(0)";
|
|
16
16
|
default:
|
|
17
|
-
return isLeftHandSide ? "translateX(-100%)" : "translateX(100%)";
|
|
17
|
+
return $isLeftHandSide ? "translateX(-100%)" : "translateX(100%)";
|
|
18
18
|
}
|
|
19
19
|
}, function (_a) {
|
|
20
|
-
var isLeftHandSide = _a
|
|
21
|
-
return
|
|
22
|
-
"\n @media (min-width: 768px) {\n max-width: ".concat(largeScreenMaxWidth, "px;\n }\n ");
|
|
20
|
+
var $isLeftHandSide = _a.$isLeftHandSide, $largeScreenMaxWidth = _a.$largeScreenMaxWidth;
|
|
21
|
+
return !$isLeftHandSide &&
|
|
22
|
+
"\n @media (min-width: 768px) {\n max-width: ".concat($largeScreenMaxWidth, "px;\n }\n ");
|
|
23
23
|
});
|
|
24
24
|
var InternalSlideInFlex = forwardRef(function (props, ref) {
|
|
25
25
|
var finalZIndex = props.finalZIndex, state = props.state, isLeftHandSide = props.isLeftHandSide, children = props.children, _a = props.largeScreenMaxWidth, largeScreenMaxWidth = _a === void 0 ? 600 : _a, rest = __rest(props, ["finalZIndex", "state", "isLeftHandSide", "children", "largeScreenMaxWidth"]);
|
|
26
|
-
return (React.createElement(SlideInFlex, __assign({ ref: ref, "$background": "bg-primary", "$right": !isLeftHandSide ? "spacing-0" : null, "$left": isLeftHandSide ? "spacing-0" : null, "$position": "fixed", "$bottom": "spacing-0", "$width": ["spacing-640"], "$top": "spacing-0", "$transition": "standard-ease", "$zIndex": finalZIndex, "$flexDirection": "column", "$state": state, "$color": "text-primary", role: "dialog", isLeftHandSide: isLeftHandSide, largeScreenMaxWidth: largeScreenMaxWidth }, rest), children));
|
|
26
|
+
return (React.createElement(SlideInFlex, __assign({ ref: ref, "$background": "bg-primary", "$right": !isLeftHandSide ? "spacing-0" : null, "$left": isLeftHandSide ? "spacing-0" : null, "$position": "fixed", "$bottom": "spacing-0", "$width": ["spacing-640"], "$top": "spacing-0", "$transition": "standard-ease", "$zIndex": finalZIndex, "$flexDirection": "column", "$state": state, "$color": "text-primary", role: "dialog", "$isLeftHandSide": isLeftHandSide, "$largeScreenMaxWidth": largeScreenMaxWidth }, rest), children));
|
|
27
27
|
});
|
|
28
28
|
var templateObject_1;
|
|
29
29
|
|
|
@@ -12,7 +12,7 @@ import { sizeStyle } from '../../../styles/utils/sizeStyle.js';
|
|
|
12
12
|
* E.g. ios and rounded borders (which border-radius doesn't fix without
|
|
13
13
|
* appearance: none)
|
|
14
14
|
*/
|
|
15
|
-
var StyledInput = styled.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n appearance: none !important;\n border: 0;\n border-radius: 0;\n border-color: transparent;\n box-shadow: none;\n font-family: inherit;\n background: transparent;\n outline: none;\n color: inherit;\n\n @media (max-width: ", "px) {\n /* iOS zooms in on inputs with font sizes <16px on mobile */\n font-size: 16px;\n }\n\n
|
|
15
|
+
var StyledInput = styled.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n appearance: none !important;\n border: 0;\n border-radius: 0;\n border-color: transparent;\n box-shadow: none;\n font-family: inherit;\n background: transparent;\n outline: none;\n color: inherit;\n\n @media (max-width: ", "px) {\n /* iOS zooms in on inputs with font sizes <16px on mobile */\n font-size: 16px;\n }\n\n &::placeholder {\n color: ", ";\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n ", "\n ", "\n"], ["\n appearance: none !important;\n border: 0;\n border-radius: 0;\n border-color: transparent;\n box-shadow: none;\n font-family: inherit;\n background: transparent;\n outline: none;\n color: inherit;\n\n @media (max-width: ", "px) {\n /* iOS zooms in on inputs with font sizes <16px on mobile */\n font-size: 16px;\n }\n\n &::placeholder {\n color: ", ";\n }\n\n &::-webkit-search-decoration,\n &::-webkit-search-cancel-button,\n &::-webkit-search-results-button,\n &::-webkit-search-results-decoration {\n appearance: none;\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n\n ", "\n ", "\n"])), getBreakpoint("small"), parseColor("text-subdued"), spacingStyle, sizeStyle);
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
* An unstyled input to be used as a basis for UI input components.
|
|
@@ -16,7 +16,7 @@ import { scrollSnapStyle } from '../../../styles/utils/scrollSnapStyle.js';
|
|
|
16
16
|
|
|
17
17
|
var oakBoxCss = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"])), positionStyle, sizeStyle, spacingStyle, colorStyle, borderStyle, displayStyle, dropShadowStyle, opacityStyle, transformStyle, transitionStyle, typographyStyle, zIndexStyle, scrollSnapStyle, function (props) {
|
|
18
18
|
/* onClick might be passed in the useClickableCard pattern */
|
|
19
|
-
return props.onClick && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
19
|
+
return props.onClick && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover {\n cursor: pointer;\n }\n "], ["\n &:hover {\n cursor: pointer;\n }\n "])));
|
|
20
20
|
});
|
|
21
21
|
/**
|
|
22
22
|
* OakBox exposes all the styles that are available styles on a div tag. These include:
|
|
@@ -4,7 +4,7 @@ import { responsiveStyle } from '../../../styles/utils/responsiveStyle.js';
|
|
|
4
4
|
import { OakBox } from '../OakBox/OakBox.js';
|
|
5
5
|
import { parseSpacing } from '../../../styles/helpers/parseSpacing.js';
|
|
6
6
|
|
|
7
|
-
var gridStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n
|
|
7
|
+
var gridStyle = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n"])), responsiveStyle("row-gap", function (props) { return props.$rg; }, parseSpacing), responsiveStyle("column-gap", function (props) { return props.$cg; }, parseSpacing), responsiveStyle("grid-auto-rows", function (props) { return props.$gridAutoRows; }), responsiveStyle("grid-template-areas", function (props) { return props.$gridTemplateAreas; }), responsiveStyle("grid-template-columns", function (props) { return props.$gridTemplateColumns; }), responsiveStyle("grid-template-rows", function (props) { return props.$gridTemplateRows; }), responsiveStyle("align-items", function (props) { return props.$alignItems; }));
|
|
8
8
|
/**
|
|
9
9
|
* Creates a grid layout
|
|
10
10
|
*
|
package/dist/npm/es/components/messaging-and-feedback/OakFocusIndicator/OakFocusIndicator.js
CHANGED
|
@@ -25,12 +25,14 @@ var OakFocusIndicator = styled(OakBox)(templateObject_1 || (templateObject_1 = _
|
|
|
25
25
|
return "\n list-style: none;\n margin: 0;\n padding: 0;\n ";
|
|
26
26
|
}
|
|
27
27
|
}, function (props) {
|
|
28
|
-
return props
|
|
29
|
-
}, hoverChildren, responsiveStyle("background-color", function (props) { return props
|
|
30
|
-
return props
|
|
28
|
+
return props.$dropShadow ? parseDropShadow(props.$dropShadow) : "none";
|
|
29
|
+
}, hoverChildren, responsiveStyle("background-color", function (props) { return props.$hoverBackground; }, function (value) { return parseColor(value); }), function (props) {
|
|
30
|
+
return props.$hoverDropShadow
|
|
31
|
+
? parseDropShadow(props.$hoverDropShadow)
|
|
32
|
+
: "none";
|
|
31
33
|
}, focusVisibleChildren, responsiveStyle("border-radius", function (props) { return props.$borderRadius; }, parseBorderRadius), focusShadow, focusVisibleChildren, activeChildren, function (props) {
|
|
32
|
-
return props
|
|
33
|
-
? parseDropShadow(props
|
|
34
|
+
return props.$activeDropShadow
|
|
35
|
+
? parseDropShadow(props.$activeDropShadow)
|
|
34
36
|
: fallbackActiveShadow;
|
|
35
37
|
});
|
|
36
38
|
var templateObject_1;
|
package/dist/npm/es/components/messaging-and-feedback/OakLoadingSpinner/OakLoadingSpinner.js
CHANGED
|
@@ -9,7 +9,7 @@ import { colorStyle } from '../../../styles/utils/colorStyle.js';
|
|
|
9
9
|
|
|
10
10
|
var SpinnerKeyframe = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"], ["\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n"])));
|
|
11
11
|
var DelayedShow = keyframes(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"], ["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"])));
|
|
12
|
-
var StyledLoadingSpinner = styled.span(
|
|
12
|
+
var StyledLoadingSpinner = styled.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n ", "\n ", "\n --inner-width: calc(var(--width) / 10 * 8);\n --thickness: calc(var(--width) / 12);\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--width);\n ", "\n"], ["\n ", "\n ", "\n --inner-width: calc(var(--width) / 10 * 8);\n --thickness: calc(var(--width) / 12);\n\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--width);\n ", "\n"])), function (props) {
|
|
13
13
|
return props.$width
|
|
14
14
|
? responsiveStyle("--width", function (props) { return props.$width; }, parseSpacing)
|
|
15
15
|
: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n --width: 1.25rem;\n "], ["\n --width: 1.25rem;\n "])));
|
|
@@ -18,17 +18,23 @@ var StyledLoadingSpinner = styled.span(templateObject_7 || (templateObject_7 = _
|
|
|
18
18
|
if ($delay) {
|
|
19
19
|
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n opacity: 0;\n animation: ", " 0s;\n animation-delay: ", "s;\n animation-fill-mode: forwards;\n "], ["\n opacity: 0;\n animation: ", " 0s;\n animation-delay: ", "s;\n animation-fill-mode: forwards;\n "])), DelayedShow, $delay / 1000);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
}, colorStyle);
|
|
22
|
+
var StyledSpinnerRing = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n width: var(--inner-width);\n height: var(--inner-width);\n border-radius: 50%;\n border: var(--thickness) solid;\n ", "\n animation: ", " 1.2s linear infinite;\n"], ["\n width: var(--inner-width);\n height: var(--inner-width);\n border-radius: 50%;\n border: var(--thickness) solid;\n ", "\n animation: ", " 1.2s linear infinite;\n"])), function (props) {
|
|
23
|
+
if (props.$loaderColor) {
|
|
24
|
+
var colorVal = parseColor(props.$loaderColor);
|
|
25
|
+
var resolvedColor = typeof colorVal === "function" ? colorVal(props) : colorVal;
|
|
26
|
+
return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-color: ", " ", " ", "\n transparent;\n "], ["\n border-color: ", " ", " ", "\n transparent;\n "])), resolvedColor, resolvedColor, resolvedColor);
|
|
27
|
+
}
|
|
28
|
+
return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-color: currentcolor currentcolor currentcolor transparent;\n "], ["\n border-color: currentcolor currentcolor currentcolor transparent;\n "])));
|
|
29
|
+
}, SpinnerKeyframe);
|
|
25
30
|
/**
|
|
26
31
|
*
|
|
27
32
|
* A loading spinner of variable size.
|
|
28
33
|
*
|
|
29
34
|
*/
|
|
30
35
|
var OakLoadingSpinner = function (props) { return (React.createElement(StyledLoadingSpinner, __assign({}, props),
|
|
31
|
-
React.createElement(OakScreenReader, null, "Loading")
|
|
32
|
-
|
|
36
|
+
React.createElement(OakScreenReader, null, "Loading"),
|
|
37
|
+
React.createElement(StyledSpinnerRing, { "$loaderColor": props.loaderColor }))); };
|
|
38
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
33
39
|
|
|
34
40
|
export { OakLoadingSpinner };
|
|
@@ -5,10 +5,10 @@ import { OakFlex } from '../../layout-and-structure/OakFlex/OakFlex.js';
|
|
|
5
5
|
import { OakIcon } from '../../images-and-icons/OakIcon/OakIcon.js';
|
|
6
6
|
|
|
7
7
|
var OakTagFunctional = function (props) {
|
|
8
|
-
var label = props.label, useSpan = props.useSpan, oakFlexProps = __rest(props, ["label", "useSpan"]);
|
|
9
|
-
var icon =
|
|
10
|
-
var trailingIcon =
|
|
11
|
-
var leadingIcon = !
|
|
8
|
+
var label = props.label, useSpan = props.useSpan, isTrailingIcon = props.isTrailingIcon, iconName = props.iconName, oakFlexProps = __rest(props, ["label", "useSpan", "isTrailingIcon", "iconName"]);
|
|
9
|
+
var icon = iconName && (React.createElement(OakIcon, { "$height": "spacing-20", "$width": "spacing-20", iconName: iconName }));
|
|
10
|
+
var trailingIcon = isTrailingIcon && icon;
|
|
11
|
+
var leadingIcon = !isTrailingIcon && icon;
|
|
12
12
|
return (React.createElement(OakFlex, __assign({ "$borderRadius": "border-radius-m", "$ph": "spacing-8", "$pv": "spacing-4", "$font": "heading-light-7", "$gap": "spacing-8" }, oakFlexProps),
|
|
13
13
|
leadingIcon,
|
|
14
14
|
React.createElement(OakBox, { as: useSpan ? "span" : undefined }, label),
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { __assign } from 'tslib';
|
|
1
|
+
import { __makeTemplateObject, __rest, __assign } from 'tslib';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
3
4
|
import { variantConfig } from './config.js';
|
|
4
5
|
import { InternalLink } from '../../internal-components/InternalLink/InternalLink.js';
|
|
6
|
+
import { typographyStyle } from '../../../styles/utils/typographyStyle.js';
|
|
5
7
|
|
|
8
|
+
var StyledInternalLink = styled(InternalLink)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) { return props.$font && typographyStyle; });
|
|
6
9
|
/**
|
|
7
10
|
* A link with an optional icon and loading state.
|
|
8
11
|
*
|
|
9
12
|
* Defaulting to a `HTMLAnchorElement` this component is polymorphic and can be rendered as a button or any other element.
|
|
10
13
|
*/
|
|
11
14
|
var OakLink = forwardRef(function (props, ref) {
|
|
12
|
-
var _a = props.variant, variant = _a === void 0 ? "primary" : _a;
|
|
15
|
+
var _a = props.variant, variant = _a === void 0 ? "primary" : _a, restProps = __rest(props, ["variant"]);
|
|
13
16
|
var variantDefinition = variantConfig[variant];
|
|
14
|
-
return (React.createElement(
|
|
17
|
+
return (React.createElement(StyledInternalLink, __assign({ color: variantDefinition.color, hoverColor: variantDefinition.hoverColor, activeColor: variantDefinition.activeColor, visitedColor: variantDefinition.visitedColor, textDecoration: variantDefinition.textDecoration, disabledColor: "text-disabled" }, restProps, { ref: ref })));
|
|
15
18
|
});
|
|
19
|
+
var templateObject_1;
|
|
16
20
|
|
|
17
21
|
export { OakLink };
|
|
@@ -12,24 +12,24 @@ import { parseColor } from '../../../styles/helpers/parseColor.js';
|
|
|
12
12
|
import { OakLink } from '../OakLink/OakLink.js';
|
|
13
13
|
import { typographyStyle } from '../../../styles/utils/typographyStyle.js';
|
|
14
14
|
|
|
15
|
-
var StyledChevronButton = styled(OakLink)(
|
|
16
|
-
var StyledIcon = styled(OakIcon)(
|
|
15
|
+
var StyledChevronButton = styled(OakLink)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-block;\n"], ["\n display: inline-block;\n"])));
|
|
16
|
+
var StyledIcon = styled(OakIcon)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
17
17
|
if (props.disabled) {
|
|
18
|
-
return css(
|
|
18
|
+
return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n filter: ", ";\n "], ["\n filter: ", ";\n "])), parseColorFilter("icon-disabled"));
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
|
-
var StyledNumberButton = styled(OakLink)(
|
|
21
|
+
var StyledNumberButton = styled(OakLink)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 30px;\n width: 30px;\n border-radius: 100px;\n display: flex;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n ", "\n color: ", ";\n\n ", ";\n\n ", "\n\n @media (hover: hover) {\n &:hover,\n &:visited:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n"], ["\n height: 30px;\n width: 30px;\n border-radius: 100px;\n display: flex;\n align-items: center;\n justify-content: center;\n text-decoration: none;\n ", "\n color: ", ";\n\n ", ";\n\n ", "\n\n @media (hover: hover) {\n &:hover,\n &:visited:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n"])), typographyStyle, parseColor("text-primary"), function (props) { return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), props.$selected
|
|
22
22
|
? parseColor("icon-primary")
|
|
23
23
|
: parseColor("icon-inverted")); }, function (props) {
|
|
24
|
-
return props
|
|
24
|
+
return props.$selected && css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n &:visited {\n color: ", ";\n }\n "], ["\n color: ", ";\n &:visited {\n color: ", ";\n }\n "])), parseColor("text-inverted"), parseColor("text-inverted"));
|
|
25
25
|
}, function (props) {
|
|
26
|
-
return props
|
|
26
|
+
return parseColor(props.$selected ? "text-inverted" : "text-primary");
|
|
27
27
|
});
|
|
28
|
-
var StyledEllipsis = styled(InternalButton)(
|
|
28
|
+
var StyledEllipsis = styled(InternalButton)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n &:disabled {\n cursor: pointer;\n }\n"], ["\n &:disabled {\n cursor: pointer;\n }\n"])));
|
|
29
29
|
var OakPageNumber = function (_a) {
|
|
30
30
|
var currentPage = _a.currentPage, pageNumber = _a.pageNumber, onClick = _a.onClick, href = _a.href, pageName = _a.pageName;
|
|
31
31
|
var isActive = currentPage === pageNumber;
|
|
32
|
-
return (React.createElement(StyledNumberButton, { "data-testid": "page-number-component", "aria-label": "".concat(pageName, " page ").concat(pageNumber), "aria-current": isActive ? "page" : false, "$font": "heading-7", onClick: onClick, selected: isActive, href: href }, pageNumber));
|
|
32
|
+
return (React.createElement(StyledNumberButton, { "data-testid": "page-number-component", "aria-label": "".concat(pageName, " page ").concat(pageNumber), "aria-current": isActive ? "page" : false, "$font": "heading-7", onClick: onClick, "$selected": isActive, href: href }, pageNumber));
|
|
33
33
|
};
|
|
34
34
|
var OakEllipsis = function () {
|
|
35
35
|
return (React.createElement(StyledEllipsis, { "$color": "text-primary", "$font": "heading-7", "$background": "bg-primary", "aria-label": "Hidden page numbers", disabled: true }, "..."));
|
|
@@ -84,7 +84,7 @@ var OakPagination = function (_a) {
|
|
|
84
84
|
}, "aria-disabled": isLastPage, disabled: isLastPage, "aria-label": isLastPage ? "No further pages" : "Go to next page" },
|
|
85
85
|
React.createElement(StyledIcon, { disabled: isLastPage, iconName: "chevron-right" })))));
|
|
86
86
|
};
|
|
87
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7
|
|
87
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
88
88
|
/**
|
|
89
89
|
*
|
|
90
90
|
* Add the description of the component here and it will appear on the story for the component
|
|
@@ -13,7 +13,7 @@ import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
|
|
|
13
13
|
import { InternalStyledSvg } from '../../internal-components/InternalStyledSvg/InternalStyledSvg.js';
|
|
14
14
|
import { Underline } from '../../../svgs/underline.js';
|
|
15
15
|
|
|
16
|
-
var StyledButton = styled(InternalButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
16
|
+
var StyledButton = styled(InternalButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover .buttonText {\n text-decoration: underline;\n color: ", ";\n }\n\n &:focus .focusUnderlineSvg {\n display: block;\n filter: ", "\n drop-shadow(", ");\n transform: rotate(-2deg);\n }\n\n &:focus .activeUnderline {\n display: none;\n }\n\n &:focus .focusUnderline {\n display: block;\n }\n .activeUnderlineSvg,\n .focusUnderlineSvg {\n position: absolute;\n bottom: 0;\n }\n"], ["\n &:hover .buttonText {\n text-decoration: underline;\n color: ", ";\n }\n\n &:focus .focusUnderlineSvg {\n display: block;\n filter: ", "\n drop-shadow(", ");\n transform: rotate(-2deg);\n }\n\n &:focus .activeUnderline {\n display: none;\n }\n\n &:focus .focusUnderline {\n display: block;\n }\n .activeUnderlineSvg,\n .focusUnderlineSvg {\n position: absolute;\n bottom: 0;\n }\n"])), parseColor("text-primary"), parseColorFilter("icon-promo"), parseDropShadow("drop-shadow-black"));
|
|
17
17
|
var OakHomepageTabButton = function (props) {
|
|
18
18
|
var _a = props.element, element = _a === void 0 ? "button" : _a, iconName = props.iconName, isActive = props.isActive, title = props.title, showNewIcon = props.showNewIcon, rest = __rest(props, ["element", "iconName", "isActive", "title", "showNewIcon"]);
|
|
19
19
|
var color = isActive ? "text-primary" : "text-subdued";
|
|
@@ -9,8 +9,8 @@ import { parseColor } from '../../../styles/helpers/parseColor.js';
|
|
|
9
9
|
import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
|
|
10
10
|
|
|
11
11
|
var StyledOakFlexAsLink = styled(OakFlex)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n animation: ", ";\n animation-delay: 0.5s;\n cursor: pointer;\n outline: none;\n &:focus-visible {\n box-shadow:\n ", ",\n ", ";\n }\n\n @keyframes background-fade {\n from {\n background-color: ", ";\n }\n to {\n transform: ", ";\n }\n }\n"], ["\n animation: ", ";\n animation-delay: 0.5s;\n cursor: pointer;\n outline: none;\n &:focus-visible {\n box-shadow:\n ", ",\n ", ";\n }\n\n @keyframes background-fade {\n from {\n background-color: ", ";\n }\n to {\n transform: ", ";\n }\n }\n"])), function (_a) {
|
|
12
|
-
var hasAnimation = _a
|
|
13
|
-
return hasAnimation ? "background-fade 2s ease-in-out" : "none";
|
|
12
|
+
var $hasAnimation = _a.$hasAnimation;
|
|
13
|
+
return $hasAnimation ? "background-fade 2s ease-in-out" : "none";
|
|
14
14
|
}, parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), parseColor("bg-decorative1-main"), parseColor("bg-primary"));
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated Use `<OakCard />` instead
|
|
@@ -30,7 +30,7 @@ var StyledOakFlexAsLink = styled(OakFlex)(templateObject_1 || (templateObject_1
|
|
|
30
30
|
*/
|
|
31
31
|
var OakLinkCard = function (_a) {
|
|
32
32
|
var mainSection = _a.mainSection, _b = _a.iconName, iconName = _b === void 0 ? "books" : _b, _c = _a.iconAlt, iconAlt = _c === void 0 ? "" : _c, _d = _a.iconColor, iconColor = _d === void 0 ? "icon-primary" : _d, _e = _a.iconFill, iconFill = _e === void 0 ? "bg-decorative1-main" : _e, href = _a.href, _f = _a.showNew, showNew = _f === void 0 ? false : _f, _g = _a.hasAnimation, hasAnimation = _g === void 0 ? false : _g, _h = _a.narrow, narrow = _h === void 0 ? false : _h;
|
|
33
|
-
return (React.createElement(StyledOakFlexAsLink, { hasAnimation: hasAnimation, as: "a", href: href, "$flexDirection": narrow ? "column-reverse" : ["column-reverse", "row"], "$alignItems": narrow ? "flex-start" : ["flex-start", "center"], "$justifyContent": "space-between", "$gap": "spacing-32", "$background": "bg-primary", "$pa": "spacing-24", "$borderRadius": "border-radius-m2", "$width": "100%", "$dropShadow": "drop-shadow-centred-standard" },
|
|
33
|
+
return (React.createElement(StyledOakFlexAsLink, { "$hasAnimation": hasAnimation, as: "a", href: href, "$flexDirection": narrow ? "column-reverse" : ["column-reverse", "row"], "$alignItems": narrow ? "flex-start" : ["flex-start", "center"], "$justifyContent": "space-between", "$gap": "spacing-32", "$background": "bg-primary", "$pa": "spacing-24", "$borderRadius": "border-radius-m2", "$width": "100%", "$dropShadow": "drop-shadow-centred-standard" },
|
|
34
34
|
React.createElement(OakBox, { "$width": "100%" }, mainSection),
|
|
35
35
|
React.createElement(OakBox, { "$position": "relative" },
|
|
36
36
|
React.createElement(OakHandDrawnCardWithIcon, { iconName: iconName, alt: iconAlt, iconWidth: narrow ? ["spacing-64"] : ["spacing-64", "spacing-100"], iconHeight: narrow ? ["spacing-64"] : ["spacing-64", "spacing-100"], "$width": narrow ? ["spacing-80"] : ["spacing-80", "spacing-160"], "$height": narrow ? ["spacing-80"] : ["spacing-80", "spacing-160"], fill: iconFill, iconColor: iconColor }),
|
|
@@ -62,7 +62,7 @@ var OakMediaClip = function (_a) {
|
|
|
62
62
|
React.createElement(MediaButtonWrapper, { "$position": "relative", "$borderRadius": "border-radius-s" },
|
|
63
63
|
React.createElement(OakBox, { className: "grey-shadow", "$position": "absolute", "$borderRadius": "border-radius-s", "$width": "100%", "$height": "100%", "$top": "spacing-0" }),
|
|
64
64
|
React.createElement(OakBox, { className: "yellow-shadow", "$position": "absolute", "$borderRadius": "border-radius-s", "$width": "100%", "$height": "100%", "$top": "spacing-0" }),
|
|
65
|
-
React.createElement(StyledInternalButton, { element: element, tabIndex: 0, className: "internal-button", "$width": "100%", "$height": "100%", "$background": buttonStyles.defaultBackground, "$borderColor": "transparent", "$borderRadius": "border-radius-s", "$position": "relative", disabled: disabled, "$defaultBorderColor": "transparent", "$color": buttonStyles.defaultTextColor, "$hoverBackground": buttonStyles.hoverBackground, "$hoverBorderColor": "transparent", "$hoverTextColor": "text-primary", "$disabledBackground": "bg-btn-secondary-disabled", "$disabledBorderColor": "text-disabled", "$disabledTextColor": "text-disabled", "$justifyContent": "flex-start", onClick: onClick, "$pa": "spacing-8", "$muxPlayingState": muxPlayingState, "aria-label": buttonAriaLabel },
|
|
65
|
+
React.createElement(StyledInternalButton, { element: element, tabIndex: 0, className: "internal-button", "$width": "100%", "$height": "100%", "$background": buttonStyles.defaultBackground, "$defaultTextColor": buttonStyles.defaultTextColor, "$defaultBackground": buttonStyles.defaultBackground, "$borderColor": "transparent", "$borderRadius": "border-radius-s", "$position": "relative", disabled: disabled, "$defaultBorderColor": "transparent", "$color": buttonStyles.defaultTextColor, "$hoverBackground": buttonStyles.hoverBackground, "$hoverBorderColor": "transparent", "$hoverTextColor": "text-primary", "$disabledBackground": "bg-btn-secondary-disabled", "$disabledBorderColor": "text-disabled", "$disabledTextColor": "text-disabled", "$justifyContent": "flex-start", onClick: onClick, "$pa": "spacing-8", "$muxPlayingState": muxPlayingState, "aria-label": buttonAriaLabel },
|
|
66
66
|
React.createElement(OakFlex, { "$flexDirection": "row", "$alignItems": "center", "$width": "100%" },
|
|
67
67
|
React.createElement(React.Fragment, null,
|
|
68
68
|
React.createElement(ImageBox, { "$height": "spacing-56", "$width": "spacing-100", "$borderRadius": "border-radius-xs", "$mr": "spacing-16", "$position": "relative", disabled: disabled, "$flexShrink": 0 },
|
|
@@ -9,7 +9,7 @@ import { InternalButton } from '../../internal-components/InternalButton/Interna
|
|
|
9
9
|
import { parseColor } from '../../../styles/helpers/parseColor.js';
|
|
10
10
|
import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
|
|
11
11
|
|
|
12
|
-
var StyledInternalButton = styled(InternalButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n
|
|
12
|
+
var StyledInternalButton = styled(InternalButton)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover {\n .oak-save-count {\n background-color: ", ";\n }\n }\n &:focus-visible {\n .oak-save-count {\n box-shadow:\n ", ",\n ", ";\n }\n }\n"], ["\n &:hover {\n .oak-save-count {\n background-color: ", ";\n }\n }\n &:focus-visible {\n .oak-save-count {\n box-shadow:\n ", ",\n ", ";\n }\n }\n"])), parseColor("bg-decorative1-main"), parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"));
|
|
13
13
|
var OakSaveCount = function (_a) {
|
|
14
14
|
var count = _a.count, href = _a.href, loading = _a.loading, _b = _a.label, label = _b === void 0 ? "My library" : _b;
|
|
15
15
|
var hasCount = typeof count === "number";
|
|
@@ -10,19 +10,19 @@ import { parseDropShadow } from '../../../styles/helpers/parseDropShadow.js';
|
|
|
10
10
|
import { OakIcon } from '../../images-and-icons/OakIcon/OakIcon.js';
|
|
11
11
|
import { OakSpan } from '../../typography/OakSpan/OakSpan.js';
|
|
12
12
|
|
|
13
|
-
var StyledLink = styled("a")(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-decoration: none;\n display: flex;\n outline: none;\n background-color: ", ";\n\n @media (min-width: ", "px) {\n border-left: ", ";\n
|
|
14
|
-
return props
|
|
13
|
+
var StyledLink = styled("a")(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-decoration: none;\n display: flex;\n outline: none;\n background-color: ", ";\n\n @media (min-width: ", "px) {\n border-left: ", ";\n &:hover {\n text-decoration: underline;\n border-color: ", ";\n }\n }\n\n &:focus-visible {\n box-shadow:\n ", ",\n ", ";\n border-color: transparent;\n border-radius: 4px;\n }\n ", "\n ", "\n"], ["\n text-decoration: none;\n display: flex;\n outline: none;\n background-color: ", ";\n\n @media (min-width: ", "px) {\n border-left: ", ";\n &:hover {\n text-decoration: underline;\n border-color: ", ";\n }\n }\n\n &:focus-visible {\n box-shadow:\n ", ",\n ", ";\n border-color: transparent;\n border-radius: 4px;\n }\n ", "\n ", "\n"])), function (props) {
|
|
14
|
+
return props.$isSelected ? parseColor(props.$selectedBackground) : undefined;
|
|
15
15
|
}, getBreakpoint("small"), function (props) {
|
|
16
|
-
return props
|
|
16
|
+
return props.$isSelected ? "4px solid #222222" : "4px solid transparent";
|
|
17
17
|
}, function (props) {
|
|
18
|
-
return props
|
|
18
|
+
return props.$isSelected
|
|
19
19
|
? parseColor("bg-btn-primary-hover")
|
|
20
|
-
: parseColor(props
|
|
20
|
+
: parseColor(props.$hoverBorderColor);
|
|
21
21
|
}, parseDropShadow("drop-shadow-centered-lemon"), parseDropShadow("drop-shadow-centered-grey"), flexStyle, paddingStyle);
|
|
22
22
|
var OakSideMenuNavLinkCss = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), flexStyle, paddingStyle);
|
|
23
23
|
var UnstyledComponent = function (props) {
|
|
24
24
|
var item = props.item, isSelected = props.isSelected, onClick = props.onClick, _a = props.hoverBorderColor, hoverBorderColor = _a === void 0 ? "bg-decorative1-main" : _a, selectedBackground = props.selectedBackground, _b = props.selectedHeadingFont, selectedHeadingFont = _b === void 0 ? "heading-light-7" : _b, rest = __rest(props, ["item", "isSelected", "onClick", "hoverBorderColor", "selectedBackground", "selectedHeadingFont"]);
|
|
25
|
-
return (React.createElement(StyledLink, __assign({ "$alignItems": ["center", "flex-start"], "$columnGap": "spacing-16", href: item.href, "$ph": ["spacing-0", "spacing-12"], isSelected: isSelected, hoverBorderColor: hoverBorderColor, selectedBackground: selectedBackground, "$flexDirection": ["row", "column"], onClick: onClick, "aria-current": isSelected ? "true" : undefined }, rest),
|
|
25
|
+
return (React.createElement(StyledLink, __assign({ "$alignItems": ["center", "flex-start"], "$columnGap": "spacing-16", href: item.href, "$ph": ["spacing-0", "spacing-12"], "$isSelected": isSelected, "$hoverBorderColor": hoverBorderColor, "$selectedBackground": selectedBackground, "$flexDirection": ["row", "column"], onClick: onClick, "aria-current": isSelected ? "true" : undefined }, rest),
|
|
26
26
|
React.createElement(OakFlex, { "$flexDirection": ["row", "column"], "$columnGap": ["spacing-16", "spacing-4"], "$flexWrap": "wrap" },
|
|
27
27
|
React.createElement(OakSpan, { "$font": isSelected ? selectedHeadingFont : "heading-light-7", "$color": "text-primary" }, item.heading),
|
|
28
28
|
item.subheading && (React.createElement(OakSpan, { "$font": "body-3", "$color": "text-subdued", "$whiteSpace": "break-spaces" }, item.subheading))),
|