entasis 0.13.6 → 0.13.8

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.
@@ -253,10 +253,25 @@ const defaultMenu = cva({
253
253
  // `suffix` and `suffixAction` hold a row's `suffix` (see `suffix`), which sits beside the row
254
254
  // rather than inside it: the row reserves the suffix's measured width (`--sidebar-suffix-width`,
255
255
  // its maximum width until measured), plus the row's own end padding or the action's box.
256
- const rowEndReserveKeys = { none: '', action: '', actionBelowMd: '', suffix: '', suffixAction: '' };
256
+ // On a two-line row the suffix sits on the description's line, which reserves its width itself
257
+ // (`menuDescriptionRow`), so the label's line runs to the row's end: `suffixLine` reserves
258
+ // nothing and `suffixLineAction` only the action's box.
259
+ const rowEndReserveKeys = {
260
+ none: '',
261
+ action: '',
262
+ actionBelowMd: '',
263
+ suffix: '',
264
+ suffixAction: '',
265
+ suffixLine: '',
266
+ suffixLineAction: ''
267
+ };
257
268
  const rowEndReserve = [
258
- { endReserve: 'action', size: ['small', 'normal'], class: 'pe-layout-lg' },
259
- { endReserve: 'action', size: 'large', class: 'pe-[calc(var(--spacing)*10)]' },
269
+ { endReserve: ['action', 'suffixLineAction'], size: ['small', 'normal'], class: 'pe-layout-lg' },
270
+ {
271
+ endReserve: ['action', 'suffixLineAction'],
272
+ size: 'large',
273
+ class: 'pe-[calc(var(--spacing)*10)]'
274
+ },
260
275
  { endReserve: 'actionBelowMd', size: ['small', 'normal'], class: 'max-md:pe-layout-lg' },
261
276
  { endReserve: 'actionBelowMd', size: 'large', class: 'max-md:pe-[calc(var(--spacing)*10)]' },
262
277
  {
@@ -304,13 +319,19 @@ const defaultMenuButton = cva({
304
319
  normal: '',
305
320
  large: ''
306
321
  },
322
+ // What leads the row. Collapsed to icons, a `media` row centres its media box rather than
323
+ // the icon glyph in the icon button.
324
+ lead: {
325
+ icon: '',
326
+ media: 'group-data-[collapsible=icon]:![padding-inline:calc((var(--sidebar-icon-button-width)-var(--sidebar-media-size))/2)]'
327
+ },
307
328
  endReserve: rowEndReserveKeys
308
329
  },
309
330
  compoundVariants: [
310
331
  ...rowEndReserve,
311
332
  // The suffix covers the row's end, so hovering it keeps the row's hover tint.
312
333
  {
313
- endReserve: ['suffix', 'suffixAction'],
334
+ endReserve: ['suffix', 'suffixAction', 'suffixLine', 'suffixLineAction'],
314
335
  class: 'group-has-[[data-sidebar=menu-suffix]:hover]/menu-row:before:opacity-[var(--state-hover-opacity)]'
315
336
  },
316
337
  { size: 'small', itemSize: 'small', class: 'h-control-sm' },
@@ -329,6 +350,7 @@ const defaultMenuButton = cva({
329
350
  size: 'normal',
330
351
  density: 'normal',
331
352
  itemSize: 'normal',
353
+ lead: 'icon',
332
354
  endReserve: 'none'
333
355
  }
334
356
  });
@@ -336,7 +358,7 @@ const defaultMenuLabel = cva({
336
358
  base: 'min-w-0 flex-1 truncate whitespace-nowrap opacity-100 transition-[opacity,transform] duration-normal ease-standard group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:translate-x-1 group-data-[collapsible=icon]:opacity-0'
337
359
  });
338
360
  const defaultMenuSecondary = cva({
339
- base: 'truncate text-neutral/70',
361
+ base: 'min-w-0 flex-1 truncate font-normal text-neutral/70',
340
362
  variants: {
341
363
  size: {
342
364
  small: 'text-xs',
@@ -348,6 +370,50 @@ const defaultMenuSecondary = cva({
348
370
  size: 'normal'
349
371
  }
350
372
  });
373
+ // A row with a `description` or a `meta` stacks its text: the label's line (the label, then the
374
+ // meta at its end) over the description. The column fades with the labels in icon mode.
375
+ const defaultMenuText = cva({
376
+ base: 'grid min-w-0 flex-1 text-start opacity-100 transition-[opacity,transform] duration-normal ease-standard group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:translate-x-1 group-data-[collapsible=icon]:opacity-0'
377
+ });
378
+ const defaultMenuTitleRow = cva({
379
+ base: 'flex min-w-0 items-baseline gap-sm whitespace-nowrap'
380
+ });
381
+ const defaultMenuTitle = cva({
382
+ base: 'min-w-0 flex-1 truncate'
383
+ });
384
+ // The description's line: the description, then the row's badge. With a `suffix`, the suffix
385
+ // sits on this line, so the line reserves its measured width and the label's line does not.
386
+ const defaultMenuDescriptionRow = cva({
387
+ base: 'flex min-w-0 items-center gap-sm',
388
+ variants: {
389
+ suffix: {
390
+ false: '',
391
+ true: 'pe-[calc(var(--sidebar-suffix-width,40%)+var(--space-sm))]'
392
+ }
393
+ },
394
+ defaultVariants: {
395
+ suffix: false
396
+ }
397
+ });
398
+ // A row's `meta`: a short text (a time, « Hier ») at the end of the label's line.
399
+ const defaultMenuMeta = cva({
400
+ base: 'text-neutral/70 shrink-0 font-normal tabular-nums group-data-[collapsible=icon]:hidden',
401
+ variants: {
402
+ size: {
403
+ small: 'text-xs',
404
+ normal: 'text-xs',
405
+ large: 'text-sm'
406
+ }
407
+ },
408
+ defaultVariants: {
409
+ size: 'normal'
410
+ }
411
+ });
412
+ // A row's `media` (a face, an avatar): a box at the media size, which an `svg` or `img` placed
413
+ // directly inside fills, over the row's icon sizing.
414
+ const defaultMenuMedia = cva({
415
+ base: 'flex size-[var(--sidebar-media-size)] shrink-0 items-center justify-center [&>img]:size-full [&>img]:object-cover [&>svg]:!size-full'
416
+ });
351
417
  const defaultMenuTrailing = cva({
352
418
  base: 'ms-auto shrink-0 opacity-100 transition-[opacity,transform] duration-normal ease-standard group-data-[collapsible=icon]:pointer-events-none group-data-[collapsible=icon]:translate-x-1 group-data-[collapsible=icon]:opacity-0 [&>svg]:size-[var(--sidebar-icon-size)]',
353
419
  variants: {
@@ -412,12 +478,20 @@ const defaultSubButton = cva({
412
478
  },
413
479
  // Room at the row's end for a pinned action, as on a top-level row. `none` adds nothing: a
414
480
  // plain row keeps its exact classes.
415
- endReserve: rowEndReserveKeys
481
+ endReserve: rowEndReserveKeys,
482
+ // A row with a `description` or a `media` takes the two-line height.
483
+ tall: {
484
+ false: '',
485
+ true: ''
486
+ }
416
487
  },
417
488
  compoundVariants: [
418
489
  ...rowEndReserve,
490
+ { tall: true, size: 'small', class: 'h-row-md' },
491
+ { tall: true, size: 'normal', class: 'h-row-lg' },
492
+ { tall: true, size: 'large', class: 'h-14' },
419
493
  {
420
- endReserve: ['suffix', 'suffixAction'],
494
+ endReserve: ['suffix', 'suffixAction', 'suffixLine', 'suffixLineAction'],
421
495
  class: 'group-has-[[data-sidebar=menu-sub-suffix]:hover]/menu-sub-item:before:opacity-[var(--state-hover-opacity)]'
422
496
  }
423
497
  ],
@@ -426,7 +500,8 @@ const defaultSubButton = cva({
426
500
  size: 'normal',
427
501
  density: 'normal',
428
502
  itemSize: 'normal',
429
- endReserve: 'none'
503
+ endReserve: 'none',
504
+ tall: false
430
505
  }
431
506
  });
432
507
  // A row's pinned action is a real small icon button: one box per Sidebar `size`, shared by menu
@@ -491,9 +566,18 @@ const defaultSuffix = cva({
491
566
  action: {
492
567
  none: '',
493
568
  action: ''
569
+ },
570
+ // Which line the suffix is centred on. A row with a description centres it on the
571
+ // description's line, half the label's line height below the row's middle.
572
+ line: {
573
+ one: '',
574
+ two: ''
494
575
  }
495
576
  },
496
577
  compoundVariants: [
578
+ { line: 'two', size: 'small', class: 'top-[calc(50%+0.5rem)]' },
579
+ { line: 'two', size: 'normal', class: 'top-[calc(50%+0.625rem)]' },
580
+ { line: 'two', size: 'large', class: 'top-[calc(50%+0.75rem)]' },
497
581
  { action: 'none', density: 'compact', class: 'end-[var(--space-sm)]' },
498
582
  { action: 'none', density: ['normal', 'comfortable'], class: 'end-[var(--space-md)]' },
499
583
  { action: 'action', size: ['small', 'normal'], class: 'end-[var(--layout-space-lg)]' },
@@ -502,7 +586,8 @@ const defaultSuffix = cva({
502
586
  defaultVariants: {
503
587
  size: 'normal',
504
588
  density: 'normal',
505
- action: 'none'
589
+ action: 'none',
590
+ line: 'one'
506
591
  }
507
592
  });
508
593
  // One icon-only ghost button box. `size` follows the descriptor, defaulting to the Sidebar size,
@@ -1162,6 +1247,12 @@ export const sidebarTheme = {
1162
1247
  menuButton: defaultMenuButton,
1163
1248
  menuLabel: defaultMenuLabel,
1164
1249
  menuSecondary: defaultMenuSecondary,
1250
+ menuText: defaultMenuText,
1251
+ menuTitleRow: defaultMenuTitleRow,
1252
+ menuTitle: defaultMenuTitle,
1253
+ menuDescriptionRow: defaultMenuDescriptionRow,
1254
+ menuMeta: defaultMenuMeta,
1255
+ menuMedia: defaultMenuMedia,
1165
1256
  menuTrailing: defaultMenuTrailing,
1166
1257
  subMenu: defaultSubMenu,
1167
1258
  treeSubMenu: defaultTreeSubMenu,
@@ -799,7 +799,7 @@ export declare const componentInventory: readonly [{
799
799
  readonly id: "signature-input";
800
800
  readonly subpath: "entasis/signature-input";
801
801
  readonly sourceIndex: "src/lib/components/Form/SignatureInput/index.ts";
802
- readonly exportedSymbols: readonly ["SignatureFormat", "SignatureInput", "SignatureInputProps", "SignatureInputTheme", "SignatureInputThemeProps", "SignaturePoint", "SignatureStroke", "setSignatureInputTheme", "signatureInputTheme", "useSignatureInputTheme"];
802
+ readonly exportedSymbols: readonly ["SignatureFormat", "SignatureImageInk", "SignatureInput", "SignatureInputProps", "SignatureInputTheme", "SignatureInputThemeProps", "SignaturePoint", "SignatureStroke", "setSignatureInputTheme", "signatureInputTheme", "useSignatureInputTheme"];
803
803
  readonly docs: readonly [{
804
804
  readonly id: "signature-input";
805
805
  readonly route: "/components/signature-input";
@@ -1936,6 +1936,7 @@ export const componentInventory = [
1936
1936
  sourceIndex: 'src/lib/components/Form/SignatureInput/index.ts',
1937
1937
  exportedSymbols: [
1938
1938
  'SignatureFormat',
1939
+ 'SignatureImageInk',
1939
1940
  'SignatureInput',
1940
1941
  'SignatureInputProps',
1941
1942
  'SignatureInputTheme',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "entasis",
3
- "version": "0.13.6",
3
+ "version": "0.13.8",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev",