@smwb/ui-styles 1.4.3 → 1.5.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 (39) hide show
  1. package/README.md +4 -2
  2. package/less/_prelude.less +4 -3
  3. package/less/components/accordion/accordion.less +78 -3
  4. package/less/components/avatar/avatar.less +12 -4
  5. package/less/components/chart/chart.entry.less +2 -0
  6. package/less/components/chart/chart.less +51 -0
  7. package/less/components/descriptionList/descriptionList.entry.less +2 -0
  8. package/less/components/descriptionList/descriptionList.less +52 -0
  9. package/less/components/emptyState/emptyState.entry.less +2 -0
  10. package/less/components/emptyState/emptyState.less +105 -0
  11. package/less/components/kanban/kanban.entry.less +2 -0
  12. package/less/components/kanban/kanban.less +162 -0
  13. package/less/components/meter/meter.entry.less +2 -0
  14. package/less/components/meter/meter.less +65 -0
  15. package/less/components/personChip/personChip.entry.less +2 -0
  16. package/less/components/personChip/personChip.less +49 -0
  17. package/less/components/progressIndicator/progressIndicator.less +33 -0
  18. package/less/components/sectionHeader/sectionHeader.entry.less +2 -0
  19. package/less/components/sectionHeader/sectionHeader.less +115 -0
  20. package/less/components/selectField/selectField.less +19 -0
  21. package/less/components/stat/stat.entry.less +2 -0
  22. package/less/components/stat/stat.less +117 -0
  23. package/less/components/stepper/stepper.less +57 -16
  24. package/less/components/table/table.less +73 -0
  25. package/less/components/tabs/tab/tab.less +9 -0
  26. package/less/components/tabs/tabs.less +46 -0
  27. package/less/components/textField/textField.less +7 -1
  28. package/less/components/timeline/timeline.entry.less +2 -0
  29. package/less/components/timeline/timeline.less +141 -0
  30. package/less/components/tooltip/tooltip.less +10 -7
  31. package/less/components/typography/typography.less +14 -0
  32. package/less/components.less +9 -0
  33. package/less/connects/rt/table.entry.less +2 -0
  34. package/less/default/globals/default.variables.less +15 -0
  35. package/less/foundation/typography.less +11 -6
  36. package/less/theme.less +1 -1
  37. package/less/tokens.entry.less +19 -0
  38. package/less/variables.less +17 -2
  39. package/package.json +2 -2
@@ -0,0 +1,141 @@
1
+ // Events on a line: each item's mark sits on a vertical rule that runs from it
2
+ // down to the next item's mark.
3
+ .smwb-timeline {
4
+ --smwb-timeline-mark: 24px;
5
+ --smwb-timeline-pad: @smui-space-xs;
6
+ display: grid;
7
+ row-gap: @smui-space-md;
8
+ margin: 0;
9
+ padding: 0;
10
+ list-style: none;
11
+ font-size: 0.875rem;
12
+ line-height: 1.45;
13
+ min-width: 0;
14
+
15
+ &__group {
16
+ display: grid;
17
+ row-gap: @smui-space-xs;
18
+ min-width: 0;
19
+ }
20
+
21
+ &__label {
22
+ padding: 2px 0;
23
+ font-size: 0.75rem;
24
+ font-weight: 600;
25
+ letter-spacing: 0.06em;
26
+ text-transform: uppercase;
27
+ color: var(--smui-onSurfaceVariant);
28
+ }
29
+
30
+ &__items {
31
+ display: grid;
32
+ margin: 0;
33
+ padding: 0;
34
+ list-style: none;
35
+ min-width: 0;
36
+ }
37
+
38
+ &__item {
39
+ --smwb-timeline-tone: var(--smui-onSurfaceVariant);
40
+ position: relative;
41
+ display: grid;
42
+ grid-template-columns: var(--smwb-timeline-mark) minmax(0, 1fr) auto;
43
+ column-gap: @smui-space-sm;
44
+ align-items: start;
45
+ padding: var(--smwb-timeline-pad) 0;
46
+ min-width: 0;
47
+
48
+ &::before {
49
+ content: "";
50
+ position: absolute;
51
+ left: calc(var(--smwb-timeline-mark) / 2 - 1px);
52
+ top: calc(var(--smwb-timeline-pad) + var(--smwb-timeline-mark));
53
+ bottom: calc(-1 * var(--smwb-timeline-pad));
54
+ width: 2px;
55
+ background-color: var(--smui-dividerColor);
56
+ }
57
+ &:last-child::before {
58
+ display: none;
59
+ }
60
+ }
61
+
62
+ &__mark {
63
+ display: inline-flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ width: var(--smwb-timeline-mark);
67
+ height: var(--smwb-timeline-mark);
68
+ color: var(--smwb-timeline-tone);
69
+ }
70
+
71
+ &__dot {
72
+ width: 8px;
73
+ height: 8px;
74
+ border-radius: @smui-radius-circle;
75
+ background-color: currentColor;
76
+ }
77
+
78
+ &__body {
79
+ min-width: 0;
80
+ }
81
+
82
+ &__title {
83
+ overflow-wrap: anywhere;
84
+
85
+ // An event is usually a link: it reads as the text around it until hovered.
86
+ a {
87
+ color: inherit;
88
+ text-decoration: none;
89
+ &:hover {
90
+ color: var(--smui-primaryColor);
91
+ text-decoration: underline;
92
+ }
93
+ }
94
+ }
95
+
96
+ &__meta {
97
+ font-size: 0.75rem;
98
+ color: var(--smui-onSurfaceVariant);
99
+ overflow-wrap: anywhere;
100
+ }
101
+
102
+ &__content {
103
+ margin-top: @smui-space-xs;
104
+ }
105
+
106
+ &__time {
107
+ font-size: 0.75rem;
108
+ line-height: 1.45rem;
109
+ white-space: nowrap;
110
+ font-variant-numeric: tabular-nums;
111
+ color: var(--smui-onSurfaceVariant);
112
+ }
113
+
114
+ &__item_tone-info {
115
+ --smwb-timeline-tone: var(--smui-infoColor);
116
+ }
117
+ &__item_tone-success {
118
+ --smwb-timeline-tone: var(--smui-successColor);
119
+ }
120
+ &__item_tone-warning {
121
+ --smwb-timeline-tone: var(--smui-warningColor);
122
+ }
123
+ &__item_tone-error {
124
+ --smwb-timeline-tone: var(--smui-errorColor);
125
+ }
126
+
127
+ &_dense {
128
+ --smwb-timeline-pad: 2px;
129
+ row-gap: @smui-space-sm;
130
+ font-size: 0.8125rem;
131
+ }
132
+
133
+ // The label covers what scrolls under it; set --smwb-timeline-label-bg to the
134
+ // background the timeline sits on.
135
+ &_sticky-labels &__label {
136
+ position: sticky;
137
+ top: 0;
138
+ z-index: 1;
139
+ background-color: var(--smwb-timeline-label-bg, var(--smui-surfaceBackground));
140
+ }
141
+ }
@@ -9,22 +9,19 @@
9
9
  display: inline-flex;
10
10
  align-items: center;
11
11
  justify-content: center;
12
- transition: all 0.2s ease-in-out;
13
12
  overflow: hidden;
14
- opacity: 0;
15
- visibility: hidden;
16
13
  white-space: nowrap;
17
14
  min-width: 50px;
15
+ // The component mounts the tooltip only while it shows — on hover, on click,
16
+ // or while `open` — so it is visible whenever it is in the DOM. (It used to be
17
+ // shown by :hover alone, which hid click and manual tooltips.)
18
+ animation: smwb-tooltip-in 0.15s ease-out;
18
19
 
19
20
  &__ref {
20
21
  display: inline-flex;
21
22
  align-items: center;
22
23
  justify-content: center;
23
24
  cursor: pointer;
24
- &:hover + .smwb-tooltip {
25
- visibility: visible;
26
- opacity: 1;
27
- }
28
25
  }
29
26
 
30
27
  &__wrapper {
@@ -34,3 +31,9 @@
34
31
  justify-content: center;
35
32
  }
36
33
  }
34
+
35
+ @keyframes smwb-tooltip-in {
36
+ from {
37
+ opacity: 0;
38
+ }
39
+ }
@@ -83,4 +83,18 @@
83
83
  text-overflow: ellipsis;
84
84
  white-space: nowrap;
85
85
  }
86
+
87
+ // lines={n}: an ellipsis after n lines (the count comes in as a custom property).
88
+ &_clamp {
89
+ display: -webkit-box;
90
+ -webkit-box-orient: vertical;
91
+ -webkit-line-clamp: var(--smwb-typography-lines);
92
+ line-clamp: var(--smwb-typography-lines);
93
+ overflow: hidden;
94
+ overflow-wrap: break-word;
95
+ }
96
+
97
+ &_tabular-nums {
98
+ font-variant-numeric: tabular-nums;
99
+ }
86
100
  }
@@ -9,8 +9,10 @@
9
9
  @import "./components/fileInput/fileInput.less";
10
10
  @import "./components/modal/modal.less";
11
11
  @import "./components/confirmDialog/confirmDialog.less";
12
+ @import "./components/emptyState/emptyState.less";
12
13
  @import "./components/saveAssetDialog/saveAssetDialog.less";
13
14
  @import "./components/progressIndicator/progressIndicator.less";
15
+ @import "./components/meter/meter.less";
14
16
  @import "./components/radioButton/radioButton.less";
15
17
  @import "./components/sidebar/sidebar.less";
16
18
  @import "./components/bottomBar/bottomBar.less";
@@ -26,6 +28,7 @@
26
28
  @import "./components/selectField/selectField.less";
27
29
  @import "./components/ripple/ripple.less";
28
30
  @import "./components/list/list.less";
31
+ @import "./components/descriptionList/descriptionList.less";
29
32
  @import "./components/imagesList/imagesList.less";
30
33
  @import "./components/imagesList/imagesListItem/imagesListItem.less";
31
34
  @import "./components/lazyImage/lazyImage.less";
@@ -37,10 +40,12 @@
37
40
  @import "./components/floatingWindow/floatingWindow.less";
38
41
  @import "./components/badge/badge.less";
39
42
  @import "./components/card/card.less";
43
+ @import "./components/stat/stat.less";
40
44
  @import "./components/carousel/carousel.less";
41
45
  @import "./components/accordion/accordion.less";
42
46
  @import "./components/expansionPanel/expansionPanel.less";
43
47
  @import "./components/chat/chat.less";
48
+ @import "./components/kanban/kanban.less";
44
49
  @import "./components/table/table.less";
45
50
  @import "./components/table/tablePagination/tablePagination.less";
46
51
  @import "./components/icon/icon.less";
@@ -48,19 +53,23 @@
48
53
  @import "./components/datePicker/dataPicker.less";
49
54
  @import "./components/timePicker/timePicker.less";
50
55
  @import "./components/treeView/treeView.less";
56
+ @import "./components/timeline/timeline.less";
51
57
  @import "./components/message/message.less";
52
58
  @import "./components/buttonGroup/buttonGroup.less";
53
59
  @import "./components/avatar/avatar.less";
60
+ @import "./components/personChip/personChip.less";
54
61
  @import "./components/breadcrumbs/breadcrumbs.less";
55
62
  @import "./components/divider/divider.less";
56
63
  @import "./components/pagination/pagination.less";
57
64
  @import "./components/rating/rating.less";
58
65
  @import "./components/skeleton/skeleton.less";
66
+ @import "./components/chart/chart.less";
59
67
  @import "./components/stepper/stepper.less";
60
68
  @import "./components/typography/typography.less";
61
69
  @import "./components/stack/stack.less";
62
70
  @import "./components/page/page.less";
63
71
  @import "./components/pageHeader/pageHeader.less";
72
+ @import "./components/sectionHeader/sectionHeader.less";
64
73
  @import "./components/appLayout/appLayout.less";
65
74
  @import "./responsive.less";
66
75
  @import "./connects.less";
@@ -0,0 +1,2 @@
1
+ @import (reference) "../../_prelude.less";
2
+ @import "./table.less";
@@ -57,6 +57,7 @@
57
57
  @onSurfaceVariant: #49454e;
58
58
  @onSurfaceHover: ~"color-mix(in srgb, @{onSurfaceColor} 8%, transparent)";
59
59
  @onSurfaceActive: ~"color-mix(in srgb, @{onSurfaceColor} 12%, transparent)";
60
+ @onSurfaceFocus: ~"color-mix(in srgb, @{onSurfaceColor} 12%, transparent)";
60
61
  @disabledTextColor: ~"color-mix(in srgb, @{onSurfaceColor} 38%, transparent)";
61
62
  @disabledBgColor: ~"color-mix(in srgb, @{onSurfaceColor} 12%, transparent)";
62
63
 
@@ -85,6 +86,8 @@
85
86
  =====================================================================*/
86
87
  @accordionSummaryPaddingX: @smui-space-lg;
87
88
  @accordionSummaryGap: 15px; // off-grid
89
+ @accordionFlatHeaderMinHeight: @smui-space-12; // outlined / plain header
90
+ @accordionOutlinedRadius: @smui-radius-md;
88
91
 
89
92
  @avatarSizeSmall: 24px;
90
93
  @avatarSizeMedium: 40px;
@@ -109,6 +112,9 @@
109
112
  @stepperConnectorGap: @smui-space-sm;
110
113
  @stepperIconSize: 24px;
111
114
  @stepperLabelGap: @smui-space-sm;
115
+ // orientation="auto": the container width per step below which the steps stack
116
+ @stepperAutoStepWidth: 8rem;
117
+ @stepperAutoMaxSteps: 12; // keep in step with AUTO_MAX_STEPS in the components
112
118
 
113
119
  @appBarPaddingX: @smui-space-lg;
114
120
  @appBarActionPadding: @smui-space-md;
@@ -159,9 +165,14 @@
159
165
  @menuTextInsetDense: 36px; // off-grid
160
166
 
161
167
  @progressDotMargin: @smui-space-xs;
168
+ @meterHeight: 6px;
169
+ @meterMinBarWidth: 3.5rem; // the bar keeps at least this much beside its text
162
170
 
163
171
  @screenDividerLabelMargin: 5px; // off-grid
164
172
 
173
+ @sectionHeaderTitleSize: 1.15rem;
174
+ @sectionHeaderMinorTitleSize: 1rem; // h3 and below
175
+
165
176
  @messagePadding: @smui-space-md @smui-space-xl;
166
177
  @messageGap: 10px; // off-grid
167
178
  @messageTitleMarginBottom: @smui-space-xs;
@@ -211,6 +222,9 @@
211
222
  @tabIconPaddingTop: 6px; // off-grid
212
223
  @tabIconPaddingBottom: @smui-space-xs;
213
224
  @tabLabelPaddingLeft: @smui-space-sm;
225
+ @tabDensePaddingX: @smui-space-md;
226
+ @tabsFadeWidth: 2.5rem; // scrollable row: the fading edge beyond which tabs are hidden
227
+ @tabsScrollButtonWidth: 40px;
214
228
 
215
229
  @tableCellPaddingX: @smui-space-lg;
216
230
  @tableToolbarMarginBottom: 10px; // off-grid
@@ -464,6 +478,7 @@
464
478
  @onSurfaceVariantDark: #cac4d0;
465
479
  @onSurfaceHoverDark: ~"color-mix(in srgb, @{onSurfaceColorDark} 8%, transparent)";
466
480
  @onSurfaceActiveDark: ~"color-mix(in srgb, @{onSurfaceColorDark} 12%, transparent)";
481
+ @onSurfaceFocusDark: ~"color-mix(in srgb, @{onSurfaceColorDark} 12%, transparent)";
467
482
  @disabledBgColorDark: ~"color-mix(in srgb, @{onSurfaceColorDark} 12%, transparent)";
468
483
  @disabledTextColorDark: ~"color-mix(in srgb, @{onSurfaceColorDark} 38%, transparent)";
469
484
 
@@ -9,12 +9,17 @@
9
9
 
10
10
  @smui-font-family: var(--smui-fontFamily, inherit);
11
11
 
12
- // size / weight / line-height per variant
13
- @smui-font-h1-size: 48px; @smui-font-h1-weight: 300; @smui-font-h1-lh: 1.2;
14
- @smui-font-h2-size: 40px; @smui-font-h2-weight: 300; @smui-font-h2-lh: 1.2;
15
- @smui-font-h3-size: 32px; @smui-font-h3-weight: 400; @smui-font-h3-lh: 1.25;
16
- @smui-font-h4-size: 28px; @smui-font-h4-weight: 400; @smui-font-h4-lh: 1.3;
17
- @smui-font-h5-size: 24px; @smui-font-h5-weight: 500; @smui-font-h5-lh: 1.3;
12
+ // Fluid headings: h1–h5 grow with the viewport from a phone (360px wide) to a
13
+ // desktop (1200px): 32/28/24/22/20px on the phone, the full 48/40/32/28/24px from
14
+ // 1200px up. The bounds are in rem, so the headings also follow the reader's font
15
+ // size. Each value is min + slope × width between the two (escaped: Less would
16
+ // otherwise add the rem and vw terms). A fixed size still overrides a step:
17
+ // @smui-font-h1-size: 48px;
18
+ @smui-font-h1-size: ~"clamp(2rem, 1.5714rem + 1.9048vw, 3rem)"; @smui-font-h1-weight: 300; @smui-font-h1-lh: 1.2;
19
+ @smui-font-h2-size: ~"clamp(1.75rem, 1.4286rem + 1.4286vw, 2.5rem)"; @smui-font-h2-weight: 300; @smui-font-h2-lh: 1.2;
20
+ @smui-font-h3-size: ~"clamp(1.5rem, 1.2857rem + 0.9524vw, 2rem)"; @smui-font-h3-weight: 400; @smui-font-h3-lh: 1.25;
21
+ @smui-font-h4-size: ~"clamp(1.375rem, 1.2143rem + 0.7143vw, 1.75rem)"; @smui-font-h4-weight: 400; @smui-font-h4-lh: 1.3;
22
+ @smui-font-h5-size: ~"clamp(1.25rem, 1.1429rem + 0.4762vw, 1.5rem)"; @smui-font-h5-weight: 500; @smui-font-h5-lh: 1.3;
18
23
  @smui-font-h6-size: 20px; @smui-font-h6-weight: 500; @smui-font-h6-lh: 1.4;
19
24
  @smui-font-subtitle1-size: 16px; @smui-font-subtitle1-weight: 500; @smui-font-subtitle1-lh: 1.5;
20
25
  @smui-font-subtitle2-size: 14px; @smui-font-subtitle2-weight: 500; @smui-font-subtitle2-lh: 1.5;
package/less/theme.less CHANGED
@@ -2,7 +2,7 @@
2
2
  Theme
3
3
  -------------------*/
4
4
  @theme: "";
5
- @themesFolder: "";
5
+ @themesFolder: "./themes";
6
6
 
7
7
  /*--------------------
8
8
  Site variables
@@ -0,0 +1,19 @@
1
+ // Runtime token layer of the per-component CSS. The default builds of
2
+ // @smwb/ui-react and @smwb/ui-solid import it from every component module,
3
+ // next to the component's <name>.entry.less: those only reference the theme
4
+ // (see _prelude.less), so without this sheet no --smui-* token is defined.
5
+ //
6
+ // :where() drops the specificity to zero. The bundler places this sheet
7
+ // with the first component module, often after the app's own CSS, so an
8
+ // app's `:root { --smui-* }` override must win regardless of load order.
9
+ // It also wins in dark mode; dark-only values go under
10
+ // :root[data-theme="dark"]. The aggregate keeps plain :root (variables.less).
11
+ @import (reference) "./_prelude.less";
12
+
13
+ :where(:root) {
14
+ .smui-tokens-light();
15
+ }
16
+
17
+ :where(:root[data-theme="dark"]) {
18
+ .smui-tokens-dark();
19
+ }
@@ -1,4 +1,9 @@
1
- :root {
1
+ // The runtime --smui-* tokens, light and dark. They are declared once, as
2
+ // mixins, because two stylesheets ship them: this file emits them on :root
3
+ // (the aggregate components.less / @smwb/ui-css, and headless-base.less), and
4
+ // tokens.entry.less emits them at zero specificity for the per-component CSS
5
+ // of @smwb/ui-react and @smwb/ui-solid.
6
+ .smui-tokens-light() {
2
7
  --smui-onSurfaceVariant: @onSurfaceVariant;
3
8
  --smui-onSurfaceColor: @onSurfaceColor;
4
9
  --smui-primaryColor: @primaryColor;
@@ -12,6 +17,7 @@
12
17
  --smui-outlineColor: @outlineColor;
13
18
  --smui-onSurfaceHover: @onSurfaceHover;
14
19
  --smui-onSurfaceActive: @onSurfaceActive;
20
+ --smui-onSurfaceFocus: @onSurfaceFocus;
15
21
  --smui-surfaceVariant: @surfaceVariant;
16
22
  --smui-disabledBgColor: @disabledBgColor;
17
23
  --smui-primaryContainer: @primaryContainer;
@@ -160,7 +166,7 @@
160
166
  --smui-bp-xl: @smui-bp-xl;
161
167
  }
162
168
 
163
- :root[data-theme="dark"] {
169
+ .smui-tokens-dark() {
164
170
  --smui-onSurfaceVariant: @onSurfaceVariantDark;
165
171
  --smui-onSurfaceColor: @onSurfaceColorDark;
166
172
  --smui-primaryColor: @primaryColorDark;
@@ -174,6 +180,7 @@
174
180
  --smui-outlineColor: @outlineColorDark;
175
181
  --smui-onSurfaceHover: @onSurfaceHoverDark;
176
182
  --smui-onSurfaceActive: @onSurfaceActiveDark;
183
+ --smui-onSurfaceFocus: @onSurfaceFocusDark;
177
184
  --smui-surfaceVariant: @surfaceVariantDark;
178
185
  --smui-disabledBgColor: @disabledBgColorDark;
179
186
  --smui-primaryContainer: @primaryContainerDark;
@@ -259,3 +266,11 @@
259
266
 
260
267
  --smui-messageBackground: @messageBgDark;
261
268
  }
269
+
270
+ :root {
271
+ .smui-tokens-light();
272
+ }
273
+
274
+ :root[data-theme="dark"] {
275
+ .smui-tokens-dark();
276
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smwb/ui-styles",
3
- "version": "1.4.3",
3
+ "version": "1.5.1",
4
4
  "description": "Framework-agnostic LESS design tokens and component styles (smwb-*) shared by the @smwb UI libraries. Prebuilt aggregate CSS lives in @smwb/ui-css.",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
@@ -19,7 +19,7 @@
19
19
  "./package.json": "./package.json"
20
20
  },
21
21
  "scripts": {
22
- "lint": "node scripts/check-aggregate.mjs"
22
+ "lint": "node scripts/check-aggregate.mjs && node scripts/check-tokens.mjs"
23
23
  },
24
24
  "homepage": "https://sourcecraft.dev/elfenmail/ui",
25
25
  "repository": {