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,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef, useMemo } from 'react';
|
|
3
4
|
import { mergeProps } from '../../merge-props.js';
|
|
4
5
|
import { createRecipeContext } from '../../styled-system/create-recipe-context.js';
|
|
5
6
|
import { mainbase } from '../../styled-system/factory.js';
|
|
6
7
|
import { dataAttr } from '../../utils/attr.js';
|
|
7
8
|
import { cx } from '../../utils/cx.js';
|
|
8
|
-
import '../../utils/unit.js';
|
|
9
9
|
import { Loader } from '../loader/loader.js';
|
|
10
10
|
import '../loader/loader-overlay.js';
|
|
11
11
|
|
|
@@ -28,7 +28,7 @@ const Button = forwardRef(
|
|
|
28
28
|
spinnerPlacement,
|
|
29
29
|
...rest
|
|
30
30
|
} = result.props;
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ jsx(
|
|
32
32
|
mainbase.button,
|
|
33
33
|
{
|
|
34
34
|
type: "button",
|
|
@@ -37,17 +37,17 @@ const Button = forwardRef(
|
|
|
37
37
|
"data-loading": dataAttr(loading),
|
|
38
38
|
disabled: loading || rest.disabled,
|
|
39
39
|
className: cx(result.className, props.className),
|
|
40
|
-
css: [result.styles, props.css]
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
children
|
|
50
|
-
|
|
40
|
+
css: [result.styles, props.css],
|
|
41
|
+
children: !props.asChild && loading ? /* @__PURE__ */ jsx(
|
|
42
|
+
Loader,
|
|
43
|
+
{
|
|
44
|
+
spinner,
|
|
45
|
+
text: loadingText,
|
|
46
|
+
spinnerPlacement,
|
|
47
|
+
children
|
|
48
|
+
}
|
|
49
|
+
) : children
|
|
50
|
+
}
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { CloseIcon } from '../icons.js';
|
|
3
4
|
import { IconButton } from './icon-button.js';
|
|
4
5
|
|
|
5
6
|
const CloseButton = React.forwardRef(function CloseButton2(props, ref) {
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsx(IconButton, { variant: "ghost", "aria-label": "Close", ref, ...props, children: props.children ?? /* @__PURE__ */ jsx(CloseIcon, {}) });
|
|
7
8
|
});
|
|
8
9
|
CloseButton.displayName = "CloseButton";
|
|
9
10
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import { Button } from './button.js';
|
|
4
5
|
|
|
5
6
|
const IconButton = forwardRef(
|
|
6
7
|
function IconButton2(props, ref) {
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
8
9
|
Button,
|
|
9
10
|
{
|
|
10
11
|
px: "0",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
3
|
import { Carousel, useCarouselContext } from '@ark-ui/react/carousel';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
@@ -35,26 +36,30 @@ const CarouselItem = withContext(
|
|
|
35
36
|
const CarouselControl = withContext(Carousel.Control, "control", { forwardAsChild: true });
|
|
36
37
|
const CarouselPrevTrigger = withContext(Carousel.PrevTrigger, "prevTrigger", {
|
|
37
38
|
forwardAsChild: true,
|
|
38
|
-
defaultProps: { children: /* @__PURE__ */
|
|
39
|
+
defaultProps: { children: /* @__PURE__ */ jsx(ChevronLeftIcon, {}) }
|
|
39
40
|
});
|
|
40
41
|
const CarouselNextTrigger = withContext(Carousel.NextTrigger, "nextTrigger", {
|
|
41
42
|
forwardAsChild: true,
|
|
42
|
-
defaultProps: { children: /* @__PURE__ */
|
|
43
|
+
defaultProps: { children: /* @__PURE__ */ jsx(ChevronRightIcon, {}) }
|
|
43
44
|
});
|
|
44
45
|
const CarouselIndicators = forwardRef(function CarouselIndicators2(props, ref) {
|
|
45
46
|
const api = useCarouselContext();
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ jsx(CarouselIndicatorGroup, { ref, children: api.pageSnapPoints.map((_, index) => /* @__PURE__ */ jsx(CarouselIndicator, { index, ...props }, index)) });
|
|
47
48
|
});
|
|
48
49
|
const CarouselAutoplayIndicator = ({
|
|
49
50
|
play,
|
|
50
51
|
paused
|
|
51
52
|
}) => {
|
|
52
53
|
const api = useCarouselContext();
|
|
53
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ jsx(Fragment, { children: api.isPlaying ? paused : play });
|
|
54
55
|
};
|
|
55
56
|
const CarouselProgressText = forwardRef(function CarouselProgressText2(props, ref) {
|
|
56
57
|
const api = useCarouselContext();
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ jsxs(Box, { ref, ...props, children: [
|
|
59
|
+
api.page + 1,
|
|
60
|
+
" / ",
|
|
61
|
+
api.pageSnapPoints.length
|
|
62
|
+
] });
|
|
58
63
|
});
|
|
59
64
|
const CarouselAutoplayTrigger = withContext(Carousel.AutoplayTrigger, "autoplayTrigger", { forwardAsChild: true });
|
|
60
65
|
const CarouselIndicatorGroup = withContext(Carousel.IndicatorGroup, "indicatorGroup", { forwardAsChild: true });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Checkbox, useCheckboxContext } from '@ark-ui/react/checkbox';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
@@ -28,30 +29,30 @@ const CheckboxIndicator = forwardRef(function CheckboxIndicator2(props, ref) {
|
|
|
28
29
|
const api = useCheckboxContext();
|
|
29
30
|
const styles = useCheckboxStyles();
|
|
30
31
|
if (checked && api.checked) {
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
32
33
|
mainbase.svg,
|
|
33
34
|
{
|
|
34
35
|
ref,
|
|
35
36
|
asChild: true,
|
|
36
37
|
...rest,
|
|
37
|
-
css: [styles.indicator, props.css]
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
css: [styles.indicator, props.css],
|
|
39
|
+
children: checked
|
|
40
|
+
}
|
|
40
41
|
);
|
|
41
42
|
}
|
|
42
43
|
if (indeterminate && api.indeterminate) {
|
|
43
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ jsx(
|
|
44
45
|
mainbase.svg,
|
|
45
46
|
{
|
|
46
47
|
ref,
|
|
47
48
|
asChild: true,
|
|
48
49
|
...rest,
|
|
49
|
-
css: [styles.indicator, props.css]
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
css: [styles.indicator, props.css],
|
|
51
|
+
children: indeterminate
|
|
52
|
+
}
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
55
56
|
Checkmark,
|
|
56
57
|
{
|
|
57
58
|
ref,
|
|
@@ -69,7 +70,7 @@ const CheckboxControl = withContext(
|
|
|
69
70
|
"control",
|
|
70
71
|
{
|
|
71
72
|
forwardAsChild: true,
|
|
72
|
-
defaultProps: { children: /* @__PURE__ */
|
|
73
|
+
defaultProps: { children: /* @__PURE__ */ jsx(CheckboxIndicator, {}) }
|
|
73
74
|
}
|
|
74
75
|
);
|
|
75
76
|
const CheckboxGroup = mainbase(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Checkbox, useCheckboxContext } from '@ark-ui/react/checkbox';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
@@ -18,7 +19,7 @@ const CheckboxCardLabel = withContext(Checkbox.Label, "label", { forwardAsChild:
|
|
|
18
19
|
const CheckboxCardDescription = forwardRef(function CheckboxCardDescription2(props, ref) {
|
|
19
20
|
const styles = useCheckboxCardStyles();
|
|
20
21
|
const api = useCheckboxContext();
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
22
23
|
mainbase.div,
|
|
23
24
|
{
|
|
24
25
|
ref,
|
|
@@ -36,7 +37,7 @@ const CheckboxCardContent = withContext("div", "content");
|
|
|
36
37
|
const CheckboxCardIndicator = forwardRef(function CheckboxCardIndicator2(props, ref) {
|
|
37
38
|
const api = useCheckboxContext();
|
|
38
39
|
const styles = useCheckboxCardStyles();
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
40
41
|
Checkmark,
|
|
41
42
|
{
|
|
42
43
|
ref,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import { EMPTY_STYLES } from '../../styled-system/empty.js';
|
|
4
5
|
import { mainbase } from '../../styled-system/factory.js';
|
|
5
6
|
import { useRecipe } from '../../styled-system/use-recipe.js';
|
|
6
7
|
import { dataAttr } from '../../utils/attr.js';
|
|
7
|
-
import '../../utils/unit.js';
|
|
8
8
|
|
|
9
9
|
const Checkmark = forwardRef(
|
|
10
10
|
function Checkmark2(props, ref) {
|
|
@@ -20,7 +20,7 @@ const Checkmark = forwardRef(
|
|
|
20
20
|
...rest
|
|
21
21
|
} = restProps;
|
|
22
22
|
const styles = unstyled ? EMPTY_STYLES : recipe(variantProps);
|
|
23
|
-
return /* @__PURE__ */
|
|
23
|
+
return /* @__PURE__ */ jsx(
|
|
24
24
|
mainbase.svg,
|
|
25
25
|
{
|
|
26
26
|
ref,
|
|
@@ -33,9 +33,9 @@ const Checkmark = forwardRef(
|
|
|
33
33
|
"data-state": indeterminate ? "indeterminate" : checked ? "checked" : "unchecked",
|
|
34
34
|
"data-disabled": dataAttr(disabled),
|
|
35
35
|
css: [styles, css],
|
|
36
|
-
...rest
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
...rest,
|
|
37
|
+
children: indeterminate ? /* @__PURE__ */ jsx("path", { d: "M5 12h14" }) : checked ? /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" }) : null
|
|
38
|
+
}
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
);
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef } from 'react';
|
|
3
4
|
import { Square } from '../square/index.js';
|
|
4
5
|
|
|
5
6
|
const Circle = forwardRef(
|
|
6
7
|
function Circle2(props, ref) {
|
|
7
8
|
const { size, ...rest } = props;
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsx(Square, { size, ref, borderRadius: "9999px", ...rest });
|
|
9
10
|
}
|
|
10
11
|
);
|
|
11
12
|
Circle.displayName = "Circle";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { useState, useEffect } from 'react';
|
|
3
4
|
import { Show } from '../show/show.js';
|
|
4
5
|
|
|
@@ -8,7 +9,7 @@ const ClientOnly = (props) => {
|
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
setHasMounted(true);
|
|
10
11
|
}, []);
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ jsx(Show, { when: hasMounted, fallback, children });
|
|
12
13
|
};
|
|
13
14
|
|
|
14
15
|
export { ClientOnly };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Clipboard } from '@ark-ui/react/clipboard';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
@@ -22,8 +23,8 @@ const ClipboardControl = withContext(Clipboard.Control, "control", { forwardAsCh
|
|
|
22
23
|
const ClipboardIndicator = withContext(Clipboard.Indicator, "indicator", {
|
|
23
24
|
forwardAsChild: true,
|
|
24
25
|
defaultProps: {
|
|
25
|
-
copied: /* @__PURE__ */
|
|
26
|
-
children: /* @__PURE__ */
|
|
26
|
+
copied: /* @__PURE__ */ jsx(CheckIcon, { boxSize: "1em" }),
|
|
27
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { boxSize: "1em" })
|
|
27
28
|
}
|
|
28
29
|
});
|
|
29
30
|
const ClipboardInput = withContext(Clipboard.Input, "input", { forwardAsChild: true });
|
|
@@ -31,7 +32,7 @@ const ClipboardLabel = withContext(Clipboard.Label, "label", { forwardAsChild: t
|
|
|
31
32
|
const ClipboardContext = Clipboard.Context;
|
|
32
33
|
const ClipboardValueText = withContext(Clipboard.ValueText, "valueText", { forwardAsChild: true });
|
|
33
34
|
const ClipboardCopyText = forwardRef(function ClipboardCopyText2(props, ref) {
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ jsx(ClipboardIndicator, { copied: "Copied", ...props, ref, children: "Copy" });
|
|
35
36
|
});
|
|
36
37
|
|
|
37
38
|
export { ClipboardContext, ClipboardControl, ClipboardCopyText, ClipboardIndicator, ClipboardInput, ClipboardLabel, ClipboardPropsProvider, ClipboardRoot, ClipboardRootProvider, ClipboardTrigger, ClipboardValueText, useClipboardStyles };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { CodeBlockAdapterContextProvider } from './code-block-adapter-context.js';
|
|
3
4
|
import { useCodeHighlight } from './use-code-highlight.js';
|
|
4
5
|
|
|
5
6
|
function CodeBlockAdapterProvider(props) {
|
|
6
7
|
const { children, value } = props;
|
|
7
8
|
const context = useCodeHighlight(value);
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsx(CodeBlockAdapterContextProvider, { value: context, children });
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export { CodeBlockAdapterProvider };
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { useClipboard } from '@ark-ui/react/clipboard';
|
|
3
4
|
import { ark } from '@ark-ui/react/factory';
|
|
4
5
|
import { forwardRef, useMemo, useId } from 'react';
|
|
5
|
-
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
6
6
|
import { useControllableState } from '../../hooks/use-controllable-state.js';
|
|
7
|
-
import '
|
|
8
|
-
import '
|
|
7
|
+
import { mergeProps } from '../../merge-props.js';
|
|
8
|
+
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
9
9
|
import { dataAttr } from '../../utils/attr.js';
|
|
10
10
|
import { cx } from '../../utils/cx.js';
|
|
11
|
-
import '../../utils/unit.js';
|
|
12
|
-
import { mergeProps } from '../../merge-props.js';
|
|
13
11
|
import { CopyIcon, CheckIcon, ChevronUpIcon, ChevronDownIcon } from '../icons.js';
|
|
14
12
|
import { useCodeBlockAdapterContext } from './code-block-adapter-context.js';
|
|
15
13
|
import { CodeBlockContextProvider, useCodeBlockContext } from './code-block-context.js';
|
|
@@ -74,7 +72,7 @@ const RootBase = forwardRef(
|
|
|
74
72
|
}),
|
|
75
73
|
[code, language, clipboard, collapsible, meta]
|
|
76
74
|
);
|
|
77
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ jsx(CodeBlockContextProvider, { value: context, children: /* @__PURE__ */ jsx(
|
|
78
76
|
ark.div,
|
|
79
77
|
{
|
|
80
78
|
ref,
|
|
@@ -88,10 +86,10 @@ const RootBase = forwardRef(
|
|
|
88
86
|
style: {
|
|
89
87
|
...rest.style,
|
|
90
88
|
["--code-block-line-length"]: `${String(codeLines).length}ch`
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
));
|
|
89
|
+
},
|
|
90
|
+
children
|
|
91
|
+
}
|
|
92
|
+
) });
|
|
95
93
|
}
|
|
96
94
|
);
|
|
97
95
|
const CodeBlockRoot = withProvider(
|
|
@@ -104,16 +102,16 @@ const ContentBase = forwardRef(
|
|
|
104
102
|
function ContentBase2(props, ref) {
|
|
105
103
|
const { children, ...restProps } = props;
|
|
106
104
|
const { collapsible } = useCodeBlockContext();
|
|
107
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
108
106
|
ark.div,
|
|
109
107
|
{
|
|
110
108
|
ref,
|
|
111
109
|
id: collapsible.contentId,
|
|
112
110
|
"data-expanded": dataAttr(!collapsible.collapsed),
|
|
113
111
|
"aria-expanded": !collapsible.collapsed,
|
|
114
|
-
...restProps
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
...restProps,
|
|
113
|
+
children
|
|
114
|
+
}
|
|
117
115
|
);
|
|
118
116
|
}
|
|
119
117
|
);
|
|
@@ -138,7 +136,7 @@ const CodeText = forwardRef(
|
|
|
138
136
|
const { highlight } = useCodeBlockAdapterContext();
|
|
139
137
|
const highlighted = highlight?.({ code, language, meta });
|
|
140
138
|
const codeContentProps = highlighted?.highlighted ? { dangerouslySetInnerHTML: { __html: highlighted.code } } : { children: code };
|
|
141
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ jsx(
|
|
142
140
|
ark.code,
|
|
143
141
|
{
|
|
144
142
|
"data-plaintext": dataAttr(!highlighted?.highlighted),
|
|
@@ -160,13 +158,13 @@ const BaseCopyTrigger = forwardRef(
|
|
|
160
158
|
function BaseCopyTrigger2(props, ref) {
|
|
161
159
|
const { children, ...restProps } = props;
|
|
162
160
|
const { clipboard } = useCodeBlockContext();
|
|
163
|
-
return /* @__PURE__ */
|
|
161
|
+
return /* @__PURE__ */ jsx(
|
|
164
162
|
ark.button,
|
|
165
163
|
{
|
|
166
164
|
ref,
|
|
167
|
-
...mergeProps(clipboard.getTriggerProps(), restProps)
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
...mergeProps(clipboard.getTriggerProps(), restProps),
|
|
166
|
+
children
|
|
167
|
+
}
|
|
170
168
|
);
|
|
171
169
|
}
|
|
172
170
|
);
|
|
@@ -175,20 +173,20 @@ const BaseCopyIndicator = forwardRef(
|
|
|
175
173
|
function BaseCopyIndicator2(props, ref) {
|
|
176
174
|
const { children, copied, ...restProps } = props;
|
|
177
175
|
const { clipboard } = useCodeBlockContext();
|
|
178
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ jsx(ark.span, { ref, ...restProps, children: clipboard.copied ? copied : children });
|
|
179
177
|
}
|
|
180
178
|
);
|
|
181
179
|
const CodeBlockCopyIndicator = withContext(BaseCopyIndicator, "copyIndicator", {
|
|
182
180
|
forwardAsChild: true,
|
|
183
181
|
defaultProps: {
|
|
184
|
-
copied: /* @__PURE__ */
|
|
185
|
-
children: /* @__PURE__ */
|
|
182
|
+
copied: /* @__PURE__ */ jsx(CheckIcon, { boxSize: "1em" }),
|
|
183
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { boxSize: "1em" })
|
|
186
184
|
}
|
|
187
185
|
});
|
|
188
186
|
const BaseCollapseTrigger = forwardRef(function BaseCollapseTrigger2(props, ref) {
|
|
189
187
|
const { children, ...restProps } = props;
|
|
190
188
|
const { collapsible } = useCodeBlockContext();
|
|
191
|
-
return /* @__PURE__ */
|
|
189
|
+
return /* @__PURE__ */ jsx(
|
|
192
190
|
ark.button,
|
|
193
191
|
{
|
|
194
192
|
type: "button",
|
|
@@ -200,33 +198,33 @@ const BaseCollapseTrigger = forwardRef(function BaseCollapseTrigger2(props, ref)
|
|
|
200
198
|
onClick: (e) => {
|
|
201
199
|
restProps.onClick?.(e);
|
|
202
200
|
collapsible.toggleCollapsed();
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
201
|
+
},
|
|
202
|
+
children
|
|
203
|
+
}
|
|
206
204
|
);
|
|
207
205
|
});
|
|
208
206
|
const CodeBlockCollapseTrigger = withContext(BaseCollapseTrigger, "collapseTrigger", { forwardAsChild: true });
|
|
209
207
|
const BaseCollapseIndicator = forwardRef(function BaseCollapseIndicator2(props, ref) {
|
|
210
208
|
const { children, collapsed, ...restProps } = props;
|
|
211
209
|
const { collapsible } = useCodeBlockContext();
|
|
212
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ jsx(ark.span, { ref, ...restProps, children: collapsible.collapsed ? collapsed : children });
|
|
213
211
|
});
|
|
214
212
|
const CodeBlockCollapseIndicator = withContext(BaseCollapseIndicator, "collapseIndicator", {
|
|
215
213
|
forwardAsChild: true,
|
|
216
214
|
defaultProps: {
|
|
217
|
-
collapsed: /* @__PURE__ */
|
|
218
|
-
children: /* @__PURE__ */
|
|
215
|
+
collapsed: /* @__PURE__ */ jsx(ChevronDownIcon, { boxSize: "1em" }),
|
|
216
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { boxSize: "1em" })
|
|
219
217
|
}
|
|
220
218
|
});
|
|
221
219
|
const CodeBlockCollapseText = forwardRef(function CodeBlockCollapseText2(props, ref) {
|
|
222
|
-
return /* @__PURE__ */
|
|
220
|
+
return /* @__PURE__ */ jsx(CodeBlockCollapseIndicator, { ref, ...props, collapsed: "Expand code", children: props.children || "Collapse code" });
|
|
223
221
|
});
|
|
224
222
|
const CodeBlockFooter = withContext("footer", "footer");
|
|
225
223
|
const CodeBlockControl = withContext("div", "control");
|
|
226
224
|
const BaseOverlay = forwardRef(
|
|
227
225
|
function BaseOverlay2(props, ref) {
|
|
228
226
|
const { collapsible } = useCodeBlockContext();
|
|
229
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ jsx(
|
|
230
228
|
ark.div,
|
|
231
229
|
{
|
|
232
230
|
ref,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
3
|
import { ColorPicker, useColorPickerContext } from '@ark-ui/react/color-picker';
|
|
3
4
|
import { forwardRef } from 'react';
|
|
4
5
|
import { mergeProps } from '../../merge-props.js';
|
|
@@ -28,7 +29,7 @@ const ColorPickerValueSwatch = withContext(ColorPicker.ValueSwatch, "swatch", {
|
|
|
28
29
|
const ColorPickerTrigger = withContext(ColorPicker.Trigger, "trigger", {
|
|
29
30
|
forwardAsChild: true,
|
|
30
31
|
defaultProps: {
|
|
31
|
-
children: /* @__PURE__ */
|
|
32
|
+
children: /* @__PURE__ */ jsx(ColorPickerValueSwatch, {})
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
35
|
const ColorPickerPositioner = withContext(ColorPicker.Positioner, "positioner", { forwardAsChild: true });
|
|
@@ -38,7 +39,10 @@ const ColorPickerAreaThumb = withContext(ColorPicker.AreaThumb, "areaThumb", { f
|
|
|
38
39
|
const ColorPickerArea = withContext(ColorPicker.Area, "area", {
|
|
39
40
|
forwardAsChild: true,
|
|
40
41
|
defaultProps: {
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
43
|
+
/* @__PURE__ */ jsx(ColorPickerAreaBackground, {}),
|
|
44
|
+
/* @__PURE__ */ jsx(ColorPickerAreaThumb, {})
|
|
45
|
+
] })
|
|
42
46
|
}
|
|
43
47
|
});
|
|
44
48
|
const ColorPickerChannelSliderTrack = withContext(ColorPicker.ChannelSliderTrack, "channelSliderTrack", {
|
|
@@ -51,17 +55,24 @@ const ColorPickerTransparencyGrid = withContext(ColorPicker.TransparencyGrid, "t
|
|
|
51
55
|
const ColorPickerChannelSlider = withContext(ColorPicker.ChannelSlider, "channelSlider", {
|
|
52
56
|
forwardAsChild: true,
|
|
53
57
|
defaultProps: {
|
|
54
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
59
|
+
/* @__PURE__ */ jsx(ColorPickerTransparencyGrid, { size: "0.6rem" }),
|
|
60
|
+
/* @__PURE__ */ jsx(ColorPickerChannelSliderTrack, {}),
|
|
61
|
+
/* @__PURE__ */ jsx(ColorPickerChannelSliderThumb, {})
|
|
62
|
+
] })
|
|
55
63
|
}
|
|
56
64
|
});
|
|
57
65
|
const ColorPickerSliders = forwardRef(
|
|
58
66
|
function ColorPickerSliders2(props, ref) {
|
|
59
|
-
return /* @__PURE__ */
|
|
67
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "1", flex: "1", px: "1", ref, ...props, children: [
|
|
68
|
+
/* @__PURE__ */ jsx(ColorPickerChannelSlider, { channel: "hue" }),
|
|
69
|
+
/* @__PURE__ */ jsx(ColorPickerChannelSlider, { channel: "alpha" })
|
|
70
|
+
] });
|
|
60
71
|
}
|
|
61
72
|
);
|
|
62
73
|
const ColorPickerChannelInput = withContext(ColorPicker.ChannelInput, "channelInput", { forwardAsChild: true });
|
|
63
74
|
const ColorPickerInput = forwardRef(function ColorHexInput(props, ref) {
|
|
64
|
-
return /* @__PURE__ */
|
|
75
|
+
return /* @__PURE__ */ jsx(ColorPickerChannelInput, { channel: "hex", ref, ...props });
|
|
65
76
|
});
|
|
66
77
|
const ColorPickerSwatchGroup = withContext(ColorPicker.SwatchGroup, "swatchGroup", { forwardAsChild: true });
|
|
67
78
|
const ColorPickerSwatchTrigger = withContext(ColorPicker.SwatchTrigger, "swatchTrigger", { forwardAsChild: true });
|
|
@@ -75,10 +86,10 @@ const ColorPickerEyeDropperTrigger = withContext(ColorPicker.EyeDropperTrigger,
|
|
|
75
86
|
forwardAsChild: true
|
|
76
87
|
});
|
|
77
88
|
const ColorPickerEyeDropper = forwardRef(function ColorPickerEyeDropper2(props, ref) {
|
|
78
|
-
const { children = /* @__PURE__ */
|
|
89
|
+
const { children = /* @__PURE__ */ jsx(PipetteIcon, {}), ...rest } = props;
|
|
79
90
|
const picker = useColorPickerContext();
|
|
80
91
|
const localProps = mergeProps(picker.getEyeDropperTriggerProps(), rest);
|
|
81
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ jsx(IconButton, { ref, ...localProps, children });
|
|
82
93
|
});
|
|
83
94
|
const ColorPickerChannelSliderValueText = withContext(ColorPicker.ChannelSliderValueText, "channelSliderValueText", {
|
|
84
95
|
forwardAsChild: true
|
|
@@ -87,7 +98,7 @@ const ColorPickerChannelSliderLabel = withContext(ColorPicker.ChannelSliderLabel
|
|
|
87
98
|
forwardAsChild: true
|
|
88
99
|
});
|
|
89
100
|
const ColorPickerHiddenInput = forwardRef(function ColorPickerHiddenInput2(props, ref) {
|
|
90
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ jsx(ColorPicker.HiddenInput, { tabIndex: -1, ref, ...props });
|
|
91
102
|
});
|
|
92
103
|
const ColorPickerContext = ColorPicker.Context;
|
|
93
104
|
const ColorPickerChannelText = withContext("span", "channelText", {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { forwardRef } 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
|
import { Grid } from '../grid/grid.js';
|
|
8
8
|
import '../grid/grid-item.js';
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@ const ColorSwatch = forwardRef(
|
|
|
14
14
|
function ColorSwatch2(props, ref) {
|
|
15
15
|
const { value, ...restProps } = props;
|
|
16
16
|
const { styles, className, props: localProps } = useRecipeResult(restProps);
|
|
17
|
-
return /* @__PURE__ */
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
18
|
mainbase.span,
|
|
19
19
|
{
|
|
20
20
|
...localProps,
|
|
@@ -33,21 +33,21 @@ const ColorSwatchMix = (props) => {
|
|
|
33
33
|
throw new Error("ColorSwatchMix doesn't support more than 4 colors");
|
|
34
34
|
}
|
|
35
35
|
const isThreeColors = items.length === 3;
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ jsx(ColorSwatch, { overflow: "hidden", ...restProps, value: "transparent", children: /* @__PURE__ */ jsx(Grid, { templateColumns: "var(--swatch-size) var(--swatch-size)", children: items.map((item, index) => {
|
|
37
37
|
const isLast = index === items.length - 1;
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
39
|
ColorSwatch,
|
|
40
40
|
{
|
|
41
41
|
size: "inherit",
|
|
42
|
-
key: item,
|
|
43
42
|
rounded: "none",
|
|
44
43
|
value: item,
|
|
45
44
|
boxShadow: "none",
|
|
46
45
|
gridColumn: isThreeColors && isLast ? "span 2 / span 2" : void 0,
|
|
47
46
|
width: isThreeColors && isLast ? "unset" : void 0
|
|
48
|
-
}
|
|
47
|
+
},
|
|
48
|
+
item
|
|
49
49
|
);
|
|
50
|
-
})));
|
|
50
|
+
}) }) });
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
export { ColorSwatch, ColorSwatchMix, ColorSwatchPropsProvider };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { Combobox } from '@ark-ui/react/combobox';
|
|
3
4
|
import { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';
|
|
4
5
|
import { ChevronDownIcon, CloseIcon, CheckIcon } from '../icons.js';
|
|
@@ -22,7 +23,7 @@ const ComboboxTrigger = withContext(Combobox.Trigger, "trigger", {
|
|
|
22
23
|
forwardAsChild: true,
|
|
23
24
|
forwardProps: ["focusable"],
|
|
24
25
|
defaultProps: {
|
|
25
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
29
|
const ComboboxPositioner = withContext(Combobox.Positioner, "positioner", { forwardAsChild: true });
|
|
@@ -40,7 +41,7 @@ const ComboboxInput = withContext(
|
|
|
40
41
|
const ComboboxClearTrigger = withContext(Combobox.ClearTrigger, "clearTrigger", {
|
|
41
42
|
forwardAsChild: true,
|
|
42
43
|
defaultProps: {
|
|
43
|
-
children: /* @__PURE__ */
|
|
44
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
44
45
|
}
|
|
45
46
|
});
|
|
46
47
|
const ComboboxIndicatorGroup = withContext("div", "indicatorGroup");
|
|
@@ -55,7 +56,7 @@ const ComboboxItemText = withContext(Combobox.ItemText, "itemText", { forwardAsC
|
|
|
55
56
|
const ComboboxItemIndicator = withContext(Combobox.ItemIndicator, "itemIndicator", {
|
|
56
57
|
forwardAsChild: true,
|
|
57
58
|
defaultProps: {
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
59
60
|
}
|
|
60
61
|
});
|
|
61
62
|
const ComboboxControl = withContext(Combobox.Control, "control", { forwardAsChild: true });
|