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,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
var index = require('../square/index.cjs');
|
|
6
7
|
|
|
7
|
-
const Circle = React
|
|
8
|
+
const Circle = React.forwardRef(
|
|
8
9
|
function Circle2(props, ref) {
|
|
9
10
|
const { size, ...rest } = props;
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Square, { size, ref, borderRadius: "9999px", ...rest });
|
|
11
12
|
}
|
|
12
13
|
);
|
|
13
14
|
Circle.displayName = "Circle";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
var show = require('../show/show.cjs');
|
|
6
7
|
|
|
7
8
|
const ClientOnly = (props) => {
|
|
8
9
|
const { children, fallback } = props;
|
|
9
|
-
const [hasMounted, setHasMounted] = React
|
|
10
|
-
React
|
|
10
|
+
const [hasMounted, setHasMounted] = React.useState(false);
|
|
11
|
+
React.useEffect(() => {
|
|
11
12
|
setHasMounted(true);
|
|
12
13
|
}, []);
|
|
13
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(show.Show, { when: hasMounted, fallback, children });
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
exports.ClientOnly = ClientOnly;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var clipboard = require('@ark-ui/react/clipboard');
|
|
5
|
-
var React
|
|
6
|
+
var React = require('react');
|
|
6
7
|
var createSlotRecipeContext = require('../../styled-system/create-slot-recipe-context.cjs');
|
|
7
8
|
var icons = require('../icons.cjs');
|
|
8
9
|
|
|
@@ -24,16 +25,16 @@ const ClipboardControl = withContext(clipboard.Clipboard.Control, "control", { f
|
|
|
24
25
|
const ClipboardIndicator = withContext(clipboard.Clipboard.Indicator, "indicator", {
|
|
25
26
|
forwardAsChild: true,
|
|
26
27
|
defaultProps: {
|
|
27
|
-
copied: /* @__PURE__ */
|
|
28
|
-
children: /* @__PURE__ */
|
|
28
|
+
copied: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckIcon, { boxSize: "1em" }),
|
|
29
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyIcon, { boxSize: "1em" })
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
const ClipboardInput = withContext(clipboard.Clipboard.Input, "input", { forwardAsChild: true });
|
|
32
33
|
const ClipboardLabel = withContext(clipboard.Clipboard.Label, "label", { forwardAsChild: true });
|
|
33
34
|
const ClipboardContext = clipboard.Clipboard.Context;
|
|
34
35
|
const ClipboardValueText = withContext(clipboard.Clipboard.ValueText, "valueText", { forwardAsChild: true });
|
|
35
|
-
const ClipboardCopyText = React
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
const ClipboardCopyText = React.forwardRef(function ClipboardCopyText2(props, ref) {
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ClipboardIndicator, { copied: "Copied", ...props, ref, children: "Copy" });
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
exports.ClipboardContext = ClipboardContext;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var codeBlockAdapterContext = require('./code-block-adapter-context.cjs');
|
|
5
6
|
var useCodeHighlight = require('./use-code-highlight.cjs');
|
|
6
7
|
|
|
7
8
|
function CodeBlockAdapterProvider(props) {
|
|
8
9
|
const { children, value } = props;
|
|
9
10
|
const context = useCodeHighlight.useCodeHighlight(value);
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(codeBlockAdapterContext.CodeBlockAdapterContextProvider, { value: context, children });
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
exports.CodeBlockAdapterProvider = CodeBlockAdapterProvider;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var clipboard = require('@ark-ui/react/clipboard');
|
|
5
6
|
var factory = require('@ark-ui/react/factory');
|
|
6
|
-
var React
|
|
7
|
-
var createSlotRecipeContext = require('../../styled-system/create-slot-recipe-context.cjs');
|
|
7
|
+
var React = require('react');
|
|
8
8
|
var useControllableState = require('../../hooks/use-controllable-state.cjs');
|
|
9
|
-
require('
|
|
10
|
-
require('
|
|
9
|
+
var mergeProps = require('../../merge-props.cjs');
|
|
10
|
+
var createSlotRecipeContext = require('../../styled-system/create-slot-recipe-context.cjs');
|
|
11
11
|
var attr = require('../../utils/attr.cjs');
|
|
12
12
|
var cx = require('../../utils/cx.cjs');
|
|
13
|
-
require('../../utils/unit.cjs');
|
|
14
|
-
var mergeProps = require('../../merge-props.cjs');
|
|
15
13
|
var icons = require('../icons.cjs');
|
|
16
14
|
var codeBlockAdapterContext = require('./code-block-adapter-context.cjs');
|
|
17
15
|
var codeBlockContext = require('./code-block-context.cjs');
|
|
@@ -24,7 +22,7 @@ const {
|
|
|
24
22
|
} = createSlotRecipeContext.createSlotRecipeContext({
|
|
25
23
|
key: "codeBlock"
|
|
26
24
|
});
|
|
27
|
-
const RootBase = React
|
|
25
|
+
const RootBase = React.forwardRef(
|
|
28
26
|
function RootBase2(props, ref) {
|
|
29
27
|
const {
|
|
30
28
|
children,
|
|
@@ -37,7 +35,7 @@ const RootBase = React$1.forwardRef(
|
|
|
37
35
|
onCopy,
|
|
38
36
|
...rest
|
|
39
37
|
} = props;
|
|
40
|
-
const meta = React
|
|
38
|
+
const meta = React.useMemo(
|
|
41
39
|
() => ({
|
|
42
40
|
...metaProp,
|
|
43
41
|
colorScheme: metaProp?.colorScheme ?? defaultColorScheme
|
|
@@ -56,8 +54,8 @@ const RootBase = React$1.forwardRef(
|
|
|
56
54
|
const [collapsed, setCollapsed] = useControllableState.useControllableState({
|
|
57
55
|
defaultValue: maxLines != null ? codeLines > maxLines : false
|
|
58
56
|
});
|
|
59
|
-
const uid = React
|
|
60
|
-
const collapsible = React
|
|
57
|
+
const uid = React.useId();
|
|
58
|
+
const collapsible = React.useMemo(
|
|
61
59
|
() => ({
|
|
62
60
|
contentId: `${uid}-content`,
|
|
63
61
|
collapsed,
|
|
@@ -66,7 +64,7 @@ const RootBase = React$1.forwardRef(
|
|
|
66
64
|
}),
|
|
67
65
|
[collapsed, setCollapsed, uid]
|
|
68
66
|
);
|
|
69
|
-
const context = React
|
|
67
|
+
const context = React.useMemo(
|
|
70
68
|
() => ({
|
|
71
69
|
code,
|
|
72
70
|
language,
|
|
@@ -76,7 +74,7 @@ const RootBase = React$1.forwardRef(
|
|
|
76
74
|
}),
|
|
77
75
|
[code, language, clipboard$1, collapsible, meta]
|
|
78
76
|
);
|
|
79
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ jsxRuntime.jsx(codeBlockContext.CodeBlockContextProvider, { value: context, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
78
|
factory.ark.div,
|
|
81
79
|
{
|
|
82
80
|
ref,
|
|
@@ -90,10 +88,10 @@ const RootBase = React$1.forwardRef(
|
|
|
90
88
|
style: {
|
|
91
89
|
...rest.style,
|
|
92
90
|
["--code-block-line-length"]: `${String(codeLines).length}ch`
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
));
|
|
91
|
+
},
|
|
92
|
+
children
|
|
93
|
+
}
|
|
94
|
+
) });
|
|
97
95
|
}
|
|
98
96
|
);
|
|
99
97
|
const CodeBlockRoot = withProvider(
|
|
@@ -102,20 +100,20 @@ const CodeBlockRoot = withProvider(
|
|
|
102
100
|
{ forwardAsChild: true, forwardProps: ["maxLines"] }
|
|
103
101
|
);
|
|
104
102
|
const CodeBlockPropsProvider = PropsProvider;
|
|
105
|
-
const ContentBase = React
|
|
103
|
+
const ContentBase = React.forwardRef(
|
|
106
104
|
function ContentBase2(props, ref) {
|
|
107
105
|
const { children, ...restProps } = props;
|
|
108
106
|
const { collapsible } = codeBlockContext.useCodeBlockContext();
|
|
109
|
-
return /* @__PURE__ */
|
|
107
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
110
108
|
factory.ark.div,
|
|
111
109
|
{
|
|
112
110
|
ref,
|
|
113
111
|
id: collapsible.contentId,
|
|
114
112
|
"data-expanded": attr.dataAttr(!collapsible.collapsed),
|
|
115
113
|
"aria-expanded": !collapsible.collapsed,
|
|
116
|
-
...restProps
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
...restProps,
|
|
115
|
+
children
|
|
116
|
+
}
|
|
119
117
|
);
|
|
120
118
|
}
|
|
121
119
|
);
|
|
@@ -134,13 +132,13 @@ const CodeBlockCode = withContext(
|
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
);
|
|
137
|
-
const CodeText = React
|
|
135
|
+
const CodeText = React.forwardRef(
|
|
138
136
|
function CodeText2(props, ref) {
|
|
139
137
|
const { code, language, meta } = codeBlockContext.useCodeBlockContext();
|
|
140
138
|
const { highlight } = codeBlockAdapterContext.useCodeBlockAdapterContext();
|
|
141
139
|
const highlighted = highlight?.({ code, language, meta });
|
|
142
140
|
const codeContentProps = highlighted?.highlighted ? { dangerouslySetInnerHTML: { __html: highlighted.code } } : { children: code };
|
|
143
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
144
142
|
factory.ark.code,
|
|
145
143
|
{
|
|
146
144
|
"data-plaintext": attr.dataAttr(!highlighted?.highlighted),
|
|
@@ -158,39 +156,39 @@ const CodeText = React$1.forwardRef(
|
|
|
158
156
|
}
|
|
159
157
|
);
|
|
160
158
|
const CodeBlockCodeText = withContext(CodeText, "codeText", { forwardAsChild: true });
|
|
161
|
-
const BaseCopyTrigger = React
|
|
159
|
+
const BaseCopyTrigger = React.forwardRef(
|
|
162
160
|
function BaseCopyTrigger2(props, ref) {
|
|
163
161
|
const { children, ...restProps } = props;
|
|
164
162
|
const { clipboard } = codeBlockContext.useCodeBlockContext();
|
|
165
|
-
return /* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
166
164
|
factory.ark.button,
|
|
167
165
|
{
|
|
168
166
|
ref,
|
|
169
|
-
...mergeProps.mergeProps(clipboard.getTriggerProps(), restProps)
|
|
170
|
-
|
|
171
|
-
|
|
167
|
+
...mergeProps.mergeProps(clipboard.getTriggerProps(), restProps),
|
|
168
|
+
children
|
|
169
|
+
}
|
|
172
170
|
);
|
|
173
171
|
}
|
|
174
172
|
);
|
|
175
173
|
const CodeBlockCopyTrigger = withContext(BaseCopyTrigger, "copyTrigger", { forwardAsChild: true });
|
|
176
|
-
const BaseCopyIndicator = React
|
|
174
|
+
const BaseCopyIndicator = React.forwardRef(
|
|
177
175
|
function BaseCopyIndicator2(props, ref) {
|
|
178
176
|
const { children, copied, ...restProps } = props;
|
|
179
177
|
const { clipboard } = codeBlockContext.useCodeBlockContext();
|
|
180
|
-
return /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ref, ...restProps, children: clipboard.copied ? copied : children });
|
|
181
179
|
}
|
|
182
180
|
);
|
|
183
181
|
const CodeBlockCopyIndicator = withContext(BaseCopyIndicator, "copyIndicator", {
|
|
184
182
|
forwardAsChild: true,
|
|
185
183
|
defaultProps: {
|
|
186
|
-
copied: /* @__PURE__ */
|
|
187
|
-
children: /* @__PURE__ */
|
|
184
|
+
copied: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckIcon, { boxSize: "1em" }),
|
|
185
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.CopyIcon, { boxSize: "1em" })
|
|
188
186
|
}
|
|
189
187
|
});
|
|
190
|
-
const BaseCollapseTrigger = React
|
|
188
|
+
const BaseCollapseTrigger = React.forwardRef(function BaseCollapseTrigger2(props, ref) {
|
|
191
189
|
const { children, ...restProps } = props;
|
|
192
190
|
const { collapsible } = codeBlockContext.useCodeBlockContext();
|
|
193
|
-
return /* @__PURE__ */
|
|
191
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
194
192
|
factory.ark.button,
|
|
195
193
|
{
|
|
196
194
|
type: "button",
|
|
@@ -202,33 +200,33 @@ const BaseCollapseTrigger = React$1.forwardRef(function BaseCollapseTrigger2(pro
|
|
|
202
200
|
onClick: (e) => {
|
|
203
201
|
restProps.onClick?.(e);
|
|
204
202
|
collapsible.toggleCollapsed();
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
203
|
+
},
|
|
204
|
+
children
|
|
205
|
+
}
|
|
208
206
|
);
|
|
209
207
|
});
|
|
210
208
|
const CodeBlockCollapseTrigger = withContext(BaseCollapseTrigger, "collapseTrigger", { forwardAsChild: true });
|
|
211
|
-
const BaseCollapseIndicator = React
|
|
209
|
+
const BaseCollapseIndicator = React.forwardRef(function BaseCollapseIndicator2(props, ref) {
|
|
212
210
|
const { children, collapsed, ...restProps } = props;
|
|
213
211
|
const { collapsible } = codeBlockContext.useCodeBlockContext();
|
|
214
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ref, ...restProps, children: collapsible.collapsed ? collapsed : children });
|
|
215
213
|
});
|
|
216
214
|
const CodeBlockCollapseIndicator = withContext(BaseCollapseIndicator, "collapseIndicator", {
|
|
217
215
|
forwardAsChild: true,
|
|
218
216
|
defaultProps: {
|
|
219
|
-
collapsed: /* @__PURE__ */
|
|
220
|
-
children: /* @__PURE__ */
|
|
217
|
+
collapsed: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, { boxSize: "1em" }),
|
|
218
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronUpIcon, { boxSize: "1em" })
|
|
221
219
|
}
|
|
222
220
|
});
|
|
223
|
-
const CodeBlockCollapseText = React
|
|
224
|
-
return /* @__PURE__ */
|
|
221
|
+
const CodeBlockCollapseText = React.forwardRef(function CodeBlockCollapseText2(props, ref) {
|
|
222
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CodeBlockCollapseIndicator, { ref, ...props, collapsed: "Expand code", children: props.children || "Collapse code" });
|
|
225
223
|
});
|
|
226
224
|
const CodeBlockFooter = withContext("footer", "footer");
|
|
227
225
|
const CodeBlockControl = withContext("div", "control");
|
|
228
|
-
const BaseOverlay = React
|
|
226
|
+
const BaseOverlay = React.forwardRef(
|
|
229
227
|
function BaseOverlay2(props, ref) {
|
|
230
228
|
const { collapsible } = codeBlockContext.useCodeBlockContext();
|
|
231
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
232
230
|
factory.ark.div,
|
|
233
231
|
{
|
|
234
232
|
ref,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var colorPicker = require('@ark-ui/react/color-picker');
|
|
5
|
-
var React
|
|
6
|
+
var React = require('react');
|
|
6
7
|
var mergeProps = require('../../merge-props.cjs');
|
|
7
8
|
var createSlotRecipeContext = require('../../styled-system/create-slot-recipe-context.cjs');
|
|
8
9
|
require('../button/button.cjs');
|
|
@@ -30,7 +31,7 @@ const ColorPickerValueSwatch = withContext(colorPicker.ColorPicker.ValueSwatch,
|
|
|
30
31
|
const ColorPickerTrigger = withContext(colorPicker.ColorPicker.Trigger, "trigger", {
|
|
31
32
|
forwardAsChild: true,
|
|
32
33
|
defaultProps: {
|
|
33
|
-
children: /* @__PURE__ */
|
|
34
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ColorPickerValueSwatch, {})
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
const ColorPickerPositioner = withContext(colorPicker.ColorPicker.Positioner, "positioner", { forwardAsChild: true });
|
|
@@ -40,7 +41,10 @@ const ColorPickerAreaThumb = withContext(colorPicker.ColorPicker.AreaThumb, "are
|
|
|
40
41
|
const ColorPickerArea = withContext(colorPicker.ColorPicker.Area, "area", {
|
|
41
42
|
forwardAsChild: true,
|
|
42
43
|
defaultProps: {
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColorPickerAreaBackground, {}),
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColorPickerAreaThumb, {})
|
|
47
|
+
] })
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
50
|
const ColorPickerChannelSliderTrack = withContext(colorPicker.ColorPicker.ChannelSliderTrack, "channelSliderTrack", {
|
|
@@ -53,17 +57,24 @@ const ColorPickerTransparencyGrid = withContext(colorPicker.ColorPicker.Transpar
|
|
|
53
57
|
const ColorPickerChannelSlider = withContext(colorPicker.ColorPicker.ChannelSlider, "channelSlider", {
|
|
54
58
|
forwardAsChild: true,
|
|
55
59
|
defaultProps: {
|
|
56
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
61
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColorPickerTransparencyGrid, { size: "0.6rem" }),
|
|
62
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColorPickerChannelSliderTrack, {}),
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColorPickerChannelSliderThumb, {})
|
|
64
|
+
] })
|
|
57
65
|
}
|
|
58
66
|
});
|
|
59
|
-
const ColorPickerSliders = React
|
|
67
|
+
const ColorPickerSliders = React.forwardRef(
|
|
60
68
|
function ColorPickerSliders2(props, ref) {
|
|
61
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(stack.Stack, { gap: "1", flex: "1", px: "1", ref, ...props, children: [
|
|
70
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColorPickerChannelSlider, { channel: "hue" }),
|
|
71
|
+
/* @__PURE__ */ jsxRuntime.jsx(ColorPickerChannelSlider, { channel: "alpha" })
|
|
72
|
+
] });
|
|
62
73
|
}
|
|
63
74
|
);
|
|
64
75
|
const ColorPickerChannelInput = withContext(colorPicker.ColorPicker.ChannelInput, "channelInput", { forwardAsChild: true });
|
|
65
|
-
const ColorPickerInput = React
|
|
66
|
-
return /* @__PURE__ */
|
|
76
|
+
const ColorPickerInput = React.forwardRef(function ColorHexInput(props, ref) {
|
|
77
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ColorPickerChannelInput, { channel: "hex", ref, ...props });
|
|
67
78
|
});
|
|
68
79
|
const ColorPickerSwatchGroup = withContext(colorPicker.ColorPicker.SwatchGroup, "swatchGroup", { forwardAsChild: true });
|
|
69
80
|
const ColorPickerSwatchTrigger = withContext(colorPicker.ColorPicker.SwatchTrigger, "swatchTrigger", { forwardAsChild: true });
|
|
@@ -76,11 +87,11 @@ const ColorPickerFormatSelect = withContext(colorPicker.ColorPicker.FormatSelect
|
|
|
76
87
|
const ColorPickerEyeDropperTrigger = withContext(colorPicker.ColorPicker.EyeDropperTrigger, "eyeDropperTrigger", {
|
|
77
88
|
forwardAsChild: true
|
|
78
89
|
});
|
|
79
|
-
const ColorPickerEyeDropper = React
|
|
80
|
-
const { children = /* @__PURE__ */
|
|
90
|
+
const ColorPickerEyeDropper = React.forwardRef(function ColorPickerEyeDropper2(props, ref) {
|
|
91
|
+
const { children = /* @__PURE__ */ jsxRuntime.jsx(icons.PipetteIcon, {}), ...rest } = props;
|
|
81
92
|
const picker = colorPicker.useColorPickerContext();
|
|
82
93
|
const localProps = mergeProps.mergeProps(picker.getEyeDropperTriggerProps(), rest);
|
|
83
|
-
return /* @__PURE__ */
|
|
94
|
+
return /* @__PURE__ */ jsxRuntime.jsx(iconButton.IconButton, { ref, ...localProps, children });
|
|
84
95
|
});
|
|
85
96
|
const ColorPickerChannelSliderValueText = withContext(colorPicker.ColorPicker.ChannelSliderValueText, "channelSliderValueText", {
|
|
86
97
|
forwardAsChild: true
|
|
@@ -88,8 +99,8 @@ const ColorPickerChannelSliderValueText = withContext(colorPicker.ColorPicker.Ch
|
|
|
88
99
|
const ColorPickerChannelSliderLabel = withContext(colorPicker.ColorPicker.ChannelSliderLabel, "channelSliderLabel", {
|
|
89
100
|
forwardAsChild: true
|
|
90
101
|
});
|
|
91
|
-
const ColorPickerHiddenInput = React
|
|
92
|
-
return /* @__PURE__ */
|
|
102
|
+
const ColorPickerHiddenInput = React.forwardRef(function ColorPickerHiddenInput2(props, ref) {
|
|
103
|
+
return /* @__PURE__ */ jsxRuntime.jsx(colorPicker.ColorPicker.HiddenInput, { tabIndex: -1, ref, ...props });
|
|
93
104
|
});
|
|
94
105
|
const ColorPickerContext = colorPicker.ColorPicker.Context;
|
|
95
106
|
const ColorPickerChannelText = withContext("span", "channelText", {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var React = require('react');
|
|
5
6
|
var createRecipeContext = require('../../styled-system/create-recipe-context.cjs');
|
|
6
7
|
var factory = require('../../styled-system/factory.cjs');
|
|
7
8
|
var cx = require('../../utils/cx.cjs');
|
|
8
|
-
require('../../utils/unit.cjs');
|
|
9
9
|
var grid = require('../grid/grid.cjs');
|
|
10
10
|
require('../grid/grid-item.cjs');
|
|
11
11
|
|
|
12
12
|
const { withPropsProvider, useRecipeResult } = createRecipeContext.createRecipeContext({
|
|
13
13
|
key: "colorSwatch"
|
|
14
14
|
});
|
|
15
|
-
const ColorSwatch = React
|
|
15
|
+
const ColorSwatch = React.forwardRef(
|
|
16
16
|
function ColorSwatch2(props, ref) {
|
|
17
17
|
const { value, ...restProps } = props;
|
|
18
18
|
const { styles, className, props: localProps } = useRecipeResult(restProps);
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
20
|
factory.mainbase.span,
|
|
21
21
|
{
|
|
22
22
|
...localProps,
|
|
@@ -35,21 +35,21 @@ const ColorSwatchMix = (props) => {
|
|
|
35
35
|
throw new Error("ColorSwatchMix doesn't support more than 4 colors");
|
|
36
36
|
}
|
|
37
37
|
const isThreeColors = items.length === 3;
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ColorSwatch, { overflow: "hidden", ...restProps, value: "transparent", children: /* @__PURE__ */ jsxRuntime.jsx(grid.Grid, { templateColumns: "var(--swatch-size) var(--swatch-size)", children: items.map((item, index) => {
|
|
39
39
|
const isLast = index === items.length - 1;
|
|
40
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
41
41
|
ColorSwatch,
|
|
42
42
|
{
|
|
43
43
|
size: "inherit",
|
|
44
|
-
key: item,
|
|
45
44
|
rounded: "none",
|
|
46
45
|
value: item,
|
|
47
46
|
boxShadow: "none",
|
|
48
47
|
gridColumn: isThreeColors && isLast ? "span 2 / span 2" : void 0,
|
|
49
48
|
width: isThreeColors && isLast ? "unset" : void 0
|
|
50
|
-
}
|
|
49
|
+
},
|
|
50
|
+
item
|
|
51
51
|
);
|
|
52
|
-
})));
|
|
52
|
+
}) }) });
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
exports.ColorSwatch = ColorSwatch;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var combobox = require('@ark-ui/react/combobox');
|
|
5
6
|
var createSlotRecipeContext = require('../../styled-system/create-slot-recipe-context.cjs');
|
|
6
7
|
var icons = require('../icons.cjs');
|
|
@@ -24,7 +25,7 @@ const ComboboxTrigger = withContext(combobox.Combobox.Trigger, "trigger", {
|
|
|
24
25
|
forwardAsChild: true,
|
|
25
26
|
forwardProps: ["focusable"],
|
|
26
27
|
defaultProps: {
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronDownIcon, {})
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
const ComboboxPositioner = withContext(combobox.Combobox.Positioner, "positioner", { forwardAsChild: true });
|
|
@@ -42,7 +43,7 @@ const ComboboxInput = withContext(
|
|
|
42
43
|
const ComboboxClearTrigger = withContext(combobox.Combobox.ClearTrigger, "clearTrigger", {
|
|
43
44
|
forwardAsChild: true,
|
|
44
45
|
defaultProps: {
|
|
45
|
-
children: /* @__PURE__ */
|
|
46
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, {})
|
|
46
47
|
}
|
|
47
48
|
});
|
|
48
49
|
const ComboboxIndicatorGroup = withContext("div", "indicatorGroup");
|
|
@@ -57,7 +58,7 @@ const ComboboxItemText = withContext(combobox.Combobox.ItemText, "itemText", { f
|
|
|
57
58
|
const ComboboxItemIndicator = withContext(combobox.Combobox.ItemIndicator, "itemIndicator", {
|
|
58
59
|
forwardAsChild: true,
|
|
59
60
|
defaultProps: {
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckIcon, {})
|
|
61
62
|
}
|
|
62
63
|
});
|
|
63
64
|
const ComboboxControl = withContext(combobox.Combobox.Control, "control", { forwardAsChild: true });
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
5
|
var datePicker = require('@ark-ui/react/date-picker');
|
|
5
|
-
var React
|
|
6
|
+
var React = require('react');
|
|
6
7
|
var createSlotRecipeContext = require('../../styled-system/create-slot-recipe-context.cjs');
|
|
7
8
|
var factory = require('../../styled-system/factory.cjs');
|
|
8
9
|
var button = require('../button/button.cjs');
|
|
@@ -26,7 +27,7 @@ const DatePickerPropsProvider = PropsProvider;
|
|
|
26
27
|
const DatePickerClearTrigger = withContext(datePicker.DatePicker.ClearTrigger, "clearTrigger", {
|
|
27
28
|
forwardAsChild: true,
|
|
28
29
|
defaultProps: {
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.CloseIcon, {})
|
|
30
31
|
}
|
|
31
32
|
});
|
|
32
33
|
const DatePickerContent = withContext(datePicker.DatePicker.Content, "content", { forwardAsChild: true });
|
|
@@ -37,7 +38,7 @@ const DatePickerMonthSelect = withContext(datePicker.DatePicker.MonthSelect, "mo
|
|
|
37
38
|
const DatePickerNextTrigger = withContext(datePicker.DatePicker.NextTrigger, "nextTrigger", {
|
|
38
39
|
forwardAsChild: true,
|
|
39
40
|
defaultProps: {
|
|
40
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronRightIcon, {})
|
|
41
42
|
}
|
|
42
43
|
});
|
|
43
44
|
const DatePickerPositioner = withContext(datePicker.DatePicker.Positioner, "positioner", { forwardAsChild: true });
|
|
@@ -45,7 +46,7 @@ const DatePickerPresetTrigger = withContext(datePicker.DatePicker.PresetTrigger,
|
|
|
45
46
|
const DatePickerPrevTrigger = withContext(datePicker.DatePicker.PrevTrigger, "prevTrigger", {
|
|
46
47
|
forwardAsChild: true,
|
|
47
48
|
defaultProps: {
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.ChevronLeftIcon, {})
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
const DatePickerRangeText = withContext(datePicker.DatePicker.RangeText, "rangeText", { forwardAsChild: true });
|
|
@@ -84,62 +85,75 @@ const DatePickerWeekNumberCellText = withContext("span", "tableCellTrigger", {
|
|
|
84
85
|
forwardAsChild: true
|
|
85
86
|
});
|
|
86
87
|
const DatePickerHeader = (props) => {
|
|
87
|
-
return /* @__PURE__ */
|
|
88
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DatePickerViewControl, { ...props, children: [
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx(DatePickerPrevTrigger, {}),
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx(DatePickerViewTrigger, { children: /* @__PURE__ */ jsxRuntime.jsx(DatePickerRangeText, {}) }),
|
|
91
|
+
/* @__PURE__ */ jsxRuntime.jsx(DatePickerNextTrigger, {})
|
|
92
|
+
] });
|
|
88
93
|
};
|
|
89
94
|
const DatePickerDayTable = (props) => {
|
|
90
95
|
const { offset, weekNumberLabel = "#", ...rest } = props;
|
|
91
96
|
const ctx = datePicker.useDatePickerContext();
|
|
92
97
|
const offsetDays = offset ? ctx.getOffset({ months: offset }) : void 0;
|
|
93
98
|
const weeks = offsetDays ? offsetDays.weeks : ctx.weeks;
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DatePickerTable, { ...rest, children: [
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx(DatePickerTableHead, { children: /* @__PURE__ */ jsxRuntime.jsxs(DatePickerTableRow, { children: [
|
|
101
|
+
ctx.showWeekNumbers && /* @__PURE__ */ jsxRuntime.jsx(DatePickerWeekNumberHeaderCell, { children: weekNumberLabel }),
|
|
102
|
+
ctx.weekDays.map((weekDay, id) => /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableHeader, { children: weekDay.narrow }, id))
|
|
103
|
+
] }) }),
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx(DatePickerTableBody, { children: weeks.map((week, weekIndex) => /* @__PURE__ */ jsxRuntime.jsxs(DatePickerTableRow, { children: [
|
|
105
|
+
ctx.showWeekNumbers && /* @__PURE__ */ jsxRuntime.jsx(DatePickerWeekNumberCell, { weekIndex, week, children: /* @__PURE__ */ jsxRuntime.jsx(DatePickerWeekNumberCellText, { children: ctx.getWeekNumber(week) }) }),
|
|
106
|
+
week.map((day, id) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
|
+
DatePickerTableCell,
|
|
108
|
+
{
|
|
109
|
+
value: day,
|
|
110
|
+
visibleRange: offsetDays?.visibleRange,
|
|
111
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableCellTrigger, { children: day.day })
|
|
112
|
+
},
|
|
113
|
+
id
|
|
114
|
+
))
|
|
115
|
+
] }, weekIndex)) })
|
|
116
|
+
] });
|
|
103
117
|
};
|
|
104
118
|
const DatePickerMonthTable = (props) => {
|
|
105
119
|
const datePicker$1 = datePicker.useDatePickerContext();
|
|
106
120
|
const { columns = 4, format = "short", ...rest } = props;
|
|
107
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DatePickerTable, { ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableBody, { children: datePicker$1.getMonthsGrid({ columns, format }).map((months, id) => /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableRow, { children: months.map((month, id2) => /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableCell, { value: month.value, children: /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableCellTrigger, { children: month.label }) }, id2)) }, id)) }) });
|
|
108
122
|
};
|
|
109
123
|
const DatePickerYearTable = (props) => {
|
|
110
124
|
const datePicker$1 = datePicker.useDatePickerContext();
|
|
111
125
|
const { columns = 4, ...rest } = props;
|
|
112
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DatePickerTable, { ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableBody, { children: datePicker$1.getYearsGrid({ columns }).map((years, id) => /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableRow, { children: years.map((year, id2) => /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableCell, { value: year.value, children: /* @__PURE__ */ jsxRuntime.jsx(DatePickerTableCellTrigger, { children: year.label }) }, id2)) }, id)) }) });
|
|
113
127
|
};
|
|
114
128
|
const DatePickerValue = (props) => {
|
|
115
129
|
const { placeholder, value, ...rest } = props;
|
|
116
130
|
const ctx = datePicker.useDatePickerContext();
|
|
117
|
-
return /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DatePickerTrigger, { asChild: true, unstyled: true, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
118
132
|
button.Button,
|
|
119
133
|
{
|
|
120
134
|
variant: "outline",
|
|
121
135
|
width: "full",
|
|
122
136
|
justifyContent: "flex-start",
|
|
123
|
-
textAlign: "start"
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
));
|
|
137
|
+
textAlign: "start",
|
|
138
|
+
children: ctx.value.length ? ctx.value[0].toDate("UTC").toLocaleDateString() : placeholder ?? "Select date"
|
|
139
|
+
}
|
|
140
|
+
) });
|
|
127
141
|
};
|
|
128
|
-
const DatePickerValueText = React
|
|
142
|
+
const DatePickerValueText = React.forwardRef((props, ref) => {
|
|
129
143
|
const { children, placeholder, separator = ", ", ...localProps } = props;
|
|
130
144
|
const ctx = datePicker.useDatePickerContext();
|
|
131
145
|
const hasValue = ctx.value.length > 0;
|
|
132
146
|
if (typeof children === "function") {
|
|
133
|
-
return /* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: hasValue ? ctx.value.map((value, index) => /* @__PURE__ */ jsxRuntime.jsx(React.Fragment, { children: children({
|
|
134
148
|
value,
|
|
135
149
|
index,
|
|
136
150
|
valueAsString: ctx.valueAsString[index],
|
|
137
151
|
remove: () => {
|
|
138
152
|
ctx.setValue(ctx.value.filter((_, i) => i !== index));
|
|
139
153
|
}
|
|
140
|
-
}))) : placeholder);
|
|
154
|
+
}) }, index)) : placeholder });
|
|
141
155
|
}
|
|
142
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.mainbase.span, { ...localProps, ref, children: hasValue ? ctx.valueAsString.join(separator) : placeholder });
|
|
143
157
|
});
|
|
144
158
|
DatePickerValueText.displayName = "DatePickerValueText";
|
|
145
159
|
|