@7shifts/sous-chef 4.3.0 → 4.4.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.
- package/dist/controls/ToolbarSelect/ToolbarSelect.d.ts +1 -1
- package/dist/forms/AsyncSelectField/AsyncSelectField.d.ts +1 -1
- package/dist/forms/CheckboxField/CheckboxField.d.ts +1 -1
- package/dist/forms/CurrencyField/CurrencyField.d.ts +2 -2
- package/dist/forms/DateField/DateField.d.ts +1 -1
- package/dist/forms/DateRangeField/DateRangeField.d.ts +1 -1
- package/dist/forms/MultiSelectField/MultiSelectField.d.ts +1 -1
- package/dist/forms/NumberField/NumberField.d.ts +1 -2
- package/dist/forms/PasswordField/PasswordField.d.ts +1 -1
- package/dist/forms/PercentageField/PercentageField.d.ts +1 -2
- package/dist/forms/PillSelectField/PillSelectField.d.ts +1 -1
- package/dist/forms/RadioGroupField/RadioGroupField.d.ts +1 -1
- package/dist/forms/SelectField/SelectField.d.ts +1 -1
- package/dist/forms/TextAreaField/TextAreaField.d.ts +1 -0
- package/dist/forms/TextField/TextField.d.ts +1 -0
- package/dist/forms/TimeField/TimeField.d.ts +2 -2
- package/dist/forms/TimeRangeField/TimeRangeField.d.ts +1 -0
- package/dist/forms/WeekField/WeekField.d.ts +1 -1
- package/dist/hooks/useScrollDetector.d.ts +1 -1
- package/dist/index.css +87 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +136 -82
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +141 -88
- package/dist/index.modern.js.map +1 -1
- package/dist/navigation/PrimaryNav/PrimaryNav.d.ts +3 -1
- package/dist/navigation/PrimaryNav/PrimaryNavContext.d.ts +3 -1
- package/dist/navigation/PrimaryNavItem/PrimaryNavItem.d.ts +3 -2
- package/dist/navigation/PrimaryNavSubItem/PrimaryNavSubItem.d.ts +3 -2
- package/package.json +2 -1
package/dist/index.modern.js
CHANGED
|
@@ -4660,7 +4660,7 @@ const IconMinus = forwardRef((_ref, ref) => {
|
|
|
4660
4660
|
viewBox: "0 0 24 24"
|
|
4661
4661
|
}), React__default.createElement("path", {
|
|
4662
4662
|
fill: "currentColor",
|
|
4663
|
-
d: "
|
|
4663
|
+
d: "M4.286 10.5C3.575 10.5 3 11.17 3 12s.575 1.5 1.286 1.5h15.428c.711 0 1.286-.67 1.286-1.5s-.575-1.5-1.286-1.5H4.286Z"
|
|
4664
4664
|
}));
|
|
4665
4665
|
}
|
|
4666
4666
|
return React__default.createElement("svg", _extends({
|
|
@@ -4673,7 +4673,7 @@ const IconMinus = forwardRef((_ref, ref) => {
|
|
|
4673
4673
|
viewBox: "0 0 24 24"
|
|
4674
4674
|
}), React__default.createElement("path", {
|
|
4675
4675
|
fill: "currentColor",
|
|
4676
|
-
d: "
|
|
4676
|
+
d: "M3.964 11C3.43 11 3 11.446 3 12s.43 1 .964 1h16.072c.534 0 .964-.446.964-1s-.43-1-.964-1H3.964Z"
|
|
4677
4677
|
}));
|
|
4678
4678
|
});
|
|
4679
4679
|
IconMinus.displayName = 'IconMinus';
|
|
@@ -4966,7 +4966,7 @@ const IconPlus = forwardRef((_ref, ref) => {
|
|
|
4966
4966
|
viewBox: "0 0 24 24"
|
|
4967
4967
|
}), React__default.createElement("path", {
|
|
4968
4968
|
fill: "currentColor",
|
|
4969
|
-
d: "
|
|
4969
|
+
d: "M13.43 3.422c0-.79-.638-1.429-1.428-1.429-.79 0-1.43.639-1.43 1.429v7.143H3.43a1.427 1.427 0 1 0 0 2.857h7.143v7.143c0 .79.638 1.428 1.428 1.428.79 0 1.429-.638 1.429-1.428v-7.143h7.143c.79 0 1.428-.639 1.428-1.429s-.638-1.428-1.428-1.428H13.43V3.422Z"
|
|
4970
4970
|
}));
|
|
4971
4971
|
}
|
|
4972
4972
|
return React__default.createElement("svg", _extends({
|
|
@@ -4979,9 +4979,7 @@ const IconPlus = forwardRef((_ref, ref) => {
|
|
|
4979
4979
|
viewBox: "0 0 24 24"
|
|
4980
4980
|
}), React__default.createElement("path", {
|
|
4981
4981
|
fill: "currentColor",
|
|
4982
|
-
|
|
4983
|
-
d: "M23.607 10.875h-10.48V.403a.375.375 0 0 0-.376-.375h-1.5a.375.375 0 0 0-.375.375v10.472H.396a.375.375 0 0 0-.375.375v1.5c0 .207.168.375.375.375h10.48v10.458c0 .207.168.375.375.375h1.5a.375.375 0 0 0 .375-.375V13.125h10.48a.375.375 0 0 0 .376-.375v-1.5a.375.375 0 0 0-.375-.375Z",
|
|
4984
|
-
clipRule: "evenodd"
|
|
4982
|
+
d: "M13.073 3.065c0-.594-.478-1.072-1.072-1.072-.593 0-1.071.478-1.071 1.072v7.857H3.073c-.594 0-1.072.477-1.072 1.071s.478 1.072 1.072 1.072h7.857v7.857c0 .593.478 1.071 1.072 1.071.593 0 1.07-.477 1.07-1.071v-7.857h7.858c.594 0 1.072-.478 1.072-1.072 0-.594-.478-1.071-1.072-1.071h-7.857V3.065Z"
|
|
4985
4983
|
}));
|
|
4986
4984
|
});
|
|
4987
4985
|
IconPlus.displayName = 'IconPlus';
|
|
@@ -5417,10 +5415,10 @@ const IconTimes = forwardRef((_ref, ref) => {
|
|
|
5417
5415
|
}, props, {
|
|
5418
5416
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5419
5417
|
fill: "none",
|
|
5420
|
-
viewBox: "0 0 24
|
|
5418
|
+
viewBox: "0 0 24 24"
|
|
5421
5419
|
}), React__default.createElement("path", {
|
|
5422
5420
|
fill: "currentColor",
|
|
5423
|
-
d: "
|
|
5421
|
+
d: "M5.562 3.444a1.502 1.502 0 0 0-2.123 2.123L9.877 12l-6.433 6.438a1.502 1.502 0 0 0 2.123 2.123L12 14.123l6.438 6.433a1.502 1.502 0 0 0 2.123-2.123L14.123 12l6.433-6.438a1.502 1.502 0 0 0-2.123-2.123L12 9.877 5.562 3.444Z"
|
|
5424
5422
|
}));
|
|
5425
5423
|
}
|
|
5426
5424
|
return React__default.createElement("svg", _extends({
|
|
@@ -5433,9 +5431,7 @@ const IconTimes = forwardRef((_ref, ref) => {
|
|
|
5433
5431
|
viewBox: "0 0 24 24"
|
|
5434
5432
|
}), React__default.createElement("path", {
|
|
5435
5433
|
fill: "currentColor",
|
|
5436
|
-
|
|
5437
|
-
d: "m23.348 21.772-9.761-9.774 9.76-9.81a.375.375 0 0 0 0-.53L22.288.597a.375.375 0 0 0-.53 0l-9.761 9.81L2.23.597a.375.375 0 0 0-.53 0l-1.06 1.06a.375.375 0 0 0 0 .531l9.764 9.81L.64 21.772a.375.375 0 0 0 0 .53l1.061 1.06a.375.375 0 0 0 .53 0l9.765-9.773 9.76 9.774a.375.375 0 0 0 .531 0l1.06-1.061a.375.375 0 0 0 0-.53Z",
|
|
5438
|
-
clipRule: "evenodd"
|
|
5434
|
+
d: "M3.33 4.92a1.125 1.125 0 0 1 1.59-1.59L12 10.41l7.08-7.08a1.125 1.125 0 0 1 1.59 1.59L13.59 12l7.08 7.08a1.125 1.125 0 0 1-1.59 1.59L12 13.59l-7.08 7.08a1.125 1.125 0 0 1-1.59-1.59L10.41 12 3.33 4.92Z"
|
|
5439
5435
|
}));
|
|
5440
5436
|
});
|
|
5441
5437
|
IconTimes.displayName = 'IconTimes';
|
|
@@ -7999,17 +7995,10 @@ const IconSparkle = forwardRef((_ref, ref) => {
|
|
|
7999
7995
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8000
7996
|
fill: "none",
|
|
8001
7997
|
viewBox: "0 0 24 24"
|
|
8002
|
-
}), React__default.createElement("
|
|
8003
|
-
clipPath: "url(#clip0_10467_577)"
|
|
8004
|
-
}, React__default.createElement("path", {
|
|
7998
|
+
}), React__default.createElement("path", {
|
|
8005
7999
|
fill: "currentColor",
|
|
8006
|
-
d: "M15.
|
|
8007
|
-
}))
|
|
8008
|
-
id: "clip0_10467_577"
|
|
8009
|
-
}, React__default.createElement("path", {
|
|
8010
|
-
fill: "#fff",
|
|
8011
|
-
d: "M0 0h24v24H0z"
|
|
8012
|
-
}))));
|
|
8000
|
+
d: "M15.352 6.02a.546.546 0 0 0 0 1.019l2.648 1 .994 2.666c.08.212.281.354.506.354a.542.542 0 0 0 .506-.354L21 8.039l2.648-1a.546.546 0 0 0 0-1.02L21 5.02l-.994-2.665A.542.542 0 0 0 19.5 2a.542.542 0 0 0-.506.354L18 5.02l-2.648 1Zm-5.738-.562a.747.747 0 0 0-1.36 0L5.78 10.837.436 13.323a.754.754 0 0 0-.436.69c0 .296.169.56.436.683l5.348 2.487L8.25 22.56a.747.747 0 0 0 1.36 0l2.47-5.383 5.348-2.487a.752.752 0 0 0 .436-.684.752.752 0 0 0-.436-.684l-5.344-2.481-2.47-5.384Z"
|
|
8001
|
+
}));
|
|
8013
8002
|
}
|
|
8014
8003
|
return React__default.createElement("svg", _extends({
|
|
8015
8004
|
style: getIconStyles(styleProps),
|
|
@@ -8021,7 +8010,7 @@ const IconSparkle = forwardRef((_ref, ref) => {
|
|
|
8021
8010
|
viewBox: "0 0 24 24"
|
|
8022
8011
|
}), React__default.createElement("path", {
|
|
8023
8012
|
fill: "currentColor",
|
|
8024
|
-
d: "M20.25
|
|
8013
|
+
d: "M20.25 2c.413 0 .75.337.75.75V5h2.25c.413 0 .75.338.75.75s-.337.75-.75.75H21v2.25c0 .412-.337.75-.75.75a.752.752 0 0 1-.75-.75V6.5h-2.25a.752.752 0 0 1-.75-.75c0-.412.337-.75.75-.75h2.25V2.75c0-.413.337-.75.75-.75ZM6.413 10.644l-3.872 1.79 3.871 1.786a1.5 1.5 0 0 1 .732.732l1.786 3.871 1.786-3.871a1.5 1.5 0 0 1 .73-.732l3.873-1.786-3.872-1.786a1.5 1.5 0 0 1-.731-.73L8.93 6.044 7.144 9.917a1.5 1.5 0 0 1-.732.731v-.004Zm-.629 4.94-5.348-2.47a.747.747 0 0 1 0-1.36l5.348-2.47L8.25 3.936a.747.747 0 0 1 1.36 0l2.47 5.348 5.348 2.466a.747.747 0 0 1 0 1.36l-5.344 2.474-2.47 5.344a.747.747 0 0 1-1.36 0l-2.47-5.344Z"
|
|
8025
8014
|
}));
|
|
8026
8015
|
});
|
|
8027
8016
|
IconSparkle.displayName = 'IconSparkle';
|
|
@@ -12527,7 +12516,7 @@ const useCheckBoxFieldControllers = ({
|
|
|
12527
12516
|
var styles$12 = {"check-box-field":"_Id4qm","check-box-field__caption":"_s9d-m","check-box-field__custom-input":"_kmvBP"};
|
|
12528
12517
|
|
|
12529
12518
|
const _excluded$bj = ["name", "id", "checked", "onChange", "onBlur", "label", "caption", "error", "disabled", "testId"];
|
|
12530
|
-
/**
|
|
12519
|
+
/** A simple check box with an option beside it. Allows the user to confirm a statement or enable an option with a simple boolean action. Use for things like agreeing to terms, or enabling one or more options in a list (where multiple selections are allowed). */
|
|
12531
12520
|
const CheckboxField = _ref => {
|
|
12532
12521
|
let {
|
|
12533
12522
|
name,
|
|
@@ -15293,7 +15282,7 @@ const useSelectField = _ref => {
|
|
|
15293
15282
|
|
|
15294
15283
|
var styles$B = {"select-field__suffix":"_vqC1M"};
|
|
15295
15284
|
|
|
15296
|
-
/**
|
|
15285
|
+
/** Simple dropdown field where the user chooses one option from a predefined list. */
|
|
15297
15286
|
const SelectField = props => {
|
|
15298
15287
|
const {
|
|
15299
15288
|
fieldProps,
|
|
@@ -15310,7 +15299,7 @@ const SelectField = props => {
|
|
|
15310
15299
|
};
|
|
15311
15300
|
|
|
15312
15301
|
const _excluded$b6 = ["name", "value", "options", "onChange", "onBlur", "placeholder", "defaultValue", "menuShouldScrollIntoView", "disabled", "prefix", "testId", "creatableButton", "onCreate"];
|
|
15313
|
-
/**
|
|
15302
|
+
/** ToolbarSelect is a compact dropdown filter for use in toolbars. It lets a user narrow page content or a paired component content by selecting from a predefined list of options. */
|
|
15314
15303
|
const ToolbarSelect = _ref => {
|
|
15315
15304
|
let {
|
|
15316
15305
|
name,
|
|
@@ -15844,6 +15833,7 @@ const useGrowTextAreaRef = (minHeight, maxHeight, autoGrow, forwardedRef) => {
|
|
|
15844
15833
|
};
|
|
15845
15834
|
};
|
|
15846
15835
|
|
|
15836
|
+
/** A basic open input field used to get text from the user, with options to add a prefix or suffix element if necessary. Accepts any characters, so do not use it if you want to limit the format of the input to numbers only. */
|
|
15847
15837
|
const TextAreaField = ({
|
|
15848
15838
|
name,
|
|
15849
15839
|
id: inputId,
|
|
@@ -15957,6 +15947,7 @@ const TextFieldElement = (_ref, ref) => {
|
|
|
15957
15947
|
suffix: suffix
|
|
15958
15948
|
}, React__default.createElement("input", _extends({}, inputProps))));
|
|
15959
15949
|
};
|
|
15950
|
+
/** A basic open input field used to get text from the user, with options to add a prefix or suffix element if necessary. Accepts any characters, so do not use it if you want to limit the format of the input to numbers only. */
|
|
15960
15951
|
const TextField = forwardRef(TextFieldElement);
|
|
15961
15952
|
|
|
15962
15953
|
var styles$r = {"pill-select-field":"_Yti6k","pill-select-field__creating-input":"_dw-VP","pill-select-field__custom-input":"_JXakU","pill-select-field__add-new-input":"_MsKVV","pill-select-field__creating-custom-input":"_ZxEwG","pill-select-field__removable-icon":"_Odw1V"};
|
|
@@ -16066,7 +16057,7 @@ const CreatableOption = ({
|
|
|
16066
16057
|
}, __('enterOption')), !!newOptionLabel && newOptionLabel)));
|
|
16067
16058
|
};
|
|
16068
16059
|
|
|
16069
|
-
/**
|
|
16060
|
+
/** A field where the user can select one or more from a vertical line of pills. Can also be made fully reactive allowing users to add and delete their own options. Use this to select from a more visual list with a limited number of options, like selecting the day of the week. */
|
|
16070
16061
|
const PillSelectField = ({
|
|
16071
16062
|
name,
|
|
16072
16063
|
id: inputId,
|
|
@@ -16379,7 +16370,7 @@ const BoxOptions = ({
|
|
|
16379
16370
|
}, row)));
|
|
16380
16371
|
};
|
|
16381
16372
|
|
|
16382
|
-
/**
|
|
16373
|
+
/** A list of radio options appearing either as an input or box. Use when the user can only select one option from a visual list and the user needs to be able to see all the options to make an informed decision. */
|
|
16383
16374
|
const RadioGroupField = ({
|
|
16384
16375
|
name,
|
|
16385
16376
|
value,
|
|
@@ -16476,7 +16467,7 @@ const groupCriterias = criterias => {
|
|
|
16476
16467
|
return groupedCriterias;
|
|
16477
16468
|
};
|
|
16478
16469
|
|
|
16479
|
-
/**
|
|
16470
|
+
/** A field used for passwords. It obfuscates the input by default, but has the option to reveal the input. Can also include required password criteria. */
|
|
16480
16471
|
const PasswordField = ({
|
|
16481
16472
|
name,
|
|
16482
16473
|
id: inputId,
|
|
@@ -16547,7 +16538,7 @@ const PasswordField = ({
|
|
|
16547
16538
|
}))));
|
|
16548
16539
|
};
|
|
16549
16540
|
|
|
16550
|
-
/**
|
|
16541
|
+
/** A dropdown style field that lets you select and input more than one option within the field. Uses removable chips to represent selected items. */
|
|
16551
16542
|
const MultiSelectField = ({
|
|
16552
16543
|
name,
|
|
16553
16544
|
id: inputId,
|
|
@@ -16659,7 +16650,7 @@ const CustomList = _ref => {
|
|
|
16659
16650
|
|
|
16660
16651
|
const _excluded$b3 = ["loadOptions"];
|
|
16661
16652
|
/**
|
|
16662
|
-
*
|
|
16653
|
+
* A variation of select field that loads a dynamic list of options from a source rather than a fixed set of options. Use when you need to select from a dynamic list that can change such as roles, employees, locations, etc.
|
|
16663
16654
|
* Instead of passing a `options` props, this component requires a `loadOptions` prop.
|
|
16664
16655
|
* */
|
|
16665
16656
|
const AsyncSelectField = _ref => {
|
|
@@ -16772,7 +16763,7 @@ const useDateFieldControllers = ({
|
|
|
16772
16763
|
|
|
16773
16764
|
var inputStyles = {"text-field":"_t-FNM","date-field":"_7xqY4","text-field--invalid":"_tANT5","date-field--invalid":"_oq75Z","text-field--prefixed":"_rlqRc","date-field--prefixed":"_fXM80","text-field--suffixed":"_uSKjx","date-field--suffixed":"_eEMy6"};
|
|
16774
16765
|
|
|
16775
|
-
/**
|
|
16766
|
+
/** A dropdown style field for selecting a single specific date. It will load a calendar widget when activated allowing the user to find and pick a day. */
|
|
16776
16767
|
const DateField = ({
|
|
16777
16768
|
name,
|
|
16778
16769
|
id: inputId,
|
|
@@ -17161,7 +17152,7 @@ const ToDateElement = ({
|
|
|
17161
17152
|
};
|
|
17162
17153
|
const ToDate = forwardRef(ToDateElement);
|
|
17163
17154
|
|
|
17164
|
-
/**
|
|
17155
|
+
/** A dropdown style field with 2 inputs. It allows the user to select a specific start date and end date separately to create a range of dates. . */
|
|
17165
17156
|
const DateRangeField = ({
|
|
17166
17157
|
name,
|
|
17167
17158
|
id: inputId,
|
|
@@ -17256,7 +17247,7 @@ const DateRangeField = ({
|
|
|
17256
17247
|
})));
|
|
17257
17248
|
};
|
|
17258
17249
|
|
|
17259
|
-
/**
|
|
17250
|
+
/** A special dropdown style field used to select a single week from a calendar widget. Selections must always be 7 consecutive days, but you may customize the day of the week the selectable range starts on. */
|
|
17260
17251
|
const WeekField = ({
|
|
17261
17252
|
name,
|
|
17262
17253
|
id: inputId,
|
|
@@ -17521,9 +17512,9 @@ const TimeFieldElement = (_ref, forwardedRef) => {
|
|
|
17521
17512
|
// exporting TimeField with all props for use in TimeRangeField
|
|
17522
17513
|
const TimeRangeSelector = forwardRef(TimeFieldElement);
|
|
17523
17514
|
/**
|
|
17524
|
-
*
|
|
17515
|
+
* A special field design for selecting a specific time of the day. Users can choose from a dropdown of preset time intervals, or type directly into the field. When the user leaves the field, the input is automatically formatted into either AM/PM time or 24h time.
|
|
17525
17516
|
*
|
|
17526
|
-
*
|
|
17517
|
+
* **You are in charge of validating the value and parsing it back to a value that you can use on your application**.
|
|
17527
17518
|
*/
|
|
17528
17519
|
const TimeField = forwardRef(TimeFieldElement);
|
|
17529
17520
|
|
|
@@ -17590,6 +17581,7 @@ const TimeRangeStart = ({
|
|
|
17590
17581
|
});
|
|
17591
17582
|
};
|
|
17592
17583
|
|
|
17584
|
+
/** A special input field for selecting a time range. Comprised of 2 individual time fields, the user selects a start time and an end time individually to. */
|
|
17593
17585
|
const TimeRangeField = ({
|
|
17594
17586
|
name,
|
|
17595
17587
|
id: inputId,
|
|
@@ -17757,9 +17749,9 @@ const CurrencyFieldElement = (_ref, forwardedRef) => {
|
|
|
17757
17749
|
}, formatThousandsSparator(inputProps.value.toString() || ''))));
|
|
17758
17750
|
};
|
|
17759
17751
|
/**
|
|
17760
|
-
*
|
|
17752
|
+
* A variation of a TextField, but it only accepts numbers, and will auto format the number into a currency format when the user leaves the field. Use anytime the user must enter a currency value and nothing else.
|
|
17761
17753
|
*
|
|
17762
|
-
*
|
|
17754
|
+
* **You are in charge of validating the value and parsing it back to a value that you can use on your application**.
|
|
17763
17755
|
*/
|
|
17764
17756
|
const CurrencyField = forwardRef(CurrencyFieldElement);
|
|
17765
17757
|
|
|
@@ -17843,8 +17835,7 @@ const NumberFieldElement = (_ref, ref) => {
|
|
|
17843
17835
|
}))));
|
|
17844
17836
|
};
|
|
17845
17837
|
/**
|
|
17846
|
-
*
|
|
17847
|
-
* In its default state it only allows whole numbers, but it can be configured to allow decimals and negative values.
|
|
17838
|
+
* A special text input field that only accepts numbers. It has validation and formatting in place to properly display number values. In its default state it only allows whole numbers, but it can be configured to allow decimals and negative values.
|
|
17848
17839
|
*/
|
|
17849
17840
|
const NumberField = forwardRef(NumberFieldElement);
|
|
17850
17841
|
|
|
@@ -17861,8 +17852,7 @@ const PercentageElement = (_ref, ref) => {
|
|
|
17861
17852
|
}));
|
|
17862
17853
|
};
|
|
17863
17854
|
/**
|
|
17864
|
-
*
|
|
17865
|
-
* In its default state it only allows integers between 0 and 100, but it can be configured to allow decimals and negative values.
|
|
17855
|
+
* A special text input field that only accepts numbers. Comes with validation and formatting in place to properly display percentage values. In its default state it only allows integers between 0 and 100, but it can be configured to allow decimals and negative values.
|
|
17866
17856
|
*/
|
|
17867
17857
|
const PercentageField = forwardRef(PercentageElement);
|
|
17868
17858
|
|
|
@@ -63772,7 +63762,7 @@ const SevenShiftsLogo = () => {
|
|
|
63772
63762
|
}));
|
|
63773
63763
|
};
|
|
63774
63764
|
|
|
63775
|
-
var styles$9 = {"primary-nav-header":"_6bVLs","primary-nav-header--collapsed":"_AYwpG","primary-nav-header--with-shadow":"_IpBk1"};
|
|
63765
|
+
var styles$9 = {"primary-nav-header":"_6bVLs","primary-nav-header--collapsed":"_AYwpG","primary-nav-header--with-shadow":"_IpBk1","primary-nav-header__toggle":"_lK6PV"};
|
|
63776
63766
|
|
|
63777
63767
|
const SevenShiftsShortLogo = () => {
|
|
63778
63768
|
return React__default.createElement("svg", {
|
|
@@ -63813,6 +63803,7 @@ function PrimaryNavContextProvider({
|
|
|
63813
63803
|
isExpanded: externalIsExpanded
|
|
63814
63804
|
}) {
|
|
63815
63805
|
const [isHoveringNav, setIsHoveringNav] = useState(false);
|
|
63806
|
+
const [isFocusWithin, setIsFocusWithin] = useState(false);
|
|
63816
63807
|
const [isInternalNavExpanded, setIsInternalNavExpanded] = useLocalStorage('vertical-nav-is-expanded', true);
|
|
63817
63808
|
const isNavExpanded = externalIsExpanded !== undefined ? externalIsExpanded : isInternalNavExpanded;
|
|
63818
63809
|
const contentRef = React__default.useRef(null);
|
|
@@ -63821,9 +63812,11 @@ function PrimaryNavContextProvider({
|
|
|
63821
63812
|
setIsNavExpanded: setIsInternalNavExpanded,
|
|
63822
63813
|
isHoveringNav,
|
|
63823
63814
|
setIsHoveringNav,
|
|
63824
|
-
|
|
63815
|
+
isFocusWithin,
|
|
63816
|
+
setIsFocusWithin,
|
|
63817
|
+
isOpen: isNavExpanded || isHoveringNav || isFocusWithin,
|
|
63825
63818
|
contentRef
|
|
63826
|
-
}), [isNavExpanded, setIsInternalNavExpanded, isHoveringNav, setIsHoveringNav]);
|
|
63819
|
+
}), [isNavExpanded, setIsInternalNavExpanded, isHoveringNav, setIsHoveringNav, isFocusWithin, setIsFocusWithin]);
|
|
63827
63820
|
return React__default.createElement(PrimaryNavContext.Provider, {
|
|
63828
63821
|
value: contextValues
|
|
63829
63822
|
}, children);
|
|
@@ -63870,7 +63863,8 @@ const PrimaryNavHeader = ({
|
|
|
63870
63863
|
setIsNavExpanded,
|
|
63871
63864
|
isNavExpanded,
|
|
63872
63865
|
contentRef,
|
|
63873
|
-
setIsHoveringNav
|
|
63866
|
+
setIsHoveringNav,
|
|
63867
|
+
setIsFocusWithin
|
|
63874
63868
|
} = usePrimaryNavContext();
|
|
63875
63869
|
const {
|
|
63876
63870
|
isScrolled
|
|
@@ -63885,13 +63879,17 @@ const PrimaryNavHeader = ({
|
|
|
63885
63879
|
}, React__default.createElement(Inline, {
|
|
63886
63880
|
justifyContent: "space-between",
|
|
63887
63881
|
alignItems: "center"
|
|
63888
|
-
}, isOpen ? React__default.createElement(ExpandedLogo, null) : React__default.createElement(CollapsedLogo, null), isOpen && React__default.createElement(
|
|
63889
|
-
|
|
63882
|
+
}, isOpen ? React__default.createElement(ExpandedLogo, null) : React__default.createElement(CollapsedLogo, null), isOpen && React__default.createElement("button", {
|
|
63883
|
+
type: "button",
|
|
63884
|
+
className: styles$9['primary-nav-header__toggle'],
|
|
63885
|
+
"aria-label": isNavExpanded ? 'Collapse navigation' : 'Expand navigation',
|
|
63886
|
+
"aria-expanded": isNavExpanded,
|
|
63890
63887
|
onClick: () => {
|
|
63891
63888
|
const nextExpanded = !isNavExpanded;
|
|
63892
63889
|
setIsNavExpanded(nextExpanded);
|
|
63893
63890
|
if (!nextExpanded) {
|
|
63894
63891
|
setIsHoveringNav(false);
|
|
63892
|
+
setIsFocusWithin(false);
|
|
63895
63893
|
}
|
|
63896
63894
|
if (onToggleExpand) {
|
|
63897
63895
|
onToggleExpand(nextExpanded ? 'expanded' : 'collapsed');
|
|
@@ -63908,7 +63906,8 @@ const PrimaryNav = ({
|
|
|
63908
63906
|
onToggleExpand,
|
|
63909
63907
|
footer,
|
|
63910
63908
|
shortLogo,
|
|
63911
|
-
longLogo
|
|
63909
|
+
longLogo,
|
|
63910
|
+
ariaLabel
|
|
63912
63911
|
}) => {
|
|
63913
63912
|
return React__default.createElement(PrimaryNavContextProvider, {
|
|
63914
63913
|
isExpanded: isExpanded
|
|
@@ -63917,7 +63916,8 @@ const PrimaryNav = ({
|
|
|
63917
63916
|
onToggleExpand: onToggleExpand,
|
|
63918
63917
|
footer: footer,
|
|
63919
63918
|
shortLogo: shortLogo,
|
|
63920
|
-
longLogo: longLogo
|
|
63919
|
+
longLogo: longLogo,
|
|
63920
|
+
ariaLabel: ariaLabel
|
|
63921
63921
|
}, children));
|
|
63922
63922
|
};
|
|
63923
63923
|
const PrimaryNavContent = ({
|
|
@@ -63925,35 +63925,57 @@ const PrimaryNavContent = ({
|
|
|
63925
63925
|
onToggleExpand,
|
|
63926
63926
|
footer,
|
|
63927
63927
|
shortLogo,
|
|
63928
|
-
longLogo
|
|
63928
|
+
longLogo,
|
|
63929
|
+
ariaLabel: _ariaLabel = 'Main'
|
|
63929
63930
|
}) => {
|
|
63930
63931
|
const {
|
|
63931
63932
|
setIsHoveringNav,
|
|
63933
|
+
setIsFocusWithin,
|
|
63932
63934
|
isOpen,
|
|
63933
63935
|
contentRef
|
|
63934
63936
|
} = usePrimaryNavContext();
|
|
63935
63937
|
const {
|
|
63936
63938
|
theme
|
|
63937
63939
|
} = useProviderConfig();
|
|
63938
|
-
return React__default.createElement("
|
|
63940
|
+
return React__default.createElement("nav", {
|
|
63941
|
+
"aria-label": _ariaLabel,
|
|
63939
63942
|
className: classnames(styles$8['primary-nav'], {
|
|
63940
63943
|
[styles$8['primary-nav--dark']]: theme === 'dark',
|
|
63941
63944
|
[styles$8['primary-nav--collapsed']]: !isOpen,
|
|
63942
63945
|
[styles$8['primary-nav--expanded']]: isOpen
|
|
63943
63946
|
}),
|
|
63944
63947
|
onMouseEnter: () => setIsHoveringNav(true),
|
|
63945
|
-
onMouseLeave: () => setIsHoveringNav(false)
|
|
63948
|
+
onMouseLeave: () => setIsHoveringNav(false),
|
|
63949
|
+
onFocus: e => {
|
|
63950
|
+
// Only expand on keyboard focus, not on mouse-driven focus
|
|
63951
|
+
// (e.g. clicking an item). :focus-visible reflects the
|
|
63952
|
+
// browser's own heuristic for "focus should be visible".
|
|
63953
|
+
let isKeyboardFocus = false;
|
|
63954
|
+
try {
|
|
63955
|
+
isKeyboardFocus = e.target instanceof Element && e.target.matches(':focus-visible');
|
|
63956
|
+
} catch (_unused) {
|
|
63957
|
+
// :focus-visible not supported in this environment
|
|
63958
|
+
}
|
|
63959
|
+
if (isKeyboardFocus) {
|
|
63960
|
+
setIsFocusWithin(true);
|
|
63961
|
+
}
|
|
63962
|
+
},
|
|
63963
|
+
onBlur: e => {
|
|
63964
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
63965
|
+
setIsFocusWithin(false);
|
|
63966
|
+
}
|
|
63967
|
+
}
|
|
63946
63968
|
}, React__default.createElement(PrimaryNavHeader, {
|
|
63947
63969
|
onToggleExpand: onToggleExpand,
|
|
63948
63970
|
shortLogo: shortLogo,
|
|
63949
63971
|
longLogo: longLogo
|
|
63950
|
-
}), React__default.createElement("
|
|
63972
|
+
}), React__default.createElement("ul", {
|
|
63951
63973
|
ref: contentRef,
|
|
63952
63974
|
className: styles$8['primary-nav__content']
|
|
63953
63975
|
}, children), footer);
|
|
63954
63976
|
};
|
|
63955
63977
|
|
|
63956
|
-
var styles$7 = {"primary-nav-item":"_mWULf","primary-nav-item__content":"_GkDWn","primary-nav-item__icon":"_3LYJx","primary-nav-item__label":"_oz5bt","primary-nav-item__small-badge":"_yCxLl","fade-in":"_aMyIG","primary-nav-item__sub-items":"_SFpch","primary-nav-item--active":"_zfy2L","primary-nav-item--active-subitem":"_els3B","primary-nav-item--has-active-sub-item":"_-RLI8"};
|
|
63978
|
+
var styles$7 = {"primary-nav-item":"_mWULf","primary-nav-item__link":"_PiWFg","primary-nav-item__content":"_GkDWn","primary-nav-item__icon":"_3LYJx","primary-nav-item__label":"_oz5bt","primary-nav-item__label--hidden":"_MFqwx","primary-nav-item__small-badge":"_yCxLl","fade-in":"_aMyIG","primary-nav-item__sub-items":"_SFpch","primary-nav-item--active":"_zfy2L","primary-nav-item--active-subitem":"_els3B","primary-nav-item--has-active-sub-item":"_-RLI8"};
|
|
63957
63979
|
|
|
63958
63980
|
var styles$6 = {"primary-nav-item-badge__small":"_S2i4R","fade-in":"_D9NA6"};
|
|
63959
63981
|
|
|
@@ -63988,7 +64010,7 @@ const PrimaryNavItemBadge = ({
|
|
|
63988
64010
|
return null;
|
|
63989
64011
|
};
|
|
63990
64012
|
|
|
63991
|
-
const _excluded$1 = ["children", "icon", "isActive", "label", "badge", "onClick"];
|
|
64013
|
+
const _excluded$1 = ["children", "icon", "isActive", "label", "badge", "onClick", "href"];
|
|
63992
64014
|
const PrimaryNavItem = _ref => {
|
|
63993
64015
|
let {
|
|
63994
64016
|
children,
|
|
@@ -63996,7 +64018,8 @@ const PrimaryNavItem = _ref => {
|
|
|
63996
64018
|
isActive,
|
|
63997
64019
|
label,
|
|
63998
64020
|
badge,
|
|
63999
|
-
onClick
|
|
64021
|
+
onClick,
|
|
64022
|
+
href
|
|
64000
64023
|
} = _ref,
|
|
64001
64024
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
64002
64025
|
const {
|
|
@@ -64008,7 +64031,7 @@ const PrimaryNavItem = _ref => {
|
|
|
64008
64031
|
const labelRef = useRef(null);
|
|
64009
64032
|
const [isTruncated, setIsTruncated] = useState(false);
|
|
64010
64033
|
const handleLabelMouseEnter = () => {
|
|
64011
|
-
if (labelRef.current) {
|
|
64034
|
+
if (isOpen && labelRef.current) {
|
|
64012
64035
|
setIsTruncated(labelRef.current.scrollWidth > labelRef.current.clientWidth);
|
|
64013
64036
|
}
|
|
64014
64037
|
};
|
|
@@ -64024,42 +64047,56 @@ const PrimaryNavItem = _ref => {
|
|
|
64024
64047
|
}
|
|
64025
64048
|
return sum;
|
|
64026
64049
|
}, 0);
|
|
64027
|
-
|
|
64028
|
-
className: classnames(styles$7['primary-nav-item'], {
|
|
64029
|
-
[styles$7['primary-nav-item--active']]: isActive,
|
|
64030
|
-
[styles$7['primary-nav-item--active-subitem']]: hasActiveSubItem,
|
|
64031
|
-
[styles$7['primary-nav-item--has-active-sub-item']]: hasActiveSubItem
|
|
64032
|
-
})
|
|
64033
|
-
}, React__default.createElement("button", _extends({
|
|
64034
|
-
onClick: onClick
|
|
64035
|
-
}, dataProps), React__default.createElement("div", {
|
|
64050
|
+
const innerContent = React__default.createElement("div", {
|
|
64036
64051
|
className: styles$7['primary-nav-item__content']
|
|
64037
64052
|
}, React__default.createElement("div", {
|
|
64038
|
-
className: styles$7['primary-nav-item__icon']
|
|
64039
|
-
|
|
64053
|
+
className: styles$7['primary-nav-item__icon'],
|
|
64054
|
+
"aria-hidden": "true"
|
|
64055
|
+
}, updatedIcon), React__default.createElement("span", {
|
|
64040
64056
|
ref: labelRef,
|
|
64041
|
-
className: styles$7['primary-nav-item__label'],
|
|
64042
|
-
|
|
64057
|
+
className: classnames(styles$7['primary-nav-item__label'], {
|
|
64058
|
+
[styles$7['primary-nav-item__label--hidden']]: !isOpen
|
|
64059
|
+
}),
|
|
64060
|
+
title: isOpen && isTruncated ? label : undefined,
|
|
64043
64061
|
onMouseEnter: handleLabelMouseEnter
|
|
64044
64062
|
}, label), React__default.createElement(PrimaryNavItemBadge, {
|
|
64045
64063
|
badge: badge,
|
|
64046
64064
|
hasSubItems: hasSubItems,
|
|
64047
64065
|
hasActiveSubItem: hasActiveSubItem,
|
|
64048
64066
|
sumOfSubItemsBadges: sumOfSubItemsBadges
|
|
64049
|
-
}))
|
|
64067
|
+
}));
|
|
64068
|
+
const ariaCurrent = isActive ? 'page' : undefined;
|
|
64069
|
+
return React__default.createElement("li", {
|
|
64070
|
+
className: classnames(styles$7['primary-nav-item'], {
|
|
64071
|
+
[styles$7['primary-nav-item--active']]: isActive,
|
|
64072
|
+
[styles$7['primary-nav-item--active-subitem']]: hasActiveSubItem,
|
|
64073
|
+
[styles$7['primary-nav-item--has-active-sub-item']]: hasActiveSubItem
|
|
64074
|
+
})
|
|
64075
|
+
}, href ? React__default.createElement(Link$1, _extends({
|
|
64076
|
+
className: styles$7['primary-nav-item__link'],
|
|
64077
|
+
onClick: onClick,
|
|
64078
|
+
to: href,
|
|
64079
|
+
"aria-current": ariaCurrent
|
|
64080
|
+
}, dataProps), innerContent) : React__default.createElement("button", _extends({
|
|
64081
|
+
type: "button",
|
|
64082
|
+
className: styles$7['primary-nav-item__link'],
|
|
64083
|
+
onClick: onClick,
|
|
64084
|
+
"aria-current": ariaCurrent
|
|
64085
|
+
}, dataProps), innerContent), hasSubItems && hasActiveSubItem && React__default.createElement("ul", {
|
|
64050
64086
|
className: styles$7['primary-nav-item__sub-items']
|
|
64051
64087
|
}, children));
|
|
64052
64088
|
};
|
|
64053
64089
|
|
|
64054
|
-
var styles$5 = {"primary-nav-sub-item":"_kWT6L","primary-nav-sub-item__content":"_c3utS","primary-nav-sub-item__content--collapsed":"_3IImx","primary-nav-sub-item__content--paywalled":"_WwagZ","primary-nav-sub-item__icon":"_uDuDj","primary-nav-sub-item__label":"_Kg1TF","primary-nav-sub-item__circle":"_uMbkq","fade-in":"_eIHTO","primary-nav-sub-item--active":"_nkaWg"};
|
|
64090
|
+
var styles$5 = {"primary-nav-sub-item":"_kWT6L","primary-nav-sub-item__link":"_KXtsV","primary-nav-sub-item__label--hidden":"_nTZxa","primary-nav-sub-item__content":"_c3utS","primary-nav-sub-item__content--collapsed":"_3IImx","primary-nav-sub-item__content--paywalled":"_WwagZ","primary-nav-sub-item__icon":"_uDuDj","primary-nav-sub-item__label":"_Kg1TF","primary-nav-sub-item__circle":"_uMbkq","fade-in":"_eIHTO","primary-nav-sub-item--active":"_nkaWg"};
|
|
64055
64091
|
|
|
64056
|
-
const _excluded = ["children", "isActive", "badge", "onClick", "isPaywalled"];
|
|
64092
|
+
const _excluded = ["children", "isActive", "badge", "onClick", "href", "isPaywalled"];
|
|
64057
64093
|
const PrimaryNavSubItem = _ref => {
|
|
64058
64094
|
let {
|
|
64059
64095
|
children,
|
|
64060
64096
|
isActive,
|
|
64061
64097
|
badge,
|
|
64062
64098
|
onClick,
|
|
64099
|
+
href,
|
|
64063
64100
|
isPaywalled
|
|
64064
64101
|
} = _ref,
|
|
64065
64102
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
@@ -64072,25 +64109,23 @@ const PrimaryNavSubItem = _ref => {
|
|
|
64072
64109
|
const labelRef = useRef(null);
|
|
64073
64110
|
const [isTruncated, setIsTruncated] = useState(false);
|
|
64074
64111
|
const handleLabelMouseEnter = () => {
|
|
64075
|
-
if (labelRef.current) {
|
|
64112
|
+
if (isOpen && labelRef.current) {
|
|
64076
64113
|
setIsTruncated(labelRef.current.scrollWidth > labelRef.current.clientWidth);
|
|
64077
64114
|
}
|
|
64078
64115
|
};
|
|
64079
|
-
|
|
64080
|
-
onClick: onClick
|
|
64081
|
-
}, dataProps), React__default.createElement("div", {
|
|
64082
|
-
className: classnames(styles$5['primary-nav-sub-item'], {
|
|
64083
|
-
[styles$5['primary-nav-sub-item--active']]: isActive
|
|
64084
|
-
})
|
|
64085
|
-
}, React__default.createElement("div", {
|
|
64116
|
+
const innerContent = React__default.createElement("div", {
|
|
64086
64117
|
className: classnames(styles$5['primary-nav-sub-item__content'], {
|
|
64087
64118
|
[styles$5['primary-nav-sub-item__content--collapsed']]: !isOpen,
|
|
64088
64119
|
[styles$5['primary-nav-sub-item__content--paywalled']]: isPaywalled && isOpen
|
|
64089
64120
|
})
|
|
64090
|
-
}, !isOpen ? React__default.createElement("div", {
|
|
64091
|
-
className: styles$5['primary-nav-sub-item__circle']
|
|
64092
|
-
|
|
64093
|
-
|
|
64121
|
+
}, !isOpen ? React__default.createElement(Fragment, null, React__default.createElement("div", {
|
|
64122
|
+
className: styles$5['primary-nav-sub-item__circle'],
|
|
64123
|
+
"aria-hidden": "true"
|
|
64124
|
+
}), React__default.createElement("span", {
|
|
64125
|
+
className: styles$5['primary-nav-sub-item__label--hidden']
|
|
64126
|
+
}, children)) : React__default.createElement(Fragment, null, isPaywalled && React__default.createElement("div", {
|
|
64127
|
+
className: styles$5['primary-nav-sub-item__icon'],
|
|
64128
|
+
"aria-hidden": "true"
|
|
64094
64129
|
}, React__default.createElement(IconAward, {
|
|
64095
64130
|
size: "medium",
|
|
64096
64131
|
color: COLORS['upsell-color']
|
|
@@ -64101,13 +64136,31 @@ const PrimaryNavSubItem = _ref => {
|
|
|
64101
64136
|
title: isTruncated ? children : undefined
|
|
64102
64137
|
}, children)), !!badge && isOpen && React__default.createElement("div", {
|
|
64103
64138
|
className: styles$5['primary-nav-sub-item__badge']
|
|
64104
|
-
}, typeof badge === 'number' ? React__default.createElement(Badge, null, badge > 99 ? '99+' : badge) : React__default.createElement(Chip, null, badge)))
|
|
64139
|
+
}, typeof badge === 'number' ? React__default.createElement(Badge, null, badge > 99 ? '99+' : badge) : React__default.createElement(Chip, null, badge)));
|
|
64140
|
+
const ariaCurrent = isActive ? 'page' : undefined;
|
|
64141
|
+
return React__default.createElement("li", {
|
|
64142
|
+
className: classnames(styles$5['primary-nav-sub-item'], {
|
|
64143
|
+
[styles$5['primary-nav-sub-item--active']]: isActive
|
|
64144
|
+
})
|
|
64145
|
+
}, href ? React__default.createElement(Link$1, _extends({
|
|
64146
|
+
className: styles$5['primary-nav-sub-item__link'],
|
|
64147
|
+
onClick: onClick,
|
|
64148
|
+
to: href,
|
|
64149
|
+
"aria-current": ariaCurrent
|
|
64150
|
+
}, dataProps), innerContent) : React__default.createElement("button", _extends({
|
|
64151
|
+
type: "button",
|
|
64152
|
+
className: styles$5['primary-nav-sub-item__link'],
|
|
64153
|
+
onClick: onClick,
|
|
64154
|
+
"aria-current": ariaCurrent
|
|
64155
|
+
}, dataProps), innerContent));
|
|
64105
64156
|
};
|
|
64106
64157
|
|
|
64107
64158
|
var styles$4 = {"primary-nav-divider":"_qN8Zl"};
|
|
64108
64159
|
|
|
64109
64160
|
const PrimaryNavDivider = () => {
|
|
64110
|
-
return React__default.createElement("
|
|
64161
|
+
return React__default.createElement("li", {
|
|
64162
|
+
role: "separator",
|
|
64163
|
+
"aria-orientation": "horizontal",
|
|
64111
64164
|
className: styles$4['primary-nav-divider']
|
|
64112
64165
|
});
|
|
64113
64166
|
};
|
|
@@ -64123,7 +64176,7 @@ const PrimaryNavFooter = ({
|
|
|
64123
64176
|
const {
|
|
64124
64177
|
hasScroll
|
|
64125
64178
|
} = useScrollDetector(contentRef);
|
|
64126
|
-
return React__default.createElement("
|
|
64179
|
+
return React__default.createElement("ul", {
|
|
64127
64180
|
className: classnames(styles$3['primary-nav-footer'], {
|
|
64128
64181
|
[styles$3['primary-nav-footer--with-shadow']]: hasScroll
|
|
64129
64182
|
})
|