@teach-in/react 1.4.0 → 1.6.0

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.
Files changed (109) hide show
  1. package/dist/{chunk-2UHA3DYG.mjs → chunk-6BWSC6ZH.mjs} +3 -10
  2. package/dist/chunk-7WIZONLU.mjs +81 -0
  3. package/dist/chunk-ALGSVEUS.mjs +1 -0
  4. package/dist/chunk-BHOCYKBI.mjs +81 -0
  5. package/dist/{chunk-VXYV37IM.mjs → chunk-C5FQB2UN.mjs} +16 -8
  6. package/dist/{chunk-CKJ5U5Q4.mjs → chunk-DEKPRZIQ.mjs} +1 -1
  7. package/dist/chunk-GEPCSZCU.mjs +71 -0
  8. package/dist/chunk-GTE5VEBV.mjs +68 -0
  9. package/dist/{chunk-UFYLYN5Z.mjs → chunk-QFWSQOF6.mjs} +20 -2
  10. package/dist/chunk-VDPROXMN.mjs +57 -0
  11. package/dist/{chunk-J3OZNLTZ.mjs → chunk-WG4IPOHE.mjs} +5 -5
  12. package/dist/{chunk-R46SWVWL.mjs → chunk-ZK6VZMUJ.mjs} +1 -1
  13. package/dist/index.js +536 -253
  14. package/dist/index.mjs +140 -132
  15. package/dist/ui/data/index.js +56 -7
  16. package/dist/ui/data/index.mjs +12 -10
  17. package/dist/ui/data/user/index.js +51 -2
  18. package/dist/ui/data/user/index.mjs +3 -1
  19. package/dist/ui/data/user/user.d.ts +24 -2
  20. package/dist/ui/data/user/user.js +52 -2
  21. package/dist/ui/data/user/user.mjs +4 -1
  22. package/dist/ui/feedback/index.mjs +7 -7
  23. package/dist/ui/form/index.js +76 -18
  24. package/dist/ui/form/index.mjs +25 -20
  25. package/dist/ui/form/rhf/fields/autocomplete-field.mjs +20 -15
  26. package/dist/ui/form/rhf/fields/checkbox-field.mjs +20 -15
  27. package/dist/ui/form/rhf/fields/date-picker-field.mjs +20 -15
  28. package/dist/ui/form/rhf/fields/email-field.js +58 -3
  29. package/dist/ui/form/rhf/fields/email-field.mjs +21 -16
  30. package/dist/ui/form/rhf/fields/index.js +76 -18
  31. package/dist/ui/form/rhf/fields/index.mjs +22 -17
  32. package/dist/ui/form/rhf/fields/input-field.mjs +20 -15
  33. package/dist/ui/form/rhf/fields/radio-field.mjs +20 -15
  34. package/dist/ui/form/rhf/fields/search-field.mjs +20 -15
  35. package/dist/ui/form/rhf/fields/select-field.js +18 -15
  36. package/dist/ui/form/rhf/fields/select-field.mjs +21 -16
  37. package/dist/ui/form/rhf/fields/switch-field.mjs +20 -15
  38. package/dist/ui/form/rhf/fields/text-field.mjs +20 -15
  39. package/dist/ui/form/rhf/fields/textarea-field.mjs +20 -15
  40. package/dist/ui/form/rhf/index.js +76 -18
  41. package/dist/ui/form/rhf/index.mjs +22 -17
  42. package/dist/ui/format/index.mjs +12 -12
  43. package/dist/ui/index.js +536 -253
  44. package/dist/ui/index.mjs +140 -132
  45. package/dist/ui/inputs/checkbox/index.mjs +3 -3
  46. package/dist/ui/inputs/email/email.js +58 -3
  47. package/dist/ui/inputs/email/email.mjs +1 -1
  48. package/dist/ui/inputs/email/index.js +58 -3
  49. package/dist/ui/inputs/email/index.mjs +1 -1
  50. package/dist/ui/inputs/index.d.ts +1 -0
  51. package/dist/ui/inputs/index.js +305 -69
  52. package/dist/ui/inputs/index.mjs +35 -25
  53. package/dist/ui/inputs/number/index.d.ts +1 -0
  54. package/dist/ui/inputs/number/index.js +218 -0
  55. package/dist/ui/inputs/number/index.mjs +12 -0
  56. package/dist/ui/inputs/number/number.d.ts +12 -0
  57. package/dist/ui/inputs/number/number.js +219 -0
  58. package/dist/ui/inputs/number/number.mjs +13 -0
  59. package/dist/ui/inputs/number/use-number.d.ts +20 -0
  60. package/dist/ui/inputs/number/use-number.js +104 -0
  61. package/dist/ui/inputs/number/use-number.mjs +7 -0
  62. package/dist/ui/inputs/select/index.d.ts +1 -1
  63. package/dist/ui/inputs/select/index.js +23 -17
  64. package/dist/ui/inputs/select/index.mjs +8 -4
  65. package/dist/ui/inputs/select/select.d.ts +11 -22
  66. package/dist/ui/inputs/select/select.js +23 -17
  67. package/dist/ui/inputs/select/select.mjs +8 -4
  68. package/dist/ui/inputs/select/use-select.d.ts +0 -1
  69. package/dist/ui/inputs/select/use-select.js +2 -9
  70. package/dist/ui/inputs/select/use-select.mjs +1 -1
  71. package/dist/ui/inputs/switch/favorite-switch.d.ts +23 -2
  72. package/dist/ui/inputs/switch/favorite-switch.js +34 -4
  73. package/dist/ui/inputs/switch/favorite-switch.mjs +1 -1
  74. package/dist/ui/inputs/switch/index.js +34 -4
  75. package/dist/ui/inputs/switch/index.mjs +1 -1
  76. package/dist/ui/layout/container/container.mjs +67 -64
  77. package/dist/ui/layout/container/index.mjs +67 -64
  78. package/dist/ui/layout/index.js +7 -7
  79. package/dist/ui/layout/index.mjs +71 -68
  80. package/dist/ui/layout/page/index.mjs +4 -4
  81. package/dist/ui/layout/page/page-loading.mjs +4 -4
  82. package/dist/ui/layout/page/section-loading.mjs +4 -4
  83. package/dist/ui/navigation/index.mjs +5 -5
  84. package/dist/ui/overlays/index.mjs +4 -4
  85. package/dist/ui/provider/index.mjs +4 -4
  86. package/dist/ui/provider/ui-provider.mjs +4 -4
  87. package/dist/ui/surface/bento/bento.d.ts +2 -2
  88. package/dist/ui/surface/bento/bento.js +5 -5
  89. package/dist/ui/surface/bento/bento.mjs +1 -1
  90. package/dist/ui/surface/bento/index.js +5 -5
  91. package/dist/ui/surface/bento/index.mjs +1 -1
  92. package/dist/ui/surface/card/card.d.ts +2427 -5
  93. package/dist/ui/surface/card/card.js +29 -2
  94. package/dist/ui/surface/card/card.mjs +5 -1
  95. package/dist/ui/surface/card/index.js +29 -2
  96. package/dist/ui/surface/card/index.mjs +5 -1
  97. package/dist/ui/surface/index.js +34 -7
  98. package/dist/ui/surface/index.mjs +9 -5
  99. package/dist/ui/theme/colors/index.mjs +1 -1
  100. package/dist/ui/theme/colors.mjs +1 -1
  101. package/dist/ui/theme/index.mjs +1 -1
  102. package/dist/ui/theme/theme.d.ts +2 -1
  103. package/dist/ui/theme/theme.mjs +1 -1
  104. package/package.json +13 -9
  105. package/LICENSE +0 -21
  106. package/dist/chunk-46SKVFMZ.mjs +0 -16
  107. package/dist/chunk-E5QSNLSR.mjs +0 -38
  108. package/dist/chunk-XHCXM5MU.mjs +0 -14
  109. /package/dist/{chunk-UQAG7TKJ.mjs → chunk-37MCHF7U.mjs} +0 -0
@@ -31,7 +31,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/ui/inputs/select/index.ts
32
32
  var select_exports = {};
33
33
  __export(select_exports, {
34
- Select: () => Select
34
+ Select: () => Select,
35
+ SelectItem: () => SelectItem
35
36
  });
36
37
  module.exports = __toCommonJS(select_exports);
37
38
 
@@ -68,6 +69,13 @@ var ClearButton = import_react.default.forwardRef(
68
69
  );
69
70
  ClearButton.displayName = "TeachInUI.ClearButton";
70
71
 
72
+ // src/ui/style/css.ts
73
+ var import_clsx = require("clsx");
74
+ var import_tailwind_merge = require("tailwind-merge");
75
+ function cn(...inputs) {
76
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
77
+ }
78
+
71
79
  // src/ui/inputs/select/use-select.ts
72
80
  var import_react2 = require("react");
73
81
  function useSelect({
@@ -78,24 +86,17 @@ function useSelect({
78
86
  isClearable = true
79
87
  }) {
80
88
  const isMultiple = selectionMode === "multiple";
81
- const [internalValue, setInternalValue] = (0, import_react2.useState)(
82
- isMultiple ? [] : null
83
- );
84
- const isControlled = value !== void 0;
85
- const currentValue = isControlled ? value : internalValue;
89
+ const currentValue = value != null ? value : isMultiple ? [] : null;
86
90
  const hasValue = currentValue != null && (Array.isArray(currentValue) ? currentValue.length > 0 : currentValue !== "");
87
91
  const handleChange = (0, import_react2.useCallback)(
88
92
  (newValue) => {
89
- if (!isControlled) {
90
- setInternalValue(newValue);
91
- }
92
93
  if (isMultiple) {
93
94
  onChange == null ? void 0 : onChange(newValue);
94
95
  } else {
95
96
  onChange == null ? void 0 : onChange(newValue);
96
97
  }
97
98
  },
98
- [isControlled, onChange, isMultiple]
99
+ [onChange, isMultiple]
99
100
  );
100
101
  const handleClear = (0, import_react2.useCallback)(() => {
101
102
  onClear == null ? void 0 : onClear();
@@ -140,9 +141,11 @@ var selectWrapperVariants = (0, import_tailwind_variants.tv)({
140
141
  var Select = import_react3.default.forwardRef(
141
142
  ({
142
143
  value,
143
- defaultSelectedKeys,
144
144
  items,
145
+ children,
146
+ selectedKeys: selectedKeysProp,
145
147
  onChange,
148
+ onSelectionChange,
146
149
  selectionMode,
147
150
  onClear,
148
151
  variant,
@@ -151,6 +154,8 @@ var Select = import_react3.default.forwardRef(
151
154
  isClearable,
152
155
  ...props
153
156
  }, ref) => {
157
+ const usesExternalSelectionControl = selectedKeysProp !== void 0 || onSelectionChange !== void 0;
158
+ const selectChildren = children != null ? children : (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_select.SelectItem, { children: item.label }, item.key);
154
159
  const { selectedKeys, handleSelectionChange, handleClear, showClearButton } = useSelect({
155
160
  value,
156
161
  onChange,
@@ -164,27 +169,28 @@ var Select = import_react3.default.forwardRef(
164
169
  ref,
165
170
  classNames: {
166
171
  ...classNames,
167
- trigger: selectWrapperVariants({ variant }),
172
+ trigger: cn(selectWrapperVariants({ variant }), classNames == null ? void 0 : classNames.trigger),
168
173
  innerWrapper: "group"
169
174
  },
170
- defaultSelectedKeys,
171
175
  endContent: (endContent || showClearButton) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center gap-1", children: [
172
176
  endContent,
173
177
  showClearButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ClearButton, { onClear: handleClear })
174
178
  ] }),
175
179
  items,
176
- selectedKeys,
180
+ selectedKeys: usesExternalSelectionControl ? selectedKeysProp : selectedKeys,
177
181
  selectionMode,
178
182
  variant,
179
- onSelectionChange: handleSelectionChange,
183
+ onSelectionChange: usesExternalSelectionControl ? onSelectionChange : handleSelectionChange,
180
184
  ...props,
181
- children: (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_select.SelectItem, { children: item.label }, item.key)
185
+ children: selectChildren
182
186
  }
183
187
  );
184
188
  }
185
189
  );
186
190
  Select.displayName = "TeachInUI.Select";
191
+ var SelectItem = import_select.SelectItem;
187
192
  // Annotate the CommonJS export names for ESM import in node:
188
193
  0 && (module.exports = {
189
- Select
194
+ Select,
195
+ SelectItem
190
196
  });
@@ -1,10 +1,14 @@
1
1
  "use client";
2
2
  import "../../../chunk-AQ3ISJKU.mjs";
3
3
  import {
4
- Select
5
- } from "../../../chunk-VXYV37IM.mjs";
6
- import "../../../chunk-2UHA3DYG.mjs";
4
+ Select,
5
+ SelectItem
6
+ } from "../../../chunk-C5FQB2UN.mjs";
7
+ import "../../../chunk-6BWSC6ZH.mjs";
7
8
  import "../../../chunk-TUIN5YJW.mjs";
9
+ import "../../../chunk-Q6XJI7Q2.mjs";
10
+ import "../../../chunk-LOMRTWX5.mjs";
8
11
  export {
9
- Select
12
+ Select,
13
+ SelectItem
10
14
  };
@@ -4,27 +4,16 @@ interface Item {
4
4
  key: string;
5
5
  label: string;
6
6
  }
7
- type BaseSelectProps = Omit<HeroUISelectProps<Item>, "selectedKeys" | "onSelectionChange" | "children" | "onChange">;
8
- export type SelectProps = (BaseSelectProps & {
9
- selectionMode?: "single";
10
- value?: string;
11
- onChange?: (value: string | null) => void;
7
+ type SelectChildren = NonNullable<HeroUISelectProps<Item>["children"]>;
8
+ type BaseSelectProps = Omit<HeroUISelectProps<Item>, "children" | "defaultSelectedKeys" | "onChange">;
9
+ export interface SelectProps extends Omit<BaseSelectProps, "selectionMode"> {
10
+ selectionMode?: "single" | "multiple";
11
+ value?: string | string[];
12
+ onChange?: ((value: string | null) => void) | ((value: string[]) => void);
12
13
  onClear?: () => void;
13
- }) | (BaseSelectProps & {
14
- selectionMode: "multiple";
15
- value?: string[];
16
- onChange?: (value: string[]) => void;
17
- onClear?: () => void;
18
- });
19
- export declare const Select: React.ForwardRefExoticComponent<(Omit<BaseSelectProps & {
20
- selectionMode?: "single";
21
- value?: string;
22
- onChange?: (value: string | null) => void;
23
- onClear?: () => void;
24
- }, "ref"> | Omit<BaseSelectProps & {
25
- selectionMode: "multiple";
26
- value?: string[];
27
- onChange?: (value: string[]) => void;
28
- onClear?: () => void;
29
- }, "ref">) & React.RefAttributes<HTMLSelectElement>>;
14
+ items?: Item[];
15
+ children?: SelectChildren;
16
+ }
17
+ export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
18
+ export declare const SelectItem: <T extends object>(props: Omit<import("@heroui/autocomplete").AutocompleteItemProps<T>, "value">) => JSX.Element;
30
19
  export {};
@@ -31,7 +31,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/ui/inputs/select/select.tsx
32
32
  var select_exports = {};
33
33
  __export(select_exports, {
34
- Select: () => Select
34
+ Select: () => Select,
35
+ SelectItem: () => SelectItem
35
36
  });
36
37
  module.exports = __toCommonJS(select_exports);
37
38
  var import_react3 = __toESM(require("react"));
@@ -66,6 +67,13 @@ var ClearButton = import_react.default.forwardRef(
66
67
  );
67
68
  ClearButton.displayName = "TeachInUI.ClearButton";
68
69
 
70
+ // src/ui/style/css.ts
71
+ var import_clsx = require("clsx");
72
+ var import_tailwind_merge = require("tailwind-merge");
73
+ function cn(...inputs) {
74
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
75
+ }
76
+
69
77
  // src/ui/inputs/select/use-select.ts
70
78
  var import_react2 = require("react");
71
79
  function useSelect({
@@ -76,24 +84,17 @@ function useSelect({
76
84
  isClearable = true
77
85
  }) {
78
86
  const isMultiple = selectionMode === "multiple";
79
- const [internalValue, setInternalValue] = (0, import_react2.useState)(
80
- isMultiple ? [] : null
81
- );
82
- const isControlled = value !== void 0;
83
- const currentValue = isControlled ? value : internalValue;
87
+ const currentValue = value != null ? value : isMultiple ? [] : null;
84
88
  const hasValue = currentValue != null && (Array.isArray(currentValue) ? currentValue.length > 0 : currentValue !== "");
85
89
  const handleChange = (0, import_react2.useCallback)(
86
90
  (newValue) => {
87
- if (!isControlled) {
88
- setInternalValue(newValue);
89
- }
90
91
  if (isMultiple) {
91
92
  onChange == null ? void 0 : onChange(newValue);
92
93
  } else {
93
94
  onChange == null ? void 0 : onChange(newValue);
94
95
  }
95
96
  },
96
- [isControlled, onChange, isMultiple]
97
+ [onChange, isMultiple]
97
98
  );
98
99
  const handleClear = (0, import_react2.useCallback)(() => {
99
100
  onClear == null ? void 0 : onClear();
@@ -138,9 +139,11 @@ var selectWrapperVariants = (0, import_tailwind_variants.tv)({
138
139
  var Select = import_react3.default.forwardRef(
139
140
  ({
140
141
  value,
141
- defaultSelectedKeys,
142
142
  items,
143
+ children,
144
+ selectedKeys: selectedKeysProp,
143
145
  onChange,
146
+ onSelectionChange,
144
147
  selectionMode,
145
148
  onClear,
146
149
  variant,
@@ -149,6 +152,8 @@ var Select = import_react3.default.forwardRef(
149
152
  isClearable,
150
153
  ...props
151
154
  }, ref) => {
155
+ const usesExternalSelectionControl = selectedKeysProp !== void 0 || onSelectionChange !== void 0;
156
+ const selectChildren = children != null ? children : (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_select.SelectItem, { children: item.label }, item.key);
152
157
  const { selectedKeys, handleSelectionChange, handleClear, showClearButton } = useSelect({
153
158
  value,
154
159
  onChange,
@@ -162,27 +167,28 @@ var Select = import_react3.default.forwardRef(
162
167
  ref,
163
168
  classNames: {
164
169
  ...classNames,
165
- trigger: selectWrapperVariants({ variant }),
170
+ trigger: cn(selectWrapperVariants({ variant }), classNames == null ? void 0 : classNames.trigger),
166
171
  innerWrapper: "group"
167
172
  },
168
- defaultSelectedKeys,
169
173
  endContent: (endContent || showClearButton) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex items-center gap-1", children: [
170
174
  endContent,
171
175
  showClearButton && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ClearButton, { onClear: handleClear })
172
176
  ] }),
173
177
  items,
174
- selectedKeys,
178
+ selectedKeys: usesExternalSelectionControl ? selectedKeysProp : selectedKeys,
175
179
  selectionMode,
176
180
  variant,
177
- onSelectionChange: handleSelectionChange,
181
+ onSelectionChange: usesExternalSelectionControl ? onSelectionChange : handleSelectionChange,
178
182
  ...props,
179
- children: (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_select.SelectItem, { children: item.label }, item.key)
183
+ children: selectChildren
180
184
  }
181
185
  );
182
186
  }
183
187
  );
184
188
  Select.displayName = "TeachInUI.Select";
189
+ var SelectItem = import_select.SelectItem;
185
190
  // Annotate the CommonJS export names for ESM import in node:
186
191
  0 && (module.exports = {
187
- Select
192
+ Select,
193
+ SelectItem
188
194
  });
@@ -1,9 +1,13 @@
1
1
  "use client";
2
2
  import {
3
- Select
4
- } from "../../../chunk-VXYV37IM.mjs";
5
- import "../../../chunk-2UHA3DYG.mjs";
3
+ Select,
4
+ SelectItem
5
+ } from "../../../chunk-C5FQB2UN.mjs";
6
+ import "../../../chunk-6BWSC6ZH.mjs";
6
7
  import "../../../chunk-TUIN5YJW.mjs";
8
+ import "../../../chunk-Q6XJI7Q2.mjs";
9
+ import "../../../chunk-LOMRTWX5.mjs";
7
10
  export {
8
- Select
11
+ Select,
12
+ SelectItem
9
13
  };
@@ -1,6 +1,5 @@
1
1
  interface UseSelectProps {
2
2
  value?: string | string[];
3
- defaultSelectedKeys?: "all" | Iterable<React.Key>;
4
3
  onChange?: ((value: string | null) => void) | ((value: string[]) => void);
5
4
  onClear?: () => void;
6
5
  selectionMode?: "single" | "multiple";
@@ -33,24 +33,17 @@ function useSelect({
33
33
  isClearable = true
34
34
  }) {
35
35
  const isMultiple = selectionMode === "multiple";
36
- const [internalValue, setInternalValue] = (0, import_react.useState)(
37
- isMultiple ? [] : null
38
- );
39
- const isControlled = value !== void 0;
40
- const currentValue = isControlled ? value : internalValue;
36
+ const currentValue = value != null ? value : isMultiple ? [] : null;
41
37
  const hasValue = currentValue != null && (Array.isArray(currentValue) ? currentValue.length > 0 : currentValue !== "");
42
38
  const handleChange = (0, import_react.useCallback)(
43
39
  (newValue) => {
44
- if (!isControlled) {
45
- setInternalValue(newValue);
46
- }
47
40
  if (isMultiple) {
48
41
  onChange == null ? void 0 : onChange(newValue);
49
42
  } else {
50
43
  onChange == null ? void 0 : onChange(newValue);
51
44
  }
52
45
  },
53
- [isControlled, onChange, isMultiple]
46
+ [onChange, isMultiple]
54
47
  );
55
48
  const handleClear = (0, import_react.useCallback)(() => {
56
49
  onClear == null ? void 0 : onClear();
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useSelect
4
- } from "../../../chunk-2UHA3DYG.mjs";
4
+ } from "../../../chunk-6BWSC6ZH.mjs";
5
5
  export {
6
6
  useSelect
7
7
  };
@@ -1,6 +1,27 @@
1
+ import type { VariantProps } from "tailwind-variants";
1
2
  import React from "react";
2
- export interface Props {
3
+ declare const wrapperVariants: import("tailwind-variants").TVReturnType<{
4
+ size: {
5
+ sm: string;
6
+ md: string;
7
+ lg: string;
8
+ };
9
+ }, undefined, "flex cursor-pointer items-center justify-center rounded-sm bg-transparent!", {
10
+ size: {
11
+ sm: string;
12
+ md: string;
13
+ lg: string;
14
+ };
15
+ }, undefined, import("tailwind-variants").TVReturnType<{
16
+ size: {
17
+ sm: string;
18
+ md: string;
19
+ lg: string;
20
+ };
21
+ }, undefined, "flex cursor-pointer items-center justify-center rounded-sm bg-transparent!", unknown, unknown, undefined>>;
22
+ export interface Props extends VariantProps<typeof wrapperVariants> {
3
23
  isSelected: boolean;
4
24
  onValueChange?: (isSelected: boolean) => void;
5
25
  }
6
- export declare function FavoriteSwitch({ isSelected, onValueChange }: Props): React.JSX.Element;
26
+ export declare function FavoriteSwitch({ isSelected, onValueChange, size }: Props): React.JSX.Element;
27
+ export {};
@@ -30,14 +30,35 @@ var import_lucide_react = require("lucide-react");
30
30
  var import_tailwind_variants = require("tailwind-variants");
31
31
  var import_jsx_runtime = require("react/jsx-runtime");
32
32
  var bookmarkVariants = (0, import_tailwind_variants.tv)({
33
- base: "size-6 stroke-default-400 group-hover:fill-primary-100 group-hover:stroke-default-400",
33
+ base: "stroke-default-400 group-hover:fill-primary-100 group-hover:stroke-default-400",
34
34
  variants: {
35
+ size: {
36
+ sm: "size-6",
37
+ md: "size-8",
38
+ lg: "size-10"
39
+ },
35
40
  isSelected: {
36
41
  true: "stroke-primary fill-primary-100"
37
42
  }
43
+ },
44
+ defaultVariants: {
45
+ size: "md"
38
46
  }
39
47
  });
40
- function FavoriteSwitch({ isSelected, onValueChange }) {
48
+ var wrapperVariants = (0, import_tailwind_variants.tv)({
49
+ base: "flex cursor-pointer items-center justify-center rounded-sm bg-transparent!",
50
+ variants: {
51
+ size: {
52
+ sm: "h-8 w-8",
53
+ md: "h-10 w-10",
54
+ lg: "h-12 w-12"
55
+ }
56
+ },
57
+ defaultVariants: {
58
+ size: "md"
59
+ }
60
+ });
61
+ function FavoriteSwitch({ isSelected, onValueChange, size }) {
41
62
  const { Component, slots, getBaseProps, getInputProps, getWrapperProps } = (0, import_switch.useSwitch)({
42
63
  isSelected,
43
64
  onValueChange
@@ -49,9 +70,18 @@ function FavoriteSwitch({ isSelected, onValueChange }) {
49
70
  {
50
71
  ...getWrapperProps(),
51
72
  className: slots.wrapper({
52
- class: "flex h-8 w-8 cursor-pointer items-center justify-center rounded-sm !bg-transparent"
73
+ class: wrapperVariants({ size })
53
74
  }),
54
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Bookmark, { className: bookmarkVariants({ isSelected }) })
75
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ import_lucide_react.BookmarkIcon,
77
+ {
78
+ absoluteStrokeWidth: true,
79
+ className: bookmarkVariants({ isSelected, size }),
80
+ strokeLinecap: "round",
81
+ strokeLinejoin: "round",
82
+ strokeWidth: 1.5
83
+ }
84
+ )
55
85
  }
56
86
  )
57
87
  ] });
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  import {
4
4
  FavoriteSwitch
5
- } from "../../../chunk-E5QSNLSR.mjs";
5
+ } from "../../../chunk-GTE5VEBV.mjs";
6
6
  export {
7
7
  FavoriteSwitch
8
8
  };
@@ -51,14 +51,35 @@ var import_lucide_react = require("lucide-react");
51
51
  var import_tailwind_variants = require("tailwind-variants");
52
52
  var import_jsx_runtime2 = require("react/jsx-runtime");
53
53
  var bookmarkVariants = (0, import_tailwind_variants.tv)({
54
- base: "size-6 stroke-default-400 group-hover:fill-primary-100 group-hover:stroke-default-400",
54
+ base: "stroke-default-400 group-hover:fill-primary-100 group-hover:stroke-default-400",
55
55
  variants: {
56
+ size: {
57
+ sm: "size-6",
58
+ md: "size-8",
59
+ lg: "size-10"
60
+ },
56
61
  isSelected: {
57
62
  true: "stroke-primary fill-primary-100"
58
63
  }
64
+ },
65
+ defaultVariants: {
66
+ size: "md"
59
67
  }
60
68
  });
61
- function FavoriteSwitch({ isSelected, onValueChange }) {
69
+ var wrapperVariants = (0, import_tailwind_variants.tv)({
70
+ base: "flex cursor-pointer items-center justify-center rounded-sm bg-transparent!",
71
+ variants: {
72
+ size: {
73
+ sm: "h-8 w-8",
74
+ md: "h-10 w-10",
75
+ lg: "h-12 w-12"
76
+ }
77
+ },
78
+ defaultVariants: {
79
+ size: "md"
80
+ }
81
+ });
82
+ function FavoriteSwitch({ isSelected, onValueChange, size }) {
62
83
  const { Component, slots, getBaseProps, getInputProps, getWrapperProps } = (0, import_switch2.useSwitch)({
63
84
  isSelected,
64
85
  onValueChange
@@ -70,9 +91,18 @@ function FavoriteSwitch({ isSelected, onValueChange }) {
70
91
  {
71
92
  ...getWrapperProps(),
72
93
  className: slots.wrapper({
73
- class: "flex h-8 w-8 cursor-pointer items-center justify-center rounded-sm !bg-transparent"
94
+ class: wrapperVariants({ size })
74
95
  }),
75
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Bookmark, { className: bookmarkVariants({ isSelected }) })
96
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
97
+ import_lucide_react.BookmarkIcon,
98
+ {
99
+ absoluteStrokeWidth: true,
100
+ className: bookmarkVariants({ isSelected, size }),
101
+ strokeLinecap: "round",
102
+ strokeLinejoin: "round",
103
+ strokeWidth: 1.5
104
+ }
105
+ )
76
106
  }
77
107
  )
78
108
  ] });
@@ -2,7 +2,7 @@
2
2
  import "../../../chunk-LLP2PTPK.mjs";
3
3
  import {
4
4
  FavoriteSwitch
5
- } from "../../../chunk-E5QSNLSR.mjs";
5
+ } from "../../../chunk-GTE5VEBV.mjs";
6
6
  import {
7
7
  Switch
8
8
  } from "../../../chunk-N3EAW6UO.mjs";