@sps-woodland/core 8.56.2 → 8.56.3
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/action-bar/action-bar/ActionBar.js +44 -59
- package/lib/action-bar/action-bar/ActionBar.ve.js +4 -11
- package/lib/action-bar/action-bar-additional-content/ActionBarAdditionalContent.js +14 -22
- package/lib/action-bar/index.js +54 -74
- package/lib/action-bar/index.umd.cjs +1 -1
- package/lib/action-bar/style.css +2 -1
- package/lib/add-to-list/add-to-list/AddToList.js +220 -302
- package/lib/add-to-list/add-to-list/AddToList.ve.js +79 -24
- package/lib/add-to-list/add-to-list/ItemsList.js +42 -67
- package/lib/add-to-list/add-to-list/ListItem.js +24 -50
- package/lib/add-to-list/index.js +393 -453
- package/lib/add-to-list/index.umd.cjs +1 -1
- package/lib/add-to-list/style.css +2 -1
- package/lib/buttons/button/Button.js +95 -121
- package/lib/buttons/button/Button.ve.js +150 -9
- package/lib/buttons/index.js +281 -171
- package/lib/buttons/index.umd.cjs +1 -1
- package/lib/buttons/style.css +2 -1
- package/lib/cards/card/Card.js +19 -27
- package/lib/cards/card/Card.ve.js +4 -4
- package/lib/cards/card-footer/CardFooter.js +12 -13
- package/lib/cards/card-footer/CardFooter.ve.js +4 -4
- package/lib/cards/card-header/CardHeader.js +12 -13
- package/lib/cards/card-header/CardHeader.ve.js +4 -4
- package/lib/cards/card-title/CardTitle.js +11 -12
- package/lib/cards/card-title/CardTitle.ve.js +4 -4
- package/lib/cards/index.js +52 -52
- package/lib/cards/index.umd.cjs +1 -1
- package/lib/cards/style.css +2 -1
- package/lib/column-manager/column-manager/ColumnManager.js +95 -112
- package/lib/column-manager/column-manager/useColumnManager.js +59 -48
- package/lib/column-manager/index.js +2 -5
- package/lib/components/icon/Icon.ve.js +15 -5
- package/lib/components/icon/icons/sprite.svg.js +4 -4
- package/lib/content-row/content-row/ContentRow.js +146 -173
- package/lib/content-row/content-row/ContentRow.ve.js +105 -18
- package/lib/content-row/content-row-col/ContentRowCol.js +37 -48
- package/lib/content-row/content-row-col/ContentRowCol.ve.js +49 -6
- package/lib/content-row/content-row-expansion/ContentRowExpansion.js +16 -24
- package/lib/content-row/index.js +407 -318
- package/lib/content-row/index.umd.cjs +1 -1
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.js +24 -39
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +13 -5
- package/lib/content-row/style.css +2 -1
- package/lib/content-tiles/content-tile/ContentTile.js +71 -60
- package/lib/content-tiles/content-tile/ContentTile.ve.js +36 -14
- package/lib/content-tiles/content-tile-list/ContentTileList.js +12 -13
- package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +4 -5
- package/lib/content-tiles/index.js +156 -118
- package/lib/content-tiles/index.umd.cjs +1 -1
- package/lib/content-tiles/style.css +2 -1
- package/lib/core.css +2 -1
- package/lib/dropdowns/dropdown/Dropdown.js +56 -68
- package/lib/dropdowns/dropdown/Dropdown.ve.js +37 -8
- package/lib/dropdowns/index.js +171 -171
- package/lib/dropdowns/index.umd.cjs +1 -1
- package/lib/dropdowns/option-list/Option.js +14 -18
- package/lib/dropdowns/option-list/Option.ve.js +4 -5
- package/lib/dropdowns/option-list/OptionList.js +28 -44
- package/lib/dropdowns/option-list/OptionList.ve.js +4 -5
- package/lib/dropdowns/style.css +2 -1
- package/lib/editable-table/EditableTable.js +68 -85
- package/lib/editable-table/index.js +1 -4
- package/lib/feedback-block/FeedbackBlock.js +40 -35
- package/lib/feedback-block/FeedbackBlock.ve.js +56 -7
- package/lib/feedback-block/index.js +132 -85
- package/lib/feedback-block/index.umd.cjs +1 -1
- package/lib/feedback-block/style.css +2 -1
- package/lib/file-upload/file-upload/FileUpload.js +164 -202
- package/lib/file-upload/file-upload/FileUpload.ve.js +84 -18
- package/lib/file-upload/file-upload/mime-type.enum.js +106 -106
- package/lib/file-upload/index.js +390 -353
- package/lib/file-upload/index.umd.cjs +1 -1
- package/lib/file-upload/style.css +2 -1
- package/lib/filter-tiles/filter-tile/FilterTile.js +41 -46
- package/lib/filter-tiles/filter-tile/FilterTile.ve.js +51 -9
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.js +12 -15
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +4 -4
- package/lib/filter-tiles/index.js +142 -107
- package/lib/filter-tiles/index.umd.cjs +1 -1
- package/lib/filter-tiles/style.css +2 -1
- package/lib/focused-task/focused-task/FocusedTask.js +52 -74
- package/lib/focused-task/focused-task/FocusedTask.ve.js +13 -12
- package/lib/focused-task/focused-task/useFocusedTask.js +20 -18
- package/lib/focused-task/focused-task-actions/FocusedTaskActions.js +12 -13
- package/lib/focused-task/index.js +127 -144
- package/lib/focused-task/index.umd.cjs +1 -1
- package/lib/focused-task/style.css +2 -1
- package/lib/growler/Growler.js +78 -90
- package/lib/growler/Growler.ve.js +23 -12
- package/lib/growler/GrowlerListProvider.js +38 -39
- package/lib/growler/Sonner.ve.js +17 -12
- package/lib/growler/index.js +249 -274
- package/lib/growler/index.umd.cjs +1 -1
- package/lib/growler/sonner.js +73 -102
- package/lib/growler/style.css +2 -1
- package/lib/index.js +520 -501
- package/lib/index.umd.cjs +4 -4
- package/lib/insight-card/InsightCard.js +90 -84
- package/lib/insight-card/InsightCard.ve.js +148 -15
- package/lib/insight-card/InsightCardSet.js +12 -12
- package/lib/insight-card/index.js +269 -141
- package/lib/insight-card/index.umd.cjs +1 -1
- package/lib/insight-card/style.css +2 -1
- package/lib/key-value-set/index.js +97 -87
- package/lib/key-value-set/index.umd.cjs +1 -1
- package/lib/key-value-set/key-value-set/KeyValueSet.js +17 -21
- package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +10 -5
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.js +25 -21
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +13 -6
- package/lib/key-value-set/style.css +2 -1
- package/lib/list-bar/advanced-search/AdvancedSearch.js +51 -54
- package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +30 -8
- package/lib/list-bar/index.js +305 -301
- package/lib/list-bar/index.umd.cjs +1 -1
- package/lib/list-bar/list-bar/InputGroupWrapper.js +10 -19
- package/lib/list-bar/list-bar/ListBar.js +105 -121
- package/lib/list-bar/list-bar/ListBar.ve.js +13 -17
- package/lib/list-bar/list-bar/ListBarSearch.js +20 -21
- package/lib/list-bar/list-bar/ListBarSearchInfo.js +8 -12
- package/lib/list-bar/list-bar/ListBarSortBy.js +28 -38
- package/lib/list-bar/search-results-bar/SearchResultsBar.js +38 -28
- package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +4 -11
- package/lib/list-bar/style.css +2 -1
- package/lib/matrix/index.js +79 -87
- package/lib/matrix/index.umd.cjs +1 -1
- package/lib/matrix/matrix/Matrix.js +18 -26
- package/lib/matrix/matrix/Matrix.ve.js +4 -7
- package/lib/matrix/matrix-body/MatrixBody.js +10 -13
- package/lib/matrix/matrix-cell/MatrixCell.js +23 -18
- package/lib/matrix/matrix-head/MatrixHead.js +10 -13
- package/lib/matrix/matrix-header/MatrixHeader.js +20 -23
- package/lib/matrix/matrix-row/MatrixRow.js +10 -13
- package/lib/matrix/style.css +2 -1
- package/lib/modal/index.js +197 -187
- package/lib/modal/index.umd.cjs +1 -1
- package/lib/modal/modal/Modal.js +90 -108
- package/lib/modal/modal/Modal.ve.js +43 -13
- package/lib/modal/modal/useModal.js +19 -24
- package/lib/modal/modal-footer/ModalFooter.js +11 -12
- package/lib/modal/style.css +2 -1
- package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +49 -0
- package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/index.browser.js +8 -10
- package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/url-alphabet/index.js +4 -4
- package/lib/page-title/heading-level/HeadingLevel.js +8 -12
- package/lib/page-title/index.js +33 -40
- package/lib/page-title/index.umd.cjs +1 -1
- package/lib/page-title/page-subtitle/PageSubtitle.js +13 -18
- package/lib/page-title/page-subtitle/PageSubtitle.ve.js +4 -5
- package/lib/page-title/page-title/PageTitle.js +15 -19
- package/lib/page-title/page-title/PageTitle.ve.js +4 -7
- package/lib/page-title/style.css +2 -1
- package/lib/photo/index.js +174 -177
- package/lib/photo/index.umd.cjs +1 -1
- package/lib/photo/photo/Photo.js +72 -81
- package/lib/photo/photo/Photo.ve.js +21 -7
- package/lib/photo/photo-carousel/PhotoCarousel.js +36 -51
- package/lib/photo/photo-carousel/PhotoCarousel.ve.js +13 -9
- package/lib/photo/style.css +2 -1
- package/lib/product-bar/hooks/usePriorityPlus.js +88 -104
- package/lib/product-bar/index.js +372 -395
- package/lib/product-bar/index.umd.cjs +1 -1
- package/lib/product-bar/product-bar/ProductBar.js +77 -103
- package/lib/product-bar/product-bar/ProductBar.ve.js +46 -15
- package/lib/product-bar/product-bar-name/ProductBarName.js +37 -40
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.js +48 -70
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +4 -8
- package/lib/product-bar/product-bar-tab/ProductBarTab.js +28 -26
- package/lib/product-bar/slack-link/SlackLink.js +26 -30
- package/lib/product-bar/slack-link/SlackLink.ve.js +4 -5
- package/lib/product-bar/style.css +2 -1
- package/lib/product-bar-vertical/index.js +240 -251
- package/lib/product-bar-vertical/index.umd.cjs +1 -1
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.js +42 -61
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +53 -23
- package/lib/product-bar-vertical/product-bar-vertical-header/ProductBarVerticalHeader.js +30 -42
- package/lib/product-bar-vertical/product-bar-vertical-item/ProductBarVerticalItem.js +71 -89
- package/lib/product-bar-vertical/product-bar-vertical-section/ProductBarVerticalSection.js +22 -29
- package/lib/product-bar-vertical/style.css +2 -1
- package/lib/progress-indicators/index.js +372 -255
- package/lib/progress-indicators/index.umd.cjs +1 -1
- package/lib/progress-indicators/progress-bar/ProgressBar.js +66 -110
- package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +66 -13
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.js +34 -54
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +136 -8
- package/lib/progress-indicators/progress-ring/ProgressRing.js +45 -52
- package/lib/progress-indicators/style.css +2 -1
- package/lib/rich-text-editor/index.js +556 -582
- package/lib/rich-text-editor/index.umd.cjs +11 -11
- package/lib/rich-text-editor/rich-text-editor/RTELinkModal.js +29 -33
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.js +23 -37
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +13 -6
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.js +68 -77
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +21 -8
- package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.js +14 -20
- package/lib/rich-text-editor/rich-text-editor/hooks/useMdToHtml.js +14 -20
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEContent.js +33 -27
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEObserver.js +79 -88
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTESelectionListener.js +28 -36
- package/lib/rich-text-editor/rich-text-editor/hooks/useRTEToolbarButtons.js +195 -211
- package/lib/rich-text-editor/rich-text-editor/icons/BOLD.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/INDENT.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/ITALICS.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/LINK.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/ORDERED_LIST.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/OUTDENT.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/REDO.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNDO.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNLINK.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/icons/UNORDERED_LIST.svg.js +4 -4
- package/lib/rich-text-editor/rich-text-editor/utils/flattenListItemParagraphs.js +12 -12
- package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.js +20 -19
- package/lib/rich-text-editor/rich-text-editor/utils/utils.js +11 -15
- package/lib/rich-text-editor/style.css +2 -1
- package/lib/scrollable-container/ScrollableContainer.js +18 -27
- package/lib/scrollable-container/ScrollableContainer.ve.js +4 -4
- package/lib/scrollable-container/index.js +20 -27
- package/lib/scrollable-container/index.umd.cjs +1 -1
- package/lib/scrollable-container/style.css +2 -1
- package/lib/side-nav/index.js +190 -228
- package/lib/side-nav/index.umd.cjs +1 -1
- package/lib/side-nav/side-nav/SideNav.js +43 -60
- package/lib/side-nav/side-nav/SideNav.ve.js +22 -16
- package/lib/side-nav/side-nav/navContext.js +7 -7
- package/lib/side-nav/side-nav-header/SideNavHeader.js +14 -15
- package/lib/side-nav/side-nav-item/SideNavItem.js +68 -94
- package/lib/side-nav/side-nav-section/SideNavSection.js +16 -26
- package/lib/side-nav/style.css +2 -1
- package/lib/sorting-header/caret/caret.ve.js +13 -5
- package/lib/sorting-header/index.js +269 -251
- package/lib/sorting-header/index.umd.cjs +1 -1
- package/lib/sorting-header/sorting-header/SortingHeader.js +110 -124
- package/lib/sorting-header/sorting-header/SortingHeader.ve.js +30 -6
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.js +69 -83
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +21 -7
- package/lib/sorting-header/style.css +2 -1
- package/lib/style.css +2 -1
- package/lib/tabs/index.js +255 -201
- package/lib/tabs/index.umd.cjs +1 -1
- package/lib/tabs/style.css +2 -1
- package/lib/tabs/tab/Tab.js +24 -27
- package/lib/tabs/tab/Tab.ve.js +76 -6
- package/lib/tabs/tab-panel/TabPanel.js +16 -25
- package/lib/tabs/tabs/Tabs.js +101 -112
- package/lib/tabs/tabs/Tabs.ve.js +13 -11
- package/lib/tags/clickable-tag/ClickableTag.js +86 -90
- package/lib/tags/clickable-tag/ClickableTag.ve.js +66 -9
- package/lib/tags/index.js +342 -199
- package/lib/tags/index.umd.cjs +1 -1
- package/lib/tags/split-tag/SplitTag.js +49 -30
- package/lib/tags/split-tag/SplitTag.ve.js +35 -9
- package/lib/tags/style.css +2 -1
- package/lib/tags/tag/Tag.js +42 -38
- package/lib/tags/tag/Tag.ve.js +41 -6
- package/lib/utils/cl.js +5 -5
- package/lib/zero-state/ZeroState.js +36 -29
- package/lib/zero-state/ZeroState.ve.js +29 -11
- package/lib/zero-state/index.js +103 -78
- package/lib/zero-state/index.umd.cjs +1 -1
- package/lib/zero-state/style.css +2 -1
- package/package.json +12 -12
- package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +0 -57
package/lib/modal/index.js
CHANGED
|
@@ -1,197 +1,207 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Button as
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import { useRef as
|
|
6
|
-
import { useWoodlandLanguage as
|
|
7
|
-
import { useOverlayTriggerState as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { Icon as e, Metadata as t, cl as n, combineEventHandlers as r, contentOf as i, modChildren as a, selectChildren as o, useChildTestIdAttrBuilder as s } from "@sps-woodland/core";
|
|
2
|
+
import { Button as c } from "@sps-woodland/core/button";
|
|
3
|
+
import { Overlay as l, useDialog as u, useModalOverlay as d, useOverlayTrigger as f } from "react-aria";
|
|
4
|
+
import * as p from "react";
|
|
5
|
+
import { useRef as m } from "react";
|
|
6
|
+
import { useWoodlandLanguage as h } from "@spscommerce/i18n";
|
|
7
|
+
import { useOverlayTriggerState as g } from "react-stately";
|
|
8
|
+
//#region ../../../node_modules/.pnpm/@vanilla-extract+recipes@0.2.5_@vanilla-extract+css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
|
|
9
|
+
function _(e, t, n) {
|
|
10
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
11
|
+
value: n,
|
|
12
|
+
enumerable: !0,
|
|
13
|
+
configurable: !0,
|
|
14
|
+
writable: !0
|
|
15
|
+
}) : e[t] = n, e;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
function v(e, t) {
|
|
18
|
+
var n = Object.keys(e);
|
|
19
|
+
if (Object.getOwnPropertySymbols) {
|
|
20
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
21
|
+
t && (r = r.filter(function(t) {
|
|
22
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
23
|
+
})), n.push.apply(n, r);
|
|
24
|
+
}
|
|
25
|
+
return n;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
function y(e) {
|
|
28
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
29
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
30
|
+
t % 2 ? v(Object(n), !0).forEach(function(t) {
|
|
31
|
+
_(e, t, n[t]);
|
|
32
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : v(Object(n)).forEach(function(t) {
|
|
33
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return e;
|
|
36
37
|
}
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
var b = (e, t, n) => {
|
|
39
|
+
for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
|
|
40
|
+
return !0;
|
|
41
|
+
}, x = (e) => (t) => {
|
|
42
|
+
var n = e.defaultClassName, r = y(y({}, e.defaultVariants), t);
|
|
43
|
+
for (var i in r) {
|
|
44
|
+
var a = r[i] ?? e.defaultVariants[i];
|
|
45
|
+
if (a != null) {
|
|
46
|
+
var o = a;
|
|
47
|
+
typeof o == "boolean" && (o = o === !0 ? "true" : "false");
|
|
48
|
+
var s = e.variantClassNames[i][o];
|
|
49
|
+
s && (n += " " + s);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (var [c, l] of e.compoundVariants) b(c, r, e.defaultVariants) && (n += " " + l);
|
|
53
|
+
return n;
|
|
54
|
+
}, S = x({
|
|
55
|
+
defaultClassName: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem0",
|
|
56
|
+
variantClassNames: {
|
|
57
|
+
kind: {
|
|
58
|
+
informational: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem1",
|
|
59
|
+
delete: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem2",
|
|
60
|
+
failure: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem3",
|
|
61
|
+
success: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem4",
|
|
62
|
+
warning: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem5",
|
|
63
|
+
successWithFailures: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem6",
|
|
64
|
+
form: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem7"
|
|
65
|
+
},
|
|
66
|
+
size: {
|
|
67
|
+
sm: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem8",
|
|
68
|
+
md: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem9",
|
|
69
|
+
lg: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksema",
|
|
70
|
+
xl: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemb"
|
|
71
|
+
},
|
|
72
|
+
fullHeight: {
|
|
73
|
+
true: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemc",
|
|
74
|
+
false: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemd"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
defaultVariants: {},
|
|
78
|
+
compoundVariants: []
|
|
79
|
+
}), C = x({
|
|
80
|
+
defaultClassName: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41kseme",
|
|
81
|
+
variantClassNames: { kind: {
|
|
82
|
+
form: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemf",
|
|
83
|
+
delete: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemg",
|
|
84
|
+
failure: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemh",
|
|
85
|
+
informational: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemi",
|
|
86
|
+
success: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemj",
|
|
87
|
+
warning: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemk",
|
|
88
|
+
successWithFailures: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41kseml"
|
|
89
|
+
} },
|
|
90
|
+
defaultVariants: {},
|
|
91
|
+
compoundVariants: []
|
|
92
|
+
}), w = "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemm", T = "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemo", E = "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemp", D = "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemq", O = "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemr", k = "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksems";
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/modal/modal-footer/ModalFooter.tsx
|
|
95
|
+
function A({ children: e, className: t = "", ...r }) {
|
|
96
|
+
return /* @__PURE__ */ p.createElement("div", {
|
|
97
|
+
className: n(E, t),
|
|
98
|
+
...r
|
|
99
|
+
}, e);
|
|
68
100
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
icon: "x",
|
|
81
|
-
className: ne
|
|
82
|
-
}
|
|
83
|
-
) : null;
|
|
101
|
+
t.set(A, { name: "ModalFooter" });
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/modal/modal/Modal.tsx
|
|
104
|
+
function j({ dismissableValue: e, handleClose: t }) {
|
|
105
|
+
return e ? /* @__PURE__ */ p.createElement(c, {
|
|
106
|
+
"aria-label": "Close",
|
|
107
|
+
onClick: t,
|
|
108
|
+
kind: "icon",
|
|
109
|
+
icon: "x",
|
|
110
|
+
className: D
|
|
111
|
+
}) : null;
|
|
84
112
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
113
|
+
var M = Object.freeze({
|
|
114
|
+
form: "pencil",
|
|
115
|
+
delete: "trash",
|
|
116
|
+
failure: "status-error",
|
|
117
|
+
informational: "info-circle",
|
|
118
|
+
success: "status-ok",
|
|
119
|
+
successWithFailures: "status-warning",
|
|
120
|
+
warning: "status-warning"
|
|
93
121
|
});
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */ s.createElement(
|
|
133
|
-
"div",
|
|
134
|
-
{
|
|
135
|
-
...f,
|
|
136
|
-
...h,
|
|
137
|
-
...i,
|
|
138
|
-
onFocus: x,
|
|
139
|
-
onBlur: z,
|
|
140
|
-
...H("dialog"),
|
|
141
|
-
ref: p,
|
|
142
|
-
className: y(ae({ kind: o, size: t, fullHeight: I }), _)
|
|
143
|
-
},
|
|
144
|
-
/* @__PURE__ */ s.createElement("div", { ...S, className: oe({ kind: o }) }, o && /* @__PURE__ */ s.createElement(
|
|
145
|
-
G,
|
|
146
|
-
{
|
|
147
|
-
icon: F[o] || F.informational,
|
|
148
|
-
className: re
|
|
149
|
-
}
|
|
150
|
-
), /* @__PURE__ */ s.createElement("div", { className: se }, k(m, l.close)), /* @__PURE__ */ s.createElement(C, { dismissableValue: g, handleClose: w })),
|
|
151
|
-
/* @__PURE__ */ s.createElement("div", { className: le }, k(T, l.close)),
|
|
152
|
-
v && v.length > 0 ? /* @__PURE__ */ s.createElement(s.Fragment, null, k(v, l.close)) : /* @__PURE__ */ s.createElement("div", { className: M }, /* @__PURE__ */ s.createElement(N, { kind: "key", onClick: w }, W("modal.defaultButtonLabel", { defaultValue: "Okay" })))
|
|
153
|
-
)
|
|
154
|
-
));
|
|
122
|
+
function N({ children: t, className: f, "data-testid": m, kind: g = "informational", onBlur: _, onFocus: v, overlayProps: y, size: b = "sm", state: x, title: D, dismissible: N, dismissable: P = !0, onClose: F, fullHeight: I = !1, ...L }) {
|
|
123
|
+
let R = N ?? P, z = p.useRef(null), { modalProps: B, underlayProps: V } = d({
|
|
124
|
+
isKeyboardDismissDisabled: !R,
|
|
125
|
+
...L
|
|
126
|
+
}, x, z), { dialogProps: H, titleProps: U } = u(L, z), W = r(B.onFocus, H.onFocus, v), G = r(B.onBlur, H.onBlur, _), { t: K } = h(), q = s({ "data-testid": m }), [J, Y] = o(t, [{ type: A }]), X = p.useCallback(() => {
|
|
127
|
+
F && typeof F == "function" && F(), x.close();
|
|
128
|
+
}, [F, x.close]), Z = a(Y, (e) => e.type === j ? [{ className: n(e.props.classname, O) }] : []);
|
|
129
|
+
return /* @__PURE__ */ p.createElement(l, null, /* @__PURE__ */ p.createElement("div", {
|
|
130
|
+
className: k,
|
|
131
|
+
"data-react-aria-top-layer": "true",
|
|
132
|
+
...V,
|
|
133
|
+
...L
|
|
134
|
+
}, /* @__PURE__ */ p.createElement("div", {
|
|
135
|
+
...B,
|
|
136
|
+
...H,
|
|
137
|
+
...y,
|
|
138
|
+
onFocus: W,
|
|
139
|
+
onBlur: G,
|
|
140
|
+
...q("dialog"),
|
|
141
|
+
ref: z,
|
|
142
|
+
className: n(S({
|
|
143
|
+
kind: g,
|
|
144
|
+
size: b,
|
|
145
|
+
fullHeight: I
|
|
146
|
+
}), f)
|
|
147
|
+
}, /* @__PURE__ */ p.createElement("div", {
|
|
148
|
+
...U,
|
|
149
|
+
className: C({ kind: g })
|
|
150
|
+
}, g && /* @__PURE__ */ p.createElement(e, {
|
|
151
|
+
icon: M[g] || M.informational,
|
|
152
|
+
className: "pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemn"
|
|
153
|
+
}), /* @__PURE__ */ p.createElement("div", { className: w }, i(D, x.close)), /* @__PURE__ */ p.createElement(j, {
|
|
154
|
+
dismissableValue: R,
|
|
155
|
+
handleClose: X
|
|
156
|
+
})), /* @__PURE__ */ p.createElement("div", { className: T }, i(Z, x.close)), J && J.length > 0 ? /* @__PURE__ */ p.createElement(p.Fragment, null, i(J, x.close)) : /* @__PURE__ */ p.createElement("div", { className: E }, /* @__PURE__ */ p.createElement(c, {
|
|
157
|
+
kind: "key",
|
|
158
|
+
onClick: X
|
|
159
|
+
}, K("modal.defaultButtonLabel", { defaultValue: "Okay" }))))));
|
|
155
160
|
}
|
|
156
|
-
function
|
|
157
|
-
|
|
161
|
+
function P(e) {
|
|
162
|
+
return e.state.isOpen ? /* @__PURE__ */ p.createElement(N, e, e.children) : /* @__PURE__ */ p.createElement(p.Fragment, null);
|
|
158
163
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
164
|
+
t.set(P, {
|
|
165
|
+
name: "Modal",
|
|
166
|
+
props: {
|
|
167
|
+
dismissable: {
|
|
168
|
+
type: "boolean",
|
|
169
|
+
default: "true"
|
|
170
|
+
},
|
|
171
|
+
fullHeight: {
|
|
172
|
+
type: "boolean",
|
|
173
|
+
default: "false"
|
|
174
|
+
},
|
|
175
|
+
kind: {
|
|
176
|
+
type: "ModalKind",
|
|
177
|
+
default: "informational"
|
|
178
|
+
},
|
|
179
|
+
onBlur: { type: "() => void" },
|
|
180
|
+
onClose: { type: "() => void" },
|
|
181
|
+
onFocus: { type: "() => void" },
|
|
182
|
+
size: {
|
|
183
|
+
type: "ModalSize",
|
|
184
|
+
default: "sm"
|
|
185
|
+
},
|
|
186
|
+
title: { type: "string" }
|
|
187
|
+
}
|
|
171
188
|
});
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
modalState: _,
|
|
189
|
-
modalProps: { overlayProps: r, state: _ }
|
|
190
|
-
};
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/modal/modal/useModal.ts
|
|
191
|
+
function F(e = {}) {
|
|
192
|
+
let t = g(e), n = m(null), { triggerProps: r, overlayProps: i } = f({ type: "dialog" }, t, n), { onPress: a, ...o } = r;
|
|
193
|
+
return {
|
|
194
|
+
triggerProps: {
|
|
195
|
+
...o,
|
|
196
|
+
onClick: a ? (e) => a(e) : void 0,
|
|
197
|
+
ref: n
|
|
198
|
+
},
|
|
199
|
+
modalState: t,
|
|
200
|
+
modalProps: {
|
|
201
|
+
overlayProps: i,
|
|
202
|
+
state: t
|
|
203
|
+
}
|
|
204
|
+
};
|
|
191
205
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
V as ModalFooter,
|
|
195
|
-
F as ModalIcons,
|
|
196
|
-
ke as useModal
|
|
197
|
-
};
|
|
206
|
+
//#endregion
|
|
207
|
+
export { P as Modal, A as ModalFooter, M as ModalIcons, F as useModal };
|
package/lib/modal/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@sps-woodland/core"),require("@sps-woodland/core/button"),require("react-aria"),require("react"),require("@spscommerce/i18n"),require("react-stately")):typeof define==`function`&&define.amd?define([`exports`,`@sps-woodland/core`,`@sps-woodland/core/button`,`react-aria`,`react`,`@spscommerce/i18n`,`react-stately`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Modal={},e.spsWoodlandCore,e.spsWoodlandCoreButton,e.reactAria,e.react,e.spscommerceI18n,e.reactStately))})(this,function(e,t,n,r,i,a,o){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var s=Object.create,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyNames,d=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,p=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=u(t),a=0,o=i.length,s;a<o;a++)s=i[a],!f.call(e,s)&&s!==n&&c(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=l(t,s))||r.enumerable});return e};i=((e,t,n)=>(n=e==null?{}:s(d(e)),p(t||!e||!e.__esModule||!f.call(e,`default`)?c(n,`default`,{value:e,enumerable:!0}):n,e)))(i,1);function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?h(Object(n),!0).forEach(function(t){m(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},v=e=>t=>{var n=e.defaultClassName,r=g(g({},e.defaultVariants),t);for(var i in r){var a=r[i]??e.defaultVariants[i];if(a!=null){var o=a;typeof o==`boolean`&&(o=o===!0?`true`:`false`);var s=e.variantClassNames[i][o];s&&(n+=` `+s)}}for(var[c,l]of e.compoundVariants)_(c,r,e.defaultVariants)&&(n+=` `+l);return n},y=v({defaultClassName:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem0`,variantClassNames:{kind:{informational:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem1`,delete:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem2`,failure:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem3`,success:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem4`,warning:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem5`,successWithFailures:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem6`,form:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem7`},size:{sm:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem8`,md:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksem9`,lg:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksema`,xl:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemb`},fullHeight:{true:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemc`,false:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemd`}},defaultVariants:{},compoundVariants:[]}),b=v({defaultClassName:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41kseme`,variantClassNames:{kind:{form:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemf`,delete:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemg`,failure:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemh`,informational:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemi`,success:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemj`,warning:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemk`,successWithFailures:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41kseml`}},defaultVariants:{},compoundVariants:[]}),x=`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemm`,S=`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemo`,C=`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemp`,w=`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemq`,T=`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemr`,E=`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksems`;function D({children:e,className:n=``,...r}){return i.createElement(`div`,{className:(0,t.cl)(C,n),...r},e)}t.Metadata.set(D,{name:`ModalFooter`});function O({dismissableValue:e,handleClose:t}){return e?i.createElement(n.Button,{"aria-label":`Close`,onClick:t,kind:`icon`,icon:`x`,className:w}):null}var k=Object.freeze({form:`pencil`,delete:`trash`,failure:`status-error`,informational:`info-circle`,success:`status-ok`,successWithFailures:`status-warning`,warning:`status-warning`});function A({children:e,className:o,"data-testid":s,kind:c=`informational`,onBlur:l,onFocus:u,overlayProps:d,size:f=`sm`,state:p,title:m,dismissible:h,dismissable:g=!0,onClose:_,fullHeight:v=!1,...w}){let A=h??g,j=i.useRef(null),{modalProps:M,underlayProps:N}=(0,r.useModalOverlay)({isKeyboardDismissDisabled:!A,...w},p,j),{dialogProps:P,titleProps:F}=(0,r.useDialog)(w,j),I=(0,t.combineEventHandlers)(M.onFocus,P.onFocus,u),L=(0,t.combineEventHandlers)(M.onBlur,P.onBlur,l),{t:R}=(0,a.useWoodlandLanguage)(),z=(0,t.useChildTestIdAttrBuilder)({"data-testid":s}),[B,V]=(0,t.selectChildren)(e,[{type:D}]),H=i.useCallback(()=>{_&&typeof _==`function`&&_(),p.close()},[_,p.close]),U=(0,t.modChildren)(V,e=>e.type===O?[{className:(0,t.cl)(e.props.classname,T)}]:[]);return i.createElement(r.Overlay,null,i.createElement(`div`,{className:E,"data-react-aria-top-layer":`true`,...N,...w},i.createElement(`div`,{...M,...P,...d,onFocus:I,onBlur:L,...z(`dialog`),ref:j,className:(0,t.cl)(y({kind:c,size:f,fullHeight:v}),o)},i.createElement(`div`,{...F,className:b({kind:c})},c&&i.createElement(t.Icon,{icon:k[c]||k.informational,className:`pkg_sps-woodland_core__family_modal__version_8_56_3__hash_41ksemn`}),i.createElement(`div`,{className:x},(0,t.contentOf)(m,p.close)),i.createElement(O,{dismissableValue:A,handleClose:H})),i.createElement(`div`,{className:S},(0,t.contentOf)(U,p.close)),B&&B.length>0?i.createElement(i.Fragment,null,(0,t.contentOf)(B,p.close)):i.createElement(`div`,{className:C},i.createElement(n.Button,{kind:`key`,onClick:H},R(`modal.defaultButtonLabel`,{defaultValue:`Okay`}))))))}function j(e){return e.state.isOpen?i.createElement(A,e,e.children):i.createElement(i.Fragment,null)}t.Metadata.set(j,{name:`Modal`,props:{dismissable:{type:`boolean`,default:`true`},fullHeight:{type:`boolean`,default:`false`},kind:{type:`ModalKind`,default:`informational`},onBlur:{type:`() => void`},onClose:{type:`() => void`},onFocus:{type:`() => void`},size:{type:`ModalSize`,default:`sm`},title:{type:`string`}}});function M(e={}){let t=(0,o.useOverlayTriggerState)(e),n=(0,i.useRef)(null),{triggerProps:a,overlayProps:s}=(0,r.useOverlayTrigger)({type:`dialog`},t,n),{onPress:c,...l}=a;return{triggerProps:{...l,onClick:c?e=>c(e):void 0,ref:n},modalState:t,modalProps:{overlayProps:s,state:t}}}e.Modal=j,e.ModalFooter=D,e.ModalIcons=k,e.useModal=M});
|