@spscommerce/ds-react 6.29.2 → 6.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs.js +62 -21
- package/lib/index.es.js +110 -11
- package/lib/modal/index.d.ts +1 -0
- package/lib/modal/useModals.d.ts +15 -0
- package/package.json +10 -10
package/lib/index.es.js
CHANGED
|
@@ -15445,6 +15445,7 @@ function SpsContentRow(props2) {
|
|
|
15445
15445
|
cardSpacing = false,
|
|
15446
15446
|
selectable = false,
|
|
15447
15447
|
selected,
|
|
15448
|
+
"data-testid": testId,
|
|
15448
15449
|
unsafelyReplaceClassName
|
|
15449
15450
|
} = _a, rest = __objRest(_a, [
|
|
15450
15451
|
"alternateLayout",
|
|
@@ -15460,6 +15461,7 @@ function SpsContentRow(props2) {
|
|
|
15460
15461
|
"cardSpacing",
|
|
15461
15462
|
"selectable",
|
|
15462
15463
|
"selected",
|
|
15464
|
+
"data-testid",
|
|
15463
15465
|
"unsafelyReplaceClassName"
|
|
15464
15466
|
]);
|
|
15465
15467
|
const { t: t2 } = React.useContext(I18nContext);
|
|
@@ -15497,9 +15499,11 @@ function SpsContentRow(props2) {
|
|
|
15497
15499
|
{ type: SpsContentRowExpansion }
|
|
15498
15500
|
]);
|
|
15499
15501
|
return /* @__PURE__ */ React.createElement("div", __spreadValues({
|
|
15500
|
-
className: classes
|
|
15502
|
+
className: classes,
|
|
15503
|
+
"data-testid": testId
|
|
15501
15504
|
}, rest), /* @__PURE__ */ React.createElement("div", {
|
|
15502
|
-
className: "sps-content-row__col-group"
|
|
15505
|
+
className: "sps-content-row__col-group",
|
|
15506
|
+
"data-testid": `${testId}__children`
|
|
15503
15507
|
}, selectable && !alternateLayout && /* @__PURE__ */ React.createElement(SpsContentRowCol, {
|
|
15504
15508
|
widthPx: 46
|
|
15505
15509
|
}, ContentRowCheckBox()), expansion && !alternateLayout && /* @__PURE__ */ React.createElement(SpsContentRowCol, {
|
|
@@ -15551,7 +15555,7 @@ const SpsContentRowExamples = {
|
|
|
15551
15555
|
<SpsContentRow
|
|
15552
15556
|
selectable
|
|
15553
15557
|
selected={formValue.selected}
|
|
15554
|
-
|
|
15558
|
+
onSelectionChange={selectRow}
|
|
15555
15559
|
>
|
|
15556
15560
|
<SpsContentRowCol>
|
|
15557
15561
|
<SpsI icon={SpsIcon.STATUS_IN_PROCESS} size={SpsIconSize.LARGE} className="mr-2" />
|
|
@@ -15581,7 +15585,7 @@ const SpsContentRowExamples = {
|
|
|
15581
15585
|
<SpsContentRow
|
|
15582
15586
|
selectable
|
|
15583
15587
|
selected={formValue.selected}
|
|
15584
|
-
|
|
15588
|
+
onSelectionChange={selectRow}
|
|
15585
15589
|
>
|
|
15586
15590
|
<SpsContentRowCol style={{ width: "2.9rem" }}>
|
|
15587
15591
|
<SpsI
|
|
@@ -15654,7 +15658,7 @@ const SpsContentRowExamples = {
|
|
|
15654
15658
|
<SpsContentRow
|
|
15655
15659
|
selectable
|
|
15656
15660
|
selected={formValue.selected}
|
|
15657
|
-
|
|
15661
|
+
onSelectionChange={selectRow}
|
|
15658
15662
|
>
|
|
15659
15663
|
<SpsContentRowCol>
|
|
15660
15664
|
<SpsI icon={SpsIcon.STATUS_IN_PROCESS} size={SpsIconSize.LARGE} className="mr-2" />
|
|
@@ -15697,7 +15701,7 @@ const SpsContentRowExamples = {
|
|
|
15697
15701
|
<SpsContentRow
|
|
15698
15702
|
selectable
|
|
15699
15703
|
selected={formValue.selected}
|
|
15700
|
-
|
|
15704
|
+
onSelectionChange={selectRow}
|
|
15701
15705
|
alternateLayout
|
|
15702
15706
|
>
|
|
15703
15707
|
<SpsContentRowCol>
|
|
@@ -15761,7 +15765,7 @@ const SpsContentRowExamples = {
|
|
|
15761
15765
|
<SpsContentRow
|
|
15762
15766
|
selectable
|
|
15763
15767
|
selected={formValue.selected}
|
|
15764
|
-
|
|
15768
|
+
onSelectionChange={selectRow}
|
|
15765
15769
|
>
|
|
15766
15770
|
<SpsContentRowCol style={{ width: "2.9rem" }}>
|
|
15767
15771
|
<SpsI
|
|
@@ -15810,7 +15814,7 @@ const SpsContentRowExamples = {
|
|
|
15810
15814
|
<SpsContentRow
|
|
15811
15815
|
selectable
|
|
15812
15816
|
selected={formValue.selected}
|
|
15813
|
-
|
|
15817
|
+
onSelectionChange={selectRow}
|
|
15814
15818
|
alternateLayout
|
|
15815
15819
|
>
|
|
15816
15820
|
<SpsContentRowCol style={{ width: "2.9rem" }}>
|
|
@@ -15912,7 +15916,7 @@ const SpsContentRowExamples = {
|
|
|
15912
15916
|
key={item.id}
|
|
15913
15917
|
selectable
|
|
15914
15918
|
selected={formValue.selected === item.id}
|
|
15915
|
-
|
|
15919
|
+
onSelectionChange={() => selectRow(item.id)}
|
|
15916
15920
|
>
|
|
15917
15921
|
<SpsContentRowCol>
|
|
15918
15922
|
{item.status === 'processing' && <SpsI icon={SpsIcon.STATUS_IN_PROCESS} size={SpsIconSize.LARGE} className="mr-2" />}
|
|
@@ -29893,6 +29897,56 @@ const SpsModalExamples = {
|
|
|
29893
29897
|
`
|
|
29894
29898
|
}
|
|
29895
29899
|
}
|
|
29900
|
+
},
|
|
29901
|
+
hook: {
|
|
29902
|
+
label: "Hooks",
|
|
29903
|
+
description: () => /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("p", null, "This hook allows to manage modals like a stack, so you can call pushModal/popModal from any place to show/hide modal."), /* @__PURE__ */ React.createElement("p", null, "It also helps with chain of modals, when you need to show several modals one by one and use results from them"), "If you use the useModals hook, you should ideally invoke it and place", " ", /* @__PURE__ */ React.createElement("code", null, "modals"), " at the top level of your app, and pass down", " ", /* @__PURE__ */ React.createElement("code", null, "pushModal"), " and ", /* @__PURE__ */ React.createElement("code", null, "popModal"), "."),
|
|
29904
|
+
examples: {
|
|
29905
|
+
hook: {
|
|
29906
|
+
react: code`
|
|
29907
|
+
function SpsModalsHook() {
|
|
29908
|
+
const [modals, pushModal, popModal] = useModals();
|
|
29909
|
+
|
|
29910
|
+
async function openModalAction() {
|
|
29911
|
+
const modalResult = await pushModal(<ModalComponent />);
|
|
29912
|
+
console.log(modalResult);
|
|
29913
|
+
}
|
|
29914
|
+
|
|
29915
|
+
function cancelAction() {
|
|
29916
|
+
popModal({
|
|
29917
|
+
action: ModalAction.Cancel
|
|
29918
|
+
});
|
|
29919
|
+
}
|
|
29920
|
+
|
|
29921
|
+
function primaryAction() {
|
|
29922
|
+
popModal({
|
|
29923
|
+
action: ModalAction.Ok,
|
|
29924
|
+
data: 'any data'
|
|
29925
|
+
});
|
|
29926
|
+
}
|
|
29927
|
+
|
|
29928
|
+
const ModalComponent = () => (
|
|
29929
|
+
<SpsModal size={ModalSize.MEDIUM}>
|
|
29930
|
+
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
|
|
29931
|
+
<SpsModalFooter>
|
|
29932
|
+
<SpsButton onClick={cancelAction}>Cancel Action</SpsButton>
|
|
29933
|
+
<SpsButton kind={ButtonKind.KEY} onClick={primaryAction}>
|
|
29934
|
+
Primary Action
|
|
29935
|
+
</SpsButton>
|
|
29936
|
+
</SpsModalFooter>
|
|
29937
|
+
</SpsModal>
|
|
29938
|
+
);
|
|
29939
|
+
|
|
29940
|
+
return (
|
|
29941
|
+
<>
|
|
29942
|
+
<SpsButton onClick={openModalAction}>Open a modal</SpsButton>
|
|
29943
|
+
{modals}
|
|
29944
|
+
</>
|
|
29945
|
+
);
|
|
29946
|
+
}
|
|
29947
|
+
`
|
|
29948
|
+
}
|
|
29949
|
+
}
|
|
29896
29950
|
}
|
|
29897
29951
|
};
|
|
29898
29952
|
const propsDoc$I = {
|
|
@@ -36094,7 +36148,8 @@ function SpsTileList(props2) {
|
|
|
36094
36148
|
]);
|
|
36095
36149
|
const classes = clsx(unsafelyReplaceClassName || "sps-tile-list", className || "sfg-row");
|
|
36096
36150
|
return /* @__PURE__ */ React.createElement("div", __spreadValues({
|
|
36097
|
-
className: classes
|
|
36151
|
+
className: classes,
|
|
36152
|
+
"data-testid": testId
|
|
36098
36153
|
}, rest), children);
|
|
36099
36154
|
}
|
|
36100
36155
|
Object.assign(SpsTileList, {
|
|
@@ -39230,6 +39285,50 @@ const SpsKeyValueTagExamples = {
|
|
|
39230
39285
|
}
|
|
39231
39286
|
}
|
|
39232
39287
|
};
|
|
39288
|
+
var ModalAction;
|
|
39289
|
+
(function(ModalAction2) {
|
|
39290
|
+
ModalAction2["Ok"] = "Ok";
|
|
39291
|
+
ModalAction2["Cancel"] = "Cancel";
|
|
39292
|
+
})(ModalAction || (ModalAction = {}));
|
|
39293
|
+
const useModals = () => {
|
|
39294
|
+
const [modals, setModals] = useState([]);
|
|
39295
|
+
const pushModal = (component) => {
|
|
39296
|
+
const modalsClone = [...modals];
|
|
39297
|
+
const componentClone = __spreadValues({}, component);
|
|
39298
|
+
componentClone.key = nanoid();
|
|
39299
|
+
const promise = new Promise((resolve) => {
|
|
39300
|
+
modalsClone.push({
|
|
39301
|
+
component: componentClone,
|
|
39302
|
+
resolve
|
|
39303
|
+
});
|
|
39304
|
+
setModals(modalsClone);
|
|
39305
|
+
});
|
|
39306
|
+
return promise;
|
|
39307
|
+
};
|
|
39308
|
+
const popModal = (result) => {
|
|
39309
|
+
const modalsClone = [...modals];
|
|
39310
|
+
const modal = modalsClone.pop();
|
|
39311
|
+
modal == null ? void 0 : modal.resolve(result);
|
|
39312
|
+
setModals(modalsClone);
|
|
39313
|
+
};
|
|
39314
|
+
const [schedulePopEnabled, setSchedulePopEnabled] = useState(false);
|
|
39315
|
+
const [schedulePopResult, setSchedulePopResult] = useState(null);
|
|
39316
|
+
useEffect(() => {
|
|
39317
|
+
if (schedulePopEnabled) {
|
|
39318
|
+
popModal(schedulePopResult);
|
|
39319
|
+
setSchedulePopEnabled(false);
|
|
39320
|
+
}
|
|
39321
|
+
}, [schedulePopEnabled]);
|
|
39322
|
+
const scheduledPopModal = (result) => {
|
|
39323
|
+
setSchedulePopEnabled(true);
|
|
39324
|
+
setSchedulePopResult(result);
|
|
39325
|
+
};
|
|
39326
|
+
return [
|
|
39327
|
+
modals.map((m2) => m2.component),
|
|
39328
|
+
pushModal,
|
|
39329
|
+
scheduledPopModal
|
|
39330
|
+
];
|
|
39331
|
+
};
|
|
39233
39332
|
function useSpsAction(descriptor, fn) {
|
|
39234
39333
|
const metadata = __spreadValues(__spreadValues({}, SPS_ACTION_DEFAULTS), descriptor);
|
|
39235
39334
|
const [state, patchState] = usePatchReducer(metadata);
|
|
@@ -39325,4 +39424,4 @@ Object.assign(SpsVr, {
|
|
|
39325
39424
|
propTypes,
|
|
39326
39425
|
displayName: "SpsDescriptionListTerm / SpsDt"
|
|
39327
39426
|
});
|
|
39328
|
-
export { AsTypingErrorKeys, ContentOrderExample, DEFAULT_PRESETS, DragDropContext, PublicDraggable as Draggable, ConnectedDroppable as Droppable, FauxChangeEvent, I18nContext, MANIFEST, OnBlurErrorKeys, OnSubmitErrorKeys, PortalContext, PreventativeErrorKeys, Provide, SimpleDateUtils, SpsAddRemoveFormRowExamples, SpsAdvancedSearch, SpsAdvancedSearchExamples, SpsApp, SpsAutocomplete, SpsAutocompleteExamples, SpsButton, SpsButtonExamples, SpsButtonGroup, SpsCard, SpsCardExamples, SpsCardTabbedPane, SpsCardV2, SpsCardV2Footer, SpsCardV2Header, SpsCardV2Title, SpsCheckbox, SpsCheckboxDropdown, SpsCheckboxExamples, SpsClickableTag, SpsClickableTagExamples, SpsColumnChooser, SpsColumnChooserColumn, SpsColumnChooserExamples, SpsConditionalField, SpsConditionalFieldExamples, SpsContentRow, SpsContentRowCol, SpsContentRowExamples, SpsContentRowExpansion, SpsContextBar, SpsCurrencyInput, SpsCurrencyInputExamples, SpsDateRangePicker, SpsDateRangePickerExamples, SpsDateTime, SpsDatepicker, SpsDatepickerExamples, SpsDatetimeExamples, SpsDd, SpsDescriptionList, SpsDescriptionListDefinition, SpsDescriptionListExamples, SpsDescriptionListTerm, SpsDl, SpsDropdown, SpsDropdownExamples, SpsDt, SpsFeedbackBlock, SpsFeedbackBlockExamples, SpsFieldset, SpsFieldsetExamples, SpsFilterPanel, SpsFilterPanelCap, SpsFilterPanelExamples, SpsFilterPanelFilterBox, SpsFilterPanelSection, SpsFilterTile, SpsFilterTileList, SpsFilterTileListExamples, SpsFocusedTask, SpsFocusedTaskActions, SpsFocusedTaskExamples, SpsForm, SpsFormArrayMeta, SpsFormComponentWrapper, SpsFormExamples, SpsFormFieldMeta, SpsFormGroupMeta, SpsFormMetaBase, SpsFormSetMeta, SpsGrowler, SpsGrowlerExamples, SpsI, SpsIconButtonPanel, SpsIncrementor, SpsIncrementorExamples, SpsInputGroup, SpsInsightTile, SpsInsights, SpsKeyValueList, SpsKeyValueListExamples, SpsKeyValueListItem, SpsKeyValueTag, SpsKeyValueTagExamples, SpsLabel, SpsLabelExamples, SpsListActionBar, SpsListActionBarExamples, SpsListToolbar, SpsListToolbarExamples, SpsListToolbarSearch, SpsListToolbarSearchInfo, SpsListToolbarSortBy, SpsMicroBlock, SpsMicroBlockExamples, SpsMicroZeroState, SpsModal, SpsModalExamples, SpsModalFooter, SpsMultiSelect, SpsMultiSelectExamples, SpsMultiValueTextInput, SpsMultiValueTextInputExamples, SpsPageSelector, SpsPageSubtitle, SpsPageTitle, SpsPageTitleExamples, SpsPagination, SpsPaginationExamples, SpsProductBar, SpsProductBarExamples, SpsProductBarTab, SpsProgressBar, SpsProgressBarExamples, SpsProgressRing, SpsRadioButton, SpsRadioButtonExamples, SpsScrollableContainer, SpsScrollableContainerExamples, SpsSearchResultsBar, SpsSearchResultsBarExamples, SpsSearchResultsBarV2, SpsSelect, SpsSelectExamples, SpsSideNav, SpsSideNavExamples, SpsSlackLink, SpsSlackLinkExamples, SpsSlideInPanel, SpsSlideInPanelExamples, SpsSortingHeader, SpsSortingHeaderCell, SpsSortingHeaderExamples, SpsSpinner, SpsSpinnerExamples, SpsSplitButton, SpsSplitButtonExamples, SpsSteppedProgressBar, SpsSteppedProgressBarExamples, SpsSummaryListColumn, SpsSummaryListExamples, SpsSummaryListExpansion, SpsSummaryListRow, SpsTab, SpsTabPanel, SpsTable, SpsTableBody, SpsTableCell, SpsTableExamples, SpsTableHead, SpsTableHeader, SpsTableRow, SpsTabsV2, SpsTag, SpsTagExamples, SpsTaskQueue, SpsTaskQueueExamples, SpsTbody, SpsTd, SpsTextInput, SpsTextInputExamples, SpsTextarea, SpsTextareaExamples, SpsTh, SpsThead, SpsTile, SpsTileList, SpsTileListExamples, SpsToggle, SpsToggleExamples, SpsTooltip, SpsTooltipExamples, SpsTooltipTitle, SpsTr, SpsValidators, SpsVerticalRule, SpsVr, SpsWf, SpsWfDoc, SpsWfDs, SpsWfStep, SpsWizardExamples, SpsWizardSidebar, SpsWizardSubstep, SpsWorkflow, SpsWorkflowDocument, SpsWorkflowDocumentStatus, SpsWorkflowExamples, SpsWorkflowStep, SpsZeroState, SpsZeroStateExamples, TooltipVisibility, ValidationMode, addOnChangeErrorKey, addOnSubmitErrorKey, bindProps, contentOf, date, dateConstraint, dateRange, findParentBranches, flipPosition, formArray, formControl, formGroup, getMember, getPosition, resetServerContext, selectChildren, toggleTooltipState, useCheckDeprecatedProps, useColumnResizer, useCustomValidator, useDidUpdateEffect, useDocumentEventListener, useElementId, useForm, useGrowlers, useInputPopup, useKeyboardSensor, useMouseSensor, usePatchReducer, usePortal, useServerSideValidation, useSpsAction, useSpsForm, useTouchSensor, validate };
|
|
39427
|
+
export { AsTypingErrorKeys, ContentOrderExample, DEFAULT_PRESETS, DragDropContext, PublicDraggable as Draggable, ConnectedDroppable as Droppable, FauxChangeEvent, I18nContext, MANIFEST, ModalAction, OnBlurErrorKeys, OnSubmitErrorKeys, PortalContext, PreventativeErrorKeys, Provide, SimpleDateUtils, SpsAddRemoveFormRowExamples, SpsAdvancedSearch, SpsAdvancedSearchExamples, SpsApp, SpsAutocomplete, SpsAutocompleteExamples, SpsButton, SpsButtonExamples, SpsButtonGroup, SpsCard, SpsCardExamples, SpsCardTabbedPane, SpsCardV2, SpsCardV2Footer, SpsCardV2Header, SpsCardV2Title, SpsCheckbox, SpsCheckboxDropdown, SpsCheckboxExamples, SpsClickableTag, SpsClickableTagExamples, SpsColumnChooser, SpsColumnChooserColumn, SpsColumnChooserExamples, SpsConditionalField, SpsConditionalFieldExamples, SpsContentRow, SpsContentRowCol, SpsContentRowExamples, SpsContentRowExpansion, SpsContextBar, SpsCurrencyInput, SpsCurrencyInputExamples, SpsDateRangePicker, SpsDateRangePickerExamples, SpsDateTime, SpsDatepicker, SpsDatepickerExamples, SpsDatetimeExamples, SpsDd, SpsDescriptionList, SpsDescriptionListDefinition, SpsDescriptionListExamples, SpsDescriptionListTerm, SpsDl, SpsDropdown, SpsDropdownExamples, SpsDt, SpsFeedbackBlock, SpsFeedbackBlockExamples, SpsFieldset, SpsFieldsetExamples, SpsFilterPanel, SpsFilterPanelCap, SpsFilterPanelExamples, SpsFilterPanelFilterBox, SpsFilterPanelSection, SpsFilterTile, SpsFilterTileList, SpsFilterTileListExamples, SpsFocusedTask, SpsFocusedTaskActions, SpsFocusedTaskExamples, SpsForm, SpsFormArrayMeta, SpsFormComponentWrapper, SpsFormExamples, SpsFormFieldMeta, SpsFormGroupMeta, SpsFormMetaBase, SpsFormSetMeta, SpsGrowler, SpsGrowlerExamples, SpsI, SpsIconButtonPanel, SpsIncrementor, SpsIncrementorExamples, SpsInputGroup, SpsInsightTile, SpsInsights, SpsKeyValueList, SpsKeyValueListExamples, SpsKeyValueListItem, SpsKeyValueTag, SpsKeyValueTagExamples, SpsLabel, SpsLabelExamples, SpsListActionBar, SpsListActionBarExamples, SpsListToolbar, SpsListToolbarExamples, SpsListToolbarSearch, SpsListToolbarSearchInfo, SpsListToolbarSortBy, SpsMicroBlock, SpsMicroBlockExamples, SpsMicroZeroState, SpsModal, SpsModalExamples, SpsModalFooter, SpsMultiSelect, SpsMultiSelectExamples, SpsMultiValueTextInput, SpsMultiValueTextInputExamples, SpsPageSelector, SpsPageSubtitle, SpsPageTitle, SpsPageTitleExamples, SpsPagination, SpsPaginationExamples, SpsProductBar, SpsProductBarExamples, SpsProductBarTab, SpsProgressBar, SpsProgressBarExamples, SpsProgressRing, SpsRadioButton, SpsRadioButtonExamples, SpsScrollableContainer, SpsScrollableContainerExamples, SpsSearchResultsBar, SpsSearchResultsBarExamples, SpsSearchResultsBarV2, SpsSelect, SpsSelectExamples, SpsSideNav, SpsSideNavExamples, SpsSlackLink, SpsSlackLinkExamples, SpsSlideInPanel, SpsSlideInPanelExamples, SpsSortingHeader, SpsSortingHeaderCell, SpsSortingHeaderExamples, SpsSpinner, SpsSpinnerExamples, SpsSplitButton, SpsSplitButtonExamples, SpsSteppedProgressBar, SpsSteppedProgressBarExamples, SpsSummaryListColumn, SpsSummaryListExamples, SpsSummaryListExpansion, SpsSummaryListRow, SpsTab, SpsTabPanel, SpsTable, SpsTableBody, SpsTableCell, SpsTableExamples, SpsTableHead, SpsTableHeader, SpsTableRow, SpsTabsV2, SpsTag, SpsTagExamples, SpsTaskQueue, SpsTaskQueueExamples, SpsTbody, SpsTd, SpsTextInput, SpsTextInputExamples, SpsTextarea, SpsTextareaExamples, SpsTh, SpsThead, SpsTile, SpsTileList, SpsTileListExamples, SpsToggle, SpsToggleExamples, SpsTooltip, SpsTooltipExamples, SpsTooltipTitle, SpsTr, SpsValidators, SpsVerticalRule, SpsVr, SpsWf, SpsWfDoc, SpsWfDs, SpsWfStep, SpsWizardExamples, SpsWizardSidebar, SpsWizardSubstep, SpsWorkflow, SpsWorkflowDocument, SpsWorkflowDocumentStatus, SpsWorkflowExamples, SpsWorkflowStep, SpsZeroState, SpsZeroStateExamples, TooltipVisibility, ValidationMode, addOnChangeErrorKey, addOnSubmitErrorKey, bindProps, contentOf, date, dateConstraint, dateRange, findParentBranches, flipPosition, formArray, formControl, formGroup, getMember, getPosition, resetServerContext, selectChildren, toggleTooltipState, useCheckDeprecatedProps, useColumnResizer, useCustomValidator, useDidUpdateEffect, useDocumentEventListener, useElementId, useForm, useGrowlers, useInputPopup, useKeyboardSensor, useModals, useMouseSensor, usePatchReducer, usePortal, useServerSideValidation, useSpsAction, useSpsForm, useTouchSensor, validate };
|
package/lib/modal/index.d.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare type UseModalsType = [
|
|
2
|
+
modals: JSX.Element[],
|
|
3
|
+
pushModal: <T>(component: JSX.Element) => Promise<ModalResult<T>>,
|
|
4
|
+
popModal: <T>(result?: ModalResult<T>) => void
|
|
5
|
+
];
|
|
6
|
+
export declare enum ModalAction {
|
|
7
|
+
Ok = "Ok",
|
|
8
|
+
Cancel = "Cancel"
|
|
9
|
+
}
|
|
10
|
+
export interface ModalResult<T> {
|
|
11
|
+
action: ModalAction;
|
|
12
|
+
data?: T;
|
|
13
|
+
}
|
|
14
|
+
export declare const useModals: () => UseModalsType;
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spscommerce/ds-react",
|
|
3
3
|
"description": "SPS Design System React components",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.30.1",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/spscommerce/design-system/tree/main/packages/@spscommerce/ds-react",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@react-stately/collections": "^3.3.3",
|
|
31
|
-
"@spscommerce/ds-colors": "6.
|
|
32
|
-
"@spscommerce/ds-illustrations": "6.
|
|
33
|
-
"@spscommerce/ds-shared": "6.
|
|
34
|
-
"@spscommerce/positioning": "6.
|
|
31
|
+
"@spscommerce/ds-colors": "6.30.1",
|
|
32
|
+
"@spscommerce/ds-illustrations": "6.30.1",
|
|
33
|
+
"@spscommerce/ds-shared": "6.30.1",
|
|
34
|
+
"@spscommerce/positioning": "6.30.1",
|
|
35
35
|
"@spscommerce/utils": "^6.11.3",
|
|
36
36
|
"moment": "^2.25.3",
|
|
37
37
|
"moment-timezone": "^0.5.28",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@react-stately/collections": "^3.3.3",
|
|
43
|
-
"@spscommerce/ds-colors": "6.
|
|
44
|
-
"@spscommerce/ds-illustrations": "6.
|
|
45
|
-
"@spscommerce/ds-shared": "6.
|
|
46
|
-
"@spscommerce/positioning": "6.
|
|
43
|
+
"@spscommerce/ds-colors": "6.30.1",
|
|
44
|
+
"@spscommerce/ds-illustrations": "6.30.1",
|
|
45
|
+
"@spscommerce/ds-shared": "6.30.1",
|
|
46
|
+
"@spscommerce/positioning": "6.30.1",
|
|
47
47
|
"@spscommerce/utils": "^6.11.3",
|
|
48
|
-
"@testing-library/react": "^
|
|
48
|
+
"@testing-library/react": "^10.4.0",
|
|
49
49
|
"@types/prop-types": "^15.7.1",
|
|
50
50
|
"@types/react": "^16.9.0",
|
|
51
51
|
"@types/react-beautiful-dnd": "^13.1.2",
|