@pismo/marola 0.0.1-alpha.14 → 0.0.1-alpha.16
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/SelectButton-DWZ2BRaX.js +44 -0
- package/dist/assets/InputSearch.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/assets/Snackbar.css +1 -1
- package/dist/components/InputSearch/InputSearch.js +7 -7
- package/dist/components/Select/Select.d.ts +9 -8
- package/dist/components/Select/Select.js +153 -155
- package/dist/components/Select/Select.stories.d.ts +10 -19
- package/dist/components/Select/Select.stories.js +72 -48
- package/dist/components/Select/SelectButton.d.ts +3 -4
- package/dist/components/Select/SelectButton.js +2 -2
- package/dist/components/Snackbar/Snackbar.d.ts +17 -5
- package/dist/components/Snackbar/Snackbar.js +180 -180
- package/dist/components/Snackbar/Snackbar.stories.d.ts +318 -0
- package/dist/components/Snackbar/Snackbar.stories.js +62 -0
- package/dist/main.js +13 -13
- package/package.json +1 -1
- package/dist/SelectButton-DWtqAiwt.js +0 -45
|
@@ -1,31 +1,22 @@
|
|
|
1
|
+
import { SelectProps } from './Select';
|
|
1
2
|
import { StoryObj } from '@storybook/react';
|
|
2
3
|
|
|
3
4
|
declare const meta: {
|
|
4
5
|
title: string;
|
|
5
6
|
component: {
|
|
6
|
-
(props:
|
|
7
|
-
|
|
8
|
-
disabled?: boolean | undefined;
|
|
9
|
-
placeholder?: string | number | undefined;
|
|
10
|
-
ariaLabelledby?: string | undefined;
|
|
11
|
-
onChange?: ((value: string | number | null, event?: import('react').SyntheticEvent<Element, Event> | null | undefined) => void) | undefined;
|
|
12
|
-
className?: string | undefined;
|
|
13
|
-
'data-testid'?: string | undefined;
|
|
14
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
Option: (props: {
|
|
16
|
-
disabled?: boolean | undefined;
|
|
17
|
-
value: string | number;
|
|
18
|
-
children: import('react').ReactNode;
|
|
19
|
-
icon?: import('react').ReactNode;
|
|
20
|
-
className?: string | undefined;
|
|
21
|
-
'data-testid'?: string | undefined;
|
|
22
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
(props: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Option: (props: import('./Select').SelectOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
9
|
};
|
|
24
10
|
tags: string[];
|
|
11
|
+
parameters: {
|
|
12
|
+
layout: string;
|
|
13
|
+
};
|
|
25
14
|
};
|
|
26
15
|
export default meta;
|
|
27
16
|
type Story = StoryObj<typeof meta>;
|
|
28
17
|
export declare const Simple: Story;
|
|
29
|
-
export declare const
|
|
18
|
+
export declare const WithAllOptionsDisabled: Story;
|
|
19
|
+
export declare const WithSomeOptionsDisabled: Story;
|
|
30
20
|
export declare const WithPrefix: Story;
|
|
31
|
-
export declare const
|
|
21
|
+
export declare const WithIcons: Story;
|
|
22
|
+
export declare const WithManyOptions: Story;
|
|
@@ -1,65 +1,89 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import "../Typography/Typography.js";
|
|
7
|
-
import "../IconButton/IconButton.js";
|
|
8
|
-
import { Select as i } from "./Select.js";
|
|
9
|
-
import "../Table/Table.js";
|
|
10
|
-
import "../Tabs/Tabs.js";
|
|
11
|
-
const r = (o) => /* @__PURE__ */ n.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...o }, /* @__PURE__ */ n.createElement("path", { d: "M0.512792 11.6594C0.139667 11.2516 0.167167 10.6184 0.574323 10.2447C0.766229 10.0688 1.00839 9.98175 1.24964 9.98175C1.52063 9.98175 1.79026 10.0912 1.98745 10.3064L2.99998 11.4406V2.00094C2.99998 1.44781 3.44779 1 3.99998 1C4.55217 1 4.99998 1.44781 4.99998 2.00094V11.4384L6.01248 10.3325C6.38748 9.92812 7.01873 9.89687 7.42498 10.2719C7.83216 10.6453 7.85935 11.2787 7.48651 11.6866L4.76463 14.6894C4.38588 15.1037 3.66901 15.1037 3.28995 14.6894L0.512792 11.6594Z", fill: "#1897F3" }), /* @__PURE__ */ n.createElement("path", { opacity: 0.4, d: "M9.99998 3H11.5859L9.29279 5.29313C9.00666 5.57925 8.92123 6.00906 9.07598 6.38313C9.23073 6.75719 9.59566 7 9.99973 7H13.9716C14.5531 6.97188 15 6.55313 15 6C15 5.44688 14.5522 5 14 5H12.414L14.7072 2.70688C14.9933 2.42075 15.0787 1.99094 14.924 1.61688C14.7692 1.24281 14.4031 1 13.9719 1H9.99998C9.44685 1 8.99998 1.44719 8.99998 2C8.99998 2.55281 9.44685 3 9.99998 3ZM15.3937 13.5406L12.894 8.5375C12.5553 7.85594 11.444 7.85594 11.1053 8.5375L8.6056 13.5406C8.35854 14.0378 8.55873 14.6419 9.05279 14.8903C9.54873 15.1379 10.1478 14.9365 10.3944 14.4403L10.6179 13.9906H13.3814L13.6049 14.4403C13.7979 14.8288 14.354 15.1863 14.9465 14.8903C15.4406 14.6438 15.6406 14.0375 15.3937 13.5406ZM11.4937 12.2313L12 11.2094L12.5069 12.2291H11.4937V12.2313Z", fill: "#1897F3" })), v = {
|
|
1
|
+
import { jsx as e, Fragment as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { useState as h } from "react";
|
|
4
|
+
import { Select as n } from "./Select.js";
|
|
5
|
+
const o = (t) => /* @__PURE__ */ d.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ d.createElement("path", { d: "M0.512792 11.6594C0.139667 11.2516 0.167167 10.6184 0.574323 10.2447C0.766229 10.0688 1.00839 9.98175 1.24964 9.98175C1.52063 9.98175 1.79026 10.0912 1.98745 10.3064L2.99998 11.4406V2.00094C2.99998 1.44781 3.44779 1 3.99998 1C4.55217 1 4.99998 1.44781 4.99998 2.00094V11.4384L6.01248 10.3325C6.38748 9.92812 7.01873 9.89687 7.42498 10.2719C7.83216 10.6453 7.85935 11.2787 7.48651 11.6866L4.76463 14.6894C4.38588 15.1037 3.66901 15.1037 3.28995 14.6894L0.512792 11.6594Z", fill: "#1897F3" }), /* @__PURE__ */ d.createElement("path", { opacity: 0.4, d: "M9.99998 3H11.5859L9.29279 5.29313C9.00666 5.57925 8.92123 6.00906 9.07598 6.38313C9.23073 6.75719 9.59566 7 9.99973 7H13.9716C14.5531 6.97188 15 6.55313 15 6C15 5.44688 14.5522 5 14 5H12.414L14.7072 2.70688C14.9933 2.42075 15.0787 1.99094 14.924 1.61688C14.7692 1.24281 14.4031 1 13.9719 1H9.99998C9.44685 1 8.99998 1.44719 8.99998 2C8.99998 2.55281 9.44685 3 9.99998 3ZM15.3937 13.5406L12.894 8.5375C12.5553 7.85594 11.444 7.85594 11.1053 8.5375L8.6056 13.5406C8.35854 14.0378 8.55873 14.6419 9.05279 14.8903C9.54873 15.1379 10.1478 14.9365 10.3944 14.4403L10.6179 13.9906H13.3814L13.6049 14.4403C13.7979 14.8288 14.354 15.1863 14.9465 14.8903C15.4406 14.6438 15.6406 14.0375 15.3937 13.5406ZM11.4937 12.2313L12 11.2094L12.5069 12.2291H11.4937V12.2313Z", fill: "#1897F3" })), g = {
|
|
12
6
|
title: "Components/Select",
|
|
13
|
-
component:
|
|
14
|
-
tags: ["autodocs"]
|
|
15
|
-
|
|
7
|
+
component: n,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "padded"
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
function c(t) {
|
|
14
|
+
const [l, s] = h(""), p = [
|
|
15
|
+
{ id: "1", name: "Frodo" },
|
|
16
|
+
{ id: "2", name: "Sam" },
|
|
17
|
+
{ id: "3", name: "Merry" },
|
|
18
|
+
{ id: "4", name: "Pippin" }
|
|
19
|
+
];
|
|
20
|
+
return /* @__PURE__ */ a(r, { children: [
|
|
21
|
+
/* @__PURE__ */ e(n, { ...t, value: l, onChange: (i) => s(i), children: p.map((i) => /* @__PURE__ */ e(n.Option, { value: i.id, children: i.name }, i.id)) }),
|
|
22
|
+
l && /* @__PURE__ */ a("pre", { style: { borderRadius: 4, background: "#fafafa", padding: 16, color: "#777777" }, children: [
|
|
23
|
+
"// selected character",
|
|
24
|
+
/* @__PURE__ */ e("br", {}),
|
|
25
|
+
JSON.stringify(
|
|
26
|
+
p.find((i) => i.id === l),
|
|
27
|
+
null,
|
|
28
|
+
4
|
|
29
|
+
)
|
|
30
|
+
] })
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
const f = {
|
|
34
|
+
args: {
|
|
35
|
+
placeholder: "Select an option"
|
|
36
|
+
},
|
|
37
|
+
render: c
|
|
38
|
+
}, S = {
|
|
39
|
+
name: "With all options disabled",
|
|
40
|
+
args: {
|
|
41
|
+
placeholder: "Select an option",
|
|
42
|
+
disabled: !0
|
|
43
|
+
},
|
|
44
|
+
render: c
|
|
45
|
+
}, v = {
|
|
46
|
+
name: "With some options disabled",
|
|
16
47
|
args: {
|
|
17
48
|
placeholder: "Select an option",
|
|
18
|
-
children: /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */ e(
|
|
20
|
-
/* @__PURE__ */ e(
|
|
21
|
-
/* @__PURE__ */ e(
|
|
22
|
-
/* @__PURE__ */ e(
|
|
49
|
+
children: /* @__PURE__ */ a(r, { children: [
|
|
50
|
+
/* @__PURE__ */ e(n.Option, { value: "1", disabled: !0, children: "Frodo" }),
|
|
51
|
+
/* @__PURE__ */ e(n.Option, { value: "2", children: "Sam" }),
|
|
52
|
+
/* @__PURE__ */ e(n.Option, { value: "3", disabled: !0, children: "Merry" }),
|
|
53
|
+
/* @__PURE__ */ e(n.Option, { value: "4", children: "Pippin" })
|
|
23
54
|
] })
|
|
24
55
|
}
|
|
25
|
-
},
|
|
56
|
+
}, O = {
|
|
57
|
+
name: "With prefix",
|
|
26
58
|
args: {
|
|
27
59
|
placeholder: "Select an option",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
] }),
|
|
34
|
-
disabled: !0
|
|
35
|
-
}
|
|
36
|
-
}, S = {
|
|
60
|
+
prefix: "Filter by:"
|
|
61
|
+
},
|
|
62
|
+
render: c
|
|
63
|
+
}, y = {
|
|
64
|
+
name: "With icons",
|
|
37
65
|
args: {
|
|
38
66
|
placeholder: "Select an option",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */ e(
|
|
42
|
-
/* @__PURE__ */ e(
|
|
43
|
-
/* @__PURE__ */ e(
|
|
44
|
-
/* @__PURE__ */ e(i.Option, { value: "4", children: "Pippin" })
|
|
67
|
+
children: /* @__PURE__ */ a(r, { children: [
|
|
68
|
+
/* @__PURE__ */ e(n.Option, { value: "1", icon: /* @__PURE__ */ e(o, {}), children: "Frodo" }),
|
|
69
|
+
/* @__PURE__ */ e(n.Option, { value: "2", icon: /* @__PURE__ */ e(o, {}), children: "Sam" }),
|
|
70
|
+
/* @__PURE__ */ e(n.Option, { value: "3", icon: /* @__PURE__ */ e(o, {}), children: "Merry" }),
|
|
71
|
+
/* @__PURE__ */ e(n.Option, { value: "4", icon: /* @__PURE__ */ e(o, {}), children: "Pippin" })
|
|
45
72
|
] })
|
|
46
73
|
}
|
|
47
|
-
},
|
|
74
|
+
}, L = {
|
|
75
|
+
name: "With many options",
|
|
48
76
|
args: {
|
|
49
77
|
placeholder: "Select an option",
|
|
50
|
-
|
|
51
|
-
children: /* @__PURE__ */ l(t, { children: [
|
|
52
|
-
/* @__PURE__ */ e(i.Option, { value: "1", disabled: !0, children: "Frodo" }),
|
|
53
|
-
/* @__PURE__ */ e(i.Option, { value: "2", icon: /* @__PURE__ */ e(r, {}), children: "Sam" }),
|
|
54
|
-
/* @__PURE__ */ e(i.Option, { value: "3", disabled: !0, children: "Mery" }),
|
|
55
|
-
/* @__PURE__ */ e(i.Option, { value: "4", children: "Pippin" })
|
|
56
|
-
] })
|
|
78
|
+
children: /* @__PURE__ */ e(r, { children: [...Array(20).keys()].map((t) => /* @__PURE__ */ e(n.Option, { value: String(t + 1), children: `Item #${t + 1}` })) })
|
|
57
79
|
}
|
|
58
80
|
};
|
|
59
81
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
f as Simple,
|
|
83
|
+
S as WithAllOptionsDisabled,
|
|
84
|
+
y as WithIcons,
|
|
85
|
+
L as WithManyOptions,
|
|
86
|
+
O as WithPrefix,
|
|
87
|
+
v as WithSomeOptionsDisabled,
|
|
88
|
+
g as default
|
|
65
89
|
};
|
|
@@ -5,9 +5,8 @@ export interface SelectButtonProps {
|
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
'aria-expanded': boolean;
|
|
8
|
-
|
|
9
|
-
type?: HTMLButtonElement['type'];
|
|
10
|
-
onClick: () => void;
|
|
8
|
+
prefix?: string;
|
|
11
9
|
'data-testid'?: string;
|
|
10
|
+
onClick: () => void;
|
|
12
11
|
}
|
|
13
|
-
export declare const
|
|
12
|
+
export declare const SelectButton: import('react').ForwardRefExoticComponent<SelectButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../clsx-DB4S2d7J.js";
|
|
4
4
|
import "../Typography/Typography.js";
|
|
5
|
-
import {
|
|
5
|
+
import { S as e } from "../../SelectButton-DWZ2BRaX.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
e as SelectButton
|
|
8
8
|
};
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { InputHTMLAttributes } from 'react';
|
|
2
2
|
|
|
3
|
-
type
|
|
3
|
+
export type SnackbarVariant = 'success' | 'error' | 'warning';
|
|
4
|
+
export type SnackbarProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
5
|
+
/** Snackbar variant */
|
|
6
|
+
variant: SnackbarVariant;
|
|
7
|
+
/** Message of snackbar */
|
|
8
|
+
snackbarMessage: string;
|
|
9
|
+
/** The open state for component visibility */
|
|
4
10
|
open?: boolean;
|
|
11
|
+
/** ID that tests can use to get this component from the DOM */
|
|
5
12
|
'data-testid'?: string;
|
|
13
|
+
/** Space seperated list of CSS classes to apply */
|
|
6
14
|
classNameWrapper?: string;
|
|
7
|
-
|
|
8
|
-
snackbarMessage: string;
|
|
15
|
+
/** Duration of visibility */
|
|
9
16
|
autoHideDuration?: number;
|
|
17
|
+
/** Callback for when close is clicked */
|
|
10
18
|
onClose?: () => void;
|
|
11
19
|
};
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Snackbars (also known as toasts) are used for
|
|
22
|
+
* brief notification of processes that
|
|
23
|
+
* have been or will be performed.
|
|
24
|
+
* */
|
|
25
|
+
export declare const Snackbar: ({ snackbarMessage, variant, autoHideDuration, open, onClose, classNameWrapper, "data-testid": dataTestId, }: SnackbarProps) => import("react/jsx-runtime").JSX.Element;
|