@fragment-build/ui 4.0.0 → 4.0.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.
@@ -72,6 +72,13 @@
72
72
 
73
73
  .fragment-sidebar__collapsed-nav {
74
74
  @apply flex flex-col gap-1;
75
+
76
+ /* The active item looks selected the same way at either rail width: the soft fill. */
77
+ .button--primary {
78
+ @apply bg-accent-soft;
79
+ color: var(--sidebar-accent-soft-foreground, var(--accent-soft-foreground));
80
+ }
81
+
75
82
  & svg {
76
83
  @apply size-[18px]! shrink-0 self-center;
77
84
  }
@@ -15,6 +15,6 @@ export const StatCard = ({ label, value, icon, delta, hint, help, helpLabel = 'M
15
15
  const sentiment = delta?.sentiment ?? (delta?.direction === 'up' ? 'positive' : delta?.direction === 'down' ? 'negative' : 'neutral');
16
16
  const v = statCard({ emphasis, sentiment });
17
17
  const DeltaIcon = delta ? deltaIcon[delta.direction] : null;
18
- return (_jsxs(Card, { className: v.base({ className }), children: [_jsxs("div", { className: v.top(), children: [_jsxs("span", { className: v.label(), children: [label, help && (_jsxs(Tooltip, { delay: 0, children: [_jsx(Tooltip.Trigger, { className: v.help(), "aria-label": helpLabel, tabIndex: 0, children: _jsx(IconInfoCircle, { size: 14, stroke: 1.75 }) }), _jsx(Tooltip.Content, { className: "max-w-xs", children: help })] }))] }), icon && _jsx("span", { className: v.icon(), children: icon })] }), isLoading ? (_jsx(Skeleton, { className: v.skeleton() })) : (_jsxs("div", { className: v.valueRow(), children: [_jsx("span", { className: v.value(), children: value }), delta && DeltaIcon && (_jsxs("span", { className: v.delta(), children: [_jsx(DeltaIcon, { size: 14, stroke: 2 }), delta.value] }))] })), (hint || delta?.label) && !isLoading && (_jsx("p", { className: v.hint(), children: hint ?? delta?.label }))] }));
18
+ return (_jsxs(Card, { className: v.base({ className }), children: [_jsxs("div", { className: v.top(), children: [_jsxs("span", { className: v.label(), children: [_jsx("span", { className: "truncate", children: label }), help && (_jsxs(Tooltip, { delay: 0, children: [_jsx(Tooltip.Trigger, { className: v.help(), "aria-label": helpLabel, tabIndex: 0, children: _jsx(IconInfoCircle, { size: 14, stroke: 1.75 }) }), _jsx(Tooltip.Content, { className: "max-w-xs", children: help })] }))] }), icon && _jsx("span", { className: v.icon(), children: icon })] }), isLoading ? (_jsx(Skeleton, { className: v.skeleton() })) : (_jsxs("div", { className: v.valueRow(), children: [_jsx("span", { className: v.value(), children: value }), delta && DeltaIcon && (_jsxs("span", { className: v.delta(), children: [_jsx(DeltaIcon, { size: 14, stroke: 2 }), delta.value] }))] })), (hint || delta?.label) && !isLoading && (_jsx("p", { className: v.hint(), children: hint ?? delta?.label }))] }));
19
19
  };
20
20
  //# sourceMappingURL=StatCard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StatCard.js","sourceRoot":"","sources":["../../src/fragments/stat/StatCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtG,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAgC7C,MAAM,SAAS,GAAG;IAChB,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,SAAS;CACP,CAAC;AAEX,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAChD,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,GAAG,kBAAkB,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,GACtG,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,IAAI,CACpC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CA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,CACP,EACA,CAAC,IAAI,IAAI,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CACvC,YAAG,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,YAAG,IAAI,IAAI,KAAK,EAAE,KAAK,GAAK,CACnD,IACI,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -3,8 +3,9 @@
3
3
  @apply p-5 gap-4 min-w-0;
4
4
  }
5
5
 
6
+ /* Wraps, so a long title and its controls share the row when they fit and stack when they do not. */
6
7
  .fragment-widget__header {
7
- @apply p-0 flex flex-row items-start gap-3;
8
+ @apply p-0 flex flex-row flex-wrap items-start gap-3;
8
9
  }
9
10
 
10
11
  .fragment-widget__header-start {
@@ -12,7 +13,7 @@
12
13
  }
13
14
 
14
15
  .fragment-widget__heading {
15
- @apply min-w-0 flex-1;
16
+ @apply min-w-48 flex-1;
16
17
  }
17
18
 
18
19
  .fragment-widget__title {
package/index.css CHANGED
@@ -62,10 +62,27 @@
62
62
  @apply border border-border shadow-none;
63
63
  }
64
64
 
65
+ /*
66
+ * Text that has to fit, in any language. Single-line controls keep one line and end in an
67
+ * ellipsis when a translation is longer than the room it has: HeroUI breaks a Select's value
68
+ * onto a second line instead ("Alle / Oberflächen"), which grows the trigger out of its row.
69
+ * The trigger may shrink, so the ellipsis — not an overflow — is what absorbs the difference.
70
+ */
71
+ .select__trigger {
72
+ @apply min-w-0 items-center;
73
+ }
74
+
75
+ .select__value {
76
+ @apply min-w-0 truncate;
77
+ overflow-wrap: normal;
78
+ }
79
+
80
+ .chip {
81
+ @apply max-w-full whitespace-nowrap;
82
+ }
83
+
84
+ /* The thumb keeps HeroUI's accent ring: transparent, only a white knob was left, invisible on a white card. */
65
85
  .slider {
66
- .slider__thumb {
67
- @apply bg-transparent;
68
- }
69
86
  &[data-orientation="horizontal"] {
70
87
  .slider__track {
71
88
  @apply h-1;
@@ -82,6 +99,19 @@
82
99
  @apply rounded-xl;
83
100
  }
84
101
 
102
+ /*
103
+ * HeroUI sets a modal's body in the muted colour, which suits a one-line confirmation and greys
104
+ * out every heading and label in a dialog that holds a form. Body copy is ink here; a dialog that
105
+ * only says something mutes its own message. The heading gets the weight of a page section.
106
+ */
107
+ .modal__body {
108
+ @apply text-foreground;
109
+ }
110
+
111
+ .modal__heading {
112
+ @apply text-lg font-semibold;
113
+ }
114
+
85
115
  .tabs {
86
116
  &:not(.tabs--secondary) {
87
117
  .tabs__list {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fragment-build/ui",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -72,6 +72,13 @@
72
72
 
73
73
  .fragment-sidebar__collapsed-nav {
74
74
  @apply flex flex-col gap-1;
75
+
76
+ /* The active item looks selected the same way at either rail width: the soft fill. */
77
+ .button--primary {
78
+ @apply bg-accent-soft;
79
+ color: var(--sidebar-accent-soft-foreground, var(--accent-soft-foreground));
80
+ }
81
+
75
82
  & svg {
76
83
  @apply size-[18px]! shrink-0 self-center;
77
84
  }
@@ -3,8 +3,9 @@
3
3
  @apply p-5 gap-4 min-w-0;
4
4
  }
5
5
 
6
+ /* Wraps, so a long title and its controls share the row when they fit and stack when they do not. */
6
7
  .fragment-widget__header {
7
- @apply p-0 flex flex-row items-start gap-3;
8
+ @apply p-0 flex flex-row flex-wrap items-start gap-3;
8
9
  }
9
10
 
10
11
  .fragment-widget__header-start {
@@ -12,7 +13,7 @@
12
13
  }
13
14
 
14
15
  .fragment-widget__heading {
15
- @apply min-w-0 flex-1;
16
+ @apply min-w-48 flex-1;
16
17
  }
17
18
 
18
19
  .fragment-widget__title {
package/src/index.css CHANGED
@@ -62,10 +62,27 @@
62
62
  @apply border border-border shadow-none;
63
63
  }
64
64
 
65
+ /*
66
+ * Text that has to fit, in any language. Single-line controls keep one line and end in an
67
+ * ellipsis when a translation is longer than the room it has: HeroUI breaks a Select's value
68
+ * onto a second line instead ("Alle / Oberflächen"), which grows the trigger out of its row.
69
+ * The trigger may shrink, so the ellipsis — not an overflow — is what absorbs the difference.
70
+ */
71
+ .select__trigger {
72
+ @apply min-w-0 items-center;
73
+ }
74
+
75
+ .select__value {
76
+ @apply min-w-0 truncate;
77
+ overflow-wrap: normal;
78
+ }
79
+
80
+ .chip {
81
+ @apply max-w-full whitespace-nowrap;
82
+ }
83
+
84
+ /* The thumb keeps HeroUI's accent ring: transparent, only a white knob was left, invisible on a white card. */
65
85
  .slider {
66
- .slider__thumb {
67
- @apply bg-transparent;
68
- }
69
86
  &[data-orientation="horizontal"] {
70
87
  .slider__track {
71
88
  @apply h-1;
@@ -82,6 +99,19 @@
82
99
  @apply rounded-xl;
83
100
  }
84
101
 
102
+ /*
103
+ * HeroUI sets a modal's body in the muted colour, which suits a one-line confirmation and greys
104
+ * out every heading and label in a dialog that holds a form. Body copy is ink here; a dialog that
105
+ * only says something mutes its own message. The heading gets the weight of a page section.
106
+ */
107
+ .modal__body {
108
+ @apply text-foreground;
109
+ }
110
+
111
+ .modal__heading {
112
+ @apply text-lg font-semibold;
113
+ }
114
+
85
115
  .tabs {
86
116
  &:not(.tabs--secondary) {
87
117
  .tabs__list {