@simplysm/solid 13.0.28 → 13.0.29
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 +6 -5
- package/dist/components/data/Pagination.d.ts.map +1 -1
- package/dist/components/data/Pagination.js.map +1 -1
- package/dist/components/data/calendar/Calendar.d.ts.map +1 -1
- package/dist/components/data/calendar/Calendar.js.map +1 -1
- package/dist/components/data/kanban/Kanban.d.ts.map +1 -1
- package/dist/components/data/kanban/Kanban.js +2 -2
- package/dist/components/data/kanban/Kanban.js.map +2 -2
- package/dist/components/data/list/List.d.ts.map +1 -1
- package/dist/components/data/list/List.js.map +1 -1
- package/dist/components/data/list/ListItem.d.ts.map +1 -1
- package/dist/components/data/list/ListItem.js.map +1 -1
- package/dist/components/data/permission-table/PermissionTable.d.ts.map +1 -1
- package/dist/components/data/permission-table/PermissionTable.js.map +1 -1
- package/dist/components/data/sheet/DataSheet.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheet.js.map +1 -1
- package/dist/components/data/sheet/DataSheet.styles.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheet.styles.js +23 -5
- package/dist/components/data/sheet/DataSheet.styles.js.map +1 -1
- package/dist/components/data/sheet/DataSheetColumn.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheetColumn.js.map +1 -1
- package/dist/components/data/sheet/DataSheetConfigDialog.d.ts.map +1 -1
- package/dist/components/data/sheet/DataSheetConfigDialog.js.map +1 -1
- package/dist/components/data/sheet/sheetUtils.d.ts.map +1 -1
- package/dist/components/data/sheet/sheetUtils.js.map +1 -1
- package/dist/components/disclosure/Collapse.d.ts.map +1 -1
- package/dist/components/disclosure/Collapse.js +0 -3
- package/dist/components/disclosure/Collapse.js.map +1 -1
- package/dist/components/disclosure/Dialog.d.ts.map +1 -1
- package/dist/components/disclosure/Dialog.js.map +1 -1
- package/dist/components/disclosure/DialogContext.d.ts.map +1 -1
- package/dist/components/disclosure/DialogContext.js.map +1 -1
- package/dist/components/disclosure/DialogProvider.d.ts.map +1 -1
- package/dist/components/disclosure/DialogProvider.js.map +1 -1
- package/dist/components/disclosure/Dropdown.d.ts.map +1 -1
- package/dist/components/disclosure/Dropdown.js.map +1 -1
- package/dist/components/disclosure/Tabs.d.ts.map +1 -1
- package/dist/components/disclosure/Tabs.js.map +1 -1
- package/dist/components/display/Alert.d.ts.map +1 -1
- package/dist/components/display/Alert.js.map +1 -1
- package/dist/components/display/Card.d.ts +0 -1
- package/dist/components/display/Card.d.ts.map +1 -1
- package/dist/components/display/Card.js +1 -2
- package/dist/components/display/Card.js.map +1 -1
- package/dist/components/display/Echarts.d.ts +1 -1
- package/dist/components/display/Echarts.d.ts.map +1 -1
- package/dist/components/display/Echarts.js +2 -2
- package/dist/components/display/Echarts.js.map +2 -2
- package/dist/components/display/Link.d.ts +5 -0
- package/dist/components/display/Link.d.ts.map +1 -0
- package/dist/components/display/Link.js +26 -0
- package/dist/components/display/Link.js.map +6 -0
- package/dist/components/feedback/busy/BusyContainer.d.ts +12 -0
- package/dist/components/feedback/busy/BusyContainer.d.ts.map +1 -0
- package/dist/components/feedback/{loading/LoadingContainer.js → busy/BusyContainer.js} +7 -7
- package/dist/components/feedback/busy/BusyContainer.js.map +6 -0
- package/dist/components/feedback/busy/BusyContext.d.ts +11 -0
- package/dist/components/feedback/busy/BusyContext.d.ts.map +1 -0
- package/dist/components/feedback/busy/BusyContext.js +14 -0
- package/dist/components/feedback/busy/BusyContext.js.map +6 -0
- package/dist/components/feedback/busy/BusyProvider.d.ts +7 -0
- package/dist/components/feedback/busy/BusyProvider.d.ts.map +1 -0
- package/dist/components/feedback/{loading/LoadingProvider.js → busy/BusyProvider.js} +7 -7
- package/dist/components/feedback/busy/BusyProvider.js.map +6 -0
- package/dist/components/feedback/notification/NotificationBanner.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationBanner.js.map +1 -1
- package/dist/components/feedback/notification/NotificationBell.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationBell.js.map +1 -1
- package/dist/components/feedback/notification/NotificationContext.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationContext.js.map +1 -1
- package/dist/components/feedback/notification/NotificationProvider.d.ts.map +1 -1
- package/dist/components/feedback/notification/NotificationProvider.js.map +1 -1
- package/dist/components/form-control/Button.d.ts.map +1 -1
- package/dist/components/form-control/Button.js +2 -2
- package/dist/components/form-control/Button.js.map +1 -1
- package/dist/components/form-control/DropdownTrigger.styles.d.ts.map +1 -1
- package/dist/components/form-control/DropdownTrigger.styles.js +6 -1
- package/dist/components/form-control/DropdownTrigger.styles.js.map +1 -1
- package/dist/components/form-control/Invalid.d.ts.map +1 -1
- package/dist/components/form-control/Invalid.js +1 -1
- package/dist/components/form-control/Invalid.js.map +1 -1
- package/dist/components/form-control/ThemeToggle.d.ts.map +1 -1
- package/dist/components/form-control/ThemeToggle.js.map +1 -1
- package/dist/components/form-control/checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/components/form-control/checkbox/Checkbox.styles.js +5 -1
- package/dist/components/form-control/checkbox/Checkbox.styles.js.map +1 -1
- package/dist/components/form-control/color-picker/ColorPicker.d.ts.map +1 -1
- package/dist/components/form-control/color-picker/ColorPicker.js.map +1 -1
- package/dist/components/form-control/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/form-control/combobox/Combobox.js +5 -5
- package/dist/components/form-control/combobox/Combobox.js.map +2 -2
- package/dist/components/form-control/editor/EditorToolbar.d.ts.map +1 -1
- package/dist/components/form-control/editor/EditorToolbar.js.map +1 -1
- package/dist/components/form-control/editor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/form-control/editor/RichTextEditor.js.map +1 -1
- package/dist/components/form-control/field/DatePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/DatePicker.js.map +1 -1
- package/dist/components/form-control/field/DateTimePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/DateTimePicker.js.map +1 -1
- package/dist/components/form-control/field/Field.styles.d.ts.map +1 -1
- package/dist/components/form-control/field/Field.styles.js +17 -3
- package/dist/components/form-control/field/Field.styles.js.map +1 -1
- package/dist/components/form-control/field/NumberInput.d.ts +3 -0
- package/dist/components/form-control/field/NumberInput.d.ts.map +1 -1
- package/dist/components/form-control/field/NumberInput.js +23 -5
- package/dist/components/form-control/field/NumberInput.js.map +2 -2
- package/dist/components/form-control/field/TextInput.d.ts +4 -1
- package/dist/components/form-control/field/TextInput.d.ts.map +1 -1
- package/dist/components/form-control/field/TextInput.js +23 -6
- package/dist/components/form-control/field/TextInput.js.map +2 -2
- package/dist/components/form-control/field/Textarea.d.ts.map +1 -1
- package/dist/components/form-control/field/Textarea.js.map +1 -1
- package/dist/components/form-control/field/TimePicker.d.ts.map +1 -1
- package/dist/components/form-control/field/TimePicker.js.map +1 -1
- package/dist/components/form-control/select/Select.d.ts.map +1 -1
- package/dist/components/form-control/select/Select.js.map +1 -1
- package/dist/components/form-control/select/SelectItem.d.ts.map +1 -1
- package/dist/components/form-control/select/SelectItem.js.map +1 -1
- package/dist/components/form-control/state-preset/StatePreset.d.ts.map +1 -1
- package/dist/components/form-control/state-preset/StatePreset.js.map +1 -1
- package/dist/components/layout/FormGroup.d.ts.map +1 -1
- package/dist/components/layout/FormGroup.js.map +1 -1
- package/dist/components/layout/sidebar/Sidebar.d.ts.map +1 -1
- package/dist/components/layout/sidebar/Sidebar.js +1 -1
- package/dist/components/layout/sidebar/Sidebar.js.map +1 -1
- package/dist/components/layout/sidebar/SidebarContainer.d.ts.map +1 -1
- package/dist/components/layout/sidebar/SidebarContainer.js.map +1 -1
- package/dist/components/layout/sidebar/SidebarMenu.js.map +1 -1
- package/dist/components/layout/sidebar/SidebarUser.d.ts.map +1 -1
- package/dist/components/layout/sidebar/SidebarUser.js +2 -2
- package/dist/components/layout/sidebar/SidebarUser.js.map +1 -1
- package/dist/components/layout/topbar/Topbar.js +1 -1
- package/dist/components/layout/topbar/TopbarMenu.d.ts.map +1 -1
- package/dist/components/layout/topbar/TopbarMenu.js.map +1 -1
- package/dist/components/layout/topbar/TopbarUser.d.ts.map +1 -1
- package/dist/components/layout/topbar/TopbarUser.js.map +1 -1
- package/dist/helpers/createAppStructure.d.ts.map +1 -1
- package/dist/helpers/createAppStructure.js +17 -12
- package/dist/helpers/createAppStructure.js.map +1 -1
- package/dist/helpers/mergeStyles.d.ts.map +1 -1
- package/dist/helpers/mergeStyles.js +4 -1
- package/dist/helpers/mergeStyles.js.map +1 -1
- package/dist/helpers/splitSlots.d.ts.map +1 -1
- package/dist/helpers/splitSlots.js.map +1 -1
- package/dist/hooks/createControllableSignal.d.ts.map +1 -1
- package/dist/hooks/createControllableSignal.js.map +1 -1
- package/dist/hooks/useClipboardValueCopy.js +3 -1
- package/dist/hooks/useClipboardValueCopy.js.map +1 -1
- package/dist/hooks/useLocalStorage.d.ts.map +1 -1
- package/dist/hooks/useLocalStorage.js.map +1 -1
- package/dist/hooks/usePrint.d.ts.map +1 -1
- package/dist/hooks/usePrint.js +5 -3
- package/dist/hooks/usePrint.js.map +1 -1
- package/dist/hooks/useRouterLink.d.ts.map +1 -1
- package/dist/hooks/useRouterLink.js.map +1 -1
- package/dist/hooks/useSyncConfig.d.ts +3 -3
- package/dist/hooks/useSyncConfig.js +4 -4
- package/dist/hooks/useSyncConfig.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/providers/ConfigContext.d.ts +2 -2
- package/dist/providers/ConfigContext.d.ts.map +1 -1
- package/dist/providers/InitializeProvider.js +3 -3
- package/dist/providers/InitializeProvider.js.map +2 -2
- package/dist/providers/ServiceClientProvider.d.ts.map +1 -1
- package/dist/providers/ServiceClientProvider.js.map +1 -1
- package/dist/providers/ThemeContext.d.ts.map +1 -1
- package/dist/providers/ThemeContext.js.map +1 -1
- package/dist/providers/shared-data/SharedDataChangeEvent.d.ts.map +1 -1
- package/dist/providers/shared-data/SharedDataChangeEvent.js +1 -3
- package/dist/providers/shared-data/SharedDataChangeEvent.js.map +1 -1
- package/dist/providers/shared-data/SharedDataContext.d.ts +1 -1
- package/dist/providers/shared-data/SharedDataContext.d.ts.map +1 -1
- package/dist/providers/shared-data/SharedDataProvider.d.ts.map +1 -1
- package/dist/providers/shared-data/SharedDataProvider.js +6 -6
- package/dist/providers/shared-data/SharedDataProvider.js.map +2 -2
- package/dist/styles/patterns.styles.js +1 -1
- package/dist/styles/tokens.styles.d.ts +1 -1
- package/dist/styles/tokens.styles.js +1 -1
- package/docs/display.md +19 -2
- package/docs/feedback.md +10 -10
- package/docs/hooks.md +6 -6
- package/docs/layout.md +3 -3
- package/docs/providers.md +1 -1
- package/package.json +3 -3
- package/src/components/data/Pagination.tsx +6 -1
- package/src/components/data/calendar/Calendar.tsx +18 -4
- package/src/components/data/kanban/Kanban.tsx +62 -18
- package/src/components/data/list/List.tsx +11 -4
- package/src/components/data/list/ListItem.tsx +12 -2
- package/src/components/data/permission-table/PermissionTable.tsx +32 -5
- package/src/components/data/sheet/DataSheet.styles.ts +23 -5
- package/src/components/data/sheet/DataSheet.tsx +100 -25
- package/src/components/data/sheet/DataSheetColumn.tsx +5 -1
- package/src/components/data/sheet/DataSheetConfigDialog.tsx +27 -5
- package/src/components/data/sheet/sheetUtils.ts +12 -3
- package/src/components/disclosure/Collapse.tsx +14 -3
- package/src/components/disclosure/Dialog.tsx +35 -6
- package/src/components/disclosure/DialogContext.ts +4 -1
- package/src/components/disclosure/DialogProvider.tsx +15 -3
- package/src/components/disclosure/Dropdown.tsx +12 -2
- package/src/components/disclosure/Tabs.tsx +29 -5
- package/src/components/display/Alert.tsx +3 -4
- package/src/components/display/Card.tsx +1 -2
- package/src/components/display/Echarts.tsx +12 -5
- package/src/components/display/Link.tsx +22 -0
- package/src/components/feedback/{loading/LoadingContainer.tsx → busy/BusyContainer.tsx} +43 -14
- package/src/components/feedback/busy/BusyContext.ts +20 -0
- package/src/components/feedback/{loading/LoadingProvider.tsx → busy/BusyProvider.tsx} +10 -10
- package/src/components/feedback/notification/NotificationBanner.tsx +13 -2
- package/src/components/feedback/notification/NotificationBell.tsx +17 -3
- package/src/components/feedback/notification/NotificationContext.ts +4 -1
- package/src/components/feedback/notification/NotificationProvider.tsx +3 -1
- package/src/components/form-control/Button.tsx +8 -3
- package/src/components/form-control/DropdownTrigger.styles.ts +7 -1
- package/src/components/form-control/Invalid.tsx +5 -1
- package/src/components/form-control/ThemeToggle.tsx +6 -2
- package/src/components/form-control/checkbox/Checkbox.styles.ts +5 -1
- package/src/components/form-control/color-picker/ColorPicker.tsx +15 -2
- package/src/components/form-control/combobox/Combobox.tsx +16 -8
- package/src/components/form-control/editor/EditorToolbar.tsx +16 -5
- package/src/components/form-control/editor/RichTextEditor.tsx +22 -4
- package/src/components/form-control/field/DatePicker.tsx +5 -1
- package/src/components/form-control/field/DateTimePicker.tsx +8 -1
- package/src/components/form-control/field/Field.styles.ts +17 -3
- package/src/components/form-control/field/NumberInput.tsx +24 -0
- package/src/components/form-control/field/TextInput.tsx +28 -5
- package/src/components/form-control/field/Textarea.tsx +2 -1
- package/src/components/form-control/field/TimePicker.tsx +5 -1
- package/src/components/form-control/select/Select.tsx +32 -7
- package/src/components/form-control/select/SelectItem.tsx +3 -1
- package/src/components/form-control/state-preset/StatePreset.tsx +39 -14
- package/src/components/layout/FormGroup.tsx +11 -2
- package/src/components/layout/sidebar/Sidebar.tsx +3 -2
- package/src/components/layout/sidebar/SidebarContainer.tsx +8 -1
- package/src/components/layout/sidebar/SidebarMenu.tsx +7 -1
- package/src/components/layout/sidebar/SidebarUser.tsx +9 -4
- package/src/components/layout/topbar/Topbar.tsx +1 -1
- package/src/components/layout/topbar/TopbarMenu.tsx +27 -5
- package/src/components/layout/topbar/TopbarUser.tsx +5 -1
- package/src/helpers/createAppStructure.ts +29 -15
- package/src/helpers/mergeStyles.ts +6 -2
- package/src/helpers/splitSlots.ts +4 -1
- package/src/hooks/createControllableSignal.ts +2 -1
- package/src/hooks/useClipboardValueCopy.ts +5 -2
- package/src/hooks/useLocalStorage.ts +3 -1
- package/src/hooks/usePrint.ts +9 -4
- package/src/hooks/useRouterLink.ts +3 -1
- package/src/hooks/useSyncConfig.ts +7 -7
- package/src/index.ts +5 -4
- package/src/providers/ConfigContext.ts +2 -2
- package/src/providers/InitializeProvider.tsx +2 -2
- package/src/providers/ServiceClientProvider.tsx +14 -3
- package/src/providers/ThemeContext.tsx +10 -2
- package/src/providers/shared-data/SharedDataChangeEvent.ts +4 -3
- package/src/providers/shared-data/SharedDataContext.ts +1 -1
- package/src/providers/shared-data/SharedDataProvider.tsx +13 -8
- package/src/styles/patterns.styles.ts +1 -1
- package/src/styles/tokens.styles.ts +1 -1
- package/tailwind.config.ts +9 -0
- package/tailwind.css +1 -1
- package/dist/components/display/Card.css +0 -15
- package/dist/components/feedback/loading/LoadingContainer.d.ts +0 -12
- package/dist/components/feedback/loading/LoadingContainer.d.ts.map +0 -1
- package/dist/components/feedback/loading/LoadingContainer.js.map +0 -6
- package/dist/components/feedback/loading/LoadingContext.d.ts +0 -11
- package/dist/components/feedback/loading/LoadingContext.d.ts.map +0 -1
- package/dist/components/feedback/loading/LoadingContext.js +0 -14
- package/dist/components/feedback/loading/LoadingContext.js.map +0 -6
- package/dist/components/feedback/loading/LoadingProvider.d.ts +0 -7
- package/dist/components/feedback/loading/LoadingProvider.d.ts.map +0 -1
- package/dist/components/feedback/loading/LoadingProvider.js.map +0 -6
- package/src/components/display/Card.css +0 -15
- package/src/components/feedback/loading/LoadingContext.ts +0 -20
- /package/dist/components/feedback/{loading/LoadingContainer.css → busy/BusyContainer.css} +0 -0
- /package/src/components/feedback/{loading/LoadingContainer.css → busy/BusyContainer.css} +0 -0
|
@@ -79,7 +79,14 @@ function parseValue(str: string, unit: DateTimePickerUnit): DateTime | undefined
|
|
|
79
79
|
// yyyy-MM-ddTHH:mm 형식
|
|
80
80
|
const match = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(str);
|
|
81
81
|
if (match == null) return undefined;
|
|
82
|
-
return new DateTime(
|
|
82
|
+
return new DateTime(
|
|
83
|
+
Number(match[1]),
|
|
84
|
+
Number(match[2]),
|
|
85
|
+
Number(match[3]),
|
|
86
|
+
Number(match[4]),
|
|
87
|
+
Number(match[5]),
|
|
88
|
+
0,
|
|
89
|
+
);
|
|
83
90
|
}
|
|
84
91
|
case "second": {
|
|
85
92
|
// yyyy-MM-ddTHH:mm:ss 형식
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import { type ComponentSize, paddingLg, paddingSm, paddingXl } from "../../../styles/tokens.styles";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
fieldSurface,
|
|
5
|
+
insetBase,
|
|
6
|
+
insetFocusOutline,
|
|
7
|
+
inputBase,
|
|
8
|
+
} from "../../../styles/patterns.styles";
|
|
4
9
|
|
|
5
10
|
export type FieldSize = ComponentSize;
|
|
6
11
|
|
|
7
12
|
// 기본 wrapper 스타일
|
|
8
|
-
export const fieldBaseClass = clsx(
|
|
13
|
+
export const fieldBaseClass = clsx(
|
|
14
|
+
"inline-flex items-center",
|
|
15
|
+
fieldSurface,
|
|
16
|
+
"px-2 py-1",
|
|
17
|
+
"h-field",
|
|
18
|
+
);
|
|
9
19
|
|
|
10
20
|
// 사이즈별 스타일
|
|
11
21
|
export const fieldSizeClasses: Record<FieldSize, string> = {
|
|
@@ -15,7 +25,11 @@ export const fieldSizeClasses: Record<FieldSize, string> = {
|
|
|
15
25
|
};
|
|
16
26
|
|
|
17
27
|
// inset 스타일
|
|
18
|
-
export const fieldInsetClass = clsx(
|
|
28
|
+
export const fieldInsetClass = clsx(
|
|
29
|
+
insetBase,
|
|
30
|
+
"bg-primary-50 dark:bg-primary-950/30",
|
|
31
|
+
insetFocusOutline,
|
|
32
|
+
);
|
|
19
33
|
|
|
20
34
|
// inset 높이 (border 2px 제외)
|
|
21
35
|
export const fieldInsetHeightClass = "h-field-inset";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Component, type JSX, Show, splitProps, createSignal, createEffect } from "solid-js";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import type { IconProps as TablerIconProps } from "@tabler/icons-solidjs";
|
|
4
5
|
import { createControllableSignal } from "../../../hooks/createControllableSignal";
|
|
5
6
|
import {
|
|
6
7
|
type FieldSize,
|
|
@@ -13,6 +14,7 @@ import {
|
|
|
13
14
|
fieldInputClass,
|
|
14
15
|
} from "./Field.styles";
|
|
15
16
|
import { textMuted } from "../../../styles/tokens.styles";
|
|
17
|
+
import { Icon } from "../../display/Icon";
|
|
16
18
|
|
|
17
19
|
// NumberInput 전용 input 스타일 (우측 정렬 + 스피너 숨김)
|
|
18
20
|
const numberInputClass = clsx(
|
|
@@ -58,6 +60,9 @@ export interface NumberInputProps {
|
|
|
58
60
|
|
|
59
61
|
/** 커스텀 style */
|
|
60
62
|
style?: JSX.CSSProperties;
|
|
63
|
+
|
|
64
|
+
/** 접두 아이콘 */
|
|
65
|
+
prefixIcon?: Component<TablerIconProps>;
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
/**
|
|
@@ -163,6 +168,7 @@ export const NumberInput: Component<NumberInputProps> = (props) => {
|
|
|
163
168
|
"readonly",
|
|
164
169
|
"size",
|
|
165
170
|
"inset",
|
|
171
|
+
"prefixIcon",
|
|
166
172
|
"class",
|
|
167
173
|
"style",
|
|
168
174
|
]);
|
|
@@ -235,6 +241,14 @@ export const NumberInput: Component<NumberInputProps> = (props) => {
|
|
|
235
241
|
const getWrapperClass = (includeCustomClass: boolean) =>
|
|
236
242
|
twMerge(
|
|
237
243
|
fieldBaseClass,
|
|
244
|
+
local.prefixIcon &&
|
|
245
|
+
(local.size === "sm"
|
|
246
|
+
? "gap-1.5"
|
|
247
|
+
: local.size === "lg"
|
|
248
|
+
? "gap-3"
|
|
249
|
+
: local.size === "xl"
|
|
250
|
+
? "gap-4"
|
|
251
|
+
: "gap-2"),
|
|
238
252
|
local.size && fieldSizeClasses[local.size],
|
|
239
253
|
local.disabled && fieldDisabledClass,
|
|
240
254
|
local.inset && fieldInsetClass,
|
|
@@ -245,6 +259,12 @@ export const NumberInput: Component<NumberInputProps> = (props) => {
|
|
|
245
259
|
|
|
246
260
|
const isEditable = () => !local.disabled && !local.readonly;
|
|
247
261
|
|
|
262
|
+
const prefixIconEl = () => (
|
|
263
|
+
<Show when={local.prefixIcon}>
|
|
264
|
+
<Icon icon={local.prefixIcon!} class="shrink-0 opacity-70" />
|
|
265
|
+
</Show>
|
|
266
|
+
);
|
|
267
|
+
|
|
248
268
|
return (
|
|
249
269
|
<Show
|
|
250
270
|
when={local.inset}
|
|
@@ -260,6 +280,7 @@ export const NumberInput: Component<NumberInputProps> = (props) => {
|
|
|
260
280
|
style={local.style}
|
|
261
281
|
title={local.title}
|
|
262
282
|
>
|
|
283
|
+
{prefixIconEl()}
|
|
263
284
|
{formatNumber(value(), local.comma ?? true, local.minDigits) ||
|
|
264
285
|
(local.placeholder != null && local.placeholder !== "" ? (
|
|
265
286
|
<span class={textMuted}>{local.placeholder}</span>
|
|
@@ -270,6 +291,7 @@ export const NumberInput: Component<NumberInputProps> = (props) => {
|
|
|
270
291
|
}
|
|
271
292
|
>
|
|
272
293
|
<div {...rest} data-number-field class={getWrapperClass(true)} style={local.style}>
|
|
294
|
+
{prefixIconEl()}
|
|
273
295
|
<input
|
|
274
296
|
type="text"
|
|
275
297
|
inputmode="numeric"
|
|
@@ -293,6 +315,7 @@ export const NumberInput: Component<NumberInputProps> = (props) => {
|
|
|
293
315
|
style={{ visibility: isEditable() ? "hidden" : undefined }}
|
|
294
316
|
title={local.title}
|
|
295
317
|
>
|
|
318
|
+
{prefixIconEl()}
|
|
296
319
|
{formatNumber(value(), local.comma ?? true, local.minDigits) ||
|
|
297
320
|
(local.placeholder != null && local.placeholder !== "" ? (
|
|
298
321
|
<span class={textMuted}>{local.placeholder}</span>
|
|
@@ -303,6 +326,7 @@ export const NumberInput: Component<NumberInputProps> = (props) => {
|
|
|
303
326
|
|
|
304
327
|
<Show when={isEditable()}>
|
|
305
328
|
<div class={twMerge(getWrapperClass(false), "absolute left-0 top-0 size-full")}>
|
|
329
|
+
{prefixIconEl()}
|
|
306
330
|
<input
|
|
307
331
|
type="text"
|
|
308
332
|
inputmode="numeric"
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import { type Component, createEffect, type JSX, Show, splitProps } from "solid-js";
|
|
3
3
|
import { twMerge } from "tailwind-merge";
|
|
4
|
+
import type { IconProps as TablerIconProps } from "@tabler/icons-solidjs";
|
|
4
5
|
import { createControllableSignal } from "../../../hooks/createControllableSignal";
|
|
5
6
|
import { createIMEHandler } from "../../../hooks/createIMEHandler";
|
|
6
7
|
import {
|
|
7
|
-
type FieldSize,
|
|
8
8
|
fieldBaseClass,
|
|
9
|
-
|
|
9
|
+
fieldDisabledClass,
|
|
10
|
+
fieldInputClass,
|
|
10
11
|
fieldInsetClass,
|
|
11
12
|
fieldInsetHeightClass,
|
|
12
13
|
fieldInsetSizeHeightClasses,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
type FieldSize,
|
|
15
|
+
fieldSizeClasses,
|
|
15
16
|
} from "./Field.styles";
|
|
16
17
|
import { textMuted } from "../../../styles/tokens.styles";
|
|
18
|
+
import { Icon } from "../../display/Icon";
|
|
17
19
|
|
|
18
20
|
type TextInputType = "text" | "password" | "email";
|
|
19
21
|
|
|
@@ -34,7 +36,7 @@ export interface TextInputProps {
|
|
|
34
36
|
title?: string;
|
|
35
37
|
|
|
36
38
|
/** 자동완성 */
|
|
37
|
-
autocomplete?:
|
|
39
|
+
autocomplete?: JSX.HTMLAutocomplete;
|
|
38
40
|
|
|
39
41
|
/** 비활성화 */
|
|
40
42
|
disabled?: boolean;
|
|
@@ -51,6 +53,9 @@ export interface TextInputProps {
|
|
|
51
53
|
/** 입력 포맷 (예: XXX-XXXX-XXXX) */
|
|
52
54
|
format?: string;
|
|
53
55
|
|
|
56
|
+
/** 접두 아이콘 */
|
|
57
|
+
prefixIcon?: Component<TablerIconProps>;
|
|
58
|
+
|
|
54
59
|
/** 커스텀 class */
|
|
55
60
|
class?: string;
|
|
56
61
|
|
|
@@ -132,6 +137,7 @@ export const TextInput: Component<TextInputProps> = (props) => {
|
|
|
132
137
|
"size",
|
|
133
138
|
"inset",
|
|
134
139
|
"format",
|
|
140
|
+
"prefixIcon",
|
|
135
141
|
"class",
|
|
136
142
|
"style",
|
|
137
143
|
]);
|
|
@@ -188,6 +194,14 @@ export const TextInput: Component<TextInputProps> = (props) => {
|
|
|
188
194
|
const getWrapperClass = (includeCustomClass: boolean) =>
|
|
189
195
|
twMerge(
|
|
190
196
|
fieldBaseClass,
|
|
197
|
+
local.prefixIcon &&
|
|
198
|
+
(local.size === "sm"
|
|
199
|
+
? "gap-1.5"
|
|
200
|
+
: local.size === "lg"
|
|
201
|
+
? "gap-3"
|
|
202
|
+
: local.size === "xl"
|
|
203
|
+
? "gap-4"
|
|
204
|
+
: "gap-2"),
|
|
191
205
|
local.size && fieldSizeClasses[local.size],
|
|
192
206
|
local.disabled && fieldDisabledClass,
|
|
193
207
|
local.inset && fieldInsetClass,
|
|
@@ -199,6 +213,12 @@ export const TextInput: Component<TextInputProps> = (props) => {
|
|
|
199
213
|
// 편집 가능 여부
|
|
200
214
|
const isEditable = () => !local.disabled && !local.readonly;
|
|
201
215
|
|
|
216
|
+
const prefixIconEl = () => (
|
|
217
|
+
<Show when={local.prefixIcon}>
|
|
218
|
+
<Icon icon={local.prefixIcon!} class="shrink-0 opacity-70" />
|
|
219
|
+
</Show>
|
|
220
|
+
);
|
|
221
|
+
|
|
202
222
|
// disabled 전환 시 미커밋 조합 값 flush
|
|
203
223
|
createEffect(() => {
|
|
204
224
|
if (!isEditable()) {
|
|
@@ -221,6 +241,7 @@ export const TextInput: Component<TextInputProps> = (props) => {
|
|
|
221
241
|
style={local.style}
|
|
222
242
|
title={local.title}
|
|
223
243
|
>
|
|
244
|
+
{prefixIconEl()}
|
|
224
245
|
{displayValue() ||
|
|
225
246
|
(local.placeholder != null && local.placeholder !== "" ? (
|
|
226
247
|
<span class={textMuted}>{local.placeholder}</span>
|
|
@@ -231,6 +252,7 @@ export const TextInput: Component<TextInputProps> = (props) => {
|
|
|
231
252
|
}
|
|
232
253
|
>
|
|
233
254
|
<div {...rest} data-text-field class={getWrapperClass(true)} style={local.style}>
|
|
255
|
+
{prefixIconEl()}
|
|
234
256
|
<input
|
|
235
257
|
type={local.type ?? "text"}
|
|
236
258
|
class={fieldInputClass}
|
|
@@ -254,6 +276,7 @@ export const TextInput: Component<TextInputProps> = (props) => {
|
|
|
254
276
|
style={local.style}
|
|
255
277
|
>
|
|
256
278
|
<div data-text-field-content style={{ visibility: isEditable() ? "hidden" : undefined }}>
|
|
279
|
+
{prefixIconEl()}
|
|
257
280
|
{displayValue() ||
|
|
258
281
|
(local.placeholder != null && local.placeholder !== "" ? (
|
|
259
282
|
<span class={textMuted}>{local.placeholder}</span>
|
|
@@ -128,7 +128,8 @@ export const Textarea: Component<TextareaProps> = (props) => {
|
|
|
128
128
|
const contentForHeight = () => {
|
|
129
129
|
const rows = local.minRows ?? 1;
|
|
130
130
|
const val = displayValue();
|
|
131
|
-
const content =
|
|
131
|
+
const content =
|
|
132
|
+
val !== "" && val.split("\n").length >= rows ? val : "\n".repeat(rows - 1) + "\u00A0";
|
|
132
133
|
// 마지막이 줄바꿈이면 빈 줄 높이 확보를 위해 공백 추가
|
|
133
134
|
return content.endsWith("\n") ? content + "\u00A0" : content;
|
|
134
135
|
};
|
|
@@ -189,7 +189,11 @@ export const TimePicker: Component<TimePickerProps> = (props) => {
|
|
|
189
189
|
class={twMerge(getWrapperClass(false), "relative", local.class)}
|
|
190
190
|
style={local.style}
|
|
191
191
|
>
|
|
192
|
-
<div
|
|
192
|
+
<div
|
|
193
|
+
data-time-field-content
|
|
194
|
+
style={{ visibility: isEditable() ? "hidden" : undefined }}
|
|
195
|
+
title={local.title}
|
|
196
|
+
>
|
|
193
197
|
{displayValue() || "\u00A0"}
|
|
194
198
|
</div>
|
|
195
199
|
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
children,
|
|
3
|
+
createSignal,
|
|
4
|
+
For,
|
|
5
|
+
type JSX,
|
|
6
|
+
type ParentComponent,
|
|
7
|
+
Show,
|
|
8
|
+
splitProps,
|
|
9
|
+
} from "solid-js";
|
|
2
10
|
import clsx from "clsx";
|
|
3
11
|
import { twMerge } from "tailwind-merge";
|
|
4
12
|
import { IconChevronDown } from "@tabler/icons-solidjs";
|
|
@@ -70,12 +78,18 @@ interface SelectItemTemplateProps<TValue> {
|
|
|
70
78
|
}
|
|
71
79
|
|
|
72
80
|
// 템플릿 함수를 저장하는 전역 Map (WeakMap 사용하여 메모리 누수 방지)
|
|
73
|
-
const templateFnMap = new WeakMap<
|
|
81
|
+
const templateFnMap = new WeakMap<
|
|
82
|
+
HTMLElement,
|
|
83
|
+
(item: unknown, index: number, depth: number) => JSX.Element
|
|
84
|
+
>();
|
|
74
85
|
|
|
75
86
|
const SelectItemTemplate = <T,>(props: SelectItemTemplateProps<T>) => (
|
|
76
87
|
<span
|
|
77
88
|
ref={(el) => {
|
|
78
|
-
templateFnMap.set(
|
|
89
|
+
templateFnMap.set(
|
|
90
|
+
el,
|
|
91
|
+
props.children as (item: unknown, index: number, depth: number) => JSX.Element,
|
|
92
|
+
);
|
|
79
93
|
}}
|
|
80
94
|
data-select-item-template
|
|
81
95
|
style={{ display: "none" }}
|
|
@@ -291,10 +305,16 @@ export const Select: SelectComponent = <T,>(props: SelectProps<T>) => {
|
|
|
291
305
|
// 내부 컴포넌트: Provider 안에서 children을 resolve
|
|
292
306
|
const SelectInner: ParentComponent = (innerProps) => {
|
|
293
307
|
const resolved = children(() => innerProps.children);
|
|
294
|
-
const [slots, items] = splitSlots(resolved, [
|
|
308
|
+
const [slots, items] = splitSlots(resolved, [
|
|
309
|
+
"selectHeader",
|
|
310
|
+
"selectAction",
|
|
311
|
+
"selectItemTemplate",
|
|
312
|
+
] as const);
|
|
295
313
|
|
|
296
314
|
// itemTemplate 함수 추출
|
|
297
|
-
const getItemTemplate = ():
|
|
315
|
+
const getItemTemplate = ():
|
|
316
|
+
| ((item: T, index: number, depth: number) => JSX.Element)
|
|
317
|
+
| undefined => {
|
|
298
318
|
const templateSlots = slots().selectItemTemplate;
|
|
299
319
|
if (templateSlots.length === 0) return undefined;
|
|
300
320
|
// WeakMap에서 함수 참조 가져오기
|
|
@@ -314,7 +334,9 @@ export const Select: SelectComponent = <T,>(props: SelectProps<T>) => {
|
|
|
314
334
|
<Show when={local.getChildren?.(item, index(), depth)} keyed>
|
|
315
335
|
{(itemChildren) => (
|
|
316
336
|
<Show when={itemChildren.length > 0}>
|
|
317
|
-
<SelectItem.Children>
|
|
337
|
+
<SelectItem.Children>
|
|
338
|
+
{renderItems(itemChildren, depth + 1)}
|
|
339
|
+
</SelectItem.Children>
|
|
318
340
|
</Show>
|
|
319
341
|
)}
|
|
320
342
|
</Show>
|
|
@@ -367,7 +389,10 @@ export const Select: SelectComponent = <T,>(props: SelectProps<T>) => {
|
|
|
367
389
|
aria-disabled={local.disabled || undefined}
|
|
368
390
|
aria-required={local.required || undefined}
|
|
369
391
|
tabIndex={local.disabled ? -1 : 0}
|
|
370
|
-
class={twMerge(
|
|
392
|
+
class={twMerge(
|
|
393
|
+
getTriggerClassName(),
|
|
394
|
+
slots().selectAction.length > 0 && "rounded-r-none border-r-0",
|
|
395
|
+
)}
|
|
371
396
|
style={local.style}
|
|
372
397
|
onClick={handleTriggerClick}
|
|
373
398
|
onKeyDown={handleTriggerKeyDown}
|
|
@@ -61,7 +61,9 @@ interface SelectItemComponent<TValue = unknown> extends ParentComponent<SelectIt
|
|
|
61
61
|
* </Select.Item>
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
export const SelectItem: SelectItemComponent = <T,>(
|
|
64
|
+
export const SelectItem: SelectItemComponent = <T,>(
|
|
65
|
+
props: SelectItemProps<T> & { children?: JSX.Element },
|
|
66
|
+
) => {
|
|
65
67
|
const [local, rest] = splitProps(props, ["children", "class", "value", "disabled"]);
|
|
66
68
|
|
|
67
69
|
const context = useSelectContext<T>();
|
|
@@ -108,13 +108,23 @@ const iconSize = "0.85em";
|
|
|
108
108
|
// ── Component ──
|
|
109
109
|
|
|
110
110
|
function StatePresetInner<TValue>(props: StatePresetProps<TValue>): JSX.Element {
|
|
111
|
-
const [local] = splitProps(props, [
|
|
111
|
+
const [local] = splitProps(props, [
|
|
112
|
+
"presetKey",
|
|
113
|
+
"value",
|
|
114
|
+
"onValueChange",
|
|
115
|
+
"size",
|
|
116
|
+
"class",
|
|
117
|
+
"style",
|
|
118
|
+
]);
|
|
112
119
|
|
|
113
120
|
const notification = useNotification();
|
|
114
121
|
|
|
115
122
|
// presetKey는 마운트 시 한 번만 설정되는 식별자이므로 즉시 평가하여 캡처
|
|
116
123
|
/* eslint-disable solid/reactivity */
|
|
117
|
-
const [presets, setPresets] = useSyncConfig<StatePresetItem<TValue>[]>(
|
|
124
|
+
const [presets, setPresets] = useSyncConfig<StatePresetItem<TValue>[]>(
|
|
125
|
+
`state-preset.${local.presetKey}`,
|
|
126
|
+
[],
|
|
127
|
+
);
|
|
118
128
|
/* eslint-enable solid/reactivity */
|
|
119
129
|
const [adding, setAdding] = createSignal(false);
|
|
120
130
|
const [inputValue, setInputValue] = createSignal("");
|
|
@@ -163,18 +173,24 @@ function StatePresetInner<TValue>(props: StatePresetProps<TValue>): JSX.Element
|
|
|
163
173
|
const snapshot = [...presets()];
|
|
164
174
|
const presetName = snapshot[index].name;
|
|
165
175
|
|
|
166
|
-
const updated = snapshot.map((p, i) =>
|
|
176
|
+
const updated = snapshot.map((p, i) =>
|
|
177
|
+
i === index ? { ...p, state: objClone(local.value) } : p,
|
|
178
|
+
);
|
|
167
179
|
setPresets(updated);
|
|
168
180
|
|
|
169
|
-
const notiId = notification.info(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
181
|
+
const notiId = notification.info(
|
|
182
|
+
"프리셋 덮어쓰기",
|
|
183
|
+
`"${presetName}" 프리셋이 현재 상태로 업데이트되었습니다.`,
|
|
184
|
+
{
|
|
185
|
+
action: {
|
|
186
|
+
label: "실행 취소",
|
|
187
|
+
onClick: () => {
|
|
188
|
+
setPresets(snapshot);
|
|
189
|
+
notification.remove(notiId);
|
|
190
|
+
},
|
|
175
191
|
},
|
|
176
192
|
},
|
|
177
|
-
|
|
193
|
+
);
|
|
178
194
|
}
|
|
179
195
|
|
|
180
196
|
function handleDelete(index: number): void {
|
|
@@ -209,7 +225,8 @@ function StatePresetInner<TValue>(props: StatePresetProps<TValue>): JSX.Element
|
|
|
209
225
|
|
|
210
226
|
const containerClass = () => twMerge(baseClass, local.class);
|
|
211
227
|
|
|
212
|
-
const resolvedChipClass = () =>
|
|
228
|
+
const resolvedChipClass = () =>
|
|
229
|
+
twMerge(chipClass, local.size ? chipSizeClasses[local.size] : chipDefaultClass);
|
|
213
230
|
|
|
214
231
|
const resolvedIconBtnClass = () =>
|
|
215
232
|
twMerge(iconBtnClass, local.size ? iconBtnSizeClasses[local.size] : iconBtnDefaultClass);
|
|
@@ -217,12 +234,18 @@ function StatePresetInner<TValue>(props: StatePresetProps<TValue>): JSX.Element
|
|
|
217
234
|
const resolvedStarBtnClass = () =>
|
|
218
235
|
twMerge(starBtnClass, local.size ? starBtnSizeClasses[local.size] : starBtnDefaultClass);
|
|
219
236
|
|
|
220
|
-
const resolvedInputClass = () =>
|
|
237
|
+
const resolvedInputClass = () =>
|
|
238
|
+
twMerge(inputClass, local.size ? inputSizeClasses[local.size] : inputDefaultClass);
|
|
221
239
|
|
|
222
240
|
return (
|
|
223
241
|
<div class={containerClass()} style={local.style}>
|
|
224
242
|
{/* Star button - add preset */}
|
|
225
|
-
<button
|
|
243
|
+
<button
|
|
244
|
+
type="button"
|
|
245
|
+
class={resolvedStarBtnClass()}
|
|
246
|
+
onClick={handleStartAdd}
|
|
247
|
+
title="프리셋 추가"
|
|
248
|
+
>
|
|
226
249
|
<Icon icon={IconStar} size={iconSize} />
|
|
227
250
|
</button>
|
|
228
251
|
|
|
@@ -278,4 +301,6 @@ function StatePresetInner<TValue>(props: StatePresetProps<TValue>): JSX.Element
|
|
|
278
301
|
);
|
|
279
302
|
}
|
|
280
303
|
|
|
281
|
-
export const StatePreset = StatePresetInner as <TValue>(
|
|
304
|
+
export const StatePreset = StatePresetInner as <TValue>(
|
|
305
|
+
props: StatePresetProps<TValue>,
|
|
306
|
+
) => JSX.Element;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type JSX,
|
|
3
|
+
type ParentComponent,
|
|
4
|
+
Show,
|
|
5
|
+
splitProps,
|
|
6
|
+
createContext,
|
|
7
|
+
useContext,
|
|
8
|
+
} from "solid-js";
|
|
2
9
|
import clsx from "clsx";
|
|
3
10
|
import { twMerge } from "tailwind-merge";
|
|
4
11
|
|
|
@@ -26,7 +33,9 @@ const FormGroupItem: ParentComponent<FormGroupItemProps> = (props) => {
|
|
|
26
33
|
return (
|
|
27
34
|
<div class={getClassName()} data-form-group-item {...rest}>
|
|
28
35
|
<Show when={local.label}>
|
|
29
|
-
<label
|
|
36
|
+
<label
|
|
37
|
+
class={ctx.inline ? clsx("whitespace-nowrap font-bold", "pr-2") : "mb-1 block font-bold"}
|
|
38
|
+
>
|
|
30
39
|
{local.label}
|
|
31
40
|
</label>
|
|
32
41
|
</Show>
|
|
@@ -22,7 +22,7 @@ const baseClass = clsx(
|
|
|
22
22
|
"flex",
|
|
23
23
|
"flex-col",
|
|
24
24
|
"bg-base-100",
|
|
25
|
-
"dark:bg-base-
|
|
25
|
+
"dark:bg-base-800",
|
|
26
26
|
"border-r",
|
|
27
27
|
"border-base-200",
|
|
28
28
|
"dark:border-base-700",
|
|
@@ -82,7 +82,8 @@ const SidebarBase: ParentComponent<SidebarProps> = (props) => {
|
|
|
82
82
|
return isOpen() ? "translateX(0)" : "translateX(-100%)";
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
const getClassName = () =>
|
|
85
|
+
const getClassName = () =>
|
|
86
|
+
twMerge(baseClass, !isDesktop() && isOpen() && mobileOpenClass, local.class);
|
|
86
87
|
|
|
87
88
|
return (
|
|
88
89
|
<aside
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type JSX,
|
|
3
|
+
type ParentComponent,
|
|
4
|
+
Show,
|
|
5
|
+
splitProps,
|
|
6
|
+
createMemo,
|
|
7
|
+
createSignal,
|
|
8
|
+
} from "solid-js";
|
|
2
9
|
import { useBeforeLeave } from "@solidjs/router";
|
|
3
10
|
import { createMediaQuery } from "@solid-primitives/media";
|
|
4
11
|
import clsx from "clsx";
|
|
@@ -166,7 +166,13 @@ const MenuItem: Component<MenuItemProps> = (props) => {
|
|
|
166
166
|
};
|
|
167
167
|
|
|
168
168
|
return (
|
|
169
|
-
<ListItem
|
|
169
|
+
<ListItem
|
|
170
|
+
selected={isSelected()}
|
|
171
|
+
open={open()}
|
|
172
|
+
onOpenChange={setOpen}
|
|
173
|
+
onClick={handleClick}
|
|
174
|
+
size={props.size}
|
|
175
|
+
>
|
|
170
176
|
<Show when={props.menu.icon}>
|
|
171
177
|
<Icon icon={props.menu.icon!} />
|
|
172
178
|
</Show>
|
|
@@ -11,7 +11,7 @@ import { Icon } from "../../display/Icon";
|
|
|
11
11
|
|
|
12
12
|
void ripple;
|
|
13
13
|
|
|
14
|
-
const containerClass = clsx("m-2 flex flex-col overflow-hidden rounded bg-white dark:bg-base-
|
|
14
|
+
const containerClass = clsx("m-2 flex flex-col overflow-hidden rounded bg-white dark:bg-base-900");
|
|
15
15
|
|
|
16
16
|
const headerClass = clsx(
|
|
17
17
|
"flex",
|
|
@@ -23,12 +23,15 @@ const headerClass = clsx(
|
|
|
23
23
|
"cursor-pointer",
|
|
24
24
|
"transition-colors",
|
|
25
25
|
"hover:bg-base-500/10",
|
|
26
|
-
"dark:hover:bg-base-
|
|
26
|
+
"dark:hover:bg-base-800",
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
const headerReadonlyClass = clsx("cursor-default hover:bg-transparent dark:hover:bg-transparent");
|
|
30
30
|
|
|
31
|
-
const avatarClass = clsx(
|
|
31
|
+
const avatarClass = clsx(
|
|
32
|
+
"flex size-10 items-center justify-center rounded-full",
|
|
33
|
+
"bg-primary-500 text-white",
|
|
34
|
+
);
|
|
32
35
|
|
|
33
36
|
export interface SidebarUserMenu {
|
|
34
37
|
title: string;
|
|
@@ -117,7 +120,9 @@ export const SidebarUser: Component<SidebarUserProps> = (props) => {
|
|
|
117
120
|
<Show when={local.description} fallback={<span class="font-semibold">{local.name}</span>}>
|
|
118
121
|
<div class="flex flex-col">
|
|
119
122
|
<span class="font-semibold">{local.name}</span>
|
|
120
|
-
<span class={clsx("text-sm", "text-base-500 dark:text-base-400")}>
|
|
123
|
+
<span class={clsx("text-sm", "text-base-500 dark:text-base-400")}>
|
|
124
|
+
{local.description}
|
|
125
|
+
</span>
|
|
121
126
|
</div>
|
|
122
127
|
</Show>
|
|
123
128
|
</div>
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type Component,
|
|
3
|
+
type JSX,
|
|
4
|
+
For,
|
|
5
|
+
Show,
|
|
6
|
+
splitProps,
|
|
7
|
+
createSignal,
|
|
8
|
+
createMemo,
|
|
9
|
+
} from "solid-js";
|
|
2
10
|
import { useLocation, useNavigate } from "@solidjs/router";
|
|
3
11
|
import { IconChevronDown, IconDotsVertical, type IconProps } from "@tabler/icons-solidjs";
|
|
4
12
|
import { Icon } from "../../display/Icon";
|
|
@@ -76,10 +84,16 @@ export const TopbarMenu: Component<TopbarMenuProps> = (props) => {
|
|
|
76
84
|
>
|
|
77
85
|
<Icon icon={IconDotsVertical} size="1.25em" />
|
|
78
86
|
</Button>
|
|
79
|
-
<Dropdown
|
|
87
|
+
<Dropdown
|
|
88
|
+
triggerRef={() => mobileButtonRef}
|
|
89
|
+
open={mobileMenuOpen()}
|
|
90
|
+
onOpenChange={setMobileMenuOpen}
|
|
91
|
+
>
|
|
80
92
|
<List inset>
|
|
81
93
|
<For each={local.menus}>
|
|
82
|
-
{(menu) =>
|
|
94
|
+
{(menu) => (
|
|
95
|
+
<TopbarMenuDropdownItem menu={menu} onClose={() => setMobileMenuOpen(false)} />
|
|
96
|
+
)}
|
|
83
97
|
</For>
|
|
84
98
|
</List>
|
|
85
99
|
</Dropdown>
|
|
@@ -147,7 +161,11 @@ const TopbarMenuButton: Component<TopbarMenuButtonProps> = (props) => {
|
|
|
147
161
|
</Show>
|
|
148
162
|
<span>{props.menu.title}</span>
|
|
149
163
|
<Show when={hasChildren()}>
|
|
150
|
-
<Icon
|
|
164
|
+
<Icon
|
|
165
|
+
icon={IconChevronDown}
|
|
166
|
+
size="1em"
|
|
167
|
+
class={clsx("transition-transform", open() && "rotate-180")}
|
|
168
|
+
/>
|
|
151
169
|
</Show>
|
|
152
170
|
</Button>
|
|
153
171
|
<Show when={hasChildren()}>
|
|
@@ -189,7 +207,11 @@ const TopbarMenuDropdownItem: Component<TopbarMenuDropdownItemProps> = (props) =
|
|
|
189
207
|
};
|
|
190
208
|
|
|
191
209
|
return (
|
|
192
|
-
<ListItem
|
|
210
|
+
<ListItem
|
|
211
|
+
selected={isSelected()}
|
|
212
|
+
readonly={props.menu.href === undefined && hasChildren()}
|
|
213
|
+
onClick={handleClick}
|
|
214
|
+
>
|
|
193
215
|
<Show when={props.menu.icon}>
|
|
194
216
|
<Icon icon={props.menu.icon!} />
|
|
195
217
|
</Show>
|
|
@@ -79,7 +79,11 @@ export const TopbarUser: ParentComponent<TopbarUserProps> = (props) => {
|
|
|
79
79
|
>
|
|
80
80
|
{local.children}
|
|
81
81
|
<Show when={hasMenus()}>
|
|
82
|
-
<Icon
|
|
82
|
+
<Icon
|
|
83
|
+
icon={IconChevronDown}
|
|
84
|
+
size="1em"
|
|
85
|
+
class={clsx("transition-transform", open() && "rotate-180")}
|
|
86
|
+
/>
|
|
83
87
|
</Show>
|
|
84
88
|
</Button>
|
|
85
89
|
<Show when={hasMenus()}>
|