@salesforce/design-system-react 11.0.0-alpha.2 → 11.0.0-alpha.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/dist/cjs/components/combobox/combobox.cjs +1 -1
- package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
- package/dist/cjs/components/data-table/highlight-cell.cjs +1 -1
- package/dist/cjs/components/data-table/index.cjs +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
- package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/cjs/components/date-picker/index.cjs +1 -1
- package/dist/cjs/components/date-picker/index.cjs.map +1 -1
- package/dist/cjs/components/illustration/check-props.cjs +2 -0
- package/dist/cjs/components/illustration/check-props.cjs.map +1 -0
- package/dist/cjs/components/illustration/index.cjs +1 -1
- package/dist/cjs/components/illustration/index.cjs.map +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/modal/trigger.cjs +1 -1
- package/dist/cjs/components/pill/index.cjs +1 -1
- package/dist/cjs/components/pill/index.cjs.map +1 -1
- package/dist/cjs/components/pill-container/index.cjs +1 -1
- package/dist/cjs/components/pill-container/index.cjs.map +1 -1
- package/dist/cjs/components/pill-container/private/selected-listbox.cjs +1 -1
- package/dist/cjs/components/pill-container/private/selected-listbox.cjs.map +1 -1
- package/dist/cjs/components/tree/private/item.cjs +1 -1
- package/dist/cjs/components/tree/private/render-branch.cjs +1 -1
- package/dist/cjs/components/utilities/dialog/index.cjs +1 -1
- package/dist/cjs/components/utilities/dialog/index.cjs.map +1 -1
- package/dist/cjs/utilities/constants.cjs +1 -1
- package/dist/cjs/utilities/constants.cjs.map +1 -1
- package/dist/es/components/combobox/combobox.js +131 -117
- package/dist/es/components/combobox/combobox.js.map +1 -1
- package/dist/es/components/data-table/highlight-cell.js +4 -4
- package/dist/es/components/data-table/index.js +9 -9
- package/dist/es/components/date-picker/date-picker.js +150 -145
- package/dist/es/components/date-picker/date-picker.js.map +1 -1
- package/dist/es/components/date-picker/index.js +6 -18
- package/dist/es/components/date-picker/index.js.map +1 -1
- package/dist/es/components/illustration/check-props.js +11 -0
- package/dist/es/components/illustration/check-props.js.map +1 -0
- package/dist/es/components/illustration/index.js +37 -25
- package/dist/es/components/illustration/index.js.map +1 -1
- package/dist/es/components/index.js +89 -115
- package/dist/es/components/modal/trigger.js +4 -4
- package/dist/es/components/pill/index.js +32 -30
- package/dist/es/components/pill/index.js.map +1 -1
- package/dist/es/components/pill-container/index.js +1 -0
- package/dist/es/components/pill-container/index.js.map +1 -1
- package/dist/es/components/pill-container/private/selected-listbox.js +3 -1
- package/dist/es/components/pill-container/private/selected-listbox.js.map +1 -1
- package/dist/es/components/tree/private/item.js +4 -4
- package/dist/es/components/tree/private/render-branch.js +9 -9
- package/dist/es/components/utilities/dialog/index.js +2 -2
- package/dist/es/components/utilities/dialog/index.js.map +1 -1
- package/dist/es/utilities/constants.js +2 -2
- package/dist/es/utilities/constants.js.map +1 -1
- package/dist/types/components/combobox/combobox.d.ts.map +1 -1
- package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/components/date-picker/index.d.ts +6 -2
- package/dist/types/components/date-picker/index.d.ts.map +1 -1
- package/dist/types/components/illustration/index.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +0 -52
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/pill/index.d.ts +4 -0
- package/dist/types/components/pill/index.d.ts.map +1 -1
- package/dist/types/components/pill-container/index.d.ts.map +1 -1
- package/dist/types/components/pill-container/private/selected-listbox.d.ts +7 -1
- package/dist/types/components/pill-container/private/selected-listbox.d.ts.map +1 -1
- package/package.json +4 -1
- package/dist/cjs/components/app-launcher/check-props.cjs +0 -2
- package/dist/cjs/components/app-launcher/check-props.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/component.cjs +0 -2
- package/dist/cjs/components/app-launcher/component.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/expandable-section.cjs +0 -2
- package/dist/cjs/components/app-launcher/expandable-section.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/index.cjs +0 -2
- package/dist/cjs/components/app-launcher/index.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/link.cjs +0 -2
- package/dist/cjs/components/app-launcher/link.cjs.map +0 -1
- package/dist/cjs/components/app-launcher/tile.cjs +0 -2
- package/dist/cjs/components/app-launcher/tile.cjs.map +0 -1
- package/dist/cjs/components/app-launcher.cjs +0 -1
- package/dist/cjs/components/brand-band/index.cjs +0 -2
- package/dist/cjs/components/brand-band/index.cjs.map +0 -1
- package/dist/cjs/components/brand-band.cjs +0 -1
- package/dist/cjs/components/expression/condition.cjs +0 -2
- package/dist/cjs/components/expression/condition.cjs.map +0 -1
- package/dist/cjs/components/expression/formula.cjs +0 -2
- package/dist/cjs/components/expression/formula.cjs.map +0 -1
- package/dist/cjs/components/expression/group.cjs +0 -2
- package/dist/cjs/components/expression/group.cjs.map +0 -1
- package/dist/cjs/components/expression/index.cjs +0 -2
- package/dist/cjs/components/expression/index.cjs.map +0 -1
- package/dist/cjs/components/expression.cjs +0 -1
- package/dist/cjs/components/global-header/button.cjs +0 -2
- package/dist/cjs/components/global-header/button.cjs.map +0 -1
- package/dist/cjs/components/global-header/check-props.cjs +0 -2
- package/dist/cjs/components/global-header/check-props.cjs.map +0 -1
- package/dist/cjs/components/global-header/dropdown.cjs +0 -2
- package/dist/cjs/components/global-header/dropdown.cjs.map +0 -1
- package/dist/cjs/components/global-header/favorites.cjs +0 -2
- package/dist/cjs/components/global-header/favorites.cjs.map +0 -1
- package/dist/cjs/components/global-header/help.cjs +0 -2
- package/dist/cjs/components/global-header/help.cjs.map +0 -1
- package/dist/cjs/components/global-header/index.cjs +0 -2
- package/dist/cjs/components/global-header/index.cjs.map +0 -1
- package/dist/cjs/components/global-header/notifications.cjs +0 -2
- package/dist/cjs/components/global-header/notifications.cjs.map +0 -1
- package/dist/cjs/components/global-header/private/dropdown-trigger.cjs +0 -2
- package/dist/cjs/components/global-header/private/dropdown-trigger.cjs.map +0 -1
- package/dist/cjs/components/global-header/profile.cjs +0 -2
- package/dist/cjs/components/global-header/profile.cjs.map +0 -1
- package/dist/cjs/components/global-header/search.cjs +0 -2
- package/dist/cjs/components/global-header/search.cjs.map +0 -1
- package/dist/cjs/components/global-header/setup.cjs +0 -2
- package/dist/cjs/components/global-header/setup.cjs.map +0 -1
- package/dist/cjs/components/global-header/task.cjs +0 -2
- package/dist/cjs/components/global-header/task.cjs.map +0 -1
- package/dist/cjs/components/global-header.cjs +0 -1
- package/dist/cjs/components/global-navigation-bar/button.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/button.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/check-props.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/check-props.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/component.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/component.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/dropdown-trigger.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/dropdown-trigger.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/dropdown.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/dropdown.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/index.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/index.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/label.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/label.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/link.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/link.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar/region.cjs +0 -2
- package/dist/cjs/components/global-navigation-bar/region.cjs.map +0 -1
- package/dist/cjs/components/global-navigation-bar.cjs +0 -1
- package/dist/cjs/components/location-map/index.cjs +0 -2
- package/dist/cjs/components/location-map/index.cjs.map +0 -1
- package/dist/cjs/components/location-map.cjs +0 -1
- package/dist/cjs/components/utilities/truncate/index.cjs +0 -2
- package/dist/cjs/components/utilities/truncate/index.cjs.map +0 -1
- package/dist/cjs/components/utilities/truncate.cjs +0 -1
- package/dist/cjs/utilities/warning/one-of-component.cjs +0 -2
- package/dist/cjs/utilities/warning/one-of-component.cjs.map +0 -1
- package/dist/es/components/app-launcher/check-props.js +0 -17
- package/dist/es/components/app-launcher/check-props.js.map +0 -1
- package/dist/es/components/app-launcher/component.js +0 -31
- package/dist/es/components/app-launcher/component.js.map +0 -1
- package/dist/es/components/app-launcher/expandable-section.js +0 -42
- package/dist/es/components/app-launcher/expandable-section.js.map +0 -1
- package/dist/es/components/app-launcher/index.js +0 -96
- package/dist/es/components/app-launcher/index.js.map +0 -1
- package/dist/es/components/app-launcher/link.js +0 -29
- package/dist/es/components/app-launcher/link.js.map +0 -1
- package/dist/es/components/app-launcher/tile.js +0 -101
- package/dist/es/components/app-launcher/tile.js.map +0 -1
- package/dist/es/components/app-launcher.js +0 -2
- package/dist/es/components/brand-band/index.js +0 -27
- package/dist/es/components/brand-band/index.js.map +0 -1
- package/dist/es/components/brand-band.js +0 -2
- package/dist/es/components/expression/condition.js +0 -124
- package/dist/es/components/expression/condition.js.map +0 -1
- package/dist/es/components/expression/formula.js +0 -105
- package/dist/es/components/expression/formula.js.map +0 -1
- package/dist/es/components/expression/group.js +0 -153
- package/dist/es/components/expression/group.js.map +0 -1
- package/dist/es/components/expression/index.js +0 -33
- package/dist/es/components/expression/index.js.map +0 -1
- package/dist/es/components/expression.js +0 -2
- package/dist/es/components/global-header/button.js +0 -19
- package/dist/es/components/global-header/button.js.map +0 -1
- package/dist/es/components/global-header/check-props.js +0 -20
- package/dist/es/components/global-header/check-props.js.map +0 -1
- package/dist/es/components/global-header/dropdown.js +0 -33
- package/dist/es/components/global-header/dropdown.js.map +0 -1
- package/dist/es/components/global-header/favorites.js +0 -74
- package/dist/es/components/global-header/favorites.js.map +0 -1
- package/dist/es/components/global-header/help.js +0 -39
- package/dist/es/components/global-header/help.js.map +0 -1
- package/dist/es/components/global-header/index.js +0 -90
- package/dist/es/components/global-header/index.js.map +0 -1
- package/dist/es/components/global-header/notifications.js +0 -51
- package/dist/es/components/global-header/notifications.js.map +0 -1
- package/dist/es/components/global-header/private/dropdown-trigger.js +0 -50
- package/dist/es/components/global-header/private/dropdown-trigger.js.map +0 -1
- package/dist/es/components/global-header/profile.js +0 -47
- package/dist/es/components/global-header/profile.js.map +0 -1
- package/dist/es/components/global-header/search.js +0 -12
- package/dist/es/components/global-header/search.js.map +0 -1
- package/dist/es/components/global-header/setup.js +0 -39
- package/dist/es/components/global-header/setup.js.map +0 -1
- package/dist/es/components/global-header/task.js +0 -38
- package/dist/es/components/global-header/task.js.map +0 -1
- package/dist/es/components/global-header.js +0 -2
- package/dist/es/components/global-navigation-bar/button.js +0 -22
- package/dist/es/components/global-navigation-bar/button.js.map +0 -1
- package/dist/es/components/global-navigation-bar/check-props.js +0 -13
- package/dist/es/components/global-navigation-bar/check-props.js.map +0 -1
- package/dist/es/components/global-navigation-bar/component.js +0 -43
- package/dist/es/components/global-navigation-bar/component.js.map +0 -1
- package/dist/es/components/global-navigation-bar/dropdown-trigger.js +0 -66
- package/dist/es/components/global-navigation-bar/dropdown-trigger.js.map +0 -1
- package/dist/es/components/global-navigation-bar/dropdown.js +0 -34
- package/dist/es/components/global-navigation-bar/dropdown.js.map +0 -1
- package/dist/es/components/global-navigation-bar/index.js +0 -27
- package/dist/es/components/global-navigation-bar/index.js.map +0 -1
- package/dist/es/components/global-navigation-bar/label.js +0 -25
- package/dist/es/components/global-navigation-bar/label.js.map +0 -1
- package/dist/es/components/global-navigation-bar/link.js +0 -50
- package/dist/es/components/global-navigation-bar/link.js.map +0 -1
- package/dist/es/components/global-navigation-bar/region.js +0 -50
- package/dist/es/components/global-navigation-bar/region.js.map +0 -1
- package/dist/es/components/global-navigation-bar.js +0 -2
- package/dist/es/components/location-map/index.js +0 -75
- package/dist/es/components/location-map/index.js.map +0 -1
- package/dist/es/components/location-map.js +0 -2
- package/dist/es/components/utilities/truncate/index.js +0 -91
- package/dist/es/components/utilities/truncate/index.js.map +0 -1
- package/dist/es/components/utilities/truncate.js +0 -2
- package/dist/es/utilities/warning/one-of-component.js +0 -15
- package/dist/es/utilities/warning/one-of-component.js.map +0 -1
- package/dist/types/components/app-launcher/check-props.d.ts +0 -3
- package/dist/types/components/app-launcher/check-props.d.ts.map +0 -1
- package/dist/types/components/app-launcher/expandable-section.d.ts +0 -62
- package/dist/types/components/app-launcher/expandable-section.d.ts.map +0 -1
- package/dist/types/components/app-launcher/index.d.ts +0 -48
- package/dist/types/components/app-launcher/index.d.ts.map +0 -1
- package/dist/types/components/app-launcher/link.d.ts +0 -39
- package/dist/types/components/app-launcher/link.d.ts.map +0 -1
- package/dist/types/components/app-launcher/section.d.ts +0 -55
- package/dist/types/components/app-launcher/section.d.ts.map +0 -1
- package/dist/types/components/app-launcher/tile.d.ts +0 -74
- package/dist/types/components/app-launcher/tile.d.ts.map +0 -1
- package/dist/types/components/app-launcher.d.ts +0 -2
- package/dist/types/components/brand-band/check-props.d.ts +0 -3
- package/dist/types/components/brand-band/check-props.d.ts.map +0 -1
- package/dist/types/components/brand-band/index.d.ts +0 -39
- package/dist/types/components/brand-band/index.d.ts.map +0 -1
- package/dist/types/components/brand-band.d.ts +0 -2
- package/dist/types/components/bread-crumb/index.d.ts +0 -3
- package/dist/types/components/bread-crumb/index.d.ts.map +0 -1
- package/dist/types/components/bread-crumb.d.ts +0 -2
- package/dist/types/components/expression/condition.d.ts +0 -105
- package/dist/types/components/expression/condition.d.ts.map +0 -1
- package/dist/types/components/expression/formula.d.ts +0 -88
- package/dist/types/components/expression/formula.d.ts.map +0 -1
- package/dist/types/components/expression/group.d.ts +0 -114
- package/dist/types/components/expression/group.d.ts.map +0 -1
- package/dist/types/components/expression/index.d.ts +0 -72
- package/dist/types/components/expression/index.d.ts.map +0 -1
- package/dist/types/components/expression.d.ts +0 -2
- package/dist/types/components/forms/input/index.d.ts +0 -3
- package/dist/types/components/forms/input/index.d.ts.map +0 -1
- package/dist/types/components/forms/input/search.d.ts +0 -3
- package/dist/types/components/forms/input/search.d.ts.map +0 -1
- package/dist/types/components/forms/input.d.ts +0 -2
- package/dist/types/components/forms/radio/index.d.ts +0 -3
- package/dist/types/components/forms/radio/index.d.ts.map +0 -1
- package/dist/types/components/forms/radio.d.ts +0 -2
- package/dist/types/components/forms/textarea/index.d.ts +0 -3
- package/dist/types/components/forms/textarea/index.d.ts.map +0 -1
- package/dist/types/components/forms/textarea.d.ts +0 -2
- package/dist/types/components/global-header/button.d.ts +0 -15
- package/dist/types/components/global-header/button.d.ts.map +0 -1
- package/dist/types/components/global-header/check-props.d.ts +0 -3
- package/dist/types/components/global-header/check-props.d.ts.map +0 -1
- package/dist/types/components/global-header/dropdown.d.ts +0 -59
- package/dist/types/components/global-header/dropdown.d.ts.map +0 -1
- package/dist/types/components/global-header/favorites.d.ts +0 -42
- package/dist/types/components/global-header/favorites.d.ts.map +0 -1
- package/dist/types/components/global-header/help.d.ts +0 -25
- package/dist/types/components/global-header/help.d.ts.map +0 -1
- package/dist/types/components/global-header/index.d.ts +0 -38
- package/dist/types/components/global-header/index.d.ts.map +0 -1
- package/dist/types/components/global-header/notifications.d.ts +0 -33
- package/dist/types/components/global-header/notifications.d.ts.map +0 -1
- package/dist/types/components/global-header/private/dropdown-trigger.d.ts +0 -78
- package/dist/types/components/global-header/private/dropdown-trigger.d.ts.map +0 -1
- package/dist/types/components/global-header/profile.d.ts +0 -38
- package/dist/types/components/global-header/profile.d.ts.map +0 -1
- package/dist/types/components/global-header/search.d.ts +0 -14
- package/dist/types/components/global-header/search.d.ts.map +0 -1
- package/dist/types/components/global-header/setup.d.ts +0 -25
- package/dist/types/components/global-header/setup.d.ts.map +0 -1
- package/dist/types/components/global-header/task.d.ts +0 -25
- package/dist/types/components/global-header/task.d.ts.map +0 -1
- package/dist/types/components/global-header.d.ts +0 -2
- package/dist/types/components/global-navigation-bar/button.d.ts +0 -18
- package/dist/types/components/global-navigation-bar/button.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/check-props.d.ts +0 -3
- package/dist/types/components/global-navigation-bar/check-props.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/dropdown-trigger.d.ts +0 -88
- package/dist/types/components/global-navigation-bar/dropdown-trigger.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/dropdown.d.ts +0 -64
- package/dist/types/components/global-navigation-bar/dropdown.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/index.d.ts +0 -35
- package/dist/types/components/global-navigation-bar/index.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/label.d.ts +0 -25
- package/dist/types/components/global-navigation-bar/label.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/link.d.ts +0 -84
- package/dist/types/components/global-navigation-bar/link.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar/region.d.ts +0 -36
- package/dist/types/components/global-navigation-bar/region.d.ts.map +0 -1
- package/dist/types/components/global-navigation-bar.d.ts +0 -2
- package/dist/types/components/location-map/index.d.ts +0 -49
- package/dist/types/components/location-map/index.d.ts.map +0 -1
- package/dist/types/components/location-map.d.ts +0 -2
- package/dist/types/components/navigation/index.d.ts +0 -3
- package/dist/types/components/navigation/index.d.ts.map +0 -1
- package/dist/types/components/navigation.d.ts +0 -2
- package/dist/types/components/popover-tooltip/index.d.ts +0 -3
- package/dist/types/components/popover-tooltip/index.d.ts.map +0 -1
- package/dist/types/components/popover-tooltip.d.ts +0 -2
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ILLUSTRATION as e } from "../../utilities/constants.js";
|
|
2
2
|
import t from "../utilities/utility-icon/svg.js";
|
|
3
3
|
import n from "../../utilities/class-names.js";
|
|
4
|
+
import r from "./check-props.js";
|
|
4
5
|
import "react";
|
|
5
|
-
import { jsx as
|
|
6
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
7
|
//#region components/illustration/index.tsx
|
|
7
|
-
var
|
|
8
|
+
var o = (e) => {
|
|
8
9
|
if (!e || typeof e != "string") return;
|
|
9
10
|
let t = e.replace(/[\x00-\x1f\x7f]/g, "").trim().toLowerCase();
|
|
10
11
|
if ([
|
|
@@ -18,44 +19,55 @@ var a = (e) => {
|
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
return e;
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
}, s = ({ className: s, illustration: c, heading: l, messageBody: u, name: d, path: f, internalIllustration: p = !0, size: m = "small", style: h = {}, ...g }) => {
|
|
23
|
+
r(e, {
|
|
24
|
+
className: s,
|
|
25
|
+
illustration: c,
|
|
26
|
+
heading: l,
|
|
27
|
+
messageBody: u,
|
|
28
|
+
name: d,
|
|
29
|
+
path: f,
|
|
30
|
+
internalIllustration: p,
|
|
31
|
+
size: m,
|
|
32
|
+
style: h
|
|
33
|
+
});
|
|
34
|
+
let _ = d ? d.replace(/_| /g, "-").toLowerCase() : "", v = { ...h }, y = null;
|
|
35
|
+
if (m === "large" && !v.height && (v.height = "400px"), c) y = /* @__PURE__ */ i(t, {
|
|
24
36
|
className: "slds-illustration__svg",
|
|
25
37
|
"aria-hidden": "true",
|
|
26
|
-
data:
|
|
27
|
-
name:
|
|
28
|
-
style:
|
|
38
|
+
data: c,
|
|
39
|
+
name: _,
|
|
40
|
+
style: v
|
|
29
41
|
});
|
|
30
|
-
else if (
|
|
31
|
-
let e =
|
|
32
|
-
e && (
|
|
42
|
+
else if (f) {
|
|
43
|
+
let e = o(f);
|
|
44
|
+
e && (y = /* @__PURE__ */ i("svg", {
|
|
33
45
|
className: "slds-illustration__svg",
|
|
34
46
|
"aria-hidden": "true",
|
|
35
|
-
name:
|
|
36
|
-
style:
|
|
37
|
-
children: /* @__PURE__ */
|
|
47
|
+
name: _,
|
|
48
|
+
style: v,
|
|
49
|
+
children: /* @__PURE__ */ i("use", { xlinkHref: e })
|
|
38
50
|
}));
|
|
39
51
|
}
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
-
className: n(
|
|
42
|
-
"slds-illustration_small":
|
|
43
|
-
"slds-illustration_large":
|
|
52
|
+
return /* @__PURE__ */ a("div", {
|
|
53
|
+
className: n(s, "slds-illustration", {
|
|
54
|
+
"slds-illustration_small": m === "small",
|
|
55
|
+
"slds-illustration_large": m === "large"
|
|
44
56
|
}),
|
|
45
|
-
children: [
|
|
57
|
+
children: [y, /* @__PURE__ */ a("div", {
|
|
46
58
|
className: "slds-text-longform",
|
|
47
|
-
children: [
|
|
59
|
+
children: [l && /* @__PURE__ */ i("h3", {
|
|
48
60
|
className: "slds-text-heading_medium",
|
|
49
|
-
children:
|
|
50
|
-
}),
|
|
61
|
+
children: l
|
|
62
|
+
}), u && /* @__PURE__ */ i("p", {
|
|
51
63
|
className: "slds-text-body_regular",
|
|
52
|
-
children:
|
|
64
|
+
children: u
|
|
53
65
|
})]
|
|
54
66
|
})]
|
|
55
67
|
});
|
|
56
68
|
};
|
|
57
|
-
|
|
69
|
+
s.displayName = e;
|
|
58
70
|
//#endregion
|
|
59
|
-
export {
|
|
71
|
+
export { s as default };
|
|
60
72
|
|
|
61
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/illustration/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport Svg from '../utilities/utility-icon/svg';\nimport { ILLUSTRATION } from '../../utilities/constants';\n// Development-only
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/illustration/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, { type ReactNode, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport Svg from '../utilities/utility-icon/svg';\nimport { ILLUSTRATION } from '../../utilities/constants';\n// Development-only deprecation warning. Illustration is deprecated for security\n// reasons (imported SVGs bypass SLDS styles via shadow DOM, and a user-provided\n// `path` is an XSS vector). This must fire — do not drop it.\nimport checkProps from './check-props';\n\n/**\n * Illustration size options\n */\nexport type IllustrationSize = 'small' | 'large';\n\n/**\n * SVG illustration data structure\n */\nexport interface IllustrationData {\n\tviewBox?: string;\n\t[key: string]: unknown;\n}\n\n/**\n * Props for the Illustration component\n */\nexport interface IllustrationProps {\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Heading text */\n\theading?: string;\n\t/** Custom SVG object */\n\tillustration?: IllustrationData;\n\t/** Whether SVGs are from design-system-react repo */\n\tinternalIllustration?: boolean;\n\t/** Message body below heading */\n\tmessageBody?: string | ReactNode;\n\t/** Name of the illustration */\n\tname?: string;\n\t/** Path to illustration SVG */\n\tpath?: string;\n\t/** Size of illustration */\n\tsize?: IllustrationSize;\n\t/** Custom styles for SVG */\n\tstyle?: CSSProperties;\n}\n\nconst sanitizePath = (path: string) => {\n\tif (!path || typeof path !== 'string') {\n\t\treturn undefined;\n\t}\n\n\t// Remove control characters, null bytes, and normalize whitespace\n\tconst normalizedPath = path\n\t\t.replace(/[\\x00-\\x1f\\x7f]/g, '') // eslint-disable-line no-control-regex\n\t\t.trim()\n\t\t.toLowerCase();\n\n\tconst dangerousProtocols = [\n\t\t'javascript:', // eslint-disable-line no-script-url\n\t\t'data:',\n\t\t'vbscript:',\n\t\t'file:',\n\t\t'blob:',\n\t];\n\n\tconst isDangerous = dangerousProtocols.some((protocol) =>\n\t\tnormalizedPath.startsWith(protocol)\n\t);\n\n\tif (isDangerous) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log(\n\t\t\t`Illustration: Blocked potentially unsafe path \"${path}\". Only http, https, relative paths, and fragment identifiers are allowed.`\n\t\t);\n\t\treturn undefined;\n\t}\n\n\treturn path;\n};\n\n/**\n * An illustration is an image and inline text that work in tandem to communicate a state in a more friendly way.\n */\nconst Illustration = ({\n\tclassName,\n\tillustration,\n\theading,\n\tmessageBody,\n\tname,\n\tpath,\n\tinternalIllustration = true,\n\tsize = 'small',\n\tstyle = {},\n\t...rest\n}: IllustrationProps): React.ReactElement => {\n\t// Dev-only deprecation warning (see check-props.js): Illustration is\n\t// deprecated, and using `path` with user-provided SVGs is an XSS risk.\n\t(checkProps as (component: string, props: unknown) => void)(ILLUSTRATION, {\n\t\tclassName,\n\t\tillustration,\n\t\theading,\n\t\tmessageBody,\n\t\tname,\n\t\tpath,\n\t\tinternalIllustration,\n\t\tsize,\n\t\tstyle,\n\t});\n\n\tconst kebabCaseName = name ? name.replace(/_| /g, '-').toLowerCase() : '';\n\tconst styles: CSSProperties = { ...style };\n\tlet illustrationSvg: React.ReactNode = null;\n\n\t// Large illustration SVG should have a default height of 400px if not already specified\n\tif (size === 'large' && !styles.height) {\n\t\tstyles.height = '400px';\n\t}\n\n\tif (illustration) {\n\t\t// Use SVG data passed in with `illustration` prop\n\t\tillustrationSvg = (\n\t\t\t<Svg\n\t\t\t\tclassName=\"slds-illustration__svg\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tdata={illustration}\n\t\t\t\tname={kebabCaseName}\n\t\t\t\tstyle={styles}\n\t\t\t/>\n\t\t);\n\t} else if (path) {\n\t\tconst safePath = sanitizePath(path);\n\t\tif (safePath) {\n\t\t\tillustrationSvg = (\n\t\t\t\t<svg\n\t\t\t\t\tclassName=\"slds-illustration__svg\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\tname={kebabCaseName}\n\t\t\t\t\tstyle={styles}\n\t\t\t\t>\n\t\t\t\t\t<use xlinkHref={safePath} />\n\t\t\t\t</svg>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(className as string, 'slds-illustration', {\n\t\t\t\t'slds-illustration_small': size === 'small',\n\t\t\t\t'slds-illustration_large': size === 'large',\n\t\t\t})}\n\t\t>\n\t\t\t{illustrationSvg}\n\t\t\t<div className=\"slds-text-longform\">\n\t\t\t\t{heading && <h3 className=\"slds-text-heading_medium\">{heading}</h3>}\n\t\t\t\t{messageBody && <p className=\"slds-text-body_regular\">{messageBody}</p>}\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nIllustration.displayName = ILLUSTRATION;\n\nexport default Illustration;\n"],"mappings":";;;;;;;AAiDA,IAAM,KAAgB,MAAiB;CACtC,IAAI,CAAC,KAAQ,OAAO,KAAS,UAC5B;CAID,IAAM,IAAiB,EACrB,QAAQ,oBAAoB,EAAE,CAAC,CAC/B,KAAK,CAAC,CACN,YAAY;CAcd,IAJoB;EAPnB;EACA;EACA;EACA;EACA;CAGmB,CAAA,CAAmB,MAAM,MAC5C,EAAe,WAAW,CAAQ,CAG/B,GAAa;EAEhB,QAAQ,IACP,kDAAkD,EAAK,2EACxD;EACA;CACD;CAEA,OAAO;AACR,GAKM,KAAgB,EACrB,cACA,iBACA,YACA,gBACA,SACA,SACA,0BAAuB,IACvB,UAAO,SACP,WAAQ,CAAC,GACT,GAAG,QACyC;CAG5C,EAA4D,GAAc;EACzE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,CAAC;CAED,IAAM,IAAgB,IAAO,EAAK,QAAQ,QAAQ,GAAG,CAAC,CAAC,YAAY,IAAI,IACjE,IAAwB,EAAE,GAAG,EAAM,GACrC,IAAmC;CAOvC,IAJI,MAAS,WAAW,CAAC,EAAO,WAC/B,EAAO,SAAS,UAGb,GAEH,IACC,kBAAC,GAAD;EACC,WAAU;EACV,eAAY;EACZ,MAAM;EACN,MAAM;EACN,OAAO;CACP,CAAA;MAEI,IAAI,GAAM;EAChB,IAAM,IAAW,EAAa,CAAI;EAClC,AAAI,MACH,IACC,kBAAC,OAAD;GACC,WAAU;GACV,eAAY;GACZ,MAAM;GACN,OAAO;GAEP,UAAA,kBAAC,OAAD,EAAK,WAAW,EAAW,CAAA;EACvB,CAAA;CAGR;CAEA,OACC,kBAAC,OAAD;EACC,WAAW,EAAW,GAAqB,qBAAqB;GAC/D,2BAA2B,MAAS;GACpC,2BAA2B,MAAS;EACrC,CAAC;EAJF,UAAA,CAME,GACD,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,KAAW,kBAAC,MAAD;IAAI,WAAU;IAA4B,UAAA;GAAY,CAAA,GACjE,KAAe,kBAAC,KAAD;IAAG,WAAU;IAA0B,UAAA;GAAe,CAAA,CAClE;EACD,CAAA,CAAA;;AAEP;AAEA,EAAa,cAAc"}
|
|
@@ -4,123 +4,97 @@ import ne from "./icon-settings/index.js";
|
|
|
4
4
|
import e from "./utilities/utility-icon/index.js";
|
|
5
5
|
import t from "./icon/button-icon/index.js";
|
|
6
6
|
import n from "./portal-settings/index.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import ue from "./data-table/row-actions.js";
|
|
59
|
-
import de from "./data-table/index.js";
|
|
60
|
-
import fe from "./data-table/highlight-cell.js";
|
|
61
|
-
import q from "./date-picker/index.js";
|
|
62
|
-
import pe from "./docked-composer/index.js";
|
|
63
|
-
import me from "./dynamic-icon/index.js";
|
|
64
|
-
import he from "./popover/edit-dialog.js";
|
|
65
|
-
import ge from "./expression/group.js";
|
|
66
|
-
import _e from "./expression/index.js";
|
|
67
|
-
import ve from "./expression/condition.js";
|
|
68
|
-
import J from "./expression/formula.js";
|
|
7
|
+
import r from "./icon/index.js";
|
|
8
|
+
import i from "./tooltip/index.js";
|
|
9
|
+
import re from "./button/index.js";
|
|
10
|
+
import ie from "./accordion/panel.js";
|
|
11
|
+
import ae from "./alert/index.js";
|
|
12
|
+
import oe from "./alert/container.js";
|
|
13
|
+
import a from "./avatar/index.js";
|
|
14
|
+
import o from "./badge/index.js";
|
|
15
|
+
import s from "./menu-dropdown/button-trigger.js";
|
|
16
|
+
import c from "./menu-dropdown/index.js";
|
|
17
|
+
import l from "./breadcrumb/index.js";
|
|
18
|
+
import u from "./builder-header/utilities.js";
|
|
19
|
+
import d from "./builder-header/nav-link.js";
|
|
20
|
+
import f from "./builder-header/index.js";
|
|
21
|
+
import p from "./builder-header/misc.js";
|
|
22
|
+
import m from "./builder-header/nav.js";
|
|
23
|
+
import h from "./builder-header/nav-dropdown.js";
|
|
24
|
+
import g from "./builder-header/toolbar.js";
|
|
25
|
+
import _ from "./button-group/index.js";
|
|
26
|
+
import v from "./button-stateful/index.js";
|
|
27
|
+
import y from "./media-object/index.js";
|
|
28
|
+
import b from "./card/empty.js";
|
|
29
|
+
import x from "./card/index.js";
|
|
30
|
+
import S from "./spinner/index.js";
|
|
31
|
+
import C from "./input/index.js";
|
|
32
|
+
import w from "./icon/input-icon/index.js";
|
|
33
|
+
import T from "./card/filter.js";
|
|
34
|
+
import E from "./carousel/index.js";
|
|
35
|
+
import D from "./checkbox/index.js";
|
|
36
|
+
import O from "./radio-group/index.js";
|
|
37
|
+
import k from "./radio-button-group/index.js";
|
|
38
|
+
import A from "./radio/index.js";
|
|
39
|
+
import j from "./tabs/index.js";
|
|
40
|
+
import M from "./tabs/panel.js";
|
|
41
|
+
import N from "./popover/index.js";
|
|
42
|
+
import P from "./color-picker/color-picker.js";
|
|
43
|
+
import F from "./pill/index.js";
|
|
44
|
+
import I from "./combobox/index.js";
|
|
45
|
+
import L from "./combobox/filter.js";
|
|
46
|
+
import R from "./data-table/cell.js";
|
|
47
|
+
import z from "./data-table/column.js";
|
|
48
|
+
import B from "./data-table/interactive-element.js";
|
|
49
|
+
import V from "./data-table/interactive-link.js";
|
|
50
|
+
import H from "./data-table/row-actions.js";
|
|
51
|
+
import U from "./data-table/index.js";
|
|
52
|
+
import W from "./data-table/highlight-cell.js";
|
|
53
|
+
import G from "./date-picker/index.js";
|
|
54
|
+
import K from "./docked-composer/index.js";
|
|
55
|
+
import q from "./dynamic-icon/index.js";
|
|
56
|
+
import J from "./popover/edit-dialog.js";
|
|
57
|
+
import se from "./expandable-section/index.js";
|
|
69
58
|
import Y from "./files/file.js";
|
|
70
|
-
import
|
|
59
|
+
import ce from "./files/index.js";
|
|
71
60
|
import X from "./files/more-files.js";
|
|
72
|
-
import
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import Ce from "./global-header/dropdown.js";
|
|
76
|
-
import we from "./global-header/favorites.js";
|
|
77
|
-
import Te from "./global-header/help.js";
|
|
78
|
-
import Ee from "./global-header/notifications.js";
|
|
79
|
-
import De from "./global-header/profile.js";
|
|
80
|
-
import Oe from "./global-header/search.js";
|
|
81
|
-
import ke from "./global-header/setup.js";
|
|
82
|
-
import Ae from "./global-header/task.js";
|
|
83
|
-
import je from "./global-navigation-bar/index.js";
|
|
84
|
-
import Me from "./global-navigation-bar/button.js";
|
|
85
|
-
import Ne from "./global-navigation-bar/dropdown.js";
|
|
86
|
-
import Pe from "./global-navigation-bar/label.js";
|
|
87
|
-
import Fe from "./global-navigation-bar/link.js";
|
|
88
|
-
import Ie from "./global-navigation-bar/region.js";
|
|
89
|
-
import Le from "./illustration/index.js";
|
|
90
|
-
import Re from "./forms/input/inline.js";
|
|
61
|
+
import le from "./filter/filter.js";
|
|
62
|
+
import ue from "./illustration/index.js";
|
|
63
|
+
import de from "./forms/input/inline.js";
|
|
91
64
|
import Z from "./input/search.js";
|
|
92
|
-
import
|
|
93
|
-
import
|
|
65
|
+
import fe from "./settings.js";
|
|
66
|
+
import pe from "./modal/index.js";
|
|
67
|
+
import me from "./modal/trigger.js";
|
|
94
68
|
import Q from "./vertical-navigation/index.js";
|
|
95
|
-
import
|
|
96
|
-
import
|
|
97
|
-
import
|
|
98
|
-
import
|
|
99
|
-
import
|
|
100
|
-
import
|
|
101
|
-
import
|
|
102
|
-
import
|
|
103
|
-
import
|
|
104
|
-
import
|
|
105
|
-
import
|
|
106
|
-
import
|
|
107
|
-
import
|
|
108
|
-
import
|
|
69
|
+
import he from "./page-header/index.js";
|
|
70
|
+
import ge from "./page-header/control.js";
|
|
71
|
+
import _e from "./panel/index.js";
|
|
72
|
+
import ve from "./panel/filtering/group.js";
|
|
73
|
+
import ye from "./panel/filtering/list.js";
|
|
74
|
+
import be from "./panel/filtering/list-heading.js";
|
|
75
|
+
import xe from "./pill-container/index.js";
|
|
76
|
+
import Se from "./progress-bar/index.js";
|
|
77
|
+
import Ce from "./progress-indicator/index.js";
|
|
78
|
+
import we from "./progress-ring/index.js";
|
|
79
|
+
import Te from "./scoped-notification/index.js";
|
|
80
|
+
import Ee from "./setup-assistant/index.js";
|
|
81
|
+
import De from "./setup-assistant/step.js";
|
|
82
|
+
import Oe from "./slider/index.js";
|
|
109
83
|
import $ from "./split-view/index.js";
|
|
110
|
-
import
|
|
111
|
-
import
|
|
112
|
-
import
|
|
113
|
-
import
|
|
114
|
-
import
|
|
115
|
-
import
|
|
116
|
-
import
|
|
117
|
-
import
|
|
118
|
-
import
|
|
119
|
-
import
|
|
120
|
-
import
|
|
121
|
-
import
|
|
122
|
-
import
|
|
123
|
-
import
|
|
124
|
-
import
|
|
125
|
-
import
|
|
126
|
-
export { ee as Accordion,
|
|
84
|
+
import ke from "./split-view/header.js";
|
|
85
|
+
import Ae from "./split-view/listbox.js";
|
|
86
|
+
import je from "./textarea/index.js";
|
|
87
|
+
import Me from "./toast/index.js";
|
|
88
|
+
import Ne from "./toast/container.js";
|
|
89
|
+
import Pe from "./tree/tree.js";
|
|
90
|
+
import Fe from "./trial-bar/index.js";
|
|
91
|
+
import Ie from "./trial-bar/button.js";
|
|
92
|
+
import Le from "./trial-bar/dropdown.js";
|
|
93
|
+
import Re from "./visual-picker/index.js";
|
|
94
|
+
import ze from "./visual-picker/link.js";
|
|
95
|
+
import Be from "./welcome-mat/index.js";
|
|
96
|
+
import Ve from "./welcome-mat/info-badge.js";
|
|
97
|
+
import He from "./welcome-mat/tile.js";
|
|
98
|
+
import Ue from "./combobox/add-subheadings.js";
|
|
99
|
+
import We from "../utilities/log.js";
|
|
100
|
+
export { ee as Accordion, ie as AccordionPanel, ae as Alert, oe as AlertContainer, a as Avatar, o as Badge, l as BreadCrumb, l as Breadcrumb, f as BuilderHeader, p as BuilderHeaderMisc, m as BuilderHeaderNav, h as BuilderHeaderNavDropdown, d as BuilderHeaderNavLink, g as BuilderHeaderToolbar, u as BuilderHeaderUtilities, re as Button, _ as ButtonGroup, t as ButtonIcon, v as ButtonStateful, x as Card, b as CardEmpty, T as CardFilter, E as Carousel, D as Checkbox, P as ColorPicker, I as Combobox, U as DataTable, R as DataTableCell, z as DataTableColumn, W as DataTableHighlightCell, B as DataTableInteractiveElement, V as DataTableInteractiveLink, H as DataTableRowActions, G as DatePicker, G as Datepicker, K as DockedComposer, c as Dropdown, s as DropdownTrigger, q as DynamicIcon, J as EditDialog, se as ExpandableSection, Y as File, ce as Files, Y as FilesFile, X as FilesMoreFiles, le as Filter, r as Icon, ne as IconSettings, ue as Illustration, de as InlineEdit, C as Input, w as InputIcon, Z as InputSearch, y as MediaObject, c as MenuDropdown, s as MenuDropdownButtonTrigger, pe as Modal, me as ModalTrigger, X as MoreFiles, Q as Navigation, he as PageHeader, ge as PageHeaderControl, _e as Panel, ve as PanelFilterGroup, ye as PanelFilterList, be as PanelFilterListHeading, F as Pill, xe as PillContainer, N as Popover, i as PopoverTooltip, n as PortalSettings, Se as ProgressBar, Ce as ProgressIndicator, we as ProgressRing, A as Radio, k as RadioButtonGroup, O as RadioGroup, ee as SLDSAccordion, ie as SLDSAccordionPanel, ae as SLDSAlert, oe as SLDSAlertContainer, a as SLDSAvatar, o as SLDSBadge, l as SLDSBreadCrumb, l as SLDSBreadcrumb, f as SLDSBuilderHeader, p as SLDSBuilderHeaderMisc, m as SLDSBuilderHeaderNav, h as SLDSBuilderHeaderNavDropdown, d as SLDSBuilderHeaderNavLink, g as SLDSBuilderHeaderToolbar, u as SLDSBuilderHeaderUtilities, re as SLDSButton, _ as SLDSButtonGroup, t as SLDSButtonIcon, v as SLDSButtonStateful, x as SLDSCard, b as SLDSCardEmpty, T as SLDSCardFilter, E as SLDSCarousel, D as SLDSCheckbox, P as SLDSColorPicker, I as SLDSCombobox, L as SLDSComboboxFilterAndLimit, U as SLDSDataTable, R as SLDSDataTableCell, z as SLDSDataTableColumn, W as SLDSDataTableHighlightCell, B as SLDSDataTableInteractiveElement, V as SLDSDataTableInteractiveLink, H as SLDSDataTableRowActions, G as SLDSDatePicker, G as SLDSDatepicker, K as SLDSDockedComposer, s as SLDSDropdownTrigger, q as SLDSDynamicIcon, J as SLDSEditDialog, se as SLDSExpandableSection, Y as SLDSFile, ce as SLDSFiles, Y as SLDSFilesFile, X as SLDSFilesMoreFiles, le as SLDSFilter, r as SLDSIcon, ne as SLDSIconSettings, ue as SLDSIllustration, de as SLDSInlineEdit, C as SLDSInput, w as SLDSInputIcon, Z as SLDSInputSearch, y as SLDSMediaObject, c as SLDSMenuDropdown, s as SLDSMenuDropdownButtonTrigger, pe as SLDSModal, me as SLDSModalTrigger, X as SLDSMoreFiles, Q as SLDSNavigation, he as SLDSPageHeader, ge as SLDSPageHeaderControl, _e as SLDSPanel, ve as SLDSPanelFilterGroup, ye as SLDSPanelFilterList, be as SLDSPanelFilterListHeading, F as SLDSPill, xe as SLDSPillContainer, N as SLDSPopover, i as SLDSPopoverTooltip, n as SLDSPortalSettings, Se as SLDSProgressBar, Ce as SLDSProgressIndicator, we as SLDSProgressRing, A as SLDSRadio, k as SLDSRadioButtonGroup, O as SLDSRadioGroup, Te as SLDSScopedNotification, Z as SLDSSearch, fe as SLDSSettings, Ee as SLDSSetupAssistant, De as SLDSSetupAssistantStep, Oe as SLDSSlider, S as SLDSSpinner, $ as SLDSSplitView, ke as SLDSSplitViewHeader, Ae as SLDSSplitViewListbox, $ as SLDSSplitview, j as SLDSTabs, M as SLDSTabsPanel, je as SLDSTextarea, Me as SLDSToast, Ne as SLDSToastContainer, i as SLDSTooltip, Pe as SLDSTree, Fe as SLDSTrialBar, Ie as SLDSTrialBarButton, Le as SLDSTrialBarDropdown, e as SLDSUtilityIcon, Q as SLDSVerticalNavigation, Re as SLDSVisualPicker, ze as SLDSVisualPickerLink, Be as SLDSWelcomeMat, Ve as SLDSWelcomeMatInfoBadge, He as SLDSWelcomeMatTile, Te as ScopedNotification, Z as Search, fe as Settings, Ee as SetupAssistant, De as SetupAssistantStep, Oe as Slider, S as Spinner, $ as SplitView, ke as SplitViewHeader, Ae as SplitViewListbox, $ as Splitview, j as Tabs, M as TabsPanel, je as Textarea, Me as Toast, Ne as ToastContainer, i as Tooltip, Pe as Tree, Fe as TrialBar, Ie as TrialBarButton, Le as TrialBarDropdown, te as UNSAFE_DirectionSettings, e as UtilityIcon, Q as VerticalNavigation, Re as VisualPicker, ze as VisualPickerLink, Be as WelcomeMat, Ve as WelcomeMatInfoBadge, He as WelcomeMatTile, Ue as comboboxAddSubheadings, L as comboboxFilterAndLimit, We as log };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { canUseDOM as e } from "../../utilities/execution-environment.js";
|
|
2
|
-
import t from "
|
|
3
|
-
import n from "
|
|
2
|
+
import t from "../../utilities/warning/component-is-deprecated.js";
|
|
3
|
+
import n from "./index.js";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
import { createRoot as i } from "react-dom/client";
|
|
6
6
|
//#region components/modal/trigger.tsx
|
|
7
7
|
var a = { open: (a) => {
|
|
8
|
-
|
|
8
|
+
t("components/modal/trigger.jsx", {}, "This component is deprecated and appears to have been created in order to do modals in portals which is what current Modal has done for years.");
|
|
9
9
|
let o;
|
|
10
10
|
e && (o = document.createElement("span"), o.setAttribute("data-slds-modal", "true"), document.body.appendChild(o));
|
|
11
|
-
let s = /* @__PURE__ */ r(
|
|
11
|
+
let s = /* @__PURE__ */ r(n, {
|
|
12
12
|
heading: a.title,
|
|
13
13
|
footer: a.footer,
|
|
14
14
|
isOpen: !0,
|
|
@@ -6,19 +6,19 @@ import { forwardRef as i, useCallback as a, useImperativeHandle as o, useRef as
|
|
|
6
6
|
import c from "classnames";
|
|
7
7
|
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
8
|
//#region components/pill/index.tsx
|
|
9
|
-
var d = {}, f = {}, p = i(({ assistiveText: e, avatar: i, bare: p, children: m, className: h, hasError: g, href: _, icon: v, labels: y, onBlur: b, onClick: x, onFocus: S, onKeyDown: C, onRemove: w,
|
|
10
|
-
let
|
|
9
|
+
var d = {}, f = {}, p = i(({ assistiveText: e, avatar: i, bare: p, children: m, className: h, hasError: g, href: _, icon: v, labels: y, onBlur: b, onClick: x, onFocus: S, onKeyDown: C, onRemove: w, tabIndex: T, "aria-selected": E, variant: D = "link" }, O) => {
|
|
10
|
+
let k = s(null), A = {
|
|
11
11
|
...d,
|
|
12
12
|
...y
|
|
13
|
-
},
|
|
13
|
+
}, j = {
|
|
14
14
|
...f,
|
|
15
15
|
...e
|
|
16
16
|
};
|
|
17
|
-
o(
|
|
18
|
-
blur: () =>
|
|
19
|
-
focus: () =>
|
|
17
|
+
o(O, () => ({
|
|
18
|
+
blur: () => k.current?.blur(),
|
|
19
|
+
focus: () => k.current?.focus()
|
|
20
20
|
}));
|
|
21
|
-
let
|
|
21
|
+
let M = a(() => typeof _ == "string" ? _ : "#", [_]), N = a((e) => {
|
|
22
22
|
if (C?.(e), !e.defaultPrevented) switch (e.keyCode) {
|
|
23
23
|
case r.ENTER:
|
|
24
24
|
x && (n.trap(e), x());
|
|
@@ -30,30 +30,30 @@ var d = {}, f = {}, p = i(({ assistiveText: e, avatar: i, bare: p, children: m,
|
|
|
30
30
|
x,
|
|
31
31
|
C,
|
|
32
32
|
w
|
|
33
|
-
]),
|
|
34
|
-
|
|
35
|
-
}, [
|
|
33
|
+
]), P = a((e) => {
|
|
34
|
+
M() === "#" && e.preventDefault(), x?.(e);
|
|
35
|
+
}, [M, x]), F = () => {
|
|
36
36
|
let e = v || i;
|
|
37
37
|
return e ? /* @__PURE__ */ l("span", {
|
|
38
38
|
className: "slds-pill__icon_container",
|
|
39
39
|
children: e
|
|
40
40
|
}) : null;
|
|
41
|
-
},
|
|
42
|
-
href:
|
|
41
|
+
}, I = () => A.label ? D === "link" ? /* @__PURE__ */ l("a", {
|
|
42
|
+
href: M(),
|
|
43
43
|
className: "slds-pill__action",
|
|
44
|
-
title:
|
|
45
|
-
onClick:
|
|
44
|
+
title: A.title || A.label,
|
|
45
|
+
onClick: P,
|
|
46
46
|
children: /* @__PURE__ */ l("span", {
|
|
47
47
|
className: "slds-pill__label",
|
|
48
|
-
children:
|
|
48
|
+
children: A.label
|
|
49
49
|
})
|
|
50
50
|
}) : /* @__PURE__ */ l("span", {
|
|
51
51
|
className: "slds-pill__label",
|
|
52
|
-
title:
|
|
53
|
-
children:
|
|
54
|
-
}) : m,
|
|
52
|
+
title: A.title || A.label,
|
|
53
|
+
children: A.label
|
|
54
|
+
}) : m, L = () => w ? /* @__PURE__ */ u("span", {
|
|
55
55
|
className: "slds-icon_container slds-pill__remove",
|
|
56
|
-
title:
|
|
56
|
+
title: A.removeTitle,
|
|
57
57
|
role: "button",
|
|
58
58
|
onClick: w,
|
|
59
59
|
children: [/* @__PURE__ */ l(t, {
|
|
@@ -63,25 +63,27 @@ var d = {}, f = {}, p = i(({ assistiveText: e, avatar: i, bare: p, children: m,
|
|
|
63
63
|
name: "close"
|
|
64
64
|
}), /* @__PURE__ */ l("span", {
|
|
65
65
|
className: "slds-assistive-text",
|
|
66
|
-
children:
|
|
66
|
+
children: j.remove || A.removeTitle
|
|
67
67
|
})]
|
|
68
|
-
}) : null,
|
|
69
|
-
return
|
|
70
|
-
ref:
|
|
71
|
-
role:
|
|
68
|
+
}) : null, R;
|
|
69
|
+
return D === "link" ? R = "button" : D === "option" && (R = "option"), /* @__PURE__ */ u("span", {
|
|
70
|
+
ref: k,
|
|
71
|
+
role: R,
|
|
72
|
+
"aria-selected": E,
|
|
73
|
+
tabIndex: T === void 0 ? void 0 : typeof T == "string" ? Number(T) : T,
|
|
72
74
|
className: c("slds-pill", {
|
|
73
|
-
"slds-pill_link":
|
|
75
|
+
"slds-pill_link": D === "link",
|
|
74
76
|
"slds-has-error": g,
|
|
75
77
|
"slds-pill_bare": p
|
|
76
78
|
}, h),
|
|
77
|
-
onClick: !
|
|
78
|
-
onKeyDown: w ?
|
|
79
|
+
onClick: !A.label || D !== "link" ? x : void 0,
|
|
80
|
+
onKeyDown: w ? N : void 0,
|
|
79
81
|
onBlur: b,
|
|
80
82
|
onFocus: S,
|
|
81
83
|
children: [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
F(),
|
|
85
|
+
I(),
|
|
86
|
+
L()
|
|
85
87
|
]
|
|
86
88
|
});
|
|
87
89
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/pill/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { useRef, useCallback, useImperativeHandle, forwardRef, type ReactNode, type KeyboardEvent, type MouseEvent, type FocusEvent } from 'react';\nimport classNames from 'classnames';\nimport { PILL } from '../../utilities/constants';\nimport UtilityIcon from '../utilities/utility-icon';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\n/**\n * Pill variant types\n */\nexport type PillVariant = 'link' | 'option';\n\n/**\n * Assistive text for Pill\n */\nexport interface PillAssistiveText {\n\t/** Remove button assistive text */\n\tremove?: string;\n}\n\n/**\n * Labels for Pill\n */\nexport interface PillLabels {\n\t/** Pill label text */\n\tlabel?: string;\n\t/** Title tooltip */\n\ttitle?: string;\n\t/** Remove icon title */\n\tremoveTitle?: string;\n}\n\n/**\n * Props for the Pill component\n */\nexport interface PillProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: PillAssistiveText;\n\t/** Avatar element to display */\n\tavatar?: ReactNode;\n\t/** Use bare styling */\n\tbare?: boolean;\n\t/** Custom content (overrides label) */\n\tchildren?: ReactNode;\n\t/** CSS classes for the pill */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Show error styling */\n\thasError?: boolean;\n\t/** URL for link variant */\n\thref?: string;\n\t/** Icon element to display */\n\ticon?: ReactNode;\n\t/** Text labels */\n\tlabels?: PillLabels;\n\t/** Blur callback */\n\tonBlur?: (event: FocusEvent<HTMLSpanElement>) => void;\n\t/** Click callback */\n\tonClick?: (event?: MouseEvent<HTMLSpanElement | HTMLAnchorElement>) => void;\n\t/** Focus callback */\n\tonFocus?: (event: FocusEvent<HTMLSpanElement>) => void;\n\t/** Keydown callback */\n\tonKeyDown?: (event: KeyboardEvent<HTMLSpanElement>) => void;\n\t/** Remove callback */\n\tonRemove?: () => void;\n\t/** Pill variant */\n\tvariant?: PillVariant;\n}\n\n/**\n * Ref methods for Pill\n */\nexport interface PillRef {\n\t/** Remove focus from the pill */\n\tblur: () => void;\n\t/** Give focus to the pill */\n\tfocus: () => void;\n}\n\nconst defaultLabels: PillLabels = {};\nconst defaultAssistiveText: PillAssistiveText = {};\n\n/**\n * A pill displays a label that can contain links and can be removed from view.\n */\nconst Pill = forwardRef<PillRef, PillProps>(({\n\tassistiveText: propAssistiveText,\n\tavatar,\n\tbare,\n\tchildren,\n\tclassName,\n\thasError,\n\thref,\n\ticon,\n\tlabels: propLabels,\n\tonBlur,\n\tonClick,\n\tonFocus,\n\tonKeyDown,\n\tonRemove,\n\tvariant = 'link',\n}, ref) => {\n\tconst rootRef = useRef<HTMLSpanElement | null>(null);\n\tconst labels = { ...defaultLabels, ...propLabels };\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t// Expose focus/blur methods via ref\n\tuseImperativeHandle(ref, () => ({\n\t\tblur: () => rootRef.current?.blur(),\n\t\tfocus: () => rootRef.current?.focus(),\n\t}));\n\n\tconst getHref = useCallback(() => {\n\t\treturn typeof href === 'string' ? href : '#';\n\t}, [href]);\n\n\tconst handleKeyDown = useCallback((event: KeyboardEvent<HTMLSpanElement>) => {\n\t\tonKeyDown?.(event);\n\t\tif (event.defaultPrevented) return;\n\n\t\tswitch (event.keyCode) {\n\t\t\tcase KEYS.ENTER:\n\t\t\t\tif (onClick) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\tonClick();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KEYS.BACKSPACE:\n\t\t\tcase KEYS.DELETE:\n\t\t\t\tif (onRemove) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\tonRemove();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}, [onClick, onKeyDown, onRemove]);\n\n\tconst handleLinkClick = useCallback((event: MouseEvent<HTMLAnchorElement>) => {\n\t\tif (getHref() === '#') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tonClick?.(event);\n\t}, [getHref, onClick]);\n\n\t// Render icon or avatar\n\tconst renderIcon = () => {\n\t\tconst iconElement = icon || avatar;\n\t\tif (iconElement) {\n\t\t\treturn <span className=\"slds-pill__icon_container\">{iconElement}</span>;\n\t\t}\n\t\treturn null;\n\t};\n\n\t// Render label or children\n\tconst renderLabel = () => {\n\t\tif (labels.label) {\n\t\t\tif (variant === 'link') {\n\t\t\t\treturn (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={getHref()}\n\t\t\t\t\t\tclassName=\"slds-pill__action\"\n\t\t\t\t\t\ttitle={labels.title || labels.label}\n\t\t\t\t\t\tonClick={handleLinkClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-pill__label\">{labels.label}</span>\n\t\t\t\t\t</a>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<span\n\t\t\t\t\tclassName=\"slds-pill__label\"\n\t\t\t\t\ttitle={labels.title || labels.label}\n\t\t\t\t>\n\t\t\t\t\t{labels.label}\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\t\treturn children;\n\t};\n\n\t// Render remove icon\n\tconst renderRemoveIcon = () => {\n\t\tif (onRemove) {\n\t\t\treturn (\n\t\t\t\t<span\n\t\t\t\t\tclassName=\"slds-icon_container slds-pill__remove\"\n\t\t\t\t\ttitle={labels.removeTitle}\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tonClick={onRemove}\n\t\t\t\t>\n\t\t\t\t\t<UtilityIcon\n\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tclassName=\"slds-icon slds-icon_x-small slds-icon-text-default\"\n\t\t\t\t\t\tname=\"close\"\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t{assistiveText.remove || labels.removeTitle}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t};\n\n\t// Determine role\n\tlet role: string | undefined;\n\tif (variant === 'link') {\n\t\trole = 'button';\n\t} else if (variant === 'option') {\n\t\trole = 'option';\n\t}\n\n\treturn (\n\t\t<span\n\t\t\tref={rootRef}\n\t\t\trole={role}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-pill',\n\t\t\t\t{\n\t\t\t\t\t'slds-pill_link': variant === 'link',\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-pill_bare': bare,\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tonClick={!labels.label || variant !== 'link' ? onClick : undefined}\n\t\t\tonKeyDown={onRemove ? handleKeyDown : undefined}\n\t\t\tonBlur={onBlur}\n\t\t\tonFocus={onFocus}\n\t\t>\n\t\t\t{renderIcon()}\n\t\t\t{renderLabel()}\n\t\t\t{renderRemoveIcon()}\n\t\t</span>\n\t);\n});\n\nPill.displayName = PILL;\n\nexport default Pill;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/pill/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport { useRef, useCallback, useImperativeHandle, forwardRef, type ReactNode, type KeyboardEvent, type MouseEvent, type FocusEvent } from 'react';\nimport classNames from 'classnames';\nimport { PILL } from '../../utilities/constants';\nimport UtilityIcon from '../utilities/utility-icon';\nimport KEYS from '../../utilities/key-code';\nimport EventUtil from '../../utilities/event';\n\n/**\n * Pill variant types\n */\nexport type PillVariant = 'link' | 'option';\n\n/**\n * Assistive text for Pill\n */\nexport interface PillAssistiveText {\n\t/** Remove button assistive text */\n\tremove?: string;\n}\n\n/**\n * Labels for Pill\n */\nexport interface PillLabels {\n\t/** Pill label text */\n\tlabel?: string;\n\t/** Title tooltip */\n\ttitle?: string;\n\t/** Remove icon title */\n\tremoveTitle?: string;\n}\n\n/**\n * Props for the Pill component\n */\nexport interface PillProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: PillAssistiveText;\n\t/** Avatar element to display */\n\tavatar?: ReactNode;\n\t/** Use bare styling */\n\tbare?: boolean;\n\t/** Custom content (overrides label) */\n\tchildren?: ReactNode;\n\t/** CSS classes for the pill */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Show error styling */\n\thasError?: boolean;\n\t/** URL for link variant */\n\thref?: string;\n\t/** Icon element to display */\n\ticon?: ReactNode;\n\t/** Text labels */\n\tlabels?: PillLabels;\n\t/** Blur callback */\n\tonBlur?: (event: FocusEvent<HTMLSpanElement>) => void;\n\t/** Click callback */\n\tonClick?: (event?: MouseEvent<HTMLSpanElement | HTMLAnchorElement>) => void;\n\t/** Focus callback */\n\tonFocus?: (event: FocusEvent<HTMLSpanElement>) => void;\n\t/** Keydown callback */\n\tonKeyDown?: (event: KeyboardEvent<HTMLSpanElement>) => void;\n\t/** Remove callback */\n\tonRemove?: () => void;\n\t/** Tab order index. Applied to the root element so the pill can receive focus (e.g. roving tabindex for pill navigation). */\n\ttabIndex?: number | string;\n\t/** Marks the pill as selected. Used when the pill acts as a listbox `option`. */\n\t'aria-selected'?: boolean | 'true' | 'false';\n\t/** Pill variant */\n\tvariant?: PillVariant;\n}\n\n/**\n * Ref methods for Pill\n */\nexport interface PillRef {\n\t/** Remove focus from the pill */\n\tblur: () => void;\n\t/** Give focus to the pill */\n\tfocus: () => void;\n}\n\nconst defaultLabels: PillLabels = {};\nconst defaultAssistiveText: PillAssistiveText = {};\n\n/**\n * A pill displays a label that can contain links and can be removed from view.\n */\nconst Pill = forwardRef<PillRef, PillProps>(({\n\tassistiveText: propAssistiveText,\n\tavatar,\n\tbare,\n\tchildren,\n\tclassName,\n\thasError,\n\thref,\n\ticon,\n\tlabels: propLabels,\n\tonBlur,\n\tonClick,\n\tonFocus,\n\tonKeyDown,\n\tonRemove,\n\ttabIndex,\n\t'aria-selected': ariaSelected,\n\tvariant = 'link',\n}, ref) => {\n\tconst rootRef = useRef<HTMLSpanElement | null>(null);\n\tconst labels = { ...defaultLabels, ...propLabels };\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\n\t// Expose focus/blur methods via ref\n\tuseImperativeHandle(ref, () => ({\n\t\tblur: () => rootRef.current?.blur(),\n\t\tfocus: () => rootRef.current?.focus(),\n\t}));\n\n\tconst getHref = useCallback(() => {\n\t\treturn typeof href === 'string' ? href : '#';\n\t}, [href]);\n\n\tconst handleKeyDown = useCallback((event: KeyboardEvent<HTMLSpanElement>) => {\n\t\tonKeyDown?.(event);\n\t\tif (event.defaultPrevented) return;\n\n\t\tswitch (event.keyCode) {\n\t\t\tcase KEYS.ENTER:\n\t\t\t\tif (onClick) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\tonClick();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KEYS.BACKSPACE:\n\t\t\tcase KEYS.DELETE:\n\t\t\t\tif (onRemove) {\n\t\t\t\t\tEventUtil.trap(event);\n\t\t\t\t\tonRemove();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}, [onClick, onKeyDown, onRemove]);\n\n\tconst handleLinkClick = useCallback((event: MouseEvent<HTMLAnchorElement>) => {\n\t\tif (getHref() === '#') {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tonClick?.(event);\n\t}, [getHref, onClick]);\n\n\t// Render icon or avatar\n\tconst renderIcon = () => {\n\t\tconst iconElement = icon || avatar;\n\t\tif (iconElement) {\n\t\t\treturn <span className=\"slds-pill__icon_container\">{iconElement}</span>;\n\t\t}\n\t\treturn null;\n\t};\n\n\t// Render label or children\n\tconst renderLabel = () => {\n\t\tif (labels.label) {\n\t\t\tif (variant === 'link') {\n\t\t\t\treturn (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={getHref()}\n\t\t\t\t\t\tclassName=\"slds-pill__action\"\n\t\t\t\t\t\ttitle={labels.title || labels.label}\n\t\t\t\t\t\tonClick={handleLinkClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"slds-pill__label\">{labels.label}</span>\n\t\t\t\t\t</a>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<span\n\t\t\t\t\tclassName=\"slds-pill__label\"\n\t\t\t\t\ttitle={labels.title || labels.label}\n\t\t\t\t>\n\t\t\t\t\t{labels.label}\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\t\treturn children;\n\t};\n\n\t// Render remove icon\n\tconst renderRemoveIcon = () => {\n\t\tif (onRemove) {\n\t\t\treturn (\n\t\t\t\t<span\n\t\t\t\t\tclassName=\"slds-icon_container slds-pill__remove\"\n\t\t\t\t\ttitle={labels.removeTitle}\n\t\t\t\t\trole=\"button\"\n\t\t\t\t\tonClick={onRemove}\n\t\t\t\t>\n\t\t\t\t\t<UtilityIcon\n\t\t\t\t\t\tstyle={{ cursor: 'pointer' }}\n\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\tclassName=\"slds-icon slds-icon_x-small slds-icon-text-default\"\n\t\t\t\t\t\tname=\"close\"\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t\t\t{assistiveText.remove || labels.removeTitle}\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t};\n\n\t// Determine role\n\tlet role: string | undefined;\n\tif (variant === 'link') {\n\t\trole = 'button';\n\t} else if (variant === 'option') {\n\t\trole = 'option';\n\t}\n\n\treturn (\n\t\t<span\n\t\t\tref={rootRef}\n\t\t\trole={role}\n\t\t\taria-selected={ariaSelected}\n\t\t\ttabIndex={\n\t\t\t\ttabIndex === undefined\n\t\t\t\t\t? undefined\n\t\t\t\t\t: typeof tabIndex === 'string'\n\t\t\t\t\t? Number(tabIndex)\n\t\t\t\t\t: tabIndex\n\t\t\t}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-pill',\n\t\t\t\t{\n\t\t\t\t\t'slds-pill_link': variant === 'link',\n\t\t\t\t\t'slds-has-error': hasError,\n\t\t\t\t\t'slds-pill_bare': bare,\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\tonClick={!labels.label || variant !== 'link' ? onClick : undefined}\n\t\t\tonKeyDown={onRemove ? handleKeyDown : undefined}\n\t\t\tonBlur={onBlur}\n\t\t\tonFocus={onFocus}\n\t\t>\n\t\t\t{renderIcon()}\n\t\t\t{renderLabel()}\n\t\t\t{renderRemoveIcon()}\n\t\t</span>\n\t);\n});\n\nPill.displayName = PILL;\n\nexport default Pill;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":";;;;;;;;AAqFA,IAAM,IAA4B,CAAC,GAC7B,IAA0C,CAAC,GAK3C,IAAO,GAAgC,EAC5C,eAAe,GACf,WACA,SACA,aACA,cACA,aACA,SACA,SACA,QAAQ,GACR,WACA,YACA,YACA,cACA,aACA,aACA,iBAAiB,GACjB,aAAU,UACR,MAAQ;CACV,IAAM,IAAU,EAA+B,IAAI,GAC7C,IAAS;EAAE,GAAG;EAAe,GAAG;CAAW,GAC3C,IAAgB;EAAE,GAAG;EAAsB,GAAG;CAAkB;CAGtE,EAAoB,UAAY;EAC/B,YAAY,EAAQ,SAAS,KAAK;EAClC,aAAa,EAAQ,SAAS,MAAM;CACrC,EAAE;CAEF,IAAM,IAAU,QACR,OAAO,KAAS,WAAW,IAAO,KACvC,CAAC,CAAI,CAAC,GAEH,IAAgB,GAAa,MAA0C;EAC5E,QAAY,CAAK,GACb,GAAM,kBAEV,QAAQ,EAAM,SAAd;GACC,KAAK,EAAK;IACT,AAAI,MACH,EAAU,KAAK,CAAK,GACpB,EAAQ;IAET;GACD,KAAK,EAAK;GACV,KAAK,EAAK,QACT,AAAI,MACH,EAAU,KAAK,CAAK,GACpB,EAAS;EAKZ;CACD,GAAG;EAAC;EAAS;EAAW;CAAQ,CAAC,GAE3B,IAAkB,GAAa,MAAyC;EAI7E,AAHI,EAAQ,MAAM,OACjB,EAAM,eAAe,GAEtB,IAAU,CAAK;CAChB,GAAG,CAAC,GAAS,CAAO,CAAC,GAGf,UAAmB;EACxB,IAAM,IAAc,KAAQ;EAI5B,OAHI,IACI,kBAAC,QAAD;GAAM,WAAU;GAA6B,UAAA;EAAkB,CAAA,IAEhE;CACR,GAGM,UACD,EAAO,QACN,MAAY,SAEd,kBAAC,KAAD;EACC,MAAM,EAAQ;EACd,WAAU;EACV,OAAO,EAAO,SAAS,EAAO;EAC9B,SAAS;EAET,UAAA,kBAAC,QAAD;GAAM,WAAU;GAAoB,UAAA,EAAO;EAAY,CAAA;CACrD,CAAA,IAIJ,kBAAC,QAAD;EACC,WAAU;EACV,OAAO,EAAO,SAAS,EAAO;EAE7B,UAAA,EAAO;CACH,CAAA,IAGD,GAIF,UACD,IAEF,kBAAC,QAAD;EACC,WAAU;EACV,OAAO,EAAO;EACd,MAAK;EACL,SAAS;EAJV,UAAA,CAMC,kBAAC,GAAD;GACC,OAAO,EAAE,QAAQ,UAAU;GAC3B,UAAS;GACT,WAAU;GACV,MAAK;EACL,CAAA,GACD,kBAAC,QAAD;GAAM,WAAU;GACd,UAAA,EAAc,UAAU,EAAO;EAC3B,CAAA,CACD;MAGD,MAIJ;CAOJ,OANI,MAAY,SACf,IAAO,WACG,MAAY,aACtB,IAAO,WAIP,kBAAC,QAAD;EACC,KAAK;EACC;EACN,iBAAe;EACf,UACC,MAAa,KAAA,IACV,KAAA,IACA,OAAO,KAAa,WACpB,OAAO,CAAQ,IACf;EAEJ,WAAW,EACV,aACA;GACC,kBAAkB,MAAY;GAC9B,kBAAkB;GAClB,kBAAkB;EACnB,GACA,CACD;EACA,SAAS,CAAC,EAAO,SAAS,MAAY,SAAS,IAAU,KAAA;EACzD,WAAW,IAAW,IAAgB,KAAA;EAC9B;EACC;EAvBV,UAAA;GAyBE,EAAW;GACX,EAAY;GACZ,EAAiB;EACb;;AAER,CAAC;AAED,EAAK,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/pill-container/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n\tuseId,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n} from 'react';\n\nimport SelectedListBox from './private/selected-listbox';\nimport { PILL_CONTAINER } from '../../utilities/constants';\n\n/**\n * Pill option structure\n */\nexport interface PillOption {\n\t/** Avatar component or config */\n\tavatar?: ReactNode | {\n\t\timgSrc?: string;\n\t\ttitle?: string;\n\t\tvariant?: string;\n\t};\n\t/** Bare style */\n\tbare?: boolean;\n\t/** Error state */\n\terror?: boolean;\n\t/** Icon component or config */\n\ticon?: ReactNode | {\n\t\tcategory?: string;\n\t\tname?: string;\n\t};\n\t/** Unique identifier */\n\tid?: string;\n\t/** Display label */\n\tlabel?: ReactNode | string;\n\t/** Hover title */\n\ttitle?: string;\n\t/** Allow additional properties */\n\t[key: string]: unknown;\n}\n\n/**\n * Assistive text for PillContainer\n */\nexport interface PillContainerAssistiveText {\n\t/** Label for the listbox */\n\tlistboxLabel?: string;\n\t/** Text for remove action */\n\tremovePill?: string;\n}\n\n/**\n * Labels for PillContainer\n */\nexport interface PillContainerLabels {\n\t/** Title for remove button */\n\tremovePillTitle?: string;\n}\n\n/**\n * Pill event data\n */\nexport interface PillEventData {\n\tindex: number;\n\toption: PillOption;\n}\n\n/**\n * Props for the PillContainer component\n */\nexport interface PillContainerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: PillContainerAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Text labels */\n\tlabels?: PillContainerLabels;\n\t/** Array of pill options */\n\toptions?: PillOption[];\n\t/** Pill click handler */\n\tonClickPill?: (event: MouseEvent | KeyboardEvent, data: PillEventData) => void;\n\t/** Remove request handler */\n\tonRequestRemovePill?: (event: MouseEvent | KeyboardEvent, data: PillEventData) => void;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** Container variant */\n\tvariant?: 'base' | 'bare';\n}\n\nconst defaultAssistiveText: PillContainerAssistiveText = {\n\tlistboxLabel: 'Selected Options:',\n\tremovePill: 'Press delete or backspace to remove',\n};\n\nconst defaultLabels: PillContainerLabels = {\n\tremovePillTitle: 'Remove',\n};\n\n/**\n * A PillContainer is a container that holds one or more pills.\n * Use it for a list of pills in a container that resembles an input form field.\n */\nconst PillContainer = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tid: propId,\n\tlabels: propLabels,\n\toptions = [],\n\tonClickPill,\n\tonRequestRemovePill,\n\tstyle,\n\tvariant,\n}: PillContainerProps): React.ReactElement | null => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tconst [activeSelectedOption, setActiveSelectedOption] = useState<PillOption | undefined>(\n\t\toptions[0] || undefined\n\t);\n\tconst [activeSelectedOptionIndex, setActiveSelectedOptionIndex] = useState(0);\n\tconst [listboxHasFocus, setListboxHasFocus] = useState(false);\n\n\tconst activeSelectedOptionRef = useRef<HTMLElement | null>(null);\n\tconst preserveFocusRef = useRef(false);\n\n\t// Reset active option when options change\n\tuseEffect(() => {\n\t\tif ((options.length > 0 && !options[activeSelectedOptionIndex]) || preserveFocusRef.current) {\n\t\t\tresetActiveSelectedOption();\n\t\t\tpreserveFocusRef.current = false;\n\t\t}\n\t}, [options, activeSelectedOptionIndex]);\n\n\tconst resetActiveSelectedOption = useCallback(() => {\n\t\tlet newIndex = activeSelectedOptionIndex;\n\n\t\tif (!options[newIndex]) {\n\t\t\tif (options.length > 0 && newIndex >= options.length) {\n\t\t\t\tnewIndex = options.length - 1;\n\t\t\t} else {\n\t\t\t\tnewIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\tsetActiveSelectedOption(options[newIndex] || undefined);\n\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\tsetListboxHasFocus(!!options[newIndex]);\n\t}, [options, activeSelectedOptionIndex]);\n\n\tconst getNewActiveOptionIndex = useCallback(\n\t\t(currentIndex: number, offset: number): number => {\n\t\t\tconst nextIndex = currentIndex + offset;\n\t\t\treturn options.length > nextIndex && nextIndex >= 0 ? nextIndex : currentIndex;\n\t\t},\n\t\t[options.length]\n\t);\n\n\tconst handleBlurPill = useCallback(() => {\n\t\tif (!preserveFocusRef.current) {\n\t\t\tsetListboxHasFocus(false);\n\t\t} else {\n\t\t\tpreserveFocusRef.current = false;\n\t\t}\n\t}, []);\n\n\tconst handleClickPill = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent, data: { index: number; option: PillOption }) => {\n\t\t\tif (onClickPill) {\n\t\t\t\tonClickPill(event, { index: data.index, option: data.option });\n\t\t\t}\n\t\t},\n\t\t[onClickPill]\n\t);\n\n\tconst handlePillFocus = useCallback(\n\t\t(_event: FocusEvent, data: { index: number; option: PillOption }) => {\n\t\t\tif (!listboxHasFocus) {\n\t\t\t\tsetActiveSelectedOption(data.option);\n\t\t\t\tsetActiveSelectedOptionIndex(data.index);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\t\t},\n\t\t[listboxHasFocus]\n\t);\n\n\tconst handleNavigatePillContainer = useCallback(\n\t\t(_event: React.SyntheticEvent | React.KeyboardEvent, { direction }: { direction: 'next' | 'previous' }) => {\n\t\t\tconst offsets = { next: 1, previous: -1 };\n\t\t\tconst isLastOptionAndRightIsPressed =\n\t\t\t\tactiveSelectedOptionIndex + 1 === options.length && direction === 'next';\n\t\t\tconst isFirstOptionAndLeftIsPressed =\n\t\t\t\tactiveSelectedOptionIndex === 0 && direction === 'previous';\n\n\t\t\tlet newIndex: number;\n\t\t\tlet newOption: PillOption;\n\n\t\t\tif (isLastOptionAndRightIsPressed) {\n\t\t\t\tnewIndex = 0;\n\t\t\t\tnewOption = options[0];\n\t\t\t} else if (isFirstOptionAndLeftIsPressed) {\n\t\t\t\tnewIndex = options.length - 1;\n\t\t\t\tnewOption = options[options.length - 1];\n\t\t\t} else {\n\t\t\t\tnewIndex = getNewActiveOptionIndex(activeSelectedOptionIndex, offsets[direction]);\n\t\t\t\tnewOption = options[newIndex];\n\t\t\t}\n\n\t\t\tpreserveFocusRef.current = true;\n\t\t\tsetActiveSelectedOption(newOption);\n\t\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\t\tsetListboxHasFocus(true);\n\t\t},\n\t\t[activeSelectedOptionIndex, options, getNewActiveOptionIndex]\n\t);\n\n\tconst handleRequestFocusPillContainer = useCallback(\n\t\t(_event: unknown, { ref }: { ref: HTMLElement | null }) => {\n\t\t\tif (ref) {\n\t\t\t\tactiveSelectedOptionRef.current = ref;\n\t\t\t\tactiveSelectedOptionRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\tconst handleRequestRemove = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent | React.SyntheticEvent, data: { index?: number; option: PillOption }) => {\n\t\t\tif (onRequestRemovePill && data.index !== undefined) {\n\t\t\t\tpreserveFocusRef.current = true;\n\t\t\t\tonRequestRemovePill(event as MouseEvent | KeyboardEvent, { index: data.index, option: data.option });\n\t\t\t}\n\t\t},\n\t\t[onRequestRemovePill]\n\t);\n\n\tif (options.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectedListBox\n\t\t\tactiveOption={activeSelectedOption}\n\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\tassistiveText={{\n\t\t\t\tremovePill: assistiveText.removePill,\n\t\t\t\tselectedListboxLabel: assistiveText.listboxLabel,\n\t\t\t}}\n\t\t\tclassName={className}\n\t\t\tevents={{\n\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\tonClickPill: handleClickPill,\n\t\t\t\tonPillFocus: handlePillFocus,\n\t\t\t\tonRequestFocus: handleRequestFocusPillContainer,\n\t\t\t\tonRequestFocusOnNextPill: handleNavigatePillContainer,\n\t\t\t\tonRequestFocusOnPreviousPill: handleNavigatePillContainer,\n\t\t\t\tonRequestRemove: handleRequestRemove,\n\t\t\t}}\n\t\t\tid={`${id}-listbox-of-pill-options`}\n\t\t\tisBare={variant === 'bare'}\n\t\t\tisPillContainer\n\t\t\tlabels={labels}\n\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\trenderAtSelectionLength={0}\n\t\t\tselection={options}\n\t\t\tstyle={style}\n\t\t/>\n\t);\n};\n\nPillContainer.displayName = PILL_CONTAINER;\n\nexport default PillContainer;\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/pill-container/index.tsx"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\nimport React, {\n\tuseState,\n\tuseCallback,\n\tuseRef,\n\tuseEffect,\n\tuseId,\n\ttype ReactNode,\n\ttype CSSProperties,\n\ttype MouseEvent,\n\ttype KeyboardEvent,\n\ttype FocusEvent,\n} from 'react';\n\nimport SelectedListBox from './private/selected-listbox';\nimport { PILL_CONTAINER } from '../../utilities/constants';\n\n/**\n * Pill option structure\n */\nexport interface PillOption {\n\t/** Avatar component or config */\n\tavatar?: ReactNode | {\n\t\timgSrc?: string;\n\t\ttitle?: string;\n\t\tvariant?: string;\n\t};\n\t/** Bare style */\n\tbare?: boolean;\n\t/** Error state */\n\terror?: boolean;\n\t/** Icon component or config */\n\ticon?: ReactNode | {\n\t\tcategory?: string;\n\t\tname?: string;\n\t};\n\t/** Unique identifier */\n\tid?: string;\n\t/** Display label */\n\tlabel?: ReactNode | string;\n\t/** Hover title */\n\ttitle?: string;\n\t/** Allow additional properties */\n\t[key: string]: unknown;\n}\n\n/**\n * Assistive text for PillContainer\n */\nexport interface PillContainerAssistiveText {\n\t/** Label for the listbox */\n\tlistboxLabel?: string;\n\t/** Text for remove action */\n\tremovePill?: string;\n}\n\n/**\n * Labels for PillContainer\n */\nexport interface PillContainerLabels {\n\t/** Title for remove button */\n\tremovePillTitle?: string;\n}\n\n/**\n * Pill event data\n */\nexport interface PillEventData {\n\tindex: number;\n\toption: PillOption;\n}\n\n/**\n * Props for the PillContainer component\n */\nexport interface PillContainerProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: PillContainerAssistiveText;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string;\n\t/** Text labels */\n\tlabels?: PillContainerLabels;\n\t/** Array of pill options */\n\toptions?: PillOption[];\n\t/** Pill click handler */\n\tonClickPill?: (event: MouseEvent | KeyboardEvent, data: PillEventData) => void;\n\t/** Remove request handler */\n\tonRequestRemovePill?: (event: MouseEvent | KeyboardEvent, data: PillEventData) => void;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** Container variant */\n\tvariant?: 'base' | 'bare';\n}\n\nconst defaultAssistiveText: PillContainerAssistiveText = {\n\tlistboxLabel: 'Selected Options:',\n\tremovePill: 'Press delete or backspace to remove',\n};\n\nconst defaultLabels: PillContainerLabels = {\n\tremovePillTitle: 'Remove',\n};\n\n/**\n * A PillContainer is a container that holds one or more pills.\n * Use it for a list of pills in a container that resembles an input form field.\n */\nconst PillContainer = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tid: propId,\n\tlabels: propLabels,\n\toptions = [],\n\tonClickPill,\n\tonRequestRemovePill,\n\tstyle,\n\tvariant,\n}: PillContainerProps): React.ReactElement | null => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\tconst [activeSelectedOption, setActiveSelectedOption] = useState<PillOption | undefined>(\n\t\toptions[0] || undefined\n\t);\n\tconst [activeSelectedOptionIndex, setActiveSelectedOptionIndex] = useState(0);\n\tconst [listboxHasFocus, setListboxHasFocus] = useState(false);\n\n\tconst activeSelectedOptionRef = useRef<HTMLElement | null>(null);\n\tconst preserveFocusRef = useRef(false);\n\n\t// Reset active option when options change\n\tuseEffect(() => {\n\t\tif ((options.length > 0 && !options[activeSelectedOptionIndex]) || preserveFocusRef.current) {\n\t\t\tresetActiveSelectedOption();\n\t\t\tpreserveFocusRef.current = false;\n\t\t}\n\t}, [options, activeSelectedOptionIndex]);\n\n\tconst resetActiveSelectedOption = useCallback(() => {\n\t\tlet newIndex = activeSelectedOptionIndex;\n\n\t\tif (!options[newIndex]) {\n\t\t\tif (options.length > 0 && newIndex >= options.length) {\n\t\t\t\tnewIndex = options.length - 1;\n\t\t\t} else {\n\t\t\t\tnewIndex = 0;\n\t\t\t}\n\t\t}\n\n\t\tsetActiveSelectedOption(options[newIndex] || undefined);\n\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\tsetListboxHasFocus(!!options[newIndex]);\n\t}, [options, activeSelectedOptionIndex]);\n\n\tconst getNewActiveOptionIndex = useCallback(\n\t\t(currentIndex: number, offset: number): number => {\n\t\t\tconst nextIndex = currentIndex + offset;\n\t\t\treturn options.length > nextIndex && nextIndex >= 0 ? nextIndex : currentIndex;\n\t\t},\n\t\t[options.length]\n\t);\n\n\tconst handleBlurPill = useCallback(() => {\n\t\tif (!preserveFocusRef.current) {\n\t\t\tsetListboxHasFocus(false);\n\t\t} else {\n\t\t\tpreserveFocusRef.current = false;\n\t\t}\n\t}, []);\n\n\tconst handleClickPill = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent, data: { index: number; option: PillOption }) => {\n\t\t\tif (onClickPill) {\n\t\t\t\tonClickPill(event, { index: data.index, option: data.option });\n\t\t\t}\n\t\t},\n\t\t[onClickPill]\n\t);\n\n\tconst handlePillFocus = useCallback(\n\t\t(_event: FocusEvent, data: { index: number; option: PillOption }) => {\n\t\t\tif (!listboxHasFocus) {\n\t\t\t\tsetActiveSelectedOption(data.option);\n\t\t\t\tsetActiveSelectedOptionIndex(data.index);\n\t\t\t\tsetListboxHasFocus(true);\n\t\t\t}\n\t\t},\n\t\t[listboxHasFocus]\n\t);\n\n\tconst handleNavigatePillContainer = useCallback(\n\t\t(_event: React.SyntheticEvent | React.KeyboardEvent, { direction }: { direction: 'next' | 'previous' }) => {\n\t\t\tconst offsets = { next: 1, previous: -1 };\n\t\t\tconst isLastOptionAndRightIsPressed =\n\t\t\t\tactiveSelectedOptionIndex + 1 === options.length && direction === 'next';\n\t\t\tconst isFirstOptionAndLeftIsPressed =\n\t\t\t\tactiveSelectedOptionIndex === 0 && direction === 'previous';\n\n\t\t\tlet newIndex: number;\n\t\t\tlet newOption: PillOption;\n\n\t\t\tif (isLastOptionAndRightIsPressed) {\n\t\t\t\tnewIndex = 0;\n\t\t\t\tnewOption = options[0];\n\t\t\t} else if (isFirstOptionAndLeftIsPressed) {\n\t\t\t\tnewIndex = options.length - 1;\n\t\t\t\tnewOption = options[options.length - 1];\n\t\t\t} else {\n\t\t\t\tnewIndex = getNewActiveOptionIndex(activeSelectedOptionIndex, offsets[direction]);\n\t\t\t\tnewOption = options[newIndex];\n\t\t\t}\n\n\t\t\tpreserveFocusRef.current = true;\n\t\t\tsetActiveSelectedOption(newOption);\n\t\t\tsetActiveSelectedOptionIndex(newIndex);\n\t\t\tsetListboxHasFocus(true);\n\t\t},\n\t\t[activeSelectedOptionIndex, options, getNewActiveOptionIndex]\n\t);\n\n\tconst handleRequestFocusPillContainer = useCallback(\n\t\t(_event: unknown, { ref }: { ref: HTMLElement | null }) => {\n\t\t\tif (ref) {\n\t\t\t\tactiveSelectedOptionRef.current = ref;\n\t\t\t\tactiveSelectedOptionRef.current.focus();\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\tconst handleRequestRemove = useCallback(\n\t\t(event: MouseEvent | KeyboardEvent | React.SyntheticEvent, data: { index?: number; option: PillOption }) => {\n\t\t\tif (onRequestRemovePill && data.index !== undefined) {\n\t\t\t\tpreserveFocusRef.current = true;\n\t\t\t\tonRequestRemovePill(event as MouseEvent | KeyboardEvent, { index: data.index, option: data.option });\n\t\t\t}\n\t\t},\n\t\t[onRequestRemovePill]\n\t);\n\n\tif (options.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectedListBox\n\t\t\tactiveOption={activeSelectedOption}\n\t\t\tactiveOptionIndex={activeSelectedOptionIndex}\n\t\t\tassistiveText={{\n\t\t\t\tremovePill: assistiveText.removePill,\n\t\t\t\tselectedListboxLabel: assistiveText.listboxLabel,\n\t\t\t}}\n\t\t\tclassName={className}\n\t\t\tevents={{\n\t\t\t\tonBlurPill: handleBlurPill,\n\t\t\t\tonClickPill: handleClickPill,\n\t\t\t\tonPillFocus: handlePillFocus,\n\t\t\t\tonRequestFocus: handleRequestFocusPillContainer,\n\t\t\t\tonRequestFocusOnNextPill: handleNavigatePillContainer,\n\t\t\t\tonRequestFocusOnPreviousPill: handleNavigatePillContainer,\n\t\t\t\tonRequestRemove: handleRequestRemove,\n\t\t\t}}\n\t\t\tid={`${id}-listbox-of-pill-options`}\n\t\t\tisBare={variant === 'bare'}\n\t\t\tisPillContainer\n\t\t\tlabels={labels}\n\t\t\tlistboxHasFocus={listboxHasFocus}\n\t\t\tmultiselectable\n\t\t\trenderAtSelectionLength={0}\n\t\t\tselection={options}\n\t\t\tstyle={style}\n\t\t/>\n\t);\n};\n\nPillContainer.displayName = PILL_CONTAINER;\n\nexport default PillContainer;\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":"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"}
|