@salesforce/design-system-react 11.0.0-alpha.4 → 11.0.0-alpha.5
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/README.md +112 -70
- package/dist/cjs/components/accordion/index.cjs +1 -1
- package/dist/cjs/components/accordion/index.cjs.map +1 -1
- package/dist/cjs/components/alert/index.cjs +1 -1
- package/dist/cjs/components/alert/index.cjs.map +1 -1
- package/dist/cjs/components/avatar/index.cjs +1 -1
- package/dist/cjs/components/avatar/index.cjs.map +1 -1
- package/dist/cjs/components/badge/index.cjs +1 -1
- package/dist/cjs/components/badge/index.cjs.map +1 -1
- package/dist/cjs/components/breadcrumb/index.cjs +1 -1
- package/dist/cjs/components/breadcrumb/index.cjs.map +1 -1
- package/dist/cjs/components/builder-header/index.cjs +1 -1
- package/dist/cjs/components/builder-header/index.cjs.map +1 -1
- package/dist/cjs/components/button/index.cjs +1 -1
- package/dist/cjs/components/button/index.cjs.map +1 -1
- package/dist/cjs/components/button-group/index.cjs +1 -1
- package/dist/cjs/components/button-group/index.cjs.map +1 -1
- package/dist/cjs/components/button-stateful/index.cjs +1 -1
- package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
- package/dist/cjs/components/card/index.cjs +1 -1
- package/dist/cjs/components/card/index.cjs.map +1 -1
- package/dist/cjs/components/carousel/index.cjs +1 -1
- package/dist/cjs/components/carousel/index.cjs.map +1 -1
- package/dist/cjs/components/checkbox/index.cjs +1 -1
- package/dist/cjs/components/checkbox/index.cjs.map +1 -1
- package/dist/cjs/components/color-picker/index.cjs +1 -0
- package/dist/cjs/components/color-picker.cjs +1 -0
- package/dist/cjs/components/combobox/index.cjs +1 -1
- package/dist/cjs/components/combobox/index.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/docked-composer/index.cjs +1 -1
- package/dist/cjs/components/docked-composer/index.cjs.map +1 -1
- package/dist/cjs/components/dynamic-icon/index.cjs +1 -1
- package/dist/cjs/components/dynamic-icon/index.cjs.map +1 -1
- package/dist/cjs/components/expandable-section/index.cjs +1 -1
- package/dist/cjs/components/expandable-section/index.cjs.map +1 -1
- package/dist/cjs/components/files/index.cjs +1 -1
- package/dist/cjs/components/files/index.cjs.map +1 -1
- package/dist/cjs/components/filter/index.cjs +1 -0
- package/dist/cjs/components/filter.cjs +1 -0
- package/dist/cjs/components/grid/index.cjs +2 -0
- package/dist/cjs/components/grid/index.cjs.map +1 -0
- package/dist/cjs/components/grid.cjs +1 -0
- package/dist/cjs/components/icon/index.cjs +1 -1
- package/dist/cjs/components/icon/index.cjs.map +1 -1
- package/dist/cjs/components/icon-settings/index.cjs +1 -1
- package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
- package/dist/cjs/components/illustration/index.cjs +1 -1
- package/dist/cjs/components/illustration/index.cjs.map +1 -1
- package/dist/cjs/components/input/index.cjs +1 -1
- package/dist/cjs/components/input/index.cjs.map +1 -1
- package/dist/cjs/components/media-object/index.cjs +1 -1
- package/dist/cjs/components/media-object/index.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/index.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/index.cjs.map +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs +1 -1
- package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
- package/dist/cjs/components/modal/index.cjs +1 -1
- package/dist/cjs/components/modal/index.cjs.map +1 -1
- package/dist/cjs/components/page-header/index.cjs +1 -1
- package/dist/cjs/components/page-header/index.cjs.map +1 -1
- package/dist/cjs/components/panel/index.cjs +1 -1
- package/dist/cjs/components/panel/index.cjs.map +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/popover/index.cjs +1 -1
- package/dist/cjs/components/popover/index.cjs.map +1 -1
- package/dist/cjs/components/popover/popover.cjs +1 -1
- package/dist/cjs/components/popover/popover.cjs.map +1 -1
- package/dist/cjs/components/portal-settings/index.cjs +1 -1
- package/dist/cjs/components/portal-settings/index.cjs.map +1 -1
- package/dist/cjs/components/progress-bar/index.cjs +1 -1
- package/dist/cjs/components/progress-bar/index.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/check-props.cjs +2 -0
- package/dist/cjs/components/progress-indicator/check-props.cjs.map +1 -0
- package/dist/cjs/components/progress-indicator/index.cjs +1 -1
- package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/private/path.cjs +2 -0
- package/dist/cjs/components/progress-indicator/private/path.cjs.map +1 -0
- package/dist/cjs/components/progress-indicator/private/progress.cjs +1 -1
- package/dist/cjs/components/progress-indicator/private/progress.cjs.map +1 -1
- package/dist/cjs/components/progress-indicator/private/use-roving-tab-index.cjs +2 -0
- package/dist/cjs/components/progress-indicator/private/use-roving-tab-index.cjs.map +1 -0
- package/dist/cjs/components/progress-ring/index.cjs +1 -1
- package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
- package/dist/cjs/components/radio/index.cjs +1 -1
- package/dist/cjs/components/radio/index.cjs.map +1 -1
- package/dist/cjs/components/radio-button-group/index.cjs +1 -1
- package/dist/cjs/components/radio-button-group/index.cjs.map +1 -1
- package/dist/cjs/components/radio-group/index.cjs +1 -1
- package/dist/cjs/components/radio-group/index.cjs.map +1 -1
- package/dist/cjs/components/scoped-notification/index.cjs +1 -1
- package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
- package/dist/cjs/components/setup-assistant/index.cjs +1 -1
- package/dist/cjs/components/setup-assistant/index.cjs.map +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs +1 -1
- package/dist/cjs/components/simple-data-table/index.cjs.map +1 -1
- package/dist/cjs/components/slider/index.cjs +1 -1
- package/dist/cjs/components/slider/index.cjs.map +1 -1
- package/dist/cjs/components/spinner/index.cjs +1 -1
- package/dist/cjs/components/spinner/index.cjs.map +1 -1
- package/dist/cjs/components/split-view/index.cjs +1 -1
- package/dist/cjs/components/split-view/index.cjs.map +1 -1
- package/dist/cjs/components/tabs/index.cjs +1 -1
- package/dist/cjs/components/tabs/index.cjs.map +1 -1
- package/dist/cjs/components/textarea/index.cjs +1 -1
- package/dist/cjs/components/textarea/index.cjs.map +1 -1
- package/dist/cjs/components/toast/index.cjs +1 -1
- package/dist/cjs/components/toast/index.cjs.map +1 -1
- package/dist/cjs/components/tooltip/index.cjs +2 -2
- package/dist/cjs/components/tooltip/index.cjs.map +1 -1
- package/dist/cjs/components/tree/index.cjs +1 -0
- package/dist/cjs/components/tree.cjs +1 -0
- package/dist/cjs/components/trial-bar/index.cjs +1 -1
- package/dist/cjs/components/trial-bar/index.cjs.map +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs +1 -1
- package/dist/cjs/components/vertical-navigation/index.cjs.map +1 -1
- package/dist/cjs/components/visual-picker/index.cjs +1 -1
- package/dist/cjs/components/visual-picker/index.cjs.map +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs +1 -1
- package/dist/cjs/components/welcome-mat/index.cjs.map +1 -1
- package/dist/cjs/utilities/constants.cjs +1 -1
- package/dist/cjs/utilities/constants.cjs.map +1 -1
- package/dist/cjs/utilities/hooks/index.cjs +1 -0
- package/dist/cjs/utilities/hooks.cjs +1 -0
- package/dist/cjs/utilities/warning/incompatible-props.cjs +2 -0
- package/dist/cjs/utilities/warning/incompatible-props.cjs.map +1 -0
- package/dist/es/components/accordion/index.js +28 -24
- package/dist/es/components/accordion/index.js.map +1 -1
- package/dist/es/components/alert/index.js +14 -14
- package/dist/es/components/alert/index.js.map +1 -1
- package/dist/es/components/badge/index.js +1 -0
- package/dist/es/components/badge/index.js.map +1 -1
- package/dist/es/components/button/index.js +1 -1
- package/dist/es/components/button/index.js.map +1 -1
- package/dist/es/components/button-stateful/index.js +3 -2
- package/dist/es/components/button-stateful/index.js.map +1 -1
- package/dist/es/components/color-picker/index.js +2 -0
- package/dist/es/components/color-picker.js +2 -0
- package/dist/es/components/filter/index.js +2 -0
- package/dist/es/components/filter.js +2 -0
- package/dist/es/components/grid/index.js +31 -0
- package/dist/es/components/grid/index.js.map +1 -0
- package/dist/es/components/grid.js +2 -0
- package/dist/es/components/menu-dropdown/index.js +5 -5
- package/dist/es/components/menu-dropdown/menu-dropdown.js +47 -40
- package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
- package/dist/es/components/page-header/index.js +24 -24
- package/dist/es/components/popover/index.js +3 -3
- package/dist/es/components/popover/popover.js +10 -3
- package/dist/es/components/popover/popover.js.map +1 -1
- package/dist/es/components/progress-indicator/check-props.js +24 -0
- package/dist/es/components/progress-indicator/check-props.js.map +1 -0
- package/dist/es/components/progress-indicator/index.js +80 -38
- package/dist/es/components/progress-indicator/index.js.map +1 -1
- package/dist/es/components/progress-indicator/private/path.js +95 -0
- package/dist/es/components/progress-indicator/private/path.js.map +1 -0
- package/dist/es/components/progress-indicator/private/progress.js +1 -1
- package/dist/es/components/progress-indicator/private/progress.js.map +1 -1
- package/dist/es/components/progress-indicator/private/use-roving-tab-index.js +29 -0
- package/dist/es/components/progress-indicator/private/use-roving-tab-index.js.map +1 -0
- package/dist/es/components/progress-ring/index.js +8 -8
- package/dist/es/components/progress-ring/index.js.map +1 -1
- package/dist/es/components/simple-data-table/index.js +67 -69
- package/dist/es/components/simple-data-table/index.js.map +1 -1
- package/dist/es/components/tooltip/index.js +90 -84
- package/dist/es/components/tooltip/index.js.map +1 -1
- package/dist/es/components/tree/index.js +2 -0
- package/dist/es/components/tree.js +2 -0
- package/dist/es/utilities/constants.js +2 -2
- package/dist/es/utilities/constants.js.map +1 -1
- package/dist/es/utilities/hooks/index.js +2 -0
- package/dist/es/utilities/hooks.js +1 -0
- package/dist/es/utilities/warning/incompatible-props.js +19 -0
- package/dist/es/utilities/warning/incompatible-props.js.map +1 -0
- package/dist/types/components/accordion/index.d.ts.map +1 -1
- package/dist/types/components/alert/index.d.ts.map +1 -1
- package/dist/types/components/badge/index.d.ts +1 -1
- package/dist/types/components/badge/index.d.ts.map +1 -1
- package/dist/types/components/button/index.d.ts +5 -2
- package/dist/types/components/button/index.d.ts.map +1 -1
- package/dist/types/components/button-stateful/index.d.ts +2 -2
- package/dist/types/components/button-stateful/index.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/check-props.d.ts +3 -0
- package/dist/types/components/progress-indicator/check-props.d.ts.map +1 -0
- package/dist/types/components/progress-indicator/index.d.ts +39 -8
- package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/private/path.d.ts +48 -0
- package/dist/types/components/progress-indicator/private/path.d.ts.map +1 -0
- package/dist/types/components/progress-indicator/private/progress.d.ts.map +1 -1
- package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts +41 -0
- package/dist/types/components/progress-indicator/private/use-roving-tab-index.d.ts.map +1 -0
- package/dist/types/components/simple-data-table/index.d.ts.map +1 -1
- package/dist/types/components/tooltip/index.d.ts +10 -1
- package/dist/types/components/tooltip/index.d.ts.map +1 -1
- package/dist/types/utilities/constants.d.ts +1 -0
- package/dist/types/utilities/constants.d.ts.map +1 -1
- package/dist/types/utilities/hooks/index.d.ts +1 -1
- package/dist/types/utilities/hooks/index.d.ts.map +1 -1
- package/dist/types/utilities/hooks.d.ts +0 -1
- package/dist/types/utilities/sample-data/global-navigation-bar.d.ts +0 -1
- package/dist/types/utilities/sample-data/vertical-navigation.d.ts +0 -1
- package/dist/types/utilities/warning/incompatible-props.d.ts.map +1 -1
- package/package.json +4 -3
- package/dist/cjs/utilities/design-tokens/dist/palette-colors.common.cjs +0 -2
- package/dist/cjs/utilities/design-tokens/dist/palette-colors.common.cjs.map +0 -1
- package/dist/cjs/utilities/design-tokens/dist/salesforce-skin.common.cjs +0 -2
- package/dist/cjs/utilities/design-tokens/dist/salesforce-skin.common.cjs.map +0 -1
- package/dist/es/utilities/design-tokens/dist/palette-colors.common.js +0 -6
- package/dist/es/utilities/design-tokens/dist/palette-colors.common.js.map +0 -1
- package/dist/es/utilities/design-tokens/dist/salesforce-skin.common.js +0 -286
- package/dist/es/utilities/design-tokens/dist/salesforce-skin.common.js.map +0 -1
- package/dist/types/utilities/design-tokens/dist/analytics-cloud.common.d.ts +0 -81
- package/dist/types/utilities/design-tokens/dist/analytics-cloud.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/bg-actions.common.d.ts +0 -201
- package/dist/types/utilities/design-tokens/dist/bg-actions.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/bg-custom.common.d.ts +0 -117
- package/dist/types/utilities/design-tokens/dist/bg-custom.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/bg-icons.common.d.ts +0 -5
- package/dist/types/utilities/design-tokens/dist/bg-icons.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/bg-standard.common.d.ts +0 -204
- package/dist/types/utilities/design-tokens/dist/bg-standard.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/color-palettes.common.d.ts +0 -3
- package/dist/types/utilities/design-tokens/dist/color-palettes.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/components.common.d.ts +0 -249
- package/dist/types/utilities/design-tokens/dist/components.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/console-base.common.d.ts +0 -9
- package/dist/types/utilities/design-tokens/dist/console-base.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/force-base.common.d.ts +0 -647
- package/dist/types/utilities/design-tokens/dist/force-base.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/force-font-commons.common.d.ts +0 -14
- package/dist/types/utilities/design-tokens/dist/force-font-commons.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/force-mq-commons.common.d.ts +0 -10
- package/dist/types/utilities/design-tokens/dist/force-mq-commons.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/icon-paths.common.d.ts +0 -9
- package/dist/types/utilities/design-tokens/dist/icon-paths.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/illustrations.common.d.ts +0 -7
- package/dist/types/utilities/design-tokens/dist/illustrations.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/image-paths.common.d.ts +0 -12
- package/dist/types/utilities/design-tokens/dist/image-paths.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/marketing-cloud.common.d.ts +0 -35
- package/dist/types/utilities/design-tokens/dist/marketing-cloud.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/palette-colors.common.d.ts +0 -98
- package/dist/types/utilities/design-tokens/dist/palette-colors.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/s1-base-large.common.d.ts +0 -15
- package/dist/types/utilities/design-tokens/dist/s1-base-large.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/s1-base-medium.common.d.ts +0 -5
- package/dist/types/utilities/design-tokens/dist/s1-base-medium.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/s1-base-small.common.d.ts +0 -11
- package/dist/types/utilities/design-tokens/dist/s1-base-small.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/s1-base.common.d.ts +0 -21
- package/dist/types/utilities/design-tokens/dist/s1-base.common.d.ts.map +0 -1
- package/dist/types/utilities/design-tokens/dist/salesforce-skin.common.d.ts +0 -283
- package/dist/types/utilities/design-tokens/dist/salesforce-skin.common.d.ts.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=`SLDSAccordion`,t=`SLDSAccordionPanel`,n=`SLDSAlert`,r=`SLDSAlertContainer`,i=`SLDSAvatar`,a=`SLDSBadge`,o=`SLDSBreadcrumb`,s=`SLDSBuilderHeader`,c=`SLDSBuilderHeaderMisc`,l=`SLDSBuilderHeaderUtilities`,u=`SLDSBuilderHeaderNav`,d=`SLDSBuilderHeaderNavDropdown`,f=`SLDSBuilderHeaderNavLink`,p=`SLDSBuilderHeaderToolbar`,m=`SLDSButton`,h=`SLDSButtonGroup`,g=`SLDSButtonStateful`,_=`SLDSButtonIcon`,v=`SLDSCard`,y=`SLDSCardBody`,b=`SLDSCardEmpty`,x=`SLDSCardFilter`,S=`SLDSCardFooter`,C=`SLDSCardHeader`,w=`SLDSCarousel`,T=`SLDSCarouselIndicators`,E=`SLDSCarouselItem`,D=`SLDSCarouselNavigators`,O=`SLDSCarouselAutoplayButton`,k=`SLDSColorPicker`,A=`SLDSCombobox`,j=`SLDSSimpleDataTable`,M=`SLDSSimpleDataTableCell`,N=`SLDSSimpleDataTableColumn`,P=`SLDSSimpleDataTableHead`,F=`SLDSSimpleDataTableHeaderCell`,I=`SLDSSimpleDataTableRowActions`,L=`SLDSSimpleDataTableRow`,R=`SLDSDatePicker`,z=`SLDSDynamicIcon`,B=`SLDSDialog`,V=`SLDSFiles`,H=`SLDSFilesFile`,U=`SLDSFilesMore`,W=`SLDSFilesFigure`,G=`SLDSFilesActions`,K=`SLDSExpandableSection`,q=`SLDSFilter`,J=`SLDSCheckbox`,Y=`SLDSInlineEdit`,X=`SLDSInput`,Z=`SLDSTextarea`,Q=`SLDSSearch`,$=`SLDSHighlighter`,ee=`SLDSIcon`,te=`SLDSIconSettings`,ne=`SLDSIconInput`,re=`SLDSIllustration`,ie=`SLDSList`,ae=`SLDSListItem`,oe=`SLDSListItemLabel`,se=`SLDSLookup`,ce=`SLDSMediaObject`,le=`SLDSMenuDropdown`,ue=`SLDSMenuDropdownTrigger`,de=`SLDSModal`,fe=`SLDSPanel`,pe=`SLDSFilterGroup`,me=`SLDSFilterList`,he=`SLDSPanelFilterListHeading`,ge=`SLDSPageHeader`,_e=`SLDSPageHeaderControl`,ve=`SLDSPill`,ye=`SLDSPillContainer`,be=`SLDSPortalSettings`,xe=`SLDSPopover`,Se=`SLDSPopoverEditDialog`,Ce=`SLDSPopoverTooltip`,we=`SLDSProgressIndicator`,Te=`
|
|
1
|
+
var e=`SLDSAccordion`,t=`SLDSAccordionPanel`,n=`SLDSAlert`,r=`SLDSAlertContainer`,i=`SLDSAvatar`,a=`SLDSBadge`,o=`SLDSBreadcrumb`,s=`SLDSBuilderHeader`,c=`SLDSBuilderHeaderMisc`,l=`SLDSBuilderHeaderUtilities`,u=`SLDSBuilderHeaderNav`,d=`SLDSBuilderHeaderNavDropdown`,f=`SLDSBuilderHeaderNavLink`,p=`SLDSBuilderHeaderToolbar`,m=`SLDSButton`,h=`SLDSButtonGroup`,g=`SLDSButtonStateful`,_=`SLDSButtonIcon`,v=`SLDSCard`,y=`SLDSCardBody`,b=`SLDSCardEmpty`,x=`SLDSCardFilter`,S=`SLDSCardFooter`,C=`SLDSCardHeader`,w=`SLDSCarousel`,T=`SLDSCarouselIndicators`,E=`SLDSCarouselItem`,D=`SLDSCarouselNavigators`,O=`SLDSCarouselAutoplayButton`,k=`SLDSColorPicker`,A=`SLDSCombobox`,j=`SLDSSimpleDataTable`,M=`SLDSSimpleDataTableCell`,N=`SLDSSimpleDataTableColumn`,P=`SLDSSimpleDataTableHead`,F=`SLDSSimpleDataTableHeaderCell`,I=`SLDSSimpleDataTableRowActions`,L=`SLDSSimpleDataTableRow`,R=`SLDSDatePicker`,z=`SLDSDynamicIcon`,B=`SLDSDialog`,V=`SLDSFiles`,H=`SLDSFilesFile`,U=`SLDSFilesMore`,W=`SLDSFilesFigure`,G=`SLDSFilesActions`,K=`SLDSExpandableSection`,q=`SLDSFilter`,J=`SLDSCheckbox`,Y=`SLDSInlineEdit`,X=`SLDSInput`,Z=`SLDSTextarea`,Q=`SLDSSearch`,$=`SLDSHighlighter`,ee=`SLDSIcon`,te=`SLDSIconSettings`,ne=`SLDSIconInput`,re=`SLDSIllustration`,ie=`SLDSList`,ae=`SLDSListItem`,oe=`SLDSListItemLabel`,se=`SLDSLookup`,ce=`SLDSMediaObject`,le=`SLDSMenuDropdown`,ue=`SLDSMenuDropdownTrigger`,de=`SLDSModal`,fe=`SLDSPanel`,pe=`SLDSFilterGroup`,me=`SLDSFilterList`,he=`SLDSPanelFilterListHeading`,ge=`SLDSPageHeader`,_e=`SLDSPageHeaderControl`,ve=`SLDSPill`,ye=`SLDSPillContainer`,be=`SLDSPortalSettings`,xe=`SLDSPopover`,Se=`SLDSPopoverEditDialog`,Ce=`SLDSPopoverTooltip`,we=`SLDSProgressIndicator`,Te=`SLDSProgressIndicatorPath`,Ee=`SLDSProgressIndicatorProgress`,De=`SLDSProgressIndicatorStep`,Oe=`SLDSProgressIndicatorStepVertical`,ke=`SLDSProgressRing`,Ae=`SLDSProgressBar`,je=`SLDSSetupAssistant`,Me=`SLDSSetupAssistantStep`,Ne=`SLDSScopedNotification`,Pe=`SLDSSlider`,Fe=`SLDSSpinner`,Ie=`SLDSSplitView`,Le=`SLDSSplitViewHeader`,Re=`SLDSSplitViewListbox`,ze=`SLDSRadio`,Be=`SLDSRadioGroup`,Ve=`SLDSRadioButtonGroup`,He=`SLDSTab`,Ue=`SLDSTabPanel`,We=`SLDSTabs`,Ge=`SLDSTabsList`,Ke=`SLDSTabsPanel`,qe=`SLDSTimepicker`,Je=`SLDSToast`,Ye=`SLDSToastContainer`,Xe=`SLDSTree`,Ze=`SLDSTreeBranch`,Qe=`SLDSTreeItem`,$e=`SLDSTrialBar`,et=`SLDSTrialBarDropdown`,tt=`SLDSTrialBarButton`,nt=`SLDSVerticalNavigation`,rt=`SLDSVerticalNavigationItem`,it=`SLDSVisualPicker`,at=`SLDSVisualPickerLink`,ot=`SLDSWelcomeMat`,st=`SLDSWelcomeMatTile`,ct=`SLDSWelcomeMatBadge`;exports.ACCORDION=e,exports.ACCORDION_PANEL=t,exports.ALERT=n,exports.ALERT_CONTAINER=r,exports.AVATAR=i,exports.BADGE=a,exports.BREADCRUMB=o,exports.BUILDER_HEADER=s,exports.BUILDER_HEADER_MISC=c,exports.BUILDER_HEADER_NAV=u,exports.BUILDER_HEADER_NAV_DROPDOWN=d,exports.BUILDER_HEADER_NAV_LINK=f,exports.BUILDER_HEADER_TOOLBAR=p,exports.BUILDER_HEADER_UTILITIES=l,exports.BUTTON=m,exports.BUTTON_GROUP=h,exports.BUTTON_ICON=_,exports.BUTTON_STATEFUL=g,exports.CARD=v,exports.CARD_BODY=y,exports.CARD_EMPTY=b,exports.CARD_FILTER=x,exports.CARD_FOOTER=S,exports.CARD_HEADER=C,exports.CAROUSEL=w,exports.CAROUSEL_AUTOPLAY_BUTTON=O,exports.CAROUSEL_INDICATORS=T,exports.CAROUSEL_ITEM=E,exports.CAROUSEL_NAVIGATORS=D,exports.CHECKBOX=J,exports.COLOR_PICKER=k,exports.COMBOBOX=A,exports.DATE_PICKER=R,exports.DIALOG=B,exports.DYNAMIC_ICON=z,exports.EXPANDABLE_SECTION=K,exports.FILES=V,exports.FILES_ACTIONS=G,exports.FILES_FIGURE=W,exports.FILES_FILE=H,exports.FILES_MORE=U,exports.FILTER=q,exports.FORMS_INLINE_EDIT=Y,exports.HIGHLIGHTER=$,exports.ICON=ee,exports.ICON_INPUT=ne,exports.ICON_SETTINGS=te,exports.ILLUSTRATION=re,exports.INPUT=X,exports.LIST=ie,exports.LIST_ITEM=ae,exports.LIST_ITEM_LABEL=oe,exports.LOOKUP=se,exports.MEDIA_OBJECT=ce,exports.MENU_DROPDOWN=le,exports.MENU_DROPDOWN_TRIGGER=ue,exports.MODAL=de,exports.PAGE_HEADER=ge,exports.PAGE_HEADER_CONTROL=_e,exports.PANEL=fe,exports.PANEL_FILTER_GROUP=pe,exports.PANEL_FILTER_LIST=me,exports.PANEL_FILTER_LIST_HEADING=he,exports.PILL=ve,exports.PILL_CONTAINER=ye,exports.POPOVER=xe,exports.POPOVER_EDIT_DIALOG=Se,exports.POPOVER_TOOLTIP=Ce,exports.PORTAL_SETTINGS=be,exports.PROGRESS_BAR=Ae,exports.PROGRESS_INDICATOR=we,exports.PROGRESS_INDICATOR_PATH=Te,exports.PROGRESS_INDICATOR_PROGRESS=Ee,exports.PROGRESS_INDICATOR_STEP=De,exports.PROGRESS_INDICATOR_STEP_VERTICAL=Oe,exports.PROGRESS_RING=ke,exports.RADIO=ze,exports.RADIO_BUTTON_GROUP=Ve,exports.RADIO_GROUP=Be,exports.SCOPED_NOTIFICATION=Ne,exports.SEARCH=Q,exports.SETUP_ASSISTANT=je,exports.SETUP_ASSISTANT_STEP=Me,exports.SIMPLE_DATA_TABLE=j,exports.SIMPLE_DATA_TABLE_CELL=M,exports.SIMPLE_DATA_TABLE_COLUMN=N,exports.SIMPLE_DATA_TABLE_HEAD=P,exports.SIMPLE_DATA_TABLE_HEADER_CELL=F,exports.SIMPLE_DATA_TABLE_ROW=L,exports.SIMPLE_DATA_TABLE_ROW_ACTIONS=I,exports.SLIDER=Pe,exports.SPINNER=Fe,exports.SPLIT_VIEW=Ie,exports.SPLIT_VIEW_HEADER=Le,exports.SPLIT_VIEW_LISTBOX=Re,exports.TAB=He,exports.TABS=We,exports.TABS_LIST=Ge,exports.TABS_PANEL=Ke,exports.TAB_PANEL=Ue,exports.TEXTAREA=Z,exports.TIME_PICKER=qe,exports.TOAST=Je,exports.TOAST_CONTAINER=Ye,exports.TREE=Xe,exports.TREE_BRANCH=Ze,exports.TREE_ITEM=Qe,exports.TRIAL_BAR=$e,exports.TRIAL_BAR_BUTTON=tt,exports.TRIAL_BAR_DROPDOWN=et,exports.VERTICAL_NAVIGATION=nt,exports.VERTICAL_NAVIGATION_ITEM=rt,exports.VISUAL_PICKER=it,exports.VISUAL_PICKER_LINK=at,exports.WELCOME_MAT=ot,exports.WELCOME_MAT_BADGE=ct,exports.WELCOME_MAT_TILE=st;
|
|
2
2
|
//# sourceMappingURL=constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs","names":[],"sources":["../../../utilities/constants.js"],"sourcesContent":["// ## Components\nexport const ACCORDION = 'SLDSAccordion';\nexport const ACCORDION_PANEL = 'SLDSAccordionPanel';\nexport const ALERT = 'SLDSAlert';\nexport const ALERT_CONTAINER = 'SLDSAlertContainer';\nexport const APP_LAUNCHER = 'SLDSAppLauncher';\nexport const APP_LAUNCHER_EXPANDABLE_SECTION =\n\t'SLDSAppLauncherExpandableSection';\n/* Remove at next breaking change */\nexport const APP_LAUNCHER_SECTION = 'SLDSAppLauncherSection';\nexport const APP_LAUNCHER_LINK = 'SLDSAppLauncherLink';\nexport const APP_LAUNCHER_TILE = 'SLDSAppLauncherTile';\nexport const APP_LAUNCHER_HEADER = 'SLDSAppLauncherHeader';\nexport const AVATAR = 'SLDSAvatar';\nexport const BADGE = 'SLDSBadge';\n\nexport const BRAND_BAND = 'SLDSBrandBand';\n\n/* Remove at next breaking change */\nexport const BREAD_CRUMB = 'SLDSBreadcrumb';\n\nexport const BREADCRUMB = 'SLDSBreadcrumb';\nexport const BUILDER_HEADER = 'SLDSBuilderHeader';\nexport const BUILDER_HEADER_MISC = 'SLDSBuilderHeaderMisc';\nexport const BUILDER_HEADER_UTILITIES = 'SLDSBuilderHeaderUtilities';\nexport const BUILDER_HEADER_NAV = 'SLDSBuilderHeaderNav';\nexport const BUILDER_HEADER_NAV_DROPDOWN = 'SLDSBuilderHeaderNavDropdown';\nexport const BUILDER_HEADER_NAV_LINK = 'SLDSBuilderHeaderNavLink';\nexport const BUILDER_HEADER_TOOLBAR = 'SLDSBuilderHeaderToolbar';\nexport const BUTTON = 'SLDSButton';\nexport const BUTTON_GROUP = 'SLDSButtonGroup';\nexport const BUTTON_STATEFUL = 'SLDSButtonStateful';\nexport const BUTTON_ICON = 'SLDSButtonIcon'; // a non-interctive icon wrapper for SLDSUtilityIcon\nexport const CARD = 'SLDSCard';\nexport const CARD_BODY = 'SLDSCardBody';\nexport const CARD_EMPTY = 'SLDSCardEmpty';\nexport const CARD_FILTER = 'SLDSCardFilter';\nexport const CARD_FOOTER = 'SLDSCardFooter';\nexport const CARD_HEADER = 'SLDSCardHeader';\nexport const CAROUSEL = 'SLDSCarousel';\nexport const CAROUSEL_INDICATORS = 'SLDSCarouselIndicators';\nexport const CAROUSEL_ITEM = 'SLDSCarouselItem';\nexport const CAROUSEL_NAVIGATORS = 'SLDSCarouselNavigators';\nexport const CAROUSEL_AUTOPLAY_BUTTON = 'SLDSCarouselAutoplayButton';\nexport const COLOR_PICKER = 'SLDSColorPicker';\nexport const COMBOBOX = 'SLDSCombobox';\nexport const SIMPLE_DATA_TABLE = 'SLDSSimpleDataTable';\nexport const SIMPLE_DATA_TABLE_CELL = 'SLDSSimpleDataTableCell';\nexport const SIMPLE_DATA_TABLE_COLUMN = 'SLDSSimpleDataTableColumn';\nexport const SIMPLE_DATA_TABLE_HEAD = 'SLDSSimpleDataTableHead';\nexport const SIMPLE_DATA_TABLE_HEADER_CELL = 'SLDSSimpleDataTableHeaderCell';\nexport const SIMPLE_DATA_TABLE_ROW_ACTIONS = 'SLDSSimpleDataTableRowActions';\nexport const SIMPLE_DATA_TABLE_ROW = 'SLDSSimpleDataTableRow';\nexport const DATE_PICKER = 'SLDSDatePicker';\nexport const DEPRECATED_WARNING = 'SLDSDeprecatedWarning';\nexport const DYNAMIC_ICON = 'SLDSDynamicIcon';\nexport const DIALOG = 'SLDSDialog';\nexport const FILES = 'SLDSFiles';\nexport const FILES_FILE = `SLDSFilesFile`;\nexport const FILES_MORE = `SLDSFilesMore`;\nexport const FILES_FIGURE = 'SLDSFilesFigure';\nexport const FILES_ACTIONS = 'SLDSFilesActions';\nexport const EXPANDABLE_SECTION = 'SLDSExpandableSection';\nexport const EXPRESSION = 'SLDSExpression';\nexport const EXPRESSION_GROUP = 'SLDSExpressionGroup';\nexport const EXPRESSION_CONDITION = 'SLDSExpressionCondition';\nexport const EXPRESSION_FORMULA = 'SLDSExpressionFormula';\nexport const FILTER = 'SLDSFilter';\nexport const CHECKBOX = 'SLDSCheckbox';\nexport const FORMS_INLINE_EDIT = 'SLDSInlineEdit';\nexport const INPUT = 'SLDSInput';\nexport const TEXTAREA = 'SLDSTextarea';\nexport const SEARCH = 'SLDSSearch';\nexport const GLOBAL_HEADER = 'SLDSGlobalHeader';\nexport const GLOBAL_HEADER_BUTTON = 'SLDSGlobalHeaderButton';\nexport const GLOBAL_HEADER_DROPDOWN = 'SLDSGlobalHeaderDropdown';\nexport const GLOBAL_HEADER_FAVORITES = 'SLDSGlobalHeaderFavorites';\nexport const GLOBAL_HEADER_HELP = 'SLDSGlobalHeaderHelp';\nexport const GLOBAL_HEADER_NOTIFICATIONS = 'SLDSGlobalHeaderNotifications';\nexport const GLOBAL_HEADER_PROFILE = 'SLDSGlobalHeaderProfile';\nexport const GLOBAL_HEADER_SEARCH = 'SLDSGlobalHeaderSearch';\nexport const GLOBAL_HEADER_SETUP = 'SLDSGlobalHeaderSetup';\nexport const GLOBAL_HEADER_TASK = 'SLDSGlobalHeaderTask';\nexport const GLOBAL_HEADER_TOOL = 'SLDSGlobalHeaderTool';\nexport const GLOBAL_NAVIGATION_BAR = 'SLDSGlobalNavigationBar';\nexport const GLOBAL_NAVIGATION_BAR_BUTTON = 'SLDSGlobalNavigationBarButton';\nexport const GLOBAL_NAVIGATION_BAR_DROPDOWN = 'SLDSGlobalNavigationBarDropdown';\nexport const GLOBAL_NAVIGATION_BAR_LABEL = 'SLDSGlobalNavigationBarLabel';\nexport const GLOBAL_NAVIGATION_BAR_LINK = 'SLDSGlobalNavigationBarLink';\nexport const GLOBAL_NAVIGATION_BAR_REGION = 'SLDSGlobalNavigationBarRegion';\nexport const GLOBAL_NAVIGATION_BAR_APP_LAUNCHER =\n\t'SLDSGlobalNavigationBarAppLauncher';\nexport const GRID = 'SLDSGrid';\nexport const HIGHLIGHTER = 'SLDSHighlighter';\nexport const ICON = 'SLDSIcon';\nexport const ICON_SETTINGS = 'SLDSIconSettings';\nexport const ICON_INPUT = 'SLDSIconInput';\nexport const ILLUSTRATION = 'SLDSIllustration';\nexport const LIST = 'SLDSList';\nexport const LIST_ITEM = 'SLDSListItem';\nexport const LIST_ITEM_LABEL = 'SLDSListItemLabel';\nexport const LISTBOX_OF_PILL_OPTIONS = 'SLDSListboxOfPillOptions';\nexport const LOCATION_MAP = 'SLDSLocationMap';\nexport const LOOKUP = 'SLDSLookup';\nexport const MEDIA_OBJECT = 'SLDSMediaObject';\nexport const MENU_DROPDOWN = 'SLDSMenuDropdown';\nexport const MENU_DROPDOWN_TRIGGER = 'SLDSMenuDropdownTrigger';\nexport const MENU_PICKLIST = 'SLDSMenuPicklist';\nexport const MODAL = 'SLDSModal';\nexport const NOTIFICATION = 'SLDSNotification';\nexport const PANEL = 'SLDSPanel';\nexport const PANEL_FILTER_GROUP = 'SLDSFilterGroup';\nexport const PANEL_FILTER_LIST = 'SLDSFilterList';\nexport const PANEL_FILTER_LIST_HEADING = 'SLDSPanelFilterListHeading';\nexport const PAGE_HEADER = 'SLDSPageHeader';\nexport const PAGE_HEADER_CONTROL = 'SLDSPageHeaderControl';\nexport const PILL = 'SLDSPill';\nexport const PILL_CONTAINER = 'SLDSPillContainer';\nexport const PORTAL_SETTINGS = 'SLDSPortalSettings';\nexport const POPOVER = 'SLDSPopover';\nexport const POPOVER_EDIT_DIALOG = 'SLDSPopoverEditDialog';\nexport const POPOVER_TOOLTIP = 'SLDSPopoverTooltip';\nexport const PROGRESS_INDICATOR = 'SLDSProgressIndicator';\nexport const PROGRESS_INDICATOR_PROGRESS = 'SLDSProgressIndicatorProgress';\nexport const PROGRESS_INDICATOR_STEP = 'SLDSProgressIndicatorStep';\nexport const PROGRESS_INDICATOR_STEP_VERTICAL =\n\t'SLDSProgressIndicatorStepVertical';\nexport const PROGRESS_RING = 'SLDSProgressRing';\nexport const PROGRESS_BAR = 'SLDSProgressBar';\nexport const SETUP_ASSISTANT = 'SLDSSetupAssistant';\nexport const SETUP_ASSISTANT_STEP = 'SLDSSetupAssistantStep';\nexport const SCOPED_NOTIFICATION = 'SLDSScopedNotification';\nexport const SLIDER = 'SLDSSlider';\nexport const SPINNER = 'SLDSSpinner';\nexport const SPLIT_VIEW = 'SLDSSplitView';\nexport const SPLIT_VIEW_HEADER = 'SLDSSplitViewHeader';\nexport const SPLIT_VIEW_LISTBOX = 'SLDSSplitViewListbox';\nexport const RADIO = 'SLDSRadio';\nexport const RADIO_GROUP = 'SLDSRadioGroup';\nexport const RADIO_BUTTON_GROUP = 'SLDSRadioButtonGroup';\nexport const TAB = 'SLDSTab';\nexport const TAB_ITEM = 'SLDSTabItem';\nexport const TAB_PANEL = 'SLDSTabPanel';\nexport const TABS = 'SLDSTabs';\nexport const TABS_LIST = 'SLDSTabsList';\nexport const TABS_PANEL = 'SLDSTabsPanel';\nexport const TIME_PICKER = 'SLDSTimepicker';\nexport const TOAST = 'SLDSToast';\nexport const TOAST_CONTAINER = 'SLDSToastContainer';\nexport const TREE = 'SLDSTree';\nexport const TREE_BRANCH = 'SLDSTreeBranch';\nexport const TREE_ITEM = 'SLDSTreeItem';\nexport const TRIAL_BAR = 'SLDSTrialBar';\nexport const TRIAL_BAR_DROPDOWN = 'SLDSTrialBarDropdown';\nexport const TRIAL_BAR_BUTTON = 'SLDSTrialBarButton';\nexport const VERTICAL_NAVIGATION = 'SLDSVerticalNavigation';\nexport const VERTICAL_NAVIGATION_ITEM = 'SLDSVerticalNavigationItem';\nexport const VISUAL_PICKER = 'SLDSVisualPicker';\nexport const VISUAL_PICKER_LINK = 'SLDSVisualPickerLink';\nexport const WELCOME_MAT = 'SLDSWelcomeMat';\nexport const WELCOME_MAT_TILE = 'SLDSWelcomeMatTile';\nexport const WELCOME_MAT_BADGE = 'SLDSWelcomeMatBadge';\nexport const DOCKED_COMPOSER = 'SLDSDockedComposer';\n"],"mappings":"AACA,IAAa,EAAY,gBACZ,EAAkB,qBAClB,EAAQ,YACR,EAAkB,qBASlB,EAAS,aACT,EAAQ,YAOR,EAAa,iBACb,EAAiB,oBACjB,EAAsB,wBACtB,EAA2B,6BAC3B,EAAqB,uBACrB,EAA8B,+BAC9B,EAA0B,2BAC1B,EAAyB,2BACzB,EAAS,aACT,EAAe,kBACf,EAAkB,qBAClB,EAAc,iBACd,EAAO,WACP,EAAY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ACd,GAAmB,qBACnB,GAAoB"}
|
|
1
|
+
{"version":3,"file":"constants.cjs","names":[],"sources":["../../../utilities/constants.js"],"sourcesContent":["// ## Components\nexport const ACCORDION = 'SLDSAccordion';\nexport const ACCORDION_PANEL = 'SLDSAccordionPanel';\nexport const ALERT = 'SLDSAlert';\nexport const ALERT_CONTAINER = 'SLDSAlertContainer';\nexport const APP_LAUNCHER = 'SLDSAppLauncher';\nexport const APP_LAUNCHER_EXPANDABLE_SECTION =\n\t'SLDSAppLauncherExpandableSection';\n/* Remove at next breaking change */\nexport const APP_LAUNCHER_SECTION = 'SLDSAppLauncherSection';\nexport const APP_LAUNCHER_LINK = 'SLDSAppLauncherLink';\nexport const APP_LAUNCHER_TILE = 'SLDSAppLauncherTile';\nexport const APP_LAUNCHER_HEADER = 'SLDSAppLauncherHeader';\nexport const AVATAR = 'SLDSAvatar';\nexport const BADGE = 'SLDSBadge';\n\nexport const BRAND_BAND = 'SLDSBrandBand';\n\n/* Remove at next breaking change */\nexport const BREAD_CRUMB = 'SLDSBreadcrumb';\n\nexport const BREADCRUMB = 'SLDSBreadcrumb';\nexport const BUILDER_HEADER = 'SLDSBuilderHeader';\nexport const BUILDER_HEADER_MISC = 'SLDSBuilderHeaderMisc';\nexport const BUILDER_HEADER_UTILITIES = 'SLDSBuilderHeaderUtilities';\nexport const BUILDER_HEADER_NAV = 'SLDSBuilderHeaderNav';\nexport const BUILDER_HEADER_NAV_DROPDOWN = 'SLDSBuilderHeaderNavDropdown';\nexport const BUILDER_HEADER_NAV_LINK = 'SLDSBuilderHeaderNavLink';\nexport const BUILDER_HEADER_TOOLBAR = 'SLDSBuilderHeaderToolbar';\nexport const BUTTON = 'SLDSButton';\nexport const BUTTON_GROUP = 'SLDSButtonGroup';\nexport const BUTTON_STATEFUL = 'SLDSButtonStateful';\nexport const BUTTON_ICON = 'SLDSButtonIcon'; // a non-interctive icon wrapper for SLDSUtilityIcon\nexport const CARD = 'SLDSCard';\nexport const CARD_BODY = 'SLDSCardBody';\nexport const CARD_EMPTY = 'SLDSCardEmpty';\nexport const CARD_FILTER = 'SLDSCardFilter';\nexport const CARD_FOOTER = 'SLDSCardFooter';\nexport const CARD_HEADER = 'SLDSCardHeader';\nexport const CAROUSEL = 'SLDSCarousel';\nexport const CAROUSEL_INDICATORS = 'SLDSCarouselIndicators';\nexport const CAROUSEL_ITEM = 'SLDSCarouselItem';\nexport const CAROUSEL_NAVIGATORS = 'SLDSCarouselNavigators';\nexport const CAROUSEL_AUTOPLAY_BUTTON = 'SLDSCarouselAutoplayButton';\nexport const COLOR_PICKER = 'SLDSColorPicker';\nexport const COMBOBOX = 'SLDSCombobox';\nexport const SIMPLE_DATA_TABLE = 'SLDSSimpleDataTable';\nexport const SIMPLE_DATA_TABLE_CELL = 'SLDSSimpleDataTableCell';\nexport const SIMPLE_DATA_TABLE_COLUMN = 'SLDSSimpleDataTableColumn';\nexport const SIMPLE_DATA_TABLE_HEAD = 'SLDSSimpleDataTableHead';\nexport const SIMPLE_DATA_TABLE_HEADER_CELL = 'SLDSSimpleDataTableHeaderCell';\nexport const SIMPLE_DATA_TABLE_ROW_ACTIONS = 'SLDSSimpleDataTableRowActions';\nexport const SIMPLE_DATA_TABLE_ROW = 'SLDSSimpleDataTableRow';\nexport const DATE_PICKER = 'SLDSDatePicker';\nexport const DEPRECATED_WARNING = 'SLDSDeprecatedWarning';\nexport const DYNAMIC_ICON = 'SLDSDynamicIcon';\nexport const DIALOG = 'SLDSDialog';\nexport const FILES = 'SLDSFiles';\nexport const FILES_FILE = `SLDSFilesFile`;\nexport const FILES_MORE = `SLDSFilesMore`;\nexport const FILES_FIGURE = 'SLDSFilesFigure';\nexport const FILES_ACTIONS = 'SLDSFilesActions';\nexport const EXPANDABLE_SECTION = 'SLDSExpandableSection';\nexport const EXPRESSION = 'SLDSExpression';\nexport const EXPRESSION_GROUP = 'SLDSExpressionGroup';\nexport const EXPRESSION_CONDITION = 'SLDSExpressionCondition';\nexport const EXPRESSION_FORMULA = 'SLDSExpressionFormula';\nexport const FILTER = 'SLDSFilter';\nexport const CHECKBOX = 'SLDSCheckbox';\nexport const FORMS_INLINE_EDIT = 'SLDSInlineEdit';\nexport const INPUT = 'SLDSInput';\nexport const TEXTAREA = 'SLDSTextarea';\nexport const SEARCH = 'SLDSSearch';\nexport const GLOBAL_HEADER = 'SLDSGlobalHeader';\nexport const GLOBAL_HEADER_BUTTON = 'SLDSGlobalHeaderButton';\nexport const GLOBAL_HEADER_DROPDOWN = 'SLDSGlobalHeaderDropdown';\nexport const GLOBAL_HEADER_FAVORITES = 'SLDSGlobalHeaderFavorites';\nexport const GLOBAL_HEADER_HELP = 'SLDSGlobalHeaderHelp';\nexport const GLOBAL_HEADER_NOTIFICATIONS = 'SLDSGlobalHeaderNotifications';\nexport const GLOBAL_HEADER_PROFILE = 'SLDSGlobalHeaderProfile';\nexport const GLOBAL_HEADER_SEARCH = 'SLDSGlobalHeaderSearch';\nexport const GLOBAL_HEADER_SETUP = 'SLDSGlobalHeaderSetup';\nexport const GLOBAL_HEADER_TASK = 'SLDSGlobalHeaderTask';\nexport const GLOBAL_HEADER_TOOL = 'SLDSGlobalHeaderTool';\nexport const GLOBAL_NAVIGATION_BAR = 'SLDSGlobalNavigationBar';\nexport const GLOBAL_NAVIGATION_BAR_BUTTON = 'SLDSGlobalNavigationBarButton';\nexport const GLOBAL_NAVIGATION_BAR_DROPDOWN = 'SLDSGlobalNavigationBarDropdown';\nexport const GLOBAL_NAVIGATION_BAR_LABEL = 'SLDSGlobalNavigationBarLabel';\nexport const GLOBAL_NAVIGATION_BAR_LINK = 'SLDSGlobalNavigationBarLink';\nexport const GLOBAL_NAVIGATION_BAR_REGION = 'SLDSGlobalNavigationBarRegion';\nexport const GLOBAL_NAVIGATION_BAR_APP_LAUNCHER =\n\t'SLDSGlobalNavigationBarAppLauncher';\nexport const GRID = 'SLDSGrid';\nexport const HIGHLIGHTER = 'SLDSHighlighter';\nexport const ICON = 'SLDSIcon';\nexport const ICON_SETTINGS = 'SLDSIconSettings';\nexport const ICON_INPUT = 'SLDSIconInput';\nexport const ILLUSTRATION = 'SLDSIllustration';\nexport const LIST = 'SLDSList';\nexport const LIST_ITEM = 'SLDSListItem';\nexport const LIST_ITEM_LABEL = 'SLDSListItemLabel';\nexport const LISTBOX_OF_PILL_OPTIONS = 'SLDSListboxOfPillOptions';\nexport const LOCATION_MAP = 'SLDSLocationMap';\nexport const LOOKUP = 'SLDSLookup';\nexport const MEDIA_OBJECT = 'SLDSMediaObject';\nexport const MENU_DROPDOWN = 'SLDSMenuDropdown';\nexport const MENU_DROPDOWN_TRIGGER = 'SLDSMenuDropdownTrigger';\nexport const MENU_PICKLIST = 'SLDSMenuPicklist';\nexport const MODAL = 'SLDSModal';\nexport const NOTIFICATION = 'SLDSNotification';\nexport const PANEL = 'SLDSPanel';\nexport const PANEL_FILTER_GROUP = 'SLDSFilterGroup';\nexport const PANEL_FILTER_LIST = 'SLDSFilterList';\nexport const PANEL_FILTER_LIST_HEADING = 'SLDSPanelFilterListHeading';\nexport const PAGE_HEADER = 'SLDSPageHeader';\nexport const PAGE_HEADER_CONTROL = 'SLDSPageHeaderControl';\nexport const PILL = 'SLDSPill';\nexport const PILL_CONTAINER = 'SLDSPillContainer';\nexport const PORTAL_SETTINGS = 'SLDSPortalSettings';\nexport const POPOVER = 'SLDSPopover';\nexport const POPOVER_EDIT_DIALOG = 'SLDSPopoverEditDialog';\nexport const POPOVER_TOOLTIP = 'SLDSPopoverTooltip';\nexport const PROGRESS_INDICATOR = 'SLDSProgressIndicator';\nexport const PROGRESS_INDICATOR_PATH = 'SLDSProgressIndicatorPath';\nexport const PROGRESS_INDICATOR_PROGRESS = 'SLDSProgressIndicatorProgress';\nexport const PROGRESS_INDICATOR_STEP = 'SLDSProgressIndicatorStep';\nexport const PROGRESS_INDICATOR_STEP_VERTICAL =\n\t'SLDSProgressIndicatorStepVertical';\nexport const PROGRESS_RING = 'SLDSProgressRing';\nexport const PROGRESS_BAR = 'SLDSProgressBar';\nexport const SETUP_ASSISTANT = 'SLDSSetupAssistant';\nexport const SETUP_ASSISTANT_STEP = 'SLDSSetupAssistantStep';\nexport const SCOPED_NOTIFICATION = 'SLDSScopedNotification';\nexport const SLIDER = 'SLDSSlider';\nexport const SPINNER = 'SLDSSpinner';\nexport const SPLIT_VIEW = 'SLDSSplitView';\nexport const SPLIT_VIEW_HEADER = 'SLDSSplitViewHeader';\nexport const SPLIT_VIEW_LISTBOX = 'SLDSSplitViewListbox';\nexport const RADIO = 'SLDSRadio';\nexport const RADIO_GROUP = 'SLDSRadioGroup';\nexport const RADIO_BUTTON_GROUP = 'SLDSRadioButtonGroup';\nexport const TAB = 'SLDSTab';\nexport const TAB_ITEM = 'SLDSTabItem';\nexport const TAB_PANEL = 'SLDSTabPanel';\nexport const TABS = 'SLDSTabs';\nexport const TABS_LIST = 'SLDSTabsList';\nexport const TABS_PANEL = 'SLDSTabsPanel';\nexport const TIME_PICKER = 'SLDSTimepicker';\nexport const TOAST = 'SLDSToast';\nexport const TOAST_CONTAINER = 'SLDSToastContainer';\nexport const TREE = 'SLDSTree';\nexport const TREE_BRANCH = 'SLDSTreeBranch';\nexport const TREE_ITEM = 'SLDSTreeItem';\nexport const TRIAL_BAR = 'SLDSTrialBar';\nexport const TRIAL_BAR_DROPDOWN = 'SLDSTrialBarDropdown';\nexport const TRIAL_BAR_BUTTON = 'SLDSTrialBarButton';\nexport const VERTICAL_NAVIGATION = 'SLDSVerticalNavigation';\nexport const VERTICAL_NAVIGATION_ITEM = 'SLDSVerticalNavigationItem';\nexport const VISUAL_PICKER = 'SLDSVisualPicker';\nexport const VISUAL_PICKER_LINK = 'SLDSVisualPickerLink';\nexport const WELCOME_MAT = 'SLDSWelcomeMat';\nexport const WELCOME_MAT_TILE = 'SLDSWelcomeMatTile';\nexport const WELCOME_MAT_BADGE = 'SLDSWelcomeMatBadge';\nexport const DOCKED_COMPOSER = 'SLDSDockedComposer';\n"],"mappings":"AACA,IAAa,EAAY,gB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GAAc,iBACd,GAAqB,uBACrB,GAAM,UAEN,GAAY,eACZ,GAAO,WACP,GAAY,eACZ,GAAa,gBACb,GAAc,iBACd,GAAQ,YACR,GAAkB,qBAClB,GAAO,WACP,GAAc,iBACd,GAAY,eACZ,GAAY,eACZ,GAAqB,uBACrB,GAAmB,qBACnB,GAAsB,yBACtB,GAA2B,6BAC3B,GAAgB,mBAChB,GAAqB,uBACrB,GAAc,iBACd,GAAmB,qBACnB,GAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./use-click-outside.cjs");exports.useClickOutside=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./hooks/index.cjs');
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs");let t=require("warning");t=e.__toESM(t,1);var n=function(){};process.env.NODE_ENV!==`production`&&(n=function(e,n,r,i,a,o,s){let c=!0;if(n[r]&&n[a]){let e=!i||i.includes(n[r]),t=!o||o.includes(n[a]);c=!(e&&t)}if(!c){let c=s?` ${s}`:``,l=i?` of value \`${n[r]}\``:``,u=o?` of value \`${n[a]}\``:``;(0,t.default)(!1,`[Design System React] ${e} should not be passed prop \`${r}\`${l} along with prop \`${a}\`${u} as they are incompatible.${c}`)}});var r=n;exports.default=r;
|
|
2
|
+
//# sourceMappingURL=incompatible-props.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incompatible-props.cjs","names":[],"sources":["../../../../utilities/warning/incompatible-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\n/* eslint-disable import/no-mutable-exports */\n\n// This function will deliver an error message to the browser console when all of the props passed in are undefined (falsey).\nimport warning from 'warning';\n\nlet incompatibleProps = function incompatiblePropsFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tincompatibleProps = function incompatiblePropsFunction(\n\t\tcontrol,\n\t\tprops,\n\t\tpropOneName,\n\t\tpropOneValues,\n\t\tpropTwoName,\n\t\tpropTwoValues,\n\t\tcomment\n\t) {\n\t\tlet checkPassed = true;\n\n\t\tif (props[propOneName] && props[propTwoName]) {\n\t\t\tconst propOneConditionMet = propOneValues\n\t\t\t\t? propOneValues.includes(props[propOneName])\n\t\t\t\t: true;\n\t\t\tconst propTwoConditionMet = propTwoValues\n\t\t\t\t? propTwoValues.includes(props[propTwoName])\n\t\t\t\t: true;\n\n\t\t\tcheckPassed = !(propOneConditionMet && propTwoConditionMet);\n\t\t}\n\n\t\tif (!checkPassed) {\n\t\t\tconst additionalComment = comment ? ` ${comment}` : '';\n\t\t\tconst incompatibleValueOne = propOneValues\n\t\t\t\t? ` of value \\`${props[propOneName]}\\``\n\t\t\t\t: '';\n\t\t\tconst incompatibleValueTwo = propTwoValues\n\t\t\t\t? ` of value \\`${props[propTwoName]}\\``\n\t\t\t\t: '';\n\n\t\t\t/* eslint-disable max-len */\n\t\t\twarning(\n\t\t\t\tfalse,\n\t\t\t\t`[Design System React] ${control} should not be passed prop \\`${propOneName}\\`${incompatibleValueOne} along with prop \\`${propTwoName}\\`${incompatibleValueTwo} as they are incompatible.${additionalComment}`\n\t\t\t);\n\t\t\t/* eslint-enable max-len */\n\t\t}\n\t};\n}\n\nexport default incompatibleProps;\n"],"mappings":"kGAQA,IAAI,EAAoB,UAAqC,CAAC,EAE9D,QAAA,IAAA,WAA6B,eAC5B,EAAoB,SACnB,EACA,EACA,EACA,EACA,EACA,EACA,EACC,CACD,IAAI,EAAc,GAElB,GAAI,EAAM,IAAgB,EAAM,GAAc,CAC7C,IAAM,EAAsB,IACzB,EAAc,SAAS,EAAM,EAAY,EAEtC,EAAsB,IACzB,EAAc,SAAS,EAAM,EAAY,EAG5C,EAAc,EAAE,GAAuB,EACxC,CAEA,GAAI,CAAC,EAAa,CACjB,IAAM,EAAoB,EAAU,IAAI,IAAY,GAC9C,EAAuB,EAC1B,eAAe,EAAM,GAAa,IAClC,GACG,EAAuB,EAC1B,eAAe,EAAM,GAAa,IAClC,IAGH,EAAA,EAAA,QAAA,CACC,GACA,yBAAyB,EAAQ,+BAA+B,EAAY,IAAI,EAAqB,qBAAqB,EAAY,IAAI,EAAqB,4BAA4B,GAC5L,CAED,CACD,GAGD,IAAA,EAAe"}
|
|
@@ -1,33 +1,37 @@
|
|
|
1
1
|
import { ACCORDION as e } from "../../utilities/constants.js";
|
|
2
|
-
import t, { useCallback as n, useEffect as r, useId as i,
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
2
|
+
import t, { useCallback as n, useEffect as r, useId as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
|
|
3
|
+
import c from "classnames";
|
|
4
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
5
5
|
//#region components/accordion/index.tsx
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
var u = ({ children: e, className: u, id: d }) => {
|
|
7
|
+
let f = i(), p = d || f, [m, h] = s(0), g = o([]), _ = t.Children.count(e), v = o(_);
|
|
8
|
+
a(() => {
|
|
9
|
+
if (v.current === _ || (v.current = _, m === null)) return;
|
|
10
|
+
let e = g.current.findIndex((e) => e === document.activeElement);
|
|
11
|
+
e === -1 ? m > _ - 1 && h(_ > 0 ? _ - 1 : null) : e !== m && h(e);
|
|
12
|
+
}, [_, m]), r(() => {
|
|
13
|
+
m !== null && g.current[m] && g.current[m].focus();
|
|
14
|
+
}, [m]);
|
|
15
|
+
let y = n(() => {
|
|
16
|
+
h(null);
|
|
17
|
+
}, []), b = n((e) => {
|
|
18
|
+
let t = m;
|
|
19
|
+
t === null && (t = g.current.findIndex((t) => t && t.id === e.target.id)), e.key === "ArrowDown" ? (e.preventDefault(), t < _ - 1 ? h(t + 1) : h(0)) : e.key === "ArrowUp" && (e.preventDefault(), h(t > 0 ? t - 1 : _ - 1));
|
|
20
|
+
}, [m, _]), x = n((e, t) => {
|
|
21
|
+
t === null ? delete g.current[e] : g.current[e] = t;
|
|
18
22
|
}, []);
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
name:
|
|
21
|
-
className:
|
|
22
|
-
children: t.Children.map(e, (e) => t.isValidElement(e) ? t.cloneElement(e, {
|
|
23
|
-
refs: { summaryButton:
|
|
24
|
-
onClickSummary:
|
|
25
|
-
onKeyDownSummary:
|
|
23
|
+
return /* @__PURE__ */ l("ul", {
|
|
24
|
+
name: p,
|
|
25
|
+
className: c("slds-accordion", u),
|
|
26
|
+
children: t.Children.map(e, (e, n) => t.isValidElement(e) ? t.cloneElement(e, {
|
|
27
|
+
refs: { summaryButton: (e) => x(n, e) },
|
|
28
|
+
onClickSummary: y,
|
|
29
|
+
onKeyDownSummary: b
|
|
26
30
|
}) : e)
|
|
27
31
|
});
|
|
28
32
|
};
|
|
29
|
-
|
|
33
|
+
u.displayName = e;
|
|
30
34
|
//#endregion
|
|
31
|
-
export {
|
|
35
|
+
export { u as default };
|
|
32
36
|
|
|
33
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/accordion/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\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tuseId,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport { ACCORDION } from '../../utilities/constants';\n\n/**\n * Props for the Accordion component\n */\nexport interface AccordionProps {\n\t/** Accordion panel children */\n\tchildren: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string | number;\n}\n\n/**\n * An accordion allows a user to toggle the display of sections of content.\n * The accordion component wraps accordion panels that can be selected and expanded.\n */\nconst Accordion = ({\n\tchildren,\n\tclassName,\n\tid: propId,\n}: AccordionProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst [currButtonIndex, setCurrButtonIndex] = useState<number | null>(0);\n\tconst summaryButtonsRef = useRef<HTMLButtonElement[]>([]);\n\tconst childCount = React.Children.count(children);\n\n\t// Focus management\n\tuseEffect(() => {\n\t\tif (
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/accordion/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\tuseRef,\n\tuseEffect,\n\tuseLayoutEffect,\n\tuseCallback,\n\tuseId,\n\ttype ReactNode,\n\ttype ReactElement,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport { ACCORDION } from '../../utilities/constants';\n\n/**\n * Props for the Accordion component\n */\nexport interface AccordionProps {\n\t/** Accordion panel children */\n\tchildren: ReactNode;\n\t/** CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** HTML id */\n\tid?: string | number;\n}\n\n/**\n * An accordion allows a user to toggle the display of sections of content.\n * The accordion component wraps accordion panels that can be selected and expanded.\n */\nconst Accordion = ({\n\tchildren,\n\tclassName,\n\tid: propId,\n}: AccordionProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst [currButtonIndex, setCurrButtonIndex] = useState<number | null>(0);\n\tconst summaryButtonsRef = useRef<HTMLButtonElement[]>([]);\n\tconst childCount = React.Children.count(children);\n\n\t// Resync the tracked index whenever the panel count changes (e.g. a panel\n\t// is removed). Removing a panel before the focused one shifts the focused\n\t// button to an earlier index without moving DOM focus off of it, so\n\t// currButtonIndex can end up in range but pointing at the wrong button.\n\t// This has to run in a layout effect rather than during render: refs are\n\t// only reattached to their new positions during the commit that follows\n\t// this render, so summaryButtonsRef.current isn't resynced yet while the\n\t// component function is running.\n\tconst prevChildCountRef = useRef(childCount);\n\tuseLayoutEffect(() => {\n\t\tif (prevChildCountRef.current === childCount) {\n\t\t\treturn;\n\t\t}\n\t\tprevChildCountRef.current = childCount;\n\n\t\tif (currButtonIndex === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst focusedIndex = summaryButtonsRef.current.findIndex(\n\t\t\t(button) => button === document.activeElement\n\t\t);\n\n\t\tif (focusedIndex !== -1) {\n\t\t\tif (focusedIndex !== currButtonIndex) {\n\t\t\t\tsetCurrButtonIndex(focusedIndex);\n\t\t\t}\n\t\t} else if (currButtonIndex > childCount - 1) {\n\t\t\tsetCurrButtonIndex(childCount > 0 ? childCount - 1 : null);\n\t\t}\n\t}, [childCount, currButtonIndex]);\n\n\t// Focus management\n\tuseEffect(() => {\n\t\tif (\n\t\t\tcurrButtonIndex !== null &&\n\t\t\tsummaryButtonsRef.current[currButtonIndex]\n\t\t) {\n\t\t\tsummaryButtonsRef.current[currButtonIndex].focus();\n\t\t}\n\t}, [currButtonIndex]);\n\n\tconst handleClickSummary = useCallback(() => {\n\t\tsetCurrButtonIndex(null);\n\t}, []);\n\n\tconst handleKeyDownSummary = useCallback(\n\t\t(e: KeyboardEvent<HTMLButtonElement>) => {\n\t\t\tlet buttonIndex = currButtonIndex;\n\n\t\t\tif (buttonIndex === null) {\n\t\t\t\tbuttonIndex = summaryButtonsRef.current.findIndex(\n\t\t\t\t\t(el) => el && el.id === (e.target as HTMLElement).id\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (e.key === 'ArrowDown') {\n\t\t\t\te.preventDefault();\n\t\t\t\tif (buttonIndex < childCount - 1) {\n\t\t\t\t\tsetCurrButtonIndex(buttonIndex + 1);\n\t\t\t\t} else {\n\t\t\t\t\tsetCurrButtonIndex(0);\n\t\t\t\t}\n\t\t\t} else if (e.key === 'ArrowUp') {\n\t\t\t\te.preventDefault();\n\t\t\t\tif (buttonIndex > 0) {\n\t\t\t\t\tsetCurrButtonIndex(buttonIndex - 1);\n\t\t\t\t} else {\n\t\t\t\t\tsetCurrButtonIndex(childCount - 1);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[currButtonIndex, childCount]\n\t);\n\n\tconst addSummaryButton = useCallback(\n\t\t(index: number, button: HTMLButtonElement | null) => {\n\t\t\tif (button === null) {\n\t\t\t\tdelete summaryButtonsRef.current[index];\n\t\t\t} else {\n\t\t\t\tsummaryButtonsRef.current[index] = button;\n\t\t\t}\n\t\t},\n\t\t[]\n\t);\n\n\treturn (\n\t\t<ul\n\t\t\t// @ts-expect-error name attribute on ul is non-standard but kept for compatibility\n\t\t\tname={id}\n\t\t\tclassName={classNames('slds-accordion', className as string)}\n\t\t>\n\t\t\t{React.Children.map(children, (child, index) => {\n\t\t\t\tif (React.isValidElement(child)) {\n\t\t\t\t\treturn React.cloneElement(\n\t\t\t\t\t\tchild as ReactElement<{\n\t\t\t\t\t\t\trefs?: {\n\t\t\t\t\t\t\t\tsummaryButton: (button: HTMLButtonElement | null) => void;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tonClickSummary?: () => void;\n\t\t\t\t\t\t\tonKeyDownSummary?: (e: KeyboardEvent<HTMLButtonElement>) => void;\n\t\t\t\t\t\t}>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trefs: {\n\t\t\t\t\t\t\t\tsummaryButton: (button: HTMLButtonElement | null) =>\n\t\t\t\t\t\t\t\t\taddSummaryButton(index, button),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tonClickSummary: handleClickSummary,\n\t\t\t\t\t\t\tonKeyDownSummary: handleKeyDownSummary,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t})}\n\t\t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,KAEjC,EAAkB,QAAQ,KAAS;CAErC,GACA,CAAC,CACF;CAEA,OACC,kBAAC,MAAD;EAEC,MAAM;EACN,WAAW,EAAW,kBAAkB,CAAmB;EAE1D,UAAA,EAAM,SAAS,IAAI,IAAW,GAAO,MACjC,EAAM,eAAe,CAAK,IACtB,EAAM,aACZ,GAOA;GACC,MAAM,EACL,gBAAgB,MACf,EAAiB,GAAO,CAAM,EAChC;GACA,gBAAgB;GAChB,kBAAkB;EACnB,CACD,IAEM,CACP;CACE,CAAA;AAEN;AAEA,EAAU,cAAc"}
|
|
@@ -30,23 +30,23 @@ var p = { closeButton: "Close" }, m = {}, h = {
|
|
|
30
30
|
name: "error"
|
|
31
31
|
})
|
|
32
32
|
}, _ = ({ assistiveText: e, className: i, dismissible: _, icon: v, labels: y, onClickHeadingLink: b, onRequestClose: x, style: S, variant: C = "info" }) => {
|
|
33
|
-
let [w, T] = u(!0), E = l(null), D = {
|
|
33
|
+
let [w, T] = u(!0), E = l(null), D = l(!1), O = {
|
|
34
34
|
...p,
|
|
35
35
|
...e
|
|
36
|
-
},
|
|
36
|
+
}, k = {
|
|
37
37
|
...m,
|
|
38
38
|
...y
|
|
39
39
|
};
|
|
40
40
|
c(() => () => {
|
|
41
|
-
n.returnFocusToStoredElement();
|
|
41
|
+
D.current && n.returnFocusToStoredElement();
|
|
42
42
|
}, []);
|
|
43
|
-
let
|
|
44
|
-
E.current = e, w && e && (n.storeActiveElement(), e.focus(), T(!1));
|
|
45
|
-
}, [w]),
|
|
43
|
+
let A = s((e) => {
|
|
44
|
+
E.current = e, w && e && (n.storeActiveElement(), D.current = !0, e.focus(), T(!1));
|
|
45
|
+
}, [w]), j = v || g[C], M = o.isValidElement(j) ? o.cloneElement(j, {
|
|
46
46
|
containerClassName: "slds-m-right_x-small",
|
|
47
47
|
inverse: !0,
|
|
48
48
|
size: "x-small"
|
|
49
|
-
}) :
|
|
49
|
+
}) : j;
|
|
50
50
|
return /* @__PURE__ */ f("div", {
|
|
51
51
|
className: r("slds-notify slds-notify_alert slds-theme_alert-texture", {
|
|
52
52
|
"slds-theme_info": C === "info",
|
|
@@ -61,26 +61,26 @@ var p = { closeButton: "Close" }, m = {}, h = {
|
|
|
61
61
|
className: "slds-assistive-text",
|
|
62
62
|
children: h[C]
|
|
63
63
|
}),
|
|
64
|
-
|
|
64
|
+
M,
|
|
65
65
|
/* @__PURE__ */ f("h2", { children: [
|
|
66
|
-
|
|
66
|
+
k.heading,
|
|
67
67
|
" ",
|
|
68
|
-
|
|
68
|
+
k.headingLink && /* @__PURE__ */ d("a", {
|
|
69
69
|
onClick: t.trappedHandler(b),
|
|
70
70
|
href: "#",
|
|
71
|
-
children:
|
|
71
|
+
children: k.headingLink
|
|
72
72
|
})
|
|
73
73
|
] }),
|
|
74
74
|
_ && /* @__PURE__ */ d(a, {
|
|
75
|
-
assistiveText: { icon:
|
|
76
|
-
buttonRef:
|
|
75
|
+
assistiveText: { icon: O.closeButton },
|
|
76
|
+
buttonRef: A,
|
|
77
77
|
className: "slds-notify__close",
|
|
78
78
|
iconCategory: "utility",
|
|
79
79
|
iconName: "close",
|
|
80
80
|
iconSize: "medium",
|
|
81
81
|
inverse: !0,
|
|
82
82
|
onClick: x,
|
|
83
|
-
title:
|
|
83
|
+
title: O.closeButton,
|
|
84
84
|
variant: "icon"
|
|
85
85
|
})
|
|
86
86
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/alert/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, { useState, useRef, useEffect, useCallback, type ReactNode, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { ALERT } from '../../utilities/constants';\nimport DOMElementFocus from '../../utilities/dom-element-focus';\nimport EventUtil from '../../utilities/event';\n\n/**\n * Alert variant types\n */\nexport type AlertVariant = 'error' | 'info' | 'offline' | 'warning';\n\n/**\n * Assistive text for Alert\n */\nexport interface AlertAssistiveText {\n\t/** Close button assistive text */\n\tcloseButton?: ReactNode;\n}\n\n/**\n * Labels for Alert\n */\nexport interface AlertLabels {\n\t/** Main heading content */\n\theading?: ReactNode;\n\t/** Link text in heading */\n\theadingLink?: ReactNode;\n}\n\n/**\n * Props for the Alert component\n */\nexport interface AlertProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: AlertAssistiveText;\n\t/** CSS classes for the alert container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Show close button */\n\tdismissible?: boolean;\n\t/** Custom icon (defaults to variant-specific icon) */\n\ticon?: ReactNode;\n\t/** Text labels */\n\tlabels?: AlertLabels;\n\t/** Callback when heading link is clicked */\n\tonClickHeadingLink?: (event: React.MouseEvent) => void;\n\t/** Callback when close button is clicked */\n\tonRequestClose?: (event: React.MouseEvent) => void;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** Alert type/severity */\n\tvariant: AlertVariant;\n}\n\nconst defaultAssistiveText: AlertAssistiveText = {\n\tcloseButton: 'Close',\n};\n\nconst defaultLabels: AlertLabels = {};\n\nconst assistiveTextVariant: Record<AlertVariant, string> = {\n\tinfo: 'info',\n\twarning: 'warning',\n\terror: 'error',\n\toffline: 'offline',\n};\n\nconst defaultIcons: Record<AlertVariant, ReactNode> = {\n\tinfo: <Icon category=\"utility\" name=\"info\" />,\n\toffline: <Icon category=\"utility\" name=\"offline\" />,\n\twarning: <Icon category=\"utility\" name=\"warning\" />,\n\terror: <Icon category=\"utility\" name=\"error\" />,\n};\n\n/**\n * Alert banners communicate a state that affects the entire system, not just a feature or page.\n * It persists over a session and appears without the user initiating the action.\n */\nconst Alert = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tdismissible,\n\ticon: propIcon,\n\tlabels: propLabels,\n\tonClickHeadingLink,\n\tonRequestClose,\n\tstyle,\n\tvariant = 'info',\n}: AlertProps): React.ReactElement => {\n\tconst [isInitialRender, setIsInitialRender] = useState(true);\n\tconst closeButtonRef = useRef<HTMLButtonElement | null>(null);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\t//
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/alert/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, { useState, useRef, useEffect, useCallback, type ReactNode, type CSSProperties } from 'react';\nimport classNames from '../../utilities/class-names';\nimport Button from '../button';\nimport Icon from '../icon';\nimport { ALERT } from '../../utilities/constants';\nimport DOMElementFocus from '../../utilities/dom-element-focus';\nimport EventUtil from '../../utilities/event';\n\n/**\n * Alert variant types\n */\nexport type AlertVariant = 'error' | 'info' | 'offline' | 'warning';\n\n/**\n * Assistive text for Alert\n */\nexport interface AlertAssistiveText {\n\t/** Close button assistive text */\n\tcloseButton?: ReactNode;\n}\n\n/**\n * Labels for Alert\n */\nexport interface AlertLabels {\n\t/** Main heading content */\n\theading?: ReactNode;\n\t/** Link text in heading */\n\theadingLink?: ReactNode;\n}\n\n/**\n * Props for the Alert component\n */\nexport interface AlertProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: AlertAssistiveText;\n\t/** CSS classes for the alert container */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Show close button */\n\tdismissible?: boolean;\n\t/** Custom icon (defaults to variant-specific icon) */\n\ticon?: ReactNode;\n\t/** Text labels */\n\tlabels?: AlertLabels;\n\t/** Callback when heading link is clicked */\n\tonClickHeadingLink?: (event: React.MouseEvent) => void;\n\t/** Callback when close button is clicked */\n\tonRequestClose?: (event: React.MouseEvent) => void;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n\t/** Alert type/severity */\n\tvariant: AlertVariant;\n}\n\nconst defaultAssistiveText: AlertAssistiveText = {\n\tcloseButton: 'Close',\n};\n\nconst defaultLabels: AlertLabels = {};\n\nconst assistiveTextVariant: Record<AlertVariant, string> = {\n\tinfo: 'info',\n\twarning: 'warning',\n\terror: 'error',\n\toffline: 'offline',\n};\n\nconst defaultIcons: Record<AlertVariant, ReactNode> = {\n\tinfo: <Icon category=\"utility\" name=\"info\" />,\n\toffline: <Icon category=\"utility\" name=\"offline\" />,\n\twarning: <Icon category=\"utility\" name=\"warning\" />,\n\terror: <Icon category=\"utility\" name=\"error\" />,\n};\n\n/**\n * Alert banners communicate a state that affects the entire system, not just a feature or page.\n * It persists over a session and appears without the user initiating the action.\n */\nconst Alert = ({\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tdismissible,\n\ticon: propIcon,\n\tlabels: propLabels,\n\tonClickHeadingLink,\n\tonRequestClose,\n\tstyle,\n\tvariant = 'info',\n}: AlertProps): React.ReactElement => {\n\tconst [isInitialRender, setIsInitialRender] = useState(true);\n\tconst closeButtonRef = useRef<HTMLButtonElement | null>(null);\n\tconst hasStoredFocusRef = useRef(false);\n\n\tconst assistiveText = { ...defaultAssistiveText, ...propAssistiveText };\n\tconst labels = { ...defaultLabels, ...propLabels };\n\n\t// Restore focus on unmount, but only if this Alert stored it. The stored\n\t// element is shared with other components (Popover, Toast), so restoring\n\t// unconditionally would take focus they stored.\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tif (hasStoredFocusRef.current) {\n\t\t\t\tDOMElementFocus.returnFocusToStoredElement();\n\t\t\t}\n\t\t};\n\t}, []);\n\n\tconst saveButtonRef = useCallback((component: HTMLButtonElement | null) => {\n\t\tcloseButtonRef.current = component;\n\t\tif (isInitialRender && component) {\n\t\t\tDOMElementFocus.storeActiveElement();\n\t\t\thasStoredFocusRef.current = true;\n\t\t\tcomponent.focus();\n\t\t\tsetIsInitialRender(false);\n\t\t}\n\t}, [isInitialRender]);\n\n\t// Get the icon to display\n\tconst icon = propIcon || defaultIcons[variant];\n\n\tconst clonedIcon = React.isValidElement(icon)\n\t\t? React.cloneElement(icon as React.ReactElement<{ containerClassName?: string; inverse?: boolean; size?: string }>, {\n\t\t\t\tcontainerClassName: 'slds-m-right_x-small',\n\t\t\t\tinverse: true,\n\t\t\t\tsize: 'x-small',\n\t\t })\n\t\t: icon;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-notify slds-notify_alert slds-theme_alert-texture',\n\t\t\t\t{\n\t\t\t\t\t'slds-theme_info': variant === 'info',\n\t\t\t\t\t'slds-theme_warning': variant === 'warning',\n\t\t\t\t\t'slds-theme_error': variant === 'error',\n\t\t\t\t\t'slds-theme_offline': variant === 'offline',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t\trole=\"alert\"\n\t\t\tstyle={style}\n\t\t>\n\t\t\t<span className=\"slds-assistive-text\">\n\t\t\t\t{assistiveTextVariant[variant]}\n\t\t\t</span>\n\t\t\t{clonedIcon}\n\t\t\t<h2>\n\t\t\t\t{labels.heading}{' '}\n\t\t\t\t{labels.headingLink && (\n\t\t\t\t\t<a\n\t\t\t\t\t\tonClick={EventUtil.trappedHandler(onClickHeadingLink)}\n\t\t\t\t\t\thref=\"#\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{labels.headingLink}\n\t\t\t\t\t</a>\n\t\t\t\t)}\n\t\t\t</h2>\n\t\t\t{dismissible && (\n\t\t\t\t<Button\n\t\t\t\t\tassistiveText={{ icon: assistiveText.closeButton as string }}\n\t\t\t\t\tbuttonRef={saveButtonRef}\n\t\t\t\t\tclassName=\"slds-notify__close\"\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"close\"\n\t\t\t\t\ticonSize=\"medium\"\n\t\t\t\t\tinverse\n\t\t\t\t\tonClick={onRequestClose}\n\t\t\t\t\ttitle={assistiveText.closeButton as string}\n\t\t\t\t\tvariant=\"icon\"\n\t\t\t\t/>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nAlert.displayName = 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B,MAAY;GAChC,sBAAsB,MAAY;EACnC,GACA,CACD;EACA,MAAK;EACE;EAZR,UAAA;GAcC,kBAAC,QAAD;IAAM,WAAU;IACd,UAAA,EAAqB;GACjB,CAAA;GACL;GACD,kBAAC,MAAD,EAAA,UAAA;IACE,EAAO;IAAS;IAChB,EAAO,eACP,kBAAC,KAAD;KACC,SAAS,EAAU,eAAe,CAAkB;KACpD,MAAK;KAEJ,UAAA,EAAO;IACN,CAAA;GAED,EAAA,CAAA;GACH,KACA,kBAAC,GAAD;IACC,eAAe,EAAE,MAAM,EAAc,YAAsB;IAC3D,WAAW;IACX,WAAU;IACV,cAAa;IACb,UAAS;IACT,UAAS;IACT,SAAA;IACA,SAAS;IACT,OAAO,EAAc;IACrB,SAAQ;GACR,CAAA;EAEE;;AAEP;AAEA,EAAM,cAAc"}
|
|
@@ -14,6 +14,7 @@ var o = ({ className: e, color: o = "default", content: s, icon: c, iconAlignmen
|
|
|
14
14
|
className: n("slds-badge", {
|
|
15
15
|
"slds-badge_inverse": o === "inverse",
|
|
16
16
|
"slds-badge_lightest": o === "light",
|
|
17
|
+
"slds-theme_info": o === "info",
|
|
17
18
|
"slds-theme_success": o === "success",
|
|
18
19
|
"slds-theme_warning": o === "warning",
|
|
19
20
|
"slds-theme_error": o === "error"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/badge/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, { useId, type ReactNode, type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { BADGE } from '../../utilities/constants';\n\n/**\n * Badge color variants\n */\nexport type BadgeColor
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/badge/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, { useId, type ReactNode, type CSSProperties } from 'react';\nimport classNames from 'classnames';\nimport { BADGE } from '../../utilities/constants';\n\n/**\n * Badge color variants\n */\nexport type BadgeColor =\n\t'default' | 'inverse' | 'light' | 'info' | 'success' | 'warning' | 'error';\n\n/**\n * Badge icon alignment\n */\nexport type BadgeIconAlignment = 'left' | 'right';\n\n/**\n * Props for the Badge component\n */\nexport interface BadgeProps {\n\t/** CSS classes for the badge */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Color variant */\n\tcolor?: BadgeColor;\n\t/** Content inside the badge */\n\tcontent?: ReactNode;\n\t/** Icon to display */\n\ticon?: ReactNode;\n\t/** Icon alignment relative to content */\n\ticonAlignment?: BadgeIconAlignment;\n\t/** Unique identifier */\n\tid?: string;\n\t/** Custom styles */\n\tstyle?: CSSProperties;\n}\n\n/**\n * Badges are labels which hold small amounts of information.\n */\nconst Badge = ({\n\tclassName,\n\tcolor = 'default',\n\tcontent,\n\ticon,\n\ticonAlignment = 'left',\n\tid: propId,\n\tstyle,\n}: BadgeProps): React.ReactElement => {\n\tconst generatedId = useId();\n\tconst id = propId || generatedId;\n\n\tconst iconElement = icon && (\n\t\t<span\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-badge__icon',\n\t\t\t\t`slds-badge__icon_${iconAlignment}`\n\t\t\t)}\n\t\t\tstyle={style}\n\t\t>\n\t\t\t{icon}\n\t\t</span>\n\t);\n\n\treturn (\n\t\t<span\n\t\t\tid={id}\n\t\t\tclassName={classNames(\n\t\t\t\t'slds-badge',\n\t\t\t\t{\n\t\t\t\t\t'slds-badge_inverse': color === 'inverse',\n\t\t\t\t\t'slds-badge_lightest': color === 'light',\n\t\t\t\t\t'slds-theme_info': color === 'info',\n\t\t\t\t\t'slds-theme_success': color === 'success',\n\t\t\t\t\t'slds-theme_warning': color === 'warning',\n\t\t\t\t\t'slds-theme_error': color === 'error',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t)}\n\t\t>\n\t\t\t{iconAlignment === 'left' ? (\n\t\t\t\t<>\n\t\t\t\t\t{iconElement}\n\t\t\t\t\t{content}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{content}\n\t\t\t\t\t{iconElement}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</span>\n\t);\n};\n\nBadge.displayName = BADGE;\n\nexport default Badge;\n"],"mappings":";;;;;AAyCA,IAAM,KAAS,EACd,cACA,WAAQ,WACR,YACA,SACA,mBAAgB,QAChB,IAAI,GACJ,eACqC;CACrC,IAAM,IAAc,EAAM,GACpB,IAAK,KAAU,GAEf,IAAc,KACnB,kBAAC,QAAD;EACC,WAAW,EACV,oBACA,oBAAoB,GACrB;EACO;EAEN,UAAA;CACI,CAAA;CAGP,OACC,kBAAC,QAAD;EACK;EACJ,WAAW,EACV,cACA;GACC,sBAAsB,MAAU;GAChC,uBAAuB,MAAU;GACjC,mBAAmB,MAAU;GAC7B,sBAAsB,MAAU;GAChC,sBAAsB,MAAU;GAChC,oBAAoB,MAAU;EAC/B,GACA,CACD;EAEC,UAAA,MAAkB,SAClB,kBAAA,GAAA,EAAA,UAAA,CACE,GACA,CACA,EAAA,CAAA,IAEF,kBAAA,GAAA,EAAA,UAAA,CACE,GACA,CACA,EAAA,CAAA;CAEE,CAAA;AAER;AAEA,EAAM,cAAc"}
|
|
@@ -30,7 +30,7 @@ var f = { icon: "" }, p = o((e, o) => {
|
|
|
30
30
|
}, X = (e) => {
|
|
31
31
|
A && A(e, { id: E });
|
|
32
32
|
}, Z = (e) => {
|
|
33
|
-
let n = !w || T ? void 0 : w;
|
|
33
|
+
let n = !w || T || w === "xx-small" ? void 0 : w;
|
|
34
34
|
return /* @__PURE__ */ u(t, {
|
|
35
35
|
category: y || "utility",
|
|
36
36
|
className: l({ "slds-global-header__icon": T === "global-header" }, b),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/button/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\n// Implements the [Button design pattern](https://lightningdesignsystem.com/components/buttons/) in React.\n\nimport React, {\n\tuseEffect,\n\tuseRef,\n\tforwardRef,\n\ttype MouseEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype CSSProperties,\n\ttype ReactNode,\n\ttype ForwardedRef,\n} from 'react';\nimport classNames from 'classnames';\n// These imports use the old JSX files for now until they're converted\nimport ButtonIcon from '../icon/button-icon/index.jsx';\nimport Tooltip from '../tooltip/index.jsx';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport getDataProps from '../../utilities/get-data-props';\nimport getFormProps from '../../utilities/get-form-props';\nimport { BUTTON } from '../../utilities/constants';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Button variant types\n */\nexport type ButtonVariant =\n\t| 'base'\n\t| 'link'\n\t| 'neutral'\n\t| 'brand'\n\t| 'outline-brand'\n\t| 'destructive'\n\t| 'success'\n\t| 'text-destructive'\n\t| 'icon';\n\n/**\n * Button icon variant types\n */\nexport type ButtonIconVariant =\n\t| 'bare'\n\t| 'container'\n\t| 'border'\n\t| 'border-filled'\n\t| 'brand'\n\t| 'more'\n\t| 'global-header';\n\n/**\n * Button icon size types\n */\nexport type ButtonIconSize = 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset';\n\n/**\n * Icon position relative to label\n */\nexport type IconPosition = 'left' | 'right';\n\n/**\n * Assistive text for button\n */\nexport interface ButtonAssistiveText {\n\ticon?: string;\n}\n\n/**\n * Props for the Button component\n */\nexport interface ButtonProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ButtonAssistiveText | string;\n\t/** Callback for DOM reference */\n\tbuttonRef?: (ref: HTMLButtonElement | null) => void;\n\t/** Additional CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Child elements */\n\tchildren?: ReactNode;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Hint styling for icon buttons */\n\thint?: boolean;\n\t/** Icon category */\n\ticonCategory?: IconCategory;\n\t/** CSS classes for icon */\n\ticonClassName?: string | string[] | Record<string, boolean>;\n\t/** Icon name */\n\ticonName?: string;\n\t/** Direct path to icon sprite */\n\ticonPath?: string;\n\t/** Icon position */\n\ticonPosition?: IconPosition;\n\t/** Icon size */\n\ticonSize?: ButtonIconSize;\n\t/** Icon variant */\n\ticonVariant?: ButtonIconVariant;\n\t/** Unique identifier */\n\tid?: string;\n\t/** Inverse colors for dark backgrounds */\n\tinverse?: boolean;\n\t/** Visible button label */\n\tlabel?: ReactNode;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Click event handler */\n\tonClick?: (event: MouseEvent<HTMLButtonElement>, data?: { id?: string }) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Mouse down event handler */\n\tonMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse enter event handler */\n\tonMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse leave event handler */\n\tonMouseLeave?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse up event handler */\n\tonMouseUp?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Request focus callback */\n\tonRequestFocus?: (element: HTMLButtonElement) => void;\n\t/** Trigger onRequestFocus */\n\trequestFocus?: boolean;\n\t/** Responsive width on small screens */\n\tresponsive?: boolean;\n\t/** Custom inline styles */\n\tstyle?: CSSProperties;\n\t/** Tab index */\n\ttabIndex?: number | string;\n\t/** HTML title attribute */\n\ttitle?: string;\n\t/** Tooltip content (deprecated) */\n\ttooltip?: ReactNode;\n\t/** Button type attribute */\n\ttype?: ButtonType;\n\t/** Button variant */\n\tvariant?: ButtonVariant;\n\t/** Allow any additional props for aria-*, data-*, form* */\n\t[key: `aria-${string}`]: string | boolean | undefined;\n\t[key: `data-${string}`]: string | number | boolean | undefined;\n\t[key: `form${string}`]: string | undefined;\n}\n\nconst defaultAssistiveText: ButtonAssistiveText = { icon: '' };\n\n/**\n * The Button component is the Lightning Design System Button component.\n * Use for label buttons, icon buttons, or buttons with both labels and icons.\n *\n * Either a `label` or `assistiveText.icon` is required for accessibility.\n * For buttons that maintain selected/unselected states, use ButtonStateful.\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n\t(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) => {\n\t\tconst {\n\t\t\tassistiveText = defaultAssistiveText,\n\t\t\tbuttonRef,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled = false,\n\t\t\thint = false,\n\t\t\ticonCategory,\n\t\t\ticonClassName,\n\t\t\ticonName,\n\t\t\ticonPath,\n\t\t\ticonPosition,\n\t\t\ticonSize = 'medium',\n\t\t\ticonVariant,\n\t\t\tid,\n\t\t\tinverse,\n\t\t\tlabel,\n\t\t\tonBlur,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonMouseDown,\n\t\t\tonMouseEnter,\n\t\t\tonMouseLeave,\n\t\t\tonMouseUp,\n\t\t\tonRequestFocus,\n\t\t\trequestFocus,\n\t\t\tstyle,\n\t\t\ttabIndex,\n\t\t\ttitle,\n\t\t\ttooltip,\n\t\t\ttype = 'button',\n\t\t\tvariant = 'neutral',\n\t\t\t...restProps\n\t\t} = props;\n\n\t\tconst internalRef = useRef<HTMLButtonElement | null>(null);\n\n\t\tuseEffect(() => {\n\t\t\tif (requestFocus && onRequestFocus && internalRef.current) {\n\t\t\t\tonRequestFocus(internalRef.current);\n\t\t\t}\n\t\t}, [requestFocus, onRequestFocus]);\n\n\t\tconst getClassName = (): string => {\n\t\t\tconst isIcon = variant === 'icon';\n\t\t\tlet computedIconVariant = iconVariant;\n\t\t\tconst iconMore = iconVariant === 'more';\n\t\t\tconst iconBorder = iconVariant === 'border';\n\t\t\tconst iconGlobalHeader = iconVariant === 'global-header';\n\n\t\t\tconst showButtonVariant =\n\t\t\t\t(variant !== 'base' &&\n\t\t\t\t\t!iconVariant &&\n\t\t\t\t\t!inverse &&\n\t\t\t\t\tvariant !== 'link') ||\n\t\t\t\ticonVariant === 'bare';\n\t\t\tconst plainInverseBtn = inverse && !isIcon;\n\t\t\tconst plainInverseIcon =\n\t\t\t\tinverse && isIcon && !iconMore && !iconBorder;\n\t\t\tconst moreInverseIcon = inverse && iconMore;\n\t\t\tconst borderInverseIcon = inverse && iconBorder;\n\n\t\t\t// Reset to container style for the actual button CSS\n\t\t\tif (iconVariant === 'global-header') {\n\t\t\t\tcomputedIconVariant = 'container';\n\t\t\t}\n\n\t\t\treturn classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-button': variant !== 'link',\n\t\t\t\t\t[`slds-button_${variant}`]: showButtonVariant,\n\t\t\t\t\t'slds-button_inverse': plainInverseBtn,\n\t\t\t\t\t'slds-button_icon-inverse': plainInverseIcon || moreInverseIcon,\n\t\t\t\t\t'slds-button_icon-border-inverse': borderInverseIcon,\n\t\t\t\t\t[`slds-button_icon-${computedIconVariant}`]:\n\t\t\t\t\t\tcomputedIconVariant && !borderInverseIcon,\n\t\t\t\t\t'slds-global-header__button_icon': iconGlobalHeader,\n\t\t\t\t\t[`slds-button_icon-${iconSize}`]:\n\t\t\t\t\t\ticonVariant && iconSize !== 'medium',\n\t\t\t\t\t'slds-button_reset': variant === 'link',\n\t\t\t\t\t'slds-text-link': variant === 'link',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t);\n\t\t};\n\n\t\tconst handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event, { id });\n\t\t\t}\n\t\t};\n\n\t\tconst renderIcon = (name?: string): React.ReactElement => {\n\t\t\tconst computedIconSize =\n\t\t\t\t!iconSize || iconVariant ? undefined : iconSize;\n\t\t\treturn (\n\t\t\t\t<ButtonIcon\n\t\t\t\t\tcategory={iconCategory || 'utility'}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-global-header__icon': iconVariant === 'global-header',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ticonClassName as string\n\t\t\t\t\t)}\n\t\t\t\t\thint={hint}\n\t\t\t\t\tinverse={inverse}\n\t\t\t\t\tname={name}\n\t\t\t\t\tpath={iconPath}\n\t\t\t\t\tposition={iconPosition}\n\t\t\t\t\tsize={computedIconSize}\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\tconst renderLabel = (): ReactNode => {\n\t\t\tconst iconOnly = iconName || iconPath;\n\t\t\tconst assistiveTextIcon =\n\t\t\t\ttypeof assistiveText === 'string'\n\t\t\t\t\t? assistiveText\n\t\t\t\t\t: {\n\t\t\t\t\t\t\t...defaultAssistiveText,\n\t\t\t\t\t\t\t...(assistiveText as ButtonAssistiveText),\n\t\t\t\t\t }.icon;\n\n\t\t\treturn iconOnly && assistiveTextIcon ? (\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveTextIcon}</span>\n\t\t\t) : (\n\t\t\t\tlabel\n\t\t\t);\n\t\t};\n\n\t\tconst renderButton = (): React.ReactElement => {\n\t\t\tconst ariaProps = getAriaProps(restProps);\n\t\t\tconst dataProps = getDataProps(restProps);\n\t\t\tconst formProps = getFormProps(restProps);\n\n\t\t\treturn (\n\t\t\t\t<button\n\t\t\t\t\tclassName={getClassName()}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tid={id}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\t\tonMouseLeave={onMouseLeave}\n\t\t\t\t\tonMouseUp={onMouseUp}\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tinternalRef.current = node;\n\t\t\t\t\t\tif (typeof ref === 'function') {\n\t\t\t\t\t\t\tref(node);\n\t\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\t\tref.current = node;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (buttonRef) {\n\t\t\t\t\t\t\tbuttonRef(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\ttabIndex={typeof tabIndex === 'string' ? parseInt(tabIndex, 10) : tabIndex}\n\t\t\t\t\ttitle={title}\n\t\t\t\t\ttype={type}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t{...dataProps}\n\t\t\t\t\t{...formProps}\n\t\t\t\t>\n\t\t\t\t\t{iconPosition === 'right' ? renderLabel() : null}\n\t\t\t\t\t{iconName || iconPath ? renderIcon(iconName) : null}\n\t\t\t\t\t{iconVariant === 'more' ? (\n\t\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"down\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t\tclassName={iconClassName as string}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{iconPosition === 'left' || !iconPosition ? renderLabel() : null}\n\t\t\t\t\t{children}\n\t\t\t\t</button>\n\t\t\t);\n\t\t};\n\n\t\t// Deprecated: wrap button in tooltip if tooltip prop is provided\n\t\tif (tooltip) {\n\t\t\treturn <Tooltip content={tooltip}>{renderButton()}</Tooltip>;\n\t\t}\n\n\t\treturn renderButton();\n\t}\n);\n\nButton.displayName = BUTTON;\n\nexport default Button;\n"],"mappings":";;;;;;;;;;AA0JA,IAAM,IAA4C,EAAE,MAAM,GAAG,GASvD,IAAS,GACb,GAAoB,MAAyC;CAC7D,IAAM,EACL,mBAAgB,GAChB,cACA,aACA,cACA,cAAW,IACX,UAAO,IACP,iBACA,kBACA,aACA,aACA,iBACA,cAAW,UACX,gBACA,OACA,YACA,UACA,WACA,YACA,YACA,cACA,eACA,YACA,gBACA,iBACA,iBACA,cACA,mBACA,iBACA,UACA,aACA,UACA,YACA,UAAO,UACP,aAAU,WACV,GAAG,MACA,GAEE,IAAc,EAAiC,IAAI;CAEzD,QAAgB;EACf,AAAI,KAAgB,KAAkB,EAAY,WACjD,EAAe,EAAY,OAAO;CAEpC,GAAG,CAAC,GAAc,CAAc,CAAC;CAEjC,IAAM,UAA6B;EAClC,IAAM,IAAS,MAAY,QACvB,IAAsB,GACpB,IAAW,MAAgB,QAC3B,IAAa,MAAgB,UAC7B,IAAmB,MAAgB,iBAEnC,IACJ,MAAY,UACZ,CAAC,KACD,CAAC,KACD,MAAY,UACb,MAAgB,QACX,IAAkB,KAAW,CAAC,GAC9B,IACL,KAAW,KAAU,CAAC,KAAY,CAAC,GAC9B,IAAkB,KAAW,GAC7B,IAAoB,KAAW;EAOrC,OAJI,MAAgB,oBACnB,IAAsB,cAGhB,EACN;GACC,eAAe,MAAY;IAC1B,eAAe,MAAY;GAC5B,uBAAuB;GACvB,4BAA4B,KAAoB;GAChD,mCAAmC;IAClC,oBAAoB,MACpB,KAAuB,CAAC;GACzB,mCAAmC;IAClC,oBAAoB,MACpB,KAAe,MAAa;GAC7B,qBAAqB,MAAY;GACjC,kBAAkB,MAAY;EAC/B,GACA,CACD;CACD,GAEM,KAAe,MAA+C;EACnE,AAAI,KACH,EAAQ,GAAO,EAAE,MAAG,C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
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/button/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\n// Implements the [Button design pattern](https://lightningdesignsystem.com/components/buttons/) in React.\n\nimport React, {\n\tuseEffect,\n\tuseRef,\n\tforwardRef,\n\ttype MouseEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n\ttype CSSProperties,\n\ttype ReactNode,\n\ttype ForwardedRef,\n} from 'react';\nimport classNames from 'classnames';\n// These imports use the old JSX files for now until they're converted\nimport ButtonIcon from '../icon/button-icon/index.jsx';\nimport Tooltip from '../tooltip/index.jsx';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport getDataProps from '../../utilities/get-data-props';\nimport getFormProps from '../../utilities/get-form-props';\nimport { BUTTON } from '../../utilities/constants';\nimport type { IconCategory } from '../../types/common';\n\n/**\n * Button variant types\n */\nexport type ButtonVariant =\n\t| 'base'\n\t| 'link'\n\t| 'neutral'\n\t| 'brand'\n\t| 'outline-brand'\n\t| 'destructive'\n\t| 'success'\n\t| 'text-destructive'\n\t| 'icon';\n\n/**\n * Button icon variant types\n */\nexport type ButtonIconVariant =\n\t| 'bare'\n\t| 'container'\n\t| 'border'\n\t| 'border-filled'\n\t| 'brand'\n\t| 'more'\n\t| 'global-header';\n\n/**\n * Button icon size types\n */\nexport type ButtonIconSize =\n\t'xx-small' | 'x-small' | 'small' | 'medium' | 'large';\n\n/**\n * Button type attribute\n */\nexport type ButtonType = 'button' | 'submit' | 'reset';\n\n/**\n * Icon position relative to label\n */\nexport type IconPosition = 'left' | 'right';\n\n/**\n * Assistive text for button\n */\nexport interface ButtonAssistiveText {\n\ticon?: string;\n}\n\n/**\n * Props for the Button component\n */\nexport interface ButtonProps {\n\t/** Assistive text for accessibility */\n\tassistiveText?: ButtonAssistiveText | string;\n\t/** Callback for DOM reference */\n\tbuttonRef?: (ref: HTMLButtonElement | null) => void;\n\t/** Additional CSS classes */\n\tclassName?: string | string[] | Record<string, boolean>;\n\t/** Child elements */\n\tchildren?: ReactNode;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Hint styling for icon buttons */\n\thint?: boolean;\n\t/** Icon category */\n\ticonCategory?: IconCategory;\n\t/** CSS classes for icon */\n\ticonClassName?: string | string[] | Record<string, boolean>;\n\t/** Icon name */\n\ticonName?: string;\n\t/** Direct path to icon sprite */\n\ticonPath?: string;\n\t/** Icon position */\n\ticonPosition?: IconPosition;\n\t/**\n\t * Icon size. With `iconVariant`, sizes the button container (`slds-button_icon-*`); otherwise sizes the SVG (`slds-button__icon_*`).\n\t * `xx-small` requires `iconVariant`, since SLDS only defines it for the button container (matches `lightning-button-icon`).\n\t */\n\ticonSize?: ButtonIconSize;\n\t/** Icon variant */\n\ticonVariant?: ButtonIconVariant;\n\t/** Unique identifier */\n\tid?: string;\n\t/** Inverse colors for dark backgrounds */\n\tinverse?: boolean;\n\t/** Visible button label */\n\tlabel?: ReactNode;\n\t/** Blur event handler */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Click event handler */\n\tonClick?: (\n\t\tevent: MouseEvent<HTMLButtonElement>,\n\t\tdata?: { id?: string }\n\t) => void;\n\t/** Focus event handler */\n\tonFocus?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Key down event handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key press event handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key up event handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Mouse down event handler */\n\tonMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse enter event handler */\n\tonMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse leave event handler */\n\tonMouseLeave?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse up event handler */\n\tonMouseUp?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Request focus callback */\n\tonRequestFocus?: (element: HTMLButtonElement) => void;\n\t/** Trigger onRequestFocus */\n\trequestFocus?: boolean;\n\t/** Responsive width on small screens */\n\tresponsive?: boolean;\n\t/** Custom inline styles */\n\tstyle?: CSSProperties;\n\t/** Tab index */\n\ttabIndex?: number | string;\n\t/** HTML title attribute */\n\ttitle?: string;\n\t/** Tooltip content (deprecated) */\n\ttooltip?: ReactNode;\n\t/** Button type attribute */\n\ttype?: ButtonType;\n\t/** Button variant */\n\tvariant?: ButtonVariant;\n\t/** Allow any additional props for aria-*, data-*, form* */\n\t[key: `aria-${string}`]: string | boolean | undefined;\n\t[key: `data-${string}`]: string | number | boolean | undefined;\n\t[key: `form${string}`]: string | undefined;\n}\n\nconst defaultAssistiveText: ButtonAssistiveText = { icon: '' };\n\n/**\n * The Button component is the Lightning Design System Button component.\n * Use for label buttons, icon buttons, or buttons with both labels and icons.\n *\n * Either a `label` or `assistiveText.icon` is required for accessibility.\n * For buttons that maintain selected/unselected states, use ButtonStateful.\n */\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(\n\t(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) => {\n\t\tconst {\n\t\t\tassistiveText = defaultAssistiveText,\n\t\t\tbuttonRef,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tdisabled = false,\n\t\t\thint = false,\n\t\t\ticonCategory,\n\t\t\ticonClassName,\n\t\t\ticonName,\n\t\t\ticonPath,\n\t\t\ticonPosition,\n\t\t\ticonSize = 'medium',\n\t\t\ticonVariant,\n\t\t\tid,\n\t\t\tinverse,\n\t\t\tlabel,\n\t\t\tonBlur,\n\t\t\tonClick,\n\t\t\tonFocus,\n\t\t\tonKeyDown,\n\t\t\tonKeyPress,\n\t\t\tonKeyUp,\n\t\t\tonMouseDown,\n\t\t\tonMouseEnter,\n\t\t\tonMouseLeave,\n\t\t\tonMouseUp,\n\t\t\tonRequestFocus,\n\t\t\trequestFocus,\n\t\t\tstyle,\n\t\t\ttabIndex,\n\t\t\ttitle,\n\t\t\ttooltip,\n\t\t\ttype = 'button',\n\t\t\tvariant = 'neutral',\n\t\t\t...restProps\n\t\t} = props;\n\n\t\tconst internalRef = useRef<HTMLButtonElement | null>(null);\n\n\t\tuseEffect(() => {\n\t\t\tif (requestFocus && onRequestFocus && internalRef.current) {\n\t\t\t\tonRequestFocus(internalRef.current);\n\t\t\t}\n\t\t}, [requestFocus, onRequestFocus]);\n\n\t\tconst getClassName = (): string => {\n\t\t\tconst isIcon = variant === 'icon';\n\t\t\tlet computedIconVariant = iconVariant;\n\t\t\tconst iconMore = iconVariant === 'more';\n\t\t\tconst iconBorder = iconVariant === 'border';\n\t\t\tconst iconGlobalHeader = iconVariant === 'global-header';\n\n\t\t\tconst showButtonVariant =\n\t\t\t\t(variant !== 'base' &&\n\t\t\t\t\t!iconVariant &&\n\t\t\t\t\t!inverse &&\n\t\t\t\t\tvariant !== 'link') ||\n\t\t\t\ticonVariant === 'bare';\n\t\t\tconst plainInverseBtn = inverse && !isIcon;\n\t\t\tconst plainInverseIcon = inverse && isIcon && !iconMore && !iconBorder;\n\t\t\tconst moreInverseIcon = inverse && iconMore;\n\t\t\tconst borderInverseIcon = inverse && iconBorder;\n\n\t\t\t// Reset to container style for the actual button CSS\n\t\t\tif (iconVariant === 'global-header') {\n\t\t\t\tcomputedIconVariant = 'container';\n\t\t\t}\n\n\t\t\treturn classNames(\n\t\t\t\t{\n\t\t\t\t\t'slds-button': variant !== 'link',\n\t\t\t\t\t[`slds-button_${variant}`]: showButtonVariant,\n\t\t\t\t\t'slds-button_inverse': plainInverseBtn,\n\t\t\t\t\t'slds-button_icon-inverse': plainInverseIcon || moreInverseIcon,\n\t\t\t\t\t'slds-button_icon-border-inverse': borderInverseIcon,\n\t\t\t\t\t[`slds-button_icon-${computedIconVariant}`]:\n\t\t\t\t\t\tcomputedIconVariant && !borderInverseIcon,\n\t\t\t\t\t'slds-global-header__button_icon': iconGlobalHeader,\n\t\t\t\t\t[`slds-button_icon-${iconSize}`]:\n\t\t\t\t\t\ticonVariant && iconSize !== 'medium',\n\t\t\t\t\t'slds-button_reset': variant === 'link',\n\t\t\t\t\t'slds-text-link': variant === 'link',\n\t\t\t\t},\n\t\t\t\tclassName as string\n\t\t\t);\n\t\t};\n\n\t\tconst handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n\t\t\tif (onClick) {\n\t\t\t\tonClick(event, { id });\n\t\t\t}\n\t\t};\n\n\t\tconst renderIcon = (name?: string): React.ReactElement => {\n\t\t\t// SLDS has no `slds-button__icon_xx-small`; xx-small only sizes the container.\n\t\t\tconst computedIconSize =\n\t\t\t\t!iconSize || iconVariant || iconSize === 'xx-small'\n\t\t\t\t\t? undefined\n\t\t\t\t\t: iconSize;\n\t\t\treturn (\n\t\t\t\t<ButtonIcon\n\t\t\t\t\tcategory={iconCategory || 'utility'}\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'slds-global-header__icon': iconVariant === 'global-header',\n\t\t\t\t\t\t},\n\t\t\t\t\t\ticonClassName as string\n\t\t\t\t\t)}\n\t\t\t\t\thint={hint}\n\t\t\t\t\tinverse={inverse}\n\t\t\t\t\tname={name}\n\t\t\t\t\tpath={iconPath}\n\t\t\t\t\tposition={iconPosition}\n\t\t\t\t\tsize={computedIconSize}\n\t\t\t\t/>\n\t\t\t);\n\t\t};\n\n\t\tconst renderLabel = (): ReactNode => {\n\t\t\tconst iconOnly = iconName || iconPath;\n\t\t\tconst assistiveTextIcon =\n\t\t\t\ttypeof assistiveText === 'string'\n\t\t\t\t\t? assistiveText\n\t\t\t\t\t: {\n\t\t\t\t\t\t\t...defaultAssistiveText,\n\t\t\t\t\t\t\t...(assistiveText as ButtonAssistiveText),\n\t\t\t\t\t\t}.icon;\n\n\t\t\treturn iconOnly && assistiveTextIcon ? (\n\t\t\t\t<span className=\"slds-assistive-text\">{assistiveTextIcon}</span>\n\t\t\t) : (\n\t\t\t\tlabel\n\t\t\t);\n\t\t};\n\n\t\tconst renderButton = (): React.ReactElement => {\n\t\t\tconst ariaProps = getAriaProps(restProps);\n\t\t\tconst dataProps = getDataProps(restProps);\n\t\t\tconst formProps = getFormProps(restProps);\n\n\t\t\treturn (\n\t\t\t\t<button\n\t\t\t\t\tclassName={getClassName()}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tid={id}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\t\tonMouseLeave={onMouseLeave}\n\t\t\t\t\tonMouseUp={onMouseUp}\n\t\t\t\t\tref={(node) => {\n\t\t\t\t\t\tinternalRef.current = node;\n\t\t\t\t\t\tif (typeof ref === 'function') {\n\t\t\t\t\t\t\tref(node);\n\t\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\t\tref.current = node;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (buttonRef) {\n\t\t\t\t\t\t\tbuttonRef(node);\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t\ttabIndex={\n\t\t\t\t\t\ttypeof tabIndex === 'string' ? parseInt(tabIndex, 10) : tabIndex\n\t\t\t\t\t}\n\t\t\t\t\ttitle={title}\n\t\t\t\t\ttype={type}\n\t\t\t\t\tstyle={style}\n\t\t\t\t\t{...ariaProps}\n\t\t\t\t\t{...dataProps}\n\t\t\t\t\t{...formProps}\n\t\t\t\t>\n\t\t\t\t\t{iconPosition === 'right' ? renderLabel() : null}\n\t\t\t\t\t{iconName || iconPath ? renderIcon(iconName) : null}\n\t\t\t\t\t{iconVariant === 'more' ? (\n\t\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\t\tcategory=\"utility\"\n\t\t\t\t\t\t\tname=\"down\"\n\t\t\t\t\t\t\tsize=\"x-small\"\n\t\t\t\t\t\t\tclassName={iconClassName as string}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null}\n\t\t\t\t\t{iconPosition === 'left' || !iconPosition ? renderLabel() : null}\n\t\t\t\t\t{children}\n\t\t\t\t</button>\n\t\t\t);\n\t\t};\n\n\t\t// Deprecated: wrap button in tooltip if tooltip prop is provided\n\t\tif (tooltip) {\n\t\t\treturn <Tooltip content={tooltip}>{renderButton()}</Tooltip>;\n\t\t}\n\n\t\treturn renderButton();\n\t}\n);\n\nButton.displayName = BUTTON;\n\nexport default Button;\n"],"mappings":";;;;;;;;;;AAiKA,IAAM,IAA4C,EAAE,MAAM,GAAG,GASvD,IAAS,GACb,GAAoB,MAAyC;CAC7D,IAAM,EACL,mBAAgB,GAChB,cACA,aACA,cACA,cAAW,IACX,UAAO,IACP,iBACA,kBACA,aACA,aACA,iBACA,cAAW,UACX,gBACA,OACA,YACA,UACA,WACA,YACA,YACA,cACA,eACA,YACA,gBACA,iBACA,iBACA,cACA,mBACA,iBACA,UACA,aACA,UACA,YACA,UAAO,UACP,aAAU,WACV,GAAG,MACA,GAEE,IAAc,EAAiC,IAAI;CAEzD,QAAgB;EACf,AAAI,KAAgB,KAAkB,EAAY,WACjD,EAAe,EAAY,OAAO;CAEpC,GAAG,CAAC,GAAc,CAAc,CAAC;CAEjC,IAAM,UAA6B;EAClC,IAAM,IAAS,MAAY,QACvB,IAAsB,GACpB,IAAW,MAAgB,QAC3B,IAAa,MAAgB,UAC7B,IAAmB,MAAgB,iBAEnC,IACJ,MAAY,UACZ,CAAC,KACD,CAAC,KACD,MAAY,UACb,MAAgB,QACX,IAAkB,KAAW,CAAC,GAC9B,IAAmB,KAAW,KAAU,CAAC,KAAY,CAAC,GACtD,IAAkB,KAAW,GAC7B,IAAoB,KAAW;EAOrC,OAJI,MAAgB,o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Y,IAAI;IAC3C,KAAY,IAAW,EAAW,CAAQ,IAAI;IAC9C,MAAgB,SAChB,kBAAC,GAAD;KACC,UAAS;KACT,MAAK;KACL,MAAK;KACL,WAAW;IACX,CAAA,IACE;IACH,MAAiB,UAAU,CAAC,IAAe,EAAY,IAAI;IAC3D;GACM;;CAEV;CAOA,OAJI,IACI,kBAAC,GAAD;EAAS,SAAS;EAAU,UAAA,EAAa;CAAW,CAAA,IAGrD,EAAa;AACrB,CACD;AAEA,EAAO,cAAc"}
|
|
@@ -17,8 +17,9 @@ var u = { icon: "" }, d = {
|
|
|
17
17
|
label: "Unfollow"
|
|
18
18
|
}, m = ({ active: e, assistiveText: m, className: h, disabled: g = !1, icon: _, iconName: v, iconSize: y = "medium", id: b, onBlur: x, onClick: S, onFocus: C, onKeyDown: w, onKeyPress: T, onKeyUp: E, onMouseDown: D, onMouseEnter: O, responsive: k = !1, stateOne: A = d, stateTwo: j = f, stateThree: M = p, tabIndex: N, variant: P, ...F }) => {
|
|
19
19
|
let [I, L] = a(!1), R = typeof e == "boolean" ? e : I, z = i((e) => o(h, "slds-button", "slds-button_stateful", {
|
|
20
|
-
"slds-button_neutral": P !== "icon" && P !== "icon-filled",
|
|
20
|
+
"slds-button_neutral": P !== "icon" && P !== "icon-filled" && P !== "success" && P !== "text",
|
|
21
21
|
"slds-button_inverse": P === "inverse",
|
|
22
|
+
"slds-button_success": P === "success",
|
|
22
23
|
"slds-not-selected": !e,
|
|
23
24
|
"slds-is-selected": e,
|
|
24
25
|
"slds-max-small-button_stretch": k,
|
|
@@ -29,7 +30,7 @@ var u = { icon: "" }, d = {
|
|
|
29
30
|
P,
|
|
30
31
|
k
|
|
31
32
|
]), B = i((e) => {
|
|
32
|
-
x &&
|
|
33
|
+
x && x(e), e.currentTarget.matches(":focus-visible") || e.currentTarget.blur();
|
|
33
34
|
}, [x]), V = i((t) => {
|
|
34
35
|
l(S) && S(t), typeof e != "boolean" && L((e) => !e);
|
|
35
36
|
}, [S, e]), H = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/button-stateful/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\ttype ReactNode,\n\ttype MouseEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport isFunction from 'lodash.isfunction';\n\nimport ButtonIcon from '../icon/button-icon';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport { BUTTON_STATEFUL } from '../../utilities/constants';\n\n/**\n * Button stateful variant types\n */\nexport type ButtonStatefulVariant = 'base' | 'neutral' | 'brand' | 'destructive' | 'icon' | 'icon-filled' | 'inverse';\n\n/**\n * State configuration for stateful button\n */\nexport interface ButtonStatefulState {\n\t/** Icon component or icon name */\n\ticon?: ReactNode;\n\t/** Icon name (if not using icon prop) */\n\ticonName?: string;\n\t/** Button label */\n\tlabel?: string;\n}\n\n/**\n * Assistive text for ButtonStateful\n */\nexport interface ButtonStatefulAssistiveText {\n\t/** Text for icon */\n\ticon?: string;\n}\n\n/**\n * Props for the ButtonStateful component\n */\nexport interface ButtonStatefulProps {\n\t/** Controlled active state */\n\tactive?: boolean;\n\t/** Assistive text */\n\tassistiveText?: ButtonStatefulAssistiveText | string;\n\t/** CSS classes */\n\tclassName?: string;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Icon component */\n\ticon?: ReactNode;\n\t/** Icon name */\n\ticonName?: string;\n\t/** Icon size */\n\ticonSize?: string;\n\t/** HTML id */\n\tid?: string;\n\t/** Blur handler */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Click handler */\n\tonClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key press handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key up handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Scale to full width on small screens */\n\tresponsive?: boolean;\n\t/** Initial/unselected state */\n\tstateOne?: ButtonStatefulState;\n\t/** Selected state */\n\tstateTwo?: ButtonStatefulState;\n\t/** Deselect/hover state */\n\tstateThree?: ButtonStatefulState;\n\t/** Tab index */\n\ttabIndex?: string;\n\t/** Button variant */\n\tvariant?: ButtonStatefulVariant;\n}\n\nconst defaultAssistiveText: ButtonStatefulAssistiveText = { icon: '' };\n\nconst defaultStateOne: ButtonStatefulState = { iconName: 'add', label: 'Follow' };\nconst defaultStateTwo: ButtonStatefulState = { iconName: 'check', label: 'Following' };\nconst defaultStateThree: ButtonStatefulState = { iconName: 'close', label: 'Unfollow' };\n\n/**\n * The ButtonStateful component is a variant of the Lightning Design System Button component.\n * It is used for buttons that have a state of unselected or selected.\n */\nconst ButtonStateful = ({\n\tactive: controlledActive,\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tdisabled = false,\n\ticon,\n\ticonName,\n\ticonSize = 'medium',\n\tid,\n\tonBlur,\n\tonClick,\n\tonFocus,\n\tonKeyDown,\n\tonKeyPress,\n\tonKeyUp,\n\tonMouseDown,\n\tonMouseEnter,\n\tresponsive = false,\n\tstateOne = defaultStateOne,\n\tstateTwo = defaultStateTwo,\n\tstateThree = defaultStateThree,\n\ttabIndex,\n\tvariant,\n\t...rest\n}: ButtonStatefulProps): React.ReactElement => {\n\tconst [internalActive, setInternalActive] = useState(false);\n\n\tconst isActive = typeof controlledActive === 'boolean' ? controlledActive : internalActive;\n\n\tconst getClassName = useCallback(\n\t\t(active: boolean) =>\n\t\t\tclassNames(className, 'slds-button', 'slds-button_stateful', {\n\t\t\t\t'slds-button_neutral': variant !== 'icon' && variant !== 'icon-filled',\n\t\t\t\t'slds-button_inverse': variant === 'inverse',\n\t\t\t\t'slds-not-selected': !active,\n\t\t\t\t'slds-is-selected': active,\n\t\t\t\t'slds-max-small-button_stretch': responsive,\n\t\t\t\t'slds-button_icon-border': variant === 'icon',\n\t\t\t\t'slds-button_icon-border-filled': variant === 'icon-filled',\n\t\t\t}),\n\t\t[className, variant, responsive]\n\t);\n\n\tconst handleBlur = useCallback(\n\t\t(e: FocusEvent<HTMLButtonElement> | MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (onBlur && 'relatedTarget' in e) onBlur(e as FocusEvent<HTMLButtonElement>);\n\t\t\te.currentTarget.blur();\n\t\t},\n\t\t[onBlur]\n\t);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (isFunction(onClick)) onClick(e);\n\t\t\tif (typeof controlledActive !== 'boolean') {\n\t\t\t\tsetInternalActive((prev) => !prev);\n\t\t\t}\n\t\t},\n\t\t[onClick, controlledActive]\n\t);\n\n\tconst defaultIconProps = {\n\t\tdisabled,\n\t\tsize: 'small' as const,\n\t\tclassName: 'slds-button__icon_stateful',\n\t};\n\n\tconst iconAssistiveText =\n\t\ttypeof propAssistiveText === 'string'\n\t\t\t? propAssistiveText\n\t\t\t: { ...defaultAssistiveText, ...propAssistiveText }.icon;\n\n\t// Accept aria-* props\n\tlet ariaProps = getAriaProps(rest);\n\n\tif (variant === 'icon' || variant === 'icon-filled') {\n\t\tif (Object.keys(ariaProps).length === 0) {\n\t\t\tariaProps = { 'aria-live': 'polite' as const };\n\t\t}\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\t{...ariaProps}\n\t\t\t\tclassName={getClassName(isActive)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={id}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\tonMouseLeave={handleBlur}\n\t\t\t\ttabIndex={tabIndex ? parseInt(tabIndex, 10) : undefined}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{icon ? (\n\t\t\t\t\tReact.cloneElement(icon as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t\t\t...defaultIconProps,\n\t\t\t\t\t\t...((icon as React.ReactElement<Record<string, unknown>>).props || {}),\n\t\t\t\t\t})\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tname={iconName}\n\t\t\t\t\t\tsize={iconSize as 'x-small' | 'small' | 'medium' | 'large'}\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{iconAssistiveText ? (\n\t\t\t\t\t<span className=\"slds-assistive-text\">{iconAssistiveText}</span>\n\t\t\t\t) : null}\n\t\t\t</button>\n\t\t);\n\t}\n\n\tconst defaultIconPropsWithPosition = { ...defaultIconProps, position: 'left' as const };\n\n\tif (Object.keys(ariaProps).length === 0) {\n\t\tariaProps = { 'aria-live': 'assertive' as const };\n\t}\n\n\treturn (\n\t\t<button\n\t\t\t{...ariaProps}\n\t\t\tclassName={getClassName(isActive)}\n\t\t\tdisabled={disabled}\n\t\t\tid={id}\n\t\t\tonBlur={handleBlur}\n\t\t\tonClick={handleClick}\n\t\t\tonFocus={onFocus}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonKeyPress={onKeyPress}\n\t\t\tonKeyUp={onKeyUp}\n\t\t\tonMouseEnter={onMouseEnter}\n\t\t\tonMouseLeave={handleBlur}\n\t\t\ttabIndex={tabIndex ? parseInt(tabIndex, 10) : undefined}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t<span className=\"slds-text-not-selected\">\n\t\t\t\t{stateOne.icon ? (\n\t\t\t\t\tReact.cloneElement(stateOne.icon as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t...((stateOne.icon as React.ReactElement<Record<string, unknown>>).props || {}),\n\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t})\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tname={stateOne.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateOne.label}\n\t\t\t</span>\n\t\t\t<span className=\"slds-text-selected\">\n\t\t\t\t{stateTwo.icon ? (\n\t\t\t\t\tReact.cloneElement(stateTwo.icon as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t...((stateTwo.icon as React.ReactElement<Record<string, unknown>>).props || {}),\n\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t})\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tname={stateTwo.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateTwo.label}\n\t\t\t</span>\n\t\t\t<span className=\"slds-text-selected-focus\">\n\t\t\t\t{stateThree.icon ? (\n\t\t\t\t\tReact.cloneElement(stateThree.icon as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t...((stateThree.icon as React.ReactElement<Record<string, unknown>>).props || {}),\n\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t})\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tname={stateThree.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateThree.label}\n\t\t\t</span>\n\t\t</button>\n\t);\n};\n\nButtonStateful.displayName = BUTTON_STATEFUL;\n\nexport default ButtonStateful;\n\n"],"mappings":";;;;;;;;AA6FA,IAAM,IAAoD,EAAE,MAAM,GAAG,GAE/D,IAAuC;CAAE,UAAU;CAAO,OAAO;AAAS,GAC1E,IAAuC;CAAE,UAAU;CAAS,OAAO;AAAY,GAC/E,IAAyC;CAAE,UAAU;CAAS,OAAO;AAAW,GAMhF,KAAkB,EACvB,QAAQ,GACR,eAAe,GACf,cACA,cAAW,IACX,SACA,aACA,cAAW,UACX,OACA,WACA,YACA,YACA,cACA,eACA,YACA,gBACA,iBACA,gBAAa,IACb,cAAW,GACX,cAAW,GACX,gBAAa,GACb,aACA,YACA,GAAG,QAC2C;CAC9C,IAAM,CAAC,GAAgB,KAAqB,EAAS,EAAK,GAEpD,IAAW,OAAO,KAAqB,YAAY,IAAmB,GAEtE,IAAe,GACnB,MACA,EAAW,GAAW,eAAe,wBAAwB;EAC5D,uBAAuB,MAAY,UAAU,MAAY;EACzD,uBAAuB,MAAY;EACnC,qBAAqB,CAAC;EACtB,oBAAoB;EACpB,iCAAiC;EACjC,2BAA2B,MAAY;EACvC,kCAAkC,MAAY;CAC/C,CAAC,GACF;EAAC;EAAW;EAAS;CAAU,CAChC,GAEM,IAAa,GACjB,MAAqE;EAErE,AADI,KAAU,mBAAmB,KAAG,EAAO,CAAkC,GAC7E,EAA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C,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,EAAS,OACT,EAAM,aAAa,EAAS,MAAqD;KAChF,GAAG;KACH,GAAK,EAAS,KAAqD,SAAS,CAAC;KAC7E,MAAM;IACP,CAAC,IAED,kBAAC,GAAD;KACW;KACV,MAAM,EAAS;KACf,MAAK;KACL,UAAS;KACT,WAAU;IACV,CAAA,GAED,EAAS,KACL;;GACN,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,EAAS,OACT,EAAM,aAAa,EAAS,MAAqD;KAChF,GAAG;KACH,GAAK,EAAS,KAAqD,SAAS,CAAC;KAC7E,MAAM;IACP,CAAC,IAED,kBAAC,GAAD;KACW;KACV,MAAM,EAAS;KACf,MAAK;KACL,UAAS;KACT,WAAU;IACV,CAAA,GAED,EAAS,KACL;;GACN,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,EAAW,OACX,EAAM,aAAa,EAAW,MAAqD;KAClF,GAAG;KACH,GAAK,EAAW,KAAqD,SAAS,CAAC;KAC/E,MAAM;IACP,CAAC,IAED,kBAAC,GAAD;KACW;KACV,MAAM,EAAW;KACjB,MAAK;KACL,UAAS;KACT,WAAU;IACV,CAAA,GAED,EAAW,KACP;;EACC;;AAEV;AAEA,EAAe,cAAc"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/button-stateful/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\ttype ReactNode,\n\ttype MouseEvent,\n\ttype FocusEvent,\n\ttype KeyboardEvent,\n} from 'react';\nimport classNames from 'classnames';\nimport isFunction from 'lodash.isfunction';\n\nimport ButtonIcon from '../icon/button-icon';\nimport getAriaProps from '../../utilities/get-aria-props';\nimport { BUTTON_STATEFUL } from '../../utilities/constants';\n\n/**\n * Button stateful variant types\n */\nexport type ButtonStatefulVariant =\n\t| 'base'\n\t| 'neutral'\n\t| 'brand'\n\t| 'destructive'\n\t| 'icon'\n\t| 'icon-filled'\n\t| 'inverse'\n\t| 'success'\n\t| 'text';\n\n/**\n * State configuration for stateful button\n */\nexport interface ButtonStatefulState {\n\t/** Icon component or icon name */\n\ticon?: ReactNode;\n\t/** Icon name (if not using icon prop) */\n\ticonName?: string;\n\t/** Button label */\n\tlabel?: string;\n}\n\n/**\n * Assistive text for ButtonStateful\n */\nexport interface ButtonStatefulAssistiveText {\n\t/** Text for icon */\n\ticon?: string;\n}\n\n/**\n * Props for the ButtonStateful component\n */\nexport interface ButtonStatefulProps {\n\t/** Controlled active state */\n\tactive?: boolean;\n\t/** Assistive text */\n\tassistiveText?: ButtonStatefulAssistiveText | string;\n\t/** CSS classes */\n\tclassName?: string;\n\t/** Disabled state */\n\tdisabled?: boolean;\n\t/** Icon component */\n\ticon?: ReactNode;\n\t/** Icon name */\n\ticonName?: string;\n\t/** Icon size */\n\ticonSize?: string;\n\t/** HTML id */\n\tid?: string;\n\t/** Blur handler */\n\tonBlur?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Click handler */\n\tonClick?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Focus handler */\n\tonFocus?: (event: FocusEvent<HTMLButtonElement>) => void;\n\t/** Key down handler */\n\tonKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key press handler */\n\tonKeyPress?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Key up handler */\n\tonKeyUp?: (event: KeyboardEvent<HTMLButtonElement>) => void;\n\t/** Mouse down handler */\n\tonMouseDown?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Mouse enter handler */\n\tonMouseEnter?: (event: MouseEvent<HTMLButtonElement>) => void;\n\t/** Scale to full width on small screens */\n\tresponsive?: boolean;\n\t/** Initial/unselected state */\n\tstateOne?: ButtonStatefulState;\n\t/** Selected state */\n\tstateTwo?: ButtonStatefulState;\n\t/** Deselect/hover state */\n\tstateThree?: ButtonStatefulState;\n\t/** Tab index */\n\ttabIndex?: string;\n\t/** Button variant. `text` renders a stateful button with no border or background. */\n\tvariant?: ButtonStatefulVariant;\n}\n\nconst defaultAssistiveText: ButtonStatefulAssistiveText = { icon: '' };\n\nconst defaultStateOne: ButtonStatefulState = {\n\ticonName: 'add',\n\tlabel: 'Follow',\n};\nconst defaultStateTwo: ButtonStatefulState = {\n\ticonName: 'check',\n\tlabel: 'Following',\n};\nconst defaultStateThree: ButtonStatefulState = {\n\ticonName: 'close',\n\tlabel: 'Unfollow',\n};\n\n/**\n * The ButtonStateful component is a variant of the Lightning Design System Button component.\n * It is used for buttons that have a state of unselected or selected.\n */\nconst ButtonStateful = ({\n\tactive: controlledActive,\n\tassistiveText: propAssistiveText,\n\tclassName,\n\tdisabled = false,\n\ticon,\n\ticonName,\n\ticonSize = 'medium',\n\tid,\n\tonBlur,\n\tonClick,\n\tonFocus,\n\tonKeyDown,\n\tonKeyPress,\n\tonKeyUp,\n\tonMouseDown,\n\tonMouseEnter,\n\tresponsive = false,\n\tstateOne = defaultStateOne,\n\tstateTwo = defaultStateTwo,\n\tstateThree = defaultStateThree,\n\ttabIndex,\n\tvariant,\n\t...rest\n}: ButtonStatefulProps): React.ReactElement => {\n\tconst [internalActive, setInternalActive] = useState(false);\n\n\tconst isActive =\n\t\ttypeof controlledActive === 'boolean' ? controlledActive : internalActive;\n\n\tconst getClassName = useCallback(\n\t\t(active: boolean) =>\n\t\t\tclassNames(className, 'slds-button', 'slds-button_stateful', {\n\t\t\t\t'slds-button_neutral':\n\t\t\t\t\tvariant !== 'icon' &&\n\t\t\t\t\tvariant !== 'icon-filled' &&\n\t\t\t\t\tvariant !== 'success' &&\n\t\t\t\t\tvariant !== 'text',\n\t\t\t\t'slds-button_inverse': variant === 'inverse',\n\t\t\t\t'slds-button_success': variant === 'success',\n\t\t\t\t'slds-not-selected': !active,\n\t\t\t\t'slds-is-selected': active,\n\t\t\t\t'slds-max-small-button_stretch': responsive,\n\t\t\t\t'slds-button_icon-border': variant === 'icon',\n\t\t\t\t'slds-button_icon-border-filled': variant === 'icon-filled',\n\t\t\t}),\n\t\t[className, variant, responsive]\n\t);\n\n\tconst handleBlur = useCallback(\n\t\t(e: FocusEvent<HTMLButtonElement> | MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (onBlur) onBlur(e as FocusEvent<HTMLButtonElement>);\n\t\t\t// SLDS shows `slds-text-selected-focus` on `.slds-is-selected:focus`, so\n\t\t\t// drop focus left behind by a mouse click. Keyboard focus is\n\t\t\t// `:focus-visible` and stays put.\n\t\t\tif (!e.currentTarget.matches(':focus-visible')) e.currentTarget.blur();\n\t\t},\n\t\t[onBlur]\n\t);\n\n\tconst handleClick = useCallback(\n\t\t(e: MouseEvent<HTMLButtonElement>) => {\n\t\t\tif (isFunction(onClick)) onClick(e);\n\t\t\tif (typeof controlledActive !== 'boolean') {\n\t\t\t\tsetInternalActive((prev) => !prev);\n\t\t\t}\n\t\t},\n\t\t[onClick, controlledActive]\n\t);\n\n\tconst defaultIconProps = {\n\t\tdisabled,\n\t\tsize: 'small' as const,\n\t\tclassName: 'slds-button__icon_stateful',\n\t};\n\n\tconst iconAssistiveText =\n\t\ttypeof propAssistiveText === 'string'\n\t\t\t? propAssistiveText\n\t\t\t: { ...defaultAssistiveText, ...propAssistiveText }.icon;\n\n\t// Accept aria-* props\n\tlet ariaProps = getAriaProps(rest);\n\n\tif (variant === 'icon' || variant === 'icon-filled') {\n\t\tif (Object.keys(ariaProps).length === 0) {\n\t\t\tariaProps = { 'aria-live': 'polite' as const };\n\t\t}\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\t{...ariaProps}\n\t\t\t\tclassName={getClassName(isActive)}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tid={id}\n\t\t\t\tonBlur={handleBlur}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonKeyDown={onKeyDown}\n\t\t\t\tonKeyPress={onKeyPress}\n\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\tonMouseDown={onMouseDown}\n\t\t\t\tonMouseEnter={onMouseEnter}\n\t\t\t\tonMouseLeave={handleBlur}\n\t\t\t\ttabIndex={tabIndex ? parseInt(tabIndex, 10) : undefined}\n\t\t\t\ttype=\"button\"\n\t\t\t>\n\t\t\t\t{icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\ticon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconProps,\n\t\t\t\t\t\t\t...((icon as React.ReactElement<Record<string, unknown>>).props ||\n\t\t\t\t\t\t\t\t{}),\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tname={iconName}\n\t\t\t\t\t\tsize={iconSize as 'x-small' | 'small' | 'medium' | 'large'}\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{iconAssistiveText ? (\n\t\t\t\t\t<span className=\"slds-assistive-text\">{iconAssistiveText}</span>\n\t\t\t\t) : null}\n\t\t\t</button>\n\t\t);\n\t}\n\n\tconst defaultIconPropsWithPosition = {\n\t\t...defaultIconProps,\n\t\tposition: 'left' as const,\n\t};\n\n\tif (Object.keys(ariaProps).length === 0) {\n\t\tariaProps = { 'aria-live': 'assertive' as const };\n\t}\n\n\treturn (\n\t\t<button\n\t\t\t{...ariaProps}\n\t\t\tclassName={getClassName(isActive)}\n\t\t\tdisabled={disabled}\n\t\t\tid={id}\n\t\t\tonBlur={handleBlur}\n\t\t\tonClick={handleClick}\n\t\t\tonFocus={onFocus}\n\t\t\tonKeyDown={onKeyDown}\n\t\t\tonKeyPress={onKeyPress}\n\t\t\tonKeyUp={onKeyUp}\n\t\t\tonMouseEnter={onMouseEnter}\n\t\t\tonMouseLeave={handleBlur}\n\t\t\ttabIndex={tabIndex ? parseInt(tabIndex, 10) : undefined}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t<span className=\"slds-text-not-selected\">\n\t\t\t\t{stateOne.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateOne.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((stateOne.icon as React.ReactElement<Record<string, unknown>>)\n\t\t\t\t\t\t\t\t.props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tname={stateOne.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateOne.label}\n\t\t\t</span>\n\t\t\t<span className=\"slds-text-selected\">\n\t\t\t\t{stateTwo.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateTwo.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((stateTwo.icon as React.ReactElement<Record<string, unknown>>)\n\t\t\t\t\t\t\t\t.props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tname={stateTwo.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateTwo.label}\n\t\t\t</span>\n\t\t\t<span className=\"slds-text-selected-focus\">\n\t\t\t\t{stateThree.icon ? (\n\t\t\t\t\tReact.cloneElement(\n\t\t\t\t\t\tstateThree.icon as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...defaultIconPropsWithPosition,\n\t\t\t\t\t\t\t...((\n\t\t\t\t\t\t\t\tstateThree.icon as React.ReactElement<Record<string, unknown>>\n\t\t\t\t\t\t\t).props || {}),\n\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t) : (\n\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tname={stateThree.iconName}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tposition=\"left\"\n\t\t\t\t\t\tclassName=\"slds-button__icon_stateful\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t{stateThree.label}\n\t\t\t</span>\n\t\t</button>\n\t);\n};\n\nButtonStateful.displayName = BUTTON_STATEFUL;\n\nexport default ButtonStateful;\n"],"mappings":";;;;;;;;AAsGA,IAAM,IAAoD,EAAE,MAAM,GAAG,GAE/D,IAAuC;CAC5C,UAAU;CACV,OAAO;AACR,GACM,IAAuC;CAC5C,UAAU;CACV,OAAO;AACR,GACM,IAAyC;CAC9C,UAAU;CACV,OAAO;AACR,GAMM,KAAkB,EACvB,QAAQ,GACR,eAAe,GACf,cACA,cAAW,IACX,SACA,aACA,cAAW,UACX,OACA,WACA,YACA,YACA,cACA,eACA,YACA,gBACA,iBACA,gBAAa,IACb,cAAW,GACX,cAAW,GACX,gBAAa,GACb,aACA,YACA,GAAG,QAC2C;CAC9C,IAAM,CAAC,GAAgB,KAAqB,EAAS,EAAK,GAEpD,IACL,OAAO,KAAqB,YAAY,IAAmB,GAEtD,IAAe,GACnB,MACA,EAAW,GAAW,eAAe,wBAAwB;EAC5D,uBACC,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,GAAG;EACH,UAAU;CACX;CAMA,OAJI,OAAO,KAAK,CAAS,CAAC,CAAC,WAAW,MACrC,IAAY,EAAE,aAAa,YAAqB,IAIhD,kBAAC,UAAD;EACC,GAAI;EACJ,WAAW,EAAa,CAAQ;EACtB;EACN;EACJ,QAAQ;EACR,SAAS;EACA;EACE;EACC;EACH;EACK;EACd,cAAc;EACd,UAAU,IAAW,SAAS,GAAU,EAAE,IAAI,KAAA;EAC9C,MAAK;EAdN,UAAA;GAgBC,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,EAAS,OACT,EAAM,aACL,EAAS,MACT;KACC,GAAG;KACH,GAAK,EAAS,KACZ,SAAS,CAAC;KACZ,MAAM;IACP,CACD,IAEA,kBAAC,GAAD;KACW;KACV,MAAM,EAAS;KACf,MAAK;KACL,UAAS;KACT,WAAU;IACV,CAAA,GAED,EAAS,KACL;;GACN,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,EAAS,OACT,EAAM,aACL,EAAS,MACT;KACC,GAAG;KACH,GAAK,EAAS,KACZ,SAAS,CAAC;KACZ,MAAM;IACP,CACD,IAEA,kBAAC,GAAD;KACW;KACV,MAAM,EAAS;KACf,MAAK;KACL,UAAS;KACT,WAAU;IACV,CAAA,GAED,EAAS,KACL;;GACN,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,EAAW,OACX,EAAM,aACL,EAAW,MACX;KACC,GAAG;KACH,GACC,EAAW,KACV,SAAS,CAAC;KACZ,MAAM;IACP,CACD,IAEA,kBAAC,GAAD;KACW;KACV,MAAM,EAAW;KACjB,MAAK;KACL,UAAS;KACT,WAAU;IACV,CAAA,GAED,EAAW,KACP;;EACC;;AAEV;AAEA,EAAe,cAAc"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component as e } from "react";
|
|
2
|
+
import t from "classnames";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region components/grid/index.tsx
|
|
5
|
+
var r = class extends e {
|
|
6
|
+
getClassName() {
|
|
7
|
+
return t(this.props.className, "slds-col");
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return /* @__PURE__ */ n("div", {
|
|
11
|
+
className: this.getClassName(),
|
|
12
|
+
children: this.props.children
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}, i = class extends e {
|
|
16
|
+
static Column = r;
|
|
17
|
+
getClassName() {
|
|
18
|
+
let { flavor: e } = this.props;
|
|
19
|
+
return t(this.props.className, "slds-grid", { [`slds-grid_${e}`]: e });
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return /* @__PURE__ */ n("div", {
|
|
23
|
+
className: this.getClassName(),
|
|
24
|
+
children: this.props.children
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { i as default };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../components/grid/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 { Component, type ReactNode } from 'react';\nimport classNames from 'classnames';\n\nexport interface GridColumnProps {\n\t/** Additional class names applied to the column. */\n\tclassName?: string;\n\t/** Column content. */\n\tchildren?: ReactNode;\n}\n\nclass GridColumn extends Component<GridColumnProps> {\n\tgetClassName() {\n\t\treturn classNames(this.props.className, 'slds-col');\n\t}\n\n\trender() {\n\t\treturn <div className={this.getClassName()}>{this.props.children}</div>;\n\t}\n}\n\nexport interface GridProps {\n\t/** Additional class names applied to the grid. */\n\tclassName?: string;\n\t/** Grid flavor, appended as `slds-grid_{flavor}`. */\n\tflavor?: string;\n\t/** Grid content, typically `Grid.Column` elements. */\n\tchildren?: ReactNode;\n}\n\nclass Grid extends Component<GridProps> {\n\tstatic Column = GridColumn;\n\n\tgetClassName() {\n\t\tconst { flavor } = this.props;\n\t\treturn classNames(this.props.className, 'slds-grid', {\n\t\t\t[`slds-grid_${flavor}`]: flavor,\n\t\t});\n\t}\n\n\trender() {\n\t\treturn <div className={this.getClassName()}>{this.props.children}</div>;\n\t}\n}\n\nexport default Grid;\n"],"mappings":";;;;AAaA,IAAM,IAAN,cAAyB,EAA2B;CACnD,eAAe;EACd,OAAO,EAAW,KAAK,MAAM,WAAW,UAAU;CACnD;CAEA,SAAS;EACR,OAAO,kBAAC,OAAD;GAAK,WAAW,KAAK,aAAa;GAAI,UAAA,KAAK,MAAM;EAAc,CAAA;CACvE;AACD,GAWM,IAAN,cAAmB,EAAqB;CACvC,OAAO,SAAS;CAEhB,eAAe;EACd,IAAM,EAAE,cAAW,KAAK;EACxB,OAAO,EAAW,KAAK,MAAM,WAAW,aAAa,GACnD,aAAa,MAAW,EAC1B,CAAC;CACF;CAEA,SAAS;EACR,OAAO,kBAAC,OAAD;GAAK,WAAW,KAAK,aAAa;GAAI,UAAA,KAAK,MAAM;EAAc,CAAA;CACvE;AACD"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../utilities/menu-list/item-label.js";
|
|
2
|
-
import "../utilities/menu-list/item.js";
|
|
3
|
-
import
|
|
1
|
+
import e from "../utilities/menu-list/item-label.js";
|
|
2
|
+
import t from "../utilities/menu-list/item.js";
|
|
3
|
+
import n, { DropdownNubbinPositions as r } from "./menu-dropdown.js";
|
|
4
4
|
//#region components/menu-dropdown/index.tsx
|
|
5
|
-
var
|
|
5
|
+
var i = n;
|
|
6
6
|
//#endregion
|
|
7
|
-
export { t as default };
|
|
7
|
+
export { r as DropdownNubbinPositions, t as ListItem, e as ListItemLabel, i as default };
|
|
8
8
|
|
|
9
9
|
//# sourceMappingURL=index.js.map
|