unifyedx-storybook-new 0.1.7 → 0.1.8

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.
@@ -646,6 +646,7 @@
646
646
  padding: 0rem 1.5rem;
647
647
  border-bottom: 1px solid #e5e7eb;
648
648
  flex-shrink: 0;
649
+ padding: 16px 20px;
649
650
  }
650
651
 
651
652
  .dialog-title-text {
@@ -3550,6 +3551,91 @@
3550
3551
  opacity: 0.9;
3551
3552
  margin: 0;
3552
3553
  }
3554
+
3555
+ .options-menu-wrapper {
3556
+ position: relative;
3557
+ display: inline-block;
3558
+ text-align: left;
3559
+ }
3560
+
3561
+ .options-menu-trigger {
3562
+ display: inline-flex;
3563
+ justify-content: center;
3564
+ width: 100%;
3565
+ padding: 0.25rem;
3566
+ border-radius: 9999px;
3567
+ cursor: pointer;
3568
+ color: #4b5563; /* gray-600 */
3569
+ background-color: transparent;
3570
+ border: none;
3571
+ }
3572
+
3573
+ .options-menu-trigger:hover {
3574
+ background-color: #f3f4f6; /* gray-100 */
3575
+ }
3576
+
3577
+ .options-menu-trigger:focus-visible {
3578
+ outline: 2px solid #2563eb;
3579
+ outline-offset: 2px;
3580
+ }
3581
+
3582
+ .options-menu-panel {
3583
+ position: absolute; /* Will be managed by floating-ui */
3584
+ z-index: 20;
3585
+ width: 12rem; /* 192px */
3586
+ margin-top: 0.5rem;
3587
+ origin-top-right: ;
3588
+ background-color: white;
3589
+ border: 1px solid #e5e7eb;
3590
+ border-radius: 0.375rem;
3591
+ box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
3592
+ padding: 0.25rem;
3593
+ }
3594
+
3595
+ .options-menu-panel:focus {
3596
+ outline: none;
3597
+ }
3598
+
3599
+ .options-menu-item-wrapper {
3600
+ /* Wrapper to contain dividers */
3601
+ }
3602
+
3603
+ .menu-divider {
3604
+ height: 1px;
3605
+ background-color: #e5e7eb;
3606
+ margin: 0.25rem 0;
3607
+ }
3608
+
3609
+ .options-menu-item {
3610
+ display: flex;
3611
+ align-items: center;
3612
+ width: 100%;
3613
+ padding: 0.5rem 0.75rem;
3614
+ font-size: 0.875rem;
3615
+ color: #374151; /* gray-700 */
3616
+ border-radius: 0.25rem;
3617
+ transition: background-color 0.15s, color 0.15s;
3618
+ background: none;
3619
+ border: none;
3620
+ cursor: pointer;
3621
+ text-align: left;
3622
+ }
3623
+
3624
+ .options-menu-item.active {
3625
+ background-color: #2563eb;
3626
+ color: white;
3627
+ }
3628
+
3629
+ .options-menu-item:disabled {
3630
+ color: #9ca3af;
3631
+ cursor: not-allowed;
3632
+ }
3633
+
3634
+ .options-menu-item .item-icon {
3635
+ margin-right: 0.75rem;
3636
+ width: 1rem;
3637
+ height: 1rem;
3638
+ }
3553
3639
  .avatar-container {
3554
3640
  display: inline-flex;
3555
3641
  align-items: center;
@@ -4685,6 +4771,7 @@
4685
4771
  padding: 0rem 1.5rem;
4686
4772
  border-bottom: 1px solid #e5e7eb;
4687
4773
  flex-shrink: 0;
4774
+ padding: 16px 20px;
4688
4775
  }
4689
4776
  .dialog-title-text {
4690
4777
  font-size: 1.25rem;
@@ -6747,3 +6834,83 @@
6747
6834
  opacity: 0.9;
6748
6835
  margin: 0;
6749
6836
  }
6837
+ .options-menu-wrapper {
6838
+ position: relative;
6839
+ display: inline-block;
6840
+ text-align: left;
6841
+ }
6842
+
6843
+ .options-menu-trigger {
6844
+ display: inline-flex;
6845
+ justify-content: center;
6846
+ width: 100%;
6847
+ padding: 0.25rem;
6848
+ border-radius: 9999px;
6849
+ cursor: pointer;
6850
+ color: #4b5563; /* gray-600 */
6851
+ background-color: transparent;
6852
+ border: none;
6853
+ }
6854
+ .options-menu-trigger:hover {
6855
+ background-color: #f3f4f6; /* gray-100 */
6856
+ }
6857
+ .options-menu-trigger:focus-visible {
6858
+ outline: 2px solid #2563eb;
6859
+ outline-offset: 2px;
6860
+ }
6861
+
6862
+ .options-menu-panel {
6863
+ position: absolute; /* Will be managed by floating-ui */
6864
+ z-index: 20;
6865
+ width: 12rem; /* 192px */
6866
+ margin-top: 0.5rem;
6867
+ origin-top-right: ;
6868
+ background-color: white;
6869
+ border: 1px solid #e5e7eb;
6870
+ border-radius: 0.375rem;
6871
+ box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
6872
+ padding: 0.25rem;
6873
+ }
6874
+ .options-menu-panel:focus {
6875
+ outline: none;
6876
+ }
6877
+
6878
+ .options-menu-item-wrapper {
6879
+ /* Wrapper to contain dividers */
6880
+ }
6881
+
6882
+ .menu-divider {
6883
+ height: 1px;
6884
+ background-color: #e5e7eb;
6885
+ margin: 0.25rem 0;
6886
+ }
6887
+
6888
+ .options-menu-item {
6889
+ display: flex;
6890
+ align-items: center;
6891
+ width: 100%;
6892
+ padding: 0.5rem 0.75rem;
6893
+ font-size: 0.875rem;
6894
+ color: #374151; /* gray-700 */
6895
+ border-radius: 0.25rem;
6896
+ transition: background-color 0.15s, color 0.15s;
6897
+ background: none;
6898
+ border: none;
6899
+ cursor: pointer;
6900
+ text-align: left;
6901
+ }
6902
+
6903
+ .options-menu-item.active {
6904
+ background-color: #2563eb;
6905
+ color: white;
6906
+ }
6907
+ .options-menu-item:disabled {
6908
+ color: #9ca3af;
6909
+ cursor: not-allowed;
6910
+ }
6911
+
6912
+ .options-menu-item .item-icon {
6913
+ margin-right: 0.75rem;
6914
+ width: 1rem;
6915
+ height: 1rem;
6916
+ }
@@ -1,6 +1,7 @@
1
1
  import React, { forwardRef, createElement, useState, useMemo, useId as useId$1, createContext, useContext, useCallback, useRef, useLayoutEffect, useEffect, Fragment, useImperativeHandle } from 'react';
2
- import { Popover as Popover$1, PopoverButton, PopoverPanel, Transition, Dialog, TransitionChild, DialogPanel, DialogTitle, TabGroup, TabList, Tab, TabPanels, RadioGroup as RadioGroup$1, Listbox, ListboxButton, ListboxOptions, ListboxOption, SwitchGroup, Switch } from '@headlessui/react';
2
+ import { Popover as Popover$1, PopoverButton, PopoverPanel, Transition, Dialog, TransitionChild, DialogPanel, DialogTitle, TabGroup, TabList, Tab, TabPanels, RadioGroup as RadioGroup$1, Listbox, ListboxButton, ListboxOptions, ListboxOption, SwitchGroup, Switch, Menu as Menu$1, MenuButton, MenuItems, MenuItem } from '@headlessui/react';
3
3
  import { motion, AnimatePresence } from 'framer-motion';
4
+ import { useFloating, offset as offset$2, flip as flip$2, shift as shift$2, autoUpdate as autoUpdate$1 } from '@floating-ui/react';
4
5
 
5
6
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
7
 
@@ -581,11 +582,11 @@ const createLucideIcon = (iconName, iconNode) => {
581
582
  */
582
583
 
583
584
 
584
- const __iconNode$l = [
585
+ const __iconNode$m = [
585
586
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
586
587
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
587
588
  ];
588
- const ArrowLeft = createLucideIcon("arrow-left", __iconNode$l);
589
+ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$m);
589
590
 
590
591
  /**
591
592
  * @license lucide-react v0.525.0 - ISC
@@ -595,13 +596,13 @@ const ArrowLeft = createLucideIcon("arrow-left", __iconNode$l);
595
596
  */
596
597
 
597
598
 
598
- const __iconNode$k = [
599
+ const __iconNode$l = [
599
600
  ["path", { d: "M8 2v4", key: "1cmpym" }],
600
601
  ["path", { d: "M16 2v4", key: "4m81vk" }],
601
602
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
602
603
  ["path", { d: "M3 10h18", key: "8toen8" }]
603
604
  ];
604
- const Calendar$1 = createLucideIcon("calendar", __iconNode$k);
605
+ const Calendar$1 = createLucideIcon("calendar", __iconNode$l);
605
606
 
606
607
  /**
607
608
  * @license lucide-react v0.525.0 - ISC
@@ -611,8 +612,8 @@ const Calendar$1 = createLucideIcon("calendar", __iconNode$k);
611
612
  */
612
613
 
613
614
 
614
- const __iconNode$j = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
615
- const Check = createLucideIcon("check", __iconNode$j);
615
+ const __iconNode$k = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
616
+ const Check = createLucideIcon("check", __iconNode$k);
616
617
 
617
618
  /**
618
619
  * @license lucide-react v0.525.0 - ISC
@@ -622,8 +623,8 @@ const Check = createLucideIcon("check", __iconNode$j);
622
623
  */
623
624
 
624
625
 
625
- const __iconNode$i = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
626
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$i);
626
+ const __iconNode$j = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
627
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$j);
627
628
 
628
629
  /**
629
630
  * @license lucide-react v0.525.0 - ISC
@@ -633,8 +634,8 @@ const ChevronDown = createLucideIcon("chevron-down", __iconNode$i);
633
634
  */
634
635
 
635
636
 
636
- const __iconNode$h = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
637
- const ChevronLeft = createLucideIcon("chevron-left", __iconNode$h);
637
+ const __iconNode$i = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
638
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$i);
638
639
 
639
640
  /**
640
641
  * @license lucide-react v0.525.0 - ISC
@@ -644,8 +645,8 @@ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$h);
644
645
  */
645
646
 
646
647
 
647
- const __iconNode$g = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
648
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$g);
648
+ const __iconNode$h = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
649
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$h);
649
650
 
650
651
  /**
651
652
  * @license lucide-react v0.525.0 - ISC
@@ -655,11 +656,11 @@ const ChevronRight = createLucideIcon("chevron-right", __iconNode$g);
655
656
  */
656
657
 
657
658
 
658
- const __iconNode$f = [
659
+ const __iconNode$g = [
659
660
  ["path", { d: "m11 17-5-5 5-5", key: "13zhaf" }],
660
661
  ["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
661
662
  ];
662
- const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$f);
663
+ const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$g);
663
664
 
664
665
  /**
665
666
  * @license lucide-react v0.525.0 - ISC
@@ -669,11 +670,11 @@ const ChevronsLeft = createLucideIcon("chevrons-left", __iconNode$f);
669
670
  */
670
671
 
671
672
 
672
- const __iconNode$e = [
673
+ const __iconNode$f = [
673
674
  ["path", { d: "m6 17 5-5-5-5", key: "xnjwq" }],
674
675
  ["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
675
676
  ];
676
- const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$e);
677
+ const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$f);
677
678
 
678
679
  /**
679
680
  * @license lucide-react v0.525.0 - ISC
@@ -683,11 +684,11 @@ const ChevronsRight = createLucideIcon("chevrons-right", __iconNode$e);
683
684
  */
684
685
 
685
686
 
686
- const __iconNode$d = [
687
+ const __iconNode$e = [
687
688
  ["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
688
689
  ["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
689
690
  ];
690
- const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$d);
691
+ const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$e);
691
692
 
692
693
  /**
693
694
  * @license lucide-react v0.525.0 - ISC
@@ -697,11 +698,11 @@ const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$d);
697
698
  */
698
699
 
699
700
 
700
- const __iconNode$c = [
701
+ const __iconNode$d = [
701
702
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
702
703
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
703
704
  ];
704
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$c);
705
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$d);
705
706
 
706
707
  /**
707
708
  * @license lucide-react v0.525.0 - ISC
@@ -711,12 +712,27 @@ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$c);
711
712
  */
712
713
 
713
714
 
714
- const __iconNode$b = [
715
+ const __iconNode$c = [
715
716
  ["path", { d: "M12 13v8", key: "1l5pq0" }],
716
717
  ["path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242", key: "1pljnt" }],
717
718
  ["path", { d: "m8 17 4-4 4 4", key: "1quai1" }]
718
719
  ];
719
- const CloudUpload = createLucideIcon("cloud-upload", __iconNode$b);
720
+ const CloudUpload = createLucideIcon("cloud-upload", __iconNode$c);
721
+
722
+ /**
723
+ * @license lucide-react v0.525.0 - ISC
724
+ *
725
+ * This source code is licensed under the ISC license.
726
+ * See the LICENSE file in the root directory of this source tree.
727
+ */
728
+
729
+
730
+ const __iconNode$b = [
731
+ ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
732
+ ["circle", { cx: "12", cy: "5", r: "1", key: "gxeob9" }],
733
+ ["circle", { cx: "12", cy: "19", r: "1", key: "lyex9k" }]
734
+ ];
735
+ const EllipsisVertical = createLucideIcon("ellipsis-vertical", __iconNode$b);
720
736
 
721
737
  /**
722
738
  * @license lucide-react v0.525.0 - ISC
@@ -43226,4 +43242,53 @@ const PageHeader = ({
43226
43242
  ] });
43227
43243
  };
43228
43244
 
43229
- export { Avatar, AvatarGroup, Badge, Breadcrumbs, Button$1 as Button, Checkbox, DatePicker, DateRangePicker$1 as DateRangePicker, FileUploadModal, FullScreenLoader, GenericFilter, Input, Modal, PageHeader, PageLayout, Pagination, RadioGroup, SearchBar, Select, Sidebar, Spinner, Textarea, ToggleSwitch, Tooltip, UnifyedCoreButton, WizardModal };
43245
+ const OptionsMenu = ({
43246
+ options = [],
43247
+ onSelect,
43248
+ triggerIcon: TriggerIcon = EllipsisVertical
43249
+ }) => {
43250
+ const { refs, floatingStyles } = useFloating({
43251
+ whileElementsMounted: autoUpdate$1,
43252
+ middleware: [offset$2(5), flip$2(), shift$2({ padding: 5 })]
43253
+ });
43254
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu$1, { as: "div", className: "options-menu-wrapper", children: [
43255
+ /* @__PURE__ */ jsxRuntimeExports.jsx(MenuButton, { ref: refs.setReference, className: "options-menu-trigger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TriggerIcon, { size: 20 }) }),
43256
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43257
+ Transition,
43258
+ {
43259
+ as: Fragment,
43260
+ enter: "transition ease-out duration-100",
43261
+ enterFrom: "transform opacity-0 scale-95",
43262
+ enterTo: "transform opacity-100 scale-100",
43263
+ leave: "transition ease-in duration-75",
43264
+ leaveFrom: "transform opacity-100 scale-100",
43265
+ leaveTo: "transform opacity-0 scale-95",
43266
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43267
+ MenuItems,
43268
+ {
43269
+ ref: refs.setFloating,
43270
+ style: floatingStyles,
43271
+ className: "options-menu-panel",
43272
+ children: options.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "options-menu-item-wrapper", children: [
43273
+ option.dividerBefore && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "menu-divider" }),
43274
+ /* @__PURE__ */ jsxRuntimeExports.jsx(MenuItem, { children: ({ active }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
43275
+ "button",
43276
+ {
43277
+ onClick: () => onSelect(option),
43278
+ className: `options-menu-item ${active ? "active" : ""}`,
43279
+ disabled: option.disabled,
43280
+ children: [
43281
+ option.icon && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "item-icon", children: option.icon }),
43282
+ option.label
43283
+ ]
43284
+ }
43285
+ ) })
43286
+ ] }, option.label))
43287
+ }
43288
+ )
43289
+ }
43290
+ )
43291
+ ] });
43292
+ };
43293
+
43294
+ export { Avatar, AvatarGroup, Badge, Breadcrumbs, Button$1 as Button, Checkbox, DatePicker, DateRangePicker$1 as DateRangePicker, FileUploadModal, FullScreenLoader, GenericFilter, Input, Modal, OptionsMenu, PageHeader, PageLayout, Pagination, RadioGroup, SearchBar, Select, Sidebar, Spinner, Textarea, ToggleSwitch, Tooltip, UnifyedCoreButton, WizardModal };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unifyedx-storybook-new",
3
3
  "private": false,
4
- "version": "0.1.7",
4
+ "version": "0.1.8",
5
5
  "type": "module",
6
6
  "main": "dist/unifyedx-storybook-new.es.js",
7
7
  "module": "dist/unifyedx-storybook-new.es.js",
@@ -18,6 +18,7 @@
18
18
  "build-storybook": "storybook build"
19
19
  },
20
20
  "dependencies": {
21
+ "@floating-ui/react": "^0.27.13",
21
22
  "@headlessui/react": "*",
22
23
  "@hookform/resolvers": "^5.1.1",
23
24
  "@storybook/jest": "^0.2.2",
@@ -73,6 +74,7 @@
73
74
  "@headlessui/react": "*",
74
75
  "framer-motion": "*",
75
76
  "react": ">=18",
76
- "react-dom": ">=18"
77
+ "react-dom": ">=18",
78
+ "@floating-ui/react": "^0.27.13"
77
79
  }
78
80
  }