@pismo/marola 2.1.49 → 2.1.50

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.
@@ -0,0 +1 @@
1
+ ._menu-icon-button_1sw09_1{position:relative;display:inline-block}._menu-options_1sw09_6{position:absolute;top:2.5rem;z-index:1001;display:flex;flex-direction:column;min-width:16.25rem;padding-top:1rem;background-color:var(--white-100);border:1px solid var(--border-secondary);border-radius:.375rem;box-shadow:0 .125rem .625rem #0000000d}._menu-options_1sw09_6 ._menu-section--title_1sw09_19{padding-left:1rem}._menu-options_1sw09_6 ._menu-section_1sw09_19:not(:last-of-type){padding-bottom:.5rem;margin-bottom:.5rem;border-bottom:1px solid var(--border-secondary)}._menu-options_1sw09_6 ul{padding:0;margin:0;margin-bottom:.5rem;list-style:none}._menu-options_1sw09_6 li{display:flex;column-gap:.5rem;align-items:center;padding:.375rem 1rem;margin:.5rem .25rem;cursor:pointer;border-radius:.25rem}._menu-options_1sw09_6 li:hover{background-color:#0000000a}
@@ -0,0 +1,24 @@
1
+ import { ReactNode } from 'react';
2
+ import { ButtonProps, TypographyProps } from '../../main';
3
+ import { IconName } from '../Icon/types';
4
+ export type MenuSections = {
5
+ sectionTitle?: ReactNode;
6
+ sectionTitleProps?: Omit<TypographyProps, 'children'>;
7
+ sectionItems: {
8
+ label: ReactNode;
9
+ labelProps?: Omit<TypographyProps, 'children'>;
10
+ onClick: () => void;
11
+ key: string;
12
+ icon?: IconName;
13
+ iconColor?: string;
14
+ }[];
15
+ }[];
16
+ type DropdownMenuProps = {
17
+ buttonProps?: Omit<ButtonProps, 'link'>;
18
+ menuSections: MenuSections;
19
+ buttonLabel: ReactNode;
20
+ className?: string;
21
+ 'data-testid'?: string;
22
+ };
23
+ export declare const DropdownMenu: ({ buttonProps, menuSections, buttonLabel, className, "data-testid": dataTestId, }: DropdownMenuProps) => import("react/jsx-runtime").JSX.Element;
24
+ export default DropdownMenu;
@@ -0,0 +1,69 @@
1
+ import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { useState as u } from "react";
3
+ import { c as _ } from "../../clsx-OuTLNxxd.js";
4
+ import { Icon as v } from "../Icon/Icon.js";
5
+ import { Typography as t } from "../Typography/Typography.js";
6
+ import "../Input/Input.js";
7
+ import "../Avatar/Avatar.js";
8
+ import { Button as C } from "../Button/Button.js";
9
+ import "../../Toggle-DcZTfLrC.js";
10
+ import "../Dialog/Dialog.js";
11
+ import "../DatePicker/DatePicker.js";
12
+ import "../../index-1UpBa69h.js";
13
+ import "../Draggable/useDraggable.js";
14
+ import "../IconButton/IconButton.js";
15
+ import "../InputSearch/InputSearch.js";
16
+ import "../Select/Select.js";
17
+ import "../Popover/Popover.js";
18
+ import "../Table/Table.js";
19
+ import "../Tabs/Tabs.js";
20
+ import "../../Group-DJz1rK2n.js";
21
+ import "../../contexts/SnackbarProvider/SnackbarProvider.js";
22
+ import "../../utils/iconsList.js";
23
+ import '../../assets/DropdownMenu.css';const c = {
24
+ "menu-options": "_menu-options_1sw09_6",
25
+ "menu-section--title": "_menu-section--title_1sw09_19",
26
+ "menu-section": "_menu-section_1sw09_19"
27
+ }, K = ({
28
+ buttonProps: n,
29
+ menuSections: m,
30
+ buttonLabel: a,
31
+ className: p,
32
+ "data-testid": d
33
+ }) => {
34
+ const [l, s] = u(!1), h = _(c["menu-options"], p);
35
+ return /* @__PURE__ */ r("div", { children: [
36
+ /* @__PURE__ */ e("div", { className: c["menu-button"], children: /* @__PURE__ */ e(
37
+ C,
38
+ {
39
+ "data-testid": d,
40
+ ...n,
41
+ onClick: () => {
42
+ var o;
43
+ (o = n == null ? void 0 : n.onClick) == null || o.call(n), s(!l);
44
+ },
45
+ children: a
46
+ }
47
+ ) }),
48
+ l && /* @__PURE__ */ e("div", { className: h, children: m.map((o, f) => /* @__PURE__ */ r("div", { className: c["menu-section"], children: [
49
+ !!o.sectionTitle && /* @__PURE__ */ e("div", { className: c["menu-section--title"], children: /* @__PURE__ */ e(t, { ...o.sectionTitleProps, children: o.sectionTitle }) }),
50
+ /* @__PURE__ */ e("ul", { children: o.sectionItems.map((i) => /* @__PURE__ */ r(
51
+ "li",
52
+ {
53
+ onClick: () => {
54
+ i == null || i.onClick(), s(!1);
55
+ },
56
+ children: [
57
+ i.icon && /* @__PURE__ */ e(v, { color: i.iconColor || "var(--accent)", icon: i.icon }),
58
+ /* @__PURE__ */ e(t, { ...i.labelProps, children: i.label })
59
+ ]
60
+ },
61
+ i.key
62
+ )) })
63
+ ] }, f)) })
64
+ ] });
65
+ };
66
+ export {
67
+ K as DropdownMenu,
68
+ K as default
69
+ };
@@ -0,0 +1,24 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ buttonProps, menuSections, buttonLabel, className, "data-testid": dataTestId, }: {
5
+ buttonProps?: Omit<import('../Button/Button').ButtonProps, "link"> | undefined;
6
+ menuSections: import('./DropdownMenu').MenuSections;
7
+ buttonLabel: import('react').ReactNode;
8
+ className?: string | undefined;
9
+ 'data-testid'?: string | undefined;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ tags: string[];
12
+ parameters: {
13
+ layout: string;
14
+ docs: {
15
+ story: {
16
+ height: string;
17
+ };
18
+ };
19
+ };
20
+ };
21
+ export default meta;
22
+ type Story = StoryObj<typeof meta>;
23
+ export declare const WithOneSection: Story;
24
+ export declare const WithTwoSections: Story;
package/dist/main.d.ts CHANGED
@@ -22,6 +22,7 @@ export * from './components/Dialog/Dialog';
22
22
  export * from './components/DoubleAutocomplete/DoubleAutocomplete';
23
23
  export * from './components/DoubleInput/DoubleInput';
24
24
  export * from './components/Draggable/Draggable';
25
+ export * from './components/DropdownMenu/DropdownMenu';
25
26
  export * from './components/EllipsisTooltip/EllipsisTooltip';
26
27
  export * from './components/Fieldset/Fieldset';
27
28
  export * from './components/Icon/Icon';
package/dist/main.js CHANGED
@@ -2,7 +2,7 @@ import { Adornment as e } from "./components/Adornment/Adornment.js";
2
2
  import { Advice as p } from "./components/Advice/Advice.js";
3
3
  import { Alert as m } from "./components/Alert/Alert.js";
4
4
  import { Autocomplete as x } from "./components/Autocomplete/Autocomplete.js";
5
- import { Avatar as n } from "./components/Avatar/Avatar.js";
5
+ import { Avatar as l } from "./components/Avatar/Avatar.js";
6
6
  import { Badge as s } from "./components/Badge/Badge.js";
7
7
  import { BankCard as g } from "./components/BankCard/BankCard.js";
8
8
  import { BankingCard as u } from "./components/BankingCard/BankingCard.js";
@@ -13,59 +13,60 @@ import { Checkbox as D } from "./components/Checkbox/Checkbox.js";
13
13
  import { C as h, R, T as A } from "./Toggle-DcZTfLrC.js";
14
14
  import { ConfirmationDialog as v } from "./components/ConfirmationDialog/ConfirmationDialog.js";
15
15
  import { DatePicker as O } from "./components/DatePicker/DatePicker.js";
16
- import { Description as G } from "./components/Description/Description.js";
16
+ import { Description as E } from "./components/Description/Description.js";
17
17
  import { Dialog as N } from "./components/Dialog/Dialog.js";
18
18
  import { DoubleAutocomplete as K } from "./components/DoubleAutocomplete/DoubleAutocomplete.js";
19
19
  import { DoubleInput as F } from "./components/DoubleInput/DoubleInput.js";
20
20
  import { Draggable as W } from "./components/Draggable/Draggable.js";
21
- import { EllipsisTooltip as q } from "./components/EllipsisTooltip/EllipsisTooltip.js";
22
- import { Fieldset as J } from "./components/Fieldset/Fieldset.js";
23
- import { Icon as U } from "./components/Icon/Icon.js";
24
- import { IconButton as Y } from "./components/IconButton/IconButton.js";
25
- import { Input as _ } from "./components/Input/Input.js";
26
- import { InputSearch as oo } from "./components/InputSearch/InputSearch.js";
27
- import { LoadingSpinner as eo } from "./components/LoadingSpinner/LoadingSpinner.js";
28
- import { PageHeader as po } from "./components/PageHeader/PageHeader.js";
29
- import { Pagination as mo, paginationDefaultTranslations as fo } from "./components/Pagination/Pagination.js";
30
- import { Popover as lo } from "./components/Popover/Popover.js";
31
- import { RadioButton as io } from "./components/RadioButton/RadioButton.js";
32
- import { ResultContainer as To } from "./components/ResultContainer/ResultContainer.js";
33
- import { ResultWithChips as co } from "./components/ResultWithChips/ResultWithChips.js";
34
- import { Select as bo, SelectContext as So, SelectOption as Co, useSelectContext as Bo } from "./components/Select/Select.js";
35
- import { Skeleton as yo, SkeletonCircle as Do, SkeletonTable as ko } from "./components/Skeleton/Skeleton.js";
36
- import { Snackbar as Ro } from "./components/Snackbar/Snackbar.js";
37
- import { SortTooltip as Po, sortTooltipDefaultTranslations as vo } from "./components/SortTooltip/SortTooltip.js";
38
- import { Stepper as Oo } from "./components/Stepper/Stepper.js";
39
- import { StepperNavigator as Go } from "./components/StepperNavigator/StepperNavigator.js";
40
- import { TBody as No, THead as Ho, Table as Ko, Td as Lo, Th as Fo, Tr as Vo } from "./components/Table/Table.js";
41
- import { Tabs as jo } from "./components/Tabs/Tabs.js";
42
- import { Tag as zo } from "./components/Tag/Tag.js";
43
- import { TextDisplay as Qo } from "./components/TextDisplay/TextDisplay.js";
44
- import { ToastCard as Xo } from "./components/ToastCard/ToastCard.js";
45
- import { Toggle as Zo } from "./components/Toggle/Toggle.js";
46
- import { G as $o } from "./Group-DJz1rK2n.js";
47
- import { Tooltip as rr } from "./components/Tooltip/Tooltip.js";
48
- import { TransactionRow as tr } from "./components/TransactionRow/TransactionRow.js";
49
- import { Text as ar, Typography as mr } from "./components/Typography/Typography.js";
50
- import { DraggableProvider as xr } from "./contexts/DraggableProvider/DraggableProvider.js";
51
- import { SnackbarContext as nr, SnackbarProvider as ir, useSnackbar as sr } from "./contexts/SnackbarProvider/SnackbarProvider.js";
52
- import { replaceItemsByIndex as gr, replaceItemsByKey as cr, sortItemsByIndex as ur, sortItemsByKey as dr } from "./utils/draggable.js";
53
- import { iconsList as Sr } from "./utils/iconsList.js";
54
- import { allowOnlyIntegerNumbers as Br, allowOnlyMathSignals as Ir, allowOnlyNumbers as yr, formatDecimalValue as Dr, parseToInteger as kr } from "./utils/inputNumberAsText.js";
55
- import { bemify as Rr, getBEMBase as Ar, getBEMBlock as Pr } from "./utils/styleStrings.js";
56
- import { default as wr } from "./components/Dialog/DialogTitle.js";
57
- import { default as Er } from "./components/Dialog/Content.js";
58
- import { default as Mr } from "./components/Dialog/Actions.js";
59
- import { R as Hr } from "./RadioOption-DYovqiwF.js";
60
- import { Tab as Lr } from "./components/Tabs/Tab.js";
61
- import { TabPanel as Vr } from "./components/Tabs/TabPanel.js";
21
+ import { DropdownMenu as q } from "./components/DropdownMenu/DropdownMenu.js";
22
+ import { EllipsisTooltip as J } from "./components/EllipsisTooltip/EllipsisTooltip.js";
23
+ import { Fieldset as U } from "./components/Fieldset/Fieldset.js";
24
+ import { Icon as Y } from "./components/Icon/Icon.js";
25
+ import { IconButton as _ } from "./components/IconButton/IconButton.js";
26
+ import { Input as oo } from "./components/Input/Input.js";
27
+ import { InputSearch as eo } from "./components/InputSearch/InputSearch.js";
28
+ import { LoadingSpinner as po } from "./components/LoadingSpinner/LoadingSpinner.js";
29
+ import { PageHeader as mo } from "./components/PageHeader/PageHeader.js";
30
+ import { Pagination as xo, paginationDefaultTranslations as no } from "./components/Pagination/Pagination.js";
31
+ import { Popover as io } from "./components/Popover/Popover.js";
32
+ import { RadioButton as To } from "./components/RadioButton/RadioButton.js";
33
+ import { ResultContainer as co } from "./components/ResultContainer/ResultContainer.js";
34
+ import { ResultWithChips as bo } from "./components/ResultWithChips/ResultWithChips.js";
35
+ import { Select as Co, SelectContext as Bo, SelectOption as Io, useSelectContext as yo } from "./components/Select/Select.js";
36
+ import { Skeleton as ko, SkeletonCircle as ho, SkeletonTable as Ro } from "./components/Skeleton/Skeleton.js";
37
+ import { Snackbar as Po } from "./components/Snackbar/Snackbar.js";
38
+ import { SortTooltip as wo, sortTooltipDefaultTranslations as Oo } from "./components/SortTooltip/SortTooltip.js";
39
+ import { Stepper as Eo } from "./components/Stepper/Stepper.js";
40
+ import { StepperNavigator as No } from "./components/StepperNavigator/StepperNavigator.js";
41
+ import { TBody as Ko, THead as Lo, Table as Fo, Td as Vo, Th as Wo, Tr as jo } from "./components/Table/Table.js";
42
+ import { Tabs as zo } from "./components/Tabs/Tabs.js";
43
+ import { Tag as Qo } from "./components/Tag/Tag.js";
44
+ import { TextDisplay as Xo } from "./components/TextDisplay/TextDisplay.js";
45
+ import { ToastCard as Zo } from "./components/ToastCard/ToastCard.js";
46
+ import { Toggle as $o } from "./components/Toggle/Toggle.js";
47
+ import { G as rr } from "./Group-DJz1rK2n.js";
48
+ import { Tooltip as tr } from "./components/Tooltip/Tooltip.js";
49
+ import { TransactionRow as ar } from "./components/TransactionRow/TransactionRow.js";
50
+ import { Text as fr, Typography as xr } from "./components/Typography/Typography.js";
51
+ import { DraggableProvider as lr } from "./contexts/DraggableProvider/DraggableProvider.js";
52
+ import { SnackbarContext as sr, SnackbarProvider as Tr, useSnackbar as gr } from "./contexts/SnackbarProvider/SnackbarProvider.js";
53
+ import { replaceItemsByIndex as ur, replaceItemsByKey as dr, sortItemsByIndex as br, sortItemsByKey as Sr } from "./utils/draggable.js";
54
+ import { iconsList as Br } from "./utils/iconsList.js";
55
+ import { allowOnlyIntegerNumbers as yr, allowOnlyMathSignals as Dr, allowOnlyNumbers as kr, formatDecimalValue as hr, parseToInteger as Rr } from "./utils/inputNumberAsText.js";
56
+ import { bemify as Pr, getBEMBase as vr, getBEMBlock as wr } from "./utils/styleStrings.js";
57
+ import { default as Mr } from "./components/Dialog/DialogTitle.js";
58
+ import { default as Gr } from "./components/Dialog/Content.js";
59
+ import { default as Hr } from "./components/Dialog/Actions.js";
60
+ import { R as Lr } from "./RadioOption-DYovqiwF.js";
61
+ import { Tab as Vr } from "./components/Tabs/Tab.js";
62
+ import { TabPanel as jr } from "./components/Tabs/TabPanel.js";
62
63
  export {
63
- Mr as Actions,
64
+ Hr as Actions,
64
65
  e as Adornment,
65
66
  p as Advice,
66
67
  m as Alert,
67
68
  x as Autocomplete,
68
- n as Avatar,
69
+ l as Avatar,
69
70
  s as Badge,
70
71
  g as BankCard,
71
72
  u as BankingCard,
@@ -75,76 +76,77 @@ export {
75
76
  D as Checkbox,
76
77
  h as Chip,
77
78
  v as ConfirmationDialog,
78
- Er as Content,
79
+ Gr as Content,
79
80
  O as DatePicker,
80
- G as Description,
81
+ E as Description,
81
82
  N as Dialog,
82
- wr as DialogTitle,
83
+ Mr as DialogTitle,
83
84
  K as DoubleAutocomplete,
84
85
  F as DoubleInput,
85
86
  W as Draggable,
86
- xr as DraggableProvider,
87
- q as EllipsisTooltip,
88
- J as Fieldset,
89
- U as Icon,
90
- Y as IconButton,
91
- _ as Input,
92
- oo as InputSearch,
93
- eo as LoadingSpinner,
94
- po as PageHeader,
95
- mo as Pagination,
96
- lo as Popover,
97
- io as RadioButton,
98
- Hr as RadioOption,
99
- To as ResultContainer,
100
- co as ResultWithChips,
87
+ lr as DraggableProvider,
88
+ q as DropdownMenu,
89
+ J as EllipsisTooltip,
90
+ U as Fieldset,
91
+ Y as Icon,
92
+ _ as IconButton,
93
+ oo as Input,
94
+ eo as InputSearch,
95
+ po as LoadingSpinner,
96
+ mo as PageHeader,
97
+ xo as Pagination,
98
+ io as Popover,
99
+ To as RadioButton,
100
+ Lr as RadioOption,
101
+ co as ResultContainer,
102
+ bo as ResultWithChips,
101
103
  R as RowItem,
102
- bo as Select,
103
- So as SelectContext,
104
- Co as SelectOption,
105
- yo as Skeleton,
106
- Do as SkeletonCircle,
107
- ko as SkeletonTable,
108
- Ro as Snackbar,
109
- nr as SnackbarContext,
110
- ir as SnackbarProvider,
111
- Po as SortTooltip,
112
- Oo as Stepper,
113
- Go as StepperNavigator,
114
- No as TBody,
115
- Ho as THead,
116
- Lr as Tab,
117
- Vr as TabPanel,
118
- Ko as Table,
119
- jo as Tabs,
120
- zo as Tag,
121
- Lo as Td,
122
- ar as Text,
123
- Qo as TextDisplay,
124
- Fo as Th,
125
- Xo as ToastCard,
126
- Zo as Toggle,
127
- $o as ToggleGroup,
104
+ Co as Select,
105
+ Bo as SelectContext,
106
+ Io as SelectOption,
107
+ ko as Skeleton,
108
+ ho as SkeletonCircle,
109
+ Ro as SkeletonTable,
110
+ Po as Snackbar,
111
+ sr as SnackbarContext,
112
+ Tr as SnackbarProvider,
113
+ wo as SortTooltip,
114
+ Eo as Stepper,
115
+ No as StepperNavigator,
116
+ Ko as TBody,
117
+ Lo as THead,
118
+ Vr as Tab,
119
+ jr as TabPanel,
120
+ Fo as Table,
121
+ zo as Tabs,
122
+ Qo as Tag,
123
+ Vo as Td,
124
+ fr as Text,
125
+ Xo as TextDisplay,
126
+ Wo as Th,
127
+ Zo as ToastCard,
128
+ $o as Toggle,
129
+ rr as ToggleGroup,
128
130
  A as ToggleGroupItem,
129
- rr as Tooltip,
130
- Vo as Tr,
131
- tr as TransactionRow,
132
- mr as Typography,
133
- Br as allowOnlyIntegerNumbers,
134
- Ir as allowOnlyMathSignals,
135
- yr as allowOnlyNumbers,
136
- Rr as bemify,
137
- Dr as formatDecimalValue,
138
- Ar as getBEMBase,
139
- Pr as getBEMBlock,
140
- Sr as iconsList,
141
- fo as paginationDefaultTranslations,
142
- kr as parseToInteger,
143
- gr as replaceItemsByIndex,
144
- cr as replaceItemsByKey,
145
- ur as sortItemsByIndex,
146
- dr as sortItemsByKey,
147
- vo as sortTooltipDefaultTranslations,
148
- Bo as useSelectContext,
149
- sr as useSnackbar
131
+ tr as Tooltip,
132
+ jo as Tr,
133
+ ar as TransactionRow,
134
+ xr as Typography,
135
+ yr as allowOnlyIntegerNumbers,
136
+ Dr as allowOnlyMathSignals,
137
+ kr as allowOnlyNumbers,
138
+ Pr as bemify,
139
+ hr as formatDecimalValue,
140
+ vr as getBEMBase,
141
+ wr as getBEMBlock,
142
+ Br as iconsList,
143
+ no as paginationDefaultTranslations,
144
+ Rr as parseToInteger,
145
+ ur as replaceItemsByIndex,
146
+ dr as replaceItemsByKey,
147
+ br as sortItemsByIndex,
148
+ Sr as sortItemsByKey,
149
+ Oo as sortTooltipDefaultTranslations,
150
+ yo as useSelectContext,
151
+ gr as useSnackbar
150
152
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pismo/marola",
3
3
  "description": "CDX tribe component library",
4
- "version": "2.1.49",
4
+ "version": "2.1.50",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",