@frontify/guideline-blocks-settings 3.0.2 → 3.0.4

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 (262) hide show
  1. package/dist/_virtual/_rolldown/runtime.es.js +17 -0
  2. package/dist/components/Attachments/AttachmentItem.es.js +116 -168
  3. package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
  4. package/dist/components/Attachments/Attachments.es.js +145 -137
  5. package/dist/components/Attachments/Attachments.es.js.map +1 -1
  6. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +25 -28
  7. package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +1 -1
  8. package/dist/components/BlockInjectButton/BlockInjectButton.es.js +114 -126
  9. package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
  10. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +53 -74
  11. package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
  12. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +26 -31
  13. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +1 -1
  14. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js +22 -25
  15. package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +1 -1
  16. package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js +17 -28
  17. package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +1 -1
  18. package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +25 -35
  19. package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -1
  20. package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +41 -34
  21. package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +1 -1
  22. package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +41 -36
  23. package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +1 -1
  24. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +24 -33
  25. package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -1
  26. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +20 -11
  27. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +1 -1
  28. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js +18 -10
  29. package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +1 -1
  30. package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js +10 -12
  31. package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js.map +1 -1
  32. package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js +13 -13
  33. package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js.map +1 -1
  34. package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +21 -19
  35. package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +1 -1
  36. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +18 -25
  37. package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -1
  38. package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js +18 -17
  39. package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js.map +1 -1
  40. package/dist/components/BlockItemWrapper/constants.es.js +6 -6
  41. package/dist/components/BlockItemWrapper/constants.es.js.map +1 -1
  42. package/dist/components/Link/LinkInput.es.js +63 -63
  43. package/dist/components/Link/LinkInput.es.js.map +1 -1
  44. package/dist/components/Link/LinkSelector/DocumentLink.es.js +46 -63
  45. package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +1 -1
  46. package/dist/components/Link/LinkSelector/DocumentLinks.es.js +50 -64
  47. package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +1 -1
  48. package/dist/components/Link/LinkSelector/LinkSelector2.es.js +77 -0
  49. package/dist/components/Link/LinkSelector/LinkSelector2.es.js.map +1 -0
  50. package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +10 -6
  51. package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +1 -1
  52. package/dist/components/Link/LinkSelector/PageLink.es.js +53 -67
  53. package/dist/components/Link/LinkSelector/PageLink.es.js.map +1 -1
  54. package/dist/components/Link/LinkSelector/PageLinks.es.js +28 -37
  55. package/dist/components/Link/LinkSelector/PageLinks.es.js.map +1 -1
  56. package/dist/components/Link/LinkSelector/SectionLink.es.js +31 -24
  57. package/dist/components/Link/LinkSelector/SectionLink.es.js.map +1 -1
  58. package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js +6 -5
  59. package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +1 -1
  60. package/dist/components/Link/utils/getUrl.es.js +10 -12
  61. package/dist/components/Link/utils/getUrl.es.js.map +1 -1
  62. package/dist/components/Link/utils/relativeUrlRegex.es.js +6 -5
  63. package/dist/components/Link/utils/relativeUrlRegex.es.js.map +1 -1
  64. package/dist/components/Link/utils/url.es.js +21 -17
  65. package/dist/components/Link/utils/url.es.js.map +1 -1
  66. package/dist/components/RichTextEditor/RichTextEditor.es.js +61 -68
  67. package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
  68. package/dist/components/RichTextEditor/SerializedText.es.js +25 -22
  69. package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
  70. package/dist/components/RichTextEditor/constants.es.js +6 -5
  71. package/dist/components/RichTextEditor/constants.es.js.map +1 -1
  72. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +30 -37
  73. package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
  74. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +31 -39
  75. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
  76. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -11
  77. package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -1
  78. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +19 -23
  79. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
  80. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +24 -26
  81. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
  82. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +46 -53
  83. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -1
  84. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +52 -54
  85. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
  86. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +68 -68
  87. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -1
  88. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +91 -103
  89. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
  90. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +26 -32
  91. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -1
  92. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +47 -53
  93. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -1
  94. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +12 -18
  95. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -1
  96. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +21 -25
  97. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -1
  98. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +29 -37
  99. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -1
  100. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +13 -17
  101. package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -1
  102. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +56 -62
  103. package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
  104. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +9 -12
  105. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
  106. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +23 -24
  107. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -1
  108. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +28 -33
  109. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
  110. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +61 -80
  111. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
  112. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +23 -23
  113. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
  114. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +18 -18
  115. package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
  116. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -12
  117. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
  118. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +9 -8
  119. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -1
  120. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +11 -10
  121. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -1
  122. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +85 -84
  123. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -1
  124. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +13 -16
  125. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
  126. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +13 -16
  127. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -1
  128. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +10 -13
  129. package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
  130. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +45 -51
  131. package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
  132. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js +20 -22
  133. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js.map +1 -1
  134. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js +12 -12
  135. package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js.map +1 -1
  136. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +48 -57
  137. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
  138. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +46 -48
  139. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
  140. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +12 -8
  141. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -1
  142. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +62 -71
  143. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
  144. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +76 -77
  145. package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
  146. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +17 -21
  147. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
  148. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +17 -10
  149. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
  150. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +11 -10
  151. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -1
  152. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js +22 -26
  153. package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js.map +1 -1
  154. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +6 -5
  155. package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -1
  156. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -40
  157. package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
  158. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +10 -10
  159. package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -1
  160. package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js +26 -26
  161. package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js.map +1 -1
  162. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +40 -46
  163. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
  164. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +40 -46
  165. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
  166. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +40 -46
  167. package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
  168. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +41 -47
  169. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
  170. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +41 -47
  171. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
  172. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +41 -47
  173. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
  174. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +41 -47
  175. package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
  176. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +44 -38
  177. package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -1
  178. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +41 -47
  179. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
  180. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +40 -46
  181. package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
  182. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +45 -41
  183. package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
  184. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +40 -48
  185. package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
  186. package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js +29 -29
  187. package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js.map +1 -1
  188. package/dist/components/RichTextEditor/plugins/styles.es.js +167 -166
  189. package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
  190. package/dist/helpers/addHttps.es.js +12 -12
  191. package/dist/helpers/addHttps.es.js.map +1 -1
  192. package/dist/helpers/convertToRichTextValue.es.js +14 -6
  193. package/dist/helpers/convertToRichTextValue.es.js.map +1 -1
  194. package/dist/helpers/hasRichTextValue.es.js +13 -14
  195. package/dist/helpers/hasRichTextValue.es.js.map +1 -1
  196. package/dist/helpers/isDownloadable.es.js +6 -5
  197. package/dist/helpers/isDownloadable.es.js.map +1 -1
  198. package/dist/hooks/useAttachments.es.js +65 -73
  199. package/dist/hooks/useAttachments.es.js.map +1 -1
  200. package/dist/hooks/useIsInViewport.es.js +20 -21
  201. package/dist/hooks/useIsInViewport.es.js.map +1 -1
  202. package/dist/index.cjs.js +6 -8
  203. package/dist/index.cjs.js.map +1 -1
  204. package/dist/index.d.ts +8 -7
  205. package/dist/index.es.js +221 -213
  206. package/dist/index.es.js.map +1 -1
  207. package/dist/index.umd.js +6 -8
  208. package/dist/index.umd.js.map +1 -1
  209. package/dist/settings/background.es.js +20 -21
  210. package/dist/settings/background.es.js.map +1 -1
  211. package/dist/settings/border.es.js +62 -64
  212. package/dist/settings/border.es.js.map +1 -1
  213. package/dist/settings/borderRadius.es.js +49 -52
  214. package/dist/settings/borderRadius.es.js.map +1 -1
  215. package/dist/settings/borderRadiusExtended.es.js +58 -60
  216. package/dist/settings/borderRadiusExtended.es.js.map +1 -1
  217. package/dist/settings/defaultValues.es.js +16 -19
  218. package/dist/settings/defaultValues.es.js.map +1 -1
  219. package/dist/settings/gutter.es.js +48 -52
  220. package/dist/settings/gutter.es.js.map +1 -1
  221. package/dist/settings/margin.es.js +49 -52
  222. package/dist/settings/margin.es.js.map +1 -1
  223. package/dist/settings/marginExtended.es.js +62 -64
  224. package/dist/settings/marginExtended.es.js.map +1 -1
  225. package/dist/settings/padding.es.js +49 -52
  226. package/dist/settings/padding.es.js.map +1 -1
  227. package/dist/settings/paddingExtended.es.js +62 -64
  228. package/dist/settings/paddingExtended.es.js.map +1 -1
  229. package/dist/settings/securityDownloadable.es.js +16 -16
  230. package/dist/settings/securityDownloadable.es.js.map +1 -1
  231. package/dist/settings/securityGlobalControl.es.js +26 -32
  232. package/dist/settings/securityGlobalControl.es.js.map +1 -1
  233. package/dist/settings/types.es.js +41 -47
  234. package/dist/settings/types.es.js.map +1 -1
  235. package/dist/styles.css +2 -1
  236. package/dist/utilities/color/getReadableColor.es.js +15 -13
  237. package/dist/utilities/color/getReadableColor.es.js.map +1 -1
  238. package/dist/utilities/color/isDark.es.js +14 -9
  239. package/dist/utilities/color/isDark.es.js.map +1 -1
  240. package/dist/utilities/color/setAlpha.es.js +7 -6
  241. package/dist/utilities/color/setAlpha.es.js.map +1 -1
  242. package/dist/utilities/color/toColorObject.es.js +14 -8
  243. package/dist/utilities/color/toColorObject.es.js.map +1 -1
  244. package/dist/utilities/color/toHex8String.es.js +7 -6
  245. package/dist/utilities/color/toHex8String.es.js.map +1 -1
  246. package/dist/utilities/color/toHexString.es.js +7 -6
  247. package/dist/utilities/color/toHexString.es.js.map +1 -1
  248. package/dist/utilities/color/toRgbaString.es.js +7 -6
  249. package/dist/utilities/color/toRgbaString.es.js.map +1 -1
  250. package/dist/utilities/color/toShortRgba.es.js +18 -11
  251. package/dist/utilities/color/toShortRgba.es.js.map +1 -1
  252. package/dist/utilities/react/getBackgroundColorStyles.es.js +7 -8
  253. package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
  254. package/dist/utilities/react/getBorderStyles.es.js +12 -11
  255. package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
  256. package/dist/utilities/react/getRadiusStyles.es.js +7 -8
  257. package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
  258. package/dist/utilities/react/joinClassNames.es.js +6 -5
  259. package/dist/utilities/react/joinClassNames.es.js.map +1 -1
  260. package/package.json +8 -10
  261. package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -72
  262. package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +0 -1
@@ -1,53 +1,49 @@
1
- /* empty css */
2
- import { numericalOrPixelRule as d, appendUnit as s, presetCustomValue as g } from "@frontify/sidebar-settings";
3
- import { GutterSpacing as a, gutterSpacingStyleMap as o } from "./types.es.js";
4
- const m = (e) => {
5
- const c = e?.id ? e.id : "hasCustomSpacing", i = e?.dependentSettingId ? e.dependentSettingId : "columns", u = e?.spacingChoiceId ? e.spacingChoiceId : "spacingChoice", l = e?.spacingCustomId ? e.spacingCustomId : "spacingCustom", n = e?.defaultValueChoices ? e.defaultValueChoices : a.M;
6
- return {
7
- id: c,
8
- type: "switch",
9
- defaultValue: !1,
10
- switchLabel: "Custom",
11
- label: "Gutter",
12
- info: "An official nerds term for ‘gap’",
13
- onChange: (t) => g(t, u, l, o),
14
- show: (t) => t.getBlock(i)?.value !== "1",
15
- on: [
16
- {
17
- id: l,
18
- type: "input",
19
- rules: [d],
20
- onChange: (t) => s(t, l)
21
- }
22
- ],
23
- off: [
24
- {
25
- id: u,
26
- type: "slider",
27
- defaultValue: n,
28
- choices: [
29
- {
30
- value: a.Auto,
31
- label: "Auto"
32
- },
33
- {
34
- value: a.S,
35
- label: "S"
36
- },
37
- {
38
- value: a.M,
39
- label: "M"
40
- },
41
- {
42
- value: a.L,
43
- label: "L"
44
- }
45
- ]
46
- }
47
- ]
48
- };
1
+ import { GutterSpacing as e, gutterSpacingStyleMap as t } from "./types.es.js";
2
+ import { src_exports as n } from "../index.es.js";
3
+ //#region src/settings/gutter.ts
4
+ var r = (r) => {
5
+ let i = r?.id ? r.id : "hasCustomSpacing", a = r?.dependentSettingId ? r.dependentSettingId : "columns", o = r?.spacingChoiceId ? r.spacingChoiceId : "spacingChoice", s = r?.spacingCustomId ? r.spacingCustomId : "spacingCustom", c = r?.defaultValueChoices ? r.defaultValueChoices : e.M;
6
+ return {
7
+ id: i,
8
+ type: "switch",
9
+ defaultValue: !1,
10
+ switchLabel: "Custom",
11
+ label: "Gutter",
12
+ info: "An official nerds term for ‘gap’",
13
+ onChange: (e) => (0, n.presetCustomValue)(e, o, s, t),
14
+ show: (e) => e.getBlock(a)?.value !== "1",
15
+ on: [{
16
+ id: s,
17
+ type: "input",
18
+ rules: [n.numericalOrPixelRule],
19
+ onChange: (e) => (0, n.appendUnit)(e, s)
20
+ }],
21
+ off: [{
22
+ id: o,
23
+ type: "slider",
24
+ defaultValue: c,
25
+ choices: [
26
+ {
27
+ value: e.Auto,
28
+ label: "Auto"
29
+ },
30
+ {
31
+ value: e.S,
32
+ label: "S"
33
+ },
34
+ {
35
+ value: e.M,
36
+ label: "M"
37
+ },
38
+ {
39
+ value: e.L,
40
+ label: "L"
41
+ }
42
+ ]
43
+ }]
44
+ };
49
45
  };
50
- export {
51
- m as getGutterSettings
52
- };
53
- //# sourceMappingURL=gutter.es.js.map
46
+ //#endregion
47
+ export { r as getGutterSettings };
48
+
49
+ //# sourceMappingURL=gutter.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gutter.es.js","sources":["../../src/settings/gutter.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';\n\nimport { GutterSpacing, gutterSpacingStyleMap } from './types';\n\n/**\n * Returns gutter settings: gutter switch, gutter choices or gutter custom input\n *\n * @param options Options for the settings\n * @param options.id Custom id for the gutters switch\n * @param options.dependentSettingId Id of the dependent setting\n * @param options.spacingChoiceId Id of the spacing choice\n * @param options.defaultValueChoices Default value for the spacing choice\n * @returns {SettingBlock} Returns the gutter settings\n */\n\ntype GutterSettingsType = {\n id?: string;\n dependentSettingId?: string;\n spacingChoiceId?: string;\n spacingCustomId?: string;\n defaultValueChoices?: GutterSpacing;\n};\n\nexport const getGutterSettings = (options?: GutterSettingsType): SettingBlock => {\n const id = options?.id ? options.id : 'hasCustomSpacing';\n const dependentSettingId = options?.dependentSettingId ? options.dependentSettingId : 'columns';\n const spacingChoiceId = options?.spacingChoiceId ? options.spacingChoiceId : 'spacingChoice';\n const spacingCustomId = options?.spacingCustomId ? options.spacingCustomId : 'spacingCustom';\n const defaultValueChoices = options?.defaultValueChoices ? options.defaultValueChoices : GutterSpacing.M;\n\n return {\n id,\n type: 'switch',\n defaultValue: false,\n switchLabel: 'Custom',\n label: 'Gutter',\n info: 'An official nerds term for ‘gap’',\n onChange: (bundle) => presetCustomValue(bundle, spacingChoiceId, spacingCustomId, gutterSpacingStyleMap),\n show: (bundle) => bundle.getBlock(dependentSettingId)?.value !== '1',\n on: [\n {\n id: spacingCustomId,\n type: 'input',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, spacingCustomId),\n },\n ],\n off: [\n {\n id: spacingChoiceId,\n type: 'slider',\n defaultValue: defaultValueChoices,\n choices: [\n {\n value: GutterSpacing.Auto,\n label: 'Auto',\n },\n {\n value: GutterSpacing.S,\n label: 'S',\n },\n {\n value: GutterSpacing.M,\n label: 'M',\n },\n {\n value: GutterSpacing.L,\n label: 'L',\n },\n ],\n },\n ],\n };\n};\n"],"names":["getGutterSettings","options","id","dependentSettingId","spacingChoiceId","spacingCustomId","defaultValueChoices","GutterSpacing","bundle","presetCustomValue","gutterSpacingStyleMap","numericalOrPixelRule","appendUnit"],"mappings":";;;AAyBO,MAAMA,IAAoB,CAACC,MAA+C;AAC7E,QAAMC,IAAKD,GAAS,KAAKA,EAAQ,KAAK,oBAChCE,IAAqBF,GAAS,qBAAqBA,EAAQ,qBAAqB,WAChFG,IAAkBH,GAAS,kBAAkBA,EAAQ,kBAAkB,iBACvEI,IAAkBJ,GAAS,kBAAkBA,EAAQ,kBAAkB,iBACvEK,IAAsBL,GAAS,sBAAsBA,EAAQ,sBAAsBM,EAAc;AAEvG,SAAO;AAAA,IACH,IAAAL;AAAA,IACA,MAAM;AAAA,IACN,cAAc;AAAA,IACd,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU,CAACM,MAAWC,EAAkBD,GAAQJ,GAAiBC,GAAiBK,CAAqB;AAAA,IACvG,MAAM,CAACF,MAAWA,EAAO,SAASL,CAAkB,GAAG,UAAU;AAAA,IACjE,IAAI;AAAA,MACA;AAAA,QACI,IAAIE;AAAA,QACJ,MAAM;AAAA,QACN,OAAO,CAACM,CAAoB;AAAA,QAC5B,UAAU,CAACH,MAAWI,EAAWJ,GAAQH,CAAe;AAAA,MAAA;AAAA,IAC5D;AAAA,IAEJ,KAAK;AAAA,MACD;AAAA,QACI,IAAID;AAAA,QACJ,MAAM;AAAA,QACN,cAAcE;AAAA,QACd,SAAS;AAAA,UACL;AAAA,YACI,OAAOC,EAAc;AAAA,YACrB,OAAO;AAAA,UAAA;AAAA,UAEX;AAAA,YACI,OAAOA,EAAc;AAAA,YACrB,OAAO;AAAA,UAAA;AAAA,UAEX;AAAA,YACI,OAAOA,EAAc;AAAA,YACrB,OAAO;AAAA,UAAA;AAAA,UAEX;AAAA,YACI,OAAOA,EAAc;AAAA,YACrB,OAAO;AAAA,UAAA;AAAA,QACX;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AAER;"}
1
+ {"version":3,"file":"gutter.es.js","names":[],"sources":["../../src/settings/gutter.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';\n\nimport { GutterSpacing, gutterSpacingStyleMap } from './types';\n\n/**\n * Returns gutter settings: gutter switch, gutter choices or gutter custom input\n *\n * @param options Options for the settings\n * @param options.id Custom id for the gutters switch\n * @param options.dependentSettingId Id of the dependent setting\n * @param options.spacingChoiceId Id of the spacing choice\n * @param options.defaultValueChoices Default value for the spacing choice\n * @returns {SettingBlock} Returns the gutter settings\n */\n\ntype GutterSettingsType = {\n id?: string;\n dependentSettingId?: string;\n spacingChoiceId?: string;\n spacingCustomId?: string;\n defaultValueChoices?: GutterSpacing;\n};\n\nexport const getGutterSettings = (options?: GutterSettingsType): SettingBlock => {\n const id = options?.id ? options.id : 'hasCustomSpacing';\n const dependentSettingId = options?.dependentSettingId ? options.dependentSettingId : 'columns';\n const spacingChoiceId = options?.spacingChoiceId ? options.spacingChoiceId : 'spacingChoice';\n const spacingCustomId = options?.spacingCustomId ? options.spacingCustomId : 'spacingCustom';\n const defaultValueChoices = options?.defaultValueChoices ? options.defaultValueChoices : GutterSpacing.M;\n\n return {\n id,\n type: 'switch',\n defaultValue: false,\n switchLabel: 'Custom',\n label: 'Gutter',\n info: 'An official nerds term for ‘gap’',\n onChange: (bundle) => presetCustomValue(bundle, spacingChoiceId, spacingCustomId, gutterSpacingStyleMap),\n show: (bundle) => bundle.getBlock(dependentSettingId)?.value !== '1',\n on: [\n {\n id: spacingCustomId,\n type: 'input',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, spacingCustomId),\n },\n ],\n off: [\n {\n id: spacingChoiceId,\n type: 'slider',\n defaultValue: defaultValueChoices,\n choices: [\n {\n value: GutterSpacing.Auto,\n label: 'Auto',\n },\n {\n value: GutterSpacing.S,\n label: 'S',\n },\n {\n value: GutterSpacing.M,\n label: 'M',\n },\n {\n value: GutterSpacing.L,\n label: 'L',\n },\n ],\n },\n ],\n };\n};\n"],"mappings":";;;AAyBA,IAAa,KAAqB,MAA+C;CAC7E,IAAM,IAAK,GAAS,KAAK,EAAQ,KAAK,oBAChC,IAAqB,GAAS,qBAAqB,EAAQ,qBAAqB,WAChF,IAAkB,GAAS,kBAAkB,EAAQ,kBAAkB,iBACvE,IAAkB,GAAS,kBAAkB,EAAQ,kBAAkB,iBACvE,IAAsB,GAAS,sBAAsB,EAAQ,sBAAsB,EAAc;CAEvG,OAAO;EACH;EACA,MAAM;EACN,cAAc;EACd,aAAa;EACb,OAAO;EACP,MAAM;EACN,WAAW,OAAA,GAAW,EAAA,kBAAA,CAAkB,GAAQ,GAAiB,GAAiB,CAAqB;EACvG,OAAO,MAAW,EAAO,SAAS,CAAkB,CAAC,EAAE,UAAU;EACjE,IAAI,CACA;GACI,IAAI;GACJ,MAAM;GACN,OAAO,CAAC,EAAA,oBAAoB;GAC5B,WAAW,OAAA,GAAW,EAAA,WAAA,CAAW,GAAQ,CAAe;EAC5D,CACJ;EACA,KAAK,CACD;GACI,IAAI;GACJ,MAAM;GACN,cAAc;GACd,SAAS;IACL;KACI,OAAO,EAAc;KACrB,OAAO;IACX;IACA;KACI,OAAO,EAAc;KACrB,OAAO;IACX;IACA;KACI,OAAO,EAAc;KACrB,OAAO;IACX;IACA;KACI,OAAO,EAAc;KACrB,OAAO;IACX;GACJ;EACJ,CACJ;CACJ;AACJ"}
@@ -1,53 +1,50 @@
1
- /* empty css */
2
- import { numericalOrPixelRule as t, appendUnit as u, maximumNumericalOrPixelOrAutoRule as m, presetCustomValue as o } from "@frontify/sidebar-settings";
3
- import { MARGIN_DEFAULT_PLACEHOLDER as g } from "./defaultValues.es.js";
4
- import { Margin as a, marginStyleMap as c } from "./types.es.js";
5
- const d = (e) => ({
6
- id: e,
7
- type: "segmentedControls",
8
- defaultValue: a.None,
9
- choices: [
10
- {
11
- value: a.None,
12
- label: "None"
13
- },
14
- {
15
- value: a.Small,
16
- label: "S"
17
- },
18
- {
19
- value: a.Medium,
20
- label: "M"
21
- },
22
- {
23
- value: a.Large,
24
- label: "L"
25
- }
26
- ]
27
- }), C = (e) => {
28
- const n = e?.id ? `hasCustomMarginValue_${e?.id}` : "hasCustomMarginValue", l = e?.id ? `marginValue_${e?.id}` : "marginValue", r = e?.id ? `marginChoice_${e?.id}` : "marginChoice";
29
- return {
30
- id: n,
31
- label: "Margin",
32
- type: "switch",
33
- switchLabel: "Custom",
34
- defaultValue: !1,
35
- info: "The spacing around UI elements to create more space",
36
- onChange: (i) => o(i, r, l, e?.marginStyleMap || c),
37
- on: [
38
- {
39
- id: l,
40
- type: "input",
41
- placeholder: g,
42
- rules: [t, m(500)],
43
- onChange: (i) => u(i, l)
44
- }
45
- ],
46
- off: [d(r)]
47
- };
1
+ import { MARGIN_DEFAULT_PLACEHOLDER as e } from "./defaultValues.es.js";
2
+ import { Margin as t, marginStyleMap as n } from "./types.es.js";
3
+ import { src_exports as r } from "../index.es.js";
4
+ //#region src/settings/margin.ts
5
+ var i = (e) => ({
6
+ id: e,
7
+ type: "segmentedControls",
8
+ defaultValue: t.None,
9
+ choices: [
10
+ {
11
+ value: t.None,
12
+ label: "None"
13
+ },
14
+ {
15
+ value: t.Small,
16
+ label: "S"
17
+ },
18
+ {
19
+ value: t.Medium,
20
+ label: "M"
21
+ },
22
+ {
23
+ value: t.Large,
24
+ label: "L"
25
+ }
26
+ ]
27
+ }), a = (t) => {
28
+ let a = t?.id ? `hasCustomMarginValue_${t?.id}` : "hasCustomMarginValue", o = t?.id ? `marginValue_${t?.id}` : "marginValue", s = t?.id ? `marginChoice_${t?.id}` : "marginChoice";
29
+ return {
30
+ id: a,
31
+ label: "Margin",
32
+ type: "switch",
33
+ switchLabel: "Custom",
34
+ defaultValue: !1,
35
+ info: "The spacing around UI elements to create more space",
36
+ onChange: (e) => (0, r.presetCustomValue)(e, s, o, t?.marginStyleMap || n),
37
+ on: [{
38
+ id: o,
39
+ type: "input",
40
+ placeholder: e,
41
+ rules: [r.numericalOrPixelRule, (0, r.maximumNumericalOrPixelOrAutoRule)(500)],
42
+ onChange: (e) => (0, r.appendUnit)(e, o)
43
+ }],
44
+ off: [i(s)]
45
+ };
48
46
  };
49
- export {
50
- C as getMarginSettings,
51
- d as getMarginSlider
52
- };
53
- //# sourceMappingURL=margin.es.js.map
47
+ //#endregion
48
+ export { a as getMarginSettings, i as getMarginSlider };
49
+
50
+ //# sourceMappingURL=margin.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"margin.es.js","sources":["../../src/settings/margin.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Margin, marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n marginStyleMap?: Record<Margin, string>;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input\n *\n * @param {string} id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Margin.None,\n choices: [\n {\n value: Margin.None,\n label: 'None',\n },\n {\n value: Margin.Small,\n label: 'S',\n },\n {\n value: Margin.Medium,\n label: 'M',\n },\n {\n value: Margin.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getMarginSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomMarginValue_${options?.id}` : 'hasCustomMarginValue';\n const valueId = options?.id ? `marginValue_${options?.id}` : 'marginValue';\n const choiceId = options?.id ? `marginChoice_${options?.id}` : 'marginChoice';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.marginStyleMap || marginStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n"],"names":["getMarginSlider","id","Margin","getMarginSettings","options","hasId","valueId","choiceId","bundle","presetCustomValue","marginStyleMap","MARGIN_DEFAULT_PLACEHOLDER","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","appendUnit"],"mappings":";;;;AAwBO,MAAMA,IAAkB,CAACC,OAA8B;AAAA,EAC1D,IAAAA;AAAA,EACA,MAAM;AAAA,EACN,cAAcC,EAAO;AAAA,EACrB,SAAS;AAAA,IACL;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IAAA;AAAA,EACX;AAER,IAEaC,IAAoB,CAACC,MAA+C;AAC7E,QAAMC,IAAQD,GAAS,KAAK,wBAAwBA,GAAS,EAAE,KAAK,wBAC9DE,IAAUF,GAAS,KAAK,eAAeA,GAAS,EAAE,KAAK,eACvDG,IAAWH,GAAS,KAAK,gBAAgBA,GAAS,EAAE,KAAK;AAE/D,SAAO;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACG,MAAWC,EAAkBD,GAAQD,GAAUD,GAASF,GAAS,kBAAkBM,CAAc;AAAA,IAC5G,IAAI;AAAA,MACA;AAAA,QACI,IAAIJ;AAAA,QACJ,MAAM;AAAA,QACN,aAAaK;AAAA,QACb,OAAO,CAACC,GAAsBC,EAAkC,GAAG,CAAC;AAAA,QACpE,UAAU,CAACL,MAAWM,EAAWN,GAAQF,CAAO;AAAA,MAAA;AAAA,IACpD;AAAA,IAEJ,KAAK,CAACN,EAAgBO,CAAQ,CAAC;AAAA,EAAA;AAEvC;"}
1
+ {"version":3,"file":"margin.es.js","names":[],"sources":["../../src/settings/margin.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Margin, marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n marginStyleMap?: Record<Margin, string>;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input\n *\n * @param {string} id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Margin.None,\n choices: [\n {\n value: Margin.None,\n label: 'None',\n },\n {\n value: Margin.Small,\n label: 'S',\n },\n {\n value: Margin.Medium,\n label: 'M',\n },\n {\n value: Margin.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getMarginSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomMarginValue_${options?.id}` : 'hasCustomMarginValue';\n const valueId = options?.id ? `marginValue_${options?.id}` : 'marginValue';\n const choiceId = options?.id ? `marginChoice_${options?.id}` : 'marginChoice';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.marginStyleMap || marginStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n"],"mappings":";;;;AAwBA,IAAa,KAAmB,OAA8B;CAC1D;CACA,MAAM;CACN,cAAc,EAAO;CACrB,SAAS;EACL;GACI,OAAO,EAAO;GACd,OAAO;EACX;EACA;GACI,OAAO,EAAO;GACd,OAAO;EACX;EACA;GACI,OAAO,EAAO;GACd,OAAO;EACX;EACA;GACI,OAAO,EAAO;GACd,OAAO;EACX;CACJ;AACJ,IAEa,KAAqB,MAA+C;CAC7E,IAAM,IAAQ,GAAS,KAAK,wBAAwB,GAAS,OAAO,wBAC9D,IAAU,GAAS,KAAK,eAAe,GAAS,OAAO,eACvD,IAAW,GAAS,KAAK,gBAAgB,GAAS,OAAO;CAE/D,OAAO;EACH,IAAI;EACJ,OAAO;EACP,MAAM;EACN,aAAa;EACb,cAAc;EACd,MAAM;EACN,WAAW,OAAA,GAAW,EAAA,kBAAA,CAAkB,GAAQ,GAAU,GAAS,GAAS,kBAAkB,CAAc;EAC5G,IAAI,CACA;GACI,IAAI;GACJ,MAAM;GACN,aAAa;GACb,OAAO,CAAC,EAAA,uBAAA,GAAsB,EAAA,kCAAA,CAAkC,GAAG,CAAC;GACpE,WAAW,OAAA,GAAW,EAAA,WAAA,CAAW,GAAQ,CAAO;EACpD,CACJ;EACA,KAAK,CAAC,EAAgB,CAAQ,CAAC;CACnC;AACJ"}
@@ -1,65 +1,63 @@
1
- /* empty css */
2
- import { numericalOrPixelRule as i, MultiInputLayout as M, maximumNumericalOrPixelOrAutoRule as a, appendUnit as n, presetCustomValue as r } from "@frontify/sidebar-settings";
3
- import { MARGIN_DEFAULT_PLACEHOLDER as l } from "./defaultValues.es.js";
4
- import { getMarginSlider as x } from "./margin.es.js";
5
- import { marginStyleMap as g } from "./types.es.js";
6
- const _ = (e) => {
7
- const h = e?.id ? `hasExtendedCustomMargin_${e?.id}` : "hasExtendedCustomMargin", p = e?.id ? `extendedMarginValues_${e?.id}` : "extendedMarginValues", d = e?.id ? `extendedMarginChoice_${e?.id}` : "extendedMarginChoice", o = e?.id ? `extendedMarginTop_${e?.id}` : "extendedMarginTop", u = e?.id ? `extendedMarginLeft_${e?.id}` : "extendedMarginLeft", m = e?.id ? `extendedMarginRight_${e?.id}` : "extendedMarginRight", c = e?.id ? `extendedMarginBottom_${e?.id}` : "extendedMarginBottom";
8
- return {
9
- id: h,
10
- label: "Margin",
11
- type: "switch",
12
- switchLabel: "Custom",
13
- defaultValue: !1,
14
- info: "The spacing around UI elements to create more negative space",
15
- onChange: (t) => {
16
- r(t, d, o, g), r(t, d, u, g), r(t, d, m, g), r(t, d, c, g);
17
- },
18
- on: [
19
- {
20
- id: p,
21
- type: "multiInput",
22
- layout: M.Spider,
23
- blocks: [
24
- {
25
- id: o,
26
- type: "input",
27
- label: "Top",
28
- placeholder: l,
29
- onChange: (t) => n(t, o),
30
- rules: [i, a(500)]
31
- },
32
- {
33
- id: u,
34
- type: "input",
35
- label: "Left",
36
- placeholder: l,
37
- onChange: (t) => n(t, u),
38
- rules: [i, a(500)]
39
- },
40
- {
41
- id: m,
42
- type: "input",
43
- label: "Right",
44
- placeholder: l,
45
- onChange: (t) => n(t, m),
46
- rules: [i, a(500)]
47
- },
48
- {
49
- id: c,
50
- type: "input",
51
- label: "Bottom",
52
- placeholder: l,
53
- onChange: (t) => n(t, c),
54
- rules: [i, a(500)]
55
- }
56
- ]
57
- }
58
- ],
59
- off: [x(d)]
60
- };
1
+ import { MARGIN_DEFAULT_PLACEHOLDER as e } from "./defaultValues.es.js";
2
+ import { marginStyleMap as t } from "./types.es.js";
3
+ import { getMarginSlider as n } from "./margin.es.js";
4
+ import { src_exports as r } from "../index.es.js";
5
+ //#region src/settings/marginExtended.ts
6
+ var i = (i) => {
7
+ let a = i?.id ? `hasExtendedCustomMargin_${i?.id}` : "hasExtendedCustomMargin", o = i?.id ? `extendedMarginValues_${i?.id}` : "extendedMarginValues", s = i?.id ? `extendedMarginChoice_${i?.id}` : "extendedMarginChoice", c = i?.id ? `extendedMarginTop_${i?.id}` : "extendedMarginTop", l = i?.id ? `extendedMarginLeft_${i?.id}` : "extendedMarginLeft", u = i?.id ? `extendedMarginRight_${i?.id}` : "extendedMarginRight", d = i?.id ? `extendedMarginBottom_${i?.id}` : "extendedMarginBottom";
8
+ return {
9
+ id: a,
10
+ label: "Margin",
11
+ type: "switch",
12
+ switchLabel: "Custom",
13
+ defaultValue: !1,
14
+ info: "The spacing around UI elements to create more negative space",
15
+ onChange: (e) => {
16
+ (0, r.presetCustomValue)(e, s, c, t), (0, r.presetCustomValue)(e, s, l, t), (0, r.presetCustomValue)(e, s, u, t), (0, r.presetCustomValue)(e, s, d, t);
17
+ },
18
+ on: [{
19
+ id: o,
20
+ type: "multiInput",
21
+ layout: r.MultiInputLayout.Spider,
22
+ blocks: [
23
+ {
24
+ id: c,
25
+ type: "input",
26
+ label: "Top",
27
+ placeholder: e,
28
+ onChange: (e) => (0, r.appendUnit)(e, c),
29
+ rules: [r.numericalOrPixelRule, (0, r.maximumNumericalOrPixelOrAutoRule)(500)]
30
+ },
31
+ {
32
+ id: l,
33
+ type: "input",
34
+ label: "Left",
35
+ placeholder: e,
36
+ onChange: (e) => (0, r.appendUnit)(e, l),
37
+ rules: [r.numericalOrPixelRule, (0, r.maximumNumericalOrPixelOrAutoRule)(500)]
38
+ },
39
+ {
40
+ id: u,
41
+ type: "input",
42
+ label: "Right",
43
+ placeholder: e,
44
+ onChange: (e) => (0, r.appendUnit)(e, u),
45
+ rules: [r.numericalOrPixelRule, (0, r.maximumNumericalOrPixelOrAutoRule)(500)]
46
+ },
47
+ {
48
+ id: d,
49
+ type: "input",
50
+ label: "Bottom",
51
+ placeholder: e,
52
+ onChange: (e) => (0, r.appendUnit)(e, d),
53
+ rules: [r.numericalOrPixelRule, (0, r.maximumNumericalOrPixelOrAutoRule)(500)]
54
+ }
55
+ ]
56
+ }],
57
+ off: [n(s)]
58
+ };
61
59
  };
62
- export {
63
- _ as getMarginExtendedSettings
64
- };
65
- //# sourceMappingURL=marginExtended.es.js.map
60
+ //#endregion
61
+ export { i as getMarginExtendedSettings };
62
+
63
+ //# sourceMappingURL=marginExtended.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"marginExtended.es.js","sources":["../../src/settings/marginExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getMarginSlider } from './margin';\nimport { marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginExtendedSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomMargin_${options?.id}` : 'hasExtendedCustomMargin';\n const valueId = options?.id ? `extendedMarginValues_${options?.id}` : 'extendedMarginValues';\n const choiceId = options?.id ? `extendedMarginChoice_${options?.id}` : 'extendedMarginChoice';\n const topId = options?.id ? `extendedMarginTop_${options?.id}` : 'extendedMarginTop';\n const leftId = options?.id ? `extendedMarginLeft_${options?.id}` : 'extendedMarginLeft';\n const rightId = options?.id ? `extendedMarginRight_${options?.id}` : 'extendedMarginRight';\n const bottomId = options?.id ? `extendedMarginBottom_${options?.id}` : 'extendedMarginBottom';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, marginStyleMap);\n presetCustomValue(bundle, choiceId, leftId, marginStyleMap);\n presetCustomValue(bundle, choiceId, rightId, marginStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, marginStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n"],"names":["getMarginExtendedSettings","options","hasId","valueId","choiceId","topId","leftId","rightId","bottomId","bundle","presetCustomValue","marginStyleMap","MultiInputLayout","MARGIN_DEFAULT_PLACEHOLDER","appendUnit","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","getMarginSlider"],"mappings":";;;;;AA0BO,MAAMA,IAA4B,CAACC,MAA+C;AACrF,QAAMC,IAAQD,GAAS,KAAK,2BAA2BA,GAAS,EAAE,KAAK,2BACjEE,IAAUF,GAAS,KAAK,wBAAwBA,GAAS,EAAE,KAAK,wBAChEG,IAAWH,GAAS,KAAK,wBAAwBA,GAAS,EAAE,KAAK,wBACjEI,IAAQJ,GAAS,KAAK,qBAAqBA,GAAS,EAAE,KAAK,qBAC3DK,IAASL,GAAS,KAAK,sBAAsBA,GAAS,EAAE,KAAK,sBAC7DM,IAAUN,GAAS,KAAK,uBAAuBA,GAAS,EAAE,KAAK,uBAC/DO,IAAWP,GAAS,KAAK,wBAAwBA,GAAS,EAAE,KAAK;AAEvE,SAAO;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACO,MAAW;AAClB,MAAAC,EAAkBD,GAAQL,GAAUC,GAAOM,CAAc,GACzDD,EAAkBD,GAAQL,GAAUE,GAAQK,CAAc,GAC1DD,EAAkBD,GAAQL,GAAUG,GAASI,CAAc,GAC3DD,EAAkBD,GAAQL,GAAUI,GAAUG,CAAc;AAAA,IAChE;AAAA,IACA,IAAI;AAAA,MACA;AAAA,QACI,IAAIR;AAAA,QACJ,MAAM;AAAA,QACN,QAAQS,EAAiB;AAAA,QACzB,QAAQ;AAAA,UACJ;AAAA,YACI,IAAIP;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaQ;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQJ,CAAK;AAAA,YAC9C,OAAO,CAACU,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIV;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaO;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQH,CAAM;AAAA,YAC/C,OAAO,CAACS,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIT;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaM;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQF,CAAO;AAAA,YAChD,OAAO,CAACQ,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,UAExE;AAAA,YACI,IAAIR;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaK;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQD,CAAQ;AAAA,YACjD,OAAO,CAACO,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UAAA;AAAA,QACxE;AAAA,MACJ;AAAA,IACJ;AAAA,IAEJ,KAAK,CAACC,EAAgBb,CAAQ,CAAC;AAAA,EAAA;AAEvC;"}
1
+ {"version":3,"file":"marginExtended.es.js","names":[],"sources":["../../src/settings/marginExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getMarginSlider } from './margin';\nimport { marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginExtendedSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomMargin_${options?.id}` : 'hasExtendedCustomMargin';\n const valueId = options?.id ? `extendedMarginValues_${options?.id}` : 'extendedMarginValues';\n const choiceId = options?.id ? `extendedMarginChoice_${options?.id}` : 'extendedMarginChoice';\n const topId = options?.id ? `extendedMarginTop_${options?.id}` : 'extendedMarginTop';\n const leftId = options?.id ? `extendedMarginLeft_${options?.id}` : 'extendedMarginLeft';\n const rightId = options?.id ? `extendedMarginRight_${options?.id}` : 'extendedMarginRight';\n const bottomId = options?.id ? `extendedMarginBottom_${options?.id}` : 'extendedMarginBottom';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, marginStyleMap);\n presetCustomValue(bundle, choiceId, leftId, marginStyleMap);\n presetCustomValue(bundle, choiceId, rightId, marginStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, marginStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n"],"mappings":";;;;;AA0BA,IAAa,KAA6B,MAA+C;CACrF,IAAM,IAAQ,GAAS,KAAK,2BAA2B,GAAS,OAAO,2BACjE,IAAU,GAAS,KAAK,wBAAwB,GAAS,OAAO,wBAChE,IAAW,GAAS,KAAK,wBAAwB,GAAS,OAAO,wBACjE,IAAQ,GAAS,KAAK,qBAAqB,GAAS,OAAO,qBAC3D,IAAS,GAAS,KAAK,sBAAsB,GAAS,OAAO,sBAC7D,IAAU,GAAS,KAAK,uBAAuB,GAAS,OAAO,uBAC/D,IAAW,GAAS,KAAK,wBAAwB,GAAS,OAAO;CAEvE,OAAO;EACH,IAAI;EACJ,OAAO;EACP,MAAM;EACN,aAAa;EACb,cAAc;EACd,MAAM;EACN,WAAW,MAAW;GAIlB,CAHA,GAAA,EAAA,kBAAA,CAAkB,GAAQ,GAAU,GAAO,CAAc,IACzD,GAAA,EAAA,kBAAA,CAAkB,GAAQ,GAAU,GAAQ,CAAc,IAC1D,GAAA,EAAA,kBAAA,CAAkB,GAAQ,GAAU,GAAS,CAAc,IAC3D,GAAA,EAAA,kBAAA,CAAkB,GAAQ,GAAU,GAAU,CAAc;EAChE;EACA,IAAI,CACA;GACI,IAAI;GACJ,MAAM;GACN,QAAQ,EAAA,iBAAiB;GACzB,QAAQ;IACJ;KACI,IAAI;KACJ,MAAM;KACN,OAAO;KACP,aAAa;KACb,WAAW,OAAA,GAAW,EAAA,WAAA,CAAW,GAAQ,CAAK;KAC9C,OAAO,CAAC,EAAA,uBAAA,GAAsB,EAAA,kCAAA,CAAkC,GAAG,CAAC;IACxE;IACA;KACI,IAAI;KACJ,MAAM;KACN,OAAO;KACP,aAAa;KACb,WAAW,OAAA,GAAW,EAAA,WAAA,CAAW,GAAQ,CAAM;KAC/C,OAAO,CAAC,EAAA,uBAAA,GAAsB,EAAA,kCAAA,CAAkC,GAAG,CAAC;IACxE;IACA;KACI,IAAI;KACJ,MAAM;KACN,OAAO;KACP,aAAa;KACb,WAAW,OAAA,GAAW,EAAA,WAAA,CAAW,GAAQ,CAAO;KAChD,OAAO,CAAC,EAAA,uBAAA,GAAsB,EAAA,kCAAA,CAAkC,GAAG,CAAC;IACxE;IACA;KACI,IAAI;KACJ,MAAM;KACN,OAAO;KACP,aAAa;KACb,WAAW,OAAA,GAAW,EAAA,WAAA,CAAW,GAAQ,CAAQ;KACjD,OAAO,CAAC,EAAA,uBAAA,GAAsB,EAAA,kCAAA,CAAkC,GAAG,CAAC;IACxE;GACJ;EACJ,CACJ;EACA,KAAK,CAAC,EAAgB,CAAQ,CAAC;CACnC;AACJ"}
@@ -1,53 +1,50 @@
1
- /* empty css */
2
- import { numericalOrPixelRule as n, appendUnit as u, maximumNumericalOrPixelOrAutoRule as r, presetCustomValue as o } from "@frontify/sidebar-settings";
3
- import { PADDING_DEFAULT_PLACEHOLDER as m } from "./defaultValues.es.js";
4
- import { Padding as a, paddingStyleMap as g } from "./types.es.js";
5
- const c = (e) => ({
6
- id: e,
7
- type: "segmentedControls",
8
- defaultValue: a.Small,
9
- choices: [
10
- {
11
- value: a.None,
12
- label: "None"
13
- },
14
- {
15
- value: a.Small,
16
- label: "S"
17
- },
18
- {
19
- value: a.Medium,
20
- label: "M"
21
- },
22
- {
23
- value: a.Large,
24
- label: "L"
25
- }
26
- ]
27
- }), P = (e) => {
28
- const t = e?.id ? `hasCustomPaddingValue_${e?.id}` : "hasCustomPaddingValue", l = e?.id ? `paddingValue_${e?.id}` : "paddingValue", i = e?.id ? `paddingChoice_${e?.id}` : "paddingChoice";
29
- return {
30
- id: t,
31
- label: "Padding",
32
- type: "switch",
33
- switchLabel: "Custom",
34
- defaultValue: !1,
35
- info: "The spacing around UI elements to create more negative space",
36
- onChange: (d) => o(d, i, l, e?.paddingStyleMap || g),
37
- on: [
38
- {
39
- id: l,
40
- type: "input",
41
- placeholder: m,
42
- rules: [n, r(500)],
43
- onChange: (d) => u(d, l)
44
- }
45
- ],
46
- off: [c(i)]
47
- };
1
+ import { PADDING_DEFAULT_PLACEHOLDER as e } from "./defaultValues.es.js";
2
+ import { Padding as t, paddingStyleMap as n } from "./types.es.js";
3
+ import { src_exports as r } from "../index.es.js";
4
+ //#region src/settings/padding.ts
5
+ var i = (e) => ({
6
+ id: e,
7
+ type: "segmentedControls",
8
+ defaultValue: t.Small,
9
+ choices: [
10
+ {
11
+ value: t.None,
12
+ label: "None"
13
+ },
14
+ {
15
+ value: t.Small,
16
+ label: "S"
17
+ },
18
+ {
19
+ value: t.Medium,
20
+ label: "M"
21
+ },
22
+ {
23
+ value: t.Large,
24
+ label: "L"
25
+ }
26
+ ]
27
+ }), a = (t) => {
28
+ let a = t?.id ? `hasCustomPaddingValue_${t?.id}` : "hasCustomPaddingValue", o = t?.id ? `paddingValue_${t?.id}` : "paddingValue", s = t?.id ? `paddingChoice_${t?.id}` : "paddingChoice";
29
+ return {
30
+ id: a,
31
+ label: "Padding",
32
+ type: "switch",
33
+ switchLabel: "Custom",
34
+ defaultValue: !1,
35
+ info: "The spacing around UI elements to create more negative space",
36
+ onChange: (e) => (0, r.presetCustomValue)(e, s, o, t?.paddingStyleMap || n),
37
+ on: [{
38
+ id: o,
39
+ type: "input",
40
+ placeholder: e,
41
+ rules: [r.numericalOrPixelRule, (0, r.maximumNumericalOrPixelOrAutoRule)(500)],
42
+ onChange: (e) => (0, r.appendUnit)(e, o)
43
+ }],
44
+ off: [i(s)]
45
+ };
48
46
  };
49
- export {
50
- P as getPaddingSettings,
51
- c as getPaddingSlider
52
- };
53
- //# sourceMappingURL=padding.es.js.map
47
+ //#endregion
48
+ export { a as getPaddingSettings, i as getPaddingSlider };
49
+
50
+ //# sourceMappingURL=padding.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"padding.es.js","sources":["../../src/settings/padding.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Padding, paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n paddingStyleMap?: Record<Padding, string>;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Padding.Small,\n choices: [\n {\n value: Padding.None,\n label: 'None',\n },\n {\n value: Padding.Small,\n label: 'S',\n },\n {\n value: Padding.Medium,\n label: 'M',\n },\n {\n value: Padding.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getPaddingSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomPaddingValue_${options?.id}` : 'hasCustomPaddingValue';\n const valueId = options?.id ? `paddingValue_${options?.id}` : 'paddingValue';\n const choiceId = options?.id ? `paddingChoice_${options?.id}` : 'paddingChoice';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.paddingStyleMap || paddingStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n"],"names":["getPaddingSlider","id","Padding","getPaddingSettings","options","hasId","valueId","choiceId","bundle","presetCustomValue","paddingStyleMap","PADDING_DEFAULT_PLACEHOLDER","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","appendUnit"],"mappings":";;;;AAyBO,MAAMA,IAAmB,CAACC,OAA8B;AAAA,EAC3D,IAAAA;AAAA,EACA,MAAM;AAAA,EACN,cAAcC,EAAQ;AAAA,EACtB,SAAS;AAAA,IACL;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,IAEX;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACX;AAER,IAEaC,IAAqB,CAACC,MAAgD;AAC/E,QAAMC,IAAQD,GAAS,KAAK,yBAAyBA,GAAS,EAAE,KAAK,yBAC/DE,IAAUF,GAAS,KAAK,gBAAgBA,GAAS,EAAE,KAAK,gBACxDG,IAAWH,GAAS,KAAK,iBAAiBA,GAAS,EAAE,KAAK;AAEhE,SAAO;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACG,MAAWC,EAAkBD,GAAQD,GAAUD,GAASF,GAAS,mBAAmBM,CAAe;AAAA,IAC9G,IAAI;AAAA,MACA;AAAA,QACI,IAAIJ;AAAA,QACJ,MAAM;AAAA,QACN,aAAaK;AAAA,QACb,OAAO,CAACC,GAAsBC,EAAkC,GAAG,CAAC;AAAA,QACpE,UAAU,CAACL,MAAWM,EAAWN,GAAQF,CAAO;AAAA,MAAA;AAAA,IACpD;AAAA,IAEJ,KAAK,CAACN,EAAiBO,CAAQ,CAAC;AAAA,EAAA;AAExC;"}
1
+ {"version":3,"file":"padding.es.js","names":[],"sources":["../../src/settings/padding.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\n\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Padding, paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n paddingStyleMap?: Record<Padding, string>;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Padding.Small,\n choices: [\n {\n value: Padding.None,\n label: 'None',\n },\n {\n value: Padding.Small,\n label: 'S',\n },\n {\n value: Padding.Medium,\n label: 'M',\n },\n {\n value: Padding.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getPaddingSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomPaddingValue_${options?.id}` : 'hasCustomPaddingValue';\n const valueId = options?.id ? `paddingValue_${options?.id}` : 'paddingValue';\n const choiceId = options?.id ? `paddingChoice_${options?.id}` : 'paddingChoice';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.paddingStyleMap || paddingStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n"],"mappings":";;;;AAyBA,IAAa,KAAoB,OAA8B;CAC3D;CACA,MAAM;CACN,cAAc,EAAQ;CACtB,SAAS;EACL;GACI,OAAO,EAAQ;GACf,OAAO;EACX;EACA;GACI,OAAO,EAAQ;GACf,OAAO;EACX;EACA;GACI,OAAO,EAAQ;GACf,OAAO;EACX;EACA;GACI,OAAO,EAAQ;GACf,OAAO;EACX;CACJ;AACJ,IAEa,KAAsB,MAAgD;CAC/E,IAAM,IAAQ,GAAS,KAAK,yBAAyB,GAAS,OAAO,yBAC/D,IAAU,GAAS,KAAK,gBAAgB,GAAS,OAAO,gBACxD,IAAW,GAAS,KAAK,iBAAiB,GAAS,OAAO;CAEhE,OAAO;EACH,IAAI;EACJ,OAAO;EACP,MAAM;EACN,aAAa;EACb,cAAc;EACd,MAAM;EACN,WAAW,OAAA,GAAW,EAAA,kBAAA,CAAkB,GAAQ,GAAU,GAAS,GAAS,mBAAmB,CAAe;EAC9G,IAAI,CACA;GACI,IAAI;GACJ,MAAM;GACN,aAAa;GACb,OAAO,CAAC,EAAA,uBAAA,GAAsB,EAAA,kCAAA,CAAkC,GAAG,CAAC;GACpE,WAAW,OAAA,GAAW,EAAA,WAAA,CAAW,GAAQ,CAAO;EACpD,CACJ;EACA,KAAK,CAAC,EAAiB,CAAQ,CAAC;CACpC;AACJ"}