@aivenio/aquarium 4.1.2 → 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/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 +574 -422
- package/dist/system.mjs +583 -428
- 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
|
};
|
@@ -12120,17 +12132,27 @@ DataTable.Skeleton = DataListSkeleton;
|
|
12120
12132
|
// src/molecules/DatePicker/DatePicker.tsx
|
12121
12133
|
import React86 from "react";
|
12122
12134
|
import {
|
12123
|
-
DatePicker as AriaDatePicker,
|
12124
12135
|
DatePickerStateContext,
|
12125
12136
|
Text
|
12126
12137
|
} from "react-aria-components";
|
12127
12138
|
import { useLabel as useLabel2 } from "@react-aria/label";
|
12128
|
-
import { useId as useId10 } from "@react-aria/utils";
|
12139
|
+
import { mergeProps as mergeProps3, useId as useId10 } from "@react-aria/utils";
|
12129
12140
|
import { omit as omit8 } from "lodash-es";
|
12130
12141
|
|
12131
|
-
// 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
|
12132
12149
|
import React80 from "react";
|
12133
|
-
import {
|
12150
|
+
import {
|
12151
|
+
DateField as AriaDateField,
|
12152
|
+
DateInput as AriaDateInput,
|
12153
|
+
DateSegment as AriaDateSegment,
|
12154
|
+
TimeField as AriaTimeField
|
12155
|
+
} from "react-aria-components";
|
12134
12156
|
import { tv as tv8 } from "tailwind-variants";
|
12135
12157
|
var segmentStyles = tv8({
|
12136
12158
|
base: "inline p-0.5 rounded outline outline-0 caret-transparent text-default",
|
@@ -12146,87 +12168,82 @@ var segmentStyles = tv8({
|
|
12146
12168
|
}
|
12147
12169
|
}
|
12148
12170
|
});
|
12149
|
-
|
12150
|
-
return /* @__PURE__ */ React80.createElement(AriaDateInput, { className: (renderProps) => fieldGroup({ ...renderProps, class: "block" }), ...props }, (segment) => /* @__PURE__ */ React80.createElement(
|
12151
|
-
}
|
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
|
+
};
|
12152
12177
|
|
12153
12178
|
// src/molecules/TimeField/TimeField.tsx
|
12154
|
-
|
12155
|
-
import {
|
12156
|
-
TimeField as AriaTimeField
|
12157
|
-
} from "react-aria-components";
|
12158
|
-
import { useLabel } from "@react-aria/label";
|
12159
|
-
import { useId as useId9 } from "@react-aria/utils";
|
12160
|
-
import { omit as omit7 } from "lodash-es";
|
12161
|
-
function TimeFieldBase({ disabled, valid, ...props }) {
|
12162
|
-
return /* @__PURE__ */ React81.createElement(AriaTimeField, { ...props, isInvalid: valid === false, isDisabled: disabled }, /* @__PURE__ */ React81.createElement(DateInput, null));
|
12163
|
-
}
|
12164
|
-
function TimeField(props) {
|
12179
|
+
function TimeField2(props) {
|
12165
12180
|
const { labelProps, fieldProps } = useLabel({ label: props.labelText });
|
12166
12181
|
const errorMessageId = useId9();
|
12167
12182
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
12168
12183
|
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12169
12184
|
const baseProps = omit7(props, Object.keys(labelControlProps));
|
12170
|
-
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 }));
|
12171
12186
|
}
|
12172
12187
|
|
12173
|
-
// 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
|
12174
12204
|
import React82 from "react";
|
12175
12205
|
import { Button as AriaButton2, composeRenderProps as composeRenderProps3 } from "react-aria-components";
|
12206
|
+
import { tv as tv9 } from "tailwind-variants";
|
12176
12207
|
var import_calendar2 = __toESM(require_calendar());
|
12177
12208
|
var import_smallCross3 = __toESM(require_smallCross());
|
12178
|
-
|
12179
|
-
|
12180
|
-
|
12181
|
-
{
|
12182
|
-
|
12183
|
-
|
12184
|
-
props.className,
|
12185
|
-
(className, renderProps) => buttonClasses({ ...renderProps, className, dense: true, kind: "icon" })
|
12186
|
-
)
|
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: ""
|
12187
12215
|
}
|
12188
|
-
|
12189
|
-
}
|
12190
|
-
var
|
12191
|
-
|
12192
|
-
hideWhenParentIsNotHoveredOrFocused = true,
|
12216
|
+
}
|
12217
|
+
});
|
12218
|
+
var DatePickerButton = ({
|
12219
|
+
hideWhenParentIsNotHoveredOrFocused = false,
|
12193
12220
|
...props
|
12194
12221
|
}) => {
|
12195
12222
|
return /* @__PURE__ */ React82.createElement(
|
12196
|
-
|
12223
|
+
AriaButton2,
|
12197
12224
|
{
|
12198
12225
|
...props,
|
12199
|
-
className:
|
12200
|
-
className,
|
12201
|
-
|
12202
|
-
|
12226
|
+
className: composeRenderProps3(
|
12227
|
+
props.className,
|
12228
|
+
(className, renderProps) => buttonClasses({
|
12229
|
+
...renderProps,
|
12230
|
+
className: datePickerButton({ hideWhenParentIsNotHoveredOrFocused, className }),
|
12231
|
+
dense: true,
|
12232
|
+
kind: "icon"
|
12203
12233
|
})
|
12204
12234
|
)
|
12205
12235
|
}
|
12206
12236
|
);
|
12207
12237
|
};
|
12208
|
-
|
12209
|
-
return /* @__PURE__ */ React82.createElement(
|
12210
|
-
}
|
12211
|
-
|
12212
|
-
return /* @__PURE__ */ React82.createElement(
|
12213
|
-
}
|
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
|
+
};
|
12214
12244
|
|
12215
|
-
// src/
|
12216
|
-
|
12217
|
-
import {
|
12218
|
-
Calendar as AriaCalendar,
|
12219
|
-
CalendarCell,
|
12220
|
-
CalendarGrid,
|
12221
|
-
CalendarGridBody,
|
12222
|
-
CalendarGridHeader as AriaCalendarGridHeader,
|
12223
|
-
CalendarHeaderCell,
|
12224
|
-
Heading
|
12225
|
-
} from "react-aria-components";
|
12226
|
-
import { tv as tv9 } from "tailwind-variants";
|
12227
|
-
var import_chevronLeft4 = __toESM(require_chevronLeft());
|
12228
|
-
var import_chevronRight4 = __toESM(require_chevronRight());
|
12229
|
-
var cellStyles = tv9({
|
12245
|
+
// src/atoms/DatePicker/Calendar.tsx
|
12246
|
+
var cellStyles = tv10({
|
12230
12247
|
extend: focusRing,
|
12231
12248
|
base: "w-8 h-8 typography-small cursor-default rounded-md flex items-center justify-center outside-month:hidden",
|
12232
12249
|
variants: {
|
@@ -12246,285 +12263,51 @@ var Calendar = (props) => {
|
|
12246
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 }))));
|
12247
12264
|
};
|
12248
12265
|
var CalendarHeader = () => {
|
12249
|
-
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 })));
|
12250
12267
|
};
|
12251
12268
|
var CalendarGridHeader = () => {
|
12252
12269
|
return /* @__PURE__ */ React83.createElement(AriaCalendarGridHeader, null, (day) => /* @__PURE__ */ React83.createElement(CalendarHeaderCell, { className: "text-xs text-inactive typography-caption" }, day));
|
12253
12270
|
};
|
12254
12271
|
|
12255
|
-
// src/
|
12272
|
+
// src/atoms/DatePicker/DatePicker.tsx
|
12256
12273
|
import React84 from "react";
|
12257
|
-
import { Dialog as AriaDialog } from "react-aria-components";
|
12258
|
-
function Dialog(props) {
|
12259
|
-
return /* @__PURE__ */ React84.createElement(
|
12260
|
-
AriaDialog,
|
12261
|
-
{
|
12262
|
-
...props,
|
12263
|
-
className: classNames(
|
12264
|
-
props.className,
|
12265
|
-
tw(
|
12266
|
-
"outline outline-0 p-5 [[data-placement]>&]:px-5 [[data-placement]>&]:py-6 max-h-[inherit] overflow-auto relative"
|
12267
|
-
)
|
12268
|
-
)
|
12269
|
-
}
|
12270
|
-
);
|
12271
|
-
}
|
12272
|
-
|
12273
|
-
// src/molecules/DatePicker/Popover.tsx
|
12274
|
-
import React85 from "react";
|
12275
12274
|
import {
|
12276
|
-
|
12277
|
-
|
12278
|
-
PopoverContext,
|
12279
|
-
useSlottedContext
|
12275
|
+
DatePicker as AriaDatePicker,
|
12276
|
+
DateRangePicker as AriaDateRangePicker
|
12280
12277
|
} from "react-aria-components";
|
12281
|
-
|
12282
|
-
|
12283
|
-
|
12284
|
-
|
12285
|
-
|
12286
|
-
return /* @__PURE__ */ React85.createElement(
|
12287
|
-
AriaPopover2,
|
12288
|
-
{
|
12289
|
-
offset,
|
12290
|
-
...props,
|
12291
|
-
className: tw(
|
12292
|
-
"rounded-sm shadow-16dp bg-popover-content mt-1 overflow-y-auto flex flex-col border border-default outline-none"
|
12293
|
-
)
|
12294
|
-
},
|
12295
|
-
showArrow && /* @__PURE__ */ React85.createElement(OverlayArrow2, { className: "group" }, /* @__PURE__ */ React85.createElement(
|
12296
|
-
"svg",
|
12297
|
-
{
|
12298
|
-
width: 12,
|
12299
|
-
height: 12,
|
12300
|
-
viewBox: "0 0 12 12",
|
12301
|
-
className: "block fill-white stroke-1 stroke-black group-placement-bottom:rotate-180 group-placement-left:-rotate-90 group-placement-right:rotate-90"
|
12302
|
-
},
|
12303
|
-
/* @__PURE__ */ React85.createElement("path", { d: "M0 0 L6 6 L12 0" })
|
12304
|
-
)),
|
12305
|
-
children
|
12306
|
-
);
|
12307
|
-
};
|
12308
|
-
|
12309
|
-
// src/molecules/DatePicker/DatePicker.tsx
|
12310
|
-
function DatePickerClearButton() {
|
12311
|
-
const state = React86.useContext(DatePickerStateContext);
|
12312
|
-
if (!state) {
|
12313
|
-
throw new Error("DatePickerStateContext is missing a provider");
|
12314
|
-
}
|
12315
|
-
if (!state.value) {
|
12316
|
-
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]"
|
12317
12283
|
}
|
12318
|
-
|
12319
|
-
|
12320
|
-
{
|
12321
|
-
onPress: () => {
|
12322
|
-
state.setValue(null);
|
12323
|
-
}
|
12324
|
-
}
|
12325
|
-
);
|
12326
|
-
}
|
12327
|
-
var createDatePickerBase = (variant) => ({
|
12328
|
-
disabled,
|
12329
|
-
valid,
|
12330
|
-
granularity,
|
12331
|
-
shouldCloseOnSelect,
|
12332
|
-
errorMessage,
|
12333
|
-
clearSelectionEnabled = true,
|
12334
|
-
...props
|
12335
|
-
}) => {
|
12284
|
+
});
|
12285
|
+
var DatePicker = ({ variant, ...props }) => {
|
12336
12286
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12337
|
-
return /* @__PURE__ */
|
12287
|
+
return /* @__PURE__ */ React84.createElement(
|
12338
12288
|
AriaDatePicker,
|
12339
12289
|
{
|
12340
12290
|
...props,
|
12341
|
-
shouldCloseOnSelect: shouldCloseOnSelect ?? variant === "date",
|
12342
|
-
|
12343
|
-
isInvalid: valid === false,
|
12344
|
-
granularity: granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12345
|
-
},
|
12346
|
-
/* @__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))),
|
12347
|
-
/* @__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))))
|
12348
|
-
);
|
12349
|
-
};
|
12350
|
-
var DatePickerBase = createDatePickerBase("date");
|
12351
|
-
var DateTimePickerBase = createDatePickerBase("datetime");
|
12352
|
-
var PickerTimeField = ({ granularity }) => {
|
12353
|
-
const state = React86.useContext(DatePickerStateContext);
|
12354
|
-
if (!state) {
|
12355
|
-
throw new Error("DatePickerStateContext is missing a provider");
|
12356
|
-
}
|
12357
|
-
return /* @__PURE__ */ React86.createElement(
|
12358
|
-
TimeField,
|
12359
|
-
{
|
12360
|
-
labelText: "Time",
|
12361
|
-
granularity: granularity !== "day" ? granularity : void 0,
|
12362
|
-
value: state.timeValue,
|
12363
|
-
onChange: (value) => value && state.setTimeValue(value),
|
12364
|
-
reserveSpaceForError: false
|
12291
|
+
shouldCloseOnSelect: props.shouldCloseOnSelect ?? variant === "date",
|
12292
|
+
granularity: props.granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12365
12293
|
}
|
12366
12294
|
);
|
12367
12295
|
};
|
12368
|
-
var
|
12369
|
-
const { labelProps, fieldProps } = useLabel2({ label: props.labelText });
|
12370
|
-
const errorMessageId = useId10();
|
12371
|
-
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
12372
|
-
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12373
|
-
const baseProps = omit8(props, Object.keys(labelControlProps));
|
12374
|
-
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
12375
|
-
return /* @__PURE__ */ React86.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React86.createElement(DatePickerBase, { ...allProps }) : /* @__PURE__ */ React86.createElement(DateTimePickerBase, { ...allProps }));
|
12376
|
-
};
|
12377
|
-
var DatePicker = createDatePicker("date");
|
12378
|
-
var DateTimePicker = createDatePicker("datetime");
|
12379
|
-
|
12380
|
-
// src/molecules/DatePicker/DateRangePicker.tsx
|
12381
|
-
import React88 from "react";
|
12382
|
-
import {
|
12383
|
-
DateRangePicker as AriaDateRangePicker,
|
12384
|
-
DateRangePickerStateContext,
|
12385
|
-
Text as Text2
|
12386
|
-
} from "react-aria-components";
|
12387
|
-
import { useLabel as useLabel3 } from "@react-aria/label";
|
12388
|
-
import { useId as useId11 } from "@react-aria/utils";
|
12389
|
-
import { omit as omit9 } from "lodash-es";
|
12390
|
-
|
12391
|
-
// src/molecules/DatePicker/RangeCalendar.tsx
|
12392
|
-
import React87 from "react";
|
12393
|
-
import {
|
12394
|
-
CalendarCell as CalendarCell2,
|
12395
|
-
CalendarGrid as CalendarGrid2,
|
12396
|
-
CalendarGridBody as CalendarGridBody2,
|
12397
|
-
RangeCalendar as AriaRangeCalendar
|
12398
|
-
} from "react-aria-components";
|
12399
|
-
import { tv as tv10 } from "tailwind-variants";
|
12400
|
-
var cell = tv10({
|
12401
|
-
extend: focusRing,
|
12402
|
-
base: "w-full h-full flex items-center justify-center rounded-md text-default",
|
12403
|
-
variants: {
|
12404
|
-
selectionState: {
|
12405
|
-
none: "group-hover:bg-default group-pressed:bg-intense",
|
12406
|
-
middle: [
|
12407
|
-
"text-white",
|
12408
|
-
"group-hover:bg-primary-default",
|
12409
|
-
"group-invalid:group-hover:bg-danger-default",
|
12410
|
-
"group-pressed:bg-primary-intense",
|
12411
|
-
"group-invalid:group-pressed:bg-danger-intense"
|
12412
|
-
],
|
12413
|
-
cap: "text-white bg-primary-default group-invalid:bg-danger-default"
|
12414
|
-
},
|
12415
|
-
isUnavailable: {
|
12416
|
-
true: "text-inactive"
|
12417
|
-
},
|
12418
|
-
isDisabled: {
|
12419
|
-
true: "text-inactive"
|
12420
|
-
}
|
12421
|
-
}
|
12422
|
-
});
|
12423
|
-
function RangeCalendar(props) {
|
12424
|
-
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(
|
12425
|
-
CalendarCell2,
|
12426
|
-
{
|
12427
|
-
date,
|
12428
|
-
className: tw(
|
12429
|
-
"group w-8 h-8 typography-small outline outline-0 cursor-default",
|
12430
|
-
"outside-month:hidden selected:bg-primary-default",
|
12431
|
-
"invalid:selected:bg-danger-default",
|
12432
|
-
"selection-start:rounded-s-md selection-end:rounded-e-md"
|
12433
|
-
)
|
12434
|
-
},
|
12435
|
-
({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */ React87.createElement(
|
12436
|
-
"span",
|
12437
|
-
{
|
12438
|
-
className: cell({
|
12439
|
-
selectionState: isSelected && (isSelectionStart || isSelectionEnd) ? "cap" : isSelected ? "middle" : "none",
|
12440
|
-
...rest
|
12441
|
-
})
|
12442
|
-
},
|
12443
|
-
formattedDate
|
12444
|
-
)
|
12445
|
-
))));
|
12446
|
-
}
|
12447
|
-
|
12448
|
-
// src/molecules/DatePicker/DateRangePicker.tsx
|
12449
|
-
function DateRangePickerClearButton() {
|
12450
|
-
const state = React88.useContext(DateRangePickerStateContext);
|
12451
|
-
if (!state) {
|
12452
|
-
throw new Error("DateRangePickerStateContext is missing a provider");
|
12453
|
-
}
|
12454
|
-
if (!state.value.start && !state.value.end) {
|
12455
|
-
return null;
|
12456
|
-
}
|
12457
|
-
return /* @__PURE__ */ React88.createElement(
|
12458
|
-
ClearInputButton,
|
12459
|
-
{
|
12460
|
-
onPress: () => {
|
12461
|
-
state.setValue(null);
|
12462
|
-
}
|
12463
|
-
}
|
12464
|
-
);
|
12465
|
-
}
|
12466
|
-
var createDateRangePickerBase = (variant) => ({
|
12467
|
-
disabled,
|
12468
|
-
valid,
|
12469
|
-
granularity,
|
12470
|
-
shouldCloseOnSelect,
|
12471
|
-
errorMessage,
|
12472
|
-
clearSelectionEnabled = true,
|
12473
|
-
...props
|
12474
|
-
}) => {
|
12296
|
+
var DateRangePicker = ({ variant, ...props }) => {
|
12475
12297
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12476
|
-
return /* @__PURE__ */
|
12298
|
+
return /* @__PURE__ */ React84.createElement(
|
12477
12299
|
AriaDateRangePicker,
|
12478
12300
|
{
|
12479
12301
|
...props,
|
12480
|
-
shouldCloseOnSelect: shouldCloseOnSelect ?? variant === "date",
|
12481
|
-
|
12482
|
-
isInvalid: valid === false,
|
12483
|
-
granularity: granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0),
|
12484
|
-
className: tw("group flex flex-col gap-1")
|
12485
|
-
},
|
12486
|
-
/* @__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))),
|
12487
|
-
/* @__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))))
|
12488
|
-
);
|
12489
|
-
};
|
12490
|
-
var PickerTimeField2 = ({ granularity, part }) => {
|
12491
|
-
const ctx = React88.useContext(DateRangePickerStateContext);
|
12492
|
-
return /* @__PURE__ */ React88.createElement(
|
12493
|
-
TimeField,
|
12494
|
-
{
|
12495
|
-
labelText: part === "start" ? "Start time" : "End time",
|
12496
|
-
granularity: granularity !== "day" ? granularity : void 0,
|
12497
|
-
value: ctx?.timeRange?.[part] ?? null,
|
12498
|
-
onChange: (value) => ctx?.setTime(part, value),
|
12499
|
-
reserveSpaceForError: false
|
12302
|
+
shouldCloseOnSelect: props.shouldCloseOnSelect ?? variant === "date",
|
12303
|
+
granularity: props.granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12500
12304
|
}
|
12501
12305
|
);
|
12502
12306
|
};
|
12503
|
-
var DateRangePickerBase = createDateRangePickerBase("date");
|
12504
|
-
var DateTimeRangePickerBase = createDateRangePickerBase("datetime");
|
12505
|
-
var createDateRangePicker = (variant) => (props) => {
|
12506
|
-
const { labelProps, fieldProps } = useLabel3({ label: props.labelText });
|
12507
|
-
const errorMessageId = useId11();
|
12508
|
-
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
12509
|
-
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
12510
|
-
const baseProps = omit9(props, Object.keys(labelControlProps));
|
12511
|
-
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
12512
|
-
return /* @__PURE__ */ React88.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React88.createElement(DateRangePickerBase, { ...allProps }) : /* @__PURE__ */ React88.createElement(DateTimeRangePickerBase, { ...allProps }));
|
12513
|
-
};
|
12514
|
-
var DateRangePicker = createDateRangePicker("date");
|
12515
|
-
var DateTimeRangePicker = createDateRangePicker("datetime");
|
12516
|
-
|
12517
|
-
// src/molecules/Dialog/Dialog.tsx
|
12518
|
-
import React91 from "react";
|
12519
|
-
import { useDialog } from "@react-aria/dialog";
|
12520
|
-
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
12521
|
-
import { useId as useId12 } from "@react-aria/utils";
|
12522
|
-
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
12523
|
-
import { omit as omit10 } from "lodash-es";
|
12524
12307
|
|
12525
12308
|
// src/atoms/Dialog/Dialog.tsx
|
12526
|
-
import
|
12527
|
-
import { Dialog as
|
12309
|
+
import React85 from "react";
|
12310
|
+
import { Dialog as AriaDialog } from "react-aria-components";
|
12528
12311
|
|
12529
12312
|
// node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
12530
12313
|
var CLASS_PART_SEPARATOR = "-";
|
@@ -15004,9 +14787,9 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
15004
14787
|
color: "danger-default"
|
15005
14788
|
}
|
15006
14789
|
};
|
15007
|
-
var
|
15008
|
-
return /* @__PURE__ */
|
15009
|
-
|
14790
|
+
var Dialog = (props) => {
|
14791
|
+
return /* @__PURE__ */ React85.createElement(
|
14792
|
+
AriaDialog,
|
15010
14793
|
{
|
15011
14794
|
...props,
|
15012
14795
|
className: twMerge("outline outline-0 max-h-[inherit] overflow-auto relative", props.className)
|
@@ -15014,10 +14797,251 @@ var Dialog2 = (props) => {
|
|
15014
14797
|
);
|
15015
14798
|
};
|
15016
14799
|
|
15017
|
-
// 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
|
15018
15034
|
import React90 from "react";
|
15019
|
-
import {
|
15020
|
-
|
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({
|
15021
15045
|
slots: {
|
15022
15046
|
overlay: "inset-0 overflow-y-auto z-modal fixed",
|
15023
15047
|
backdrop: "-z-10 fixed min-w-full min-h-full bg-body-intense opacity-70",
|
@@ -15120,55 +15144,55 @@ var Modal = ({
|
|
15120
15144
|
...rest
|
15121
15145
|
}) => {
|
15122
15146
|
const { overlay } = modalStyles({ kind });
|
15123
|
-
return open ? /* @__PURE__ */
|
15147
|
+
return open ? /* @__PURE__ */ React89.createElement("div", { ...rest, className: overlay({ className }) }, children) : null;
|
15124
15148
|
};
|
15125
15149
|
Modal.BackDrop = ({ className, ...rest }) => {
|
15126
15150
|
const { backdrop } = modalStyles();
|
15127
|
-
return /* @__PURE__ */
|
15151
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: backdrop({ className }) });
|
15128
15152
|
};
|
15129
|
-
Modal.Dialog =
|
15153
|
+
Modal.Dialog = React89.forwardRef(
|
15130
15154
|
({ kind = "dialog", children, className, size = "md", ...rest }, ref) => {
|
15131
15155
|
const { dialog } = modalStyles({ kind, size });
|
15132
|
-
return /* @__PURE__ */
|
15156
|
+
return /* @__PURE__ */ React89.createElement("div", { ref, "aria-modal": "true", ...rest, className: dialog({ className }) }, children);
|
15133
15157
|
}
|
15134
15158
|
);
|
15135
15159
|
Modal.Header = ({ kind = "dialog", size = "md", children, className, ...rest }) => {
|
15136
15160
|
const { header } = modalStyles({ kind, size });
|
15137
|
-
return /* @__PURE__ */
|
15161
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: header({ className }) }, children);
|
15138
15162
|
};
|
15139
15163
|
Modal.HeaderImage = ({ backgroundImage, className, ...rest }) => {
|
15140
15164
|
const { headerImage } = modalStyles({ backgroundImage: Boolean(backgroundImage) });
|
15141
|
-
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 }) });
|
15142
15166
|
};
|
15143
15167
|
Modal.CloseButtonContainer = ({ className, ...rest }) => {
|
15144
15168
|
const { closeButtonContainer } = modalStyles();
|
15145
|
-
return /* @__PURE__ */
|
15169
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: closeButtonContainer({ className }) });
|
15146
15170
|
};
|
15147
15171
|
Modal.Title = ({ kind = "dialog", children, className, ...rest }) => {
|
15148
15172
|
const { title } = modalStyles({ kind });
|
15149
|
-
return /* @__PURE__ */
|
15173
|
+
return /* @__PURE__ */ React89.createElement(Typography, { htmlTag: "h2", variant: "subheading", color: "intense", className: title({ className }), ...rest }, children);
|
15150
15174
|
};
|
15151
|
-
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
15175
|
+
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React89.createElement(Typography, { variant: "small", color: "default", ...rest }, children);
|
15152
15176
|
Modal.TitleContainer = ({ children, className, ...rest }) => {
|
15153
15177
|
const { titleContainer } = modalStyles();
|
15154
|
-
return /* @__PURE__ */
|
15178
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: titleContainer({ className }) }, children);
|
15155
15179
|
};
|
15156
15180
|
Modal.Body = ({ children, className, noFooter = false, maxHeight, style, ...rest }) => {
|
15157
15181
|
const { body } = modalStyles();
|
15158
|
-
return /* @__PURE__ */
|
15182
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: body({ noFooter, className }), style: { maxHeight, ...style } }, children);
|
15159
15183
|
};
|
15160
15184
|
Modal.Footer = ({ children, className, ...rest }) => {
|
15161
15185
|
const { footer } = modalStyles();
|
15162
|
-
return /* @__PURE__ */
|
15186
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: footer({ className }) }, children);
|
15163
15187
|
};
|
15164
15188
|
Modal.Actions = ({ children, className, ...rest }) => {
|
15165
15189
|
const { actions } = modalStyles();
|
15166
|
-
return /* @__PURE__ */
|
15190
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: actions({ className }) }, children);
|
15167
15191
|
};
|
15168
15192
|
|
15169
15193
|
// src/molecules/Dialog/Dialog.tsx
|
15170
|
-
var
|
15171
|
-
const ref =
|
15194
|
+
var Dialog2 = (props) => {
|
15195
|
+
const ref = React90.useRef(null);
|
15172
15196
|
const { open, onClose } = props;
|
15173
15197
|
const state = useOverlayTriggerState2({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose?.() });
|
15174
15198
|
const { modalProps, underlayProps } = useModalOverlay(
|
@@ -15179,7 +15203,7 @@ var Dialog3 = (props) => {
|
|
15179
15203
|
if (!state.isOpen) {
|
15180
15204
|
return null;
|
15181
15205
|
}
|
15182
|
-
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 }))));
|
15183
15207
|
};
|
15184
15208
|
var DialogWrapper = ({
|
15185
15209
|
title,
|
@@ -15188,7 +15212,7 @@ var DialogWrapper = ({
|
|
15188
15212
|
primaryAction,
|
15189
15213
|
secondaryAction
|
15190
15214
|
}) => {
|
15191
|
-
const ref =
|
15215
|
+
const ref = React90.useRef(null);
|
15192
15216
|
const labelledBy = useId12();
|
15193
15217
|
const describedBy = useId12();
|
15194
15218
|
const { dialogProps } = useDialog(
|
@@ -15199,35 +15223,35 @@ var DialogWrapper = ({
|
|
15199
15223
|
},
|
15200
15224
|
ref
|
15201
15225
|
);
|
15202
|
-
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))));
|
15203
15227
|
};
|
15204
15228
|
|
15205
15229
|
// src/molecules/Drawer/Drawer.tsx
|
15206
|
-
import
|
15207
|
-
import { Dialog as
|
15230
|
+
import React93 from "react";
|
15231
|
+
import { Dialog as AriaDialog2, Modal as AriaModal, ModalOverlay as AriaModalOverlay } from "react-aria-components";
|
15208
15232
|
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
15209
15233
|
import { castArray as castArray3, omit as omit11 } from "lodash-es";
|
15210
15234
|
|
15211
15235
|
// src/molecules/Modal/ModalTitle.tsx
|
15212
|
-
import
|
15236
|
+
import React91 from "react";
|
15213
15237
|
import { HeadingContext, useContextProps } from "react-aria-components";
|
15214
15238
|
var ModalTitle = ({ children, ...props }) => {
|
15215
15239
|
const [ctxProps] = useContextProps({ ...props, slot: "title" }, null, HeadingContext);
|
15216
|
-
return /* @__PURE__ */
|
15240
|
+
return /* @__PURE__ */ React91.createElement(Modal.Title, { id: ctxProps.id, ...props }, children);
|
15217
15241
|
};
|
15218
15242
|
|
15219
15243
|
// src/molecules/Tabs/Tabs.tsx
|
15220
|
-
import
|
15244
|
+
import React92, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState11 } from "react";
|
15221
15245
|
import { isNumber as isNumber6, kebabCase } from "lodash-es";
|
15222
15246
|
var import_chevronLeft5 = __toESM(require_chevronLeft());
|
15223
15247
|
var import_chevronRight5 = __toESM(require_chevronRight());
|
15224
15248
|
var import_warningSign4 = __toESM(require_warningSign());
|
15225
15249
|
var isTabComponent = (c) => {
|
15226
|
-
return
|
15250
|
+
return React92.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
15227
15251
|
};
|
15228
|
-
var Tab =
|
15252
|
+
var Tab = React92.forwardRef(
|
15229
15253
|
({ className, id, title, children }, ref) => {
|
15230
|
-
return /* @__PURE__ */
|
15254
|
+
return /* @__PURE__ */ React92.createElement(
|
15231
15255
|
"div",
|
15232
15256
|
{
|
15233
15257
|
ref,
|
@@ -15241,10 +15265,10 @@ var Tab = React93.forwardRef(
|
|
15241
15265
|
);
|
15242
15266
|
}
|
15243
15267
|
);
|
15244
|
-
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);
|
15245
15269
|
var ModalTab = Tab;
|
15246
15270
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
15247
|
-
const Tab2 =
|
15271
|
+
const Tab2 = React92.forwardRef(
|
15248
15272
|
({
|
15249
15273
|
id,
|
15250
15274
|
value,
|
@@ -15263,11 +15287,11 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15263
15287
|
const _id = id ?? kebabCase(title);
|
15264
15288
|
let statusIcon = void 0;
|
15265
15289
|
if (status === "warning") {
|
15266
|
-
statusIcon = /* @__PURE__ */
|
15290
|
+
statusIcon = /* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "warning-default" });
|
15267
15291
|
} else if (status === "error") {
|
15268
|
-
statusIcon = /* @__PURE__ */
|
15292
|
+
statusIcon = /* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "danger-default" });
|
15269
15293
|
}
|
15270
|
-
const tab = /* @__PURE__ */
|
15294
|
+
const tab = /* @__PURE__ */ React92.createElement(
|
15271
15295
|
Component,
|
15272
15296
|
{
|
15273
15297
|
ref,
|
@@ -15288,7 +15312,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15288
15312
|
tabIndex: disabled ? void 0 : 0,
|
15289
15313
|
...rest
|
15290
15314
|
},
|
15291
|
-
/* @__PURE__ */
|
15315
|
+
/* @__PURE__ */ React92.createElement(
|
15292
15316
|
Typography2,
|
15293
15317
|
{
|
15294
15318
|
htmlTag: "div",
|
@@ -15296,8 +15320,8 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15296
15320
|
color: selected ? "primary-default" : disabled ? "default" : "current",
|
15297
15321
|
className: tw("inline-flex items-center gap-3")
|
15298
15322
|
},
|
15299
|
-
showNotification ? /* @__PURE__ */
|
15300
|
-
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(
|
15301
15325
|
Typography2,
|
15302
15326
|
{
|
15303
15327
|
htmlTag: "span",
|
@@ -15305,7 +15329,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15305
15329
|
color: selected ? "primary-intense" : "grey-5",
|
15306
15330
|
className: "leading-none"
|
15307
15331
|
},
|
15308
|
-
/* @__PURE__ */
|
15332
|
+
/* @__PURE__ */ React92.createElement(
|
15309
15333
|
TabBadge,
|
15310
15334
|
{
|
15311
15335
|
kind: "filled",
|
@@ -15317,7 +15341,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15317
15341
|
statusIcon
|
15318
15342
|
)
|
15319
15343
|
);
|
15320
|
-
return tooltip ? /* @__PURE__ */
|
15344
|
+
return tooltip ? /* @__PURE__ */ React92.createElement(Tooltip, { content: tooltip }, tab) : tab;
|
15321
15345
|
}
|
15322
15346
|
);
|
15323
15347
|
Tab2.displayName = displayName;
|
@@ -15328,7 +15352,7 @@ var CARET_OFFSET = 24;
|
|
15328
15352
|
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
15329
15353
|
const Tabs2 = (props) => {
|
15330
15354
|
const { className, value, defaultValue, onChange, children } = props;
|
15331
|
-
const childArr =
|
15355
|
+
const childArr = React92.Children.toArray(children);
|
15332
15356
|
const firstTab = childArr[0];
|
15333
15357
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
15334
15358
|
const [selected, setSelected] = useState11(value ?? defaultValue ?? firstTabValue ?? 0);
|
@@ -15340,7 +15364,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15340
15364
|
const revealSelectedTab = ({ smooth }) => {
|
15341
15365
|
const container = containerRef.current;
|
15342
15366
|
const tabs = tabsRef.current;
|
15343
|
-
const values =
|
15367
|
+
const values = React92.Children.map(
|
15344
15368
|
children,
|
15345
15369
|
(tab, i) => tab?.props.value ?? i
|
15346
15370
|
);
|
@@ -15378,7 +15402,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15378
15402
|
updateCarets();
|
15379
15403
|
setSelected(value);
|
15380
15404
|
revealSelectedTab({ smooth: value !== selected });
|
15381
|
-
}, [value,
|
15405
|
+
}, [value, React92.Children.count(children)]);
|
15382
15406
|
useLayoutEffect2(() => {
|
15383
15407
|
updateCarets();
|
15384
15408
|
containerRef.current?.addEventListener("scroll", updateCarets);
|
@@ -15440,12 +15464,12 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15440
15464
|
const handleSelected = (key) => {
|
15441
15465
|
(onChange ?? setSelected)(key);
|
15442
15466
|
};
|
15443
|
-
|
15467
|
+
React92.Children.forEach(children, (c) => {
|
15444
15468
|
if (c && !isTabComponent(c)) {
|
15445
15469
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
15446
15470
|
}
|
15447
15471
|
});
|
15448
|
-
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(
|
15449
15473
|
"div",
|
15450
15474
|
{
|
15451
15475
|
ref: tabsRef,
|
@@ -15453,9 +15477,9 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15453
15477
|
"aria-label": "tabs",
|
15454
15478
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
15455
15479
|
},
|
15456
|
-
|
15480
|
+
React92.Children.map(
|
15457
15481
|
children,
|
15458
|
-
(tab, index) => tab ? /* @__PURE__ */
|
15482
|
+
(tab, index) => tab ? /* @__PURE__ */ React92.createElement(
|
15459
15483
|
TabItemComponent,
|
15460
15484
|
{
|
15461
15485
|
key: tab.props.value,
|
@@ -15467,26 +15491,26 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15467
15491
|
}
|
15468
15492
|
) : void 0
|
15469
15493
|
)
|
15470
|
-
)), 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(
|
15471
15495
|
"div",
|
15472
15496
|
{
|
15473
15497
|
onClick: () => handleScrollToNext("left"),
|
15474
15498
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15475
15499
|
},
|
15476
|
-
/* @__PURE__ */
|
15477
|
-
)), rightCaret && /* @__PURE__ */
|
15500
|
+
/* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_chevronLeft5.default })
|
15501
|
+
)), rightCaret && /* @__PURE__ */ React92.createElement(
|
15478
15502
|
"div",
|
15479
15503
|
{
|
15480
15504
|
onClick: () => handleScrollToNext("right"),
|
15481
15505
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
15482
15506
|
},
|
15483
|
-
/* @__PURE__ */
|
15507
|
+
/* @__PURE__ */ React92.createElement(
|
15484
15508
|
"div",
|
15485
15509
|
{
|
15486
15510
|
onClick: () => handleScrollToNext("right"),
|
15487
15511
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15488
15512
|
},
|
15489
|
-
/* @__PURE__ */
|
15513
|
+
/* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_chevronRight5.default })
|
15490
15514
|
)
|
15491
15515
|
)), renderChildren(children, selected, props));
|
15492
15516
|
};
|
@@ -15494,7 +15518,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15494
15518
|
Tabs2.Tab = TabComponent;
|
15495
15519
|
return Tabs2;
|
15496
15520
|
};
|
15497
|
-
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(
|
15498
15522
|
(node, index) => node?.props.value === selected || index === selected
|
15499
15523
|
)));
|
15500
15524
|
|
@@ -15522,7 +15546,7 @@ var Drawer = ({
|
|
15522
15546
|
secondaryActions,
|
15523
15547
|
closeOnEsc = true
|
15524
15548
|
}) => {
|
15525
|
-
const [hidden, setHidden] =
|
15549
|
+
const [hidden, setHidden] = React93.useState(!open);
|
15526
15550
|
if (open && hidden) {
|
15527
15551
|
setHidden(!open);
|
15528
15552
|
}
|
@@ -15545,10 +15569,10 @@ var Drawer = ({
|
|
15545
15569
|
}
|
15546
15570
|
const dialogSize = size === "lg" ? "full" : size;
|
15547
15571
|
const styles = modalStyles({ kind: "drawer", size: dialogSize });
|
15548
|
-
const childElements =
|
15572
|
+
const childElements = React93.Children.toArray(children).filter(React93.isValidElement);
|
15549
15573
|
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
15550
15574
|
const hasTabs = isComponentType(onlyChild, Tabs);
|
15551
|
-
return /* @__PURE__ */
|
15575
|
+
return /* @__PURE__ */ React93.createElement(
|
15552
15576
|
AriaModalOverlay,
|
15553
15577
|
{
|
15554
15578
|
isOpen: !hidden,
|
@@ -15557,60 +15581,60 @@ var Drawer = ({
|
|
15557
15581
|
isKeyboardDismissDisabled: !closeOnEsc,
|
15558
15582
|
className: styles.overlay({ className: "Aquarium-Drawer" })
|
15559
15583
|
},
|
15560
|
-
/* @__PURE__ */
|
15561
|
-
/* @__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(
|
15562
15586
|
DrawerTabs,
|
15563
15587
|
{
|
15564
15588
|
...onlyChild.props,
|
15565
15589
|
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
15566
15590
|
}
|
15567
|
-
) : /* @__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)))))))
|
15568
15592
|
);
|
15569
15593
|
};
|
15570
|
-
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(
|
15571
15595
|
(node, index) => node?.props.value === selected || index === selected
|
15572
15596
|
))));
|
15573
15597
|
|
15574
15598
|
// src/molecules/Dropdown/Dropdown.tsx
|
15575
|
-
import
|
15599
|
+
import React95 from "react";
|
15576
15600
|
import { OverlayTriggerStateContext as OverlayTriggerStateContext2 } from "react-aria-components";
|
15577
15601
|
|
15578
15602
|
// src/molecules/Popover/Popover.tsx
|
15579
|
-
import
|
15603
|
+
import React94, { createContext as createContext5 } from "react";
|
15580
15604
|
import { DialogTrigger, OverlayTriggerStateContext } from "react-aria-components";
|
15581
|
-
import { mergeProps as
|
15605
|
+
import { mergeProps as mergeProps5 } from "@react-aria/utils";
|
15582
15606
|
var PopoverPropsContext = createContext5({});
|
15583
|
-
var
|
15607
|
+
var Popover2 = ({ children, onOpenChange: _onOpenChange, onClose, onOpen, ...props }) => {
|
15584
15608
|
const onOpenChange = (isOpen) => {
|
15585
15609
|
_onOpenChange?.(isOpen);
|
15586
15610
|
isOpen ? onOpen?.() : onClose?.();
|
15587
15611
|
};
|
15588
|
-
return /* @__PURE__ */
|
15612
|
+
return /* @__PURE__ */ React94.createElement(PopoverPropsContext.Provider, { value: props }, /* @__PURE__ */ React94.createElement(DialogTrigger, { ...props, onOpenChange }, children));
|
15589
15613
|
};
|
15590
|
-
|
15614
|
+
Popover2.displayName = "Popover";
|
15591
15615
|
var Trigger = ({ children }) => {
|
15592
|
-
return /* @__PURE__ */
|
15616
|
+
return /* @__PURE__ */ React94.createElement(Pressable, { "aria-haspopup": "true" }, children);
|
15593
15617
|
};
|
15594
15618
|
Trigger.displayName = "Popover.Trigger";
|
15595
|
-
|
15619
|
+
Popover2.Trigger = Trigger;
|
15596
15620
|
var Panel = ({ className, children }) => {
|
15597
|
-
const { offset = 0, onOpenChange, ...props } =
|
15598
|
-
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));
|
15599
15623
|
};
|
15600
15624
|
Panel.displayName = "Popover.Panel";
|
15601
|
-
|
15625
|
+
Popover2.Panel = Panel;
|
15602
15626
|
var CloseToggle = ({ children }) => {
|
15603
|
-
const ctx =
|
15627
|
+
const ctx = React94.useContext(OverlayTriggerStateContext);
|
15604
15628
|
const onClick = ctx?.close;
|
15605
|
-
const child =
|
15606
|
-
return
|
15629
|
+
const child = React94.Children.only(children);
|
15630
|
+
return React94.cloneElement(child, { ...mergeProps5(child.props, { onClick }) });
|
15607
15631
|
};
|
15608
15632
|
CloseToggle.displayName = "Popover.CloseToggle";
|
15609
|
-
|
15633
|
+
Popover2.CloseToggle = CloseToggle;
|
15610
15634
|
|
15611
15635
|
// src/molecules/Dropdown/Dropdown.tsx
|
15612
15636
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
15613
|
-
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));
|
15614
15638
|
};
|
15615
15639
|
var DropdownMenu3 = ({
|
15616
15640
|
title,
|
@@ -15619,13 +15643,13 @@ var DropdownMenu3 = ({
|
|
15619
15643
|
triggerId,
|
15620
15644
|
setClose = () => void 0
|
15621
15645
|
}) => {
|
15622
|
-
const menuRef =
|
15623
|
-
|
15646
|
+
const menuRef = React95.useRef(null);
|
15647
|
+
React95.useEffect(() => {
|
15624
15648
|
const id = setTimeout(() => (menuRef.current?.children[0]).focus());
|
15625
15649
|
return () => clearTimeout(id);
|
15626
15650
|
}, [menuRef.current]);
|
15627
|
-
return /* @__PURE__ */
|
15628
|
-
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 });
|
15629
15653
|
})));
|
15630
15654
|
};
|
15631
15655
|
var DropdownItem = ({
|
@@ -15638,7 +15662,7 @@ var DropdownItem = ({
|
|
15638
15662
|
setClose = () => void 0,
|
15639
15663
|
...props
|
15640
15664
|
}) => {
|
15641
|
-
const ctx =
|
15665
|
+
const ctx = React95.useContext(OverlayTriggerStateContext2);
|
15642
15666
|
const handleSelect = () => {
|
15643
15667
|
onSelect?.();
|
15644
15668
|
ctx?.close();
|
@@ -15672,8 +15696,8 @@ var DropdownItem = ({
|
|
15672
15696
|
handleSelect();
|
15673
15697
|
}
|
15674
15698
|
};
|
15675
|
-
const itemContent = /* @__PURE__ */
|
15676
|
-
return /* @__PURE__ */
|
15699
|
+
const itemContent = /* @__PURE__ */ React95.createElement("div", { className: tw("py-3 px-4") }, children);
|
15700
|
+
return /* @__PURE__ */ React95.createElement(
|
15677
15701
|
"li",
|
15678
15702
|
{
|
15679
15703
|
role: "menuitem",
|
@@ -15690,14 +15714,14 @@ var DropdownItem = ({
|
|
15690
15714
|
})
|
15691
15715
|
)
|
15692
15716
|
},
|
15693
|
-
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
|
15694
15718
|
);
|
15695
15719
|
};
|
15696
15720
|
Dropdown.Menu = DropdownMenu3;
|
15697
15721
|
Dropdown.Item = DropdownItem;
|
15698
15722
|
|
15699
15723
|
// src/molecules/EmptyState/EmptyState.tsx
|
15700
|
-
import
|
15724
|
+
import React96 from "react";
|
15701
15725
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
15702
15726
|
EmptyStateLayout2["Vertical"] = "vertical";
|
15703
15727
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -15735,7 +15759,7 @@ var EmptyState = ({
|
|
15735
15759
|
fullHeight = isVerticalLayout(layout) ? true : false
|
15736
15760
|
}) => {
|
15737
15761
|
const template = layoutStyle(layout);
|
15738
|
-
return /* @__PURE__ */
|
15762
|
+
return /* @__PURE__ */ React96.createElement(
|
15739
15763
|
Box,
|
15740
15764
|
{
|
15741
15765
|
className: classNames(
|
@@ -15751,7 +15775,7 @@ var EmptyState = ({
|
|
15751
15775
|
backgroundColor: "transparent",
|
15752
15776
|
borderColor: "default"
|
15753
15777
|
},
|
15754
|
-
/* @__PURE__ */
|
15778
|
+
/* @__PURE__ */ React96.createElement(
|
15755
15779
|
Box.Flex,
|
15756
15780
|
{
|
15757
15781
|
style: { gap: "56px" },
|
@@ -15760,19 +15784,149 @@ var EmptyState = ({
|
|
15760
15784
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
15761
15785
|
height: fullHeight ? "full" : void 0
|
15762
15786
|
},
|
15763
|
-
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */
|
15787
|
+
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */ React96.createElement(
|
15764
15788
|
"img",
|
15765
15789
|
{
|
15766
15790
|
src: Image2,
|
15767
15791
|
alt: imageAlt,
|
15768
15792
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
15769
15793
|
}
|
15770
|
-
) : /* @__PURE__ */
|
15771
|
-
/* @__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)))
|
15772
15796
|
)
|
15773
15797
|
);
|
15774
15798
|
};
|
15775
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
|
+
|
15776
15930
|
// src/molecules/LineClamp/LineClamp.tsx
|
15777
15931
|
import React98 from "react";
|
15778
15932
|
var LineClamp2 = ({
|
@@ -15844,9 +15998,9 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
15844
15998
|
|
15845
15999
|
// src/molecules/Modal/Modal.tsx
|
15846
16000
|
import React101 from "react";
|
15847
|
-
import { Dialog as
|
16001
|
+
import { Dialog as AriaDialog3, Modal as AriaModal2, ModalOverlay as AriaModalOverlay2 } from "react-aria-components";
|
15848
16002
|
import { castArray as castArray4, omit as omit12 } from "lodash-es";
|
15849
|
-
var
|
16003
|
+
var import_cross8 = __toESM(require_cross());
|
15850
16004
|
var Modal2 = ({
|
15851
16005
|
open,
|
15852
16006
|
onClose,
|
@@ -15874,7 +16028,7 @@ var Modal2 = ({
|
|
15874
16028
|
className: styles.overlay({ className: "Aquarium-Modal" })
|
15875
16029
|
},
|
15876
16030
|
size !== "screen" && /* @__PURE__ */ React101.createElement(Modal.BackDrop, { className: styles.backdrop() }),
|
15877
|
-
/* @__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(
|
15878
16032
|
Modal.Header,
|
15879
16033
|
{
|
15880
16034
|
kind: "dialog",
|
@@ -16587,7 +16741,7 @@ import { castArray as castArray6 } from "lodash-es";
|
|
16587
16741
|
|
16588
16742
|
// src/atoms/PageHeader/PageHeader.tsx
|
16589
16743
|
import React108 from "react";
|
16590
|
-
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);
|
16591
16745
|
PageHeader.Container = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col grow gap-0"), className), ...rest }, children);
|
16592
16746
|
PageHeader.TitleContainer = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col justify-center gap-2"), className), ...rest }, children);
|
16593
16747
|
PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__ */ React108.createElement(
|
@@ -16647,9 +16801,9 @@ PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
|
16647
16801
|
|
16648
16802
|
// src/molecules/Popover/PopoverContext.tsx
|
16649
16803
|
import { createContext as createContext6, useContext as useContext8 } from "react";
|
16650
|
-
var
|
16804
|
+
var PopoverContext = createContext6(null);
|
16651
16805
|
var usePopoverContext = () => {
|
16652
|
-
const ctx = useContext8(
|
16806
|
+
const ctx = useContext8(PopoverContext);
|
16653
16807
|
if (ctx === null) {
|
16654
16808
|
throw new Error("PopoverContext was used outside of provider.");
|
16655
16809
|
}
|
@@ -16681,12 +16835,12 @@ var PopoverDialogPropsContext = createContext7({
|
|
16681
16835
|
primaryAction: { text: "", onClick: noop3 }
|
16682
16836
|
});
|
16683
16837
|
var PopoverDialog2 = ({ placement, open, children, ...props }) => {
|
16684
|
-
return /* @__PURE__ */ React111.createElement(
|
16838
|
+
return /* @__PURE__ */ React111.createElement(Popover2, { placement }, /* @__PURE__ */ React111.createElement(PopoverDialogPropsContext.Provider, { value: props }, children));
|
16685
16839
|
};
|
16686
|
-
PopoverDialog2.Trigger =
|
16840
|
+
PopoverDialog2.Trigger = Popover2.Trigger;
|
16687
16841
|
var Prompt = ({ children }) => {
|
16688
16842
|
const { title, primaryAction, secondaryAction } = React111.useContext(PopoverDialogPropsContext);
|
16689
|
-
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)))));
|
16690
16844
|
};
|
16691
16845
|
Prompt.displayName = "PopoverDialog.Prompt";
|
16692
16846
|
PopoverDialog2.Prompt = Prompt;
|
@@ -17420,7 +17574,7 @@ Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
|
17420
17574
|
|
17421
17575
|
// src/molecules/TimePicker/TimePicker.tsx
|
17422
17576
|
import React128 from "react";
|
17423
|
-
var TimePicker = (props) => /* @__PURE__ */ React128.createElement(
|
17577
|
+
var TimePicker = (props) => /* @__PURE__ */ React128.createElement(TimeField2, { ...props });
|
17424
17578
|
|
17425
17579
|
// src/utils/table/sortByColumn.ts
|
17426
17580
|
var sortByColumn = (items, column, sortState) => {
|
@@ -17702,16 +17856,16 @@ export {
|
|
17702
17856
|
ControlLabel,
|
17703
17857
|
DataList2 as DataList,
|
17704
17858
|
DataTable,
|
17705
|
-
DatePicker,
|
17859
|
+
DatePicker2 as DatePicker,
|
17706
17860
|
DatePickerBase,
|
17707
|
-
DateRangePicker,
|
17861
|
+
DateRangePicker2 as DateRangePicker,
|
17708
17862
|
DateRangePickerBase,
|
17709
17863
|
DateTimePicker,
|
17710
17864
|
DateTimePickerBase,
|
17711
17865
|
DateTimeRangePicker,
|
17712
17866
|
DateTimeRangePickerBase,
|
17713
17867
|
DesignSystemContext,
|
17714
|
-
|
17868
|
+
Dialog2 as Dialog,
|
17715
17869
|
Divider2 as Divider,
|
17716
17870
|
Drawer,
|
17717
17871
|
Dropdown,
|
@@ -17720,6 +17874,7 @@ export {
|
|
17720
17874
|
EmptyState,
|
17721
17875
|
EmptyStateLayout,
|
17722
17876
|
FileInput,
|
17877
|
+
Filter,
|
17723
17878
|
FormControl,
|
17724
17879
|
Grid,
|
17725
17880
|
HelperText,
|
@@ -17748,7 +17903,7 @@ export {
|
|
17748
17903
|
Option,
|
17749
17904
|
PageHeader2 as PageHeader,
|
17750
17905
|
Pagination,
|
17751
|
-
|
17906
|
+
Popover2 as Popover,
|
17752
17907
|
PopoverDialog2 as PopoverDialog,
|
17753
17908
|
Portal,
|
17754
17909
|
PositionerPlacement,
|