@plexui/vue 0.22.0 → 0.24.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 (93) hide show
  1. package/dist/es/components/Alert/Alert.js +16 -4
  2. package/dist/es/components/Alert/Alert.js.map +1 -1
  3. package/dist/es/components/ColorPicker/ColorPicker.js +13 -9
  4. package/dist/es/components/ColorPicker/ColorPicker.js.map +1 -1
  5. package/dist/es/components/ColorPicker/ColorWell.js +5 -3
  6. package/dist/es/components/ColorPicker/ColorWell.js.map +1 -1
  7. package/dist/es/components/ColorPicker/shared.js +5 -4
  8. package/dist/es/components/ColorPicker/shared.js.map +1 -1
  9. package/dist/es/components/ContextMenu/ContextMenu.js +9 -9
  10. package/dist/es/components/ContextMenu/ContextMenu.js.map +1 -1
  11. package/dist/es/components/ContextMenu/shared.js +25 -5
  12. package/dist/es/components/ContextMenu/shared.js.map +1 -1
  13. package/dist/es/components/DatePicker/CalendarNavigationIcon.js +8 -15
  14. package/dist/es/components/DatePicker/CalendarNavigationIcon.js.map +1 -1
  15. package/dist/es/components/DatePicker/DatePicker.js +3 -3
  16. package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
  17. package/dist/es/components/DatePicker/useCalendarCollisionPadding.js +25 -0
  18. package/dist/es/components/DatePicker/useCalendarCollisionPadding.js.map +1 -0
  19. package/dist/es/components/DateRangePicker/DateRangePicker.js +3 -3
  20. package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
  21. package/dist/es/components/Dialog/Dialog.js +75 -24
  22. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  23. package/dist/es/components/Dialog/index.js.map +1 -1
  24. package/dist/es/components/Dialog/sheetDrag.js +3 -1
  25. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  26. package/dist/es/components/Icon/svg/FilterBadge.js +1 -1
  27. package/dist/es/components/Icon/svg/FilterBadge.js.map +1 -1
  28. package/dist/es/components/Input/Input.js +3 -0
  29. package/dist/es/components/Input/Input.js.map +1 -1
  30. package/dist/es/components/Menu/Menu.js +10 -1
  31. package/dist/es/components/Menu/Menu.js.map +1 -1
  32. package/dist/es/components/PhoneLayout/PhoneLayout.js +9 -1
  33. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -1
  34. package/dist/es/components/Popover/Popover.js +2 -2
  35. package/dist/es/components/Popover/Popover.js.map +1 -1
  36. package/dist/es/components/ProgressSteps/ProgressSteps.js +7 -3
  37. package/dist/es/components/ProgressSteps/ProgressSteps.js.map +1 -1
  38. package/dist/es/components/ProgressSteps/index.js.map +1 -1
  39. package/dist/es/components/Select/Select.js +178 -32
  40. package/dist/es/components/Select/Select.js.map +1 -1
  41. package/dist/es/components/SelectControl/SelectControl.js +3 -1
  42. package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
  43. package/dist/es/components/Slider/Slider.js +24 -11
  44. package/dist/es/components/Slider/Slider.js.map +1 -1
  45. package/dist/es/components/Slider/sliderPrimitive.js +5 -2
  46. package/dist/es/components/Slider/sliderPrimitive.js.map +1 -1
  47. package/dist/es/components/Sortable/Sortable.js +1 -1
  48. package/dist/es/components/Sortable/Sortable.js.map +1 -1
  49. package/dist/es/components/StatCard/index.js +4 -1
  50. package/dist/es/components/StatCard/index.js.map +1 -1
  51. package/dist/es/components/{StatCard/StatCard.js → StatsCard/StatsCard.js} +32 -27
  52. package/dist/es/components/StatsCard/StatsCard.js.map +1 -0
  53. package/dist/es/components/StatsCard/index.js +2 -0
  54. package/dist/es/components/StatsCard/index.js.map +1 -0
  55. package/dist/es/components/SwipeActions/SwipeActions.js +32 -5
  56. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -1
  57. package/dist/es/components/TabBar/TabBar.js +52 -21
  58. package/dist/es/components/TabBar/TabBar.js.map +1 -1
  59. package/dist/es/components/Tabs/Tabs.js +229 -6
  60. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  61. package/dist/es/components/Toast/index.js.map +1 -1
  62. package/dist/es/components/Toast/toast.js +3 -1
  63. package/dist/es/components/Toast/toast.js.map +1 -1
  64. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  65. package/dist/es/lib/menuTriggerCover.js +40 -3
  66. package/dist/es/lib/menuTriggerCover.js.map +1 -1
  67. package/dist/types/components/ColorPicker/ColorPicker.d.ts +3 -2
  68. package/dist/types/components/ColorPicker/shared.d.ts +5 -4
  69. package/dist/types/components/ContextMenu/shared.d.ts +28 -6
  70. package/dist/types/components/DatePicker/useCalendarCollisionPadding.d.ts +9 -0
  71. package/dist/types/components/Dialog/Dialog.d.ts +56 -14
  72. package/dist/types/components/Dialog/index.d.ts +1 -1
  73. package/dist/types/components/Dialog/sheetDrag.d.ts +2 -1
  74. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +5 -0
  75. package/dist/types/components/Popover/Popover.d.ts +5 -5
  76. package/dist/types/components/ProgressSteps/ProgressSteps.d.ts +17 -3
  77. package/dist/types/components/ProgressSteps/index.d.ts +1 -1
  78. package/dist/types/components/Select/Select.d.ts +19 -8
  79. package/dist/types/components/StatCard/index.d.ts +9 -1
  80. package/dist/types/components/{StatCard/StatCard.d.ts → StatsCard/StatsCard.d.ts} +19 -19
  81. package/dist/types/components/StatsCard/index.d.ts +1 -0
  82. package/dist/types/components/SwipeActions/SwipeActions.d.ts +6 -6
  83. package/dist/types/components/TabBar/TabBar.d.ts +34 -0
  84. package/dist/types/components/Tabs/Tabs.d.ts +33 -2
  85. package/dist/types/components/Toast/index.d.ts +1 -1
  86. package/dist/types/components/Toast/toast.d.ts +11 -2
  87. package/dist/types/components/Toolbar/Toolbar.d.ts +1 -1
  88. package/dist/types/lib/menuTriggerCover.d.ts +16 -2
  89. package/package.json +2 -2
  90. package/dist/es/components/DatePicker/useCalendarGutter.js +0 -14
  91. package/dist/es/components/DatePicker/useCalendarGutter.js.map +0 -1
  92. package/dist/es/components/StatCard/StatCard.js.map +0 -1
  93. package/dist/types/components/DatePicker/useCalendarGutter.d.ts +0 -2
@@ -26,6 +26,14 @@ declare const TabBarItemComponent: import("vue").DefineComponent<import("vue").E
26
26
  };
27
27
  /** Makes the tab a link to this URL. */
28
28
  href: StringConstructor;
29
+ /**
30
+ * A count or a short word in a red capsule over the symbol, as an iOS tab badge; it is read after the label.
31
+ * A count of 0 shows none, as on iOS.
32
+ */
33
+ badge: {
34
+ type: (StringConstructor | NumberConstructor)[];
35
+ default: undefined;
36
+ };
29
37
  /** When `true`, the tab cannot be selected. */
30
38
  disabled: {
31
39
  type: BooleanConstructor;
@@ -54,6 +62,14 @@ declare const TabBarItemComponent: import("vue").DefineComponent<import("vue").E
54
62
  };
55
63
  /** Makes the tab a link to this URL. */
56
64
  href: StringConstructor;
65
+ /**
66
+ * A count or a short word in a red capsule over the symbol, as an iOS tab badge; it is read after the label.
67
+ * A count of 0 shows none, as on iOS.
68
+ */
69
+ badge: {
70
+ type: (StringConstructor | NumberConstructor)[];
71
+ default: undefined;
72
+ };
57
73
  /** When `true`, the tab cannot be selected. */
58
74
  disabled: {
59
75
  type: BooleanConstructor;
@@ -68,6 +84,7 @@ declare const TabBarItemComponent: import("vue").DefineComponent<import("vue").E
68
84
  onClick?: ((event: MouseEvent) => any) | undefined;
69
85
  }>, {
70
86
  disabled: boolean;
87
+ badge: string | number;
71
88
  hideLabel: boolean;
72
89
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
73
90
  /** Props of `TabBarItem`. */
@@ -86,6 +103,14 @@ export declare const TabBarItem: import("vue").DefineComponent<import("vue").Ext
86
103
  };
87
104
  /** Makes the tab a link to this URL. */
88
105
  href: StringConstructor;
106
+ /**
107
+ * A count or a short word in a red capsule over the symbol, as an iOS tab badge; it is read after the label.
108
+ * A count of 0 shows none, as on iOS.
109
+ */
110
+ badge: {
111
+ type: (StringConstructor | NumberConstructor)[];
112
+ default: undefined;
113
+ };
89
114
  /** When `true`, the tab cannot be selected. */
90
115
  disabled: {
91
116
  type: BooleanConstructor;
@@ -114,6 +139,14 @@ export declare const TabBarItem: import("vue").DefineComponent<import("vue").Ext
114
139
  };
115
140
  /** Makes the tab a link to this URL. */
116
141
  href: StringConstructor;
142
+ /**
143
+ * A count or a short word in a red capsule over the symbol, as an iOS tab badge; it is read after the label.
144
+ * A count of 0 shows none, as on iOS.
145
+ */
146
+ badge: {
147
+ type: (StringConstructor | NumberConstructor)[];
148
+ default: undefined;
149
+ };
117
150
  /** When `true`, the tab cannot be selected. */
118
151
  disabled: {
119
152
  type: BooleanConstructor;
@@ -128,6 +161,7 @@ export declare const TabBarItem: import("vue").DefineComponent<import("vue").Ext
128
161
  onClick?: ((event: MouseEvent) => any) | undefined;
129
162
  }>, {
130
163
  disabled: boolean;
164
+ badge: string | number;
131
165
  hideLabel: boolean;
132
166
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
133
167
  declare const TabBarComponent: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -116,7 +116,11 @@ declare const TabsPublic: import("vue").DefineComponent<import("vue").ExtractPro
116
116
  type: PropType<TabsOrientation>;
117
117
  default: string;
118
118
  };
119
- /** Controls the size of the tabs, `3xs` (22px) to `3xl` (48px). @default "md" */
119
+ /**
120
+ * Controls the size of the tabs, `3xs` (22px) to `3xl` (48px). On a phone horizontal tabs take the two sizes of
121
+ * the iOS 27 segmented control: `sm` and smaller the small 32px one, `md` and larger the large 48px one (49px with
122
+ * `mobileMaterial="flat"`). @default "md"
123
+ */
120
124
  size: {
121
125
  type: PropType<ControlSize>;
122
126
  default: string;
@@ -147,6 +151,17 @@ declare const TabsPublic: import("vue").DefineComponent<import("vue").ExtractPro
147
151
  type: BooleanConstructor;
148
152
  default: boolean;
149
153
  };
154
+ /**
155
+ * Phone surface of horizontal tabs. On a phone the large control (`md` and larger) is the glass capsule of iOS 27
156
+ * apps and the small one (`sm` and smaller) the plain capsule of SwiftUI's segmented Picker; `flat` gives the large
157
+ * one the plain look of SwiftUI's `.controlSize(.large)`, and `glass` gives the small one `.glassEffect()`, like the
158
+ * Button prop of the same name. Inside a phone Toolbar the control is the large glass one anyway. Desktop keeps the
159
+ * chosen variant. @default "glass" at md and larger, "flat" at sm and smaller
160
+ */
161
+ mobileMaterial: {
162
+ type: PropType<"glass" | "flat">;
163
+ default: undefined;
164
+ };
150
165
  }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
151
166
  [key: string]: any;
152
167
  }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -190,7 +205,11 @@ declare const TabsPublic: import("vue").DefineComponent<import("vue").ExtractPro
190
205
  type: PropType<TabsOrientation>;
191
206
  default: string;
192
207
  };
193
- /** Controls the size of the tabs, `3xs` (22px) to `3xl` (48px). @default "md" */
208
+ /**
209
+ * Controls the size of the tabs, `3xs` (22px) to `3xl` (48px). On a phone horizontal tabs take the two sizes of
210
+ * the iOS 27 segmented control: `sm` and smaller the small 32px one, `md` and larger the large 48px one (49px with
211
+ * `mobileMaterial="flat"`). @default "md"
212
+ */
194
213
  size: {
195
214
  type: PropType<ControlSize>;
196
215
  default: string;
@@ -221,6 +240,17 @@ declare const TabsPublic: import("vue").DefineComponent<import("vue").ExtractPro
221
240
  type: BooleanConstructor;
222
241
  default: boolean;
223
242
  };
243
+ /**
244
+ * Phone surface of horizontal tabs. On a phone the large control (`md` and larger) is the glass capsule of iOS 27
245
+ * apps and the small one (`sm` and smaller) the plain capsule of SwiftUI's segmented Picker; `flat` gives the large
246
+ * one the plain look of SwiftUI's `.controlSize(.large)`, and `glass` gives the small one `.glassEffect()`, like the
247
+ * Button prop of the same name. Inside a phone Toolbar the control is the large glass one anyway. Desktop keeps the
248
+ * chosen variant. @default "glass" at md and larger, "flat" at sm and smaller
249
+ */
250
+ mobileMaterial: {
251
+ type: PropType<"glass" | "flat">;
252
+ default: undefined;
253
+ };
224
254
  }>> & Readonly<{
225
255
  onChange?: ((value: string) => any) | undefined;
226
256
  onClick?: ((event: MouseEvent) => any) | undefined;
@@ -234,6 +264,7 @@ declare const TabsPublic: import("vue").DefineComponent<import("vue").ExtractPro
234
264
  overflow: "menu" | "scroll";
235
265
  variant: TabsVariant;
236
266
  pill: boolean;
267
+ mobileMaterial: "flat" | "glass";
237
268
  overflowLabel: string;
238
269
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
239
270
  type TabsOwnProps = InstanceType<typeof TabsPublic>["$props"];
@@ -1,3 +1,3 @@
1
1
  export { Toaster, compact, type ToasterProps } from "./Toaster.js";
2
- export { toast } from "./toast.js";
2
+ export { toast, type ToastOptions } from "./toast.js";
3
3
  export type { Action, ExternalToast, ToastT } from "vue-sonner";
@@ -1,2 +1,11 @@
1
- import { toast as sonnerToast } from "vue-sonner";
2
- export declare const toast: typeof sonnerToast;
1
+ import { toast as sonnerToast, type ExternalToast } from "vue-sonner";
2
+ type Message = Parameters<typeof sonnerToast>[0];
3
+ /** vue-sonner's options; `icon: null` leaves a typed toast's icon out, as sonner's React `icon: null` does. */
4
+ export type ToastOptions = Omit<ExternalToast, "icon"> & {
5
+ icon?: ExternalToast["icon"] | null;
6
+ };
7
+ type Show = (message: Message, data?: ToastOptions) => string | number;
8
+ type Typed = "success" | "info" | "warning" | "error" | "message" | "loading";
9
+ type PlexToast = Show & Omit<typeof sonnerToast, Typed> & Record<Typed, Show>;
10
+ export declare const toast: PlexToast;
11
+ export {};
@@ -17,7 +17,7 @@ export type BarBackground = "soft" | "hard" | "glass" | "solid";
17
17
  export type ToolbarBackground = BarBackground | "edge";
18
18
  /**
19
19
  * A surface that places phone toolbars: `Page` puts the top bar over its content
20
- * and reserves the space; `Dialog` puts it under the Sheet's grabber.
20
+ * and reserves the space; `Dialog` puts it 16px under the Sheet's top edge.
21
21
  */
22
22
  export type ToolbarHost = {
23
23
  kind: "page" | "dialog";
@@ -11,9 +11,23 @@ export type MenuTriggerCover = {
11
11
  * the upper half, upward from one in the lower half even when it would fit below (IMG_5688, the Icon and List Size
12
12
  * row of Files' View Options; IMG_5687, IMG_5689, and IMG_5693 from a bottom bar). Reports the side offset that puts
13
13
  * the panel there, minus the control's height, and that side, while the screen is a phone, and `null` on a larger one,
14
- * where the menu keeps its gap below the control.
14
+ * where the menu keeps its gap below the control. `windowOnly` takes only a phone-wide window for a phone, for a list
15
+ * that is laid out as on a phone only there (Select: its list keeps no phone scope in a PhoneLayout).
15
16
  */
16
- export declare function observeMenuTriggerCover(trigger: HTMLElement, onChange: (cover: MenuTriggerCover | null) => void): () => void;
17
+ export declare function observeMenuTriggerCover(trigger: HTMLElement, onChange: (cover: MenuTriggerCover | null) => void, { windowOnly }?: {
18
+ windowOnly?: boolean;
19
+ }): () => void;
20
+ /**
21
+ * A phone menu that covers its trigger whole hides it while it is open, as iOS 27.2 turns a bar button into its menu
22
+ * (ref-app menus-bar, block 8: the More button is gone under the panel). Kept, the round 44pt button showed past the
23
+ * panel's 34pt corner and through its glass. A trigger the panel leaves a part of uncovered stays: one wider than the
24
+ * panel (a form row), one beside it (an align offset), one at the screen's edge past a panel kept off that edge.
25
+ * Marks the trigger `data-menu-covered` (touch.css) while it lies within the panel's resting box, and clears the mark
26
+ * on cleanup. That box is the primitive's positioned wrapper around the panel: the panel itself grows in from a
27
+ * smaller scale as it opens. The boxes are read again whenever the wrapper moves or either element resizes: the
28
+ * wrapper first stands off screen until it is placed, and a panel can mount with no size yet.
29
+ */
30
+ export declare function markCoveredMenuTrigger(trigger: HTMLElement, content: HTMLElement): () => void;
17
31
  /**
18
32
  * A mouse opens a menu when its button goes down, so on a phone-wide window the menu that covers the trigger is under
19
33
  * the pointer when the button comes up, and that release would choose the item there. Cancels the release of the press
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plexui/vue",
3
- "version": "0.22.0",
3
+ "version": "0.24.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.1.46",
80
+ "@plexui/styles": "^0.3.0",
81
81
  "@tanstack/table-core": "8.21.3",
82
82
  "@tanstack/vue-table": "8.21.3",
83
83
  "@tiptap/core": "3.21.0",
@@ -1,14 +0,0 @@
1
- import { computed, onBeforeUnmount, onMounted, ref } from "vue";
2
- // Mirrors React's useWindowSize subscription; the CSS uses the same gutter
3
- // formula so Popover's numeric collision padding matches the rendered width.
4
- export const useCalendarGutter = () => {
5
- const width = ref();
6
- const update = () => { width.value = window.innerWidth; };
7
- onMounted(() => {
8
- update();
9
- window.addEventListener("resize", update);
10
- });
11
- onBeforeUnmount(() => window.removeEventListener("resize", update));
12
- return computed(() => width.value === undefined ? 16 : Math.max(3, Math.min(16, (width.value - 308) / 4)));
13
- };
14
- //# sourceMappingURL=useCalendarGutter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useCalendarGutter.js","sourceRoot":"","sources":["../../../../src/components/DatePicker/useCalendarGutter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAoB,MAAM,KAAK,CAAA;AAEjF,2EAA2E;AAC3E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAwB,EAAE;IACzD,MAAM,KAAK,GAAG,GAAG,EAAU,CAAA;IAC3B,MAAM,MAAM,GAAG,GAAG,EAAE,GAAG,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,UAAU,CAAA,CAAC,CAAC,CAAA;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,CAAA;QACR,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IACF,eAAe,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAA;IAEnE,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AAC5G,CAAC,CAAA","sourcesContent":["import { computed, onBeforeUnmount, onMounted, ref, type ComputedRef } from \"vue\"\n\n// Mirrors React's useWindowSize subscription; the CSS uses the same gutter\n// formula so Popover's numeric collision padding matches the rendered width.\nexport const useCalendarGutter = (): ComputedRef<number> => {\n const width = ref<number>()\n const update = () => { width.value = window.innerWidth }\n\n onMounted(() => {\n update()\n window.addEventListener(\"resize\", update)\n })\n onBeforeUnmount(() => window.removeEventListener(\"resize\", update))\n\n return computed(() => width.value === undefined ? 16 : Math.max(3, Math.min(16, (width.value - 308) / 4)))\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"StatCard.js","sourceRoot":"","sources":["../../../../src/components/StatCard/StatCard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAsC,MAAM,KAAK,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,CAAC,MAAM,wDAAwD,CAAA;AAyBtE,MAAM,iBAAiB,GAAG,eAAe,CAAC;IACxC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE;QACL,kCAAkC;QAClC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;QACvC,6FAA6F;QAC7F,KAAK,EAAE,EAAE,IAAI,E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AE,EAAE,CAAA;YAC/B,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;YAEzE,OAAO,CAAC,CACN,KAAK,EACL;gBACE,OAAO,EAAE,CAAC,CAAC,QAAQ;gBACnB,cAAc,EAAE,KAAK,CAAC,OAAO;gBAC7B,WAAW,EAAE,KAAK,CAAC,IAAI;gBACvB,mBAAmB,EAAE,KAAK,CAAC,WAAW;aACvC,EACD,UAAU,CAAC,QAAQ,CAAC;gBAClB,CAAC,CAAC;oBACE,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE;wBAC1B,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,QAAQ,CAAC;wBAC5C,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC;qBACxC,CAAC;iBACH;gBACH,CAAC,CAAC,OAAO,CACZ,CAAA;QACH,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA;AAOF,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAqF,CAAA","sourcesContent":["import { defineComponent, h, type HTMLAttributes, type PropType } from \"vue\"\nimport { Badge } from \"../Badge/index.js\"\nimport { InfoCircle } from \"../Icon/index.js\"\nimport { Tooltip } from \"../Tooltip/index.js\"\nimport { hasContent } from \"../../lib/slotContent.js\"\nimport s from \"@plexui/styles/components/StatCard/StatCard.module.css\"\n\n// Vue port of packages/ui/src/components/StatCard/StatCard.tsx. Props,\n// defaults and rendered DOM match React (checked by the parity tests).\n// ReactNode props are slots: `value` (also a prop, for plain values),\n// `icon` and `sparkline`. React spreads the remaining props after its own\n// attributes, so caller attributes win; Vue's fallthrough does the same.\n\nexport type StatCardTrend = {\n /** The percentage change value (e.g. 12.5 for +12.5%) */\n value: number\n /** Optional label for the trend (e.g. \"vs last month\") */\n label?: string\n}\n\nexport type StatCardAccentColor =\n | \"primary\"\n | \"secondary\"\n | \"info\"\n | \"success\"\n | \"warning\"\n | \"danger\"\n | \"discovery\"\n | \"caution\"\n\nconst StatCardComponent = defineComponent({\n name: \"StatCard\",\n props: {\n /** Label describing the metric */\n label: { type: String, required: true },\n /** The primary metric value (e.g. \"1,234\" or \"$50K\"); the `value` slot takes rich content */\n value: { type: [String, Number] as PropType<string | number>, default: undefined },\n /** Optional description or subtitle below the value */\n description: String,\n /** Trend indicator with percentage change */\n trend: Object as PropType<StatCardTrend>,\n /** When true, a positive trend is bad (red) and negative is good (green). Use for metrics like \"Error Rate\" or \"Avg Completion Time\". */\n invertTrend: { type: Boolean, default: undefined },\n /** Progress value from 0 to 100. Shows a progress bar at the bottom. */\n progress: Number,\n /** Label displayed next to the progress bar */\n progressLabel: String,\n /** Tooltip text: renders an (i) icon next to the label with a tooltip on hover */\n tooltip: String,\n /** Where the trend indicator is positioned: next to the value, or right-aligned in the header row. @default \"value\" */\n trendPosition: { type: String as PropType<\"value\" | \"header\">, default: \"value\" },\n /** Visual style of the trend indicator: plain colored text, or a Badge. @default \"text\" */\n trendVariant: { type: String as PropType<\"text\" | \"badge\">, default: \"text\" },\n /** Size of the card: standard dashboard card, or compact for dense layouts. @default \"default\" */\n size: { type: String as PropType<\"default\" | \"sm\">, default: \"default\" },\n /** Visual variant of the card. @default \"default\" */\n variant: { type: String as PropType<\"default\" | \"accent\">, default: \"default\" },\n /** Accent border color for the \"accent\" variant. @default \"primary\" */\n accentColor: { type: String as PropType<StatCardAccentColor>, default: \"primary\" },\n },\n setup(props, { slots }) {\n return () => {\n const { label, description, trend, invertTrend, progress, progressLabel, tooltip, trendPosition, trendVariant } =\n props\n\n const trendValue = trend?.value ?? 0\n const trendClassName =\n trendValue === 0\n ? s.TrendNeutral\n : trendValue > 0\n ? invertTrend\n ? s.TrendNegative\n : s.TrendPositive\n : invertTrend\n ? s.TrendPositive\n : s.TrendNegative\n\n const trendText = `${trendValue > 0 ? \"+\" : \"\"}${trendValue}%`\n const progressValue = progress === undefined ? undefined : Math.min(100, Math.max(0, progress))\n\n const trendBadgeColor =\n trendValue === 0\n ? \"secondary\"\n : trendValue > 0\n ? invertTrend\n ? \"danger\"\n : \"success\"\n : invertTrend\n ? \"success\"\n : \"danger\"\n\n const trendEl =\n trend != null\n ? trendVariant === \"badge\"\n ? h(Badge, { size: \"sm\", color: trendBadgeColor }, { default: () => trendText })\n : h(\"div\", { class: [s.Trend, trendClassName] }, trendText)\n : null\n\n const headerEl = h(\"div\", { class: s.Header }, [\n h(\"div\", { class: s.LabelRow }, [\n h(\"div\", { class: s.Label }, label),\n tooltip\n ? h(\n Tooltip,\n { content: tooltip },\n {\n // Focusable and named so keyboard and screen-reader users reach the tooltip\n default: () =>\n h(\"span\", { \"class\": s.InfoIcon, \"tabindex\": 0, \"role\": \"img\", \"aria-label\": \"More information\" }, [\n h(InfoCircle),\n ]),\n },\n )\n : null,\n ]),\n trendPosition === \"header\" && trendEl ? h(\"div\", { class: s.HeaderEnd }, [trendEl]) : null,\n ])\n\n const valueSlot = slots.value?.()\n const valueRowEl = h(\"div\", { class: s.ValueRow }, [\n h(\"div\", { class: s.Value }, hasContent(valueSlot) ? valueSlot : props.value),\n trendPosition === \"value\" ? trendEl : null,\n description ? h(\"div\", { class: s.Description }, description) : null,\n ])\n\n const footerEl = trend?.label\n ? h(\"div\", { class: s.Footer }, [h(\"div\", { class: s.TrendLabel }, trend.label)])\n : null\n\n const progressEl =\n progressValue !== undefined || progressLabel\n ? h(\"div\", { class: s.Progress }, [\n h(\"div\", { class: s.ProgressTrack }, [\n h(\"div\", {\n \"class\": s.ProgressBar,\n \"style\": { width: `${progressValue ?? 0}%` },\n \"aria-hidden\": \"true\",\n }),\n ]),\n progressLabel ? h(\"div\", { class: s.ProgressLabel }, progressLabel) : null,\n ])\n : null\n\n const sparklineSlot = slots.sparkline?.()\n const sparklineEl = hasContent(sparklineSlot) ? h(\"div\", { class: s.Sparkline }, sparklineSlot) : null\n\n const iconSlot = slots.icon?.()\n const content = [headerEl, valueRowEl, footerEl, progressEl, sparklineEl]\n\n return h(\n \"div\",\n {\n \"class\": s.StatCard,\n \"data-variant\": props.variant,\n \"data-size\": props.size,\n \"data-accent-color\": props.accentColor,\n },\n hasContent(iconSlot)\n ? [\n h(\"div\", { class: s.Body }, [\n h(\"div\", { class: s.IconWrapper }, iconSlot),\n h(\"div\", { class: s.Content }, content),\n ]),\n ]\n : content,\n )\n }\n },\n})\n\ntype StatCardOwnProps = InstanceType<typeof StatCardComponent>[\"$props\"]\n\n/** StatCard props plus the native <div> attributes that fall through to it, as in React. */\nexport type StatCardProps = StatCardOwnProps & Omit<HTMLAttributes, keyof StatCardOwnProps>\n\nexport const StatCard = StatCardComponent as typeof StatCardComponent & { new (): { $props: StatCardProps } }\n"]}
@@ -1,2 +0,0 @@
1
- import { type ComputedRef } from "vue";
2
- export declare const useCalendarGutter: () => ComputedRef<number>;