@aivenio/aquarium 4.1.1 → 4.2.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/atoms.cjs +1 -1
- package/dist/atoms.mjs +1 -1
- package/dist/src/atoms/DateField/DateField.d.ts +13 -0
- package/dist/src/atoms/DateField/DateField.js +43 -0
- package/dist/src/{molecules → atoms}/DatePicker/Calendar.js +4 -4
- package/dist/src/atoms/DatePicker/DatePicker.d.ts +55 -0
- package/dist/src/atoms/DatePicker/DatePicker.js +39 -0
- package/dist/src/atoms/DatePicker/DatePickerButton.d.ts +7 -0
- package/dist/src/atoms/DatePicker/DatePickerButton.js +39 -0
- package/dist/src/{molecules → atoms}/DatePicker/RangeCalendar.js +2 -2
- package/dist/src/atoms/Field/Field.js +7 -0
- package/dist/src/atoms/PageHeader/PageHeader.js +2 -2
- package/dist/src/molecules/Breadcrumbs/Breadcrumbs.js +2 -2
- package/dist/src/molecules/DateField/DateField.d.ts +3 -6
- package/dist/src/molecules/DateField/DateField.js +3 -8
- package/dist/src/molecules/DatePicker/DatePicker.d.ts +59 -4
- package/dist/src/molecules/DatePicker/DatePicker.js +72 -48
- package/dist/src/molecules/DatePicker/DateRangePicker.d.ts +59 -4
- package/dist/src/molecules/DatePicker/DateRangePicker.js +76 -49
- package/dist/src/molecules/DropdownMenu/DropdownMenu.js +17 -11
- package/dist/src/molecules/DropdownMenu/SearchField.js +2 -2
- package/dist/src/molecules/Filter/Filter.d.ts +2 -0
- package/dist/src/molecules/Filter/Filter.js +3 -0
- package/dist/src/molecules/Link/Link.js +3 -3
- package/dist/src/molecules/TimeField/TimeField.d.ts +5 -8
- package/dist/src/molecules/TimeField/TimeField.js +3 -8
- package/dist/src/molecules/index.d.ts +1 -0
- package/dist/src/molecules/index.js +2 -1
- package/dist/system.cjs +588 -431
- package/dist/system.mjs +597 -437
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/molecules/DateField/DateInput.d.ts +0 -3
- package/dist/src/molecules/DateField/DateInput.js +0 -22
- package/dist/src/molecules/DatePicker/Button.d.ts +0 -5
- package/dist/src/molecules/DatePicker/Button.js +0 -35
- package/dist/src/molecules/DatePicker/Dialog.d.ts +0 -3
- package/dist/src/molecules/DatePicker/Dialog.js +0 -7
- package/dist/src/molecules/DatePicker/Popover.d.ts +0 -7
- package/dist/src/molecules/DatePicker/Popover.js +0 -27
- package/dist/src/molecules/Field/Field.js +0 -7
- /package/dist/src/{molecules → atoms}/DatePicker/Calendar.d.ts +0 -0
- /package/dist/src/{molecules → atoms}/DatePicker/RangeCalendar.d.ts +0 -0
- /package/dist/src/{molecules → atoms}/Field/Field.d.ts +0 -0
package/dist/system.mjs
CHANGED
@@ -4311,16 +4311,16 @@ __export(molecules_exports, {
|
|
4311
4311
|
ControlLabel: () => ControlLabel,
|
4312
4312
|
DataList: () => DataList2,
|
4313
4313
|
DataTable: () => DataTable,
|
4314
|
-
DatePicker: () =>
|
4314
|
+
DatePicker: () => DatePicker2,
|
4315
4315
|
DatePickerBase: () => DatePickerBase,
|
4316
|
-
DateRangePicker: () =>
|
4316
|
+
DateRangePicker: () => DateRangePicker2,
|
4317
4317
|
DateRangePickerBase: () => DateRangePickerBase,
|
4318
4318
|
DateTimePicker: () => DateTimePicker,
|
4319
4319
|
DateTimePickerBase: () => DateTimePickerBase,
|
4320
4320
|
DateTimeRangePicker: () => DateTimeRangePicker,
|
4321
4321
|
DateTimeRangePickerBase: () => DateTimeRangePickerBase,
|
4322
4322
|
DesignSystemContext: () => DesignSystemContext,
|
4323
|
-
Dialog: () =>
|
4323
|
+
Dialog: () => Dialog2,
|
4324
4324
|
Divider: () => Divider2,
|
4325
4325
|
Drawer: () => Drawer,
|
4326
4326
|
Dropdown: () => Dropdown,
|
@@ -4329,6 +4329,7 @@ __export(molecules_exports, {
|
|
4329
4329
|
EmptyState: () => EmptyState,
|
4330
4330
|
EmptyStateLayout: () => EmptyStateLayout,
|
4331
4331
|
FileInput: () => FileInput,
|
4332
|
+
Filter: () => Filter,
|
4332
4333
|
Grid: () => Grid,
|
4333
4334
|
Icon: () => Icon,
|
4334
4335
|
InlineIcon: () => InlineIcon,
|
@@ -4353,7 +4354,7 @@ __export(molecules_exports, {
|
|
4353
4354
|
Option: () => Option,
|
4354
4355
|
PageHeader: () => PageHeader2,
|
4355
4356
|
Pagination: () => Pagination,
|
4356
|
-
Popover: () =>
|
4357
|
+
Popover: () => Popover2,
|
4357
4358
|
PopoverDialog: () => PopoverDialog2,
|
4358
4359
|
Portal: () => Portal,
|
4359
4360
|
ProgressBar: () => ProgressBar2,
|
@@ -7795,9 +7796,20 @@ var LinkButton2 = ({
|
|
7795
7796
|
className,
|
7796
7797
|
tooltip,
|
7797
7798
|
tooltipPlacement,
|
7799
|
+
"aria-label": ariaLabel,
|
7798
7800
|
...props
|
7799
7801
|
}) => {
|
7800
|
-
const content = /* @__PURE__ */ React21.createElement(
|
7802
|
+
const content = /* @__PURE__ */ React21.createElement(
|
7803
|
+
LinkButton,
|
7804
|
+
{
|
7805
|
+
className: classNames5("Aquarium-Link", className),
|
7806
|
+
"aria-label": props.kind === "icon" ? ariaLabel ?? tooltip : ariaLabel,
|
7807
|
+
...props
|
7808
|
+
},
|
7809
|
+
icon && iconPlacement === "left" && /* @__PURE__ */ React21.createElement(Icon2, { icon, dense: props.dense }),
|
7810
|
+
children,
|
7811
|
+
icon && iconPlacement === "right" && /* @__PURE__ */ React21.createElement(Icon2, { icon, dense: props.dense })
|
7812
|
+
);
|
7801
7813
|
return tooltip ? /* @__PURE__ */ React21.createElement(Tooltip, { content: tooltip, placement: tooltipPlacement }, content) : content;
|
7802
7814
|
};
|
7803
7815
|
var LinkButtonPrimary = (props) => /* @__PURE__ */ React21.createElement(LinkButton2, { kind: "primary", ...props });
|
@@ -8255,7 +8267,7 @@ var Breadcrumbs = (props) => {
|
|
8255
8267
|
const crumbs = React29.Children.toArray(children).filter(
|
8256
8268
|
(c) => Boolean(c)
|
8257
8269
|
);
|
8258
|
-
return /* @__PURE__ */ React29.createElement("nav", { className: classNames6("Aquarium-Breadcrumbs", className), "aria-label": "Breadcrumbs" }, /* @__PURE__ */ React29.createElement("ol", { className: tw("flex flex-row flex-
|
8270
|
+
return /* @__PURE__ */ React29.createElement("nav", { className: classNames6("Aquarium-Breadcrumbs", className), "aria-label": "Breadcrumbs" }, /* @__PURE__ */ React29.createElement("ol", { className: tw("flex flex-row flex-wrap items-center typography-caption") }, crumbs.map((crumb, index) => {
|
8259
8271
|
const isLast = index === crumbs.length - 1;
|
8260
8272
|
return (
|
8261
8273
|
// Using index as key here is not good, but there isn't too many other options to choose from either.
|
@@ -11091,7 +11103,7 @@ import {
|
|
11091
11103
|
SearchField as AriaSearchField
|
11092
11104
|
} from "react-aria-components";
|
11093
11105
|
|
11094
|
-
// src/
|
11106
|
+
// src/atoms/Field/Field.tsx
|
11095
11107
|
import React69 from "react";
|
11096
11108
|
import { Group as Group3 } from "react-aria-components";
|
11097
11109
|
|
@@ -11128,7 +11140,7 @@ var fieldGroup = tv7({
|
|
11128
11140
|
variants: fieldBorder.variants
|
11129
11141
|
});
|
11130
11142
|
|
11131
|
-
// src/
|
11143
|
+
// src/atoms/Field/Field.tsx
|
11132
11144
|
var FieldGroup = (props) => {
|
11133
11145
|
return /* @__PURE__ */ React69.createElement(Group3, { ...props, className: (renderProps) => fieldGroup(renderProps) });
|
11134
11146
|
};
|
@@ -11153,7 +11165,7 @@ DropdownMenu2.Trigger.displayName = "DropdownMenu.Trigger";
|
|
11153
11165
|
var MenuItems = ({ children }) => {
|
11154
11166
|
const props = useContext6(MenuPropsContext);
|
11155
11167
|
const { contains } = useFilter({ sensitivity: "base" });
|
11156
|
-
const childrenWithIds =
|
11168
|
+
const childrenWithIds = mapKeyToId(children);
|
11157
11169
|
const baseContent = /* @__PURE__ */ React71.createElement(
|
11158
11170
|
DropdownMenu,
|
11159
11171
|
{
|
@@ -11187,19 +11199,24 @@ var MenuItem = (props) => {
|
|
11187
11199
|
DropdownMenu2.Item = MenuItem;
|
11188
11200
|
DropdownMenu2.Item.displayName = "DropdownMenu.Item";
|
11189
11201
|
var MenuSection = ({ children, ...props }) => {
|
11190
|
-
const childrenWithIds =
|
11202
|
+
const childrenWithIds = mapKeyToId(children);
|
11191
11203
|
return /* @__PURE__ */ React71.createElement(DropdownMenu.Group, { ...props }, childrenWithIds);
|
11192
11204
|
};
|
11193
11205
|
DropdownMenu2.Section = MenuSection;
|
11194
11206
|
DropdownMenu2.Section.displayName = "DropdownMenu.Section";
|
11195
|
-
var mapKeyToId = (
|
11196
|
-
|
11207
|
+
var mapKeyToId = (children) => {
|
11208
|
+
return React71.Children.map(children, (child) => {
|
11209
|
+
if (typeof child === "boolean" || child === null || child === void 0) {
|
11210
|
+
return child;
|
11211
|
+
}
|
11212
|
+
if (React71.isValidElement(child) && child.type === React71.Fragment) {
|
11213
|
+
return mapKeyToId(child.props.children);
|
11214
|
+
}
|
11215
|
+
if (isComponentType(child, MenuItem)) {
|
11216
|
+
return React71.cloneElement(child, { id: child.props.id ?? child.key ?? void 0 });
|
11217
|
+
}
|
11197
11218
|
return child;
|
11198
|
-
}
|
11199
|
-
if (isComponentType(child, MenuItem)) {
|
11200
|
-
return React71.cloneElement(child, { id: child.props.id ?? child.key ?? void 0 });
|
11201
|
-
}
|
11202
|
-
return child;
|
11219
|
+
});
|
11203
11220
|
};
|
11204
11221
|
|
11205
11222
|
// src/utils/object.ts
|
@@ -12115,17 +12132,27 @@ DataTable.Skeleton = DataListSkeleton;
|
|
12115
12132
|
// src/molecules/DatePicker/DatePicker.tsx
|
12116
12133
|
import React86 from "react";
|
12117
12134
|
import {
|
12118
|
-
DatePicker as AriaDatePicker,
|
12119
12135
|
DatePickerStateContext,
|
12120
12136
|
Text
|
12121
12137
|
} from "react-aria-components";
|
12122
12138
|
import { useLabel as useLabel2 } from "@react-aria/label";
|
12123
|
-
import { useId as useId10 } from "@react-aria/utils";
|
12139
|
+
import { mergeProps as mergeProps3, useId as useId10 } from "@react-aria/utils";
|
12124
12140
|
import { omit as omit8 } from "lodash-es";
|
12125
12141
|
|
12126
|
-
// src/molecules/
|
12142
|
+
// src/molecules/TimeField/TimeField.tsx
|
12143
|
+
import React81 from "react";
|
12144
|
+
import { useLabel } from "@react-aria/label";
|
12145
|
+
import { useId as useId9 } from "@react-aria/utils";
|
12146
|
+
import { omit as omit7 } from "lodash-es";
|
12147
|
+
|
12148
|
+
// src/atoms/DateField/DateField.tsx
|
12127
12149
|
import React80 from "react";
|
12128
|
-
import {
|
12150
|
+
import {
|
12151
|
+
DateField as AriaDateField,
|
12152
|
+
DateInput as AriaDateInput,
|
12153
|
+
DateSegment as AriaDateSegment,
|
12154
|
+
TimeField as AriaTimeField
|
12155
|
+
} from "react-aria-components";
|
12129
12156
|
import { tv as tv8 } from "tailwind-variants";
|
12130
12157
|
var segmentStyles = tv8({
|
12131
12158
|
base: "inline p-0.5 rounded outline outline-0 caret-transparent text-default",
|
@@ -12141,87 +12168,82 @@ var segmentStyles = tv8({
|
|
12141
12168
|
}
|
12142
12169
|
}
|
12143
12170
|
});
|
12144
|
-
|
12145
|
-
return /* @__PURE__ */ React80.createElement(AriaDateInput, { className: (renderProps) => fieldGroup({ ...renderProps, class: "block" }), ...props }, (segment) => /* @__PURE__ */ React80.createElement(
|
12146
|
-
}
|
12171
|
+
var DateInput = (props) => {
|
12172
|
+
return /* @__PURE__ */ React80.createElement(AriaDateInput, { className: (renderProps) => fieldGroup({ ...renderProps, class: "block" }), ...props }, (segment) => /* @__PURE__ */ React80.createElement(AriaDateSegment, { segment, className: segmentStyles }));
|
12173
|
+
};
|
12174
|
+
var TimeField = ({ disabled, valid, ...props }) => {
|
12175
|
+
return /* @__PURE__ */ React80.createElement(AriaTimeField, { ...props, isInvalid: valid === false, isDisabled: disabled }, /* @__PURE__ */ React80.createElement(DateInput, null));
|
12176
|
+
};
|
12147
12177
|
|
12148
12178
|
// src/molecules/TimeField/TimeField.tsx
|
12149
|
-
|
12150
|
-
import {
|
12151
|
-
TimeField as AriaTimeField
|
12152
|
-
} from "react-aria-components";
|
12153
|
-
import { useLabel } from "@react-aria/label";
|
12154
|
-
import { useId as useId9 } from "@react-aria/utils";
|
12155
|
-
import { omit as omit7 } from "lodash-es";
|
12156
|
-
function TimeFieldBase({ disabled, valid, ...props }) {
|
12157
|
-
return /* @__PURE__ */ React81.createElement(AriaTimeField, { ...props, isInvalid: valid === false, isDisabled: disabled }, /* @__PURE__ */ React81.createElement(DateInput, null));
|
12158
|
-
}
|
12159
|
-
function TimeField(props) {
|
12179
|
+
function TimeField2(props) {
|
12160
12180
|
const { labelProps, fieldProps } = useLabel({ label: props.labelText });
|
12161
12181
|
const errorMessageId = useId9();
|
12162
12182
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12163
12183
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12164
12184
|
const baseProps = omit7(props, Object.keys(labelControlProps));
|
12165
|
-
return /* @__PURE__ */ React81.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-TimeField" }, /* @__PURE__ */ React81.createElement(
|
12185
|
+
return /* @__PURE__ */ React81.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-TimeField" }, /* @__PURE__ */ React81.createElement(TimeField, { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid }));
|
12166
12186
|
}
|
12167
12187
|
|
12168
|
-
// src/
|
12188
|
+
// src/atoms/DatePicker/Calendar.tsx
|
12189
|
+
import React83 from "react";
|
12190
|
+
import {
|
12191
|
+
Calendar as AriaCalendar,
|
12192
|
+
CalendarCell,
|
12193
|
+
CalendarGrid,
|
12194
|
+
CalendarGridBody,
|
12195
|
+
CalendarGridHeader as AriaCalendarGridHeader,
|
12196
|
+
CalendarHeaderCell,
|
12197
|
+
Heading
|
12198
|
+
} from "react-aria-components";
|
12199
|
+
import { tv as tv10 } from "tailwind-variants";
|
12200
|
+
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
12201
|
+
var import_chevronRight4 = __toESM(require_chevronRight());
|
12202
|
+
|
12203
|
+
// src/atoms/DatePicker/DatePickerButton.tsx
|
12169
12204
|
import React82 from "react";
|
12170
12205
|
import { Button as AriaButton2, composeRenderProps as composeRenderProps3 } from "react-aria-components";
|
12206
|
+
import { tv as tv9 } from "tailwind-variants";
|
12171
12207
|
var import_calendar2 = __toESM(require_calendar());
|
12172
12208
|
var import_smallCross3 = __toESM(require_smallCross());
|
12173
|
-
|
12174
|
-
|
12175
|
-
|
12176
|
-
{
|
12177
|
-
|
12178
|
-
|
12179
|
-
props.className,
|
12180
|
-
(className, renderProps) => buttonClasses({ ...renderProps, className, dense: true, kind: "icon" })
|
12181
|
-
)
|
12209
|
+
var datePickerButton = tv9({
|
12210
|
+
base: "p-0",
|
12211
|
+
variants: {
|
12212
|
+
hideWhenParentIsNotHoveredOrFocused: {
|
12213
|
+
true: "opacity-0 group-hover:opacity-100 group-focus-within:opacity-100",
|
12214
|
+
false: ""
|
12182
12215
|
}
|
12183
|
-
|
12184
|
-
}
|
12185
|
-
var
|
12186
|
-
|
12187
|
-
hideWhenParentIsNotHoveredOrFocused = true,
|
12216
|
+
}
|
12217
|
+
});
|
12218
|
+
var DatePickerButton = ({
|
12219
|
+
hideWhenParentIsNotHoveredOrFocused = false,
|
12188
12220
|
...props
|
12189
12221
|
}) => {
|
12190
12222
|
return /* @__PURE__ */ React82.createElement(
|
12191
|
-
|
12223
|
+
AriaButton2,
|
12192
12224
|
{
|
12193
12225
|
...props,
|
12194
|
-
className:
|
12195
|
-
className,
|
12196
|
-
|
12197
|
-
|
12226
|
+
className: composeRenderProps3(
|
12227
|
+
props.className,
|
12228
|
+
(className, renderProps) => buttonClasses({
|
12229
|
+
...renderProps,
|
12230
|
+
className: datePickerButton({ hideWhenParentIsNotHoveredOrFocused, className }),
|
12231
|
+
dense: true,
|
12232
|
+
kind: "icon"
|
12198
12233
|
})
|
12199
12234
|
)
|
12200
12235
|
}
|
12201
12236
|
);
|
12202
12237
|
};
|
12203
|
-
|
12204
|
-
return /* @__PURE__ */ React82.createElement(
|
12205
|
-
}
|
12206
|
-
|
12207
|
-
return /* @__PURE__ */ React82.createElement(
|
12208
|
-
}
|
12238
|
+
var ClearInputButton = (props) => {
|
12239
|
+
return /* @__PURE__ */ React82.createElement(DatePickerButton, { ...props, "aria-label": "Clear", slot: null, hideWhenParentIsNotHoveredOrFocused: true }, /* @__PURE__ */ React82.createElement(Icon2, { icon: import_smallCross3.default, dense: true }));
|
12240
|
+
};
|
12241
|
+
var CalendarButton = (props) => {
|
12242
|
+
return /* @__PURE__ */ React82.createElement(DatePickerButton, { ...props, "aria-label": "Calendar" }, /* @__PURE__ */ React82.createElement(Icon2, { icon: import_calendar2.default, dense: true }));
|
12243
|
+
};
|
12209
12244
|
|
12210
|
-
// src/
|
12211
|
-
|
12212
|
-
import {
|
12213
|
-
Calendar as AriaCalendar,
|
12214
|
-
CalendarCell,
|
12215
|
-
CalendarGrid,
|
12216
|
-
CalendarGridBody,
|
12217
|
-
CalendarGridHeader as AriaCalendarGridHeader,
|
12218
|
-
CalendarHeaderCell,
|
12219
|
-
Heading
|
12220
|
-
} from "react-aria-components";
|
12221
|
-
import { tv as tv9 } from "tailwind-variants";
|
12222
|
-
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
12223
|
-
var import_chevronRight4 = __toESM(require_chevronRight());
|
12224
|
-
var cellStyles = tv9({
|
12245
|
+
// src/atoms/DatePicker/Calendar.tsx
|
12246
|
+
var cellStyles = tv10({
|
12225
12247
|
extend: focusRing,
|
12226
12248
|
base: "w-8 h-8 typography-small cursor-default rounded-md flex items-center justify-center outside-month:hidden",
|
12227
12249
|
variants: {
|
@@ -12241,285 +12263,51 @@ var Calendar = (props) => {
|
|
12241
12263
|
return /* @__PURE__ */ React83.createElement(AriaCalendar, { ...props }, /* @__PURE__ */ React83.createElement(CalendarHeader, null), /* @__PURE__ */ React83.createElement(CalendarGrid, null, /* @__PURE__ */ React83.createElement(CalendarGridHeader, null), /* @__PURE__ */ React83.createElement(CalendarGridBody, null, (date) => /* @__PURE__ */ React83.createElement(CalendarCell, { date, className: cellStyles }))));
|
12242
12264
|
};
|
12243
12265
|
var CalendarHeader = () => {
|
12244
|
-
return /* @__PURE__ */ React83.createElement("header", { className: "flex items-center gap-1 pb-5 w-full" }, /* @__PURE__ */ React83.createElement(
|
12266
|
+
return /* @__PURE__ */ React83.createElement("header", { className: "flex items-center gap-1 pb-5 w-full" }, /* @__PURE__ */ React83.createElement(DatePickerButton, { slot: "previous", className: "p-3" }, /* @__PURE__ */ React83.createElement(Icon, { icon: import_chevronLeft4.default })), /* @__PURE__ */ React83.createElement(Heading, { className: tw("flex-1 typography-default-strong text-center") }), /* @__PURE__ */ React83.createElement(DatePickerButton, { slot: "next", className: "p-3" }, /* @__PURE__ */ React83.createElement(Icon, { icon: import_chevronRight4.default })));
|
12245
12267
|
};
|
12246
12268
|
var CalendarGridHeader = () => {
|
12247
12269
|
return /* @__PURE__ */ React83.createElement(AriaCalendarGridHeader, null, (day) => /* @__PURE__ */ React83.createElement(CalendarHeaderCell, { className: "text-xs text-inactive typography-caption" }, day));
|
12248
12270
|
};
|
12249
12271
|
|
12250
|
-
// src/
|
12272
|
+
// src/atoms/DatePicker/DatePicker.tsx
|
12251
12273
|
import React84 from "react";
|
12252
|
-
import { Dialog as AriaDialog } from "react-aria-components";
|
12253
|
-
function Dialog(props) {
|
12254
|
-
return /* @__PURE__ */ React84.createElement(
|
12255
|
-
AriaDialog,
|
12256
|
-
{
|
12257
|
-
...props,
|
12258
|
-
className: classNames(
|
12259
|
-
props.className,
|
12260
|
-
tw(
|
12261
|
-
"outline outline-0 p-5 [[data-placement]>&]:px-5 [[data-placement]>&]:py-6 max-h-[inherit] overflow-auto relative"
|
12262
|
-
)
|
12263
|
-
)
|
12264
|
-
}
|
12265
|
-
);
|
12266
|
-
}
|
12267
|
-
|
12268
|
-
// src/molecules/DatePicker/Popover.tsx
|
12269
|
-
import React85 from "react";
|
12270
12274
|
import {
|
12271
|
-
|
12272
|
-
|
12273
|
-
PopoverContext,
|
12274
|
-
useSlottedContext
|
12275
|
+
DatePicker as AriaDatePicker,
|
12276
|
+
DateRangePicker as AriaDateRangePicker
|
12275
12277
|
} from "react-aria-components";
|
12276
|
-
|
12277
|
-
|
12278
|
-
|
12279
|
-
|
12280
|
-
|
12281
|
-
return /* @__PURE__ */ React85.createElement(
|
12282
|
-
AriaPopover2,
|
12283
|
-
{
|
12284
|
-
offset,
|
12285
|
-
...props,
|
12286
|
-
className: tw(
|
12287
|
-
"rounded-sm shadow-16dp bg-popover-content mt-1 overflow-y-auto flex flex-col border border-default outline-none"
|
12288
|
-
)
|
12289
|
-
},
|
12290
|
-
showArrow && /* @__PURE__ */ React85.createElement(OverlayArrow2, { className: "group" }, /* @__PURE__ */ React85.createElement(
|
12291
|
-
"svg",
|
12292
|
-
{
|
12293
|
-
width: 12,
|
12294
|
-
height: 12,
|
12295
|
-
viewBox: "0 0 12 12",
|
12296
|
-
className: "block fill-white stroke-1 stroke-black group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90"
|
12297
|
-
},
|
12298
|
-
/* @__PURE__ */ React85.createElement("path", { d: "M0 0 L6 6 L12 0" })
|
12299
|
-
)),
|
12300
|
-
children
|
12301
|
-
);
|
12302
|
-
};
|
12303
|
-
|
12304
|
-
// src/molecules/DatePicker/DatePicker.tsx
|
12305
|
-
function DatePickerClearButton() {
|
12306
|
-
const state = React86.useContext(DatePickerStateContext);
|
12307
|
-
if (!state) {
|
12308
|
-
throw new Error("DatePickerStateContext is missing a provider");
|
12309
|
-
}
|
12310
|
-
if (!state.value) {
|
12311
|
-
return null;
|
12278
|
+
import { tv as tv11 } from "tailwind-variants";
|
12279
|
+
var datePickerCalendarStyles = tv11({
|
12280
|
+
slots: {
|
12281
|
+
dialog: "p-5 [[data-placement]>&]:px-5 [[data-placement]>&]:py-6 max-h-[inherit]",
|
12282
|
+
errorMessage: "typography-caption text-danger-default max-w-[300px]"
|
12312
12283
|
}
|
12313
|
-
|
12314
|
-
|
12315
|
-
{
|
12316
|
-
onPress: () => {
|
12317
|
-
state.setValue(null);
|
12318
|
-
}
|
12319
|
-
}
|
12320
|
-
);
|
12321
|
-
}
|
12322
|
-
var createDatePickerBase = (variant) => ({
|
12323
|
-
disabled,
|
12324
|
-
valid,
|
12325
|
-
granularity,
|
12326
|
-
shouldCloseOnSelect,
|
12327
|
-
errorMessage,
|
12328
|
-
clearSelectionEnabled = true,
|
12329
|
-
...props
|
12330
|
-
}) => {
|
12284
|
+
});
|
12285
|
+
var DatePicker = ({ variant, ...props }) => {
|
12331
12286
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12332
|
-
return /* @__PURE__ */
|
12287
|
+
return /* @__PURE__ */ React84.createElement(
|
12333
12288
|
AriaDatePicker,
|
12334
12289
|
{
|
12335
12290
|
...props,
|
12336
|
-
shouldCloseOnSelect: shouldCloseOnSelect ?? variant === "date",
|
12337
|
-
|
12338
|
-
isInvalid: valid === false,
|
12339
|
-
granularity: granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12340
|
-
},
|
12341
|
-
/* @__PURE__ */ React86.createElement(FieldGroup, { className: tw("min-w-[210px] w-auto") }, /* @__PURE__ */ React86.createElement(DateInput, { className: tw("flex-1") }), /* @__PURE__ */ React86.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !disabled && /* @__PURE__ */ React86.createElement(DatePickerClearButton, null), /* @__PURE__ */ React86.createElement(CalendarButton, null))),
|
12342
|
-
/* @__PURE__ */ React86.createElement(Popover2, { offset: 0 }, /* @__PURE__ */ React86.createElement(Dialog, null, /* @__PURE__ */ React86.createElement(Spacing, { gap: "3" }, /* @__PURE__ */ React86.createElement(Calendar, null), variant === "datetime" && /* @__PURE__ */ React86.createElement(PickerTimeField, { granularity }), errorMessage && /* @__PURE__ */ React86.createElement(Text, { slot: "errorMessage", className: tw("typography-caption text-danger-default max-w-[300px]") }, errorMessage))))
|
12343
|
-
);
|
12344
|
-
};
|
12345
|
-
var DatePickerBase = createDatePickerBase("date");
|
12346
|
-
var DateTimePickerBase = createDatePickerBase("datetime");
|
12347
|
-
var PickerTimeField = ({ granularity }) => {
|
12348
|
-
const state = React86.useContext(DatePickerStateContext);
|
12349
|
-
if (!state) {
|
12350
|
-
throw new Error("DatePickerStateContext is missing a provider");
|
12351
|
-
}
|
12352
|
-
return /* @__PURE__ */ React86.createElement(
|
12353
|
-
TimeField,
|
12354
|
-
{
|
12355
|
-
labelText: "Time",
|
12356
|
-
granularity: granularity !== "day" ? granularity : void 0,
|
12357
|
-
value: state.timeValue,
|
12358
|
-
onChange: (value) => value && state.setTimeValue(value),
|
12359
|
-
reserveSpaceForError: false
|
12291
|
+
shouldCloseOnSelect: props.shouldCloseOnSelect ?? variant === "date",
|
12292
|
+
granularity: props.granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12360
12293
|
}
|
12361
12294
|
);
|
12362
12295
|
};
|
12363
|
-
var
|
12364
|
-
const { labelProps, fieldProps } = useLabel2({ label: props.labelText });
|
12365
|
-
const errorMessageId = useId10();
|
12366
|
-
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
12367
|
-
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12368
|
-
const baseProps = omit8(props, Object.keys(labelControlProps));
|
12369
|
-
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
12370
|
-
return /* @__PURE__ */ React86.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React86.createElement(DatePickerBase, { ...allProps }) : /* @__PURE__ */ React86.createElement(DateTimePickerBase, { ...allProps }));
|
12371
|
-
};
|
12372
|
-
var DatePicker = createDatePicker("date");
|
12373
|
-
var DateTimePicker = createDatePicker("datetime");
|
12374
|
-
|
12375
|
-
// src/molecules/DatePicker/DateRangePicker.tsx
|
12376
|
-
import React88 from "react";
|
12377
|
-
import {
|
12378
|
-
DateRangePicker as AriaDateRangePicker,
|
12379
|
-
DateRangePickerStateContext,
|
12380
|
-
Text as Text2
|
12381
|
-
} from "react-aria-components";
|
12382
|
-
import { useLabel as useLabel3 } from "@react-aria/label";
|
12383
|
-
import { useId as useId11 } from "@react-aria/utils";
|
12384
|
-
import { omit as omit9 } from "lodash-es";
|
12385
|
-
|
12386
|
-
// src/molecules/DatePicker/RangeCalendar.tsx
|
12387
|
-
import React87 from "react";
|
12388
|
-
import {
|
12389
|
-
CalendarCell as CalendarCell2,
|
12390
|
-
CalendarGrid as CalendarGrid2,
|
12391
|
-
CalendarGridBody as CalendarGridBody2,
|
12392
|
-
RangeCalendar as AriaRangeCalendar
|
12393
|
-
} from "react-aria-components";
|
12394
|
-
import { tv as tv10 } from "tailwind-variants";
|
12395
|
-
var cell = tv10({
|
12396
|
-
extend: focusRing,
|
12397
|
-
base: "w-full h-full flex items-center justify-center rounded-md text-default",
|
12398
|
-
variants: {
|
12399
|
-
selectionState: {
|
12400
|
-
none: "group-hover:bg-default group-pressed:bg-intense",
|
12401
|
-
middle: [
|
12402
|
-
"text-white",
|
12403
|
-
"group-hover:bg-primary-default",
|
12404
|
-
"group-invalid:group-hover:bg-danger-default",
|
12405
|
-
"group-pressed:bg-primary-intense",
|
12406
|
-
"group-invalid:group-pressed:bg-danger-intense"
|
12407
|
-
],
|
12408
|
-
cap: "text-white bg-primary-default group-invalid:bg-danger-default"
|
12409
|
-
},
|
12410
|
-
isUnavailable: {
|
12411
|
-
true: "text-inactive"
|
12412
|
-
},
|
12413
|
-
isDisabled: {
|
12414
|
-
true: "text-inactive"
|
12415
|
-
}
|
12416
|
-
}
|
12417
|
-
});
|
12418
|
-
function RangeCalendar(props) {
|
12419
|
-
return /* @__PURE__ */ React87.createElement(AriaRangeCalendar, { ...props }, /* @__PURE__ */ React87.createElement(CalendarHeader, null), /* @__PURE__ */ React87.createElement(CalendarGrid2, { className: "[&_td]:px-0" }, /* @__PURE__ */ React87.createElement(CalendarGridHeader, null), /* @__PURE__ */ React87.createElement(CalendarGridBody2, null, (date) => /* @__PURE__ */ React87.createElement(
|
12420
|
-
CalendarCell2,
|
12421
|
-
{
|
12422
|
-
date,
|
12423
|
-
className: tw(
|
12424
|
-
"group w-8 h-8 typography-small outline outline-0 cursor-default",
|
12425
|
-
"outside-month:hidden selected:bg-primary-default",
|
12426
|
-
"invalid:selected:bg-danger-default",
|
12427
|
-
"selection-start:rounded-s-md selection-end:rounded-e-md"
|
12428
|
-
)
|
12429
|
-
},
|
12430
|
-
({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */ React87.createElement(
|
12431
|
-
"span",
|
12432
|
-
{
|
12433
|
-
className: cell({
|
12434
|
-
selectionState: isSelected && (isSelectionStart || isSelectionEnd) ? "cap" : isSelected ? "middle" : "none",
|
12435
|
-
...rest
|
12436
|
-
})
|
12437
|
-
},
|
12438
|
-
formattedDate
|
12439
|
-
)
|
12440
|
-
))));
|
12441
|
-
}
|
12442
|
-
|
12443
|
-
// src/molecules/DatePicker/DateRangePicker.tsx
|
12444
|
-
function DateRangePickerClearButton() {
|
12445
|
-
const state = React88.useContext(DateRangePickerStateContext);
|
12446
|
-
if (!state) {
|
12447
|
-
throw new Error("DateRangePickerStateContext is missing a provider");
|
12448
|
-
}
|
12449
|
-
if (!state.value.start && !state.value.end) {
|
12450
|
-
return null;
|
12451
|
-
}
|
12452
|
-
return /* @__PURE__ */ React88.createElement(
|
12453
|
-
ClearInputButton,
|
12454
|
-
{
|
12455
|
-
onPress: () => {
|
12456
|
-
state.setValue(null);
|
12457
|
-
}
|
12458
|
-
}
|
12459
|
-
);
|
12460
|
-
}
|
12461
|
-
var createDateRangePickerBase = (variant) => ({
|
12462
|
-
disabled,
|
12463
|
-
valid,
|
12464
|
-
granularity,
|
12465
|
-
shouldCloseOnSelect,
|
12466
|
-
errorMessage,
|
12467
|
-
clearSelectionEnabled = true,
|
12468
|
-
...props
|
12469
|
-
}) => {
|
12296
|
+
var DateRangePicker = ({ variant, ...props }) => {
|
12470
12297
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12471
|
-
return /* @__PURE__ */
|
12298
|
+
return /* @__PURE__ */ React84.createElement(
|
12472
12299
|
AriaDateRangePicker,
|
12473
12300
|
{
|
12474
12301
|
...props,
|
12475
|
-
shouldCloseOnSelect: shouldCloseOnSelect ?? variant === "date",
|
12476
|
-
|
12477
|
-
isInvalid: valid === false,
|
12478
|
-
granularity: granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0),
|
12479
|
-
className: tw("group flex flex-col gap-1")
|
12480
|
-
},
|
12481
|
-
/* @__PURE__ */ React88.createElement(FieldGroup, { className: tw("min-w-[200px] w-auto gap-2") }, /* @__PURE__ */ React88.createElement(DateInput, { slot: "start", className: tw("px-2 py-1") }), /* @__PURE__ */ React88.createElement("span", { "aria-hidden": true, className: tw("text-muted") }, "-"), /* @__PURE__ */ React88.createElement(DateInput, { slot: "end", className: tw("flex-1 px-2 py-1") }), /* @__PURE__ */ React88.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !disabled && /* @__PURE__ */ React88.createElement(DateRangePickerClearButton, null), /* @__PURE__ */ React88.createElement(CalendarButton, null))),
|
12482
|
-
/* @__PURE__ */ React88.createElement(Popover2, { offset: 0 }, /* @__PURE__ */ React88.createElement(Dialog, null, /* @__PURE__ */ React88.createElement(Spacing, { gap: "3" }, /* @__PURE__ */ React88.createElement(RangeCalendar, null), variant === "datetime" && /* @__PURE__ */ React88.createElement(Box.Flex, { gap: "6" }, /* @__PURE__ */ React88.createElement("div", { className: tw("flex-1") }, /* @__PURE__ */ React88.createElement(PickerTimeField2, { granularity, part: "start" })), /* @__PURE__ */ React88.createElement("div", { className: tw("flex-1") }, /* @__PURE__ */ React88.createElement(PickerTimeField2, { granularity, part: "end" }))), errorMessage && /* @__PURE__ */ React88.createElement(Text2, { slot: "errorMessage", className: tw("typography-caption text-danger-default max-w-[300px]") }, errorMessage))))
|
12483
|
-
);
|
12484
|
-
};
|
12485
|
-
var PickerTimeField2 = ({ granularity, part }) => {
|
12486
|
-
const ctx = React88.useContext(DateRangePickerStateContext);
|
12487
|
-
return /* @__PURE__ */ React88.createElement(
|
12488
|
-
TimeField,
|
12489
|
-
{
|
12490
|
-
labelText: part === "start" ? "Start time" : "End time",
|
12491
|
-
granularity: granularity !== "day" ? granularity : void 0,
|
12492
|
-
value: ctx?.timeRange?.[part] ?? null,
|
12493
|
-
onChange: (value) => ctx?.setTime(part, value),
|
12494
|
-
reserveSpaceForError: false
|
12302
|
+
shouldCloseOnSelect: props.shouldCloseOnSelect ?? variant === "date",
|
12303
|
+
granularity: props.granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12495
12304
|
}
|
12496
12305
|
);
|
12497
12306
|
};
|
12498
|
-
var DateRangePickerBase = createDateRangePickerBase("date");
|
12499
|
-
var DateTimeRangePickerBase = createDateRangePickerBase("datetime");
|
12500
|
-
var createDateRangePicker = (variant) => (props) => {
|
12501
|
-
const { labelProps, fieldProps } = useLabel3({ label: props.labelText });
|
12502
|
-
const errorMessageId = useId11();
|
12503
|
-
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
12504
|
-
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12505
|
-
const baseProps = omit9(props, Object.keys(labelControlProps));
|
12506
|
-
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
12507
|
-
return /* @__PURE__ */ React88.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React88.createElement(DateRangePickerBase, { ...allProps }) : /* @__PURE__ */ React88.createElement(DateTimeRangePickerBase, { ...allProps }));
|
12508
|
-
};
|
12509
|
-
var DateRangePicker = createDateRangePicker("date");
|
12510
|
-
var DateTimeRangePicker = createDateRangePicker("datetime");
|
12511
|
-
|
12512
|
-
// src/molecules/Dialog/Dialog.tsx
|
12513
|
-
import React91 from "react";
|
12514
|
-
import { useDialog } from "@react-aria/dialog";
|
12515
|
-
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
12516
|
-
import { useId as useId12 } from "@react-aria/utils";
|
12517
|
-
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
12518
|
-
import { omit as omit10 } from "lodash-es";
|
12519
12307
|
|
12520
12308
|
// src/atoms/Dialog/Dialog.tsx
|
12521
|
-
import
|
12522
|
-
import { Dialog as
|
12309
|
+
import React85 from "react";
|
12310
|
+
import { Dialog as AriaDialog } from "react-aria-components";
|
12523
12311
|
|
12524
12312
|
// node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
12525
12313
|
var CLASS_PART_SEPARATOR = "-";
|
@@ -14999,9 +14787,9 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
14999
14787
|
color: "danger-default"
|
15000
14788
|
}
|
15001
14789
|
};
|
15002
|
-
var
|
15003
|
-
return /* @__PURE__ */
|
15004
|
-
|
14790
|
+
var Dialog = (props) => {
|
14791
|
+
return /* @__PURE__ */ React85.createElement(
|
14792
|
+
AriaDialog,
|
15005
14793
|
{
|
15006
14794
|
...props,
|
15007
14795
|
className: twMerge("outline outline-0 max-h-[inherit] overflow-auto relative", props.className)
|
@@ -15009,10 +14797,251 @@ var Dialog2 = (props) => {
|
|
15009
14797
|
);
|
15010
14798
|
};
|
15011
14799
|
|
15012
|
-
// src/
|
14800
|
+
// src/molecules/DatePicker/DatePicker.tsx
|
14801
|
+
var DatePickerClearButton = () => {
|
14802
|
+
const state = React86.useContext(DatePickerStateContext);
|
14803
|
+
if (!state) {
|
14804
|
+
throw new Error("DatePickerStateContext is missing a provider");
|
14805
|
+
}
|
14806
|
+
if (!state.value) {
|
14807
|
+
return null;
|
14808
|
+
}
|
14809
|
+
return /* @__PURE__ */ React86.createElement(
|
14810
|
+
ClearInputButton,
|
14811
|
+
{
|
14812
|
+
onPress: () => {
|
14813
|
+
state.setValue(null);
|
14814
|
+
}
|
14815
|
+
}
|
14816
|
+
);
|
14817
|
+
};
|
14818
|
+
DatePickerClearButton.displayName = "DatePicker.ClearButton";
|
14819
|
+
var CalendarTimeField = ({ granularity, labelText = "Time", ...props }) => {
|
14820
|
+
const ctx = React86.useContext(DatePickerStateContext);
|
14821
|
+
return /* @__PURE__ */ React86.createElement(
|
14822
|
+
TimeField2,
|
14823
|
+
{
|
14824
|
+
...props,
|
14825
|
+
labelText,
|
14826
|
+
granularity: granularity !== "day" ? granularity : void 0,
|
14827
|
+
value: ctx?.timeValue,
|
14828
|
+
onChange: (value) => value && ctx?.setTimeValue(value),
|
14829
|
+
reserveSpaceForError: false
|
14830
|
+
}
|
14831
|
+
);
|
14832
|
+
};
|
14833
|
+
var DatePickerCalendarPropsContext = React86.createContext(null);
|
14834
|
+
var DatePickerCalendar = (props) => {
|
14835
|
+
const ctx = React86.useContext(DatePickerCalendarPropsContext);
|
14836
|
+
const { variant, granularity, errorMessage } = mergeProps3(ctx, props);
|
14837
|
+
const { dialog, errorMessage: errorMessageStyle } = datePickerCalendarStyles();
|
14838
|
+
return /* @__PURE__ */ React86.createElement(Popover, { offset: 0 }, /* @__PURE__ */ React86.createElement(Dialog, { className: dialog() }, /* @__PURE__ */ React86.createElement(Spacing, { gap: "3" }, /* @__PURE__ */ React86.createElement(Calendar, null), variant === "datetime" && /* @__PURE__ */ React86.createElement(CalendarTimeField, { granularity }), errorMessage && /* @__PURE__ */ React86.createElement(Text, { slot: "errorMessage", className: errorMessageStyle() }, errorMessage))));
|
14839
|
+
};
|
14840
|
+
DatePickerCalendar.displayName = "DatePicker.Calendar";
|
14841
|
+
var DatePickerField = ({ clearSelectionEnabled = true, disabled = false }) => {
|
14842
|
+
return /* @__PURE__ */ React86.createElement(FieldGroup, { className: tw("min-w-[210px] w-auto") }, /* @__PURE__ */ React86.createElement(DateInput, { className: tw("flex-1") }), /* @__PURE__ */ React86.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !disabled && /* @__PURE__ */ React86.createElement(DatePickerClearButton, null), /* @__PURE__ */ React86.createElement(CalendarButton, null)));
|
14843
|
+
};
|
14844
|
+
DatePickerField.displayName = "DatePicker.Field";
|
14845
|
+
var createDatePickerBase = (variant) => {
|
14846
|
+
const datePicker = ({
|
14847
|
+
disabled,
|
14848
|
+
valid,
|
14849
|
+
shouldCloseOnSelect,
|
14850
|
+
errorMessage,
|
14851
|
+
clearSelectionEnabled = true,
|
14852
|
+
children,
|
14853
|
+
...props
|
14854
|
+
}) => {
|
14855
|
+
const content = children ?? /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(DatePickerField, { clearSelectionEnabled, disabled }), /* @__PURE__ */ React86.createElement(DatePickerCalendar, null));
|
14856
|
+
return /* @__PURE__ */ React86.createElement(DatePickerCalendarPropsContext.Provider, { value: { variant, granularity: props.granularity, errorMessage } }, /* @__PURE__ */ React86.createElement(DatePicker, { ...props, variant, isDisabled: disabled, isInvalid: valid === false }, content));
|
14857
|
+
};
|
14858
|
+
datePicker.Calendar = DatePickerCalendar;
|
14859
|
+
datePicker.Field = DatePickerField;
|
14860
|
+
datePicker.displayName = variant === "date" ? "DatePickerBase" : "DateTimePickerBase";
|
14861
|
+
return datePicker;
|
14862
|
+
};
|
14863
|
+
var DatePickerBase = createDatePickerBase("date");
|
14864
|
+
var DateTimePickerBase = createDatePickerBase("datetime");
|
14865
|
+
var createDatePicker = (variant) => {
|
14866
|
+
const datePicker = (props) => {
|
14867
|
+
const { labelProps, fieldProps } = useLabel2({ "label": props.labelText, "aria-label": props["aria-label"] });
|
14868
|
+
const errorMessageId = useId10();
|
14869
|
+
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
14870
|
+
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
14871
|
+
const baseProps = omit8(props, Object.keys(labelControlProps));
|
14872
|
+
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
14873
|
+
return /* @__PURE__ */ React86.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React86.createElement(DatePickerBase, { ...allProps }) : /* @__PURE__ */ React86.createElement(DateTimePickerBase, { ...allProps }));
|
14874
|
+
};
|
14875
|
+
datePicker.Calendar = DatePickerCalendar;
|
14876
|
+
datePicker.Field = DatePickerField;
|
14877
|
+
datePicker.displayName = variant === "date" ? "DatePicker" : "DateTimePicker";
|
14878
|
+
return datePicker;
|
14879
|
+
};
|
14880
|
+
var DatePicker2 = createDatePicker("date");
|
14881
|
+
var DateTimePicker = createDatePicker("datetime");
|
14882
|
+
|
14883
|
+
// src/molecules/DatePicker/DateRangePicker.tsx
|
14884
|
+
import React88 from "react";
|
14885
|
+
import {
|
14886
|
+
DateRangePickerStateContext,
|
14887
|
+
Text as Text2
|
14888
|
+
} from "react-aria-components";
|
14889
|
+
import { useLabel as useLabel3 } from "@react-aria/label";
|
14890
|
+
import { mergeProps as mergeProps4, useId as useId11 } from "@react-aria/utils";
|
14891
|
+
import { omit as omit9 } from "lodash-es";
|
14892
|
+
|
14893
|
+
// src/atoms/DatePicker/RangeCalendar.tsx
|
14894
|
+
import React87 from "react";
|
14895
|
+
import {
|
14896
|
+
CalendarCell as CalendarCell2,
|
14897
|
+
CalendarGrid as CalendarGrid2,
|
14898
|
+
CalendarGridBody as CalendarGridBody2,
|
14899
|
+
RangeCalendar as AriaRangeCalendar
|
14900
|
+
} from "react-aria-components";
|
14901
|
+
import { tv as tv12 } from "tailwind-variants";
|
14902
|
+
var cell = tv12({
|
14903
|
+
extend: focusRing,
|
14904
|
+
base: "w-full h-full flex items-center justify-center rounded-md text-default",
|
14905
|
+
variants: {
|
14906
|
+
selectionState: {
|
14907
|
+
none: "group-hover:bg-default group-pressed:bg-intense",
|
14908
|
+
middle: [
|
14909
|
+
"text-white",
|
14910
|
+
"group-hover:bg-primary-default",
|
14911
|
+
"group-invalid:group-hover:bg-danger-default",
|
14912
|
+
"group-pressed:bg-primary-intense",
|
14913
|
+
"group-invalid:group-pressed:bg-danger-intense"
|
14914
|
+
],
|
14915
|
+
cap: "text-white bg-primary-default group-invalid:bg-danger-default"
|
14916
|
+
},
|
14917
|
+
isUnavailable: {
|
14918
|
+
true: "text-inactive"
|
14919
|
+
},
|
14920
|
+
isDisabled: {
|
14921
|
+
true: "text-inactive"
|
14922
|
+
}
|
14923
|
+
}
|
14924
|
+
});
|
14925
|
+
function RangeCalendar(props) {
|
14926
|
+
return /* @__PURE__ */ React87.createElement(AriaRangeCalendar, { ...props }, /* @__PURE__ */ React87.createElement(CalendarHeader, null), /* @__PURE__ */ React87.createElement(CalendarGrid2, { className: "[&_td]:px-0" }, /* @__PURE__ */ React87.createElement(CalendarGridHeader, null), /* @__PURE__ */ React87.createElement(CalendarGridBody2, null, (date) => /* @__PURE__ */ React87.createElement(
|
14927
|
+
CalendarCell2,
|
14928
|
+
{
|
14929
|
+
date,
|
14930
|
+
className: tw(
|
14931
|
+
"group w-8 h-8 typography-small outline outline-0 cursor-default",
|
14932
|
+
"outside-month:hidden selected:bg-primary-default",
|
14933
|
+
"invalid:selected:bg-danger-default",
|
14934
|
+
"selection-start:rounded-s-md selection-end:rounded-e-md"
|
14935
|
+
)
|
14936
|
+
},
|
14937
|
+
({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */ React87.createElement(
|
14938
|
+
"span",
|
14939
|
+
{
|
14940
|
+
className: cell({
|
14941
|
+
selectionState: isSelected && (isSelectionStart || isSelectionEnd) ? "cap" : isSelected ? "middle" : "none",
|
14942
|
+
...rest
|
14943
|
+
})
|
14944
|
+
},
|
14945
|
+
formattedDate
|
14946
|
+
)
|
14947
|
+
))));
|
14948
|
+
}
|
14949
|
+
|
14950
|
+
// src/molecules/DatePicker/DateRangePicker.tsx
|
14951
|
+
function DateRangePickerClearButton() {
|
14952
|
+
const state = React88.useContext(DateRangePickerStateContext);
|
14953
|
+
if (!state) {
|
14954
|
+
throw new Error("DateRangePickerStateContext is missing a provider");
|
14955
|
+
}
|
14956
|
+
if (!state.value.start && !state.value.end) {
|
14957
|
+
return null;
|
14958
|
+
}
|
14959
|
+
return /* @__PURE__ */ React88.createElement(
|
14960
|
+
ClearInputButton,
|
14961
|
+
{
|
14962
|
+
onPress: () => {
|
14963
|
+
state.setValue(null);
|
14964
|
+
}
|
14965
|
+
}
|
14966
|
+
);
|
14967
|
+
}
|
14968
|
+
var RangeCalendarTimeField = ({ granularity, part, ...props }) => {
|
14969
|
+
const ctx = React88.useContext(DateRangePickerStateContext);
|
14970
|
+
const labelText = props.labelText ?? (part === "start" ? "Start time" : "End time");
|
14971
|
+
return /* @__PURE__ */ React88.createElement(
|
14972
|
+
TimeField2,
|
14973
|
+
{
|
14974
|
+
...props,
|
14975
|
+
labelText,
|
14976
|
+
granularity: granularity !== "day" ? granularity : void 0,
|
14977
|
+
value: ctx?.timeRange?.[part] ?? null,
|
14978
|
+
onChange: (value) => ctx?.setTime(part, value),
|
14979
|
+
reserveSpaceForError: false
|
14980
|
+
}
|
14981
|
+
);
|
14982
|
+
};
|
14983
|
+
var DateRangePickerCalendarPropsContext = React88.createContext(null);
|
14984
|
+
var DateRangePickerCalendar = (props) => {
|
14985
|
+
const ctx = React88.useContext(DateRangePickerCalendarPropsContext);
|
14986
|
+
const { variant, granularity, errorMessage } = mergeProps4(ctx, props);
|
14987
|
+
const { dialog, errorMessage: errorMessageStyle } = datePickerCalendarStyles();
|
14988
|
+
return /* @__PURE__ */ React88.createElement(Popover, { offset: 0 }, /* @__PURE__ */ React88.createElement(Dialog, { className: dialog() }, /* @__PURE__ */ React88.createElement(Spacing, { gap: "3" }, /* @__PURE__ */ React88.createElement(RangeCalendar, null), variant === "datetime" && /* @__PURE__ */ React88.createElement(Box.Flex, { gap: "6" }, /* @__PURE__ */ React88.createElement("div", { className: tw("flex-1") }, /* @__PURE__ */ React88.createElement(RangeCalendarTimeField, { granularity, part: "start" })), /* @__PURE__ */ React88.createElement("div", { className: tw("flex-1") }, /* @__PURE__ */ React88.createElement(RangeCalendarTimeField, { granularity, part: "end" }))), errorMessage && /* @__PURE__ */ React88.createElement(Text2, { slot: "errorMessage", className: errorMessageStyle() }, errorMessage))));
|
14989
|
+
};
|
14990
|
+
DateRangePickerCalendar.displayName = "DateRangePicker.Calendar";
|
14991
|
+
var DateRangePickerField = ({ clearSelectionEnabled = true, disabled = false }) => {
|
14992
|
+
return /* @__PURE__ */ React88.createElement(FieldGroup, { className: tw("min-w-[200px] w-auto gap-2") }, /* @__PURE__ */ React88.createElement(DateInput, { slot: "start", className: tw("px-2 py-1") }), /* @__PURE__ */ React88.createElement("span", { "aria-hidden": true, className: tw("text-muted") }, "-"), /* @__PURE__ */ React88.createElement(DateInput, { slot: "end", className: tw("flex-1 px-2 py-1") }), /* @__PURE__ */ React88.createElement(Box.Flex, { alignItems: "center", gap: "2" }, clearSelectionEnabled && !disabled && /* @__PURE__ */ React88.createElement(DateRangePickerClearButton, null), /* @__PURE__ */ React88.createElement(CalendarButton, null)));
|
14993
|
+
};
|
14994
|
+
DateRangePickerField.displayName = "DateRangePicker.Field";
|
14995
|
+
var createDateRangePickerBase = (variant) => {
|
14996
|
+
const dateRangePicker = ({
|
14997
|
+
disabled,
|
14998
|
+
valid,
|
14999
|
+
shouldCloseOnSelect,
|
15000
|
+
errorMessage,
|
15001
|
+
clearSelectionEnabled = true,
|
15002
|
+
children,
|
15003
|
+
...props
|
15004
|
+
}) => {
|
15005
|
+
const content = children ?? /* @__PURE__ */ React88.createElement(React88.Fragment, null, /* @__PURE__ */ React88.createElement(DateRangePickerField, { clearSelectionEnabled, disabled }), /* @__PURE__ */ React88.createElement(DateRangePickerCalendar, { variant, granularity: props.granularity, errorMessage }));
|
15006
|
+
return /* @__PURE__ */ React88.createElement(DateRangePickerCalendarPropsContext.Provider, { value: { variant, granularity: props.granularity, errorMessage } }, /* @__PURE__ */ React88.createElement(DateRangePicker, { ...props, variant, isDisabled: disabled, isInvalid: valid === false }, content));
|
15007
|
+
};
|
15008
|
+
dateRangePicker.Calendar = DateRangePickerCalendar;
|
15009
|
+
dateRangePicker.Field = DateRangePickerField;
|
15010
|
+
dateRangePicker.displayName = variant === "date" ? "DateRangePickerBase" : "DateTimeRangePickerBase";
|
15011
|
+
return dateRangePicker;
|
15012
|
+
};
|
15013
|
+
var DateRangePickerBase = createDateRangePickerBase("date");
|
15014
|
+
var DateTimeRangePickerBase = createDateRangePickerBase("datetime");
|
15015
|
+
var createDateRangePicker = (variant) => {
|
15016
|
+
const dateRangePicker = (props) => {
|
15017
|
+
const { labelProps, fieldProps } = useLabel3({ "label": props.labelText, "aria-label": props["aria-label"] });
|
15018
|
+
const errorMessageId = useId11();
|
15019
|
+
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
15020
|
+
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
15021
|
+
const baseProps = omit9(props, Object.keys(labelControlProps));
|
15022
|
+
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
15023
|
+
return /* @__PURE__ */ React88.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React88.createElement(DateRangePickerBase, { ...allProps }) : /* @__PURE__ */ React88.createElement(DateTimeRangePickerBase, { ...allProps }));
|
15024
|
+
};
|
15025
|
+
dateRangePicker.Calendar = DateRangePickerCalendar;
|
15026
|
+
dateRangePicker.Field = DateRangePickerField;
|
15027
|
+
dateRangePicker.displayName = variant === "date" ? "DateRangePicker" : "DateTimeRangePicker";
|
15028
|
+
return dateRangePicker;
|
15029
|
+
};
|
15030
|
+
var DateRangePicker2 = createDateRangePicker("date");
|
15031
|
+
var DateTimeRangePicker = createDateRangePicker("datetime");
|
15032
|
+
|
15033
|
+
// src/molecules/Dialog/Dialog.tsx
|
15013
15034
|
import React90 from "react";
|
15014
|
-
import {
|
15015
|
-
|
15035
|
+
import { useDialog } from "@react-aria/dialog";
|
15036
|
+
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
15037
|
+
import { useId as useId12 } from "@react-aria/utils";
|
15038
|
+
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
15039
|
+
import { omit as omit10 } from "lodash-es";
|
15040
|
+
|
15041
|
+
// src/atoms/Modal/Modal.tsx
|
15042
|
+
import React89 from "react";
|
15043
|
+
import { tv as tv13 } from "tailwind-variants";
|
15044
|
+
var modalStyles = tv13({
|
15016
15045
|
slots: {
|
15017
15046
|
overlay: "inset-0 overflow-y-auto z-modal fixed",
|
15018
15047
|
backdrop: "-z-10 fixed min-w-full min-h-full bg-body-intense opacity-70",
|
@@ -15115,55 +15144,55 @@ var Modal = ({
|
|
15115
15144
|
...rest
|
15116
15145
|
}) => {
|
15117
15146
|
const { overlay } = modalStyles({ kind });
|
15118
|
-
return open ? /* @__PURE__ */
|
15147
|
+
return open ? /* @__PURE__ */ React89.createElement("div", { ...rest, className: overlay({ className }) }, children) : null;
|
15119
15148
|
};
|
15120
15149
|
Modal.BackDrop = ({ className, ...rest }) => {
|
15121
15150
|
const { backdrop } = modalStyles();
|
15122
|
-
return /* @__PURE__ */
|
15151
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: backdrop({ className }) });
|
15123
15152
|
};
|
15124
|
-
Modal.Dialog =
|
15153
|
+
Modal.Dialog = React89.forwardRef(
|
15125
15154
|
({ kind = "dialog", children, className, size = "md", ...rest }, ref) => {
|
15126
15155
|
const { dialog } = modalStyles({ kind, size });
|
15127
|
-
return /* @__PURE__ */
|
15156
|
+
return /* @__PURE__ */ React89.createElement("div", { ref, "aria-modal": "true", ...rest, className: dialog({ className }) }, children);
|
15128
15157
|
}
|
15129
15158
|
);
|
15130
15159
|
Modal.Header = ({ kind = "dialog", size = "md", children, className, ...rest }) => {
|
15131
15160
|
const { header } = modalStyles({ kind, size });
|
15132
|
-
return /* @__PURE__ */
|
15161
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: header({ className }) }, children);
|
15133
15162
|
};
|
15134
15163
|
Modal.HeaderImage = ({ backgroundImage, className, ...rest }) => {
|
15135
15164
|
const { headerImage } = modalStyles({ backgroundImage: Boolean(backgroundImage) });
|
15136
|
-
return backgroundImage ? /* @__PURE__ */
|
15165
|
+
return backgroundImage ? /* @__PURE__ */ React89.createElement("img", { "aria-hidden": true, src: backgroundImage, ...rest, className: headerImage({ className }) }) : /* @__PURE__ */ React89.createElement("div", { className: headerImage({ className }) });
|
15137
15166
|
};
|
15138
15167
|
Modal.CloseButtonContainer = ({ className, ...rest }) => {
|
15139
15168
|
const { closeButtonContainer } = modalStyles();
|
15140
|
-
return /* @__PURE__ */
|
15169
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: closeButtonContainer({ className }) });
|
15141
15170
|
};
|
15142
15171
|
Modal.Title = ({ kind = "dialog", children, className, ...rest }) => {
|
15143
15172
|
const { title } = modalStyles({ kind });
|
15144
|
-
return /* @__PURE__ */
|
15173
|
+
return /* @__PURE__ */ React89.createElement(Typography, { htmlTag: "h2", variant: "subheading", color: "intense", className: title({ className }), ...rest }, children);
|
15145
15174
|
};
|
15146
|
-
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
15175
|
+
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React89.createElement(Typography, { variant: "small", color: "default", ...rest }, children);
|
15147
15176
|
Modal.TitleContainer = ({ children, className, ...rest }) => {
|
15148
15177
|
const { titleContainer } = modalStyles();
|
15149
|
-
return /* @__PURE__ */
|
15178
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: titleContainer({ className }) }, children);
|
15150
15179
|
};
|
15151
15180
|
Modal.Body = ({ children, className, noFooter = false, maxHeight, style, ...rest }) => {
|
15152
15181
|
const { body } = modalStyles();
|
15153
|
-
return /* @__PURE__ */
|
15182
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: body({ noFooter, className }), style: { maxHeight, ...style } }, children);
|
15154
15183
|
};
|
15155
15184
|
Modal.Footer = ({ children, className, ...rest }) => {
|
15156
15185
|
const { footer } = modalStyles();
|
15157
|
-
return /* @__PURE__ */
|
15186
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: footer({ className }) }, children);
|
15158
15187
|
};
|
15159
15188
|
Modal.Actions = ({ children, className, ...rest }) => {
|
15160
15189
|
const { actions } = modalStyles();
|
15161
|
-
return /* @__PURE__ */
|
15190
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: actions({ className }) }, children);
|
15162
15191
|
};
|
15163
15192
|
|
15164
15193
|
// src/molecules/Dialog/Dialog.tsx
|
15165
|
-
var
|
15166
|
-
const ref =
|
15194
|
+
var Dialog2 = (props) => {
|
15195
|
+
const ref = React90.useRef(null);
|
15167
15196
|
const { open, onClose } = props;
|
15168
15197
|
const state = useOverlayTriggerState2({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose?.() });
|
15169
15198
|
const { modalProps, underlayProps } = useModalOverlay(
|
@@ -15174,7 +15203,7 @@ var Dialog3 = (props) => {
|
|
15174
15203
|
if (!state.isOpen) {
|
15175
15204
|
return null;
|
15176
15205
|
}
|
15177
|
-
return /* @__PURE__ */
|
15206
|
+
return /* @__PURE__ */ React90.createElement(Overlay, null, /* @__PURE__ */ React90.createElement(Modal, { className: "Aquarium-Dialog", open: true }, /* @__PURE__ */ React90.createElement(Modal.BackDrop, { ...underlayProps }), /* @__PURE__ */ React90.createElement(Modal.Dialog, { ref, size: "sm", ...modalProps }, /* @__PURE__ */ React90.createElement(DialogWrapper, { ...props }))));
|
15178
15207
|
};
|
15179
15208
|
var DialogWrapper = ({
|
15180
15209
|
title,
|
@@ -15183,7 +15212,7 @@ var DialogWrapper = ({
|
|
15183
15212
|
primaryAction,
|
15184
15213
|
secondaryAction
|
15185
15214
|
}) => {
|
15186
|
-
const ref =
|
15215
|
+
const ref = React90.useRef(null);
|
15187
15216
|
const labelledBy = useId12();
|
15188
15217
|
const describedBy = useId12();
|
15189
15218
|
const { dialogProps } = useDialog(
|
@@ -15194,35 +15223,35 @@ var DialogWrapper = ({
|
|
15194
15223
|
},
|
15195
15224
|
ref
|
15196
15225
|
);
|
15197
|
-
return /* @__PURE__ */
|
15226
|
+
return /* @__PURE__ */ React90.createElement("div", { ref, ...dialogProps, className: tw("outline-none") }, /* @__PURE__ */ React90.createElement(Modal.Header, { className: tw("icon-stroke-2") }, /* @__PURE__ */ React90.createElement(Icon, { icon: DIALOG_ICONS_AND_COLORS[type].icon, color: DIALOG_ICONS_AND_COLORS[type].color, fontSize: 20 }), /* @__PURE__ */ React90.createElement(Modal.Title, { id: labelledBy, variant: "large", color: DIALOG_ICONS_AND_COLORS[type].color }, title)), /* @__PURE__ */ React90.createElement(Modal.Body, { id: describedBy }, /* @__PURE__ */ React90.createElement(Typography2.Default, null, children)), /* @__PURE__ */ React90.createElement(Modal.Footer, null, /* @__PURE__ */ React90.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React90.createElement(Button2.Ghost, { key: secondaryAction.text, ...omit10(secondaryAction, "text") }, secondaryAction.text), /* @__PURE__ */ React90.createElement(Button2.Secondary, { key: primaryAction.text, ...omit10(primaryAction, "text") }, primaryAction.text))));
|
15198
15227
|
};
|
15199
15228
|
|
15200
15229
|
// src/molecules/Drawer/Drawer.tsx
|
15201
|
-
import
|
15202
|
-
import { Dialog as
|
15230
|
+
import React93 from "react";
|
15231
|
+
import { Dialog as AriaDialog2, Modal as AriaModal, ModalOverlay as AriaModalOverlay } from "react-aria-components";
|
15203
15232
|
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
15204
15233
|
import { castArray as castArray3, omit as omit11 } from "lodash-es";
|
15205
15234
|
|
15206
15235
|
// src/molecules/Modal/ModalTitle.tsx
|
15207
|
-
import
|
15236
|
+
import React91 from "react";
|
15208
15237
|
import { HeadingContext, useContextProps } from "react-aria-components";
|
15209
15238
|
var ModalTitle = ({ children, ...props }) => {
|
15210
15239
|
const [ctxProps] = useContextProps({ ...props, slot: "title" }, null, HeadingContext);
|
15211
|
-
return /* @__PURE__ */
|
15240
|
+
return /* @__PURE__ */ React91.createElement(Modal.Title, { id: ctxProps.id, ...props }, children);
|
15212
15241
|
};
|
15213
15242
|
|
15214
15243
|
// src/molecules/Tabs/Tabs.tsx
|
15215
|
-
import
|
15244
|
+
import React92, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState11 } from "react";
|
15216
15245
|
import { isNumber as isNumber6, kebabCase } from "lodash-es";
|
15217
15246
|
var import_chevronLeft5 = __toESM(require_chevronLeft());
|
15218
15247
|
var import_chevronRight5 = __toESM(require_chevronRight());
|
15219
15248
|
var import_warningSign4 = __toESM(require_warningSign());
|
15220
15249
|
var isTabComponent = (c) => {
|
15221
|
-
return
|
15250
|
+
return React92.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
15222
15251
|
};
|
15223
|
-
var Tab =
|
15252
|
+
var Tab = React92.forwardRef(
|
15224
15253
|
({ className, id, title, children }, ref) => {
|
15225
|
-
return /* @__PURE__ */
|
15254
|
+
return /* @__PURE__ */ React92.createElement(
|
15226
15255
|
"div",
|
15227
15256
|
{
|
15228
15257
|
ref,
|
@@ -15236,10 +15265,10 @@ var Tab = React93.forwardRef(
|
|
15236
15265
|
);
|
15237
15266
|
}
|
15238
15267
|
);
|
15239
|
-
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */
|
15268
|
+
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */ React92.createElement("div", { ...rest, className: classNames("py-6 z-0", className) }, children);
|
15240
15269
|
var ModalTab = Tab;
|
15241
15270
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
15242
|
-
const Tab2 =
|
15271
|
+
const Tab2 = React92.forwardRef(
|
15243
15272
|
({
|
15244
15273
|
id,
|
15245
15274
|
value,
|
@@ -15258,11 +15287,11 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15258
15287
|
const _id = id ?? kebabCase(title);
|
15259
15288
|
let statusIcon = void 0;
|
15260
15289
|
if (status === "warning") {
|
15261
|
-
statusIcon = /* @__PURE__ */
|
15290
|
+
statusIcon = /* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "warning-default" });
|
15262
15291
|
} else if (status === "error") {
|
15263
|
-
statusIcon = /* @__PURE__ */
|
15292
|
+
statusIcon = /* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "danger-default" });
|
15264
15293
|
}
|
15265
|
-
const tab = /* @__PURE__ */
|
15294
|
+
const tab = /* @__PURE__ */ React92.createElement(
|
15266
15295
|
Component,
|
15267
15296
|
{
|
15268
15297
|
ref,
|
@@ -15283,7 +15312,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15283
15312
|
tabIndex: disabled ? void 0 : 0,
|
15284
15313
|
...rest
|
15285
15314
|
},
|
15286
|
-
/* @__PURE__ */
|
15315
|
+
/* @__PURE__ */ React92.createElement(
|
15287
15316
|
Typography2,
|
15288
15317
|
{
|
15289
15318
|
htmlTag: "div",
|
@@ -15291,8 +15320,8 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15291
15320
|
color: selected ? "primary-default" : disabled ? "default" : "current",
|
15292
15321
|
className: tw("inline-flex items-center gap-3")
|
15293
15322
|
},
|
15294
|
-
showNotification ? /* @__PURE__ */
|
15295
|
-
isNumber6(badge) && /* @__PURE__ */
|
15323
|
+
showNotification ? /* @__PURE__ */ React92.createElement(Badge.Notification, { right: "-4px", top: "3px" }, /* @__PURE__ */ React92.createElement("span", { className: tw("whitespace-nowrap") }, title)) : /* @__PURE__ */ React92.createElement("span", { className: tw("whitespace-nowrap") }, title),
|
15324
|
+
isNumber6(badge) && /* @__PURE__ */ React92.createElement(
|
15296
15325
|
Typography2,
|
15297
15326
|
{
|
15298
15327
|
htmlTag: "span",
|
@@ -15300,7 +15329,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15300
15329
|
color: selected ? "primary-intense" : "grey-5",
|
15301
15330
|
className: "leading-none"
|
15302
15331
|
},
|
15303
|
-
/* @__PURE__ */
|
15332
|
+
/* @__PURE__ */ React92.createElement(
|
15304
15333
|
TabBadge,
|
15305
15334
|
{
|
15306
15335
|
kind: "filled",
|
@@ -15312,7 +15341,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15312
15341
|
statusIcon
|
15313
15342
|
)
|
15314
15343
|
);
|
15315
|
-
return tooltip ? /* @__PURE__ */
|
15344
|
+
return tooltip ? /* @__PURE__ */ React92.createElement(Tooltip, { content: tooltip }, tab) : tab;
|
15316
15345
|
}
|
15317
15346
|
);
|
15318
15347
|
Tab2.displayName = displayName;
|
@@ -15323,7 +15352,7 @@ var CARET_OFFSET = 24;
|
|
15323
15352
|
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
15324
15353
|
const Tabs2 = (props) => {
|
15325
15354
|
const { className, value, defaultValue, onChange, children } = props;
|
15326
|
-
const childArr =
|
15355
|
+
const childArr = React92.Children.toArray(children);
|
15327
15356
|
const firstTab = childArr[0];
|
15328
15357
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
15329
15358
|
const [selected, setSelected] = useState11(value ?? defaultValue ?? firstTabValue ?? 0);
|
@@ -15335,7 +15364,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15335
15364
|
const revealSelectedTab = ({ smooth }) => {
|
15336
15365
|
const container = containerRef.current;
|
15337
15366
|
const tabs = tabsRef.current;
|
15338
|
-
const values =
|
15367
|
+
const values = React92.Children.map(
|
15339
15368
|
children,
|
15340
15369
|
(tab, i) => tab?.props.value ?? i
|
15341
15370
|
);
|
@@ -15373,7 +15402,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15373
15402
|
updateCarets();
|
15374
15403
|
setSelected(value);
|
15375
15404
|
revealSelectedTab({ smooth: value !== selected });
|
15376
|
-
}, [value,
|
15405
|
+
}, [value, React92.Children.count(children)]);
|
15377
15406
|
useLayoutEffect2(() => {
|
15378
15407
|
updateCarets();
|
15379
15408
|
containerRef.current?.addEventListener("scroll", updateCarets);
|
@@ -15435,12 +15464,12 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15435
15464
|
const handleSelected = (key) => {
|
15436
15465
|
(onChange ?? setSelected)(key);
|
15437
15466
|
};
|
15438
|
-
|
15467
|
+
React92.Children.forEach(children, (c) => {
|
15439
15468
|
if (c && !isTabComponent(c)) {
|
15440
15469
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
15441
15470
|
}
|
15442
15471
|
});
|
15443
|
-
return /* @__PURE__ */
|
15472
|
+
return /* @__PURE__ */ React92.createElement("div", { ref: parentRef, className: classNames("Aquarium-Tabs", tw("h-full"), className) }, /* @__PURE__ */ React92.createElement("div", { className: tw("relative flex items-center border-b-2 border-default") }, /* @__PURE__ */ React92.createElement("div", { ref: containerRef, className: tw("overflow-y-auto scrollbar-hide mb-[-2px] h-auto") }, /* @__PURE__ */ React92.createElement(
|
15444
15473
|
"div",
|
15445
15474
|
{
|
15446
15475
|
ref: tabsRef,
|
@@ -15448,9 +15477,9 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15448
15477
|
"aria-label": "tabs",
|
15449
15478
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
15450
15479
|
},
|
15451
|
-
|
15480
|
+
React92.Children.map(
|
15452
15481
|
children,
|
15453
|
-
(tab, index) => tab ? /* @__PURE__ */
|
15482
|
+
(tab, index) => tab ? /* @__PURE__ */ React92.createElement(
|
15454
15483
|
TabItemComponent,
|
15455
15484
|
{
|
15456
15485
|
key: tab.props.value,
|
@@ -15462,26 +15491,26 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15462
15491
|
}
|
15463
15492
|
) : void 0
|
15464
15493
|
)
|
15465
|
-
)), leftCaret && /* @__PURE__ */
|
15494
|
+
)), leftCaret && /* @__PURE__ */ React92.createElement("div", { className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4") }, /* @__PURE__ */ React92.createElement(
|
15466
15495
|
"div",
|
15467
15496
|
{
|
15468
15497
|
onClick: () => handleScrollToNext("left"),
|
15469
15498
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15470
15499
|
},
|
15471
|
-
/* @__PURE__ */
|
15472
|
-
)), rightCaret && /* @__PURE__ */
|
15500
|
+
/* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_chevronLeft5.default })
|
15501
|
+
)), rightCaret && /* @__PURE__ */ React92.createElement(
|
15473
15502
|
"div",
|
15474
15503
|
{
|
15475
15504
|
onClick: () => handleScrollToNext("right"),
|
15476
15505
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
15477
15506
|
},
|
15478
|
-
/* @__PURE__ */
|
15507
|
+
/* @__PURE__ */ React92.createElement(
|
15479
15508
|
"div",
|
15480
15509
|
{
|
15481
15510
|
onClick: () => handleScrollToNext("right"),
|
15482
15511
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15483
15512
|
},
|
15484
|
-
/* @__PURE__ */
|
15513
|
+
/* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_chevronRight5.default })
|
15485
15514
|
)
|
15486
15515
|
)), renderChildren(children, selected, props));
|
15487
15516
|
};
|
@@ -15489,7 +15518,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15489
15518
|
Tabs2.Tab = TabComponent;
|
15490
15519
|
return Tabs2;
|
15491
15520
|
};
|
15492
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
15521
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React92.createElement(TabContainer, null, children.find(
|
15493
15522
|
(node, index) => node?.props.value === selected || index === selected
|
15494
15523
|
)));
|
15495
15524
|
|
@@ -15517,7 +15546,7 @@ var Drawer = ({
|
|
15517
15546
|
secondaryActions,
|
15518
15547
|
closeOnEsc = true
|
15519
15548
|
}) => {
|
15520
|
-
const [hidden, setHidden] =
|
15549
|
+
const [hidden, setHidden] = React93.useState(!open);
|
15521
15550
|
if (open && hidden) {
|
15522
15551
|
setHidden(!open);
|
15523
15552
|
}
|
@@ -15540,10 +15569,10 @@ var Drawer = ({
|
|
15540
15569
|
}
|
15541
15570
|
const dialogSize = size === "lg" ? "full" : size;
|
15542
15571
|
const styles = modalStyles({ kind: "drawer", size: dialogSize });
|
15543
|
-
const childElements =
|
15572
|
+
const childElements = React93.Children.toArray(children).filter(React93.isValidElement);
|
15544
15573
|
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
15545
15574
|
const hasTabs = isComponentType(onlyChild, Tabs);
|
15546
|
-
return /* @__PURE__ */
|
15575
|
+
return /* @__PURE__ */ React93.createElement(
|
15547
15576
|
AriaModalOverlay,
|
15548
15577
|
{
|
15549
15578
|
isOpen: !hidden,
|
@@ -15552,60 +15581,60 @@ var Drawer = ({
|
|
15552
15581
|
isKeyboardDismissDisabled: !closeOnEsc,
|
15553
15582
|
className: styles.overlay({ className: "Aquarium-Drawer" })
|
15554
15583
|
},
|
15555
|
-
/* @__PURE__ */
|
15556
|
-
/* @__PURE__ */
|
15584
|
+
/* @__PURE__ */ React93.createElement(AnimatedBackDrop, { style: { opacity } }),
|
15585
|
+
/* @__PURE__ */ React93.createElement(AriaModal, null, /* @__PURE__ */ React93.createElement(AnimatedDialog, { kind: "drawer", "aria-modal": "true", size: dialogSize, style: { position: "fixed", right } }, /* @__PURE__ */ React93.createElement(AriaDialog2, { className: "flex flex-col grow overflow-y-auto" }, ({ close }) => /* @__PURE__ */ React93.createElement(React93.Fragment, null, /* @__PURE__ */ React93.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React93.createElement(Button2.Icon, { "aria-label": "Close", icon: import_cross6.default, onClick: close })), /* @__PURE__ */ React93.createElement(Modal.Header, { className: tw({ "pb-3": hasTabs }) }, /* @__PURE__ */ React93.createElement(ModalTitle, { kind: "drawer" }, title)), hasTabs ? /* @__PURE__ */ React93.createElement(
|
15557
15586
|
DrawerTabs,
|
15558
15587
|
{
|
15559
15588
|
...onlyChild.props,
|
15560
15589
|
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
15561
15590
|
}
|
15562
|
-
) : /* @__PURE__ */
|
15591
|
+
) : /* @__PURE__ */ React93.createElement(Modal.Body, { tabIndex: 0, noFooter: !(secondaryActions ?? primaryAction) }, children), (secondaryActions ?? primaryAction) && /* @__PURE__ */ React93.createElement(Modal.Footer, null, /* @__PURE__ */ React93.createElement(Modal.Actions, { className: size === "sm" ? tw("flex-col") : void 0 }, size !== "sm" && menu && /* @__PURE__ */ React93.createElement(Box.Flex, { alignItems: "center" }, /* @__PURE__ */ React93.createElement(DropdownMenu2, { onAction: (action) => onAction(action), onOpenChange: onMenuOpenChange }, /* @__PURE__ */ React93.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React93.createElement(Button2.Icon, { "aria-label": menuAriaLabel ?? "Context menu", icon: import_more4.default })), menu)), secondaryActions && castArray3(secondaryActions).filter(Boolean).map(({ text, ...action }) => /* @__PURE__ */ React93.createElement(Button2.Secondary, { key: text, ...action }, text)), primaryAction && /* @__PURE__ */ React93.createElement(Button2.Primary, { key: primaryAction.text, ...omit11(primaryAction, "text") }, primaryAction.text)))))))
|
15563
15592
|
);
|
15564
15593
|
};
|
15565
|
-
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */
|
15594
|
+
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */ React93.createElement(Modal.Body, { className: tw("h-full") }, /* @__PURE__ */ React93.createElement(TabContainer, null, children.find(
|
15566
15595
|
(node, index) => node?.props.value === selected || index === selected
|
15567
15596
|
))));
|
15568
15597
|
|
15569
15598
|
// src/molecules/Dropdown/Dropdown.tsx
|
15570
|
-
import
|
15599
|
+
import React95 from "react";
|
15571
15600
|
import { OverlayTriggerStateContext as OverlayTriggerStateContext2 } from "react-aria-components";
|
15572
15601
|
|
15573
15602
|
// src/molecules/Popover/Popover.tsx
|
15574
|
-
import
|
15603
|
+
import React94, { createContext as createContext5 } from "react";
|
15575
15604
|
import { DialogTrigger, OverlayTriggerStateContext } from "react-aria-components";
|
15576
|
-
import { mergeProps as
|
15605
|
+
import { mergeProps as mergeProps5 } from "@react-aria/utils";
|
15577
15606
|
var PopoverPropsContext = createContext5({});
|
15578
|
-
var
|
15607
|
+
var Popover2 = ({ children, onOpenChange: _onOpenChange, onClose, onOpen, ...props }) => {
|
15579
15608
|
const onOpenChange = (isOpen) => {
|
15580
15609
|
_onOpenChange?.(isOpen);
|
15581
15610
|
isOpen ? onOpen?.() : onClose?.();
|
15582
15611
|
};
|
15583
|
-
return /* @__PURE__ */
|
15612
|
+
return /* @__PURE__ */ React94.createElement(PopoverPropsContext.Provider, { value: props }, /* @__PURE__ */ React94.createElement(DialogTrigger, { ...props, onOpenChange }, children));
|
15584
15613
|
};
|
15585
|
-
|
15614
|
+
Popover2.displayName = "Popover";
|
15586
15615
|
var Trigger = ({ children }) => {
|
15587
|
-
return /* @__PURE__ */
|
15616
|
+
return /* @__PURE__ */ React94.createElement(Pressable, { "aria-haspopup": "true" }, children);
|
15588
15617
|
};
|
15589
15618
|
Trigger.displayName = "Popover.Trigger";
|
15590
|
-
|
15619
|
+
Popover2.Trigger = Trigger;
|
15591
15620
|
var Panel = ({ className, children }) => {
|
15592
|
-
const { offset = 0, onOpenChange, ...props } =
|
15593
|
-
return /* @__PURE__ */
|
15621
|
+
const { offset = 0, onOpenChange, ...props } = React94.useContext(PopoverPropsContext);
|
15622
|
+
return /* @__PURE__ */ React94.createElement(Popover, { ...props, className, offset }, /* @__PURE__ */ React94.createElement(Dialog, null, children));
|
15594
15623
|
};
|
15595
15624
|
Panel.displayName = "Popover.Panel";
|
15596
|
-
|
15625
|
+
Popover2.Panel = Panel;
|
15597
15626
|
var CloseToggle = ({ children }) => {
|
15598
|
-
const ctx =
|
15627
|
+
const ctx = React94.useContext(OverlayTriggerStateContext);
|
15599
15628
|
const onClick = ctx?.close;
|
15600
|
-
const child =
|
15601
|
-
return
|
15629
|
+
const child = React94.Children.only(children);
|
15630
|
+
return React94.cloneElement(child, { ...mergeProps5(child.props, { onClick }) });
|
15602
15631
|
};
|
15603
15632
|
CloseToggle.displayName = "Popover.CloseToggle";
|
15604
|
-
|
15633
|
+
Popover2.CloseToggle = CloseToggle;
|
15605
15634
|
|
15606
15635
|
// src/molecules/Dropdown/Dropdown.tsx
|
15607
15636
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
15608
|
-
return /* @__PURE__ */
|
15637
|
+
return /* @__PURE__ */ React95.createElement(Popover2, { placement }, /* @__PURE__ */ React95.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React95.createElement(Popover2.Panel, { className: "Aquarium-Dropdown" }, content));
|
15609
15638
|
};
|
15610
15639
|
var DropdownMenu3 = ({
|
15611
15640
|
title,
|
@@ -15614,13 +15643,13 @@ var DropdownMenu3 = ({
|
|
15614
15643
|
triggerId,
|
15615
15644
|
setClose = () => void 0
|
15616
15645
|
}) => {
|
15617
|
-
const menuRef =
|
15618
|
-
|
15646
|
+
const menuRef = React95.useRef(null);
|
15647
|
+
React95.useEffect(() => {
|
15619
15648
|
const id = setTimeout(() => (menuRef.current?.children[0]).focus());
|
15620
15649
|
return () => clearTimeout(id);
|
15621
15650
|
}, [menuRef.current]);
|
15622
|
-
return /* @__PURE__ */
|
15623
|
-
return
|
15651
|
+
return /* @__PURE__ */ React95.createElement("div", { style: { minWidth: "250px" }, className: tw("py-3 bg-popover-content") }, !!title && /* @__PURE__ */ React95.createElement("div", { className: tw("px-4 py-4 text-left text-intense typography-default-strong") }, title), /* @__PURE__ */ React95.createElement("ol", { role: "menu", ref: menuRef, id: contentId, "aria-labelledby": triggerId }, React95.Children.map(children, (child) => {
|
15652
|
+
return React95.cloneElement(child, { setClose });
|
15624
15653
|
})));
|
15625
15654
|
};
|
15626
15655
|
var DropdownItem = ({
|
@@ -15633,7 +15662,7 @@ var DropdownItem = ({
|
|
15633
15662
|
setClose = () => void 0,
|
15634
15663
|
...props
|
15635
15664
|
}) => {
|
15636
|
-
const ctx =
|
15665
|
+
const ctx = React95.useContext(OverlayTriggerStateContext2);
|
15637
15666
|
const handleSelect = () => {
|
15638
15667
|
onSelect?.();
|
15639
15668
|
ctx?.close();
|
@@ -15667,8 +15696,8 @@ var DropdownItem = ({
|
|
15667
15696
|
handleSelect();
|
15668
15697
|
}
|
15669
15698
|
};
|
15670
|
-
const itemContent = /* @__PURE__ */
|
15671
|
-
return /* @__PURE__ */
|
15699
|
+
const itemContent = /* @__PURE__ */ React95.createElement("div", { className: tw("py-3 px-4") }, children);
|
15700
|
+
return /* @__PURE__ */ React95.createElement(
|
15672
15701
|
"li",
|
15673
15702
|
{
|
15674
15703
|
role: "menuitem",
|
@@ -15685,14 +15714,14 @@ var DropdownItem = ({
|
|
15685
15714
|
})
|
15686
15715
|
)
|
15687
15716
|
},
|
15688
|
-
tooltip ? /* @__PURE__ */
|
15717
|
+
tooltip ? /* @__PURE__ */ React95.createElement(Tooltip, { content: tooltip, placement: tooltipPlacement, display: "block" }, /* @__PURE__ */ React95.createElement("div", { tabIndex: 0, className: tw("grow") }, itemContent)) : itemContent
|
15689
15718
|
);
|
15690
15719
|
};
|
15691
15720
|
Dropdown.Menu = DropdownMenu3;
|
15692
15721
|
Dropdown.Item = DropdownItem;
|
15693
15722
|
|
15694
15723
|
// src/molecules/EmptyState/EmptyState.tsx
|
15695
|
-
import
|
15724
|
+
import React96 from "react";
|
15696
15725
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
15697
15726
|
EmptyStateLayout2["Vertical"] = "vertical";
|
15698
15727
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -15730,7 +15759,7 @@ var EmptyState = ({
|
|
15730
15759
|
fullHeight = isVerticalLayout(layout) ? true : false
|
15731
15760
|
}) => {
|
15732
15761
|
const template = layoutStyle(layout);
|
15733
|
-
return /* @__PURE__ */
|
15762
|
+
return /* @__PURE__ */ React96.createElement(
|
15734
15763
|
Box,
|
15735
15764
|
{
|
15736
15765
|
className: classNames(
|
@@ -15746,7 +15775,7 @@ var EmptyState = ({
|
|
15746
15775
|
backgroundColor: "transparent",
|
15747
15776
|
borderColor: "default"
|
15748
15777
|
},
|
15749
|
-
/* @__PURE__ */
|
15778
|
+
/* @__PURE__ */ React96.createElement(
|
15750
15779
|
Box.Flex,
|
15751
15780
|
{
|
15752
15781
|
style: { gap: "56px" },
|
@@ -15755,19 +15784,149 @@ var EmptyState = ({
|
|
15755
15784
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
15756
15785
|
height: fullHeight ? "full" : void 0
|
15757
15786
|
},
|
15758
|
-
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */
|
15787
|
+
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */ React96.createElement(
|
15759
15788
|
"img",
|
15760
15789
|
{
|
15761
15790
|
src: Image2,
|
15762
15791
|
alt: imageAlt,
|
15763
15792
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
15764
15793
|
}
|
15765
|
-
) : /* @__PURE__ */
|
15766
|
-
/* @__PURE__ */
|
15794
|
+
) : /* @__PURE__ */ React96.createElement("div", { className: tw("animate-draw") }, /* @__PURE__ */ React96.createElement(Image2, null))),
|
15795
|
+
/* @__PURE__ */ React96.createElement(Box.Flex, { flexDirection: "column", justifyContent: template.justifyContent, alignItems: template.alignItems }, /* @__PURE__ */ React96.createElement(Typography2.Heading, { htmlTag: "h2" }, title), children && /* @__PURE__ */ React96.createElement(Box, { marginTop: "5" }, /* @__PURE__ */ React96.createElement(Typography2.Default, null, children)), (secondaryAction ?? primaryAction) && /* @__PURE__ */ React96.createElement(Box.Flex, { marginTop: "7", gap: "4", justifyContent: "center", alignItems: "center", flexWrap: "wrap" }, primaryAction && renderAction({ kind: "primary", action: primaryAction }), secondaryAction && renderAction({ kind: "secondary", action: secondaryAction })), footer && /* @__PURE__ */ React96.createElement(Box, { marginTop: "5" }, /* @__PURE__ */ React96.createElement(Typography2.Small, { color: "default" }, footer)))
|
15767
15796
|
)
|
15768
15797
|
);
|
15769
15798
|
};
|
15770
15799
|
|
15800
|
+
// src/atoms/Filter/Filter.tsx
|
15801
|
+
import React97 from "react";
|
15802
|
+
import {
|
15803
|
+
Button as AriaButton3,
|
15804
|
+
DatePickerStateContext as AriaDatePickerStateContext,
|
15805
|
+
DateRangePickerStateContext as AriaDateRangePickerStateContext,
|
15806
|
+
Group as AriaGroup
|
15807
|
+
} from "react-aria-components";
|
15808
|
+
import { tv as tv14 } from "tailwind-variants";
|
15809
|
+
var import_cross7 = __toESM(require_cross());
|
15810
|
+
var DATE_FORMAT_OPTIONS = {
|
15811
|
+
locale: "en-GB",
|
15812
|
+
options: { day: "numeric", month: "numeric", year: "numeric" }
|
15813
|
+
};
|
15814
|
+
var filterWrapper = tv14({
|
15815
|
+
base: "rounded-full inline-flex items-center pressed:border-info-default justify-between outline-0 outline-none border border-dashed border-default text-default bg-transparent",
|
15816
|
+
variants: {
|
15817
|
+
isHovered: {
|
15818
|
+
true: "hover:bg-muted"
|
15819
|
+
},
|
15820
|
+
isFocusWithin: {
|
15821
|
+
true: "border-solid border-info-default"
|
15822
|
+
},
|
15823
|
+
isInvalid: {
|
15824
|
+
true: "border-solid border-danger-default"
|
15825
|
+
},
|
15826
|
+
hasValue: {
|
15827
|
+
true: "border-solid"
|
15828
|
+
}
|
15829
|
+
}
|
15830
|
+
});
|
15831
|
+
var FilterTrigger = ({
|
15832
|
+
labelText,
|
15833
|
+
icon,
|
15834
|
+
badge,
|
15835
|
+
onClear,
|
15836
|
+
onClick,
|
15837
|
+
value,
|
15838
|
+
// children,
|
15839
|
+
error: error2 = false,
|
15840
|
+
...props
|
15841
|
+
}) => {
|
15842
|
+
const ariaDatePickerState = React97.useContext(AriaDatePickerStateContext);
|
15843
|
+
const ariaDateRangePickerState = React97.useContext(AriaDateRangePickerStateContext);
|
15844
|
+
const isUsedInsideDatePicker = !!ariaDatePickerState?.value;
|
15845
|
+
const isUsedInsideDateRangePicker = !!ariaDateRangePickerState?.value.start && !!ariaDateRangePickerState.value.end;
|
15846
|
+
const onClearDatePickerRelated = () => {
|
15847
|
+
if (isUsedInsideDatePicker) {
|
15848
|
+
ariaDatePickerState.setValue(null);
|
15849
|
+
} else if (isUsedInsideDateRangePicker) {
|
15850
|
+
ariaDateRangePickerState.setValue(null);
|
15851
|
+
}
|
15852
|
+
};
|
15853
|
+
const hasValue = !!value || isUsedInsideDatePicker || isUsedInsideDateRangePicker;
|
15854
|
+
const showClearButton = !!onClear && !!value || isUsedInsideDatePicker || isUsedInsideDateRangePicker;
|
15855
|
+
return /* @__PURE__ */ React97.createElement(
|
15856
|
+
AriaGroup,
|
15857
|
+
{
|
15858
|
+
...props,
|
15859
|
+
isInvalid: error2,
|
15860
|
+
className: (renderProps) => filterWrapper({ ...renderProps, hasValue: hasValue || !!badge })
|
15861
|
+
},
|
15862
|
+
/* @__PURE__ */ React97.createElement(React97.Fragment, null, /* @__PURE__ */ React97.createElement(
|
15863
|
+
AriaButton3,
|
15864
|
+
{
|
15865
|
+
onPress: () => {
|
15866
|
+
onClick && onClick();
|
15867
|
+
},
|
15868
|
+
className: tw("outline-0 outline-none flex items-center py-3 cursor-pointer", {
|
15869
|
+
"pl-4 pr-[6px]": showClearButton,
|
15870
|
+
// keep padding right the same as padding left of <FilterClearButton>
|
15871
|
+
"px-4": !showClearButton
|
15872
|
+
})
|
15873
|
+
},
|
15874
|
+
/* @__PURE__ */ React97.createElement("div", { className: tw("flex items-center gap-3 divide-x divide-grey-20") }, /* @__PURE__ */ React97.createElement("div", { className: tw("flex items-center gap-3") }, /* @__PURE__ */ React97.createElement("div", { className: tw("flex items-center gap-2") }, /* @__PURE__ */ React97.createElement(InlineIcon, { icon }), /* @__PURE__ */ React97.createElement(Typography2.Small, null, labelText)), badge && /* @__PURE__ */ React97.createElement(Typography2, { color: "primary-active", className: tw("flex items-center") }, /* @__PURE__ */ React97.createElement(Badge, { dense: true, value: badge }))), hasValue && /* @__PURE__ */ React97.createElement("div", { className: "pl-3" }, /* @__PURE__ */ React97.createElement(
|
15875
|
+
Typography2.Small,
|
15876
|
+
{
|
15877
|
+
className: tw("truncate max-w-[233px]"),
|
15878
|
+
color: error2 ? "danger-intense" : "primary-active"
|
15879
|
+
},
|
15880
|
+
value,
|
15881
|
+
isUsedInsideDatePicker && /* @__PURE__ */ React97.createElement(DateDisplay, { state: ariaDatePickerState }),
|
15882
|
+
isUsedInsideDateRangePicker && /* @__PURE__ */ React97.createElement(DateDisplay, { state: ariaDateRangePickerState })
|
15883
|
+
)))
|
15884
|
+
), showClearButton && /* @__PURE__ */ React97.createElement(
|
15885
|
+
FilterClearButton,
|
15886
|
+
{
|
15887
|
+
onClear: () => {
|
15888
|
+
onClearDatePickerRelated();
|
15889
|
+
onClear?.();
|
15890
|
+
}
|
15891
|
+
}
|
15892
|
+
))
|
15893
|
+
);
|
15894
|
+
};
|
15895
|
+
var isDateRangePickerState = (state) => {
|
15896
|
+
return "value" in state && state.value !== null && "start" in state.value;
|
15897
|
+
};
|
15898
|
+
var DateDisplay = ({ state }) => {
|
15899
|
+
const primary = isDateRangePickerState(state) ? state.formatValue(DATE_FORMAT_OPTIONS.locale, DATE_FORMAT_OPTIONS.options)?.start : state.formatValue(DATE_FORMAT_OPTIONS.locale, DATE_FORMAT_OPTIONS.options);
|
15900
|
+
const secondary = isDateRangePickerState(state) ? state.formatValue(DATE_FORMAT_OPTIONS.locale, DATE_FORMAT_OPTIONS.options)?.end : void 0;
|
15901
|
+
return /* @__PURE__ */ React97.createElement(Box.Flex, { gap: "2" }, /* @__PURE__ */ React97.createElement("span", null, primary), secondary && /* @__PURE__ */ React97.createElement(React97.Fragment, null, /* @__PURE__ */ React97.createElement("span", { "aria-hidden": true, className: tw("text-muted") }, "-"), /* @__PURE__ */ React97.createElement("span", null, secondary)));
|
15902
|
+
};
|
15903
|
+
var FilterClearButton = ({ onClear }) => (
|
15904
|
+
// using a native HTML <button> here instead of <Button slot={null} /> from react-aria because react-aria <DialogTrigger> doesn't support it as a child. If we used <Button slot={null}>, the popover would open simultaneously with the clear callback, which is unintended behavior. Interestingly, this issue doesn't occur in react-aria's <DatePicker>, but for consistency and to avoid conflicts here, we're sticking with a plain button.
|
15905
|
+
/* @__PURE__ */ React97.createElement(
|
15906
|
+
"button",
|
15907
|
+
{
|
15908
|
+
"aria-label": "Clear filter",
|
15909
|
+
onClick: (e) => {
|
15910
|
+
e.preventDefault();
|
15911
|
+
e.stopPropagation();
|
15912
|
+
const previousButton = e.currentTarget.previousElementSibling;
|
15913
|
+
if (previousButton instanceof HTMLElement) {
|
15914
|
+
previousButton.focus();
|
15915
|
+
}
|
15916
|
+
onClear();
|
15917
|
+
},
|
15918
|
+
className: tw(
|
15919
|
+
"py-[10px] pl-[6px] pr-4 inline-flex items-center hover:bg-default focus:bg-default outline-0 outline-none rounded-r-full"
|
15920
|
+
// keep padding left the same as padding right of its button sibling.
|
15921
|
+
)
|
15922
|
+
},
|
15923
|
+
/* @__PURE__ */ React97.createElement(InlineIcon, { icon: import_cross7.default })
|
15924
|
+
)
|
15925
|
+
);
|
15926
|
+
var Filter = () => null;
|
15927
|
+
FilterTrigger.displayName = "Filter.Trigger";
|
15928
|
+
Filter.Trigger = FilterTrigger;
|
15929
|
+
|
15771
15930
|
// src/molecules/LineClamp/LineClamp.tsx
|
15772
15931
|
import React98 from "react";
|
15773
15932
|
var LineClamp2 = ({
|
@@ -15839,9 +15998,9 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
15839
15998
|
|
15840
15999
|
// src/molecules/Modal/Modal.tsx
|
15841
16000
|
import React101 from "react";
|
15842
|
-
import { Dialog as
|
16001
|
+
import { Dialog as AriaDialog3, Modal as AriaModal2, ModalOverlay as AriaModalOverlay2 } from "react-aria-components";
|
15843
16002
|
import { castArray as castArray4, omit as omit12 } from "lodash-es";
|
15844
|
-
var
|
16003
|
+
var import_cross8 = __toESM(require_cross());
|
15845
16004
|
var Modal2 = ({
|
15846
16005
|
open,
|
15847
16006
|
onClose,
|
@@ -15869,7 +16028,7 @@ var Modal2 = ({
|
|
15869
16028
|
className: styles.overlay({ className: "Aquarium-Modal" })
|
15870
16029
|
},
|
15871
16030
|
size !== "screen" && /* @__PURE__ */ React101.createElement(Modal.BackDrop, { className: styles.backdrop() }),
|
15872
|
-
/* @__PURE__ */ React101.createElement(AriaModal2, { className: styles.dialog() }, /* @__PURE__ */ React101.createElement(
|
16031
|
+
/* @__PURE__ */ React101.createElement(AriaModal2, { className: styles.dialog() }, /* @__PURE__ */ React101.createElement(AriaDialog3, { className: "flex flex-col grow overflow-y-auto" }, ({ close }) => /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React101.createElement(Button2.Icon, { "aria-label": "Close", icon: import_cross8.default, onClick: close })), headerImage !== void 0 && /* @__PURE__ */ React101.createElement(Modal.HeaderImage, { backgroundImage: headerImage }), /* @__PURE__ */ React101.createElement(
|
15873
16032
|
Modal.Header,
|
15874
16033
|
{
|
15875
16034
|
kind: "dialog",
|
@@ -16582,7 +16741,7 @@ import { castArray as castArray6 } from "lodash-es";
|
|
16582
16741
|
|
16583
16742
|
// src/atoms/PageHeader/PageHeader.tsx
|
16584
16743
|
import React108 from "react";
|
16585
|
-
var PageHeader = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-row gap-4 pb-6"), className), ...rest }, children);
|
16744
|
+
var PageHeader = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-row flex-wrap gap-4 pb-6"), className), ...rest }, children);
|
16586
16745
|
PageHeader.Container = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col grow gap-0"), className), ...rest }, children);
|
16587
16746
|
PageHeader.TitleContainer = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col justify-center gap-2"), className), ...rest }, children);
|
16588
16747
|
PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__ */ React108.createElement(
|
@@ -16642,9 +16801,9 @@ PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
|
16642
16801
|
|
16643
16802
|
// src/molecules/Popover/PopoverContext.tsx
|
16644
16803
|
import { createContext as createContext6, useContext as useContext8 } from "react";
|
16645
|
-
var
|
16804
|
+
var PopoverContext = createContext6(null);
|
16646
16805
|
var usePopoverContext = () => {
|
16647
|
-
const ctx = useContext8(
|
16806
|
+
const ctx = useContext8(PopoverContext);
|
16648
16807
|
if (ctx === null) {
|
16649
16808
|
throw new Error("PopoverContext was used outside of provider.");
|
16650
16809
|
}
|
@@ -16676,12 +16835,12 @@ var PopoverDialogPropsContext = createContext7({
|
|
16676
16835
|
primaryAction: { text: "", onClick: noop3 }
|
16677
16836
|
});
|
16678
16837
|
var PopoverDialog2 = ({ placement, open, children, ...props }) => {
|
16679
|
-
return /* @__PURE__ */ React111.createElement(
|
16838
|
+
return /* @__PURE__ */ React111.createElement(Popover2, { placement }, /* @__PURE__ */ React111.createElement(PopoverDialogPropsContext.Provider, { value: props }, children));
|
16680
16839
|
};
|
16681
|
-
PopoverDialog2.Trigger =
|
16840
|
+
PopoverDialog2.Trigger = Popover2.Trigger;
|
16682
16841
|
var Prompt = ({ children }) => {
|
16683
16842
|
const { title, primaryAction, secondaryAction } = React111.useContext(PopoverDialogPropsContext);
|
16684
|
-
return /* @__PURE__ */ React111.createElement(
|
16843
|
+
return /* @__PURE__ */ React111.createElement(Popover2.Panel, { className: "Aquarium-PopoverDialog max-w-[300px]" }, /* @__PURE__ */ React111.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React111.createElement(PopoverDialog.Title, null, title)), /* @__PURE__ */ React111.createElement(PopoverDialog.Body, null, children), /* @__PURE__ */ React111.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React111.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React111.createElement(Popover2.CloseToggle, null, /* @__PURE__ */ React111.createElement(Button2, { key: secondaryAction.text, kind: "secondary", dense: true, ...omit16(secondaryAction, "text") }, secondaryAction.text)), /* @__PURE__ */ React111.createElement(Popover2.CloseToggle, null, /* @__PURE__ */ React111.createElement(Button2, { key: primaryAction.text, kind: "ghost", dense: true, ...omit16(primaryAction, "text") }, primaryAction.text)))));
|
16685
16844
|
};
|
16686
16845
|
Prompt.displayName = "PopoverDialog.Prompt";
|
16687
16846
|
PopoverDialog2.Prompt = Prompt;
|
@@ -17415,7 +17574,7 @@ Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
|
17415
17574
|
|
17416
17575
|
// src/molecules/TimePicker/TimePicker.tsx
|
17417
17576
|
import React128 from "react";
|
17418
|
-
var TimePicker = (props) => /* @__PURE__ */ React128.createElement(
|
17577
|
+
var TimePicker = (props) => /* @__PURE__ */ React128.createElement(TimeField2, { ...props });
|
17419
17578
|
|
17420
17579
|
// src/utils/table/sortByColumn.ts
|
17421
17580
|
var sortByColumn = (items, column, sortState) => {
|
@@ -17697,16 +17856,16 @@ export {
|
|
17697
17856
|
ControlLabel,
|
17698
17857
|
DataList2 as DataList,
|
17699
17858
|
DataTable,
|
17700
|
-
DatePicker,
|
17859
|
+
DatePicker2 as DatePicker,
|
17701
17860
|
DatePickerBase,
|
17702
|
-
DateRangePicker,
|
17861
|
+
DateRangePicker2 as DateRangePicker,
|
17703
17862
|
DateRangePickerBase,
|
17704
17863
|
DateTimePicker,
|
17705
17864
|
DateTimePickerBase,
|
17706
17865
|
DateTimeRangePicker,
|
17707
17866
|
DateTimeRangePickerBase,
|
17708
17867
|
DesignSystemContext,
|
17709
|
-
|
17868
|
+
Dialog2 as Dialog,
|
17710
17869
|
Divider2 as Divider,
|
17711
17870
|
Drawer,
|
17712
17871
|
Dropdown,
|
@@ -17715,6 +17874,7 @@ export {
|
|
17715
17874
|
EmptyState,
|
17716
17875
|
EmptyStateLayout,
|
17717
17876
|
FileInput,
|
17877
|
+
Filter,
|
17718
17878
|
FormControl,
|
17719
17879
|
Grid,
|
17720
17880
|
HelperText,
|
@@ -17743,7 +17903,7 @@ export {
|
|
17743
17903
|
Option,
|
17744
17904
|
PageHeader2 as PageHeader,
|
17745
17905
|
Pagination,
|
17746
|
-
|
17906
|
+
Popover2 as Popover,
|
17747
17907
|
PopoverDialog2 as PopoverDialog,
|
17748
17908
|
Portal,
|
17749
17909
|
PositionerPlacement,
|