@aivenio/aquarium 4.1.2 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +106 -0
- package/dist/src/atoms/DatePicker/DatePicker.js +80 -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 +65 -4
- package/dist/src/molecules/DatePicker/DatePicker.js +73 -48
- package/dist/src/molecules/DatePicker/DateRangePicker.d.ts +69 -4
- package/dist/src/molecules/DatePicker/DateRangePicker.js +77 -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/Spacing/Spacing.d.ts +1 -1
- package/dist/src/molecules/Spacing/Spacing.js +1 -1
- 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/styles.css +6 -0
- package/dist/system.cjs +622 -419
- package/dist/system.mjs +634 -425
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +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,91 @@ 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
|
-
|
12279
|
-
|
12275
|
+
Button as AriaButton3,
|
12276
|
+
DatePicker as AriaDatePicker,
|
12277
|
+
DatePickerStateContext as AriaDatePickerStateContext,
|
12278
|
+
DateRangePicker as AriaDateRangePicker,
|
12279
|
+
DateRangePickerStateContext as AriaDateRangePickerStateContext
|
12280
12280
|
} from "react-aria-components";
|
12281
|
-
|
12282
|
-
|
12283
|
-
|
12284
|
-
|
12285
|
-
|
12286
|
-
|
12287
|
-
|
12288
|
-
|
12289
|
-
|
12290
|
-
|
12291
|
-
|
12292
|
-
|
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"
|
12281
|
+
import { tv as tv11 } from "tailwind-variants";
|
12282
|
+
var datePickerCalendarStyles = tv11({
|
12283
|
+
slots: {
|
12284
|
+
dialog: "flex",
|
12285
|
+
calendar: "[[data-placement]>&]:px-5 [[data-placement]>&]:py-6 max-h-[inherit]",
|
12286
|
+
errorMessage: "typography-caption text-danger-default max-w-[300px]",
|
12287
|
+
presets: "bg-muted py-6 px-5 flex flex-col min-w-[150px] max-w-[300px] self-stretch",
|
12288
|
+
preset: "hover:text-primary-active p-3 text-left hover:underline"
|
12289
|
+
},
|
12290
|
+
variants: {
|
12291
|
+
isPresetActive: {
|
12292
|
+
true: {
|
12293
|
+
preset: "text-primary-active typography-small-strong"
|
12302
12294
|
},
|
12303
|
-
|
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;
|
12317
|
-
}
|
12318
|
-
return /* @__PURE__ */ React86.createElement(
|
12319
|
-
ClearInputButton,
|
12320
|
-
{
|
12321
|
-
onPress: () => {
|
12322
|
-
state.setValue(null);
|
12295
|
+
false: {
|
12296
|
+
preset: "typography-small"
|
12323
12297
|
}
|
12324
12298
|
}
|
12325
|
-
|
12326
|
-
}
|
12327
|
-
var
|
12328
|
-
disabled,
|
12329
|
-
valid,
|
12330
|
-
granularity,
|
12331
|
-
shouldCloseOnSelect,
|
12332
|
-
errorMessage,
|
12333
|
-
clearSelectionEnabled = true,
|
12334
|
-
...props
|
12335
|
-
}) => {
|
12299
|
+
}
|
12300
|
+
});
|
12301
|
+
var DatePicker = ({ variant, ...props }) => {
|
12336
12302
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12337
|
-
return /* @__PURE__ */
|
12303
|
+
return /* @__PURE__ */ React84.createElement(
|
12338
12304
|
AriaDatePicker,
|
12339
12305
|
{
|
12340
12306
|
...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
|
12307
|
+
shouldCloseOnSelect: props.shouldCloseOnSelect ?? variant === "date",
|
12308
|
+
granularity: props.granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12365
12309
|
}
|
12366
12310
|
);
|
12367
12311
|
};
|
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
|
-
}) => {
|
12312
|
+
var DateRangePicker = ({ variant, ...props }) => {
|
12475
12313
|
const hasSomeValue = props.value ?? props.defaultValue ?? props.placeholderValue;
|
12476
|
-
return /* @__PURE__ */
|
12314
|
+
return /* @__PURE__ */ React84.createElement(
|
12477
12315
|
AriaDateRangePicker,
|
12478
12316
|
{
|
12479
12317
|
...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
|
12318
|
+
shouldCloseOnSelect: props.shouldCloseOnSelect ?? variant === "date",
|
12319
|
+
granularity: props.granularity ?? (variant === "datetime" && !hasSomeValue ? "minute" : void 0)
|
12500
12320
|
}
|
12501
12321
|
);
|
12502
12322
|
};
|
12503
|
-
var
|
12504
|
-
|
12505
|
-
|
12506
|
-
|
12507
|
-
|
12508
|
-
const
|
12509
|
-
const
|
12510
|
-
const
|
12511
|
-
|
12512
|
-
|
12323
|
+
var Presets = ({ children }) => {
|
12324
|
+
const { presets } = datePickerCalendarStyles();
|
12325
|
+
return /* @__PURE__ */ React84.createElement("div", { className: presets() }, children);
|
12326
|
+
};
|
12327
|
+
var Preset = ({ value, label }) => {
|
12328
|
+
const { preset } = datePickerCalendarStyles();
|
12329
|
+
const context2 = React84.useContext(AriaDatePickerStateContext);
|
12330
|
+
const handlePress = () => {
|
12331
|
+
context2?.setValue(value);
|
12332
|
+
context2?.close();
|
12333
|
+
};
|
12334
|
+
const isActive = context2?.value !== void 0 && context2.value?.toString() === value.toString();
|
12335
|
+
return /* @__PURE__ */ React84.createElement(AriaButton3, { onPress: handlePress, className: preset({ isPresetActive: isActive }) }, label);
|
12336
|
+
};
|
12337
|
+
var RangePreset = ({ value, label }) => {
|
12338
|
+
const { preset } = datePickerCalendarStyles();
|
12339
|
+
const context2 = React84.useContext(AriaDateRangePickerStateContext);
|
12340
|
+
const handlePress = () => {
|
12341
|
+
context2?.setValue(value);
|
12342
|
+
context2?.close();
|
12343
|
+
};
|
12344
|
+
const isActive = context2?.value !== void 0 && context2.value.start?.toString() === value.start.toString() && context2.value.end?.toString() === value.end.toString();
|
12345
|
+
return /* @__PURE__ */ React84.createElement(AriaButton3, { onPress: handlePress, className: preset({ isPresetActive: isActive }) }, label);
|
12513
12346
|
};
|
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
12347
|
|
12525
12348
|
// src/atoms/Dialog/Dialog.tsx
|
12526
|
-
import
|
12527
|
-
import { Dialog as
|
12349
|
+
import React85 from "react";
|
12350
|
+
import { Dialog as AriaDialog } from "react-aria-components";
|
12528
12351
|
|
12529
12352
|
// node_modules/tailwind-merge/dist/bundle-mjs.mjs
|
12530
12353
|
var CLASS_PART_SEPARATOR = "-";
|
@@ -15004,9 +14827,9 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
15004
14827
|
color: "danger-default"
|
15005
14828
|
}
|
15006
14829
|
};
|
15007
|
-
var
|
15008
|
-
return /* @__PURE__ */
|
15009
|
-
|
14830
|
+
var Dialog = (props) => {
|
14831
|
+
return /* @__PURE__ */ React85.createElement(
|
14832
|
+
AriaDialog,
|
15010
14833
|
{
|
15011
14834
|
...props,
|
15012
14835
|
className: twMerge("outline outline-0 max-h-[inherit] overflow-auto relative", props.className)
|
@@ -15014,10 +14837,265 @@ var Dialog2 = (props) => {
|
|
15014
14837
|
);
|
15015
14838
|
};
|
15016
14839
|
|
15017
|
-
// src/
|
14840
|
+
// src/molecules/DatePicker/DatePicker.tsx
|
14841
|
+
var DatePickerClearButton = () => {
|
14842
|
+
const state = React86.useContext(DatePickerStateContext);
|
14843
|
+
if (!state) {
|
14844
|
+
throw new Error("DatePickerStateContext is missing a provider");
|
14845
|
+
}
|
14846
|
+
if (!state.value) {
|
14847
|
+
return null;
|
14848
|
+
}
|
14849
|
+
return /* @__PURE__ */ React86.createElement(
|
14850
|
+
ClearInputButton,
|
14851
|
+
{
|
14852
|
+
onPress: () => {
|
14853
|
+
state.setValue(null);
|
14854
|
+
}
|
14855
|
+
}
|
14856
|
+
);
|
14857
|
+
};
|
14858
|
+
DatePickerClearButton.displayName = "DatePicker.ClearButton";
|
14859
|
+
var CalendarTimeField = ({ granularity, labelText = "Time", ...props }) => {
|
14860
|
+
const ctx = React86.useContext(DatePickerStateContext);
|
14861
|
+
return /* @__PURE__ */ React86.createElement(
|
14862
|
+
TimeField2,
|
14863
|
+
{
|
14864
|
+
...props,
|
14865
|
+
labelText,
|
14866
|
+
granularity: granularity !== "day" ? granularity : void 0,
|
14867
|
+
value: ctx?.timeValue,
|
14868
|
+
onChange: (value) => value && ctx?.setTimeValue(value),
|
14869
|
+
reserveSpaceForError: false
|
14870
|
+
}
|
14871
|
+
);
|
14872
|
+
};
|
14873
|
+
var DatePickerCalendarPropsContext = React86.createContext(null);
|
14874
|
+
var DatePickerCalendar = (props) => {
|
14875
|
+
const ctx = React86.useContext(DatePickerCalendarPropsContext);
|
14876
|
+
const { variant, granularity, errorMessage, presets = [] } = mergeProps3(ctx, props);
|
14877
|
+
const { dialog, calendar, errorMessage: errorMessageStyle } = datePickerCalendarStyles();
|
14878
|
+
return /* @__PURE__ */ React86.createElement(Popover, { offset: 0 }, /* @__PURE__ */ React86.createElement(Dialog, { className: dialog() }, presets.length > 0 && /* @__PURE__ */ React86.createElement(Presets, null, presets.map((props2) => /* @__PURE__ */ React86.createElement(Preset, { key: props2.value.toString(), ...props2 }))), /* @__PURE__ */ React86.createElement(Spacing, { gap: "3", className: tw("p-5") }, /* @__PURE__ */ React86.createElement(Calendar, { className: calendar() }), variant === "datetime" && /* @__PURE__ */ React86.createElement(CalendarTimeField, { granularity }), errorMessage && /* @__PURE__ */ React86.createElement(Text, { slot: "errorMessage", className: errorMessageStyle() }, errorMessage))));
|
14879
|
+
};
|
14880
|
+
DatePickerCalendar.displayName = "DatePicker.Calendar";
|
14881
|
+
var DatePickerField = ({ clearSelectionEnabled = true, disabled = false }) => {
|
14882
|
+
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)));
|
14883
|
+
};
|
14884
|
+
DatePickerField.displayName = "DatePicker.Field";
|
14885
|
+
var createDatePickerBase = (variant) => {
|
14886
|
+
const datePicker = ({
|
14887
|
+
disabled,
|
14888
|
+
valid,
|
14889
|
+
shouldCloseOnSelect,
|
14890
|
+
errorMessage,
|
14891
|
+
clearSelectionEnabled = true,
|
14892
|
+
presets,
|
14893
|
+
children,
|
14894
|
+
...props
|
14895
|
+
}) => {
|
14896
|
+
const content = children ?? /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(DatePickerField, { clearSelectionEnabled, disabled }), /* @__PURE__ */ React86.createElement(DatePickerCalendar, null));
|
14897
|
+
return /* @__PURE__ */ React86.createElement(
|
14898
|
+
DatePickerCalendarPropsContext.Provider,
|
14899
|
+
{
|
14900
|
+
value: { variant, granularity: props.granularity, errorMessage, presets }
|
14901
|
+
},
|
14902
|
+
/* @__PURE__ */ React86.createElement(DatePicker, { ...props, variant, isDisabled: disabled, isInvalid: valid === false }, content)
|
14903
|
+
);
|
14904
|
+
};
|
14905
|
+
datePicker.Calendar = DatePickerCalendar;
|
14906
|
+
datePicker.Field = DatePickerField;
|
14907
|
+
datePicker.displayName = variant === "date" ? "DatePickerBase" : "DateTimePickerBase";
|
14908
|
+
return datePicker;
|
14909
|
+
};
|
14910
|
+
var DatePickerBase = createDatePickerBase("date");
|
14911
|
+
var DateTimePickerBase = createDatePickerBase("datetime");
|
14912
|
+
var createDatePicker = (variant) => {
|
14913
|
+
const datePicker = (props) => {
|
14914
|
+
const { labelProps, fieldProps } = useLabel2({ "label": props.labelText, "aria-label": props["aria-label"] });
|
14915
|
+
const errorMessageId = useId10();
|
14916
|
+
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
14917
|
+
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
14918
|
+
const baseProps = omit8(props, Object.keys(labelControlProps));
|
14919
|
+
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
14920
|
+
return /* @__PURE__ */ React86.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React86.createElement(DatePickerBase, { ...allProps }) : /* @__PURE__ */ React86.createElement(DateTimePickerBase, { ...allProps }));
|
14921
|
+
};
|
14922
|
+
datePicker.Calendar = DatePickerCalendar;
|
14923
|
+
datePicker.Field = DatePickerField;
|
14924
|
+
datePicker.displayName = variant === "date" ? "DatePicker" : "DateTimePicker";
|
14925
|
+
return datePicker;
|
14926
|
+
};
|
14927
|
+
var DatePicker2 = createDatePicker("date");
|
14928
|
+
var DateTimePicker = createDatePicker("datetime");
|
14929
|
+
|
14930
|
+
// src/molecules/DatePicker/DateRangePicker.tsx
|
14931
|
+
import React88 from "react";
|
14932
|
+
import {
|
14933
|
+
DateRangePickerStateContext,
|
14934
|
+
Text as Text2
|
14935
|
+
} from "react-aria-components";
|
14936
|
+
import { useLabel as useLabel3 } from "@react-aria/label";
|
14937
|
+
import { mergeProps as mergeProps4, useId as useId11 } from "@react-aria/utils";
|
14938
|
+
import { omit as omit9 } from "lodash-es";
|
14939
|
+
|
14940
|
+
// src/atoms/DatePicker/RangeCalendar.tsx
|
14941
|
+
import React87 from "react";
|
14942
|
+
import {
|
14943
|
+
CalendarCell as CalendarCell2,
|
14944
|
+
CalendarGrid as CalendarGrid2,
|
14945
|
+
CalendarGridBody as CalendarGridBody2,
|
14946
|
+
RangeCalendar as AriaRangeCalendar
|
14947
|
+
} from "react-aria-components";
|
14948
|
+
import { tv as tv12 } from "tailwind-variants";
|
14949
|
+
var cell = tv12({
|
14950
|
+
extend: focusRing,
|
14951
|
+
base: "w-full h-full flex items-center justify-center rounded-md text-default",
|
14952
|
+
variants: {
|
14953
|
+
selectionState: {
|
14954
|
+
none: "group-hover:bg-default group-pressed:bg-intense",
|
14955
|
+
middle: [
|
14956
|
+
"text-white",
|
14957
|
+
"group-hover:bg-primary-default",
|
14958
|
+
"group-invalid:group-hover:bg-danger-default",
|
14959
|
+
"group-pressed:bg-primary-intense",
|
14960
|
+
"group-invalid:group-pressed:bg-danger-intense"
|
14961
|
+
],
|
14962
|
+
cap: "text-white bg-primary-default group-invalid:bg-danger-default"
|
14963
|
+
},
|
14964
|
+
isUnavailable: {
|
14965
|
+
true: "text-inactive"
|
14966
|
+
},
|
14967
|
+
isDisabled: {
|
14968
|
+
true: "text-inactive"
|
14969
|
+
}
|
14970
|
+
}
|
14971
|
+
});
|
14972
|
+
function RangeCalendar(props) {
|
14973
|
+
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(
|
14974
|
+
CalendarCell2,
|
14975
|
+
{
|
14976
|
+
date,
|
14977
|
+
className: tw(
|
14978
|
+
"group w-8 h-8 typography-small outline outline-0 cursor-default",
|
14979
|
+
"outside-month:hidden selected:bg-primary-default",
|
14980
|
+
"invalid:selected:bg-danger-default",
|
14981
|
+
"selection-start:rounded-s-md selection-end:rounded-e-md"
|
14982
|
+
)
|
14983
|
+
},
|
14984
|
+
({ formattedDate, isSelected, isSelectionStart, isSelectionEnd, ...rest }) => /* @__PURE__ */ React87.createElement(
|
14985
|
+
"span",
|
14986
|
+
{
|
14987
|
+
className: cell({
|
14988
|
+
selectionState: isSelected && (isSelectionStart || isSelectionEnd) ? "cap" : isSelected ? "middle" : "none",
|
14989
|
+
...rest
|
14990
|
+
})
|
14991
|
+
},
|
14992
|
+
formattedDate
|
14993
|
+
)
|
14994
|
+
))));
|
14995
|
+
}
|
14996
|
+
|
14997
|
+
// src/molecules/DatePicker/DateRangePicker.tsx
|
14998
|
+
function DateRangePickerClearButton() {
|
14999
|
+
const state = React88.useContext(DateRangePickerStateContext);
|
15000
|
+
if (!state) {
|
15001
|
+
throw new Error("DateRangePickerStateContext is missing a provider");
|
15002
|
+
}
|
15003
|
+
if (!state.value.start && !state.value.end) {
|
15004
|
+
return null;
|
15005
|
+
}
|
15006
|
+
return /* @__PURE__ */ React88.createElement(
|
15007
|
+
ClearInputButton,
|
15008
|
+
{
|
15009
|
+
onPress: () => {
|
15010
|
+
state.setValue(null);
|
15011
|
+
}
|
15012
|
+
}
|
15013
|
+
);
|
15014
|
+
}
|
15015
|
+
var RangeCalendarTimeField = ({ granularity, part, ...props }) => {
|
15016
|
+
const ctx = React88.useContext(DateRangePickerStateContext);
|
15017
|
+
const labelText = props.labelText ?? (part === "start" ? "Start time" : "End time");
|
15018
|
+
return /* @__PURE__ */ React88.createElement(
|
15019
|
+
TimeField2,
|
15020
|
+
{
|
15021
|
+
...props,
|
15022
|
+
labelText,
|
15023
|
+
granularity: granularity !== "day" ? granularity : void 0,
|
15024
|
+
value: ctx?.timeRange?.[part] ?? null,
|
15025
|
+
onChange: (value) => ctx?.setTime(part, value),
|
15026
|
+
reserveSpaceForError: false
|
15027
|
+
}
|
15028
|
+
);
|
15029
|
+
};
|
15030
|
+
var DateRangePickerCalendarPropsContext = React88.createContext(null);
|
15031
|
+
var DateRangePickerCalendar = (props) => {
|
15032
|
+
const ctx = React88.useContext(DateRangePickerCalendarPropsContext);
|
15033
|
+
const { variant, granularity, errorMessage, presets = [] } = mergeProps4(ctx, props);
|
15034
|
+
const { dialog, calendar, errorMessage: errorMessageStyle } = datePickerCalendarStyles();
|
15035
|
+
return /* @__PURE__ */ React88.createElement(Popover, { offset: 0 }, /* @__PURE__ */ React88.createElement(Dialog, { className: dialog() }, presets.length > 0 && /* @__PURE__ */ React88.createElement(Presets, null, presets.map((props2) => /* @__PURE__ */ React88.createElement(RangePreset, { key: `${props2.value.start.toString()}-${props2.value.end.toString()}`, ...props2 }))), /* @__PURE__ */ React88.createElement(Spacing, { gap: "3", className: tw("p-5") }, /* @__PURE__ */ React88.createElement(RangeCalendar, { className: calendar() }), 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))));
|
15036
|
+
};
|
15037
|
+
DateRangePickerCalendar.displayName = "DateRangePicker.Calendar";
|
15038
|
+
var DateRangePickerField = ({ clearSelectionEnabled = true, disabled = false }) => {
|
15039
|
+
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)));
|
15040
|
+
};
|
15041
|
+
DateRangePickerField.displayName = "DateRangePicker.Field";
|
15042
|
+
var createDateRangePickerBase = (variant) => {
|
15043
|
+
const dateRangePicker = ({
|
15044
|
+
disabled,
|
15045
|
+
valid,
|
15046
|
+
shouldCloseOnSelect,
|
15047
|
+
errorMessage,
|
15048
|
+
clearSelectionEnabled = true,
|
15049
|
+
presets,
|
15050
|
+
children,
|
15051
|
+
...props
|
15052
|
+
}) => {
|
15053
|
+
const content = children ?? /* @__PURE__ */ React88.createElement(React88.Fragment, null, /* @__PURE__ */ React88.createElement(DateRangePickerField, { clearSelectionEnabled, disabled }), /* @__PURE__ */ React88.createElement(DateRangePickerCalendar, { variant, granularity: props.granularity, errorMessage }));
|
15054
|
+
return /* @__PURE__ */ React88.createElement(
|
15055
|
+
DateRangePickerCalendarPropsContext.Provider,
|
15056
|
+
{
|
15057
|
+
value: { variant, granularity: props.granularity, errorMessage, presets }
|
15058
|
+
},
|
15059
|
+
/* @__PURE__ */ React88.createElement(DateRangePicker, { ...props, variant, isDisabled: disabled, isInvalid: valid === false }, content)
|
15060
|
+
);
|
15061
|
+
};
|
15062
|
+
dateRangePicker.Calendar = DateRangePickerCalendar;
|
15063
|
+
dateRangePicker.Field = DateRangePickerField;
|
15064
|
+
dateRangePicker.displayName = variant === "date" ? "DateRangePickerBase" : "DateTimeRangePickerBase";
|
15065
|
+
return dateRangePicker;
|
15066
|
+
};
|
15067
|
+
var DateRangePickerBase = createDateRangePickerBase("date");
|
15068
|
+
var DateTimeRangePickerBase = createDateRangePickerBase("datetime");
|
15069
|
+
var createDateRangePicker = (variant) => {
|
15070
|
+
const dateRangePicker = (props) => {
|
15071
|
+
const { labelProps, fieldProps } = useLabel3({ "label": props.labelText, "aria-label": props["aria-label"] });
|
15072
|
+
const errorMessageId = useId11();
|
15073
|
+
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId, "errorMessage": props.helperText ?? props.error } : {};
|
15074
|
+
const { "data-testid": dataTestId, ...labelControlProps } = getLabelControlProps(props);
|
15075
|
+
const baseProps = omit9(props, Object.keys(labelControlProps));
|
15076
|
+
const allProps = { ...baseProps, ...fieldProps, ...errorProps, disabled: props.disabled, valid: props.valid };
|
15077
|
+
return /* @__PURE__ */ React88.createElement(LabelControl, { ...labelProps, ...labelControlProps, messageId: errorMessageId, className: "Aquarium-DatePicker" }, variant === "date" ? /* @__PURE__ */ React88.createElement(DateRangePickerBase, { ...allProps }) : /* @__PURE__ */ React88.createElement(DateTimeRangePickerBase, { ...allProps }));
|
15078
|
+
};
|
15079
|
+
dateRangePicker.Calendar = DateRangePickerCalendar;
|
15080
|
+
dateRangePicker.Field = DateRangePickerField;
|
15081
|
+
dateRangePicker.displayName = variant === "date" ? "DateRangePicker" : "DateTimeRangePicker";
|
15082
|
+
return dateRangePicker;
|
15083
|
+
};
|
15084
|
+
var DateRangePicker2 = createDateRangePicker("date");
|
15085
|
+
var DateTimeRangePicker = createDateRangePicker("datetime");
|
15086
|
+
|
15087
|
+
// src/molecules/Dialog/Dialog.tsx
|
15018
15088
|
import React90 from "react";
|
15019
|
-
import {
|
15020
|
-
|
15089
|
+
import { useDialog } from "@react-aria/dialog";
|
15090
|
+
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
15091
|
+
import { useId as useId12 } from "@react-aria/utils";
|
15092
|
+
import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
|
15093
|
+
import { omit as omit10 } from "lodash-es";
|
15094
|
+
|
15095
|
+
// src/atoms/Modal/Modal.tsx
|
15096
|
+
import React89 from "react";
|
15097
|
+
import { tv as tv13 } from "tailwind-variants";
|
15098
|
+
var modalStyles = tv13({
|
15021
15099
|
slots: {
|
15022
15100
|
overlay: "inset-0 overflow-y-auto z-modal fixed",
|
15023
15101
|
backdrop: "-z-10 fixed min-w-full min-h-full bg-body-intense opacity-70",
|
@@ -15120,55 +15198,55 @@ var Modal = ({
|
|
15120
15198
|
...rest
|
15121
15199
|
}) => {
|
15122
15200
|
const { overlay } = modalStyles({ kind });
|
15123
|
-
return open ? /* @__PURE__ */
|
15201
|
+
return open ? /* @__PURE__ */ React89.createElement("div", { ...rest, className: overlay({ className }) }, children) : null;
|
15124
15202
|
};
|
15125
15203
|
Modal.BackDrop = ({ className, ...rest }) => {
|
15126
15204
|
const { backdrop } = modalStyles();
|
15127
|
-
return /* @__PURE__ */
|
15205
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: backdrop({ className }) });
|
15128
15206
|
};
|
15129
|
-
Modal.Dialog =
|
15207
|
+
Modal.Dialog = React89.forwardRef(
|
15130
15208
|
({ kind = "dialog", children, className, size = "md", ...rest }, ref) => {
|
15131
15209
|
const { dialog } = modalStyles({ kind, size });
|
15132
|
-
return /* @__PURE__ */
|
15210
|
+
return /* @__PURE__ */ React89.createElement("div", { ref, "aria-modal": "true", ...rest, className: dialog({ className }) }, children);
|
15133
15211
|
}
|
15134
15212
|
);
|
15135
15213
|
Modal.Header = ({ kind = "dialog", size = "md", children, className, ...rest }) => {
|
15136
15214
|
const { header } = modalStyles({ kind, size });
|
15137
|
-
return /* @__PURE__ */
|
15215
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: header({ className }) }, children);
|
15138
15216
|
};
|
15139
15217
|
Modal.HeaderImage = ({ backgroundImage, className, ...rest }) => {
|
15140
15218
|
const { headerImage } = modalStyles({ backgroundImage: Boolean(backgroundImage) });
|
15141
|
-
return backgroundImage ? /* @__PURE__ */
|
15219
|
+
return backgroundImage ? /* @__PURE__ */ React89.createElement("img", { "aria-hidden": true, src: backgroundImage, ...rest, className: headerImage({ className }) }) : /* @__PURE__ */ React89.createElement("div", { className: headerImage({ className }) });
|
15142
15220
|
};
|
15143
15221
|
Modal.CloseButtonContainer = ({ className, ...rest }) => {
|
15144
15222
|
const { closeButtonContainer } = modalStyles();
|
15145
|
-
return /* @__PURE__ */
|
15223
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: closeButtonContainer({ className }) });
|
15146
15224
|
};
|
15147
15225
|
Modal.Title = ({ kind = "dialog", children, className, ...rest }) => {
|
15148
15226
|
const { title } = modalStyles({ kind });
|
15149
|
-
return /* @__PURE__ */
|
15227
|
+
return /* @__PURE__ */ React89.createElement(Typography, { htmlTag: "h2", variant: "subheading", color: "intense", className: title({ className }), ...rest }, children);
|
15150
15228
|
};
|
15151
|
-
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */
|
15229
|
+
Modal.Subtitle = ({ children, ...rest }) => /* @__PURE__ */ React89.createElement(Typography, { variant: "small", color: "default", ...rest }, children);
|
15152
15230
|
Modal.TitleContainer = ({ children, className, ...rest }) => {
|
15153
15231
|
const { titleContainer } = modalStyles();
|
15154
|
-
return /* @__PURE__ */
|
15232
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: titleContainer({ className }) }, children);
|
15155
15233
|
};
|
15156
15234
|
Modal.Body = ({ children, className, noFooter = false, maxHeight, style, ...rest }) => {
|
15157
15235
|
const { body } = modalStyles();
|
15158
|
-
return /* @__PURE__ */
|
15236
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: body({ noFooter, className }), style: { maxHeight, ...style } }, children);
|
15159
15237
|
};
|
15160
15238
|
Modal.Footer = ({ children, className, ...rest }) => {
|
15161
15239
|
const { footer } = modalStyles();
|
15162
|
-
return /* @__PURE__ */
|
15240
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: footer({ className }) }, children);
|
15163
15241
|
};
|
15164
15242
|
Modal.Actions = ({ children, className, ...rest }) => {
|
15165
15243
|
const { actions } = modalStyles();
|
15166
|
-
return /* @__PURE__ */
|
15244
|
+
return /* @__PURE__ */ React89.createElement("div", { ...rest, className: actions({ className }) }, children);
|
15167
15245
|
};
|
15168
15246
|
|
15169
15247
|
// src/molecules/Dialog/Dialog.tsx
|
15170
|
-
var
|
15171
|
-
const ref =
|
15248
|
+
var Dialog2 = (props) => {
|
15249
|
+
const ref = React90.useRef(null);
|
15172
15250
|
const { open, onClose } = props;
|
15173
15251
|
const state = useOverlayTriggerState2({ isOpen: open, onOpenChange: (isOpen) => !isOpen && onClose?.() });
|
15174
15252
|
const { modalProps, underlayProps } = useModalOverlay(
|
@@ -15179,7 +15257,7 @@ var Dialog3 = (props) => {
|
|
15179
15257
|
if (!state.isOpen) {
|
15180
15258
|
return null;
|
15181
15259
|
}
|
15182
|
-
return /* @__PURE__ */
|
15260
|
+
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
15261
|
};
|
15184
15262
|
var DialogWrapper = ({
|
15185
15263
|
title,
|
@@ -15188,7 +15266,7 @@ var DialogWrapper = ({
|
|
15188
15266
|
primaryAction,
|
15189
15267
|
secondaryAction
|
15190
15268
|
}) => {
|
15191
|
-
const ref =
|
15269
|
+
const ref = React90.useRef(null);
|
15192
15270
|
const labelledBy = useId12();
|
15193
15271
|
const describedBy = useId12();
|
15194
15272
|
const { dialogProps } = useDialog(
|
@@ -15199,35 +15277,35 @@ var DialogWrapper = ({
|
|
15199
15277
|
},
|
15200
15278
|
ref
|
15201
15279
|
);
|
15202
|
-
return /* @__PURE__ */
|
15280
|
+
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
15281
|
};
|
15204
15282
|
|
15205
15283
|
// src/molecules/Drawer/Drawer.tsx
|
15206
|
-
import
|
15207
|
-
import { Dialog as
|
15284
|
+
import React93 from "react";
|
15285
|
+
import { Dialog as AriaDialog2, Modal as AriaModal, ModalOverlay as AriaModalOverlay } from "react-aria-components";
|
15208
15286
|
import { animated as animated5, useSpring as useSpring4 } from "@react-spring/web";
|
15209
15287
|
import { castArray as castArray3, omit as omit11 } from "lodash-es";
|
15210
15288
|
|
15211
15289
|
// src/molecules/Modal/ModalTitle.tsx
|
15212
|
-
import
|
15290
|
+
import React91 from "react";
|
15213
15291
|
import { HeadingContext, useContextProps } from "react-aria-components";
|
15214
15292
|
var ModalTitle = ({ children, ...props }) => {
|
15215
15293
|
const [ctxProps] = useContextProps({ ...props, slot: "title" }, null, HeadingContext);
|
15216
|
-
return /* @__PURE__ */
|
15294
|
+
return /* @__PURE__ */ React91.createElement(Modal.Title, { id: ctxProps.id, ...props }, children);
|
15217
15295
|
};
|
15218
15296
|
|
15219
15297
|
// src/molecules/Tabs/Tabs.tsx
|
15220
|
-
import
|
15298
|
+
import React92, { useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useRef as useRef10, useState as useState11 } from "react";
|
15221
15299
|
import { isNumber as isNumber6, kebabCase } from "lodash-es";
|
15222
15300
|
var import_chevronLeft5 = __toESM(require_chevronLeft());
|
15223
15301
|
var import_chevronRight5 = __toESM(require_chevronRight());
|
15224
15302
|
var import_warningSign4 = __toESM(require_warningSign());
|
15225
15303
|
var isTabComponent = (c) => {
|
15226
|
-
return
|
15304
|
+
return React92.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
15227
15305
|
};
|
15228
|
-
var Tab =
|
15306
|
+
var Tab = React92.forwardRef(
|
15229
15307
|
({ className, id, title, children }, ref) => {
|
15230
|
-
return /* @__PURE__ */
|
15308
|
+
return /* @__PURE__ */ React92.createElement(
|
15231
15309
|
"div",
|
15232
15310
|
{
|
15233
15311
|
ref,
|
@@ -15241,10 +15319,10 @@ var Tab = React93.forwardRef(
|
|
15241
15319
|
);
|
15242
15320
|
}
|
15243
15321
|
);
|
15244
|
-
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */
|
15322
|
+
var TabContainer = ({ className, children, ...rest }) => /* @__PURE__ */ React92.createElement("div", { ...rest, className: classNames("py-6 z-0", className) }, children);
|
15245
15323
|
var ModalTab = Tab;
|
15246
15324
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
15247
|
-
const Tab2 =
|
15325
|
+
const Tab2 = React92.forwardRef(
|
15248
15326
|
({
|
15249
15327
|
id,
|
15250
15328
|
value,
|
@@ -15263,11 +15341,11 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15263
15341
|
const _id = id ?? kebabCase(title);
|
15264
15342
|
let statusIcon = void 0;
|
15265
15343
|
if (status === "warning") {
|
15266
|
-
statusIcon = /* @__PURE__ */
|
15344
|
+
statusIcon = /* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "warning-default" });
|
15267
15345
|
} else if (status === "error") {
|
15268
|
-
statusIcon = /* @__PURE__ */
|
15346
|
+
statusIcon = /* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_warningSign4.default, color: selected ? void 0 : "danger-default" });
|
15269
15347
|
}
|
15270
|
-
const tab = /* @__PURE__ */
|
15348
|
+
const tab = /* @__PURE__ */ React92.createElement(
|
15271
15349
|
Component,
|
15272
15350
|
{
|
15273
15351
|
ref,
|
@@ -15288,7 +15366,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15288
15366
|
tabIndex: disabled ? void 0 : 0,
|
15289
15367
|
...rest
|
15290
15368
|
},
|
15291
|
-
/* @__PURE__ */
|
15369
|
+
/* @__PURE__ */ React92.createElement(
|
15292
15370
|
Typography2,
|
15293
15371
|
{
|
15294
15372
|
htmlTag: "div",
|
@@ -15296,8 +15374,8 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15296
15374
|
color: selected ? "primary-default" : disabled ? "default" : "current",
|
15297
15375
|
className: tw("inline-flex items-center gap-3")
|
15298
15376
|
},
|
15299
|
-
showNotification ? /* @__PURE__ */
|
15300
|
-
isNumber6(badge) && /* @__PURE__ */
|
15377
|
+
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),
|
15378
|
+
isNumber6(badge) && /* @__PURE__ */ React92.createElement(
|
15301
15379
|
Typography2,
|
15302
15380
|
{
|
15303
15381
|
htmlTag: "span",
|
@@ -15305,7 +15383,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15305
15383
|
color: selected ? "primary-intense" : "grey-5",
|
15306
15384
|
className: "leading-none"
|
15307
15385
|
},
|
15308
|
-
/* @__PURE__ */
|
15386
|
+
/* @__PURE__ */ React92.createElement(
|
15309
15387
|
TabBadge,
|
15310
15388
|
{
|
15311
15389
|
kind: "filled",
|
@@ -15317,7 +15395,7 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
15317
15395
|
statusIcon
|
15318
15396
|
)
|
15319
15397
|
);
|
15320
|
-
return tooltip ? /* @__PURE__ */
|
15398
|
+
return tooltip ? /* @__PURE__ */ React92.createElement(Tooltip, { content: tooltip }, tab) : tab;
|
15321
15399
|
}
|
15322
15400
|
);
|
15323
15401
|
Tab2.displayName = displayName;
|
@@ -15328,7 +15406,7 @@ var CARET_OFFSET = 24;
|
|
15328
15406
|
var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderChildren) => {
|
15329
15407
|
const Tabs2 = (props) => {
|
15330
15408
|
const { className, value, defaultValue, onChange, children } = props;
|
15331
|
-
const childArr =
|
15409
|
+
const childArr = React92.Children.toArray(children);
|
15332
15410
|
const firstTab = childArr[0];
|
15333
15411
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
15334
15412
|
const [selected, setSelected] = useState11(value ?? defaultValue ?? firstTabValue ?? 0);
|
@@ -15340,7 +15418,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15340
15418
|
const revealSelectedTab = ({ smooth }) => {
|
15341
15419
|
const container = containerRef.current;
|
15342
15420
|
const tabs = tabsRef.current;
|
15343
|
-
const values =
|
15421
|
+
const values = React92.Children.map(
|
15344
15422
|
children,
|
15345
15423
|
(tab, i) => tab?.props.value ?? i
|
15346
15424
|
);
|
@@ -15378,7 +15456,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15378
15456
|
updateCarets();
|
15379
15457
|
setSelected(value);
|
15380
15458
|
revealSelectedTab({ smooth: value !== selected });
|
15381
|
-
}, [value,
|
15459
|
+
}, [value, React92.Children.count(children)]);
|
15382
15460
|
useLayoutEffect2(() => {
|
15383
15461
|
updateCarets();
|
15384
15462
|
containerRef.current?.addEventListener("scroll", updateCarets);
|
@@ -15440,12 +15518,12 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15440
15518
|
const handleSelected = (key) => {
|
15441
15519
|
(onChange ?? setSelected)(key);
|
15442
15520
|
};
|
15443
|
-
|
15521
|
+
React92.Children.forEach(children, (c) => {
|
15444
15522
|
if (c && !isTabComponent(c)) {
|
15445
15523
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
15446
15524
|
}
|
15447
15525
|
});
|
15448
|
-
return /* @__PURE__ */
|
15526
|
+
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
15527
|
"div",
|
15450
15528
|
{
|
15451
15529
|
ref: tabsRef,
|
@@ -15453,9 +15531,9 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15453
15531
|
"aria-label": "tabs",
|
15454
15532
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
15455
15533
|
},
|
15456
|
-
|
15534
|
+
React92.Children.map(
|
15457
15535
|
children,
|
15458
|
-
(tab, index) => tab ? /* @__PURE__ */
|
15536
|
+
(tab, index) => tab ? /* @__PURE__ */ React92.createElement(
|
15459
15537
|
TabItemComponent,
|
15460
15538
|
{
|
15461
15539
|
key: tab.props.value,
|
@@ -15467,26 +15545,26 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15467
15545
|
}
|
15468
15546
|
) : void 0
|
15469
15547
|
)
|
15470
|
-
)), leftCaret && /* @__PURE__ */
|
15548
|
+
)), 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
15549
|
"div",
|
15472
15550
|
{
|
15473
15551
|
onClick: () => handleScrollToNext("left"),
|
15474
15552
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15475
15553
|
},
|
15476
|
-
/* @__PURE__ */
|
15477
|
-
)), rightCaret && /* @__PURE__ */
|
15554
|
+
/* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_chevronLeft5.default })
|
15555
|
+
)), rightCaret && /* @__PURE__ */ React92.createElement(
|
15478
15556
|
"div",
|
15479
15557
|
{
|
15480
15558
|
onClick: () => handleScrollToNext("right"),
|
15481
15559
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
15482
15560
|
},
|
15483
|
-
/* @__PURE__ */
|
15561
|
+
/* @__PURE__ */ React92.createElement(
|
15484
15562
|
"div",
|
15485
15563
|
{
|
15486
15564
|
onClick: () => handleScrollToNext("right"),
|
15487
15565
|
className: tw("hover:bg-muted p-2 leading-none cursor-pointer")
|
15488
15566
|
},
|
15489
|
-
/* @__PURE__ */
|
15567
|
+
/* @__PURE__ */ React92.createElement(InlineIcon, { icon: import_chevronRight5.default })
|
15490
15568
|
)
|
15491
15569
|
)), renderChildren(children, selected, props));
|
15492
15570
|
};
|
@@ -15494,7 +15572,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
15494
15572
|
Tabs2.Tab = TabComponent;
|
15495
15573
|
return Tabs2;
|
15496
15574
|
};
|
15497
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
15575
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React92.createElement(TabContainer, null, children.find(
|
15498
15576
|
(node, index) => node?.props.value === selected || index === selected
|
15499
15577
|
)));
|
15500
15578
|
|
@@ -15522,7 +15600,7 @@ var Drawer = ({
|
|
15522
15600
|
secondaryActions,
|
15523
15601
|
closeOnEsc = true
|
15524
15602
|
}) => {
|
15525
|
-
const [hidden, setHidden] =
|
15603
|
+
const [hidden, setHidden] = React93.useState(!open);
|
15526
15604
|
if (open && hidden) {
|
15527
15605
|
setHidden(!open);
|
15528
15606
|
}
|
@@ -15545,10 +15623,10 @@ var Drawer = ({
|
|
15545
15623
|
}
|
15546
15624
|
const dialogSize = size === "lg" ? "full" : size;
|
15547
15625
|
const styles = modalStyles({ kind: "drawer", size: dialogSize });
|
15548
|
-
const childElements =
|
15626
|
+
const childElements = React93.Children.toArray(children).filter(React93.isValidElement);
|
15549
15627
|
const onlyChild = childElements.length === 1 ? childElements[0] : null;
|
15550
15628
|
const hasTabs = isComponentType(onlyChild, Tabs);
|
15551
|
-
return /* @__PURE__ */
|
15629
|
+
return /* @__PURE__ */ React93.createElement(
|
15552
15630
|
AriaModalOverlay,
|
15553
15631
|
{
|
15554
15632
|
isOpen: !hidden,
|
@@ -15557,60 +15635,60 @@ var Drawer = ({
|
|
15557
15635
|
isKeyboardDismissDisabled: !closeOnEsc,
|
15558
15636
|
className: styles.overlay({ className: "Aquarium-Drawer" })
|
15559
15637
|
},
|
15560
|
-
/* @__PURE__ */
|
15561
|
-
/* @__PURE__ */
|
15638
|
+
/* @__PURE__ */ React93.createElement(AnimatedBackDrop, { style: { opacity } }),
|
15639
|
+
/* @__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
15640
|
DrawerTabs,
|
15563
15641
|
{
|
15564
15642
|
...onlyChild.props,
|
15565
15643
|
className: tw("[&>div:first-child]:px-5 grow flex flex-col overflow-y-auto")
|
15566
15644
|
}
|
15567
|
-
) : /* @__PURE__ */
|
15645
|
+
) : /* @__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
15646
|
);
|
15569
15647
|
};
|
15570
|
-
var DrawerTabs = createTabsComponent(ModalTab, TabItem, "DrawerTabs", (children, selected) => /* @__PURE__ */
|
15648
|
+
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
15649
|
(node, index) => node?.props.value === selected || index === selected
|
15572
15650
|
))));
|
15573
15651
|
|
15574
15652
|
// src/molecules/Dropdown/Dropdown.tsx
|
15575
|
-
import
|
15653
|
+
import React95 from "react";
|
15576
15654
|
import { OverlayTriggerStateContext as OverlayTriggerStateContext2 } from "react-aria-components";
|
15577
15655
|
|
15578
15656
|
// src/molecules/Popover/Popover.tsx
|
15579
|
-
import
|
15657
|
+
import React94, { createContext as createContext5 } from "react";
|
15580
15658
|
import { DialogTrigger, OverlayTriggerStateContext } from "react-aria-components";
|
15581
|
-
import { mergeProps as
|
15659
|
+
import { mergeProps as mergeProps5 } from "@react-aria/utils";
|
15582
15660
|
var PopoverPropsContext = createContext5({});
|
15583
|
-
var
|
15661
|
+
var Popover2 = ({ children, onOpenChange: _onOpenChange, onClose, onOpen, ...props }) => {
|
15584
15662
|
const onOpenChange = (isOpen) => {
|
15585
15663
|
_onOpenChange?.(isOpen);
|
15586
15664
|
isOpen ? onOpen?.() : onClose?.();
|
15587
15665
|
};
|
15588
|
-
return /* @__PURE__ */
|
15666
|
+
return /* @__PURE__ */ React94.createElement(PopoverPropsContext.Provider, { value: props }, /* @__PURE__ */ React94.createElement(DialogTrigger, { ...props, onOpenChange }, children));
|
15589
15667
|
};
|
15590
|
-
|
15668
|
+
Popover2.displayName = "Popover";
|
15591
15669
|
var Trigger = ({ children }) => {
|
15592
|
-
return /* @__PURE__ */
|
15670
|
+
return /* @__PURE__ */ React94.createElement(Pressable, { "aria-haspopup": "true" }, children);
|
15593
15671
|
};
|
15594
15672
|
Trigger.displayName = "Popover.Trigger";
|
15595
|
-
|
15673
|
+
Popover2.Trigger = Trigger;
|
15596
15674
|
var Panel = ({ className, children }) => {
|
15597
|
-
const { offset = 0, onOpenChange, ...props } =
|
15598
|
-
return /* @__PURE__ */
|
15675
|
+
const { offset = 0, onOpenChange, ...props } = React94.useContext(PopoverPropsContext);
|
15676
|
+
return /* @__PURE__ */ React94.createElement(Popover, { ...props, className, offset }, /* @__PURE__ */ React94.createElement(Dialog, null, children));
|
15599
15677
|
};
|
15600
15678
|
Panel.displayName = "Popover.Panel";
|
15601
|
-
|
15679
|
+
Popover2.Panel = Panel;
|
15602
15680
|
var CloseToggle = ({ children }) => {
|
15603
|
-
const ctx =
|
15681
|
+
const ctx = React94.useContext(OverlayTriggerStateContext);
|
15604
15682
|
const onClick = ctx?.close;
|
15605
|
-
const child =
|
15606
|
-
return
|
15683
|
+
const child = React94.Children.only(children);
|
15684
|
+
return React94.cloneElement(child, { ...mergeProps5(child.props, { onClick }) });
|
15607
15685
|
};
|
15608
15686
|
CloseToggle.displayName = "Popover.CloseToggle";
|
15609
|
-
|
15687
|
+
Popover2.CloseToggle = CloseToggle;
|
15610
15688
|
|
15611
15689
|
// src/molecules/Dropdown/Dropdown.tsx
|
15612
15690
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
15613
|
-
return /* @__PURE__ */
|
15691
|
+
return /* @__PURE__ */ React95.createElement(Popover2, { placement }, /* @__PURE__ */ React95.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React95.createElement(Popover2.Panel, { className: "Aquarium-Dropdown" }, content));
|
15614
15692
|
};
|
15615
15693
|
var DropdownMenu3 = ({
|
15616
15694
|
title,
|
@@ -15619,13 +15697,13 @@ var DropdownMenu3 = ({
|
|
15619
15697
|
triggerId,
|
15620
15698
|
setClose = () => void 0
|
15621
15699
|
}) => {
|
15622
|
-
const menuRef =
|
15623
|
-
|
15700
|
+
const menuRef = React95.useRef(null);
|
15701
|
+
React95.useEffect(() => {
|
15624
15702
|
const id = setTimeout(() => (menuRef.current?.children[0]).focus());
|
15625
15703
|
return () => clearTimeout(id);
|
15626
15704
|
}, [menuRef.current]);
|
15627
|
-
return /* @__PURE__ */
|
15628
|
-
return
|
15705
|
+
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) => {
|
15706
|
+
return React95.cloneElement(child, { setClose });
|
15629
15707
|
})));
|
15630
15708
|
};
|
15631
15709
|
var DropdownItem = ({
|
@@ -15638,7 +15716,7 @@ var DropdownItem = ({
|
|
15638
15716
|
setClose = () => void 0,
|
15639
15717
|
...props
|
15640
15718
|
}) => {
|
15641
|
-
const ctx =
|
15719
|
+
const ctx = React95.useContext(OverlayTriggerStateContext2);
|
15642
15720
|
const handleSelect = () => {
|
15643
15721
|
onSelect?.();
|
15644
15722
|
ctx?.close();
|
@@ -15672,8 +15750,8 @@ var DropdownItem = ({
|
|
15672
15750
|
handleSelect();
|
15673
15751
|
}
|
15674
15752
|
};
|
15675
|
-
const itemContent = /* @__PURE__ */
|
15676
|
-
return /* @__PURE__ */
|
15753
|
+
const itemContent = /* @__PURE__ */ React95.createElement("div", { className: tw("py-3 px-4") }, children);
|
15754
|
+
return /* @__PURE__ */ React95.createElement(
|
15677
15755
|
"li",
|
15678
15756
|
{
|
15679
15757
|
role: "menuitem",
|
@@ -15690,14 +15768,14 @@ var DropdownItem = ({
|
|
15690
15768
|
})
|
15691
15769
|
)
|
15692
15770
|
},
|
15693
|
-
tooltip ? /* @__PURE__ */
|
15771
|
+
tooltip ? /* @__PURE__ */ React95.createElement(Tooltip, { content: tooltip, placement: tooltipPlacement, display: "block" }, /* @__PURE__ */ React95.createElement("div", { tabIndex: 0, className: tw("grow") }, itemContent)) : itemContent
|
15694
15772
|
);
|
15695
15773
|
};
|
15696
15774
|
Dropdown.Menu = DropdownMenu3;
|
15697
15775
|
Dropdown.Item = DropdownItem;
|
15698
15776
|
|
15699
15777
|
// src/molecules/EmptyState/EmptyState.tsx
|
15700
|
-
import
|
15778
|
+
import React96 from "react";
|
15701
15779
|
var EmptyStateLayout = /* @__PURE__ */ ((EmptyStateLayout2) => {
|
15702
15780
|
EmptyStateLayout2["Vertical"] = "vertical";
|
15703
15781
|
EmptyStateLayout2["Horizontal"] = "horizontal";
|
@@ -15735,7 +15813,7 @@ var EmptyState = ({
|
|
15735
15813
|
fullHeight = isVerticalLayout(layout) ? true : false
|
15736
15814
|
}) => {
|
15737
15815
|
const template = layoutStyle(layout);
|
15738
|
-
return /* @__PURE__ */
|
15816
|
+
return /* @__PURE__ */ React96.createElement(
|
15739
15817
|
Box,
|
15740
15818
|
{
|
15741
15819
|
className: classNames(
|
@@ -15751,7 +15829,7 @@ var EmptyState = ({
|
|
15751
15829
|
backgroundColor: "transparent",
|
15752
15830
|
borderColor: "default"
|
15753
15831
|
},
|
15754
|
-
/* @__PURE__ */
|
15832
|
+
/* @__PURE__ */ React96.createElement(
|
15755
15833
|
Box.Flex,
|
15756
15834
|
{
|
15757
15835
|
style: { gap: "56px" },
|
@@ -15760,19 +15838,149 @@ var EmptyState = ({
|
|
15760
15838
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
15761
15839
|
height: fullHeight ? "full" : void 0
|
15762
15840
|
},
|
15763
|
-
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */
|
15841
|
+
Image2 && (typeof Image2 === "string" ? /* @__PURE__ */ React96.createElement(
|
15764
15842
|
"img",
|
15765
15843
|
{
|
15766
15844
|
src: Image2,
|
15767
15845
|
alt: imageAlt,
|
15768
15846
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
15769
15847
|
}
|
15770
|
-
) : /* @__PURE__ */
|
15771
|
-
/* @__PURE__ */
|
15848
|
+
) : /* @__PURE__ */ React96.createElement("div", { className: tw("animate-draw") }, /* @__PURE__ */ React96.createElement(Image2, null))),
|
15849
|
+
/* @__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
15850
|
)
|
15773
15851
|
);
|
15774
15852
|
};
|
15775
15853
|
|
15854
|
+
// src/atoms/Filter/Filter.tsx
|
15855
|
+
import React97 from "react";
|
15856
|
+
import {
|
15857
|
+
Button as AriaButton4,
|
15858
|
+
DatePickerStateContext as AriaDatePickerStateContext2,
|
15859
|
+
DateRangePickerStateContext as AriaDateRangePickerStateContext2,
|
15860
|
+
Group as AriaGroup
|
15861
|
+
} from "react-aria-components";
|
15862
|
+
import { tv as tv14 } from "tailwind-variants";
|
15863
|
+
var import_cross7 = __toESM(require_cross());
|
15864
|
+
var DATE_FORMAT_OPTIONS = {
|
15865
|
+
locale: "en-GB",
|
15866
|
+
options: { day: "numeric", month: "numeric", year: "numeric" }
|
15867
|
+
};
|
15868
|
+
var filterWrapper = tv14({
|
15869
|
+
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",
|
15870
|
+
variants: {
|
15871
|
+
isHovered: {
|
15872
|
+
true: "hover:bg-muted"
|
15873
|
+
},
|
15874
|
+
isFocusWithin: {
|
15875
|
+
true: "border-solid border-info-default"
|
15876
|
+
},
|
15877
|
+
isInvalid: {
|
15878
|
+
true: "border-solid border-danger-default"
|
15879
|
+
},
|
15880
|
+
hasValue: {
|
15881
|
+
true: "border-solid"
|
15882
|
+
}
|
15883
|
+
}
|
15884
|
+
});
|
15885
|
+
var FilterTrigger = ({
|
15886
|
+
labelText,
|
15887
|
+
icon,
|
15888
|
+
badge,
|
15889
|
+
onClear,
|
15890
|
+
onClick,
|
15891
|
+
value,
|
15892
|
+
// children,
|
15893
|
+
error: error2 = false,
|
15894
|
+
...props
|
15895
|
+
}) => {
|
15896
|
+
const ariaDatePickerState = React97.useContext(AriaDatePickerStateContext2);
|
15897
|
+
const ariaDateRangePickerState = React97.useContext(AriaDateRangePickerStateContext2);
|
15898
|
+
const isUsedInsideDatePicker = !!ariaDatePickerState?.value;
|
15899
|
+
const isUsedInsideDateRangePicker = !!ariaDateRangePickerState?.value.start && !!ariaDateRangePickerState.value.end;
|
15900
|
+
const onClearDatePickerRelated = () => {
|
15901
|
+
if (isUsedInsideDatePicker) {
|
15902
|
+
ariaDatePickerState.setValue(null);
|
15903
|
+
} else if (isUsedInsideDateRangePicker) {
|
15904
|
+
ariaDateRangePickerState.setValue(null);
|
15905
|
+
}
|
15906
|
+
};
|
15907
|
+
const hasValue = !!value || isUsedInsideDatePicker || isUsedInsideDateRangePicker;
|
15908
|
+
const showClearButton = !!onClear && !!value || isUsedInsideDatePicker || isUsedInsideDateRangePicker;
|
15909
|
+
return /* @__PURE__ */ React97.createElement(
|
15910
|
+
AriaGroup,
|
15911
|
+
{
|
15912
|
+
...props,
|
15913
|
+
isInvalid: error2,
|
15914
|
+
className: (renderProps) => filterWrapper({ ...renderProps, hasValue: hasValue || !!badge })
|
15915
|
+
},
|
15916
|
+
/* @__PURE__ */ React97.createElement(React97.Fragment, null, /* @__PURE__ */ React97.createElement(
|
15917
|
+
AriaButton4,
|
15918
|
+
{
|
15919
|
+
onPress: () => {
|
15920
|
+
onClick && onClick();
|
15921
|
+
},
|
15922
|
+
className: tw("outline-0 outline-none flex items-center py-3 cursor-pointer", {
|
15923
|
+
"pl-4 pr-[6px]": showClearButton,
|
15924
|
+
// keep padding right the same as padding left of <FilterClearButton>
|
15925
|
+
"px-4": !showClearButton
|
15926
|
+
})
|
15927
|
+
},
|
15928
|
+
/* @__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(
|
15929
|
+
Typography2.Small,
|
15930
|
+
{
|
15931
|
+
className: tw("truncate max-w-[233px]"),
|
15932
|
+
color: error2 ? "danger-intense" : "primary-active"
|
15933
|
+
},
|
15934
|
+
value,
|
15935
|
+
isUsedInsideDatePicker && /* @__PURE__ */ React97.createElement(DateDisplay, { state: ariaDatePickerState }),
|
15936
|
+
isUsedInsideDateRangePicker && /* @__PURE__ */ React97.createElement(DateDisplay, { state: ariaDateRangePickerState })
|
15937
|
+
)))
|
15938
|
+
), showClearButton && /* @__PURE__ */ React97.createElement(
|
15939
|
+
FilterClearButton,
|
15940
|
+
{
|
15941
|
+
onClear: () => {
|
15942
|
+
onClearDatePickerRelated();
|
15943
|
+
onClear?.();
|
15944
|
+
}
|
15945
|
+
}
|
15946
|
+
))
|
15947
|
+
);
|
15948
|
+
};
|
15949
|
+
var isDateRangePickerState = (state) => {
|
15950
|
+
return "value" in state && state.value !== null && "start" in state.value;
|
15951
|
+
};
|
15952
|
+
var DateDisplay = ({ state }) => {
|
15953
|
+
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);
|
15954
|
+
const secondary = isDateRangePickerState(state) ? state.formatValue(DATE_FORMAT_OPTIONS.locale, DATE_FORMAT_OPTIONS.options)?.end : void 0;
|
15955
|
+
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)));
|
15956
|
+
};
|
15957
|
+
var FilterClearButton = ({ onClear }) => (
|
15958
|
+
// 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.
|
15959
|
+
/* @__PURE__ */ React97.createElement(
|
15960
|
+
"button",
|
15961
|
+
{
|
15962
|
+
"aria-label": "Clear filter",
|
15963
|
+
onClick: (e) => {
|
15964
|
+
e.preventDefault();
|
15965
|
+
e.stopPropagation();
|
15966
|
+
const previousButton = e.currentTarget.previousElementSibling;
|
15967
|
+
if (previousButton instanceof HTMLElement) {
|
15968
|
+
previousButton.focus();
|
15969
|
+
}
|
15970
|
+
onClear();
|
15971
|
+
},
|
15972
|
+
className: tw(
|
15973
|
+
"py-[10px] pl-[6px] pr-4 inline-flex items-center hover:bg-default focus:bg-default outline-0 outline-none rounded-r-full"
|
15974
|
+
// keep padding left the same as padding right of its button sibling.
|
15975
|
+
)
|
15976
|
+
},
|
15977
|
+
/* @__PURE__ */ React97.createElement(InlineIcon, { icon: import_cross7.default })
|
15978
|
+
)
|
15979
|
+
);
|
15980
|
+
var Filter = () => null;
|
15981
|
+
FilterTrigger.displayName = "Filter.Trigger";
|
15982
|
+
Filter.Trigger = FilterTrigger;
|
15983
|
+
|
15776
15984
|
// src/molecules/LineClamp/LineClamp.tsx
|
15777
15985
|
import React98 from "react";
|
15778
15986
|
var LineClamp2 = ({
|
@@ -15844,9 +16052,9 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
15844
16052
|
|
15845
16053
|
// src/molecules/Modal/Modal.tsx
|
15846
16054
|
import React101 from "react";
|
15847
|
-
import { Dialog as
|
16055
|
+
import { Dialog as AriaDialog3, Modal as AriaModal2, ModalOverlay as AriaModalOverlay2 } from "react-aria-components";
|
15848
16056
|
import { castArray as castArray4, omit as omit12 } from "lodash-es";
|
15849
|
-
var
|
16057
|
+
var import_cross8 = __toESM(require_cross());
|
15850
16058
|
var Modal2 = ({
|
15851
16059
|
open,
|
15852
16060
|
onClose,
|
@@ -15874,7 +16082,7 @@ var Modal2 = ({
|
|
15874
16082
|
className: styles.overlay({ className: "Aquarium-Modal" })
|
15875
16083
|
},
|
15876
16084
|
size !== "screen" && /* @__PURE__ */ React101.createElement(Modal.BackDrop, { className: styles.backdrop() }),
|
15877
|
-
/* @__PURE__ */ React101.createElement(AriaModal2, { className: styles.dialog() }, /* @__PURE__ */ React101.createElement(
|
16085
|
+
/* @__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
16086
|
Modal.Header,
|
15879
16087
|
{
|
15880
16088
|
kind: "dialog",
|
@@ -16587,7 +16795,7 @@ import { castArray as castArray6 } from "lodash-es";
|
|
16587
16795
|
|
16588
16796
|
// src/atoms/PageHeader/PageHeader.tsx
|
16589
16797
|
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);
|
16798
|
+
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
16799
|
PageHeader.Container = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col grow gap-0"), className), ...rest }, children);
|
16592
16800
|
PageHeader.TitleContainer = ({ children, className, ...rest }) => /* @__PURE__ */ React108.createElement("div", { className: classNames(tw("flex flex-col justify-center gap-2"), className), ...rest }, children);
|
16593
16801
|
PageHeader.Title = ({ isSubHeader = false, children, ...rest }) => /* @__PURE__ */ React108.createElement(
|
@@ -16647,9 +16855,9 @@ PageHeader2.SubHeader.displayName = "PageHeader.SubHeader";
|
|
16647
16855
|
|
16648
16856
|
// src/molecules/Popover/PopoverContext.tsx
|
16649
16857
|
import { createContext as createContext6, useContext as useContext8 } from "react";
|
16650
|
-
var
|
16858
|
+
var PopoverContext = createContext6(null);
|
16651
16859
|
var usePopoverContext = () => {
|
16652
|
-
const ctx = useContext8(
|
16860
|
+
const ctx = useContext8(PopoverContext);
|
16653
16861
|
if (ctx === null) {
|
16654
16862
|
throw new Error("PopoverContext was used outside of provider.");
|
16655
16863
|
}
|
@@ -16681,12 +16889,12 @@ var PopoverDialogPropsContext = createContext7({
|
|
16681
16889
|
primaryAction: { text: "", onClick: noop3 }
|
16682
16890
|
});
|
16683
16891
|
var PopoverDialog2 = ({ placement, open, children, ...props }) => {
|
16684
|
-
return /* @__PURE__ */ React111.createElement(
|
16892
|
+
return /* @__PURE__ */ React111.createElement(Popover2, { placement }, /* @__PURE__ */ React111.createElement(PopoverDialogPropsContext.Provider, { value: props }, children));
|
16685
16893
|
};
|
16686
|
-
PopoverDialog2.Trigger =
|
16894
|
+
PopoverDialog2.Trigger = Popover2.Trigger;
|
16687
16895
|
var Prompt = ({ children }) => {
|
16688
16896
|
const { title, primaryAction, secondaryAction } = React111.useContext(PopoverDialogPropsContext);
|
16689
|
-
return /* @__PURE__ */ React111.createElement(
|
16897
|
+
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
16898
|
};
|
16691
16899
|
Prompt.displayName = "PopoverDialog.Prompt";
|
16692
16900
|
PopoverDialog2.Prompt = Prompt;
|
@@ -17420,7 +17628,7 @@ Timeline2.Skeleton.displayName = "Timeline.Skeleton";
|
|
17420
17628
|
|
17421
17629
|
// src/molecules/TimePicker/TimePicker.tsx
|
17422
17630
|
import React128 from "react";
|
17423
|
-
var TimePicker = (props) => /* @__PURE__ */ React128.createElement(
|
17631
|
+
var TimePicker = (props) => /* @__PURE__ */ React128.createElement(TimeField2, { ...props });
|
17424
17632
|
|
17425
17633
|
// src/utils/table/sortByColumn.ts
|
17426
17634
|
var sortByColumn = (items, column, sortState) => {
|
@@ -17702,16 +17910,16 @@ export {
|
|
17702
17910
|
ControlLabel,
|
17703
17911
|
DataList2 as DataList,
|
17704
17912
|
DataTable,
|
17705
|
-
DatePicker,
|
17913
|
+
DatePicker2 as DatePicker,
|
17706
17914
|
DatePickerBase,
|
17707
|
-
DateRangePicker,
|
17915
|
+
DateRangePicker2 as DateRangePicker,
|
17708
17916
|
DateRangePickerBase,
|
17709
17917
|
DateTimePicker,
|
17710
17918
|
DateTimePickerBase,
|
17711
17919
|
DateTimeRangePicker,
|
17712
17920
|
DateTimeRangePickerBase,
|
17713
17921
|
DesignSystemContext,
|
17714
|
-
|
17922
|
+
Dialog2 as Dialog,
|
17715
17923
|
Divider2 as Divider,
|
17716
17924
|
Drawer,
|
17717
17925
|
Dropdown,
|
@@ -17720,6 +17928,7 @@ export {
|
|
17720
17928
|
EmptyState,
|
17721
17929
|
EmptyStateLayout,
|
17722
17930
|
FileInput,
|
17931
|
+
Filter,
|
17723
17932
|
FormControl,
|
17724
17933
|
Grid,
|
17725
17934
|
HelperText,
|
@@ -17748,7 +17957,7 @@ export {
|
|
17748
17957
|
Option,
|
17749
17958
|
PageHeader2 as PageHeader,
|
17750
17959
|
Pagination,
|
17751
|
-
|
17960
|
+
Popover2 as Popover,
|
17752
17961
|
PopoverDialog2 as PopoverDialog,
|
17753
17962
|
Portal,
|
17754
17963
|
PositionerPlacement,
|