@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.
- package/dist/assets/DropdownMenu.css +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +24 -0
- package/dist/components/DropdownMenu/DropdownMenu.js +69 -0
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +24 -0
- package/dist/components/DropdownMenu/DropdownMenu.test.d.ts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +112 -110
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
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
|
|
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
|
|
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 {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
79
|
+
Gr as Content,
|
|
79
80
|
O as DatePicker,
|
|
80
|
-
|
|
81
|
+
E as Description,
|
|
81
82
|
N as Dialog,
|
|
82
|
-
|
|
83
|
+
Mr as DialogTitle,
|
|
83
84
|
K as DoubleAutocomplete,
|
|
84
85
|
F as DoubleInput,
|
|
85
86
|
W as Draggable,
|
|
86
|
-
|
|
87
|
-
q as
|
|
88
|
-
J as
|
|
89
|
-
U as
|
|
90
|
-
Y as
|
|
91
|
-
_ as
|
|
92
|
-
oo as
|
|
93
|
-
eo as
|
|
94
|
-
po as
|
|
95
|
-
mo as
|
|
96
|
-
|
|
97
|
-
io as
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
co as
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
};
|