torch-glare 2.5.5 → 2.6.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.
- package/README.md +4 -3
- package/dist/bin/index.js +9 -24
- package/dist/bin/index.js.map +1 -1
- package/dist/src/commands/add.d.ts +2 -2
- package/dist/src/commands/add.d.ts.map +1 -1
- package/dist/src/commands/add.js +4 -70
- package/dist/src/commands/add.js.map +1 -1
- package/dist/src/commands/hook.d.ts +5 -4
- package/dist/src/commands/hook.d.ts.map +1 -1
- package/dist/src/commands/hook.js +7 -75
- package/dist/src/commands/hook.js.map +1 -1
- package/dist/src/commands/init.js +1 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/layout.d.ts +5 -4
- package/dist/src/commands/layout.d.ts.map +1 -1
- package/dist/src/commands/layout.js +7 -75
- package/dist/src/commands/layout.js.map +1 -1
- package/dist/src/commands/provider.d.ts +5 -4
- package/dist/src/commands/provider.d.ts.map +1 -1
- package/dist/src/commands/provider.js +7 -75
- package/dist/src/commands/provider.js.map +1 -1
- package/dist/src/commands/update.d.ts.map +1 -1
- package/dist/src/commands/update.js +78 -43
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/utils.d.ts +5 -4
- package/dist/src/commands/utils.d.ts.map +1 -1
- package/dist/src/commands/utils.js +7 -80
- package/dist/src/commands/utils.js.map +1 -1
- package/dist/src/shared/addFromRegistry.d.ts +16 -0
- package/dist/src/shared/addFromRegistry.d.ts.map +1 -0
- package/dist/src/shared/addFromRegistry.js +88 -0
- package/dist/src/shared/addFromRegistry.js.map +1 -0
- package/dist/src/shared/getInstallCommand.d.ts.map +1 -1
- package/dist/src/shared/getInstallCommand.js +5 -0
- package/dist/src/shared/getInstallCommand.js.map +1 -1
- package/dist/src/shared/installDependencies.d.ts +0 -10
- package/dist/src/shared/installDependencies.d.ts.map +1 -1
- package/dist/src/shared/installDependencies.js +0 -17
- package/dist/src/shared/installDependencies.js.map +1 -1
- package/dist/src/shared/installFromPlan.d.ts +7 -5
- package/dist/src/shared/installFromPlan.d.ts.map +1 -1
- package/dist/src/shared/installFromPlan.js +103 -36
- package/dist/src/shared/installFromPlan.js.map +1 -1
- package/dist/src/shared/loadRegistry.d.ts +12 -3
- package/dist/src/shared/loadRegistry.d.ts.map +1 -1
- package/dist/src/shared/loadRegistry.js +19 -20
- package/dist/src/shared/loadRegistry.js.map +1 -1
- package/dist/src/shared/registryClient.d.ts +19 -0
- package/dist/src/shared/registryClient.d.ts.map +1 -0
- package/dist/src/shared/registryClient.js +128 -0
- package/dist/src/shared/registryClient.js.map +1 -0
- package/dist/src/shared/resolveEntry.d.ts +10 -7
- package/dist/src/shared/resolveEntry.d.ts.map +1 -1
- package/dist/src/shared/resolveEntry.js +18 -13
- package/dist/src/shared/resolveEntry.js.map +1 -1
- package/dist/src/shared/suggestOtherCommand.d.ts +7 -1
- package/dist/src/shared/suggestOtherCommand.d.ts.map +1 -1
- package/dist/src/shared/suggestOtherCommand.js +29 -23
- package/dist/src/shared/suggestOtherCommand.js.map +1 -1
- package/dist/src/types/main.d.ts +31 -2
- package/dist/src/types/main.d.ts.map +1 -1
- package/package.json +6 -11
- package/apps/lib/components/ActionButton.tsx +0 -93
- package/apps/lib/components/ActionsGroup.tsx +0 -27
- package/apps/lib/components/AlertDialog.tsx +0 -204
- package/apps/lib/components/Avatar.tsx +0 -46
- package/apps/lib/components/Badge.tsx +0 -250
- package/apps/lib/components/BadgeField.tsx +0 -338
- package/apps/lib/components/Breadcrumb.tsx +0 -280
- package/apps/lib/components/Button.tsx +0 -317
- package/apps/lib/components/ButtonGroup.tsx +0 -190
- package/apps/lib/components/Calendar.tsx +0 -115
- package/apps/lib/components/Card.tsx +0 -95
- package/apps/lib/components/Checkbox.tsx +0 -42
- package/apps/lib/components/ColorPicker.tsx +0 -441
- package/apps/lib/components/ConclusionHeader.tsx +0 -148
- package/apps/lib/components/ContextMenu.tsx +0 -571
- package/apps/lib/components/CountBadge.tsx +0 -52
- package/apps/lib/components/DataTable.tsx +0 -213
- package/apps/lib/components/DataViews/badge.ts +0 -49
- package/apps/lib/components/DataViews/cell.tsx +0 -324
- package/apps/lib/components/DataViews/context.ts +0 -144
- package/apps/lib/components/DataViews/data-views.tsx +0 -383
- package/apps/lib/components/DataViews/filters/children.tsx +0 -98
- package/apps/lib/components/DataViews/filters/custom.tsx +0 -34
- package/apps/lib/components/DataViews/filters/filters.tsx +0 -157
- package/apps/lib/components/DataViews/filters/index.ts +0 -4
- package/apps/lib/components/DataViews/filters/labelled.tsx +0 -20
- package/apps/lib/components/DataViews/filters/presets.tsx +0 -65
- package/apps/lib/components/DataViews/filters/sync.tsx +0 -35
- package/apps/lib/components/DataViews/filters/values.ts +0 -173
- package/apps/lib/components/DataViews/header.tsx +0 -220
- package/apps/lib/components/DataViews/hooks/index.ts +0 -5
- package/apps/lib/components/DataViews/hooks/useActiveRow.ts +0 -22
- package/apps/lib/components/DataViews/hooks/useControllable.ts +0 -52
- package/apps/lib/components/DataViews/index.ts +0 -84
- package/apps/lib/components/DataViews/panel/columns.tsx +0 -153
- package/apps/lib/components/DataViews/panel/controls.tsx +0 -106
- package/apps/lib/components/DataViews/panel/index.ts +0 -3
- package/apps/lib/components/DataViews/panel/panel.tsx +0 -164
- package/apps/lib/components/DataViews/panel/saved-views.tsx +0 -67
- package/apps/lib/components/DataViews/panel/section.tsx +0 -81
- package/apps/lib/components/DataViews/panel/sort.tsx +0 -42
- package/apps/lib/components/DataViews/panel/tab.tsx +0 -31
- package/apps/lib/components/DataViews/slots.ts +0 -63
- package/apps/lib/components/DataViews/states.tsx +0 -38
- package/apps/lib/components/DataViews/types.ts +0 -510
- package/apps/lib/components/DataViews/views/board-view.tsx +0 -381
- package/apps/lib/components/DataViews/views/card-rows.tsx +0 -36
- package/apps/lib/components/DataViews/views/inbox-view.tsx +0 -260
- package/apps/lib/components/DataViews/views/pane-views.tsx +0 -196
- package/apps/lib/components/DataViews/views/table-view.tsx +0 -493
- package/apps/lib/components/DataViews/views/tree-view.tsx +0 -367
- package/apps/lib/components/DatePicker.tsx +0 -232
- package/apps/lib/components/Dialog.tsx +0 -116
- package/apps/lib/components/Divider.tsx +0 -28
- package/apps/lib/components/Drawer.tsx +0 -420
- package/apps/lib/components/DropdownMenu.tsx +0 -540
- package/apps/lib/components/FieldHint.tsx +0 -69
- package/apps/lib/components/Form.tsx +0 -182
- package/apps/lib/components/FormBuilder/context.ts +0 -73
- package/apps/lib/components/FormBuilder/field-kind.ts +0 -28
- package/apps/lib/components/FormBuilder/fields/ChoiceFields.tsx +0 -60
- package/apps/lib/components/FormBuilder/fields/ColorField.tsx +0 -59
- package/apps/lib/components/FormBuilder/fields/CustomField.tsx +0 -11
- package/apps/lib/components/FormBuilder/fields/DateField.tsx +0 -32
- package/apps/lib/components/FormBuilder/fields/FieldArray.tsx +0 -74
- package/apps/lib/components/FormBuilder/fields/FieldShell.tsx +0 -163
- package/apps/lib/components/FormBuilder/fields/FileField.tsx +0 -39
- package/apps/lib/components/FormBuilder/fields/OptionListFields.tsx +0 -132
- package/apps/lib/components/FormBuilder/fields/OtpField.tsx +0 -31
- package/apps/lib/components/FormBuilder/fields/PhoneField.tsx +0 -109
- package/apps/lib/components/FormBuilder/fields/RichTextEditorField.tsx +0 -31
- package/apps/lib/components/FormBuilder/fields/SelectField.tsx +0 -91
- package/apps/lib/components/FormBuilder/fields/SignatureField.tsx +0 -157
- package/apps/lib/components/FormBuilder/fields/SliderField.tsx +0 -67
- package/apps/lib/components/FormBuilder/fields/SwitchBoxField.tsx +0 -41
- package/apps/lib/components/FormBuilder/fields/TableField.tsx +0 -336
- package/apps/lib/components/FormBuilder/fields/TextField.tsx +0 -213
- package/apps/lib/components/FormBuilder/fields/TreeSelectField.tsx +0 -43
- package/apps/lib/components/FormBuilder/fields/countries.ts +0 -303
- package/apps/lib/components/FormBuilder/fields/index.ts +0 -25
- package/apps/lib/components/FormBuilder/form-builder.tsx +0 -198
- package/apps/lib/components/FormBuilder/index.ts +0 -31
- package/apps/lib/components/FormBuilder/numberFormat.ts +0 -16
- package/apps/lib/components/FormBuilder/submit.tsx +0 -47
- package/apps/lib/components/FormBuilder/types.ts +0 -311
- package/apps/lib/components/FormRenderer/FormDrawer.tsx +0 -128
- package/apps/lib/components/FormRenderer/detail.tsx +0 -207
- package/apps/lib/components/FormRenderer/form-renderer.tsx +0 -297
- package/apps/lib/components/FormRenderer/header.tsx +0 -88
- package/apps/lib/components/FormRenderer/index.ts +0 -15
- package/apps/lib/components/FormRenderer/section.tsx +0 -39
- package/apps/lib/components/FormRenderer/stepper.tsx +0 -339
- package/apps/lib/components/FormRenderer/types.ts +0 -78
- package/apps/lib/components/FormSummary.tsx +0 -282
- package/apps/lib/components/HeaderBar.tsx +0 -117
- package/apps/lib/components/ImageAttachment.tsx +0 -209
- package/apps/lib/components/InnerLabelField.tsx +0 -154
- package/apps/lib/components/Input.tsx +0 -224
- package/apps/lib/components/InputField.tsx +0 -147
- package/apps/lib/components/InputOTP.tsx +0 -84
- package/apps/lib/components/Label.tsx +0 -129
- package/apps/lib/components/LabelField.tsx +0 -76
- package/apps/lib/components/LabeledCheckBox.tsx +0 -51
- package/apps/lib/components/LabeledRadio.tsx +0 -51
- package/apps/lib/components/LinkButton.tsx +0 -94
- package/apps/lib/components/LoginButton.tsx +0 -51
- package/apps/lib/components/PasswordLevel.tsx +0 -58
- package/apps/lib/components/Popover.tsx +0 -312
- package/apps/lib/components/ProfileMenu.tsx +0 -85
- package/apps/lib/components/Radio.tsx +0 -59
- package/apps/lib/components/RadioCard.tsx +0 -50
- package/apps/lib/components/ScrollArea.tsx +0 -54
- package/apps/lib/components/SearchField.tsx +0 -62
- package/apps/lib/components/SearchableSelect.tsx +0 -318
- package/apps/lib/components/SearchableTable.tsx +0 -344
- package/apps/lib/components/SearchableTree.tsx +0 -485
- package/apps/lib/components/SearchableTreeDialog.tsx +0 -502
- package/apps/lib/components/SectionBlock.tsx +0 -147
- package/apps/lib/components/Select.tsx +0 -347
- package/apps/lib/components/SimpleSelect.tsx +0 -225
- package/apps/lib/components/Skeleton.tsx +0 -12
- package/apps/lib/components/SlideDatePicker.tsx +0 -253
- package/apps/lib/components/SpinLoading.tsx +0 -174
- package/apps/lib/components/Stepper.tsx +0 -480
- package/apps/lib/components/Switch.tsx +0 -82
- package/apps/lib/components/TabFormItem.tsx +0 -153
- package/apps/lib/components/TabSwitch.tsx +0 -172
- package/apps/lib/components/Table.tsx +0 -610
- package/apps/lib/components/TextEditor/ChartBlockTool.ts +0 -676
- package/apps/lib/components/TextEditor/RichTextField.tsx +0 -46
- package/apps/lib/components/TextEditor/TableDnDWrapper.ts +0 -462
- package/apps/lib/components/TextEditor/TextEditor.tsx +0 -1164
- package/apps/lib/components/TextEditor/TextEditorToolbar.tsx +0 -429
- package/apps/lib/components/TextEditor/editor-tools/AlignmentTune.ts +0 -70
- package/apps/lib/components/TextEditor/editor-tools/ColorInlineTool.ts +0 -50
- package/apps/lib/components/TextEditor/editor-tools/StrikethroughInlineTool.ts +0 -48
- package/apps/lib/components/TextEditor/editor-tools/inlineFormat.ts +0 -98
- package/apps/lib/components/TextEditor/editorjs.d.ts +0 -60
- package/apps/lib/components/TextEditor/index.ts +0 -7
- package/apps/lib/components/TextEditor/markdownParser.ts +0 -346
- package/apps/lib/components/Textarea.tsx +0 -117
- package/apps/lib/components/Timeline.tsx +0 -263
- package/apps/lib/components/Toast.tsx +0 -87
- package/apps/lib/components/Toggle.tsx +0 -125
- package/apps/lib/components/ToggleButton.tsx +0 -140
- package/apps/lib/components/Tooltip.tsx +0 -116
- package/apps/lib/components/TransparentLabel.tsx +0 -71
- package/apps/lib/components/TreeDropDown.tsx +0 -115
- package/apps/lib/components/TreeFolder/TreeFolder.tsx +0 -380
- package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +0 -75
- package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +0 -354
- package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +0 -60
- package/apps/lib/components/TreeFolder/icons.tsx +0 -60
- package/apps/lib/components/TreeFolder/index.ts +0 -24
- package/apps/lib/components/TreeFolder/treeFolderUtils.ts +0 -109
- package/apps/lib/components/TreeFolder/types.ts +0 -77
- package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +0 -118
- package/apps/lib/hooks/useActiveTreeItem.ts +0 -58
- package/apps/lib/hooks/useClickOutside.ts +0 -27
- package/apps/lib/hooks/useDragDrop.tsx +0 -365
- package/apps/lib/hooks/useInfiniteScroll.ts +0 -108
- package/apps/lib/hooks/useIsMobile.ts +0 -21
- package/apps/lib/hooks/useResize.ts +0 -67
- package/apps/lib/hooks/useTagSelection.ts +0 -214
- package/apps/lib/layouts/CNLayout.tsx +0 -372
- package/apps/lib/layouts/DataViewCard.tsx +0 -62
- package/apps/lib/layouts/FieldSection.tsx +0 -91
- package/apps/lib/layouts/TreeSubLayout.tsx +0 -173
- package/apps/lib/providers/ThemeProvider.tsx +0 -84
- package/apps/lib/registry.json +0 -1201
- package/apps/lib/tsconfig.json +0 -9
- package/apps/lib/tsconfig.tsbuildinfo +0 -1
- package/apps/lib/utils/cn.ts +0 -6
- package/apps/lib/utils/color.ts +0 -175
- package/apps/lib/utils/dataViews/path.ts +0 -67
- package/apps/lib/utils/dataViews/query.ts +0 -73
- package/apps/lib/utils/dataViews/types.ts +0 -187
- package/apps/lib/utils/dateFormat.ts +0 -108
- package/apps/lib/utils/resize.ts +0 -31
- package/apps/lib/utils/types.ts +0 -16
- package/docs/BLOCKS.md +0 -129
- package/docs/CHANGELOG-1.1.16.md +0 -108
- package/docs/Cover.png +0 -0
- package/docs/README.md +0 -215
- package/docs/components/action-button.md +0 -638
- package/docs/components/actions-group.md +0 -708
- package/docs/components/alert-dialog.md +0 -920
- package/docs/components/avatar.md +0 -709
- package/docs/components/badge-field.md +0 -712
- package/docs/components/badge.md +0 -301
- package/docs/components/breadcrumb.md +0 -930
- package/docs/components/button-group.md +0 -650
- package/docs/components/button.md +0 -639
- package/docs/components/calendar.md +0 -555
- package/docs/components/card.md +0 -622
- package/docs/components/chart-block-tool.md +0 -129
- package/docs/components/checkbox.md +0 -699
- package/docs/components/cn-layout.md +0 -854
- package/docs/components/color-picker.md +0 -101
- package/docs/components/conclusion-header.md +0 -80
- package/docs/components/context-menu.md +0 -483
- package/docs/components/count-badge.md +0 -560
- package/docs/components/data-table.md +0 -854
- package/docs/components/data-views/backend-response.md +0 -324
- package/docs/components/data-views/examples/a11y-rtl.md +0 -250
- package/docs/components/data-views/examples/api-orders-route.md +0 -130
- package/docs/components/data-views/examples/fields.md +0 -362
- package/docs/components/data-views/examples/filters.md +0 -307
- package/docs/components/data-views/examples/inbox-routing.md +0 -218
- package/docs/components/data-views/examples/index.md +0 -29
- package/docs/components/data-views/examples/overview.md +0 -244
- package/docs/components/data-views/examples/panel.md +0 -212
- package/docs/components/data-views/examples/scale.md +0 -231
- package/docs/components/data-views/examples/server-side.md +0 -210
- package/docs/components/data-views/examples/state.md +0 -250
- package/docs/components/data-views/examples/tree-custom.md +0 -388
- package/docs/components/data-views/examples/view-registry.md +0 -313
- package/docs/components/data-views/examples/views.md +0 -534
- package/docs/components/data-views/guide.md +0 -405
- package/docs/components/data-views/index.md +0 -1495
- package/docs/components/data-views/migration.md +0 -79
- package/docs/components/date-picker.md +0 -857
- package/docs/components/dialog.md +0 -929
- package/docs/components/divider.md +0 -766
- package/docs/components/drawer.md +0 -654
- package/docs/components/dropdown-menu.md +0 -668
- package/docs/components/field-hint.md +0 -898
- package/docs/components/field-section.md +0 -781
- package/docs/components/form-builder.md +0 -276
- package/docs/components/form-renderer.md +0 -326
- package/docs/components/form-summary.md +0 -138
- package/docs/components/form.md +0 -785
- package/docs/components/header-bar.md +0 -188
- package/docs/components/image-attachment.md +0 -906
- package/docs/components/inner-label-field.md +0 -819
- package/docs/components/input-field.md +0 -623
- package/docs/components/input-otp.md +0 -756
- package/docs/components/input.md +0 -634
- package/docs/components/label-field.md +0 -770
- package/docs/components/label.md +0 -761
- package/docs/components/labeled-check-box.md +0 -642
- package/docs/components/labeled-radio.md +0 -796
- package/docs/components/link-button.md +0 -685
- package/docs/components/login-button.md +0 -872
- package/docs/components/password-level.md +0 -803
- package/docs/components/popover.md +0 -649
- package/docs/components/profile-menu.md +0 -656
- package/docs/components/radio-card.md +0 -801
- package/docs/components/radio.md +0 -735
- package/docs/components/scroll-area.md +0 -691
- package/docs/components/search-field.md +0 -702
- package/docs/components/searchable-select.md +0 -368
- package/docs/components/searchable-table.md +0 -438
- package/docs/components/searchable-tree-dialog.md +0 -190
- package/docs/components/searchable-tree.md +0 -200
- package/docs/components/section-block.md +0 -477
- package/docs/components/select.md +0 -709
- package/docs/components/simple-select.md +0 -741
- package/docs/components/skeleton.md +0 -706
- package/docs/components/slide-date-picker.md +0 -837
- package/docs/components/spin-loading.md +0 -696
- package/docs/components/stepper.md +0 -316
- package/docs/components/switch.md +0 -770
- package/docs/components/tab-form-item.md +0 -773
- package/docs/components/tab-switch.md +0 -170
- package/docs/components/table-dnd-wrapper.md +0 -107
- package/docs/components/table.md +0 -1088
- package/docs/components/text-editor.md +0 -735
- package/docs/components/textarea.md +0 -681
- package/docs/components/timeline.md +0 -254
- package/docs/components/toast.md +0 -773
- package/docs/components/toggle-button.md +0 -643
- package/docs/components/toggle.md +0 -882
- package/docs/components/tooltip.md +0 -513
- package/docs/components/transparent-label.md +0 -721
- package/docs/components/tree-drop-down.md +0 -740
- package/docs/components/tree-folder.md +0 -110
- package/docs/components/tree-sub-layout.md +0 -707
- package/docs/explanation/architecture.md +0 -54
- package/docs/explanation/design-system.md +0 -52
- package/docs/how-to/form-and-list-recipes.md +0 -386
- package/docs/how-to/forms-with-form-builder.md +0 -472
- package/docs/how-to/guides.md +0 -1027
- package/docs/migration/changelog.md +0 -54
- package/docs/migration/form-builder-2.5.2.md +0 -113
- package/docs/reference/cli.md +0 -112
- package/docs/reference/components.md +0 -572
- package/docs/reference/hooks.md +0 -1500
- package/docs/reference/providers.md +0 -866
- package/docs/reference/tailwind-plugins.md +0 -942
- package/docs/reference/theme.md +0 -85
- package/docs/reference/types.md +0 -1016
- package/docs/reference/utilities.md +0 -704
- package/docs/tutorials/building-first-form.md +0 -846
- package/docs/tutorials/component-composition.md +0 -882
- package/docs/tutorials/getting-started.md +0 -302
- package/docs/tutorials/theming-basics.md +0 -785
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cva, VariantProps } from "class-variance-authority";
|
|
3
|
-
import { cn } from "../utils/cn";
|
|
4
|
-
import React, { cloneElement, isValidElement, useEffect, useRef } from "react";
|
|
5
|
-
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
6
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
7
|
-
import { Themes } from "../utils/types";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
interface LocalPopOverProps extends VariantProps<typeof popoverStyles> {
|
|
11
|
-
variant?: "SystemStyle" | "PresentationStyle";
|
|
12
|
-
className?: string;
|
|
13
|
-
overlayBlur?: boolean;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Popover = PopoverPrimitive.Root;
|
|
17
|
-
|
|
18
|
-
const PopoverTrigger = React.forwardRef<
|
|
19
|
-
React.ElementRef<typeof PopoverPrimitive.Trigger>,
|
|
20
|
-
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger> & {
|
|
21
|
-
className?: string;
|
|
22
|
-
}
|
|
23
|
-
>(({ className, ...props }, ref) => (
|
|
24
|
-
<PopoverPrimitive.Trigger
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn("z-[20] transition-all duration-300 data-[state=open]:z-[49]", className)}
|
|
27
|
-
{...props}
|
|
28
|
-
/>
|
|
29
|
-
));
|
|
30
|
-
|
|
31
|
-
PopoverTrigger.displayName = PopoverPrimitive.Trigger.displayName;
|
|
32
|
-
|
|
33
|
-
const PopoverContent = React.forwardRef<
|
|
34
|
-
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
35
|
-
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> &
|
|
36
|
-
LocalPopOverProps & {
|
|
37
|
-
theme?: Themes;
|
|
38
|
-
}
|
|
39
|
-
>(
|
|
40
|
-
(
|
|
41
|
-
{
|
|
42
|
-
className,
|
|
43
|
-
align = "center",
|
|
44
|
-
sideOffset = 4,
|
|
45
|
-
variant = "PresentationStyle",
|
|
46
|
-
overlayBlur = false,
|
|
47
|
-
theme,
|
|
48
|
-
children,
|
|
49
|
-
...props
|
|
50
|
-
},
|
|
51
|
-
ref,
|
|
52
|
-
) => (
|
|
53
|
-
<PopoverPrimitive.Portal>
|
|
54
|
-
{overlayBlur ? (
|
|
55
|
-
<div className="relative z-[42]" data-theme={theme}>
|
|
56
|
-
<div className="fixed top-0 left-0 flex h-full w-full items-center flex-shrink-0 bg-[rgba(16,7,25,0.32)] backdrop-blur-[8px] transition-all duration-300"></div>
|
|
57
|
-
<PopoverPrimitive.Content
|
|
58
|
-
ref={ref}
|
|
59
|
-
align={align}
|
|
60
|
-
sideOffset={sideOffset}
|
|
61
|
-
className={cn(popoverStyles({ variant, overlayBlur }), className)}
|
|
62
|
-
{...props}
|
|
63
|
-
>
|
|
64
|
-
{children}
|
|
65
|
-
</PopoverPrimitive.Content>
|
|
66
|
-
</div>
|
|
67
|
-
) : (
|
|
68
|
-
<PopoverPrimitive.Content
|
|
69
|
-
data-theme={theme}
|
|
70
|
-
ref={ref}
|
|
71
|
-
align={align}
|
|
72
|
-
sideOffset={sideOffset}
|
|
73
|
-
className={cn(popoverStyles({ variant, overlayBlur }), className)}
|
|
74
|
-
{...props}
|
|
75
|
-
>
|
|
76
|
-
{children}
|
|
77
|
-
</PopoverPrimitive.Content>
|
|
78
|
-
)}
|
|
79
|
-
</PopoverPrimitive.Portal>
|
|
80
|
-
),
|
|
81
|
-
);
|
|
82
|
-
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
83
|
-
|
|
84
|
-
// Define the Props interface with a generic type parameter
|
|
85
|
-
interface Props<T extends React.ElementType = "li">
|
|
86
|
-
extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof PopoverItemStyles> {
|
|
87
|
-
asChild?: boolean;
|
|
88
|
-
as?: T; // The `as` prop can be any valid HTML element or React component
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// Define the PopoverItem component with a generic type parameter
|
|
92
|
-
const PopoverItem = <T extends React.ElementType = "li">({
|
|
93
|
-
variant = "Default",
|
|
94
|
-
size = "M",
|
|
95
|
-
asChild,
|
|
96
|
-
className,
|
|
97
|
-
children,
|
|
98
|
-
active,
|
|
99
|
-
as = "button" as T, // Default to "li" if `as` is not provided
|
|
100
|
-
...props
|
|
101
|
-
}: Props<T> & Omit<React.ComponentPropsWithoutRef<T>, keyof Props<T>>) => {
|
|
102
|
-
const Component = asChild ? Slot : as;
|
|
103
|
-
const ref = useRef<HTMLLIElement>(null);
|
|
104
|
-
|
|
105
|
-
// Scroll to the selected item when the dropdown is opened
|
|
106
|
-
useEffect(() => {
|
|
107
|
-
if (active && ref.current) {
|
|
108
|
-
ref.current.scrollIntoView({ behavior: "auto", block: "center" });
|
|
109
|
-
}
|
|
110
|
-
}, [active]);
|
|
111
|
-
|
|
112
|
-
const itemClassName = cn(PopoverItemStyles({ variant, size, active }), className);
|
|
113
|
-
|
|
114
|
-
// The styles are a two-layer chip (see `PopoverItemStyles`): this element is the container and
|
|
115
|
-
// the inner div is the row that lights up, which every `[&>div]:` rule targets. It therefore has
|
|
116
|
-
// to exist in both branches.
|
|
117
|
-
if (asChild && isValidElement(children)) {
|
|
118
|
-
// Slot merges the item's props onto the consumer's element (e.g. a Link), so the row div has to
|
|
119
|
-
// be injected as that element's child — wrapping the Link instead would move the class onto the
|
|
120
|
-
// wrapper and leave the anchor nested inside the item rather than being it.
|
|
121
|
-
const child = children as React.ReactElement<{ children?: React.ReactNode }>;
|
|
122
|
-
return (
|
|
123
|
-
<Slot className={itemClassName} ref={ref as React.Ref<HTMLElement>}>
|
|
124
|
-
{cloneElement(child, {}, <div>{child.props.children}</div>)}
|
|
125
|
-
</Slot>
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<Component
|
|
131
|
-
{...(props as React.ComponentPropsWithoutRef<T>)} // Spread the props dynamically
|
|
132
|
-
className={itemClassName}
|
|
133
|
-
ref={ref}
|
|
134
|
-
>
|
|
135
|
-
<div>{children}</div>
|
|
136
|
-
</Component>
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export { Popover, PopoverTrigger, PopoverContent, PopoverItem };
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const PopoverItemStyles = cva(
|
|
144
|
-
// `MenuItemStyles` (ContextMenu/DropdownMenu) minus its grey wrapper fill: same 2px gutter, same
|
|
145
|
-
// inner `<div>` that lights up on hover/focus, but the row itself stays transparent on the panel.
|
|
146
|
-
// `PopoverItem` always renders that inner div, including through `asChild`.
|
|
147
|
-
[
|
|
148
|
-
"text-content-presentation-global-primary-light typography-body-medium-regular",
|
|
149
|
-
"outline-none",
|
|
150
|
-
"border",
|
|
151
|
-
"border-transparent",
|
|
152
|
-
"flex w-full",
|
|
153
|
-
"shrink-0", // keep full row height so the popover scrolls instead of squishing
|
|
154
|
-
"items-center",
|
|
155
|
-
"justify-start",
|
|
156
|
-
"text-overflow",
|
|
157
|
-
"overflow-hidden",
|
|
158
|
-
"p-[2px]",
|
|
159
|
-
"transition-all",
|
|
160
|
-
// No `bg-[rgba(184,192,204,0.36)]` here, unlike the menu's item: a popover row sits directly on
|
|
161
|
-
// the panel with no grey container behind it. Everything else is the menu's rule set.
|
|
162
|
-
"ease-in-out",
|
|
163
|
-
"duration-300",
|
|
164
|
-
"[&>div]:flex",
|
|
165
|
-
"[&>div]:px-[12px]",
|
|
166
|
-
"[&>div]:py-[4px]",
|
|
167
|
-
"[&>div]:gap-2",
|
|
168
|
-
"[&>div]:w-full",
|
|
169
|
-
"[&>div]:rounded-[8px]",
|
|
170
|
-
"[&>div]:items-center",
|
|
171
|
-
"group",
|
|
172
|
-
],
|
|
173
|
-
{
|
|
174
|
-
variants: {
|
|
175
|
-
variant: {
|
|
176
|
-
// The menu marks its keyboard highlight with Radix's `data-highlighted` and its disabled
|
|
177
|
-
// rows with `data-disabled`; a PopoverItem is a plain <button>, so those become `:focus`
|
|
178
|
-
// and `:disabled` here. Everything else is the menu's rule set verbatim.
|
|
179
|
-
Default: [
|
|
180
|
-
"text-content-presentation-global-primary-light",
|
|
181
|
-
"[&>div]:hover:bg-white-50 [&>div]:hover:shadow-[0_0_16px_0_rgba(0,0,0,0.36)]",
|
|
182
|
-
"[&>div]:hover:text-black-1000",
|
|
183
|
-
"[&:focus>div]:bg-white-alpha-75",
|
|
184
|
-
"[&:focus>div]:text-black-1000",
|
|
185
|
-
"[&:disabled>div]:text-content-presentation-global-primary-light",
|
|
186
|
-
"[&:disabled>div]:opacity-50",
|
|
187
|
-
"[&:disabled>div]:hover:text-content-presentation-global-primary-light",
|
|
188
|
-
"[&:disabled>div]:hover:bg-transparent",
|
|
189
|
-
"[&:disabled>div]:hover:shadow-none",
|
|
190
|
-
],
|
|
191
|
-
Warning: [
|
|
192
|
-
"text-blue-sparkle-200",
|
|
193
|
-
"[&>div]:hover:bg-white-50 [&>div]:hover:shadow-[0_0_16px_0_rgba(0,0,0,0.36)]",
|
|
194
|
-
"[&>div]:hover:text-blue-sparkle-700",
|
|
195
|
-
"[&:focus>div]:bg-white-alpha-75",
|
|
196
|
-
"[&:focus>div]:text-blue-sparkle-700",
|
|
197
|
-
"[&:disabled>div]:text-content-presentation-global-primary-light",
|
|
198
|
-
"[&:disabled>div]:opacity-50",
|
|
199
|
-
"[&:disabled>div]:hover:text-content-presentation-global-primary-light",
|
|
200
|
-
"[&:disabled>div]:hover:bg-transparent",
|
|
201
|
-
"[&:disabled>div]:hover:shadow-none",
|
|
202
|
-
],
|
|
203
|
-
Negative: [
|
|
204
|
-
"text-medium-red-200",
|
|
205
|
-
"[&>div]:hover:bg-white-50 [&>div]:hover:shadow-[0_0_16px_0_rgba(0,0,0,0.36)]",
|
|
206
|
-
"[&>div]:hover:text-medium-red-600",
|
|
207
|
-
"[&:focus>div]:bg-white-alpha-75",
|
|
208
|
-
"[&:focus>div]:text-medium-red-600",
|
|
209
|
-
"[&:disabled>div]:text-content-presentation-global-primary-light",
|
|
210
|
-
"[&:disabled>div]:opacity-50",
|
|
211
|
-
"[&:disabled>div]:hover:text-content-presentation-global-primary-light",
|
|
212
|
-
"[&:disabled>div]:hover:bg-transparent",
|
|
213
|
-
"[&:disabled>div]:hover:shadow-none",
|
|
214
|
-
],
|
|
215
|
-
SystemStyle: [
|
|
216
|
-
"bg-background-system-body-primary",
|
|
217
|
-
"text-content-system-global-primary",
|
|
218
|
-
"hover:bg-background-system-action-secondary-hover",
|
|
219
|
-
"hover:text-content-system-action-primary-hover",
|
|
220
|
-
"hover:border-border-system-action-primary-hover",
|
|
221
|
-
"focus:bg-background-system-action-secondary-hover",
|
|
222
|
-
"focus:text-content-system-action-primary-hover",
|
|
223
|
-
"focus:border-border-system-action-primary-hover",
|
|
224
|
-
"disabled:bg-background-system-body-secondary",
|
|
225
|
-
"disabled:text-content-system-global-disabled",
|
|
226
|
-
],
|
|
227
|
-
},
|
|
228
|
-
size: {
|
|
229
|
-
S: ["typography-body-small-regular", "h-[24px]"],
|
|
230
|
-
M: ["typography-body-medium-regular", "h-[32px]"],
|
|
231
|
-
},
|
|
232
|
-
|
|
233
|
-
disabled: {
|
|
234
|
-
true: ["text-content-presentation-state-disabled", "bg-white-00"],
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
active: {
|
|
238
|
-
true: [
|
|
239
|
-
"bg-background-presentation-action-selected",
|
|
240
|
-
"text-content-presentation-action-light-primary",
|
|
241
|
-
],
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
// Same misplacement as `popoverStyles` — a sibling of `variants`, not one of them.
|
|
245
|
-
defaultVariants: {
|
|
246
|
-
variant: "Default",
|
|
247
|
-
size: "M",
|
|
248
|
-
active: false,
|
|
249
|
-
disabled: false,
|
|
250
|
-
},
|
|
251
|
-
compoundVariants: [
|
|
252
|
-
{
|
|
253
|
-
active: true,
|
|
254
|
-
variant: "Warning",
|
|
255
|
-
className: ["text-content-presentation-state-negative"],
|
|
256
|
-
},
|
|
257
|
-
],
|
|
258
|
-
},
|
|
259
|
-
);
|
|
260
|
-
|
|
261
|
-
const popoverStyles = cva(
|
|
262
|
-
[
|
|
263
|
-
// Cap at 200px but never exceed the room Radix actually has after collision handling, so a
|
|
264
|
-
// popover opened near a screen edge shrinks and scrolls instead of being cut off. Consumers that
|
|
265
|
-
// supply their own inner scroller override this with an inline `maxHeight`, which beats the class.
|
|
266
|
-
"p-1 max-h-[min(200px,var(--radix-popover-content-available-height,100vh))] z-[1000] shrink-0",
|
|
267
|
-
"rounded-[8px]",
|
|
268
|
-
"border",
|
|
269
|
-
"min-w-[240px]",
|
|
270
|
-
"outline-none",
|
|
271
|
-
"overflow-scroll",
|
|
272
|
-
"data-[state=open]:animate-in",
|
|
273
|
-
"data-[state=closed]:animate-out",
|
|
274
|
-
"data-[state=closed]:fade-out-0",
|
|
275
|
-
"data-[state=open]:fade-in-0",
|
|
276
|
-
"scrollbar-hide",
|
|
277
|
-
"overflow-x-hidden",
|
|
278
|
-
],
|
|
279
|
-
{
|
|
280
|
-
variants: {
|
|
281
|
-
variant: {
|
|
282
|
-
SystemStyle: [
|
|
283
|
-
"border-border-system-global-secondary",
|
|
284
|
-
"bg-background-system-body-primary",
|
|
285
|
-
"shadow-[0px_0px_18px_0px_rgba(0,0,0,0.75)]",
|
|
286
|
-
],
|
|
287
|
-
// Figma `Dropdown-Menu-1.0` (1735:159246) — the same surface `menuContentStyles` renders,
|
|
288
|
-
// so a popover and a dropdown menu are indistinguishable panels.
|
|
289
|
-
PresentationStyle: [
|
|
290
|
-
// `border-0`, not `border-transparent`: the base sets `border`, and with `border-box`
|
|
291
|
-
// that 1px sits on top of the 4px padding, making the panel 2px wider than the design.
|
|
292
|
-
"border-0",
|
|
293
|
-
"rounded-[14px]",
|
|
294
|
-
"backdrop-blur-[21px]",
|
|
295
|
-
// The design's fill is a raw `rgba(61,64,69,0.72)` with no Figma variable behind it, so it
|
|
296
|
-
// is spelled out exactly as DropdownMenu/ContextMenu already spell it. It has to be
|
|
297
|
-
// translucent: over the previous opaque `form-base` the backdrop-blur painted nothing.
|
|
298
|
-
"bg-[rgba(61,64,69,0.72)]",
|
|
299
|
-
"shadow-[0_0_32px_2px_rgba(0,0,0,0.20),0_0_48px_2px_rgba(0,0,0,0.05)]",
|
|
300
|
-
],
|
|
301
|
-
},
|
|
302
|
-
overlayBlur: {
|
|
303
|
-
true: ["h-fit"],
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
// Was nested inside `variants`, where cva reads it as a variant group called
|
|
307
|
-
// "defaultVariants" and no default is ever applied.
|
|
308
|
-
defaultVariants: {
|
|
309
|
-
variant: "PresentationStyle",
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
);
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode, useEffect, useState } from "react";
|
|
2
|
-
import { cva } from "class-variance-authority";
|
|
3
|
-
import { cn } from "../utils/cn";
|
|
4
|
-
import { Popover, PopoverContent, PopoverTrigger } from "./Popover";
|
|
5
|
-
|
|
6
|
-
// Define the base styles and variants using `cva`
|
|
7
|
-
export const profileItemStyles = cva(
|
|
8
|
-
"flex items-center justify-between group w-full p-[6px] outline-none rounded-[8px] fucus:bg-background-system-action-primary-selected active:bg-background-system-action-primary-selected transition-all ease-in-out duration-150",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
selected: {
|
|
12
|
-
true: "bg-background-system-action-primary-selected",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
interface ProfileItemProps extends HTMLAttributes<HTMLButtonElement> {
|
|
19
|
-
label: ReactNode;
|
|
20
|
-
selected?: boolean;
|
|
21
|
-
icon?: string;
|
|
22
|
-
theme?: "dark" | "light" | "default";
|
|
23
|
-
popoverChildren?: ReactNode;
|
|
24
|
-
overlayBlur?: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const ProfileMenu: React.FC<ProfileItemProps> = ({
|
|
28
|
-
label,
|
|
29
|
-
selected,
|
|
30
|
-
icon,
|
|
31
|
-
theme,
|
|
32
|
-
className,
|
|
33
|
-
popoverChildren,
|
|
34
|
-
overlayBlur,
|
|
35
|
-
...props
|
|
36
|
-
}) => {
|
|
37
|
-
const [isOpen, setIsOpen] = useState(selected);
|
|
38
|
-
const [dropdownWidth, setDropdownWidth] = useState(0);
|
|
39
|
-
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
setIsOpen(selected);
|
|
42
|
-
}, [selected]);
|
|
43
|
-
return (
|
|
44
|
-
<Popover onOpenChange={(open) => setIsOpen(open)}>
|
|
45
|
-
<PopoverTrigger asChild>
|
|
46
|
-
<button
|
|
47
|
-
{...props}
|
|
48
|
-
data-theme={theme}
|
|
49
|
-
className={cn(profileItemStyles({ selected }), className)}
|
|
50
|
-
onPointerDown={(e: React.PointerEvent<HTMLButtonElement>) => {
|
|
51
|
-
props.onPointerDown && props.onPointerDown(e);
|
|
52
|
-
setDropdownWidth(e.currentTarget.offsetWidth);
|
|
53
|
-
}}
|
|
54
|
-
>
|
|
55
|
-
<div className="flex items-center gap-2">
|
|
56
|
-
<div className="flex items-center">
|
|
57
|
-
<span className="h-[28px] w-[2px] bg-transparent group-hover:bg-[#9748FF] group-hover:mr-[6px] transition-all ease-in-out duration-150"></span>
|
|
58
|
-
<img className="w-[28px] h-[28px] rounded-full object-cover" src={icon} alt="" />
|
|
59
|
-
</div>
|
|
60
|
-
|
|
61
|
-
<p className={cn("typography-body-medium-medium text-content-system-global-primary")}>
|
|
62
|
-
{label}
|
|
63
|
-
</p>
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<i
|
|
67
|
-
className={cn(
|
|
68
|
-
"ri-arrow-down-s-line text-[18px] text-content-system-global-primary group-hover:text-[#9748FF] transition-all ease-in-out duration-150",
|
|
69
|
-
{ "rotate-180": isOpen && popoverChildren },
|
|
70
|
-
)}
|
|
71
|
-
></i>
|
|
72
|
-
</button>
|
|
73
|
-
</PopoverTrigger>
|
|
74
|
-
{popoverChildren && (
|
|
75
|
-
<PopoverContent
|
|
76
|
-
overlayBlur={overlayBlur}
|
|
77
|
-
style={{ width: `${dropdownWidth}px` }}
|
|
78
|
-
theme={theme}
|
|
79
|
-
>
|
|
80
|
-
{popoverChildren}
|
|
81
|
-
</PopoverContent>
|
|
82
|
-
)}
|
|
83
|
-
</Popover>
|
|
84
|
-
);
|
|
85
|
-
};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cn } from "../utils/cn";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
6
|
-
|
|
7
|
-
const RadioGroup = React.forwardRef<
|
|
8
|
-
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
9
|
-
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
|
10
|
-
>(({ className, ...props }, ref) => {
|
|
11
|
-
return (
|
|
12
|
-
<RadioGroupPrimitive.Root className={cn("grid gap-0.5", className)} {...props} ref={ref} />
|
|
13
|
-
);
|
|
14
|
-
});
|
|
15
|
-
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
16
|
-
|
|
17
|
-
const Radio = React.forwardRef<
|
|
18
|
-
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
|
19
|
-
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> & {
|
|
20
|
-
size?: "S" | "M";
|
|
21
|
-
}
|
|
22
|
-
>(({ className, size = "S", ...props }, ref) => {
|
|
23
|
-
return (
|
|
24
|
-
<RadioGroupPrimitive.Item
|
|
25
|
-
ref={ref}
|
|
26
|
-
className={cn(glareRadioStyles({ size }), className)}
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
<RadioGroupPrimitive.Indicator className="bg-white rounded-full flex items-center justify-center shrink-0">
|
|
30
|
-
<i className="ri-record-circle-fill text-background-presentation-state-information-primary leading-none shrink-0"></i>
|
|
31
|
-
</RadioGroupPrimitive.Indicator>
|
|
32
|
-
</RadioGroupPrimitive.Item>
|
|
33
|
-
);
|
|
34
|
-
});
|
|
35
|
-
Radio.displayName = "Radio";
|
|
36
|
-
|
|
37
|
-
export { RadioGroup, Radio };
|
|
38
|
-
|
|
39
|
-
const glareRadioStyles = cva(
|
|
40
|
-
[
|
|
41
|
-
"rounded-full shadow focus:outline-none flex items-center justify-center shrink-0",
|
|
42
|
-
"border border-border-presentation-action-checkbox-primary",
|
|
43
|
-
"bg-background-presentation-action-borderstyle",
|
|
44
|
-
"transition-[background,border-color,background-color] duration-200",
|
|
45
|
-
"hover:bg-blue-sparkle-alpha-15 hover:border-border-presentation-state-focus",
|
|
46
|
-
"checked:border-background-presentation-state-information-primary checked:hover:bg-white checked:bg-white",
|
|
47
|
-
"disabled:bg-background-presentation-action-disabled disabled:border-border-presentation-global-primary",
|
|
48
|
-
"disabled:cursor-not-allowed",
|
|
49
|
-
"data-[state=checked]:!border-none",
|
|
50
|
-
],
|
|
51
|
-
{
|
|
52
|
-
variants: {
|
|
53
|
-
size: {
|
|
54
|
-
S: ["w-[12px]", "h-[12px] [&_i]:text-[10px] [&_i]:scale-[1.5]"],
|
|
55
|
-
M: ["w-[24px]", "h-[24px] [&_i]:text-[20px] [&_i]:scale-[1.47]"],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
);
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { forwardRef, ReactNode } from "react";
|
|
2
|
-
import { cn } from "../utils/cn";
|
|
3
|
-
import { Radio } from "./Radio";
|
|
4
|
-
import { Card, CardContent, CardDescription, CardHeader } from "./Card";
|
|
5
|
-
|
|
6
|
-
interface Props extends Omit<React.ComponentProps<typeof Radio>, "size" | "value"> {
|
|
7
|
-
headerLabel?: ReactNode;
|
|
8
|
-
id: string;
|
|
9
|
-
description?: ReactNode;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
children?: ReactNode;
|
|
12
|
-
theme?: "dark" | "light" | "default";
|
|
13
|
-
value: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const RadioCard = forwardRef<HTMLInputElement, Props>(
|
|
17
|
-
({ headerLabel, description, disabled, className, id, children, theme, value, ...props }) => {
|
|
18
|
-
return (
|
|
19
|
-
<Card
|
|
20
|
-
data-theme={theme}
|
|
21
|
-
htmlFor={id}
|
|
22
|
-
as="label"
|
|
23
|
-
// The whole card is the radio's label — an interactive target, so it keeps the hover.
|
|
24
|
-
variant="clickable"
|
|
25
|
-
className={cn(
|
|
26
|
-
"relative [&>button]:data-[state=checked]:!border-none",
|
|
27
|
-
'[&:has(button[data-state="checked"])]:border-border-presentation-state-focus',
|
|
28
|
-
// Disabled state
|
|
29
|
-
disabled && "!bg-background-presentation-action-disabled",
|
|
30
|
-
disabled && "cursor-not-allowed",
|
|
31
|
-
disabled && "hover:border-border-presentation-global-primary",
|
|
32
|
-
className,
|
|
33
|
-
)}
|
|
34
|
-
>
|
|
35
|
-
<section className={"absolute top-0 left-0 w-full p-[10px] flex justify-end"}>
|
|
36
|
-
<Radio {...props} value={value} size="M" id={id} disabled={disabled} />
|
|
37
|
-
</section>
|
|
38
|
-
|
|
39
|
-
<CardHeader>{headerLabel}</CardHeader>
|
|
40
|
-
|
|
41
|
-
<CardContent>
|
|
42
|
-
{description && <CardDescription>{description}</CardDescription>}
|
|
43
|
-
{children}
|
|
44
|
-
</CardContent>
|
|
45
|
-
</Card>
|
|
46
|
-
);
|
|
47
|
-
},
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
RadioCard.displayName = "RadioCard";
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
5
|
-
|
|
6
|
-
import { cn } from "../utils/cn";
|
|
7
|
-
|
|
8
|
-
const ScrollArea = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
11
|
-
>(({ className, children, ...props }, ref) => (
|
|
12
|
-
<ScrollAreaPrimitive.Root
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
[
|
|
16
|
-
"relative overflow-hidden",
|
|
17
|
-
"border-border-presentation-global-primary",
|
|
18
|
-
"bg-background-presentation-form-base",
|
|
19
|
-
"shadow-[0px_0px_10px_0px_rgba(0,0,0,0.4),0px_4px_4px_0px_rgba(0,0,0,0.2)]",
|
|
20
|
-
],
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
>
|
|
25
|
-
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
26
|
-
{children}
|
|
27
|
-
</ScrollAreaPrimitive.Viewport>
|
|
28
|
-
<ScrollBar />
|
|
29
|
-
<ScrollAreaPrimitive.Corner />
|
|
30
|
-
</ScrollAreaPrimitive.Root>
|
|
31
|
-
));
|
|
32
|
-
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
33
|
-
|
|
34
|
-
const ScrollBar = React.forwardRef<
|
|
35
|
-
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
36
|
-
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
37
|
-
>(({ className, orientation = "vertical", ...props }, ref) => (
|
|
38
|
-
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
39
|
-
ref={ref}
|
|
40
|
-
orientation={orientation}
|
|
41
|
-
className={cn(
|
|
42
|
-
"flex touch-none select-none transition-colors",
|
|
43
|
-
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
44
|
-
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
45
|
-
className,
|
|
46
|
-
)}
|
|
47
|
-
{...props}
|
|
48
|
-
>
|
|
49
|
-
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
50
|
-
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
51
|
-
));
|
|
52
|
-
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
53
|
-
|
|
54
|
-
export { ScrollArea, ScrollBar };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { forwardRef, ReactNode } from "react";
|
|
2
|
-
import { Props, InputField } from "./InputField";
|
|
3
|
-
|
|
4
|
-
interface SearchProps extends Props {
|
|
5
|
-
Searchplaceholder?: ReactNode;
|
|
6
|
-
secondaryPlaceholder?: ReactNode;
|
|
7
|
-
childrenSide?: ReactNode;
|
|
8
|
-
}
|
|
9
|
-
// Use InputField types in the SearchInput component
|
|
10
|
-
export const SearchField = forwardRef<HTMLInputElement, SearchProps>(
|
|
11
|
-
({ Searchplaceholder, secondaryPlaceholder, childrenSide, ...props }, forwardedRef) => {
|
|
12
|
-
return (
|
|
13
|
-
<div className="mb-[10px] w-full h-fit justify-center items-center rounded-[12px] p-[3px] bg-[rgba(106,112,144,0.60)] shadow-[0px_0px_18px_0px_rgba(0,0,0,0.75)] backdrop-blur-[21px]">
|
|
14
|
-
<InputField
|
|
15
|
-
{...props}
|
|
16
|
-
ref={forwardedRef}
|
|
17
|
-
type="text"
|
|
18
|
-
variant="SystemStyle"
|
|
19
|
-
size="M"
|
|
20
|
-
className="h-[54px] rounded-[9px] p-[15px] border-border-system-global-primary bg-[rgba(0,0,0,0.60)]"
|
|
21
|
-
icon={
|
|
22
|
-
<SearchInputPlaceholder
|
|
23
|
-
value={props.value}
|
|
24
|
-
secondaryPlaceholder={secondaryPlaceholder}
|
|
25
|
-
Searchplaceholder={Searchplaceholder}
|
|
26
|
-
/>
|
|
27
|
-
}
|
|
28
|
-
childrenSide={childrenSide}
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
SearchField.displayName = " SearchField"; // Set displayName for debugging
|
|
36
|
-
|
|
37
|
-
function SearchInputPlaceholder({
|
|
38
|
-
Searchplaceholder,
|
|
39
|
-
secondaryPlaceholder,
|
|
40
|
-
value,
|
|
41
|
-
}: {
|
|
42
|
-
Searchplaceholder?: ReactNode;
|
|
43
|
-
secondaryPlaceholder?: ReactNode;
|
|
44
|
-
value?: string | number | readonly string[];
|
|
45
|
-
}) {
|
|
46
|
-
return (
|
|
47
|
-
<div className="flex gap-[10px] justify-center items-center ">
|
|
48
|
-
<i className="ri-search-2-line text-[24px] text-[#E5E5E5]"></i>
|
|
49
|
-
|
|
50
|
-
{value == "" ? (
|
|
51
|
-
<div className="flex gap-[5px] justify-center items-center ">
|
|
52
|
-
<p className="text-content-system-global-primary typography-headers-medium-regular leading-none opacity-[0.8]">
|
|
53
|
-
{Searchplaceholder}
|
|
54
|
-
</p>
|
|
55
|
-
<p className="text-content-system-global-primary typography-body-medium-medium leading-none opacity-30 mix-blend-luminosity mt-[2px]">
|
|
56
|
-
{secondaryPlaceholder}
|
|
57
|
-
</p>
|
|
58
|
-
</div>
|
|
59
|
-
) : null}
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
}
|