@worknice/whiteboard 0.23.3 → 0.25.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 (45) hide show
  1. package/dist/controls/Action.stories.d.ts +52 -0
  2. package/dist/controls/Action.stories.js +93 -0
  3. package/dist/controls/Button.stories.d.ts +2 -16
  4. package/dist/controls/Button.stories.js +5 -28
  5. package/dist/controls/ButtonCard.stories.d.ts +31 -0
  6. package/dist/controls/ButtonCard.stories.js +77 -0
  7. package/dist/controls/ButtonLink.d.ts +6 -1
  8. package/dist/controls/ButtonLink.js +1 -1
  9. package/dist/controls/ButtonLink.stories.d.ts +46 -0
  10. package/dist/controls/ButtonLink.stories.js +72 -0
  11. package/dist/controls/Disclosure.d.ts +4 -0
  12. package/dist/controls/Disclosure.stories.d.ts +53 -0
  13. package/dist/controls/Disclosure.stories.js +132 -0
  14. package/dist/controls/Link.d.ts +5 -0
  15. package/dist/controls/Link.stories.d.ts +38 -0
  16. package/dist/controls/Link.stories.js +34 -0
  17. package/dist/controls/LinkCard.stories.d.ts +23 -0
  18. package/dist/controls/LinkCard.stories.js +25 -0
  19. package/dist/controls/MenuButton.d.ts +2 -0
  20. package/dist/controls/MenuButton.js +2 -1
  21. package/dist/controls/MenuButton.stories.d.ts +71 -0
  22. package/dist/controls/MenuButton.stories.js +275 -0
  23. package/dist/controls/PageTabSet.d.ts +6 -2
  24. package/dist/controls/PageTabSet.js +2 -2
  25. package/dist/controls/PageTabSet.stories.d.ts +49 -0
  26. package/dist/controls/PageTabSet.stories.js +106 -0
  27. package/dist/controls/Sortable.d.ts +8 -4
  28. package/dist/controls/Sortable.stories.d.ts +32 -0
  29. package/dist/controls/Sortable.stories.js +106 -0
  30. package/dist/controls/SortableItem.d.ts +1 -0
  31. package/dist/controls/TabSet.stories.d.ts +43 -0
  32. package/dist/controls/TabSet.stories.js +109 -0
  33. package/dist/controls/TabSetLink.d.ts +3 -0
  34. package/dist/controls/TabSetLink.stories.d.ts +44 -0
  35. package/dist/controls/TabSetLink.stories.js +204 -0
  36. package/dist/fields/StringField.d.ts +1 -1
  37. package/dist/fields/StringField.js +3 -2
  38. package/dist/presentation/PersonAvatar.js +1 -0
  39. package/dist/utils/storybook.d.ts +2 -0
  40. package/dist/utils/storybook.js +26 -0
  41. package/dist/validators/isFutureDate.d.ts +8 -0
  42. package/dist/validators/isFutureDate.js +23 -0
  43. package/dist/validators/isFutureDate.test.d.ts +1 -0
  44. package/dist/validators/isFutureDate.test.js +119 -0
  45. package/package.json +12 -14
@@ -0,0 +1,132 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__ from "storybook/test";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_Card_js_6a9e15fd__ from "../presentation/Card.js";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_CardContent_js_72373f62__ from "../presentation/CardContent.js";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_ConfirmationModal_js_ded519be__ from "../presentation/ConfirmationModal.js";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_Icon_js_6961aa57__ from "../presentation/Icon.js";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_Modal_js_31b952b2__ from "../presentation/Modal.js";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__ from "../presentation/PlainText.js";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_VStack_js_fd392b79__ from "../presentation/VStack.js";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_3cc1ba9c__ from "../utils/storybook.js";
11
+ import * as __WEBPACK_EXTERNAL_MODULE__Disclosure_js_c4149207__ from "./Disclosure.js";
12
+ const meta = {
13
+ component: __WEBPACK_EXTERNAL_MODULE__Disclosure_js_c4149207__["default"],
14
+ argTypes: {
15
+ id: {
16
+ control: false
17
+ },
18
+ title: {
19
+ control: false
20
+ },
21
+ children: {
22
+ table: {
23
+ type: {
24
+ summary: "ReactNode"
25
+ }
26
+ }
27
+ },
28
+ icon: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_3cc1ba9c__.iconStoryControl)()
29
+ },
30
+ args: {
31
+ id: "default-button",
32
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
33
+ children: "Open modal"
34
+ }),
35
+ type: "secondary",
36
+ size: "normal",
37
+ disabled: false,
38
+ tooltip: "This is a tooltip",
39
+ render: (onClose)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Modal_js_31b952b2__["default"], {
40
+ onClose: onClose,
41
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Card_js_6a9e15fd__["default"], {
42
+ header: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__["default"], {
43
+ font: "h6",
44
+ tagName: "h6",
45
+ children: "Simple Modal"
46
+ }),
47
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_CardContent_js_72373f62__["default"], {
48
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE__presentation_VStack_js_fd392b79__["default"], {
49
+ spacing: "p2",
50
+ children: [
51
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__["default"], {
52
+ children: "This is a simple modal opened by Disclosure."
53
+ }),
54
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__["default"], {
55
+ tone: "muted",
56
+ children: "Click outside or press Escape to close."
57
+ })
58
+ ]
59
+ })
60
+ })
61
+ })
62
+ })
63
+ }
64
+ };
65
+ const Disclosure_stories_rslib_entry_ = meta;
66
+ const WithSimpleModal = {
67
+ args: {
68
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
69
+ children: "Open modal"
70
+ })
71
+ }
72
+ };
73
+ const WithConfirmationModal = {
74
+ args: {
75
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
76
+ children: "Archive"
77
+ }),
78
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Icon_js_6961aa57__["default"], {
79
+ symbol: "Archive"
80
+ }),
81
+ render: (onClose)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_ConfirmationModal_js_ded519be__["default"], {
82
+ title: "Archive item",
83
+ primaryLabel: "Archive",
84
+ onClose: onClose,
85
+ onSubmit: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)(async ()=>{
86
+ await new Promise((resolve)=>setTimeout(resolve, 1000));
87
+ }),
88
+ onSuccess: onClose,
89
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__["default"], {
90
+ children: "Are you sure you want to archive this item? This action cannot be undone."
91
+ })
92
+ })
93
+ }
94
+ };
95
+ const WithIcon = {
96
+ args: {
97
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
98
+ children: "Edit"
99
+ }),
100
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Icon_js_6961aa57__["default"], {
101
+ symbol: "Edit"
102
+ })
103
+ }
104
+ };
105
+ const Primary = {
106
+ args: {
107
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
108
+ children: "Save"
109
+ }),
110
+ type: "primary"
111
+ }
112
+ };
113
+ const Small = {
114
+ args: {
115
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
116
+ children: "Duplicate"
117
+ }),
118
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Icon_js_6961aa57__["default"], {
119
+ symbol: "Copy"
120
+ }),
121
+ size: "small"
122
+ }
123
+ };
124
+ const Disabled = {
125
+ args: {
126
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
127
+ children: "Disabled"
128
+ }),
129
+ disabled: true
130
+ }
131
+ };
132
+ export { Disabled, Primary, Small, WithConfirmationModal, WithIcon, WithSimpleModal, Disclosure_stories_rslib_entry_ as default };
@@ -1,7 +1,12 @@
1
1
  import { type ReactNode } from "react";
2
2
  type Props = {
3
3
  children: ReactNode;
4
+ /** What to download, if true the href is used as the download filename.
5
+ *
6
+ * See: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/a#download
7
+ * */
4
8
  download?: string | boolean;
9
+ /** Whether the link should open in a new tab. */
5
10
  external?: boolean;
6
11
  font?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "monospace" | "regular-bold-italic" | "regular-bold" | "regular-italic" | "regular" | "small-bold-italic" | "small-bold" | "small-italic" | "small" | "tiny-bold-italic" | "tiny-bold" | "tiny-italic" | "tiny";
7
12
  href: string;
@@ -0,0 +1,38 @@
1
+ import type { StoryObj } from "@storybook/nextjs-vite";
2
+ declare const meta: {
3
+ component: ({ children, download, external, font, href, tone, id, icon, iconRight, }: {
4
+ children: import("react").ReactNode;
5
+ download?: string | boolean;
6
+ external?: boolean;
7
+ font?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "monospace" | "regular-bold-italic" | "regular-bold" | "regular-italic" | "regular" | "small-bold-italic" | "small-bold" | "small-italic" | "small" | "tiny-bold-italic" | "tiny-bold" | "tiny-italic" | "tiny";
8
+ href: string;
9
+ id?: string;
10
+ tone?: "default" | "primary" | "muted" | "danger" | "warning" | "success" | "info";
11
+ icon?: import("react").ReactNode;
12
+ iconRight?: import("react").ReactNode;
13
+ }) => import("react/jsx-runtime").JSX.Element;
14
+ argTypes: {
15
+ id: {
16
+ control: false;
17
+ };
18
+ children: {
19
+ table: {
20
+ type: {
21
+ summary: string;
22
+ };
23
+ };
24
+ };
25
+ icon: import("storybook/internal/csf").InputType;
26
+ iconRight: import("storybook/internal/csf").InputType;
27
+ };
28
+ args: {
29
+ download: false;
30
+ href: string;
31
+ children: import("react/jsx-runtime").JSX.Element;
32
+ external: false;
33
+ id: string;
34
+ };
35
+ };
36
+ export default meta;
37
+ type Story = StoryObj<typeof meta>;
38
+ export declare const Default: Story;
@@ -0,0 +1,34 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_3cc1ba9c__ from "../utils/storybook.js";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__Link_js_42733813__ from "./Link.js";
4
+ const meta = {
5
+ component: __WEBPACK_EXTERNAL_MODULE__Link_js_42733813__["default"],
6
+ argTypes: {
7
+ id: {
8
+ control: false
9
+ },
10
+ children: {
11
+ table: {
12
+ type: {
13
+ summary: "ReactNode"
14
+ }
15
+ }
16
+ },
17
+ icon: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_3cc1ba9c__.iconStoryControl)(),
18
+ iconRight: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_3cc1ba9c__.iconStoryControl)()
19
+ },
20
+ args: {
21
+ download: false,
22
+ href: "#",
23
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
24
+ children: "Click me!"
25
+ }),
26
+ external: false,
27
+ id: "button-link-1"
28
+ }
29
+ };
30
+ const Link_stories_rslib_entry_ = meta;
31
+ const Default = {
32
+ args: {}
33
+ };
34
+ export { Default, Link_stories_rslib_entry_ as default };
@@ -0,0 +1,23 @@
1
+ import type { StoryObj } from "@storybook/nextjs-vite";
2
+ declare const meta: {
3
+ component: ({ children, href }: {
4
+ children: import("react").ReactNode;
5
+ href: string;
6
+ }) => import("react/jsx-runtime").JSX.Element;
7
+ argTypes: {
8
+ children: {
9
+ table: {
10
+ type: {
11
+ summary: string;
12
+ };
13
+ };
14
+ };
15
+ };
16
+ args: {
17
+ href: string;
18
+ children: import("react/jsx-runtime").JSX.Element;
19
+ };
20
+ };
21
+ export default meta;
22
+ type Story = StoryObj<typeof meta>;
23
+ export declare const Default: Story;
@@ -0,0 +1,25 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__LinkCard_js_900a4437__ from "./LinkCard.js";
3
+ const meta = {
4
+ component: __WEBPACK_EXTERNAL_MODULE__LinkCard_js_900a4437__["default"],
5
+ argTypes: {
6
+ children: {
7
+ table: {
8
+ type: {
9
+ summary: "ReactNode"
10
+ }
11
+ }
12
+ }
13
+ },
14
+ args: {
15
+ href: "#",
16
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
17
+ children: "Click me!"
18
+ })
19
+ }
20
+ };
21
+ const LinkCard_stories_rslib_entry_ = meta;
22
+ const Default = {
23
+ args: {}
24
+ };
25
+ export { Default, LinkCard_stories_rslib_entry_ as default };
@@ -28,10 +28,12 @@ type Props = {
28
28
  children?: ReactNode;
29
29
  icon: ReactNode;
30
30
  }) & ({
31
+ /** An array of options to display in the menu. Can be a link or use render or onClick callbacks. It is mutually exclusive with optionGroups. */
31
32
  options: Array<Option | null>;
32
33
  optionGroups?: never;
33
34
  } | {
34
35
  options?: never;
36
+ /** An array of option groups to display in the menu. Each group has a header and an array of options. It is mutually exclusive with options. */
35
37
  optionGroups: Array<{
36
38
  header: string;
37
39
  options: Array<Option | null>;
@@ -157,7 +157,8 @@ const MenuButton = ({ autoFocus = false, disabled = false, id, options, optionGr
157
157
  activeIndex,
158
158
  getItemProps,
159
159
  optionsRef,
160
- NextLink
160
+ NextLink,
161
+ triggerOption
161
162
  ]);
162
163
  const triggerOptionAtIndex = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((index)=>{
163
164
  if (null == index) return;
@@ -0,0 +1,71 @@
1
+ import type { StoryObj } from "@storybook/nextjs-vite";
2
+ declare const meta: {
3
+ component: ({ autoFocus, disabled, id, options, optionGroups, searchPlaceholder, children, icon, iconRight, displaySearch, fullWidth, }: {
4
+ autoFocus?: boolean;
5
+ disabled?: boolean;
6
+ id?: string;
7
+ searchPlaceholder?: string;
8
+ displaySearch?: boolean;
9
+ iconRight?: import("react").ReactNode;
10
+ fullWidth?: boolean;
11
+ } & ({
12
+ children: import("react").ReactNode;
13
+ icon?: import("react").ReactNode;
14
+ } | {
15
+ children?: import("react").ReactNode;
16
+ icon: import("react").ReactNode;
17
+ }) & ({
18
+ options: Array<import("./MenuButton").MenuButtonOption | null>;
19
+ optionGroups?: never;
20
+ } | {
21
+ options?: never;
22
+ optionGroups: Array<{
23
+ header: string;
24
+ options: Array<import("./MenuButton").MenuButtonOption | null>;
25
+ }>;
26
+ })) => import("react/jsx-runtime").JSX.Element;
27
+ argTypes: {
28
+ id: {
29
+ control: false;
30
+ };
31
+ children: {
32
+ table: {
33
+ type: {
34
+ summary: string;
35
+ };
36
+ };
37
+ };
38
+ icon: import("storybook/internal/csf").InputType;
39
+ iconRight: import("storybook/internal/csf").InputType;
40
+ options: {
41
+ control: false;
42
+ };
43
+ optionGroups: {
44
+ control: false;
45
+ };
46
+ };
47
+ args: {
48
+ id: string;
49
+ disabled: false;
50
+ fullWidth: false;
51
+ displaySearch: false;
52
+ searchPlaceholder: string;
53
+ autoFocus: false;
54
+ options: {
55
+ id: string;
56
+ label: string;
57
+ type: "onClick";
58
+ onClick: import("storybook/test").Mock<(...args: any[]) => any>;
59
+ }[];
60
+ };
61
+ };
62
+ export default meta;
63
+ type Story = StoryObj<typeof meta>;
64
+ export declare const Normal: Story;
65
+ export declare const WithChildrenAndIcon: Story;
66
+ export declare const WithSearch: Story;
67
+ export declare const WithOptionGroups: Story;
68
+ export declare const WithDisabledOptions: Story;
69
+ export declare const Disabled: Story;
70
+ export declare const WithManyOptions: Story;
71
+ export declare const WithMixedOptionTypes: Story;
@@ -0,0 +1,275 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__ from "storybook/test";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_Card_js_6a9e15fd__ from "../presentation/Card.js";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_CardContent_js_72373f62__ from "../presentation/CardContent.js";
5
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_Icon_js_6961aa57__ from "../presentation/Icon.js";
6
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_Modal_js_31b952b2__ from "../presentation/Modal.js";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__ from "../presentation/PlainText.js";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__presentation_VStack_js_fd392b79__ from "../presentation/VStack.js";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_3cc1ba9c__ from "../utils/storybook.js";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__MenuButton_js_7e3407c7__ from "./MenuButton.js";
11
+ const meta = {
12
+ component: __WEBPACK_EXTERNAL_MODULE__MenuButton_js_7e3407c7__["default"],
13
+ argTypes: {
14
+ id: {
15
+ control: false
16
+ },
17
+ children: {
18
+ table: {
19
+ type: {
20
+ summary: "ReactNode"
21
+ }
22
+ }
23
+ },
24
+ icon: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_3cc1ba9c__.iconStoryControl)(),
25
+ iconRight: (0, __WEBPACK_EXTERNAL_MODULE__utils_storybook_js_3cc1ba9c__.iconStoryControl)(),
26
+ options: {
27
+ control: false
28
+ },
29
+ optionGroups: {
30
+ control: false
31
+ }
32
+ },
33
+ args: {
34
+ id: "default-menu-button",
35
+ disabled: false,
36
+ fullWidth: false,
37
+ displaySearch: false,
38
+ searchPlaceholder: "Search...",
39
+ autoFocus: false,
40
+ options: [
41
+ {
42
+ id: "option-1",
43
+ label: "Option 1",
44
+ type: "onClick",
45
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
46
+ },
47
+ {
48
+ id: "option-2",
49
+ label: "Option 2",
50
+ type: "onClick",
51
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
52
+ },
53
+ {
54
+ id: "option-3",
55
+ label: "Option 3",
56
+ type: "onClick",
57
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
58
+ }
59
+ ]
60
+ }
61
+ };
62
+ const MenuButton_stories_rslib_entry_ = meta;
63
+ const Normal = {
64
+ args: {
65
+ id: "icon-only-menu-button",
66
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Icon_js_6961aa57__["default"], {
67
+ symbol: "Overflow"
68
+ })
69
+ }
70
+ };
71
+ const WithChildrenAndIcon = {
72
+ args: {
73
+ id: "with-children-and-icon-menu-button",
74
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
75
+ children: "Add item"
76
+ }),
77
+ icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Icon_js_6961aa57__["default"], {
78
+ symbol: "Plus"
79
+ })
80
+ }
81
+ };
82
+ const WithSearch = {
83
+ args: {
84
+ id: "with-search-menu-button",
85
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
86
+ children: "Find option"
87
+ }),
88
+ displaySearch: true,
89
+ searchPlaceholder: "Find option...",
90
+ options: [
91
+ {
92
+ id: "option-1",
93
+ label: "Apple",
94
+ type: "onClick",
95
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
96
+ },
97
+ {
98
+ id: "option-2",
99
+ label: "Banana",
100
+ type: "onClick",
101
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
102
+ },
103
+ {
104
+ id: "option-3",
105
+ label: "Cherry",
106
+ type: "onClick",
107
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
108
+ },
109
+ {
110
+ id: "option-4",
111
+ label: "Date",
112
+ type: "onClick",
113
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
114
+ },
115
+ {
116
+ id: "option-5",
117
+ label: "Elderberry",
118
+ type: "onClick",
119
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
120
+ }
121
+ ]
122
+ }
123
+ };
124
+ const WithOptionGroups = {
125
+ args: {
126
+ id: "with-groups-menu-button",
127
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
128
+ children: "Choose with category"
129
+ }),
130
+ options: void 0,
131
+ optionGroups: [
132
+ {
133
+ header: "Fruits",
134
+ options: [
135
+ {
136
+ id: "apple",
137
+ label: "Apple",
138
+ type: "onClick",
139
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
140
+ },
141
+ {
142
+ id: "banana",
143
+ label: "Banana",
144
+ type: "onClick",
145
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
146
+ }
147
+ ]
148
+ },
149
+ {
150
+ header: "Vegetables",
151
+ options: [
152
+ {
153
+ id: "carrot",
154
+ label: "Carrot",
155
+ type: "onClick",
156
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
157
+ },
158
+ {
159
+ id: "lettuce",
160
+ label: "Lettuce",
161
+ type: "onClick",
162
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
163
+ }
164
+ ]
165
+ }
166
+ ]
167
+ }
168
+ };
169
+ const WithDisabledOptions = {
170
+ args: {
171
+ id: "with-disabled-menu-button",
172
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
173
+ children: "Choose option"
174
+ }),
175
+ options: [
176
+ {
177
+ id: "option-1",
178
+ label: "Enabled Option",
179
+ type: "onClick",
180
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
181
+ },
182
+ {
183
+ id: "option-2",
184
+ label: "Disabled Option",
185
+ disabled: true,
186
+ type: "onClick",
187
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
188
+ },
189
+ {
190
+ id: "option-3",
191
+ label: "Another Enabled",
192
+ type: "onClick",
193
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
194
+ }
195
+ ]
196
+ }
197
+ };
198
+ const Disabled = {
199
+ args: {
200
+ id: "disabled-menu-button",
201
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
202
+ children: "Disabled"
203
+ }),
204
+ disabled: true
205
+ }
206
+ };
207
+ const WithManyOptions = {
208
+ args: {
209
+ id: "many-options-menu-button",
210
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
211
+ children: "Choose from many"
212
+ }),
213
+ displaySearch: true,
214
+ options: Array.from({
215
+ length: 20
216
+ }, (_, i)=>({
217
+ id: `option-${i + 1}`,
218
+ label: `Option ${i + 1}`,
219
+ type: "onClick",
220
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
221
+ }))
222
+ }
223
+ };
224
+ const WithMixedOptionTypes = {
225
+ args: {
226
+ id: "with-links-menu-button",
227
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
228
+ children: "Navigate"
229
+ }),
230
+ options: [
231
+ {
232
+ id: "link-1",
233
+ label: "Link",
234
+ type: "link",
235
+ href: "#"
236
+ },
237
+ {
238
+ id: "click-1",
239
+ label: "OnClick Callback",
240
+ type: "onClick",
241
+ onClick: (0, __WEBPACK_EXTERNAL_MODULE_storybook_test_a99c99ea__.fn)()
242
+ },
243
+ {
244
+ id: "render-1",
245
+ label: "Render callback with modal",
246
+ type: "render",
247
+ render: (onClose)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Modal_js_31b952b2__["default"], {
248
+ onClose: onClose,
249
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_Card_js_6a9e15fd__["default"], {
250
+ header: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__["default"], {
251
+ font: "h6",
252
+ tagName: "h6",
253
+ children: "Simple Modal"
254
+ }),
255
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_CardContent_js_72373f62__["default"], {
256
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE__presentation_VStack_js_fd392b79__["default"], {
257
+ spacing: "p2",
258
+ children: [
259
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__["default"], {
260
+ children: "This is a simple modal opened by Disclosure."
261
+ }),
262
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__presentation_PlainText_js_e98763ad__["default"], {
263
+ tone: "muted",
264
+ children: "Click outside or press Escape to close."
265
+ })
266
+ ]
267
+ })
268
+ })
269
+ })
270
+ })
271
+ }
272
+ ]
273
+ }
274
+ };
275
+ export { Disabled, Normal, WithChildrenAndIcon, WithDisabledOptions, WithManyOptions, WithMixedOptionTypes, WithOptionGroups, WithSearch, MenuButton_stories_rslib_entry_ as default };
@@ -1,12 +1,16 @@
1
1
  import { type ReactNode } from "react";
2
2
  type Props = {
3
3
  id?: string;
4
- pages: Array<{
4
+ pages: {
5
5
  path: string;
6
6
  label: ReactNode;
7
7
  key: string;
8
- }>;
8
+ }[];
9
9
  variant?: "default" | "steps";
10
10
  };
11
+ /**
12
+ * A set of tabs that can be used to navigate between pages. Depends on Link and pathname from NextContext.
13
+ * For a controlled version of this, see TabSetLink.
14
+ */
11
15
  declare const PageTabSet: ({ id, pages, variant }: Props) => import("react/jsx-runtime").JSX.Element;
12
16
  export default PageTabSet;