@assembly-js/design-system 2.4.1 → 3.0.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/.yarn/install-state.gz +0 -0
- package/dist/esm/common/utils.js +4 -1
- package/dist/esm/components/Avatar/Avatar.js +1 -1
- package/dist/esm/components/Button/index.js +1 -0
- package/dist/esm/components/Callout/Callout.js +4 -2
- package/dist/esm/components/Chip/Chip.js +2 -1
- package/dist/esm/components/Status/Status.js +2 -1
- package/dist/esm/components/Toast/Toaster.js +2 -1
- package/dist/esm/components/Typography/Base.js +1 -1
- package/dist/esm/components/Typography/Heading.js +16 -1
- package/dist/esm/components/UserCompanySelector/LimitedOptionsList.js +1 -1
- package/dist/esm/components/UserCompanySelector/ListItem.js +5 -5
- package/dist/esm/components/UserCompanySelector/UserCompanySelector.js +1 -1
- package/dist/esm/types/components/Avatar/Avatar.d.ts +6 -6
- package/dist/esm/types/components/Typography/Base.stories.d.ts +2 -2
- package/dist/esm/types/tsconfig.tsbuildinfo +1 -1
- package/dist/styles/main.css +1 -1
- package/dist/types/components/Avatar/Avatar.d.ts +6 -6
- package/dist/types/components/Typography/Base.stories.d.ts +2 -2
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/umd/common/utils.js +4 -1
- package/dist/umd/components/Avatar/Avatar.js +1 -1
- package/dist/umd/components/Button/index.js +1 -0
- package/dist/umd/components/Callout/Callout.js +4 -2
- package/dist/umd/components/Chip/Chip.js +2 -1
- package/dist/umd/components/Status/Status.js +2 -1
- package/dist/umd/components/Toast/Toaster.js +2 -1
- package/dist/umd/components/Typography/Base.js +1 -1
- package/dist/umd/components/Typography/Heading.js +19 -5
- package/dist/umd/components/UserCompanySelector/LimitedOptionsList.js +1 -1
- package/dist/umd/components/UserCompanySelector/ListItem.js +5 -5
- package/dist/umd/components/UserCompanySelector/UserCompanySelector.js +1 -1
- package/dist/umd/types/components/Avatar/Avatar.d.ts +6 -6
- package/dist/umd/types/components/Typography/Base.stories.d.ts +2 -2
- package/dist/umd/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/umd/common/utils.js
CHANGED
|
@@ -20,11 +20,14 @@
|
|
|
20
20
|
_exports.cn = cn;
|
|
21
21
|
_exports.ensureUnreachable = ensureUnreachable;
|
|
22
22
|
_exports.getInitials = getInitials;
|
|
23
|
+
var twMerge = (0, _tailwindMerge.extendTailwindMerge)({
|
|
24
|
+
prefix: 'cop-'
|
|
25
|
+
});
|
|
23
26
|
function cn() {
|
|
24
27
|
for (var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
25
28
|
inputs[_key] = arguments[_key];
|
|
26
29
|
}
|
|
27
|
-
return
|
|
30
|
+
return twMerge((0, _clsx.clsx)(inputs));
|
|
28
31
|
}
|
|
29
32
|
function ensureUnreachable(value, message) {
|
|
30
33
|
throw new Error(message !== null && message !== void 0 ? message : "Unreachable code hit with value ".concat(String(value)));
|
|
@@ -169,7 +169,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
169
169
|
alt: props.alt
|
|
170
170
|
}), 'text' in props && !props.icon && /*#__PURE__*/React.createElement(AvatarFallback, null, /*#__PURE__*/React.createElement(_Typography.Heading, {
|
|
171
171
|
size: TEXT_SIZE_MAP[size],
|
|
172
|
-
className: fallbackClassName
|
|
172
|
+
className: (0, _utils.cn)('cop-my-0', fallbackClassName)
|
|
173
173
|
}, props.text)), props.icon && /*#__PURE__*/React.createElement(AvatarFallback, null, /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
174
174
|
icon: props.icon,
|
|
175
175
|
className: AVATAR_ICON_SIZE_MAP[size]
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
icon: prefixIcon,
|
|
78
78
|
className: (0, _clsx["default"])('cop-pr-2', iconClasses)
|
|
79
79
|
}), /*#__PURE__*/_react["default"].createElement(_Base.Base, {
|
|
80
|
+
className: "cop-m-0",
|
|
80
81
|
size: size === 'base' ? 'base' : 'xs',
|
|
81
82
|
leading: size === 'base' ? '1' : '075',
|
|
82
83
|
tag: "p",
|
|
@@ -93,9 +93,11 @@
|
|
|
93
93
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
94
94
|
className: "cop-flex-1"
|
|
95
95
|
}, /*#__PURE__*/_react["default"].createElement(_Typography.Heading, {
|
|
96
|
-
size: "base"
|
|
96
|
+
size: "base",
|
|
97
|
+
className: "cop-my-0"
|
|
97
98
|
}, title), /*#__PURE__*/_react["default"].createElement(_Typography.Body, {
|
|
98
|
-
size: "base"
|
|
99
|
+
size: "base",
|
|
100
|
+
className: "cop-m-0"
|
|
99
101
|
}, description), footerAction && /*#__PURE__*/_react["default"].createElement("div", {
|
|
100
102
|
className: "cop-mt-2"
|
|
101
103
|
}, /*#__PURE__*/_react["default"].createElement(_TextLink.TextLink, footerAction))), onClose && /*#__PURE__*/_react["default"].createElement(_Button.IconButton, {
|
|
@@ -143,7 +143,8 @@
|
|
|
143
143
|
size: size
|
|
144
144
|
})
|
|
145
145
|
}), /*#__PURE__*/_react["default"].createElement(_Typography.Body, {
|
|
146
|
-
size: size !== 'sm' ? 'base' : 'sm'
|
|
146
|
+
size: size !== 'sm' ? 'base' : 'sm',
|
|
147
|
+
className: "cop-m-0"
|
|
147
148
|
}, label), Boolean(onClose) ?
|
|
148
149
|
/*#__PURE__*/
|
|
149
150
|
// We intentionally attach both onClick and onTouch event
|
|
@@ -77,7 +77,8 @@
|
|
|
77
77
|
icon: icon !== null && icon !== void 0 ? icon : mapIconToStatus(status),
|
|
78
78
|
className: "cop-h-2.5 cop-w-2.5"
|
|
79
79
|
}) : null, /*#__PURE__*/_react["default"].createElement(_Typography.Heading, {
|
|
80
|
-
size: "sm"
|
|
80
|
+
size: "sm",
|
|
81
|
+
className: "cop-my-0"
|
|
81
82
|
}, label));
|
|
82
83
|
};
|
|
83
84
|
});
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
48
48
|
className: "cop-flex cop-w-full cop-items-center cop-justify-between cop-text-primary"
|
|
49
49
|
}, title && /*#__PURE__*/_react["default"].createElement(_Typography.Heading, {
|
|
50
|
-
size: "sm"
|
|
50
|
+
size: "sm",
|
|
51
|
+
className: "cop-my-0"
|
|
51
52
|
}, title), props.variant !== 'progress' && /*#__PURE__*/_react["default"].createElement(_Toast.ToastClose, null)), typeof description === 'string' ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
52
53
|
className: "cop-text-secondary"
|
|
53
54
|
}, /*#__PURE__*/_react["default"].createElement(_Body.Body, {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
81
81
|
var Tag = tag;
|
|
82
82
|
return /*#__PURE__*/_react["default"].createElement(Tag, _extends({
|
|
83
|
-
className: (0, _utils.cn)(
|
|
83
|
+
className: (0, _utils.cn)(VARIANT_CLASSNAMES[variant], SIZE_CLASSNAMES[size], LEADING_CLASSNAMES[leading], WEIGHT_CLASSNAMES[weight], className)
|
|
84
84
|
}, props), children);
|
|
85
85
|
};
|
|
86
86
|
});
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// This file is generated by a script. Do not edit this file directly.
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
if (typeof define === "function" && define.amd) {
|
|
4
|
-
define(["exports", "react", "./Base"], factory);
|
|
4
|
+
define(["exports", "react", "./Base", "../../common/utils"], factory);
|
|
5
5
|
} else if (typeof exports !== "undefined") {
|
|
6
|
-
factory(exports, require("react"), require("./Base"));
|
|
6
|
+
factory(exports, require("react"), require("./Base"), require("../../common/utils"));
|
|
7
7
|
} else {
|
|
8
8
|
var mod = {
|
|
9
9
|
exports: {}
|
|
10
10
|
};
|
|
11
|
-
factory(mod.exports, global.react, global.Base);
|
|
11
|
+
factory(mod.exports, global.react, global.Base, global.utils);
|
|
12
12
|
global.Heading = mod.exports;
|
|
13
13
|
}
|
|
14
|
-
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _Base) {
|
|
14
|
+
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _react, _Base, _utils) {
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
17
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -44,6 +44,20 @@
|
|
|
44
44
|
'3xl': '5',
|
|
45
45
|
'4xl': '6'
|
|
46
46
|
};
|
|
47
|
+
|
|
48
|
+
// Margin-bottom classes to restore vertical rhythm (Tailwind Preflight removes default margins)
|
|
49
|
+
var MARGIN_CLASSNAMES = {
|
|
50
|
+
'3xs': 'cop-mb-1',
|
|
51
|
+
'2xs': 'cop-mb-1',
|
|
52
|
+
xs: 'cop-mb-1',
|
|
53
|
+
sm: 'cop-mb-2',
|
|
54
|
+
base: 'cop-mb-2',
|
|
55
|
+
lg: 'cop-mb-3',
|
|
56
|
+
xl: 'cop-mb-3',
|
|
57
|
+
'2xl': 'cop-mb-4',
|
|
58
|
+
'3xl': 'cop-mb-4',
|
|
59
|
+
'4xl': 'cop-mb-5'
|
|
60
|
+
};
|
|
47
61
|
function Heading(_ref) {
|
|
48
62
|
var children = _ref.children,
|
|
49
63
|
_ref$className = _ref.className,
|
|
@@ -53,7 +67,7 @@
|
|
|
53
67
|
_ref$size = _ref.size,
|
|
54
68
|
size = _ref$size === void 0 ? 'base' : _ref$size;
|
|
55
69
|
return /*#__PURE__*/_react["default"].createElement(_Base.Base, {
|
|
56
|
-
className: className,
|
|
70
|
+
className: (0, _utils.cn)(MARGIN_CLASSNAMES[size], className),
|
|
57
71
|
size: SIZE_MAP[size],
|
|
58
72
|
variant: "body",
|
|
59
73
|
tag: tag,
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
className: "cop-flex cop-items-center cop-px-3 cop-pb-1 cop-pt-2"
|
|
42
42
|
}, /*#__PURE__*/_react["default"].createElement(_Typography.Heading, {
|
|
43
43
|
size: "xs",
|
|
44
|
-
className: "cop-text-secondary"
|
|
44
|
+
className: "cop-my-0 cop-text-secondary"
|
|
45
45
|
}, title)), children);
|
|
46
46
|
};
|
|
47
47
|
});
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
ref: innerRef
|
|
41
41
|
}, innerProps, {
|
|
42
42
|
className: (0, _clsx["default"])('cop-flex cop-cursor-pointer cop-items-center cop-gap-3 cop-px-3 hover:cop-bg-gray-100', {
|
|
43
|
-
'cop-h-10': !!
|
|
44
|
-
// if an option has company to render, the option should have a height of 40px
|
|
45
|
-
'cop-h-8': !
|
|
46
|
-
// if an option has no company to render, the option should have a height of 32px
|
|
43
|
+
'cop-h-10': !!companyName,
|
|
44
|
+
// if an option has company name to render, the option should have a height of 40px
|
|
45
|
+
'cop-h-8': !companyName,
|
|
46
|
+
// if an option has no company name to render, the option should have a height of 32px
|
|
47
47
|
'cop-bg-primary': isFocused
|
|
48
48
|
})
|
|
49
49
|
}), option.type !== 'company' ? /*#__PURE__*/_react["default"].createElement(_UserWithCompanyAvatar.UserWithCompanyAvatar, {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
65
65
|
className: "cop-flex cop-flex-col cop-text-[10px]"
|
|
66
66
|
}, /*#__PURE__*/_react["default"].createElement(_Typography.Body, {
|
|
67
|
-
className: "cop-truncate",
|
|
67
|
+
className: "cop-m-0 cop-truncate",
|
|
68
68
|
size: "sm"
|
|
69
69
|
}, option.label), companyName && /*#__PURE__*/_react["default"].createElement("span", {
|
|
70
70
|
className: "cop-text-secondary"
|
|
@@ -315,7 +315,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
315
315
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
316
316
|
className: "cop-flex cop-h-8 cop-items-center cop-gap-2 cop-px-3"
|
|
317
317
|
}, /*#__PURE__*/_react["default"].createElement(_Typography.Heading, {
|
|
318
|
-
className: "cop-text-secondary",
|
|
318
|
+
className: "cop-my-0 cop-text-secondary",
|
|
319
319
|
size: "xs"
|
|
320
320
|
}, props.data.label));
|
|
321
321
|
},
|
|
@@ -17,6 +17,9 @@ type TextProps = {
|
|
|
17
17
|
} & BaseProps;
|
|
18
18
|
type AvatarProps = TextProps | ImageProps;
|
|
19
19
|
declare const Avatar: React.ForwardRefExoticComponent<({
|
|
20
|
+
content?: string | undefined;
|
|
21
|
+
translate?: "yes" | "no" | undefined;
|
|
22
|
+
prefix?: string | undefined;
|
|
20
23
|
children?: React.ReactNode;
|
|
21
24
|
className?: string | undefined;
|
|
22
25
|
slot?: string | undefined;
|
|
@@ -42,14 +45,11 @@ declare const Avatar: React.ForwardRefExoticComponent<({
|
|
|
42
45
|
placeholder?: string | undefined;
|
|
43
46
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
44
47
|
tabIndex?: number | undefined;
|
|
45
|
-
translate?: "yes" | "no" | undefined;
|
|
46
48
|
radioGroup?: string | undefined;
|
|
47
49
|
role?: React.AriaRole | undefined;
|
|
48
50
|
about?: string | undefined;
|
|
49
|
-
content?: string | undefined;
|
|
50
51
|
datatype?: string | undefined;
|
|
51
52
|
inlist?: any;
|
|
52
|
-
prefix?: string | undefined;
|
|
53
53
|
property?: string | undefined;
|
|
54
54
|
rel?: string | undefined;
|
|
55
55
|
resource?: string | undefined;
|
|
@@ -296,6 +296,9 @@ declare const Avatar: React.ForwardRefExoticComponent<({
|
|
|
296
296
|
subAvatar?: Omit<AvatarProps, "size" | "subAvatar"> | undefined;
|
|
297
297
|
icon?: "Info" | "InfoSolid" | "Search" | "ResetZoom" | "FitToWidth" | "Ellipsis" | "MoreVertical" | "Download" | "Upload" | "Edit" | "Plus" | "Minus" | "Trash" | "ChevronRight" | "ChevronUp" | "ChevronDown" | "ChevronLeft" | "Copy" | "Duplicate" | "Automation" | "Play" | "Pause" | "Scale" | "Form" | "Message" | "Contract" | "Profile" | "Building" | "InvoicePaid" | "EditSolid" | "Archive" | "Unarchive" | "Settings" | "Link" | "Attachment" | "Close" | "Cancel" | "Smile" | "Share" | "Reply" | "Calendar" | "At" | "List" | "NumberedList" | "UnorderedList" | "Checklist" | "Tasks" | "Filter" | "Templates" | "Star" | "Email" | "EmailUnread" | "EmailRead" | "H1" | "H2" | "H3" | "Text" | "Bold" | "Italicize" | "Underline" | "Strikethrough" | "Menu" | "Inbox" | "Home" | "Notification" | "Billing" | "Dollar" | "Helpdesk" | "AppSetup" | "Gift" | "Location" | "Number" | "MobileNumber" | "Airtable" | "QuickBook" | "Bank" | "Puzzle" | "Code" | "ArrowUpSolid" | "ArrowDownSolid" | "ArrowLeft" | "ArrowRight" | "ArrowNE" | "Dash" | "Compose" | "MassFileShare" | "Warning" | "WarningSolid" | "Failed" | "FailedSolid" | "Check" | "Success" | "SuccessSolid" | "New" | "ToDo" | "InProgress" | "Book" | "Send" | "SendFilled" | "Dot" | "SquareSolid" | "Eye" | "EyeHidden" | "Invoice" | "Comment" | "Invite" | "Spinner" | "Repeat" | "Web" | "Time" | "GraphBarSolid" | "Sidebar" | "SidebarFilled" | "Export" | "File" | "MP4" | "SVG" | "MOV" | "MP3" | "CSV" | "Excel" | "PNG" | "PDF" | "JPG" | "Doc" | "ZIP" | "Movie" | "GIF" | "Store" | "ShoppingBag" | "DragDrop" | "Image" | "ImageMissing" | "LogOut" | "Lead" | "QuestionMark" | "API" | "PlansPayments" | "Customization" | "Teams" | "AI" | "BracketsCurly" | "Callout" | "Table" | "Chart" | "Tag" | "ThumbsUp" | "ThumbsDown" | "CaretDown" | "CaretUp" | "CaretRight" | "Disconnect" | "Mention" | "Insert" | "AssemblyLogo" | "Reposition" | "Marketing" | "Gauge" | "Subtask" | "Compass" | "UnPin" | "Pin" | "Files" | "FolderLocked" | "Unlock" | "Authentication" | "LockFilled" | undefined;
|
|
298
298
|
} | {
|
|
299
|
+
content?: string | undefined;
|
|
300
|
+
translate?: "yes" | "no" | undefined;
|
|
301
|
+
prefix?: string | undefined;
|
|
299
302
|
children?: React.ReactNode;
|
|
300
303
|
className?: string | undefined;
|
|
301
304
|
slot?: string | undefined;
|
|
@@ -321,14 +324,11 @@ declare const Avatar: React.ForwardRefExoticComponent<({
|
|
|
321
324
|
placeholder?: string | undefined;
|
|
322
325
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
323
326
|
tabIndex?: number | undefined;
|
|
324
|
-
translate?: "yes" | "no" | undefined;
|
|
325
327
|
radioGroup?: string | undefined;
|
|
326
328
|
role?: React.AriaRole | undefined;
|
|
327
329
|
about?: string | undefined;
|
|
328
|
-
content?: string | undefined;
|
|
329
330
|
datatype?: string | undefined;
|
|
330
331
|
inlist?: any;
|
|
331
|
-
prefix?: string | undefined;
|
|
332
332
|
property?: string | undefined;
|
|
333
333
|
rel?: string | undefined;
|
|
334
334
|
resource?: string | undefined;
|
|
@@ -7,8 +7,8 @@ declare const meta: {
|
|
|
7
7
|
className?: string | undefined;
|
|
8
8
|
leading: "tight" | "snug" | "normal" | "relaxed" | "loose" | "8" | "7" | "6" | "5" | "4" | "3" | "2" | "1" | "075" | "050" | "025";
|
|
9
9
|
size: "3xs" | "2xs" | "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl";
|
|
10
|
-
variant: "
|
|
11
|
-
tag: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "
|
|
10
|
+
variant: "display" | "body" | "heading";
|
|
11
|
+
tag: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span";
|
|
12
12
|
weight: "bold" | "semibold" | "medium" | "regular" | "light";
|
|
13
13
|
'data-typography'?: "heading" | undefined;
|
|
14
14
|
}) => import("react").JSX.Element;
|