@yamada-ui/checkbox 1.1.8-dev-20240915031944 → 1.1.8-dev-20240917033401

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.
@@ -0,0 +1,13 @@
1
+ import * as react from 'react';
2
+ import { ChangeEvent } from 'react';
3
+ import { ThemeProps } from '@yamada-ui/core';
4
+ import { FormControlOptions } from '@yamada-ui/form-control';
5
+
6
+ interface CheckboxGroupContext extends ThemeProps<"Checkbox">, FormControlOptions {
7
+ value: (string | number)[];
8
+ onChange: (evOrValue: ChangeEvent<HTMLInputElement> | string | number) => void;
9
+ }
10
+ declare const CheckboxGroupProvider: react.Provider<CheckboxGroupContext | undefined>;
11
+ declare const useCheckboxGroupContext: () => CheckboxGroupContext | undefined;
12
+
13
+ export { type CheckboxGroupContext, CheckboxGroupProvider, useCheckboxGroupContext };
@@ -0,0 +1,13 @@
1
+ import * as react from 'react';
2
+ import { ChangeEvent } from 'react';
3
+ import { ThemeProps } from '@yamada-ui/core';
4
+ import { FormControlOptions } from '@yamada-ui/form-control';
5
+
6
+ interface CheckboxGroupContext extends ThemeProps<"Checkbox">, FormControlOptions {
7
+ value: (string | number)[];
8
+ onChange: (evOrValue: ChangeEvent<HTMLInputElement> | string | number) => void;
9
+ }
10
+ declare const CheckboxGroupProvider: react.Provider<CheckboxGroupContext | undefined>;
11
+ declare const useCheckboxGroupContext: () => CheckboxGroupContext | undefined;
12
+
13
+ export { type CheckboxGroupContext, CheckboxGroupProvider, useCheckboxGroupContext };
@@ -0,0 +1,38 @@
1
+ "use client"
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/checkbox-context.tsx
22
+ var checkbox_context_exports = {};
23
+ __export(checkbox_context_exports, {
24
+ CheckboxGroupProvider: () => CheckboxGroupProvider,
25
+ useCheckboxGroupContext: () => useCheckboxGroupContext
26
+ });
27
+ module.exports = __toCommonJS(checkbox_context_exports);
28
+ var import_utils = require("@yamada-ui/utils");
29
+ var [CheckboxGroupProvider, useCheckboxGroupContext] = (0, import_utils.createContext)({
30
+ strict: false,
31
+ name: "CheckboxGroupContext"
32
+ });
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ CheckboxGroupProvider,
36
+ useCheckboxGroupContext
37
+ });
38
+ //# sourceMappingURL=checkbox-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/checkbox-context.tsx"],"sourcesContent":["import type { ThemeProps } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport { createContext } from \"@yamada-ui/utils\"\nimport type { ChangeEvent } from \"react\"\n\nexport interface CheckboxGroupContext\n extends ThemeProps<\"Checkbox\">,\n FormControlOptions {\n value: (string | number)[]\n onChange: (evOrValue: ChangeEvent<HTMLInputElement> | string | number) => void\n}\n\nexport const [CheckboxGroupProvider, useCheckboxGroupContext] = createContext<\n CheckboxGroupContext | undefined\n>({\n strict: false,\n name: \"CheckboxGroupContext\",\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAA8B;AAUvB,IAAM,CAAC,uBAAuB,uBAAuB,QAAI,4BAE9D;AAAA,EACA,QAAQ;AAAA,EACR,MAAM;AACR,CAAC;","names":[]}
@@ -0,0 +1,10 @@
1
+ "use client"
2
+ import {
3
+ CheckboxGroupProvider,
4
+ useCheckboxGroupContext
5
+ } from "./chunk-IZINMNYX.mjs";
6
+ export {
7
+ CheckboxGroupProvider,
8
+ useCheckboxGroupContext
9
+ };
10
+ //# sourceMappingURL=checkbox-context.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,16 +1,16 @@
1
1
  import { CheckboxProps } from './checkbox.mjs';
2
2
  import * as react from 'react';
3
- import { ChangeEvent, Ref } from 'react';
4
- import { UIPropGetter, ThemeProps, ComponentArgs } from '@yamada-ui/core';
3
+ import { ChangeEvent, RefAttributes } from 'react';
4
+ import { PropGetter, ThemeProps, ComponentArgs } from '@yamada-ui/core';
5
5
  import { FormControlOptions } from '@yamada-ui/form-control';
6
6
  import { FlexProps } from '@yamada-ui/layouts';
7
- import { Dict, PropGetter } from '@yamada-ui/utils';
7
+ import { Dict } from '@yamada-ui/utils';
8
8
  import '@yamada-ui/motion';
9
9
 
10
- type CheckboxItem<Y extends string | number = string> = CheckboxProps<Y> & {
10
+ interface CheckboxItem<Y extends string | number = string> extends CheckboxProps<Y> {
11
11
  label?: string;
12
- };
13
- type UseCheckboxGroupProps<Y extends string | number = string> = {
12
+ }
13
+ interface UseCheckboxGroupProps<Y extends string | number = string> {
14
14
  /**
15
15
  * The value of the checkbox group.
16
16
  */
@@ -31,39 +31,32 @@ type UseCheckboxGroupProps<Y extends string | number = string> = {
31
31
  * @default false
32
32
  */
33
33
  isNative?: boolean;
34
- };
35
- declare const useCheckboxGroup: <Y extends string | number = string, M extends Dict = Dict>({ value: valueProp, defaultValue, onChange: onChangeProp, isNative, ...props }: UseCheckboxGroupProps<Y> & M) => {
34
+ }
35
+ declare const useCheckboxGroup: <Y extends string | number, M extends Dict = Dict<any>>({ value: valueProp, defaultValue, onChange: onChangeProp, isNative, ...props }: UseCheckboxGroupProps<Y> & M) => {
36
36
  props: Omit<UseCheckboxGroupProps<Y> & M, "defaultValue" | "onChange" | "value" | "isNative">;
37
37
  value: Y[];
38
38
  setValue: react.Dispatch<react.SetStateAction<Y[]>>;
39
39
  onChange: (evOrValue: ChangeEvent<HTMLInputElement> | Y) => void;
40
- getContainerProps: PropGetter;
41
- getCheckboxProps: UIPropGetter<"input", {
40
+ getContainerProps: PropGetter<"div", undefined>;
41
+ getCheckboxProps: PropGetter<{
42
42
  value?: Y;
43
43
  }, {
44
44
  value?: Y;
45
+ checked?: boolean;
45
46
  isChecked?: boolean;
46
47
  }>;
47
48
  };
48
49
  type UseCheckboxGroupReturn<Y extends string | number = string> = ReturnType<typeof useCheckboxGroup<Y>>;
49
- type CheckboxGroupProps<Y extends string | number = string> = ThemeProps<"Checkbox"> & Omit<FlexProps, "onChange"> & UseCheckboxGroupProps<Y> & FormControlOptions & {
50
+ interface CheckboxGroupProps<Y extends string | number = string> extends ThemeProps<"Checkbox">, Omit<FlexProps, "defaultValue" | "onChange">, UseCheckboxGroupProps<Y>, FormControlOptions {
50
51
  /**
51
52
  * If provided, generate checkboxes based on items.
52
53
  *
53
54
  * @default '[]'
54
55
  */
55
56
  items?: CheckboxItem<Y>[];
56
- };
57
- type CheckboxContext = ThemeProps<"Checkbox"> & FormControlOptions & {
58
- value: (string | number)[];
59
- onChange: (evOrValue: ChangeEvent<HTMLInputElement> | string | number) => void;
60
- };
61
- declare const useCheckboxGroupContext: () => CheckboxContext | undefined;
62
-
57
+ }
63
58
  declare const CheckboxGroup: {
64
- <Y extends string | number = string>(props: CheckboxGroupProps<Y> & {
65
- ref?: Ref<HTMLDivElement>;
66
- }): JSX.Element;
59
+ <Y extends string | number = string>(props: CheckboxGroupProps<Y> & RefAttributes<HTMLDivElement>): JSX.Element;
67
60
  } & ComponentArgs;
68
61
 
69
- export { CheckboxGroup, type CheckboxGroupProps, type CheckboxItem, type UseCheckboxGroupProps, type UseCheckboxGroupReturn, useCheckboxGroup, useCheckboxGroupContext };
62
+ export { CheckboxGroup, type CheckboxGroupProps, type CheckboxItem, type UseCheckboxGroupProps, type UseCheckboxGroupReturn, useCheckboxGroup };
@@ -1,16 +1,16 @@
1
1
  import { CheckboxProps } from './checkbox.js';
2
2
  import * as react from 'react';
3
- import { ChangeEvent, Ref } from 'react';
4
- import { UIPropGetter, ThemeProps, ComponentArgs } from '@yamada-ui/core';
3
+ import { ChangeEvent, RefAttributes } from 'react';
4
+ import { PropGetter, ThemeProps, ComponentArgs } from '@yamada-ui/core';
5
5
  import { FormControlOptions } from '@yamada-ui/form-control';
6
6
  import { FlexProps } from '@yamada-ui/layouts';
7
- import { Dict, PropGetter } from '@yamada-ui/utils';
7
+ import { Dict } from '@yamada-ui/utils';
8
8
  import '@yamada-ui/motion';
9
9
 
10
- type CheckboxItem<Y extends string | number = string> = CheckboxProps<Y> & {
10
+ interface CheckboxItem<Y extends string | number = string> extends CheckboxProps<Y> {
11
11
  label?: string;
12
- };
13
- type UseCheckboxGroupProps<Y extends string | number = string> = {
12
+ }
13
+ interface UseCheckboxGroupProps<Y extends string | number = string> {
14
14
  /**
15
15
  * The value of the checkbox group.
16
16
  */
@@ -31,39 +31,32 @@ type UseCheckboxGroupProps<Y extends string | number = string> = {
31
31
  * @default false
32
32
  */
33
33
  isNative?: boolean;
34
- };
35
- declare const useCheckboxGroup: <Y extends string | number = string, M extends Dict = Dict>({ value: valueProp, defaultValue, onChange: onChangeProp, isNative, ...props }: UseCheckboxGroupProps<Y> & M) => {
34
+ }
35
+ declare const useCheckboxGroup: <Y extends string | number, M extends Dict = Dict<any>>({ value: valueProp, defaultValue, onChange: onChangeProp, isNative, ...props }: UseCheckboxGroupProps<Y> & M) => {
36
36
  props: Omit<UseCheckboxGroupProps<Y> & M, "defaultValue" | "onChange" | "value" | "isNative">;
37
37
  value: Y[];
38
38
  setValue: react.Dispatch<react.SetStateAction<Y[]>>;
39
39
  onChange: (evOrValue: ChangeEvent<HTMLInputElement> | Y) => void;
40
- getContainerProps: PropGetter;
41
- getCheckboxProps: UIPropGetter<"input", {
40
+ getContainerProps: PropGetter<"div", undefined>;
41
+ getCheckboxProps: PropGetter<{
42
42
  value?: Y;
43
43
  }, {
44
44
  value?: Y;
45
+ checked?: boolean;
45
46
  isChecked?: boolean;
46
47
  }>;
47
48
  };
48
49
  type UseCheckboxGroupReturn<Y extends string | number = string> = ReturnType<typeof useCheckboxGroup<Y>>;
49
- type CheckboxGroupProps<Y extends string | number = string> = ThemeProps<"Checkbox"> & Omit<FlexProps, "onChange"> & UseCheckboxGroupProps<Y> & FormControlOptions & {
50
+ interface CheckboxGroupProps<Y extends string | number = string> extends ThemeProps<"Checkbox">, Omit<FlexProps, "defaultValue" | "onChange">, UseCheckboxGroupProps<Y>, FormControlOptions {
50
51
  /**
51
52
  * If provided, generate checkboxes based on items.
52
53
  *
53
54
  * @default '[]'
54
55
  */
55
56
  items?: CheckboxItem<Y>[];
56
- };
57
- type CheckboxContext = ThemeProps<"Checkbox"> & FormControlOptions & {
58
- value: (string | number)[];
59
- onChange: (evOrValue: ChangeEvent<HTMLInputElement> | string | number) => void;
60
- };
61
- declare const useCheckboxGroupContext: () => CheckboxContext | undefined;
62
-
57
+ }
63
58
  declare const CheckboxGroup: {
64
- <Y extends string | number = string>(props: CheckboxGroupProps<Y> & {
65
- ref?: Ref<HTMLDivElement>;
66
- }): JSX.Element;
59
+ <Y extends string | number = string>(props: CheckboxGroupProps<Y> & RefAttributes<HTMLDivElement>): JSX.Element;
67
60
  } & ComponentArgs;
68
61
 
69
- export { CheckboxGroup, type CheckboxGroupProps, type CheckboxItem, type UseCheckboxGroupProps, type UseCheckboxGroupReturn, useCheckboxGroup, useCheckboxGroupContext };
62
+ export { CheckboxGroup, type CheckboxGroupProps, type CheckboxItem, type UseCheckboxGroupProps, type UseCheckboxGroupReturn, useCheckboxGroup };
@@ -22,14 +22,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  var checkbox_group_exports = {};
23
23
  __export(checkbox_group_exports, {
24
24
  CheckboxGroup: () => CheckboxGroup,
25
- useCheckboxGroup: () => useCheckboxGroup,
26
- useCheckboxGroupContext: () => useCheckboxGroupContext
25
+ useCheckboxGroup: () => useCheckboxGroup
27
26
  });
28
27
  module.exports = __toCommonJS(checkbox_group_exports);
29
28
  var import_form_control2 = require("@yamada-ui/form-control");
30
29
  var import_layouts = require("@yamada-ui/layouts");
31
30
  var import_use_controllable_state = require("@yamada-ui/use-controllable-state");
32
- var import_utils2 = require("@yamada-ui/utils");
31
+ var import_utils3 = require("@yamada-ui/utils");
33
32
  var import_react2 = require("react");
34
33
 
35
34
  // src/checkbox.tsx
@@ -37,8 +36,17 @@ var import_core = require("@yamada-ui/core");
37
36
  var import_form_control = require("@yamada-ui/form-control");
38
37
  var import_motion = require("@yamada-ui/motion");
39
38
  var import_use_focus_visible = require("@yamada-ui/use-focus-visible");
40
- var import_utils = require("@yamada-ui/utils");
39
+ var import_utils2 = require("@yamada-ui/utils");
41
40
  var import_react = require("react");
41
+
42
+ // src/checkbox-context.tsx
43
+ var import_utils = require("@yamada-ui/utils");
44
+ var [CheckboxGroupProvider, useCheckboxGroupContext] = (0, import_utils.createContext)({
45
+ strict: false,
46
+ name: "CheckboxGroupContext"
47
+ });
48
+
49
+ // src/checkbox.tsx
42
50
  var import_jsx_runtime = require("react/jsx-runtime");
43
51
  var useCheckbox = ({
44
52
  id,
@@ -67,7 +75,7 @@ var useCheckbox = ({
67
75
  ...formControlProps
68
76
  },
69
77
  rest
70
- ] = (0, import_utils.splitObject)(computedProps, import_form_control.formControlProperties);
78
+ ] = (0, import_utils2.splitObject)(computedProps, import_form_control.formControlProperties);
71
79
  const [isFocusVisible, setIsFocusVisible] = (0, import_react.useState)(false);
72
80
  const [isFocused, setFocused] = (0, import_react.useState)(false);
73
81
  const [isHovered, setHovered] = (0, import_react.useState)(false);
@@ -77,7 +85,7 @@ var useCheckbox = ({
77
85
  const [isChecked, setIsChecked] = (0, import_react.useState)(!!defaultIsChecked);
78
86
  const isControlled = isCheckedProp !== void 0;
79
87
  const checked = isControlled ? isCheckedProp : isChecked;
80
- const onChange = (0, import_utils.useCallbackRef)(
88
+ const onChange = (0, import_utils2.useCallbackRef)(
81
89
  (ev) => {
82
90
  if (readOnly || disabled) {
83
91
  ev.preventDefault();
@@ -89,8 +97,8 @@ var useCheckbox = ({
89
97
  },
90
98
  [readOnly, disabled, isControlled, checked, isIndeterminate]
91
99
  );
92
- const onFocus = (0, import_utils.useCallbackRef)(onFocusProp);
93
- const onBlur = (0, import_utils.useCallbackRef)(onBlurProp);
100
+ const onFocus = (0, import_utils2.useCallbackRef)(onFocusProp);
101
+ const onBlur = (0, import_utils2.useCallbackRef)(onBlurProp);
94
102
  const onKeyDown = (0, import_react.useCallback)(
95
103
  ({ key }) => {
96
104
  if (key === " ") setActive(true);
@@ -106,19 +114,19 @@ var useCheckbox = ({
106
114
  (0, import_react.useEffect)(() => {
107
115
  return (0, import_use_focus_visible.trackFocusVisible)(setIsFocusVisible);
108
116
  }, []);
109
- (0, import_utils.useSafeLayoutEffect)(() => {
117
+ (0, import_utils2.useSafeLayoutEffect)(() => {
110
118
  if (inputRef.current)
111
119
  inputRef.current.indeterminate = Boolean(isIndeterminate);
112
120
  }, [isIndeterminate]);
113
- (0, import_utils.useUpdateEffect)(() => {
121
+ (0, import_utils2.useUpdateEffect)(() => {
114
122
  if (disabled) setFocused(false);
115
123
  }, [disabled, setFocused]);
116
- (0, import_utils.useSafeLayoutEffect)(() => {
124
+ (0, import_utils2.useSafeLayoutEffect)(() => {
117
125
  var _a;
118
126
  if (!((_a = inputRef.current) == null ? void 0 : _a.form)) return;
119
127
  inputRef.current.form.onreset = () => setIsChecked(!!defaultIsChecked);
120
128
  }, []);
121
- (0, import_utils.useSafeLayoutEffect)(() => {
129
+ (0, import_utils2.useSafeLayoutEffect)(() => {
122
130
  if (!inputRef.current) return;
123
131
  if (inputRef.current.checked !== checked)
124
132
  setIsChecked(inputRef.current.checked);
@@ -127,11 +135,11 @@ var useCheckbox = ({
127
135
  (props2 = {}, ref = null) => ({
128
136
  ...formControlProps,
129
137
  ...props2,
130
- ref: (0, import_utils.mergeRefs)(ref, (el) => {
138
+ ref: (0, import_utils2.mergeRefs)(ref, (el) => {
131
139
  if (el) setIsLabel(el.tagName === "LABEL");
132
140
  }),
133
- "data-checked": (0, import_utils.dataAttr)(checked),
134
- onClick: (0, import_utils.handlerAll)(props2.onClick, () => {
141
+ "data-checked": (0, import_utils2.dataAttr)(checked),
142
+ onClick: (0, import_utils2.handlerAll)(props2.onClick, () => {
135
143
  var _a;
136
144
  if (isLabel) return;
137
145
  (_a = inputRef.current) == null ? void 0 : _a.click();
@@ -148,20 +156,20 @@ var useCheckbox = ({
148
156
  ...formControlProps,
149
157
  ...props2,
150
158
  ref,
151
- "data-active": (0, import_utils.dataAttr)(isActive),
152
- "data-hover": (0, import_utils.dataAttr)(isHovered),
153
- "data-checked": (0, import_utils.dataAttr)(checked),
154
- "data-focus": (0, import_utils.dataAttr)(isFocused),
155
- "data-focus-visible": (0, import_utils.dataAttr)(isFocused && isFocusVisible),
156
- "data-indeterminate": (0, import_utils.dataAttr)(isIndeterminate),
159
+ "data-active": (0, import_utils2.dataAttr)(isActive),
160
+ "data-hover": (0, import_utils2.dataAttr)(isHovered),
161
+ "data-checked": (0, import_utils2.dataAttr)(checked),
162
+ "data-focus": (0, import_utils2.dataAttr)(isFocused),
163
+ "data-focus-visible": (0, import_utils2.dataAttr)(isFocused && isFocusVisible),
164
+ "data-indeterminate": (0, import_utils2.dataAttr)(isIndeterminate),
157
165
  "aria-hidden": true,
158
- onMouseDown: (0, import_utils.handlerAll)(props2.onMouseDown, (ev) => {
166
+ onMouseDown: (0, import_utils2.handlerAll)(props2.onMouseDown, (ev) => {
159
167
  if (isFocused) ev.preventDefault();
160
168
  setActive(true);
161
169
  }),
162
- onMouseUp: (0, import_utils.handlerAll)(props2.onMouseUp, () => setActive(false)),
163
- onMouseEnter: (0, import_utils.handlerAll)(props2.onMouseEnter, () => setHovered(true)),
164
- onMouseLeave: (0, import_utils.handlerAll)(props2.onMouseLeave, () => setHovered(false))
170
+ onMouseUp: (0, import_utils2.handlerAll)(props2.onMouseUp, () => setActive(false)),
171
+ onMouseEnter: (0, import_utils2.handlerAll)(props2.onMouseEnter, () => setHovered(true)),
172
+ onMouseLeave: (0, import_utils2.handlerAll)(props2.onMouseLeave, () => setHovered(false))
165
173
  }),
166
174
  [
167
175
  isActive,
@@ -177,7 +185,7 @@ var useCheckbox = ({
177
185
  (props2 = {}, ref = null) => ({
178
186
  ...formControlProps,
179
187
  ...props2,
180
- ref: (0, import_utils.mergeRefs)(inputRef, ref),
188
+ ref: (0, import_utils2.mergeRefs)(inputRef, ref),
181
189
  id,
182
190
  type: "checkbox",
183
191
  name,
@@ -199,11 +207,11 @@ var useCheckbox = ({
199
207
  whiteSpace: "nowrap",
200
208
  position: "absolute"
201
209
  },
202
- onChange: (0, import_utils.handlerAll)(props2.onChange, onChange),
203
- onBlur: (0, import_utils.handlerAll)(props2.onBlur, onBlur, () => setFocused(false)),
204
- onFocus: (0, import_utils.handlerAll)(props2.onFocus, onFocus, () => setFocused(true)),
205
- onKeyDown: (0, import_utils.handlerAll)(props2.onKeyDown, onKeyDown),
206
- onKeyUp: (0, import_utils.handlerAll)(props2.onKeyUp, onKeyUp)
210
+ onChange: (0, import_utils2.handlerAll)(props2.onChange, onChange),
211
+ onBlur: (0, import_utils2.handlerAll)(props2.onBlur, onBlur, () => setFocused(false)),
212
+ onFocus: (0, import_utils2.handlerAll)(props2.onFocus, onFocus, () => setFocused(true)),
213
+ onKeyDown: (0, import_utils2.handlerAll)(props2.onKeyDown, onKeyDown),
214
+ onKeyUp: (0, import_utils2.handlerAll)(props2.onKeyUp, onKeyUp)
207
215
  }),
208
216
  [
209
217
  isIndeterminate,
@@ -228,12 +236,12 @@ var useCheckbox = ({
228
236
  ...formControlProps,
229
237
  ...props2,
230
238
  ref,
231
- "data-checked": (0, import_utils.dataAttr)(checked),
232
- onMouseDown: (0, import_utils.handlerAll)(props2.onMouseDown, (ev) => {
239
+ "data-checked": (0, import_utils2.dataAttr)(checked),
240
+ onMouseDown: (0, import_utils2.handlerAll)(props2.onMouseDown, (ev) => {
233
241
  ev.preventDefault();
234
242
  ev.stopPropagation();
235
243
  }),
236
- onTouchStart: (0, import_utils.handlerAll)(props2.onTouchStart, (ev) => {
244
+ onTouchStart: (0, import_utils2.handlerAll)(props2.onTouchStart, (ev) => {
237
245
  ev.preventDefault();
238
246
  ev.stopPropagation();
239
247
  })
@@ -260,7 +268,7 @@ var Checkbox = (0, import_react.forwardRef)(
260
268
  const group = useCheckboxGroupContext();
261
269
  const { value: groupValue, ...groupProps } = { ...group };
262
270
  const control = (0, import_form_control.useFormControl)(props);
263
- const [styles, mergedProps] = (0, import_core.useMultiComponentStyle)("Checkbox", {
271
+ const [styles, mergedProps] = (0, import_core.useComponentMultiStyle)("Checkbox", {
264
272
  ...groupProps,
265
273
  ...props
266
274
  });
@@ -278,7 +286,7 @@ var Checkbox = (0, import_react.forwardRef)(
278
286
  ...computedProps
279
287
  } = (0, import_core.omitThemeProps)(mergedProps);
280
288
  const isCheckedProp = groupValue && computedProps.value ? groupValue.includes(computedProps.value) : computedProps.isChecked;
281
- const onChange = groupProps.onChange && computedProps.value ? (0, import_utils.funcAll)(groupProps.onChange, computedProps.onChange) : computedProps.onChange;
289
+ const onChange = groupProps.onChange && computedProps.value ? (0, import_utils2.funcAll)(groupProps.onChange, computedProps.onChange) : computedProps.onChange;
282
290
  const {
283
291
  isChecked,
284
292
  isIndeterminate,
@@ -314,7 +322,7 @@ var Checkbox = (0, import_react.forwardRef)(
314
322
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
315
323
  import_core.ui.label,
316
324
  {
317
- className: (0, import_utils.cx)("ui-checkbox", className),
325
+ className: (0, import_utils2.cx)("ui-checkbox", className),
318
326
  ...getContainerProps(),
319
327
  __css: {
320
328
  cursor: "pointer",
@@ -460,7 +468,7 @@ var IndeterminateIcon = (props) => {
460
468
 
461
469
  // src/checkbox-group.tsx
462
470
  var import_jsx_runtime2 = require("react/jsx-runtime");
463
- var isEvent = (value) => value && (0, import_utils2.isObject)(value) && (0, import_utils2.isObject)(value.target);
471
+ var isEvent = (value) => value && (0, import_utils3.isObject)(value) && (0, import_utils3.isObject)(value.target);
464
472
  var useCheckboxGroup = ({
465
473
  value: valueProp,
466
474
  defaultValue = [],
@@ -468,7 +476,7 @@ var useCheckboxGroup = ({
468
476
  isNative,
469
477
  ...props
470
478
  }) => {
471
- const onChangeRef = (0, import_utils2.useCallbackRef)(onChangeProp);
479
+ const onChangeRef = (0, import_utils3.useCallbackRef)(onChangeProp);
472
480
  const [value, setValue] = (0, import_use_controllable_state.useControllableState)({
473
481
  value: valueProp,
474
482
  defaultValue,
@@ -492,7 +500,7 @@ var useCheckboxGroup = ({
492
500
  []
493
501
  );
494
502
  const getCheckboxProps = (0, import_react2.useCallback)(
495
- (props2, ref = null) => ({
503
+ (props2 = {}, ref = null) => ({
496
504
  ...props2,
497
505
  ref,
498
506
  [isNative ? "checked" : "isChecked"]: value.some(
@@ -511,10 +519,6 @@ var useCheckboxGroup = ({
511
519
  getCheckboxProps
512
520
  };
513
521
  };
514
- var [CheckboxGroupProvider, useCheckboxGroupContext] = (0, import_utils2.createContext)({
515
- strict: false,
516
- name: "CheckboxGroupContext"
517
- });
518
522
  var CheckboxGroup = (0, import_react2.forwardRef)(
519
523
  ({
520
524
  className,
@@ -534,7 +538,7 @@ var CheckboxGroup = (0, import_react2.forwardRef)(
534
538
  getContainerProps
535
539
  } = useCheckboxGroup(props);
536
540
  const { labelId, isRequired, isReadOnly, isDisabled, isInvalid, ...rest } = (0, import_form_control2.useFormControl)(computedProps);
537
- const validChildren = (0, import_utils2.getValidChildren)(children);
541
+ const validChildren = (0, import_utils3.getValidChildren)(children);
538
542
  let computedChildren = [];
539
543
  if (!validChildren.length && items.length) {
540
544
  computedChildren = items.map(({ label, value: value2, ...props2 }, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Checkbox, { value: value2, ...props2, children: label }, i));
@@ -557,7 +561,7 @@ var CheckboxGroup = (0, import_react2.forwardRef)(
557
561
  import_layouts.Flex,
558
562
  {
559
563
  ref,
560
- className: (0, import_utils2.cx)("ui-checkbox-group", className),
564
+ className: (0, import_utils3.cx)("ui-checkbox-group", className),
561
565
  direction,
562
566
  gap: gap != null ? gap : direction === "row" ? "1rem" : void 0,
563
567
  ...getContainerProps({
@@ -575,7 +579,6 @@ CheckboxGroup.displayName = "CheckboxGroup";
575
579
  // Annotate the CommonJS export names for ESM import in node:
576
580
  0 && (module.exports = {
577
581
  CheckboxGroup,
578
- useCheckboxGroup,
579
- useCheckboxGroupContext
582
+ useCheckboxGroup
580
583
  });
581
584
  //# sourceMappingURL=checkbox-group.js.map