@luscii-healthtech/web-ui 42.11.4 → 42.12.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/index.development.js +37 -10
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/components/DetailsDisclosure/DetailsDisclosure.d.ts +6 -0
- package/dist/stories/DetailsDisclosure.stories.d.ts +33 -0
- package/dist/web-ui-tailwind.css +93 -0
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -5199,7 +5199,8 @@ const Padding = (props) => {
|
|
|
5199
5199
|
};
|
|
5200
5200
|
const Item$1 = (props) => {
|
|
5201
5201
|
const { _DO_NOT_USE_index } = props, rest = __rest(props, ["_DO_NOT_USE_index"]);
|
|
5202
|
-
|
|
5202
|
+
const liClasses = classNames__default.default("ui:first:rounded-t-[inherit] ui:last:rounded-b-[inherit]", props.className);
|
|
5203
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [_DO_NOT_USE_index === 0 ? null : jsxRuntime.jsx("div", { "data-index": _DO_NOT_USE_index, className: classNames__default.default("ui:absolute ui:left-0 ui:right-0", "ui:border-t ui:border-slate-200") }), jsxRuntime.jsx("li", Object.assign({ className: liClasses }, rest, { children: React__namespace.default.Children.map(props.children, (child) => {
|
|
5203
5204
|
if (!React__namespace.default.isValidElement(child)) {
|
|
5204
5205
|
return child;
|
|
5205
5206
|
}
|
|
@@ -5222,9 +5223,19 @@ const Item$1 = (props) => {
|
|
|
5222
5223
|
};
|
|
5223
5224
|
const UnorderedList = (props) => {
|
|
5224
5225
|
const { _DO_NOT_USE_isRoot = true } = props, rest = __rest(props, ["_DO_NOT_USE_isRoot"]);
|
|
5225
|
-
return jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [_DO_NOT_USE_isRoot ? null : jsxRuntime.jsx("div", { className: classNames__default.default("ui:absolute ui:left-0 ui:right-0", "ui:border-t ui:border-slate-200") }), jsxRuntime.jsx("ul", Object.assign({}, rest, { className: classNames__default.default(
|
|
5226
|
-
|
|
5227
|
-
|
|
5226
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [_DO_NOT_USE_isRoot ? null : jsxRuntime.jsx("div", { className: classNames__default.default("ui:absolute ui:left-0 ui:right-0", "ui:border-t ui:border-slate-200") }), jsxRuntime.jsx("ul", Object.assign({}, rest, { className: classNames__default.default(
|
|
5227
|
+
{
|
|
5228
|
+
"ui:relative": _DO_NOT_USE_isRoot
|
|
5229
|
+
},
|
|
5230
|
+
/**
|
|
5231
|
+
* Inheriting border radius from the parent element.
|
|
5232
|
+
*
|
|
5233
|
+
* This makes the parent component (e.g. a Card component) determine the rounding
|
|
5234
|
+
* of the list and its items.
|
|
5235
|
+
*/
|
|
5236
|
+
"ui:rounded-[inherit]",
|
|
5237
|
+
props.className
|
|
5238
|
+
), children: React__namespace.default.Children.map(props.children, (child, index) => {
|
|
5228
5239
|
if (!React__namespace.default.isValidElement(child)) {
|
|
5229
5240
|
return child !== null && child !== void 0 ? child : null;
|
|
5230
5241
|
}
|
|
@@ -5264,18 +5275,34 @@ FullPageModal.setAppElement = ReactModal__default.default.setAppElement;
|
|
|
5264
5275
|
|
|
5265
5276
|
const context$2 = React.createContext({ isOpen: false });
|
|
5266
5277
|
const DetailsDisclosure = (_a) => {
|
|
5267
|
-
var { children, onToggleDetails, name, onToggle, openByDefault, open } = _a, rest = __rest(_a, ["children", "onToggleDetails", "name", "onToggle", "openByDefault", "open"]);
|
|
5278
|
+
var { children, onToggleDetails, name, onToggle, openByDefault, open, className, omitBorder = false } = _a, rest = __rest(_a, ["children", "onToggleDetails", "name", "onToggle", "openByDefault", "open", "className", "omitBorder"]);
|
|
5268
5279
|
const [internalIsOpen, setInternalIsOpen] = React.useState(openByDefault !== null && openByDefault !== void 0 ? openByDefault : false);
|
|
5269
5280
|
const isOpen = open !== null && open !== void 0 ? open : internalIsOpen;
|
|
5281
|
+
const classes = classNames__default.default(
|
|
5282
|
+
{
|
|
5283
|
+
"ui:border-0": omitBorder,
|
|
5284
|
+
"ui:border": !omitBorder
|
|
5285
|
+
},
|
|
5286
|
+
"ui:rounded-[inherit]",
|
|
5287
|
+
/**
|
|
5288
|
+
* TODO: revisit these colors after they've been standardized in the design system.
|
|
5289
|
+
*/
|
|
5290
|
+
"ui:[&:has(summary:hover)]:border-blue-500",
|
|
5291
|
+
"ui:[&:has(summary:focus)]:border-blue-500",
|
|
5292
|
+
"ui:border-slate-300 ui:transition-colors",
|
|
5293
|
+
"ui:details-content:opacity-0 ui:details-content:h-0 ui:details-content:transition-discrete ui:details-content:duration-300 ui:motion-reduce:details-content:duration-[0ms] ui:details-content:overflow-clip",
|
|
5294
|
+
"ui:open:details-content:opacity-100 ui:open:details-content:h-auto",
|
|
5295
|
+
className
|
|
5296
|
+
);
|
|
5270
5297
|
return jsxRuntime.jsx(context$2.Provider, { value: { isOpen }, children: jsxRuntime.jsx(Box, Object.assign({ as: "details", name, onToggle: (e) => {
|
|
5271
5298
|
const wasOpened = e.currentTarget.hasAttribute("open");
|
|
5272
5299
|
onToggleDetails === null || onToggleDetails === void 0 ? void 0 : onToggleDetails(wasOpened);
|
|
5273
5300
|
setInternalIsOpen(wasOpened);
|
|
5274
5301
|
onToggle === null || onToggle === void 0 ? void 0 : onToggle(e);
|
|
5275
|
-
}, open: isOpen }, rest, { children })) });
|
|
5302
|
+
}, open: isOpen, className: classes }, rest, { children })) });
|
|
5276
5303
|
};
|
|
5277
5304
|
const DefaultOpenIndicator = ({ isOpen }) => {
|
|
5278
|
-
return jsxRuntime.jsx(ChevronRightIcon, { className: classNames__default.default("ui:shrink-0 ui:transition-transform", {
|
|
5305
|
+
return jsxRuntime.jsx(ChevronRightIcon, { className: classNames__default.default("ui:shrink-0 ui:transition-transform ui:ml-s", {
|
|
5279
5306
|
"ui:rotate-90": isOpen
|
|
5280
5307
|
}) });
|
|
5281
5308
|
};
|
|
@@ -5284,9 +5311,9 @@ const OpenIndicator = ({ component: Component = DefaultOpenIndicator }) => {
|
|
|
5284
5311
|
return jsxRuntime.jsx(Component, { isOpen });
|
|
5285
5312
|
};
|
|
5286
5313
|
const Summary = (_a) => {
|
|
5287
|
-
var { children, omitOpenIndicator = false } = _a, rest = __rest(_a, ["children", "omitOpenIndicator"]);
|
|
5314
|
+
var { children, omitOpenIndicator = false, className } = _a, rest = __rest(_a, ["children", "omitOpenIndicator", "className"]);
|
|
5288
5315
|
const { isOpen } = React.useContext(context$2);
|
|
5289
|
-
return jsxRuntime.jsx(Stack, Object.assign({ as: "summary",
|
|
5316
|
+
return jsxRuntime.jsx(Stack, Object.assign({ as: "summary", cursor: "pointer", className: classNames__default.default("ui:rounded-[inherit]", className) }, rest, { children: jsxRuntime.jsx(Stack, { axis: "x", justify: "between", align: "center", width: "full", children: jsxRuntime.jsxs(Stack, { axis: "x", width: "full", align: "center", gap: "xxs", children: [!omitOpenIndicator && jsxRuntime.jsx(DefaultOpenIndicator, { isOpen }), jsxRuntime.jsx(Box, { width: "full", children })] }) }) }));
|
|
5290
5317
|
};
|
|
5291
5318
|
DetailsDisclosure.Summary = Summary;
|
|
5292
5319
|
Summary.OpenIndicator = OpenIndicator;
|
|
@@ -5466,7 +5493,7 @@ function MenuItemGroupOpenIndicator({ isOpen }) {
|
|
|
5466
5493
|
}
|
|
5467
5494
|
function MenuItemGroup(_a) {
|
|
5468
5495
|
var { title, children, className } = _a, rest = __rest(_a, ["title", "children", "className"]);
|
|
5469
|
-
return jsxRuntime.jsxs(DetailsDisclosure, Object.assign({ className: classNames__default.default("ui:w-full", className) }, rest, { children: [jsxRuntime.jsx(DetailsDisclosure.Summary, { hoverBackgroundColor: void 0, pl: void 0, omitOpenIndicator: true, children: jsxRuntime.jsx(MenuItemLayout, { children: jsxRuntime.jsx(MenuItemPadding, { children: jsxRuntime.jsxs(Stack, { axis: "x", align: "center", justify: "between", children: [jsxRuntime.jsx(MenuItemText, { children: title }), jsxRuntime.jsx(DetailsDisclosure.Summary.OpenIndicator, { component: MenuItemGroupOpenIndicator })] }) }) }) }), jsxRuntime.jsx(MenuItemPadding, { paddingX: true, paddingY: false, children })] }));
|
|
5496
|
+
return jsxRuntime.jsxs(DetailsDisclosure, Object.assign({ omitBorder: true, className: classNames__default.default("ui:w-full", className) }, rest, { children: [jsxRuntime.jsx(DetailsDisclosure.Summary, { hoverBackgroundColor: void 0, pl: void 0, omitOpenIndicator: true, children: jsxRuntime.jsx(MenuItemLayout, { children: jsxRuntime.jsx(MenuItemPadding, { children: jsxRuntime.jsxs(Stack, { axis: "x", align: "center", justify: "between", children: [jsxRuntime.jsx(MenuItemText, { children: title }), jsxRuntime.jsx(DetailsDisclosure.Summary.OpenIndicator, { component: MenuItemGroupOpenIndicator })] }) }) }) }), jsxRuntime.jsx(MenuItemPadding, { paddingX: true, paddingY: false, children })] }));
|
|
5470
5497
|
}
|
|
5471
5498
|
function SectionTitle(props) {
|
|
5472
5499
|
return jsxRuntime.jsx(MenuItemPadding, { children: jsxRuntime.jsx(Text, { variant: "strong", children: props.children }) });
|