linkedunion-design-kit 1.9.2 → 1.9.3

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 (141) hide show
  1. package/dist/app/layout.jsx +13 -0
  2. package/dist/app/page.jsx +25 -0
  3. package/dist/build/types/app/layout.d.ts +12 -0
  4. package/dist/build/types/app/layout.js +22 -0
  5. package/dist/build/types/app/page.d.ts +12 -0
  6. package/dist/build/types/app/page.js +22 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.js +3 -0
  9. package/dist/src/components/Accordion/Accordion.stories.jsx +33 -0
  10. package/dist/src/components/Accordion/accordion.jsx +59 -0
  11. package/dist/src/components/Alerts/Alert/alert.jsx +152 -0
  12. package/dist/src/components/Alerts/Alert/alert.stories.jsx +344 -0
  13. package/dist/src/components/Alerts/AlertDialog/alert-dialog.jsx +170 -0
  14. package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.jsx +552 -0
  15. package/dist/src/components/AppIcons/AndroidIcon.jsx +24 -0
  16. package/dist/src/components/AppIcons/AppIcon.jsx +29 -0
  17. package/dist/src/components/AppIcons/AppIcon.stories.jsx +223 -0
  18. package/dist/src/components/AppIcons/AppleIcon.jsx +31 -0
  19. package/dist/src/components/AppIcons/PlayStoreIcon.jsx +29 -0
  20. package/dist/src/components/Avatar/Avatar/Avatar.jsx +45 -0
  21. package/dist/src/components/Avatar/Avatar/Avatar.stories.jsx +95 -0
  22. package/dist/src/components/Avatar/Avatar/Avatar.test.jsx +9 -0
  23. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.jsx +17 -0
  24. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.jsx +32 -0
  25. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.jsx +20 -0
  26. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.jsx +50 -0
  27. package/dist/src/components/Badge/Badge.jsx +54 -0
  28. package/dist/src/components/Badge/Badge.stories.jsx +201 -0
  29. package/dist/src/components/Button/Button/Button.d.ts +7 -6
  30. package/dist/src/components/Button/Button/Button.js +32 -9
  31. package/dist/src/components/Button/Button/Button.jsx +101 -0
  32. package/dist/src/components/Button/Button/Button.stories.jsx +283 -0
  33. package/dist/src/components/Button/Button/Button.test.jsx +73 -0
  34. package/dist/src/components/Button/IconButton/IconButton.jsx +63 -0
  35. package/dist/src/components/Button/IconButton/IconButton.stories.jsx +128 -0
  36. package/dist/src/components/Button/IconButton/IconButton.test.jsx +28 -0
  37. package/dist/src/components/Button/index.js +1 -1
  38. package/dist/src/components/Card/MultipleNews/MultiNews.jsx +80 -0
  39. package/dist/src/components/Card/MultipleNews/MultiNews.stories.jsx +104 -0
  40. package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +60 -0
  41. package/dist/src/components/Card/PostByCategory/PostByCategory.stories.jsx +106 -0
  42. package/dist/src/components/Card/SinglePost/SinglePost.jsx +26 -0
  43. package/dist/src/components/Card/SinglePost/SinglePost.stories.jsx +68 -0
  44. package/dist/src/components/Card/card.jsx +36 -0
  45. package/dist/src/components/Card/contactProfile/ContactProfile.jsx +60 -0
  46. package/dist/src/components/Card/contactProfile/ContactProfile.stories.jsx +103 -0
  47. package/dist/src/components/Card/photoAlbum/PhotoAlbum.jsx +41 -0
  48. package/dist/src/components/Card/photoAlbum/PhotoAlbum.stories.jsx +69 -0
  49. package/dist/src/components/Card/photoGallery/PhotoGallery.jsx +17 -0
  50. package/dist/src/components/Card/photoGallery/PhotoGallery.stories.jsx +39 -0
  51. package/dist/src/components/Checkbox/checkbox.jsx +47 -0
  52. package/dist/src/components/Checkbox/checkbox.stories.jsx +113 -0
  53. package/dist/src/components/ColorPicker/ColorPicker.jsx +67 -0
  54. package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +138 -0
  55. package/dist/src/components/Colors/color.jsx +5 -0
  56. package/dist/src/components/Colors/color.stories.jsx +20 -0
  57. package/dist/src/components/Colors/color.test.jsx +23 -0
  58. package/dist/src/components/Dropdown/Combobox/Combobox.jsx +198 -0
  59. package/dist/src/components/Dropdown/Combobox/Combobox.stories.jsx +289 -0
  60. package/dist/src/components/Dropdown/Combobox/utils/renderBadge.jsx +7 -0
  61. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.jsx +102 -0
  62. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.jsx +464 -0
  63. package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.jsx +19 -0
  64. package/dist/src/components/Dropdown/Select.stories.jsx +201 -0
  65. package/dist/src/components/Dropdown/select.jsx +93 -0
  66. package/dist/src/components/Icons/LUIcon.jsx +41 -0
  67. package/dist/src/components/Icons/LUIcon.test.jsx +308 -0
  68. package/dist/src/components/Icons/stories/IconDropdown.jsx +67 -0
  69. package/dist/src/components/Icons/stories/IconGallery.jsx +77 -0
  70. package/dist/src/components/Icons/stories/InteractiveIconSelector.jsx +86 -0
  71. package/dist/src/components/Icons/stories/LUIcon.stories.jsx +108 -0
  72. package/dist/src/components/ImageUploader/ImageUploader.stories.jsx +50 -0
  73. package/dist/src/components/ImageUploader/imageUploader.jsx +94 -0
  74. package/dist/src/components/Images/LuImage.jsx +19 -0
  75. package/dist/src/components/Images/LuImage.stories.jsx +154 -0
  76. package/dist/src/components/Images/LuImage.test.jsx +44 -0
  77. package/dist/src/components/Input/Input.stories.jsx +250 -0
  78. package/dist/src/components/Input/input.jsx +110 -0
  79. package/dist/src/components/Label/Label.jsx +32 -0
  80. package/dist/src/components/Label/Label.stories.jsx +30 -0
  81. package/dist/src/components/Pagination/pagination.d.ts +33 -0
  82. package/dist/src/components/Pagination/pagination.js +68 -0
  83. package/dist/src/components/Pagination/pagination.jsx +68 -0
  84. package/dist/src/components/Pagination/pagination.stories.d.ts +74 -0
  85. package/dist/src/components/Pagination/pagination.stories.js +168 -0
  86. package/dist/src/components/Pagination/pagination.stories.jsx +114 -0
  87. package/dist/src/components/RadioGroup/RadioGroup.stories.jsx +146 -0
  88. package/dist/src/components/RadioGroup/radio-group.jsx +49 -0
  89. package/dist/src/components/Skeleton/skeleton.d.ts +117 -0
  90. package/dist/src/components/Skeleton/skeleton.js +140 -0
  91. package/dist/src/components/Skeleton/skeleton.stories.d.ts +153 -0
  92. package/dist/src/components/Skeleton/skeleton.stories.js +404 -0
  93. package/dist/src/components/Slider/Slider.stories.jsx +159 -0
  94. package/dist/src/components/Slider/slider.jsx +31 -0
  95. package/dist/src/components/SweetAlert/SweetAlert.jsx +147 -0
  96. package/dist/src/components/SweetAlert/SweetAlert.stories.jsx +505 -0
  97. package/dist/src/components/Switch/Switch.stories.jsx +66 -0
  98. package/dist/src/components/Switch/switch.jsx +61 -0
  99. package/dist/src/components/Table/Table.d.ts +26 -0
  100. package/dist/src/components/Table/Table.js +186 -0
  101. package/dist/src/components/Table/Table.jsx +221 -0
  102. package/dist/src/components/Table/Table.stories.d.ts +51 -0
  103. package/dist/src/components/Table/Table.stories.js +408 -0
  104. package/dist/src/components/Table/Table.stories.jsx +652 -0
  105. package/dist/src/components/Table/index.d.ts +20 -0
  106. package/dist/src/components/Table/index.js +20 -0
  107. package/dist/src/components/Tabs/Tabs.stories.jsx +29 -0
  108. package/dist/src/components/Tabs/tabs.jsx +32 -0
  109. package/dist/src/components/Title/Title.jsx +8 -0
  110. package/dist/src/components/Title/Title.stories.jsx +37 -0
  111. package/dist/src/components/Title/Title.test.jsx +24 -0
  112. package/dist/src/components/ToolTip/Tooltip.jsx +18 -0
  113. package/dist/src/components/ToolTip/Tooltip.stories.jsx +25 -0
  114. package/dist/src/components/Typography/Body/Body.stories.jsx +34 -0
  115. package/dist/src/components/Typography/Body/body.jsx +52 -0
  116. package/dist/src/components/Typography/Caption/Caption.stories.jsx +24 -0
  117. package/dist/src/components/Typography/Caption/caption.jsx +25 -0
  118. package/dist/src/components/Typography/Display/Display.stories.jsx +24 -0
  119. package/dist/src/components/Typography/Display/display.jsx +39 -0
  120. package/dist/src/components/Typography/Heading/Heading.stories.jsx +37 -0
  121. package/dist/src/components/Typography/Heading/heading.jsx +53 -0
  122. package/dist/src/components/ui/avatar.d.ts +3 -10
  123. package/dist/src/components/ui/avatar.js +12 -27
  124. package/dist/src/components/ui/avatar.jsx +27 -0
  125. package/dist/src/components/ui/button.d.ts +10 -0
  126. package/dist/src/components/ui/button.js +56 -0
  127. package/dist/src/components/ui/button.jsx +45 -0
  128. package/dist/src/components/ui/collapsible.d.ts +5 -0
  129. package/dist/src/components/ui/collapsible.js +5 -0
  130. package/dist/src/components/ui/collapsible.jsx +5 -0
  131. package/dist/src/components/ui/command.jsx +67 -0
  132. package/dist/src/components/ui/dialog.jsx +66 -0
  133. package/dist/src/components/ui/popover.jsx +33 -0
  134. package/dist/src/components/ui/tooltip.jsx +38 -0
  135. package/dist/src/components/ui/typography.jsx +56 -0
  136. package/dist/src/utils/iconList.d.ts +4 -0
  137. package/dist/src/utils/iconList.js +4 -0
  138. package/dist/styles/global.css +139 -0
  139. package/package.json +1 -1
  140. package/dist/src/components/Avatar/Avatar/Avatar1.stories.d.ts +0 -17
  141. package/dist/src/components/Avatar/Avatar/Avatar1.stories.js +0 -68
@@ -0,0 +1,168 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { buttonStyles } from "../Button";
3
+ import { variant } from "../Button/Button/Button";
4
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "../Dropdown/select";
5
+ import { Body } from "../Typography/Body/body";
6
+ import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./pagination";
7
+ import { useState } from "react";
8
+ var range = function (start, end) {
9
+ return Array.from({ length: end - start + 1 }, function (_, i) { return start + i; });
10
+ };
11
+ export default {
12
+ title: "Components/Pagination",
13
+ component: Pagination,
14
+ tags: ["autodocs"],
15
+ parameters: {
16
+ docs: {
17
+ description: {
18
+ component: "A component for displaying pagination controls.",
19
+ },
20
+ },
21
+ },
22
+ };
23
+ var Template = function (args) { return (_jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { size: args.size, color: args.color, variant: args.variant, href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { size: args.size, color: args.color, variant: args.variant, href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { size: args.size, color: args.color, variant: args.variant, href: "#" }) })] }) })); };
24
+ export var Default = Template.bind({});
25
+ Default.args = {};
26
+ Default.argTypes = {
27
+ size: {
28
+ control: { type: "select" },
29
+ options: Object.keys(buttonStyles.size),
30
+ description: "Size variant for Pagination",
31
+ table: {
32
+ defaultValue: { summary: "md" },
33
+ type: { summary: "enum" },
34
+ category: "Pagination",
35
+ },
36
+ },
37
+ color: {
38
+ control: { type: "select" },
39
+ options: Object.keys(buttonStyles.fillColor),
40
+ description: "Color theme for Pagination",
41
+ table: {
42
+ defaultValue: { summary: "gray" },
43
+ type: { summary: "enum" },
44
+ category: "Pagination",
45
+ },
46
+ },
47
+ variant: {
48
+ control: { type: "select" },
49
+ options: Object.keys(variant),
50
+ description: "Variant for Pagination (outline | fill | link)",
51
+ table: {
52
+ defaultValue: { summary: "ghost" },
53
+ type: { summary: "enum" },
54
+ category: "Pagination",
55
+ },
56
+ },
57
+ };
58
+ // Pagination with Ellipsis
59
+ export var WithEllipsis = function () {
60
+ var pages = [1, 2, "ellipsis", 8, 9, 10];
61
+ return (_jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { color: "red", href: "#" }) }), pages.map(function (page, idx) {
62
+ return page === "ellipsis" ? (_jsx(PaginationItem, { children: _jsx(PaginationEllipsis, { color: "red" }) }, "ellipsis-" + idx)) : (_jsx(PaginationItem, { children: _jsx(PaginationLink, { color: "red", href: "#", isActive: page === 1, children: page }) }, page));
63
+ }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { color: "red", href: "#" }) })] }) }));
64
+ };
65
+ WithEllipsis.parameters = {
66
+ docs: {
67
+ description: {
68
+ story: "Pagination example with an ellipsis to indicate skipped pages.",
69
+ },
70
+ },
71
+ };
72
+ // All Colors
73
+ export var AllColors = function () { return (_jsx("div", { className: "flex flex-col gap-6", children: Object.keys(buttonStyles.fillColor).map(function (color) { return (_jsxs("div", { children: [_jsx("div", { className: "text-xl font-medium", children: color }), _jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { color: color, href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { color: color, href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { color: color, href: "#" }) })] }) })] }, color)); }) })); };
74
+ AllColors.parameters = {
75
+ docs: {
76
+ description: {
77
+ story: "Shows Pagination in all color variants.",
78
+ },
79
+ },
80
+ };
81
+ // All Variants
82
+ export var AllVariants = function () { return (_jsx("div", { className: "flex flex-col gap-6", children: Object.keys(variant).map(function (v) { return (_jsxs("div", { children: [_jsx("div", { className: "text-xl font-medium", children: v }), _jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { variant: v, href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { variant: v, href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { variant: v, href: "#" }) })] }) })] }, v)); }) })); };
83
+ AllVariants.parameters = {
84
+ docs: {
85
+ description: {
86
+ story: "Shows Pagination in all variant styles (fill, outline, link, ghost).",
87
+ },
88
+ },
89
+ };
90
+ // All Sizes
91
+ export var AllSizes = function () { return (_jsx("div", { className: "flex flex-col gap-6", children: Object.keys(buttonStyles.size).map(function (size) { return (_jsxs("div", { children: [_jsx("div", { className: "text-xl font-medium", children: size }), _jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { size: size, href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { size: size, href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { size: size, href: "#" }) })] }) })] }, size)); }) })); };
92
+ AllSizes.parameters = {
93
+ docs: {
94
+ description: {
95
+ story: "Shows Pagination in all size variants.",
96
+ },
97
+ },
98
+ };
99
+ // Table of Pagination Stories
100
+ export var TablePagination = function () { return (_jsxs("div", { className: "flex gap-6", children: [_jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { href: "#" }) }), range(1, 5).map(function (page) { return (_jsx(PaginationItem, { children: _jsx(PaginationLink, { href: "#", isActive: page === 1, children: page }) }, page)); }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { href: "#" }) })] }) }), _jsxs("div", { className: "inline-flex items-center gap-4", children: [_jsxs(Select, { defaultValue: "10", onValueChange: function () { }, children: [_jsx(SelectTrigger, { color: "default", shape: "rectangular", size: "md", variant: "fill", defaultValue: "10", children: _jsx(SelectValue, { placeholder: "Select an option", defaultValue: "10" }) }), _jsxs(SelectContent, { defaultValue: "10", className: "w-32", children: [_jsx(SelectItem, { value: "10", children: "10" }), _jsx(SelectItem, { value: "20", children: "20" }), _jsx(SelectItem, { value: "30", children: "30" })] })] }), _jsx(Body, { variant: "body-sm", className: "text-nowrap", children: "Showing 1 - 10 of 13" })] })] })); };
101
+ TablePagination.parameters = {
102
+ docs: {
103
+ description: {
104
+ story: "Shows Pagination in all size variants.",
105
+ },
106
+ },
107
+ };
108
+ // Material-UI Style Pagination
109
+ export var MultiPagination = function () {
110
+ var _a = useState(1), selectedPage = _a[0], setSelectedPage = _a[1];
111
+ var totalPages = 10;
112
+ var siblingCount = 1; // Number of pages to show on each side of the current page
113
+ var boundaryCount = 1; // Always show first and last page
114
+ // Helper to generate the pagination range
115
+ function getPaginationRange() {
116
+ var range = [];
117
+ var leftSibling = Math.max(selectedPage - siblingCount, boundaryCount + 2);
118
+ var rightSibling = Math.min(selectedPage + siblingCount, totalPages - boundaryCount - 1);
119
+ // Show all pages if total is small
120
+ if (totalPages <= 7) {
121
+ for (var i = 1; i <= totalPages; i++)
122
+ range.push(i);
123
+ return range;
124
+ }
125
+ // Always show first N pages
126
+ for (var i = 1; i <= boundaryCount; i++) {
127
+ range.push(i);
128
+ }
129
+ // Show left ellipsis if needed
130
+ if (leftSibling > boundaryCount + 2) {
131
+ range.push("ellipsis");
132
+ }
133
+ else {
134
+ for (var i = boundaryCount + 1; i < leftSibling; i++) {
135
+ range.push(i);
136
+ }
137
+ }
138
+ // Show middle pages
139
+ for (var i = leftSibling; i <= rightSibling; i++) {
140
+ range.push(i);
141
+ }
142
+ // Show right ellipsis if needed
143
+ if (rightSibling < totalPages - boundaryCount - 1) {
144
+ range.push("ellipsis");
145
+ }
146
+ else {
147
+ for (var i = rightSibling + 1; i < totalPages - boundaryCount + 1; i++) {
148
+ range.push(i);
149
+ }
150
+ }
151
+ // Always show last N pages
152
+ for (var i = totalPages - boundaryCount + 1; i <= totalPages; i++) {
153
+ range.push(i);
154
+ }
155
+ return range;
156
+ }
157
+ var pages = getPaginationRange();
158
+ return (_jsx(Pagination, { children: _jsxs(PaginationContent, { children: [_jsx(PaginationItem, { children: _jsx(PaginationPrevious, { href: "#", onClick: function () { return setSelectedPage(function (p) { return Math.max(1, p - 1); }); } }) }), pages.map(function (page, idx) {
159
+ return page === "ellipsis" ? (_jsx(PaginationItem, { children: _jsx(PaginationEllipsis, {}) }, "ellipsis-" + idx)) : (_jsx(PaginationItem, { children: _jsx(PaginationLink, { href: "#", isActive: selectedPage === page, onClick: function () { return setSelectedPage(Number(page)); }, children: page }) }, page));
160
+ }), _jsx(PaginationItem, { children: _jsx(PaginationNext, { href: "#", onClick: function () { return setSelectedPage(function (p) { return Math.min(totalPages, p + 1); }); } }) })] }) }));
161
+ };
162
+ MultiPagination.parameters = {
163
+ docs: {
164
+ description: {
165
+ story: "MultiPagination-UI style pagination: shows a window of pages, ellipses, and always the first/last page. Ellipses appear and disappear as you select different pages.",
166
+ },
167
+ },
168
+ };
@@ -0,0 +1,114 @@
1
+ import React from "react";
2
+ import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, } from "./pagination";
3
+ var range = function (start, end) {
4
+ return Array.from({ length: end - start + 1 }, function (_, i) { return start + i; });
5
+ };
6
+ export default {
7
+ title: "Components/Pagination",
8
+ component: Pagination,
9
+ };
10
+ export var Basic = function () { return (<Pagination>
11
+ <PaginationContent>
12
+ <PaginationItem>
13
+ <PaginationPrevious href="#"/>
14
+ </PaginationItem>
15
+ {range(1, 5).map(function (page) { return (<PaginationItem key={page}>
16
+ <PaginationLink href="#" isActive={page === 1}>
17
+ {page}
18
+ </PaginationLink>
19
+ </PaginationItem>); })}
20
+ <PaginationItem>
21
+ <PaginationNext href="#"/>
22
+ </PaginationItem>
23
+ </PaginationContent>
24
+ </Pagination>); };
25
+ Basic.storyName = "Basic";
26
+ export var WithEllipsis = function () { return (<Pagination>
27
+ <PaginationContent>
28
+ <PaginationItem>
29
+ <PaginationPrevious href="#"/>
30
+ </PaginationItem>
31
+ <PaginationItem>
32
+ <PaginationLink href="#">1</PaginationLink>
33
+ </PaginationItem>
34
+ <PaginationItem>
35
+ <PaginationEllipsis />
36
+ </PaginationItem>
37
+ {range(8, 10).map(function (page) { return (<PaginationItem key={page}>
38
+ <PaginationLink href="#" isActive={page === 9}>
39
+ {page}
40
+ </PaginationLink>
41
+ </PaginationItem>); })}
42
+ <PaginationItem>
43
+ <PaginationNext href="#"/>
44
+ </PaginationItem>
45
+ </PaginationContent>
46
+ </Pagination>); };
47
+ WithEllipsis.storyName = "With Ellipsis";
48
+ export var OnlyOnePage = function () { return (<Pagination>
49
+ <PaginationContent>
50
+ <PaginationItem>
51
+ <PaginationPrevious href="#"/>
52
+ </PaginationItem>
53
+ <PaginationItem>
54
+ <PaginationLink href="#" isActive>
55
+ 1
56
+ </PaginationLink>
57
+ </PaginationItem>
58
+ <PaginationItem>
59
+ <PaginationNext href="#"/>
60
+ </PaginationItem>
61
+ </PaginationContent>
62
+ </Pagination>); };
63
+ OnlyOnePage.storyName = "Only One Page";
64
+ export var DisabledPreviousNext = function () { return (<Pagination>
65
+ <PaginationContent>
66
+ <PaginationItem>
67
+ <PaginationPrevious href="#" aria-disabled/>
68
+ </PaginationItem>
69
+ {range(1, 3).map(function (page) { return (<PaginationItem key={page}>
70
+ <PaginationLink href="#" isActive={page === 2}>
71
+ {page}
72
+ </PaginationLink>
73
+ </PaginationItem>); })}
74
+ <PaginationItem>
75
+ <PaginationNext href="#" aria-disabled/>
76
+ </PaginationItem>
77
+ </PaginationContent>
78
+ </Pagination>); };
79
+ DisabledPreviousNext.storyName = "Disabled Previous/Next";
80
+ export var CustomSizes = function () { return (<Pagination>
81
+ <PaginationContent>
82
+ <PaginationItem>
83
+ <PaginationPrevious href="#" size="sm"/>
84
+ </PaginationItem>
85
+ {range(1, 3).map(function (page) { return (<PaginationItem key={page}>
86
+ <PaginationLink href="#" size={page === 2 ? "lg" : "sm"} isActive={page === 2}>
87
+ {page}
88
+ </PaginationLink>
89
+ </PaginationItem>); })}
90
+ <PaginationItem>
91
+ <PaginationNext href="#" size="lg"/>
92
+ </PaginationItem>
93
+ </PaginationContent>
94
+ </Pagination>); };
95
+ CustomSizes.storyName = "Custom Sizes";
96
+ export var Playground = function (args) { return (<Pagination {...args}>
97
+ <PaginationContent>
98
+ <PaginationItem>
99
+ <PaginationPrevious href="#"/>
100
+ </PaginationItem>
101
+ {range(1, 5).map(function (page) { return (<PaginationItem key={page}>
102
+ <PaginationLink href="#" isActive={page === 3}>
103
+ {page}
104
+ </PaginationLink>
105
+ </PaginationItem>); })}
106
+ <PaginationItem>
107
+ <PaginationNext href="#"/>
108
+ </PaginationItem>
109
+ </PaginationContent>
110
+ </Pagination>); };
111
+ Playground.storyName = "Playground";
112
+ Playground.args = {
113
+ className: "",
114
+ };
@@ -0,0 +1,146 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { RadioGroup, RadioGroupItem, sizeClass } from "./radio-group";
13
+ import { Label } from "../Label/Label";
14
+ import React, { useState } from "react";
15
+ import { Caption } from "../Typography/Caption/caption";
16
+ import { Button } from "../Button/Button/Button";
17
+ var meta = {
18
+ title: "Components/RadioGroup",
19
+ component: RadioGroup,
20
+ tags: ["autodocs"],
21
+ argTypes: {
22
+ defaultValue: { control: "text" },
23
+ value: {
24
+ control: "text",
25
+ description: "Controlled value of the RadioGroup",
26
+ },
27
+ onValueChange: {
28
+ action: "onValueChange",
29
+ description: "Callback when value changes",
30
+ table: {
31
+ type: { summary: "(value: string) => void" },
32
+ },
33
+ },
34
+ name: {
35
+ control: "text",
36
+ description: "Name attribute for the radio group",
37
+ table: {
38
+ type: { summary: "string" },
39
+ },
40
+ },
41
+ disabled: { control: "boolean" },
42
+ required: { control: "boolean" },
43
+ },
44
+ };
45
+ export default meta;
46
+ export var Basic = {
47
+ argTypes: {
48
+ size: {
49
+ control: { type: "select" },
50
+ options: Object.keys(sizeClass),
51
+ description: "Radio button size (applies to all RadioGroupItem children)",
52
+ table: {
53
+ type: { summary: Object.keys(sizeClass).join(" | ") },
54
+ defaultValue: { summary: "md" },
55
+ },
56
+ },
57
+ },
58
+ parameters: {
59
+ controls: {
60
+ include: [
61
+ "defaultValue",
62
+ "value",
63
+ "onValueChange",
64
+ "name",
65
+ "disabled",
66
+ "required",
67
+ "aria-invalid",
68
+ "size",
69
+ ],
70
+ },
71
+ },
72
+ render: function DefaultSelectedStory(args) {
73
+ var _a = args.size, size = _a === void 0 ? "md" : _a, onValueChange = args.onValueChange, value = args.value, radioGroupProps = __rest(args, ["size", "onValueChange", "value"]);
74
+ var _b = useState(value || ""), currentValue = _b[0], setCurrentValue = _b[1];
75
+ var handleChange = function (value) {
76
+ setCurrentValue(value);
77
+ onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(value); // safe call for Storybook action
78
+ };
79
+ return (<>
80
+ <RadioGroup {...radioGroupProps} onValueChange={handleChange} value={currentValue}>
81
+ <div className="flex items-center space-x-2">
82
+ <RadioGroupItem value="option-1" id="option-1" size={size}/>
83
+ <Label htmlFor="option-1">Option 1</Label>
84
+ </div>
85
+ <div className="flex items-center space-x-2">
86
+ <RadioGroupItem value="option-2" id="option-2" size={size}/>
87
+ <Label htmlFor="option-2">Option 2</Label>
88
+ </div>
89
+ <div className="flex items-center space-x-2">
90
+ <RadioGroupItem value="option-3" id="option-3" size={size}/>
91
+ <Label htmlFor="option-3">Option 3</Label>
92
+ </div>
93
+ </RadioGroup>
94
+ </>);
95
+ },
96
+ };
97
+ export var Disabled = {
98
+ args: {
99
+ disabled: true,
100
+ },
101
+ render: function (args) { return (<RadioGroup {...args}>
102
+ <div className="flex items-center space-x-2">
103
+ <RadioGroupItem value="option-1" id="disabled-1" disabled/>
104
+ <Label htmlFor="disabled-1">Option 1</Label>
105
+ </div>
106
+ <div className="flex items-center space-x-2">
107
+ <RadioGroupItem value="option-2" id="disabled-2" disabled/>
108
+ <Label htmlFor="disabled-2">Option 2</Label>
109
+ </div>
110
+ </RadioGroup>); },
111
+ };
112
+ export var ValidationComponent = function () {
113
+ var _a = useState(""), selected = _a[0], setSelected = _a[1];
114
+ var _b = useState(false), submitted = _b[0], setSubmitted = _b[1];
115
+ var hasError = submitted && !selected;
116
+ return (<form onSubmit={function (e) {
117
+ e.preventDefault();
118
+ setSubmitted(true);
119
+ if (selected) {
120
+ alert("Selected: ".concat(selected));
121
+ }
122
+ }} className="w-fit space-y-4">
123
+ <div className="space-y-2">
124
+ <Label>Choose an option</Label>
125
+ <RadioGroup value={selected} onValueChange={function (val) {
126
+ if (typeof val === "string") {
127
+ setSelected(val);
128
+ setSubmitted(false); // clear error on change
129
+ }
130
+ }} className="flex flex-col gap-2">
131
+ <div className="flex items-center space-x-2">
132
+ <RadioGroupItem value="option-1" id="validation-1" color={hasError ? "red" : "default"} className="border"/>
133
+ <Label htmlFor="validation-1">Option 1</Label>
134
+ </div>
135
+ <div className="flex items-center space-x-2">
136
+ <RadioGroupItem value="option-2" id="validation-2" color={hasError ? "red" : "default"} className="border"/>
137
+ <Label htmlFor="validation-2">Option 2</Label>
138
+ </div>
139
+ </RadioGroup>
140
+ {hasError && (<Caption className="text-red-500">Please select an option.</Caption>)}
141
+ </div>
142
+ <Button type="submit" className="px-4 py-2 bg-blue-600 text-white rounded">
143
+ Submit
144
+ </Button>
145
+ </form>);
146
+ };
@@ -0,0 +1,49 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import * as React from "react";
13
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
14
+ import { CircleIcon } from "lucide-react";
15
+ import { cn } from "../../lib/utils";
16
+ export var sizeClass = {
17
+ sm: "size-3.5",
18
+ md: "size-4",
19
+ lg: "size-5",
20
+ };
21
+ var checkedCircleSize = {
22
+ sm: "size-2",
23
+ md: "size-2.5",
24
+ lg: "size-3.5",
25
+ };
26
+ var RadioGroup = React.forwardRef(function (_a, ref) {
27
+ var className = _a.className, props = __rest(_a, ["className"]);
28
+ return (<RadioGroupPrimitive.Root ref={ref} data-slot="radio-group" className={cn("grid !gap-2", className)} {...props}/>);
29
+ });
30
+ RadioGroup.displayName = "RadioGroup";
31
+ function RadioGroupItem(props) {
32
+ var className = props.className, _a = props.size, size = _a === void 0 ? "md" : _a, _b = props.color, color = _b === void 0 ? "default" : _b, rest = __rest(props, ["className", "size", "color"]);
33
+ // Color classes for border and indicator, similar to Input
34
+ var colorClasses = {
35
+ default: "border-gray-200 hover:border-blue-600 data-[state=checked]:border-blue-600 focus-visible:ring-blue-200",
36
+ red: "border-red-600 focus-visible:ring-blue-200",
37
+ };
38
+ //used for CircleIcon
39
+ var indicatorColor = {
40
+ default: "fill-blue-600 stroke-blue-600",
41
+ red: "fill-red-600 stroke-red-600",
42
+ };
43
+ return (<RadioGroupPrimitive.Item data-slot="radio-group-item" className={cn(size && sizeClass[size], colorClasses[color], "focus-visible:border-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square shrink-0 !rounded-full !border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:border-gray-300 disabled:bg-gray-100", className)} {...rest}>
44
+ <RadioGroupPrimitive.Indicator data-slot="radio-group-indicator" className="relative flex items-center justify-center">
45
+ <CircleIcon className={cn(indicatorColor[color], "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", checkedCircleSize[size])}/>
46
+ </RadioGroupPrimitive.Indicator>
47
+ </RadioGroupPrimitive.Item>);
48
+ }
49
+ export { RadioGroup, RadioGroupItem };
@@ -0,0 +1,117 @@
1
+ import { avatarSize } from "../Avatar/Avatar";
2
+ import { buttonStyles } from "../Button";
3
+ import { badgeStyles } from "../Badge";
4
+ import { tableBodySize } from "../Table";
5
+ import { comboboxSizes } from "../Dropdown/Combobox";
6
+ import { iconSize as LUIconSizes } from "../Icons";
7
+ import { checkboxSize } from "../Checkbox/checkbox";
8
+ import { size as SwitchSizes } from "../Switch/switch";
9
+ declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
10
+ declare namespace Skeleton {
11
+ var Button: typeof ButtonSkeleton;
12
+ var Input: typeof InputSkeleton;
13
+ var Avatar: typeof AvatarSkeleton;
14
+ var Badge: typeof BadgeSkeleton;
15
+ var Card: typeof CardSkeleton;
16
+ var TableRow: typeof TableRowSkeleton;
17
+ var Checkbox: typeof CheckboxSkeleton;
18
+ var Switch: typeof SwitchSkeleton;
19
+ var Select: typeof SelectSkeleton;
20
+ var Icon: typeof IconSkeleton;
21
+ var Text: typeof TextSkeleton;
22
+ var Heading: typeof HeadingSkeleton;
23
+ var Image: typeof ImageSkeleton;
24
+ }
25
+ type ButtonSkeletonProps = {
26
+ size?: keyof typeof buttonStyles.size;
27
+ className?: string;
28
+ } & React.HTMLAttributes<HTMLDivElement>;
29
+ declare function ButtonSkeleton({ size, className, ...props }: ButtonSkeletonProps): import("react/jsx-runtime").JSX.Element;
30
+ export declare const InputSkeletonSize: {
31
+ sm: string;
32
+ md: string;
33
+ lg: string;
34
+ };
35
+ type InputSkeletonProps = {
36
+ size?: keyof typeof InputSkeletonSize;
37
+ className?: string;
38
+ } & React.HTMLAttributes<HTMLDivElement>;
39
+ declare function InputSkeleton({ size, className, ...props }: InputSkeletonProps): import("react/jsx-runtime").JSX.Element;
40
+ type AvatarSkeletonProps = {
41
+ size?: keyof typeof avatarSize;
42
+ className?: string;
43
+ } & React.HTMLAttributes<HTMLDivElement>;
44
+ declare function AvatarSkeleton({ size, className, ...props }: AvatarSkeletonProps): import("react/jsx-runtime").JSX.Element;
45
+ type BadgeSkeletonProps = {
46
+ size?: keyof typeof badgeStyles.size;
47
+ className?: string;
48
+ } & React.HTMLAttributes<HTMLDivElement>;
49
+ export declare const BadgeSkeletonSize: {
50
+ sm: string;
51
+ md: string;
52
+ lg: string;
53
+ };
54
+ declare function BadgeSkeleton({ size, className, ...props }: BadgeSkeletonProps): import("react/jsx-runtime").JSX.Element;
55
+ type CardSkeletonProps = {
56
+ className?: string;
57
+ } & React.HTMLAttributes<HTMLDivElement>;
58
+ declare function CardSkeleton({ className, ...props }: CardSkeletonProps): import("react/jsx-runtime").JSX.Element;
59
+ type TableRowSkeletonProps = {
60
+ columns?: number;
61
+ size?: keyof typeof tableBodySize;
62
+ className?: string;
63
+ } & React.HTMLAttributes<HTMLDivElement>;
64
+ declare function TableRowSkeleton({ columns, size, className, ...props }: TableRowSkeletonProps): import("react/jsx-runtime").JSX.Element;
65
+ type CheckboxSkeletonProps = {
66
+ className?: string;
67
+ size?: keyof typeof checkboxSize;
68
+ } & React.HTMLAttributes<HTMLDivElement>;
69
+ declare function CheckboxSkeleton({ className, size, ...props }: CheckboxSkeletonProps): import("react/jsx-runtime").JSX.Element;
70
+ type SwitchSkeletonProps = {
71
+ className?: string;
72
+ size?: keyof typeof SwitchSizes;
73
+ } & React.HTMLAttributes<HTMLDivElement>;
74
+ declare function SwitchSkeleton({ className, size, ...props }: SwitchSkeletonProps): import("react/jsx-runtime").JSX.Element;
75
+ type SelectSkeletonProps = {
76
+ size?: keyof typeof comboboxSizes;
77
+ className?: string;
78
+ } & React.HTMLAttributes<HTMLDivElement>;
79
+ declare function SelectSkeleton({ size, className, ...props }: SelectSkeletonProps): import("react/jsx-runtime").JSX.Element;
80
+ type IconSkeletonProps = {
81
+ size?: keyof typeof LUIconSizes;
82
+ className?: string;
83
+ } & React.HTMLAttributes<HTMLDivElement>;
84
+ declare function IconSkeleton({ size, className, ...props }: IconSkeletonProps): import("react/jsx-runtime").JSX.Element;
85
+ export declare const TextSkeletonSize: {
86
+ xs: string;
87
+ sm: string;
88
+ md: string;
89
+ lg: string;
90
+ xl: string;
91
+ };
92
+ type TextSkeletonProps = {
93
+ lines?: number;
94
+ size?: keyof typeof TextSkeletonSize;
95
+ className?: string;
96
+ } & React.HTMLAttributes<HTMLDivElement>;
97
+ declare function TextSkeleton({ lines, size, className, ...props }: TextSkeletonProps): import("react/jsx-runtime").JSX.Element;
98
+ export declare const HeadingSkeletonSize: {
99
+ h1: string;
100
+ h2: string;
101
+ h3: string;
102
+ h4: string;
103
+ h5: string;
104
+ h6: string;
105
+ };
106
+ type HeadingSkeletonProps = {
107
+ size?: keyof typeof HeadingSkeletonSize;
108
+ className?: string;
109
+ } & React.HTMLAttributes<HTMLDivElement>;
110
+ declare function HeadingSkeleton({ size, className, ...props }: HeadingSkeletonProps): import("react/jsx-runtime").JSX.Element;
111
+ type ImageSkeletonProps = {
112
+ aspectRatio?: "square" | "video" | "portrait";
113
+ className?: string;
114
+ isIcon?: boolean;
115
+ } & React.HTMLAttributes<HTMLDivElement>;
116
+ declare function ImageSkeleton({ aspectRatio, className, isIcon, ...props }: ImageSkeletonProps): import("react/jsx-runtime").JSX.Element;
117
+ export { Skeleton };