@muraldevkit/ui-toolkit 4.81.0 → 4.82.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 (33) hide show
  1. package/dist/cjs/components/grid/MrlCol/MrlCol.js +61 -55
  2. package/dist/cjs/components/grid/MrlCol/MrlCol.js.map +1 -1
  3. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js +8 -5
  4. package/dist/cjs/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  5. package/dist/cjs/components/grid/MrlRow/MrlRow.js +10 -8
  6. package/dist/cjs/components/grid/MrlRow/MrlRow.js.map +1 -1
  7. package/dist/cjs/components/grid/constants.js +47 -9
  8. package/dist/cjs/components/grid/constants.js.map +1 -1
  9. package/dist/cjs/version.js +1 -1
  10. package/dist/cjs/version.js.map +1 -1
  11. package/dist/esm/components/grid/MrlCol/MrlCol.js +62 -56
  12. package/dist/esm/components/grid/MrlCol/MrlCol.js.map +1 -1
  13. package/dist/esm/components/grid/MrlGrid/MrlGrid.js +8 -5
  14. package/dist/esm/components/grid/MrlGrid/MrlGrid.js.map +1 -1
  15. package/dist/esm/components/grid/MrlRow/MrlRow.js +10 -8
  16. package/dist/esm/components/grid/MrlRow/MrlRow.js.map +1 -1
  17. package/dist/esm/components/grid/constants.js +46 -9
  18. package/dist/esm/components/grid/constants.js.map +1 -1
  19. package/dist/esm/version.js +1 -1
  20. package/dist/esm/version.js.map +1 -1
  21. package/dist/styles/MrlSidebar/module.scss +2 -2
  22. package/dist/styles/grid/global.scss +97 -2
  23. package/dist/styles.css +1 -7
  24. package/dist/types/components/grid/MrlCol/MrlCol.d.ts +4 -6
  25. package/dist/types/components/grid/MrlCol/index.d.ts +1 -1
  26. package/dist/types/components/grid/MrlGrid/MrlGrid.d.ts +9 -4
  27. package/dist/types/components/grid/MrlGrid/index.d.ts +1 -1
  28. package/dist/types/components/grid/MrlRow/MrlRow.d.ts +7 -7
  29. package/dist/types/components/grid/MrlRow/index.d.ts +1 -1
  30. package/dist/types/components/grid/constants.d.ts +56 -13
  31. package/dist/types/components/grid/index.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/dist/styles/grid/variables.scss +0 -26
@@ -1,25 +1,26 @@
1
+ import { DataQa } from '../../utils/dataQa';
1
2
  /**
2
3
  * Alignment & justification options for grid containers
3
4
  */
4
5
  export type AlignOptions = 'start' | 'center' | 'end';
5
6
  export type JustifyOptions = 'start' | 'center' | 'end' | 'between' | 'around';
6
7
  /**
7
- * Available grid sizes
8
+ * Number of columns a `col` can span. There is no `col-0` class — a column
9
+ * always occupies at least one of the twelve tracks.
8
10
  */
9
- export declare const GridSizes: string[];
11
+ export type ColSpan = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
12
  /**
11
- * Number of columns that will be span on the grid.
13
+ * Number of columns an `offset` can skip. `0` is meaningful here: it is how a
14
+ * larger breakpoint cancels an offset inherited from a smaller one.
12
15
  */
13
- export type NumCols = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
16
+ export type OffsetSpan = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
14
17
  /**
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>""
18
+ * @deprecated Use `ColSpan` for spans or `OffsetSpan` for offsets. This union
19
+ * allowed `col={0}`, which never produced a class.
19
20
  */
20
- type GridClass = 'col' | 'offset';
21
+ export type NumCols = 0 | ColSpan;
21
22
  /**
22
- * Interface of available class selectors based on GridClass
23
+ * Interface of available class selectors per breakpoint.
23
24
  *
24
25
  * Example interface:
25
26
  * {
@@ -28,19 +29,23 @@ type GridClass = 'col' | 'offset';
28
29
  * }
29
30
  */
30
31
  type GridClassConfig = {
31
- [key in GridClass]?: NumCols;
32
+ col?: ColSpan;
33
+ offset?: OffsetSpan;
32
34
  };
33
35
  /**
34
36
  * Options to configure the number of columns to span on different screen sizes.
35
37
  */
36
- type ColumnConfig = NumCols | 'auto' | GridClassConfig | undefined;
38
+ type ColumnConfig = ColSpan | 'auto' | GridClassConfig | undefined;
37
39
  export interface GridColumns {
38
40
  /**
39
41
  * Columns that are the same from the smallest of devices to the largest.
40
42
  */
41
43
  col?: ColumnConfig;
42
44
  /**
43
- * @deprecated xs maps to col. Bootstrap grid removed xs in favor of col.
45
+ * @deprecated Alias of `col`, kept for backwards compatibility. It resolves
46
+ * to the same un-prefixed tier, so passing both `col` and `xs` emits two
47
+ * competing classes and the larger span wins on CSS source order rather
48
+ * than the one you wrote last. Pass only one.
44
49
  */
45
50
  xs?: ColumnConfig;
46
51
  /**
@@ -64,8 +69,46 @@ export interface GridColumns {
64
69
  */
65
70
  xxl?: ColumnConfig;
66
71
  }
72
+ /**
73
+ * Breakpoint keys in ascending order. Drives both class generation and the
74
+ * filtering that keeps grid props from reaching the DOM.
75
+ */
76
+ export declare const GRID_SIZE_KEYS: readonly ["col", "xs", "sm", "md", "lg", "xl", "xxl"];
67
77
  /**
68
78
  * Available gutter sizes for customizing the grid
69
79
  */
70
80
  export type GutterSizes = 0 | 1 | 2;
81
+ /**
82
+ * Gutter size to modifier class. `1` is the default declared on `.row`, so it
83
+ * needs no class.
84
+ */
85
+ export declare const GUTTER_CLASS: Record<GutterSizes, string | undefined>;
86
+ /**
87
+ * Roles a generic layout wrapper may safely carry.
88
+ *
89
+ * Composite widget roles (`grid`, `row`, `gridcell`, `listbox`, `tablist`, …)
90
+ * are deliberately excluded: they promise an APG keyboard contract — roving
91
+ * tabindex or `aria-activedescendant`, arrow-key navigation, selection state —
92
+ * that these divs do not implement. The roles below are structural only and
93
+ * carry no interaction contract, so they are safe to forward.
94
+ *
95
+ * `list`/`listitem` in particular is how a row of columns is announced as
96
+ * "list, N items", and is the standard workaround for Safari/VoiceOver
97
+ * dropping implicit list semantics. `region` needs an accessible name to be
98
+ * exposed as a landmark; the type cannot enforce that.
99
+ *
100
+ * Page landmarks belong to the layout components (MrlMain, MrlPage).
101
+ */
102
+ export type SafeLayoutRole = 'group' | 'list' | 'listitem' | 'none' | 'presentation' | 'region';
103
+ /**
104
+ * Shared props for the grid components: every `div` attribute, with `role`
105
+ * narrowed to {@link SafeLayoutRole}.
106
+ */
107
+ export type GridBaseProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'role'> & DataQa & {
108
+ /**
109
+ * Structural role for the wrapper. Composite widget roles are not
110
+ * accepted — see {@link SafeLayoutRole}.
111
+ */
112
+ role?: SafeLayoutRole;
113
+ };
71
114
  export {};
@@ -1,4 +1,4 @@
1
1
  export * from './MrlGrid';
2
2
  export * from './MrlRow';
3
3
  export * from './MrlCol';
4
- export type { NumCols } from './constants';
4
+ export type { AlignOptions, ColSpan, GridColumns, GutterSizes, JustifyOptions, NumCols, OffsetSpan, SafeLayoutRole } from './constants';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muraldevkit/ui-toolkit",
3
- "version": "4.81.0",
3
+ "version": "4.82.0",
4
4
  "description": "Mural's UI Toolkit",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -1,26 +0,0 @@
1
-
2
- @use '@muraldevkit/ds-foundation/src/styles/global-variables/breakpoints' as *;
3
- $grid-breakpoints: (
4
- xs: 0,
5
- sm: $mrl-breakpoint-01,
6
- md: $mrl-breakpoint-02,
7
- lg: $mrl-breakpoint-03,
8
- xl: $mrl-breakpoint-04,
9
- xxl: $mrl-breakpoint-05
10
- );
11
- $grid-gutter-width: 1rem;
12
- $spacer: 1rem;
13
- $spacers: (
14
- 0: 0,
15
- 1: $spacer * 1,
16
- 2: $spacer * 2,
17
- 3: $spacer * 3,
18
- 4: $spacer * 0.25,
19
- 5: $spacer * 0.5
20
- );
21
- $gutters: (
22
- 0: 0,
23
- 1: $spacer,
24
- 2: $spacer * 2,
25
- none: 0
26
- );