@optimum-intelligence/opti-ui 0.7.6 → 0.8.1
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/CHANGELOG.md +121 -0
- package/README.md +20 -10
- package/dist/components/alert/Alert.d.ts +5 -2
- package/dist/components/alert/Alert.js +67 -65
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app-shell/AppShell.d.ts +25 -8
- package/dist/components/app-shell/AppShell.js +428 -397
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +6 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +42 -40
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/calendar/Calendar.js +140 -136
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +9 -3
- package/dist/components/combobox/Combobox.js +220 -231
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +13 -4
- package/dist/components/command-palette/CommandPalette.js +91 -89
- package/dist/components/command-palette/CommandPalette.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +51 -17
- package/dist/components/data-table/DataTable.js +489 -278
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableContent.d.ts +7 -1
- package/dist/components/data-table/DataTableContent.js +247 -211
- package/dist/components/data-table/DataTableContent.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +56 -4
- package/dist/components/data-table/DataTableFilters.js +493 -77
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/data-table/layout.d.ts +5 -0
- package/dist/components/data-table/layout.js +23 -1
- package/dist/components/data-table/layout.js.map +1 -1
- package/dist/components/data-table/types.d.ts +35 -2
- package/dist/components/data-table/useDataTable.d.ts +1 -1
- package/dist/components/data-table/useDataTable.js +386 -332
- package/dist/components/data-table/useDataTable.js.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.js +148 -140
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/DateRangePicker.d.ts +2 -0
- package/dist/components/date-picker/DateRangePicker.js +171 -164
- package/dist/components/date-picker/DateRangePicker.js.map +1 -1
- package/dist/components/date-picker/PickerField.d.ts +6 -3
- package/dist/components/date-picker/PickerField.js +166 -159
- package/dist/components/date-picker/PickerField.js.map +1 -1
- package/dist/components/dialog/ConfirmDialog.d.ts +5 -2
- package/dist/components/dialog/ConfirmDialog.js +79 -77
- package/dist/components/dialog/ConfirmDialog.js.map +1 -1
- package/dist/components/dialog/Dialog.d.ts +5 -2
- package/dist/components/dialog/Dialog.js +65 -63
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +13 -4
- package/dist/components/drawer/Drawer.js +122 -164
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/field/Field.d.ts +38 -9
- package/dist/components/field/Field.js +66 -1
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/file-upload/FileUpload.js +2 -0
- package/dist/components/file-upload/FileUpload.js.map +1 -1
- package/dist/components/input/Input.d.ts +9 -16
- package/dist/components/input/Input.js +124 -206
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/map/colors.d.ts +2 -2
- package/dist/components/map/colors.js +12 -3
- package/dist/components/map/colors.js.map +1 -1
- package/dist/components/number-field/NumberField.d.ts +12 -3
- package/dist/components/number-field/NumberField.js +109 -130
- package/dist/components/number-field/NumberField.js.map +1 -1
- package/dist/components/pagination/Pagination.js +135 -186
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/progress/Progress.d.ts +2 -1
- package/dist/components/progress/Progress.js.map +1 -1
- package/dist/components/search-input/SearchInput.d.ts +5 -2
- package/dist/components/search-input/SearchInput.js +47 -45
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/select/Select.d.ts +13 -3
- package/dist/components/select/Select.js +144 -139
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/spinner/Spinner.d.ts +6 -2
- package/dist/components/spinner/Spinner.js +42 -40
- package/dist/components/spinner/Spinner.js.map +1 -1
- package/dist/components/stat-card/StatCard.d.ts +7 -2
- package/dist/components/stat-card/StatCard.js +1 -1
- package/dist/components/stat-card/StatCard.js.map +1 -1
- package/dist/components/stepper/Stepper.js +44 -40
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/toast/Toast.d.ts +17 -1
- package/dist/components/toast/Toast.js +65 -33
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components.json +475 -68
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +12 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -4
- package/dist/labels/Labels.d.ts +93 -0
- package/dist/labels/Labels.js +96 -0
- package/dist/labels/Labels.js.map +1 -0
- package/dist/labels/hu.d.ts +17 -0
- package/dist/labels/hu.js +124 -0
- package/dist/labels/hu.js.map +1 -0
- package/dist/llms-full.txt +274 -48
- package/dist/llms.txt +11 -4
- package/dist/opti-ui.css +370 -47
- package/dist/theme/ThemeProvider.d.ts +8 -4
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/utils/media.d.ts +9 -2
- package/dist/utils/media.js +10 -3
- package/dist/utils/media.js.map +1 -1
- package/package.json +5 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
3
|
+
import { type FormFieldProps } from '../field/Field';
|
|
3
4
|
import type { ControlSize } from '../input/Input';
|
|
4
5
|
export interface ComboboxInputGroupProps extends BaseCombobox.InputGroup.Props {
|
|
5
6
|
/** Control height. */
|
|
@@ -24,7 +25,7 @@ declare function ComboboxList({ className, ref, ...props }: BaseCombobox.List.Pr
|
|
|
24
25
|
declare function ComboboxItem({ className, children, ref, ...props }: BaseCombobox.Item.Props): React.JSX.Element;
|
|
25
26
|
declare function ComboboxEmpty({ className, ref, ...props }: BaseCombobox.Empty.Props): React.JSX.Element;
|
|
26
27
|
declare function ComboboxChips({ className, ref, ...props }: BaseCombobox.Chips.Props): React.JSX.Element;
|
|
27
|
-
declare function ComboboxChip({ className, children, removeLabel, ref, ...props }: BaseCombobox.Chip.Props & {
|
|
28
|
+
declare function ComboboxChip({ className, children, removeLabel: removeLabelProp, ref, ...props }: BaseCombobox.Chip.Props & {
|
|
28
29
|
removeLabel?: string;
|
|
29
30
|
}): React.JSX.Element;
|
|
30
31
|
declare function ComboboxGroupLabel({ className, ref, ...props }: BaseCombobox.GroupLabel.Props): React.JSX.Element;
|
|
@@ -43,9 +44,14 @@ export interface ComboboxProps extends RootProps {
|
|
|
43
44
|
description?: React.ReactNode;
|
|
44
45
|
/** Error message. When set, the field is marked invalid. */
|
|
45
46
|
error?: React.ReactNode;
|
|
47
|
+
/** Props for the wrapping `Field.Root` (className, validate, validationMode…). */
|
|
48
|
+
fieldProps?: FormFieldProps['fieldProps'];
|
|
46
49
|
/** Placeholder shown while nothing is typed or selected. */
|
|
47
50
|
placeholder?: string;
|
|
48
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Shown when the filter matches nothing. Set app-wide with `LabelsProvider` (`noResults`).
|
|
53
|
+
* @default 'No results found.'
|
|
54
|
+
*/
|
|
49
55
|
emptyText?: React.ReactNode;
|
|
50
56
|
/** Control height. */
|
|
51
57
|
size?: ControlSize;
|
|
@@ -59,7 +65,7 @@ export interface ComboboxProps extends RootProps {
|
|
|
59
65
|
/** Props for the text input. */
|
|
60
66
|
inputProps?: BaseCombobox.Input.Props;
|
|
61
67
|
}
|
|
62
|
-
declare function ComboboxComponent({ items, label, description, error, placeholder, emptyText, size, hideClear, maxChips, inputProps, name, disabled, required, multiple, ...rootProps }: ComboboxProps): React.JSX.Element;
|
|
68
|
+
declare function ComboboxComponent({ items, label, description, error, fieldProps, placeholder, emptyText: emptyTextProp, size, hideClear, maxChips, inputProps, name, disabled, required, multiple, ...rootProps }: ComboboxProps): React.JSX.Element;
|
|
63
69
|
/**
|
|
64
70
|
* Searchable select. `<Combobox items={…} />` covers single and `multiple`
|
|
65
71
|
* (chips) selection; `maxChips` keeps a multi-select on one line. Compose the
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { usePortalContainer } from "../../utils/portal.js";
|
|
3
3
|
import { withClass } from "../../utils/cx.js";
|
|
4
|
+
import { useLabels } from "../../labels/Labels.js";
|
|
4
5
|
import { CheckIcon, ChevronDownIcon, XIcon } from "../../icons/index.js";
|
|
5
|
-
import {
|
|
6
|
+
import { FormField } from "../field/Field.js";
|
|
6
7
|
import { c } from "react/compiler-runtime";
|
|
7
8
|
import "react";
|
|
8
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -87,7 +88,7 @@ function ComboboxInput(t0) {
|
|
|
87
88
|
return t2;
|
|
88
89
|
}
|
|
89
90
|
function ComboboxTrigger(t0) {
|
|
90
|
-
const $ = c(
|
|
91
|
+
const $ = c(15);
|
|
91
92
|
let children;
|
|
92
93
|
let className;
|
|
93
94
|
let props;
|
|
@@ -105,37 +106,40 @@ function ComboboxTrigger(t0) {
|
|
|
105
106
|
props = $[3];
|
|
106
107
|
ref = $[4];
|
|
107
108
|
}
|
|
108
|
-
|
|
109
|
+
const text = useLabels();
|
|
110
|
+
const t1 = text.openList;
|
|
111
|
+
let t2;
|
|
109
112
|
if ($[5] !== className) {
|
|
110
|
-
|
|
113
|
+
t2 = withClass("oui-combobox__action", className);
|
|
111
114
|
$[5] = className;
|
|
112
|
-
$[6] =
|
|
113
|
-
} else
|
|
114
|
-
let
|
|
115
|
+
$[6] = t2;
|
|
116
|
+
} else t2 = $[6];
|
|
117
|
+
let t3;
|
|
115
118
|
if ($[7] !== children) {
|
|
116
|
-
|
|
119
|
+
t3 = children ?? /* @__PURE__ */ jsx(ChevronDownIcon, {});
|
|
117
120
|
$[7] = children;
|
|
118
|
-
$[8] =
|
|
119
|
-
} else
|
|
120
|
-
let
|
|
121
|
-
if ($[9] !== props || $[10] !== ref || $[11] !==
|
|
122
|
-
|
|
121
|
+
$[8] = t3;
|
|
122
|
+
} else t3 = $[8];
|
|
123
|
+
let t4;
|
|
124
|
+
if ($[9] !== props || $[10] !== ref || $[11] !== t2 || $[12] !== t3 || $[13] !== text.openList) {
|
|
125
|
+
t4 = /* @__PURE__ */ jsx(Combobox.Trigger, {
|
|
123
126
|
ref,
|
|
124
|
-
"aria-label":
|
|
125
|
-
className:
|
|
127
|
+
"aria-label": t1,
|
|
128
|
+
className: t2,
|
|
126
129
|
...props,
|
|
127
|
-
children:
|
|
130
|
+
children: t3
|
|
128
131
|
});
|
|
129
132
|
$[9] = props;
|
|
130
133
|
$[10] = ref;
|
|
131
|
-
$[11] =
|
|
132
|
-
$[12] =
|
|
133
|
-
$[13] =
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
$[11] = t2;
|
|
135
|
+
$[12] = t3;
|
|
136
|
+
$[13] = text.openList;
|
|
137
|
+
$[14] = t4;
|
|
138
|
+
} else t4 = $[14];
|
|
139
|
+
return t4;
|
|
136
140
|
}
|
|
137
141
|
function ComboboxClear(t0) {
|
|
138
|
-
const $ = c(
|
|
142
|
+
const $ = c(15);
|
|
139
143
|
let children;
|
|
140
144
|
let className;
|
|
141
145
|
let props;
|
|
@@ -153,34 +157,37 @@ function ComboboxClear(t0) {
|
|
|
153
157
|
props = $[3];
|
|
154
158
|
ref = $[4];
|
|
155
159
|
}
|
|
156
|
-
|
|
160
|
+
const text = useLabels();
|
|
161
|
+
const t1 = text.clearSelection;
|
|
162
|
+
let t2;
|
|
157
163
|
if ($[5] !== className) {
|
|
158
|
-
|
|
164
|
+
t2 = withClass("oui-combobox__action", className);
|
|
159
165
|
$[5] = className;
|
|
160
|
-
$[6] =
|
|
161
|
-
} else
|
|
162
|
-
let
|
|
166
|
+
$[6] = t2;
|
|
167
|
+
} else t2 = $[6];
|
|
168
|
+
let t3;
|
|
163
169
|
if ($[7] !== children) {
|
|
164
|
-
|
|
170
|
+
t3 = children ?? /* @__PURE__ */ jsx(XIcon, {});
|
|
165
171
|
$[7] = children;
|
|
166
|
-
$[8] =
|
|
167
|
-
} else
|
|
168
|
-
let
|
|
169
|
-
if ($[9] !== props || $[10] !== ref || $[11] !==
|
|
170
|
-
|
|
172
|
+
$[8] = t3;
|
|
173
|
+
} else t3 = $[8];
|
|
174
|
+
let t4;
|
|
175
|
+
if ($[9] !== props || $[10] !== ref || $[11] !== t2 || $[12] !== t3 || $[13] !== text.clearSelection) {
|
|
176
|
+
t4 = /* @__PURE__ */ jsx(Combobox.Clear, {
|
|
171
177
|
ref,
|
|
172
|
-
"aria-label":
|
|
173
|
-
className:
|
|
178
|
+
"aria-label": t1,
|
|
179
|
+
className: t2,
|
|
174
180
|
...props,
|
|
175
|
-
children:
|
|
181
|
+
children: t3
|
|
176
182
|
});
|
|
177
183
|
$[9] = props;
|
|
178
184
|
$[10] = ref;
|
|
179
|
-
$[11] =
|
|
180
|
-
$[12] =
|
|
181
|
-
$[13] =
|
|
182
|
-
|
|
183
|
-
|
|
185
|
+
$[11] = t2;
|
|
186
|
+
$[12] = t3;
|
|
187
|
+
$[13] = text.clearSelection;
|
|
188
|
+
$[14] = t4;
|
|
189
|
+
} else t4 = $[14];
|
|
190
|
+
return t4;
|
|
184
191
|
}
|
|
185
192
|
function ComboboxContent(t0) {
|
|
186
193
|
const $ = c(23);
|
|
@@ -426,73 +433,82 @@ function ComboboxChips(t0) {
|
|
|
426
433
|
return t2;
|
|
427
434
|
}
|
|
428
435
|
function ComboboxChip(t0) {
|
|
429
|
-
const $ = c(
|
|
436
|
+
const $ = c(23);
|
|
430
437
|
let children;
|
|
431
438
|
let className;
|
|
432
439
|
let props;
|
|
433
440
|
let ref;
|
|
434
|
-
let
|
|
441
|
+
let removeLabelProp;
|
|
435
442
|
if ($[0] !== t0) {
|
|
436
|
-
({className, children, removeLabel:
|
|
443
|
+
({className, children, removeLabel: removeLabelProp, ref, ...props} = t0);
|
|
437
444
|
$[0] = t0;
|
|
438
445
|
$[1] = children;
|
|
439
446
|
$[2] = className;
|
|
440
447
|
$[3] = props;
|
|
441
448
|
$[4] = ref;
|
|
442
|
-
$[5] =
|
|
449
|
+
$[5] = removeLabelProp;
|
|
443
450
|
} else {
|
|
444
451
|
children = $[1];
|
|
445
452
|
className = $[2];
|
|
446
453
|
props = $[3];
|
|
447
454
|
ref = $[4];
|
|
448
|
-
|
|
455
|
+
removeLabelProp = $[5];
|
|
449
456
|
}
|
|
450
|
-
const
|
|
457
|
+
const text = useLabels();
|
|
458
|
+
let t1;
|
|
459
|
+
if ($[6] !== children || $[7] !== removeLabelProp || $[8] !== text) {
|
|
460
|
+
t1 = removeLabelProp ?? (typeof children === "string" ? text.removeItem(children) : text.remove);
|
|
461
|
+
$[6] = children;
|
|
462
|
+
$[7] = removeLabelProp;
|
|
463
|
+
$[8] = text;
|
|
464
|
+
$[9] = t1;
|
|
465
|
+
} else t1 = $[9];
|
|
466
|
+
const removeLabel = t1;
|
|
451
467
|
let t2;
|
|
452
|
-
if ($[
|
|
468
|
+
if ($[10] !== className) {
|
|
453
469
|
t2 = withClass("oui-combobox__chip", className);
|
|
454
|
-
$[
|
|
455
|
-
$[
|
|
456
|
-
} else t2 = $[
|
|
470
|
+
$[10] = className;
|
|
471
|
+
$[11] = t2;
|
|
472
|
+
} else t2 = $[11];
|
|
457
473
|
let t3;
|
|
458
|
-
if ($[
|
|
474
|
+
if ($[12] !== children) {
|
|
459
475
|
t3 = /* @__PURE__ */ jsx("span", {
|
|
460
476
|
className: "oui-combobox__chip-label",
|
|
461
477
|
children
|
|
462
478
|
});
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
} else t3 = $[
|
|
479
|
+
$[12] = children;
|
|
480
|
+
$[13] = t3;
|
|
481
|
+
} else t3 = $[13];
|
|
466
482
|
let t4;
|
|
467
|
-
if ($[
|
|
483
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
468
484
|
t4 = /* @__PURE__ */ jsx(XIcon, {});
|
|
469
|
-
$[
|
|
470
|
-
} else t4 = $[
|
|
485
|
+
$[14] = t4;
|
|
486
|
+
} else t4 = $[14];
|
|
471
487
|
let t5;
|
|
472
|
-
if ($[
|
|
488
|
+
if ($[15] !== removeLabel) {
|
|
473
489
|
t5 = /* @__PURE__ */ jsx(Combobox.ChipRemove, {
|
|
474
490
|
className: "oui-combobox__chip-remove",
|
|
475
491
|
"aria-label": removeLabel,
|
|
476
492
|
children: t4
|
|
477
493
|
});
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
} else t5 = $[
|
|
494
|
+
$[15] = removeLabel;
|
|
495
|
+
$[16] = t5;
|
|
496
|
+
} else t5 = $[16];
|
|
481
497
|
let t6;
|
|
482
|
-
if ($[
|
|
498
|
+
if ($[17] !== props || $[18] !== ref || $[19] !== t2 || $[20] !== t3 || $[21] !== t5) {
|
|
483
499
|
t6 = /* @__PURE__ */ jsxs(Combobox.Chip, {
|
|
484
500
|
ref,
|
|
485
501
|
className: t2,
|
|
486
502
|
...props,
|
|
487
503
|
children: [t3, t5]
|
|
488
504
|
});
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
494
|
-
$[
|
|
495
|
-
} else t6 = $[
|
|
505
|
+
$[17] = props;
|
|
506
|
+
$[18] = ref;
|
|
507
|
+
$[19] = t2;
|
|
508
|
+
$[20] = t3;
|
|
509
|
+
$[21] = t5;
|
|
510
|
+
$[22] = t6;
|
|
511
|
+
} else t6 = $[22];
|
|
496
512
|
return t6;
|
|
497
513
|
}
|
|
498
514
|
function ComboboxGroupLabel(t0) {
|
|
@@ -532,10 +548,12 @@ function ComboboxGroupLabel(t0) {
|
|
|
532
548
|
return t2;
|
|
533
549
|
}
|
|
534
550
|
function ComboboxComponent(t0) {
|
|
535
|
-
const $ = c(
|
|
551
|
+
const $ = c(55);
|
|
536
552
|
let description;
|
|
537
553
|
let disabled;
|
|
554
|
+
let emptyTextProp;
|
|
538
555
|
let error;
|
|
556
|
+
let fieldProps;
|
|
539
557
|
let hideClear;
|
|
540
558
|
let inputProps;
|
|
541
559
|
let items;
|
|
@@ -547,71 +565,65 @@ function ComboboxComponent(t0) {
|
|
|
547
565
|
let required;
|
|
548
566
|
let rootProps;
|
|
549
567
|
let t1;
|
|
550
|
-
let t2;
|
|
551
568
|
if ($[0] !== t0) {
|
|
552
|
-
({items, label, description, error, placeholder, emptyText:
|
|
569
|
+
({items, label, description, error, fieldProps, placeholder, emptyText: emptyTextProp, size: t1, hideClear, maxChips, inputProps, name, disabled, required, multiple, ...rootProps} = t0);
|
|
553
570
|
$[0] = t0;
|
|
554
571
|
$[1] = description;
|
|
555
572
|
$[2] = disabled;
|
|
556
|
-
$[3] =
|
|
557
|
-
$[4] =
|
|
558
|
-
$[5] =
|
|
559
|
-
$[6] =
|
|
560
|
-
$[7] =
|
|
561
|
-
$[8] =
|
|
562
|
-
$[9] =
|
|
563
|
-
$[10] =
|
|
564
|
-
$[11] =
|
|
565
|
-
$[12] =
|
|
566
|
-
$[13] =
|
|
567
|
-
$[14] =
|
|
568
|
-
$[15] =
|
|
573
|
+
$[3] = emptyTextProp;
|
|
574
|
+
$[4] = error;
|
|
575
|
+
$[5] = fieldProps;
|
|
576
|
+
$[6] = hideClear;
|
|
577
|
+
$[7] = inputProps;
|
|
578
|
+
$[8] = items;
|
|
579
|
+
$[9] = label;
|
|
580
|
+
$[10] = maxChips;
|
|
581
|
+
$[11] = multiple;
|
|
582
|
+
$[12] = name;
|
|
583
|
+
$[13] = placeholder;
|
|
584
|
+
$[14] = required;
|
|
585
|
+
$[15] = rootProps;
|
|
586
|
+
$[16] = t1;
|
|
569
587
|
} else {
|
|
570
588
|
description = $[1];
|
|
571
589
|
disabled = $[2];
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
590
|
+
emptyTextProp = $[3];
|
|
591
|
+
error = $[4];
|
|
592
|
+
fieldProps = $[5];
|
|
593
|
+
hideClear = $[6];
|
|
594
|
+
inputProps = $[7];
|
|
595
|
+
items = $[8];
|
|
596
|
+
label = $[9];
|
|
597
|
+
maxChips = $[10];
|
|
598
|
+
multiple = $[11];
|
|
599
|
+
name = $[12];
|
|
600
|
+
placeholder = $[13];
|
|
601
|
+
required = $[14];
|
|
602
|
+
rootProps = $[15];
|
|
603
|
+
t1 = $[16];
|
|
585
604
|
}
|
|
586
|
-
const
|
|
587
|
-
const
|
|
588
|
-
const
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
children: label
|
|
595
|
-
});
|
|
596
|
-
$[16] = label;
|
|
597
|
-
$[17] = required;
|
|
598
|
-
$[18] = t5;
|
|
599
|
-
} else t5 = $[18];
|
|
600
|
-
const t6 = multiple || void 0;
|
|
601
|
-
let t7;
|
|
602
|
-
if ($[19] !== inputProps || $[20] !== maxChips || $[21] !== multiple || $[22] !== placeholder) {
|
|
603
|
-
t7 = multiple ? /* @__PURE__ */ jsx(Combobox.Value, { children: (value) => {
|
|
605
|
+
const size = t1 === void 0 ? "md" : t1;
|
|
606
|
+
const text = useLabels();
|
|
607
|
+
const emptyText = emptyTextProp ?? text.noResults;
|
|
608
|
+
const t2 = rootProps;
|
|
609
|
+
const t3 = multiple || void 0;
|
|
610
|
+
let t4;
|
|
611
|
+
if ($[17] !== inputProps || $[18] !== maxChips || $[19] !== multiple || $[20] !== placeholder || $[21] !== text) {
|
|
612
|
+
t4 = multiple ? /* @__PURE__ */ jsx(Combobox.Value, { children: (value) => {
|
|
604
613
|
const shown = maxChips === void 0 ? value : value.slice(0, maxChips);
|
|
605
614
|
const hidden = value.slice(shown.length);
|
|
606
615
|
return /* @__PURE__ */ jsxs(ComboboxChips, {
|
|
607
616
|
"data-collapse": maxChips === void 0 ? void 0 : "",
|
|
608
617
|
children: [
|
|
609
|
-
shown.map(
|
|
618
|
+
shown.map((item) => /* @__PURE__ */ jsx(ComboboxChip, {
|
|
619
|
+
removeLabel: text.removeItem(item.label),
|
|
620
|
+
children: item.label
|
|
621
|
+
}, item.value)),
|
|
610
622
|
hidden.length > 0 && /* @__PURE__ */ jsxs("span", {
|
|
611
623
|
className: "oui-combobox__chip",
|
|
612
624
|
"data-overflow": "",
|
|
613
|
-
title: hidden.map(
|
|
614
|
-
"aria-label":
|
|
625
|
+
title: hidden.map(_temp).join(", "),
|
|
626
|
+
"aria-label": text.moreSelected(hidden.length),
|
|
615
627
|
children: ["+", hidden.length]
|
|
616
628
|
}),
|
|
617
629
|
/* @__PURE__ */ jsx(ComboboxInput, {
|
|
@@ -624,122 +636,105 @@ function ComboboxComponent(t0) {
|
|
|
624
636
|
placeholder,
|
|
625
637
|
...inputProps
|
|
626
638
|
});
|
|
627
|
-
$[
|
|
628
|
-
$[
|
|
629
|
-
$[
|
|
630
|
-
$[
|
|
631
|
-
$[
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
$[
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
639
|
+
$[17] = inputProps;
|
|
640
|
+
$[18] = maxChips;
|
|
641
|
+
$[19] = multiple;
|
|
642
|
+
$[20] = placeholder;
|
|
643
|
+
$[21] = text;
|
|
644
|
+
$[22] = t4;
|
|
645
|
+
} else t4 = $[22];
|
|
646
|
+
let t5;
|
|
647
|
+
if ($[23] !== hideClear) {
|
|
648
|
+
t5 = !hideClear && /* @__PURE__ */ jsx(ComboboxClear, {});
|
|
649
|
+
$[23] = hideClear;
|
|
650
|
+
$[24] = t5;
|
|
651
|
+
} else t5 = $[24];
|
|
652
|
+
let t6;
|
|
653
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
654
|
+
t6 = /* @__PURE__ */ jsx(ComboboxTrigger, {});
|
|
655
|
+
$[25] = t6;
|
|
656
|
+
} else t6 = $[25];
|
|
657
|
+
let t7;
|
|
658
|
+
if ($[26] !== t5) {
|
|
659
|
+
t7 = /* @__PURE__ */ jsxs("span", {
|
|
647
660
|
className: "oui-combobox__actions",
|
|
648
|
-
children: [
|
|
661
|
+
children: [t5, t6]
|
|
649
662
|
});
|
|
650
|
-
$[
|
|
651
|
-
$[
|
|
652
|
-
} else
|
|
653
|
-
let
|
|
654
|
-
if ($[
|
|
655
|
-
|
|
663
|
+
$[26] = t5;
|
|
664
|
+
$[27] = t7;
|
|
665
|
+
} else t7 = $[27];
|
|
666
|
+
let t8;
|
|
667
|
+
if ($[28] !== size || $[29] !== t3 || $[30] !== t4 || $[31] !== t7) {
|
|
668
|
+
t8 = /* @__PURE__ */ jsxs(ComboboxInputGroup, {
|
|
656
669
|
size,
|
|
657
|
-
"data-multiple":
|
|
658
|
-
children: [
|
|
670
|
+
"data-multiple": t3,
|
|
671
|
+
children: [t4, t7]
|
|
659
672
|
});
|
|
660
|
-
$[
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
663
|
-
$[
|
|
664
|
-
$[
|
|
665
|
-
} else
|
|
673
|
+
$[28] = size;
|
|
674
|
+
$[29] = t3;
|
|
675
|
+
$[30] = t4;
|
|
676
|
+
$[31] = t7;
|
|
677
|
+
$[32] = t8;
|
|
678
|
+
} else t8 = $[32];
|
|
679
|
+
let t9;
|
|
680
|
+
if ($[33] !== emptyText) {
|
|
681
|
+
t9 = /* @__PURE__ */ jsx(ComboboxEmpty, { children: emptyText });
|
|
682
|
+
$[33] = emptyText;
|
|
683
|
+
$[34] = t9;
|
|
684
|
+
} else t9 = $[34];
|
|
685
|
+
let t10;
|
|
686
|
+
if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
|
|
687
|
+
t10 = /* @__PURE__ */ jsx(ComboboxList, { children: _temp2 });
|
|
688
|
+
$[35] = t10;
|
|
689
|
+
} else t10 = $[35];
|
|
690
|
+
let t11;
|
|
691
|
+
if ($[36] !== t9) {
|
|
692
|
+
t11 = /* @__PURE__ */ jsxs(ComboboxContent, { children: [t9, t10] });
|
|
693
|
+
$[36] = t9;
|
|
694
|
+
$[37] = t11;
|
|
695
|
+
} else t11 = $[37];
|
|
666
696
|
let t12;
|
|
667
|
-
if ($[
|
|
668
|
-
t12 = /* @__PURE__ */
|
|
669
|
-
$[34] = emptyText;
|
|
670
|
-
$[35] = t12;
|
|
671
|
-
} else t12 = $[35];
|
|
672
|
-
let t13;
|
|
673
|
-
if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
|
|
674
|
-
t13 = /* @__PURE__ */ jsx(ComboboxList, { children: _temp3 });
|
|
675
|
-
$[36] = t13;
|
|
676
|
-
} else t13 = $[36];
|
|
677
|
-
let t14;
|
|
678
|
-
if ($[37] !== t12) {
|
|
679
|
-
t14 = /* @__PURE__ */ jsxs(ComboboxContent, { children: [t12, t13] });
|
|
680
|
-
$[37] = t12;
|
|
681
|
-
$[38] = t14;
|
|
682
|
-
} else t14 = $[38];
|
|
683
|
-
let t15;
|
|
684
|
-
if ($[39] !== disabled || $[40] !== items || $[41] !== multiple || $[42] !== required || $[43] !== t11 || $[44] !== t14 || $[45] !== t4 || $[46] !== t5) {
|
|
685
|
-
t15 = /* @__PURE__ */ jsxs(Combobox.Root, {
|
|
697
|
+
if ($[38] !== disabled || $[39] !== items || $[40] !== multiple || $[41] !== required || $[42] !== t11 || $[43] !== t2 || $[44] !== t8) {
|
|
698
|
+
t12 = /* @__PURE__ */ jsxs(Combobox.Root, {
|
|
686
699
|
items,
|
|
687
700
|
multiple,
|
|
688
701
|
disabled,
|
|
689
702
|
required,
|
|
690
|
-
...
|
|
691
|
-
children: [
|
|
692
|
-
t5,
|
|
693
|
-
t11,
|
|
694
|
-
t14
|
|
695
|
-
]
|
|
703
|
+
...t2,
|
|
704
|
+
children: [t8, t11]
|
|
696
705
|
});
|
|
697
|
-
$[
|
|
698
|
-
$[
|
|
699
|
-
$[
|
|
700
|
-
$[
|
|
701
|
-
$[
|
|
702
|
-
$[
|
|
703
|
-
$[
|
|
704
|
-
$[
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
let t17;
|
|
714
|
-
if ($[50] !== error) {
|
|
715
|
-
t17 = error ? /* @__PURE__ */ jsx(Field.Error, {
|
|
716
|
-
match: true,
|
|
717
|
-
children: error
|
|
718
|
-
}) : /* @__PURE__ */ jsx(Field.Error, {});
|
|
719
|
-
$[50] = error;
|
|
720
|
-
$[51] = t17;
|
|
721
|
-
} else t17 = $[51];
|
|
722
|
-
let t18;
|
|
723
|
-
if ($[52] !== disabled || $[53] !== name || $[54] !== t15 || $[55] !== t16 || $[56] !== t17 || $[57] !== t3) {
|
|
724
|
-
t18 = /* @__PURE__ */ jsxs(Field.Root, {
|
|
706
|
+
$[38] = disabled;
|
|
707
|
+
$[39] = items;
|
|
708
|
+
$[40] = multiple;
|
|
709
|
+
$[41] = required;
|
|
710
|
+
$[42] = t11;
|
|
711
|
+
$[43] = t2;
|
|
712
|
+
$[44] = t8;
|
|
713
|
+
$[45] = t12;
|
|
714
|
+
} else t12 = $[45];
|
|
715
|
+
let t13;
|
|
716
|
+
if ($[46] !== description || $[47] !== disabled || $[48] !== error || $[49] !== fieldProps || $[50] !== label || $[51] !== name || $[52] !== required || $[53] !== t12) {
|
|
717
|
+
t13 = /* @__PURE__ */ jsx(FormField, {
|
|
718
|
+
label,
|
|
719
|
+
description,
|
|
720
|
+
error,
|
|
721
|
+
required,
|
|
725
722
|
name,
|
|
726
723
|
disabled,
|
|
727
|
-
|
|
728
|
-
children:
|
|
729
|
-
t15,
|
|
730
|
-
t16,
|
|
731
|
-
t17
|
|
732
|
-
]
|
|
724
|
+
fieldProps,
|
|
725
|
+
children: t12
|
|
733
726
|
});
|
|
734
|
-
$[
|
|
735
|
-
$[
|
|
736
|
-
$[
|
|
737
|
-
$[
|
|
738
|
-
$[
|
|
739
|
-
$[
|
|
740
|
-
$[
|
|
741
|
-
|
|
742
|
-
|
|
727
|
+
$[46] = description;
|
|
728
|
+
$[47] = disabled;
|
|
729
|
+
$[48] = error;
|
|
730
|
+
$[49] = fieldProps;
|
|
731
|
+
$[50] = label;
|
|
732
|
+
$[51] = name;
|
|
733
|
+
$[52] = required;
|
|
734
|
+
$[53] = t12;
|
|
735
|
+
$[54] = t13;
|
|
736
|
+
} else t13 = $[54];
|
|
737
|
+
return t13;
|
|
743
738
|
}
|
|
744
739
|
/**
|
|
745
740
|
* Searchable select. `<Combobox items={…} />` covers single and `multiple`
|
|
@@ -749,22 +744,16 @@ function ComboboxComponent(t0) {
|
|
|
749
744
|
* @example
|
|
750
745
|
* <Combobox label="Vehicles" items={vehicles} multiple maxChips={1} placeholder="All vehicles" />
|
|
751
746
|
*/
|
|
752
|
-
function
|
|
747
|
+
function _temp2(item_1) {
|
|
753
748
|
return /* @__PURE__ */ jsx(ComboboxItem, {
|
|
754
749
|
value: item_1,
|
|
755
750
|
disabled: item_1.disabled,
|
|
756
751
|
children: item_1.label
|
|
757
752
|
}, item_1.value);
|
|
758
753
|
}
|
|
759
|
-
function
|
|
754
|
+
function _temp(item_0) {
|
|
760
755
|
return item_0.label;
|
|
761
756
|
}
|
|
762
|
-
function _temp(item) {
|
|
763
|
-
return /* @__PURE__ */ jsx(ComboboxChip, {
|
|
764
|
-
removeLabel: `Remove ${item.label}`,
|
|
765
|
-
children: item.label
|
|
766
|
-
}, item.value);
|
|
767
|
-
}
|
|
768
757
|
var Combobox$1 = Object.assign(ComboboxComponent, {
|
|
769
758
|
Root: Combobox.Root,
|
|
770
759
|
InputGroup: ComboboxInputGroup,
|