@eifi1/ui-kit 0.15.0 → 0.15.2
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/dist/chart.d.ts +2 -1
- package/dist/components/alert-banner.js +15 -2
- package/dist/components/alert-banner.js.map +1 -1
- package/dist/components/chart.js +10 -3
- package/dist/components/chart.js.map +1 -1
- package/dist/components/facing-pair.d.ts +1 -0
- package/dist/components/series-chart-budget.d.ts +60 -0
- package/dist/components/series-chart-budget.js +56 -0
- package/dist/components/series-chart-budget.js.map +1 -0
- package/dist/components/series-chart.d.ts +54 -2
- package/dist/components/series-chart.js +71 -13
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/slider.js +6 -2
- package/dist/components/slider.js.map +1 -1
- package/dist/components/table.d.ts +12 -1
- package/dist/components/table.js +38 -0
- package/dist/components/table.js.map +1 -1
- package/dist/components/toggle-group.d.ts +9 -0
- package/dist/components/toggle-group.js +4 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/ui.js +26 -22
- package/dist/components/ui.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/alert-banner.tsx +19 -2
- package/src/components/chart.tsx +10 -3
- package/src/components/series-chart-budget.ts +121 -0
- package/src/components/series-chart.tsx +152 -8
- package/src/components/slider.tsx +6 -2
- package/src/components/table.tsx +59 -0
- package/src/components/toggle-group.tsx +13 -1
- package/src/components/ui.tsx +13 -7
package/src/components/ui.tsx
CHANGED
|
@@ -2712,8 +2712,12 @@ const TAB_VERTICAL_INACTIVE_CLASSES =
|
|
|
2712
2712
|
const TABLIST_WRAP_CLASSES =
|
|
2713
2713
|
"flex flex-wrap gap-1.5 md:flex-nowrap md:gap-1 md:overflow-x-auto md:overflow-y-hidden md:border-b md:border-[var(--border)]";
|
|
2714
2714
|
|
|
2715
|
+
// `max-w-full`: no tab outgrows its strip. A sheet's `detail` line ("Spurstangenkraft
|
|
2716
|
+
// links · … · 31 Punkte") made one tab 448px wide in a 390px strip, and a tab wider
|
|
2717
|
+
// than the strip cannot be scrolled into view — its end was simply off screen
|
|
2718
|
+
// (lenkbank L3). The label and detail truncate inside it instead; see `inner`.
|
|
2715
2719
|
const TAB_CLASSES =
|
|
2716
|
-
"whitespace-nowrap px-3 py-2 text-sm font-medium transition-colors border-b-2 -mb-px focus:outline-none focus:ring-2 focus:ring-[var(--border-strong)]";
|
|
2720
|
+
"max-w-full whitespace-nowrap px-3 py-2 text-sm font-medium transition-colors border-b-2 -mb-px focus:outline-none focus:ring-2 focus:ring-[var(--border-strong)]";
|
|
2717
2721
|
const TAB_ACTIVE_CLASSES = "border-[var(--text-primary)] text-[var(--text-primary)]";
|
|
2718
2722
|
const TAB_INACTIVE_CLASSES =
|
|
2719
2723
|
"border-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)] hover:border-[var(--border-strong)]";
|
|
@@ -2727,7 +2731,7 @@ const TAB_INACTIVE_CLASSES =
|
|
|
2727
2731
|
// all ten have to stay readable; it is the FILL, not the text weight, that says
|
|
2728
2732
|
// which one is open.
|
|
2729
2733
|
const TAB_WRAP_CLASSES =
|
|
2730
|
-
"whitespace-nowrap rounded-md px-2.5 py-2 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--border-strong)] md:rounded-none md:border-b-2 md:-mb-px md:bg-transparent md:px-3 md:py-2 md:text-sm";
|
|
2734
|
+
"max-w-full whitespace-nowrap rounded-md px-2.5 py-2 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-[var(--border-strong)] md:rounded-none md:border-b-2 md:-mb-px md:bg-transparent md:px-3 md:py-2 md:text-sm";
|
|
2731
2735
|
const TAB_WRAP_ACTIVE_CLASSES =
|
|
2732
2736
|
"bg-[var(--brand)] text-[var(--brand-contrast)] md:border-[var(--text-primary)] md:text-[var(--text-primary)]";
|
|
2733
2737
|
const TAB_WRAP_INACTIVE_CLASSES =
|
|
@@ -2944,7 +2948,7 @@ export function Tabs<T extends string>({
|
|
|
2944
2948
|
className={cn(
|
|
2945
2949
|
// In a side nav the row is the full width, so the label takes it and a
|
|
2946
2950
|
// badge lands at the row's end, where a column of counts lines up.
|
|
2947
|
-
vertical ? "flex min-w-0 flex-1 items-center gap-1.5" : "inline-flex items-center gap-1.5",
|
|
2951
|
+
vertical ? "flex min-w-0 flex-1 items-center gap-1.5" : "inline-flex max-w-full min-w-0 items-center gap-1.5",
|
|
2948
2952
|
tab.empty && TAB_EMPTY_CLASSES,
|
|
2949
2953
|
)}
|
|
2950
2954
|
>
|
|
@@ -2954,14 +2958,16 @@ export function Tabs<T extends string>({
|
|
|
2954
2958
|
</span>
|
|
2955
2959
|
)}
|
|
2956
2960
|
{tab.detail != null ? (
|
|
2957
|
-
|
|
2958
|
-
|
|
2961
|
+
// `min-w-0` + `truncate` on each line: capped by the tab's `max-w-full`, a
|
|
2962
|
+
// long detail ends in an ellipsis. The whole text stays the tab's name.
|
|
2963
|
+
<span className="flex min-w-0 flex-col items-start text-start">
|
|
2964
|
+
<span className="max-w-full truncate">{tab.label}</span>
|
|
2959
2965
|
{/* A separator for the NAME only — whitespace between flex items is
|
|
2960
2966
|
not drawn, and without it the two lines ran together into one
|
|
2961
2967
|
word for a screen reader ("80 km/hloop 2"). */}{" "}
|
|
2962
2968
|
<span
|
|
2963
2969
|
className={cn(
|
|
2964
|
-
"text-[11px] font-normal leading-tight text-[var(--text-muted)]",
|
|
2970
|
+
"max-w-full truncate text-[11px] font-normal leading-tight text-[var(--text-muted)]",
|
|
2965
2971
|
// On a wrapped strip's filled chip (below `md`) the muted grey
|
|
2966
2972
|
// was dark text on the brand fill — "loop 2" all but vanished
|
|
2967
2973
|
// under the one label that most needed reading. It takes the
|
|
@@ -3025,7 +3031,7 @@ export function Tabs<T extends string>({
|
|
|
3025
3031
|
// The × cannot go INSIDE the tab: a button in a button is invalid HTML, and
|
|
3026
3032
|
// a tab's children are presentational, so a reader would flatten it into the
|
|
3027
3033
|
// tab's name. It sits beside the tab, over the gutter the tab reserves.
|
|
3028
|
-
<div key={tab.id} className={cn("relative flex", !vertical && "shrink-0")}>
|
|
3034
|
+
<div key={tab.id} className={cn("relative flex max-w-full", !vertical && "shrink-0")}>
|
|
3029
3035
|
{element}
|
|
3030
3036
|
{isActive && (
|
|
3031
3037
|
<IconButton
|