@plexui/vue 0.22.0 → 0.23.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 (79) 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/DatePicker.js +3 -3
  14. package/dist/es/components/DatePicker/DatePicker.js.map +1 -1
  15. package/dist/es/components/DatePicker/useCalendarCollisionPadding.js +25 -0
  16. package/dist/es/components/DatePicker/useCalendarCollisionPadding.js.map +1 -0
  17. package/dist/es/components/DateRangePicker/DateRangePicker.js +3 -3
  18. package/dist/es/components/DateRangePicker/DateRangePicker.js.map +1 -1
  19. package/dist/es/components/Dialog/Dialog.js +2 -2
  20. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  21. package/dist/es/components/Input/Input.js +3 -0
  22. package/dist/es/components/Input/Input.js.map +1 -1
  23. package/dist/es/components/Menu/Menu.js +10 -1
  24. package/dist/es/components/Menu/Menu.js.map +1 -1
  25. package/dist/es/components/PhoneLayout/PhoneLayout.js +9 -1
  26. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -1
  27. package/dist/es/components/Popover/Popover.js +2 -2
  28. package/dist/es/components/Popover/Popover.js.map +1 -1
  29. package/dist/es/components/ProgressSteps/ProgressSteps.js +7 -3
  30. package/dist/es/components/ProgressSteps/ProgressSteps.js.map +1 -1
  31. package/dist/es/components/ProgressSteps/index.js.map +1 -1
  32. package/dist/es/components/Select/Select.js +178 -32
  33. package/dist/es/components/Select/Select.js.map +1 -1
  34. package/dist/es/components/SelectControl/SelectControl.js +3 -1
  35. package/dist/es/components/SelectControl/SelectControl.js.map +1 -1
  36. package/dist/es/components/Slider/Slider.js +24 -11
  37. package/dist/es/components/Slider/Slider.js.map +1 -1
  38. package/dist/es/components/Slider/sliderPrimitive.js +5 -2
  39. package/dist/es/components/Slider/sliderPrimitive.js.map +1 -1
  40. package/dist/es/components/Sortable/Sortable.js +1 -1
  41. package/dist/es/components/Sortable/Sortable.js.map +1 -1
  42. package/dist/es/components/StatCard/index.js +4 -1
  43. package/dist/es/components/StatCard/index.js.map +1 -1
  44. package/dist/es/components/{StatCard/StatCard.js → StatsCard/StatsCard.js} +32 -27
  45. package/dist/es/components/StatsCard/StatsCard.js.map +1 -0
  46. package/dist/es/components/StatsCard/index.js +2 -0
  47. package/dist/es/components/StatsCard/index.js.map +1 -0
  48. package/dist/es/components/SwipeActions/SwipeActions.js +32 -5
  49. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -1
  50. package/dist/es/components/TabBar/TabBar.js +52 -21
  51. package/dist/es/components/TabBar/TabBar.js.map +1 -1
  52. package/dist/es/components/Tabs/Tabs.js +229 -6
  53. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  54. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  55. package/dist/es/lib/menuTriggerCover.js +40 -3
  56. package/dist/es/lib/menuTriggerCover.js.map +1 -1
  57. package/dist/types/components/ColorPicker/ColorPicker.d.ts +3 -2
  58. package/dist/types/components/ColorPicker/shared.d.ts +5 -4
  59. package/dist/types/components/ContextMenu/shared.d.ts +28 -6
  60. package/dist/types/components/DatePicker/useCalendarCollisionPadding.d.ts +9 -0
  61. package/dist/types/components/Dialog/Dialog.d.ts +2 -2
  62. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +5 -0
  63. package/dist/types/components/Popover/Popover.d.ts +5 -5
  64. package/dist/types/components/ProgressSteps/ProgressSteps.d.ts +17 -3
  65. package/dist/types/components/ProgressSteps/index.d.ts +1 -1
  66. package/dist/types/components/Select/Select.d.ts +19 -8
  67. package/dist/types/components/StatCard/index.d.ts +9 -1
  68. package/dist/types/components/{StatCard/StatCard.d.ts → StatsCard/StatsCard.d.ts} +19 -19
  69. package/dist/types/components/StatsCard/index.d.ts +1 -0
  70. package/dist/types/components/SwipeActions/SwipeActions.d.ts +4 -4
  71. package/dist/types/components/TabBar/TabBar.d.ts +34 -0
  72. package/dist/types/components/Tabs/Tabs.d.ts +33 -2
  73. package/dist/types/components/Toolbar/Toolbar.d.ts +1 -1
  74. package/dist/types/lib/menuTriggerCover.d.ts +16 -2
  75. package/package.json +2 -2
  76. package/dist/es/components/DatePicker/useCalendarGutter.js +0 -14
  77. package/dist/es/components/DatePicker/useCalendarGutter.js.map +0 -1
  78. package/dist/es/components/StatCard/StatCard.js.map +0 -1
  79. package/dist/types/components/DatePicker/useCalendarGutter.d.ts +0 -2
@@ -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,UAA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AAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,SAAS,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;YAEtG,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,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>;