mainbase-ui 3.36.0 → 3.37.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/README.md +12 -23
- package/dist/cjs/components/accordion/accordion.cjs +2 -1
- package/dist/cjs/components/alert/alert.cjs +7 -6
- package/dist/cjs/components/aspect-ratio/aspect-ratio.cjs +8 -8
- package/dist/cjs/components/avatar/avatar.cjs +16 -16
- package/dist/cjs/components/bleed/bleed.cjs +5 -4
- package/dist/cjs/components/breadcrumb/breadcrumb.cjs +3 -2
- package/dist/cjs/components/button/button-group.cjs +5 -4
- package/dist/cjs/components/button/button.cjs +16 -16
- package/dist/cjs/components/button/close-button.cjs +2 -1
- package/dist/cjs/components/button/icon-button.cjs +4 -3
- package/dist/cjs/components/carousel/carousel.cjs +13 -8
- package/dist/cjs/components/checkbox/checkbox.cjs +13 -12
- package/dist/cjs/components/checkbox-card/checkbox-card.cjs +6 -5
- package/dist/cjs/components/checkmark/checkmark.cjs +7 -7
- package/dist/cjs/components/circle/index.cjs +4 -3
- package/dist/cjs/components/client-only/client-only.cjs +5 -4
- package/dist/cjs/components/clipboard/clipboard.cjs +6 -5
- package/dist/cjs/components/code-block/code-block-adapter-provider.cjs +2 -1
- package/dist/cjs/components/code-block/code-block.cjs +43 -45
- package/dist/cjs/components/color-picker/color-picker.cjs +24 -13
- package/dist/cjs/components/color-swatch/index.cjs +9 -9
- package/dist/cjs/components/combobox/combobox.cjs +4 -3
- package/dist/cjs/components/date-picker/date-picker.cjs +39 -25
- package/dist/cjs/components/dialog/dialog.cjs +4 -3
- package/dist/cjs/components/drawer/drawer.cjs +4 -3
- package/dist/cjs/components/editable/editable.cjs +4 -3
- package/dist/cjs/components/field/field.cjs +7 -7
- package/dist/cjs/components/file-upload/file-upload.cjs +21 -13
- package/dist/cjs/components/flex/flex.cjs +4 -3
- package/dist/cjs/components/float/float.cjs +5 -5
- package/dist/cjs/components/floating-panel/floating-panel.cjs +2 -1
- package/dist/cjs/components/grid/grid-item.cjs +5 -5
- package/dist/cjs/components/grid/grid.cjs +4 -3
- package/dist/cjs/components/group/group.cjs +11 -11
- package/dist/cjs/components/highlight/highlight.cjs +5 -4
- package/dist/cjs/components/hover-card/hover-card.cjs +2 -1
- package/dist/cjs/components/icon/create-icon.cjs +7 -6
- package/dist/cjs/components/icon/icon.cjs +2 -2
- package/dist/cjs/components/icons.cjs +90 -75
- package/dist/cjs/components/image/image.cjs +4 -4
- package/dist/cjs/components/input-addon/input-addon.cjs +4 -3
- package/dist/cjs/components/input-group/input-group.cjs +20 -17
- package/dist/cjs/components/link/link-box.cjs +6 -6
- package/dist/cjs/components/listbox/listbox.cjs +2 -1
- package/dist/cjs/components/loader/loader.cjs +12 -4
- package/dist/cjs/components/menu/menu.cjs +3 -2
- package/dist/cjs/components/native-select/native-select.cjs +15 -13
- package/dist/cjs/components/number-input/number-input.cjs +7 -3
- package/dist/cjs/components/pagination/pagination.cjs +12 -11
- package/dist/cjs/components/popover/popover.cjs +2 -1
- package/dist/cjs/components/qr-code/qr-code.cjs +2 -1
- package/dist/cjs/components/radio-card/radio-card.cjs +10 -10
- package/dist/cjs/components/radio-group/radio-group.cjs +5 -4
- package/dist/cjs/components/radiomark/radiomark.cjs +4 -4
- package/dist/cjs/components/rating-group/rating-group.cjs +15 -12
- package/dist/cjs/components/scroll-area/scroll-area.cjs +2 -1
- package/dist/cjs/components/segment-group/segment-group.cjs +11 -8
- package/dist/cjs/components/select/select.cjs +4 -3
- package/dist/cjs/components/separator/separator.cjs +4 -4
- package/dist/cjs/components/show/show.cjs +3 -2
- package/dist/cjs/components/simple-grid/simple-grid.cjs +4 -4
- package/dist/cjs/components/skeleton/skeleton.cjs +6 -5
- package/dist/cjs/components/skip-nav/skip-nav-content.cjs +4 -3
- package/dist/cjs/components/skip-nav/skip-nav-link.cjs +4 -3
- package/dist/cjs/components/slider/slider.cjs +10 -6
- package/dist/cjs/components/splitter/splitter.cjs +5 -1
- package/dist/cjs/components/square/index.cjs +4 -3
- package/dist/cjs/components/stack/get-separator-style.cjs +0 -2
- package/dist/cjs/components/stack/h-stack.cjs +4 -3
- package/dist/cjs/components/stack/stack.cjs +17 -14
- package/dist/cjs/components/stack/v-stack.cjs +4 -3
- package/dist/cjs/components/stat/stat.cjs +8 -7
- package/dist/cjs/components/steps/steps.cjs +10 -9
- package/dist/cjs/components/switch/switch.cjs +10 -10
- package/dist/cjs/components/table/table.cjs +6 -6
- package/dist/cjs/components/tag/tag.cjs +2 -1
- package/dist/cjs/components/tags-input/tags-input.cjs +10 -3
- package/dist/cjs/components/theme.cjs +4 -4
- package/dist/cjs/components/toast/toast.cjs +5 -4
- package/dist/cjs/components/tooltip/tooltip.cjs +2 -1
- package/dist/cjs/components/tree-view/tree-view.cjs +20 -13
- package/dist/cjs/components/wrap/wrap.cjs +6 -6
- package/dist/cjs/hooks/index.cjs +5 -5
- package/dist/cjs/hooks/use-overlay.cjs +3 -3
- package/dist/cjs/index.cjs +21 -21
- package/dist/cjs/merge-props.cjs +0 -2
- package/dist/cjs/styled-system/breakpoints.cjs +0 -2
- package/dist/cjs/styled-system/calc.cjs +0 -2
- package/dist/cjs/styled-system/conditions.cjs +0 -2
- package/dist/cjs/styled-system/create-recipe-context.cjs +6 -6
- package/dist/cjs/styled-system/create-slot-recipe-context.cjs +12 -12
- package/dist/cjs/styled-system/css.cjs +1 -3
- package/dist/cjs/styled-system/cva.cjs +0 -2
- package/dist/cjs/styled-system/factory.cjs +19 -13
- package/dist/cjs/styled-system/merge-config.cjs +1 -3
- package/dist/cjs/styled-system/normalize.cjs +0 -2
- package/dist/cjs/styled-system/preflight.cjs +0 -2
- package/dist/cjs/styled-system/provider.cjs +6 -1
- package/dist/cjs/styled-system/recipe-props.cjs +2 -1
- package/dist/cjs/styled-system/references.cjs +0 -2
- package/dist/cjs/styled-system/serialize.cjs +1 -3
- package/dist/cjs/styled-system/sort-at-rules.cjs +0 -2
- package/dist/cjs/styled-system/sva.cjs +0 -2
- package/dist/cjs/styled-system/system.cjs +1 -3
- package/dist/cjs/styled-system/token-dictionary.cjs +2 -4
- package/dist/cjs/styled-system/token-middleware.cjs +0 -2
- package/dist/cjs/styled-system/use-resolved-props.cjs +0 -1
- package/dist/cjs/styled-system/utility.cjs +1 -3
- package/dist/cjs/theme/recipes/number-input.cjs +0 -2
- package/dist/cjs/theme/recipes/pin-input.cjs +0 -2
- package/dist/esm/components/accordion/accordion.js +2 -1
- package/dist/esm/components/alert/alert.js +4 -3
- package/dist/esm/components/aspect-ratio/aspect-ratio.js +5 -5
- package/dist/esm/components/avatar/avatar.js +11 -11
- package/dist/esm/components/bleed/bleed.js +3 -2
- package/dist/esm/components/breadcrumb/breadcrumb.js +3 -2
- package/dist/esm/components/button/button-group.js +2 -1
- package/dist/esm/components/button/button.js +13 -13
- package/dist/esm/components/button/close-button.js +2 -1
- package/dist/esm/components/button/icon-button.js +2 -1
- package/dist/esm/components/carousel/carousel.js +10 -5
- package/dist/esm/components/checkbox/checkbox.js +11 -10
- package/dist/esm/components/checkbox-card/checkbox-card.js +3 -2
- package/dist/esm/components/checkmark/checkmark.js +5 -5
- package/dist/esm/components/circle/index.js +2 -1
- package/dist/esm/components/client-only/client-only.js +2 -1
- package/dist/esm/components/clipboard/clipboard.js +4 -3
- package/dist/esm/components/code-block/code-block-adapter-provider.js +2 -1
- package/dist/esm/components/code-block/code-block.js +29 -31
- package/dist/esm/components/color-picker/color-picker.js +19 -8
- package/dist/esm/components/color-swatch/index.js +7 -7
- package/dist/esm/components/combobox/combobox.js +4 -3
- package/dist/esm/components/date-picker/date-picker.js +37 -23
- package/dist/esm/components/dialog/dialog.js +2 -1
- package/dist/esm/components/drawer/drawer.js +2 -1
- package/dist/esm/components/editable/editable.js +2 -1
- package/dist/esm/components/field/field.js +5 -5
- package/dist/esm/components/file-upload/file-upload.js +17 -9
- package/dist/esm/components/flex/flex.js +2 -1
- package/dist/esm/components/float/float.js +2 -2
- package/dist/esm/components/floating-panel/floating-panel.js +2 -1
- package/dist/esm/components/grid/grid-item.js +2 -2
- package/dist/esm/components/grid/grid.js +2 -1
- package/dist/esm/components/group/group.js +5 -5
- package/dist/esm/components/highlight/highlight.js +4 -3
- package/dist/esm/components/hover-card/hover-card.js +2 -1
- package/dist/esm/components/icon/create-icon.js +5 -4
- package/dist/esm/components/icon/icon.js +2 -2
- package/dist/esm/components/icons.js +90 -75
- package/dist/esm/components/image/image.js +2 -2
- package/dist/esm/components/input-addon/input-addon.js +2 -1
- package/dist/esm/components/input-group/input-group.js +17 -14
- package/dist/esm/components/link/link-box.js +3 -3
- package/dist/esm/components/listbox/listbox.js +2 -1
- package/dist/esm/components/loader/loader.js +12 -4
- package/dist/esm/components/menu/menu.js +3 -2
- package/dist/esm/components/native-select/native-select.js +13 -11
- package/dist/esm/components/number-input/number-input.js +7 -3
- package/dist/esm/components/pagination/pagination.js +9 -8
- package/dist/esm/components/popover/popover.js +2 -1
- package/dist/esm/components/qr-code/qr-code.js +2 -1
- package/dist/esm/components/radio-card/radio-card.js +7 -7
- package/dist/esm/components/radio-group/radio-group.js +3 -2
- package/dist/esm/components/radiomark/radiomark.js +2 -2
- package/dist/esm/components/rating-group/rating-group.js +11 -8
- package/dist/esm/components/scroll-area/scroll-area.js +2 -1
- package/dist/esm/components/segment-group/segment-group.js +9 -6
- package/dist/esm/components/select/select.js +4 -3
- package/dist/esm/components/separator/separator.js +2 -2
- package/dist/esm/components/show/show.js +2 -1
- package/dist/esm/components/simple-grid/simple-grid.js +2 -2
- package/dist/esm/components/skeleton/skeleton.js +6 -5
- package/dist/esm/components/skip-nav/skip-nav-content.js +2 -1
- package/dist/esm/components/skip-nav/skip-nav-link.js +2 -1
- package/dist/esm/components/slider/slider.js +8 -4
- package/dist/esm/components/splitter/splitter.js +5 -1
- package/dist/esm/components/square/index.js +2 -1
- package/dist/esm/components/stack/get-separator-style.js +0 -2
- package/dist/esm/components/stack/h-stack.js +2 -1
- package/dist/esm/components/stack/stack.js +9 -6
- package/dist/esm/components/stack/v-stack.js +2 -1
- package/dist/esm/components/stat/stat.js +5 -4
- package/dist/esm/components/steps/steps.js +8 -7
- package/dist/esm/components/switch/switch.js +7 -7
- package/dist/esm/components/table/table.js +3 -3
- package/dist/esm/components/tag/tag.js +2 -1
- package/dist/esm/components/tags-input/tags-input.js +10 -3
- package/dist/esm/components/theme.js +2 -2
- package/dist/esm/components/toast/toast.js +3 -2
- package/dist/esm/components/tooltip/tooltip.js +2 -1
- package/dist/esm/components/tree-view/tree-view.js +20 -13
- package/dist/esm/components/wrap/wrap.js +3 -3
- package/dist/esm/hooks/index.js +1 -1
- package/dist/esm/hooks/use-overlay.js +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/merge-props.js +0 -2
- package/dist/esm/styled-system/breakpoints.js +0 -2
- package/dist/esm/styled-system/calc.js +0 -2
- package/dist/esm/styled-system/conditions.js +0 -2
- package/dist/esm/styled-system/create-recipe-context.js +2 -2
- package/dist/esm/styled-system/create-slot-recipe-context.js +5 -5
- package/dist/esm/styled-system/css.js +1 -3
- package/dist/esm/styled-system/cva.js +0 -2
- package/dist/esm/styled-system/factory.js +19 -13
- package/dist/esm/styled-system/merge-config.js +1 -3
- package/dist/esm/styled-system/normalize.js +0 -2
- package/dist/esm/styled-system/preflight.js +0 -2
- package/dist/esm/styled-system/provider.js +6 -1
- package/dist/esm/styled-system/recipe-props.js +2 -1
- package/dist/esm/styled-system/references.js +0 -2
- package/dist/esm/styled-system/serialize.js +1 -3
- package/dist/esm/styled-system/sort-at-rules.js +0 -2
- package/dist/esm/styled-system/sva.js +0 -2
- package/dist/esm/styled-system/system.js +1 -3
- package/dist/esm/styled-system/token-dictionary.js +2 -4
- package/dist/esm/styled-system/token-middleware.js +0 -2
- package/dist/esm/styled-system/use-resolved-props.js +0 -1
- package/dist/esm/styled-system/utility.js +1 -3
- package/dist/esm/theme/recipes/number-input.js +0 -2
- package/dist/esm/theme/recipes/pin-input.js +0 -2
- package/package.json +3 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import { DatePicker, useDatePickerContext } from '@ark-ui/react/date-picker';
|
|
3
4
|
import { forwardRef, Fragment } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
@@ -24,7 +25,7 @@ const DatePickerPropsProvider = PropsProvider;
|
|
|
24
25
|
const DatePickerClearTrigger = withContext(DatePicker.ClearTrigger, "clearTrigger", {
|
|
25
26
|
forwardAsChild: true,
|
|
26
27
|
defaultProps: {
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
const DatePickerContent = withContext(DatePicker.Content, "content", { forwardAsChild: true });
|
|
@@ -35,7 +36,7 @@ const DatePickerMonthSelect = withContext(DatePicker.MonthSelect, "monthSelect",
|
|
|
35
36
|
const DatePickerNextTrigger = withContext(DatePicker.NextTrigger, "nextTrigger", {
|
|
36
37
|
forwardAsChild: true,
|
|
37
38
|
defaultProps: {
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
const DatePickerPositioner = withContext(DatePicker.Positioner, "positioner", { forwardAsChild: true });
|
|
@@ -43,7 +44,7 @@ const DatePickerPresetTrigger = withContext(DatePicker.PresetTrigger, "presetTri
|
|
|
43
44
|
const DatePickerPrevTrigger = withContext(DatePicker.PrevTrigger, "prevTrigger", {
|
|
44
45
|
forwardAsChild: true,
|
|
45
46
|
defaultProps: {
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
const DatePickerRangeText = withContext(DatePicker.RangeText, "rangeText", { forwardAsChild: true });
|
|
@@ -82,62 +83,75 @@ const DatePickerWeekNumberCellText = withContext("span", "tableCellTrigger", {
|
|
|
82
83
|
forwardAsChild: true
|
|
83
84
|
});
|
|
84
85
|
const DatePickerHeader = (props) => {
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ jsxs(DatePickerViewControl, { ...props, children: [
|
|
87
|
+
/* @__PURE__ */ jsx(DatePickerPrevTrigger, {}),
|
|
88
|
+
/* @__PURE__ */ jsx(DatePickerViewTrigger, { children: /* @__PURE__ */ jsx(DatePickerRangeText, {}) }),
|
|
89
|
+
/* @__PURE__ */ jsx(DatePickerNextTrigger, {})
|
|
90
|
+
] });
|
|
86
91
|
};
|
|
87
92
|
const DatePickerDayTable = (props) => {
|
|
88
93
|
const { offset, weekNumberLabel = "#", ...rest } = props;
|
|
89
94
|
const ctx = useDatePickerContext();
|
|
90
95
|
const offsetDays = offset ? ctx.getOffset({ months: offset }) : void 0;
|
|
91
96
|
const weeks = offsetDays ? offsetDays.weeks : ctx.weeks;
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
return /* @__PURE__ */ jsxs(DatePickerTable, { ...rest, children: [
|
|
98
|
+
/* @__PURE__ */ jsx(DatePickerTableHead, { children: /* @__PURE__ */ jsxs(DatePickerTableRow, { children: [
|
|
99
|
+
ctx.showWeekNumbers && /* @__PURE__ */ jsx(DatePickerWeekNumberHeaderCell, { children: weekNumberLabel }),
|
|
100
|
+
ctx.weekDays.map((weekDay, id) => /* @__PURE__ */ jsx(DatePickerTableHeader, { children: weekDay.narrow }, id))
|
|
101
|
+
] }) }),
|
|
102
|
+
/* @__PURE__ */ jsx(DatePickerTableBody, { children: weeks.map((week, weekIndex) => /* @__PURE__ */ jsxs(DatePickerTableRow, { children: [
|
|
103
|
+
ctx.showWeekNumbers && /* @__PURE__ */ jsx(DatePickerWeekNumberCell, { weekIndex, week, children: /* @__PURE__ */ jsx(DatePickerWeekNumberCellText, { children: ctx.getWeekNumber(week) }) }),
|
|
104
|
+
week.map((day, id) => /* @__PURE__ */ jsx(
|
|
105
|
+
DatePickerTableCell,
|
|
106
|
+
{
|
|
107
|
+
value: day,
|
|
108
|
+
visibleRange: offsetDays?.visibleRange,
|
|
109
|
+
children: /* @__PURE__ */ jsx(DatePickerTableCellTrigger, { children: day.day })
|
|
110
|
+
},
|
|
111
|
+
id
|
|
112
|
+
))
|
|
113
|
+
] }, weekIndex)) })
|
|
114
|
+
] });
|
|
101
115
|
};
|
|
102
116
|
const DatePickerMonthTable = (props) => {
|
|
103
117
|
const datePicker = useDatePickerContext();
|
|
104
118
|
const { columns = 4, format = "short", ...rest } = props;
|
|
105
|
-
return /* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ jsx(DatePickerTable, { ...rest, children: /* @__PURE__ */ jsx(DatePickerTableBody, { children: datePicker.getMonthsGrid({ columns, format }).map((months, id) => /* @__PURE__ */ jsx(DatePickerTableRow, { children: months.map((month, id2) => /* @__PURE__ */ jsx(DatePickerTableCell, { value: month.value, children: /* @__PURE__ */ jsx(DatePickerTableCellTrigger, { children: month.label }) }, id2)) }, id)) }) });
|
|
106
120
|
};
|
|
107
121
|
const DatePickerYearTable = (props) => {
|
|
108
122
|
const datePicker = useDatePickerContext();
|
|
109
123
|
const { columns = 4, ...rest } = props;
|
|
110
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ jsx(DatePickerTable, { ...rest, children: /* @__PURE__ */ jsx(DatePickerTableBody, { children: datePicker.getYearsGrid({ columns }).map((years, id) => /* @__PURE__ */ jsx(DatePickerTableRow, { children: years.map((year, id2) => /* @__PURE__ */ jsx(DatePickerTableCell, { value: year.value, children: /* @__PURE__ */ jsx(DatePickerTableCellTrigger, { children: year.label }) }, id2)) }, id)) }) });
|
|
111
125
|
};
|
|
112
126
|
const DatePickerValue = (props) => {
|
|
113
127
|
const { placeholder, value, ...rest } = props;
|
|
114
128
|
const ctx = useDatePickerContext();
|
|
115
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ jsx(DatePickerTrigger, { asChild: true, unstyled: true, ...rest, children: /* @__PURE__ */ jsx(
|
|
116
130
|
Button,
|
|
117
131
|
{
|
|
118
132
|
variant: "outline",
|
|
119
133
|
width: "full",
|
|
120
134
|
justifyContent: "flex-start",
|
|
121
|
-
textAlign: "start"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
));
|
|
135
|
+
textAlign: "start",
|
|
136
|
+
children: ctx.value.length ? ctx.value[0].toDate("UTC").toLocaleDateString() : placeholder ?? "Select date"
|
|
137
|
+
}
|
|
138
|
+
) });
|
|
125
139
|
};
|
|
126
140
|
const DatePickerValueText = forwardRef((props, ref) => {
|
|
127
141
|
const { children, placeholder, separator = ", ", ...localProps } = props;
|
|
128
142
|
const ctx = useDatePickerContext();
|
|
129
143
|
const hasValue = ctx.value.length > 0;
|
|
130
144
|
if (typeof children === "function") {
|
|
131
|
-
return /* @__PURE__ */
|
|
145
|
+
return /* @__PURE__ */ jsx(Fragment, { children: hasValue ? ctx.value.map((value, index) => /* @__PURE__ */ jsx(Fragment, { children: children({
|
|
132
146
|
value,
|
|
133
147
|
index,
|
|
134
148
|
valueAsString: ctx.valueAsString[index],
|
|
135
149
|
remove: () => {
|
|
136
150
|
ctx.setValue(ctx.value.filter((_, i) => i !== index));
|
|
137
151
|
}
|
|
138
|
-
}))) : placeholder);
|
|
152
|
+
}) }, index)) : placeholder });
|
|
139
153
|
}
|
|
140
|
-
return /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ jsx(mainbase.span, { ...localProps, ref, children: hasValue ? ctx.valueAsString.join(separator) : placeholder });
|
|
141
155
|
});
|
|
142
156
|
DatePickerValueText.displayName = "DatePickerValueText";
|
|
143
157
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Dialog, useDialogContext } from '@ark-ui/react/dialog';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
@@ -40,7 +41,7 @@ const DialogTitle = withContext(
|
|
|
40
41
|
const DialogCloseTrigger = withContext(Dialog.CloseTrigger, "closeTrigger", { forwardAsChild: true });
|
|
41
42
|
const DialogActionTrigger = forwardRef(function DialogActionTrigger2(props, ref) {
|
|
42
43
|
const dialog = useDialogContext();
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ jsx(mainbase.button, { ...props, ref, onClick: () => dialog.setOpen(false) });
|
|
44
45
|
});
|
|
45
46
|
const DialogBackdrop = withContext(
|
|
46
47
|
Dialog.Backdrop,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Dialog, useDialogContext } from '@ark-ui/react/dialog';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
@@ -40,7 +41,7 @@ const DrawerTitle = withContext(
|
|
|
40
41
|
const DrawerCloseTrigger = withContext(Dialog.CloseTrigger, "closeTrigger", { forwardAsChild: true });
|
|
41
42
|
const DrawerActionTrigger = forwardRef(function DrawerActionTrigger2(props, ref) {
|
|
42
43
|
const drawer = useDialogContext();
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ jsx(mainbase.button, { ...props, ref, onClick: () => drawer.setOpen(false) });
|
|
44
45
|
});
|
|
45
46
|
const DrawerBackdrop = withContext(
|
|
46
47
|
Dialog.Backdrop,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Editable, useEditableContext } from '@ark-ui/react/editable';
|
|
3
4
|
import { ark } from '@ark-ui/react/factory';
|
|
4
5
|
import { forwardRef } from 'react';
|
|
@@ -32,7 +33,7 @@ const EditableInput = withContext(
|
|
|
32
33
|
const ArkEditableTextarea = forwardRef(function EditableTextarea2(props, ref) {
|
|
33
34
|
const editable = useEditableContext();
|
|
34
35
|
const mergedProps = mergeProps(editable.getInputProps(), props);
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ jsx(ark.textarea, { ref, ...mergedProps });
|
|
36
37
|
});
|
|
37
38
|
const EditableTextarea = withContext(ArkEditableTextarea, "input", { forwardAsChild: true });
|
|
38
39
|
const EditableControl = withContext(Editable.Control, "control", { forwardAsChild: true });
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Field, useFieldContext } from '@ark-ui/react/field';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
5
6
|
import { mainbase } from '../../styled-system/factory.js';
|
|
6
7
|
import { cx } from '../../utils/cx.js';
|
|
7
|
-
import '../../utils/unit.js';
|
|
8
8
|
import '../icon/icon.js';
|
|
9
9
|
import { createIcon } from '../icon/create-icon.js';
|
|
10
10
|
|
|
@@ -44,16 +44,16 @@ const FieldRequiredIndicator = forwardRef(function RequiredIndicator(props, ref)
|
|
|
44
44
|
if (!field?.required) {
|
|
45
45
|
return fallback;
|
|
46
46
|
}
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
48
|
mainbase.span,
|
|
49
49
|
{
|
|
50
50
|
ref,
|
|
51
51
|
"aria-hidden": "true",
|
|
52
52
|
...restProps,
|
|
53
53
|
className: cx(classNames.requiredIndicator, props.className),
|
|
54
|
-
css: [styles.requiredIndicator, props.css]
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
css: [styles.requiredIndicator, props.css],
|
|
55
|
+
children
|
|
56
|
+
}
|
|
57
57
|
);
|
|
58
58
|
});
|
|
59
59
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
3
|
import { FileUpload, useFileUploadContext } from '@ark-ui/react/file-upload';
|
|
3
4
|
import { forwardRef, useMemo } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
@@ -31,7 +32,7 @@ const FileUploadItemContent = withContext("div", "itemContent");
|
|
|
31
32
|
const FileUploadItemDeleteTrigger = withContext(FileUpload.ItemDeleteTrigger, "itemDeleteTrigger", {
|
|
32
33
|
forwardAsChild: true,
|
|
33
34
|
defaultProps: {
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
const FileUploadItemGroup = withContext(FileUpload.ItemGroup, "itemGroup", { forwardAsChild: true });
|
|
@@ -39,7 +40,7 @@ const FileUploadItemName = withContext(FileUpload.ItemName, "itemName", { forwar
|
|
|
39
40
|
const FileUploadItemPreview = withContext(FileUpload.ItemPreview, "itemPreview", {
|
|
40
41
|
forwardAsChild: true,
|
|
41
42
|
defaultProps: {
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
+
children: /* @__PURE__ */ jsx(FileIcon, {})
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
const FileUploadItemPreviewImage = withContext(FileUpload.ItemPreviewImage, "itemPreviewImage", { forwardAsChild: true });
|
|
@@ -50,19 +51,26 @@ const FileUploadItems = (props) => {
|
|
|
50
51
|
const { showSize, clearable, files, ...rest } = props;
|
|
51
52
|
const fileUpload = useFileUploadContext();
|
|
52
53
|
const acceptedFiles = files ?? fileUpload.acceptedFiles;
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ jsx(For, { each: acceptedFiles, children: (file) => /* @__PURE__ */ jsxs(FileUploadItem, { file, ...rest, children: [
|
|
55
|
+
/* @__PURE__ */ jsx(FileUploadItemPreview, {}),
|
|
56
|
+
showSize ? /* @__PURE__ */ jsxs(FileUploadItemContent, { children: [
|
|
57
|
+
/* @__PURE__ */ jsx(FileUploadItemName, {}),
|
|
58
|
+
/* @__PURE__ */ jsx(FileUploadItemSizeText, {})
|
|
59
|
+
] }) : /* @__PURE__ */ jsx(FileUploadItemName, { flex: "1" }),
|
|
60
|
+
clearable && /* @__PURE__ */ jsx(FileUploadItemDeleteTrigger, {})
|
|
61
|
+
] }, file.name) });
|
|
54
62
|
};
|
|
55
63
|
const FileUploadList = forwardRef(
|
|
56
64
|
function FileUploadList2(props, ref) {
|
|
57
65
|
const { showSize, clearable, files, ...rest } = props;
|
|
58
|
-
return /* @__PURE__ */
|
|
66
|
+
return /* @__PURE__ */ jsx(FileUploadItemGroup, { ref, ...rest, children: /* @__PURE__ */ jsx(
|
|
59
67
|
FileUploadItems,
|
|
60
68
|
{
|
|
61
69
|
showSize,
|
|
62
70
|
clearable,
|
|
63
71
|
files
|
|
64
72
|
}
|
|
65
|
-
));
|
|
73
|
+
) });
|
|
66
74
|
}
|
|
67
75
|
);
|
|
68
76
|
const FileUploadFileText = forwardRef(function FileUploadFileText2(props, ref) {
|
|
@@ -79,7 +87,7 @@ const FileUploadFileText = forwardRef(function FileUploadFileText2(props, ref) {
|
|
|
79
87
|
}
|
|
80
88
|
return fallback;
|
|
81
89
|
}, [acceptedFiles, fallback]);
|
|
82
|
-
return /* @__PURE__ */
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
83
91
|
Span,
|
|
84
92
|
{
|
|
85
93
|
ref,
|
|
@@ -87,9 +95,9 @@ const FileUploadFileText = forwardRef(function FileUploadFileText2(props, ref) {
|
|
|
87
95
|
"data-scope": "file-upload",
|
|
88
96
|
"data-part": "file-text",
|
|
89
97
|
...rest,
|
|
90
|
-
css: [styles.fileText, props.css]
|
|
91
|
-
|
|
92
|
-
|
|
98
|
+
css: [styles.fileText, props.css],
|
|
99
|
+
children: fileText
|
|
100
|
+
}
|
|
93
101
|
);
|
|
94
102
|
});
|
|
95
103
|
const FileUploadContext = FileUpload.Context;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import { mainbase } from '../../styled-system/factory.js';
|
|
4
5
|
|
|
@@ -15,7 +16,7 @@ const Flex = forwardRef(
|
|
|
15
16
|
inline,
|
|
16
17
|
...rest
|
|
17
18
|
} = props;
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsx(
|
|
19
20
|
mainbase.div,
|
|
20
21
|
{
|
|
21
22
|
ref,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef, useMemo } from 'react';
|
|
3
4
|
import { mainbase } from '../../styled-system/factory.js';
|
|
4
5
|
import { mapObject } from '../../utils/walk-object.js';
|
|
5
|
-
import '../../utils/unit.js';
|
|
6
6
|
|
|
7
7
|
const Float = forwardRef(
|
|
8
8
|
function Float2(props, ref) {
|
|
@@ -65,7 +65,7 @@ const Float = forwardRef(
|
|
|
65
65
|
}),
|
|
66
66
|
[offset, offsetX, offsetY, placement]
|
|
67
67
|
);
|
|
68
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ jsx(mainbase.div, { ref, css: [styles, cssProp], ...rest });
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
Float.displayName = "Float";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { FloatingPanel } from '@ark-ui/react/floating-panel';
|
|
3
4
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
4
5
|
import { For } from '../for/for.js';
|
|
@@ -32,7 +33,7 @@ const FloatingPanelTitle = withContext(FloatingPanel.Title, "title", { forwardAs
|
|
|
32
33
|
const FloatingPanelDragTrigger = withContext(FloatingPanel.DragTrigger, "dragTrigger", { forwardAsChild: true });
|
|
33
34
|
const FloatingPanelResizeTrigger = withContext(FloatingPanel.ResizeTrigger, "resizeTrigger", { forwardAsChild: true });
|
|
34
35
|
const RESIZE_AXES = ["n", "s", "e", "w", "ne", "nw", "se", "sw"];
|
|
35
|
-
const FloatingPanelResizeTriggers = (props) => /* @__PURE__ */
|
|
36
|
+
const FloatingPanelResizeTriggers = (props) => /* @__PURE__ */ jsx(For, { each: props.axes ?? RESIZE_AXES, children: (axis) => /* @__PURE__ */ jsx(FloatingPanelResizeTrigger, { ...props, axis }, axis) });
|
|
36
37
|
const FloatingPanelStageTrigger = withContext(FloatingPanel.StageTrigger, "stageTrigger", { forwardAsChild: true });
|
|
37
38
|
const FloatingPanelCloseTrigger = withContext(FloatingPanel.CloseTrigger, "closeTrigger", { forwardAsChild: true });
|
|
38
39
|
const FloatingPanelControl = withContext(FloatingPanel.Control, "control", { forwardAsChild: true });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef, useMemo } from 'react';
|
|
3
4
|
import { mainbase } from '../../styled-system/factory.js';
|
|
4
5
|
import { compact } from '../../utils/compact.js';
|
|
5
6
|
import { mapObject } from '../../utils/walk-object.js';
|
|
6
|
-
import '../../utils/unit.js';
|
|
7
7
|
|
|
8
8
|
function spanFn(span) {
|
|
9
9
|
return mapObject(
|
|
@@ -36,7 +36,7 @@ const GridItem = forwardRef(
|
|
|
36
36
|
}),
|
|
37
37
|
[area, colSpan, colStart, colEnd, rowEnd, rowSpan, rowStart]
|
|
38
38
|
);
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ jsx(mainbase.div, { ref, css: [styles, css], ...rest });
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
42
|
GridItem.displayName = "GridItem";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import { mainbase } from '../../styled-system/factory.js';
|
|
4
5
|
|
|
@@ -16,7 +17,7 @@ const Grid = forwardRef(
|
|
|
16
17
|
inline,
|
|
17
18
|
...rest
|
|
18
19
|
} = props;
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
20
21
|
mainbase.div,
|
|
21
22
|
{
|
|
22
23
|
...rest,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { memo, forwardRef, useMemo, Children, isValidElement, cloneElement } from 'react';
|
|
3
4
|
import { mainbase } from '../../styled-system/factory.js';
|
|
4
5
|
import { dataAttr } from '../../utils/attr.js';
|
|
5
6
|
import { cx } from '../../utils/cx.js';
|
|
6
|
-
import '../../utils/unit.js';
|
|
7
7
|
|
|
8
8
|
const StyledGroup = mainbase("div", {
|
|
9
9
|
base: {
|
|
@@ -126,7 +126,7 @@ const Group = memo(
|
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
}, [children, skip]);
|
|
129
|
-
return /* @__PURE__ */
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
130
|
StyledGroup,
|
|
131
131
|
{
|
|
132
132
|
ref,
|
|
@@ -134,9 +134,9 @@ const Group = memo(
|
|
|
134
134
|
justifyContent: justify,
|
|
135
135
|
flexWrap: wrap,
|
|
136
136
|
...rest,
|
|
137
|
-
className: cx("mainbase-group", props.className)
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
className: cx("mainbase-group", props.className),
|
|
138
|
+
children: _children
|
|
139
|
+
}
|
|
140
140
|
);
|
|
141
141
|
})
|
|
142
142
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { useHighlight } from '@ark-ui/react/highlight';
|
|
3
4
|
import { Fragment } from 'react';
|
|
4
5
|
import { For } from '../for/for.js';
|
|
@@ -15,9 +16,9 @@ function Highlight(props) {
|
|
|
15
16
|
matchAll,
|
|
16
17
|
ignoreCase
|
|
17
18
|
});
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
return chunk.match ? /* @__PURE__ */
|
|
20
|
-
});
|
|
19
|
+
return /* @__PURE__ */ jsx(For, { each: chunks, children: (chunk, index) => {
|
|
20
|
+
return chunk.match ? /* @__PURE__ */ jsx(Mark, { css: styles, children: chunk.text }, index) : /* @__PURE__ */ jsx(Fragment, { children: chunk.text }, index);
|
|
21
|
+
} });
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export { Highlight };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { HoverCard } from '@ark-ui/react/hover-card';
|
|
3
4
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
4
5
|
|
|
@@ -22,7 +23,7 @@ const HoverCardArrow = withContext(
|
|
|
22
23
|
"arrow",
|
|
23
24
|
{
|
|
24
25
|
forwardAsChild: true,
|
|
25
|
-
defaultProps: { children: /* @__PURE__ */
|
|
26
|
+
defaultProps: { children: /* @__PURE__ */ jsx(HoverCardArrowTip, {}) }
|
|
26
27
|
}
|
|
27
28
|
);
|
|
28
29
|
const HoverCardContext = HoverCard.Context;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Children, forwardRef } from 'react';
|
|
3
4
|
import { Icon } from './icon.js';
|
|
4
5
|
|
|
@@ -10,16 +11,16 @@ function createIcon(options) {
|
|
|
10
11
|
defaultProps = {}
|
|
11
12
|
} = options;
|
|
12
13
|
const path = Children.toArray(options.path);
|
|
13
|
-
const Comp = forwardRef((props, ref) => /* @__PURE__ */
|
|
14
|
+
const Comp = forwardRef((props, ref) => /* @__PURE__ */ jsx(
|
|
14
15
|
Icon,
|
|
15
16
|
{
|
|
16
17
|
ref,
|
|
17
18
|
asChild: false,
|
|
18
19
|
viewBox,
|
|
19
20
|
...defaultProps,
|
|
20
|
-
...props
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
...props,
|
|
22
|
+
children: path.length ? path : /* @__PURE__ */ jsx("path", { fill: "currentColor", d: pathDefinition })
|
|
23
|
+
}
|
|
23
24
|
));
|
|
24
25
|
Comp.displayName = displayName;
|
|
25
26
|
return Comp;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
import { createRecipeContext } from '../../styled-system/create-recipe-context.js';
|
|
4
5
|
import { mainbase } from '../../styled-system/factory.js';
|
|
5
6
|
import { cx } from '../../utils/cx.js';
|
|
6
|
-
import '../../utils/unit.js';
|
|
7
7
|
|
|
8
8
|
const { useRecipeResult, PropsProvider } = createRecipeContext({ key: "icon" });
|
|
9
9
|
const Icon = React.forwardRef(
|
|
@@ -13,7 +13,7 @@ const Icon = React.forwardRef(
|
|
|
13
13
|
className,
|
|
14
14
|
props: otherProps
|
|
15
15
|
} = useRecipeResult({ asChild: !props.as, ...props });
|
|
16
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
17
|
mainbase.svg,
|
|
18
18
|
{
|
|
19
19
|
ref,
|