@rio-cloud/rio-uikit 2.0.0 → 2.1.0

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 (205) hide show
  1. package/components/actionBarItem/ActionBarItem.d.ts +2 -2
  2. package/components/actionBarItem/ActionBarItem.js.map +1 -1
  3. package/components/applicationHeader/ApplicationHeader.d.ts +6 -7
  4. package/components/applicationHeader/ApplicationHeader.js.map +1 -1
  5. package/components/applicationLayout/SubNavigation.d.ts +7 -0
  6. package/components/applicationLayout/SubNavigation.js.map +1 -1
  7. package/components/assetTree/AssetTree.d.ts +7 -0
  8. package/components/assetTree/AssetTree.js.map +1 -1
  9. package/components/assetTree/Tree.d.ts +15 -0
  10. package/components/assetTree/Tree.js.map +1 -1
  11. package/components/assetTree/TreeIcon.d.ts +30 -0
  12. package/components/assetTree/TreeIcon.js +16 -0
  13. package/components/assetTree/TreeIcon.js.map +1 -0
  14. package/components/assetTree/TreeLeaf.js +22 -22
  15. package/components/assetTree/TreeLeaf.js.map +1 -1
  16. package/components/assetTree/TreeNode.js +25 -25
  17. package/components/assetTree/TreeNode.js.map +1 -1
  18. package/components/assetTree/TreeSearch.d.ts +2 -0
  19. package/components/assetTree/TreeSearch.js.map +1 -1
  20. package/components/barList/BarList.d.ts +26 -0
  21. package/components/barList/BarList.js.map +1 -1
  22. package/components/bottomSheet/BottomSheet.d.ts +17 -3
  23. package/components/bottomSheet/BottomSheet.js.map +1 -1
  24. package/components/bottomSheet/TimedBottomSheet.d.ts +10 -0
  25. package/components/bottomSheet/TimedBottomSheet.js.map +1 -1
  26. package/components/calendarStripe/CalendarStripe.d.ts +1 -1
  27. package/components/calendarStripe/CalendarStripe.js +34 -36
  28. package/components/calendarStripe/CalendarStripe.js.map +1 -1
  29. package/components/charts/Area.d.ts +2 -2
  30. package/components/charts/Area.js.map +1 -1
  31. package/components/charts/Line.d.ts +2 -2
  32. package/components/charts/Line.js.map +1 -1
  33. package/components/checkbox/Checkbox.d.ts +0 -3
  34. package/components/checkbox/Checkbox.js.map +1 -1
  35. package/components/clearableInput/ClearableInput.d.ts +21 -20
  36. package/components/clearableInput/ClearableInput.js.map +1 -1
  37. package/components/collapse/Collapse.d.ts +3 -0
  38. package/components/collapse/Collapse.js +12 -12
  39. package/components/collapse/Collapse.js.map +1 -1
  40. package/components/contentLoader/ContentLoader.d.ts +10 -2
  41. package/components/contentLoader/ContentLoader.js.map +1 -1
  42. package/components/dataTabs/DataTabs.d.ts +6 -0
  43. package/components/dataTabs/DataTabs.js.map +1 -1
  44. package/components/datepicker/DatePicker.d.ts +2 -2
  45. package/components/datepicker/DatePicker.js +31 -31
  46. package/components/datepicker/DatePicker.js.map +1 -1
  47. package/components/dialog/ConfirmationDialog.d.ts +22 -0
  48. package/components/dialog/ConfirmationDialog.js.map +1 -1
  49. package/components/dialog/Dialog.d.ts +13 -1
  50. package/components/dialog/Dialog.js.map +1 -1
  51. package/components/dialog/ReleaseNotesDialog.d.ts +3 -3
  52. package/components/dialog/ReleaseNotesDialog.js.map +1 -1
  53. package/components/dropdown/ButtonDropdown.d.ts +4 -0
  54. package/components/dropdown/ButtonDropdown.js +51 -51
  55. package/components/dropdown/ButtonDropdown.js.map +1 -1
  56. package/components/dropdown/DropdownSubmenu.d.ts +4 -0
  57. package/components/dropdown/DropdownSubmenu.js.map +1 -1
  58. package/components/editableContent/EditableContent.d.ts +6 -0
  59. package/components/editableContent/EditableContent.js.map +1 -1
  60. package/components/expander/ExpanderList.d.ts +3 -0
  61. package/components/expander/ExpanderList.js.map +1 -1
  62. package/components/expander/ExpanderPanel.d.ts +14 -4
  63. package/components/expander/ExpanderPanel.js.map +1 -1
  64. package/components/fade/Fade.d.ts +1 -1
  65. package/components/fade/Fade.js.map +1 -1
  66. package/components/filepicker/FilePicker.d.ts +0 -2
  67. package/components/filepicker/FilePicker.js.map +1 -1
  68. package/components/groupedItemList/GroupedItemList.d.ts +10 -7
  69. package/components/groupedItemList/GroupedItemList.js.map +1 -1
  70. package/components/listMenu/ListMenu.js.map +1 -1
  71. package/components/listMenu/ListMenuGroup.d.ts +2 -1
  72. package/components/listMenu/ListMenuGroup.js.map +1 -1
  73. package/components/map/components/Map.js.map +1 -1
  74. package/components/map/components/constants.js.map +1 -1
  75. package/components/map/components/features/ContextMenuItem.d.ts +1 -1
  76. package/components/map/components/features/ContextMenuItem.js +2 -17
  77. package/components/map/components/features/ContextMenuItem.js.map +1 -1
  78. package/components/map/components/features/basics/Polyline.d.ts +4 -1
  79. package/components/map/components/features/basics/Polyline.js +1 -1
  80. package/components/map/components/features/basics/Polyline.js.map +1 -1
  81. package/components/map/components/features/layers/MarkerLayer.d.ts +3 -1
  82. package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
  83. package/components/map/components/features/layers/clustering/ClusterLayer.js +1 -1
  84. package/components/map/components/features/layers/clustering/ClusterLayer.js.map +1 -1
  85. package/components/map/components/features/layers/clustering/SimpleClusterLayer.d.ts +3 -2
  86. package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
  87. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js +7 -7
  88. package/components/map/components/features/layers/overlayLayers/RoadRestrictionLayer.js.map +1 -1
  89. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js +4 -4
  90. package/components/map/components/features/layers/overlayLayers/TrafficLayer.js.map +1 -1
  91. package/components/map/utils/clustering.d.ts +6 -1
  92. package/components/map/utils/clustering.js +25 -19
  93. package/components/map/utils/clustering.js.map +1 -1
  94. package/components/map/utils/rendering.d.ts +1 -1
  95. package/components/map/utils/rendering.js +23 -23
  96. package/components/map/utils/rendering.js.map +1 -1
  97. package/components/menuItems/MenuItem.d.ts +23 -0
  98. package/components/menuItems/MenuItem.js.map +1 -1
  99. package/components/notification/Notification.js +4 -4
  100. package/components/notification/Notification.js.map +1 -1
  101. package/components/onboarding/OnboardingTip.d.ts +18 -12
  102. package/components/onboarding/OnboardingTip.js.map +1 -1
  103. package/components/overlay/OverlayTrigger.d.ts +43 -1
  104. package/components/overlay/OverlayTrigger.js.map +1 -1
  105. package/components/pager/Pager.d.ts +3 -0
  106. package/components/pager/Pager.js.map +1 -1
  107. package/components/popover/Popover.d.ts +1 -0
  108. package/components/popover/Popover.js.map +1 -1
  109. package/components/preloader/ImagePreloader.d.ts +1 -1
  110. package/components/preloader/ImagePreloader.js.map +1 -1
  111. package/components/radiobutton/RadioButton.d.ts +9 -5
  112. package/components/radiobutton/RadioButton.js.map +1 -1
  113. package/components/releaseNotes/ReleaseNotes.d.ts +0 -3
  114. package/components/releaseNotes/ReleaseNotes.js.map +1 -1
  115. package/components/resizer/Resizer.d.ts +17 -3
  116. package/components/resizer/Resizer.js.map +1 -1
  117. package/components/rioglyph/Rioglyph.d.ts +20 -8
  118. package/components/rioglyph/Rioglyph.js.map +1 -1
  119. package/components/rules/RulesWrapper.js +1 -1
  120. package/components/rules/RulesWrapper.js.map +1 -1
  121. package/components/saveableInput/SaveableDateInput.d.ts +20 -2
  122. package/components/saveableInput/SaveableDateInput.js.map +1 -1
  123. package/components/saveableInput/SaveableInput.d.ts +10 -2
  124. package/components/saveableInput/SaveableInput.js.map +1 -1
  125. package/components/selects/BaseSelectDropdown.js +90 -79
  126. package/components/selects/BaseSelectDropdown.js.map +1 -1
  127. package/components/selects/Select.d.ts +5 -0
  128. package/components/selects/Select.js +94 -94
  129. package/components/selects/Select.js.map +1 -1
  130. package/components/sidebars/Sidebar.d.ts +19 -3
  131. package/components/sidebars/Sidebar.js.map +1 -1
  132. package/components/slider/RangeSlider.d.ts +15 -0
  133. package/components/slider/RangeSlider.js.map +1 -1
  134. package/components/slider/Slider.d.ts +9 -0
  135. package/components/slider/Slider.js.map +1 -1
  136. package/components/smoothScrollbars/SmoothScrollbars.d.ts +44 -0
  137. package/components/smoothScrollbars/SmoothScrollbars.js.map +1 -1
  138. package/components/spinner/Spinner.d.ts +3 -3
  139. package/components/spinner/Spinner.js.map +1 -1
  140. package/components/states/BaseStateProps.d.ts +6 -2
  141. package/components/states/StateIcon.d.ts +14 -1
  142. package/components/states/StateIcon.js.map +1 -1
  143. package/components/statsWidget/StatsWidget.d.ts +2 -0
  144. package/components/statsWidget/StatsWidget.js.map +1 -1
  145. package/components/statsWidget/StatsWidgetBody.d.ts +1 -0
  146. package/components/statsWidget/StatsWidgetBody.js.map +1 -1
  147. package/components/statsWidget/StatsWidgetNumber.d.ts +2 -0
  148. package/components/statsWidget/StatsWidgetNumber.js.map +1 -1
  149. package/components/statusBar/StatusBar.d.ts +2 -31
  150. package/components/statusBar/StatusBar.js.map +1 -1
  151. package/components/statusBar/StatusBarIcon.d.ts +2 -2
  152. package/components/statusBar/StatusBarIcon.js.map +1 -1
  153. package/components/statusBar/StatusBarLabel.d.ts +2 -2
  154. package/components/statusBar/StatusBarLabel.js.map +1 -1
  155. package/components/statusBar/StatusBarProgressBar.d.ts +1 -1
  156. package/components/statusBar/StatusBarProgressBar.js.map +1 -1
  157. package/components/statusBar/{StatusBar.types.d.ts → StatusBarProps.d.ts} +44 -2
  158. package/components/steppedProgressBar/SteppedProgressBar.d.ts +1 -1
  159. package/components/steppedProgressBar/SteppedProgressBar.js.map +1 -1
  160. package/components/switch/Switch.d.ts +13 -1
  161. package/components/switch/Switch.js.map +1 -1
  162. package/components/table/SortArrowDown.d.ts +1 -1
  163. package/components/table/SortArrowDown.js.map +1 -1
  164. package/components/table/SortArrowUp.d.ts +1 -1
  165. package/components/table/SortArrowUp.js.map +1 -1
  166. package/components/table/TableSettingsDialog.d.ts +5 -0
  167. package/components/table/TableSettingsDialog.js +119 -109
  168. package/components/table/TableSettingsDialog.js.map +1 -1
  169. package/components/table/TableSettingsDialogFooter.js +9 -9
  170. package/components/table/TableSettingsDialogFooter.js.map +1 -1
  171. package/components/table/TableViewToggles.d.ts +21 -1
  172. package/components/table/TableViewToggles.js.map +1 -1
  173. package/components/tag/Tag.d.ts +7 -2
  174. package/components/tag/Tag.js.map +1 -1
  175. package/components/tagManager/TagManager.d.ts +15 -0
  176. package/components/tagManager/TagManager.js.map +1 -1
  177. package/components/tagManager/TagManagerTag.d.ts +9 -0
  178. package/components/teaser/Teaser.d.ts +57 -55
  179. package/components/teaser/Teaser.js.map +1 -1
  180. package/components/teaser/TeaserContainer.d.ts +1 -1
  181. package/components/teaser/TeaserContainer.js.map +1 -1
  182. package/components/tooltip/SimpleTooltip.d.ts +22 -4
  183. package/components/tooltip/SimpleTooltip.js.map +1 -1
  184. package/components/tooltip/Tooltip.d.ts +22 -2
  185. package/components/tooltip/Tooltip.js.map +1 -1
  186. package/components/video/ResponsiveVideo.d.ts +8 -3
  187. package/components/video/ResponsiveVideo.js.map +1 -1
  188. package/hooks/useKey.d.ts +1 -1
  189. package/hooks/useKey.js.map +1 -1
  190. package/hooks/useOnboarding.d.ts +86 -80
  191. package/hooks/useOnboarding.js.map +1 -1
  192. package/hooks/useTableExport.js.map +1 -1
  193. package/hooks/useUncontrollable.d.ts +1 -1
  194. package/hooks/useUncontrollable.js.map +1 -1
  195. package/package.json +12 -14
  196. package/utils/colorScheme.js +14 -13
  197. package/utils/colorScheme.js.map +1 -1
  198. package/utils/cssuseragent.js.map +1 -1
  199. package/utils/scrollItemIntoView.js +12 -11
  200. package/utils/scrollItemIntoView.js.map +1 -1
  201. package/utils/urlFeatureToggles.js +19 -20
  202. package/utils/urlFeatureToggles.js.map +1 -1
  203. package/version.d.ts +1 -1
  204. package/version.js +1 -1
  205. package/version.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Pager.js","sources":["../../../src/components/pager/Pager.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport classNames from 'classnames';\n\nimport type { ObjectValues } from '../../utils/ObjectValues';\n\nexport const PagerVariant = {\n VARIANT_FULL: 'full',\n VARIANT_COMPACT: 'compact',\n} as const;\n\nexport type PagerProps = {\n /**\n * The title or name of the section next/previous section.\n */\n title: string | React.ReactNode;\n\n /**\n * The optional label for the full variant.\n */\n label?: string | React.ReactNode;\n\n /**\n * Set right alignment for \"previous\" pager content to be aligned\n * to the right side of the pager and the arrow on the left side.\n * @default false\n */\n alignRight?: boolean;\n\n /**\n * Define how large the component should be rendered.\n *\n * Possible values are:\n * `Pager.VARIANT_FULL`, `Pager.VARIANT_COMPACT` or\n * `full`, `compact`.\n *\n * @default `full`\n */\n variant?: ObjectValues<typeof PagerVariant>;\n\n /**\n * Sets the pager disabled.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback function for when the component is clicked.\n * @param event\n * @returns\n */\n onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n};\n\nconst Pager = (props: PagerProps) => {\n const {\n title,\n label,\n alignRight = false,\n variant = PagerVariant.VARIANT_FULL,\n disabled = false,\n onClick,\n className,\n ...remainingProps\n } = props;\n\n const [isHover, setIsHover] = useState(false);\n\n const handleEnter = () => !disabled && setIsHover(true);\n const handleLeave = () => setIsHover(false);\n\n const isCompactVariant = variant === Pager.VARIANT_COMPACT;\n\n const wrapperClassesBase = classNames(\n 'Pager',\n 'bg-white',\n 'border',\n 'display-flex justify-space-between align-items-center',\n isHover && 'border-color-highlight',\n alignRight && 'flex-row-reverse',\n disabled && 'pointer-events-none',\n 'cursor-pointer user-select-none'\n );\n\n const iconClassesBase = classNames(\n 'rioglyph',\n disabled ? 'text-color-light' : 'text-color-darker',\n isHover && 'text-color-highlight'\n );\n\n const titleClassesBase = classNames(\n disabled ? 'text-color-light' : 'text-color-darker',\n isHover && 'text-color-highlight'\n );\n\n // The compact version has a slightly different markup and different classes for the\n // individual parts, hence we extend the base classes\n if (isCompactVariant) {\n const wrapperClassesCompact = classNames(\n wrapperClassesBase,\n 'rounded-circle',\n 'padding-y-5 padding-x-15',\n 'width-auto',\n className\n );\n\n const iconClassesCompact = classNames(\n iconClassesBase,\n alignRight ? 'rioglyph-chevron-left margin-right-5' : 'rioglyph-chevron-right margin-left-5',\n 'text-size-10'\n );\n\n return (\n <div\n {...remainingProps}\n className={wrapperClassesCompact}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n onClick={onClick}\n >\n <div className={`display-flex flex-1-1 flex-column ${alignRight ? 'align-items-end' : ''}`}>\n <div className={titleClassesBase}>{title}</div>\n </div>\n <span className={iconClassesCompact} />\n </div>\n );\n }\n\n const wrapperClassesFull = classNames(\n wrapperClassesBase,\n 'rounded',\n 'padding-y-15 padding-x-20',\n 'width-100pct',\n className\n );\n\n const iconClassesFull = classNames(\n iconClassesBase,\n alignRight ? 'rioglyph-arrow-left margin-right-10' : 'rioglyph-arrow-right margin-left-10',\n 'text-size-200pct'\n );\n\n const titleClassesFull = classNames(titleClassesBase, alignRight && 'text-right', 'text-size-16 text-medium');\n\n return (\n <div\n {...remainingProps}\n className={wrapperClassesFull}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n onClick={onClick}\n >\n <div className={`display-flex flex-1-1 flex-column ${alignRight ? 'align-items-end' : ''}`}>\n <div className='text-color-gray line-height-16'>{label}</div>\n <div className={titleClassesFull}>{title}</div>\n </div>\n <div className='text-size-12 display-grid place-items-center'>\n <span className={iconClassesFull} />\n </div>\n </div>\n );\n};\n\nPager.VARIANT_FULL = PagerVariant.VARIANT_FULL;\nPager.VARIANT_COMPACT = PagerVariant.VARIANT_COMPACT;\n\nexport default Pager;\n"],"names":["PagerVariant","Pager","props","title","label","alignRight","variant","disabled","onClick","className","remainingProps","isHover","setIsHover","useState","handleEnter","handleLeave","isCompactVariant","wrapperClassesBase","classNames","iconClassesBase","titleClassesBase","wrapperClassesCompact","iconClassesCompact","jsxs","jsx","wrapperClassesFull","iconClassesFull","titleClassesFull"],"mappings":";;;AAMO,MAAMA,IAAe;AAAA,EACxB,cAAc;AAAA,EACd,iBAAiB;AACrB,GAkDMC,IAAQ,CAACC,MAAsB;AACjC,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,SAAAC,IAAUN,EAAa;AAAA,I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,IACAR;AAAA,EAAA,GAGEiB,IAAkBR;AAAA,IACpBC;AAAA,IACAd,IAAa,wCAAwC;AAAA,IACrD;AAAA,EAAA,GAGEsB,IAAmBT,EAAWE,GAAkBf,KAAc,cAAc,0BAA0B;AAE5G,SACI,gBAAAkB;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGb;AAAA,MACJ,WAAWe;AAAA,MACX,cAAcX;AAAA,MACd,cAAcC;AAAA,MACd,SAAAP;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAe,EAAC,SAAI,WAAW,qCAAqClB,IAAa,oBAAoB,EAAE,IACpF,UAAA;AAAA,UAAA,gBAAAmB,EAAC,OAAA,EAAI,WAAU,kCAAkC,UAAApB,GAAM;AAAA,UACvD,gBAAAoB,EAAC,OAAA,EAAI,WAAWG,GAAmB,UAAAxB,EAAA,CAAM;AAAA,QAAA,GAC7C;AAAA,QACA,gBAAAqB,EAAC,SAAI,WAAU,gDACX,4BAAC,QAAA,EAAK,WAAWE,GAAiB,EAAA,CACtC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEAzB,EAAM,eAAeD,EAAa;AAClCC,EAAM,kBAAkBD,EAAa;"}
1
+ {"version":3,"file":"Pager.js","sources":["../../../src/components/pager/Pager.tsx"],"sourcesContent":["import type React from 'react';\nimport { useState } from 'react';\nimport classNames from 'classnames';\n\nimport type { ObjectValues } from '../../utils/ObjectValues';\n\nexport const PagerVariant = {\n VARIANT_FULL: 'full',\n VARIANT_COMPACT: 'compact',\n} as const;\n\nexport type PagerProps = {\n /**\n * The title or name of the section next/previous section.\n */\n title: string | React.ReactNode;\n\n /**\n * The optional label for the full variant.\n */\n label?: string | React.ReactNode;\n\n /**\n * Set right alignment for \"previous\" pager content to be aligned\n * to the right side of the pager and the arrow on the left side.\n *\n * @default false\n */\n alignRight?: boolean;\n\n /**\n * Define how large the component should be rendered.\n *\n * Possible values are:\n * `Pager.VARIANT_FULL`, `Pager.VARIANT_COMPACT` or\n * `full`, `compact`.\n *\n * @default `full`\n */\n variant?: ObjectValues<typeof PagerVariant>;\n\n /**\n * Sets the pager disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback function for when the component is clicked.\n *\n * @param event\n * @returns\n */\n onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;\n\n /**\n * Additional classes for the wrapper element.\n */\n className?: string;\n};\n\nconst Pager = (props: PagerProps) => {\n const {\n title,\n label,\n alignRight = false,\n variant = PagerVariant.VARIANT_FULL,\n disabled = false,\n onClick,\n className,\n ...remainingProps\n } = props;\n\n const [isHover, setIsHover] = useState(false);\n\n const handleEnter = () => !disabled && setIsHover(true);\n const handleLeave = () => setIsHover(false);\n\n const isCompactVariant = variant === Pager.VARIANT_COMPACT;\n\n const wrapperClassesBase = classNames(\n 'Pager',\n 'bg-white',\n 'border',\n 'display-flex justify-space-between align-items-center',\n isHover && 'border-color-highlight',\n alignRight && 'flex-row-reverse',\n disabled && 'pointer-events-none',\n 'cursor-pointer user-select-none'\n );\n\n const iconClassesBase = classNames(\n 'rioglyph',\n disabled ? 'text-color-light' : 'text-color-darker',\n isHover && 'text-color-highlight'\n );\n\n const titleClassesBase = classNames(\n disabled ? 'text-color-light' : 'text-color-darker',\n isHover && 'text-color-highlight'\n );\n\n // The compact version has a slightly different markup and different classes for the\n // individual parts, hence we extend the base classes\n if (isCompactVariant) {\n const wrapperClassesCompact = classNames(\n wrapperClassesBase,\n 'rounded-circle',\n 'padding-y-5 padding-x-15',\n 'width-auto',\n className\n );\n\n const iconClassesCompact = classNames(\n iconClassesBase,\n alignRight ? 'rioglyph-chevron-left margin-right-5' : 'rioglyph-chevron-right margin-left-5',\n 'text-size-10'\n );\n\n return (\n <div\n {...remainingProps}\n className={wrapperClassesCompact}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n onClick={onClick}\n >\n <div className={`display-flex flex-1-1 flex-column ${alignRight ? 'align-items-end' : ''}`}>\n <div className={titleClassesBase}>{title}</div>\n </div>\n <span className={iconClassesCompact} />\n </div>\n );\n }\n\n const wrapperClassesFull = classNames(\n wrapperClassesBase,\n 'rounded',\n 'padding-y-15 padding-x-20',\n 'width-100pct',\n className\n );\n\n const iconClassesFull = classNames(\n iconClassesBase,\n alignRight ? 'rioglyph-arrow-left margin-right-10' : 'rioglyph-arrow-right margin-left-10',\n 'text-size-200pct'\n );\n\n const titleClassesFull = classNames(titleClassesBase, alignRight && 'text-right', 'text-size-16 text-medium');\n\n return (\n <div\n {...remainingProps}\n className={wrapperClassesFull}\n onMouseEnter={handleEnter}\n onMouseLeave={handleLeave}\n onClick={onClick}\n >\n <div className={`display-flex flex-1-1 flex-column ${alignRight ? 'align-items-end' : ''}`}>\n <div className='text-color-gray line-height-16'>{label}</div>\n <div className={titleClassesFull}>{title}</div>\n </div>\n <div className='text-size-12 display-grid place-items-center'>\n <span className={iconClassesFull} />\n </div>\n </div>\n );\n};\n\nPager.VARIANT_FULL = PagerVariant.VARIANT_FULL;\nPager.VARIANT_COMPACT = PagerVariant.VARIANT_COMPACT;\n\nexport default Pager;\n"],"names":["PagerVariant","Pager","props","title","label","alignRight","variant","disabled","onClick","className","remainingProps","isHover","setIsHover","useState","handleEnter","handleLeave","isCompactVariant","wrapperClassesBase","classNames","iconClassesBase","titleClassesBase","wrapperClassesCompact","iconClassesCompact","jsxs","jsx","wrapperClassesFull","iconClassesFull","titleClassesFull"],"mappings":";;;AAMO,MAAMA,IAAe;AAAA,EACxB,cAAc;AAAA,EACd,iBAAiB;AACrB,GAqDMC,IAAQ,CAACC,MAAsB;AACjC,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,SAAAC,IAAUN,EAAa;AAAA,IACvB,UAAAO,IAAW;AAAA,IACX,SAAAC;AAAA,IACA,WAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHR,GAEE,CAACS,GAASC,CAAU,IAAIC,EAAS,EAAK,GAEtCC,IAAc,MAAM,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AE5G,SACI,gBAAAkB;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGb;AAAA,MACJ,WAAWe;AAAA,MACX,cAAcX;AAAA,MACd,cAAcC;AAAA,MACd,SAAAP;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAe,EAAC,SAAI,WAAW,qCAAqClB,IAAa,oBAAoB,EAAE,IACpF,UAAA;AAAA,UAAA,gBAAAmB,EAAC,OAAA,EAAI,WAAU,kCAAkC,UAAApB,GAAM;AAAA,UACvD,gBAAAoB,EAAC,OAAA,EAAI,WAAWG,GAAmB,UAAAxB,EAAA,CAAM;AAAA,QAAA,GAC7C;AAAA,QACA,gBAAAqB,EAAC,SAAI,WAAU,gDACX,4BAAC,QAAA,EAAK,WAAWE,GAAiB,EAAA,CACtC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGZ;AAEAzB,EAAM,eAAeD,EAAa;AAClCC,EAAM,kBAAkBD,EAAa;"}
@@ -17,6 +17,7 @@ export type PopoverProps = Omit<ComponentProps<'div'>, 'title'> & {
17
17
  * This is generally provided by the OverlayTrigger component positioning the Popover.
18
18
  *
19
19
  * Possible values are:
20
+ *
20
21
  * - `auto`
21
22
  * - `top`
22
23
  * - `right`
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type RefAttributes,\n type PropsWithChildren,\n type ReactNode,\n type ComponentProps,\n isValidElement,\n useState,\n useEffect,\n} from 'react';\n\nimport { PLACEMENT } from '../../values/Placement';\n\nexport const PLACEMENT_MAP = {\n AUTO: PLACEMENT.AUTO,\n TOP: PLACEMENT.TOP,\n RIGHT: PLACEMENT.RIGHT,\n BOTTOM: PLACEMENT.BOTTOM,\n LEFT: PLACEMENT.LEFT,\n} as const;\n\nexport type PopoverProps = Omit<ComponentProps<'div'>, 'title'> & {\n /**\n * HTML ID attribute, necessary for accessibility.\n */\n id: string;\n\n /**\n * Sets the direction the Popover is positioned towards.\n *\n * This is generally provided by the OverlayTrigger component positioning the Popover.\n *\n * Possible values are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n */\n placement?: 'auto' | 'top' | 'right' | 'bottom' | 'left';\n\n /**\n * Additional props assigned to the arrow element. Internally used.\n */\n arrowProps?: Record<string, unknown>;\n\n /**\n * Any element to be rendered as the title of the Popover.\n *\n * It creates a `Popover.Title` inside the `Popover` passing the title directly into it.\n */\n title?: string | ReactNode;\n\n /**\n * Additional classes to be set on the `Popover.Title` element.\n */\n titleClassName?: string;\n\n /**\n * Additional classes to be set on the `Popover.Content` element.\n */\n contentClassName?: string;\n\n /**\n * Additional class names for the wrapper element.\n */\n className?: string;\n};\n\nconst PopoverTitle = ({ className = '', children }: PropsWithChildren<{ className?: string }>) => (\n <div className={`popover-header popover-title ${className}`}>{children}</div>\n);\n\nconst PopoverContent = ({ className = '', children }: PropsWithChildren<{ className?: string }>) => (\n <div className={`popover-content popover-body ${className}`}>{children}</div>\n);\n\nconst isPopoverTitleOrContent = (element: ReactNode): boolean => {\n return isValidElement(element) && (element.type === PopoverTitle || element.type === PopoverContent);\n};\n\ntype PopoverType = ForwardRefExoticComponent<PropsWithChildren<PopoverProps> & RefAttributes<HTMLDivElement>> & {\n Title: typeof PopoverTitle;\n Content: typeof PopoverContent;\n};\n\nconst Popover = forwardRef<HTMLDivElement, PropsWithChildren<PopoverProps>>((props, ref) => {\n const {\n placement = 'bottom',\n arrowProps,\n title,\n titleClassName = '',\n contentClassName = '',\n children,\n className = '',\n ...remainingProps\n } = props;\n\n const hasTitle = !!title;\n const hasCustomContent = React.Children.toArray(children).some(isPopoverTitleOrContent);\n\n // Mount the component but don't show it yet via CSS.\n // After it is mounted, we set the visibility class to use CSS animation\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n return (\n <div\n {...remainingProps}\n role='tooltip'\n // x-placement is used by the css to define how to position the arrow.\n // eslint-disable-next-line react/no-unknown-property\n x-placement={placement}\n ref={ref}\n className={`popover fade ${isMounted ? 'show' : ''} ${className}`}\n >\n <div className='arrow' {...arrowProps} />\n {hasTitle && <PopoverTitle className={titleClassName}>{title}</PopoverTitle>}\n {hasCustomContent ? children : <PopoverContent className={contentClassName}>{children}</PopoverContent>}\n </div>\n );\n}) as PopoverType;\n\nPopover.Title = PopoverTitle;\nPopover.Content = PopoverContent;\n\nObject.assign(Popover, PLACEMENT_MAP);\n\nexport default Popover;\n"],"names":["PLACEMENT_MAP","PLACEMENT","PopoverTitle","className","children","jsx","PopoverContent","isPopoverTitleOrContent","element","isValidElement","Popover","forwardRef","props","ref","placement","arrowProps","title","titleClassName","contentClassName","remainingProps","hasTitle","hasCustomContent","React","isMounted","setIsMounted","useState","useEffect","jsxs"],"mappings":";;;AAcO,MAAMA,IAAgB;AAAA,EACzB,MAAMC,EAAU;AAAA,EAChB,KAAKA,EAAU;AAAA,EACf,OAAOA,EAAU;AAAA,EACjB,QAAQA,EAAU;AAAA,EAClB,MAAMA,EAAU;AACpB,GAkDMC,IAAe,CAAC,EAAE,WAAAC,IAAY,IAAI,UAAAC,EAAA,MACpC,gBAAAC,EAAC,OAAA,EAAI,WAAW,gCAAgCF,CAAS,IAAK,UAAAC,EAAA,CAAS,GAGrEE,IAAiB,CAAC,EAAE,WAAAH,IAAY,IAAI,UAAAC,EAAA,MACtC,gBAAAC,EAAC,OAAA,EAAI,WAAW,gCAAgCF,CAAS,IAAK,UAAAC,EAAA,CAAS,GAGrEG,IAA0B,CAACC,MACtBC,EAAeD,CAAO,MAAMA,EAAQ,SAASN,KAAgBM,EAAQ,SAASF,IAQnFI,IAAUC,EAA4D,CAACC,GAAOC,MAAQ;AACxF,QAAM;AAAA,IACF,WAAAC,IAAY;AAAA,IACZ,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,kBAAAC,IAAmB;AAAA,IACnB,UAAAd;AAAA,IACA,WAAAD,IAAY;AAAA,IACZ,GAAGgB;AAAA,EAAA,IACHP,GAEEQ,IAAW,CAAC,CAACJ,GACbK,IAAmBC,EAAM,SAAS,QAAQlB,CAAQ,EAAE,KAAKG,CAAuB,GAIhF,CAACgB,GAAWC,CAAY,IAAIC,EAAS,EAAK;AAChD,SAAAC,EAAU,MAAMF,EAAa,EAAI,GAAG,CAAA,CAAE,GAGlC,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGR;AAAA,MACJ,MAAK;AAAA,MAGL,eAAaL;AAAA,MACb,KAAAD;AAAA,MACA,WAAW,gBAAgBU,IAAY,SAAS,EAAE,IAAIpB,CAAS;AAAA,MAE/D,UAAA;AAAA,QAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,SAAS,GAAGU,EAAA,CAAY;AAAA,QACtCK,KAAY,gBAAAf,EAACH,GAAA,EAAa,WAAWe,GAAiB,UAAAD,GAAM;AAAA,QAC5DK,IAAmBjB,IAAW,gBAAAC,EAACC,GAAA,EAAe,WAAWY,GAAmB,UAAAd,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGlG,CAAC;AAEDM,EAAQ,QAAQR;AAChBQ,EAAQ,UAAUJ;AAElB,OAAO,OAAOI,GAASV,CAAa;"}
1
+ {"version":3,"file":"Popover.js","sources":["../../../src/components/popover/Popover.tsx"],"sourcesContent":["import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type RefAttributes,\n type PropsWithChildren,\n type ReactNode,\n type ComponentProps,\n isValidElement,\n useState,\n useEffect,\n} from 'react';\n\nimport { PLACEMENT } from '../../values/Placement';\n\nexport const PLACEMENT_MAP = {\n AUTO: PLACEMENT.AUTO,\n TOP: PLACEMENT.TOP,\n RIGHT: PLACEMENT.RIGHT,\n BOTTOM: PLACEMENT.BOTTOM,\n LEFT: PLACEMENT.LEFT,\n} as const;\n\nexport type PopoverProps = Omit<ComponentProps<'div'>, 'title'> & {\n /**\n * HTML ID attribute, necessary for accessibility.\n */\n id: string;\n\n /**\n * Sets the direction the Popover is positioned towards.\n *\n * This is generally provided by the OverlayTrigger component positioning the Popover.\n *\n * Possible values are:\n *\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n */\n placement?: 'auto' | 'top' | 'right' | 'bottom' | 'left';\n\n /**\n * Additional props assigned to the arrow element. Internally used.\n */\n arrowProps?: Record<string, unknown>;\n\n /**\n * Any element to be rendered as the title of the Popover.\n *\n * It creates a `Popover.Title` inside the `Popover` passing the title directly into it.\n */\n title?: string | ReactNode;\n\n /**\n * Additional classes to be set on the `Popover.Title` element.\n */\n titleClassName?: string;\n\n /**\n * Additional classes to be set on the `Popover.Content` element.\n */\n contentClassName?: string;\n\n /**\n * Additional class names for the wrapper element.\n */\n className?: string;\n};\n\nconst PopoverTitle = ({ className = '', children }: PropsWithChildren<{ className?: string }>) => (\n <div className={`popover-header popover-title ${className}`}>{children}</div>\n);\n\nconst PopoverContent = ({ className = '', children }: PropsWithChildren<{ className?: string }>) => (\n <div className={`popover-content popover-body ${className}`}>{children}</div>\n);\n\nconst isPopoverTitleOrContent = (element: ReactNode): boolean => {\n return isValidElement(element) && (element.type === PopoverTitle || element.type === PopoverContent);\n};\n\ntype PopoverType = ForwardRefExoticComponent<PropsWithChildren<PopoverProps> & RefAttributes<HTMLDivElement>> & {\n Title: typeof PopoverTitle;\n Content: typeof PopoverContent;\n};\n\nconst Popover = forwardRef<HTMLDivElement, PropsWithChildren<PopoverProps>>((props, ref) => {\n const {\n placement = 'bottom',\n arrowProps,\n title,\n titleClassName = '',\n contentClassName = '',\n children,\n className = '',\n ...remainingProps\n } = props;\n\n const hasTitle = !!title;\n const hasCustomContent = React.Children.toArray(children).some(isPopoverTitleOrContent);\n\n // Mount the component but don't show it yet via CSS.\n // After it is mounted, we set the visibility class to use CSS animation\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n return (\n <div\n {...remainingProps}\n role='tooltip'\n // x-placement is used by the css to define how to position the arrow.\n // eslint-disable-next-line react/no-unknown-property\n x-placement={placement}\n ref={ref}\n className={`popover fade ${isMounted ? 'show' : ''} ${className}`}\n >\n <div className='arrow' {...arrowProps} />\n {hasTitle && <PopoverTitle className={titleClassName}>{title}</PopoverTitle>}\n {hasCustomContent ? children : <PopoverContent className={contentClassName}>{children}</PopoverContent>}\n </div>\n );\n}) as PopoverType;\n\nPopover.Title = PopoverTitle;\nPopover.Content = PopoverContent;\n\nObject.assign(Popover, PLACEMENT_MAP);\n\nexport default Popover;\n"],"names":["PLACEMENT_MAP","PLACEMENT","PopoverTitle","className","children","jsx","PopoverContent","isPopoverTitleOrContent","element","isValidElement","Popover","forwardRef","props","ref","placement","arrowProps","title","titleClassName","contentClassName","remainingProps","hasTitle","hasCustomContent","React","isMounted","setIsMounted","useState","useEffect","jsxs"],"mappings":";;;AAcO,MAAMA,IAAgB;AAAA,EACzB,MAAMC,EAAU;AAAA,EAChB,KAAKA,EAAU;AAAA,EACf,OAAOA,EAAU;AAAA,EACjB,QAAQA,EAAU;AAAA,EAClB,MAAMA,EAAU;AACpB,GAmDMC,IAAe,CAAC,EAAE,WAAAC,IAAY,IAAI,UAAAC,EAAA,MACpC,gBAAAC,EAAC,OAAA,EAAI,WAAW,gCAAgCF,CAAS,IAAK,UAAAC,EAAA,CAAS,GAGrEE,IAAiB,CAAC,EAAE,WAAAH,IAAY,IAAI,UAAAC,EAAA,MACtC,gBAAAC,EAAC,OAAA,EAAI,WAAW,gCAAgCF,CAAS,IAAK,UAAAC,EAAA,CAAS,GAGrEG,IAA0B,CAACC,MACtBC,EAAeD,CAAO,MAAMA,EAAQ,SAASN,KAAgBM,EAAQ,SAASF,IAQnFI,IAAUC,EAA4D,CAACC,GAAOC,MAAQ;AACxF,QAAM;AAAA,IACF,WAAAC,IAAY;AAAA,IACZ,YAAAC;AAAA,IACA,OAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,kBAAAC,IAAmB;AAAA,IACnB,UAAAd;AAAA,IACA,WAAAD,IAAY;AAAA,IACZ,GAAGgB;AAAA,EAAA,IACHP,GAEEQ,IAAW,CAAC,CAACJ,GACbK,IAAmBC,EAAM,SAAS,QAAQlB,CAAQ,EAAE,KAAKG,CAAuB,GAIhF,CAACgB,GAAWC,CAAY,IAAIC,EAAS,EAAK;AAChD,SAAAC,EAAU,MAAMF,EAAa,EAAI,GAAG,CAAA,CAAE,GAGlC,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGR;AAAA,MACJ,MAAK;AAAA,MAGL,eAAaL;AAAA,MACb,KAAAD;AAAA,MACA,WAAW,gBAAgBU,IAAY,SAAS,EAAE,IAAIpB,CAAS;AAAA,MAE/D,UAAA;AAAA,QAAA,gBAAAE,EAAC,OAAA,EAAI,WAAU,SAAS,GAAGU,EAAA,CAAY;AAAA,QACtCK,KAAY,gBAAAf,EAACH,GAAA,EAAa,WAAWe,GAAiB,UAAAD,GAAM;AAAA,QAC5DK,IAAmBjB,IAAW,gBAAAC,EAACC,GAAA,EAAe,WAAWY,GAAmB,UAAAd,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGlG,CAAC;AAEDM,EAAQ,QAAQR;AAChBQ,EAAQ,UAAUJ;AAElB,OAAO,OAAOI,GAASV,CAAa;"}
@@ -34,7 +34,7 @@ export type ImagePreloaderProps = {
34
34
  *
35
35
  * The function will receive props containing the `status` and `image` properties.
36
36
  *
37
- * `status` will be one of 'PENDING', 'FAILED' or 'LOADED'. `image` is the Image element.
37
+ * `status` will be one of `PENDING`, `FAILED` or `LOADED`. `image` is the Image element.
38
38
  */
39
39
  children?: ImagePreloaderChild;
40
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ImagePreloader.js","sources":["../../../src/components/preloader/ImagePreloader.tsx"],"sourcesContent":["import { type JSX, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { noop } from 'es-toolkit/compat';\n\nconst loadImage =\n (onLoad: (event: Event) => void, onError: (event: Event | string) => void) =>\n (src: string, isAnonymous: boolean) => {\n const image = new Image();\n\n if (isAnonymous) {\n image.crossOrigin = 'anonymous';\n }\n\n // attach listeners\n image.onload = onLoad;\n image.onerror = onError;\n\n // preload the actual image\n image.src = src;\n\n return image;\n };\n\ntype ImagePreloaderStatus = 'PENDING' | 'FAILED' | 'LOADED';\n\nexport type ImagePreloaderChild = (props: {\n status: ImagePreloaderStatus;\n image: HTMLImageElement;\n}) => JSX.Element | null;\n\nexport type ImagePreloaderProps = {\n /**\n * The URL of the image to load.\n */\n src: string;\n\n /**\n * Invoked when the image is loaded.\n *\n * @param image The native Image object.\n */\n onLoaded?: (image: HTMLImageElement) => void;\n\n /**\n * Invoked when the image failed to load.\n *\n * @param image The native Image object.\n */\n onFailed?: (image: HTMLImageElement) => void;\n\n /**\n * Whether to set the \"crossOrigin\" to \"anonymous\".\n *\n * @default false\n */\n isAnonymous?: boolean;\n\n /**\n * A render function can be used to access both the current state and the image element.\n *\n * Using this, you can decide how to render the different states and/or the loaded image.\n *\n * The function will receive props containing the `status` and `image` properties.\n *\n * `status` will be one of 'PENDING', 'FAILED' or 'LOADED'. `image` is the Image element.\n */\n children?: ImagePreloaderChild;\n};\n\nconst ImagePreloader = (props: ImagePreloaderProps) => {\n const { src, isAnonymous = false, onLoaded = noop, onFailed = noop, children } = props;\n\n const [status, setStatus] = useState<ImagePreloaderStatus>('PENDING');\n const [image, setImage] = useState<HTMLImageElement | null>(null);\n const imageRef = useRef<HTMLImageElement | null>(null);\n\n const willUnmount = useRef(false);\n\n const handleImageLoaded = useCallback(() => {\n const currentImage = imageRef.current;\n\n if (willUnmount.current || !currentImage) {\n return;\n }\n setStatus('LOADED');\n onLoaded(currentImage);\n }, [onLoaded]);\n\n const handleImageFailed = useCallback(() => {\n const currentImage = imageRef.current;\n\n if (willUnmount.current || !currentImage) {\n return;\n }\n setStatus('FAILED');\n onFailed(currentImage);\n }, [onFailed]);\n\n const loadImageWithCallbacks = useMemo(\n () => loadImage(handleImageLoaded, handleImageFailed),\n [handleImageLoaded, handleImageFailed]\n );\n\n useEffect(() => {\n willUnmount.current = false;\n setStatus('PENDING');\n\n const nextImage = loadImageWithCallbacks(src, isAnonymous);\n imageRef.current = nextImage;\n setImage(nextImage);\n\n return () => {\n willUnmount.current = true;\n };\n }, [src, isAnonymous, loadImageWithCallbacks]);\n\n return children && image ? children({ status, image }) : null;\n};\n\nImagePreloader.STATUS_PENDING = 'PENDING';\nImagePreloader.STATUS_LOADED = 'LOADED';\nImagePreloader.STATUS_FAILED = 'FAILED';\n\nexport default ImagePreloader;\n"],"names":["loadImage","onLoad","onError","src","isAnonymous","image","ImagePreloader","props","onLoaded","noop","onFailed","children","status","setStatus","useState","setImage","imageRef","useRef","willUnmount","handleImageLoaded","useCallback","currentImage","handleImageFailed","loadImageWithCallbacks","useMemo","useEffect","nextImage"],"mappings":";;AAGA,MAAMA,IACF,CAACC,GAAgCC,MACjC,CAACC,GAAaC,MAAyB;AACnC,QAAMC,IAAQ,IAAI,MAAA;AAElB,SAAID,MACAC,EAAM,cAAc,cAIxBA,EAAM,SAASJ,GACfI,EAAM,UAAUH,GAGhBG,EAAM,MAAMF,GAELE;AACX,GAgDEC,IAAiB,CAACC,MAA+B;AACnD,QAAM,EAAE,KAAAJ,GAAK,aAAAC,IAAc,IAAO,UAAAI,IAAWC,GAAM,UAAAC,IAAWD,GAAM,UAAAE,EAAA,IAAaJ,GAE3E,CAACK,GAAQC,CAAS,IAAIC,EAA+B,SAAS,GAC9D,CAACT,GAAOU,CAAQ,IAAID,EAAkC,IAAI,GAC1DE,IAAWC,EAAgC,IAAI,GAE/CC,IAAcD,EAAO,EAAK,GAE1BE,IAAoBC,EAAY,MAAM;AACxC,UAAMC,IAAeL,EAAS;AAE9B,IAAIE,EAAY,WAAW,CAACG,MAG5BR,EAAU,QAAQ,GAClBL,EAASa,CAAY;AAAA,EACzB,GAAG,CAACb,CAAQ,CAAC,GAEPc,IAAoBF,EAAY,MAAM;AACxC,UAAMC,IAAeL,EAAS;AAE9B,IAAIE,EAAY,WAAW,CAACG,MAG5BR,EAAU,QAAQ,GAClBH,EAASW,CAAY;AAAA,EACzB,GAAG,CAACX,CAAQ,CAAC,GAEPa,IAAyBC;AAAA,IAC3B,MAAMxB,EAAUmB,GAAmBG,CAAiB;AAAA,IACpD,CAACH,GAAmBG,CAAiB;AAAA,EAAA;AAGzC,SAAAG,EAAU,MAAM;AACZ,IAAAP,EAAY,UAAU,IACtBL,EAAU,SAAS;AAEnB,UAAMa,IAAYH,EAAuBpB,GAAKC,CAAW;AACzD,WAAAY,EAAS,UAAUU,GACnBX,EAASW,CAAS,GAEX,MAAM;AACT,MAAAR,EAAY,UAAU;AAAA,IAC1B;AAAA,EACJ,GAAG,CAACf,GAAKC,GAAamB,CAAsB,CAAC,GAEtCZ,KAAYN,IAAQM,EAAS,EAAE,QAAAC,GAAQ,OAAAP,EAAA,CAAO,IAAI;AAC7D;AAEAC,EAAe,iBAAiB;AAChCA,EAAe,gBAAgB;AAC/BA,EAAe,gBAAgB;"}
1
+ {"version":3,"file":"ImagePreloader.js","sources":["../../../src/components/preloader/ImagePreloader.tsx"],"sourcesContent":["import { type JSX, useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { noop } from 'es-toolkit/compat';\n\nconst loadImage =\n (onLoad: (event: Event) => void, onError: (event: Event | string) => void) =>\n (src: string, isAnonymous: boolean) => {\n const image = new Image();\n\n if (isAnonymous) {\n image.crossOrigin = 'anonymous';\n }\n\n // attach listeners\n image.onload = onLoad;\n image.onerror = onError;\n\n // preload the actual image\n image.src = src;\n\n return image;\n };\n\ntype ImagePreloaderStatus = 'PENDING' | 'FAILED' | 'LOADED';\n\nexport type ImagePreloaderChild = (props: {\n status: ImagePreloaderStatus;\n image: HTMLImageElement;\n}) => JSX.Element | null;\n\nexport type ImagePreloaderProps = {\n /**\n * The URL of the image to load.\n */\n src: string;\n\n /**\n * Invoked when the image is loaded.\n *\n * @param image The native Image object.\n */\n onLoaded?: (image: HTMLImageElement) => void;\n\n /**\n * Invoked when the image failed to load.\n *\n * @param image The native Image object.\n */\n onFailed?: (image: HTMLImageElement) => void;\n\n /**\n * Whether to set the \"crossOrigin\" to \"anonymous\".\n *\n * @default false\n */\n isAnonymous?: boolean;\n\n /**\n * A render function can be used to access both the current state and the image element.\n *\n * Using this, you can decide how to render the different states and/or the loaded image.\n *\n * The function will receive props containing the `status` and `image` properties.\n *\n * `status` will be one of `PENDING`, `FAILED` or `LOADED`. `image` is the Image element.\n */\n children?: ImagePreloaderChild;\n};\n\nconst ImagePreloader = (props: ImagePreloaderProps) => {\n const { src, isAnonymous = false, onLoaded = noop, onFailed = noop, children } = props;\n\n const [status, setStatus] = useState<ImagePreloaderStatus>('PENDING');\n const [image, setImage] = useState<HTMLImageElement | null>(null);\n const imageRef = useRef<HTMLImageElement | null>(null);\n\n const willUnmount = useRef(false);\n\n const handleImageLoaded = useCallback(() => {\n const currentImage = imageRef.current;\n\n if (willUnmount.current || !currentImage) {\n return;\n }\n setStatus('LOADED');\n onLoaded(currentImage);\n }, [onLoaded]);\n\n const handleImageFailed = useCallback(() => {\n const currentImage = imageRef.current;\n\n if (willUnmount.current || !currentImage) {\n return;\n }\n setStatus('FAILED');\n onFailed(currentImage);\n }, [onFailed]);\n\n const loadImageWithCallbacks = useMemo(\n () => loadImage(handleImageLoaded, handleImageFailed),\n [handleImageLoaded, handleImageFailed]\n );\n\n useEffect(() => {\n willUnmount.current = false;\n setStatus('PENDING');\n\n const nextImage = loadImageWithCallbacks(src, isAnonymous);\n imageRef.current = nextImage;\n setImage(nextImage);\n\n return () => {\n willUnmount.current = true;\n };\n }, [src, isAnonymous, loadImageWithCallbacks]);\n\n return children && image ? children({ status, image }) : null;\n};\n\nImagePreloader.STATUS_PENDING = 'PENDING';\nImagePreloader.STATUS_LOADED = 'LOADED';\nImagePreloader.STATUS_FAILED = 'FAILED';\n\nexport default ImagePreloader;\n"],"names":["loadImage","onLoad","onError","src","isAnonymous","image","ImagePreloader","props","onLoaded","noop","onFailed","children","status","setStatus","useState","setImage","imageRef","useRef","willUnmount","handleImageLoaded","useCallback","currentImage","handleImageFailed","loadImageWithCallbacks","useMemo","useEffect","nextImage"],"mappings":";;AAGA,MAAMA,IACF,CAACC,GAAgCC,MACjC,CAACC,GAAaC,MAAyB;AACnC,QAAMC,IAAQ,IAAI,MAAA;AAElB,SAAID,MACAC,EAAM,cAAc,cAIxBA,EAAM,SAASJ,GACfI,EAAM,UAAUH,GAGhBG,EAAM,MAAMF,GAELE;AACX,GAgDEC,IAAiB,CAACC,MAA+B;AACnD,QAAM,EAAE,KAAAJ,GAAK,aAAAC,IAAc,IAAO,UAAAI,IAAWC,GAAM,UAAAC,IAAWD,GAAM,UAAAE,EAAA,IAAaJ,GAE3E,CAACK,GAAQC,CAAS,IAAIC,EAA+B,SAAS,GAC9D,CAACT,GAAOU,CAAQ,IAAID,EAAkC,IAAI,GAC1DE,IAAWC,EAAgC,IAAI,GAE/CC,IAAcD,EAAO,EAAK,GAE1BE,IAAoBC,EAAY,MAAM;AACxC,UAAMC,IAAeL,EAAS;AAE9B,IAAIE,EAAY,WAAW,CAACG,MAG5BR,EAAU,QAAQ,GAClBL,EAASa,CAAY;AAAA,EACzB,GAAG,CAACb,CAAQ,CAAC,GAEPc,IAAoBF,EAAY,MAAM;AACxC,UAAMC,IAAeL,EAAS;AAE9B,IAAIE,EAAY,WAAW,CAACG,MAG5BR,EAAU,QAAQ,GAClBH,EAASW,CAAY;AAAA,EACzB,GAAG,CAACX,CAAQ,CAAC,GAEPa,IAAyBC;AAAA,IAC3B,MAAMxB,EAAUmB,GAAmBG,CAAiB;AAAA,IACpD,CAACH,GAAmBG,CAAiB;AAAA,EAAA;AAGzC,SAAAG,EAAU,MAAM;AACZ,IAAAP,EAAY,UAAU,IACtBL,EAAU,SAAS;AAEnB,UAAMa,IAAYH,EAAuBpB,GAAKC,CAAW;AACzD,WAAAY,EAAS,UAAUU,GACnBX,EAASW,CAAS,GAEX,MAAM;AACT,MAAAR,EAAY,UAAU;AAAA,IAC1B;AAAA,EACJ,GAAG,CAACf,GAAKC,GAAamB,CAAsB,CAAC,GAEtCZ,KAAYN,IAAQM,EAAS,EAAE,QAAAC,GAAQ,OAAAP,EAAA,CAAO,IAAI;AAC7D;AAEAC,EAAe,iBAAiB;AAChCA,EAAe,gBAAgB;AAC/BA,EAAe,gBAAgB;"}
@@ -7,7 +7,7 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
7
7
  /**
8
8
  * The label position.
9
9
  *
10
- * Possible values are: "horizontal" or "vertical".
10
+ * Possible values are: `'horizontal'` or `'vertical'`.
11
11
  *
12
12
  * @default 'vertical'
13
13
  */
@@ -25,7 +25,7 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
25
25
  /**
26
26
  * Callback function that is invoked when the radio button is clicked.
27
27
  *
28
- * @default noop
28
+ * @default () => {}
29
29
  */
30
30
  onClick?: MouseEventHandler<{
31
31
  value: string | string[] | number;
@@ -34,7 +34,7 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
34
34
  * Callback function that is invoked when the radio button is toggled and the state should change (for controlled
35
35
  * usage).
36
36
  *
37
- * @default noop
37
+ * @default () => {}
38
38
  */
39
39
  onChange?: ChangeEventHandler;
40
40
  /**
@@ -81,8 +81,10 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
81
81
  name?: string;
82
82
  /**
83
83
  * The value attribute is a string containing the radio button's value but __it is never shown to the user__.
84
+ *
84
85
  * It serves a special purpose for inputs of type radio: when a form is submitted, only radio buttons which are
85
86
  * currently checked are submitted, and the reported value is the value of the value attribute.
87
+ *
86
88
  * If the value is not otherwise specified, it is the string on by default.
87
89
  *
88
90
  * This is useful when using native `FormData` when submitting a form to get the selected radio button value.
@@ -92,8 +94,10 @@ export type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onCl
92
94
  * Number of the index used for keyboard support.
93
95
  *
94
96
  * An index of 0 means that the element should be focusable in sequential keyboard navigation, but its order is
95
- * defined by the document's source order. To disable the focus set the value to -1. A positive value means the
96
- * element should be focusable in sequential keyboard navigation, with its order defined by the value of the number.
97
+ * defined by the document's source order. To disable the focus set the value to -1.
98
+ *
99
+ * A positive value means the element should be focusable in sequential keyboard navigation,
100
+ * with its order defined by the value of the number.
97
101
  *
98
102
  * @default 0
99
103
  */
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.js","sources":["../../../src/components/radiobutton/RadioButton.tsx"],"sourcesContent":["import {\n type ChangeEventHandler,\n type KeyboardEvent,\n type MouseEventHandler,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n useRef,\n type HTMLProps,\n} from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/compat';\n\ntype RadioButtonIconProps = {\n icon: string;\n iconSize: number;\n iconLabelPosition: 'vertical' | 'horizontal';\n text: string | ReactNode;\n};\n\nconst RadioButtonIcon = (props: RadioButtonIconProps) => {\n const { icon, iconSize, iconLabelPosition, text } = props;\n\n const iconStyles = {\n width: `${iconSize}px`,\n height: `${iconSize}px`,\n fontSize: `${iconSize}px`,\n lineHeight: `${iconSize}px`,\n };\n\n return (\n <span className={`radio-icon label-${iconLabelPosition}`}>\n <span className={`rioglyph ${icon}`} style={iconStyles} />\n <span className='radio-label'>{text}</span>\n </span>\n );\n};\n\nexport type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onClick'> & {\n /**\n * Define any rioglyph icon like \"rioglyph-truck\".\n */\n icon?: string;\n\n /**\n * The label position.\n *\n * Possible values are: \"horizontal\" or \"vertical\".\n *\n * @default 'vertical'\n */\n iconLabelPosition?: 'vertical' | 'horizontal';\n\n /**\n * The icon Size in px.\n *\n * @default 16\n */\n iconSize?: number;\n\n /**\n * Defines the label text.\n */\n label?: string | ReactNode;\n\n /**\n * Callback function that is invoked when the radio button is clicked.\n *\n * @default noop\n */\n onClick?: MouseEventHandler<{ value: string | string[] | number }>;\n\n /**\n * Callback function that is invoked when the radio button is toggled and the state should change (for controlled\n * usage).\n *\n * @default noop\n */\n onChange?: ChangeEventHandler;\n\n /**\n * Defines whether the radio is checked (for controlled usage).\n */\n checked?: boolean;\n\n /**\n * Defines whether the radio is initially checked (state can be changed on click).\n */\n defaultChecked?: boolean;\n\n /**\n * Defines whether the checkbox is disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input element.\n */\n className?: string;\n\n /**\n * Defines whether the radio button is applying an inline style.\n *\n * Use this in combination with other radio buttons.\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Displays the icon on the right side of the text.\n *\n * @default false\n */\n right?: boolean;\n\n /**\n * Allows for rendering a completely different layout with or without a radio tick.\n *\n * @default false\n */\n custom?: boolean;\n\n /**\n * Name to be given to the input element.\n */\n name?: string;\n\n /**\n * The value attribute is a string containing the radio button's value but __it is never shown to the user__.\n * It serves a special purpose for inputs of type radio: when a form is submitted, only radio buttons which are\n * currently checked are submitted, and the reported value is the value of the value attribute.\n * If the value is not otherwise specified, it is the string on by default.\n *\n * This is useful when using native `FormData` when submitting a form to get the selected radio button value.\n */\n value?: string;\n\n /**\n * Number of the index used for keyboard support.\n *\n * An index of 0 means that the element should be focusable in sequential keyboard navigation, but its order is\n * defined by the document's source order. To disable the focus set the value to -1. A positive value means the\n * element should be focusable in sequential keyboard navigation, with its order defined by the value of the number.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Ref which is added to the input element.\n */\n inputRef?: Ref<HTMLInputElement>;\n};\n\nconst RadioButton = (props: PropsWithChildren<RadioButtonProps>) => {\n const {\n icon = '',\n iconLabelPosition = 'vertical',\n iconSize = 16,\n label,\n onClick = noop,\n onChange = noop,\n checked,\n defaultChecked,\n disabled = false,\n className,\n inline = false,\n right = false,\n custom = false,\n name,\n value,\n tabIndex = 0,\n inputRef,\n children,\n ...remainingProps\n } = props;\n\n const isControlled = checked !== null && checked !== undefined;\n\n const labelRef = useRef<HTMLLabelElement>(null);\n\n const handleToggleKeyDown = (event: KeyboardEvent<HTMLLabelElement>) => {\n switch (event.key) {\n case ' ': // toggle on space\n case 'Enter': // open on enter\n toggle(event);\n break;\n\n default:\n break;\n }\n };\n\n const toggle = (event: KeyboardEvent<HTMLLabelElement>) => {\n event.preventDefault();\n\n if (disabled) {\n return;\n }\n\n // Controlled case - uses \"onChange()\" instead of \"onClick()\" callback\n if (isControlled) {\n onChange(event);\n return;\n }\n\n // Uncontrolled case - set the input checked or unchecked\n if (labelRef.current) {\n const checkbox = labelRef.current.firstChild as HTMLInputElement;\n checkbox.checked = !checkbox.checked;\n }\n };\n\n const text = label || children;\n\n const labelClassnames = classNames('radio', inline && 'radio-inline', className);\n const inputClassnames = classNames(right && 'icon-right', className);\n\n const renderCustomIcon = !!icon;\n const renderCustomContent = custom && children;\n const renderDefault = !icon && !custom;\n\n return (\n <label\n {...remainingProps}\n className={labelClassnames}\n tabIndex={tabIndex}\n onKeyDown={handleToggleKeyDown}\n ref={labelRef}\n >\n <input\n type='radio'\n defaultChecked={defaultChecked}\n checked={checked}\n disabled={disabled}\n className={inputClassnames}\n ref={inputRef}\n onClick={onClick}\n // Only wire onChange for controlled usage; uncontrolled relies on native state + onClick.\n onChange={isControlled ? onChange : undefined}\n name={name}\n value={value}\n />\n {renderCustomIcon && (\n <RadioButtonIcon icon={icon} iconSize={iconSize} iconLabelPosition={iconLabelPosition} text={text} />\n )}\n {renderDefault && (\n <span className='radio-text'>\n <span>{text}</span>\n </span>\n )}\n {renderCustomContent && children}\n </label>\n );\n};\n\nRadioButton.ICON_LABEL_VERTICAL = 'vertical';\nRadioButton.ICON_LABEL_HORIZONTAL = 'horizontal';\n\nexport default RadioButton;\n"],"names":["RadioButtonIcon","props","icon","iconSize","iconLabelPosition","text","iconStyles","jsxs","jsx","RadioButton","label","onClick","noop","onChange","checked","defaultChecked","disabled","className","inline","right","custom","name","value","tabIndex","inputRef","children","remainingProps","isControlled","labelRef","useRef","handleToggleKeyDown","event","toggle","checkbox","labelClassnames","classNames","inputClassnames"],"mappings":";;;;AAoBA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,MAAAC,GAAM,UAAAC,GAAU,mBAAAC,GAAmB,MAAAC,MAASJ,GAE9CK,IAAa;AAAA,IACf,OAAO,GAAGH,CAAQ;AAAA,IAClB,QAAQ,GAAGA,CAAQ;AAAA,IACnB,UAAU,GAAGA,CAAQ;AAAA,IACrB,YAAY,GAAGA,CAAQ;AAAA,EAAA;AAG3B,SACI,gBAAAI,EAAC,QAAA,EAAK,WAAW,oBAAoBH,CAAiB,IAClD,UAAA;AAAA,IAAA,gBAAAI,EAAC,UAAK,WAAW,YAAYN,CAAI,IAAI,OAAOI,GAAY;AAAA,IACxD,gBAAAE,EAAC,QAAA,EAAK,WAAU,eAAe,UAAAH,EAAA,CAAK;AAAA,EAAA,GACxC;AAER,GAyHMI,IAAc,CAACR,MAA+C;AAChE,QAAM;AAAA,IACF,MAAAC,IAAO;AAAA,IACP,mBAAAE,IAAoB;AAAA,IACpB,UAAAD,IAAW;AAAA,IACX,OAAAO;AAAA,IACA,SAAAC,IAAUC;AAAA,IACV,UAAAC,IAAWD;AAAA,IACX,SAAAE;AAAA,IACA,gBAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,WAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,OAAAC,IAAQ;AAAA,IACR,QAAAC,IAAS;AAAA,IACT,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACHzB,GAEE0B,IAAeb,KAAY,MAE3Bc,IAAWC,EAAyB,IAAI,GAExCC,IAAsB,CAACC,MAA2C;AACpE,YAAQA,EAAM,KAAA;AAAA,MACV,KAAK;AAAA;AAAA,MACL,KAAK;AACD,QAAAC,EAA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","sources":["../../../src/components/radiobutton/RadioButton.tsx"],"sourcesContent":["import {\n type ChangeEventHandler,\n type KeyboardEvent,\n type MouseEventHandler,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n useRef,\n type HTMLProps,\n} from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/compat';\n\ntype RadioButtonIconProps = {\n icon: string;\n iconSize: number;\n iconLabelPosition: 'vertical' | 'horizontal';\n text: string | ReactNode;\n};\n\nconst RadioButtonIcon = (props: RadioButtonIconProps) => {\n const { icon, iconSize, iconLabelPosition, text } = props;\n\n const iconStyles = {\n width: `${iconSize}px`,\n height: `${iconSize}px`,\n fontSize: `${iconSize}px`,\n lineHeight: `${iconSize}px`,\n };\n\n return (\n <span className={`radio-icon label-${iconLabelPosition}`}>\n <span className={`rioglyph ${icon}`} style={iconStyles} />\n <span className='radio-label'>{text}</span>\n </span>\n );\n};\n\nexport type RadioButtonProps = Omit<HTMLProps<HTMLLabelElement>, 'label' | 'onClick'> & {\n /**\n * Define any rioglyph icon like \"rioglyph-truck\".\n */\n icon?: string;\n\n /**\n * The label position.\n *\n * Possible values are: `'horizontal'` or `'vertical'`.\n *\n * @default 'vertical'\n */\n iconLabelPosition?: 'vertical' | 'horizontal';\n\n /**\n * The icon Size in px.\n *\n * @default 16\n */\n iconSize?: number;\n\n /**\n * Defines the label text.\n */\n label?: string | ReactNode;\n\n /**\n * Callback function that is invoked when the radio button is clicked.\n *\n * @default () => {}\n */\n onClick?: MouseEventHandler<{ value: string | string[] | number }>;\n\n /**\n * Callback function that is invoked when the radio button is toggled and the state should change (for controlled\n * usage).\n *\n * @default () => {}\n */\n onChange?: ChangeEventHandler;\n\n /**\n * Defines whether the radio is checked (for controlled usage).\n */\n checked?: boolean;\n\n /**\n * Defines whether the radio is initially checked (state can be changed on click).\n */\n defaultChecked?: boolean;\n\n /**\n * Defines whether the checkbox is disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Additional classes to be set on the input element.\n */\n className?: string;\n\n /**\n * Defines whether the radio button is applying an inline style.\n *\n * Use this in combination with other radio buttons.\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Displays the icon on the right side of the text.\n *\n * @default false\n */\n right?: boolean;\n\n /**\n * Allows for rendering a completely different layout with or without a radio tick.\n *\n * @default false\n */\n custom?: boolean;\n\n /**\n * Name to be given to the input element.\n */\n name?: string;\n\n /**\n * The value attribute is a string containing the radio button's value but __it is never shown to the user__.\n *\n * It serves a special purpose for inputs of type radio: when a form is submitted, only radio buttons which are\n * currently checked are submitted, and the reported value is the value of the value attribute.\n *\n * If the value is not otherwise specified, it is the string on by default.\n *\n * This is useful when using native `FormData` when submitting a form to get the selected radio button value.\n */\n value?: string;\n\n /**\n * Number of the index used for keyboard support.\n *\n * An index of 0 means that the element should be focusable in sequential keyboard navigation, but its order is\n * defined by the document's source order. To disable the focus set the value to -1.\n *\n * A positive value means the element should be focusable in sequential keyboard navigation,\n * with its order defined by the value of the number.\n *\n * @default 0\n */\n tabIndex?: number;\n\n /**\n * Ref which is added to the input element.\n */\n inputRef?: Ref<HTMLInputElement>;\n};\n\nconst RadioButton = (props: PropsWithChildren<RadioButtonProps>) => {\n const {\n icon = '',\n iconLabelPosition = 'vertical',\n iconSize = 16,\n label,\n onClick = noop,\n onChange = noop,\n checked,\n defaultChecked,\n disabled = false,\n className,\n inline = false,\n right = false,\n custom = false,\n name,\n value,\n tabIndex = 0,\n inputRef,\n children,\n ...remainingProps\n } = props;\n\n const isControlled = checked !== null && checked !== undefined;\n\n const labelRef = useRef<HTMLLabelElement>(null);\n\n const handleToggleKeyDown = (event: KeyboardEvent<HTMLLabelElement>) => {\n switch (event.key) {\n case ' ': // toggle on space\n case 'Enter': // open on enter\n toggle(event);\n break;\n\n default:\n break;\n }\n };\n\n const toggle = (event: KeyboardEvent<HTMLLabelElement>) => {\n event.preventDefault();\n\n if (disabled) {\n return;\n }\n\n // Controlled case - uses \"onChange()\" instead of \"onClick()\" callback\n if (isControlled) {\n onChange(event);\n return;\n }\n\n // Uncontrolled case - set the input checked or unchecked\n if (labelRef.current) {\n const checkbox = labelRef.current.firstChild as HTMLInputElement;\n checkbox.checked = !checkbox.checked;\n }\n };\n\n const text = label || children;\n\n const labelClassnames = classNames('radio', inline && 'radio-inline', className);\n const inputClassnames = classNames(right && 'icon-right', className);\n\n const renderCustomIcon = !!icon;\n const renderCustomContent = custom && children;\n const renderDefault = !icon && !custom;\n\n return (\n <label\n {...remainingProps}\n className={labelClassnames}\n tabIndex={tabIndex}\n onKeyDown={handleToggleKeyDown}\n ref={labelRef}\n >\n <input\n type='radio'\n defaultChecked={defaultChecked}\n checked={checked}\n disabled={disabled}\n className={inputClassnames}\n ref={inputRef}\n onClick={onClick}\n // Only wire onChange for controlled usage; uncontrolled relies on native state + onClick.\n onChange={isControlled ? onChange : undefined}\n name={name}\n value={value}\n />\n {renderCustomIcon && (\n <RadioButtonIcon icon={icon} iconSize={iconSize} iconLabelPosition={iconLabelPosition} text={text} />\n )}\n {renderDefault && (\n <span className='radio-text'>\n <span>{text}</span>\n </span>\n )}\n {renderCustomContent && children}\n </label>\n );\n};\n\nRadioButton.ICON_LABEL_VERTICAL = 'vertical';\nRadioButton.ICON_LABEL_HORIZONTAL = 'horizontal';\n\nexport default RadioButton;\n"],"names":["RadioButtonIcon","props","icon","iconSize","iconLabelPosition","text","iconStyles","jsxs","jsx","RadioButton","label","onClick","noop","onChange","checked","defaultChecked","disabled","className","inline","right","custom","name","value","tabIndex","inputRef","children","remainingProps","isControlled","labelRef","useRef","handleToggleKeyDown","event","toggle","checkbox","labelClassnames","classNames","inputClassnames"],"mappings":";;;;AAoBA,MAAMA,IAAkB,CAACC,MAAgC;AACrD,QAAM,EAAE,MAAAC,GAAM,UAAAC,GAAU,mBAAAC,GAAmB,MAAAC,MAASJ,GAE9CK,IAAa;AAAA,IACf,OAAO,GAAGH,CAAQ;AAAA,IAClB,QAAQ,GAAGA,CAAQ;AAAA,IACnB,UAAU,GAAGA,CAA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,KAASe,GAEhBS,IAAkBC,EAAW,SAASjB,KAAU,gBAAgBD,CAAS,GACzEmB,IAAkBD,EAAWhB,KAAS,cAAcF,CAAS;AAMnE,SACI,gBAAAV;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGmB;AAAA,MACJ,WAAWQ;AAAA,MACX,UAAAX;AAAA,MACA,WAAWO;AAAA,MACX,KAAKF;AAAA,MAEL,UAAA;AAAA,QAAA,gBAAApB;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,MAAK;AAAA,YACL,gBAAAO;AAAA,YACA,SAAAD;AAAA,YACA,UAAAE;AAAA,YACA,WAAWoB;AAAA,YACX,KAAKZ;AAAA,YACL,SAAAb;AAAA,YAEA,UAAUgB,IAAed,IAAW;AAAA,YACpC,MAAAQ;AAAA,YACA,OAAAC;AAAA,UAAA;AAAA,QAAA;AAAA,QAvBa,CAAC,CAACpB,KA0Bf,gBAAAM,EAACR,GAAA,EAAgB,MAAAE,GAAY,UAAAC,GAAoB,mBAAAC,GAAsC,MAAAC,GAAY;AAAA,QAxBzF,CAACH,KAAQ,CAACkB,uBA2BnB,QAAA,EAAK,WAAU,cACZ,UAAA,gBAAAZ,EAAC,QAAA,EAAM,aAAK,EAAA,CAChB;AAAA,QA9BgBY,KAAUK,KAgCNA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpC;AAEAhB,EAAY,sBAAsB;AAClCA,EAAY,wBAAwB;"}
@@ -18,8 +18,6 @@ export type ReleaseNotesProps = {
18
18
  * Translated release notes of the following shape:
19
19
  *
20
20
  * @example
21
- *
22
- * ```tsx
23
21
  * {
24
22
  * "0.1.2": {
25
23
  * date: '23.07.2018',
@@ -32,7 +30,6 @@ export type ReleaseNotesProps = {
32
30
  * ),
33
31
  * }
34
32
  * }
35
- * ```
36
33
  */
37
34
  releaseNotes: ReleaseNotesData;
38
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ReleaseNotes.js","sources":["../../../src/components/releaseNotes/ReleaseNotes.tsx"],"sourcesContent":["import type React from 'react';\nimport { isArray, map, toPairs } from 'es-toolkit/compat';\n\nexport type NoteContent = (React.ReactNode | JSX.Element) | (React.ReactNode | JSX.Element)[];\n\nexport type NoteProps = {\n version: string;\n note: {\n date: string;\n content: NoteContent;\n };\n};\n\nconst Note = (props: NoteProps) => {\n const { note, version } = props;\n const { date, content } = note;\n return (\n <div className='panel panel-default' key={`${version}-note`}>\n <div className='panel-heading'>\n <div className='display-flex justify-content-between'>\n <span className='text-size-16 text-medium'>{`${version}`}</span>\n <span className='text-thin'>{date}</span>\n </div>\n </div>\n <div className='panel-body white-space-pre-line'>\n {isArray(content) ? (\n <ul className='margin-bottom-0 margin-left-5 padding-left-25'>\n {map(content, (item: React.ReactNode) => (\n <li key={`${version}-note-${Math.random()}`}>{item}</li>\n ))}\n </ul>\n ) : (\n <div>{content}</div>\n )}\n </div>\n </div>\n );\n};\n\nexport type ReleaseNotesData = {\n [key: string]: {\n date: string;\n content: NoteContent;\n };\n};\n\nexport type ReleaseNotesProps = {\n /**\n * Translated release notes of the following shape:\n *\n * @example\n *\n * ```tsx\n * {\n * \"0.1.2\": {\n * date: '23.07.2018',\n * content: (\n * <div className='padding-left-15'>\n * Map view within the tour history table\n * • Modern map design as used in the Beta of the fleet monitor\n * • Works with all event types\n * </div>\n * ),\n * }\n * }\n * ```\n */\n releaseNotes: ReleaseNotesData;\n};\n\nconst ReleaseNotes = (props: ReleaseNotesProps) => {\n const { releaseNotes, ...remainingProps } = props;\n return (\n <div {...remainingProps}>\n {map(toPairs(releaseNotes), ([key, note]) => (\n <Note key={key} note={note} version={key} />\n ))}\n </div>\n );\n};\n\nexport default ReleaseNotes;\n"],"names":["Note","props","note","version","date","content","jsxs","jsx","isArray","map","item","ReleaseNotes","releaseNotes","remainingProps","toPairs","key"],"mappings":";;AAaA,MAAMA,IAAO,CAACC,MAAqB;AAC/B,QAAM,EAAE,MAAAC,GAAM,SAAAC,EAAA,IAAYF,GACpB,EAAE,MAAAG,GAAM,SAAAC,EAAA,IAAYH;AAC1B,SACI,gBAAAI,EAAC,OAAA,EAAI,WAAU,uBACX,UAAA;AAAA,IAAA,gBAAAC,EAAC,SAAI,WAAU,iBACX,UAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,wCACX,UAAA;AAAA,MAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,4BAA4B,UAAA,GAAGJ,CAAO,IAAG;AAAA,MACzD,gBAAAI,EAAC,QAAA,EAAK,WAAU,aAAa,UAAAH,EAAA,CAAK;AAAA,IAAA,EAAA,CACtC,EAAA,CACJ;AAAA,IACA,gBAAAG,EAAC,OAAA,EAAI,WAAU,mCACV,UAAAC,EAAQH,CAAO,IACZ,gBAAAE,EAAC,MAAA,EAAG,WAAU,iDACT,UAAAE,EAAIJ,GAAS,CAACK,MACX,gBAAAH,EAAC,MAAA,EAA6C,UAAAG,EAAA,GAArC,GAAGP,CAAO,SAAS,KAAK,OAAA,CAAQ,EAAU,CACtD,EAAA,CACL,IAEA,gBAAAI,EAAC,OAAA,EAAK,aAAQ,EAAA,CAEtB;AAAA,EAAA,EAAA,GAjBsC,GAAGJ,CAAO,OAkBpD;AAER,GAiCMQ,IAAe,CAACV,MAA6B;AAC/C,QAAM,EAAE,cAAAW,GAAc,GAAGC,EAAA,IAAmBZ;AAC5C,SACI,gBAAAM,EAAC,SAAK,GAAGM,GACJ,YAAIC,EAAQF,CAAY,GAAG,CAAC,CAACG,GAAKb,CAAI,wBAClCF,GAAA,EAAe,MAAAE,GAAY,SAASa,EAAA,GAA1BA,CAA+B,CAC7C,GACL;AAER;"}
1
+ {"version":3,"file":"ReleaseNotes.js","sources":["../../../src/components/releaseNotes/ReleaseNotes.tsx"],"sourcesContent":["import type React from 'react';\nimport { isArray, map, toPairs } from 'es-toolkit/compat';\n\nexport type NoteContent = (React.ReactNode | JSX.Element) | (React.ReactNode | JSX.Element)[];\n\nexport type NoteProps = {\n version: string;\n note: {\n date: string;\n content: NoteContent;\n };\n};\n\nconst Note = (props: NoteProps) => {\n const { note, version } = props;\n const { date, content } = note;\n return (\n <div className='panel panel-default' key={`${version}-note`}>\n <div className='panel-heading'>\n <div className='display-flex justify-content-between'>\n <span className='text-size-16 text-medium'>{`${version}`}</span>\n <span className='text-thin'>{date}</span>\n </div>\n </div>\n <div className='panel-body white-space-pre-line'>\n {isArray(content) ? (\n <ul className='margin-bottom-0 margin-left-5 padding-left-25'>\n {map(content, (item: React.ReactNode) => (\n <li key={`${version}-note-${Math.random()}`}>{item}</li>\n ))}\n </ul>\n ) : (\n <div>{content}</div>\n )}\n </div>\n </div>\n );\n};\n\nexport type ReleaseNotesData = {\n [key: string]: {\n date: string;\n content: NoteContent;\n };\n};\n\nexport type ReleaseNotesProps = {\n /**\n * Translated release notes of the following shape:\n *\n * @example\n * {\n * \"0.1.2\": {\n * date: '23.07.2018',\n * content: (\n * <div className='padding-left-15'>\n * Map view within the tour history table\n * • Modern map design as used in the Beta of the fleet monitor\n * • Works with all event types\n * </div>\n * ),\n * }\n * }\n */\n releaseNotes: ReleaseNotesData;\n};\n\nconst ReleaseNotes = (props: ReleaseNotesProps) => {\n const { releaseNotes, ...remainingProps } = props;\n return (\n <div {...remainingProps}>\n {map(toPairs(releaseNotes), ([key, note]) => (\n <Note key={key} note={note} version={key} />\n ))}\n </div>\n );\n};\n\nexport default ReleaseNotes;\n"],"names":["Note","props","note","version","date","content","jsxs","jsx","isArray","map","item","ReleaseNotes","releaseNotes","remainingProps","toPairs","key"],"mappings":";;AAaA,MAAMA,IAAO,CAACC,MAAqB;AAC/B,QAAM,EAAE,MAAAC,GAAM,SAAAC,EAAA,IAAYF,GACpB,EAAE,MAAAG,GAAM,SAAAC,EAAA,IAAYH;AAC1B,SACI,gBAAAI,EAAC,OAAA,EAAI,WAAU,uBACX,UAAA;AAAA,IAAA,gBAAAC,EAAC,SAAI,WAAU,iBACX,UAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,wCACX,UAAA;AAAA,MAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,4BAA4B,UAAA,GAAGJ,CAAO,IAAG;AAAA,MACzD,gBAAAI,EAAC,QAAA,EAAK,WAAU,aAAa,UAAAH,EAAA,CAAK;AAAA,IAAA,EAAA,CACtC,EAAA,CACJ;AAAA,IACA,gBAAAG,EAAC,OAAA,EAAI,WAAU,mCACV,UAAAC,EAAQH,CAAO,IACZ,gBAAAE,EAAC,MAAA,EAAG,WAAU,iDACT,UAAAE,EAAIJ,GAAS,CAACK,MACX,gBAAAH,EAAC,MAAA,EAA6C,UAAAG,EAAA,GAArC,GAAGP,CAAO,SAAS,KAAK,OAAA,CAAQ,EAAU,CACtD,EAAA,CACL,IAEA,gBAAAI,EAAC,OAAA,EAAK,aAAQ,EAAA,CAEtB;AAAA,EAAA,EAAA,GAjBsC,GAAGJ,CAAO,OAkBpD;AAER,GA8BMQ,IAAe,CAACV,MAA6B;AAC/C,QAAM,EAAE,cAAAW,GAAc,GAAGC,EAAA,IAAmBZ;AAC5C,SACI,gBAAAM,EAAC,SAAK,GAAGM,GACJ,YAAIC,EAAQF,CAAY,GAAG,CAAC,CAACG,GAAKb,CAAI,wBAClCF,GAAA,EAAe,MAAAE,GAAY,SAASa,EAAA,GAA1BA,CAA+B,CAC7C,GACL;AAER;"}
@@ -10,19 +10,31 @@ export type ResizerProps = {
10
10
  * Defines where the resize handle is positioned relative to the element to resize.
11
11
  *
12
12
  * Possible values are:
13
- * `Resizer.LEFT`, `Resizer.RIGHT`, `Resizer.TOP`, `Resizer.BOTTOM` or
14
- * `left`, `right`, `top`, `bottom`.
13
+ *
14
+ * - `Resizer.LEFT`,
15
+ * - `Resizer.RIGHT`,
16
+ * - `Resizer.TOP`,
17
+ * - `Resizer.BOTTOM`
18
+ * - `'left`',
19
+ * - `'right`',
20
+ * - `'top`',
21
+ * - `'bottom'`
15
22
  */
16
23
  position?: typeof LEFT | typeof RIGHT | typeof TOP | typeof BOTTOM;
17
24
  /**
18
25
  * Defines on which axis to resize.
19
26
  *
20
27
  * Possible values are:
21
- * `Resizer.HORIZONTAL`, `Resizer.VERTICAL` or `x`, `y`.
28
+ *
29
+ * - `Resizer.HORIZONTAL`
30
+ * - `Resizer.VERTICAL`
31
+ * - `'x'`
32
+ * - `'y'`
22
33
  */
23
34
  direction?: typeof HORIZONTAL | typeof VERTICAL;
24
35
  /**
25
36
  * Callback when the resize starts, means when the handle is pressed. It returns the respective event.
37
+ *
26
38
  * @param event
27
39
  * @returns
28
40
  */
@@ -31,12 +43,14 @@ export type ResizerProps = {
31
43
  * Callback when the resize handle is moved. The function returns the distant between the last
32
44
  * position and the mouse movement. Means you can either subtract or add this diff to the elements
33
45
  * width you want to change.
46
+ *
34
47
  * @param diff
35
48
  * @returns
36
49
  */
37
50
  onResize?: (diff: number) => void;
38
51
  /**
39
52
  * Callback when the resize ends, means when the handle is released. It returns the respective event.
53
+ *
40
54
  * @param event
41
55
  * @returns
42
56
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Resizer.js","sources":["../../../src/components/resizer/Resizer.tsx"],"sourcesContent":["import React, { useEffect, useRef, type MouseEvent, type TouchEvent, type PropsWithChildren } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\n\nconst HORIZONTAL = 'x';\nconst VERTICAL = 'y';\n\nconst LEFT = 'left';\nconst RIGHT = 'right';\nconst TOP = 'top';\nconst BOTTOM = 'bottom';\n\nexport type ResizerProps = {\n /**\n * Defines where the resize handle is positioned relative to the element to resize.\n *\n * Possible values are:\n * `Resizer.LEFT`, `Resizer.RIGHT`, `Resizer.TOP`, `Resizer.BOTTOM` or\n * `left`, `right`, `top`, `bottom`.\n */\n position?: typeof LEFT | typeof RIGHT | typeof TOP | typeof BOTTOM;\n\n /**\n * Defines on which axis to resize.\n *\n * Possible values are:\n * `Resizer.HORIZONTAL`, `Resizer.VERTICAL` or `x`, `y`.\n */\n direction?: typeof HORIZONTAL | typeof VERTICAL;\n\n /**\n * Callback when the resize starts, means when the handle is pressed. It returns the respective event.\n * @param event\n * @returns\n */\n onResizeStart?: (event: MouseEvent | TouchEvent) => void;\n\n /**\n * Callback when the resize handle is moved. The function returns the distant between the last\n * position and the mouse movement. Means you can either subtract or add this diff to the elements\n * width you want to change.\n * @param diff\n * @returns\n */\n onResize?: (diff: number) => void;\n\n /**\n * Callback when the resize ends, means when the handle is released. It returns the respective event.\n * @param event\n * @returns\n */\n onResizeEnd?: (event: Event) => void;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\ntype Position = {\n x: number;\n y: number;\n};\n\nconst createListeners = (\n targetNode: HTMLDivElement | null,\n onEnd: (event: Event) => void,\n onMove: (event: Event) => void\n) => {\n if (!targetNode) {\n return;\n }\n\n // The read-only ownerDocument property of the Node interface returns\n // the top-level document object of the node.\n const ownerDocument = targetNode.ownerDocument;\n\n ownerDocument.addEventListener('mouseup', onEnd);\n ownerDocument.addEventListener('mousemove', onMove);\n ownerDocument.addEventListener('touchend', onEnd);\n ownerDocument.addEventListener('touchmove', onMove);\n return {\n remove: () => {\n ownerDocument.removeEventListener('mouseup', onEnd);\n ownerDocument.removeEventListener('mousemove', onMove);\n ownerDocument.removeEventListener('touchend', onEnd);\n ownerDocument.removeEventListener('touchmove', onMove);\n },\n };\n};\n\nconst Resizer = (props: PropsWithChildren<ResizerProps>) => {\n const {\n className = '',\n direction = HORIZONTAL,\n position = RIGHT,\n onResizeStart = noop,\n onResize = noop,\n onResizeEnd = noop,\n children,\n ...remainingProps\n } = props;\n\n const eventsRef = useRef<{ remove: () => void } | undefined | null>(null);\n\n // Use refs here instead of local state as the move event listener fired before the state is set\n // and then it would work with outdated state at that time.\n const elementRef = useRef<HTMLDivElement>(null);\n const isDragRef = useRef<boolean>(false);\n const startPositionRef = useRef<Position>({ x: 0, y: 0 });\n\n useEffect(() => {\n return () => {\n removeListeners();\n };\n }, []);\n\n const getClientX = (event: Event) => {\n // Note: some browsers don't provide the global \"TouchEvent\" constructor!\n if (!!window.TouchEvent && event instanceof window.TouchEvent) {\n return event.touches[0].clientX;\n }\n\n if (event instanceof MouseEvent) {\n return event.clientX;\n }\n\n throw new Error('Unsupported event type');\n };\n\n const getClientY = (event: Event) => {\n // Note: some browsers don't provide the global \"TouchEvent\" constructor!\n if (!!window.TouchEvent && event instanceof window.TouchEvent) {\n return event.touches[0].clientY;\n }\n\n if (event instanceof MouseEvent) {\n return event.clientY;\n }\n\n throw new Error('Unsupported event type');\n };\n\n const handleMouseStart = (event: React.MouseEvent) => {\n isDragRef.current = true;\n\n // Use the native event to check for the event type. Otherwise the type check\n // fails and the start position would be { x: 0, y: 0 }.\n const mouseEvent = event.nativeEvent;\n const { clientX, clientY } = mouseEvent;\n startPositionRef.current = {\n x: clientX,\n y: clientY,\n };\n\n onResizeStart(event);\n\n eventsRef.current = createListeners(elementRef.current, handleEnd, handleMove);\n };\n\n const handleTouchStart = (event: React.TouchEvent) => {\n isDragRef.current = true;\n\n // Use the native event to check for the event type. Otherwise the type check\n // fails and the start position would be { x: 0, y: 0 }.\n const touchEvent = event.nativeEvent;\n const firstTouch = touchEvent.touches[0];\n startPositionRef.current = {\n x: firstTouch.clientX,\n y: firstTouch.clientY,\n };\n\n onResizeStart(event);\n\n eventsRef.current = createListeners(elementRef.current, handleEnd, handleMove);\n };\n\n const handleMove = (event: Event) => {\n if (!isDragRef.current) {\n return;\n }\n\n if (direction === Resizer.HORIZONTAL) {\n const diff = startPositionRef.current.x - getClientX(event);\n\n if (diff !== 0) {\n onResize(diff);\n }\n }\n\n if (direction === Resizer.VERTICAL) {\n const diff = startPositionRef.current.y - getClientY(event);\n if (diff !== 0) {\n onResize(diff);\n }\n }\n\n startPositionRef.current = {\n x: getClientX(event),\n y: getClientY(event),\n };\n };\n\n const handleEnd = (event: Event) => {\n isDragRef.current = false;\n onResizeEnd(event);\n removeListeners();\n };\n\n const removeListeners = () => {\n if (eventsRef.current) {\n eventsRef.current.remove();\n }\n };\n\n const wrapperClasses = classNames(\n 'Resizer',\n direction === 'x' && 'resize-horizontal',\n direction === 'y' && 'resize-vertical',\n position === 'left' && 'resize-left',\n position === 'right' && 'resize-right',\n position === 'top' && 'resize-top',\n position === 'bottom' && 'resize-bottom',\n className && className\n );\n\n return (\n <div\n ref={elementRef}\n className={wrapperClasses}\n onMouseDown={handleMouseStart}\n onTouchStart={handleTouchStart}\n {...remainingProps}\n >\n {children}\n </div>\n );\n};\n\nResizer.HORIZONTAL = HORIZONTAL as typeof HORIZONTAL;\nResizer.VERTICAL = VERTICAL as typeof VERTICAL;\n\nResizer.LEFT = LEFT as typeof LEFT;\nResizer.RIGHT = RIGHT as typeof RIGHT;\nResizer.TOP = TOP as typeof TOP;\nResizer.BOTTOM = BOTTOM as typeof BOTTOM;\n\nexport default Resizer;\n"],"names":["HORIZONTAL","VERTICAL","LEFT","RIGHT","TOP","BOTTOM","createListeners","targetNode","onEnd","onMove","ownerDocument","Resizer","props","className","direction","position","onResizeStart","noop","onResize","onResizeEnd","children","remainingProps","eventsRef","useRef","elementRef","isDragRef","startPositionRef","useEffect","removeListeners","getClientX","event","getClientY","handleMouseStart","mouseEvent","clientX","clientY","handleEnd","handleMove","handleTouchStart","firstTouch","diff","wrapperClasses","classNames","jsx"],"mappings":";;;;AAIA,MAAMA,IAAa,KACbC,IAAW,KAEXC,IAAO,QACPC,IAAQ,SACRC,IAAM,OACNC,IAAS,UAsDTC,IAAkB,CACpBC,GACAC,GACAC,MACC;AACD,MAAI,CAACF;AACD;AAKJ,QAAMG,IAAgBH,EAAW;AAEjC,SAAAG,EAAc,iBAAiB,WAAWF,CAAK,GAC/CE,EAAc,iBAAiB,aAAaD,CAAM,GAClDC,EAAc,iBAAiB,YAAYF,CAAK,GAChDE,EAAc,iBAAiB,aAAaD,CAAM,GAC3C;AAAA,IACH,QAAQ,MAAM;AACV,MAAAC,EAAc,oBAAoB,WAAWF,CAAK,GAClDE,EAAc,oBAAoB,aAAaD,CAAM,GACrDC,EAAc,oBAAoB,YAAYF,CAAK,GACnDE,EAAc,oBAAoB,aAA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A,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGb;AAEAT,EAAQ,aAAaX;AACrBW,EAAQ,WAAWV;AAEnBU,EAAQ,OAAOT;AACfS,EAAQ,QAAQR;AAChBQ,EAAQ,MAAMP;AACdO,EAAQ,SAASN;"}
1
+ {"version":3,"file":"Resizer.js","sources":["../../../src/components/resizer/Resizer.tsx"],"sourcesContent":["import React, { useEffect, useRef, type MouseEvent, type TouchEvent, type PropsWithChildren } from 'react';\nimport classNames from 'classnames';\nimport { noop } from 'es-toolkit/function';\n\nconst HORIZONTAL = 'x';\nconst VERTICAL = 'y';\n\nconst LEFT = 'left';\nconst RIGHT = 'right';\nconst TOP = 'top';\nconst BOTTOM = 'bottom';\n\nexport type ResizerProps = {\n /**\n * Defines where the resize handle is positioned relative to the element to resize.\n *\n * Possible values are:\n *\n * - `Resizer.LEFT`,\n * - `Resizer.RIGHT`,\n * - `Resizer.TOP`,\n * - `Resizer.BOTTOM`\n * - `'left`',\n * - `'right`',\n * - `'top`',\n * - `'bottom'`\n */\n position?: typeof LEFT | typeof RIGHT | typeof TOP | typeof BOTTOM;\n\n /**\n * Defines on which axis to resize.\n *\n * Possible values are:\n *\n * - `Resizer.HORIZONTAL`\n * - `Resizer.VERTICAL`\n * - `'x'`\n * - `'y'`\n */\n direction?: typeof HORIZONTAL | typeof VERTICAL;\n\n /**\n * Callback when the resize starts, means when the handle is pressed. It returns the respective event.\n *\n * @param event\n * @returns\n */\n onResizeStart?: (event: MouseEvent | TouchEvent) => void;\n\n /**\n * Callback when the resize handle is moved. The function returns the distant between the last\n * position and the mouse movement. Means you can either subtract or add this diff to the elements\n * width you want to change.\n *\n * @param diff\n * @returns\n */\n onResize?: (diff: number) => void;\n\n /**\n * Callback when the resize ends, means when the handle is released. It returns the respective event.\n *\n * @param event\n * @returns\n */\n onResizeEnd?: (event: Event) => void;\n\n /**\n * Additional classes to be set on the wrapper element.\n */\n className?: string;\n};\n\ntype Position = {\n x: number;\n y: number;\n};\n\nconst createListeners = (\n targetNode: HTMLDivElement | null,\n onEnd: (event: Event) => void,\n onMove: (event: Event) => void\n) => {\n if (!targetNode) {\n return;\n }\n\n // The read-only ownerDocument property of the Node interface returns\n // the top-level document object of the node.\n const ownerDocument = targetNode.ownerDocument;\n\n ownerDocument.addEventListener('mouseup', onEnd);\n ownerDocument.addEventListener('mousemove', onMove);\n ownerDocument.addEventListener('touchend', onEnd);\n ownerDocument.addEventListener('touchmove', onMove);\n return {\n remove: () => {\n ownerDocument.removeEventListener('mouseup', onEnd);\n ownerDocument.removeEventListener('mousemove', onMove);\n ownerDocument.removeEventListener('touchend', onEnd);\n ownerDocument.removeEventListener('touchmove', onMove);\n },\n };\n};\n\nconst Resizer = (props: PropsWithChildren<ResizerProps>) => {\n const {\n className = '',\n direction = HORIZONTAL,\n position = RIGHT,\n onResizeStart = noop,\n onResize = noop,\n onResizeEnd = noop,\n children,\n ...remainingProps\n } = props;\n\n const eventsRef = useRef<{ remove: () => void } | undefined | null>(null);\n\n // Use refs here instead of local state as the move event listener fired before the state is set\n // and then it would work with outdated state at that time.\n const elementRef = useRef<HTMLDivElement>(null);\n const isDragRef = useRef<boolean>(false);\n const startPositionRef = useRef<Position>({ x: 0, y: 0 });\n\n useEffect(() => {\n return () => {\n removeListeners();\n };\n }, []);\n\n const getClientX = (event: Event) => {\n // Note: some browsers don't provide the global \"TouchEvent\" constructor!\n if (!!window.TouchEvent && event instanceof window.TouchEvent) {\n return event.touches[0].clientX;\n }\n\n if (event instanceof MouseEvent) {\n return event.clientX;\n }\n\n throw new Error('Unsupported event type');\n };\n\n const getClientY = (event: Event) => {\n // Note: some browsers don't provide the global \"TouchEvent\" constructor!\n if (!!window.TouchEvent && event instanceof window.TouchEvent) {\n return event.touches[0].clientY;\n }\n\n if (event instanceof MouseEvent) {\n return event.clientY;\n }\n\n throw new Error('Unsupported event type');\n };\n\n const handleMouseStart = (event: React.MouseEvent) => {\n isDragRef.current = true;\n\n // Use the native event to check for the event type. Otherwise the type check\n // fails and the start position would be { x: 0, y: 0 }.\n const mouseEvent = event.nativeEvent;\n const { clientX, clientY } = mouseEvent;\n startPositionRef.current = {\n x: clientX,\n y: clientY,\n };\n\n onResizeStart(event);\n\n eventsRef.current = createListeners(elementRef.current, handleEnd, handleMove);\n };\n\n const handleTouchStart = (event: React.TouchEvent) => {\n isDragRef.current = true;\n\n // Use the native event to check for the event type. Otherwise the type check\n // fails and the start position would be { x: 0, y: 0 }.\n const touchEvent = event.nativeEvent;\n const firstTouch = touchEvent.touches[0];\n startPositionRef.current = {\n x: firstTouch.clientX,\n y: firstTouch.clientY,\n };\n\n onResizeStart(event);\n\n eventsRef.current = createListeners(elementRef.current, handleEnd, handleMove);\n };\n\n const handleMove = (event: Event) => {\n if (!isDragRef.current) {\n return;\n }\n\n if (direction === Resizer.HORIZONTAL) {\n const diff = startPositionRef.current.x - getClientX(event);\n\n if (diff !== 0) {\n onResize(diff);\n }\n }\n\n if (direction === Resizer.VERTICAL) {\n const diff = startPositionRef.current.y - getClientY(event);\n if (diff !== 0) {\n onResize(diff);\n }\n }\n\n startPositionRef.current = {\n x: getClientX(event),\n y: getClientY(event),\n };\n };\n\n const handleEnd = (event: Event) => {\n isDragRef.current = false;\n onResizeEnd(event);\n removeListeners();\n };\n\n const removeListeners = () => {\n if (eventsRef.current) {\n eventsRef.current.remove();\n }\n };\n\n const wrapperClasses = classNames(\n 'Resizer',\n direction === 'x' && 'resize-horizontal',\n direction === 'y' && 'resize-vertical',\n position === 'left' && 'resize-left',\n position === 'right' && 'resize-right',\n position === 'top' && 'resize-top',\n position === 'bottom' && 'resize-bottom',\n className && className\n );\n\n return (\n <div\n ref={elementRef}\n className={wrapperClasses}\n onMouseDown={handleMouseStart}\n onTouchStart={handleTouchStart}\n {...remainingProps}\n >\n {children}\n </div>\n );\n};\n\nResizer.HORIZONTAL = HORIZONTAL as typeof HORIZONTAL;\nResizer.VERTICAL = VERTICAL as typeof VERTICAL;\n\nResizer.LEFT = LEFT as typeof LEFT;\nResizer.RIGHT = RIGHT as typeof RIGHT;\nResizer.TOP = TOP as typeof TOP;\nResizer.BOTTOM = BOTTOM as typeof BOTTOM;\n\nexport default Resizer;\n"],"names":["HORIZONTAL","VERTICAL","LEFT","RIGHT","TOP","BOTTOM","createListeners","targetNode","onEnd","onMove","ownerDocument","Resizer","props","className","direction","position","onResizeStart","noop","onResize","onResizeEnd","children","remainingProps","eventsRef","useRef","elementRef","isDragRef","startPositionRef","useEffect","removeListeners","getClientX","event","getClientY","handleMouseStart","mouseEvent","clientX","clientY","handleEnd","handleMove","handleTouchStart","firstTouch","diff","wrapperClasses","classNames","jsx"],"mappings":";;;;AAIA,MAAMA,IAAa,KACbC,IAAW,KAEXC,IAAO,QACPC,IAAQ,SACRC,IAAM,OACNC,IAAS,UAoETC,IAAkB,CACpBC,GACAC,GACAC,MACC;AACD,MAAI,CAACF;AACD;AAKJ,QAAMG,IAAgBH,EAAW;AAEjC,SAAAG,EAAc,iBAAiB,WAAWF,CAAK,GAC/CE,EAAc,iBAAiB,aAAaD,CAAM,GAClDC,EAAc,iBAAiB,YAAYF,CAAK,GAChDE,EAAc,iBAAiB,aAAaD,CAAM,GAC3C;AAAA,IACH,QAAQ,MAAM;AACV,MAAAC,EAAc,oBAAoB,WAAWF,CAAK,GAClDE,EAAc,oBAAoB,aAAaD,CAAM,GACrDC,EAAc,oBAAoB,YAAYF,CAAK,GACnDE,EAAc,oBAAoB,aAAaD,CAAM;AAAA,IACzD;AAAA,EAAA;AAER,GAEME,IAAU,CAACC,MAA2C;AACxD,QAAM;AAAA,IACF,WAAAC,IAAY;AAAA,IACZ,WAAAC,IAAYd;AAAA,IACZ,UAAAe,IAAWZ;AAAA,IACX,eAAAa,IAAgBC;AAAA,IAChB,UAAAC,IAAWD;AAAA,IACX,aAAAE,IAAcF;AAAA,IACd,UAAAG;AAAA,IACA,GAAGC;AAAA,EAAA,IACHT,GAEEU,IAAYC,EAAkD,IAAI,GAIlEC,IAAaD,EAAuB,I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AAOd,EAAiB,QAAQ,IAAIG,EAAWC,CAAK;AAE1D,QAAIU,MAAS,KACTtB,EAASsB,CAAI;AAAA,MAErB;AAEA,UAAI1B,MAAcH,EAAQ,UAAU;AAChC,cAAM6B,IAAOd,EAAiB,QAAQ,IAAIK,EAAWD,CAAK;AAC1D,QAAIU,MAAS,KACTtB,EAASsB,CAAI;AAAA,MAErB;AAEA,MAAAd,EAAiB,UAAU;AAAA,QACvB,GAAGG,EAAWC,CAAK;AAAA,QACnB,GAAGC,EAAWD,CAAK;AAAA,MAAA;AAAA;AAAA,EAE3B,GAEMM,IAAY,CAACN,MAAiB;AAChC,IAAAL,EAAU,UAAU,IACpBN,EAAYW,CAAK,GACjBF,EAAA;AAAA,EACJ,GAEMA,IAAkB,MAAM;AAC1B,IAAIN,EAAU,WACVA,EAAU,QAAQ,OAAA;AAAA,EAE1B,GAEMmB,IAAiBC;AAAA,IACnB;AAAA,IACA5B,MAAc,OAAO;AAAA,IACrBA,MAAc,OAAO;AAAA,IACrBC,MAAa,UAAU;AAAA,IACvBA,MAAa,WAAW;AAAA,IACxBA,MAAa,SAAS;AAAA,IACtBA,MAAa,YAAY;AAAA,IACzBF,KAAaA;AAAA,EAAA;AAGjB,SACI,gBAAA8B;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKnB;AAAA,MACL,WAAWiB;AAAA,MACX,aAAaT;AAAA,MACb,cAAcM;AAAA,MACb,GAAGjB;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGb;AAEAT,EAAQ,aAAaX;AACrBW,EAAQ,WAAWV;AAEnBU,EAAQ,OAAOT;AACfS,EAAQ,QAAQR;AAChBQ,EAAQ,MAAMP;AACdO,EAAQ,SAASN;"}
@@ -2,7 +2,7 @@ import { RioglyphIconType } from './RioglyphIconType';
2
2
  export type IconType = RioglyphIconType;
3
3
  export type RioglyphProps = {
4
4
  /**
5
- * The icon class to display.
5
+ * The rioglyph icon string OR an external .svg link
6
6
  */
7
7
  icon: IconType | string;
8
8
  /**
@@ -14,31 +14,43 @@ export type RioglyphProps = {
14
14
  */
15
15
  size?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | '10' | '11' | '12' | '14' | '16' | '18' | '20';
16
16
  /**
17
- * Spinning animation
17
+ * Spinning animation.
18
+ *
19
+ * @default false
18
20
  */
19
21
  spinning?: boolean;
20
22
  /**
21
- * Pulsing animation
23
+ * Pulsing animation.
24
+ *
25
+ * @default false
22
26
  */
23
27
  pulsing?: boolean;
24
28
  /**
25
- * Filled style
29
+ * Filled style.
30
+ *
31
+ * @default false
26
32
  */
27
33
  filled?: boolean;
28
34
  /**
29
- * Pulsing animation
35
+ * Add a disabled line
36
+ *
37
+ * @default false
30
38
  */
31
39
  disabled?: boolean;
32
40
  /**
33
- * Pulsing animation
41
+ * Recolor the disabled line to the danger color.
42
+ *
43
+ * @default false
34
44
  */
35
45
  disabledDanger?: boolean;
36
46
  /**
37
- * Pulsing animation
47
+ * Flip the disabled line.
48
+ *
49
+ * @default false
38
50
  */
39
51
  disabledInverse?: boolean;
40
52
  /**
41
- * The icon class to display as a pair (optional).
53
+ * The rioglyph icon string OR an external .svg link.
42
54
  */
43
55
  pairIcon?: IconType | string;
44
56
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Rioglyph.js","sources":["../../../src/components/rioglyph/Rioglyph.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport type { RioglyphIconType } from './RioglyphIconType';\n\nexport type IconType = RioglyphIconType;\n\nexport type RioglyphProps = {\n /**\n * The icon class to display.\n */\n icon: IconType | string;\n\n /**\n * Additional classes set to the icon span.\n */\n iconClassName?: string;\n\n /**\n * The size (text-size) of the icon\n */\n size?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | '10' | '11' | '12' | '14' | '16' | '18' | '20';\n\n /**\n * Spinning animation\n */\n spinning?: boolean;\n\n /**\n * Pulsing animation\n */\n pulsing?: boolean;\n\n /**\n * Filled style\n */\n filled?: boolean;\n\n /**\n * Pulsing animation\n */\n disabled?: boolean;\n\n /**\n * Pulsing animation\n */\n disabledDanger?: boolean;\n\n /**\n * Pulsing animation\n */\n disabledInverse?: boolean;\n\n /**\n * The icon class to display as a pair (optional).\n */\n pairIcon?: IconType | string;\n\n /**\n * Additional classes set to the pairIcon span.\n */\n pairIconClassName?: string;\n};\n\nconst Rioglyph = (props: RioglyphProps) => {\n const {\n icon,\n iconClassName = '',\n pairIcon,\n pairIconClassName = '',\n size,\n spinning = false,\n pulsing = false,\n filled = false,\n disabled = false,\n disabledDanger = false,\n disabledInverse = false,\n } = props;\n\n const spinningClass = spinning ? 'spinning' : '';\n const pulsingClass = pulsing ? 'pulsing' : '';\n const filledClass = filled ? 'rioglyph-filled' : '';\n const disabledClass = disabled ? 'rioglyph-disabled' : '';\n const disabledDangerClass = disabledDanger ? 'rioglyph-disabled rioglyph-disabled-danger' : '';\n const disabledInverseClass = disabledInverse ? 'rioglyph-disabled rioglyph-disabled-inverse' : '';\n\n let iconStyle: React.CSSProperties | undefined;\n if (icon.includes('.svg')) {\n iconStyle = { '--i': `url(${icon})` } as React.CSSProperties;\n }\n\n if (pairIcon) {\n const wrapperClasses = classNames('rioglyph-icon-pair', size && `text-size-${size}`);\n const iconClasses = classNames('rioglyph', !icon.includes('.svg') && icon, iconClassName);\n const pairIconClasses = classNames(\n 'rioglyph',\n !pairIcon.includes('.svg') && pairIcon,\n pairIconClassName,\n spinningClass,\n pulsingClass\n );\n\n let pairIconStyle: React.CSSProperties | undefined;\n if (pairIcon?.includes('.svg')) {\n pairIconStyle = { '--i': `url(${pairIcon})` } as React.CSSProperties;\n }\n\n return (\n <span className={wrapperClasses}>\n <span className={iconClasses} style={iconStyle} />\n <span className={pairIconClasses} style={pairIconStyle} />\n </span>\n );\n }\n\n const iconClasses = classNames(\n 'rioglyph',\n !icon.includes('.svg') && icon,\n size && `text-size-${size}`,\n disabledClass,\n disabledDangerClass,\n disabledInverseClass,\n iconClassName,\n spinningClass,\n pulsingClass,\n filledClass\n );\n\n return <span className={iconClasses} style={iconStyle} />;\n};\n\nexport default Rioglyph;\n"],"names":["Rioglyph","props","icon","iconClassName","pairIcon","pairIconClassName","size","spinning","pulsing","filled","disabled","disabledDanger","disabledInverse","spinningClass","pulsingClass","filledClass","disabledClass","disabledDangerClass","disabledInverseClass","iconStyle","wrapperClasses","classNames","iconClasses","pairIconClasses","pairIconStyle","jsxs","jsx"],"mappings":";;AA+DA,MAAMA,IAAW,CAACC,MAAyB;AACvC,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,UAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,MAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAU;AAAA,IACV,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,gBAAAC,IAAiB;AAAA,IACjB,iBAAAC,IAAkB;AAAA,EAAA,IAClBX,GAEEY,IAAgBN,IAAW,aAAa,IACxCO,IAAeN,IAAU,YAAY,IACrCO,IAAcN,IAAS,oBAAoB,IAC3CO,IAAgBN,IAAW,sBAAsB,IACjDO,IAAsBN,IAAiB,+CAA+C,IACtFO,IAAuBN,IAAkB,gDAAgD;AAE/F,MAAIO;AAKJ,MAJIjB,EAAK,SAAS,MAAM,MACpBiB,IAAY,EAAE,OAAO,OAAOjB,CAAI,IAAA,IAGhCE,GAAU;AACV,UAAMgB,IAAiBC,EAAW,sBAAsBf,KAAQ,aAAaA,CAAI,EAAE,GAC7EgB,IAAcD,EAAW,YAAY,CAACnB,EAAK,SAAS,MAAM,KAAKA,GAAMC,CAAa,GAClFoB,IAAkBF;AAAA,MACpB;AAAA,MACA,CAACjB,EAAS,SAAS,MAAM,KAAKA;AAAA,MAC9BC;AAAA,MACAQ;AAAA,MACAC;AAAA,IAAA;AAGJ,QAAIU;AACJ,WAAIpB,GAAU,SAAS,MAAM,MACzBoB,IAAgB,EAAE,OAAO,OAAOpB,CAAQ,IAAA,IAIxC,gBAAAqB,EAAC,QAAA,EAAK,WAAWL,GACb,UAAA;AAAA,MAAA,gBAAAM,EAAC,QAAA,EAAK,WAAWJ,GAAa,OAAOH,GAAW;AAAA,MAChD,gBAAAO,EAAC,QAAA,EAAK,WAAWH,GAAiB,OAAOC,EAAA,CAAe;AAAA,IAAA,GAC5D;AAAA,EAER;AAEA,QAAMF,IAAcD;AAAA,IAChB;AAAA,IACA,CAACnB,EAAK,SAAS,MAAM,KAAKA;AAAA,IAC1BI,KAAQ,aAAaA,CAAI;AAAA,IACzBU;AAAA,IACAC;AAAA,IACAC;AAAA,IACAf;AAAA,IACAU;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAGJ,SAAO,gBAAAW,EAAC,QAAA,EAAK,WAAWJ,GAAa,OAAOH,GAAW;AAC3D;"}
1
+ {"version":3,"file":"Rioglyph.js","sources":["../../../src/components/rioglyph/Rioglyph.tsx"],"sourcesContent":["import classNames from 'classnames';\n\nimport type { RioglyphIconType } from './RioglyphIconType';\n\nexport type IconType = RioglyphIconType;\n\nexport type RioglyphProps = {\n /**\n * The rioglyph icon string OR an external .svg link\n */\n icon: IconType | string;\n\n /**\n * Additional classes set to the icon span.\n */\n iconClassName?: string;\n\n /**\n * The size (text-size) of the icon\n */\n size?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | '10' | '11' | '12' | '14' | '16' | '18' | '20';\n\n /**\n * Spinning animation.\n * \n * @default false\n */\n spinning?: boolean;\n\n /**\n * Pulsing animation.\n * \n * @default false\n */\n pulsing?: boolean;\n\n /**\n * Filled style.\n * \n * @default false\n */\n filled?: boolean;\n\n /**\n * Add a disabled line\n * \n * @default false\n */\n disabled?: boolean;\n\n /**\n * Recolor the disabled line to the danger color.\n * \n * @default false\n */\n disabledDanger?: boolean;\n\n /**\n * Flip the disabled line.\n * \n * @default false\n */\n disabledInverse?: boolean;\n\n /**\n * The rioglyph icon string OR an external .svg link.\n */\n pairIcon?: IconType | string;\n\n /**\n * Additional classes set to the pairIcon span.\n */\n pairIconClassName?: string;\n};\n\nconst Rioglyph = (props: RioglyphProps) => {\n const {\n icon,\n iconClassName = '',\n pairIcon,\n pairIconClassName = '',\n size,\n spinning = false,\n pulsing = false,\n filled = false,\n disabled = false,\n disabledDanger = false,\n disabledInverse = false,\n } = props;\n\n const spinningClass = spinning ? 'spinning' : '';\n const pulsingClass = pulsing ? 'pulsing' : '';\n const filledClass = filled ? 'rioglyph-filled' : '';\n const disabledClass = disabled ? 'rioglyph-disabled' : '';\n const disabledDangerClass = disabledDanger ? 'rioglyph-disabled rioglyph-disabled-danger' : '';\n const disabledInverseClass = disabledInverse ? 'rioglyph-disabled rioglyph-disabled-inverse' : '';\n\n let iconStyle: React.CSSProperties | undefined;\n if (icon.includes('.svg')) {\n iconStyle = { '--i': `url(${icon})` } as React.CSSProperties;\n }\n\n if (pairIcon) {\n const wrapperClasses = classNames('rioglyph-icon-pair', size && `text-size-${size}`);\n const iconClasses = classNames('rioglyph', !icon.includes('.svg') && icon, iconClassName);\n const pairIconClasses = classNames(\n 'rioglyph',\n !pairIcon.includes('.svg') && pairIcon,\n pairIconClassName,\n spinningClass,\n pulsingClass\n );\n\n let pairIconStyle: React.CSSProperties | undefined;\n if (pairIcon?.includes('.svg')) {\n pairIconStyle = { '--i': `url(${pairIcon})` } as React.CSSProperties;\n }\n\n return (\n <span className={wrapperClasses}>\n <span className={iconClasses} style={iconStyle} />\n <span className={pairIconClasses} style={pairIconStyle} />\n </span>\n );\n }\n\n const iconClasses = classNames(\n 'rioglyph',\n !icon.includes('.svg') && icon,\n size && `text-size-${size}`,\n disabledClass,\n disabledDangerClass,\n disabledInverseClass,\n iconClassName,\n spinningClass,\n pulsingClass,\n filledClass\n );\n\n return <span className={iconClasses} style={iconStyle} />;\n};\n\nexport default Rioglyph;\n"],"names":["Rioglyph","props","icon","iconClassName","pairIcon","pairIconClassName","size","spinning","pulsing","filled","disabled","disabledDanger","disabledInverse","spinningClass","pulsingClass","filledClass","disabledClass","disabledDangerClass","disabledInverseClass","iconStyle","wrapperClasses","classNames","iconClasses","pairIconClasses","pairIconStyle","jsxs","jsx"],"mappings":";;AA2EA,MAAMA,IAAW,CAACC,MAAyB;AACvC,QAAM;AAAA,IACF,MAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,UAAAC;AAAA,IACA,mBAAAC,IAAoB;AAAA,IACpB,MAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,SAAAC,IAAU;AAAA,IACV,QAAAC,IAAS;AAAA,IACT,UAAAC,IAAW;AAAA,IACX,gBAAAC,IAAiB;AAAA,IACjB,iBAAAC,IAAkB;AAAA,EAAA,IAClBX,GAEEY,IAAgBN,IAAW,aAAa,IACxCO,IAAeN,IAAU,YAAY,IACrCO,IAAcN,IAAS,oBAAoB,IAC3CO,IAAgBN,IAAW,sBAAsB,IACjDO,IAAsBN,IAAiB,+CAA+C,IACtFO,IAAuBN,IAAkB,gDAAgD;AAE/F,MAAIO;AAKJ,MAJIjB,EAAK,SAAS,MAAM,MACpBiB,IAAY,EAAE,OAAO,OAAOjB,CAAI,IAAA,IAGhCE,GAAU;AACV,UAAMgB,IAAiBC,EAAW,sBAAsBf,KAAQ,aAAaA,CAAI,EAAE,GAC7EgB,IAAcD,EAAW,YAAY,CAACnB,EAAK,SAAS,MAAM,KAAKA,GAAMC,CAAa,GAClFoB,IAAkBF;AAAA,MACpB;AAAA,MACA,CAACjB,EAAS,SAAS,MAAM,KAAKA;AAAA,MAC9BC;AAAA,MACAQ;AAAA,MACAC;AAAA,IAAA;AAGJ,QAAIU;AACJ,WAAIpB,GAAU,SAAS,MAAM,MACzBoB,IAAgB,EAAE,OAAO,OAAOpB,CAAQ,IAAA,IAIxC,gBAAAqB,EAAC,QAAA,EAAK,WAAWL,GACb,UAAA;AAAA,MAAA,gBAAAM,EAAC,QAAA,EAAK,WAAWJ,GAAa,OAAOH,GAAW;AAAA,MAChD,gBAAAO,EAAC,QAAA,EAAK,WAAWH,GAAiB,OAAOC,EAAA,CAAe;AAAA,IAAA,GAC5D;AAAA,EAER;AAEA,QAAMF,IAAcD;AAAA,IAChB;AAAA,IACA,CAACnB,EAAK,SAAS,MAAM,KAAKA;AAAA,IAC1BI,KAAQ,aAAaA,CAAI;AAAA,IACzBU;AAAA,IACAC;AAAA,IACAC;AAAA,IACAf;AAAA,IACAU;AAAA,IACAC;AAAA,IACAC;AAAA,EAAA;AAGJ,SAAO,gBAAAW,EAAC,QAAA,EAAK,WAAWJ,GAAa,OAAOH,GAAW;AAC3D;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import { motion as e, AnimatePresence as r } from "motion/react";
3
3
  const n = ({ children: o, ...t }) => (
4
- // @ts-ignore-next-line
4
+ // @ts-expect-error-next-line
5
5
  /* @__PURE__ */ i(e.div, { initial: !1, layout: !0, ...t, children: /* @__PURE__ */ i(r, { children: /* @__PURE__ */ i(e.div, { layout: "position", children: o }) }) })
6
6
  );
7
7
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"RulesWrapper.js","sources":["../../../src/components/rules/RulesWrapper.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport { AnimatePresence, motion } from 'motion/react';\n\ntype RulesWrapperProps = HTMLAttributes<HTMLDivElement>;\n\nconst RulesWrapper = ({ children, ...remainingProps }: PropsWithChildren<RulesWrapperProps>) => (\n // @ts-ignore-next-line\n <motion.div initial={false} layout {...remainingProps}>\n {/* @ts-ignore-next-line */}\n <AnimatePresence>\n <motion.div layout='position'>{children}</motion.div>\n </AnimatePresence>\n </motion.div>\n);\n\nexport default RulesWrapper;\n"],"names":["RulesWrapper","children","remainingProps","jsx","motion","AnimatePresence"],"mappings":";;AAKA,MAAMA,IAAe,CAAC,EAAE,UAAAC,GAAU,GAAGC,EAAA;AAAA;AAAA,EAEjC,gBAAAC,EAACC,EAAO,KAAP,EAAW,SAAS,IAAO,QAAM,IAAE,GAAGF,GAEnC,4BAACG,GAAA,EACG,UAAA,gBAAAF,EAACC,EAAO,KAAP,EAAW,QAAO,YAAY,UAAAH,GAAS,GAC5C,EAAA,CACJ;AAAA;"}
1
+ {"version":3,"file":"RulesWrapper.js","sources":["../../../src/components/rules/RulesWrapper.tsx"],"sourcesContent":["import type { HTMLAttributes, PropsWithChildren } from 'react';\nimport { AnimatePresence, motion } from 'motion/react';\n\ntype RulesWrapperProps = HTMLAttributes<HTMLDivElement>;\n\nconst RulesWrapper = ({ children, ...remainingProps }: PropsWithChildren<RulesWrapperProps>) => (\n // @ts-expect-error-next-line\n <motion.div initial={false} layout {...remainingProps}>\n <AnimatePresence>\n <motion.div layout='position'>{children}</motion.div>\n </AnimatePresence>\n </motion.div>\n);\n\nexport default RulesWrapper;\n"],"names":["RulesWrapper","children","remainingProps","jsx","motion","AnimatePresence"],"mappings":";;AAKA,MAAMA,IAAe,CAAC,EAAE,UAAAC,GAAU,GAAGC,EAAA;AAAA;AAAA,EAEjC,gBAAAC,EAACC,EAAO,KAAP,EAAW,SAAS,IAAO,QAAM,IAAE,GAAGF,GACnC,4BAACG,GAAA,EACG,UAAA,gBAAAF,EAACC,EAAO,KAAP,EAAW,QAAO,YAAY,UAAAH,GAAS,GAC5C,EAAA,CACJ;AAAA;"}
@@ -18,15 +18,20 @@ export type SaveableDateInputProps = {
18
18
  */
19
19
  isValid?: boolean;
20
20
  /**
21
- * This is the error message that is shown below the input. It uses the built-in error handling, and will be shown when the "isValid" prop is set to false.
21
+ * This is the error message that is shown below the input. It uses the built-in error handling,
22
+ * and will be shown when the "isValid" prop is set to false.
22
23
  */
23
24
  errorMessage?: string | React.ReactNode;
24
25
  /**
25
- * Defines wether the error icon is shown or not. If enabled, it will be shown when the "isValid" prop is set to false.
26
+ * Defines wether the error icon is shown or not. If enabled, it will be shown when the "isValid" prop
27
+ * is set to false.
28
+ *
29
+ * @default false
26
30
  */
27
31
  hideErrorIcon?: boolean;
28
32
  /**
29
33
  * Callback function triggered when the value changes and is saved.
34
+ *
30
35
  * @param value
31
36
  * @param previousValue
32
37
  * @returns
@@ -35,6 +40,7 @@ export type SaveableDateInputProps = {
35
40
  /**
36
41
  * Callback function that gets triggered on every input change. Use this to control the component
37
42
  * or when implementing key validation.
43
+ *
38
44
  * @param keyValue the key value that has been entered
39
45
  * @returns
40
46
  */
@@ -42,11 +48,13 @@ export type SaveableDateInputProps = {
42
48
  /**
43
49
  * Callback function that gets triggered when the input is in edit mode. Use this
44
50
  * to control the component and to handle the previous value on the outside.
51
+ *
45
52
  * @returns
46
53
  */
47
54
  onEnterEdit?: () => void;
48
55
  /**
49
56
  * Callback function that gets triggered when edit mode is exited (either saved or cancelled).
57
+ *
50
58
  * @param wasSaved - true if value was saved, false if cancelled/reset
51
59
  * @returns
52
60
  */
@@ -54,6 +62,7 @@ export type SaveableDateInputProps = {
54
62
  /**
55
63
  * Callback function that gets triggered when the user aborts the edit mode. Use this
56
64
  * to control the component and handle the resetting of previous value on the outside.
65
+ *
57
66
  * @returns
58
67
  */
59
68
  onCancel?: () => void;
@@ -67,15 +76,24 @@ export type SaveableDateInputProps = {
67
76
  invalidExitBehavior?: 'stay-open' | 'reset-and-close';
68
77
  /**
69
78
  * Defines the button style: `default` or `primary`.
79
+ *
80
+ * @default 'primary'
70
81
  */
71
82
  buttonStyle?: 'primary' | 'default';
72
83
  /**
73
84
  * Additional HTML attributes to be set on the input element.
74
85
  */
75
86
  inputProps?: HTMLAttributes<HTMLInputElement>;
87
+ /**
88
+ * Additional props passed to the underlying DatePicker component.
89
+ *
90
+ * @default {}
91
+ */
76
92
  datePickerProps?: DatePickerProps;
77
93
  /**
78
94
  * Disables the component so the user cannot enter the edit mode.
95
+ *
96
+ * @default false
79
97
  */
80
98
  disabled?: boolean;
81
99
  /**