@salesforce/design-system-react 11.0.0-rc.1 → 11.0.0-rc.2

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.
Files changed (248) hide show
  1. package/README.md +10 -2
  2. package/dist/cjs/components/accordion/index.cjs +1 -1
  3. package/dist/cjs/components/accordion/index.cjs.map +1 -1
  4. package/dist/cjs/components/accordion/panel.cjs.map +1 -1
  5. package/dist/cjs/components/builder-header/nav-dropdown.cjs.map +1 -1
  6. package/dist/cjs/components/builder-header/nav-link.cjs.map +1 -1
  7. package/dist/cjs/components/builder-header/toolbar.cjs.map +1 -1
  8. package/dist/cjs/components/button/index.cjs.map +1 -1
  9. package/dist/cjs/components/button-stateful/index.cjs.map +1 -1
  10. package/dist/cjs/components/checkbox/index.cjs.map +1 -1
  11. package/dist/cjs/components/color-picker/color-picker.cjs.map +1 -1
  12. package/dist/cjs/components/combobox/combobox.cjs +1 -1
  13. package/dist/cjs/components/combobox/combobox.cjs.map +1 -1
  14. package/dist/cjs/components/date-picker/date-picker.cjs +1 -1
  15. package/dist/cjs/components/date-picker/date-picker.cjs.map +1 -1
  16. package/dist/cjs/components/date-picker/index.cjs.map +1 -1
  17. package/dist/cjs/components/files/file.cjs.map +1 -1
  18. package/dist/cjs/components/icon/index.cjs.map +1 -1
  19. package/dist/cjs/components/icon/input-icon/index.cjs.map +1 -1
  20. package/dist/cjs/components/icon-settings/index.cjs.map +1 -1
  21. package/dist/cjs/components/input/index.cjs.map +1 -1
  22. package/dist/cjs/components/input/private/inner-input.cjs.map +1 -1
  23. package/dist/cjs/components/menu-dropdown/button-trigger.cjs.map +1 -1
  24. package/dist/cjs/components/menu-dropdown/menu-dropdown.cjs.map +1 -1
  25. package/dist/cjs/components/modal/index.cjs.map +1 -1
  26. package/dist/cjs/components/panel/filtering/group.cjs.map +1 -1
  27. package/dist/cjs/components/pill/index.cjs.map +1 -1
  28. package/dist/cjs/components/popover/edit-dialog.cjs.map +1 -1
  29. package/dist/cjs/components/popover/popover.cjs.map +1 -1
  30. package/dist/cjs/components/progress-indicator/index.cjs.map +1 -1
  31. package/dist/cjs/components/progress-ring/index.cjs.map +1 -1
  32. package/dist/cjs/components/radio/index.cjs.map +1 -1
  33. package/dist/cjs/components/radio-group/check-props.cjs.map +1 -1
  34. package/dist/cjs/components/radio-group/index.cjs.map +1 -1
  35. package/dist/cjs/components/scoped-notification/index.cjs.map +1 -1
  36. package/dist/cjs/components/setup-assistant/step.cjs.map +1 -1
  37. package/dist/cjs/components/slider/index.cjs.map +1 -1
  38. package/dist/cjs/components/split-view/header.cjs.map +1 -1
  39. package/dist/cjs/components/tabs/index.cjs.map +1 -1
  40. package/dist/cjs/components/tabs/panel.cjs.map +1 -1
  41. package/dist/cjs/components/textarea/index.cjs +1 -1
  42. package/dist/cjs/components/textarea/index.cjs.map +1 -1
  43. package/dist/cjs/components/tooltip/index.cjs.map +1 -1
  44. package/dist/cjs/components/tree/tree.cjs.map +1 -1
  45. package/dist/cjs/components/trial-bar/button.cjs.map +1 -1
  46. package/dist/cjs/components/trial-bar/dropdown.cjs.map +1 -1
  47. package/dist/cjs/components/utilities/menu-list/item-label.cjs.map +1 -1
  48. package/dist/cjs/utilities/get-component-doc.cjs +1 -1
  49. package/dist/cjs/utilities/get-component-doc.cjs.map +1 -1
  50. package/dist/cjs/utilities/warning/children-as-trigger.cjs +1 -1
  51. package/dist/cjs/utilities/warning/children-as-trigger.cjs.map +1 -1
  52. package/dist/cjs/utilities/warning/deprecated-property-value.cjs +1 -1
  53. package/dist/cjs/utilities/warning/deprecated-property-value.cjs.map +1 -1
  54. package/dist/cjs/utilities/warning/deprecated-property.cjs +1 -1
  55. package/dist/cjs/utilities/warning/deprecated-property.cjs.map +1 -1
  56. package/dist/cjs/utilities/warning/removal-version.cjs +2 -0
  57. package/dist/cjs/utilities/warning/removal-version.cjs.map +1 -0
  58. package/dist/es/components/accordion/index.js +7 -3
  59. package/dist/es/components/accordion/index.js.map +1 -1
  60. package/dist/es/components/accordion/panel.js.map +1 -1
  61. package/dist/es/components/builder-header/nav-dropdown.js.map +1 -1
  62. package/dist/es/components/builder-header/nav-link.js.map +1 -1
  63. package/dist/es/components/builder-header/toolbar.js.map +1 -1
  64. package/dist/es/components/button/index.js.map +1 -1
  65. package/dist/es/components/button-stateful/index.js.map +1 -1
  66. package/dist/es/components/checkbox/index.js.map +1 -1
  67. package/dist/es/components/color-picker/color-picker.js.map +1 -1
  68. package/dist/es/components/combobox/combobox.js +4 -2
  69. package/dist/es/components/combobox/combobox.js.map +1 -1
  70. package/dist/es/components/date-picker/date-picker.js +1 -1
  71. package/dist/es/components/date-picker/date-picker.js.map +1 -1
  72. package/dist/es/components/date-picker/index.js.map +1 -1
  73. package/dist/es/components/files/file.js.map +1 -1
  74. package/dist/es/components/icon/index.js.map +1 -1
  75. package/dist/es/components/icon/input-icon/index.js.map +1 -1
  76. package/dist/es/components/icon-settings/index.js.map +1 -1
  77. package/dist/es/components/input/index.js.map +1 -1
  78. package/dist/es/components/input/private/inner-input.js.map +1 -1
  79. package/dist/es/components/menu-dropdown/button-trigger.js.map +1 -1
  80. package/dist/es/components/menu-dropdown/menu-dropdown.js.map +1 -1
  81. package/dist/es/components/modal/index.js.map +1 -1
  82. package/dist/es/components/panel/filtering/group.js.map +1 -1
  83. package/dist/es/components/pill/index.js.map +1 -1
  84. package/dist/es/components/popover/edit-dialog.js.map +1 -1
  85. package/dist/es/components/popover/popover.js.map +1 -1
  86. package/dist/es/components/progress-indicator/index.js.map +1 -1
  87. package/dist/es/components/progress-ring/index.js.map +1 -1
  88. package/dist/es/components/radio/index.js.map +1 -1
  89. package/dist/es/components/radio-group/check-props.js.map +1 -1
  90. package/dist/es/components/radio-group/index.js.map +1 -1
  91. package/dist/es/components/scoped-notification/index.js.map +1 -1
  92. package/dist/es/components/setup-assistant/step.js.map +1 -1
  93. package/dist/es/components/slider/index.js.map +1 -1
  94. package/dist/es/components/split-view/header.js.map +1 -1
  95. package/dist/es/components/tabs/index.js.map +1 -1
  96. package/dist/es/components/tabs/panel.js.map +1 -1
  97. package/dist/es/components/textarea/index.js +29 -44
  98. package/dist/es/components/textarea/index.js.map +1 -1
  99. package/dist/es/components/tooltip/index.js.map +1 -1
  100. package/dist/es/components/tree/tree.js.map +1 -1
  101. package/dist/es/components/trial-bar/button.js.map +1 -1
  102. package/dist/es/components/trial-bar/dropdown.js.map +1 -1
  103. package/dist/es/components/utilities/menu-list/item-label.js.map +1 -1
  104. package/dist/es/utilities/get-component-doc.js +6 -6
  105. package/dist/es/utilities/get-component-doc.js.map +1 -1
  106. package/dist/es/utilities/warning/children-as-trigger.js +9 -8
  107. package/dist/es/utilities/warning/children-as-trigger.js.map +1 -1
  108. package/dist/es/utilities/warning/deprecated-property-value.js +11 -10
  109. package/dist/es/utilities/warning/deprecated-property-value.js.map +1 -1
  110. package/dist/es/utilities/warning/deprecated-property.js +9 -8
  111. package/dist/es/utilities/warning/deprecated-property.js.map +1 -1
  112. package/dist/es/utilities/warning/removal-version.js +6 -0
  113. package/dist/es/utilities/warning/removal-version.js.map +1 -0
  114. package/dist/llms/components/accordion.md +267 -0
  115. package/dist/llms/components/alert.md +228 -0
  116. package/dist/llms/components/avatar.md +167 -0
  117. package/dist/llms/components/badge.md +153 -0
  118. package/dist/llms/components/breadcrumb.md +148 -0
  119. package/dist/llms/components/builder-header.examples.md +239 -0
  120. package/dist/llms/components/builder-header.md +736 -0
  121. package/dist/llms/components/button-group.md +167 -0
  122. package/dist/llms/components/button-stateful.md +246 -0
  123. package/dist/llms/components/button.md +661 -0
  124. package/dist/llms/components/card.md +368 -0
  125. package/dist/llms/components/carousel.md +365 -0
  126. package/dist/llms/components/checkbox.md +887 -0
  127. package/dist/llms/components/color-picker.md +591 -0
  128. package/dist/llms/components/combobox.examples.md +802 -0
  129. package/dist/llms/components/combobox.md +929 -0
  130. package/dist/llms/components/date-picker.md +546 -0
  131. package/dist/llms/components/docked-composer.md +173 -0
  132. package/dist/llms/components/dynamic-icon.md +226 -0
  133. package/dist/llms/components/expandable-section.md +198 -0
  134. package/dist/llms/components/files.md +337 -0
  135. package/dist/llms/components/filter.md +775 -0
  136. package/dist/llms/components/icon-settings.md +301 -0
  137. package/dist/llms/components/icon.md +1040 -0
  138. package/dist/llms/components/input.md +746 -0
  139. package/dist/llms/components/media-object.md +125 -0
  140. package/dist/llms/components/menu-dropdown.md +732 -0
  141. package/dist/llms/components/modal.md +504 -0
  142. package/dist/llms/components/page-header.md +282 -0
  143. package/dist/llms/components/panel.md +256 -0
  144. package/dist/llms/components/pill-container.md +218 -0
  145. package/dist/llms/components/pill.md +266 -0
  146. package/dist/llms/components/popover.md +600 -0
  147. package/dist/llms/components/portal-settings.md +371 -0
  148. package/dist/llms/components/progress-bar.md +175 -0
  149. package/dist/llms/components/progress-indicator.md +399 -0
  150. package/dist/llms/components/progress-ring.md +146 -0
  151. package/dist/llms/components/radio-button-group.md +285 -0
  152. package/dist/llms/components/radio-group.md +242 -0
  153. package/dist/llms/components/radio.md +269 -0
  154. package/dist/llms/components/scoped-notification.md +156 -0
  155. package/dist/llms/components/setup-assistant.md +398 -0
  156. package/dist/llms/components/simple-data-table.examples.md +2773 -0
  157. package/dist/llms/components/simple-data-table.md +919 -0
  158. package/dist/llms/components/slider.md +217 -0
  159. package/dist/llms/components/spinner.md +232 -0
  160. package/dist/llms/components/split-view.md +350 -0
  161. package/dist/llms/components/tabs.md +311 -0
  162. package/dist/llms/components/textarea.md +331 -0
  163. package/dist/llms/components/toast.md +267 -0
  164. package/dist/llms/components/tooltip.md +470 -0
  165. package/dist/llms/components/tree.md +1011 -0
  166. package/dist/llms/components/trial-bar.md +383 -0
  167. package/dist/llms/components/vertical-navigation.md +196 -0
  168. package/dist/llms/components/visual-picker.md +362 -0
  169. package/dist/llms/components/welcome-mat.md +885 -0
  170. package/dist/llms/docs/migration-v11.md +471 -0
  171. package/dist/llms/llms-full.txt +6874 -0
  172. package/dist/llms/llms.txt +133 -0
  173. package/dist/llms/rules.md +36 -0
  174. package/dist/types/components/accordion/index.d.ts.map +1 -1
  175. package/dist/types/components/accordion/panel.d.ts +7 -7
  176. package/dist/types/components/builder-header/nav-dropdown.d.ts +1 -0
  177. package/dist/types/components/builder-header/nav-dropdown.d.ts.map +1 -1
  178. package/dist/types/components/builder-header/nav-link.d.ts +0 -1
  179. package/dist/types/components/builder-header/nav-link.d.ts.map +1 -1
  180. package/dist/types/components/builder-header/toolbar.d.ts +0 -1
  181. package/dist/types/components/builder-header/toolbar.d.ts.map +1 -1
  182. package/dist/types/components/button/index.d.ts +6 -3
  183. package/dist/types/components/button/index.d.ts.map +1 -1
  184. package/dist/types/components/button-stateful/index.d.ts +4 -1
  185. package/dist/types/components/button-stateful/index.d.ts.map +1 -1
  186. package/dist/types/components/checkbox/index.d.ts +19 -5
  187. package/dist/types/components/checkbox/index.d.ts.map +1 -1
  188. package/dist/types/components/color-picker/color-picker.d.ts +6 -4
  189. package/dist/types/components/color-picker/color-picker.d.ts.map +1 -1
  190. package/dist/types/components/color-picker/types.d.ts +2 -2
  191. package/dist/types/components/combobox/combobox.d.ts +22 -0
  192. package/dist/types/components/combobox/combobox.d.ts.map +1 -1
  193. package/dist/types/components/date-picker/date-picker.d.ts +16 -4
  194. package/dist/types/components/date-picker/date-picker.d.ts.map +1 -1
  195. package/dist/types/components/date-picker/index.d.ts +2 -6
  196. package/dist/types/components/date-picker/index.d.ts.map +1 -1
  197. package/dist/types/components/files/file.d.ts +1 -1
  198. package/dist/types/components/icon/index.d.ts +1 -0
  199. package/dist/types/components/icon/index.d.ts.map +1 -1
  200. package/dist/types/components/icon/input-icon/index.d.ts +3 -0
  201. package/dist/types/components/icon/input-icon/index.d.ts.map +1 -1
  202. package/dist/types/components/icon-settings/index.d.ts.map +1 -1
  203. package/dist/types/components/input/index.d.ts +2 -1
  204. package/dist/types/components/input/index.d.ts.map +1 -1
  205. package/dist/types/components/menu-dropdown/button-trigger.d.ts +5 -0
  206. package/dist/types/components/menu-dropdown/button-trigger.d.ts.map +1 -1
  207. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts +4 -0
  208. package/dist/types/components/menu-dropdown/menu-dropdown.d.ts.map +1 -1
  209. package/dist/types/components/modal/index.d.ts +5 -5
  210. package/dist/types/components/page-header/types.d.ts +3 -0
  211. package/dist/types/components/page-header/types.d.ts.map +1 -1
  212. package/dist/types/components/panel/filtering/group.d.ts +2 -0
  213. package/dist/types/components/panel/filtering/group.d.ts.map +1 -1
  214. package/dist/types/components/pill/index.d.ts +1 -0
  215. package/dist/types/components/pill/index.d.ts.map +1 -1
  216. package/dist/types/components/popover/edit-dialog.d.ts +1 -3
  217. package/dist/types/components/popover/edit-dialog.d.ts.map +1 -1
  218. package/dist/types/components/popover/popover.d.ts +1 -0
  219. package/dist/types/components/popover/popover.d.ts.map +1 -1
  220. package/dist/types/components/progress-indicator/index.d.ts +1 -0
  221. package/dist/types/components/progress-indicator/index.d.ts.map +1 -1
  222. package/dist/types/components/progress-ring/index.d.ts +1 -0
  223. package/dist/types/components/progress-ring/index.d.ts.map +1 -1
  224. package/dist/types/components/radio/index.d.ts +2 -2
  225. package/dist/types/components/radio/index.d.ts.map +1 -1
  226. package/dist/types/components/radio-group/index.d.ts +2 -0
  227. package/dist/types/components/radio-group/index.d.ts.map +1 -1
  228. package/dist/types/components/scoped-notification/index.d.ts +1 -0
  229. package/dist/types/components/scoped-notification/index.d.ts.map +1 -1
  230. package/dist/types/components/setup-assistant/step.d.ts +0 -1
  231. package/dist/types/components/setup-assistant/step.d.ts.map +1 -1
  232. package/dist/types/components/simple-data-table/types.d.ts +1 -0
  233. package/dist/types/components/simple-data-table/types.d.ts.map +1 -1
  234. package/dist/types/components/slider/index.d.ts +4 -2
  235. package/dist/types/components/slider/index.d.ts.map +1 -1
  236. package/dist/types/components/tabs/index.d.ts +1 -0
  237. package/dist/types/components/tabs/index.d.ts.map +1 -1
  238. package/dist/types/components/tabs/panel.d.ts +2 -1
  239. package/dist/types/components/tabs/panel.d.ts.map +1 -1
  240. package/dist/types/components/textarea/index.d.ts +9 -40
  241. package/dist/types/components/textarea/index.d.ts.map +1 -1
  242. package/dist/types/components/tooltip/index.d.ts +5 -0
  243. package/dist/types/components/tooltip/index.d.ts.map +1 -1
  244. package/dist/types/components/tree/tree.d.ts +5 -0
  245. package/dist/types/components/tree/tree.d.ts.map +1 -1
  246. package/dist/types/components/utilities/menu-list/item-label.d.ts +12 -0
  247. package/dist/types/components/utilities/menu-list/item-label.d.ts.map +1 -1
  248. package/package.json +8 -5
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.js","names":[],"sources":["../../../../components/trial-bar/dropdown.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport Dropdown from '../menu-dropdown';\nimport { type MenuDropdownBaseProps } from '../menu-dropdown/menu-dropdown';\nimport Button from '../button';\n\nimport { TRIAL_BAR_DROPDOWN } from '../../utilities/constants';\n\nexport interface TrialBarDropdownProps extends Omit<\n\tMenuDropdownBaseProps,\n\t'inverse' | 'label' | 'trigger'\n> {\n\t/**\n\t * Label rendered on the dropdown trigger button.\n\t */\n\tlabel?: string;\n}\n\n/**\n * A [Dropdown](/components/menu-dropdowns/) within the Trial Bar.\n */\nconst TrialBarDropdown = (props: TrialBarDropdownProps) => {\n\tconst { label, triggerClassName, ...rest } = props;\n\treturn (\n\t\t<Dropdown\n\t\t\t{...rest}\n\t\t\tinverse\n\t\t\ttriggerClassName={classNames('slds-grid', triggerClassName)}\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tinverse\n\t\t\t\t\tstyle={{ border: 0, height: '100%', padding: 0 }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"right\"\n\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\tlabel={label}\n\t\t\t\t/>\n\t\t\t}\n\t\t/>\n\t);\n};\n\nTrialBarDropdown.displayName = TRIAL_BAR_DROPDOWN;\nexport default TrialBarDropdown;\n"],"mappings":";;;;;;AAqBA,IAAM,KAAoB,MAAiC;CAC1D,IAAM,EAAE,UAAO,qBAAkB,GAAG,MAAS;CAC7C,OACC,kBAAC,GAAD;EACC,GAAI;EACJ,SAAA;EACA,kBAAkB,EAAW,aAAa,CAAgB;EAC1D,SACC,kBAAC,GAAD;GACC,SAAA;GACA,OAAO;IAAE,QAAQ;IAAG,QAAQ;IAAQ,SAAS;GAAE;GAC/C,cAAa;GACb,UAAS;GACT,cAAa;GACN;EACP,CAAA;CAEF,CAAA;AAEH;AAEA,EAAiB,cAAc"}
1
+ {"version":3,"file":"dropdown.js","names":[],"sources":["../../../../components/trial-bar/dropdown.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport Dropdown from '../menu-dropdown';\nimport { type MenuDropdownBaseProps } from '../menu-dropdown/menu-dropdown';\nimport Button from '../button';\n\nimport { TRIAL_BAR_DROPDOWN } from '../../utilities/constants';\n\nexport interface TrialBarDropdownProps extends Omit<\n\tMenuDropdownBaseProps,\n\t'inverse' | 'label' | 'trigger'\n> {\n\t/**\n\t * Label rendered on the dropdown trigger button.\n\t */\n\tlabel?: string;\n}\n\n/**\n * A `MenuDropdown` within the Trial Bar.\n */\nconst TrialBarDropdown = (props: TrialBarDropdownProps) => {\n\tconst { label, triggerClassName, ...rest } = props;\n\treturn (\n\t\t<Dropdown\n\t\t\t{...rest}\n\t\t\tinverse\n\t\t\ttriggerClassName={classNames('slds-grid', triggerClassName)}\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tinverse\n\t\t\t\t\tstyle={{ border: 0, height: '100%', padding: 0 }}\n\t\t\t\t\ticonCategory=\"utility\"\n\t\t\t\t\ticonName=\"right\"\n\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\tlabel={label}\n\t\t\t\t/>\n\t\t\t}\n\t\t/>\n\t);\n};\n\nTrialBarDropdown.displayName = TRIAL_BAR_DROPDOWN;\nexport default TrialBarDropdown;\n"],"mappings":";;;;;;AAqBA,IAAM,KAAoB,MAAiC;CAC1D,IAAM,EAAE,UAAO,qBAAkB,GAAG,MAAS;CAC7C,OACC,kBAAC,GAAD;EACC,GAAI;EACJ,SAAA;EACA,kBAAkB,EAAW,aAAa,CAAgB;EAC1D,SACC,kBAAC,GAAD;GACC,SAAA;GACA,OAAO;IAAE,QAAQ;IAAG,QAAQ;IAAQ,SAAS;GAAE;GAC/C,cAAa;GACb,UAAS;GACT,cAAa;GACN;EACP,CAAA;CAEF,CAAA;AAEH;AAEA,EAAiB,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"item-label.js","names":[],"sources":["../../../../../components/utilities/menu-list/item-label.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// # List Item Label Component\n\n// ## Dependencies\n\n// ### React\nimport { type ReactNode } from 'react';\n\n// ## Constants\nimport { LIST_ITEM_LABEL } from '../../../utilities/constants';\n\nexport interface ListItemLabelProps {\n\tdata?: Record<string, unknown>;\n\ticon?: ReactNode;\n\tindex?: number;\n\tinverted?: boolean;\n\tisSelected?: boolean;\n\tlabel?: string;\n\tcheckmark?: boolean;\n\tvalue?: unknown;\n}\n\n/**\n * Component description.\n */\nconst ListItemLabel = ({ label = '', icon }: ListItemLabelProps) => (\n\t<span className=\"slds-truncate\" title={label}>\n\t\t{icon}\n\t\t{label}\n\t</span>\n);\n\nListItemLabel.displayName = LIST_ITEM_LABEL;\n\nexport default ListItemLabel;\n"],"mappings":";;;AA2BA,IAAM,KAAiB,EAAE,WAAQ,IAAI,cACpC,kBAAC,QAAD;CAAM,WAAU;CAAgB,OAAO;CAAvC,UAAA,CACE,GACA,CACI;;AAGP,EAAc,cAAc"}
1
+ {"version":3,"file":"item-label.js","names":[],"sources":["../../../../../components/utilities/menu-list/item-label.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// # List Item Label Component\n\n// ## Dependencies\n\n// ### React\nimport { type ReactNode } from 'react';\n\n// ## Constants\nimport { LIST_ITEM_LABEL } from '../../../utilities/constants';\n\n/**\n * Props a menu item passes to its label renderer (`renderLabel` or\n * `labelRenderer`), taken from the menu option.\n */\nexport interface ListItemLabelProps {\n\t/** The option's `data`. */\n\tdata?: Record<string, unknown>;\n\t/** The rendered left icon, or the checkmark in the checkmark variant. */\n\ticon?: ReactNode;\n\t/** Index of the item in the menu. */\n\tindex?: number;\n\t/** Whether the menu uses the inverse color scheme. */\n\tinverted?: boolean;\n\t/** Whether the item is selected. */\n\tisSelected?: boolean;\n\t/** The option's `label`. Also used as the `title`. */\n\tlabel?: string;\n\t/** Whether the item shows a checkmark when selected. */\n\tcheckmark?: boolean;\n\t/** The option's `value`. */\n\tvalue?: unknown;\n}\n\n/**\n * Component description.\n */\nconst ListItemLabel = ({ label = '', icon }: ListItemLabelProps) => (\n\t<span className=\"slds-truncate\" title={label}>\n\t\t{icon}\n\t\t{label}\n\t</span>\n);\n\nListItemLabel.displayName = LIST_ITEM_LABEL;\n\nexport default ListItemLabel;\n"],"mappings":";;;AAuCA,IAAM,KAAiB,EAAE,WAAQ,IAAI,cACpC,kBAAC,QAAD;CAAM,WAAU;CAAgB,OAAO;CAAvC,UAAA,CACE,GACA,CACI;;AAGP,EAAc,cAAc"}
@@ -1,11 +1,11 @@
1
1
  //#region utilities/get-component-doc.js
2
- var e = function() {}, t = "https://react.lightningdesignsystem.com";
3
- process.env.NODE_ENV !== "production" && (e = function(e) {
4
- let n = `${t + (e && e["url-slug"] ? `/components/${e["url-slug"]}` : "")}`;
5
- return (e) => `Please check the current documentation at: ${e ? `${n}#prop-${e}` : n}`;
2
+ var e = "https://opensource.salesforce.com/design-system-react/", t = (t) => t ? `${e}?path=/docs/components-${t.toLowerCase()}--docs` : e, n = function() {};
3
+ process.env.NODE_ENV !== "production" && (n = function(e) {
4
+ let n = t(e && e.classKey);
5
+ return () => `See the documentation: ${n}`;
6
6
  });
7
- var n = e;
7
+ var r = n;
8
8
  //#endregion
9
- export { n as default };
9
+ export { e as DOCS_SITE, r as default, t as storybookDocsUrl };
10
10
 
11
11
  //# sourceMappingURL=get-component-doc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-component-doc.js","names":[],"sources":["../../../utilities/get-component-doc.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\nlet getComponentDocFn = function getComponentDocFnEmpty() {};\n\nconst baseURL = 'https://react.lightningdesignsystem.com';\n\nif (process.env.NODE_ENV !== 'production') {\n\tgetComponentDocFn = function getComponentDocFnInside(jsonDoc) {\n\t\tconst componentUrl = `${\n\t\t\tbaseURL +\n\t\t\t(jsonDoc && jsonDoc['url-slug']\n\t\t\t\t? `/components/${jsonDoc['url-slug']}`\n\t\t\t\t: '')\n\t\t}`;\n\t\treturn (propName) =>\n\t\t\t`Please check the current documentation at: ${\n\t\t\t\tpropName ? `${componentUrl}#prop-${propName}` : componentUrl\n\t\t\t}`;\n\t};\n}\n\nexport default getComponentDocFn;\n"],"mappings":";AAIA,IAAI,IAAoB,WAAkC,CAAC,GAErD,IAAU;AAEhB,QAAA,IAAA,aAA6B,iBAC5B,IAAoB,SAAiC,GAAS;CAC7D,IAAM,IAAe,GACpB,KACC,KAAW,EAAQ,cACjB,eAAe,EAAQ,gBACvB;CAEJ,QAAQ,MACP,8CACC,IAAW,GAAG,EAAa,QAAQ,MAAa;AAEnD;AAGD,IAAA,IAAe"}
1
+ {"version":3,"file":"get-component-doc.js","names":[],"sources":["../../../utilities/get-component-doc.js"],"sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n/* eslint-disable import/no-mutable-exports */\n\n/** The hosted v11 docs: Storybook, with the LLM docs at the root. */\nexport const DOCS_SITE =\n\t'https://opensource.salesforce.com/design-system-react/';\n\n/**\n * The Storybook docs page of a component. A component's stories file has the\n * title `Components/<classKey>` (its `component.json` `classKey`), and\n * Storybook makes the page id from the title: `Components/ButtonGroup` is\n * `components-buttongroup--docs`. `scripts/__tests__/storybook-doc-links.test.mjs`\n * checks every component against Storybook's own `toId`.\n */\nexport const storybookDocsUrl = (classKey) =>\n\tclassKey\n\t\t? `${DOCS_SITE}?path=/docs/components-${classKey.toLowerCase()}--docs`\n\t\t: DOCS_SITE;\n\nlet getComponentDocFn = function getComponentDocFnEmpty() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\t/**\n\t * Returns the link that a component's prop warnings end with. Callers pass\n\t * the prop name, but Storybook has no anchor per prop, so every warning\n\t * links the component's docs page.\n\t */\n\tgetComponentDocFn = function getComponentDocFnInside(jsonDoc) {\n\t\tconst url = storybookDocsUrl(jsonDoc && jsonDoc.classKey);\n\t\treturn () => `See the documentation: ${url}`;\n\t};\n}\n\nexport default getComponentDocFn;\n"],"mappings":";AAKA,IAAa,IACZ,0DASY,KAAoB,MAChC,IACG,GAAG,EAAU,yBAAyB,EAAS,YAAY,EAAE,UAC7D,GAEA,IAAoB,WAAkC,CAAC;AAE3D,QAAA,IAAA,aAA6B,iBAM5B,IAAoB,SAAiC,GAAS;CAC7D,IAAM,IAAM,EAAiB,KAAW,EAAQ,QAAQ;CACxD,aAAa,0BAA0B;AACxC;AAGD,IAAA,IAAe"}
@@ -1,16 +1,17 @@
1
1
  import { createWarnedMap as e } from "./warned-registry.js";
2
- import t from "warning";
2
+ import { REMOVAL_VERSION as t } from "./removal-version.js";
3
+ import n from "warning";
3
4
  //#region utilities/warning/children-as-trigger.ts
4
- var n = function() {};
5
+ var r = function() {};
5
6
  if (process.env.NODE_ENV !== "production") {
6
- let r = e();
7
- n = function(e, n, i) {
8
- let a = i ? ` ${i}` : "";
9
- n && !r[e] && (t(!1, `[Design System React] Passing the trigger of ${e} as \`children\` is deprecated and will be removed in the next major version. Use \`trigger\` instead: an element, whose props ${e} merges with its own, or a function that receives ${e}'s trigger props.${a}`), r[e] = !0);
7
+ let i = e();
8
+ r = function(e, r, a) {
9
+ let o = a ? ` ${a}` : "";
10
+ r && !i[e] && (n(!1, `[Design System React] Passing the trigger of ${e} as \`children\` is deprecated and will be removed in ${t}. Use \`trigger\` instead: an element, whose props ${e} merges with its own, or a function that receives ${e}'s trigger props.${o}`), i[e] = !0);
10
11
  };
11
12
  }
12
- var r = n;
13
+ var i = r;
13
14
  //#endregion
14
- export { r as default };
15
+ export { i as default };
15
16
 
16
17
  //# sourceMappingURL=children-as-trigger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"children-as-trigger.js","names":[],"sources":["../../../../utilities/warning/children-as-trigger.ts"],"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\nimport warning from 'warning';\nimport { createWarnedMap } from './warned-registry';\n\n// Warns once per component when its trigger is passed as `children` instead of `trigger`.\nlet childrenAsTrigger: (\n\tcontrol: string,\n\tusesChildrenAsTrigger: boolean,\n\tcomment?: string\n) => void = function childrenAsTriggerFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tconst hasWarned = createWarnedMap();\n\n\tchildrenAsTrigger = function childrenAsTriggerFunction(\n\t\tcontrol,\n\t\tusesChildrenAsTrigger,\n\t\tcomment\n\t) {\n\t\tconst additionalComment = comment ? ` ${comment}` : '';\n\t\tif (usesChildrenAsTrigger && !hasWarned[control]) {\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] Passing the trigger of ${control} as \\`children\\` is deprecated and will be removed in the next major version. Use \\`trigger\\` instead: an element, whose props ${control} merges with its own, or a function that receives ${control}'s trigger props.${additionalComment}`\n\t\t\t);\n\t\t\t/* eslint-enable max-len */\n\t\t\thasWarned[control] = true;\n\t\t}\n\t};\n}\n\nexport default childrenAsTrigger;\n"],"mappings":";;;AASA,IAAI,IAIQ,WAAqC,CAAC;AAElD,IAAA,QAAA,IAAA,aAA6B,cAAc;CAC1C,IAAM,IAAY,EAAgB;CAElC,IAAoB,SACnB,GACA,GACA,GACC;EACD,IAAM,IAAoB,IAAU,IAAI,MAAY;EACpD,AAAI,KAAyB,CAAC,EAAU,OAEvC,EACC,IACA,gDAAgD,EAAQ,iIAAiI,EAAQ,oDAAoD,EAAQ,mBAAmB,GACjR,GAEA,EAAU,KAAW;CAEvB;AACD;AAEA,IAAA,IAAe"}
1
+ {"version":3,"file":"children-as-trigger.js","names":[],"sources":["../../../../utilities/warning/children-as-trigger.ts"],"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\nimport warning from 'warning';\nimport { createWarnedMap } from './warned-registry';\nimport { REMOVAL_VERSION } from './removal-version';\n\n// Warns once per component when its trigger is passed as `children` instead of `trigger`.\nlet childrenAsTrigger: (\n\tcontrol: string,\n\tusesChildrenAsTrigger: boolean,\n\tcomment?: string\n) => void = function childrenAsTriggerFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tconst hasWarned = createWarnedMap();\n\n\tchildrenAsTrigger = function childrenAsTriggerFunction(\n\t\tcontrol,\n\t\tusesChildrenAsTrigger,\n\t\tcomment\n\t) {\n\t\tconst additionalComment = comment ? ` ${comment}` : '';\n\t\tif (usesChildrenAsTrigger && !hasWarned[control]) {\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] Passing the trigger of ${control} as \\`children\\` is deprecated and will be removed in ${REMOVAL_VERSION}. Use \\`trigger\\` instead: an element, whose props ${control} merges with its own, or a function that receives ${control}'s trigger props.${additionalComment}`\n\t\t\t);\n\t\t\t/* eslint-enable max-len */\n\t\t\thasWarned[control] = true;\n\t\t}\n\t};\n}\n\nexport default childrenAsTrigger;\n"],"mappings":";;;;AAUA,IAAI,IAIQ,WAAqC,CAAC;AAElD,IAAA,QAAA,IAAA,aAA6B,cAAc;CAC1C,IAAM,IAAY,EAAgB;CAElC,IAAoB,SACnB,GACA,GACA,GACC;EACD,IAAM,IAAoB,IAAU,IAAI,MAAY;EACpD,AAAI,KAAyB,CAAC,EAAU,OAEvC,EACC,IACA,gDAAgD,EAAQ,wDAAwD,EAAgB,qDAAqD,EAAQ,oDAAoD,EAAQ,mBAAmB,GAC7Q,GAEA,EAAU,KAAW;CAEvB;AACD;AAEA,IAAA,IAAe"}
@@ -1,19 +1,20 @@
1
1
  import { createWarnedMap as e } from "./warned-registry.js";
2
- import t from "warning";
2
+ import { REMOVAL_VERSION as t } from "./removal-version.js";
3
+ import n from "warning";
3
4
  //#region utilities/warning/deprecated-property-value.js
4
- var n = function() {};
5
+ var r = function() {};
5
6
  if (process.env.NODE_ENV !== "production") {
6
- let r = e();
7
- n = function(e, { propAsString: n, propValue: i, deprecatedPropValue: a, replacementPropAsString: o, replacementPropAsValue: s, log: c }, l) {
8
- let u = l ? ` ${l}` : "", d = e + n + a, f = i === a, p = a && o && s ? ` Replace \`${n}="${a}"\` with \`${o}="${s}"\`.` : "";
9
- if (!r[d]) {
10
- let i = `[Design System React] The value of \`${a}\`, for prop \`${n}\` will be removed in the next major version of ${e}. Please update your props.${p}${u}`;
11
- f && c ? c({ message: i }) : t(!f, i), r[d] = f;
7
+ let i = e();
8
+ r = function(e, { propAsString: r, propValue: a, deprecatedPropValue: o, replacementPropAsString: s, replacementPropAsValue: c, log: l }, u) {
9
+ let d = u ? ` ${u}` : "", f = e + r + o, p = a === o, m = o && s && c ? ` Replace \`${r}="${o}"\` with \`${s}="${c}"\`.` : "";
10
+ if (!i[f]) {
11
+ let a = `[Design System React] The value of \`${o}\`, for prop \`${r}\` will be removed from ${e} in ${t}. Please update your props.${m}${d}`;
12
+ p && l ? l({ message: a }) : n(!p, a), i[f] = p;
12
13
  }
13
14
  };
14
15
  }
15
- var r = n;
16
+ var i = r;
16
17
  //#endregion
17
- export { r as default };
18
+ export { i as default };
18
19
 
19
20
  //# sourceMappingURL=deprecated-property-value.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deprecated-property-value.js","names":[],"sources":["../../../../utilities/warning/deprecated-property-value.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/* eslint-disable max-len */\n\n// This function will deliver an error message to the browser console about the future of a removal and moving of a property's valid value to another prop. This makes the most sense to be used with `oneOf` prop types.\nimport warning from 'warning';\nimport { createWarnedMap } from './warned-registry';\n\nlet deprecated = function deprecatedFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tconst hasWarned = createWarnedMap();\n\n\tdeprecated = function deprecatedFunction(\n\t\tcontrol,\n\t\t{\n\t\t\tpropAsString, // key name of prop being warned about\n\t\t\tpropValue, // actual value of prop being warned about\n\t\t\tdeprecatedPropValue, // value that is being deprecated\n\t\t\treplacementPropAsString, // prop that value is being moved to\n\t\t\treplacementPropAsValue, // value that should be used in new prop\n\t\t\tlog, // log function that will disable console warning and pipe to another function log({ message })\n\t\t},\n\t\tcomment\n\t) {\n\t\tconst additionalComment = comment ? ` ${comment}` : '';\n\t\tconst warnOnFirstOccurrenceKey =\n\t\t\tcontrol + propAsString + deprecatedPropValue;\n\t\tconst triggerWarning = propValue === deprecatedPropValue;\n\t\tconst replacementSentence =\n\t\t\tdeprecatedPropValue && replacementPropAsString && replacementPropAsValue\n\t\t\t\t? ` Replace \\`${propAsString}=\"${deprecatedPropValue}\"\\` with \\`${replacementPropAsString}=\"${replacementPropAsValue}\"\\`.`\n\t\t\t\t: '';\n\n\t\tif (!hasWarned[warnOnFirstOccurrenceKey]) {\n\t\t\tconst message = `[Design System React] The value of \\`${deprecatedPropValue}\\`, for prop \\`${propAsString}\\` will be removed in the next major version of ${control}. Please update your props.${replacementSentence}${additionalComment}`;\n\n\t\t\tif (triggerWarning && log) {\n\t\t\t\tlog({ message });\n\t\t\t} else {\n\t\t\t\twarning(\n\t\t\t\t\t!triggerWarning, // false value triggers warning\n\t\t\t\t\tmessage\n\t\t\t\t);\n\t\t\t}\n\t\t\t// store global flag to limit warnings to first issue\n\t\t\thasWarned[warnOnFirstOccurrenceKey] = triggerWarning;\n\t\t}\n\t};\n}\n\nexport default deprecated;\n"],"mappings":";;;AAUA,IAAI,IAAa,WAA8B,CAAC;AAEhD,IAAA,QAAA,IAAA,aAA6B,cAAc;CAC1C,IAAM,IAAY,EAAgB;CAElC,IAAa,SACZ,GACA,EACC,iBACA,cACA,wBACA,4BACA,2BACA,UAED,GACC;EACD,IAAM,IAAoB,IAAU,IAAI,MAAY,IAC9C,IACL,IAAU,IAAe,GACpB,IAAiB,MAAc,GAC/B,IACL,KAAuB,KAA2B,IAC/C,cAAc,EAAa,IAAI,EAAoB,aAAa,EAAwB,IAAI,EAAuB,QACnH;EAEJ,IAAI,CAAC,EAAU,IAA2B;GACzC,IAAM,IAAU,wCAAwC,EAAoB,iBAAiB,EAAa,kDAAkD,EAAQ,6BAA6B,IAAsB;GAWvN,AATI,KAAkB,IACrB,EAAI,EAAE,WAAQ,CAAC,IAEf,EACC,CAAC,GACD,CACD,GAGD,EAAU,KAA4B;EACvC;CACD;AACD;AAEA,IAAA,IAAe"}
1
+ {"version":3,"file":"deprecated-property-value.js","names":[],"sources":["../../../../utilities/warning/deprecated-property-value.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/* eslint-disable max-len */\n\n// This function will deliver an error message to the browser console about the future of a removal and moving of a property's valid value to another prop. This makes the most sense to be used with `oneOf` prop types.\nimport warning from 'warning';\nimport { createWarnedMap } from './warned-registry';\nimport { REMOVAL_VERSION } from './removal-version';\n\nlet deprecated = function deprecatedFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tconst hasWarned = createWarnedMap();\n\n\tdeprecated = function deprecatedFunction(\n\t\tcontrol,\n\t\t{\n\t\t\tpropAsString, // key name of prop being warned about\n\t\t\tpropValue, // actual value of prop being warned about\n\t\t\tdeprecatedPropValue, // value that is being deprecated\n\t\t\treplacementPropAsString, // prop that value is being moved to\n\t\t\treplacementPropAsValue, // value that should be used in new prop\n\t\t\tlog, // log function that will disable console warning and pipe to another function log({ message })\n\t\t},\n\t\tcomment\n\t) {\n\t\tconst additionalComment = comment ? ` ${comment}` : '';\n\t\tconst warnOnFirstOccurrenceKey =\n\t\t\tcontrol + propAsString + deprecatedPropValue;\n\t\tconst triggerWarning = propValue === deprecatedPropValue;\n\t\tconst replacementSentence =\n\t\t\tdeprecatedPropValue && replacementPropAsString && replacementPropAsValue\n\t\t\t\t? ` Replace \\`${propAsString}=\"${deprecatedPropValue}\"\\` with \\`${replacementPropAsString}=\"${replacementPropAsValue}\"\\`.`\n\t\t\t\t: '';\n\n\t\tif (!hasWarned[warnOnFirstOccurrenceKey]) {\n\t\t\tconst message = `[Design System React] The value of \\`${deprecatedPropValue}\\`, for prop \\`${propAsString}\\` will be removed from ${control} in ${REMOVAL_VERSION}. Please update your props.${replacementSentence}${additionalComment}`;\n\n\t\t\tif (triggerWarning && log) {\n\t\t\t\tlog({ message });\n\t\t\t} else {\n\t\t\t\twarning(\n\t\t\t\t\t!triggerWarning, // false value triggers warning\n\t\t\t\t\tmessage\n\t\t\t\t);\n\t\t\t}\n\t\t\t// store global flag to limit warnings to first issue\n\t\t\thasWarned[warnOnFirstOccurrenceKey] = triggerWarning;\n\t\t}\n\t};\n}\n\nexport default deprecated;\n"],"mappings":";;;;AAWA,IAAI,IAAa,WAA8B,CAAC;AAEhD,IAAA,QAAA,IAAA,aAA6B,cAAc;CAC1C,IAAM,IAAY,EAAgB;CAElC,IAAa,SACZ,GACA,EACC,iBACA,cACA,wBACA,4BACA,2BACA,UAED,GACC;EACD,IAAM,IAAoB,IAAU,IAAI,MAAY,IAC9C,IACL,IAAU,IAAe,GACpB,IAAiB,MAAc,GAC/B,IACL,KAAuB,KAA2B,IAC/C,cAAc,EAAa,IAAI,EAAoB,aAAa,EAAwB,IAAI,EAAuB,QACnH;EAEJ,IAAI,CAAC,EAAU,IAA2B;GACzC,IAAM,IAAU,wCAAwC,EAAoB,iBAAiB,EAAa,0BAA0B,EAAQ,MAAM,EAAgB,6BAA6B,IAAsB;GAWrN,AATI,KAAkB,IACrB,EAAI,EAAE,WAAQ,CAAC,IAEf,EACC,CAAC,GACD,CACD,GAGD,EAAU,KAA4B;EACvC;CACD;AACD;AAEA,IAAA,IAAe"}
@@ -1,16 +1,17 @@
1
1
  import { createWarnedMap as e } from "./warned-registry.js";
2
- import t from "warning";
2
+ import { REMOVAL_VERSION as t } from "./removal-version.js";
3
+ import n from "warning";
3
4
  //#region utilities/warning/deprecated-property.js
4
- var n = function() {};
5
+ var r = function() {};
5
6
  if (process.env.NODE_ENV !== "production") {
6
- let r = e();
7
- n = function(e, n, i, a, o, s) {
8
- let c = o ? ` ${o}` : "", l = a ? `Use \`${a}\`` : "", u = a ? ` ${l} instead.` : "";
9
- !s && !r[e + i] && (t(n === void 0, `[Design System React] \`${i}\` will be removed in the next major version of ${e}.${u}${c}`), r[e + i] = n !== void 0);
7
+ let i = e();
8
+ r = function(e, r, a, o, s, c) {
9
+ let l = s ? ` ${s}` : "", u = o ? `Use \`${o}\`` : "", d = o ? ` ${u} instead.` : "";
10
+ !c && !i[e + a] && (n(r === void 0, `[Design System React] \`${a}\` will be removed from ${e} in ${t}.${d}${l}`), i[e + a] = r !== void 0);
10
11
  };
11
12
  }
12
- var r = n;
13
+ var i = r;
13
14
  //#endregion
14
- export { r as default };
15
+ export { i as default };
15
16
 
16
17
  //# sourceMappingURL=deprecated-property.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deprecated-property.js","names":[],"sources":["../../../../utilities/warning/deprecated-property.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 about the removal of a property.\nimport warning from 'warning';\nimport { createWarnedMap } from './warned-registry';\n\nlet deprecated = function deprecatedFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tconst hasWarned = createWarnedMap();\n\n\tdeprecated = function deprecatedFunction(\n\t\tcontrol,\n\t\tpropValue,\n\t\toldProp,\n\t\tnewProp,\n\t\tcomment,\n\t\tsilenceDeprecatedPropertyWarning\n\t) {\n\t\tconst additionalComment = comment ? ` ${comment}` : '';\n\t\tconst newProperty = newProp ? `Use \\`${newProp}\\`` : '';\n\t\tconst newPropertySentence = newProp ? ` ${newProperty} instead.` : '';\n\t\tif (!silenceDeprecatedPropertyWarning && !hasWarned[control + oldProp]) {\n\t\t\t/* eslint-disable max-len */\n\t\t\twarning(\n\t\t\t\tpropValue === undefined,\n\t\t\t\t`[Design System React] \\`${oldProp}\\` will be removed in the next major version of ${control}.${newPropertySentence}${additionalComment}`\n\t\t\t);\n\t\t\t/* eslint-enable max-len */\n\t\t\thasWarned[control + oldProp] = propValue !== undefined;\n\t\t}\n\t};\n}\n\nexport default deprecated;\n"],"mappings":";;;AASA,IAAI,IAAa,WAA8B,CAAC;AAEhD,IAAA,QAAA,IAAA,aAA6B,cAAc;CAC1C,IAAM,IAAY,EAAgB;CAElC,IAAa,SACZ,GACA,GACA,GACA,GACA,GACA,GACC;EACD,IAAM,IAAoB,IAAU,IAAI,MAAY,IAC9C,IAAc,IAAU,SAAS,EAAQ,MAAM,IAC/C,IAAsB,IAAU,IAAI,EAAY,aAAa;EACnE,AAAI,CAAC,KAAoC,CAAC,EAAU,IAAU,OAE7D,EACC,MAAc,KAAA,GACd,2BAA2B,EAAQ,kDAAkD,EAAQ,GAAG,IAAsB,GACvH,GAEA,EAAU,IAAU,KAAW,MAAc,KAAA;CAE/C;AACD;AAEA,IAAA,IAAe"}
1
+ {"version":3,"file":"deprecated-property.js","names":[],"sources":["../../../../utilities/warning/deprecated-property.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 about the removal of a property.\nimport warning from 'warning';\nimport { createWarnedMap } from './warned-registry';\nimport { REMOVAL_VERSION } from './removal-version';\n\nlet deprecated = function deprecatedFunction() {};\n\nif (process.env.NODE_ENV !== 'production') {\n\tconst hasWarned = createWarnedMap();\n\n\tdeprecated = function deprecatedFunction(\n\t\tcontrol,\n\t\tpropValue,\n\t\toldProp,\n\t\tnewProp,\n\t\tcomment,\n\t\tsilenceDeprecatedPropertyWarning\n\t) {\n\t\tconst additionalComment = comment ? ` ${comment}` : '';\n\t\tconst newProperty = newProp ? `Use \\`${newProp}\\`` : '';\n\t\tconst newPropertySentence = newProp ? ` ${newProperty} instead.` : '';\n\t\tif (!silenceDeprecatedPropertyWarning && !hasWarned[control + oldProp]) {\n\t\t\t/* eslint-disable max-len */\n\t\t\twarning(\n\t\t\t\tpropValue === undefined,\n\t\t\t\t`[Design System React] \\`${oldProp}\\` will be removed from ${control} in ${REMOVAL_VERSION}.${newPropertySentence}${additionalComment}`\n\t\t\t);\n\t\t\t/* eslint-enable max-len */\n\t\t\thasWarned[control + oldProp] = propValue !== undefined;\n\t\t}\n\t};\n}\n\nexport default deprecated;\n"],"mappings":";;;;AAUA,IAAI,IAAa,WAA8B,CAAC;AAEhD,IAAA,QAAA,IAAA,aAA6B,cAAc;CAC1C,IAAM,IAAY,EAAgB;CAElC,IAAa,SACZ,GACA,GACA,GACA,GACA,GACA,GACC;EACD,IAAM,IAAoB,IAAU,IAAI,MAAY,IAC9C,IAAc,IAAU,SAAS,EAAQ,MAAM,IAC/C,IAAsB,IAAU,IAAI,EAAY,aAAa;EACnE,AAAI,CAAC,KAAoC,CAAC,EAAU,IAAU,OAE7D,EACC,MAAc,KAAA,GACd,2BAA2B,EAAQ,0BAA0B,EAAQ,MAAM,EAAgB,GAAG,IAAsB,GACrH,GAEA,EAAU,IAAU,KAAW,MAAc,KAAA;CAE/C;AACD;AAEA,IAAA,IAAe"}
@@ -0,0 +1,6 @@
1
+ //#region utilities/warning/removal-version.ts
2
+ var e = "11.0.0";
3
+ //#endregion
4
+ export { e as REMOVAL_VERSION };
5
+
6
+ //# sourceMappingURL=removal-version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removal-version.js","names":[],"sources":["../../../../utilities/warning/removal-version.ts"],"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// The release that removes what is deprecated now. Props deprecated in the\n// 11.0.0 release candidates work only in those releases.\nexport const REMOVAL_VERSION = '11.0.0';\n"],"mappings":";AAKA,IAAa,IAAkB"}
@@ -0,0 +1,267 @@
1
+ # Accordion
2
+
3
+ An accordion allows a user to toggle the display of sections of content.
4
+ The accordion component wraps accordion panels that can be selected and expanded.
5
+
6
+ ## Import
7
+
8
+ ```tsx
9
+ import { Accordion, AccordionPanel } from '@salesforce/design-system-react';
10
+ // or, one entry point per module:
11
+ import Accordion from '@salesforce/design-system-react/components/accordion';
12
+ import AccordionPanel from '@salesforce/design-system-react/components/accordion/panel';
13
+ ```
14
+
15
+ ## Accordion props
16
+
17
+ ```ts
18
+ import type { AccordionProps } from '@salesforce/design-system-react/components/accordion';
19
+ ```
20
+
21
+ | Prop | Type | Required | Description |
22
+ | --- | --- | --- | --- |
23
+ | `children` | `ChildrenOf<AccordionPanelProps>` | Yes | `AccordionPanel` elements |
24
+ | `className` | `string \| string[] \| Record<string, boolean>` | | CSS classes |
25
+ | `id` | `string \| number` | | HTML id |
26
+
27
+ ## AccordionPanel props
28
+
29
+ The panel content for the Accordion component.
30
+
31
+ ```ts
32
+ import type { AccordionPanelProps } from '@salesforce/design-system-react/components/accordion/panel';
33
+ ```
34
+
35
+ | Prop | Type | Required | Description |
36
+ | --- | --- | --- | --- |
37
+ | `children` | `ReactNode` | | The panel content for the Accordion component. Accordion panels should be added as <AccordionPanel />. Event handler for the accordion panels should be added to `<AccordionPanel />`. Optional `panelContentActions` component may be passed as prop. |
38
+ | `expanded` | `boolean` | Yes | Indicates whether item is expanded or not, which should be handled by `onTogglePanel`. |
39
+ | `id` | `number \| string` | Yes | Id of the item belonging to this panel. |
40
+ | `onTogglePanel` | `(event: MouseEvent) => void` | Yes | Callback that will run whenever a panel is toggled. Function should handle state to toggle `expanded` prop. |
41
+ | `panelContentActions` | `ReactNode` | | Component that can be passed as prop to `<Panel />`. As an example, a menu dropdown could be used here to handle additional actions for each accordion panel. |
42
+ | `summary` | `string \| ReactNode` | Yes | Summary in the span element in the header of this panel. The summary is truncated and so the title element should contain the full text so that it is accessible on hover. |
43
+ | `title` | `string` | | HTML title attribute. |
44
+
45
+ ## Types
46
+
47
+ Declarations the props above refer to, from the package `.d.ts`:
48
+
49
+ ```ts
50
+ /**
51
+ * `children` that must be elements of library components with props `P`
52
+ * (e.g. `ChildrenOf<TabsPanelProps>`), possibly in arrays or
53
+ * skipped with `false`/`null`. The parent matches its children by component
54
+ * reference, so `P` documents the contract; TypeScript can't check which
55
+ * component a JSX element came from.
56
+ */
57
+ export type ChildrenOf<P> = React.ReactElement<P> | false | null | undefined | ChildrenOf<P>[];
58
+
59
+ export interface AccordionPanelProps {
60
+ /**
61
+ * The panel content for the Accordion component. Accordion panels should be added as <AccordionPanel />. Event handler for the accordion panels should be added to `<AccordionPanel />`. Optional `panelContentActions` component may be passed as prop.
62
+ */
63
+ children?: ReactNode;
64
+ /**
65
+ * Indicates whether item is expanded or not, which should be handled by `onTogglePanel`.
66
+ */
67
+ expanded: boolean;
68
+ /**
69
+ * Id of the item belonging to this panel.
70
+ */
71
+ id: number | string;
72
+ /**
73
+ * Component that can be passed as prop to `<Panel />`. As an example, a menu dropdown could be used here to handle additional actions for each accordion panel.
74
+ */
75
+ panelContentActions?: ReactNode;
76
+ /**
77
+ * Callback that will run whenever a panel is toggled. Function should handle state to toggle `expanded` prop.
78
+ */
79
+ onTogglePanel: (event: MouseEvent) => void;
80
+ /**
81
+ * Summary in the span element in the header of this panel. The summary is truncated and so the title element should contain the full text so that it is accessible on hover.
82
+ */
83
+ summary: string | ReactNode;
84
+ /**
85
+ * HTML title attribute.
86
+ */
87
+ title?: string;
88
+ }
89
+ ```
90
+
91
+ ## Examples
92
+
93
+ Every story in Storybook for this component, in sidebar order, as code for an app: imports use the package paths, and Storybook's own code (`meta`, decorators, `parameters`) is left out. A story that renders an `__examples__` file shows that file the first time. Icons are served from `/assets/icons` (see `IconSettings`). Storybook: <https://opensource.salesforce.com/design-system-react/?path=/docs/components-accordion--docs>.
94
+
95
+ ### Shared code: `components/accordion/__docs__/Accordion.stories.jsx`
96
+
97
+ The stories from Components/Accordion below use these imports and helpers.
98
+
99
+ ```jsx
100
+ import { useState } from 'react';
101
+ import Accordion from '@salesforce/design-system-react/components/accordion';
102
+ import AccordionPanel from '@salesforce/design-system-react/components/accordion/panel';
103
+
104
+ // AccordionPanel is a controlled component: it renders `expanded` from its prop and
105
+ // calls `onTogglePanel` on click. The consumer owns the expanded state, so this
106
+ // wrapper tracks it and flips it on toggle, honoring the `allowMultipleOpen` arg.
107
+ const AccordionTemplate = ({
108
+ allowMultipleOpen,
109
+ defaultExpandedId,
110
+ panels,
111
+ }) => {
112
+ const [expanded, setExpanded] = useState(
113
+ defaultExpandedId ? { [defaultExpandedId]: true } : {}
114
+ );
115
+
116
+ const toggle = (id) =>
117
+ setExpanded((prev) =>
118
+ allowMultipleOpen ? { ...prev, [id]: !prev[id] } : { [id]: !prev[id] }
119
+ );
120
+
121
+ return (
122
+ <Accordion id="accordion-example">
123
+ {panels.map((panel) => (
124
+ <AccordionPanel
125
+ key={panel.id}
126
+ id={panel.id}
127
+ expanded={!!expanded[panel.id]}
128
+ summary={panel.summary}
129
+ onTogglePanel={() => toggle(panel.id)}
130
+ >
131
+ <p>{panel.content}</p>
132
+ </AccordionPanel>
133
+ ))}
134
+ </Accordion>
135
+ );
136
+ };
137
+
138
+ // Rich content — panels can hold arbitrary markup, not just text.
139
+ const RichContentStory = ({ allowMultipleOpen, defaultExpandedId }) => {
140
+ const [expanded, setExpanded] = useState({ [defaultExpandedId]: true });
141
+ const toggle = (id) =>
142
+ setExpanded((prev) =>
143
+ allowMultipleOpen ? { ...prev, [id]: !prev[id] } : { [id]: !prev[id] }
144
+ );
145
+
146
+ return (
147
+ <Accordion id="rich-content-accordion">
148
+ <AccordionPanel
149
+ id="details"
150
+ expanded={!!expanded.details}
151
+ summary="Account Details"
152
+ onTogglePanel={() => toggle('details')}
153
+ >
154
+ <dl className="slds-list_horizontal slds-wrap">
155
+ <dt className="slds-item_label slds-text-color_weak slds-truncate">
156
+ Name:
157
+ </dt>
158
+ <dd className="slds-item_detail slds-truncate">Acme Corporation</dd>
159
+ <dt className="slds-item_label slds-text-color_weak slds-truncate">
160
+ Industry:
161
+ </dt>
162
+ <dd className="slds-item_detail slds-truncate">Technology</dd>
163
+ </dl>
164
+ </AccordionPanel>
165
+ <AccordionPanel
166
+ id="contact"
167
+ expanded={!!expanded.contact}
168
+ summary="Contact Information"
169
+ onTogglePanel={() => toggle('contact')}
170
+ >
171
+ <dl className="slds-list_horizontal slds-wrap">
172
+ <dt className="slds-item_label slds-text-color_weak slds-truncate">
173
+ Email:
174
+ </dt>
175
+ <dd className="slds-item_detail slds-truncate">contact@acme.com</dd>
176
+ <dt className="slds-item_label slds-text-color_weak slds-truncate">
177
+ Phone:
178
+ </dt>
179
+ <dd className="slds-item_detail slds-truncate">(555) 123-4567</dd>
180
+ </dl>
181
+ </AccordionPanel>
182
+ </Accordion>
183
+ );
184
+ };
185
+ ```
186
+
187
+ ### Default
188
+
189
+ ```jsx
190
+ const Default = () => (
191
+ <AccordionTemplate
192
+ allowMultipleOpen={false}
193
+ defaultExpandedId="1"
194
+ panels={[
195
+ {
196
+ id: '1',
197
+ summary: 'Accordion Panel 1',
198
+ content: 'Panel 1 content goes here.',
199
+ },
200
+ {
201
+ id: '2',
202
+ summary: 'Accordion Panel 2',
203
+ content: 'Panel 2 content goes here.',
204
+ },
205
+ {
206
+ id: '3',
207
+ summary: 'Accordion Panel 3',
208
+ content: 'Panel 3 content goes here.',
209
+ },
210
+ ]}
211
+ />
212
+ );
213
+ ```
214
+
215
+ ### Multiple Expanded
216
+
217
+ ```jsx
218
+ const MultipleExpanded = () => (
219
+ <AccordionTemplate
220
+ allowMultipleOpen
221
+ defaultExpandedId="1"
222
+ panels={[
223
+ {
224
+ id: '1',
225
+ summary: 'First Panel',
226
+ content: 'First panel is expanded by default.',
227
+ },
228
+ {
229
+ id: '2',
230
+ summary: 'Second Panel',
231
+ content: 'Open a second panel without closing the first.',
232
+ },
233
+ { id: '3', summary: 'Third Panel', content: 'Third panel is collapsed.' },
234
+ ]}
235
+ />
236
+ );
237
+ ```
238
+
239
+ ### With Rich Content
240
+
241
+ Panels can contain arbitrary markup (here, description lists).
242
+
243
+ ```jsx
244
+ const WithRichContent = () => (
245
+ <RichContentStory
246
+ allowMultipleOpen={false}
247
+ defaultExpandedId="details"
248
+ panels={[
249
+ {
250
+ id: '1',
251
+ summary: 'Accordion Panel 1',
252
+ content: 'Panel 1 content goes here.',
253
+ },
254
+ {
255
+ id: '2',
256
+ summary: 'Accordion Panel 2',
257
+ content: 'Panel 2 content goes here.',
258
+ },
259
+ {
260
+ id: '3',
261
+ summary: 'Accordion Panel 3',
262
+ content: 'Panel 3 content goes here.',
263
+ },
264
+ ]}
265
+ />
266
+ );
267
+ ```