@jobber/components 6.112.1 → 6.113.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.
- package/dist/Autocomplete/Autocomplete.types.d.ts +41 -3
- package/dist/Autocomplete/components/FloatingMenu.d.ts +61 -0
- package/dist/Autocomplete/constants.d.ts +3 -0
- package/dist/Autocomplete/hooks/useAutocompleteListNav.d.ts +8 -1
- package/dist/Autocomplete/hooks/useChipNavigation.d.ts +17 -0
- package/dist/Autocomplete/index.cjs +437 -172
- package/dist/Autocomplete/index.d.ts +1 -7
- package/dist/Autocomplete/index.mjs +439 -174
- package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +37 -2
- package/dist/Autocomplete/useAutocomplete.d.ts +3 -1
- package/dist/Page/Page.d.ts +70 -70
- package/dist/Page/index.cjs +2 -1
- package/dist/Page/index.d.ts +2 -1
- package/dist/Page/index.mjs +2 -1
- package/dist/Page/types.d.ts +120 -0
- package/dist/Page-cjs.js +148 -16
- package/dist/Page-es.js +148 -16
- package/dist/floating-ui.react-es.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/styles.css +377 -242
- package/dist/utils/meta/meta.json +14 -0
- package/package.json +2 -2
package/dist/Page-es.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { _ as __rest } from './tslib.es6-es.js';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import classnames from 'classnames';
|
|
3
4
|
import { useResizeObserver, Breakpoints } from '@jobber/hooks';
|
|
@@ -8,11 +9,27 @@ import { M as Markdown } from './Markdown-es.js';
|
|
|
8
9
|
import { B as Button } from './Button-es.js';
|
|
9
10
|
import { M as Menu } from './Menu-es.js';
|
|
10
11
|
import { E as Emphasis } from './Emphasis-es.js';
|
|
12
|
+
import { f as filterDataAttributes } from './filterDataAttributes-es.js';
|
|
11
13
|
|
|
12
14
|
var styles = {"page":"BLYnKItuM3c-","fill":"n5WRRhMkoLs-","standard":"WziKEWW9nA8-","narrow":"qgGzgDyS2NY-","titleBar":"lbmoDvdtQO4-","titleRow":"k9y5NuqTcks-","actionGroup":"_7t53-bnzh98-","large":"SH0aNOLVhE8-","medium":"Lc7Z0FsBa6w-","small":"iF5IA1SYKoA-","primaryAction":"g-H7CKkX-LA-","actionButton":"RSP7jHjP-mw-","subtitle":"EqsNMrZVL-8-","spinning":"MJZVhEmx6h4-"};
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
/** Discriminates between the props-based API and the composable children API. */
|
|
17
|
+
function isLegacy(props) {
|
|
18
|
+
return "title" in props;
|
|
19
|
+
}
|
|
20
|
+
function Page(props) {
|
|
21
|
+
var _a;
|
|
22
|
+
const pageStyles = classnames(styles.page, styles[(_a = props.width) !== null && _a !== void 0 ? _a : "standard"]);
|
|
23
|
+
if (isLegacy(props)) {
|
|
24
|
+
return React__default.createElement(PageLegacy, Object.assign({}, props, { pageStyles: pageStyles }));
|
|
25
|
+
}
|
|
26
|
+
return (React__default.createElement("div", { className: pageStyles },
|
|
27
|
+
React__default.createElement(Content, null, props.children)));
|
|
28
|
+
}
|
|
29
|
+
/** Props-based renderer. Preserves the original Page behavior for existing consumers. */
|
|
30
|
+
function PageLegacy(_a) {
|
|
31
|
+
var { title, titleMetaData, intro, externalIntroLinks, subtitle, children, primaryAction, secondaryAction, moreActionsMenu = [], pageStyles } = _a, rest = __rest(_a, ["title", "titleMetaData", "intro", "externalIntroLinks", "subtitle", "children", "primaryAction", "secondaryAction", "moreActionsMenu", "pageStyles"]);
|
|
32
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
16
33
|
const [titleBarRef, { width: titleBarWidth = Breakpoints.large }] = useResizeObserver();
|
|
17
34
|
const titleBarClasses = classnames(styles.titleBar, {
|
|
18
35
|
[styles.small]: titleBarWidth > Breakpoints.smaller,
|
|
@@ -21,16 +38,7 @@ function Page({ title, titleMetaData, intro, externalIntroLinks, subtitle, child
|
|
|
21
38
|
});
|
|
22
39
|
const showMenu = moreActionsMenu.length > 0;
|
|
23
40
|
const showActionGroup = showMenu || primaryAction || secondaryAction;
|
|
24
|
-
|
|
25
|
-
primaryAction = Object.assign({ fullWidth: true }, primaryAction);
|
|
26
|
-
}
|
|
27
|
-
if (secondaryAction != undefined) {
|
|
28
|
-
secondaryAction = Object.assign({ type: "secondary", fullWidth: true }, secondaryAction);
|
|
29
|
-
}
|
|
30
|
-
if (secondaryAction != undefined) {
|
|
31
|
-
secondaryAction = Object.assign({ type: "secondary", fullWidth: true }, secondaryAction);
|
|
32
|
-
}
|
|
33
|
-
return (React__default.createElement("div", { className: pageStyles },
|
|
41
|
+
return (React__default.createElement("div", Object.assign({ className: pageStyles }, dataAttrs),
|
|
34
42
|
React__default.createElement(Content, null,
|
|
35
43
|
React__default.createElement(Content, null,
|
|
36
44
|
React__default.createElement("div", { className: titleBarClasses, ref: titleBarRef },
|
|
@@ -44,20 +52,144 @@ function Page({ title, titleMetaData, intro, externalIntroLinks, subtitle, child
|
|
|
44
52
|
React__default.createElement(Markdown, { content: subtitle, basicUsage: true })))))),
|
|
45
53
|
showActionGroup && (React__default.createElement("div", { className: styles.actionGroup },
|
|
46
54
|
primaryAction && (React__default.createElement("div", { className: styles.primaryAction, ref: primaryAction.ref },
|
|
47
|
-
React__default.createElement(Button, Object.assign({}, getActionProps(primaryAction))))),
|
|
55
|
+
React__default.createElement(Button, Object.assign({}, getActionProps(primaryAction), { fullWidth: true })))),
|
|
48
56
|
secondaryAction && (React__default.createElement("div", { className: styles.actionButton, ref: secondaryAction.ref },
|
|
49
|
-
React__default.createElement(Button, Object.assign({}, getActionProps(secondaryAction))))),
|
|
57
|
+
React__default.createElement(Button, Object.assign({}, getActionProps(secondaryAction), { fullWidth: true, type: "secondary" })))),
|
|
50
58
|
showMenu && (React__default.createElement("div", { className: styles.actionButton },
|
|
51
59
|
React__default.createElement(Menu, { items: moreActionsMenu })))))),
|
|
52
60
|
intro && (React__default.createElement(Text, { size: "large" },
|
|
53
61
|
React__default.createElement(Markdown, { content: intro, basicUsage: true, externalLink: externalIntroLinks })))),
|
|
54
62
|
React__default.createElement(Content, null, children))));
|
|
55
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Groups the title area and actions into the page header layout.
|
|
66
|
+
* Place non-action content (title, subtitle) inside `Page.HeaderContent`
|
|
67
|
+
* and actions inside `Page.Actions`.
|
|
68
|
+
*/
|
|
69
|
+
function PageHeader(_a) {
|
|
70
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
71
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
72
|
+
const [titleBarRef, { width: titleBarWidth = Breakpoints.large }] = useResizeObserver();
|
|
73
|
+
const titleBarClasses = classnames(styles.titleBar, {
|
|
74
|
+
[styles.small]: titleBarWidth > Breakpoints.smaller,
|
|
75
|
+
[styles.medium]: titleBarWidth > Breakpoints.small,
|
|
76
|
+
[styles.large]: titleBarWidth > Breakpoints.base,
|
|
77
|
+
});
|
|
78
|
+
return (React__default.createElement("div", Object.assign({ className: titleBarClasses, ref: titleBarRef }, dataAttrs), children));
|
|
79
|
+
}
|
|
80
|
+
/** Wraps the title area (title, subtitle) inside `Page.Header`. Use when the header contains more than one content element to keep them stacked vertically. */
|
|
81
|
+
function PageHeaderContent(_a) {
|
|
82
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
83
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
84
|
+
return React__default.createElement("div", Object.assign({}, dataAttrs), children);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Flex container for the page title and optional sibling elements such as
|
|
88
|
+
* status badges. Use when you need to display metadata alongside the heading.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```tsx
|
|
92
|
+
* <Page.TitleBar>
|
|
93
|
+
* <Page.Title>Clients</Page.Title>
|
|
94
|
+
* <StatusLabel label="Active" status="success" />
|
|
95
|
+
* </Page.TitleBar>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
function PageTitleBar(_a) {
|
|
99
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
100
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
101
|
+
return (React__default.createElement("div", Object.assign({ className: styles.titleRow }, dataAttrs), children));
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Renders the page heading as an H1. When metadata is present alongside the
|
|
105
|
+
* title, wrap both in `Page.TitleBar`.
|
|
106
|
+
*/
|
|
107
|
+
function PageTitle(_a) {
|
|
108
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
109
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
110
|
+
return (React__default.createElement(Heading, Object.assign({ level: 1 }, dataAttrs), children));
|
|
111
|
+
}
|
|
112
|
+
/** Secondary text below the title. Always applies default Text/Emphasis styling. */
|
|
113
|
+
function PageSubtitle(_a) {
|
|
114
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
115
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
116
|
+
return (React__default.createElement("div", Object.assign({ className: styles.subtitle }, dataAttrs),
|
|
117
|
+
React__default.createElement(Text, { size: "large", variation: "subdued" },
|
|
118
|
+
React__default.createElement(Emphasis, { variation: "bold" }, children))));
|
|
119
|
+
}
|
|
120
|
+
/** Introduction text between the header and body. Always applies default Text styling. */
|
|
121
|
+
function PageIntro({ children }) {
|
|
122
|
+
return React__default.createElement(Text, { size: "large" }, children);
|
|
123
|
+
}
|
|
124
|
+
/** Container for action buttons and menu. Applies responsive actionGroup layout. */
|
|
125
|
+
function PageActions(_a) {
|
|
126
|
+
var { children } = _a, rest = __rest(_a, ["children"]);
|
|
127
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
128
|
+
return (React__default.createElement("div", Object.assign({ className: styles.actionGroup }, dataAttrs), children));
|
|
129
|
+
}
|
|
130
|
+
/** Positional container for the primary action. Should contain a Button element, e.g. <Page.PrimaryButton>. */
|
|
131
|
+
function PageActionPrimary({ children, ref }) {
|
|
132
|
+
return (React__default.createElement("div", { className: styles.primaryAction, ref: ref }, children));
|
|
133
|
+
}
|
|
134
|
+
/** Positional container for the secondary action. Should contain a Button element, e.g. <Page.SecondaryButton>. */
|
|
135
|
+
function PageActionSecondary({ children, ref }) {
|
|
136
|
+
return (React__default.createElement("div", { className: styles.actionButton, ref: ref }, children));
|
|
137
|
+
}
|
|
138
|
+
/** Positional container for the menu action. Should contain Page.Menu or a custom Menu. */
|
|
139
|
+
function PageActionMenu({ children, ref }) {
|
|
140
|
+
return (React__default.createElement("div", { className: styles.actionButton, ref: ref }, children));
|
|
141
|
+
}
|
|
142
|
+
/** Default primary Button with opinionated styling. Use inside Page.ActionPrimary. */
|
|
143
|
+
function PagePrimaryButton(_a) {
|
|
144
|
+
var { ref, label, onClick, icon, disabled, loading, ariaLabel } = _a, rest = __rest(_a, ["ref", "label", "onClick", "icon", "disabled", "loading", "ariaLabel"]);
|
|
145
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
146
|
+
return (React__default.createElement("div", Object.assign({ ref: ref }, dataAttrs),
|
|
147
|
+
React__default.createElement(Button, { label: label, onClick: onClick, icon: icon, disabled: disabled, loading: loading, ariaLabel: ariaLabel, fullWidth: true })));
|
|
148
|
+
}
|
|
149
|
+
/** Default secondary Button with opinionated styling. Use inside Page.ActionSecondary. */
|
|
150
|
+
function PageSecondaryButton(_a) {
|
|
151
|
+
var { ref, label, onClick, icon, disabled, loading, ariaLabel } = _a, rest = __rest(_a, ["ref", "label", "onClick", "icon", "disabled", "loading", "ariaLabel"]);
|
|
152
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
153
|
+
return (React__default.createElement("div", Object.assign({ ref: ref }, dataAttrs),
|
|
154
|
+
React__default.createElement(Button, { label: label, onClick: onClick, icon: icon, disabled: disabled, loading: loading, ariaLabel: ariaLabel, fullWidth: true, type: "secondary" })));
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* "More Actions" menu with a default trigger button.
|
|
158
|
+
* Consumers supply Menu.Item children (in case custom routing is needed,
|
|
159
|
+
* e.g. wrapping Menu.Item with createLink() from TanStack Router).
|
|
160
|
+
*/
|
|
161
|
+
function PageMenu(_a) {
|
|
162
|
+
var { children, triggerLabel = "More Actions" } = _a, rest = __rest(_a, ["children", "triggerLabel"]);
|
|
163
|
+
const dataAttrs = filterDataAttributes(rest);
|
|
164
|
+
return (React__default.createElement("div", Object.assign({}, dataAttrs),
|
|
165
|
+
React__default.createElement(Menu, null,
|
|
166
|
+
React__default.createElement(Menu.Trigger, { UNSAFE_style: { display: "block" } },
|
|
167
|
+
React__default.createElement(Button, { icon: "more", label: triggerLabel, type: "secondary", fullWidth: true })),
|
|
168
|
+
React__default.createElement(Menu.Content, null, children))));
|
|
169
|
+
}
|
|
170
|
+
/** Main content area of the page. */
|
|
171
|
+
function PageBody({ children }) {
|
|
172
|
+
return React__default.createElement(Content, null, children);
|
|
173
|
+
}
|
|
56
174
|
const getActionProps = (actionProps) => {
|
|
57
|
-
const buttonProps =
|
|
58
|
-
if (actionProps.ref)
|
|
175
|
+
const buttonProps = (actionProps !== null && actionProps !== void 0 ? actionProps : {});
|
|
176
|
+
if (actionProps === null || actionProps === void 0 ? void 0 : actionProps.ref)
|
|
59
177
|
delete buttonProps.ref;
|
|
60
178
|
return buttonProps;
|
|
61
179
|
};
|
|
180
|
+
Page.Header = PageHeader;
|
|
181
|
+
Page.HeaderContent = PageHeaderContent;
|
|
182
|
+
Page.TitleBar = PageTitleBar;
|
|
183
|
+
Page.Title = PageTitle;
|
|
184
|
+
Page.Subtitle = PageSubtitle;
|
|
185
|
+
Page.Intro = PageIntro;
|
|
186
|
+
Page.Actions = PageActions;
|
|
187
|
+
Page.ActionPrimary = PageActionPrimary;
|
|
188
|
+
Page.ActionSecondary = PageActionSecondary;
|
|
189
|
+
Page.ActionMenu = PageActionMenu;
|
|
190
|
+
Page.PrimaryButton = PagePrimaryButton;
|
|
191
|
+
Page.SecondaryButton = PageSecondaryButton;
|
|
192
|
+
Page.Menu = PageMenu;
|
|
193
|
+
Page.Body = PageBody;
|
|
62
194
|
|
|
63
195
|
export { Page as P };
|
package/dist/index.cjs
CHANGED
|
@@ -112,12 +112,12 @@ require('react/jsx-runtime');
|
|
|
112
112
|
require('react-dom');
|
|
113
113
|
require('classnames');
|
|
114
114
|
require('./maxHeight-cjs.js');
|
|
115
|
-
require('./filterDataAttributes-cjs.js');
|
|
116
115
|
require('./tslib.es6-cjs.js');
|
|
116
|
+
require('react-hook-form');
|
|
117
|
+
require('./filterDataAttributes-cjs.js');
|
|
117
118
|
require('color');
|
|
118
119
|
require('react-router-dom');
|
|
119
120
|
require('./getMappedAtlantisSpaceToken-cjs.js');
|
|
120
|
-
require('react-hook-form');
|
|
121
121
|
require('./useChildComponent-cjs.js');
|
|
122
122
|
require('./InternalChipDismissible-cjs.js');
|
|
123
123
|
require('./useScrollToActive-cjs.js');
|
package/dist/index.mjs
CHANGED
|
@@ -110,12 +110,12 @@ import 'react/jsx-runtime';
|
|
|
110
110
|
import 'react-dom';
|
|
111
111
|
import 'classnames';
|
|
112
112
|
import './maxHeight-es.js';
|
|
113
|
-
import './filterDataAttributes-es.js';
|
|
114
113
|
import './tslib.es6-es.js';
|
|
114
|
+
import 'react-hook-form';
|
|
115
|
+
import './filterDataAttributes-es.js';
|
|
115
116
|
import 'color';
|
|
116
117
|
import 'react-router-dom';
|
|
117
118
|
import './getMappedAtlantisSpaceToken-es.js';
|
|
118
|
-
import 'react-hook-form';
|
|
119
119
|
import './useChildComponent-es.js';
|
|
120
120
|
import './InternalChipDismissible-es.js';
|
|
121
121
|
import './useScrollToActive-es.js';
|