@saas-ui/react 3.0.0-alpha.23 → 3.0.0-alpha.24

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 (39) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{chunk-BU7QENBQ.js → chunk-3JZ42NYM.js} +1 -1
  3. package/dist/{chunk-VJ4NCA6R.js → chunk-3Y67QIZ7.js} +1 -1
  4. package/dist/chunk-52XM5VXJ.js +9 -0
  5. package/dist/chunk-IVLUAUU5.js +10 -0
  6. package/dist/chunk-JMYI6YXR.js +1 -0
  7. package/dist/{chunk-EQ7Q6HRE.js → chunk-OIOBGO3Y.js} +1 -1
  8. package/dist/chunk-RLIAFHVM.js +66 -0
  9. package/dist/components/badge/index.d.cts +2 -0
  10. package/dist/components/badge/index.d.ts +2 -0
  11. package/dist/components/close-button/index.js +2 -1
  12. package/dist/components/data-list/index.cjs +33 -0
  13. package/dist/components/data-list/index.d.cts +1 -0
  14. package/dist/components/data-list/index.d.ts +1 -0
  15. package/dist/components/data-list/index.js +10 -0
  16. package/dist/components/dialog/index.js +3 -2
  17. package/dist/components/drawer/index.js +3 -2
  18. package/dist/components/navbar/index.d.cts +3 -3
  19. package/dist/components/navbar/index.d.ts +3 -3
  20. package/dist/components/persona/index.d.cts +3 -8
  21. package/dist/components/persona/index.d.ts +3 -8
  22. package/dist/components/select/index.js +3 -2
  23. package/dist/components/sidebar/index.d.cts +11 -11
  24. package/dist/components/sidebar/index.d.ts +11 -11
  25. package/dist/components/tabs/index.cjs +35 -0
  26. package/dist/components/tabs/index.d.cts +1 -0
  27. package/dist/components/tabs/index.d.ts +1 -0
  28. package/dist/components/tabs/index.js +12 -0
  29. package/dist/components/toaster/index.cjs +161 -11
  30. package/dist/components/toaster/index.d.cts +6 -5
  31. package/dist/components/toaster/index.d.ts +6 -5
  32. package/dist/components/toaster/index.js +3 -1
  33. package/dist/index.cjs +801 -735
  34. package/dist/index.d.cts +2 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +764 -727
  37. package/package.json +1 -1
  38. package/dist/chunk-HELHPHIQ.js +0 -35
  39. /package/dist/{chunk-BKYGKH3L.js → chunk-YXGJOOMM.js} +0 -0
@@ -0,0 +1,35 @@
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/components/tabs/index.ts
22
+ var tabs_exports = {};
23
+ __export(tabs_exports, {
24
+ Tabs: () => import_tabs.Tabs,
25
+ useTabsContext: () => import_tabs.useTabsContext,
26
+ useTabsStyles: () => import_tabs.useTabsStyles
27
+ });
28
+ module.exports = __toCommonJS(tabs_exports);
29
+ var import_tabs = require("@chakra-ui/react/tabs");
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ Tabs,
33
+ useTabsContext,
34
+ useTabsStyles
35
+ });
@@ -0,0 +1 @@
1
+ export { Tabs, useTabsContext, useTabsStyles } from '@chakra-ui/react/tabs';
@@ -0,0 +1 @@
1
+ export { Tabs, useTabsContext, useTabsStyles } from '@chakra-ui/react/tabs';
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ import {
3
+ Tabs,
4
+ useTabsContext,
5
+ useTabsStyles
6
+ } from "../../chunk-IVLUAUU5.js";
7
+ import "../../chunk-RTMS5TJN.js";
8
+ export {
9
+ Tabs,
10
+ useTabsContext,
11
+ useTabsStyles
12
+ };
@@ -27,26 +27,176 @@ __export(toaster_exports, {
27
27
  module.exports = __toCommonJS(toaster_exports);
28
28
 
29
29
  // src/components/toaster/toaster.tsx
30
+ var import_react4 = require("react");
31
+ var import_react5 = require("@chakra-ui/react");
32
+
33
+ // src/components/close-button/close-button.tsx
34
+ var import_react2 = require("react");
35
+ var import_react3 = require("@chakra-ui/react");
36
+
37
+ // src/components/icons/create-icon.tsx
30
38
  var import_react = require("@chakra-ui/react");
39
+ var createIcon = (props) => {
40
+ return (0, import_react.createIcon)({
41
+ viewBox: "0 0 24 24",
42
+ defaultProps: {
43
+ fill: "none",
44
+ stroke: "currentColor",
45
+ strokeWidth: "2",
46
+ strokeLinecap: "round",
47
+ strokeLinejoin: "round"
48
+ },
49
+ ...props
50
+ });
51
+ };
52
+
53
+ // src/components/icons/icons.tsx
31
54
  var import_jsx_runtime = require("react/jsx-runtime");
32
- var toast = (0, import_react.createToaster)({
55
+ var ChevronUpIcon = createIcon({
56
+ displayName: "ChevronUpIcon",
57
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "18 15 12 9 6 15" })
58
+ });
59
+ var ChevronDownIcon = createIcon({
60
+ displayName: "ChevronDownIcon",
61
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "6 9 12 15 18 9" })
62
+ });
63
+ var ChevronLeftIcon = createIcon({
64
+ displayName: "ChevronLeftIcon",
65
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "15 18 9 12 15 6" })
66
+ });
67
+ var ChevronRightIcon = createIcon({
68
+ displayName: "ChevronRightIcon",
69
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "9 18 15 12 9 6" })
70
+ });
71
+ var HamburgerIcon = createIcon({
72
+ displayName: "ChevronDownIcon",
73
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "none", children: [
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "12", x2: "21", y2: "12" }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "6", x2: "21", y2: "6" }),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "18", x2: "21", y2: "18" })
77
+ ] })
78
+ });
79
+ var CloseIcon = createIcon({
80
+ displayName: "CloseIcon",
81
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
84
+ ] })
85
+ });
86
+ var FilterIcon = createIcon({
87
+ displayName: "FilterIcon",
88
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" })
89
+ });
90
+ var CalendarIcon = createIcon({
91
+ displayName: "CalendarIcon",
92
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
93
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
94
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
95
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
97
+ ] })
98
+ });
99
+ var PlusIcon = createIcon({
100
+ displayName: "PlusIcon",
101
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
102
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
103
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
104
+ ] })
105
+ });
106
+ var MinusIcon = createIcon({
107
+ displayName: "MinusIcon",
108
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) })
109
+ });
110
+ var ViewOffIcon = createIcon({
111
+ displayName: "ViewOffIcon",
112
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
113
+ /* @__PURE__ */ (0, import_jsx_runtime.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" }),
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
115
+ ] })
116
+ });
117
+ var ViewIcon = createIcon({
118
+ displayName: "ViewOffIcon",
119
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
120
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
121
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "3" })
122
+ ] })
123
+ });
124
+ var SearchIcon = createIcon({
125
+ displayName: "SearchIcon",
126
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
127
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "8" }),
128
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
129
+ ] })
130
+ });
131
+ var CheckIcon = createIcon({
132
+ displayName: "CheckIcon",
133
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("g", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("polyline", { points: "20 6 9 17 4 12" }) })
134
+ });
135
+ var EllipsisIcon = createIcon({
136
+ displayName: "EllipsisIcon",
137
+ path: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { children: [
138
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "1" }),
139
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "19", cy: "12", r: "1" }),
140
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "5", cy: "12", r: "1" })
141
+ ] })
142
+ });
143
+
144
+ // src/components/close-button/close-button.tsx
145
+ var import_jsx_runtime2 = require("react/jsx-runtime");
146
+ var CloseButton = (0, import_react2.forwardRef)(
147
+ function CloseButton2(props, ref) {
148
+ var _a;
149
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react3.IconButton, { variant: "ghost", "aria-label": "Close", ref, ...props, children: (_a = props.children) != null ? _a : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CloseIcon, {}) });
150
+ }
151
+ );
152
+
153
+ // src/components/toaster/toaster.tsx
154
+ var import_jsx_runtime3 = require("react/jsx-runtime");
155
+ var defaultOptions = {
33
156
  placement: "bottom-end",
34
157
  pauseOnPageIdle: true
35
- });
36
- var Toaster = () => {
37
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Toaster, { toaster: toast, insetInline: { mdDown: "4" }, children: (toast2) => {
158
+ };
159
+ var toast = (0, import_react5.createToaster)(defaultOptions);
160
+ var Toaster = (props) => {
161
+ const { closable: defaultClosable = true, ...options } = props || {};
162
+ const toaster = (0, import_react4.useMemo)(() => {
163
+ toast = (0, import_react5.createToaster)({
164
+ ...defaultOptions,
165
+ ...options
166
+ });
167
+ return toast;
168
+ }, [options]);
169
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast2) => {
38
170
  var _a;
39
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Toast.Root, { width: { md: "sm" }, children: [
40
- toast2.type === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Spinner, { size: "sm", color: "colorPalette.solid" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Toast.Indicator, {}),
41
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: [
42
- toast2.title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Toast.Title, { children: toast2.title }),
43
- toast2.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Toast.Description, { children: toast2.description })
171
+ const closable = ((_a = toast2.meta) == null ? void 0 : _a.closable) === false ? false : defaultClosable && toast2.type !== "loading";
172
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(ToastRoot, { children: [
173
+ toast2.type === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Spinner, { size: "sm", color: "colorPalette.solid", mt: "0.5" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Toast.Indicator, {}),
174
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react5.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: [
175
+ toast2.title && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Toast.Title, { children: toast2.title }),
176
+ toast2.description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Toast.Description, { children: toast2.description }),
177
+ toast2.action && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Toast.ActionTrigger, { children: toast2.action.label })
44
178
  ] }),
45
- toast2.action && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Toast.ActionTrigger, { children: toast2.action.label }),
46
- ((_a = toast2.meta) == null ? void 0 : _a.closable) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Toast.CloseTrigger, {})
179
+ closable !== false && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react5.Toast.CloseTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CloseButton, { size: "xs" }) })
47
180
  ] });
48
181
  } }) });
49
182
  };
183
+ function ToastRoot(props) {
184
+ const [rect, setRect] = (0, import_react4.useState)();
185
+ const rectCallbackRef = (0, import_react4.useCallback)((el) => {
186
+ setRect(el == null ? void 0 : el.getBoundingClientRect());
187
+ }, []);
188
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
189
+ import_react5.Toast.Root,
190
+ {
191
+ ref: rectCallbackRef,
192
+ width: { md: "sm" },
193
+ css: {
194
+ "--toast-height": `${rect == null ? void 0 : rect.height}px`
195
+ },
196
+ children: props.children
197
+ }
198
+ );
199
+ }
50
200
  // Annotate the CommonJS export names for ESM import in node:
51
201
  0 && (module.exports = {
52
202
  Toaster,
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CreateToasterReturn } from '@chakra-ui/react';
2
+ import * as _ark_ui_react from '@ark-ui/react';
3
+ import { CreateToasterProps } from '@chakra-ui/react';
3
4
 
4
- declare const toast: CreateToasterReturn;
5
- interface ToasterProps extends CreateToasterReturn {
6
- children: React.ReactNode;
5
+ declare let toast: _ark_ui_react.CreateToasterReturn;
6
+ interface ToasterProps extends Partial<CreateToasterProps> {
7
+ closable?: boolean;
7
8
  }
8
- declare const Toaster: () => react_jsx_runtime.JSX.Element;
9
+ declare const Toaster: (props?: ToasterProps) => react_jsx_runtime.JSX.Element;
9
10
 
10
11
  export { Toaster, type ToasterProps, toast };
@@ -1,10 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CreateToasterReturn } from '@chakra-ui/react';
2
+ import * as _ark_ui_react from '@ark-ui/react';
3
+ import { CreateToasterProps } from '@chakra-ui/react';
3
4
 
4
- declare const toast: CreateToasterReturn;
5
- interface ToasterProps extends CreateToasterReturn {
6
- children: React.ReactNode;
5
+ declare let toast: _ark_ui_react.CreateToasterReturn;
6
+ interface ToasterProps extends Partial<CreateToasterProps> {
7
+ closable?: boolean;
7
8
  }
8
- declare const Toaster: () => react_jsx_runtime.JSX.Element;
9
+ declare const Toaster: (props?: ToasterProps) => react_jsx_runtime.JSX.Element;
9
10
 
10
11
  export { Toaster, type ToasterProps, toast };
@@ -2,7 +2,9 @@
2
2
  import {
3
3
  Toaster,
4
4
  toast
5
- } from "../../chunk-HELHPHIQ.js";
5
+ } from "../../chunk-RLIAFHVM.js";
6
+ import "../../chunk-YXGJOOMM.js";
7
+ import "../../chunk-4TPVIHNO.js";
6
8
  import "../../chunk-RTMS5TJN.js";
7
9
  export {
8
10
  Toaster,