@aleph-alpha/ui-library 6.1.0 → 6.2.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.
package/config.js CHANGED
@@ -965,6 +965,27 @@ export const presetUiLibraryThemeFromTokens = (options = {}) => {
965
965
  { getCSS: () => getSaansFontFaceCss() },
966
966
  { getCSS: () => fontVariablesCss },
967
967
  ],
968
+ /**
969
+ * Design-system breakpoints on top of the Wind defaults. `desktop`
970
+ * (1200px) is the standard desktop size; between the minimum desktop size
971
+ * of 1024px and `desktop`, layouts compact (32px content margins, 162px
972
+ * sidebar). Extended rather than set via `theme.breakpoint`, which would
973
+ * replace the Wind defaults; rebuilt in ascending order so media queries
974
+ * cascade mobile-first.
975
+ * @param {Record<string, unknown>} theme Merged UnoCSS theme.
976
+ */
977
+ extendTheme: (theme) => {
978
+ const breakpoint = /** @type {Record<string, string>} */ (
979
+ theme.breakpoint ?? {}
980
+ );
981
+ const entries = Object.entries({ ...breakpoint, desktop: '75rem' });
982
+ const toPx = (value) =>
983
+ value.endsWith('rem')
984
+ ? Number.parseFloat(value) * 16
985
+ : Number.parseFloat(value);
986
+ entries.sort(([, a], [, b]) => toPx(a) - toPx(b));
987
+ theme.breakpoint = Object.fromEntries(entries);
988
+ },
968
989
  theme: {
969
990
  font: {
970
991
  sans: `'${fontBody}', sans-serif`,
@@ -1440,6 +1461,27 @@ const scrollbarCSS = `
1440
1461
  export const presetUiLibraryUtils = () =>
1441
1462
  definePreset(() => ({
1442
1463
  name: '@aleph-alpha/ui-library-utils',
1464
+ // Variant separator `:` only. The default also allows `-`, under which
1465
+ // the `lg` breakpoint would swallow `lg-min:` as `lg-` + `min:…` and the
1466
+ // desktop-minimum variant below could never match.
1467
+ separators: [':'],
1468
+ // `lg-min:` is the design system's desktop minimum (1200px = 75rem):
1469
+ // library components switch from 32px to 48px layout-grid margins there
1470
+ // (e.g. `px-8 lg-min:px-12` in `UiLayoutContent`). Registered through
1471
+ // `extendTheme` so it lands in the resolved theme after any user
1472
+ // breakpoint map is merged, inserted after `lg` to keep size order.
1473
+ extendTheme: (theme) => {
1474
+ const breakpoints = theme.breakpoint ?? {};
1475
+ if (!breakpoints['lg-min']) {
1476
+ const entries = Object.entries(breakpoints);
1477
+ const lgIndex = entries.findIndex(([name]) => name === 'lg');
1478
+ entries.splice(lgIndex === -1 ? entries.length : lgIndex + 1, 0, [
1479
+ 'lg-min',
1480
+ '75rem',
1481
+ ]);
1482
+ theme.breakpoint = Object.fromEntries(entries);
1483
+ }
1484
+ },
1443
1485
  preflights: [
1444
1486
  { getCSS: () => vHoverOverlayCSS },
1445
1487
  { getCSS: () => scrollbarCSS },
@@ -5,6 +5,15 @@ export declare const SIDEBAR_WIDTH = "16rem";
5
5
  export declare const SIDEBAR_WIDTH_DEFAULT = 256;
6
6
  export declare const SIDEBAR_WIDTH_MIN = 240;
7
7
  export declare const SIDEBAR_WIDTH_MAX = 480;
8
+ /**
9
+ * Width on compact desktop viewports (from `md` up to below the `desktop`
10
+ * breakpoint, 1200px): toward the minimum desktop size of 1024px the sidebar
11
+ * narrows to 162px and its content truncates, leaving the room to the content
12
+ * area's grid.
13
+ */
14
+ export declare const SIDEBAR_WIDTH_MIN_DESKTOP = "162px";
15
+ /** Matches compact desktop viewports — at or above `md`, below `desktop`. */
16
+ export declare const SIDEBAR_MIN_DESKTOP_MEDIA_QUERY = "(min-width: 768px) and (max-width: 1199.9px)";
8
17
  export declare const SIDEBAR_WIDTH_MOBILE = "16rem";
9
18
  export declare const SIDEBAR_WIDTH_ICON = "3rem";
10
19
  export declare const SIDEBAR_KEYBOARD_SHORTCUT = "b";
@@ -32,6 +32,7 @@
32
32
  "components-uiautocomplete--accessibility": "accessibility",
33
33
  "components-uibreadcrumb--accessibility": "accessibility",
34
34
  "patterns-uifloatactions--accessibility": "accessibility",
35
+ "patterns-uilayout-content--accessibility": "accessibility",
35
36
  "patterns-uidatatable--accessibility": "accessibility",
36
37
  "patterns-uitopbar--accessibility": "accessibility",
37
38
  "patterns-uifileupload-uifileitem--accessibility": "accessibility",