@plexui/vue 0.25.0 → 0.27.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.
@@ -162,6 +162,17 @@ declare const TabsPublic: import("vue").DefineComponent<import("vue").ExtractPro
162
162
  type: PropType<"glass" | "flat">;
163
163
  default: undefined;
164
164
  };
165
+ /**
166
+ * Widths of the segments of horizontal tabs on a phone, as UISegmentedControl sets them. `equal` gives every
167
+ * segment the widest one's width, its default; `content` gives each its label and the same air around it, as
168
+ * `apportionsSegmentWidthsByContent` does, for a compact control. Equal segments that do not fit take their labels'
169
+ * widths anyway; where those still do not fit, the air beside each label narrows, to 4px, and what still does not
170
+ * fit scrolls. A `block` control fills its row either way. Desktop tabs always take their labels' widths. @default "equal"
171
+ */
172
+ mobileSegmentWidth: {
173
+ type: PropType<"equal" | "content">;
174
+ default: undefined;
175
+ };
165
176
  }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
166
177
  [key: string]: any;
167
178
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -251,6 +262,17 @@ declare const TabsPublic: import("vue").DefineComponent<import("vue").ExtractPro
251
262
  type: PropType<"glass" | "flat">;
252
263
  default: undefined;
253
264
  };
265
+ /**
266
+ * Widths of the segments of horizontal tabs on a phone, as UISegmentedControl sets them. `equal` gives every
267
+ * segment the widest one's width, its default; `content` gives each its label and the same air around it, as
268
+ * `apportionsSegmentWidthsByContent` does, for a compact control. Equal segments that do not fit take their labels'
269
+ * widths anyway; where those still do not fit, the air beside each label narrows, to 4px, and what still does not
270
+ * fit scrolls. A `block` control fills its row either way. Desktop tabs always take their labels' widths. @default "equal"
271
+ */
272
+ mobileSegmentWidth: {
273
+ type: PropType<"equal" | "content">;
274
+ default: undefined;
275
+ };
254
276
  }>> & Readonly<{
255
277
  onChange?: ((value: string) => any) | undefined;
256
278
  onClick?: ((event: MouseEvent) => any) | undefined;
@@ -265,6 +287,7 @@ declare const TabsPublic: import("vue").DefineComponent<import("vue").ExtractPro
265
287
  variant: TabsVariant;
266
288
  pill: boolean;
267
289
  mobileMaterial: "flat" | "glass";
290
+ mobileSegmentWidth: "content" | "equal";
268
291
  overflowLabel: string;
269
292
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
270
293
  type TabsOwnProps = InstanceType<typeof TabsPublic>["$props"];
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The widths of a phone's segmented control. Shared by the React and Vue packages (the Vue copy must match).
3
+ *
4
+ * UISegmentedControl at its own width gives every segment the widest one's width (iOS 27.2); where that does not fit,
5
+ * each segment takes its label and the same air around it, as apportionsSegmentWidthsByContent does (ref-app
6
+ * segmented-hug, 13.11), and where even that does not fit, the air beside each label narrows, to 4px, before the
7
+ * segments scroll, as UIKit narrows a squeezed control's (Calendar's Напоминание stands 4pt inside its segment). A grid
8
+ * that hugs its content cannot size its tracks to the widest one by itself (the browser sizes it by the sum of its
9
+ * labels), so the widest is measured here and set as the track. Tabs.module.css asks for one width with
10
+ * `--tabs-equal-segments: 1` and for the narrowing with `--tabs-fit-segments: 1`, on a phone's horizontal control that
11
+ * is not `block`; elsewhere nothing is set.
12
+ */
13
+ /** Sets the track and the air of the segments and says whether they changed, so a thumb on a segment that moved can
14
+ * follow. */
15
+ export declare function equalizeSegments(root: HTMLElement | null, thumb: HTMLElement | null): boolean;
16
+ /**
17
+ * Measures again when the room changes (the segments may fit one width now), when the screen crosses into or out of
18
+ * the phone block (the control starts or stops asking, its room unchanged) and when the font loads and the labels
19
+ * widen. `moved` runs when the track changed, so the thumb can follow its segment, and always once the font has
20
+ * loaded: segments sized by their labels move then with no track and no size changing. Returns the cleanup.
21
+ */
22
+ export declare function watchSegments(root: HTMLElement, thumb: () => HTMLElement | null, moved: () => void): () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/vue",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "Plex UI components for Vue 3, built on Reka UI and the shared @plexui/styles CSS",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -77,7 +77,7 @@
77
77
  "@maskito/core": "5.2.2",
78
78
  "@maskito/kit": "5.2.2",
79
79
  "@maskito/vue": "5.2.2",
80
- "@plexui/styles": "^0.4.0",
80
+ "@plexui/styles": "^0.6.0",
81
81
  "@tanstack/table-core": "8.21.3",
82
82
  "@tanstack/vue-table": "8.21.3",
83
83
  "@tiptap/core": "3.21.0",