torch-glare 2.4.0 → 2.4.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.
- package/README.md +8 -0
- package/apps/lib/components/ActionButton.tsx +7 -12
- package/apps/lib/components/ActionsGroup.tsx +4 -15
- package/apps/lib/components/AlertDialog.tsx +173 -191
- package/apps/lib/components/Avatar.tsx +13 -16
- package/apps/lib/components/Badge.tsx +1 -3
- package/apps/lib/components/BadgeField.tsx +76 -71
- package/apps/lib/components/Breadcrumb.tsx +49 -85
- package/apps/lib/components/Button.tsx +20 -19
- package/apps/lib/components/ButtonGroup.tsx +31 -41
- package/apps/lib/components/Calendar.tsx +51 -29
- package/apps/lib/components/Card.tsx +2 -13
- package/apps/lib/components/ChartBlockTool.ts +17 -52
- package/apps/lib/components/Checkbox.tsx +9 -16
- package/apps/lib/components/ContextMenu.tsx +97 -96
- package/apps/lib/components/CountBadge.tsx +4 -6
- package/apps/lib/components/DataTable.tsx +196 -216
- package/apps/lib/components/DataViews/DataViewRadio.tsx +1 -6
- package/apps/lib/components/DataViews/DataViewsConfigPanel.tsx +13 -47
- package/apps/lib/components/DataViews/DataViewsHeader.tsx +1 -3
- package/apps/lib/components/DataViews/DataViewsLayout.tsx +5 -12
- package/apps/lib/components/DataViews/FilterPanel.tsx +155 -149
- package/apps/lib/components/DataViews/HeaderSearch.tsx +1 -5
- package/apps/lib/components/DataViews/InboxView.tsx +22 -68
- package/apps/lib/components/DataViews/InboxViewCard.tsx +68 -77
- package/apps/lib/components/DataViews/KanbanView.tsx +8 -25
- package/apps/lib/components/DataViews/PanelControls.tsx +3 -13
- package/apps/lib/components/DataViews/SettingsPanel.tsx +83 -89
- package/apps/lib/components/DataViews/TableView.tsx +8 -28
- package/apps/lib/components/DataViews/TreeView.tsx +12 -40
- package/apps/lib/components/DataViews/badgeAdapter.ts +32 -28
- package/apps/lib/components/DataViews/fieldRenderers.tsx +106 -141
- package/apps/lib/components/DataViews/filters/DatePickerRangeFilter.tsx +30 -23
- package/apps/lib/components/DataViews/filters/DateRangePopover.tsx +39 -32
- package/apps/lib/components/DataViews/filters/PresetChips.tsx +15 -15
- package/apps/lib/components/DataViews/filters/RangeSliderWithInputs.tsx +69 -58
- package/apps/lib/components/DataViews/index.ts +26 -26
- package/apps/lib/components/DataViews/tree/TreeDrawer.tsx +12 -16
- package/apps/lib/components/DataViews/tree/TreeSidebar.tsx +28 -31
- package/apps/lib/components/DataViews/types.ts +104 -115
- package/apps/lib/components/DatePicker.tsx +198 -196
- package/apps/lib/components/Dialog.tsx +92 -105
- package/apps/lib/components/Divider.tsx +21 -24
- package/apps/lib/components/Drawer.tsx +79 -139
- package/apps/lib/components/DropdownMenu.tsx +131 -171
- package/apps/lib/components/FieldHint.tsx +4 -11
- package/apps/lib/components/Form.tsx +146 -155
- package/apps/lib/components/FormStepper.tsx +9 -39
- package/apps/lib/components/HeaderBar.tsx +1 -9
- package/apps/lib/components/ImageAttachment.tsx +111 -73
- package/apps/lib/components/InnerLabelField.tsx +20 -16
- package/apps/lib/components/Input.tsx +171 -172
- package/apps/lib/components/InputField.tsx +44 -45
- package/apps/lib/components/InputOTP.tsx +68 -69
- package/apps/lib/components/Label.tsx +31 -35
- package/apps/lib/components/LabelField.tsx +4 -5
- package/apps/lib/components/LabeledCheckBox.tsx +8 -12
- package/apps/lib/components/LabeledRadio.tsx +7 -5
- package/apps/lib/components/LinkButton.tsx +2 -9
- package/apps/lib/components/LoginButton.tsx +4 -9
- package/apps/lib/components/PasswordLevel.tsx +5 -5
- package/apps/lib/components/Popover.tsx +15 -33
- package/apps/lib/components/ProfileMenu.tsx +67 -72
- package/apps/lib/components/Radio.tsx +1 -5
- package/apps/lib/components/RadioCard.tsx +9 -28
- package/apps/lib/components/ScrollArea.tsx +45 -43
- package/apps/lib/components/SearchField.tsx +49 -39
- package/apps/lib/components/SearchableSelect.tsx +8 -14
- package/apps/lib/components/SearchableTable.tsx +108 -118
- package/apps/lib/components/SearchableTree.tsx +469 -0
- package/apps/lib/components/SearchableTreeDialog.tsx +493 -0
- package/apps/lib/components/SectionBlock.tsx +4 -16
- package/apps/lib/components/Select.tsx +53 -80
- package/apps/lib/components/SimpleSelect.tsx +196 -187
- package/apps/lib/components/Skeleton.tsx +9 -12
- package/apps/lib/components/SlideDatePicker.tsx +215 -166
- package/apps/lib/components/SpinLoading.tsx +33 -49
- package/apps/lib/components/Stepper.tsx +13 -56
- package/apps/lib/components/Switch.tsx +8 -10
- package/apps/lib/components/TabFormItem.tsx +3 -12
- package/apps/lib/components/TabSwitch.tsx +7 -34
- package/apps/lib/components/Table.tsx +60 -75
- package/apps/lib/components/TableDnDWrapper.ts +15 -48
- package/apps/lib/components/TextEditor.tsx +93 -104
- package/apps/lib/components/Textarea.tsx +8 -12
- package/apps/lib/components/Timeline.tsx +21 -41
- package/apps/lib/components/Toast.tsx +83 -83
- package/apps/lib/components/Toggle.tsx +112 -114
- package/apps/lib/components/ToggleButton.tsx +1 -1
- package/apps/lib/components/Tooltip.tsx +24 -19
- package/apps/lib/components/TransparentLabel.tsx +61 -62
- package/apps/lib/components/TreeDropDown.tsx +86 -52
- package/apps/lib/components/TreeFolder/TreeFolder.tsx +15 -48
- package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +16 -21
- package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +9 -20
- package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +3 -3
- package/apps/lib/components/TreeFolder/icons.tsx +14 -17
- package/apps/lib/components/TreeFolder/index.ts +15 -8
- package/apps/lib/components/TreeFolder/treeFolderUtils.ts +47 -52
- package/apps/lib/components/TreeFolder/types.ts +32 -32
- package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +117 -123
- package/apps/lib/hooks/useActiveTreeItem.ts +52 -55
- package/apps/lib/hooks/useClickOutside.ts +21 -20
- package/apps/lib/hooks/useDataViewsState.ts +86 -80
- package/apps/lib/hooks/useIsMobile.ts +12 -12
- package/apps/lib/hooks/useResize.ts +54 -65
- package/apps/lib/hooks/useTagSelection.ts +201 -201
- package/apps/lib/layouts/CNLayout.tsx +181 -140
- package/apps/lib/layouts/DataViewCard.tsx +4 -18
- package/apps/lib/layouts/FieldSection.tsx +2 -6
- package/apps/lib/layouts/TreeSubLayout.tsx +24 -38
- package/apps/lib/providers/ThemeProvider.tsx +8 -23
- package/apps/lib/registry.json +1004 -0
- package/apps/lib/tsconfig.json +9 -0
- package/apps/lib/utils/cn.ts +1 -1
- package/apps/lib/utils/dataViews/columnUtils.ts +46 -44
- package/apps/lib/utils/dataViews/fieldUtils.ts +70 -71
- package/apps/lib/utils/dataViews/nestedDataUtils.tsx +129 -122
- package/apps/lib/utils/dataViews/pathUtils.ts +74 -67
- package/apps/lib/utils/dataViews/rangeUtils.ts +121 -112
- package/apps/lib/utils/dataViews/treeUtils.ts +204 -211
- package/apps/lib/utils/dateFormat.ts +64 -54
- package/apps/lib/utils/markdownParser.ts +2 -7
- package/apps/lib/utils/resize.ts +21 -25
- package/apps/lib/utils/types.ts +13 -13
- package/dist/bin/index.js +8 -2
- package/dist/bin/index.js.map +1 -1
- package/dist/src/shared/getAvailableFiles.d.ts.map +1 -1
- package/dist/src/shared/getAvailableFiles.js +6 -1
- package/dist/src/shared/getAvailableFiles.js.map +1 -1
- package/dist/src/shared/loadRegistry.d.ts +7 -0
- package/dist/src/shared/loadRegistry.d.ts.map +1 -0
- package/dist/src/shared/loadRegistry.js +31 -0
- package/dist/src/shared/loadRegistry.js.map +1 -0
- package/dist/src/shared/resolveInstallPlan.d.ts +12 -0
- package/dist/src/shared/resolveInstallPlan.d.ts.map +1 -0
- package/dist/src/shared/resolveInstallPlan.js +39 -0
- package/dist/src/shared/resolveInstallPlan.js.map +1 -0
- package/dist/src/types/main.d.ts +24 -0
- package/dist/src/types/main.d.ts.map +1 -1
- package/docs/README.md +10 -2
- package/docs/components/action-button.md +30 -24
- package/docs/components/actions-group.md +26 -20
- package/docs/components/alert-dialog.md +45 -45
- package/docs/components/avatar.md +6 -2
- package/docs/components/badge-field.md +6 -2
- package/docs/components/badge.md +7 -1
- package/docs/components/breadcrumb.md +15 -40
- package/docs/components/button-group.md +13 -10
- package/docs/components/button.md +58 -33
- package/docs/components/calendar.md +26 -19
- package/docs/components/card.md +19 -16
- package/docs/components/chart-block-tool.md +128 -0
- package/docs/components/checkbox.md +16 -8
- package/docs/components/cn-layout.md +7 -1
- package/docs/components/context-menu.md +18 -25
- package/docs/components/count-badge.md +7 -1
- package/docs/components/data-table.md +45 -33
- package/docs/components/data-views-config-panel.md +15 -11
- package/docs/components/data-views-layout.md +13 -16
- package/docs/components/date-picker.md +30 -23
- package/docs/components/dialog.md +43 -42
- package/docs/components/divider.md +10 -4
- package/docs/components/drawer.md +8 -33
- package/docs/components/dropdown-menu.md +25 -34
- package/docs/components/field-hint.md +37 -25
- package/docs/components/field-section.md +9 -3
- package/docs/components/form-stepper.md +6 -0
- package/docs/components/form.md +17 -20
- package/docs/components/header-bar.md +6 -0
- package/docs/components/image-attachment.md +33 -41
- package/docs/components/inbox-view.md +16 -5
- package/docs/components/inner-label-field.md +34 -24
- package/docs/components/input-field.md +18 -10
- package/docs/components/input-otp.md +14 -11
- package/docs/components/input.md +22 -16
- package/docs/components/kanban-view.md +15 -5
- package/docs/components/label-field.md +32 -22
- package/docs/components/label.md +43 -32
- package/docs/components/labeled-check-box.md +16 -8
- package/docs/components/labeled-radio.md +18 -11
- package/docs/components/link-button.md +7 -1
- package/docs/components/login-button.md +8 -2
- package/docs/components/password-level.md +37 -24
- package/docs/components/popover.md +26 -23
- package/docs/components/profile-menu.md +38 -27
- package/docs/components/radio-card.md +16 -9
- package/docs/components/radio.md +16 -8
- package/docs/components/scroll-area.md +6 -2
- package/docs/components/search-field.md +14 -6
- package/docs/components/searchable-select.md +19 -14
- package/docs/components/searchable-table.md +18 -13
- package/docs/components/searchable-tree-dialog.md +190 -0
- package/docs/components/searchable-tree.md +200 -0
- package/docs/components/section-block.md +12 -4
- package/docs/components/select.md +23 -18
- package/docs/components/simple-select.md +14 -10
- package/docs/components/skeleton.md +43 -33
- package/docs/components/slide-date-picker.md +37 -29
- package/docs/components/spin-loading.md +32 -23
- package/docs/components/stepper.md +6 -0
- package/docs/components/switch.md +14 -6
- package/docs/components/tab-form-item.md +7 -1
- package/docs/components/tab-switch.md +13 -6
- package/docs/components/table-dnd-wrapper.md +105 -0
- package/docs/components/table-view.md +15 -5
- package/docs/components/table.md +28 -28
- package/docs/components/text-editor.md +19 -13
- package/docs/components/textarea.md +15 -7
- package/docs/components/timeline.md +6 -0
- package/docs/components/toast.md +35 -26
- package/docs/components/toggle-button.md +24 -21
- package/docs/components/toggle.md +23 -15
- package/docs/components/tooltip.md +42 -30
- package/docs/components/transparent-label.md +29 -20
- package/docs/components/tree-drop-down.md +31 -23
- package/docs/components/tree-sub-layout.md +6 -2
- package/docs/components/tree-view.md +16 -5
- package/docs/explanation/architecture.md +54 -0
- package/docs/explanation/design-system.md +52 -0
- package/docs/how-to/data-views-from-backend-response.md +6 -4
- package/docs/how-to/guides.md +24 -18
- package/docs/migration/changelog.md +38 -0
- package/docs/reference/cli.md +87 -0
- package/docs/reference/components.md +11 -12
- package/docs/reference/hooks.md +8 -8
- package/docs/reference/providers.md +22 -22
- package/docs/reference/tailwind-plugins.md +2 -2
- package/docs/reference/theme.md +85 -0
- package/docs/reference/types.md +4 -4
- package/docs/reference/utilities.md +19 -26
- package/docs/tutorials/building-first-form.md +20 -13
- package/docs/tutorials/component-composition.md +34 -50
- package/docs/tutorials/getting-started.md +2 -2
- package/docs/tutorials/theming-basics.md +13 -10
- package/package.json +31 -3
- package/dist/src/commands/block.d.ts +0 -5
- package/dist/src/commands/block.d.ts.map +0 -1
- package/dist/src/commands/block.js +0 -255
- package/dist/src/commands/block.js.map +0 -1
- package/dist/src/shared/configureFonts.d.ts +0 -6
- package/dist/src/shared/configureFonts.d.ts.map +0 -1
- package/dist/src/shared/configureFonts.js +0 -106
- package/dist/src/shared/configureFonts.js.map +0 -1
- package/dist/src/shared/configureGlobalCss.d.ts +0 -6
- package/dist/src/shared/configureGlobalCss.d.ts.map +0 -1
- package/dist/src/shared/configureGlobalCss.js +0 -154
- package/dist/src/shared/configureGlobalCss.js.map +0 -1
- package/dist/src/shared/configureTailwind.d.ts +0 -7
- package/dist/src/shared/configureTailwind.d.ts.map +0 -1
- package/dist/src/shared/configureTailwind.js +0 -163
- package/dist/src/shared/configureTailwind.js.map +0 -1
- package/dist/src/shared/detectFramework.d.ts +0 -23
- package/dist/src/shared/detectFramework.d.ts.map +0 -1
- package/dist/src/shared/detectFramework.js +0 -119
- package/dist/src/shared/detectFramework.js.map +0 -1
- package/dist/src/shared/installBaseUtils.d.ts +0 -5
- package/dist/src/shared/installBaseUtils.d.ts.map +0 -1
- package/dist/src/shared/installBaseUtils.js +0 -79
- package/dist/src/shared/installBaseUtils.js.map +0 -1
- package/dist/src/shared/resolveAliases.d.ts +0 -24
- package/dist/src/shared/resolveAliases.d.ts.map +0 -1
- package/dist/src/shared/resolveAliases.js +0 -98
- package/dist/src/shared/resolveAliases.js.map +0 -1
|
@@ -16,11 +16,11 @@ const SelectValue = SelectPrimitive.Value;
|
|
|
16
16
|
const SelectTrigger = React.forwardRef<
|
|
17
17
|
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
18
18
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
VariantProps<typeof PopoverTriggerStyles> & {
|
|
20
|
+
errors?: string;
|
|
21
|
+
icon?: string;
|
|
22
|
+
theme?: Themes;
|
|
23
|
+
}
|
|
24
24
|
>(
|
|
25
25
|
(
|
|
26
26
|
{
|
|
@@ -33,7 +33,7 @@ const SelectTrigger = React.forwardRef<
|
|
|
33
33
|
icon,
|
|
34
34
|
...props
|
|
35
35
|
},
|
|
36
|
-
ref
|
|
36
|
+
ref,
|
|
37
37
|
) => {
|
|
38
38
|
return (
|
|
39
39
|
<Tooltip toolTipSide={"top"} open={errors !== undefined} text={errors}>
|
|
@@ -46,23 +46,25 @@ const SelectTrigger = React.forwardRef<
|
|
|
46
46
|
variant,
|
|
47
47
|
error: errors !== undefined,
|
|
48
48
|
}),
|
|
49
|
-
className
|
|
49
|
+
className,
|
|
50
50
|
)}
|
|
51
51
|
{...props}
|
|
52
52
|
>
|
|
53
|
-
<p
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
<p
|
|
54
|
+
className={cn({
|
|
55
|
+
"[&_span]:text-[#A0A0A0]": !props.value,
|
|
56
|
+
})}
|
|
57
|
+
>
|
|
58
|
+
{children}
|
|
59
|
+
</p>
|
|
56
60
|
|
|
57
61
|
<Button
|
|
58
62
|
as={"span"}
|
|
59
63
|
buttonType="icon"
|
|
60
|
-
className={cn(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
]
|
|
65
|
-
)}
|
|
64
|
+
className={cn([
|
|
65
|
+
"group-aria-expanded:bg-background-presentation-action-hover",
|
|
66
|
+
"group-aria-expanded:text-white",
|
|
67
|
+
])}
|
|
66
68
|
>
|
|
67
69
|
<i
|
|
68
70
|
className={cn(
|
|
@@ -71,14 +73,14 @@ const SelectTrigger = React.forwardRef<
|
|
|
71
73
|
{ "!text-[16px]": size === "M" },
|
|
72
74
|
{ "!text-[18px]": size === "L" },
|
|
73
75
|
{ "!text-[26px]": size === "XL" },
|
|
74
|
-
{ icon: icon }
|
|
76
|
+
{ icon: icon },
|
|
75
77
|
)}
|
|
76
78
|
/>
|
|
77
79
|
</Button>
|
|
78
80
|
</SelectPrimitive.Trigger>
|
|
79
81
|
</Tooltip>
|
|
80
82
|
);
|
|
81
|
-
}
|
|
83
|
+
},
|
|
82
84
|
);
|
|
83
85
|
SelectTrigger.displayName = "SelectTrigger";
|
|
84
86
|
|
|
@@ -88,10 +90,7 @@ const SelectScrollUpButton = React.forwardRef<
|
|
|
88
90
|
>(({ className, ...props }, ref) => (
|
|
89
91
|
<SelectPrimitive.ScrollUpButton
|
|
90
92
|
ref={ref}
|
|
91
|
-
className={cn(
|
|
92
|
-
"flex cursor-default items-center justify-center py-1 ",
|
|
93
|
-
className
|
|
94
|
-
)}
|
|
93
|
+
className={cn("flex cursor-default items-center justify-center py-1 ", className)}
|
|
95
94
|
{...props}
|
|
96
95
|
>
|
|
97
96
|
<i
|
|
@@ -108,10 +107,7 @@ const SelectScrollDownButton = React.forwardRef<
|
|
|
108
107
|
>(({ className, ...props }, ref) => (
|
|
109
108
|
<SelectPrimitive.ScrollDownButton
|
|
110
109
|
ref={ref}
|
|
111
|
-
className={cn(
|
|
112
|
-
"flex cursor-default items-center justify-center py-1",
|
|
113
|
-
className
|
|
114
|
-
)}
|
|
110
|
+
className={cn("flex cursor-default items-center justify-center py-1", className)}
|
|
115
111
|
{...props}
|
|
116
112
|
>
|
|
117
113
|
<i
|
|
@@ -125,20 +121,13 @@ SelectScrollDownButton.displayName = "SelectScrollDownButton";
|
|
|
125
121
|
const SelectContent = React.forwardRef<
|
|
126
122
|
React.ElementRef<typeof SelectPrimitive.Content>,
|
|
127
123
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
VariantProps<typeof SelectContentStyles> & {
|
|
125
|
+
theme?: Themes;
|
|
126
|
+
}
|
|
131
127
|
>(
|
|
132
128
|
(
|
|
133
|
-
{
|
|
134
|
-
|
|
135
|
-
children,
|
|
136
|
-
variant = "PresentationStyle",
|
|
137
|
-
position = "popper",
|
|
138
|
-
theme,
|
|
139
|
-
...props
|
|
140
|
-
},
|
|
141
|
-
ref
|
|
129
|
+
{ className, children, variant = "PresentationStyle", position = "popper", theme, ...props },
|
|
130
|
+
ref,
|
|
142
131
|
) => (
|
|
143
132
|
<SelectPrimitive.Portal>
|
|
144
133
|
<SelectPrimitive.Content
|
|
@@ -151,7 +140,7 @@ const SelectContent = React.forwardRef<
|
|
|
151
140
|
<SelectPrimitive.Viewport>{children}</SelectPrimitive.Viewport>
|
|
152
141
|
</SelectPrimitive.Content>
|
|
153
142
|
</SelectPrimitive.Portal>
|
|
154
|
-
)
|
|
143
|
+
),
|
|
155
144
|
);
|
|
156
145
|
SelectContent.displayName = "SelectContent";
|
|
157
146
|
|
|
@@ -170,28 +159,23 @@ SelectLabel.displayName = "SelectLabel";
|
|
|
170
159
|
const SelectItem = React.forwardRef<
|
|
171
160
|
React.ElementRef<typeof SelectPrimitive.Item>,
|
|
172
161
|
React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> &
|
|
173
|
-
|
|
174
|
-
>(
|
|
175
|
-
|
|
176
|
-
{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
>
|
|
191
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
192
|
-
</SelectPrimitive.Item>
|
|
193
|
-
)
|
|
194
|
-
);
|
|
162
|
+
VariantProps<typeof SelectItemStyles>
|
|
163
|
+
>(({ className, children, size = "M", variant = "Default", active, ...props }, ref) => (
|
|
164
|
+
<SelectPrimitive.Item
|
|
165
|
+
ref={ref}
|
|
166
|
+
className={cn(
|
|
167
|
+
SelectItemStyles({
|
|
168
|
+
variant,
|
|
169
|
+
active,
|
|
170
|
+
size,
|
|
171
|
+
}),
|
|
172
|
+
className,
|
|
173
|
+
)}
|
|
174
|
+
{...props}
|
|
175
|
+
>
|
|
176
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
177
|
+
</SelectPrimitive.Item>
|
|
178
|
+
));
|
|
195
179
|
|
|
196
180
|
SelectItem.displayName = "SelectItem";
|
|
197
181
|
|
|
@@ -220,7 +204,6 @@ export {
|
|
|
220
204
|
SelectScrollDownButton,
|
|
221
205
|
};
|
|
222
206
|
|
|
223
|
-
|
|
224
207
|
// NOTE: radix select as DropDownButton
|
|
225
208
|
|
|
226
209
|
const SelectContentStyles = cva(
|
|
@@ -257,7 +240,7 @@ const SelectContentStyles = cva(
|
|
|
257
240
|
variant: "PresentationStyle",
|
|
258
241
|
},
|
|
259
242
|
},
|
|
260
|
-
}
|
|
243
|
+
},
|
|
261
244
|
);
|
|
262
245
|
|
|
263
246
|
const SelectItemStyles = cva(
|
|
@@ -277,7 +260,6 @@ const SelectItemStyles = cva(
|
|
|
277
260
|
"transition-all",
|
|
278
261
|
"ease-in-out",
|
|
279
262
|
"duration-300",
|
|
280
|
-
|
|
281
263
|
],
|
|
282
264
|
{
|
|
283
265
|
variants: {
|
|
@@ -326,10 +308,7 @@ const SelectItemStyles = cva(
|
|
|
326
308
|
},
|
|
327
309
|
|
|
328
310
|
disabled: {
|
|
329
|
-
true: [
|
|
330
|
-
"text-content-presentation-state-disabled",
|
|
331
|
-
"bg-white-00",
|
|
332
|
-
],
|
|
311
|
+
true: ["text-content-presentation-state-disabled", "bg-white-00"],
|
|
333
312
|
},
|
|
334
313
|
|
|
335
314
|
active: {
|
|
@@ -353,7 +332,7 @@ const SelectItemStyles = cva(
|
|
|
353
332
|
className: ["text-content-presentation-state-negative"],
|
|
354
333
|
},
|
|
355
334
|
],
|
|
356
|
-
}
|
|
335
|
+
},
|
|
357
336
|
);
|
|
358
337
|
|
|
359
338
|
const PopoverTriggerStyles = cva(
|
|
@@ -398,15 +377,9 @@ const PopoverTriggerStyles = cva(
|
|
|
398
377
|
],
|
|
399
378
|
},
|
|
400
379
|
size: {
|
|
401
|
-
S: [
|
|
402
|
-
|
|
403
|
-
],
|
|
404
|
-
M: [
|
|
405
|
-
"[&_span]:h-[26px] [&_span]:w-[26px] [&_p]:typography-body-medium-medium",
|
|
406
|
-
],
|
|
407
|
-
L: [
|
|
408
|
-
"[&_span]:h-[28px] [&_span]:w-[28px] [&_p]:typography-body-large-medium",
|
|
409
|
-
],
|
|
380
|
+
S: ["[&_span]:h-[22px] [&_span]:w-[22px] [&_p]:typography-body-small-medium"],
|
|
381
|
+
M: ["[&_span]:h-[26px] [&_span]:w-[26px] [&_p]:typography-body-medium-medium"],
|
|
382
|
+
L: ["[&_span]:h-[28px] [&_span]:w-[28px] [&_p]:typography-body-large-medium"],
|
|
410
383
|
XL: [
|
|
411
384
|
"h-[40px] p-[4px] rounded-[6px] [&_span]:h-[32px] [&_span]:w-[32px] [&_p]:typography-body-large-regular [&_p]:px-[4px]",
|
|
412
385
|
],
|
|
@@ -415,5 +388,5 @@ const PopoverTriggerStyles = cva(
|
|
|
415
388
|
defaultVariants: {
|
|
416
389
|
size: "M",
|
|
417
390
|
},
|
|
418
|
-
}
|
|
419
|
-
);
|
|
391
|
+
},
|
|
392
|
+
);
|
|
@@ -4,213 +4,222 @@ import { cva } from "class-variance-authority";
|
|
|
4
4
|
import { HTMLAttributes, InputHTMLAttributes, ReactNode, useEffect, useRef, useState } from "react";
|
|
5
5
|
|
|
6
6
|
interface SimpleSelectDropDownProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
className?: string;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
onClick?: () => void;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
const SimpleSelectDropDown = ({ className, children, onClick }: SimpleSelectDropDownProps) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
return (
|
|
14
|
+
<div
|
|
15
|
+
className={cn(
|
|
16
|
+
"absolute min-w-[100px] z-[20] top-[27px] left-0",
|
|
17
|
+
dropdownMenuStyles({ variant: "SystemStyle" }),
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
onClick={onClick}
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
18
25
|
};
|
|
19
26
|
|
|
20
|
-
interface SimpleSelectItemProps
|
|
21
|
-
|
|
22
|
-
selected?: boolean
|
|
27
|
+
interface SimpleSelectItemProps extends HTMLAttributes<HTMLLIElement> {
|
|
28
|
+
selected?: boolean;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
const SimpleSelectItem = ({ selected, ...props }: SimpleSelectItemProps) => {
|
|
32
|
+
const ref = useRef<HTMLLIElement>(null);
|
|
26
33
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
34
|
+
// Scroll to the selected item when the dropdown is opened
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (selected && ref.current) {
|
|
37
|
+
ref.current.scrollIntoView({ behavior: "auto", block: "center" });
|
|
38
|
+
}
|
|
39
|
+
}, [selected]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<li
|
|
43
|
+
{...props}
|
|
44
|
+
ref={ref}
|
|
45
|
+
className={cn(
|
|
46
|
+
" whitespace-nowrap z-[9999]",
|
|
47
|
+
MenuItemStyles({ variant: "SystemStyle", selected: selected, size: "S" }),
|
|
48
|
+
)}
|
|
49
|
+
>
|
|
50
|
+
{props.children}
|
|
51
|
+
</li>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
42
54
|
|
|
43
|
-
interface SimpleSelectValueProps
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className?: string;
|
|
55
|
+
interface SimpleSelectValueProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
|
|
56
|
+
inputClassName?: string;
|
|
57
|
+
onChange?: (value: string) => void;
|
|
58
|
+
defaultOpen?: boolean;
|
|
59
|
+
className?: string;
|
|
49
60
|
}
|
|
50
61
|
|
|
51
62
|
const SimpleSelectValue = ({
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
63
|
+
inputClassName,
|
|
64
|
+
children,
|
|
65
|
+
onChange,
|
|
66
|
+
defaultOpen = false,
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
58
69
|
}: SimpleSelectValueProps) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
70
|
+
const [active, setActive] = useState(defaultOpen);
|
|
71
|
+
const sectionRef = useClickOutside<HTMLDivElement>(
|
|
72
|
+
() => setActive(false),
|
|
73
|
+
() => setActive(true),
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
77
|
+
if (onChange) {
|
|
78
|
+
onChange(e.target.value);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<div
|
|
84
|
+
ref={sectionRef}
|
|
85
|
+
className={cn([
|
|
86
|
+
"relative flex justify-between items-center",
|
|
87
|
+
"bg-black-alpha-20",
|
|
88
|
+
"text-white",
|
|
89
|
+
"border-[#2C2D2E]",
|
|
90
|
+
active ? "border-[#9748FF] bg-purple-alpha-10" : "",
|
|
91
|
+
"hover:border-[#9748FF]",
|
|
92
|
+
"hover:bg-purple-alpha-10",
|
|
93
|
+
"typography-body-small-regular leading-0",
|
|
94
|
+
"border",
|
|
95
|
+
"transition-all duration-200 ease-in-out",
|
|
96
|
+
"h-[26px]",
|
|
97
|
+
"w-fit",
|
|
98
|
+
"rounded-[6px]",
|
|
99
|
+
"outline-none",
|
|
100
|
+
"pl-[8px]",
|
|
101
|
+
className,
|
|
102
|
+
])}
|
|
103
|
+
>
|
|
104
|
+
<input
|
|
105
|
+
{...props}
|
|
106
|
+
onChange={handleInputChange}
|
|
107
|
+
className={cn(
|
|
108
|
+
[
|
|
109
|
+
"bg-transparent",
|
|
110
|
+
"text-content-system-global-primary",
|
|
111
|
+
"h-[24px]",
|
|
112
|
+
"border-none",
|
|
113
|
+
"outline-none",
|
|
114
|
+
"typography-body-small-regular leading-0",
|
|
115
|
+
],
|
|
116
|
+
inputClassName,
|
|
117
|
+
)}
|
|
118
|
+
/>
|
|
119
|
+
<button type="button" className="flex items-center">
|
|
120
|
+
<i
|
|
121
|
+
className={cn("ri-arrow-down-s-fill text-[12px] text-[#9748FF] px-1", {
|
|
122
|
+
"transform rotate-180": active,
|
|
123
|
+
})}
|
|
124
|
+
></i>
|
|
125
|
+
</button>
|
|
126
|
+
{children && active && (
|
|
127
|
+
<SimpleSelectDropDown onClick={() => setActive(false)}>{children}</SimpleSelectDropDown>
|
|
128
|
+
)}
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
116
131
|
};
|
|
117
132
|
|
|
118
133
|
export { SimpleSelectValue, SimpleSelectItem, SimpleSelectDropDown };
|
|
119
134
|
|
|
120
135
|
export const MenuItemStyles = cva(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
},
|
|
180
|
-
}
|
|
181
|
-
}
|
|
136
|
+
[
|
|
137
|
+
"text-content-presentation-action-light-primary",
|
|
138
|
+
"outline-none",
|
|
139
|
+
"border",
|
|
140
|
+
"border-transparent",
|
|
141
|
+
"flex",
|
|
142
|
+
"gap-[8px]",
|
|
143
|
+
"items-center",
|
|
144
|
+
"justify-start",
|
|
145
|
+
"text-overflow",
|
|
146
|
+
"overflow-hidden",
|
|
147
|
+
"px-[12px]",
|
|
148
|
+
"rounded-[4px]",
|
|
149
|
+
"transition-all",
|
|
150
|
+
"ease-in-out",
|
|
151
|
+
"duration-300",
|
|
152
|
+
],
|
|
153
|
+
{
|
|
154
|
+
variants: {
|
|
155
|
+
variant: {
|
|
156
|
+
SystemStyle: [
|
|
157
|
+
"bg-background-system-body-primary",
|
|
158
|
+
"text-content-system-global-primary",
|
|
159
|
+
"hover:!bg-background-system-action-secondary-hover",
|
|
160
|
+
"hover:!text-content-system-action-primary-hover",
|
|
161
|
+
"hover:!border-border-system-action-primary-hover",
|
|
162
|
+
"focus:bg-background-system-action-primary-hover",
|
|
163
|
+
"focus:border-transparent",
|
|
164
|
+
"active:border-transparent",
|
|
165
|
+
"active:bg-background-system-action-primary-hover",
|
|
166
|
+
"disabled:bg-background-system-body-secondary",
|
|
167
|
+
"disabled:text-content-system-global-disabled",
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
size: {
|
|
171
|
+
S: ["typography-body-small-regular", "h-[24px]"],
|
|
172
|
+
M: ["typography-body-medium-regular", "h-[32px]"],
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
disabled: {
|
|
176
|
+
true: ["text-content-presentation-state-disabled", "bg-white-00"],
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
selected: {
|
|
180
|
+
true: [
|
|
181
|
+
"bg-background-presentation-action-selected",
|
|
182
|
+
"text-content-presentation-action-light-primary",
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
defaultVariants: {
|
|
187
|
+
variant: "Default",
|
|
188
|
+
size: "M",
|
|
189
|
+
active: false,
|
|
190
|
+
disabled: false,
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
},
|
|
182
194
|
);
|
|
183
195
|
|
|
184
196
|
export const dropdownMenuStyles = cva(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
197
|
+
[
|
|
198
|
+
"p-1",
|
|
199
|
+
"rounded-[8px]",
|
|
200
|
+
"border",
|
|
201
|
+
"max-h-[200px]",
|
|
202
|
+
"outline-none",
|
|
203
|
+
"overflow-scroll",
|
|
204
|
+
"data-[state=open]:animate-in",
|
|
205
|
+
"data-[state=closed]:animate-out",
|
|
206
|
+
"data-[state=closed]:fade-out-0",
|
|
207
|
+
"data-[state=open]:fade-in-0",
|
|
208
|
+
"overflow-x-hidden",
|
|
209
|
+
"scrollbar-hide",
|
|
210
|
+
],
|
|
211
|
+
{
|
|
212
|
+
variants: {
|
|
213
|
+
variant: {
|
|
214
|
+
SystemStyle: [
|
|
215
|
+
"border-border-system-global-secondary",
|
|
216
|
+
"bg-background-system-body-primary",
|
|
217
|
+
"shadow-[0px_0px_18px_0px_rgba(0,0,0,0.75)]",
|
|
218
|
+
],
|
|
219
|
+
},
|
|
220
|
+
defaultVariants: {
|
|
221
|
+
variant: "SystemStyle",
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
},
|
|
213
225
|
);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|