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

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 (84) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/chunk-2EUACKRH.js +26 -0
  3. package/dist/chunk-3Z2C27LI.js +51 -0
  4. package/dist/chunk-4TR3AOMG.js +33 -0
  5. package/dist/chunk-6LOMIKR5.js +69 -0
  6. package/dist/chunk-6ZNR6N2K.js +45 -0
  7. package/dist/chunk-7C3IZBNJ.js +38 -0
  8. package/dist/chunk-BCNPBZZK.js +45 -0
  9. package/dist/{chunk-KHRLZUV4.js → chunk-BFA5FCA2.js} +16 -1
  10. package/dist/chunk-CTOVNZVS.js +1 -0
  11. package/dist/chunk-DPMEXCSG.js +137 -0
  12. package/dist/chunk-F3CVOMG5.js +160 -0
  13. package/dist/chunk-FJFNGSPL.js +23 -0
  14. package/dist/chunk-GEPWRHHH.js +65 -0
  15. package/dist/chunk-HELHPHIQ.js +35 -0
  16. package/dist/chunk-I2RXEKTB.js +38 -0
  17. package/dist/chunk-L356FPLY.js +20 -0
  18. package/dist/chunk-LIYUBUOP.js +119 -0
  19. package/dist/chunk-M7FOBCOV.js +184 -0
  20. package/dist/chunk-NSD5HRIP.js +46 -0
  21. package/dist/chunk-QMG6HP7Z.js +87 -0
  22. package/dist/chunk-QSNSWCTM.js +32 -0
  23. package/dist/chunk-S3CQW7GD.js +100 -0
  24. package/dist/chunk-SA3OGTOO.js +23 -0
  25. package/dist/chunk-UCQ3LZIE.js +43 -0
  26. package/dist/chunk-ULAJ3JEO.js +32 -0
  27. package/dist/chunk-VF3BV2BY.js +87 -0
  28. package/dist/chunk-WYLMBMAH.js +22 -0
  29. package/dist/chunk-YWJZWB6I.js +1892 -0
  30. package/dist/chunk-ZWSZQZ5G.js +73 -0
  31. package/dist/components/app-shell/index.js +3 -40
  32. package/dist/components/avatar/index.cjs +69 -0
  33. package/dist/components/avatar/index.d.cts +18 -0
  34. package/dist/components/avatar/index.d.ts +18 -0
  35. package/dist/components/avatar/index.js +10 -0
  36. package/dist/components/breadcrumbs/index.js +3 -32
  37. package/dist/components/button/index.js +3 -40
  38. package/dist/components/checkbox/index.js +3 -15
  39. package/dist/components/command/index.js +3 -28
  40. package/dist/components/dialog/index.js +5 -67
  41. package/dist/components/drawer/index.d.cts +2 -2
  42. package/dist/components/drawer/index.d.ts +2 -2
  43. package/dist/components/drawer/index.js +5 -59
  44. package/dist/components/empty-state/index.js +3 -18
  45. package/dist/components/grid-list/index.js +3 -40
  46. package/dist/components/icon-badge/index.js +3 -33
  47. package/dist/components/link/index.js +2 -14
  48. package/dist/components/loading-overlay/index.js +5 -1885
  49. package/dist/components/menu/index.cjs +263 -0
  50. package/dist/components/menu/index.d.cts +30 -0
  51. package/dist/components/menu/index.d.ts +30 -0
  52. package/dist/components/menu/index.js +9 -0
  53. package/dist/components/navbar/index.d.cts +4 -4
  54. package/dist/components/navbar/index.d.ts +4 -4
  55. package/dist/components/navbar/index.js +3 -45
  56. package/dist/components/number-input/index.js +3 -26
  57. package/dist/components/password-input/index.js +4 -225
  58. package/dist/components/persona/index.js +6 -178
  59. package/dist/components/pin-input/index.js +3 -21
  60. package/dist/components/radio/index.js +4 -16
  61. package/dist/components/search-input/index.js +4 -114
  62. package/dist/components/segmented-control/index.cjs +2 -0
  63. package/dist/components/segmented-control/index.d.cts +2 -0
  64. package/dist/components/segmented-control/index.d.ts +2 -0
  65. package/dist/components/segmented-control/index.js +2 -0
  66. package/dist/components/select/index.js +4 -94
  67. package/dist/components/sidebar/index.d.cts +11 -11
  68. package/dist/components/sidebar/index.d.ts +11 -11
  69. package/dist/components/sidebar/index.js +7 -129
  70. package/dist/components/steps/index.js +5 -64
  71. package/dist/components/switch/index.js +3 -18
  72. package/dist/components/toaster/index.cjs +54 -0
  73. package/dist/components/toaster/index.d.cts +10 -0
  74. package/dist/components/toaster/index.d.ts +10 -0
  75. package/dist/components/toaster/index.js +10 -0
  76. package/dist/components/tooltip/index.cjs +57 -0
  77. package/dist/components/tooltip/index.d.cts +14 -0
  78. package/dist/components/tooltip/index.d.ts +14 -0
  79. package/dist/components/tooltip/index.js +8 -0
  80. package/dist/index.cjs +3707 -8
  81. package/dist/index.d.cts +37 -2
  82. package/dist/index.d.ts +37 -2
  83. package/dist/index.js +285 -4
  84. package/package.json +4 -4
@@ -0,0 +1,100 @@
1
+ 'use client'
2
+ import {
3
+ CloseButton
4
+ } from "./chunk-FZW2DYK3.js";
5
+ import {
6
+ __export
7
+ } from "./chunk-RTMS5TJN.js";
8
+
9
+ // src/components/select/namespace.ts
10
+ var namespace_exports = {};
11
+ __export(namespace_exports, {
12
+ Content: () => SelectContent,
13
+ Item: () => SelectItem,
14
+ ItemGroup: () => SelectItemGroup,
15
+ ItemText: () => SelectItemText,
16
+ Label: () => SelectLabel,
17
+ Root: () => SelectRoot,
18
+ Trigger: () => SelectTrigger,
19
+ ValueText: () => SelectValueText
20
+ });
21
+
22
+ // src/components/select/select.tsx
23
+ import { forwardRef } from "react";
24
+ import { Portal, Select as SelectPrimitive } from "@chakra-ui/react";
25
+ import { jsx, jsxs } from "react/jsx-runtime";
26
+ var SelectTrigger = forwardRef(
27
+ function SelectTrigger2(props, ref) {
28
+ const { children, clearable, ...rest } = props;
29
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Control, { ...rest, children: [
30
+ /* @__PURE__ */ jsx(SelectPrimitive.Trigger, { ref, children }),
31
+ /* @__PURE__ */ jsxs(SelectPrimitive.IndicatorGroup, { children: [
32
+ clearable && /* @__PURE__ */ jsx(SelectClearTrigger, {}),
33
+ /* @__PURE__ */ jsx(SelectPrimitive.Indicator, {})
34
+ ] })
35
+ ] });
36
+ }
37
+ );
38
+ var SelectClearTrigger = forwardRef(function SelectClearTrigger2(props, ref) {
39
+ return /* @__PURE__ */ jsx(SelectPrimitive.ClearTrigger, { asChild: true, ...props, ref, children: /* @__PURE__ */ jsx(
40
+ CloseButton,
41
+ {
42
+ size: "xs",
43
+ variant: "plain",
44
+ focusVisibleRing: "inside",
45
+ focusRingWidth: "2px",
46
+ pointerEvents: "auto"
47
+ }
48
+ ) });
49
+ });
50
+ var SelectContent = forwardRef(
51
+ function SelectContent2(props, ref) {
52
+ const { portalled = true, portalRef, ...rest } = props;
53
+ return /* @__PURE__ */ jsx(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx(SelectPrimitive.Positioner, { children: /* @__PURE__ */ jsx(SelectPrimitive.Content, { ...rest, ref }) }) });
54
+ }
55
+ );
56
+ var SelectItem = forwardRef(
57
+ function SelectItem2(props, ref) {
58
+ const { item, children, ...rest } = props;
59
+ return /* @__PURE__ */ jsxs(SelectPrimitive.Item, { item, ...rest, ref, children: [
60
+ children,
61
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, {})
62
+ ] }, item.value);
63
+ }
64
+ );
65
+ var SelectValueText = forwardRef(function SelectValueText2(props, ref) {
66
+ const { children, ...rest } = props;
67
+ return /* @__PURE__ */ jsx(SelectPrimitive.ValueText, { ...rest, ref, children: /* @__PURE__ */ jsx(SelectPrimitive.Context, { children: (select) => {
68
+ const items = select.selectedItems;
69
+ if (items.length === 0) return props.placeholder;
70
+ if (children) return children(items);
71
+ if (items.length === 1)
72
+ return select.collection.stringifyItem(items[0]);
73
+ return `${items.length} selected`;
74
+ } }) });
75
+ });
76
+ var SelectRoot = forwardRef(function SelectRoot2(props, ref) {
77
+ return /* @__PURE__ */ jsx(
78
+ SelectPrimitive.Root,
79
+ {
80
+ ...props,
81
+ ref,
82
+ positioning: { sameWidth: true, ...props.positioning }
83
+ }
84
+ );
85
+ });
86
+ var SelectItemGroup = forwardRef(
87
+ function SelectItemGroup2(props, ref) {
88
+ const { children, label, ...rest } = props;
89
+ return /* @__PURE__ */ jsxs(SelectPrimitive.ItemGroup, { ...rest, ref, children: [
90
+ /* @__PURE__ */ jsx(SelectPrimitive.ItemGroupLabel, { children: label }),
91
+ children
92
+ ] });
93
+ }
94
+ );
95
+ var SelectLabel = SelectPrimitive.Label;
96
+ var SelectItemText = SelectPrimitive.ItemText;
97
+
98
+ export {
99
+ namespace_exports
100
+ };
@@ -0,0 +1,23 @@
1
+ 'use client'
2
+
3
+ // src/components/switch/switch.tsx
4
+ import { Switch as ChakraSwitch } from "@chakra-ui/react";
5
+ import { forwardRef } from "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var Switch = forwardRef(
8
+ function Switch2(props, ref) {
9
+ const { inputProps, children, rootRef, trackLabel, thumbLabel, ...rest } = props;
10
+ return /* @__PURE__ */ jsxs(ChakraSwitch.Root, { ref: rootRef, ...rest, children: [
11
+ /* @__PURE__ */ jsx(ChakraSwitch.HiddenInput, { ref, ...inputProps }),
12
+ /* @__PURE__ */ jsxs(ChakraSwitch.Control, { children: [
13
+ /* @__PURE__ */ jsx(ChakraSwitch.Thumb, { children: thumbLabel && /* @__PURE__ */ jsx(ChakraSwitch.ThumbIndicator, { fallback: thumbLabel == null ? void 0 : thumbLabel.off, children: thumbLabel == null ? void 0 : thumbLabel.on }) }),
14
+ trackLabel && /* @__PURE__ */ jsx(ChakraSwitch.Indicator, { fallback: trackLabel.off, children: trackLabel.on })
15
+ ] }),
16
+ children != null && /* @__PURE__ */ jsx(ChakraSwitch.Label, { children })
17
+ ] });
18
+ }
19
+ );
20
+
21
+ export {
22
+ Switch
23
+ };
@@ -0,0 +1,43 @@
1
+ 'use client'
2
+
3
+ // src/components/avatar/avatar.tsx
4
+ import { forwardRef } from "react";
5
+ import { Avatar as ChakraAvatar, Group } from "@chakra-ui/react";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ var Avatar = forwardRef(
8
+ function Avatar2(props, ref) {
9
+ const { name, src, srcSet, loading, icon, fallback, children, ...rest } = props;
10
+ return /* @__PURE__ */ jsxs(ChakraAvatar.Root, { ref, ...rest, children: [
11
+ /* @__PURE__ */ jsx(AvatarFallback, { name, icon, children: fallback }),
12
+ /* @__PURE__ */ jsx(ChakraAvatar.Image, { src, srcSet, loading }),
13
+ children
14
+ ] });
15
+ }
16
+ );
17
+ var AvatarFallback = forwardRef(
18
+ function AvatarFallback2(props, ref) {
19
+ const { name, icon, children, ...rest } = props;
20
+ return /* @__PURE__ */ jsxs(ChakraAvatar.Fallback, { ref, ...rest, children: [
21
+ children,
22
+ name != null && children == null && /* @__PURE__ */ jsx(Fragment, { children: getInitials(name) }),
23
+ name == null && children == null && /* @__PURE__ */ jsx(ChakraAvatar.Icon, { asChild: !!icon, children: icon })
24
+ ] });
25
+ }
26
+ );
27
+ function getInitials(name) {
28
+ const names = name.trim().split(" ");
29
+ const firstName = names[0] != null ? names[0] : "";
30
+ const lastName = names.length > 1 ? names[names.length - 1] : "";
31
+ return firstName && lastName ? `${firstName.charAt(0)}${lastName.charAt(0)}` : firstName.charAt(0);
32
+ }
33
+ var AvatarGroup = forwardRef(
34
+ function AvatarGroup2(props, ref) {
35
+ const { size, variant, borderless, ...rest } = props;
36
+ return /* @__PURE__ */ jsx(ChakraAvatar.PropsProvider, { value: { size, variant, borderless }, children: /* @__PURE__ */ jsx(Group, { gap: "0", spaceX: "-3", ref, ...rest }) });
37
+ }
38
+ );
39
+
40
+ export {
41
+ Avatar,
42
+ AvatarGroup
43
+ };
@@ -0,0 +1,32 @@
1
+ 'use client'
2
+ import {
3
+ InputGroup
4
+ } from "./chunk-PKI6YH2V.js";
5
+
6
+ // src/components/number-input/number-input.tsx
7
+ import { forwardRef } from "react";
8
+ import { NumberInput as ChakraNumberInput } from "@chakra-ui/react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ var NumberInput = forwardRef(
11
+ function NumberInput2(props, ref) {
12
+ const {
13
+ hideControls,
14
+ startElement,
15
+ endElement,
16
+ inputProps,
17
+ rootRef,
18
+ ...rest
19
+ } = props;
20
+ return /* @__PURE__ */ jsxs(ChakraNumberInput.Root, { ref: rootRef, ...rest, children: [
21
+ /* @__PURE__ */ jsx(InputGroup, { startElement, endElement, children: /* @__PURE__ */ jsx(ChakraNumberInput.Input, { ref, ...inputProps }) }),
22
+ !hideControls && !endElement ? /* @__PURE__ */ jsxs(ChakraNumberInput.Control, { children: [
23
+ /* @__PURE__ */ jsx(ChakraNumberInput.IncrementTrigger, {}),
24
+ /* @__PURE__ */ jsx(ChakraNumberInput.DecrementTrigger, {})
25
+ ] }) : null
26
+ ] });
27
+ }
28
+ );
29
+
30
+ export {
31
+ NumberInput
32
+ };
@@ -0,0 +1,87 @@
1
+ 'use client'
2
+ import {
3
+ LuCheck,
4
+ LuChevronRight
5
+ } from "./chunk-F3CVOMG5.js";
6
+ import {
7
+ __export
8
+ } from "./chunk-RTMS5TJN.js";
9
+
10
+ // src/components/menu/menu.tsx
11
+ var menu_exports = {};
12
+ __export(menu_exports, {
13
+ Arrow: () => MenuArrow,
14
+ CheckboxItem: () => MenuCheckboxItem,
15
+ Content: () => MenuContent,
16
+ ContextTrigger: () => MenuContextTrigger,
17
+ Item: () => MenuItem,
18
+ ItemCommand: () => MenuItemCommand,
19
+ ItemGroup: () => MenuItemGroup,
20
+ ItemText: () => MenuItemText,
21
+ RadioItem: () => MenuRadioItem,
22
+ RadioItemGroup: () => MenuRadioItemGroup,
23
+ Root: () => MenuRoot,
24
+ Separator: () => MenuSeparator,
25
+ Trigger: () => MenuTrigger,
26
+ TriggerItem: () => MenuTriggerItem
27
+ });
28
+ import { forwardRef } from "react";
29
+ import { AbsoluteCenter, Menu as ChakraMenu, Portal } from "@chakra-ui/react";
30
+ import { jsx, jsxs } from "react/jsx-runtime";
31
+ var MenuContent = forwardRef(
32
+ function MenuContent2(props, ref) {
33
+ const { portalled = true, portalRef, ...rest } = props;
34
+ return /* @__PURE__ */ jsx(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx(ChakraMenu.Positioner, { children: /* @__PURE__ */ jsx(ChakraMenu.Content, { ref, ...rest }) }) });
35
+ }
36
+ );
37
+ var MenuArrow = forwardRef(
38
+ function MenuArrow2(props, ref) {
39
+ return /* @__PURE__ */ jsx(ChakraMenu.Arrow, { ref, ...props, children: /* @__PURE__ */ jsx(ChakraMenu.ArrowTip, {}) });
40
+ }
41
+ );
42
+ var MenuCheckboxItem = forwardRef(function MenuCheckboxItem2(props, ref) {
43
+ return /* @__PURE__ */ jsxs(ChakraMenu.CheckboxItem, { ref, ...props, children: [
44
+ /* @__PURE__ */ jsx(ChakraMenu.ItemIndicator, { hidden: false, children: /* @__PURE__ */ jsx(LuCheck, {}) }),
45
+ props.children
46
+ ] });
47
+ });
48
+ var MenuRadioItem = forwardRef(
49
+ function MenuRadioItem2(props, ref) {
50
+ const { children, ...rest } = props;
51
+ return /* @__PURE__ */ jsxs(ChakraMenu.RadioItem, { ps: "8", ref, ...rest, children: [
52
+ /* @__PURE__ */ jsx(AbsoluteCenter, { axis: "horizontal", left: "4", asChild: true, children: /* @__PURE__ */ jsx(ChakraMenu.ItemIndicator, { children: /* @__PURE__ */ jsx(LuCheck, {}) }) }),
53
+ /* @__PURE__ */ jsx(ChakraMenu.ItemText, { children })
54
+ ] });
55
+ }
56
+ );
57
+ var MenuItemGroup = forwardRef(
58
+ function MenuItemGroup2(props, ref) {
59
+ const { title, children, ...rest } = props;
60
+ return /* @__PURE__ */ jsxs(ChakraMenu.ItemGroup, { ref, ...rest, children: [
61
+ title && /* @__PURE__ */ jsx(ChakraMenu.ItemGroupLabel, { userSelect: "none", children: title }),
62
+ children
63
+ ] });
64
+ }
65
+ );
66
+ var MenuTriggerItem = forwardRef(
67
+ function MenuTriggerItem2(props, ref) {
68
+ const { startIcon, children, ...rest } = props;
69
+ return /* @__PURE__ */ jsxs(ChakraMenu.TriggerItem, { ref, ...rest, children: [
70
+ startIcon,
71
+ children,
72
+ /* @__PURE__ */ jsx(LuChevronRight, {})
73
+ ] });
74
+ }
75
+ );
76
+ var MenuRadioItemGroup = ChakraMenu.RadioItemGroup;
77
+ var MenuContextTrigger = ChakraMenu.ContextTrigger;
78
+ var MenuRoot = ChakraMenu.Root;
79
+ var MenuSeparator = ChakraMenu.Separator;
80
+ var MenuItem = ChakraMenu.Item;
81
+ var MenuItemText = ChakraMenu.ItemText;
82
+ var MenuItemCommand = ChakraMenu.ItemCommand;
83
+ var MenuTrigger = ChakraMenu.Trigger;
84
+
85
+ export {
86
+ menu_exports
87
+ };
@@ -0,0 +1,22 @@
1
+ 'use client'
2
+
3
+ // src/components/radio/radio.tsx
4
+ import { forwardRef } from "react";
5
+ import { RadioGroup as ChakraRadioGroup } from "@chakra-ui/react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ var Radio = forwardRef(
8
+ function Radio2(props, ref) {
9
+ const { children, inputProps, rootRef, ...rest } = props;
10
+ return /* @__PURE__ */ jsxs(ChakraRadioGroup.Item, { ref: rootRef, ...rest, children: [
11
+ /* @__PURE__ */ jsx(ChakraRadioGroup.ItemHiddenInput, { ref, ...inputProps }),
12
+ /* @__PURE__ */ jsx(ChakraRadioGroup.ItemIndicator, {}),
13
+ children && /* @__PURE__ */ jsx(ChakraRadioGroup.ItemText, { children })
14
+ ] });
15
+ }
16
+ );
17
+ var RadioGroup = ChakraRadioGroup.Root;
18
+
19
+ export {
20
+ Radio,
21
+ RadioGroup
22
+ };