linkedunion-design-kit 1.9.6-beta.0 → 1.9.6-beta.1

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 (132) hide show
  1. package/dist/build/types/validator.js +12 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +2 -0
  4. package/dist/src/components/Badge/Badge.stories.d.ts +1 -1
  5. package/dist/src/components/Badge/Badge.stories.js +1 -1
  6. package/dist/src/components/Button/Button/Button.module.css +1 -1
  7. package/dist/src/components/Card/MultipleNews/MultiNews.js +2 -2
  8. package/dist/src/components/Pagination/pagination.js +7 -7
  9. package/dist/src/components/Skeleton/skeleton.stories.d.ts +3 -1
  10. package/dist/src/components/Skeleton/skeleton.stories.js +48 -38
  11. package/dist/src/components/Title/Title.module.css +1 -1
  12. package/dist/src/components/Typography/Heading/heading.module.css +1 -1
  13. package/dist/src/components/VerticalTabs/VerticalTabs.d.ts +18 -0
  14. package/dist/src/components/VerticalTabs/VerticalTabs.js +60 -0
  15. package/dist/src/components/VerticalTabs/VerticalTabs.stories.d.ts +11 -0
  16. package/dist/src/components/VerticalTabs/VerticalTabs.stories.js +100 -0
  17. package/dist/src/components/VerticalTabs/VerticalTabs.test.d.ts +1 -0
  18. package/dist/src/components/VerticalTabs/VerticalTabs.test.js +48 -0
  19. package/dist/styles/global.css +118 -6
  20. package/package.json +2 -2
  21. package/dist/app/layout.jsx +0 -13
  22. package/dist/app/page.jsx +0 -5
  23. package/dist/src/components/Accordion/Accordion.stories.jsx +0 -33
  24. package/dist/src/components/Accordion/accordion.jsx +0 -59
  25. package/dist/src/components/Alerts/Alert/alert.jsx +0 -152
  26. package/dist/src/components/Alerts/Alert/alert.stories.jsx +0 -344
  27. package/dist/src/components/Alerts/AlertDialog/alert-dialog.jsx +0 -170
  28. package/dist/src/components/Alerts/AlertDialog/alert-dialog.stories.jsx +0 -552
  29. package/dist/src/components/AppIcons/AndroidIcon.jsx +0 -24
  30. package/dist/src/components/AppIcons/AppIcon.jsx +0 -29
  31. package/dist/src/components/AppIcons/AppIcon.stories.jsx +0 -223
  32. package/dist/src/components/AppIcons/AppleIcon.jsx +0 -31
  33. package/dist/src/components/AppIcons/PlayStoreIcon.jsx +0 -29
  34. package/dist/src/components/Avatar/Avatar/Avatar.jsx +0 -45
  35. package/dist/src/components/Avatar/Avatar/Avatar.stories.jsx +0 -95
  36. package/dist/src/components/Avatar/Avatar/Avatar.test.jsx +0 -9
  37. package/dist/src/components/Avatar/Avatar/type.d.ts +0 -12
  38. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.jsx +0 -17
  39. package/dist/src/components/Avatar/AvatarGroup/AvatarGroup.stories.jsx +0 -32
  40. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.jsx +0 -20
  41. package/dist/src/components/Avatar/StatusIndicator/StatusIndicator.stories.jsx +0 -50
  42. package/dist/src/components/Badge/Badge.jsx +0 -54
  43. package/dist/src/components/Badge/Badge.stories.jsx +0 -201
  44. package/dist/src/components/Button/Button/Button.jsx +0 -96
  45. package/dist/src/components/Button/Button/Button.stories.jsx +0 -283
  46. package/dist/src/components/Button/Button/Button.test.jsx +0 -73
  47. package/dist/src/components/Button/IconButton/IconButton.jsx +0 -63
  48. package/dist/src/components/Button/IconButton/IconButton.stories.jsx +0 -128
  49. package/dist/src/components/Button/IconButton/IconButton.test.jsx +0 -28
  50. package/dist/src/components/Card/MultipleNews/MultiNews.jsx +0 -70
  51. package/dist/src/components/Card/MultipleNews/MultiNews.stories.jsx +0 -101
  52. package/dist/src/components/Card/PostByCategory/PostByCategory.jsx +0 -60
  53. package/dist/src/components/Card/PostByCategory/PostByCategory.stories.jsx +0 -102
  54. package/dist/src/components/Card/SinglePost/SinglePost.jsx +0 -26
  55. package/dist/src/components/Card/SinglePost/SinglePost.stories.jsx +0 -63
  56. package/dist/src/components/Card/card.jsx +0 -20
  57. package/dist/src/components/Card/contactProfile/ContactProfile.jsx +0 -60
  58. package/dist/src/components/Card/contactProfile/ContactProfile.stories.jsx +0 -99
  59. package/dist/src/components/Card/photoAlbum/PhotoAlbum.jsx +0 -41
  60. package/dist/src/components/Card/photoAlbum/PhotoAlbum.stories.jsx +0 -51
  61. package/dist/src/components/Card/photoGallery/PhotoGallery.jsx +0 -17
  62. package/dist/src/components/Card/photoGallery/PhotoGallery.stories.jsx +0 -34
  63. package/dist/src/components/Checkbox/checkbox.jsx +0 -47
  64. package/dist/src/components/Checkbox/checkbox.stories.jsx +0 -113
  65. package/dist/src/components/ColorPicker/ColorPicker.jsx +0 -67
  66. package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +0 -138
  67. package/dist/src/components/Colors/color.jsx +0 -5
  68. package/dist/src/components/Colors/color.stories.jsx +0 -20
  69. package/dist/src/components/Colors/color.test.jsx +0 -23
  70. package/dist/src/components/Dropdown/Combobox/Combobox.jsx +0 -198
  71. package/dist/src/components/Dropdown/Combobox/Combobox.stories.jsx +0 -289
  72. package/dist/src/components/Dropdown/Combobox/utils/renderBadge.jsx +0 -7
  73. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.jsx +0 -102
  74. package/dist/src/components/Dropdown/DropdownMenu/DropdownMenu.stories.jsx +0 -464
  75. package/dist/src/components/Dropdown/DropdownMenu/SelectAllSection.jsx +0 -19
  76. package/dist/src/components/Dropdown/Select.stories.jsx +0 -201
  77. package/dist/src/components/Dropdown/select.jsx +0 -93
  78. package/dist/src/components/Icons/LUIcon.jsx +0 -41
  79. package/dist/src/components/Icons/LUIcon.test.jsx +0 -308
  80. package/dist/src/components/Icons/stories/IconDropdown.jsx +0 -67
  81. package/dist/src/components/Icons/stories/IconGallery.jsx +0 -77
  82. package/dist/src/components/Icons/stories/InteractiveIconSelector.jsx +0 -86
  83. package/dist/src/components/Icons/stories/LUIcon.stories.jsx +0 -108
  84. package/dist/src/components/ImageUploader/ImageUploader.stories.jsx +0 -50
  85. package/dist/src/components/ImageUploader/imageUploader.jsx +0 -94
  86. package/dist/src/components/Images/LuImage.jsx +0 -19
  87. package/dist/src/components/Images/LuImage.stories.jsx +0 -154
  88. package/dist/src/components/Images/LuImage.test.jsx +0 -44
  89. package/dist/src/components/Input/Input.stories.jsx +0 -250
  90. package/dist/src/components/Input/input.jsx +0 -110
  91. package/dist/src/components/Label/Label.jsx +0 -32
  92. package/dist/src/components/Label/Label.stories.jsx +0 -30
  93. package/dist/src/components/Pagination/pagination.jsx +0 -65
  94. package/dist/src/components/Pagination/pagination.stories.jsx +0 -301
  95. package/dist/src/components/RadioGroup/RadioGroup.stories.jsx +0 -146
  96. package/dist/src/components/RadioGroup/radio-group.jsx +0 -49
  97. package/dist/src/components/Slider/Slider.stories.jsx +0 -159
  98. package/dist/src/components/Slider/slider.jsx +0 -31
  99. package/dist/src/components/SweetAlert/SweetAlert.jsx +0 -147
  100. package/dist/src/components/SweetAlert/SweetAlert.stories.jsx +0 -505
  101. package/dist/src/components/Switch/Switch.stories.jsx +0 -66
  102. package/dist/src/components/Switch/switch.jsx +0 -61
  103. package/dist/src/components/Table/Table.jsx +0 -221
  104. package/dist/src/components/Table/Table.stories.jsx +0 -652
  105. package/dist/src/components/Tabs/Tabs.stories.jsx +0 -29
  106. package/dist/src/components/Tabs/tabs.jsx +0 -32
  107. package/dist/src/components/Title/Title.jsx +0 -8
  108. package/dist/src/components/Title/Title.stories.jsx +0 -37
  109. package/dist/src/components/Title/Title.test.jsx +0 -24
  110. package/dist/src/components/ToolTip/Tooltip.jsx +0 -18
  111. package/dist/src/components/ToolTip/Tooltip.stories.jsx +0 -25
  112. package/dist/src/components/Typography/Body/Body.stories.jsx +0 -34
  113. package/dist/src/components/Typography/Body/body.jsx +0 -52
  114. package/dist/src/components/Typography/Caption/Caption.stories.jsx +0 -24
  115. package/dist/src/components/Typography/Caption/caption.jsx +0 -25
  116. package/dist/src/components/Typography/Display/Display.stories.jsx +0 -24
  117. package/dist/src/components/Typography/Display/display.jsx +0 -39
  118. package/dist/src/components/Typography/Heading/Heading.stories.jsx +0 -37
  119. package/dist/src/components/Typography/Heading/heading.jsx +0 -53
  120. package/dist/src/components/ui/avatar.d.ts +0 -6
  121. package/dist/src/components/ui/avatar.js +0 -38
  122. package/dist/src/components/ui/avatar.jsx +0 -27
  123. package/dist/src/components/ui/button.d.ts +0 -10
  124. package/dist/src/components/ui/button.js +0 -56
  125. package/dist/src/components/ui/button.jsx +0 -45
  126. package/dist/src/components/ui/collapsible.jsx +0 -5
  127. package/dist/src/components/ui/command.jsx +0 -67
  128. package/dist/src/components/ui/dialog.jsx +0 -66
  129. package/dist/src/components/ui/popover.jsx +0 -33
  130. package/dist/src/components/ui/tooltip.jsx +0 -38
  131. package/dist/src/components/ui/typography.jsx +0 -56
  132. /package/dist/{src/components/Avatar/Avatar/type.js → build/types/validator.d.ts} +0 -0
@@ -1,289 +0,0 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
- import { useState } from "react";
11
- import Combobox from "./Combobox";
12
- import { comboboxColor, comboboxSelectType, comboboxShapes, comboboxSizes, } from ".";
13
- import LUIcon from "../../../components/Icons/LUIcon";
14
- import { Label } from "../../../components/Label/Label";
15
- import Tooltip from "../../../components/ToolTip/Tooltip";
16
- import { Caption } from "../../../components/Typography/Caption/caption";
17
- import { Button } from "../../../components/Button/Button/Button";
18
- import { Checkbox } from "../../../components/Checkbox/checkbox";
19
- import { Badge } from "../../../components/Badge/Badge";
20
- export default {
21
- title: "Components/Dropdown/Combobox",
22
- component: Combobox,
23
- tags: ["autodocs"],
24
- argTypes: {
25
- options: {
26
- control: { type: "object" },
27
- description: "Options for the combobox dropdown",
28
- table: {
29
- type: { summary: "Array<{ value: string; label: string }>" },
30
- defaultValue: { summary: "See default" },
31
- },
32
- },
33
- size: {
34
- control: { type: "select" },
35
- options: Object.keys(comboboxSizes),
36
- description: "Size of the combobox button",
37
- table: {
38
- type: { summary: "comboboxSizes" },
39
- defaultValue: { summary: "md" },
40
- },
41
- },
42
- placeholder: {
43
- control: { type: "text" },
44
- description: "Placeholder text for the combobox",
45
- table: {
46
- type: { summary: "string" },
47
- defaultValue: { summary: "Select Options" },
48
- },
49
- },
50
- shape: {
51
- control: { type: "select" },
52
- options: Object.keys(comboboxShapes),
53
- description: "Shape of the combobox button",
54
- table: {
55
- type: { summary: "comboboxShapes" },
56
- defaultValue: { summary: "rectangular" },
57
- },
58
- },
59
- variant: {
60
- control: { type: "select" },
61
- options: Object.keys(comboboxSelectType),
62
- description: "Type of the combobox",
63
- table: {
64
- type: { summary: "comboboxSelectType" },
65
- defaultValue: { summary: "fill" },
66
- },
67
- },
68
- color: {
69
- control: { type: "select" },
70
- options: Object.keys(comboboxColor.fill),
71
- description: "Color of the combobox",
72
- table: {
73
- type: { summary: "comboboxColor" },
74
- defaultValue: { summary: "default" },
75
- },
76
- },
77
- isSearch: {
78
- control: { type: "boolean" },
79
- description: "Enable search functionality",
80
- table: {
81
- type: { summary: "boolean" },
82
- defaultValue: { summary: "false" },
83
- },
84
- },
85
- isMulti: {
86
- control: { type: "boolean" },
87
- description: "Enable multi-select functionality",
88
- table: {
89
- type: { summary: "boolean" },
90
- defaultValue: { summary: "false" },
91
- },
92
- },
93
- onSelect: {
94
- control: false,
95
- description: "Callback fired when an option is selected",
96
- table: {
97
- type: { summary: "(selected: any) => void" },
98
- },
99
- },
100
- disabled: {
101
- control: { type: "boolean" },
102
- description: "Disable the combobox",
103
- table: {
104
- type: { summary: "boolean" },
105
- defaultValue: { summary: "false" },
106
- },
107
- },
108
- renderOption: {
109
- control: false,
110
- description: "Custom render function for options",
111
- table: {
112
- type: { summary: "(option: any) => ReactNode" },
113
- },
114
- },
115
- defaultValue: {
116
- control: { type: "text" },
117
- description: "Default value for the combobox",
118
- table: {
119
- type: { summary: "string | string[]" },
120
- },
121
- },
122
- },
123
- };
124
- var Template = function (args) { return <Combobox {...args}/>; };
125
- export var Default = Template.bind({});
126
- Default.args = {
127
- size: "md",
128
- placeholder: "Select Options",
129
- shape: "rectangular",
130
- options: [
131
- { key: "next.js", value: "Next.js" },
132
- { key: "sveltekit", value: "SvelteKit" },
133
- { key: "nest.js", value: "Nest.js" },
134
- { key: "remix", value: "Remix" },
135
- { key: "astro", value: "Astro" },
136
- { key: "react", value: "React" },
137
- { key: "nest", value: "Nest" },
138
- { key: "python", value: "Python" },
139
- { key: "ai", value: "AI" },
140
- ],
141
- isSearch: true,
142
- isMulti: true,
143
- renderOption: function (option) { return (<>
144
- {option.icon && <LUIcon icon={option.icon} size="md"/>}
145
- <span>{option.key}</span>
146
- </>); },
147
- onSelect: function (value) { return console.log(value); },
148
- };
149
- export var Basic = function () { return (<Combobox options={[
150
- { key: "React", value: "react" },
151
- { key: "Vue", value: "vue" },
152
- ]} onSelect={function (value) { return console.log(value); }}/>); };
153
- export var ComboboxSize = function () { return (<div className="space-y-4">
154
- <Combobox size="sm" options={[
155
- { key: "React", value: "react" },
156
- { key: "Vue", value: "vue" },
157
- ]} onSelect={function (value) { return console.log(value); }}/>
158
- <Combobox size="md" options={[
159
- { key: "React", value: "react" },
160
- { key: "Vue", value: "vue" },
161
- ]} onSelect={function (value) { return console.log(value); }}/>
162
- <Combobox size="lg" options={[
163
- { key: "React", value: "react" },
164
- { key: "Vue", value: "vue" },
165
- ]} onSelect={function (value) { return console.log(value); }}/>
166
- </div>); };
167
- export var ComboboxType = function () { return (<div className="space-y-4">
168
- <Label variant="label-sm">Text</Label>
169
- <Combobox isMulti options={["React", "Vue", "Angular"]} renderOption={function (option) { return <span>{option.value}</span>; }}/>
170
-
171
- <Label variant="label-sm">Text With Right Icon</Label>
172
- <Combobox isMulti options={["React", "Vue", "Angular"]} renderOption={function (option) { return (<div className="flex items-center justify-between w-full">
173
- <span>{option.value}</span>
174
- <LUIcon icon="plus"/>
175
- </div>); }}/>
176
-
177
- <Label variant="label-sm">Text With Left Icon</Label>
178
- <Combobox isMulti options={[
179
- { key: "next.js", value: "Next.js", icon: "plus" },
180
- { key: "sveltekit", value: "SvelteKit", icon: "star" },
181
- { key: "nest.js", value: "Nest.js", icon: "check" },
182
- { key: "remix", value: "Remix", icon: "minus" },
183
- { key: "astro", value: "Astro", icon: "plus" },
184
- ]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
185
- <LUIcon icon={option.icon}/>
186
- <span>{option.value}</span>
187
- </div>); }}/>
188
-
189
- <Label variant="label-sm">Badge</Label>
190
- <Combobox isMulti options={["React", "Vue", "Angular"]} renderOption={function (option) { return (<Badge startIcon="star" color="light-blue">
191
- {option.value}
192
- </Badge>); }}/>
193
-
194
- <Label variant="label-sm">Text+Counter</Label>
195
- <Combobox isMulti options={["React", "Vue", "Angular"]} renderOption={function (option) { return (<div className="flex items-center justify-between w-full">
196
- <span>{option.value}</span>
197
- <Badge color="light-blue">{+3}</Badge>
198
- </div>); }}/>
199
- </div>); };
200
- export var ComboboxWithCheckbox = function () {
201
- var _a = useState([]), selected = _a[0], setSelected = _a[1];
202
- var options = ["React", "Vue", "Angular"];
203
- var onCheckChange = function (value) {
204
- setSelected(function (prev) {
205
- return prev.includes(value) ? prev.filter(function (v) { return v !== value; }) : __spreadArray(__spreadArray([], prev, true), [value], false);
206
- });
207
- };
208
- return (<Combobox isMulti options={options} onSelect={function (value) {
209
- if (Array.isArray(value)) {
210
- setSelected(value);
211
- }
212
- }} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
213
- <Checkbox id={"checkbox-".concat(option.value)} checked={selected.includes(option.value)} onCheckedChange={function () {
214
- onCheckChange(option.value);
215
- }}/>
216
- <span>{option.value}</span>
217
- </div>); }}/>);
218
- };
219
- export var ComboboxWithUserIcon = function () { return (<Combobox isMulti options={["React", "Vue", "Angular", "Nest", "Next"]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
220
- {/* TODO: Replace it with Avatar */}
221
- <LUIcon icon="user" variant="padded"/>
222
- <span>{option.value}</span>
223
- </div>); }}/>); };
224
- export var ComboboxWithDefaultValue = function () { return (<div className="space-y-4">
225
- <Label variant="label-sm">Multiple Default Values in Multiple Select</Label>
226
- <Combobox isMulti isSearch options={["React", "Vue", "Angular", "Nest", "Next"]} defaultValue={["React", "Vue"]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
227
- <LUIcon icon="plus"/>
228
- <span>{option.value}</span>
229
- </div>); }}/>
230
-
231
- <Label variant="label-sm">Single Default Value in Multiple Select</Label>
232
- <Combobox isMulti isSearch options={["React", "Vue", "Angular", "Nest", "Next"]} defaultValue={["React"]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
233
- <LUIcon icon="plus"/>
234
- <span>{option.value}</span>
235
- </div>); }}/>
236
-
237
- <Label variant="label-sm">Single Default Value in Single Select</Label>
238
- <Combobox isSearch options={["React", "Vue", "Angular", "Nest", "Next"]} defaultValue={"React"} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
239
- <LUIcon icon="plus"/>
240
- <span>{option.value}</span>
241
- </div>); }}/>
242
- </div>); };
243
- export var ListOfArray = function () { return (<Combobox isMulti isSearch options={["React", "Vue", "Angular", "Nest", "Next"]} renderOption={function (option) { return (<div className="flex items-center gap-2 w-full">
244
- <LUIcon icon="plus"/>
245
- <span>{option.value}</span>
246
- </div>); }}/>); };
247
- export var ComboboxValidation = function () {
248
- var _a = useState(""), selected = _a[0], setSelected = _a[1];
249
- var _b = useState(false), error = _b[0], setError = _b[1];
250
- var handleSelect = function (value) {
251
- // Since isMulti is false, value will be string
252
- if (typeof value === "string") {
253
- setSelected(value);
254
- if (value && error)
255
- setError(false);
256
- }
257
- };
258
- var handleSubmit = function (e) {
259
- e.preventDefault();
260
- if (!selected) {
261
- setError(true);
262
- }
263
- else {
264
- setError(false);
265
- }
266
- };
267
- return (<form className="space-y-4" onSubmit={handleSubmit}>
268
- <div className="flex items-center gap-2 mb-2">
269
- <Label variant="label-sm">Select Category</Label>
270
- <span className="text-red-600">*</span>
271
- <Tooltip title="Select Option">
272
- <LUIcon variant="padded" size="xs" shape="rounded" icon="question" color="light-blue"/>
273
- </Tooltip>
274
- </div>
275
- <div>
276
- <Combobox placeholder="Select framework..." size="md" options={[
277
- { key: "next.js", value: "Next.js" },
278
- { key: "sveltekit", value: "SvelteKit" },
279
- { key: "nest.js", value: "Nest.js" },
280
- { key: "remix", value: "Remix" },
281
- { key: "astro", value: "Astro" },
282
- ]} isSearch onSelect={handleSelect} color={error ? "red" : "default"} renderOption={function (option) { return <span>{option.value}</span>; }}/>
283
- {error && (<Caption variant="md" className="mt-1 text-red-600">
284
- field is required
285
- </Caption>)}
286
- </div>
287
- <Button type="submit">Submit</Button>
288
- </form>);
289
- };
@@ -1,7 +0,0 @@
1
- import React from "react";
2
- import { Badge } from "../../../../components/Badge/Badge";
3
- export var renderBadge = function (option, handleRemove) {
4
- return (<Badge key={option.value} color="light-blue" startIcon={option.icon} onRemove={function () { return handleRemove(option.value); }}>
5
- {option.key}
6
- </Badge>);
7
- };
@@ -1,102 +0,0 @@
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 DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
14
- import { ChevronRight, Circle } from "lucide-react";
15
- import { cn } from "../../../lib/utils";
16
- import { checkBoxSize, dropdownMenuIconSize, dropDownMenuItemSize, dropdownMenuSize, } from ".";
17
- import { Checkbox } from "../../../components/Checkbox/checkbox";
18
- // Provide size from Content to all items
19
- var DropdownMenuSizeContext = React.createContext("md");
20
- var DropdownMenu = DropdownMenuPrimitive.Root;
21
- var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
22
- var DropdownMenuGroup = DropdownMenuPrimitive.Group;
23
- var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
24
- var DropdownMenuSub = DropdownMenuPrimitive.Sub;
25
- var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
26
- var DropdownMenuSubTrigger = React.forwardRef(function (_a, ref) {
27
- var className = _a.className, inset = _a.inset, children = _a.children, props = __rest(_a, ["className", "inset", "children"]);
28
- return (<DropdownMenuPrimitive.SubTrigger ref={ref} className={cn("flex cursor-default select-none items-center gap-2 rounded-sm p-2 outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className)} {...props}>
29
- {children}
30
- <ChevronRight className="ml-auto"/>
31
- </DropdownMenuPrimitive.SubTrigger>);
32
- });
33
- DropdownMenuSubTrigger.displayName =
34
- DropdownMenuPrimitive.SubTrigger.displayName;
35
- var DropdownMenuSubContent = React.forwardRef(function (_a, ref) {
36
- var _b;
37
- var className = _a.className, size = _a.size, props = __rest(_a, ["className", "size"]);
38
- var inheritedSize = React.useContext(DropdownMenuSizeContext);
39
- var effectiveSize = (_b = size !== null && size !== void 0 ? size : inheritedSize) !== null && _b !== void 0 ? _b : "md";
40
- return (<DropdownMenuPrimitive.SubContent ref={ref} className={cn("z-50 min-w-[8rem] overflow-hidden rounded-sm bg-white text-gray-900 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", className, dropDownMenuItemSize[effectiveSize])} {...props}/>);
41
- });
42
- DropdownMenuSubContent.displayName =
43
- DropdownMenuPrimitive.SubContent.displayName;
44
- var DropdownMenuContent = React.forwardRef(function (_a, ref) {
45
- var className = _a.className, _b = _a.sideOffset, sideOffset = _b === void 0 ? 4 : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.align, align = _d === void 0 ? "start" : _d, props = __rest(_a, ["className", "sideOffset", "size", "align"]);
46
- return (<DropdownMenuPrimitive.Portal>
47
- <DropdownMenuSizeContext.Provider value={size}>
48
- <DropdownMenuPrimitive.Content ref={ref} sideOffset={sideOffset} align={align} // Pass align prop to DropdownMenuPrimitive.Content
49
- className={cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-sm bg-white p-2 text-gray-900 shadow-backdrop-shadow-lg", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]", dropdownMenuSize[size], className)} {...props}/>
50
- </DropdownMenuSizeContext.Provider>
51
- </DropdownMenuPrimitive.Portal>);
52
- });
53
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
54
- var DropdownMenuItem = React.forwardRef(function (_a, ref) {
55
- var _b;
56
- var className = _a.className, inset = _a.inset, selected = _a.selected, size = _a.size, props = __rest(_a, ["className", "inset", "selected", "size"]);
57
- var inheritedSize = React.useContext(DropdownMenuSizeContext);
58
- var effectiveSize = (_b = size !== null && size !== void 0 ? size : inheritedSize) !== null && _b !== void 0 ? _b : "md";
59
- return (<DropdownMenuPrimitive.Item ref={ref} className={cn("relative flex cursor-pointer select-none items-center gap-2 rounded-sm outline-none transition-colors text-gray-900 hover:bg-blue-50 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:bg-gray-100 data-[disabled]:text-gray-300 [&>svg]:shrink-0", dropdownMenuIconSize[effectiveSize], dropdownMenuSize[effectiveSize], dropDownMenuItemSize[effectiveSize], inset && "pl-8", selected && "bg-blue-50 text-blue-600", // Apply styles for selected item
60
- className)} {...props}/>);
61
- });
62
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
63
- var DropdownMenuCheckboxItem = React.forwardRef(function (_a, ref) {
64
- var _b;
65
- var className = _a.className, children = _a.children, checked = _a.checked, size = _a.size, props = __rest(_a, ["className", "children", "checked", "size"]);
66
- var inheritedSize = React.useContext(DropdownMenuSizeContext);
67
- var effectiveSize = (_b = size !== null && size !== void 0 ? size : inheritedSize) !== null && _b !== void 0 ? _b : "md";
68
- return (<DropdownMenuPrimitive.CheckboxItem ref={ref} className={cn("relative flex cursor-default select-none items-center gap-2 rounded-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className, dropDownMenuItemSize[effectiveSize])} checked={checked} {...props}>
69
- <Checkbox size={checkBoxSize[effectiveSize]} checked={!!checked} className="pointer-events-none"/>
70
- {children}
71
- </DropdownMenuPrimitive.CheckboxItem>);
72
- });
73
- DropdownMenuCheckboxItem.displayName =
74
- DropdownMenuPrimitive.CheckboxItem.displayName;
75
- var DropdownMenuRadioItem = React.forwardRef(function (_a, ref) {
76
- var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
77
- return (<DropdownMenuPrimitive.RadioItem ref={ref} className={cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)} {...props}>
78
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
79
- <DropdownMenuPrimitive.ItemIndicator>
80
- <Circle className="h-2 w-2 fill-current"/>
81
- </DropdownMenuPrimitive.ItemIndicator>
82
- </span>
83
- {children}
84
- </DropdownMenuPrimitive.RadioItem>);
85
- });
86
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
87
- var DropdownMenuLabel = React.forwardRef(function (_a, ref) {
88
- var className = _a.className, inset = _a.inset, props = __rest(_a, ["className", "inset"]);
89
- return (<DropdownMenuPrimitive.Label ref={ref} className={cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)} {...props}/>);
90
- });
91
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
92
- var DropdownMenuSeparator = React.forwardRef(function (_a, ref) {
93
- var className = _a.className, props = __rest(_a, ["className"]);
94
- return (<DropdownMenuPrimitive.Separator ref={ref} className={cn("-mx-1 my-1 h-px bg-muted", className)} {...props}/>);
95
- });
96
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
97
- var DropdownMenuShortcut = function (_a) {
98
- var className = _a.className, props = __rest(_a, ["className"]);
99
- return (<span className={cn("ml-auto text-xs tracking-widest opacity-60", className)} {...props}/>);
100
- };
101
- DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
102
- export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };