@scalewing/react 1.42.0 → 1.45.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 (76) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +65 -1
  3. package/dist/components/ActionMenu.d.ts +4 -2
  4. package/dist/components/ActionMenu.js +4 -8
  5. package/dist/components/Article.d.ts +19 -2
  6. package/dist/components/Article.js +9 -5
  7. package/dist/components/DescriptionList.d.ts +12 -2
  8. package/dist/components/DescriptionList.js +7 -3
  9. package/dist/components/FileField.d.ts +15 -4
  10. package/dist/components/FileField.js +13 -4
  11. package/dist/components/FilterChips.d.ts +1 -1
  12. package/dist/components/FilterChips.js +1 -1
  13. package/dist/components/FilterChipsRow.d.ts +24 -0
  14. package/dist/components/FilterChipsRow.js +14 -0
  15. package/dist/components/ListRow.d.ts +18 -2
  16. package/dist/components/ListRow.js +7 -4
  17. package/dist/components/action-menu/assert-action-menu.d.ts +13 -0
  18. package/dist/components/action-menu/assert-action-menu.js +21 -0
  19. package/dist/components/description-list-layout.d.ts +10 -0
  20. package/dist/components/description-list-layout.js +13 -0
  21. package/dist/components/file-field/file-field-checks.d.ts +2 -2
  22. package/dist/components/file-field/file-field-checks.js +4 -2
  23. package/dist/components/filter-chips/FilterChip.js +1 -1
  24. package/dist/components/filter-chips/options.d.ts +10 -0
  25. package/dist/components/filter-chips/options.js +8 -0
  26. package/dist/components/filter-chips/validate.d.ts +3 -3
  27. package/dist/components/filter-chips/validate.js +8 -4
  28. package/dist/components/list/ListRowContent.d.ts +9 -2
  29. package/dist/components/list/ListRowContent.js +7 -4
  30. package/dist/components/list/ListRowItem.js +1 -1
  31. package/dist/components/list/row-naming.js +1 -1
  32. package/dist/components/slot.d.ts +9 -0
  33. package/dist/components/slot.js +13 -0
  34. package/dist/components/steps/Step.d.ts +10 -1
  35. package/dist/components/steps/Step.js +15 -19
  36. package/dist/components/steps/StepTitleLine.d.ts +19 -0
  37. package/dist/components/steps/StepTitleLine.js +13 -0
  38. package/dist/components/steps/StepTitleWords.d.ts +27 -0
  39. package/dist/components/steps/StepTitleWords.js +21 -0
  40. package/dist/components/steps/assert-step.d.ts +7 -0
  41. package/dist/components/steps/assert-step.js +19 -0
  42. package/dist/css/css-action-menu-trigger.d.ts +6 -2
  43. package/dist/css/css-action-menu-trigger.js +50 -2
  44. package/dist/css/css-action-menu.js +4 -2
  45. package/dist/css/css-components.js +3 -0
  46. package/dist/css/css-description-list.d.ts +1 -0
  47. package/dist/css/css-description-list.js +24 -0
  48. package/dist/css/css-file-field.js +15 -1
  49. package/dist/css/css-filter-chip-tones.d.ts +3 -0
  50. package/dist/css/css-filter-chip-tones.js +28 -0
  51. package/dist/css/css-filter-chips-layout.d.ts +1 -0
  52. package/dist/css/css-filter-chips-layout.js +1 -1
  53. package/dist/css/css-filter-chips-row.d.ts +2 -0
  54. package/dist/css/css-filter-chips-row.js +79 -0
  55. package/dist/css/css-filter-chips.js +8 -0
  56. package/dist/css/css-font-mono.d.ts +3 -0
  57. package/dist/css/css-font-mono.js +23 -0
  58. package/dist/css/css-list-row-truncate.d.ts +2 -0
  59. package/dist/css/css-list-row-truncate.js +29 -0
  60. package/dist/css/css-list.js +5 -1
  61. package/dist/css/css-steps-title-detail.d.ts +2 -0
  62. package/dist/css/css-steps-title-detail.js +36 -0
  63. package/dist/css/css-steps.d.ts +2 -2
  64. package/dist/css/css-steps.js +6 -2
  65. package/dist/css/css-utilities.js +3 -0
  66. package/dist/css/spacing-classes.d.ts +1 -1
  67. package/dist/css/spacing-classes.js +1 -0
  68. package/dist/css/stylesheet.js +2 -0
  69. package/dist/index.d.ts +6 -4
  70. package/dist/index.js +3 -2
  71. package/dist/list-options.d.ts +7 -6
  72. package/dist/list-options.js +8 -6
  73. package/dist/styles.css +164 -0
  74. package/package.json +1 -1
  75. package/dist/components/list/row-slot.d.ts +0 -8
  76. package/dist/components/list/row-slot.js +0 -12
package/dist/styles.css CHANGED
@@ -829,6 +829,7 @@ body {
829
829
  .sw-grow { flex-grow: 1; }
830
830
  .sw-full-width { width: 100%; }
831
831
  .sw-container { width: 100%; max-width: var(--sw-container-max); margin-inline: auto; }
832
+ .sw-container-reading { width: 100%; max-width: var(--sw-reading-max); margin-inline: auto; }
832
833
  .sw-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
833
834
  .sw-align-start { align-items: flex-start; }
834
835
  .sw-align-center { align-items: center; }
@@ -904,6 +905,11 @@ body {
904
905
  .sw-text-heading { font-size: 24px; line-height: 30px; letter-spacing: -0.4px; }
905
906
  }
906
907
 
908
+ [data-theme] .sw-font-mono,
909
+ [data-theme] :is(input[type='text'], input[type='email'], input[type='number'], input[type='search'], input[type='url'], input[type='password'], input:not([type]), textarea).sw-font-mono {
910
+ font-family: ui-monospace, monospace;
911
+ }
912
+
907
913
  .sw-button {
908
914
  appearance: none;
909
915
  align-items: center;
@@ -2995,6 +3001,23 @@ body {
2995
3001
  }
2996
3002
  }
2997
3003
 
3004
+ .sw-list-row-truncate .sw-list-row-title {
3005
+ align-items: center;
3006
+ display: flex;
3007
+ min-width: 0;
3008
+ }
3009
+
3010
+ .sw-list-row-truncate .sw-list-row-unread { flex: none; }
3011
+
3012
+ .sw-list-row-truncate .sw-list-row-title-text,
3013
+ .sw-list-row-truncate .sw-list-row-detail {
3014
+ min-width: 0;
3015
+ overflow: hidden;
3016
+ overflow-wrap: normal;
3017
+ text-overflow: ellipsis;
3018
+ white-space: nowrap;
3019
+ }
3020
+
2998
3021
  .sw-file-field-frame {
2999
3022
  border: 1px solid var(--sw-color-border);
3000
3023
  border-radius: var(--sw-radius-md);
@@ -3089,6 +3112,16 @@ body {
3089
3112
  flex: none;
3090
3113
  }
3091
3114
 
3115
+ .sw-file-field-preview {
3116
+ background: var(--sw-color-subtle);
3117
+ border-radius: var(--sw-radius-sm);
3118
+ display: block;
3119
+ flex: none;
3120
+ height: var(--sw-space-6);
3121
+ object-fit: cover;
3122
+ width: var(--sw-space-8);
3123
+ }
3124
+
3092
3125
  .sw-file-field-file {
3093
3126
  display: flex;
3094
3127
  flex: 1 1 calc(4 * var(--sw-space-8));
@@ -4873,6 +4906,43 @@ body {
4873
4906
  .sw-action-menu-trigger.sw-action-menu-trigger-text[aria-expanded='true'] { border-color: Highlight; }
4874
4907
  }
4875
4908
 
4909
+ .sw-action-menu-trigger.sw-action-menu-trigger-icon {
4910
+ align-items: center;
4911
+ background: transparent;
4912
+ border-color: transparent;
4913
+ border-radius: var(--sw-radius-pill);
4914
+ color: var(--sw-color-muted);
4915
+ display: inline-flex;
4916
+ justify-content: center;
4917
+ min-height: var(--sw-control-sm-min-height);
4918
+ min-width: var(--sw-control-sm-min-height);
4919
+ padding: 0;
4920
+ }
4921
+
4922
+ .sw-action-menu-trigger.sw-action-menu-trigger-icon[aria-expanded='true'] {
4923
+ background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent);
4924
+ color: var(--sw-color-text);
4925
+ }
4926
+
4927
+ @media (hover: hover) {
4928
+ .sw-action-menu-trigger.sw-action-menu-trigger-icon:hover:not(:disabled) {
4929
+ background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent);
4930
+ color: var(--sw-color-text);
4931
+ }
4932
+ }
4933
+
4934
+ @media (pointer: coarse) {
4935
+ .sw-action-menu-trigger.sw-action-menu-trigger-icon {
4936
+ min-height: var(--sw-control-md-min-height);
4937
+ min-width: var(--sw-control-md-min-height);
4938
+ }
4939
+ }
4940
+
4941
+ @media (forced-colors: active) {
4942
+ .sw-action-menu-trigger.sw-action-menu-trigger-icon { color: ButtonText; }
4943
+ .sw-action-menu-trigger.sw-action-menu-trigger-icon[aria-expanded='true'] { border-color: Highlight; }
4944
+ }
4945
+
4876
4946
  .sw-combobox {
4877
4947
  max-width: 100%;
4878
4948
  min-width: 0;
@@ -5745,6 +5815,18 @@ body {
5745
5815
  .sw-description-list { grid-template-columns: minmax(0, 1fr); }
5746
5816
  }
5747
5817
 
5818
+ .sw-description-list-spread { grid-template-columns: minmax(0, 1fr); }
5819
+
5820
+ .sw-description-list-spread > .sw-description-item {
5821
+ column-gap: var(--sw-space-4);
5822
+ grid-template-columns: fit-content(50%) minmax(0, 1fr);
5823
+ }
5824
+
5825
+ .sw-description-list-spread .sw-description-detail {
5826
+ align-items: flex-end;
5827
+ text-align: end;
5828
+ }
5829
+
5748
5830
  @media (forced-colors: active) {
5749
5831
  .sw-description-item + .sw-description-item { border-top-color: CanvasText; }
5750
5832
  }
@@ -5972,6 +6054,69 @@ body {
5972
6054
  white-space: nowrap;
5973
6055
  }
5974
6056
 
6057
+ .sw-filter-chip-warning:not(.sw-filter-chip-quiet) .sw-filter-chip-input:not(:checked) + .sw-filter-chip-face {
6058
+ background: color-mix(in srgb, var(--sw-color-warning) 10%, var(--sw-color-surface));
6059
+ color: color-mix(in srgb, var(--sw-color-warning) 70%, var(--sw-color-text));
6060
+ }
6061
+
6062
+ .sw-filter-chip-warning:not(.sw-filter-chip-quiet) .sw-filter-chip-input:not(:checked) + .sw-filter-chip-face .sw-filter-chip-count {
6063
+ color: inherit;
6064
+ }
6065
+
6066
+ @media (forced-colors: active) {
6067
+ .sw-filter-chip-warning:not(.sw-filter-chip-quiet) .sw-filter-chip-input:not(:checked) + .sw-filter-chip-face { background: Canvas; color: CanvasText; }
6068
+ }
6069
+
6070
+ .sw-filter-chips-row {
6071
+ align-items: flex-end;
6072
+ display: flex;
6073
+ flex-wrap: wrap;
6074
+ gap: var(--sw-space-2);
6075
+ max-width: 100%;
6076
+ min-width: 0;
6077
+ }
6078
+
6079
+ .sw-filter-chips-row-end {
6080
+ display: flex;
6081
+ margin-inline-start: auto;
6082
+ max-width: 100%;
6083
+ min-width: 0;
6084
+ }
6085
+
6086
+ .sw-filter-chips-row-scroll {
6087
+ flex-wrap: nowrap;
6088
+ margin: calc(-1 * calc(var(--sw-focus-ring-width) + var(--sw-focus-ring-offset)));
6089
+ overflow-x: auto;
6090
+ overscroll-behavior-x: contain;
6091
+ padding: calc(var(--sw-focus-ring-width) + var(--sw-focus-ring-offset));
6092
+ position: relative;
6093
+ scrollbar-width: thin;
6094
+ }
6095
+
6096
+ .sw-filter-chips-row-scroll .sw-filter-chips,
6097
+ .sw-filter-chips-row-scroll > .sw-filter-chips-row-end {
6098
+ flex: none;
6099
+ max-width: none;
6100
+ }
6101
+
6102
+ .sw-filter-chips-row-scroll .sw-filter-chips { width: min-content; }
6103
+
6104
+ .sw-filter-chips-row-scroll .sw-filter-chips-options {
6105
+ flex-wrap: nowrap;
6106
+ margin: 0;
6107
+ overflow: visible;
6108
+ padding: 0;
6109
+ }
6110
+
6111
+ .sw-filter-chips-row-scroll .sw-filter-chip {
6112
+ flex: none;
6113
+ max-width: none;
6114
+ }
6115
+
6116
+ .sw-filter-chips-row-scroll .sw-filter-chip-face {
6117
+ white-space: nowrap;
6118
+ }
6119
+
5975
6120
  @media (forced-colors: active) {
5976
6121
  .sw-filter-chip-face { background: Canvas; border-color: CanvasText; color: CanvasText; }
5977
6122
  .sw-filter-chips-error { color: Mark; }
@@ -7158,6 +7303,25 @@ body {
7158
7303
  min-width: 0;
7159
7304
  }
7160
7305
 
7306
+ .sw-steps-title-line {
7307
+ align-items: baseline;
7308
+ column-gap: var(--sw-space-2);
7309
+ display: flex;
7310
+ flex: 0 1 auto;
7311
+ flex-wrap: wrap;
7312
+ min-width: 0;
7313
+ }
7314
+
7315
+ .sw-steps-title-detail {
7316
+ color: var(--sw-color-muted);
7317
+ font-size: 15px;
7318
+ font-weight: 400;
7319
+ letter-spacing: -0.2px;
7320
+ line-height: 20px;
7321
+ min-width: 0;
7322
+ overflow-wrap: anywhere;
7323
+ }
7324
+
7161
7325
  .sw-steps-item-upcoming .sw-steps-marker,
7162
7326
  .sw-steps-item-skipped .sw-steps-marker {
7163
7327
  box-shadow: inset 0 0 0 2px var(--sw-color-border);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalewing/react",
3
- "version": "1.42.0",
3
+ "version": "1.45.0",
4
4
  "description": "Scalewing DOM components and package-owned CSS utilities.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,8 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- /**
3
- * Whether a row's slot (`leading`, `tag`, `action`) holds something to
4
- * draw. As React renders nothing for them, `undefined`, `null`, a boolean
5
- * (the `false` of `canArchive && <ActionMenu …/>`) and an empty string are
6
- * an empty slot, so they add no box and no gap.
7
- */
8
- export declare function hasSlot(node: ReactNode): boolean;
@@ -1,12 +0,0 @@
1
- /**
2
- * Whether a row's slot (`leading`, `tag`, `action`) holds something to
3
- * draw. As React renders nothing for them, `undefined`, `null`, a boolean
4
- * (the `false` of `canArchive && <ActionMenu …/>`) and an empty string are
5
- * an empty slot, so they add no box and no gap.
6
- */
7
- export function hasSlot(node) {
8
- return (node !== undefined &&
9
- node !== null &&
10
- node !== '' &&
11
- typeof node !== 'boolean');
12
- }