@saas-ui/react 3.0.0-alpha.6 → 3.0.0-alpha.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{chunk-VF3BV2BY.js → chunk-5T7S5OAM.js} +20 -7
  3. package/dist/{chunk-F3CVOMG5.js → chunk-CD2JUFI2.js} +81 -10
  4. package/dist/chunk-IFYV7NUJ.js +326 -0
  5. package/dist/chunk-SKXSBAOS.js +35 -0
  6. package/dist/{chunk-7C3IZBNJ.js → chunk-TT4C5VXB.js} +4 -6
  7. package/dist/components/{breadcrumbs → breadcrumb}/index.cjs +8 -10
  8. package/dist/components/{breadcrumbs → breadcrumb}/index.d.cts +3 -4
  9. package/dist/components/{breadcrumbs → breadcrumb}/index.d.ts +3 -4
  10. package/dist/components/breadcrumb/index.js +8 -0
  11. package/dist/components/menu/index.cjs +163 -179
  12. package/dist/components/menu/index.d.cts +9 -2
  13. package/dist/components/menu/index.d.ts +9 -2
  14. package/dist/components/menu/index.js +4 -2
  15. package/dist/components/password-input/index.js +1 -2
  16. package/dist/components/segmented-control/index.cjs +58 -0
  17. package/dist/components/segmented-control/index.d.cts +13 -1
  18. package/dist/components/segmented-control/index.d.ts +13 -1
  19. package/dist/components/segmented-control/index.js +7 -1
  20. package/dist/index.cjs +693 -462
  21. package/dist/index.d.cts +2 -1
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +288 -403
  24. package/dist/theme/tokens/colors.cjs +349 -0
  25. package/dist/theme/tokens/colors.d.cts +856 -0
  26. package/dist/theme/tokens/colors.d.ts +856 -0
  27. package/dist/theme/tokens/colors.js +8 -0
  28. package/package.json +7 -1
  29. package/dist/chunk-CTOVNZVS.js +0 -1
  30. package/dist/chunk-QMG6HP7Z.js +0 -87
  31. package/dist/components/breadcrumbs/index.js +0 -8
@@ -1,10 +1,8 @@
1
1
  'use client'
2
2
  "use strict";
3
- var __create = Object.create;
4
3
  var __defProp = Object.defineProperty;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
7
  var __export = (target, all) => {
10
8
  for (var name in all)
@@ -18,14 +16,6 @@ var __copyProps = (to, from, except, desc) => {
18
16
  }
19
17
  return to;
20
18
  };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
19
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
20
 
31
21
  // src/components/menu/index.ts
@@ -39,6 +29,7 @@ module.exports = __toCommonJS(menu_exports2);
39
29
  var menu_exports = {};
40
30
  __export(menu_exports, {
41
31
  Arrow: () => MenuArrow,
32
+ Button: () => MenuButton,
42
33
  CheckboxItem: () => MenuCheckboxItem,
43
34
  Content: () => MenuContent,
44
35
  ContextTrigger: () => MenuContextTrigger,
@@ -53,210 +44,203 @@ __export(menu_exports, {
53
44
  Trigger: () => MenuTrigger,
54
45
  TriggerItem: () => MenuTriggerItem
55
46
  });
56
- var import_react3 = require("react");
57
- var import_react4 = require("@chakra-ui/react");
47
+ var import_react4 = require("react");
48
+ var import_react5 = require("@chakra-ui/react");
58
49
 
59
- // ../../node_modules/react-icons/lib/iconBase.mjs
60
- var import_react2 = __toESM(require("react"), 1);
61
-
62
- // ../../node_modules/react-icons/lib/iconContext.mjs
63
- var import_react = __toESM(require("react"), 1);
64
- var DefaultContext = {
65
- color: void 0,
66
- size: void 0,
67
- className: void 0,
68
- style: void 0,
69
- attr: void 0
70
- };
71
- var IconContext = import_react.default.createContext && /* @__PURE__ */ import_react.default.createContext(DefaultContext);
72
-
73
- // ../../node_modules/react-icons/lib/iconBase.mjs
74
- var _excluded = ["attr", "size", "title"];
75
- function _objectWithoutProperties(source, excluded) {
76
- if (source == null) return {};
77
- var target = _objectWithoutPropertiesLoose(source, excluded);
78
- var key, i;
79
- if (Object.getOwnPropertySymbols) {
80
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
81
- for (i = 0; i < sourceSymbolKeys.length; i++) {
82
- key = sourceSymbolKeys[i];
83
- if (excluded.indexOf(key) >= 0) continue;
84
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
85
- target[key] = source[key];
86
- }
87
- }
88
- return target;
89
- }
90
- function _objectWithoutPropertiesLoose(source, excluded) {
91
- if (source == null) return {};
92
- var target = {};
93
- for (var key in source) {
94
- if (Object.prototype.hasOwnProperty.call(source, key)) {
95
- if (excluded.indexOf(key) >= 0) continue;
96
- target[key] = source[key];
97
- }
98
- }
99
- return target;
100
- }
101
- function _extends() {
102
- _extends = Object.assign ? Object.assign.bind() : function(target) {
103
- for (var i = 1; i < arguments.length; i++) {
104
- var source = arguments[i];
105
- for (var key in source) {
106
- if (Object.prototype.hasOwnProperty.call(source, key)) {
107
- target[key] = source[key];
108
- }
50
+ // src/components/button/button.tsx
51
+ var import_react = require("react");
52
+ var import_react2 = require("@chakra-ui/react");
53
+ var import_jsx_runtime = require("react/jsx-runtime");
54
+ var Button = (0, import_react.forwardRef)(
55
+ function Button2(props, ref) {
56
+ const {
57
+ loading,
58
+ disabled,
59
+ loadingText,
60
+ children,
61
+ variant = "glass",
62
+ colorPalette = variant === "glass" ? "accent" : "gray",
63
+ ...rest
64
+ } = props;
65
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
66
+ import_react2.Button,
67
+ {
68
+ colorPalette,
69
+ disabled: loading || disabled,
70
+ variant,
71
+ ref,
72
+ ...rest,
73
+ children: loading && !loadingText ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.AbsoluteCenter, { display: "inline-flex", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Spinner, { size: "inherit", color: "inherit" }) }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Span, { opacity: 0, children })
76
+ ] }) : loading && loadingText ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Spinner, { size: "inherit", color: "inherit" }),
78
+ loadingText
79
+ ] }) : children
109
80
  }
110
- }
111
- return target;
112
- };
113
- return _extends.apply(this, arguments);
114
- }
115
- function ownKeys(e, r) {
116
- var t = Object.keys(e);
117
- if (Object.getOwnPropertySymbols) {
118
- var o = Object.getOwnPropertySymbols(e);
119
- r && (o = o.filter(function(r2) {
120
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
121
- })), t.push.apply(t, o);
122
- }
123
- return t;
124
- }
125
- function _objectSpread(e) {
126
- for (var r = 1; r < arguments.length; r++) {
127
- var t = null != arguments[r] ? arguments[r] : {};
128
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
129
- _defineProperty(e, r2, t[r2]);
130
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
131
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
132
- });
81
+ );
133
82
  }
134
- return e;
135
- }
136
- function _defineProperty(obj, key, value) {
137
- key = _toPropertyKey(key);
138
- if (key in obj) {
139
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
140
- } else {
141
- obj[key] = value;
142
- }
143
- return obj;
144
- }
145
- function _toPropertyKey(t) {
146
- var i = _toPrimitive(t, "string");
147
- return "symbol" == typeof i ? i : i + "";
148
- }
149
- function _toPrimitive(t, r) {
150
- if ("object" != typeof t || !t) return t;
151
- var e = t[Symbol.toPrimitive];
152
- if (void 0 !== e) {
153
- var i = e.call(t, r || "default");
154
- if ("object" != typeof i) return i;
155
- throw new TypeError("@@toPrimitive must return a primitive value.");
156
- }
157
- return ("string" === r ? String : Number)(t);
158
- }
159
- function Tree2Element(tree) {
160
- return tree && tree.map((node, i) => /* @__PURE__ */ import_react2.default.createElement(node.tag, _objectSpread({
161
- key: i
162
- }, node.attr), Tree2Element(node.child)));
163
- }
164
- function GenIcon(data) {
165
- return (props) => /* @__PURE__ */ import_react2.default.createElement(IconBase, _extends({
166
- attr: _objectSpread({}, data.attr)
167
- }, props), Tree2Element(data.child));
168
- }
169
- function IconBase(props) {
170
- var elem = (conf) => {
171
- var {
172
- attr,
173
- size,
174
- title
175
- } = props, svgProps = _objectWithoutProperties(props, _excluded);
176
- var computedSize = size || conf.size || "1em";
177
- var className;
178
- if (conf.className) className = conf.className;
179
- if (props.className) className = (className ? className + " " : "") + props.className;
180
- return /* @__PURE__ */ import_react2.default.createElement("svg", _extends({
83
+ );
84
+
85
+ // src/components/icons/create-icon.tsx
86
+ var import_react3 = require("@chakra-ui/react");
87
+ var createIcon = (props) => {
88
+ return (0, import_react3.createIcon)({
89
+ viewBox: "0 0 24 24",
90
+ defaultProps: {
91
+ fill: "none",
181
92
  stroke: "currentColor",
182
- fill: "currentColor",
183
- strokeWidth: "0"
184
- }, conf.attr, attr, svgProps, {
185
- className,
186
- style: _objectSpread(_objectSpread({
187
- color: props.color || conf.color
188
- }, conf.style), props.style),
189
- height: computedSize,
190
- width: computedSize,
191
- xmlns: "http://www.w3.org/2000/svg"
192
- }), title && /* @__PURE__ */ import_react2.default.createElement("title", null, title), props.children);
193
- };
194
- return IconContext !== void 0 ? /* @__PURE__ */ import_react2.default.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
195
- }
93
+ strokeWidth: "2",
94
+ strokeLinecap: "round",
95
+ strokeLinejoin: "round"
96
+ },
97
+ ...props
98
+ });
99
+ };
196
100
 
197
- // ../../node_modules/react-icons/lu/index.mjs
198
- function LuCheck(props) {
199
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "polyline", "attr": { "points": "20 6 9 17 4 12" }, "child": [] }] })(props);
200
- }
201
- function LuChevronRight(props) {
202
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "m9 18 6-6-6-6" }, "child": [] }] })(props);
203
- }
101
+ // src/components/icons/icons.tsx
102
+ var import_jsx_runtime2 = require("react/jsx-runtime");
103
+ var ChevronUpIcon = createIcon({
104
+ displayName: "ChevronUpIcon",
105
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "18 15 12 9 6 15" })
106
+ });
107
+ var ChevronDownIcon = createIcon({
108
+ displayName: "ChevronDownIcon",
109
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "6 9 12 15 18 9" })
110
+ });
111
+ var ChevronLeftIcon = createIcon({
112
+ displayName: "ChevronLeftIcon",
113
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "15 18 9 12 15 6" })
114
+ });
115
+ var ChevronRightIcon = createIcon({
116
+ displayName: "ChevronRightIcon",
117
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "9 18 15 12 9 6" })
118
+ });
119
+ var HamburgerIcon = createIcon({
120
+ displayName: "ChevronDownIcon",
121
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { fill: "none", children: [
122
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
123
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
125
+ ] })
126
+ });
127
+ var CloseIcon = createIcon({
128
+ displayName: "CloseIcon",
129
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { children: [
130
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
131
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
132
+ ] })
133
+ });
134
+ var FilterIcon = createIcon({
135
+ displayName: "FilterIcon",
136
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" })
137
+ });
138
+ var CalendarIcon = createIcon({
139
+ displayName: "CalendarIcon",
140
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { children: [
141
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
142
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
143
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
144
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
145
+ ] })
146
+ });
147
+ var PlusIcon = createIcon({
148
+ displayName: "PlusIcon",
149
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { children: [
150
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
151
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
152
+ ] })
153
+ });
154
+ var MinusIcon = createIcon({
155
+ displayName: "MinusIcon",
156
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) })
157
+ });
158
+ var ViewOffIcon = createIcon({
159
+ displayName: "ViewOffIcon",
160
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { children: [
161
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
162
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
163
+ ] })
164
+ });
165
+ var ViewIcon = createIcon({
166
+ displayName: "ViewOffIcon",
167
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { children: [
168
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
169
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "3" })
170
+ ] })
171
+ });
172
+ var SearchIcon = createIcon({
173
+ displayName: "SearchIcon",
174
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { children: [
175
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
176
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
177
+ ] })
178
+ });
179
+ var CheckIcon = createIcon({
180
+ displayName: "CheckIcon",
181
+ path: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("polyline", { points: "20 6 9 17 4 12" }) })
182
+ });
204
183
 
205
184
  // src/components/menu/menu.tsx
206
- var import_jsx_runtime = require("react/jsx-runtime");
207
- var MenuContent = (0, import_react3.forwardRef)(
185
+ var import_jsx_runtime3 = require("react/jsx-runtime");
186
+ var MenuContent = (0, import_react4.forwardRef)(
208
187
  function MenuContent2(props, ref) {
209
188
  const { portalled = true, portalRef, ...rest } = props;
210
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Menu.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Menu.Content, { ref, ...rest }) }) });
189
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Menu.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Menu.Content, { ref, ...rest }) }) });
211
190
  }
212
191
  );
213
- var MenuArrow = (0, import_react3.forwardRef)(
192
+ var MenuArrow = (0, import_react4.forwardRef)(
214
193
  function MenuArrow2(props, ref) {
215
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Menu.Arrow, { ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Menu.ArrowTip, {}) });
194
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Menu.Arrow, { ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Menu.ArrowTip, {}) });
216
195
  }
217
196
  );
218
- var MenuCheckboxItem = (0, import_react3.forwardRef)(function MenuCheckboxItem2(props, ref) {
219
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.Menu.CheckboxItem, { ref, ...props, children: [
220
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Menu.ItemIndicator, { hidden: false, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LuCheck, {}) }),
197
+ var MenuCheckboxItem = (0, import_react4.forwardRef)(function MenuCheckboxItem2(props, ref) {
198
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react5.Menu.CheckboxItem, { ref, ...props, children: [
199
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Menu.ItemIndicator, { hidden: false, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckIcon, {}) }),
221
200
  props.children
222
201
  ] });
223
202
  });
224
- var MenuRadioItem = (0, import_react3.forwardRef)(
203
+ var MenuRadioItem = (0, import_react4.forwardRef)(
225
204
  function MenuRadioItem2(props, ref) {
226
205
  const { children, ...rest } = props;
227
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.Menu.RadioItem, { ps: "8", ref, ...rest, children: [
228
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.AbsoluteCenter, { axis: "horizontal", left: "4", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Menu.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LuCheck, {}) }) }),
229
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Menu.ItemText, { children })
206
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react5.Menu.RadioItem, { ps: "8", ref, ...rest, children: [
207
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.AbsoluteCenter, { axis: "horizontal", left: "4", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Menu.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CheckIcon, {}) }) }),
208
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Menu.ItemText, { children })
230
209
  ] });
231
210
  }
232
211
  );
233
- var MenuItemGroup = (0, import_react3.forwardRef)(
212
+ var MenuItemGroup = (0, import_react4.forwardRef)(
234
213
  function MenuItemGroup2(props, ref) {
235
214
  const { title, children, ...rest } = props;
236
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.Menu.ItemGroup, { ref, ...rest, children: [
237
- title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.Menu.ItemGroupLabel, { userSelect: "none", children: title }),
215
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react5.Menu.ItemGroup, { ref, ...rest, children: [
216
+ title && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Menu.ItemGroupLabel, { userSelect: "none", children: title }),
238
217
  children
239
218
  ] });
240
219
  }
241
220
  );
242
- var MenuTriggerItem = (0, import_react3.forwardRef)(
221
+ var MenuTriggerItem = (0, import_react4.forwardRef)(
243
222
  function MenuTriggerItem2(props, ref) {
244
223
  const { startIcon, children, ...rest } = props;
245
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react4.Menu.TriggerItem, { ref, ...rest, children: [
224
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react5.Menu.TriggerItem, { ref, ...rest, children: [
246
225
  startIcon,
247
226
  children,
248
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LuChevronRight, {})
227
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ChevronRightIcon, {})
249
228
  ] });
250
229
  }
251
230
  );
252
- var MenuRadioItemGroup = import_react4.Menu.RadioItemGroup;
253
- var MenuContextTrigger = import_react4.Menu.ContextTrigger;
254
- var MenuRoot = import_react4.Menu.Root;
255
- var MenuSeparator = import_react4.Menu.Separator;
256
- var MenuItem = import_react4.Menu.Item;
257
- var MenuItemText = import_react4.Menu.ItemText;
258
- var MenuItemCommand = import_react4.Menu.ItemCommand;
259
- var MenuTrigger = import_react4.Menu.Trigger;
231
+ var MenuButton = (0, import_react4.forwardRef)(
232
+ function MenuButton2(props, ref) {
233
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MenuTrigger, { ref, ...props, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Button, {}) });
234
+ }
235
+ );
236
+ var MenuRadioItemGroup = import_react5.Menu.RadioItemGroup;
237
+ var MenuContextTrigger = import_react5.Menu.ContextTrigger;
238
+ var MenuRoot = import_react5.Menu.Root;
239
+ var MenuSeparator = import_react5.Menu.Separator;
240
+ var MenuItem = import_react5.Menu.Item;
241
+ var MenuItemText = import_react5.Menu.ItemText;
242
+ var MenuItemCommand = import_react5.Menu.ItemCommand;
243
+ var MenuTrigger = import_react5.Menu.Trigger;
260
244
  // Annotate the CommonJS export names for ESM import in node:
261
245
  0 && (module.exports = {
262
246
  Menu
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { Menu } from '@chakra-ui/react';
2
+ import { Menu, ButtonProps } from '@chakra-ui/react';
3
3
 
4
4
  interface MenuContentProps extends Menu.ContentProps {
5
5
  portalled?: boolean;
@@ -14,6 +14,9 @@ interface MenuTriggerItemProps extends Menu.ItemProps {
14
14
  startIcon?: React.ReactNode;
15
15
  }
16
16
  declare const MenuTriggerItem: react.ForwardRefExoticComponent<MenuTriggerItemProps & react.RefAttributes<HTMLDivElement>>;
17
+ interface MenuButtonProps extends ButtonProps, Menu.TriggerProps {
18
+ }
19
+ declare const MenuButton: react.ForwardRefExoticComponent<MenuButtonProps & react.RefAttributes<HTMLButtonElement>>;
17
20
  declare const MenuRadioItemGroup: react.ForwardRefExoticComponent<Menu.RadioItemGroupProps & react.RefAttributes<HTMLDivElement>>;
18
21
  declare const MenuContextTrigger: react.ForwardRefExoticComponent<Menu.ContextTriggerProps & react.RefAttributes<HTMLElement>>;
19
22
  declare const MenuRoot: react.FC<Menu.RootProps>;
@@ -23,8 +26,12 @@ declare const MenuItemText: react.ForwardRefExoticComponent<Menu.ItemTextProps &
23
26
  declare const MenuItemCommand: react.ForwardRefExoticComponent<Menu.CommandProps & react.RefAttributes<HTMLElement>>;
24
27
  declare const MenuTrigger: react.ForwardRefExoticComponent<Menu.TriggerProps & react.RefAttributes<HTMLButtonElement>>;
25
28
 
29
+ type MenuRootProps = Menu.RootProps;
30
+ type MenuTriggerProps = Menu.TriggerProps;
31
+ type MenuItemProps = Menu.ItemProps;
32
+
26
33
  declare namespace menu {
27
- export { MenuArrow as Arrow, MenuCheckboxItem as CheckboxItem, MenuContent as Content, type MenuContentProps as ContentProps, MenuContextTrigger as ContextTrigger, MenuItem as Item, MenuItemCommand as ItemCommand, MenuItemGroup as ItemGroup, MenuItemText as ItemText, MenuRadioItem as RadioItem, MenuRadioItemGroup as RadioItemGroup, MenuRoot as Root, MenuSeparator as Separator, MenuTrigger as Trigger, MenuTriggerItem as TriggerItem, type MenuTriggerItemProps as TriggerItemProps };
34
+ export { MenuArrow as Arrow, MenuButton as Button, type MenuButtonProps as ButtonProps, MenuCheckboxItem as CheckboxItem, MenuContent as Content, type MenuContentProps as ContentProps, MenuContextTrigger as ContextTrigger, MenuItem as Item, MenuItemCommand as ItemCommand, MenuItemGroup as ItemGroup, type MenuItemProps as ItemProps, MenuItemText as ItemText, MenuRadioItem as RadioItem, MenuRadioItemGroup as RadioItemGroup, MenuRoot as Root, type MenuRootProps as RootProps, MenuSeparator as Separator, MenuTrigger as Trigger, MenuTriggerItem as TriggerItem, type MenuTriggerItemProps as TriggerItemProps, type MenuTriggerProps as TriggerProps };
28
35
  }
29
36
 
30
37
  export { menu as Menu };
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { Menu } from '@chakra-ui/react';
2
+ import { Menu, ButtonProps } from '@chakra-ui/react';
3
3
 
4
4
  interface MenuContentProps extends Menu.ContentProps {
5
5
  portalled?: boolean;
@@ -14,6 +14,9 @@ interface MenuTriggerItemProps extends Menu.ItemProps {
14
14
  startIcon?: React.ReactNode;
15
15
  }
16
16
  declare const MenuTriggerItem: react.ForwardRefExoticComponent<MenuTriggerItemProps & react.RefAttributes<HTMLDivElement>>;
17
+ interface MenuButtonProps extends ButtonProps, Menu.TriggerProps {
18
+ }
19
+ declare const MenuButton: react.ForwardRefExoticComponent<MenuButtonProps & react.RefAttributes<HTMLButtonElement>>;
17
20
  declare const MenuRadioItemGroup: react.ForwardRefExoticComponent<Menu.RadioItemGroupProps & react.RefAttributes<HTMLDivElement>>;
18
21
  declare const MenuContextTrigger: react.ForwardRefExoticComponent<Menu.ContextTriggerProps & react.RefAttributes<HTMLElement>>;
19
22
  declare const MenuRoot: react.FC<Menu.RootProps>;
@@ -23,8 +26,12 @@ declare const MenuItemText: react.ForwardRefExoticComponent<Menu.ItemTextProps &
23
26
  declare const MenuItemCommand: react.ForwardRefExoticComponent<Menu.CommandProps & react.RefAttributes<HTMLElement>>;
24
27
  declare const MenuTrigger: react.ForwardRefExoticComponent<Menu.TriggerProps & react.RefAttributes<HTMLButtonElement>>;
25
28
 
29
+ type MenuRootProps = Menu.RootProps;
30
+ type MenuTriggerProps = Menu.TriggerProps;
31
+ type MenuItemProps = Menu.ItemProps;
32
+
26
33
  declare namespace menu {
27
- export { MenuArrow as Arrow, MenuCheckboxItem as CheckboxItem, MenuContent as Content, type MenuContentProps as ContentProps, MenuContextTrigger as ContextTrigger, MenuItem as Item, MenuItemCommand as ItemCommand, MenuItemGroup as ItemGroup, MenuItemText as ItemText, MenuRadioItem as RadioItem, MenuRadioItemGroup as RadioItemGroup, MenuRoot as Root, MenuSeparator as Separator, MenuTrigger as Trigger, MenuTriggerItem as TriggerItem, type MenuTriggerItemProps as TriggerItemProps };
34
+ export { MenuArrow as Arrow, MenuButton as Button, type MenuButtonProps as ButtonProps, MenuCheckboxItem as CheckboxItem, MenuContent as Content, type MenuContentProps as ContentProps, MenuContextTrigger as ContextTrigger, MenuItem as Item, MenuItemCommand as ItemCommand, MenuItemGroup as ItemGroup, type MenuItemProps as ItemProps, MenuItemText as ItemText, MenuRadioItem as RadioItem, MenuRadioItemGroup as RadioItemGroup, MenuRoot as Root, type MenuRootProps as RootProps, MenuSeparator as Separator, MenuTrigger as Trigger, MenuTriggerItem as TriggerItem, type MenuTriggerItemProps as TriggerItemProps, type MenuTriggerProps as TriggerProps };
28
35
  }
29
36
 
30
37
  export { menu as Menu };
@@ -1,8 +1,10 @@
1
1
  'use client'
2
2
  import {
3
3
  menu_exports
4
- } from "../../chunk-VF3BV2BY.js";
5
- import "../../chunk-F3CVOMG5.js";
4
+ } from "../../chunk-5T7S5OAM.js";
5
+ import "../../chunk-KTLWEUNW.js";
6
+ import "../../chunk-BCNPBZZK.js";
7
+ import "../../chunk-VDXTEASE.js";
6
8
  import "../../chunk-RTMS5TJN.js";
7
9
  export {
8
10
  menu_exports as Menu
@@ -1,8 +1,7 @@
1
1
  'use client'
2
2
  import {
3
3
  PasswordInput
4
- } from "../../chunk-QMG6HP7Z.js";
5
- import "../../chunk-F3CVOMG5.js";
4
+ } from "../../chunk-CD2JUFI2.js";
6
5
  import "../../chunk-PKI6YH2V.js";
7
6
  import "../../chunk-RTMS5TJN.js";
8
7
  export {
@@ -1,2 +1,60 @@
1
1
  'use client'
2
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/components/segmented-control/index.ts
22
+ var segmented_control_exports = {};
23
+ __export(segmented_control_exports, {
24
+ SegmentedControl: () => SegmentedControl
25
+ });
26
+ module.exports = __toCommonJS(segmented_control_exports);
27
+
28
+ // src/components/segmented-control/segmented-control.tsx
29
+ var import_react = require("react");
30
+ var import_react2 = require("@chakra-ui/react");
31
+ var import_jsx_runtime = require("react/jsx-runtime");
32
+ function normalize(items) {
33
+ return items.map((item) => {
34
+ if (typeof item === "string") return { value: item, label: item };
35
+ return item;
36
+ });
37
+ }
38
+ var SegmentedControl = (0, import_react.forwardRef)(function SegmentedControl2(props, ref) {
39
+ const { items, ...rest } = props;
40
+ const data = (0, import_react.useMemo)(() => normalize(items), [items]);
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react2.SegmentGroup.Root, { ref, ...rest, children: [
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.SegmentGroup.Indicator, {}),
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.For, { each: data, children: (item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
44
+ import_react2.SegmentGroup.Item,
45
+ {
46
+ value: item.value,
47
+ disabled: item.disabled,
48
+ children: [
49
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.SegmentGroup.ItemText, { children: item.label }),
50
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.SegmentGroup.ItemHiddenInput, {})
51
+ ]
52
+ },
53
+ item.value
54
+ ) })
55
+ ] });
56
+ });
57
+ // Annotate the CommonJS export names for ESM import in node:
58
+ 0 && (module.exports = {
59
+ SegmentedControl
60
+ });
@@ -1,2 +1,14 @@
1
+ import * as react from 'react';
2
+ import { SegmentGroup } from '@chakra-ui/react';
1
3
 
2
- export { }
4
+ interface Item {
5
+ value: string;
6
+ label: React.ReactNode;
7
+ disabled?: boolean;
8
+ }
9
+ interface SegmentedControlProps extends SegmentGroup.RootProps {
10
+ items: Array<string | Item>;
11
+ }
12
+ declare const SegmentedControl: react.ForwardRefExoticComponent<SegmentedControlProps & react.RefAttributes<HTMLDivElement>>;
13
+
14
+ export { SegmentedControl, type SegmentedControlProps };
@@ -1,2 +1,14 @@
1
+ import * as react from 'react';
2
+ import { SegmentGroup } from '@chakra-ui/react';
1
3
 
2
- export { }
4
+ interface Item {
5
+ value: string;
6
+ label: React.ReactNode;
7
+ disabled?: boolean;
8
+ }
9
+ interface SegmentedControlProps extends SegmentGroup.RootProps {
10
+ items: Array<string | Item>;
11
+ }
12
+ declare const SegmentedControl: react.ForwardRefExoticComponent<SegmentedControlProps & react.RefAttributes<HTMLDivElement>>;
13
+
14
+ export { SegmentedControl, type SegmentedControlProps };
@@ -1,2 +1,8 @@
1
1
  'use client'
2
- import "../../chunk-CTOVNZVS.js";
2
+ import {
3
+ SegmentedControl
4
+ } from "../../chunk-SKXSBAOS.js";
5
+ import "../../chunk-RTMS5TJN.js";
6
+ export {
7
+ SegmentedControl
8
+ };