@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,51 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_HEADER_NOTIFICATIONS as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "../button/index.js";
|
|
3
|
-
import n from "../popover/index.js";
|
|
4
|
-
import r from "react";
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
import o from "lodash.assign";
|
|
7
|
-
//#region components/global-header/notifications.tsx
|
|
8
|
-
var s = class extends r.Component {
|
|
9
|
-
static displayName = e;
|
|
10
|
-
static defaultProps = {
|
|
11
|
-
assistiveText: {
|
|
12
|
-
newNotificationsAfter: " new notifications",
|
|
13
|
-
newNotificationsBefore: "",
|
|
14
|
-
noNotifications: "No new notifications"
|
|
15
|
-
},
|
|
16
|
-
notificationCount: 0
|
|
17
|
-
};
|
|
18
|
-
render() {
|
|
19
|
-
let e = { "aria-live": "assertive" }, r = this.props.notificationCount ?? 0, s = o({
|
|
20
|
-
align: "bottom right",
|
|
21
|
-
body: /* @__PURE__ */ i("span", {}),
|
|
22
|
-
triggerClassName: "slds-dropdown-trigger slds-dropdown-trigger_click"
|
|
23
|
-
}, this.props.popover ? this.props.popover.props : {}), c = this.props.assistiveText, l = c.noNotifications;
|
|
24
|
-
return delete s.children, r > 0 ? l = `${c.newNotificationsBefore}${r}${c.newNotificationsAfter}` : e["aria-atomic"] = !0, /* @__PURE__ */ a(n, {
|
|
25
|
-
...s,
|
|
26
|
-
children: [/* @__PURE__ */ i(t, {
|
|
27
|
-
assistiveText: { icon: l },
|
|
28
|
-
className: "slds-button_icon slds-global-actions__notifications slds-global-actions__item-action",
|
|
29
|
-
iconCategory: "utility",
|
|
30
|
-
iconClassName: "slds-global-header__icon",
|
|
31
|
-
iconName: "notification",
|
|
32
|
-
iconSize: "small",
|
|
33
|
-
iconVariant: "container",
|
|
34
|
-
title: l,
|
|
35
|
-
variant: "icon",
|
|
36
|
-
...e
|
|
37
|
-
}), r > 0 ? /* @__PURE__ */ i("span", {
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
className: "slds-notification-badge slds-incoming-notification slds-show-notification",
|
|
40
|
-
children: r
|
|
41
|
-
}) : /* @__PURE__ */ i("span", {
|
|
42
|
-
"aria-hidden": "true",
|
|
43
|
-
className: "slds-notification-badge"
|
|
44
|
-
})]
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
//#endregion
|
|
49
|
-
export { s as default };
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","names":[],"sources":["../../../../components/global-header/notifications.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\n// # Global Header Notifications Component\n// Implements the [Global Header Notifications design pattern](https://www.lightningdesignsystem.com/components/global-header/#Notifications) in React.\n\nimport React, { type ReactElement } from 'react';\nimport assign from 'lodash.assign';\nimport Button from '../button';\nimport Popover from '../popover';\n\nimport { GLOBAL_HEADER_NOTIFICATIONS } from '../../utilities/constants';\n\nexport interface GlobalHeaderNotificationsAssistiveText {\n\tnewNotificationsAfter?: string;\n\tnewNotificationsBefore?: string;\n\tnoNotifications?: string;\n}\n\nexport interface GlobalHeaderNotificationsProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `newNotificationsAfter`: Assistive text for when there are new notifications, after the notificationCount. The default is ' new notifications'.\n\t * * `newNotificationsBefore`: Assistive text for when there are new notifications, before the notificationCount. The default is ''.\n\t * * `noNotifications`: Assistive text for when there are no new notifications.\n\t */\n\tassistiveText?: GlobalHeaderNotificationsAssistiveText;\n\t/**\n\t * Dictates the number of notifications shown in the new notifications badge.\n\t */\n\tnotificationCount?: number;\n\t/**\n\t * A `Popover` component. The props from this popover will be merged and override any default props. The `children` prop will be ignored.\n\t */\n\tpopover?: ReactElement;\n}\n\n/**\n * A GlobalHeaderNotifications component. Notifications are a way to notify a user about a global change within the application.\n */\nclass GlobalHeaderNotifications extends React.Component<GlobalHeaderNotificationsProps> {\n\tstatic displayName = GLOBAL_HEADER_NOTIFICATIONS;\n\n\tstatic defaultProps: Partial<GlobalHeaderNotificationsProps> = {\n\t\tassistiveText: {\n\t\t\tnewNotificationsAfter: ' new notifications',\n\t\t\tnewNotificationsBefore: '',\n\t\t\tnoNotifications: 'No new notifications',\n\t\t},\n\t\tnotificationCount: 0,\n\t};\n\n\trender() {\n\t\tconst buttonAriaProps: Record<string, unknown> = {\n\t\t\t'aria-live': 'assertive',\n\t\t};\n\t\tconst notificationCount = this.props.notificationCount ?? 0;\n\t\tconst popoverProps: Record<string, unknown> = assign(\n\t\t\t{\n\t\t\t\talign: 'bottom right',\n\t\t\t\tbody: <span />,\n\t\t\t\ttriggerClassName:\n\t\t\t\t\t'slds-dropdown-trigger slds-dropdown-trigger_click',\n\t\t\t},\n\t\t\tthis.props.popover ? this.props.popover.props : {}\n\t\t);\n\t\tconst assistiveText = this.props\n\t\t\t.assistiveText as GlobalHeaderNotificationsAssistiveText;\n\t\tlet notificationsAssistiveText = assistiveText.noNotifications;\n\n\t\tdelete popoverProps.children;\n\n\t\tif (notificationCount > 0) {\n\t\t\tnotificationsAssistiveText = `${assistiveText.newNotificationsBefore}${notificationCount}${assistiveText.newNotificationsAfter}`;\n\t\t} else {\n\t\t\tbuttonAriaProps['aria-atomic'] = true;\n\t\t}\n\n\t\treturn (\n\t\t\t<Popover {...(popoverProps as unknown as React.ComponentProps<typeof Popover>)}>\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: notificationsAssistiveText }}\n\t\t\t\t\tclassName=\"slds-button_icon slds-global-actions__notifications slds-global-actions__item-action\"\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonClassName=\"slds-global-header__icon\"\n\t\t\t\t\ticonName=\"notification\"\n\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\ticonVariant=\"container\"\n\t\t\t\t\ttitle={notificationsAssistiveText}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t{...buttonAriaProps}\n\t\t\t\t/>\n\t\t\t\t{notificationCount > 0 ? (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName=\"slds-notification-badge slds-incoming-notification slds-show-notification\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{notificationCount}\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<span aria-hidden=\"true\" className=\"slds-notification-badge\" />\n\t\t\t\t)}\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\nexport default GlobalHeaderNotifications;\n"],"mappings":";;;;;;;AAwCA,IAAM,IAAN,cAAwC,EAAM,UAA0C;CACvF,OAAO,cAAc;CAErB,OAAO,eAAwD;EAC9D,eAAe;GACd,uBAAuB;GACvB,wBAAwB;GACxB,iBAAiB;EAClB;EACA,mBAAmB;CACpB;CAEA,SAAS;EACR,IAAM,IAA2C,EAChD,aAAa,YACd,GACM,IAAoB,KAAK,MAAM,qBAAqB,GACpD,IAAwC,EAC7C;GACC,OAAO;GACP,MAAM,kBAAC,QAAD,CAAO,CAAA;GACb,kBACC;EACF,GACA,KAAK,MAAM,UAAU,KAAK,MAAM,QAAQ,QAAQ,CAAC,CAClD,GACM,IAAgB,KAAK,MACzB,eACE,IAA6B,EAAc;EAU/C,OARA,OAAO,EAAa,UAEhB,IAAoB,IACvB,IAA6B,GAAG,EAAc,yBAAyB,IAAoB,EAAc,0BAEzG,EAAgB,iBAAiB,IAIjC,kBAAC,GAAD;GAAS,GAAK;GAAd,UAAA,CACC,kBAAC,GAAD;IACC,eAAe,EAAE,MAAM,EAA2B;IAClD,WAAU;IACV,cAAa;IACb,eAAc;IACd,UAAS;IACT,UAAS;IACT,aAAY;IACZ,OAAO;IACP,SAAQ;IACR,GAAI;GACJ,CAAA,GACA,IAAoB,IACpB,kBAAC,QAAD;IACC,eAAY;IACZ,WAAU;IAET,UAAA;GACI,CAAA,IAEN,kBAAC,QAAD;IAAM,eAAY;IAAO,WAAU;GAA2B,CAAA,CAEvD;;CAEX;AACD"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { MENU_DROPDOWN_TRIGGER as e } from "../../../utilities/constants.js";
|
|
2
|
-
import t from "../button.js";
|
|
3
|
-
import n from "react";
|
|
4
|
-
import r from "classnames";
|
|
5
|
-
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
-
//#region components/global-header/private/dropdown-trigger.tsx
|
|
7
|
-
var o = class extends n.Component {
|
|
8
|
-
static displayName = e;
|
|
9
|
-
renderAvatar = () => {
|
|
10
|
-
let { avatar: e } = this.props;
|
|
11
|
-
return typeof e == "string" ? /* @__PURE__ */ i("span", {
|
|
12
|
-
className: "slds-avatar slds-avatar_circle slds-avatar_medium",
|
|
13
|
-
children: /* @__PURE__ */ i("img", {
|
|
14
|
-
src: e,
|
|
15
|
-
alt: ""
|
|
16
|
-
})
|
|
17
|
-
}) : e || null;
|
|
18
|
-
};
|
|
19
|
-
render() {
|
|
20
|
-
let { className: e, id: n, isOpen: o, globalAction: s, menu: c, onBlur: l, onClick: u, onFocus: d, onKeyDown: f, onMouseDown: p, onMouseEnter: m, onMouseLeave: h, triggerRef: g, ..._ } = this.props;
|
|
21
|
-
return /* @__PURE__ */ a("li", {
|
|
22
|
-
"aria-haspopup": "true",
|
|
23
|
-
className: r("slds-dropdown-trigger slds-dropdown-trigger_click", {
|
|
24
|
-
"slds-is-open": o,
|
|
25
|
-
"slds-p-around_xx-small": s
|
|
26
|
-
}, e),
|
|
27
|
-
id: n,
|
|
28
|
-
onBlur: l,
|
|
29
|
-
onClick: u,
|
|
30
|
-
onFocus: d,
|
|
31
|
-
onKeyDown: f,
|
|
32
|
-
onMouseDown: p,
|
|
33
|
-
onMouseEnter: m,
|
|
34
|
-
onMouseLeave: h,
|
|
35
|
-
ref: g,
|
|
36
|
-
children: [/* @__PURE__ */ i(t, {
|
|
37
|
-
className: r({ "slds-global-header__button_icon-actions": s }),
|
|
38
|
-
iconClassName: r({ "slds-global-header__icon-actions": s }),
|
|
39
|
-
"aria-haspopup": "true",
|
|
40
|
-
buttonVariant: "dropdown",
|
|
41
|
-
..._,
|
|
42
|
-
children: this.renderAvatar()
|
|
43
|
-
}), c]
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
//#endregion
|
|
48
|
-
export { o as default };
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=dropdown-trigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-trigger.js","names":[],"sources":["../../../../../components/global-header/private/dropdown-trigger.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\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\n// # Global Header Dropdown Component\n\n// ## Dependencies\n\n// ### React\nimport React, { type ReactNode } from 'react';\n\n// ### classNames\n// [github.com/JedWatson/classnames](https://github.com/JedWatson/classnames)\n// This project uses `classnames`, \"a simple javascript utility for conditionally\n// joining classNames together.\"\nimport classnames from 'classnames';\n\n// ### Dropdown\nimport Button from '../button';\n\n// ### Children\nimport { MENU_DROPDOWN_TRIGGER } from '../../../utilities/constants';\n\nexport interface GlobalHeaderDropdownTriggerProps {\n\t/**\n\t * An image URL or avatar node to display for the user profile.\n\t */\n\tavatar?: string | ReactNode;\n\t/**\n\t * CSS classes to be added to `li` element.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the dropdown to the triggering button.\n\t */\n\tid?: string;\n\t/**\n\t * Informs the trigger on the open/close state of the dropdown menu\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Adds custom styling such as inverse fill and special sizing/spacing\n\t */\n\tglobalAction?: boolean;\n\t/**\n\t * The dropdown menu.\n\t */\n\tmenu?: ReactNode;\n\t/**\n\t * Is only called when `openOn` is set to `hover` and when the triggering li loses focus.\n\t */\n\tonBlur?: React.FocusEventHandler<HTMLLIElement>;\n\t/**\n\t * This prop is passed onto the triggering `li`. Triggered when the trigger li is clicked.\n\t */\n\tonClick?: React.MouseEventHandler<HTMLLIElement>;\n\t/**\n\t * Is only called when `openOn` is set to `hover` and when the triggering li gains focus.\n\t */\n\tonFocus?: React.FocusEventHandler<HTMLLIElement>;\n\t/**\n\t * Called when a key pressed.\n\t */\n\tonKeyDown?: React.KeyboardEventHandler<HTMLLIElement>;\n\t/**\n\t * Called when mouse clicks down on the trigger li.\n\t */\n\tonMouseDown?: React.MouseEventHandler<HTMLLIElement>;\n\t/**\n\t * Called when mouse hovers over the trigger `li`.\n\t */\n\tonMouseEnter?: React.MouseEventHandler<HTMLLIElement>;\n\t/**\n\t * Called when mouse leaves trigger `li` or the menu.\n\t */\n\tonMouseLeave?: React.MouseEventHandler<HTMLLIElement>;\n\t/**\n\t * Determines if mouse hover or click opens the dropdown menu. The default of `click` is highly recommended to comply with accessibility standards. If you are planning on using hover, please pause a moment and reconsider.\n\t */\n\topenOn?: 'hover' | 'click' | 'hybrid';\n\t/**\n\t * Set to true if menu is inline and relatively positioned with CSS. This is the typical use case for menus with nubbins.\n\t */\n\tpositioned?: boolean;\n\t/**\n\t * The ref of the actual triggering button.\n\t */\n\ttriggerRef?: React.Ref<HTMLLIElement>;\n\t[key: string]: unknown;\n}\n\n/**\n * The Dropdown Button Trigger renders the default trigger button for the dropdown menu. If this component has children, it does not render itself to the DOM. Instead, it renders its child element, `Button`, and all that child's properties. This component may be used as a template to create custom triggers that do not use `Button`.\n */\nclass GlobalHeaderDropdownTrigger extends React.Component<GlobalHeaderDropdownTriggerProps> {\n\t// TODO: Make this a stateless component, however dropdowns break when this component becomes stateless.\n\n\t// ### Display Name\n\t// Always use the canonical component name (set in the core) as the React\n\t// display name.\n\tstatic displayName = MENU_DROPDOWN_TRIGGER;\n\n\trenderAvatar = () => {\n\t\tconst { avatar } = this.props;\n\t\tif (typeof avatar === 'string') {\n\t\t\treturn (\n\t\t\t\t<span className=\"slds-avatar slds-avatar_circle slds-avatar_medium\">\n\t\t\t\t\t<img src={avatar} alt=\"\" />\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\t\treturn avatar || null;\n\t};\n\n\t// ### Render\n\trender() {\n\t\t// The following props are provided to the `li`, all others are passed into the `Button`\n\t\tconst {\n\t\t\tclassName,\n\t\t\tid,\n\t\t\tisOpen,\n\t\t\tglobalAction,\n\t\t\tmenu,\n\t\t\tonBlur,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonMouseDown,\n\t\t\tonMouseEnter,\n\t\t\tonMouseLeave,\n\t\t\ttriggerRef,\n\t\t\t...rest\n\t\t} = this.props;\n\n\t\treturn (\n\t\t\t/* eslint-disable jsx-a11y/no-static-element-interactions */\n\t\t\t// eslint-disable-next-line jsx-a11y/role-supports-aria-props\n\t\t\t<li\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\tclassName={classnames(\n\t\t\t\t\t'slds-dropdown-trigger slds-dropdown-trigger_click',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t\t\t'slds-p-around_xx-small': globalAction,\n\t\t\t\t\t},\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t\tid={id}\n\t\t\t\tonBlur={onBlur}\n\t\t\t\tonClick={onClick}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\tonMouseLeave={onMouseLeave}\n\t\t\t\tref={triggerRef}\n\t\t\t>\n\t\t\t\t{/* eslint-enable jsx-a11y/no-static-element-interactions */}\n\t\t\t\t<Button\n\t\t\t\t\tclassName={classnames({\n\t\t\t\t\t\t'slds-global-header__button_icon-actions': globalAction,\n\t\t\t\t\t})}\n\t\t\t\t\ticonClassName={classnames({\n\t\t\t\t\t\t'slds-global-header__icon-actions': globalAction,\n\t\t\t\t\t})}\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\tbuttonVariant=\"dropdown\"\n\t\t\t\t\t{...rest}\n\t\t\t\t>\n\t\t\t\t\t{this.renderAvatar()}\n\t\t\t\t</Button>\n\t\t\t\t{menu}\n\t\t\t</li>\n\t\t);\n\t}\n}\n\nexport default GlobalHeaderDropdownTrigger;\n"],"mappings":";;;;;;AA+FA,IAAM,IAAN,cAA0C,EAAM,UAA4C;CAM3F,OAAO,cAAc;CAErB,qBAAqB;EACpB,IAAM,EAAE,cAAW,KAAK;EAQxB,OAPI,OAAO,KAAW,WAEpB,kBAAC,QAAD;GAAM,WAAU;GACf,UAAA,kBAAC,OAAD;IAAK,KAAK;IAAQ,KAAI;GAAI,CAAA;EACrB,CAAA,IAGD,KAAU;CAClB;CAGA,SAAS;EAER,IAAM,EACL,cACA,OACA,WACA,iBACA,SACA,WACA,YACA,YACA,cACA,gBACA,iBACA,iBACA,eACA,GAAG,MACA,KAAK;EAET,OAGC,kBAAC,MAAD;GACC,iBAAc;GACd,WAAW,EACV,qDACA;IACC,gBAAgB;IAChB,0BAA0B;GAC3B,GACA,CACD;GACI;GACI;GACC;GACA;GACE;GACE;GACC;GACA;GACd,KAAK;GAlBN,UAAA,CAqBC,kBAAC,GAAD;IACC,WAAW,EAAW,EACrB,2CAA2C,EAC5C,CAAC;IACD,eAAe,EAAW,EACzB,oCAAoC,EACrC,CAAC;IACD,iBAAc;IACd,eAAc;IACd,GAAI;IAEH,UAAA,KAAK,aAAa;GACZ,CAAA,GACP,CACE;;CAEN;AACD"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_HEADER_PROFILE as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "../button/index.js";
|
|
3
|
-
import n from "../popover/index.js";
|
|
4
|
-
import r from "./check-props.js";
|
|
5
|
-
import i from "react";
|
|
6
|
-
import a from "classnames";
|
|
7
|
-
import { jsx as o } from "react/jsx-runtime";
|
|
8
|
-
import s from "lodash.assign";
|
|
9
|
-
//#region components/global-header/profile.tsx
|
|
10
|
-
var c = class extends i.Component {
|
|
11
|
-
static displayName = e;
|
|
12
|
-
static defaultProps = { userName: "User Name" };
|
|
13
|
-
constructor(t) {
|
|
14
|
-
super(t), r(e, t);
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
let e = { "aria-haspopup": !0 }, r = s({
|
|
18
|
-
align: "bottom right",
|
|
19
|
-
body: /* @__PURE__ */ o("span", {}),
|
|
20
|
-
className: this.props.className,
|
|
21
|
-
heading: this.props.userName,
|
|
22
|
-
id: this.props.id,
|
|
23
|
-
triggerClassName: "slds-dropdown-trigger slds-dropdown-trigger_click"
|
|
24
|
-
}, this.props.popover ? this.props.popover.props : {}), i = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAwaADAAQAAAABAAAAwQAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgAwQDBAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uLj5OXm5+jp6vLz9PX29/j5+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WhKWya/M/rkoqjpupWGs6fDqulzLPbXCCSKRDlWVhkEEVer8LaP2ZMKKKKQBRRRQAUUUUAFFFFABRRVLUtSsNH0+bVdUmW3trdDJJI5wqqoySSaaQNn8tf7dun22m/tY+Mba0UIhuIpMD1eFGP5k18kV7p+0z8RbH4sfHjxN4+0o5tb67Igb+9HEojRv8AgQXNeF1+6YCEo0IRlukvyPxnHTjKtOUdm3+YUUUV1nKFFFFABRRRQB//0PqCiiiv6APw8KKKKACiiigD6v8Agv8Atp/H34F6WugeE9TS602P/V2l8nnRx/7nIZR7A49q9/8A+Hq37SX/AD5aL/4Dy/8Ax2vzRorza2T4WpLnnTTZ6FLNcTCPLCbSP0u/4erftJf8+Wi/+A8v/wAdo/4erftJf8+Wi/8AgPL/APHa/NGisv7Bwf8Az7Rp/bWL/wCfjP0u/wCHq37SX/Plov8A4Dy//HaP+Hq37SX/AD5aL/4Dy/8Ax2vzRoo/sHB/8+0H9tYv/n4z9Lv+Hq37SX/Plov/AIDy/wDx2j/h6t+0l/z5aL/4Dy//AB2vzRoo/sHB/wDPtB/bWL/5+M/S7/h6t+0l/wA+Wi/+A8v/AMdo/wCHq37SX/Plov8A4Dy//Ha/NGij+wcH/wA+0H9tYv8A5+M/S7/h6t+0l/z5aL/4Dy//AB2vAPjR+2n8ffjppbaB4s1NLXTZP9ZaWKeTHJ/v8lmHsTj2r5QorWjk+Fpy54U0mZ1c1xM48s5toKKKK9I88KKKKACiiigAooooA//R+oKKKK/oA/DwooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD/9L6gooor+gD8PCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/0/qCiiiv6APw8KKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA//Z";
|
|
25
|
-
return delete r.children, i = this.props.avatar ? this.props.avatar : i, /* @__PURE__ */ o(n, {
|
|
26
|
-
...r,
|
|
27
|
-
children: /* @__PURE__ */ o(t, {
|
|
28
|
-
className: a("slds-global-actions__avatar slds-global-actions__item-action", this.props.buttonClassName),
|
|
29
|
-
title: this.props.userName,
|
|
30
|
-
variant: "icon",
|
|
31
|
-
...e,
|
|
32
|
-
children: typeof i == "string" ? /* @__PURE__ */ o("span", {
|
|
33
|
-
className: "slds-avatar slds-avatar_circle slds-avatar_medium",
|
|
34
|
-
children: /* @__PURE__ */ o("img", {
|
|
35
|
-
alt: this.props.userName,
|
|
36
|
-
src: i,
|
|
37
|
-
title: "User avatar"
|
|
38
|
-
})
|
|
39
|
-
}) : i || null
|
|
40
|
-
})
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
//#endregion
|
|
45
|
-
export { c as default };
|
|
46
|
-
|
|
47
|
-
//# sourceMappingURL=profile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","names":[],"sources":["../../../../components/global-header/profile.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\n// # Global Header Button Component\n\n// ## Dependencies\n\n// ### React\nimport React, { type ReactNode } from 'react';\n\nimport assign from 'lodash.assign';\nimport classnames from 'classnames';\n\nimport checkProps from './check-props';\n\nimport Button from '../button';\nimport Popover from '../popover';\n\n// ## Constants\nimport { GLOBAL_HEADER_PROFILE } from '../../utilities/constants';\n\nexport interface GlobalHeaderProfileProps {\n\t/**\n\t * Extra classnames to apply to the popover.\n\t */\n\tclassName?: string;\n\t/**\n\t * An image URL or avatar node to display for the user profile. Defaults to a base64 encoded generic user avatar image string\n\t */\n\tavatar?: string | ReactNode;\n\t/**\n\t * CSS classes to be added to the `button` element.\n\t */\n\tbuttonClassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the popover to the triggering button. If an id is not provided, it will be automatically generated.\n\t */\n\tid?: string;\n\t/**\n\t * A `Popover` component. The props from this popover will be merged and override any default props.\n\t */\n\tpopover?: React.ReactElement;\n\t/**\n\t * The user name of the profile. Defaults to \"User Name\"\n\t */\n\tuserName?: string;\n}\n\n/**\n * This component is an `Avatar` component that opens a `Popover` component when clicked.\n */\nclass GlobalHeaderProfile extends React.Component<GlobalHeaderProfileProps> {\n\t// ### Display Name\n\tstatic displayName = GLOBAL_HEADER_PROFILE;\n\n\t// ### Default Props\n\tstatic defaultProps: Partial<GlobalHeaderProfileProps> = {\n\t\tuserName: 'User Name',\n\t};\n\n\tconstructor(props: GlobalHeaderProfileProps) {\n\t\tsuper(props);\n\t\t(checkProps as (name: string, props: unknown, doc?: unknown) => void)(\n\t\t\tGLOBAL_HEADER_PROFILE,\n\t\t\tprops\n\t\t);\n\t}\n\n\trender() {\n\t\tconst buttonAriaProps = {\n\t\t\t'aria-haspopup': true,\n\t\t};\n\t\tconst popoverProps: Record<string, unknown> = assign(\n\t\t\t{\n\t\t\t\talign: 'bottom right',\n\t\t\t\tbody: <span />,\n\t\t\t\tclassName: this.props.className,\n\t\t\t\theading: this.props.userName,\n\t\t\t\tid: this.props.id,\n\t\t\t\ttriggerClassName: 'slds-dropdown-trigger slds-dropdown-trigger_click',\n\t\t\t},\n\t\t\tthis.props.popover ? this.props.popover.props : {}\n\t\t);\n\t\t// Note: the default avatar is done this way to prevent documentation from showing this giant string\n\t\t/* eslint-disable max-len */\n\t\tlet avatar: string | ReactNode =\n\t\t\t'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAwaADAAQAAAABAAAAwQAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgAwQDBAwEiAAIRAQMRAf/EAB8AAAEF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4z9Lv+Hq37SX/Plov/AIDy/wDx2j/h6t+0l/z5aL/4Dy//AB2vzRoo/sHB/wDPtB/bWL/5+M/S7/h6t+0l/wA+Wi/+A8v/AMdo/wCHq37SX/Plov8A4Dy//Ha/NGij+wcH/wA+0H9tYv8A5+M/S7/h6t+0l/z5aL/4Dy//AB2vAPjR+2n8ffjppbaB4s1NLXTZP9ZaWKeTHJ/v8lmHsTj2r5QorWjk+Fpy54U0mZ1c1xM48s5toKKKK9I88KKKKACiiigAooooA//R+oKKKK/oA/DwooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD/9L6gooor+gD8PCiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/0/qCiiiv6APw8KKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooA//Z';\n\t\t/* eslint-enable max-len */\n\n\t\tdelete popoverProps.children;\n\n\t\tavatar = this.props.avatar ? this.props.avatar : avatar;\n\n\t\treturn (\n\t\t\t<Popover {...(popoverProps as unknown as React.ComponentProps<typeof Popover>)}>\n\t\t\t\t<Button\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\t'slds-global-actions__avatar slds-global-actions__item-action',\n\t\t\t\t\t\tthis.props.buttonClassName as string\n\t\t\t\t\t)}\n\t\t\t\t\ttitle={this.props.userName}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t{...buttonAriaProps}\n\t\t\t\t>\n\t\t\t\t\t{typeof avatar === 'string' ? (\n\t\t\t\t\t\t<span className=\"slds-avatar slds-avatar_circle slds-avatar_medium\">\n\t\t\t\t\t\t\t<img alt={this.props.userName} src={avatar} title=\"User avatar\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tavatar || null\n\t\t\t\t\t)}\n\t\t\t\t</Button>\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\nexport default GlobalHeaderProfile;\n"],"mappings":";;;;;;;;;AAmDA,IAAM,IAAN,cAAkC,EAAM,UAAoC;CAE3E,OAAO,cAAc;CAGrB,OAAO,eAAkD,EACxD,UAAU,YACX;CAEA,YAAY,GAAiC;EAE5C,AADA,MAAM,CAAK,GACX,EACC,GACA,CACD;CACD;CAEA,SAAS;EACR,IAAM,IAAkB,EACvB,iBAAiB,GAClB,GACM,IAAwC,EAC7C;GACC,OAAO;GACP,MAAM,kBAAC,QAAD,CAAO,CAAA;GACb,WAAW,KAAK,MAAM;GACtB,SAAS,KAAK,MAAM;GACpB,IAAI,KAAK,MAAM;GACf,kBAAkB;EACnB,GACA,KAAK,MAAM,UAAU,KAAK,MAAM,QAAQ,QAAQ,CAAC,CAClD,GAGI,IACH;EAOD,OAJA,OAAO,EAAa,UAEpB,IAAS,KAAK,MAAM,SAAS,KAAK,MAAM,SAAS,GAGhD,kBAAC,GAAD;GAAS,GAAK;GACb,UAAA,kBAAC,GAAD;IACC,WAAW,EACV,gEACA,KAAK,MAAM,eACZ;IACA,OAAO,KAAK,MAAM;IAClB,SAAQ;IACR,GAAI;IAEH,UAAA,OAAO,KAAW,WAClB,kBAAC,QAAD;KAAM,WAAU;KACf,UAAA,kBAAC,OAAD;MAAK,KAAK,KAAK,MAAM;MAAU,KAAK;MAAQ,OAAM;KAAe,CAAA;IAC5D,CAAA,IAEN,KAAU;GAEJ,CAAA;EACA,CAAA;CAEX;AACD"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_HEADER_SEARCH as e } from "../../utilities/constants.js";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
//#region components/global-header/search.tsx
|
|
4
|
-
var n = (e) => /* @__PURE__ */ t("div", {
|
|
5
|
-
className: "slds-global-header__item slds-global-header__item_search",
|
|
6
|
-
children: e.combobox
|
|
7
|
-
});
|
|
8
|
-
n.displayName = e;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { n as default };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","names":[],"sources":["../../../../components/global-header/search.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\n// # Global Header Search Component\n\n// ## Dependencies\n\n// ### React\nimport { type ReactNode } from 'react';\n\n// ## Constants\nimport { GLOBAL_HEADER_SEARCH } from '../../utilities/constants';\n\nexport interface GlobalHeaderSearchProps {\n\t/**\n\t * A required `Combobox` component. The props from this combobox will be merged and override any default props.\n\t */\n\tcombobox: ReactNode;\n}\n\n/**\n * The GlobalHeaderSearch component is used for application wide search. The form element is implemented as a `Combobox`.\n */\nconst GlobalHeaderSearch = (props: GlobalHeaderSearchProps) => (\n\t<div className=\"slds-global-header__item slds-global-header__item_search\">\n\t\t{props.combobox}\n\t</div>\n);\n\nGlobalHeaderSearch.displayName = GLOBAL_HEADER_SEARCH;\n\nexport default GlobalHeaderSearch;\n"],"mappings":";;;AAuBA,IAAM,KAAsB,MAC3B,kBAAC,OAAD;CAAK,WAAU;CACb,UAAA,EAAM;AACH,CAAA;AAGN,EAAmB,cAAc"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_HEADER_SETUP as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "../button/index.js";
|
|
3
|
-
import n from "../menu-dropdown/button-trigger.js";
|
|
4
|
-
import r from "../menu-dropdown/index.js";
|
|
5
|
-
import i from "react";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
import s from "lodash.assign";
|
|
8
|
-
//#region components/global-header/setup.tsx
|
|
9
|
-
var c = class extends i.Component {
|
|
10
|
-
static displayName = e;
|
|
11
|
-
static defaultProps = { assistiveText: { triggerButton: "Setup" } };
|
|
12
|
-
render() {
|
|
13
|
-
let e = { "aria-haspopup": !0 }, i = s({
|
|
14
|
-
align: "right",
|
|
15
|
-
nubbinPosition: "top right"
|
|
16
|
-
}, this.props.dropdown ? this.props.dropdown.props : {}), c = i.children || null;
|
|
17
|
-
delete i.children;
|
|
18
|
-
let l = this.props.assistiveText;
|
|
19
|
-
return /* @__PURE__ */ o(r, {
|
|
20
|
-
...i,
|
|
21
|
-
children: [/* @__PURE__ */ a(n, { children: /* @__PURE__ */ a(t, {
|
|
22
|
-
assistiveText: { icon: l.triggerButton },
|
|
23
|
-
className: "slds-button_icon slds-global-actions__setup slds-global-actions__item-action",
|
|
24
|
-
iconCategory: "utility",
|
|
25
|
-
iconClassName: "slds-global-header__icon",
|
|
26
|
-
iconName: "setup",
|
|
27
|
-
iconSize: "small",
|
|
28
|
-
iconVariant: "container",
|
|
29
|
-
title: l.triggerButton,
|
|
30
|
-
variant: "icon",
|
|
31
|
-
...e
|
|
32
|
-
}) }), c]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
export { c as default };
|
|
38
|
-
|
|
39
|
-
//# sourceMappingURL=setup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","names":[],"sources":["../../../../components/global-header/setup.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\n// # Global Header Setup Component\n// Implements the [Global Header Setup design pattern](https://www.lightningdesignsystem.com/components/global-header/#Setup) in React.\n\nimport React, { type ReactElement } from 'react';\nimport assign from 'lodash.assign';\nimport Button from '../button';\nimport Dropdown from '../menu-dropdown';\nimport DropdownTrigger from '../menu-dropdown/button-trigger';\n\nimport { GLOBAL_HEADER_SETUP } from '../../utilities/constants';\n\nexport interface GlobalHeaderSetupAssistiveText {\n\ttriggerButton?: string;\n}\n\nexport interface GlobalHeaderSetupProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `triggerButton`: Assistive text for the GlobalHeaderSetup trigger button. The default is `Setup`.\n\t */\n\tassistiveText?: GlobalHeaderSetupAssistiveText;\n\t/**\n\t * A `Dropdown` component. The props from this dropdown will be merged and override any default props. This also allows custom content to be passed as children and rendered in the dropdown.\n\t */\n\tdropdown?: ReactElement;\n}\n\n/**\n * A GlobalHeaderSetup component.\n */\nclass GlobalHeaderSetup extends React.Component<GlobalHeaderSetupProps> {\n\tstatic displayName = GLOBAL_HEADER_SETUP;\n\n\tstatic defaultProps: Partial<GlobalHeaderSetupProps> = {\n\t\tassistiveText: {\n\t\t\ttriggerButton: 'Setup',\n\t\t},\n\t};\n\n\trender() {\n\t\tconst buttonAriaProps = {\n\t\t\t'aria-haspopup': true,\n\t\t};\n\t\tconst dropdownProps: Record<string, unknown> = assign(\n\t\t\t{\n\t\t\t\talign: 'right',\n\t\t\t\tnubbinPosition: 'top right',\n\t\t\t},\n\t\t\tthis.props.dropdown ? this.props.dropdown.props : {}\n\t\t);\n\t\tconst dropdownChildren = dropdownProps.children || null;\n\n\t\tdelete dropdownProps.children;\n\n\t\tconst assistiveText = this.props\n\t\t\t.assistiveText as GlobalHeaderSetupAssistiveText;\n\n\t\treturn (\n\t\t\t<Dropdown {...(dropdownProps as React.ComponentProps<typeof Dropdown>)}>\n\t\t\t\t<DropdownTrigger>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: assistiveText.triggerButton }}\n\t\t\t\t\t\tclassName=\"slds-button_icon slds-global-actions__setup slds-global-actions__item-action\"\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonClassName=\"slds-global-header__icon\"\n\t\t\t\t\t\ticonName=\"setup\"\n\t\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\t\ticonVariant=\"container\"\n\t\t\t\t\t\ttitle={assistiveText.triggerButton}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t{...buttonAriaProps}\n\t\t\t\t\t/>\n\t\t\t\t</DropdownTrigger>\n\t\t\t\t{dropdownChildren as React.ReactNode}\n\t\t\t</Dropdown>\n\t\t);\n\t}\n}\n\nexport default GlobalHeaderSetup;\n"],"mappings":";;;;;;;;AAiCA,IAAM,IAAN,cAAgC,EAAM,UAAkC;CACvE,OAAO,cAAc;CAErB,OAAO,eAAgD,EACtD,eAAe,EACd,eAAe,QAChB,EACD;CAEA,SAAS;EACR,IAAM,IAAkB,EACvB,iBAAiB,GAClB,GACM,IAAyC,EAC9C;GACC,OAAO;GACP,gBAAgB;EACjB,GACA,KAAK,MAAM,WAAW,KAAK,MAAM,SAAS,QAAQ,CAAC,CACpD,GACM,IAAmB,EAAc,YAAY;EAEnD,OAAO,EAAc;EAErB,IAAM,IAAgB,KAAK,MACzB;EAEF,OACC,kBAAC,GAAD;GAAU,GAAK;GAAf,UAAA,CACC,kBAAC,GAAD,EAAA,UACC,kBAAC,GAAD;IACC,eAAe,EAAE,MAAM,EAAc,cAAc;IACnD,WAAU;IACV,cAAa;IACb,eAAc;IACd,UAAS;IACT,UAAS;IACT,aAAY;IACZ,OAAO,EAAc;IACrB,SAAQ;IACR,GAAI;GACJ,CAAA,EACe,CAAA,GAChB,CACQ;;CAEZ;AACD"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_HEADER_TASK as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "../button/index.js";
|
|
3
|
-
import n from "../menu-dropdown/button-trigger.js";
|
|
4
|
-
import r from "../menu-dropdown/index.js";
|
|
5
|
-
import i from "react";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
import s from "lodash.assign";
|
|
8
|
-
//#region components/global-header/task.tsx
|
|
9
|
-
var c = class extends i.Component {
|
|
10
|
-
static displayName = e;
|
|
11
|
-
static defaultProps = { assistiveText: { triggerButton: "Global Actions" } };
|
|
12
|
-
render() {
|
|
13
|
-
let e = { "aria-haspopup": !0 }, i = s({
|
|
14
|
-
align: "right",
|
|
15
|
-
nubbinPosition: "top right"
|
|
16
|
-
}, this.props.dropdown ? this.props.dropdown.props : {}), c = i.children || null;
|
|
17
|
-
delete i.children;
|
|
18
|
-
let l = this.props.assistiveText;
|
|
19
|
-
return /* @__PURE__ */ o(r, {
|
|
20
|
-
...i,
|
|
21
|
-
children: [/* @__PURE__ */ a(n, { children: /* @__PURE__ */ a(t, {
|
|
22
|
-
assistiveText: { icon: l.triggerButton },
|
|
23
|
-
className: "slds-button_icon slds-global-actions__task slds-global-actions__item-action",
|
|
24
|
-
iconCategory: "utility",
|
|
25
|
-
iconName: "add",
|
|
26
|
-
iconSize: "small",
|
|
27
|
-
iconVariant: "container",
|
|
28
|
-
title: l.triggerButton,
|
|
29
|
-
variant: "icon",
|
|
30
|
-
...e
|
|
31
|
-
}) }), c]
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
//#endregion
|
|
36
|
-
export { c as default };
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=task.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task.js","names":[],"sources":["../../../../components/global-header/task.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\n// # Global Header Task Component\n// Implements the [Global Header Task design pattern](https://www.lightningdesignsystem.com/components/global-header/#Task) in React.\n\nimport React, { type ReactElement } from 'react';\nimport assign from 'lodash.assign';\nimport Button from '../button';\nimport Dropdown from '../menu-dropdown';\nimport DropdownTrigger from '../menu-dropdown/button-trigger';\n\nimport { GLOBAL_HEADER_TASK } from '../../utilities/constants';\n\nexport interface GlobalHeaderTaskAssistiveText {\n\ttriggerButton?: string;\n}\n\nexport interface GlobalHeaderTaskProps {\n\t/**\n\t * **Assistive text for accessibility**\n\t * * `triggerButton`: Assistive text for the GlobalHeaderTask trigger button. The default is `Global Actions`.\n\t */\n\tassistiveText?: GlobalHeaderTaskAssistiveText;\n\t/**\n\t * A `Dropdown` component. The props from this dropdown will be merged and override any default props. This also allows custom content to be passed as children and rendered in the dropdown.\n\t */\n\tdropdown?: ReactElement;\n}\n\n/**\n * A GlobalHeaderTask component.\n */\nclass GlobalHeaderTask extends React.Component<GlobalHeaderTaskProps> {\n\tstatic displayName = GLOBAL_HEADER_TASK;\n\n\tstatic defaultProps: Partial<GlobalHeaderTaskProps> = {\n\t\tassistiveText: {\n\t\t\ttriggerButton: 'Global Actions',\n\t\t},\n\t};\n\n\trender() {\n\t\tconst buttonAriaProps = {\n\t\t\t'aria-haspopup': true,\n\t\t};\n\t\tconst dropdownProps: Record<string, unknown> = assign(\n\t\t\t{\n\t\t\t\talign: 'right',\n\t\t\t\tnubbinPosition: 'top right',\n\t\t\t},\n\t\t\tthis.props.dropdown ? this.props.dropdown.props : {}\n\t\t);\n\t\tconst dropdownChildren = dropdownProps.children || null;\n\n\t\tdelete dropdownProps.children;\n\n\t\tconst assistiveText = this.props\n\t\t\t.assistiveText as GlobalHeaderTaskAssistiveText;\n\n\t\treturn (\n\t\t\t<Dropdown {...(dropdownProps as React.ComponentProps<typeof Dropdown>)}>\n\t\t\t\t<DropdownTrigger>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={{ icon: assistiveText.triggerButton }}\n\t\t\t\t\t\tclassName=\"slds-button_icon slds-global-actions__task slds-global-actions__item-action\"\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonName=\"add\"\n\t\t\t\t\t\ticonSize=\"small\"\n\t\t\t\t\t\ticonVariant=\"container\"\n\t\t\t\t\t\ttitle={assistiveText.triggerButton}\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t\t{...buttonAriaProps}\n\t\t\t\t\t/>\n\t\t\t\t</DropdownTrigger>\n\t\t\t\t{dropdownChildren as React.ReactNode}\n\t\t\t</Dropdown>\n\t\t);\n\t}\n}\n\nexport default GlobalHeaderTask;\n"],"mappings":";;;;;;;;AAiCA,IAAM,IAAN,cAA+B,EAAM,UAAiC;CACrE,OAAO,cAAc;CAErB,OAAO,eAA+C,EACrD,eAAe,EACd,eAAe,iBAChB,EACD;CAEA,SAAS;EACR,IAAM,IAAkB,EACvB,iBAAiB,GAClB,GACM,IAAyC,EAC9C;GACC,OAAO;GACP,gBAAgB;EACjB,GACA,KAAK,MAAM,WAAW,KAAK,MAAM,SAAS,QAAQ,CAAC,CACpD,GACM,IAAmB,EAAc,YAAY;EAEnD,OAAO,EAAc;EAErB,IAAM,IAAgB,KAAK,MACzB;EAEF,OACC,kBAAC,GAAD;GAAU,GAAK;GAAf,UAAA,CACC,kBAAC,GAAD,EAAA,UACC,kBAAC,GAAD;IACC,eAAe,EAAE,MAAM,EAAc,cAAc;IACnD,WAAU;IACV,cAAa;IACb,UAAS;IACT,UAAS;IACT,aAAY;IACZ,OAAO,EAAc;IACrB,SAAQ;IACR,GAAI;GACJ,CAAA,EACe,CAAA,GAChB,CACQ;;CAEZ;AACD"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_NAVIGATION_BAR_BUTTON as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "../button/index.js";
|
|
3
|
-
import n from "classnames";
|
|
4
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
//#region components/global-navigation-bar/button.tsx
|
|
6
|
-
var i = ({ className: e = "slds-context-bar__label-action slds-text-body_regular", style: i = { lineHeight: "inherit" }, variant: a = "base", active: o, dividerPosition: s, ...c }) => /* @__PURE__ */ r("li", {
|
|
7
|
-
className: n("slds-context-bar__item", {
|
|
8
|
-
"slds-is-active": o,
|
|
9
|
-
[`slds-context-bar__item_divider-${s}`]: s
|
|
10
|
-
}),
|
|
11
|
-
children: /* @__PURE__ */ r(t, {
|
|
12
|
-
className: e,
|
|
13
|
-
style: i,
|
|
14
|
-
variant: a,
|
|
15
|
-
...c
|
|
16
|
-
})
|
|
17
|
-
});
|
|
18
|
-
i.displayName = e;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { i as default };
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../../../components/global-navigation-bar/button.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\n// # Global Navigation Bar Button Component\n\n// ## Dependencies\n\n// ### classNames\nimport classNames from 'classnames';\n\n// ### Button\nimport Button, { type ButtonProps } from '../button';\n\n// ## Constants\nimport { GLOBAL_NAVIGATION_BAR_BUTTON } from '../../utilities/constants';\n\nexport interface GlobalNavigationButtonProps extends ButtonProps {\n\t/**\n\t * Whether the item is active or not.\n\t */\n\tactive?: boolean;\n\t/**\n\t * Determines position of separating bar.\n\t */\n\tdividerPosition?: 'left' | 'right';\n}\n\n/**\n * A helper component that renders a Button as an item in the Global Navigation Bar. All props are passed onto `Button` except `active` and `dividerPosition`.\n */\nconst GlobalNavigationButton = ({\n\tclassName = 'slds-context-bar__label-action slds-text-body_regular',\n\tstyle = { lineHeight: 'inherit' },\n\tvariant = 'base',\n\tactive,\n\tdividerPosition,\n\t...props\n}: GlobalNavigationButtonProps) => (\n\t<li\n\t\tclassName={classNames('slds-context-bar__item', {\n\t\t\t'slds-is-active': active,\n\t\t\t[`slds-context-bar__item_divider-${dividerPosition}`]: dividerPosition,\n\t\t})}\n\t>\n\t\t<Button className={className} style={style} variant={variant} {...props} />\n\t</li>\n);\n\nGlobalNavigationButton.displayName = GLOBAL_NAVIGATION_BAR_BUTTON;\n\nexport default GlobalNavigationButton;\n"],"mappings":";;;;;AA8BA,IAAM,KAA0B,EAC/B,eAAY,yDACZ,WAAQ,EAAE,YAAY,UAAU,GAChC,aAAU,QACV,WACA,oBACA,GAAG,QAEH,kBAAC,MAAD;CACC,WAAW,EAAW,0BAA0B;EAC/C,kBAAkB;GACjB,kCAAkC,MAAoB;CACxD,CAAC;CAED,UAAA,kBAAC,GAAD;EAAmB;EAAkB;EAAgB;EAAS,GAAI;CAAQ,CAAA;AACvE,CAAA;AAGL,EAAuB,cAAc"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import e from "../../utilities/warning/sunset-property.js";
|
|
2
|
-
import t from "../../utilities/get-component-doc.js";
|
|
3
|
-
//#region components/global-navigation-bar/check-props.js
|
|
4
|
-
var n = function() {};
|
|
5
|
-
process.env.NODE_ENV !== "production" && (n = function(n, r, i) {
|
|
6
|
-
let a = t(i);
|
|
7
|
-
typeof r.assistiveText == "string" && e(n, r.assistiveText, "assistiveText", `\`assistiveText\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \`assistiveText.icon\` instead. ${a("assistiveText")}`);
|
|
8
|
-
});
|
|
9
|
-
var r = n;
|
|
10
|
-
//#endregion
|
|
11
|
-
export { r as default };
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=check-props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-props.js","names":[],"sources":["../../../../components/global-navigation-bar/check-props.js"],"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/* eslint-disable import/no-mutable-exports */\n\nimport sunsetProperty from '../../utilities/warning/sunset-property';\nimport getComponentDocFn from '../../utilities/get-component-doc';\n\nlet checkProps = function checkPropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tcheckProps = function checkPropsFunction(COMPONENT, props, jsonDoc) {\n\t\tconst createDocUrl = getComponentDocFn(jsonDoc);\n\n\t\tif (typeof props.assistiveText === 'string') {\n\t\t\tsunsetProperty(\n\t\t\t\tCOMPONENT,\n\t\t\t\tprops.assistiveText,\n\t\t\t\t'assistiveText',\n\t\t\t\t`\\`assistiveText\\` as a string has been deprecated and is now an object to allow for multiple uses in the component. Please use \\`assistiveText.icon\\` instead. ${createDocUrl(\n\t\t\t\t\t'assistiveText'\n\t\t\t\t)}`\n\t\t\t);\n\t\t}\n\t};\n}\n\nexport default checkProps;\n"],"mappings":";;;AAOA,IAAI,IAAa,WAA8B,CAAC;AAEhD,QAAA,IAAA,aAA6B,iBAC5B,IAAa,SAA4B,GAAW,GAAO,GAAS;CACnE,IAAM,IAAe,EAAkB,CAAO;CAE9C,AAAI,OAAO,EAAM,iBAAkB,YAClC,EACC,GACA,EAAM,eACN,iBACA,kKAAkK,EACjK,eACD,GACD;AAEF;AAGD,IAAA,IAAe"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
//#region components/global-navigation-bar/component.json
|
|
2
|
-
var e = "global-navigation-bar", t = "prod", n = "GlobalNavigationBar", r = [
|
|
3
|
-
{
|
|
4
|
-
component: "button",
|
|
5
|
-
classKey: "GlobalNavigationBarButton"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
component: "dropdown",
|
|
9
|
-
classKey: "GlobalNavigationBarDropdown"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
component: "label",
|
|
13
|
-
classKey: "GlobalNavigationBarLabel"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
component: "link",
|
|
17
|
-
classKey: "GlobalNavigationBarLink"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
component: "region",
|
|
21
|
-
classKey: "GlobalNavigationBarRegion"
|
|
22
|
-
}
|
|
23
|
-
], i = {
|
|
24
|
-
component: e,
|
|
25
|
-
status: t,
|
|
26
|
-
"display-name": "Global Navigation Bar",
|
|
27
|
-
classKey: n,
|
|
28
|
-
"last-accessibility-review": {
|
|
29
|
-
"date-iso-8601": "2017/05/02",
|
|
30
|
-
"commit-sha": "ad6b6c6523ee21cada11be5f7ea4d99abc530726"
|
|
31
|
-
},
|
|
32
|
-
"SLDS-component-path": "/components/global-navigation",
|
|
33
|
-
dependencies: r,
|
|
34
|
-
"site-stories": [{
|
|
35
|
-
heading: "Default",
|
|
36
|
-
path: "/__examples__/default.jsx"
|
|
37
|
-
}],
|
|
38
|
-
"url-slug": "global-navigation-bar"
|
|
39
|
-
};
|
|
40
|
-
//#endregion
|
|
41
|
-
export { n as classKey, e as component, i as default, r as dependencies, t as status };
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","names":[],"sources":["../../../../components/global-navigation-bar/component.json"],"sourcesContent":["{\n\t\"component\": \"global-navigation-bar\",\n\t\"status\": \"prod\",\n\t\"display-name\": \"Global Navigation Bar\",\n\t\"classKey\": \"GlobalNavigationBar\",\n\t\"last-accessibility-review\": {\n\t\t\"date-iso-8601\": \"2017/05/02\",\n\t\t\"commit-sha\": \"ad6b6c6523ee21cada11be5f7ea4d99abc530726\"\n\t},\n\t\"SLDS-component-path\": \"/components/global-navigation\",\n\t\"dependencies\": [\n\t\t{\n\t\t\t\"component\": \"button\",\n\t\t\t\"classKey\": \"GlobalNavigationBarButton\"\n\t\t},\n\t\t{\n\t\t\t\"component\": \"dropdown\",\n\t\t\t\"classKey\": \"GlobalNavigationBarDropdown\"\n\t\t},\n\t\t{\n\t\t\t\"component\": \"label\",\n\t\t\t\"classKey\": \"GlobalNavigationBarLabel\"\n\t\t},\n\t\t{\n\t\t\t\"component\": \"link\",\n\t\t\t\"classKey\": \"GlobalNavigationBarLink\"\n\t\t},\n\t\t{\n\t\t\t\"component\": \"region\",\n\t\t\t\"classKey\": \"GlobalNavigationBarRegion\"\n\t\t}\n\t],\n\t\"site-stories\": [\n\t\t{\n\t\t\t\"heading\": \"Default\",\n\t\t\t\"path\": \"/__examples__/default.jsx\"\n\t\t}\n\t],\n\t\"url-slug\": \"global-navigation-bar\"\n}\n"],"mappings":""}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { MENU_DROPDOWN_TRIGGER as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "../button/index.js";
|
|
3
|
-
import n from "../../utilities/design-tokens/dist/salesforce-skin.common.js";
|
|
4
|
-
import r from "./check-props.js";
|
|
5
|
-
import i from "./component.js";
|
|
6
|
-
import a from "react";
|
|
7
|
-
import o from "classnames";
|
|
8
|
-
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
-
//#region components/global-navigation-bar/dropdown-trigger.tsx
|
|
10
|
-
var l = class extends a.Component {
|
|
11
|
-
static displayName = e;
|
|
12
|
-
static defaultProps = { assistiveText: { icon: "Open menu item submenu" } };
|
|
13
|
-
constructor(t) {
|
|
14
|
-
super(t), r(e, this.props, i);
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
let { active: e, activeBackgroundColor: r, className: i, dividerPosition: a, id: l, isOpen: u, label: d, menu: f, onBlur: p, onClick: m, onFocus: h, onKeyDown: g, onMouseDown: _, onMouseEnter: v, onMouseLeave: y, triggerRef: b, ...x } = this.props, S = {}, C = n.brandPrimaryTransparent10;
|
|
18
|
-
return e && (S.backgroundColor = r, S.borderBottomColor = r), u && (S.backgroundColor = C), /* @__PURE__ */ c("li", {
|
|
19
|
-
"aria-haspopup": "true",
|
|
20
|
-
className: o("slds-context-bar__item slds-context-bar__dropdown-trigger slds-dropdown-trigger slds-dropdown-trigger_click", {
|
|
21
|
-
"slds-is-open": u,
|
|
22
|
-
"slds-is-active": e,
|
|
23
|
-
[`slds-context-bar__item_divider-${a}`]: a
|
|
24
|
-
}, i),
|
|
25
|
-
id: l,
|
|
26
|
-
onBlur: p,
|
|
27
|
-
onClick: m,
|
|
28
|
-
onFocus: h,
|
|
29
|
-
onKeyDown: g,
|
|
30
|
-
onMouseDown: _,
|
|
31
|
-
onMouseEnter: v,
|
|
32
|
-
onMouseLeave: y,
|
|
33
|
-
ref: b,
|
|
34
|
-
style: S,
|
|
35
|
-
children: [
|
|
36
|
-
/* @__PURE__ */ s("a", {
|
|
37
|
-
className: "slds-context-bar__label-action",
|
|
38
|
-
title: d,
|
|
39
|
-
children: /* @__PURE__ */ s("span", {
|
|
40
|
-
className: "slds-truncate",
|
|
41
|
-
title: d,
|
|
42
|
-
children: d
|
|
43
|
-
})
|
|
44
|
-
}),
|
|
45
|
-
/* @__PURE__ */ s("div", {
|
|
46
|
-
className: "slds-context-bar__icon-action slds-p-left_none",
|
|
47
|
-
children: /* @__PURE__ */ s(t, {
|
|
48
|
-
assistiveText: this.props.assistiveText,
|
|
49
|
-
...x,
|
|
50
|
-
className: "slds-context-bar__button",
|
|
51
|
-
"aria-haspopup": "true",
|
|
52
|
-
iconCategory: "utility",
|
|
53
|
-
iconName: "chevrondown",
|
|
54
|
-
iconVariant: "bare",
|
|
55
|
-
variant: "icon"
|
|
56
|
-
})
|
|
57
|
-
}),
|
|
58
|
-
f
|
|
59
|
-
]
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
//#endregion
|
|
64
|
-
export { l as default };
|
|
65
|
-
|
|
66
|
-
//# sourceMappingURL=dropdown-trigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-trigger.js","names":[],"sources":["../../../../components/global-navigation-bar/dropdown-trigger.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\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\n\n// # Global Navigation Dropdown Component\n\n// ## Dependencies\n\n// ### React\nimport React, { type ReactNode, type CSSProperties } from 'react';\n\n// ### classNames\nimport classNames from 'classnames';\n\nimport colors from '../../utilities/design-tokens/dist/salesforce-skin.common.js';\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\nimport Button from '../button';\n\n// ## Constants\nimport { MENU_DROPDOWN_TRIGGER } from '../../utilities/constants';\n\nexport interface GlobalNavigationDropdownTriggerAssistiveText {\n\ticon?: string;\n}\n\nexport interface GlobalNavigationDropdownTriggerProps {\n\t/**\n\t * Whether the item is active or not.\n\t */\n\tactive?: boolean;\n\t/**\n\t * Allows alignment of active item with active application background color.\n\t */\n\tactiveBackgroundColor?: string;\n\t/**\n\t * **Assistive text for accessibility.**\n\t * This object is merged with the default props object on every render.\n\t * * `icon`: Text that is visually hidden but read aloud by screenreaders to tell the user what the icon means. If the button has an icon and a visible label, you can omit the <code>assistiveText.icon</code> prop and use the <code>label</code> prop.\n\t */\n\tassistiveText?: GlobalNavigationDropdownTriggerAssistiveText;\n\t/**\n\t * CSS classes to be added to the 'li'.\n\t */\n\tclassName?: unknown[] | Record<string, unknown> | string;\n\t/**\n\t * Determines position of separating bar.\n\t */\n\tdividerPosition?: 'left' | 'right';\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the dropdown to the triggering button.\n\t */\n\tid?: string;\n\t/**\n\t * Allows the dropdown menu to style itself accordingly when open since CSS hover rules cannot take effect if the menu is not inline.\n\t */\n\tisOpen?: boolean;\n\t/**\n\t * Visible label on the dropdown menu trigger button.\n\t */\n\tlabel?: string;\n\t/**\n\t * The dropdown menu.\n\t */\n\tmenu?: ReactNode;\n\t/**\n\t * Is only called when `openOn` is set to `hover` and when the triggering li loses focus.\n\t */\n\tonBlur?: React.FocusEventHandler<HTMLLIElement>;\n\t/**\n\t * This prop is passed onto the triggering `li`. Triggered when the trigger li is clicked.\n\t */\n\tonClick?: React.MouseEventHandler<HTMLLIElement>;\n\t/**\n\t * Is only called when `openOn` is set to `hover` and when the triggering li gains focus.\n\t */\n\tonFocus?: React.FocusEventHandler<HTMLLIElement>;\n\t/**\n\t * Called when a key pressed.\n\t */\n\tonKeyDown?: React.KeyboardEventHandler<HTMLLIElement>;\n\t/**\n\t * Called when mouse clicks down on the trigger `li`.\n\t */\n\tonMouseDown?: React.MouseEventHandler<HTMLLIElement>;\n\t/**\n\t * Called when mouse hovers over the trigger `li`.\n\t */\n\tonMouseEnter?: React.MouseEventHandler<HTMLLIElement>;\n\t/**\n\t * Called when mouse leaves trigger `li` or the menu.\n\t */\n\tonMouseLeave?: React.MouseEventHandler<HTMLLIElement>;\n\t/**\n\t * The ref of the actual triggering button.\n\t */\n\ttriggerRef?: React.Ref<HTMLLIElement>;\n\t[key: string]: unknown;\n}\n\n/**\n * The Dropdown Button Trigger renders the default trigger button for the dropdown menu. If this component has children, it does not render itself to the DOM. Instead, it renders its child element, `Button`, and all that child's properties. This component may be used as a template to create custom triggers that do not use `Button`.\n */\nclass GlobalNavigationDropdownTrigger extends React.Component<GlobalNavigationDropdownTriggerProps> {\n\t// ### Display Name\n\t// Always use the canonical component name (set in the core) as the React\n\t// display name.\n\tstatic displayName = MENU_DROPDOWN_TRIGGER;\n\n\tstatic defaultProps: Partial<GlobalNavigationDropdownTriggerProps> = {\n\t\tassistiveText: { icon: 'Open menu item submenu' },\n\t};\n\n\tconstructor(props: GlobalNavigationDropdownTriggerProps) {\n\t\tsuper(props);\n\t\t(\n\t\t\tcheckProps as (\n\t\t\t\tname: string,\n\t\t\t\tprops: unknown,\n\t\t\t\tdoc: unknown\n\t\t\t) => void\n\t\t)(MENU_DROPDOWN_TRIGGER, this.props, componentDoc);\n\t}\n\n\t// ### Render\n\trender() {\n\t\tconst {\n\t\t\tactive,\n\t\t\tactiveBackgroundColor,\n\t\t\tclassName,\n\t\t\tdividerPosition,\n\t\t\tid,\n\t\t\tisOpen,\n\t\t\tlabel,\n\t\t\tmenu,\n\t\t\tonBlur,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonMouseDown,\n\t\t\tonMouseEnter,\n\t\t\tonMouseLeave,\n\t\t\ttriggerRef,\n\t\t\t...rest\n\t\t} = this.props;\n\n\t\tconst listItemstyle: CSSProperties = {};\n\t\t// Uses design token to get correct color\n\t\tconst hoverBackgroundColor = (colors as Record<string, string>)\n\t\t\t.brandPrimaryTransparent10;\n\n\t\tif (active) {\n\t\t\tlistItemstyle.backgroundColor = activeBackgroundColor;\n\t\t\tlistItemstyle.borderBottomColor = activeBackgroundColor;\n\t\t}\n\n\t\t// Per SLDS pattern, set trigger style like hover style, so that hover visuals and menu being open and closed are in same state\n\t\tif (isOpen) {\n\t\t\tlistItemstyle.backgroundColor = hoverBackgroundColor;\n\t\t}\n\n\t\treturn (\n\t\t\t// eslint-disable-next-line jsx-a11y/role-supports-aria-props\n\t\t\t<li\n\t\t\t\taria-haspopup=\"true\"\n\t\t\t\tclassName={classNames(\n\t\t\t\t\t'slds-context-bar__item slds-context-bar__dropdown-trigger slds-dropdown-trigger slds-dropdown-trigger_click',\n\t\t\t\t\t{\n\t\t\t\t\t\t'slds-is-open': isOpen,\n\t\t\t\t\t\t'slds-is-active': active,\n\t\t\t\t\t\t[`slds-context-bar__item_divider-${dividerPosition}`]:\n\t\t\t\t\t\t\tdividerPosition,\n\t\t\t\t\t},\n\t\t\t\t\tclassName as string\n\t\t\t\t)}\n\t\t\t\tid={id}\n\t\t\t\tonBlur={onBlur}\n\t\t\t\tonClick={onClick}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\tonMouseLeave={onMouseLeave}\n\t\t\t\tref={triggerRef}\n\t\t\t\tstyle={listItemstyle}\n\t\t\t>\n\t\t\t\t<a className=\"slds-context-bar__label-action\" title={label}>\n\t\t\t\t\t<span className=\"slds-truncate\" title={label}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</span>\n\t\t\t\t</a>\n\t\t\t\t<div className=\"slds-context-bar__icon-action slds-p-left_none\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tassistiveText={this.props.assistiveText}\n\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\tclassName=\"slds-context-bar__button\"\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\t\ticonName=\"chevrondown\"\n\t\t\t\t\t\ticonVariant=\"bare\"\n\t\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{menu}\n\t\t\t</li>\n\t\t);\n\t}\n}\n\nexport default GlobalNavigationDropdownTrigger;\n"],"mappings":";;;;;;;;;AA0GA,IAAM,IAAN,cAA8C,EAAM,UAAgD;CAInG,OAAO,cAAc;CAErB,OAAO,eAA8D,EACpE,eAAe,EAAE,MAAM,yBAAyB,EACjD;CAEA,YAAY,GAA6C;EAExD,AADA,MAAM,CAAK,GACX,EAME,GAAuB,KAAK,OAAO,CAAY;CAClD;CAGA,SAAS;EACR,IAAM,EACL,WACA,0BACA,cACA,oBACA,OACA,WACA,UACA,SACA,WACA,YACA,YACA,cACA,gBACA,iBACA,iBACA,eACA,GAAG,MACA,KAAK,OAEH,IAA+B,CAAC,GAEhC,IAAwB,EAC5B;EAYF,OAVI,MACH,EAAc,kBAAkB,GAChC,EAAc,oBAAoB,IAI/B,MACH,EAAc,kBAAkB,IAKhC,kBAAC,MAAD;GACC,iBAAc;GACd,WAAW,EACV,+GACA;IACC,gBAAgB;IAChB,kBAAkB;KACjB,kCAAkC,MAClC;GACF,GACA,CACD;GACI;GACI;GACC;GACA;GACE;GACE;GACC;GACA;GACd,KAAK;GACL,OAAO;GArBR,UAAA;IAuBC,kBAAC,KAAD;KAAG,WAAU;KAAiC,OAAO;KACpD,UAAA,kBAAC,QAAD;MAAM,WAAU;MAAgB,OAAO;MACrC,UAAA;KACI,CAAA;IACJ,CAAA;IACH,kBAAC,OAAD;KAAK,WAAU;KACd,UAAA,kBAAC,GAAD;MACC,eAAe,KAAK,MAAM;MAC1B,GAAI;MACJ,WAAU;MACV,iBAAc;MACd,cAAa;MACb,UAAS;MACT,aAAY;MACZ,SAAQ;KACR,CAAA;IACG,CAAA;IACJ;GACE;;CAEN;AACD"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_NAVIGATION_BAR_DROPDOWN as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "../menu-dropdown/index.js";
|
|
3
|
-
import n from "./check-props.js";
|
|
4
|
-
import r from "./component.js";
|
|
5
|
-
import i from "./dropdown-trigger.js";
|
|
6
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
7
|
-
//#region components/global-navigation-bar/dropdown.tsx
|
|
8
|
-
var o = ({ align: o = "right", length: s = null, active: c, activeBackgroundColor: l, assistiveText: u, dividerPosition: d, ...f }) => (n(e, {
|
|
9
|
-
align: o,
|
|
10
|
-
length: s,
|
|
11
|
-
active: c,
|
|
12
|
-
activeBackgroundColor: l,
|
|
13
|
-
assistiveText: u,
|
|
14
|
-
dividerPosition: d,
|
|
15
|
-
...f
|
|
16
|
-
}, r), /* @__PURE__ */ a(t, {
|
|
17
|
-
align: "right",
|
|
18
|
-
hasStaticAlignment: !0,
|
|
19
|
-
hoverCloseDelay: 400,
|
|
20
|
-
length: s ?? void 0,
|
|
21
|
-
menuPosition: "relative",
|
|
22
|
-
...f,
|
|
23
|
-
children: /* @__PURE__ */ a(i, {
|
|
24
|
-
active: c,
|
|
25
|
-
assistiveText: u,
|
|
26
|
-
activeBackgroundColor: l,
|
|
27
|
-
dividerPosition: d
|
|
28
|
-
})
|
|
29
|
-
}));
|
|
30
|
-
o.displayName = e;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { o as default };
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=dropdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","names":[],"sources":["../../../../components/global-navigation-bar/dropdown.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\n// # Global Navigation Dropdown Component\n\n// ## Dependencies\n\nimport checkProps from './check-props';\nimport componentDoc from './component.json';\n\n// ### Dropdown\nimport MenuDropdown, { type MenuDropdownOption } from '../menu-dropdown';\nimport GlobalNavigationTrigger from './dropdown-trigger';\n\n// ## Constants\nimport { GLOBAL_NAVIGATION_BAR_DROPDOWN } from '../../utilities/constants';\n\nexport interface GlobalNavigationBarDropdownAssistiveText {\n\ticon?: string;\n}\n\nexport interface GlobalNavigationBarDropdownProps {\n\t/**\n\t * Whether the item is active or not.\n\t */\n\tactive?: boolean;\n\t/**\n\t * Allows alignment of active item with active application background color.\n\t */\n\tactiveBackgroundColor?: string;\n\t/**\n\t * **Assistive text for accessibility.**\n\t * This object is merged with the default props object on every render.\n\t * * `icon`: Text that is visually hidden but read aloud by screenreaders to tell the user what the icon means. If the button has an icon and a visible label, you can omit the <code>assistiveText.icon</code> prop and use the <code>label</code> prop.\n\t */\n\tassistiveText?: GlobalNavigationBarDropdownAssistiveText;\n\t/**\n\t * Aligns the right or left side of the menu with the respective side of the trigger. This is not intended for use with `nubbinPosition`.\n\t */\n\talign?: 'left' | 'right';\n\t/**\n\t * Extra classnames to apply to the dropdown menu.\n\t */\n\tclassName?: string;\n\t/**\n\t * Determines position of separating bar.\n\t */\n\tdividerPosition?: 'left' | 'right';\n\t/**\n\t * CSS classes to be added to `li` element.\n\t */\n\tbuttonClassName?: string[] | Record<string, boolean> | string;\n\t/**\n\t * A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the dropdown to the triggering button.\n\t */\n\tid?: string;\n\t/**\n\t * Provided to List to indicate number of items visible in the List. Pass `null` to display all items, or a string containing one of the numeric option values listed under [Dropdown Height](https://www.lightningdesignsystem.com/components/menus/#flavor-dropdown-height) at the right (eg. '5').\n\t */\n\tlength?: null | '5' | '7' | '10';\n\t/**\n\t * Offset adds pixels to the absolutely positioned dropdown menu in the format: ([vertical]px [horizontal]px).\n\t */\n\toffset?: string;\n\t/**\n\t * Triggered when an item in the menu is clicked.\n\t */\n\tonSelect?: (...args: unknown[]) => void;\n\t/**\n\t * An array of menu item.\n\t */\n\toptions: MenuDropdownOption[];\n\t[key: string]: unknown;\n}\n\n/**\n * This component is an implementation of `MenuDropdown` with a custom trigger. All the properties listed below are provided to the `MenuDropdown` component. Any additional properties are provided to the Custom Trigger (that is the `Button` or `li` tag).\n */\nconst GlobalNavigationBarDropdown = ({\n\talign = 'right',\n\tlength = null,\n\tactive,\n\tactiveBackgroundColor,\n\tassistiveText,\n\tdividerPosition,\n\t...rest\n}: GlobalNavigationBarDropdownProps) => {\n\t(checkProps as (name: string, props: unknown, doc: unknown) => void)(\n\t\tGLOBAL_NAVIGATION_BAR_DROPDOWN,\n\t\t{\n\t\t\talign,\n\t\t\tlength,\n\t\t\tactive,\n\t\t\tactiveBackgroundColor,\n\t\t\tassistiveText,\n\t\t\tdividerPosition,\n\t\t\t...rest,\n\t\t},\n\t\tcomponentDoc\n\t);\n\n\treturn (\n\t\t<MenuDropdown\n\t\t\talign=\"right\"\n\t\t\thasStaticAlignment\n\t\t\t// only need if using hybrid or hover\n\t\t\thoverCloseDelay={400}\n\t\t\tlength={length ?? undefined}\n\t\t\tmenuPosition=\"relative\"\n\t\t\t{...rest}\n\t\t>\n\t\t\t<GlobalNavigationTrigger\n\t\t\t\tactive={active}\n\t\t\t\tassistiveText={assistiveText}\n\t\t\t\tactiveBackgroundColor={activeBackgroundColor}\n\t\t\t\tdividerPosition={dividerPosition}\n\t\t\t/>\n\t\t</MenuDropdown>\n\t);\n};\n\n// ### Display Name\n// Always use the canonical component name (set in the core) as the React\n// display name.\nGlobalNavigationBarDropdown.displayName = GLOBAL_NAVIGATION_BAR_DROPDOWN;\n\nexport default GlobalNavigationBarDropdown;\n"],"mappings":";;;;;;;AA8EA,IAAM,KAA+B,EACpC,WAAQ,SACR,YAAS,MACT,WACA,0BACA,kBACA,oBACA,GAAG,SAEH,EACC,GACA;CACC;CACA;CACA;CACA;CACA;CACA;CACA,GAAG;AACJ,GACA,CACD,GAGC,kBAAC,GAAD;CACC,OAAM;CACN,oBAAA;CAEA,iBAAiB;CACjB,QAAQ,KAAU,KAAA;CAClB,cAAa;CACb,GAAI;CAEJ,UAAA,kBAAC,GAAD;EACS;EACO;EACQ;EACN;CACjB,CAAA;AACY,CAAA;AAOhB,EAA4B,cAAc"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { GLOBAL_NAVIGATION_BAR as e } from "../../utilities/constants.js";
|
|
2
|
-
import t from "react";
|
|
3
|
-
import n from "classnames";
|
|
4
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
-
//#region components/global-navigation-bar/index.tsx
|
|
6
|
-
var i = (e) => {
|
|
7
|
-
let n, r = [], i;
|
|
8
|
-
t.Children.forEach(e, (e) => {
|
|
9
|
-
if (e && t.isValidElement(e) && e.type.displayName === "SLDSGlobalNavigationBarRegion") {
|
|
10
|
-
let t = e.props;
|
|
11
|
-
t.region === "primary" ? n = e : t.region === "secondary" ? r.push(e) : t.region === "tertiary" && (i = e);
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
let a = [];
|
|
15
|
-
return n && a.push(n), a.push(...r), i && a.push(i), a;
|
|
16
|
-
}, a = ({ children: e, className: t, cloud: a, theme: o }) => /* @__PURE__ */ r("div", {
|
|
17
|
-
className: n("slds-context-bar", {
|
|
18
|
-
[`slds-context-bar_theme-${a}`]: a,
|
|
19
|
-
[`slds-context-bar_theme-${o}`]: o
|
|
20
|
-
}, t),
|
|
21
|
-
children: i(e)
|
|
22
|
-
});
|
|
23
|
-
a.displayName = e;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { a as default };
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/global-navigation-bar/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 ReactElement } from 'react';\nimport classNames from 'classnames';\nimport {\n\tGLOBAL_NAVIGATION_BAR,\n\tGLOBAL_NAVIGATION_BAR_REGION,\n} from '../../utilities/constants';\n\n/**\n * Theme options for GlobalNavigationBar\n */\nexport type GlobalNavigationBarTheme = 'light' | 'dark';\n\n/**\n * Region type for child components\n */\nexport type GlobalNavigationBarRegionType = 'primary' | 'secondary' | 'tertiary';\n\n/**\n * Props for region child components\n */\nexport interface GlobalNavigationBarRegionProps {\n\tregion?: GlobalNavigationBarRegionType;\n}\n\n/**\n * Props for the GlobalNavigationBar component\n */\nexport interface GlobalNavigationBarProps {\n\t/** Navigation bar items */\n\tchildren?: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Cloud name for theming (e.g., \"sales\", \"marketing\") */\n\tcloud?: string;\n\t/** Theme for text and interactions */\n\ttheme?: GlobalNavigationBarTheme;\n}\n\n/**\n * Audit and organize children by region\n */\nconst auditChildren = (children: ReactNode): ReactElement[] => {\n\tlet primaryRegion: ReactElement | undefined;\n\tconst secondaryRegions: ReactElement[] = [];\n\tlet tertiaryRegion: ReactElement | undefined;\n\n\tReact.Children.forEach(children, (child) => {\n\t\tif (child && React.isValidElement(child)) {\n\t\t\tconst displayName = (child.type as { displayName?: string }).displayName;\n\t\t\tif (displayName === GLOBAL_NAVIGATION_BAR_REGION) {\n\t\t\t\tconst childProps = child.props as GlobalNavigationBarRegionProps;\n\t\t\t\tif (childProps.region === 'primary') {\n\t\t\t\t\tprimaryRegion = child;\n\t\t\t\t} else if (childProps.region === 'secondary') {\n\t\t\t\t\tsecondaryRegions.push(child);\n\t\t\t\t} else if (childProps.region === 'tertiary') {\n\t\t\t\t\ttertiaryRegion = child;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tconst result: ReactElement[] = [];\n\tif (primaryRegion) result.push(primaryRegion);\n\tresult.push(...secondaryRegions);\n\tif (tertiaryRegion) result.push(tertiaryRegion);\n\n\treturn result;\n};\n\n/**\n * Global Navigation Bar represents a list of links that either take the user\n * to another page or parts of the page the user is in.\n */\nconst GlobalNavigationBar = ({\n\tchildren,\n\tclassName,\n\tcloud,\n\ttheme,\n}: GlobalNavigationBarProps): React.ReactElement => (\n\t<div\n\t\tclassName={classNames(\n\t\t\t'slds-context-bar',\n\t\t\t{\n\t\t\t\t[`slds-context-bar_theme-${cloud}`]: cloud,\n\t\t\t\t[`slds-context-bar_theme-${theme}`]: theme,\n\t\t\t},\n\t\t\tclassName as string\n\t\t)}\n\t>\n\t\t{auditChildren(children)}\n\t</div>\n);\n\nGlobalNavigationBar.displayName = GLOBAL_NAVIGATION_BAR;\n\nexport default GlobalNavigationBar;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"],"mappings":";;;;;AA4CA,IAAM,KAAiB,MAAwC;CAC9D,IAAI,GACE,IAAmC,CAAC,GACtC;CAEJ,EAAM,SAAS,QAAQ,IAAW,MAAU;EAC3C,IAAI,KAAS,EAAM,eAAe,CAAK,KACjB,EAAM,KAAkC,gBAAA,iCACX;GACjD,IAAM,IAAa,EAAM;GACzB,AAAI,EAAW,WAAW,YACzB,IAAgB,IACN,EAAW,WAAW,cAChC,EAAiB,KAAK,CAAK,IACjB,EAAW,WAAW,eAChC,IAAiB;EAEnB;CAEF,CAAC;CAED,IAAM,IAAyB,CAAC;CAKhC,OAJI,KAAe,EAAO,KAAK,CAAa,GAC5C,EAAO,KAAK,GAAG,CAAgB,GAC3B,KAAgB,EAAO,KAAK,CAAc,GAEvC;AACR,GAMM,KAAuB,EAC5B,aACA,cACA,UACA,eAEA,kBAAC,OAAD;CACC,WAAW,EACV,oBACA;GACE,0BAA0B,MAAU;GACpC,0BAA0B,MAAU;CACtC,GACA,CACD;CAEC,UAAA,EAAc,CAAQ;AACnB,CAAA;AAGN,EAAoB,cAAc"}
|