@muraldevkit/ui-toolkit 4.77.0-dev-yOaq.1 → 4.77.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 (115) hide show
  1. package/dist/cjs/components/button/MrlButton/MrlButton.js +16 -8
  2. package/dist/cjs/components/button/MrlButton/MrlButton.js.map +1 -1
  3. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js +5 -2
  4. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -1
  5. package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js +2 -1
  6. package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
  7. package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  8. package/dist/cjs/components/grid/MrlCol/MrlCol.js +49 -42
  9. package/dist/cjs/components/grid/MrlCol/MrlCol.js.map +1 -1
  10. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js +6 -4
  11. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  12. package/dist/cjs/components/grid/MrlRow/MrlRow.js +8 -10
  13. package/dist/cjs/components/grid/MrlRow/MrlRow.js.map +1 -1
  14. package/dist/cjs/components/grid/constants.js +8 -27
  15. package/dist/cjs/components/grid/constants.js.map +1 -1
  16. package/dist/cjs/components/menu/MrlMenu/MrlMenu.js.map +1 -1
  17. package/dist/cjs/components/menu/MrlMenuGroup/MrlMenuGroup.js +4 -1
  18. package/dist/cjs/components/menu/MrlMenuGroup/MrlMenuGroup.js.map +1 -1
  19. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js +2 -1
  20. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  21. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +8 -4
  22. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  23. package/dist/cjs/components/modal/MrlModalContent/MrlModalContent.js +1 -1
  24. package/dist/cjs/components/modal/MrlModalContent/MrlModalContent.js.map +1 -1
  25. package/dist/cjs/components/modal/MrlModalFooter/MrlModalFooter.js +2 -1
  26. package/dist/cjs/components/modal/MrlModalFooter/MrlModalFooter.js.map +1 -1
  27. package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
  28. package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
  29. package/dist/cjs/components/panel/MrlPanel/MrlPanel.js.map +1 -1
  30. package/dist/cjs/components/panel/MrlPanelFooter/MrlPanelFooter.js +2 -1
  31. package/dist/cjs/components/panel/MrlPanelFooter/MrlPanelFooter.js.map +1 -1
  32. package/dist/cjs/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js +2 -1
  33. package/dist/cjs/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js.map +1 -1
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/cjs/version.js.map +1 -1
  36. package/dist/components/button/MrlButton/MrlButton.d.ts +6 -0
  37. package/dist/components/filter/MrlFilterItem/MrlFilterItem.d.ts +6 -3
  38. package/dist/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +10 -2
  39. package/dist/components/grid/MrlCol/MrlCol.d.ts +6 -4
  40. package/dist/components/grid/MrlCol/index.d.ts +1 -1
  41. package/dist/components/grid/MrlGrid/MrlGrid.d.ts +4 -5
  42. package/dist/components/grid/MrlGrid/index.d.ts +1 -1
  43. package/dist/components/grid/MrlRow/MrlRow.d.ts +7 -7
  44. package/dist/components/grid/MrlRow/index.d.ts +1 -1
  45. package/dist/components/grid/constants.d.ts +6 -20
  46. package/dist/components/menu/MrlMenu/MrlMenu.d.ts +10 -3
  47. package/dist/components/menu/MrlMenuGroup/MrlMenuGroup.d.ts +15 -1
  48. package/dist/components/menu/MrlMenuItem/MrlMenuItem.d.ts +14 -6
  49. package/dist/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +16 -7
  50. package/dist/components/modal/MrlModalContent/MrlModalContent.d.ts +5 -2
  51. package/dist/components/modal/MrlModalFooter/MrlModalFooter.d.ts +4 -2
  52. package/dist/components/modal/MrlModalHeader/MrlModalHeader.d.ts +4 -3
  53. package/dist/components/panel/MrlPanel/MrlPanel.d.ts +2 -1
  54. package/dist/components/panel/MrlPanelFooter/MrlPanelFooter.d.ts +6 -3
  55. package/dist/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.d.ts +4 -2
  56. package/dist/esm/components/button/MrlButton/MrlButton.js +16 -8
  57. package/dist/esm/components/button/MrlButton/MrlButton.js.map +1 -1
  58. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js +5 -2
  59. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -1
  60. package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js +2 -1
  61. package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
  62. package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  63. package/dist/esm/components/grid/MrlCol/MrlCol.js +50 -43
  64. package/dist/esm/components/grid/MrlCol/MrlCol.js.map +1 -1
  65. package/dist/esm/components/grid/MrlGrid/MrlGrid.js +6 -4
  66. package/dist/esm/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  67. package/dist/esm/components/grid/MrlRow/MrlRow.js +8 -10
  68. package/dist/esm/components/grid/MrlRow/MrlRow.js.map +1 -1
  69. package/dist/esm/components/grid/constants.js +8 -26
  70. package/dist/esm/components/grid/constants.js.map +1 -1
  71. package/dist/esm/components/menu/MrlMenu/MrlMenu.js.map +1 -1
  72. package/dist/esm/components/menu/MrlMenuGroup/MrlMenuGroup.js +4 -1
  73. package/dist/esm/components/menu/MrlMenuGroup/MrlMenuGroup.js.map +1 -1
  74. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js +2 -1
  75. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  76. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +8 -4
  77. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  78. package/dist/esm/components/modal/MrlModalContent/MrlModalContent.js +1 -1
  79. package/dist/esm/components/modal/MrlModalContent/MrlModalContent.js.map +1 -1
  80. package/dist/esm/components/modal/MrlModalFooter/MrlModalFooter.js +2 -1
  81. package/dist/esm/components/modal/MrlModalFooter/MrlModalFooter.js.map +1 -1
  82. package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
  83. package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
  84. package/dist/esm/components/panel/MrlPanel/MrlPanel.js.map +1 -1
  85. package/dist/esm/components/panel/MrlPanelFooter/MrlPanelFooter.js +2 -1
  86. package/dist/esm/components/panel/MrlPanelFooter/MrlPanelFooter.js.map +1 -1
  87. package/dist/esm/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js +2 -1
  88. package/dist/esm/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.js.map +1 -1
  89. package/dist/esm/version.js +1 -1
  90. package/dist/esm/version.js.map +1 -1
  91. package/dist/styles/MrlSidebar/module.scss +2 -2
  92. package/dist/styles/grid/global.scss +2 -98
  93. package/dist/styles/grid/variables.scss +18 -2
  94. package/dist/styles.css +6 -1
  95. package/dist/types/components/button/MrlButton/MrlButton.d.ts +6 -0
  96. package/dist/types/components/filter/MrlFilterItem/MrlFilterItem.d.ts +6 -3
  97. package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +10 -2
  98. package/dist/types/components/grid/MrlCol/MrlCol.d.ts +6 -4
  99. package/dist/types/components/grid/MrlCol/index.d.ts +1 -1
  100. package/dist/types/components/grid/MrlGrid/MrlGrid.d.ts +4 -5
  101. package/dist/types/components/grid/MrlGrid/index.d.ts +1 -1
  102. package/dist/types/components/grid/MrlRow/MrlRow.d.ts +7 -7
  103. package/dist/types/components/grid/MrlRow/index.d.ts +1 -1
  104. package/dist/types/components/grid/constants.d.ts +6 -20
  105. package/dist/types/components/menu/MrlMenu/MrlMenu.d.ts +10 -3
  106. package/dist/types/components/menu/MrlMenuGroup/MrlMenuGroup.d.ts +15 -1
  107. package/dist/types/components/menu/MrlMenuItem/MrlMenuItem.d.ts +14 -6
  108. package/dist/types/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +16 -7
  109. package/dist/types/components/modal/MrlModalContent/MrlModalContent.d.ts +5 -2
  110. package/dist/types/components/modal/MrlModalFooter/MrlModalFooter.d.ts +4 -2
  111. package/dist/types/components/modal/MrlModalHeader/MrlModalHeader.d.ts +4 -3
  112. package/dist/types/components/panel/MrlPanel/MrlPanel.d.ts +2 -1
  113. package/dist/types/components/panel/MrlPanelFooter/MrlPanelFooter.d.ts +6 -3
  114. package/dist/types/components/panel/MrlPanelStickyHeader/MrlPanelStickyHeader.d.ts +4 -2
  115. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MrlFilterItem.js","sources":["../../../../../src/components/filter/MrlFilterItem/MrlFilterItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlFilterItem.module.scss';\nimport { DataQa } from '../../../utils/dataQa';\nimport { getUniqueId } from '../../../utils';\nimport { useMrlFilterContext } from '../MrlFilterContext';\nimport { MrlBadge } from '../../badge';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport type MrlFilterItemProps = {\n\t/**\n\t * The filter item's value.\n\t */\n\tvalue: string;\n\t/**\n\t * The content to be displayed within the filter item.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * The count of items for this filter option.\n\t */\n\tcount?: number;\n\t/**\n\t * Enables interaction tracking for this filter option. Provide a stable, non-PII id\n\t * (e.g. 'templates-category-filter'). When omitted, the option emits no analytics.\n\t *\n\t * Note: the option's value and content are never emitted.\n\t */\n\teventId?: string;\n} & React.ComponentPropsWithoutRef<'span'> &\n\tDataQa;\n\n/**\n * MrlFilterItem component.\n *\n * @param props - The component props.\n * @returns The MrlFilterItem component.\n */\nexport function MrlFilterItem(props: MrlFilterItemProps): React.ReactElement {\n\tconst { ['data-qa']: dataQa, id, children, className, value, count, eventId, ...rest } = props;\n\n\tconst { state, dispatch } = useMrlFilterContext();\n\tconst trackInteraction = useMrlTrackInteraction('MrlFilterItem', eventId);\n\n\tfunction handleFilterChange() {\n\t\t// click also focuses the item, so only an actual change in selection is emitted.\n\t\t// the option's value is consumer data and is never emitted.\n\t\tif (state.checked !== value) {\n\t\t\ttrackInteraction({ action: 'select' });\n\t\t}\n\n\t\tdispatch({\n\t\t\tpayload: value,\n\t\t\ttype: 'SET_CHECKED'\n\t\t});\n\t}\n\n\tconst filterItemIdRef = React.useRef<string>(id || getUniqueId('mrl-filter-item'));\n\tconst isChecked = state.checked === value;\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/interactive-supports-focus, jsx-a11y/click-events-have-key-events\n\t\t<span\n\t\t\t{...rest}\n\t\t\tdata-qa={dataQa}\n\t\t\tdata-roving=\"true\"\n\t\t\tonClick={handleFilterChange}\n\t\t\tonFocus={handleFilterChange}\n\t\t\taria-checked={isChecked}\n\t\t\trole=\"radio\"\n\t\t\tid={filterItemIdRef.current}\n\t\t\tclassName={classnames(\n\t\t\t\tstyles['MrlFilterItem'],\n\t\t\t\t'MrlFilterItem',\n\t\t\t\t{\n\t\t\t\t\t[styles['MrlFilterItem-has-count']]: typeof count !== 'undefined'\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{children}\n\t\t\t{typeof count !== 'undefined' && (\n\t\t\t\t<MrlBadge text={String(count)} aria-label={`, ${count} items`} />\n\t\t\t)}\n\t\t</span>\n\t);\n}\n"],"names":["MrlFilterItem","props","dataQa","id","children","className","value","count","eventId","rest","_objectWithoutProperties","_excluded","_useMrlFilterContext","useMrlFilterContext","state","dispatch","trackInteraction","useMrlTrackInteraction","handleFilterChange","checked","action","payload","type","filterItemIdRef","React","useRef","getUniqueId","isChecked","createElement","_extends","onClick","onFocus","role","current","classnames","styles","MrlBadge","text","String","concat"],"mappings":";;;;;;;;;;AAgCA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAACC,KAAyB,EAAsB;AAC5E,EAAA,IAAqBC,MAAM,GAA8DD,KAAK,CAArF,SAAS,CAAA;IAAWE,EAAE,GAA0DF,KAAK,CAAjEE,EAAE;IAAEC,QAAQ,GAAgDH,KAAK,CAA7DG,QAAQ;IAAEC,SAAS,GAAqCJ,KAAK,CAAnDI,SAAS;IAAEC,KAAK,GAA8BL,KAAK,CAAxCK,KAAK;IAAEC,KAAK,GAAuBN,KAAK,CAAjCM,KAAK;IAAEC,OAAO,GAAcP,KAAK,CAA1BO,OAAO;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAKT,KAAK,EAAAU,SAAA,CAAA;AAE9F,EAAA,IAAAC,oBAAA,GAA4BC,mBAAmB,EAAE;IAAzCC,KAAK,GAAAF,oBAAA,CAALE,KAAK;IAAEC,QAAQ,GAAAH,oBAAA,CAARG,QAAQ;AACvB,EAAA,IAAMC,gBAAgB,GAAGC,sBAAsB,CAAC,eAAe,EAAET,OAAO,CAAC;EAEzE,SAASU,kBAAkBA,GAAG;AAC7B;AACA;AACA,IAAA,IAAIJ,KAAK,CAACK,OAAO,KAAKb,KAAK,EAAE;AAC5BU,MAAAA,gBAAgB,CAAC;AAAEI,QAAAA,MAAM,EAAE;AAAS,OAAC,CAAC;AACvC,IAAA;AAEAL,IAAAA,QAAQ,CAAC;AACRM,MAAAA,OAAO,EAAEf,KAAK;AACdgB,MAAAA,IAAI,EAAE;AACP,KAAC,CAAC;AACH,EAAA;AAEA,EAAA,IAAMC,eAAe,GAAGC,KAAK,CAACC,MAAM,CAAStB,EAAE,IAAIuB,WAAW,CAAC,iBAAiB,CAAC,CAAC;AAClF,EAAA,IAAMC,SAAS,GAAGb,KAAK,CAACK,OAAO,KAAKb,KAAK;AAEzC,EAAA;AAAA;AACC;AACAkB,IAAAA,KAAA,CAAAI,aAAA,CAAA,MAAA,EAAAC,QAAA,KACKpB,IAAI,EAAA;AACR,MAAA,SAAA,EAASP,MAAO;AAChB,MAAA,aAAA,EAAY,MAAM;AAClB4B,MAAAA,OAAO,EAAEZ,kBAAmB;AAC5Ba,MAAAA,OAAO,EAAEb,kBAAmB;AAC5B,MAAA,cAAA,EAAcS,SAAU;AACxBK,MAAAA,IAAI,EAAC,OAAO;MACZ7B,EAAE,EAAEoB,eAAe,CAACU,OAAQ;MAC5B5B,SAAS,EAAE6B,UAAU,CACpBC,MAAM,CAAC,eAAe,CAAC,EACvB,eAAe,EACf;AACC,QAAA,CAACA,MAAM,CAAC,yBAAyB,CAAC,GAAG,OAAO5B,KAAK,KAAK;AACvD,OAAC,EACDF,SACD;KAAE,CAAA,EAEDD,QAAQ,EACR,OAAOG,KAAK,KAAK,WAAW,iBAC5BiB,KAAA,CAAAI,aAAA,CAACQ,QAAQ,EAAA;AAACC,MAAAA,IAAI,EAAEC,MAAM,CAAC/B,KAAK,CAAE;MAAC,YAAA,EAAA,IAAA,CAAAgC,MAAA,CAAiBhC,KAAK,EAAA,QAAA;AAAS,KAAE,CAE5D;AAAC;AAET;;;;"}
1
+ {"version":3,"file":"MrlFilterItem.js","sources":["../../../../../src/components/filter/MrlFilterItem/MrlFilterItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport styles from './MrlFilterItem.module.scss';\nimport { DataQa } from '../../../utils/dataQa';\nimport { getUniqueId } from '../../../utils';\nimport { useMrlFilterContext } from '../MrlFilterContext';\nimport { MrlBadge } from '../../badge';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport type MrlFilterItemProps = {\n\t/**\n\t * The filter item's value, reported to `MrlFilter` when the item is selected by click or by\n\t * arrow-key focus. The item is checked while it equals the filter's selected value.\n\t */\n\tvalue: string;\n\t/**\n\t * The content to be displayed within the filter item.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * The count of items for this filter option, shown as a badge and announced as \", N items\"\n\t * after the label.\n\t */\n\tcount?: number;\n\t/**\n\t * Enables interaction tracking for this filter option. Provide a stable, non-PII id\n\t * (e.g. 'templates-category-filter'). When omitted, the option emits no analytics.\n\t *\n\t * Note: the option's value and content are never emitted.\n\t */\n\teventId?: string;\n} & React.ComponentPropsWithoutRef<'span'> &\n\tDataQa;\n\n/**\n * MrlFilterItem component. One option of an `MrlFilter`, rendered as a `radio` of the filter's\n * radio group; must be rendered inside `MrlFilter`.\n *\n * @param props - The component props.\n * @returns The MrlFilterItem component.\n */\nexport function MrlFilterItem(props: MrlFilterItemProps): React.ReactElement {\n\tconst { ['data-qa']: dataQa, id, children, className, value, count, eventId, ...rest } = props;\n\n\tconst { state, dispatch } = useMrlFilterContext();\n\tconst trackInteraction = useMrlTrackInteraction('MrlFilterItem', eventId);\n\n\tfunction handleFilterChange() {\n\t\t// click also focuses the item, so only an actual change in selection is emitted.\n\t\t// the option's value is consumer data and is never emitted.\n\t\tif (state.checked !== value) {\n\t\t\ttrackInteraction({ action: 'select' });\n\t\t}\n\n\t\tdispatch({\n\t\t\tpayload: value,\n\t\t\ttype: 'SET_CHECKED'\n\t\t});\n\t}\n\n\tconst filterItemIdRef = React.useRef<string>(id || getUniqueId('mrl-filter-item'));\n\tconst isChecked = state.checked === value;\n\n\treturn (\n\t\t// eslint-disable-next-line jsx-a11y/interactive-supports-focus, jsx-a11y/click-events-have-key-events\n\t\t<span\n\t\t\t{...rest}\n\t\t\tdata-qa={dataQa}\n\t\t\tdata-roving=\"true\"\n\t\t\tonClick={handleFilterChange}\n\t\t\tonFocus={handleFilterChange}\n\t\t\taria-checked={isChecked}\n\t\t\trole=\"radio\"\n\t\t\tid={filterItemIdRef.current}\n\t\t\tclassName={classnames(\n\t\t\t\tstyles['MrlFilterItem'],\n\t\t\t\t'MrlFilterItem',\n\t\t\t\t{\n\t\t\t\t\t[styles['MrlFilterItem-has-count']]: typeof count !== 'undefined'\n\t\t\t\t},\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{children}\n\t\t\t{typeof count !== 'undefined' && (\n\t\t\t\t<MrlBadge text={String(count)} aria-label={`, ${count} items`} />\n\t\t\t)}\n\t\t</span>\n\t);\n}\n"],"names":["MrlFilterItem","props","dataQa","id","children","className","value","count","eventId","rest","_objectWithoutProperties","_excluded","_useMrlFilterContext","useMrlFilterContext","state","dispatch","trackInteraction","useMrlTrackInteraction","handleFilterChange","checked","action","payload","type","filterItemIdRef","React","useRef","getUniqueId","isChecked","createElement","_extends","onClick","onFocus","role","current","classnames","styles","MrlBadge","text","String","concat"],"mappings":";;;;;;;;;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAACC,KAAyB,EAAsB;AAC5E,EAAA,IAAqBC,MAAM,GAA8DD,KAAK,CAArF,SAAS,CAAA;IAAWE,EAAE,GAA0DF,KAAK,CAAjEE,EAAE;IAAEC,QAAQ,GAAgDH,KAAK,CAA7DG,QAAQ;IAAEC,SAAS,GAAqCJ,KAAK,CAAnDI,SAAS;IAAEC,KAAK,GAA8BL,KAAK,CAAxCK,KAAK;IAAEC,KAAK,GAAuBN,KAAK,CAAjCM,KAAK;IAAEC,OAAO,GAAcP,KAAK,CAA1BO,OAAO;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAKT,KAAK,EAAAU,SAAA,CAAA;AAE9F,EAAA,IAAAC,oBAAA,GAA4BC,mBAAmB,EAAE;IAAzCC,KAAK,GAAAF,oBAAA,CAALE,KAAK;IAAEC,QAAQ,GAAAH,oBAAA,CAARG,QAAQ;AACvB,EAAA,IAAMC,gBAAgB,GAAGC,sBAAsB,CAAC,eAAe,EAAET,OAAO,CAAC;EAEzE,SAASU,kBAAkBA,GAAG;AAC7B;AACA;AACA,IAAA,IAAIJ,KAAK,CAACK,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../../src/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { AttrsObject, getUniqueId, setAttributes } from '../../../../utils';\nimport { check, minus } from '@muraldevkit/ds-icons';\nimport { checkboxDefaults, CheckboxSelected, CheckboxStates } from '../../constants';\nimport { MrlSvg } from '../../../svg/MrlSvg/MrlSvg';\nimport { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics';\n\nimport styles from './MrlCheckboxStandalone.module.scss';\nimport './MrlCheckboxStandalone.global.scss';\n\ninterface MrlCheckboxStandaloneProps {\n\t/** Applies additional HTML attributes to the checkbox element */\n\tattrs?: AttrsObject;\n\t/** The current state of the checkbox input based on user interactions or permissions */\n\tstate?: CheckboxStates;\n\t/** Sets what selection state the checkbox is in. */\n\tselected?: CheckboxSelected;\n\t/**\n\t * Enables interaction tracking for this checkbox. Provide a stable, non-PII id\n\t * (e.g. 'export-include-comments'). When omitted, the checkbox emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * Input that allows the user to select one or more options from a provided list.\n * Note, this component does not provide out of the box accessibility for ensuring\n * an associated label and must be manually setup during adoption.\n * @param {MrlCheckboxStandaloneProps} props - the component props\n * @returns a checkbox element\n */\nexport function MrlCheckboxStandalone({\n\tattrs = {},\n\tstate = checkboxDefaults.state,\n\tselected = checkboxDefaults.selected,\n\teventId,\n\t...rest\n}: MrlCheckboxStandaloneProps): JSX.Element {\n\tconst trackInteraction = useMrlTrackInteraction('MrlCheckboxStandalone', eventId);\n\t// Use attrs.id if the developer passes in a custom id\n\t// but we need to ensure one exists for accessibility\n\tconst checkboxIdRef = React.useRef<string>(attrs.id || getUniqueId('mrl-checkbox'));\n\tconst inputRef = React.useRef<HTMLInputElement>(null);\n\n\tif (!(attrs.id || attrs['aria-labelledby'])) {\n\t\tconsole.warn(\n\t\t\t'Warning: Mural Standalone Checkboxes must have either an id or' +\n\t\t\t\t' aria-labelledby attribute for proper accessibility.'\n\t\t);\n\t}\n\n\t// We need to use the ref to set indetermiant attr\n\t// due to not being an intrinsic HTML attr\n\tReact.useEffect(() => {\n\t\tconst indeterminate = selected === 'indeterminate';\n\n\t\tif (inputRef.current) {\n\t\t\tinputRef.current.indeterminate = indeterminate;\n\t\t}\n\t}, [selected]);\n\n\tdelete attrs.class;\n\tdelete attrs.className;\n\n\tconst attributes = setAttributes(attrs);\n\n\t// the consumer's handler arrives through `attrs`, so wrap it here rather than\n\t// relying on a top-level onChange prop.\n\tconst consumerOnChange = attributes.onChange as\n\t\t| ((e: React.ChangeEvent<HTMLInputElement>) => void)\n\t\t| undefined;\n\n\t/**\n\t * Handle change events\n\t *\n\t * @param {React.ChangeEvent<HTMLInputElement>} e - change event\n\t */\n\tconst handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\ttrackInteraction({ action: 'change', metadata: { selected: e.target.checked } });\n\n\t\tconsumerOnChange?.(e);\n\t};\n\n\treturn (\n\t\t<div className={classnames(styles['MrlCheckboxStandalone'], 'MrlCheckboxStandalone')}>\n\t\t\t<span className=\"mrl-u-focus-wrapper\">\n\t\t\t\t<input\n\t\t\t\t\t{...rest}\n\t\t\t\t\t{...attributes}\n\t\t\t\t\taria-invalid={state === 'error'}\n\t\t\t\t\tchecked={selected === 'checked'}\n\t\t\t\t\tdisabled={state === 'disabled'}\n\t\t\t\t\tid={checkboxIdRef.current}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlCheckboxStandalone-input'],\n\t\t\t\t\t\t'MrlCheckboxStandalone-input'\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t<span className=\"mrl-u-focus-indicator\"></span>\n\t\t\t\t<span\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlCheckboxStandalone-inputDisplay'],\n\t\t\t\t\t\t'MrlCheckboxStandalone-inputDisplay'\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<MrlSvg\n\t\t\t\t\t\tsvg={selected !== 'indeterminate' ? check : minus}\n\t\t\t\t\t\tsize=\"auto\"\n\t\t\t\t\t\tclassName={styles['MrlCheckboxStandalone-inputDisplay-icon']}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n"],"names":["MrlCheckboxStandalone","_ref","_ref$attrs","attrs","_ref$state","state","checkboxDefaults","_ref$selected","selected","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","checkboxIdRef","React","useRef","id","getUniqueId","inputRef","console","warn","useEffect","indeterminate","current","class","className","attributes","setAttributes","consumerOnChange","onChange","handleChange","e","action","metadata","target","checked","createElement","classnames","styles","_extends","disabled","ref","type","MrlSvg","svg","check","minus","size"],"mappings":";;;;;;;;;;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAqBA,CAAAC,IAAA,EAMO;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CAL3CE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IAAAE,UAAA,GAAAH,IAAA,CACVI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAGE,gBAAgB,CAACD,KAAK,GAAAD,UAAA;IAAAG,aAAA,GAAAN,IAAA,CAC9BO,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,MAAA,GAAGD,gBAAgB,CAACE,QAAQ,GAAAD,aAAA;IACpCE,OAAO,GAAAR,IAAA,CAAPQ,OAAO;AACJC,IAAAA,IAAI,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA,CAAA;AAEP,EAAA,IAAMC,gBAAgB,GAAGC,sBAAsB,CAAC,uBAAuB,EAAEL,OAAO,CAAC;AACjF;AACA;AACA,EAAA,IAAMM,aAAa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CAAC,EAAE,uBAAuB;GAAE,eACpFxB,KAAA,CAAAsB,aAAA,CAAA,MAAA,EAAA;AAAMX,IAAAA,SAAS,EAAC;GAAqB,eACpCX,KAAA,CAAAsB,aAAA,CAAA,OAAA,EAAAG,QAAA,CAAA,EAAA,EACK/B,IAAI,EACJkB,UAAU,EAAA;IACd,cAAA,EAAcvB,KAAK,KAAK,OAAQ;IAChCgC,OAAO,EAAE7B,QAAQ,KAAK,SAAU;IAChCkC,QAAQ,EAAErC,KAAK,KAAK,UAAW;IAC/Ba,EAAE,EAAEH,aAAa,CAACU,OAAQ;AAC1BM,IAAAA,QAAQ,EAAEC,YAAa;AACvBW,IAAAA,GAAG,EAAEvB,QAAS;AACdwB,IAAAA,IAAI,EAAC,UAAU;IACfjB,SAAS,EAAEY,UAAU,CACpBC,MAAM,CAAC,6BAA6B,CAAC,EACrC,6BACD;AAAE,GAAA,CACF,CAAC,eACFxB,KAAA,CAAAsB,aAAA,CAAA,MAAA,EAAA;AAAMX,IAAAA,SAAS,EAAC;AAAuB,GAAO,CAAC,eAC/CX,KAAA,CAAAsB,aAAA,CAAA,MAAA,EAAA;IACCX,SAAS,EAAEY,UAAU,CACpBC,MAAM,CAAC,oCAAoC,CAAC,EAC5C,oCACD;AAAE,GAAA,eAEFxB,KAAA,CAAAsB,aAAA,CAACO,MAAM,EAAA;AACNC,IAAAA,GAAG,EAAEtC,QAAQ,KAAK,eAAe,GAAGuC,KAAK,GAAGC,KAAM;AAClDC,IAAAA,IAAI,EAAC,MAAM;IACXtB,SAAS,EAAEa,MAAM,CAAC,yCAAyC;GAC3D,CACI,CACD,CACF,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlCheckboxStandalone.js","sources":["../../../../../../src/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { AttrsObject, getUniqueId, setAttributes } from '../../../../utils';\nimport { check, minus } from '@muraldevkit/ds-icons';\nimport { checkboxDefaults, CheckboxSelected, CheckboxStates } from '../../constants';\nimport { MrlSvg } from '../../../svg/MrlSvg/MrlSvg';\nimport { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics';\n\nimport styles from './MrlCheckboxStandalone.module.scss';\nimport './MrlCheckboxStandalone.global.scss';\n\ninterface MrlCheckboxStandaloneProps {\n\t/**\n\t * Applies additional HTML attributes to the checkbox element. The component renders no label,\n\t * so label it here: an `id` referenced by a `<label htmlFor>`, or `aria-labelledby` pointing\n\t * to visible text (a console warning is logged when both are missing). Pass the `onChange`\n\t * handler here as well.\n\t */\n\tattrs?: AttrsObject;\n\t/** The current state of the checkbox input based on user interactions or permissions */\n\tstate?: CheckboxStates;\n\t/**\n\t * Sets what selection state the checkbox is in. The component is controlled: update it from\n\t * the `onChange` handler passed in `attrs`.\n\t */\n\tselected?: CheckboxSelected;\n\t/**\n\t * Enables interaction tracking for this checkbox. Provide a stable, non-PII id\n\t * (e.g. 'export-include-comments'). When omitted, the checkbox emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * Input that allows the user to select one or more options from a provided list.\n * Note, this component does not provide out of the box accessibility for ensuring\n * an associated label and must be manually setup during adoption.\n * @param {MrlCheckboxStandaloneProps} props - the component props\n * @returns a checkbox element\n */\nexport function MrlCheckboxStandalone({\n\tattrs = {},\n\tstate = checkboxDefaults.state,\n\tselected = checkboxDefaults.selected,\n\teventId,\n\t...rest\n}: MrlCheckboxStandaloneProps): JSX.Element {\n\tconst trackInteraction = useMrlTrackInteraction('MrlCheckboxStandalone', eventId);\n\t// Use attrs.id if the developer passes in a custom id\n\t// but we need to ensure one exists for accessibility\n\tconst checkboxIdRef = React.useRef<string>(attrs.id || getUniqueId('mrl-checkbox'));\n\tconst inputRef = React.useRef<HTMLInputElement>(null);\n\n\tif (!(attrs.id || attrs['aria-labelledby'])) {\n\t\tconsole.warn(\n\t\t\t'Warning: Mural Standalone Checkboxes must have either an id or' +\n\t\t\t\t' aria-labelledby attribute for proper accessibility.'\n\t\t);\n\t}\n\n\t// We need to use the ref to set indetermiant attr\n\t// due to not being an intrinsic HTML attr\n\tReact.useEffect(() => {\n\t\tconst indeterminate = selected === 'indeterminate';\n\n\t\tif (inputRef.current) {\n\t\t\tinputRef.current.indeterminate = indeterminate;\n\t\t}\n\t}, [selected]);\n\n\tdelete attrs.class;\n\tdelete attrs.className;\n\n\tconst attributes = setAttributes(attrs);\n\n\t// the consumer's handler arrives through `attrs`, so wrap it here rather than\n\t// relying on a top-level onChange prop.\n\tconst consumerOnChange = attributes.onChange as\n\t\t| ((e: React.ChangeEvent<HTMLInputElement>) => void)\n\t\t| undefined;\n\n\t/**\n\t * Handle change events\n\t *\n\t * @param {React.ChangeEvent<HTMLInputElement>} e - change event\n\t */\n\tconst handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\ttrackInteraction({ action: 'change', metadata: { selected: e.target.checked } });\n\n\t\tconsumerOnChange?.(e);\n\t};\n\n\treturn (\n\t\t<div className={classnames(styles['MrlCheckboxStandalone'], 'MrlCheckboxStandalone')}>\n\t\t\t<span className=\"mrl-u-focus-wrapper\">\n\t\t\t\t<input\n\t\t\t\t\t{...rest}\n\t\t\t\t\t{...attributes}\n\t\t\t\t\taria-invalid={state === 'error'}\n\t\t\t\t\tchecked={selected === 'checked'}\n\t\t\t\t\tdisabled={state === 'disabled'}\n\t\t\t\t\tid={checkboxIdRef.current}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlCheckboxStandalone-input'],\n\t\t\t\t\t\t'MrlCheckboxStandalone-input'\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t<span className=\"mrl-u-focus-indicator\"></span>\n\t\t\t\t<span\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlCheckboxStandalone-inputDisplay'],\n\t\t\t\t\t\t'MrlCheckboxStandalone-inputDisplay'\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<MrlSvg\n\t\t\t\t\t\tsvg={selected !== 'indeterminate' ? check : minus}\n\t\t\t\t\t\tsize=\"auto\"\n\t\t\t\t\t\tclassName={styles['MrlCheckboxStandalone-inputDisplay-icon']}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n"],"names":["MrlCheckboxStandalone","_ref","_ref$attrs","attrs","_ref$state","state","checkboxDefaults","_ref$selected","selected","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","checkboxIdRef","React","useRef","id","getUniqueId","inputRef","console","warn","useEffect","indeterminate","current","class","className","attributes","setAttributes","consumerOnChange","onChange","handleChange","e","action","metadata","target","checked","createElement","classnames","styles","_extends","disabled","ref","type","MrlSvg","svg","check","minus","size"],"mappings":";;;;;;;;;;;AAiCA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAqBA,CAAAC,IAAA,EAMO;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CAL3CE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IAAAE,UAAA,GAAAH,IAAA,CACVI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAGE,gBAAgB,CAACD,KAAK,GAAAD,UAAA;IAAAG,aAAA,GAAAN,IAAA,CAC9BO,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,MAAA,GAAGD,gBAAgB,CAACE,QAAQ,GAAAD,aAAA;IACpCE,OAAO,GAAAR,IAAA,CAAPQ,OAAO;AACJC,IAAAA,IAAI,GAAAC,wBAAA,CAAAV,IAAA,EAAAW,SAAA,CAAA;AAEP,EAAA,IAAMC,gBAAgB,GAAGC,sBAAsB,CAAC,uBAAuB,EAAEL,OAAO,CAAC;AACjF;AACA;AACA,EAAA,IA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,uBAAuB,CAAC,EAAE,uBAAuB;GAAE,eACpFxB,KAAA,CAAAsB,aAAA,CAAA,MAAA,EAAA;AAAMX,IAAAA,SAAS,EAAC;GAAqB,eACpCX,KAAA,CAAAsB,aAAA,CAAA,OAAA,EAAAG,QAAA,CAAA,EAAA,EACK/B,IAAI,EACJkB,UAAU,EAAA;IACd,cAAA,EAAcvB,KAAK,KAAK,OAAQ;IAChCgC,OAAO,EAAE7B,QAAQ,KAAK,SAAU;IAChCkC,QAAQ,EAAErC,KAAK,KAAK,UAAW;IAC/Ba,EAAE,EAAEH,aAAa,CAACU,OAAQ;AAC1BM,IAAAA,QAAQ,EAAEC,YAAa;AACvBW,IAAAA,GAAG,EAAEvB,QAAS;AACdwB,IAAAA,IAAI,EAAC,UAAU;IACfjB,SAAS,EAAEY,UAAU,CACpBC,MAAM,CAAC,6BAA6B,CAAC,EACrC,6BACD;AAAE,GAAA,CACF,CAAC,eACFxB,KAAA,CAAAsB,aAAA,CAAA,MAAA,EAAA;AAAMX,IAAAA,SAAS,EAAC;AAAuB,GAAO,CAAC,eAC/CX,KAAA,CAAAsB,aAAA,CAAA,MAAA,EAAA;IACCX,SAAS,EAAEY,UAAU,CACpBC,MAAM,CAAC,oCAAoC,CAAC,EAC5C,oCACD;AAAE,GAAA,eAEFxB,KAAA,CAAAsB,aAAA,CAACO,MAAM,EAAA;AACNC,IAAAA,GAAG,EAAEtC,QAAQ,KAAK,eAAe,GAAGuC,KAAK,GAAGC,KAAM;AAClDC,IAAAA,IAAI,EAAC,MAAM;IACXtB,SAAS,EAAEa,MAAM,CAAC,yCAAyC;GAC3D,CACI,CACD,CACF,CAAC;AAER;;;;"}
@@ -1,46 +1,40 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends, slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import * as React from 'react';
3
3
  import classnames from 'classnames';
4
- import { GRID_SIZE_KEYS } from '../constants.js';
4
+ import { GridSizes } from '../constants.js';
5
5
 
6
- var _excluded = ["children", "className", "col", "lg", "md", "sm", "xl", "xs", "xxl"];
7
- /**
8
- * Builds a single grid class. The base tier (`col`) and the deprecated `xs`
9
- * alias are un-prefixed; every other breakpoint carries its infix.
10
- * @param size - breakpoint key
11
- * @param type - `col` or `offset`
12
- * @param val - column count, or `auto`
13
- * @returns the grid class name
14
- */
15
- var getGridClass = (size, type, val) => size === 'col' || size === 'xs' ? "".concat(type, "-").concat(val) : "".concat(type, "-").concat(size, "-").concat(val);
6
+ var _excluded = ["children", "className"];
7
+ var getBootstrapClass = (size, type, val) => size === 'col' || size === 'xs' ? "".concat(type, "-").concat(val) : "".concat(type, "-").concat(size, "-").concat(val);
16
8
 
17
9
  /**
18
10
  * Creates the size classes for the grid.
19
11
  * @param props - component props
20
- * @returns an array of size classes
12
+ * @returns an array of size classes based on bootstrap grid API
21
13
  */
22
14
  var createSizeClasses = props => {
23
15
  var classes = [];
24
- for (var size of GRID_SIZE_KEYS) {
16
+ for (var size of GridSizes) {
25
17
  // get the value based on the prop key from the component props
26
18
  var value = props[size];
27
19
 
28
- // create the size class based on the value
20
+ // create the size class based on the value using the bootstrap grid API
29
21
  if (value) {
30
- // if the value is a number or `auto`, then it is a column size
31
- if (typeof value === 'number' || typeof value === 'string') {
32
- classes.push(getGridClass(size, 'col', value));
22
+ // if the value is a number, then it is a column size
23
+ if (typeof value === 'number') {
24
+ classes.push(getBootstrapClass(size, 'col', value));
33
25
  continue;
34
26
  }
35
27
 
36
28
  // if the value is an object, then we need to compose multiple classes
37
29
  // based on the keyvalue pairings
38
- for (var _ref3 of Object.entries(value)) {
39
- var _ref2 = _slicedToArray(_ref3, 2);
40
- var key = _ref2[0];
41
- var val = _ref2[1];
42
- if (val === 0 || val === undefined) continue;
43
- classes.push(getGridClass(size, key, val));
30
+ if (value !== null && typeof value === 'object') {
31
+ for (var _ref3 of Object.entries(value)) {
32
+ var _ref2 = _slicedToArray(_ref3, 2);
33
+ var key = _ref2[0];
34
+ var val = _ref2[1];
35
+ if (val === 0 || val === undefined) continue;
36
+ classes.push(getBootstrapClass(size, key, val));
37
+ }
44
38
  }
45
39
  }
46
40
  }
@@ -49,31 +43,44 @@ var createSizeClasses = props => {
49
43
  };
50
44
 
51
45
  /**
52
- * MrlCol React component. Creates a grid column.
53
- * @param props - component props
54
- * @returns a MrlCol React component.
46
+ * Gets the grid size props from the component props.
47
+ * @param props - component props
48
+ * @returns object of grid size props
55
49
  */
56
- function MrlCol(_ref4) {
57
- var children = _ref4.children,
58
- className = _ref4.className,
59
- col = _ref4.col,
60
- lg = _ref4.lg,
61
- md = _ref4.md,
62
- sm = _ref4.sm,
63
- xl = _ref4.xl,
64
- xs = _ref4.xs,
65
- xxl = _ref4.xxl,
66
- rest = _objectWithoutProperties(_ref4, _excluded);
67
- var columnClasses = createSizeClasses({
50
+ var getGridProps = props => {
51
+ var col = props.col,
52
+ xs = props.xs,
53
+ sm = props.sm,
54
+ md = props.md,
55
+ lg = props.lg,
56
+ xl = props.xl,
57
+ xxl = props.xxl;
58
+
59
+ // eslint-disable-next-line sort-keys
60
+ return {
68
61
  col,
69
- lg,
70
- md,
62
+ xs,
71
63
  sm,
64
+ md,
65
+ lg,
72
66
  xl,
73
- xs,
74
67
  xxl
75
- });
76
- var allClasses = classnames(className, 'MrlCol', columnClasses);
68
+ };
69
+ };
70
+
71
+ /**
72
+ * MrlCol React component.
73
+ * @param props - component props
74
+ * @returns a MrlCol React component.
75
+ */
76
+ function MrlCol(props) {
77
+ var children = props.children,
78
+ _props$className = props.className,
79
+ className = _props$className === void 0 ? '' : _props$className,
80
+ rest = _objectWithoutProperties(props, _excluded);
81
+ var gridProps = getGridProps(props);
82
+ var columnClasses = React.useMemo(() => createSizeClasses(gridProps), [gridProps]);
83
+ var allClasses = classnames(className, columnClasses);
77
84
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
78
85
  className: allClasses
79
86
  }), children);
@@ -1 +1 @@
1
- {"version":3,"file":"MrlCol.js","sources":["../../../../../src/components/grid/MrlCol/MrlCol.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { GRID_SIZE_KEYS, GridBaseProps, GridColumns } from '../constants';\n\nexport type MrlColProps = GridColumns & GridBaseProps;\n\n/**\n * Builds a single grid class. The base tier (`col`) and the deprecated `xs`\n * alias are un-prefixed; every other breakpoint carries its infix.\n * @param size - breakpoint key\n * @param type - `col` or `offset`\n * @param val - column count, or `auto`\n * @returns the grid class name\n */\nconst getGridClass = (size: string, type: string, val: number | string): string =>\n\tsize === 'col' || size === 'xs' ? `${type}-${val}` : `${type}-${size}-${val}`;\n\n/**\n * Creates the size classes for the grid.\n * @param props - component props\n * @returns an array of size classes\n */\nconst createSizeClasses = (props: GridColumns): string[] => {\n\tconst classes: string[] = [];\n\n\tfor (const size of GRID_SIZE_KEYS) {\n\t\t// get the value based on the prop key from the component props\n\t\tconst value = props[size];\n\n\t\t// create the size class based on the value\n\t\tif (value) {\n\t\t\t// if the value is a number or `auto`, then it is a column size\n\t\t\tif (typeof value === 'number' || typeof value === 'string') {\n\t\t\t\tclasses.push(getGridClass(size, 'col', value));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// if the value is an object, then we need to compose multiple classes\n\t\t\t// based on the keyvalue pairings\n\t\t\tfor (const [key, val] of Object.entries(value)) {\n\t\t\t\tif (val === 0 || val === undefined) continue;\n\t\t\t\tclasses.push(getGridClass(size, key, val as number));\n\t\t\t}\n\t\t}\n\t}\n\n\tif (classes.length === 0) classes.push('col');\n\n\treturn classes;\n};\n\n/**\n * MrlCol React component. Creates a grid column.\n * @param props - component props\n * @returns a MrlCol React component.\n */\nexport function MrlCol({\n\tchildren,\n\tclassName,\n\tcol,\n\tlg,\n\tmd,\n\tsm,\n\txl,\n\txs,\n\txxl,\n\t...rest\n}: MrlColProps): JSX.Element {\n\tconst columnClasses = createSizeClasses({ col, lg, md, sm, xl, xs, xxl });\n\tconst allClasses = classnames(className, 'MrlCol', columnClasses);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["getGridClass","size","type","val","concat","createSizeClasses","props","classes","GRID_SIZE_KEYS","value","push","_ref3","Object","entries","_ref2","_slicedToArray","key","undefined","length","MrlCol","_ref4","children","className","col","lg","md","sm","xl","xs","xxl","rest","_objectWithoutProperties","_excluded","columnClasses","allClasses","classnames","React","createElement","_extends"],"mappings":";;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,YAAY,GAAGA,CAACC,IAAY,EAAEC,IAAY,EAAEC,GAAoB,KACrEF,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,IAAI,GAAA,EAAA,CAAAG,MAAA,CAAMF,IAAI,OAAAE,MAAA,CAAID,GAAG,CAAA,GAAA,EAAA,CAAAC,MAAA,CAAQF,IAAI,EAAA,GAAA,CAAA,CAAAE,MAAA,CAAIH,IAAI,EAAA,GAAA,CAAA,CAAAG,MAAA,CAAID,GAAG,CAAE;;AAE9E;AACA;AACA;AACA;AACA;AACA,IAAME,iBAAiB,GAAIC,KAAkB,IAAe;EAC3D,IAAMC,OAAiB,GAAG,EAAE;AAE5B,EAAA,KAAK,IAAMN,IAAI,IAAIO,cAAc,EAAE;AAClC;AACA,IAAA,IAAMC,KAAK,GAAGH,KAAK,CAACL,IAAI,CAAC;;AAEzB;AACA,IAAA,IAAIQ,KAAK,EAAE;AACV;MACA,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;QAC3DF,OAAO,CAACG,IAAI,CAACV,YAAY,CAACC,IAAI,EAAE,KAAK,EAAEQ,KAAK,CAAC,CAAC;AAC9C,QAAA;AACD,MAAA;;AAEA;AACA;MACA,KAAA,IAAAE,KAAA,IAAyBC,MAAM,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;AAAA,QAAA,IAAAK,KAAA,GAAAC,cAAA,CAAAJ,KAAA,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I,EAAA;AAAER,IAAAA,SAAS,EAAEY;AAAW,GAAA,CAAA,EACnCb,QACG,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlCol.js","sources":["../../../../../src/components/grid/MrlCol/MrlCol.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { LayoutComponent } from '../../layout/constants';\nimport { GridSizes, GridColumns } from '../constants';\n\ntype MrlCol = LayoutComponent & GridColumns;\n\nconst getBootstrapClass = (size: string, type: string, val: number | string): string =>\n\tsize === 'col' || size === 'xs' ? `${type}-${val}` : `${type}-${size}-${val}`;\n\n/**\n * Creates the size classes for the grid.\n * @param props - component props\n * @returns an array of size classes based on bootstrap grid API\n */\nconst createSizeClasses = (props: GridColumns): string[] => {\n\tconst classes: string[] = [];\n\n\tfor (const size of GridSizes) {\n\t\t// get the value based on the prop key from the component props\n\t\tconst value = props[size as keyof GridColumns];\n\n\t\t// create the size class based on the value using the bootstrap grid API\n\t\tif (value) {\n\t\t\t// if the value is a number, then it is a column size\n\t\t\tif (typeof value === 'number') {\n\t\t\t\tclasses.push(getBootstrapClass(size, 'col', value));\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// if the value is an object, then we need to compose multiple classes\n\t\t\t// based on the keyvalue pairings\n\t\t\tif (value !== null && typeof value === 'object') {\n\t\t\t\tfor (const [key, val] of Object.entries(value)) {\n\t\t\t\t\tif (val === 0 || val === undefined) continue;\n\t\t\t\t\tclasses.push(getBootstrapClass(size, key, val as number));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (classes.length === 0) classes.push('col');\n\n\treturn classes;\n};\n\n/**\n * Gets the grid size props from the component props.\n * @param props - component props\n * @returns object of grid size props\n */\nconst getGridProps = (props: MrlCol): GridColumns => {\n\tconst { col, xs, sm, md, lg, xl, xxl } = props;\n\n\t// eslint-disable-next-line sort-keys\n\treturn { col, xs, sm, md, lg, xl, xxl };\n};\n\n/**\n * MrlCol React component.\n * @param props - component props\n * @returns a MrlCol React component.\n */\nexport function MrlCol(props: MrlCol): JSX.Element {\n\tconst { children, className = '', ...rest } = props;\n\tconst gridProps = getGridProps(props);\n\n\tconst columnClasses = React.useMemo(() => createSizeClasses(gridProps), [gridProps]);\n\tconst allClasses = classnames(className, columnClasses);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["getBootstrapClass","size","type","val","concat","createSizeClasses","props","classes","GridSizes","value","push","_ref3","Object","entries","_ref2","_slicedToArray","key","undefined","length","getGridProps","col","xs","sm","md","lg","xl","xxl","MrlCol","children","_props$className","className","rest","_objectWithoutProperties","_excluded","gridProps","columnClasses","React","useMemo","allClasses","classnames","createElement","_extends"],"mappings":";;;;;;AAOA,IAAMA,iBAAiB,GAAGA,CAACC,IAAY,EAAEC,IAAY,EAAEC,GAAoB,KAC1EF,IAAI,KAAK,KAAK,IAAIA,IAAI,KAAK,IAAI,GAAA,EAAA,CAAAG,MAAA,CAAMF,IAAI,OAAAE,MAAA,CAAID,GAAG,CAAA,GAAA,EAAA,CAAAC,MAAA,CAAQF,IAAI,EAAA,GAAA,CAAA,CAAAE,MAAA,CAAIH,IAAI,EAAA,GAAA,CAAA,CAAAG,MAAA,CAAID,GAAG,CAAE;;AAE9E;AACA;AACA;AACA;AACA;AACA,IAAME,iBAAiB,GAAIC,KAAkB,IAAe;EAC3D,IAAMC,OAAiB,GAAG,EAAE;AAE5B,EAAA,KAAK,IAAMN,IAAI,IAAIO,SAAS,EAAE;AAC7B;AACA,IAAA,IAAMC,KAAK,GAAGH,KAAK,CAACL,IAAI,CAAsB;;AAE9C;AACA,IAAA,IAAIQ,KAAK,EAAE;AACV;AACA,MAAA,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;QAC9BF,OAAO,CAACG,IAAI,CAACV,iBAAiB,CAACC,IAAI,EAAE,KAAK,EAAEQ,KAAK,CAAC,CAAC;AACnD,QAAA;AACD,MAAA;;AAEA;AACA;MACA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,QAAQ,GAA8BtB,KAAK,CAA3CsB,QAAQ;IAAAC,gBAAA,GAA8BvB,KAAK,CAAjCwB,SAAS;AAATA,IAAAA,SAAS,GAAAD,gBAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,gBAAA;AAAKE,IAAAA,IAAI,GAAAC,wBAAA,CAAK1B,KAAK,EAAA2B,SAAA,CAAA;AACnD,EAAA,IAAMC,SAAS,GAAGf,YAAY,CAACb,KAAK,CAAC;AAErC,EAAA,IAAM6B,aAAa,GAAGC,KAAK,CAACC,OAAO,CAAC,MAAMhC,iBAAiB,CAAC6B,SAAS,CAAC,EAAE,CAACA,SAAS,CAAC,CAAC;AACpF,EAAA,IAAMI,UAAU,GAAGC,UAAU,CAACT,SAAS,EAAEK,aAAa,CAAC;AAEvD,EAAA,oBACCC,KAAA,CAAAI,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASV,IAAI,EAAA;AAAED,IAAAA,SAAS,EAAEQ;AAAW,GAAA,CAAA,EACnCV,QACG,CAAC;AAER;;;;"}
@@ -3,16 +3,18 @@ import * as React from 'react';
3
3
  import classnames from 'classnames';
4
4
 
5
5
  var _excluded = ["children", "className"];
6
+
6
7
  /**
7
- * MrlGrid React component. Primary container of a grid.
8
+ * MrlCol React component.
8
9
  * @param props - component props
9
- * @returns a MrlGrid React component.
10
+ * @returns a MrlCol React component.
10
11
  */
11
12
  function MrlGrid(_ref) {
12
13
  var children = _ref.children,
13
- className = _ref.className,
14
+ _ref$className = _ref.className,
15
+ className = _ref$className === void 0 ? '' : _ref$className,
14
16
  rest = _objectWithoutProperties(_ref, _excluded);
15
- var allClasses = classnames('container', 'MrlGrid', className);
17
+ var allClasses = classnames('container', className);
16
18
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
17
19
  className: allClasses
18
20
  }), children);
@@ -1 +1 @@
1
- {"version":3,"file":"MrlGrid.js","sources":["../../../../../src/components/grid/MrlGrid/MrlGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { GridBaseProps } from '../constants';\nimport '../grid.variables.scss';\nimport '../grid.global.scss';\n\nexport type MrlGridProps = GridBaseProps;\n\n/**\n * MrlGrid React component. Primary container of a grid.\n * @param props - component props\n * @returns a MrlGrid React component.\n */\nexport function MrlGrid({ children, className, ...rest }: MrlGridProps): JSX.Element {\n\tconst allClasses = classnames('container', 'MrlGrid', className);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["MrlGrid","_ref","children","className","rest","_objectWithoutProperties","_excluded","allClasses","classnames","React","createElement","_extends"],"mappings":";;;;;AAQA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAOA,CAAAC,IAAA,EAA8D;AAAA,EAAA,IAA3DC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA;EACrD,IAAMC,UAAU,GAAGC,UAAU,CAAC,WAAW,EAAE,SAAS,EAAEL,SAAS,CAAC;AAEhE,EAAA,oBACCM,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASP,IAAI,EAAA;AAAED,IAAAA,SAAS,EAAEI;AAAW,GAAA,CAAA,EACnCL,QACG,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlGrid.js","sources":["../../../../../src/components/grid/MrlGrid/MrlGrid.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { LayoutComponent } from '../../layout/constants';\nimport '../grid.variables.scss';\nimport '../grid.global.scss';\n\n/**\n * MrlCol React component.\n * @param props - component props\n * @returns a MrlCol React component.\n */\nexport function MrlGrid({ children, className = '', ...rest }: LayoutComponent): JSX.Element {\n\tconst allClasses = classnames('container', className);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["MrlGrid","_ref","children","_ref$className","className","rest","_objectWithoutProperties","_excluded","allClasses","classnames","React","createElement","_extends"],"mappings":";;;;;;AAMA;AACA;AACA;AACA;AACA;AACO,SAASA,OAAOA,CAAAC,IAAA,EAAsE;AAAA,EAAA,IAAnEC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,cAAA,GAAAF,IAAA,CAAEG,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;AAAKE,IAAAA,IAAI,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA;AAC1D,EAAA,IAAMC,UAAU,GAAGC,UAAU,CAAC,WAAW,EAAEL,SAAS,CAAC;AAErD,EAAA,oBACCM,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASP,IAAI,EAAA;AAAED,IAAAA,SAAS,EAAEI;AAAW,GAAA,CAAA,EACnCN,QACG,CAAC;AAER;;;;"}
@@ -1,28 +1,26 @@
1
1
  import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import * as React from 'react';
3
3
  import classnames from 'classnames';
4
- import { GUTTER_CLASS } from '../constants.js';
5
4
 
6
- var _excluded = ["align", "children", "className", "gutter", "justify"];
5
+ var _excluded = ["align", "children", "className", "justify"];
7
6
  /**
8
- * MrlRow React component. Creates a grid row.
7
+ * MrlRow React component.
9
8
  * @param props - component props
10
9
  * @returns a MrlRow React component.
11
10
  */
12
11
  function MrlRow(_ref) {
13
12
  var align = _ref.align,
14
13
  children = _ref.children,
15
- className = _ref.className,
16
- _ref$gutter = _ref.gutter,
17
- gutter = _ref$gutter === void 0 ? 1 : _ref$gutter,
14
+ _ref$className = _ref.className,
15
+ className = _ref$className === void 0 ? '' : _ref$className,
18
16
  justify = _ref.justify,
19
17
  rest = _objectWithoutProperties(_ref, _excluded);
20
- var alignClass = align && "align-items-".concat(align);
18
+ var alignClass = align ? "align-items-".concat(align) : '';
21
19
  var justifyClass = justify && "justify-content-".concat(justify);
22
- var allClasses = classnames('row', 'MrlRow', className, alignClass, justifyClass, GUTTER_CLASS[gutter]);
23
- return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
20
+ var allClasses = classnames('row', className, alignClass, justifyClass);
21
+ return /*#__PURE__*/React.createElement("div", _extends({
24
22
  className: allClasses
25
- }), children);
23
+ }, rest), children);
26
24
  }
27
25
 
28
26
  export { MrlRow };
@@ -1 +1 @@
1
- {"version":3,"file":"MrlRow.js","sources":["../../../../../src/components/grid/MrlRow/MrlRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport {\n\tAlignOptions,\n\tGridBaseProps,\n\tGUTTER_CLASS,\n\tGutterSizes,\n\tJustifyOptions\n} from '../constants';\n\nexport interface MrlRowProps extends GridBaseProps {\n\t/**\n\t * Flex alignment of the children within the component.\n\t */\n\talign?: AlignOptions;\n\n\t/**\n\t * Gutter size for columns within the row.\n\t *\n\t * @default 1\n\t */\n\tgutter?: GutterSizes;\n\n\t/**\n\t * Justify content of the children within the component.\n\t */\n\tjustify?: JustifyOptions;\n}\n\n/**\n * MrlRow React component. Creates a grid row.\n * @param props - component props\n * @returns a MrlRow React component.\n */\nexport function MrlRow({\n\talign,\n\tchildren,\n\tclassName,\n\tgutter = 1,\n\tjustify,\n\t...rest\n}: MrlRowProps): JSX.Element {\n\tconst alignClass = align && `align-items-${align}`;\n\tconst justifyClass = justify && `justify-content-${justify}`;\n\n\tconst allClasses = classnames(\n\t\t'row',\n\t\t'MrlRow',\n\t\tclassName,\n\t\talignClass,\n\t\tjustifyClass,\n\t\tGUTTER_CLASS[gutter]\n\t);\n\n\treturn (\n\t\t<div {...rest} className={allClasses}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["MrlRow","_ref","align","children","className","_ref$gutter","gutter","justify","rest","_objectWithoutProperties","_excluded","alignClass","concat","justifyClass","allClasses","classnames","GUTTER_CLASS","React","createElement","_extends"],"mappings":";;;;;;AA6BA;AACA;AACA;AACA;AACA;AACO,SAASA,MAAMA,CAAAC,IAAA,EAOO;AAAA,EAAA,IAN5BC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,SAAS,GAAAH,IAAA,CAATG,SAAS;IAAAC,WAAA,GAAAJ,IAAA,CACTK,MAAM;AAANA,IAAAA,MAAM,GAAAD,WAAA,KAAA,MAAA,GAAG,CAAC,GAAAA,WAAA;IACVE,OAAO,GAAAN,IAAA,CAAPM,OAAO;AACJC,IAAAA,IAAI,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA,CAAA;AAEP,EAAA,IAAMC,UAAU,GAAGT,KAAK,mBAAAU,MAAA,CAAmBV,KAAK,CAAE;AAClD,EAAA,IAAMW,YAAY,GAAGN,OAAO,uBAAAK,MAAA,CAAuBL,OAAO,CAAE;AAE5D,EAAA,IAAMO,UAAU,GAAGC,UAAU,CAC5B,KAAK,EACL,QAAQ,EACRX,SAAS,EACTO,UAAU,EACVE,YAAY,EACZG,YAAY,CAACV,MAAM,CACpB,CAAC;AAED,EAAA,oBACCW,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASX,IAAI,EAAA;AAAEJ,IAAAA,SAAS,EAAEU;AAAW,GAAA,CAAA,EACnCX,QACG,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlRow.js","sources":["../../../../../src/components/grid/MrlRow/MrlRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { LayoutComponent } from '../../layout/constants';\nimport { AlignOptions, GutterSizes, JustifyOptions } from '../constants';\n\ninterface MrlRow extends LayoutComponent {\n\t/**\n\t * Flex alignment of the children within the component.\n\t */\n\talign?: AlignOptions;\n\n\t/**\n\t * Gutter size for columns within the row\n\t */\n\tgutter?: GutterSizes;\n\n\t/**\n\t * Justify content of the children within the component.\n\t */\n\tjustify?: JustifyOptions;\n}\n\n/**\n * MrlRow React component.\n * @param props - component props\n * @returns a MrlRow React component.\n */\nexport function MrlRow({ align, children, className = '', justify, ...rest }: MrlRow): JSX.Element {\n\tconst alignClass = align ? `align-items-${align}` : '';\n\tconst justifyClass = justify && `justify-content-${justify}`;\n\n\tconst allClasses = classnames('row', className, alignClass, justifyClass);\n\n\treturn (\n\t\t<div className={allClasses} {...rest}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n"],"names":["MrlRow","_ref","align","children","_ref$className","className","justify","rest","_objectWithoutProperties","_excluded","alignClass","concat","justifyClass","allClasses","classnames","React","createElement","_extends"],"mappings":";;;;;AAsBA;AACA;AACA;AACA;AACA;AACO,SAASA,MAAMA,CAAAC,IAAA,EAA6E;AAAA,EAAA,IAA1EC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAAC,cAAA,GAAAH,IAAA,CAAEI,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IAAEE,OAAO,GAAAL,IAAA,CAAPK,OAAO;AAAKC,IAAAA,IAAI,GAAAC,wBAAA,CAAAP,IAAA,EAAAQ,SAAA,CAAA;EACzE,IAAMC,UAAU,GAAGR,KAAK,GAAA,cAAA,CAAAS,MAAA,CAAkBT,KAAK,IAAK,EAAE;AACtD,EAAA,IAAMU,YAAY,GAAGN,OAAO,uBAAAK,MAAA,CAAuBL,OAAO,CAAE;EAE5D,IAAMO,UAAU,GAAGC,UAAU,CAAC,KAAK,EAAET,SAAS,EAAEK,UAAU,EAAEE,YAAY,CAAC;AAEzE,EAAA,oBACCG,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,CAAA;AAAKZ,IAAAA,SAAS,EAAEQ;GAAW,EAAKN,IAAI,CAAA,EAClCJ,QACG,CAAC;AAER;;;;"}
@@ -2,15 +2,20 @@
2
2
  * Alignment & justification options for grid containers
3
3
  */
4
4
 
5
+ /**
6
+ * Available grid sizes
7
+ */
8
+ var GridSizes = ['col', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
9
+
5
10
  /**
6
11
  * Number of columns that will be span on the grid.
7
12
  */
8
13
 
9
14
  /**
10
- * The grid classes that can be configured per breakpoint.
15
+ * The type of classes that can be configured based on the bootstrap API.
11
16
  * Current supported:
12
17
  * - columns "col-<size>-<number>"
13
- * - offsets "offset-<size>-<number>"
18
+ * - offsets "offset-<size>-<number>""
14
19
  */
15
20
 
16
21
  /**
@@ -27,32 +32,9 @@
27
32
  * Options to configure the number of columns to span on different screen sizes.
28
33
  */
29
34
 
30
- /**
31
- * Breakpoint keys in ascending order. Drives both class generation and the
32
- * filtering that keeps grid props from reaching the DOM.
33
- */
34
- var GRID_SIZE_KEYS = ['col', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
35
-
36
35
  /**
37
36
  * Available gutter sizes for customizing the grid
38
37
  */
39
38
 
40
- /**
41
- * Gutter size to modifier class. `1` is the default gutter declared on `:root`,
42
- * so it needs no class.
43
- */
44
- var GUTTER_CLASS = {
45
- 0: 'MrlRow-gutter--none',
46
- 1: undefined,
47
- 2: 'MrlRow-gutter--double'
48
- };
49
-
50
- /**
51
- * Shared props for the grid components. `role` is intentionally omitted: these
52
- * are generic layout wrappers, and a `role="grid"` would promise interactive
53
- * grid keyboard semantics that they do not implement. Page landmarks belong to
54
- * the layout components (MrlMain, MrlPage).
55
- */
56
-
57
- export { GRID_SIZE_KEYS, GUTTER_CLASS };
39
+ export { GridSizes };
58
40
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sources":["../../../../src/components/grid/constants.ts"],"sourcesContent":["import { DataQa } from '../../utils/dataQa';\n\n/**\n * Alignment & justification options for grid containers\n */\nexport type AlignOptions = 'start' | 'center' | 'end';\nexport type JustifyOptions = 'start' | 'center' | 'end' | 'between' | 'around';\n\n/**\n * Number of columns that will be span on the grid.\n */\nexport type NumCols = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\n/**\n * The grid classes that can be configured per breakpoint.\n * Current supported:\n * - columns \"col-<size>-<number>\"\n * - offsets \"offset-<size>-<number>\"\n */\ntype GridClass = 'col' | 'offset';\n\n/**\n * Interface of available class selectors based on GridClass\n *\n * Example interface:\n * {\n * col?: number,\n * offset?: number\n * }\n */\ntype GridClassConfig = {\n\t[key in GridClass]?: NumCols;\n};\n\n/**\n * Options to configure the number of columns to span on different screen sizes.\n */\ntype ColumnConfig = NumCols | 'auto' | GridClassConfig | undefined;\n\nexport interface GridColumns {\n\t/*\n\t * Columns that are the same from the smallest of devices to the largest.\n\t */\n\tcol?: ColumnConfig;\n\n\t/*\n\t * @deprecated Alias of `col`, kept for backwards compatibility.\n\t */\n\txs?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on small devices.\n\t */\n\tsm?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on medium devices.\n\t */\n\tmd?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on large devices.\n\t */\n\tlg?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on extra large devices.\n\t */\n\txl?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on extra extra large devices.\n\t */\n\txxl?: ColumnConfig;\n}\n\n/**\n * Breakpoint keys in ascending order. Drives both class generation and the\n * filtering that keeps grid props from reaching the DOM.\n */\nexport const GRID_SIZE_KEYS = ['col', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'] as const;\n\n/**\n * Available gutter sizes for customizing the grid\n */\nexport type GutterSizes = 0 | 1 | 2;\n\n/**\n * Gutter size to modifier class. `1` is the default gutter declared on `:root`,\n * so it needs no class.\n */\nexport const GUTTER_CLASS: Record<GutterSizes, string | undefined> = {\n\t0: 'MrlRow-gutter--none',\n\t1: undefined,\n\t2: 'MrlRow-gutter--double'\n};\n\n/**\n * Shared props for the grid components. `role` is intentionally omitted: these\n * are generic layout wrappers, and a `role=\"grid\"` would promise interactive\n * grid keyboard semantics that they do not implement. Page landmarks belong to\n * the layout components (MrlMain, MrlPage).\n */\nexport type GridBaseProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'role'> & DataQa;\n"],"names":["GRID_SIZE_KEYS","GUTTER_CLASS","undefined"],"mappings":"AAEA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;;AAwCA;AACA;AACA;AACA;IACaA,cAAc,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK;;AAEzE;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,IAAMC,YAAqD,GAAG;AACpE,EAAA,CAAC,EAAE,qBAAqB;AACxB,EAAA,CAAC,EAAEC,SAAS;AACZ,EAAA,CAAC,EAAE;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/components/grid/constants.ts"],"sourcesContent":["/**\n * Alignment & justification options for grid containers\n */\nexport type AlignOptions = 'start' | 'center' | 'end';\nexport type JustifyOptions = 'start' | 'center' | 'end' | 'between' | 'around';\n\n/**\n * Available grid sizes\n */\nexport const GridSizes = [\n\t'col',\n\t'xs',\n\t'sm',\n\t'md',\n\t'lg',\n\t'xl',\n\t'xxl'\n];\n\n/**\n * Number of columns that will be span on the grid.\n */\nexport type NumCols = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\n/**\n * The type of classes that can be configured based on the bootstrap API.\n * Current supported:\n * - columns \"col-<size>-<number>\"\n * - offsets \"offset-<size>-<number>\"\"\n */\ntype GridClass = 'col' | 'offset';\n\n/**\n * Interface of available class selectors based on GridClass\n *\n * Example interface:\n * {\n * col?: number,\n * offset?: number\n * }\n */\ntype GridClassConfig = {\n\t[key in GridClass]?: NumCols;\n};\n\n/**\n * Options to configure the number of columns to span on different screen sizes.\n */\ntype ColumnConfig = NumCols | 'auto' | GridClassConfig | undefined;\n\nexport interface GridColumns {\n\t/*\n\t * Columns that are the same from the smallest of devices to the largest.\n\t */\n\tcol?: ColumnConfig;\n\n\t/*\n\t * @deprecated xs maps to col. Bootstrap grid removed xs in favor of col.\n\t */\n\txs?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on small devices.\n\t */\n\tsm?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on medium devices.\n\t */\n\tmd?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on large devices.\n\t */\n\tlg?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on extra large devices.\n\t */\n\txl?: ColumnConfig;\n\n\t/*\n\t * The number of columns to span on extra extra large devices.\n\t */\n\txxl?: ColumnConfig;\n}\n\n/**\n * Available gutter sizes for customizing the grid\n */\nexport type GutterSizes = 0 | 1 | 2;\n"],"names":["GridSizes"],"mappings":"AAAA;AACA;AACA;;AAIA;AACA;AACA;IACaA,SAAS,GAAG,CACxB,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,KAAK;;AAGN;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;;AAwCA;AACA;AACA;;;;"}