@luscii-healthtech/web-ui 23.2.12 → 23.3.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/components/FlyOutMenu/FlyOutMenu.d.ts +40 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.development.js +112 -0
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/web-ui-tailwind.css +221 -4
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as FlyOutMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3
|
+
export declare function cn(...inputs: (string | boolean | undefined)[]): string;
|
|
4
|
+
type OmitDisabled<T> = Omit<T, "disabled">;
|
|
5
|
+
declare const FlyOutMenuRoot: (props: React.ComponentPropsWithoutRef<typeof FlyOutMenuPrimitive.Root>) => React.JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* The child of this component should accept a `ref` prop, otherwise
|
|
8
|
+
* the menu will not work correctly.
|
|
9
|
+
*/
|
|
10
|
+
declare const FlyOutMenuTrigger: React.ForwardRefExoticComponent<Omit<FlyOutMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
declare const FlyOutMenuGroup: React.ForwardRefExoticComponent<FlyOutMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const FlyOutMenuPortal: React.FC<FlyOutMenuPrimitive.DropdownMenuPortalProps>;
|
|
13
|
+
declare const FlyOutMenuContent: React.ForwardRefExoticComponent<Omit<FlyOutMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const FlyOutMenuItem: React.ForwardRefExoticComponent<OmitDisabled<Omit<FlyOutMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
}> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const FlyOutMenuLabel: React.ForwardRefExoticComponent<Omit<FlyOutMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const FlyOutMenuSeparator: React.ForwardRefExoticComponent<Omit<FlyOutMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
type ButtonItemProps = React.ComponentPropsWithoutRef<typeof FlyOutMenuItem> & {
|
|
20
|
+
icon?: React.ReactNode;
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
declare const FlyOutMenuButtonItem: (props: OmitDisabled<ButtonItemProps>) => React.JSX.Element;
|
|
24
|
+
type SwitchItemProps = React.ComponentPropsWithoutRef<typeof FlyOutMenuPrimitive.CheckboxItem> & {
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
children?: React.ReactNode;
|
|
27
|
+
};
|
|
28
|
+
declare const FlyOutMenuSwitchItem: React.ForwardRefExoticComponent<OmitDisabled<SwitchItemProps> & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export declare const FlyOutMenu: {
|
|
30
|
+
Root: typeof FlyOutMenuRoot;
|
|
31
|
+
Trigger: typeof FlyOutMenuTrigger;
|
|
32
|
+
Content: typeof FlyOutMenuContent;
|
|
33
|
+
Group: typeof FlyOutMenuGroup;
|
|
34
|
+
Label: typeof FlyOutMenuLabel;
|
|
35
|
+
Separator: typeof FlyOutMenuSeparator;
|
|
36
|
+
Portal: typeof FlyOutMenuPortal;
|
|
37
|
+
ButtonItem: typeof FlyOutMenuButtonItem;
|
|
38
|
+
SwitchItem: typeof FlyOutMenuSwitchItem;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export { default as Dropdown } from "./components/Dropdown/Dropdown";
|
|
|
33
33
|
export { EmptyListMessage } from "./components/EmptyListMessage/EmptyListMessage";
|
|
34
34
|
export { InfoField } from "./components/InfoField/InfoField";
|
|
35
35
|
export { default as Input } from "./components/Input/Input";
|
|
36
|
+
export { FlyOutMenu } from "./components/FlyOutMenu/FlyOutMenu";
|
|
36
37
|
export { StyledInput } from "./components/Input/StyledInput";
|
|
37
38
|
export { default as Line } from "./components/Line/Line";
|
|
38
39
|
export { Table, type TableProps } from "./components/Table/Table";
|
|
@@ -25,6 +25,8 @@ var fr = require('date-fns/locale/fr');
|
|
|
25
25
|
var pt = require('date-fns/locale/pt');
|
|
26
26
|
require('react-datepicker-v2/dist/react-datepicker.min.css');
|
|
27
27
|
var omit = require('lodash.omit');
|
|
28
|
+
var FlyOutMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
29
|
+
var tailwindMerge = require('tailwind-merge');
|
|
28
30
|
var ReactSelect = require('react-select');
|
|
29
31
|
var groupBy = require('lodash/groupBy');
|
|
30
32
|
var debounce = require('lodash.debounce');
|
|
@@ -66,6 +68,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
66
68
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
67
69
|
var ReactDatePicker__default$1 = /*#__PURE__*/_interopDefault(ReactDatePicker$1);
|
|
68
70
|
var omit__default = /*#__PURE__*/_interopDefault(omit);
|
|
71
|
+
var FlyOutMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(FlyOutMenuPrimitive);
|
|
69
72
|
var ReactSelect__default = /*#__PURE__*/_interopDefault(ReactSelect);
|
|
70
73
|
var groupBy__default = /*#__PURE__*/_interopDefault(groupBy);
|
|
71
74
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
@@ -3268,6 +3271,114 @@ const InfoField = (props) => {
|
|
|
3268
3271
|
);
|
|
3269
3272
|
};
|
|
3270
3273
|
|
|
3274
|
+
function cn(...inputs) {
|
|
3275
|
+
return tailwindMerge.twMerge(classNames__default.default(inputs));
|
|
3276
|
+
}
|
|
3277
|
+
const FlyOutMenuRoot = (props) => React__namespace.createElement(FlyOutMenuPrimitive__namespace.Root, Object.assign({}, props));
|
|
3278
|
+
const FlyOutMenuTrigger = React__namespace.forwardRef((props, ref) => React__namespace.createElement(FlyOutMenuPrimitive__namespace.Trigger, Object.assign({ ref, asChild: true }, props)));
|
|
3279
|
+
const FlyOutMenuGroup = FlyOutMenuPrimitive__namespace.Group;
|
|
3280
|
+
const FlyOutMenuPortal = FlyOutMenuPrimitive__namespace.Portal;
|
|
3281
|
+
const FlyOutMenuContent = React__namespace.forwardRef((_a, ref) => {
|
|
3282
|
+
var {
|
|
3283
|
+
className,
|
|
3284
|
+
/**
|
|
3285
|
+
* "8px" is size "xxs" from the design system
|
|
3286
|
+
*/
|
|
3287
|
+
sideOffset = 8,
|
|
3288
|
+
align = "end"
|
|
3289
|
+
} = _a, props = __rest(_a, ["className", "sideOffset", "align"]);
|
|
3290
|
+
return React__namespace.createElement(
|
|
3291
|
+
FlyOutMenuPrimitive__namespace.Portal,
|
|
3292
|
+
null,
|
|
3293
|
+
React__namespace.createElement(FlyOutMenuPrimitive__namespace.Content, Object.assign({ ref, align, sideOffset, className: cn("ui-z-50 ui-min-w-[8rem] ui-max-w-[30ch] ui-overflow-hidden ui-border-1 ui-border-color-border ui-bg-white ui-shadow-large ui-radius-m", "data-[state=open]:ui-animate-in data-[state=closed]:ui-animate-out data-[state=closed]:ui-fade-out-0 data-[state=open]:ui-fade-in-0 data-[state=closed]:ui-zoom-out-95 data-[state=open]:ui-zoom-in-95 data-[side=bottom]:ui-slide-in-from-top-2 data-[side=left]:ui-slide-in-from-right-2 data-[side=right]:ui-slide-in-from-left-2 data-[side=top]:ui-slide-in-from-bottom-2", className) }, props))
|
|
3294
|
+
);
|
|
3295
|
+
});
|
|
3296
|
+
FlyOutMenuContent.displayName = FlyOutMenuPrimitive__namespace.Content.displayName;
|
|
3297
|
+
const FlyOutMenuItem = React__namespace.forwardRef((_a, ref) => {
|
|
3298
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
3299
|
+
return React__namespace.createElement(
|
|
3300
|
+
FlyOutMenuPrimitive__namespace.Item,
|
|
3301
|
+
Object.assign({ ref, className: cn("ui-gap-m", "ui-relative ui-flex ui-select-none ui-items-center ui-rounded-sm ui-text-sm ui-outline-none ui-transition-colors", "focus:text-accent-foreground focus:ui-bg-primary-background", className) }, props),
|
|
3302
|
+
props.icon,
|
|
3303
|
+
props.children
|
|
3304
|
+
);
|
|
3305
|
+
});
|
|
3306
|
+
FlyOutMenuItem.displayName = FlyOutMenuPrimitive__namespace.Item.displayName;
|
|
3307
|
+
const FlyOutMenuLabel = React__namespace.forwardRef((_a, ref) => {
|
|
3308
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
3309
|
+
return React__namespace.createElement(
|
|
3310
|
+
FlyOutMenuPrimitive__namespace.Label,
|
|
3311
|
+
Object.assign({ ref, className: cn("ui-px-s ui-pb-xxs ui-pt-l", className) }, props),
|
|
3312
|
+
React__namespace.createElement(Text, { variant: "strong" }, props.children)
|
|
3313
|
+
);
|
|
3314
|
+
});
|
|
3315
|
+
FlyOutMenuLabel.displayName = FlyOutMenuPrimitive__namespace.Label.displayName;
|
|
3316
|
+
const FlyOutMenuSeparator = React__namespace.forwardRef((_a, ref) => {
|
|
3317
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
3318
|
+
return React__namespace.createElement(FlyOutMenuPrimitive__namespace.Separator, Object.assign({ ref, className: cn("ui-h-px ui-bg-color-divider", className) }, props));
|
|
3319
|
+
});
|
|
3320
|
+
FlyOutMenuSeparator.displayName = FlyOutMenuPrimitive__namespace.Separator.displayName;
|
|
3321
|
+
const ItemButton = (props) => {
|
|
3322
|
+
const { children, icon } = props, rest = __rest(props, ["children", "icon"]);
|
|
3323
|
+
return React__namespace.createElement(
|
|
3324
|
+
"button",
|
|
3325
|
+
Object.assign({}, rest, { className: "ui-flex ui-w-full ui-gap-s ui-p-s" }),
|
|
3326
|
+
React__namespace.isValidElement(icon) ? React__namespace.cloneElement(icon, { className: "ui-flex-shrink-0" }) : null,
|
|
3327
|
+
React__namespace.createElement(Text, { className: "ui-mt-[2px] ui-text-start" }, children)
|
|
3328
|
+
);
|
|
3329
|
+
};
|
|
3330
|
+
const FlyOutMenuButtonItem = (props) => {
|
|
3331
|
+
const { children, icon } = props, rest = __rest(props, ["children", "icon"]);
|
|
3332
|
+
return React__namespace.createElement(
|
|
3333
|
+
FlyOutMenuItem,
|
|
3334
|
+
Object.assign({}, rest),
|
|
3335
|
+
React__namespace.createElement(ItemButton, { icon }, children)
|
|
3336
|
+
);
|
|
3337
|
+
};
|
|
3338
|
+
const FlyOutMenuSwitchItem = React__namespace.forwardRef((props, forwardedRef) => {
|
|
3339
|
+
const { children, icon, onSelect } = props, rest = __rest(props, ["children", "icon", "onSelect"]);
|
|
3340
|
+
return React__namespace.createElement(
|
|
3341
|
+
FlyOutMenuPrimitive__namespace.CheckboxItem,
|
|
3342
|
+
Object.assign({ ref: forwardedRef, className: "ui-outline-none focus:ui-bg-primary-background", onSelect: (event) => {
|
|
3343
|
+
event.preventDefault();
|
|
3344
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(event);
|
|
3345
|
+
} }, rest),
|
|
3346
|
+
React__namespace.createElement(
|
|
3347
|
+
"div",
|
|
3348
|
+
{ className: "ui-flex ui-w-full" },
|
|
3349
|
+
React__namespace.createElement(
|
|
3350
|
+
"label",
|
|
3351
|
+
{ className: "ui-inline-flex ui-w-full ui-cursor-pointer ui-p-s" },
|
|
3352
|
+
React__namespace.isValidElement(icon) ? React__namespace.cloneElement(icon, { className: "ui-flex-shrink-0" }) : null,
|
|
3353
|
+
React__namespace.createElement(
|
|
3354
|
+
"div",
|
|
3355
|
+
{ className: "ui-inline-flex ui-w-full ui-flex-row-reverse ui-gap-m" },
|
|
3356
|
+
React__namespace.createElement(
|
|
3357
|
+
"div",
|
|
3358
|
+
{ className: "ui-peer ui-ml-auto" },
|
|
3359
|
+
React__namespace.createElement("div", { className: classNames__default.default("ui-relative ui-h-6 ui-w-11 ui-rounded-full ui-transition-colors", "after:ui-absolute after:ui-start-[2px] after:ui-top-[2px] after:ui-h-5 after:ui-w-5 after:ui-rounded-full after:ui-border after:ui-border-slate-300 after:ui-bg-white after:ui-transition-all after:ui-content-['']", {
|
|
3360
|
+
"ui-bg-primary-light after:ui-translate-x-full after:ui-border-white": props.checked === true,
|
|
3361
|
+
"ui-bg-slate-300": !props.checked
|
|
3362
|
+
}) })
|
|
3363
|
+
),
|
|
3364
|
+
React__namespace.createElement(Text, { className: "ui-ml-3 ui-mt-[2px] ui-text-start" }, children)
|
|
3365
|
+
)
|
|
3366
|
+
)
|
|
3367
|
+
)
|
|
3368
|
+
);
|
|
3369
|
+
});
|
|
3370
|
+
const FlyOutMenu = {
|
|
3371
|
+
Root: FlyOutMenuRoot,
|
|
3372
|
+
Trigger: FlyOutMenuTrigger,
|
|
3373
|
+
Content: FlyOutMenuContent,
|
|
3374
|
+
Group: FlyOutMenuGroup,
|
|
3375
|
+
Label: FlyOutMenuLabel,
|
|
3376
|
+
Separator: FlyOutMenuSeparator,
|
|
3377
|
+
Portal: FlyOutMenuPortal,
|
|
3378
|
+
ButtonItem: FlyOutMenuButtonItem,
|
|
3379
|
+
SwitchItem: FlyOutMenuSwitchItem
|
|
3380
|
+
};
|
|
3381
|
+
|
|
3271
3382
|
const Line = ({ left, right, className }) => /* @__PURE__ */ React__namespace.default.createElement(
|
|
3272
3383
|
"div",
|
|
3273
3384
|
{
|
|
@@ -5973,6 +6084,7 @@ exports.FirstAidKitIcon = FirstAidKitIcon;
|
|
|
5973
6084
|
exports.FlagIcon = FlagIcon;
|
|
5974
6085
|
exports.FlexColumn = FlexColumn;
|
|
5975
6086
|
exports.FlexRow = FlexRow;
|
|
6087
|
+
exports.FlyOutMenu = FlyOutMenu;
|
|
5976
6088
|
exports.ForwardIcon = ForwardIcon;
|
|
5977
6089
|
exports.FullPageModal = FullPageModal;
|
|
5978
6090
|
exports.GearColoredIcon = GearColoredIcon;
|