@muraldevkit/ui-toolkit 4.75.0 → 4.76.1-dev-aD33.1

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 (75) hide show
  1. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js +404 -0
  2. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -0
  3. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.module.scss.js +8 -0
  4. package/dist/cjs/components/file-upload/MrlFileUpload/MrlFileUpload.module.scss.js.map +1 -0
  5. package/dist/cjs/components/file-upload/constants.js +48 -0
  6. package/dist/cjs/components/file-upload/constants.js.map +1 -0
  7. package/dist/cjs/components/file-upload/helpers.js +67 -0
  8. package/dist/cjs/components/file-upload/helpers.js.map +1 -0
  9. package/dist/cjs/components/grid/MrlCol/MrlCol.js +58 -55
  10. package/dist/cjs/components/grid/MrlCol/MrlCol.js.map +1 -1
  11. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js +4 -6
  12. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  13. package/dist/cjs/components/grid/MrlRow/MrlRow.js +10 -8
  14. package/dist/cjs/components/grid/MrlRow/MrlRow.js.map +1 -1
  15. package/dist/cjs/components/grid/constants.js +47 -9
  16. package/dist/cjs/components/grid/constants.js.map +1 -1
  17. package/dist/cjs/index.js +37 -31
  18. package/dist/cjs/index.js.map +1 -1
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/cjs/version.js.map +1 -1
  21. package/dist/components/file-upload/MrlFileUpload/MrlFileUpload.d.ts +154 -0
  22. package/dist/components/file-upload/MrlFileUpload/index.d.ts +1 -0
  23. package/dist/components/file-upload/constants.d.ts +35 -0
  24. package/dist/components/file-upload/helpers.d.ts +35 -0
  25. package/dist/components/file-upload/index.d.ts +2 -0
  26. package/dist/components/grid/MrlCol/MrlCol.d.ts +4 -6
  27. package/dist/components/grid/MrlCol/index.d.ts +1 -1
  28. package/dist/components/grid/MrlGrid/MrlGrid.d.ts +5 -5
  29. package/dist/components/grid/MrlGrid/index.d.ts +1 -1
  30. package/dist/components/grid/MrlRow/MrlRow.d.ts +7 -7
  31. package/dist/components/grid/MrlRow/index.d.ts +1 -1
  32. package/dist/components/grid/constants.d.ts +52 -12
  33. package/dist/components/grid/index.d.ts +1 -0
  34. package/dist/components/index.d.ts +1 -0
  35. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js +379 -0
  36. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.js.map +1 -0
  37. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.module.scss.js +4 -0
  38. package/dist/esm/components/file-upload/MrlFileUpload/MrlFileUpload.module.scss.js.map +1 -0
  39. package/dist/esm/components/file-upload/constants.js +44 -0
  40. package/dist/esm/components/file-upload/constants.js.map +1 -0
  41. package/dist/esm/components/file-upload/helpers.js +62 -0
  42. package/dist/esm/components/file-upload/helpers.js.map +1 -0
  43. package/dist/esm/components/grid/MrlCol/MrlCol.js +59 -56
  44. package/dist/esm/components/grid/MrlCol/MrlCol.js.map +1 -1
  45. package/dist/esm/components/grid/MrlGrid/MrlGrid.js +4 -6
  46. package/dist/esm/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  47. package/dist/esm/components/grid/MrlRow/MrlRow.js +10 -8
  48. package/dist/esm/components/grid/MrlRow/MrlRow.js.map +1 -1
  49. package/dist/esm/components/grid/constants.js +46 -9
  50. package/dist/esm/components/grid/constants.js.map +1 -1
  51. package/dist/esm/index.js +2 -0
  52. package/dist/esm/index.js.map +1 -1
  53. package/dist/esm/version.js +1 -1
  54. package/dist/esm/version.js.map +1 -1
  55. package/dist/styles/MrlFileUpload/module.scss +136 -0
  56. package/dist/styles/MrlSidebar/module.scss +2 -2
  57. package/dist/styles/file-upload/variables.scss +13 -0
  58. package/dist/styles/grid/global.scss +97 -2
  59. package/dist/styles.css +2 -7
  60. package/dist/types/components/file-upload/MrlFileUpload/MrlFileUpload.d.ts +154 -0
  61. package/dist/types/components/file-upload/MrlFileUpload/index.d.ts +1 -0
  62. package/dist/types/components/file-upload/constants.d.ts +35 -0
  63. package/dist/types/components/file-upload/helpers.d.ts +35 -0
  64. package/dist/types/components/file-upload/index.d.ts +2 -0
  65. package/dist/types/components/grid/MrlCol/MrlCol.d.ts +4 -6
  66. package/dist/types/components/grid/MrlCol/index.d.ts +1 -1
  67. package/dist/types/components/grid/MrlGrid/MrlGrid.d.ts +5 -5
  68. package/dist/types/components/grid/MrlGrid/index.d.ts +1 -1
  69. package/dist/types/components/grid/MrlRow/MrlRow.d.ts +7 -7
  70. package/dist/types/components/grid/MrlRow/index.d.ts +1 -1
  71. package/dist/types/components/grid/constants.d.ts +52 -12
  72. package/dist/types/components/grid/index.d.ts +1 -0
  73. package/dist/types/components/index.d.ts +1 -0
  74. package/package.json +1 -1
  75. package/dist/styles/grid/variables.scss +0 -26
@@ -1,41 +1,57 @@
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 { GridSizes } from '../constants.js';
4
+ import { GRID_SIZE_KEYS } from '../constants.js';
5
5
 
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);
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);
16
+
17
+ /*
18
+ * There is no `col-0` class, so a zero span produces nothing. `ColSpan` already
19
+ * rules it out, but this is a published component and JavaScript consumers are
20
+ * not held to that — hence a runtime check rather than a type-level one.
21
+ */
22
+ var isZeroSpan = val => val === 0;
8
23
 
9
24
  /**
10
25
  * Creates the size classes for the grid.
26
+ *
27
+ * `offset: 0` is kept, because `offset-<size>-0` is how a breakpoint cancels an
28
+ * offset set on a smaller one. `col: 0` is dropped, because there is no
29
+ * `col-0` class — a column always spans at least one track.
11
30
  * @param props - component props
12
- * @returns an array of size classes based on bootstrap grid API
31
+ * @returns an array of size classes
13
32
  */
14
33
  var createSizeClasses = props => {
15
34
  var classes = [];
16
- for (var size of GridSizes) {
35
+ for (var size of GRID_SIZE_KEYS) {
17
36
  // get the value based on the prop key from the component props
18
37
  var value = props[size];
38
+ if (value === undefined) continue;
19
39
 
20
- // create the size class based on the value using the bootstrap grid API
21
- if (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));
25
- continue;
26
- }
40
+ // if the value is a number or `auto`, then it is a column size
41
+ if (typeof value === 'number' || typeof value === 'string') {
42
+ if (!isZeroSpan(value)) classes.push(getGridClass(size, 'col', value));
43
+ continue;
44
+ }
27
45
 
28
- // if the value is an object, then we need to compose multiple classes
29
- // based on the keyvalue pairings
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
- }
38
- }
46
+ // if the value is an object, then we need to compose multiple classes
47
+ // based on the keyvalue pairings
48
+ for (var _ref3 of Object.entries(value)) {
49
+ var _ref2 = _slicedToArray(_ref3, 2);
50
+ var key = _ref2[0];
51
+ var val = _ref2[1];
52
+ if (val === undefined) continue;
53
+ if (key === 'col' && isZeroSpan(val)) continue;
54
+ classes.push(getGridClass(size, key, val));
39
55
  }
40
56
  }
41
57
  if (classes.length === 0) classes.push('col');
@@ -43,44 +59,31 @@ var createSizeClasses = props => {
43
59
  };
44
60
 
45
61
  /**
46
- * Gets the grid size props from the component props.
47
- * @param props - component props
48
- * @returns object of grid size props
62
+ * MrlCol React component. Creates a grid column.
63
+ * @param props - component props
64
+ * @returns a MrlCol React component.
49
65
  */
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 {
66
+ function MrlCol(_ref4) {
67
+ var children = _ref4.children,
68
+ className = _ref4.className,
69
+ col = _ref4.col,
70
+ lg = _ref4.lg,
71
+ md = _ref4.md,
72
+ sm = _ref4.sm,
73
+ xl = _ref4.xl,
74
+ xs = _ref4.xs,
75
+ xxl = _ref4.xxl,
76
+ rest = _objectWithoutProperties(_ref4, _excluded);
77
+ var columnClasses = createSizeClasses({
61
78
  col,
62
- xs,
63
- sm,
64
- md,
65
79
  lg,
80
+ md,
81
+ sm,
66
82
  xl,
83
+ xs,
67
84
  xxl
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);
85
+ });
86
+ var allClasses = classnames('MrlCol', className, columnClasses);
84
87
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
85
88
  className: allClasses
86
89
  }), 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 { 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":"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"}
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 * There is no `col-0` class, so a zero span produces nothing. `ColSpan` already\n * rules it out, but this is a published component and JavaScript consumers are\n * not held to that — hence a runtime check rather than a type-level one.\n */\nconst isZeroSpan = (val: unknown): boolean => val === 0;\n\n/**\n * Creates the size classes for the grid.\n *\n * `offset: 0` is kept, because `offset-<size>-0` is how a breakpoint cancels an\n * offset set on a smaller one. `col: 0` is dropped, because there is no\n * `col-0` class — a column always spans at least one track.\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\tif (value === undefined) continue;\n\n\t\t// if the value is a number or `auto`, then it is a column size\n\t\tif (typeof value === 'number' || typeof value === 'string') {\n\t\t\tif (!isZeroSpan(value)) classes.push(getGridClass(size, 'col', value));\n\t\t\tcontinue;\n\t\t}\n\n\t\t// if the value is an object, then we need to compose multiple classes\n\t\t// based on the keyvalue pairings\n\t\tfor (const [key, val] of Object.entries(value)) {\n\t\t\tif (val === undefined) continue;\n\t\t\tif (key === 'col' && isZeroSpan(val)) continue;\n\t\t\tclasses.push(getGridClass(size, key, val));\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('MrlCol', 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":["getGridClass","size","type","val","concat","isZeroSpan","createSizeClasses","props","classes","GRID_SIZE_KEYS","value","undefined","push","_ref3","Object","entries","_ref2","_slicedToArray","key","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,UAAU,GAAIF,GAAY,IAAcA,GAAG,KAAK,CAAC;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMG,iBAAiB,GAAIC,KAAkB,IAAe;EAC3D,IAAMC,OAAiB,GAAG,EAAE;AAE5B,EAAA,KAAK,IAAMP,IAAI,IAAIQ,cAAc,EAAE;AAClC;AACA,IAAA,IAAMC,KAAK,GAAGH,KAAK,CAACN,IAAI,CAAC;IAEzB,IAAIS,KAAK,KAAKC,SAAS,EAAE;;AAEzB;IACA,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;AAC3D,MAAA,IAAI,CAACL,UAAU,CAACK,KAAK,CAAC,EAAEF,OAAO,CAACI,IAAI,CAACZ,YAAY,CAACC,IAAI,EAAE,KAAK,EAAES,KAAK,CAAC,CAAC;AACtE,MAAA;AACD,IAAA;;AAEA;AACA;IACA,KAAA,IAAAG,KAAA,IAAyBC,MAAM,CAACC,OAAO,CAACL,KAAK,CAAC,EAAE;AAAA,MAAA,IAAAM,KAAA,GAAAC,cAAA,CAAAJ,KAAA,EAAA,CAAA,CAAA;MAAA,IAApCK,GAAG,GAAAF,KAAA,CAAA,CAAA,CAAA;MAAA,IAAEb,GAAG,GAAAa,KAAA,CAAA,CAAA,CAAA;MACnB,IAAIb,GAAG,KAAKQ,SAAS,EAAE;MACvB,IAAIO,GAAG,KAAK,KAAK,IAAIb,UAAU,CAACF,GAAG,CAAC,EAAE;MACtCK,OAAO,CAACI,IAAI,CAACZ,YAAY,CAACC,IAAI,EAAEiB,GAAG,EAAEf,GAAG,CAAC,CAAC;AAC3C,IAAA;AACD,EAAA;EAEA,IAAIK,OAAO,CAACW,MAAM,KAAK,CAAC,EAAEX,OAAO,CAACI,IAAI,CAAC,KAAK,CAAC;AAE7C,EAAA,OAAOJ,OAAO;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,SAASY,MAAMA,CAAAC,KAAA,EAWO;AAAA,EAAA,IAV5BC,QAAQ,GAAAD,KAAA,CAARC,QAAQ;IACRC,SAAS,GAAAF,KAAA,CAATE,SAAS;IACTC,GAAG,GAAAH,KAAA,CAAHG,GAAG;IACHC,EAAE,GAAAJ,KAAA,CAAFI,EAAE;IACFC,EAAE,GAAAL,KAAA,CAAFK,EAAE;IACFC,EAAE,GAAAN,KAAA,CAAFM,EAAE;IACFC,EAAE,GAAAP,KAAA,CAAFO,EAAE;IACFC,EAAE,GAAAR,KAAA,CAAFQ,EAAE;IACFC,GAAG,GAAAT,KAAA,CAAHS,GAAG;AACAC,IAAAA,IAAI,GAAAC,wBAAA,CAAAX,KAAA,EAAAY,SAAA,CAAA;EAEP,IAAMC,aAAa,GAAG5B,iBAAiB,CAAC;IAAEkB,GAAG;IAAEC,EAAE;IAAEC,EAAE;IAAEC,EAAE;IAAEC,EAAE;IAAEC,EAAE;AAAEC,IAAAA;AAAI,GAAC,CAAC;EACzE,IAAMK,UAAU,GAAGC,UAAU,CAAC,QAAQ,EAAEb,SAAS,EAAEW,aAAa,CAAC;AAEjE,EAAA,oBACCG,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAAC,QAAA,KAASR,IAAI,EAAA;AAAER,IAAAA,SAAS,EAAEY;AAAW,GAAA,CAAA,EACnCb,QACG,CAAC;AAER;;;;"}
@@ -3,18 +3,16 @@ import * as React from 'react';
3
3
  import classnames from 'classnames';
4
4
 
5
5
  var _excluded = ["children", "className"];
6
-
7
6
  /**
8
- * MrlCol React component.
7
+ * MrlGrid React component. Primary container of a grid.
9
8
  * @param props - component props
10
- * @returns a MrlCol React component.
9
+ * @returns a MrlGrid React component.
11
10
  */
12
11
  function MrlGrid(_ref) {
13
12
  var children = _ref.children,
14
- _ref$className = _ref.className,
15
- className = _ref$className === void 0 ? '' : _ref$className,
13
+ className = _ref.className,
16
14
  rest = _objectWithoutProperties(_ref, _excluded);
17
- var allClasses = classnames('container', className);
15
+ var allClasses = classnames('container', 'MrlGrid', className);
18
16
  return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
19
17
  className: allClasses
20
18
  }), 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 { 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
+ {"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.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":";;;;;AAOA;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,26 +1,28 @@
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';
4
5
 
5
- var _excluded = ["align", "children", "className", "justify"];
6
+ var _excluded = ["align", "children", "className", "gutter", "justify"];
6
7
  /**
7
- * MrlRow React component.
8
+ * MrlRow React component. Creates a grid row.
8
9
  * @param props - component props
9
10
  * @returns a MrlRow React component.
10
11
  */
11
12
  function MrlRow(_ref) {
12
13
  var align = _ref.align,
13
14
  children = _ref.children,
14
- _ref$className = _ref.className,
15
- className = _ref$className === void 0 ? '' : _ref$className,
15
+ className = _ref.className,
16
+ _ref$gutter = _ref.gutter,
17
+ gutter = _ref$gutter === void 0 ? 1 : _ref$gutter,
16
18
  justify = _ref.justify,
17
19
  rest = _objectWithoutProperties(_ref, _excluded);
18
- var alignClass = align ? "align-items-".concat(align) : '';
20
+ var alignClass = align && "align-items-".concat(align);
19
21
  var justifyClass = justify && "justify-content-".concat(justify);
20
- var allClasses = classnames('row', className, alignClass, justifyClass);
21
- return /*#__PURE__*/React.createElement("div", _extends({
22
+ var allClasses = classnames('row', 'MrlRow', className, alignClass, justifyClass, GUTTER_CLASS[gutter]);
23
+ return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
22
24
  className: allClasses
23
- }, rest), children);
25
+ }), children);
24
26
  }
25
27
 
26
28
  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 { 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;;;;"}
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;;;;"}
@@ -3,23 +3,22 @@
3
3
  */
4
4
 
5
5
  /**
6
- * Available grid sizes
6
+ * Number of columns a `col` can span. There is no `col-0` class — a column
7
+ * always occupies at least one of the twelve tracks.
7
8
  */
8
- var GridSizes = ['col', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
9
9
 
10
10
  /**
11
- * Number of columns that will be span on the grid.
11
+ * Number of columns an `offset` can skip. `0` is meaningful here: it is how a
12
+ * larger breakpoint cancels an offset inherited from a smaller one.
12
13
  */
13
14
 
14
15
  /**
15
- * The type of classes that can be configured based on the bootstrap API.
16
- * Current supported:
17
- * - columns "col-<size>-<number>"
18
- * - offsets "offset-<size>-<number>""
16
+ * @deprecated Use `ColSpan` for spans or `OffsetSpan` for offsets. This union
17
+ * allowed `col={0}`, which never produced a class.
19
18
  */
20
19
 
21
20
  /**
22
- * Interface of available class selectors based on GridClass
21
+ * Interface of available class selectors per breakpoint.
23
22
  *
24
23
  * Example interface:
25
24
  * {
@@ -32,9 +31,47 @@ var GridSizes = ['col', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
32
31
  * Options to configure the number of columns to span on different screen sizes.
33
32
  */
34
33
 
34
+ /**
35
+ * Breakpoint keys in ascending order. Drives both class generation and the
36
+ * filtering that keeps grid props from reaching the DOM.
37
+ */
38
+ var GRID_SIZE_KEYS = ['col', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
39
+
35
40
  /**
36
41
  * Available gutter sizes for customizing the grid
37
42
  */
38
43
 
39
- export { GridSizes };
44
+ /**
45
+ * Gutter size to modifier class. `1` is the default declared on `.row`, so it
46
+ * needs no class.
47
+ */
48
+ var GUTTER_CLASS = {
49
+ 0: 'MrlRow-gutter--none',
50
+ 1: undefined,
51
+ 2: 'MrlRow-gutter--double'
52
+ };
53
+
54
+ /**
55
+ * Roles a generic layout wrapper may safely carry.
56
+ *
57
+ * Composite widget roles (`grid`, `row`, `gridcell`, `listbox`, `tablist`, …)
58
+ * are deliberately excluded: they promise an APG keyboard contract — roving
59
+ * tabindex or `aria-activedescendant`, arrow-key navigation, selection state —
60
+ * that these divs do not implement. The roles below are structural only and
61
+ * carry no interaction contract, so they are safe to forward.
62
+ *
63
+ * `list`/`listitem` in particular is how a row of columns is announced as
64
+ * "list, N items", and is the standard workaround for Safari/VoiceOver
65
+ * dropping implicit list semantics. `region` needs an accessible name to be
66
+ * exposed as a landmark; the type cannot enforce that.
67
+ *
68
+ * Page landmarks belong to the layout components (MrlMain, MrlPage).
69
+ */
70
+
71
+ /**
72
+ * Shared props for the grid components: every `div` attribute, with `role`
73
+ * narrowed to {@link SafeLayoutRole}.
74
+ */
75
+
76
+ export { GRID_SIZE_KEYS, GUTTER_CLASS };
40
77
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
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;;;;"}
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 a `col` can span. There is no `col-0` class — a column\n * always occupies at least one of the twelve tracks.\n */\nexport type ColSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\n/**\n * Number of columns an `offset` can skip. `0` is meaningful here: it is how a\n * larger breakpoint cancels an offset inherited from a smaller one.\n */\nexport type OffsetSpan = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;\n\n/**\n * @deprecated Use `ColSpan` for spans or `OffsetSpan` for offsets. This union\n * allowed `col={0}`, which never produced a class.\n */\nexport type NumCols = 0 | ColSpan;\n\n/**\n * Interface of available class selectors per breakpoint.\n *\n * Example interface:\n * {\n * col?: number,\n * offset?: number\n * }\n */\ntype GridClassConfig = {\n\tcol?: ColSpan;\n\toffset?: OffsetSpan;\n};\n\n/**\n * Options to configure the number of columns to span on different screen sizes.\n */\ntype ColumnConfig = ColSpan | '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. It resolves\n\t * to the same un-prefixed tier, so passing both `col` and `xs` emits two\n\t * competing classes and the larger span wins on CSS source order rather\n\t * than the one you wrote last. Pass only one.\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 declared on `.row`, so it\n * 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 * Roles a generic layout wrapper may safely carry.\n *\n * Composite widget roles (`grid`, `row`, `gridcell`, `listbox`, `tablist`, …)\n * are deliberately excluded: they promise an APG keyboard contract — roving\n * tabindex or `aria-activedescendant`, arrow-key navigation, selection state —\n * that these divs do not implement. The roles below are structural only and\n * carry no interaction contract, so they are safe to forward.\n *\n * `list`/`listitem` in particular is how a row of columns is announced as\n * \"list, N items\", and is the standard workaround for Safari/VoiceOver\n * dropping implicit list semantics. `region` needs an accessible name to be\n * exposed as a landmark; the type cannot enforce that.\n *\n * Page landmarks belong to the layout components (MrlMain, MrlPage).\n */\nexport type SafeLayoutRole = 'group' | 'list' | 'listitem' | 'none' | 'presentation' | 'region';\n\n/**\n * Shared props for the grid components: every `div` attribute, with `role`\n * narrowed to {@link SafeLayoutRole}.\n */\nexport type GridBaseProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'role'> &\n\tDataQa & {\n\t\t/**\n\t\t * Structural role for the wrapper. Composite widget roles are not\n\t\t * accepted — see {@link SafeLayoutRole}.\n\t\t */\n\t\trole?: SafeLayoutRole;\n\t};\n"],"names":["GRID_SIZE_KEYS","GUTTER_CLASS","undefined"],"mappings":"AAEA;AACA;AACA;;AAIA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA;AACA;AACA;;AA2CA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;;;"}
package/dist/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { CREATABLE_SELECT_CLASS_NAME_PREFIX, CREATABLE_SELECT_MENU_LIST_CLASS_NAME, MrlCreatableSelect } from './components/form/select/MrlCreatableSelect/MrlCreatableSelect.js';
2
+ export { DEFAULT_ERROR_MESSAGE, allowedFileUploadValues, fileUploadDefaults } from './components/file-upload/constants.js';
2
3
  export { DEFAULT_FEEDBACK_TIME, DEFAULT_RESET_TIME, MrlProcessingButton } from './components/button/MrlProcessingButton/MrlProcessingButton.js';
3
4
  export { FOCUSABLE_ELEMENTS_SELECTOR, getElementWithAutofocus, getFocusableElementsInsideElement, trapFocus } from './utils/trapFocus/index.js';
4
5
  export { MRL_PORTAL_ID, MrlPortal } from './components/portal/MrlPortal.js';
@@ -31,6 +32,7 @@ export { MrlEmptyLarge } from './components/empty/large/MrlEmptyLarge.js';
31
32
  export { MrlErrorBoundary } from './components/error-boundary/MrlErrorBoundary.js';
32
33
  export { MrlErrorPage } from './components/layout/error-page/MrlErrorPage/MrlErrorPage.js';
33
34
  export { MrlFieldset } from './components/form/fieldset/MrlFieldset/MrlFieldset.js';
35
+ export { MrlFileUpload } from './components/file-upload/MrlFileUpload/MrlFileUpload.js';
34
36
  export { MrlFilter } from './components/filter/MrlFilter/MrlFilter.js';
35
37
  export { MrlFilterContextProvider, useMrlFilterContext } from './components/filter/MrlFilterContext/MrlFilterContext.js';
36
38
  export { MrlFilterItem } from './components/filter/MrlFilterItem/MrlFilterItem.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- var TOOLKIT_VERSION = "4.75.0";
1
+ var TOOLKIT_VERSION = "4.76.1-dev-aD33.1";
2
2
 
3
3
  export { TOOLKIT_VERSION };
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.75.0\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.76.1-dev-aD33.1\";"],"names":["TOOLKIT_VERSION"],"mappings":"AAAO,IAAMA,eAAe,GAAG;;;;"}
@@ -0,0 +1,136 @@
1
+
2
+ @use '../file-upload.variables.scss';
3
+ .MrlFileUpload {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: var(--mrl-file-upload-gap);
7
+ max-width: 100%;
8
+ min-width: 0;
9
+ width: var(--mrl-file-upload-width);
10
+ }
11
+ .MrlFileUpload-label {
12
+ color: var(--mrl-color-text-label);
13
+ font-family: var(--mrl-heading-font);
14
+ font-size: var(--mrl-font-size-03);
15
+ font-weight: var(--mrl-font-weight-02);
16
+ line-height: var(--mrl-line-height-03);
17
+ padding-inline: var(--mrl-spacing-01);
18
+ }
19
+ .MrlFileUpload-zone {
20
+ align-items: center;
21
+ background-color: var(--mrl-file-upload-background);
22
+ border: var(--mrl-file-upload-border-width) var(--mrl-file-upload-border-style)
23
+ var(--mrl-file-upload-border-color);
24
+ border-radius: var(--mrl-file-upload-radius);
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: var(--mrl-space-stack-related);
28
+ justify-content: center;
29
+ min-height: var(--mrl-file-upload-min-height);
30
+ padding: var(--mrl-space-inset-control);
31
+ text-align: center;
32
+ transition:
33
+ border-color var(--mrl-duration-02) ease,
34
+ background-color var(--mrl-duration-02) ease;
35
+ &:hover {
36
+ --mrl-file-upload-background: var(--mrl-color-background-emph-hover);
37
+ --mrl-file-upload-border-color: var(--mrl-color-line-hover);
38
+ }
39
+ }
40
+ .MrlFileUpload-zone--dragging {
41
+ &,
42
+ &:hover {
43
+ --mrl-file-upload-background: var(--mrl-color-background-decorative);
44
+ --mrl-file-upload-border-color: var(--mrl-color-accent);
45
+ --mrl-file-upload-border-width: var(--mrl-line-width-control);
46
+ }
47
+ }
48
+ .MrlFileUpload-zone--uploading {
49
+ &:hover {
50
+ --mrl-file-upload-background: var(--mrl-color-background-secondary);
51
+ --mrl-file-upload-border-color: var(--mrl-color-line);
52
+ }
53
+ }
54
+ .MrlFileUpload-zone--complete {
55
+ &,
56
+ &:hover {
57
+ --mrl-file-upload-border-color: rgba(var(--mrl-status-success), 1);
58
+ --mrl-file-upload-border-style: solid;
59
+ }
60
+ }
61
+ .MrlFileUpload-zone--error {
62
+ &,
63
+ &:hover {
64
+ --mrl-file-upload-background: var(--mrl-color-background-error-light);
65
+ --mrl-file-upload-border-color: rgba(var(--mrl-status-error), 1);
66
+ --mrl-file-upload-border-style: solid;
67
+ }
68
+ }
69
+ .MrlFileUpload-zone--disabled {
70
+ --mrl-file-upload-border-color: var(--mrl-color-line-disabled);
71
+ pointer-events: none;
72
+ p {
73
+ color: var(--mrl-color-text-disabled);
74
+ }
75
+ }
76
+ .MrlFileUpload-content,
77
+ .MrlFileUpload-preloader {
78
+ align-items: center;
79
+ display: flex;
80
+ flex-direction: column;
81
+ width: 100%;
82
+ }
83
+ .MrlFileUpload-preloader {
84
+ gap: var(--mrl-spacing-02);
85
+ }
86
+ .MrlFileUpload-heading {
87
+ color: var(--mrl-color-text);
88
+ font-family: var(--mrl-heading-font);
89
+ font-size: var(--mrl-font-size-03);
90
+ font-weight: var(--mrl-font-weight-04);
91
+ line-height: var(--mrl-line-height-03);
92
+ margin: 0;
93
+ }
94
+ .MrlFileUpload-heading--accent {
95
+ color: var(--mrl-color-accent);
96
+ }
97
+ .MrlFileUpload-heading--strong {
98
+ color: var(--mrl-color-text-heading);
99
+ }
100
+ .MrlFileUpload-icon {
101
+ display: block;
102
+ height: var(--mrl-spacing-08);
103
+ width: var(--mrl-spacing-08);
104
+ svg {
105
+ height: 100%;
106
+ width: 100%;
107
+ }
108
+ }
109
+ .MrlFileUpload-icon--accent {
110
+ color: var(--mrl-color-accent);
111
+ fill: var(--mrl-color-accent);
112
+ }
113
+ .MrlFileUpload-icon--success {
114
+ color: rgba(var(--mrl-status-success), 1);
115
+ fill: rgba(var(--mrl-status-success), 1);
116
+ }
117
+ .MrlFileUpload-progress {
118
+ max-width: 100%;
119
+ padding-block: var(--mrl-spacing-04) var(--mrl-spacing-03);
120
+ width: var(--mrl-file-upload-progress-width);
121
+ }
122
+ .MrlFileUpload-input {
123
+ border: 0;
124
+ clip-path: inset(50%);
125
+ height: 1px;
126
+ overflow: hidden;
127
+ padding: 0;
128
+ position: absolute;
129
+ white-space: nowrap;
130
+ width: 1px;
131
+ }
132
+ @media (prefers-reduced-motion: reduce) {
133
+ .MrlFileUpload-zone {
134
+ transition: none;
135
+ }
136
+ }
@@ -1,6 +1,5 @@
1
1
 
2
2
  @use '../layout.variables' as *;
3
- @use '../../grid/grid.variables' as *;
4
3
  .MrlSidebar {
5
4
  align-items: stretch;
6
5
  margin-right: var(--mrl-spacing-05);
@@ -16,7 +15,8 @@
16
15
  padding: 4.5rem var(--mrl-space-inset-large) var(--mrl-space-inset-large);
17
16
  position: fixed;
18
17
  top: var(--mrl-spacing-03);
19
- transition: opacity var(--mrl-duration-03) var(--mrl-timing-m1),
18
+ transition:
19
+ opacity var(--mrl-duration-03) var(--mrl-timing-m1),
20
20
  left var(--mrl-duration-03) var(--mrl-timing-m1);
21
21
  z-index: 2;
22
22
  @media (prefers-reduced-motion: reduce) {
@@ -0,0 +1,13 @@
1
+
2
+ :root,
3
+ .MrlFileUpload {
4
+ --mrl-file-upload-background: var(--mrl-color-background-secondary);
5
+ --mrl-file-upload-border-color: var(--mrl-color-line);
6
+ --mrl-file-upload-border-style: dashed;
7
+ --mrl-file-upload-border-width: var(--mrl-line-width-border-fine);
8
+ --mrl-file-upload-gap: var(--mrl-spacing-02);
9
+ --mrl-file-upload-min-height: 10rem;
10
+ --mrl-file-upload-progress-width: 11rem;
11
+ --mrl-file-upload-radius: var(--mrl-border-radius-content-large);
12
+ --mrl-file-upload-width: 100%;
13
+ }