@addsign/moje-agenda-shared-lib 1.0.60 → 2.0.0

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 (128) hide show
  1. package/dist/Dialog-DZMfjbGC.js +421 -0
  2. package/dist/Dialog-DZMfjbGC.js.map +1 -0
  3. package/dist/assets/style.css +4369 -0
  4. package/dist/assets/tailwind.css +1365 -1193
  5. package/dist/check-B7dJm08z.js +12 -0
  6. package/dist/check-B7dJm08z.js.map +1 -0
  7. package/dist/components/Button.js +1 -1
  8. package/dist/components/datatable/DataTable.js +6 -2
  9. package/dist/components/datatable/DataTable.js.map +1 -1
  10. package/dist/components/datatable/DataTableServer.js +6 -2
  11. package/dist/components/datatable/DataTableServer.js.map +1 -1
  12. package/dist/components/form/AutocompleteSearchBar.js +6 -2
  13. package/dist/components/form/AutocompleteSearchBar.js.map +1 -1
  14. package/dist/components/form/AutocompleteSearchBarServer.js +6 -2
  15. package/dist/components/form/AutocompleteSearchBarServer.js.map +1 -1
  16. package/dist/components/form/FileInput.js +7 -3
  17. package/dist/components/form/FileInput.js.map +1 -1
  18. package/dist/components/form/FileInputMultiple.js +7 -3
  19. package/dist/components/form/FileInputMultiple.js.map +1 -1
  20. package/dist/components/form/FormField.js +6 -2
  21. package/dist/components/form/FormField.js.map +1 -1
  22. package/dist/components/form/PositionsSelectorSingle.js +6 -2
  23. package/dist/components/form/PositionsSelectorSingle.js.map +1 -1
  24. package/dist/components/form/SelectField.js +6 -2
  25. package/dist/components/form/SelectField.js.map +1 -1
  26. package/dist/components/profiles/ProfileOverview.js +6 -2
  27. package/dist/components/profiles/ProfileOverview.js.map +1 -1
  28. package/dist/components/ui/Combobox.d.ts +1 -0
  29. package/dist/components/ui/Combobox.js +138 -0
  30. package/dist/components/ui/Combobox.js.map +1 -0
  31. package/dist/components/ui/DateTimePicker.js +19 -5
  32. package/dist/components/ui/DateTimePicker.js.map +1 -1
  33. package/dist/components/ui/Dialog.js +15 -413
  34. package/dist/components/ui/Dialog.js.map +1 -1
  35. package/dist/components/ui/ScrollArea.js +2 -1
  36. package/dist/components/ui/ScrollArea.js.map +1 -1
  37. package/dist/components/ui/command.d.ts +80 -0
  38. package/dist/components/ui/command.js +643 -0
  39. package/dist/components/ui/command.js.map +1 -0
  40. package/dist/components/ui/datepicker.js +14 -1
  41. package/dist/components/ui/datepicker.js.map +1 -1
  42. package/dist/components/ui/popover.js +3 -2
  43. package/dist/components/ui/popover.js.map +1 -1
  44. package/dist/components/ui/radioGroup.d.ts +5 -0
  45. package/dist/components/ui/radioGroup.js +586 -0
  46. package/dist/components/ui/radioGroup.js.map +1 -0
  47. package/dist/components/ui/select.js +9 -144
  48. package/dist/components/ui/select.js.map +1 -1
  49. package/dist/index-BXrwe-_7.js +1395 -0
  50. package/dist/index-BXrwe-_7.js.map +1 -0
  51. package/dist/index-Bk8dRTPE.js +11 -0
  52. package/dist/index-Bk8dRTPE.js.map +1 -0
  53. package/dist/index-BlzC-wss.js +140 -0
  54. package/dist/index-BlzC-wss.js.map +1 -0
  55. package/dist/index-Bp9GiUkg.js +2266 -0
  56. package/dist/index-Bp9GiUkg.js.map +1 -0
  57. package/dist/index-BzVVosDl.js +57 -0
  58. package/dist/index-BzVVosDl.js.map +1 -0
  59. package/dist/index-CbAQSs_C.js +40 -0
  60. package/dist/index-CbAQSs_C.js.map +1 -0
  61. package/dist/index-Dz_fWpFA.js +2203 -0
  62. package/dist/index-Dz_fWpFA.js.map +1 -0
  63. package/dist/index-IXOTxK3N.js +7 -0
  64. package/dist/index-IXOTxK3N.js.map +1 -0
  65. package/dist/main.d.ts +3 -0
  66. package/dist/main.js +29 -12
  67. package/dist/main.js.map +1 -1
  68. package/dist/parse-D2yb8751.js +1727 -0
  69. package/dist/parse-D2yb8751.js.map +1 -0
  70. package/dist/tailwind-l0sNRNKZ.js +2 -0
  71. package/dist/tailwind-l0sNRNKZ.js.map +1 -0
  72. package/lib/components/Button.tsx +57 -0
  73. package/lib/components/Calendar.tsx +242 -0
  74. package/lib/components/ConfirmationModalDialog.tsx +115 -0
  75. package/lib/components/Modal.tsx +73 -0
  76. package/lib/components/ModalDialog.tsx +63 -0
  77. package/lib/components/Spinner.tsx +25 -0
  78. package/lib/components/SpinnerIcon.tsx +12 -0
  79. package/lib/components/datatable/DataTable.tsx +442 -0
  80. package/lib/components/datatable/DataTableServer.tsx +939 -0
  81. package/lib/components/datatable/DatatableSettings.tsx +48 -0
  82. package/lib/components/datatable/Resizable.tsx +99 -0
  83. package/lib/components/datatable/types.ts +33 -0
  84. package/lib/components/form/AutocompleteSearchBar.tsx +424 -0
  85. package/lib/components/form/AutocompleteSearchBarServer.tsx +257 -0
  86. package/lib/components/form/DateField.tsx +124 -0
  87. package/lib/components/form/DateRangeField.tsx +116 -0
  88. package/lib/components/form/FileInput.tsx +188 -0
  89. package/lib/components/form/FileInputMultiple.tsx +186 -0
  90. package/lib/components/form/FormField.tsx +371 -0
  91. package/lib/components/form/InputField.tsx +230 -0
  92. package/lib/components/form/PositionsSelectorSingle.tsx +266 -0
  93. package/lib/components/form/RadioGroup.tsx +64 -0
  94. package/lib/components/form/SelectField.tsx +267 -0
  95. package/lib/components/layout/IconInCircle.tsx +29 -0
  96. package/lib/components/layout/PageTitle.tsx +19 -0
  97. package/lib/components/layout/SectionTitle.tsx +22 -0
  98. package/lib/components/profiles/ProfileOverview.tsx +212 -0
  99. package/lib/components/ui/Calendar.tsx +68 -0
  100. package/lib/components/ui/Combobox.tsx +122 -0
  101. package/lib/components/ui/DatePicker.tsx +124 -0
  102. package/lib/components/ui/DateTimePicker.tsx +187 -0
  103. package/lib/components/ui/Dialog.tsx +118 -0
  104. package/lib/components/ui/ScrollArea.tsx +45 -0
  105. package/lib/components/ui/button.tsx +56 -0
  106. package/lib/components/ui/command.tsx +153 -0
  107. package/lib/components/ui/form.tsx +177 -0
  108. package/lib/components/ui/input.tsx +22 -0
  109. package/lib/components/ui/label.tsx +24 -0
  110. package/lib/components/ui/popover.tsx +31 -0
  111. package/lib/components/ui/radioGroup.tsx +44 -0
  112. package/lib/components/ui/select.tsx +158 -0
  113. package/lib/contexts/FederationContext.tsx +28 -0
  114. package/lib/contexts/useFederationContext.ts +4 -0
  115. package/lib/css/tailwind.css +10 -0
  116. package/lib/fonts/arial.ts +3 -0
  117. package/lib/fonts/arialBold.ts +4 -0
  118. package/lib/main.ts +64 -0
  119. package/lib/types.ts +492 -0
  120. package/lib/utils/PdfManager.ts +224 -0
  121. package/lib/utils/getFullName.tsx +83 -0
  122. package/lib/utils/getIntersectingDays.ts +28 -0
  123. package/lib/utils/handleErrors.ts +28 -0
  124. package/lib/utils/hasRightInModule.ts +17 -0
  125. package/lib/utils/hasRole.ts +12 -0
  126. package/lib/utils/utils.ts +6 -0
  127. package/lib/vite-env.d.ts +1 -0
  128. package/package.json +5 -2
@@ -0,0 +1,153 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { type DialogProps } from "@radix-ui/react-dialog";
5
+ import { Command as CommandPrimitive } from "cmdk";
6
+ import { Search } from "lucide-react";
7
+
8
+ import { cn } from "../../utils/utils";
9
+ import { Dialog, DialogContent } from "./Dialog";
10
+
11
+ const Command = React.forwardRef<
12
+ React.ElementRef<typeof CommandPrimitive>,
13
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>
14
+ >(({ className, ...props }, ref) => (
15
+ <CommandPrimitive
16
+ ref={ref}
17
+ className={cn(
18
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ ));
24
+ Command.displayName = CommandPrimitive.displayName;
25
+
26
+ const CommandDialog = ({ children, ...props }: DialogProps) => {
27
+ return (
28
+ <Dialog {...props}>
29
+ <DialogContent className="overflow-hidden p-0 shadow-lg">
30
+ <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
31
+ {children}
32
+ </Command>
33
+ </DialogContent>
34
+ </Dialog>
35
+ );
36
+ };
37
+
38
+ const CommandInput = React.forwardRef<
39
+ React.ElementRef<typeof CommandPrimitive.Input>,
40
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
41
+ >(({ className, ...props }, ref) => (
42
+ <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
43
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
44
+ <CommandPrimitive.Input
45
+ ref={ref}
46
+ className={cn(
47
+ "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ </div>
53
+ ));
54
+
55
+ CommandInput.displayName = CommandPrimitive.Input.displayName;
56
+
57
+ const CommandList = React.forwardRef<
58
+ React.ElementRef<typeof CommandPrimitive.List>,
59
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
60
+ >(({ className, ...props }, ref) => (
61
+ <CommandPrimitive.List
62
+ ref={ref}
63
+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
64
+ {...props}
65
+ />
66
+ ));
67
+
68
+ CommandList.displayName = CommandPrimitive.List.displayName;
69
+
70
+ const CommandEmpty = React.forwardRef<
71
+ React.ElementRef<typeof CommandPrimitive.Empty>,
72
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
73
+ >((props, ref) => (
74
+ <CommandPrimitive.Empty
75
+ ref={ref}
76
+ className="py-6 text-center text-sm"
77
+ {...props}
78
+ />
79
+ ));
80
+
81
+ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
82
+
83
+ const CommandGroup = React.forwardRef<
84
+ React.ElementRef<typeof CommandPrimitive.Group>,
85
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
86
+ >(({ className, ...props }, ref) => (
87
+ <CommandPrimitive.Group
88
+ ref={ref}
89
+ className={cn(
90
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
91
+ className
92
+ )}
93
+ {...props}
94
+ />
95
+ ));
96
+
97
+ CommandGroup.displayName = CommandPrimitive.Group.displayName;
98
+
99
+ const CommandSeparator = React.forwardRef<
100
+ React.ElementRef<typeof CommandPrimitive.Separator>,
101
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
102
+ >(({ className, ...props }, ref) => (
103
+ <CommandPrimitive.Separator
104
+ ref={ref}
105
+ className={cn("-mx-1 h-px bg-border", className)}
106
+ {...props}
107
+ />
108
+ ));
109
+ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
110
+
111
+ const CommandItem = React.forwardRef<
112
+ React.ElementRef<typeof CommandPrimitive.Item>,
113
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
114
+ >(({ className, ...props }, ref) => (
115
+ <CommandPrimitive.Item
116
+ ref={ref}
117
+ className={cn(
118
+ "relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
119
+ className
120
+ )}
121
+ {...props}
122
+ />
123
+ ));
124
+
125
+ CommandItem.displayName = CommandPrimitive.Item.displayName;
126
+
127
+ const CommandShortcut = ({
128
+ className,
129
+ ...props
130
+ }: React.HTMLAttributes<HTMLSpanElement>) => {
131
+ return (
132
+ <span
133
+ className={cn(
134
+ "ml-auto text-xs tracking-widest text-muted-foreground",
135
+ className
136
+ )}
137
+ {...props}
138
+ />
139
+ );
140
+ };
141
+ CommandShortcut.displayName = "CommandShortcut";
142
+
143
+ export {
144
+ Command,
145
+ CommandDialog,
146
+ CommandInput,
147
+ CommandList,
148
+ CommandEmpty,
149
+ CommandGroup,
150
+ CommandItem,
151
+ CommandShortcut,
152
+ CommandSeparator,
153
+ };
@@ -0,0 +1,177 @@
1
+ import * as React from "react";
2
+ import * as LabelPrimitive from "@radix-ui/react-label";
3
+ import { Slot } from "@radix-ui/react-slot";
4
+ import {
5
+ Controller,
6
+ ControllerProps,
7
+ FieldPath,
8
+ FieldValues,
9
+ FormProvider,
10
+ useFormContext,
11
+ } from "react-hook-form";
12
+
13
+ import { cn } from "../../utils/utils";
14
+ import { Label } from "./label";
15
+
16
+ const Form = FormProvider;
17
+
18
+ type FormFieldContextValue<
19
+ TFieldValues extends FieldValues = FieldValues,
20
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
21
+ > = {
22
+ name: TName;
23
+ };
24
+
25
+ const FormFieldContext = React.createContext<FormFieldContextValue>(
26
+ {} as FormFieldContextValue
27
+ );
28
+
29
+ const FormField = <
30
+ TFieldValues extends FieldValues = FieldValues,
31
+ TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
32
+ >({
33
+ ...props
34
+ }: ControllerProps<TFieldValues, TName>) => {
35
+ return (
36
+ <FormFieldContext.Provider value={{ name: props.name }}>
37
+ <Controller {...props} />
38
+ </FormFieldContext.Provider>
39
+ );
40
+ };
41
+
42
+ const useFormField = () => {
43
+ const fieldContext = React.useContext(FormFieldContext);
44
+ const itemContext = React.useContext(FormItemContext);
45
+ const { getFieldState, formState } = useFormContext();
46
+
47
+ const fieldState = getFieldState(fieldContext.name, formState);
48
+
49
+ if (!fieldContext) {
50
+ throw new Error("useFormField should be used within <FormField>");
51
+ }
52
+
53
+ const { id } = itemContext;
54
+
55
+ return {
56
+ id,
57
+ name: fieldContext.name,
58
+ formItemId: `${id}-form-item`,
59
+ formDescriptionId: `${id}-form-item-description`,
60
+ formMessageId: `${id}-form-item-message`,
61
+ ...fieldState,
62
+ };
63
+ };
64
+
65
+ type FormItemContextValue = {
66
+ id: string;
67
+ };
68
+
69
+ const FormItemContext = React.createContext<FormItemContextValue>(
70
+ {} as FormItemContextValue
71
+ );
72
+
73
+ const FormItem = React.forwardRef<
74
+ HTMLDivElement,
75
+ React.HTMLAttributes<HTMLDivElement>
76
+ >(({ className, ...props }, ref) => {
77
+ const id = React.useId();
78
+
79
+ return (
80
+ <FormItemContext.Provider value={{ id }}>
81
+ <div ref={ref} className={cn("space-y-2", className)} {...props} />
82
+ </FormItemContext.Provider>
83
+ );
84
+ });
85
+ FormItem.displayName = "FormItem";
86
+
87
+ const FormLabel = React.forwardRef<
88
+ React.ElementRef<typeof LabelPrimitive.Root>,
89
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>
90
+ >(({ className, ...props }, ref) => {
91
+ const { error, formItemId } = useFormField();
92
+
93
+ return (
94
+ <Label
95
+ ref={ref}
96
+ className={cn(error && "text-destructive", className)}
97
+ htmlFor={formItemId}
98
+ {...props}
99
+ />
100
+ );
101
+ });
102
+ FormLabel.displayName = "FormLabel";
103
+
104
+ const FormControl = React.forwardRef<
105
+ React.ElementRef<typeof Slot>,
106
+ React.ComponentPropsWithoutRef<typeof Slot>
107
+ >(({ ...props }, ref) => {
108
+ const { error, formItemId, formDescriptionId, formMessageId } =
109
+ useFormField();
110
+
111
+ return (
112
+ <Slot
113
+ ref={ref}
114
+ id={formItemId}
115
+ aria-describedby={
116
+ !error
117
+ ? `${formDescriptionId}`
118
+ : `${formDescriptionId} ${formMessageId}`
119
+ }
120
+ aria-invalid={!!error}
121
+ {...props}
122
+ />
123
+ );
124
+ });
125
+ FormControl.displayName = "FormControl";
126
+
127
+ const FormDescription = React.forwardRef<
128
+ HTMLParagraphElement,
129
+ React.HTMLAttributes<HTMLParagraphElement>
130
+ >(({ className, ...props }, ref) => {
131
+ const { formDescriptionId } = useFormField();
132
+
133
+ return (
134
+ <p
135
+ ref={ref}
136
+ id={formDescriptionId}
137
+ className={cn("text-sm text-muted-foreground", className)}
138
+ {...props}
139
+ />
140
+ );
141
+ });
142
+ FormDescription.displayName = "FormDescription";
143
+
144
+ const FormMessage = React.forwardRef<
145
+ HTMLParagraphElement,
146
+ React.HTMLAttributes<HTMLParagraphElement>
147
+ >(({ className, children, ...props }, ref) => {
148
+ const { error, formMessageId } = useFormField();
149
+ const body = error ? String(error?.message) : children;
150
+
151
+ if (!body) {
152
+ return null;
153
+ }
154
+
155
+ return (
156
+ <p
157
+ ref={ref}
158
+ id={formMessageId}
159
+ className={cn("text-sm font-medium text-destructive", className)}
160
+ {...props}
161
+ >
162
+ {body}
163
+ </p>
164
+ );
165
+ });
166
+ FormMessage.displayName = "FormMessage";
167
+
168
+ export {
169
+ useFormField,
170
+ Form,
171
+ FormItem,
172
+ FormLabel,
173
+ FormControl,
174
+ FormDescription,
175
+ FormMessage,
176
+ FormField as FormFieldCN,
177
+ };
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+
3
+ import { cn } from "../..//utils/utils";
4
+
5
+ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
6
+ ({ className, type, ...props }, ref) => {
7
+ return (
8
+ <input
9
+ type={type}
10
+ className={cn(
11
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-ring file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-80 disabled:border-opacity-100 md:text-sm",
12
+ className
13
+ )}
14
+ ref={ref}
15
+ {...props}
16
+ />
17
+ );
18
+ }
19
+ );
20
+ Input.displayName = "Input";
21
+
22
+ export { Input };
@@ -0,0 +1,24 @@
1
+ import * as React from "react";
2
+ import * as LabelPrimitive from "@radix-ui/react-label";
3
+ import { cva, type VariantProps } from "class-variance-authority";
4
+
5
+ import { cn } from "../../utils/utils";
6
+
7
+ const labelVariants = cva(
8
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
9
+ );
10
+
11
+ const Label = React.forwardRef<
12
+ React.ElementRef<typeof LabelPrimitive.Root>,
13
+ React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
14
+ VariantProps<typeof labelVariants>
15
+ >(({ className, ...props }, ref) => (
16
+ <LabelPrimitive.Root
17
+ ref={ref}
18
+ className={cn(labelVariants(), className)}
19
+ {...props}
20
+ />
21
+ ));
22
+ Label.displayName = LabelPrimitive.Root.displayName;
23
+
24
+ export { Label };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
5
+
6
+ import { cn } from "../../utils/utils";
7
+
8
+ const Popover = PopoverPrimitive.Root;
9
+
10
+ const PopoverTrigger = PopoverPrimitive.Trigger;
11
+
12
+ const PopoverContent = React.forwardRef<
13
+ React.ElementRef<typeof PopoverPrimitive.Content>,
14
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
15
+ >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16
+ <PopoverPrimitive.Portal>
17
+ <PopoverPrimitive.Content
18
+ ref={ref}
19
+ align={align}
20
+ sideOffset={sideOffset}
21
+ className={cn(
22
+ "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ </PopoverPrimitive.Portal>
28
+ ));
29
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
30
+
31
+ export { Popover, PopoverTrigger, PopoverContent };
@@ -0,0 +1,44 @@
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
5
+ import { Circle } from "lucide-react";
6
+
7
+ import { cn } from "../../utils/utils";
8
+
9
+ const RadioGroup = React.forwardRef<
10
+ React.ElementRef<typeof RadioGroupPrimitive.Root>,
11
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
12
+ >(({ className, ...props }, ref) => {
13
+ return (
14
+ <RadioGroupPrimitive.Root
15
+ className={cn("grid gap-2", className)}
16
+ {...props}
17
+ ref={ref}
18
+ />
19
+ );
20
+ });
21
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
22
+
23
+ const RadioGroupItem = React.forwardRef<
24
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
25
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
26
+ >(({ className, ...props }, ref) => {
27
+ return (
28
+ <RadioGroupPrimitive.Item
29
+ ref={ref}
30
+ className={cn(
31
+ "aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
32
+ className
33
+ )}
34
+ {...props}
35
+ >
36
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
37
+ <Circle className="h-2.5 w-2.5 fill-current text-current" />
38
+ </RadioGroupPrimitive.Indicator>
39
+ </RadioGroupPrimitive.Item>
40
+ );
41
+ });
42
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
43
+
44
+ export { RadioGroup as RadioGroupCN, RadioGroupItem };
@@ -0,0 +1,158 @@
1
+ import * as React from "react";
2
+ import * as SelectPrimitive from "@radix-ui/react-select";
3
+ import { Check, ChevronDown, ChevronUp } from "lucide-react";
4
+
5
+ import { cn } from "../../utils/utils";
6
+
7
+ const Select = SelectPrimitive.Root;
8
+
9
+ const SelectGroup = SelectPrimitive.Group;
10
+
11
+ const SelectValue = SelectPrimitive.Value;
12
+
13
+ const SelectTrigger = React.forwardRef<
14
+ React.ElementRef<typeof SelectPrimitive.Trigger>,
15
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>
16
+ >(({ className, children, ...props }, ref) => (
17
+ <SelectPrimitive.Trigger
18
+ ref={ref}
19
+ className={cn(
20
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
21
+ className
22
+ )}
23
+ {...props}
24
+ >
25
+ {children}
26
+ <SelectPrimitive.Icon asChild>
27
+ <ChevronDown className="h-4 w-4 opacity-50" />
28
+ </SelectPrimitive.Icon>
29
+ </SelectPrimitive.Trigger>
30
+ ));
31
+ SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
32
+
33
+ const SelectScrollUpButton = React.forwardRef<
34
+ React.ElementRef<typeof SelectPrimitive.ScrollUpButton>,
35
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>
36
+ >(({ className, ...props }, ref) => (
37
+ <SelectPrimitive.ScrollUpButton
38
+ ref={ref}
39
+ className={cn(
40
+ "flex cursor-default items-center justify-center py-1",
41
+ className
42
+ )}
43
+ {...props}
44
+ >
45
+ <ChevronUp className="h-4 w-4" />
46
+ </SelectPrimitive.ScrollUpButton>
47
+ ));
48
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
49
+
50
+ const SelectScrollDownButton = React.forwardRef<
51
+ React.ElementRef<typeof SelectPrimitive.ScrollDownButton>,
52
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>
53
+ >(({ className, ...props }, ref) => (
54
+ <SelectPrimitive.ScrollDownButton
55
+ ref={ref}
56
+ className={cn(
57
+ "flex cursor-default items-center justify-center py-1",
58
+ className
59
+ )}
60
+ {...props}
61
+ >
62
+ <ChevronDown className="h-4 w-4" />
63
+ </SelectPrimitive.ScrollDownButton>
64
+ ));
65
+ SelectScrollDownButton.displayName =
66
+ SelectPrimitive.ScrollDownButton.displayName;
67
+
68
+ const SelectContent = React.forwardRef<
69
+ React.ElementRef<typeof SelectPrimitive.Content>,
70
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>
71
+ >(({ className, children, position = "popper", ...props }, ref) => (
72
+ <SelectPrimitive.Portal>
73
+ <SelectPrimitive.Content
74
+ ref={ref}
75
+ className={cn(
76
+ "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",
77
+ position === "popper" &&
78
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
79
+ className
80
+ )}
81
+ position={position}
82
+ {...props}
83
+ >
84
+ <SelectScrollUpButton />
85
+ <SelectPrimitive.Viewport
86
+ className={cn(
87
+ "p-1",
88
+ position === "popper" &&
89
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
90
+ )}
91
+ >
92
+ {children}
93
+ </SelectPrimitive.Viewport>
94
+ <SelectScrollDownButton />
95
+ </SelectPrimitive.Content>
96
+ </SelectPrimitive.Portal>
97
+ ));
98
+ SelectContent.displayName = SelectPrimitive.Content.displayName;
99
+
100
+ const SelectLabel = React.forwardRef<
101
+ React.ElementRef<typeof SelectPrimitive.Label>,
102
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>
103
+ >(({ className, ...props }, ref) => (
104
+ <SelectPrimitive.Label
105
+ ref={ref}
106
+ className={cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className)}
107
+ {...props}
108
+ />
109
+ ));
110
+ SelectLabel.displayName = SelectPrimitive.Label.displayName;
111
+
112
+ const SelectItem = React.forwardRef<
113
+ React.ElementRef<typeof SelectPrimitive.Item>,
114
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>
115
+ >(({ className, children, ...props }, ref) => (
116
+ <SelectPrimitive.Item
117
+ ref={ref}
118
+ className={cn(
119
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
120
+ className
121
+ )}
122
+ {...props}
123
+ >
124
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
125
+ <SelectPrimitive.ItemIndicator>
126
+ <Check className="h-4 w-4" />
127
+ </SelectPrimitive.ItemIndicator>
128
+ </span>
129
+
130
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
131
+ </SelectPrimitive.Item>
132
+ ));
133
+ SelectItem.displayName = SelectPrimitive.Item.displayName;
134
+
135
+ const SelectSeparator = React.forwardRef<
136
+ React.ElementRef<typeof SelectPrimitive.Separator>,
137
+ React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>
138
+ >(({ className, ...props }, ref) => (
139
+ <SelectPrimitive.Separator
140
+ ref={ref}
141
+ className={cn("-mx-1 my-1 h-px bg-muted", className)}
142
+ {...props}
143
+ />
144
+ ));
145
+ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
146
+
147
+ export {
148
+ Select,
149
+ SelectGroup,
150
+ SelectValue,
151
+ SelectTrigger,
152
+ SelectContent,
153
+ SelectLabel,
154
+ SelectItem,
155
+ SelectSeparator,
156
+ SelectScrollUpButton,
157
+ SelectScrollDownButton,
158
+ };
@@ -0,0 +1,28 @@
1
+ import { FC, PropsWithChildren, createContext } from "react";
2
+ import { IContextValue } from "../types";
3
+
4
+ export const FederationContext = createContext({} as IContextValue);
5
+
6
+ type FederationContextProviderProps = PropsWithChildren & {
7
+ value: IContextValue;
8
+ };
9
+
10
+ export const FederationContextProvider: FC<FederationContextProviderProps> = ({
11
+ children,
12
+ value,
13
+ }) => {
14
+ //const { userInfo, apiClient, authApps, emitter } = value;
15
+
16
+ // const contextValue = {
17
+ // userInfo: userInfo,
18
+ // apiClient: apiClient,
19
+ // authApps: authApps,
20
+ // emitter: emitter,
21
+ // };
22
+
23
+ return (
24
+ <FederationContext.Provider value={value}>
25
+ {children}
26
+ </FederationContext.Provider>
27
+ );
28
+ };
@@ -0,0 +1,4 @@
1
+ import { useContext } from "react";
2
+ import { FederationContext } from "./FederationContext";
3
+
4
+ export const useFederationContext = () => useContext(FederationContext);
@@ -0,0 +1,10 @@
1
+ @tailwind base;
2
+ @tailwind components;
3
+ @tailwind utilities;
4
+
5
+
6
+
7
+ :root {
8
+ /* --color-primary: green;
9
+ Example color */
10
+ }