@musecat/uikit 0.1.3 → 0.2.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/.agents/references/Components/Box.md +1 -1
- package/.agents/references/Components/Button.md +1 -1
- package/.agents/references/Components/Card.md +1 -1
- package/.agents/references/Components/Checkbox.md +1 -1
- package/.agents/references/Components/CodeBox.md +1 -1
- package/.agents/references/Components/ContextMenu.md +1 -1
- package/.agents/references/Components/ContributionGraph.md +1 -1
- package/.agents/references/Components/DatePicker.md +1 -1
- package/.agents/references/Components/Divider.md +1 -1
- package/.agents/references/Components/Header.md +3 -3
- package/.agents/references/Components/Icon.md +1 -1
- package/.agents/references/Components/Input.md +1 -1
- package/.agents/references/Components/Label.md +2 -2
- package/.agents/references/Components/Layout.md +2 -2
- package/.agents/references/Components/Maps.md +1 -1
- package/.agents/references/Components/Nav.md +1 -1
- package/.agents/references/Components/Pagination.md +1 -1
- package/.agents/references/Components/Pill.md +1 -1
- package/.agents/references/Components/Profile.md +1 -1
- package/.agents/references/Components/Progress.md +2 -2
- package/.agents/references/Components/Radio.md +2 -2
- package/.agents/references/Components/Select.md +1 -1
- package/.agents/references/Components/Skeleton.md +1 -1
- package/.agents/references/Components/Spinner.md +1 -1
- package/.agents/references/Components/Text.md +1 -1
- package/.agents/references/Components/TimePicker.md +1 -1
- package/.agents/references/Components/Timeline.md +2 -2
- package/.agents/references/Frameworks/DNDView.md +1 -1
- package/.agents/references/Frameworks/Dialog.md +2 -2
- package/.agents/references/Frameworks/EdgeEffect.md +2 -2
- package/.agents/references/Frameworks/HScrollView.md +2 -2
- package/.agents/references/Frameworks/ImageView.md +1 -1
- package/.agents/references/Frameworks/Motion.md +1 -1
- package/.agents/references/Frameworks/Pressable.md +1 -1
- package/.agents/references/Frameworks/Squircle.md +1 -1
- package/.agents/references/Frameworks/Theme.md +1 -1
- package/.agents/references/Frameworks/Toaster.md +2 -2
- package/.agents/references/Frameworks/View.md +1 -1
- package/.agents/references/Frameworks/_shared.md +3 -3
- package/README.md +25 -1
- package/global.d.ts +6 -0
- package/i18n/messages/en/uikit.json +50 -0
- package/i18n/messages/jp/uikit.json +50 -0
- package/i18n/messages/kr/uikit.json +50 -0
- package/i18n/request.ts +17 -0
- package/i18n/shared.ts +54 -0
- package/index.ts +86 -66
- package/package.json +33 -10
- package/packages/Components/Box/Box.tsx +7 -7
- package/packages/Components/Box/Box.types.ts +7 -7
- package/packages/Components/Button/Button.tsx +6 -6
- package/packages/Components/Button/Button.types.ts +6 -6
- package/packages/Components/Card/Card.default.tsx +13 -11
- package/packages/Components/Card/Card.foldable.tsx +16 -14
- package/packages/Components/Card/Card.tsx +3 -3
- package/packages/Components/Card/Card.types.ts +5 -5
- package/packages/Components/Card/Card.utils.ts +1 -1
- package/packages/Components/Checkbox/Checkbox.tsx +6 -6
- package/packages/Components/Checkbox/Checkbox.types.ts +4 -4
- package/packages/Components/CodeBox/CodeBox.copy.tsx +3 -3
- package/packages/Components/CodeBox/CodeBox.tsx +6 -5
- package/packages/Components/CodeBox/CodeBox.types.ts +2 -2
- package/packages/Components/ContextMenu/ContextMenu.options.tsx +6 -6
- package/packages/Components/ContextMenu/ContextMenu.tsx +8 -7
- package/packages/Components/ContextMenu/ContextMenu.types.ts +1 -1
- package/packages/Components/ContributionGraph/ContributionGraph.tsx +18 -9
- package/packages/Components/ContributionGraph/ContributionGraph.types.ts +2 -2
- package/packages/Components/DatePicker/DatePicker.calendar.tsx +6 -6
- package/packages/Components/DatePicker/DatePicker.core.tsx +2 -2
- package/packages/Components/DatePicker/DatePicker.tsx +48 -27
- package/packages/Components/DatePicker/DatePicker.types.ts +1 -1
- package/packages/Components/DatePicker/hooks/useCalendar.ts +1 -1
- package/packages/Components/DatePicker/hooks/useSelection.ts +2 -2
- package/packages/Components/Divider/Divider.tsx +2 -2
- package/packages/Components/Divider/Divider.types.ts +1 -1
- package/packages/Components/Header/Header.tsx +4 -4
- package/packages/Components/Icon/Icon.group.tsx +5 -5
- package/packages/Components/Icon/Icon.group.types.ts +4 -4
- package/packages/Components/Icon/Icon.tsx +8 -8
- package/packages/Components/Icon/Icon.types.ts +7 -7
- package/packages/Components/Input/Input.tsx +5 -5
- package/packages/Components/Input/Input.types.ts +1 -1
- package/packages/Components/Label/Label.tsx +7 -7
- package/packages/Components/Label/Label.types.ts +2 -2
- package/packages/Components/Layout/Layout.docs.tsx +6 -6
- package/packages/Components/Layout/Layout.docs.types.ts +2 -2
- package/packages/Components/Layout/Layout.tsx +7 -7
- package/packages/Components/Layout/Layout.types.ts +4 -4
- package/packages/Components/Maps/OSM/MapOSM.tsx +4 -4
- package/packages/Components/Nav/Nav.tsx +8 -8
- package/packages/Components/Nav/Nav.types.ts +5 -5
- package/packages/Components/Nav/hooks/useNavDrag.ts +1 -1
- package/packages/Components/Pagination/Pagination.tsx +8 -7
- package/packages/Components/Pagination/Pagination.types.ts +1 -1
- package/packages/Components/Pill/Pill.tsx +4 -4
- package/packages/Components/Pill/Pill.types.ts +6 -6
- package/packages/Components/Profile/Profile.shared.ts +3 -3
- package/packages/Components/Profile/Profile.tsx +7 -7
- package/packages/Components/Profile/Profile.types.ts +4 -4
- package/packages/Components/Progress/Progress.tsx +5 -5
- package/packages/Components/Progress/Progress.types.ts +2 -2
- package/packages/Components/Radio/Radio.tsx +5 -5
- package/packages/Components/Radio/Radio.types.ts +4 -4
- package/packages/Components/Select/Select.keyboard.tsx +1 -1
- package/packages/Components/Select/Select.trigger.tsx +3 -3
- package/packages/Components/Select/Select.tsx +2 -2
- package/packages/Components/Select/Select.types.ts +1 -1
- package/packages/Components/Select/Select.utils.ts +1 -1
- package/packages/Components/Select/hooks/useSelectNavigation.ts +7 -10
- package/packages/Components/Select/hooks/useSelectSelection.ts +3 -3
- package/packages/Components/Select/hooks/useSelectState.ts +3 -3
- package/packages/Components/Select/select.control.tsx +15 -24
- package/packages/Components/Select/select.inner.tsx +10 -10
- package/packages/Components/Skeleton/Skeleton.tsx +2 -2
- package/packages/Components/Skeleton/Skeleton.types.ts +2 -2
- package/packages/Components/Spinner/Spinner.tsx +5 -5
- package/packages/Components/Spinner/Spinner.types.ts +2 -2
- package/packages/Components/Text/Text.tsx +3 -3
- package/packages/Components/Text/Text.types.ts +2 -2
- package/packages/Components/TimePicker/TimePicker.core.tsx +4 -4
- package/packages/Components/TimePicker/TimePicker.tsx +7 -7
- package/packages/Components/TimePicker/TimePicker.types.ts +1 -1
- package/packages/Components/Timeline/Timeline.tsx +5 -5
- package/packages/Components/Timeline/Timeline.types.ts +3 -3
- package/packages/Components/Title/Title.tsx +7 -7
- package/packages/Components/Title/Title.types.ts +6 -6
- package/packages/Components/Toggle/Toggle.tsx +9 -9
- package/packages/Components/Toggle/Toggle.types.ts +3 -3
- package/packages/Components/Tooltip/Tooltip.tsx +3 -3
- package/packages/Components/Tooltip/Tooltip.types.ts +2 -2
- package/packages/Frameworks/Dialog/Dialog.background.tsx +4 -4
- package/packages/Frameworks/Dialog/Dialog.boot.tsx +2 -2
- package/packages/Frameworks/Dialog/Dialog.store.ts +1 -1
- package/packages/Frameworks/Dialog/Dialog.tsx +6 -5
- package/packages/Frameworks/Dialog/Dialog.types.ts +4 -4
- package/packages/Frameworks/Dialog/contents/Dialog.footer.tsx +4 -4
- package/packages/Frameworks/Dialog/contents/Dialog.funnel.tsx +6 -6
- package/packages/Frameworks/Dialog/contents/Dialog.header.tsx +6 -6
- package/packages/Frameworks/Dialog/hooks/useDialogPosition.ts +2 -2
- package/packages/Frameworks/Dialog/hooks/useSheetDrag.ts +4 -2
- package/packages/Frameworks/Dialog/hooks/useSheetGeometry.ts +5 -3
- package/packages/Frameworks/Dialog/hooks/useSheetProgressive.ts +2 -2
- package/packages/Frameworks/Dialog/renderers/renderModal.tsx +9 -9
- package/packages/Frameworks/Dialog/renderers/renderPopover.tsx +11 -11
- package/packages/Frameworks/Dialog/renderers/renderSheet.tsx +17 -17
- package/packages/Frameworks/EdgeEffect/EdgeEffect.tsx +2 -2
- package/packages/Frameworks/EdgeEffect/EdgeEffect.types.ts +1 -1
- package/packages/Frameworks/Pressable/Pressable.tsx +11 -11
- package/packages/Frameworks/Pressable/Pressable.types.ts +15 -6
- package/packages/Frameworks/Squircle/Squircle.tsx +3 -3
- package/packages/Frameworks/Squircle/Squircle.types.ts +1 -1
- package/packages/Frameworks/Theme/Radius.types.ts +2 -2
- package/packages/Frameworks/Toaster/Toaster.boot.tsx +5 -5
- package/packages/Frameworks/Toaster/Toaster.types.ts +3 -1
- package/packages/Frameworks/View/DNDView/DNDView.tsx +5 -5
- package/packages/Frameworks/View/DNDView/DNDView.types.ts +2 -2
- package/packages/Frameworks/View/HScrollView/HScrollView.tsx +8 -8
- package/packages/Frameworks/View/HScrollView/HScrollView.types.ts +2 -2
- package/packages/Frameworks/View/ImageView/Dialog/ImageDialog.counter.tsx +2 -2
- package/packages/Frameworks/View/ImageView/Dialog/ImageDialog.footer.tsx +8 -4
- package/packages/Frameworks/View/ImageView/Dialog/ImageDialog.header.tsx +3 -3
- package/packages/Frameworks/View/ImageView/Dialog/ImageDialog.list.tsx +5 -5
- package/packages/Frameworks/View/ImageView/Dialog/ImageDialog.slide.tsx +3 -3
- package/packages/Frameworks/View/ImageView/Dialog/ImageDialog.tsx +7 -7
- package/packages/Frameworks/View/ImageView/Image.controls.tsx +1 -1
- package/packages/Frameworks/View/ImageView/Image.tsx +44 -27
- package/packages/Frameworks/View/ImageView/Image.types.ts +2 -2
- package/packages/Frameworks/View/ImageView/Image.utils.ts +2 -2
- package/packages/Frameworks/View/View.tsx +8 -8
- package/packages/Frameworks/View/View.types.ts +5 -5
- package/packages/Frameworks/_shared/Padding.types.ts +2 -4
- package/packages/Frameworks/_shared/StopParentInteraction.tsx +1 -1
- package/packages/Frameworks/_shared/Wind.types.ts +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IconGroupProps } from "
|
|
2
|
-
import type { IconProps } from "
|
|
3
|
-
import type { PillProps } from "
|
|
4
|
-
import type { TextProps } from "
|
|
5
|
-
import type { PressableProps } from "
|
|
6
|
-
import type { ViewProps } from "
|
|
1
|
+
import type { IconGroupProps } from "../Icon/Icon.group.types";
|
|
2
|
+
import type { IconProps } from "../Icon/Icon.types";
|
|
3
|
+
import type { PillProps } from "../Pill/Pill.types";
|
|
4
|
+
import type { TextProps } from "../Text/Text.types";
|
|
5
|
+
import type { PressableProps } from "../../Frameworks/Pressable/Pressable.types";
|
|
6
|
+
import type { ViewProps } from "../../Frameworks/View/View.types";
|
|
7
7
|
|
|
8
8
|
interface TitleItemProps {
|
|
9
9
|
"data-color-mode"?: string;
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
useRef,
|
|
9
9
|
useState,
|
|
10
10
|
} from "react";
|
|
11
|
-
import Spinner from "
|
|
12
|
-
import Text from "
|
|
13
|
-
import styles from "
|
|
14
|
-
import type { ToggleProps } from "
|
|
15
|
-
import { Size, SizePX } from "
|
|
16
|
-
import { useControllableState } from "
|
|
17
|
-
import { Radius } from "
|
|
18
|
-
import { Border } from "
|
|
19
|
-
import View from "
|
|
11
|
+
import Spinner from "../Spinner/Spinner";
|
|
12
|
+
import Text from "../Text/Text";
|
|
13
|
+
import styles from "./Toggle.module.scss";
|
|
14
|
+
import type { ToggleProps } from "./Toggle.types";
|
|
15
|
+
import { Size, SizePX } from "../../Frameworks/_shared/sizing";
|
|
16
|
+
import { useControllableState } from "../../Frameworks/_shared/useControllableState";
|
|
17
|
+
import { Radius } from "../../Frameworks/Theme/Radius.types";
|
|
18
|
+
import { Border } from "../../Frameworks/Theme/Theme.types";
|
|
19
|
+
import View from "../../Frameworks/View/View";
|
|
20
20
|
|
|
21
21
|
type ToggleTrackStyle = React.CSSProperties & {
|
|
22
22
|
"--toggle-padding"?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { TextProps } from "
|
|
2
|
-
import type { UIKitSizeValue } from "
|
|
3
|
-
import type { ThemeSystemProps } from "
|
|
1
|
+
import type { TextProps } from "../Text/Text.types";
|
|
2
|
+
import type { UIKitSizeValue } from "../../Frameworks/_shared/sizing";
|
|
3
|
+
import type { ThemeSystemProps } from "../../Frameworks/Theme/Theme.types";
|
|
4
4
|
|
|
5
5
|
export interface ToggleProps
|
|
6
6
|
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "color">,
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
useRef,
|
|
13
13
|
useState,
|
|
14
14
|
} from "react";
|
|
15
|
-
import styles from "
|
|
15
|
+
import styles from "./Tooltip.module.scss";
|
|
16
16
|
import type {
|
|
17
17
|
TooltipPlacement,
|
|
18
18
|
TooltipProps,
|
|
19
|
-
} from "
|
|
20
|
-
import View from "
|
|
19
|
+
} from "./Tooltip.types";
|
|
20
|
+
import View from "../../Frameworks/View/View";
|
|
21
21
|
|
|
22
22
|
const TOOLTIP_GAP = 8;
|
|
23
23
|
const TOOLTIP_MARGIN = 4;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { RadiusValue } from "
|
|
1
|
+
import type { RadiusValue } from "../../Frameworks/Theme/Radius.types";
|
|
2
2
|
import type {
|
|
3
3
|
BorderProps,
|
|
4
4
|
ThemeBackgroundPaint,
|
|
5
5
|
ThemePaint,
|
|
6
6
|
ThemePreset,
|
|
7
|
-
} from "
|
|
7
|
+
} from "../../Frameworks/Theme/Theme.types";
|
|
8
8
|
|
|
9
9
|
export type TooltipPlacement =
|
|
10
10
|
| "top"
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import type { MotionValue } from "motion/react";
|
|
5
5
|
import { useEffect, useState } from "react";
|
|
6
|
-
import { motionPresets } from "
|
|
6
|
+
import { motionPresets } from "../Motion/Motion.presets";
|
|
7
7
|
import type {
|
|
8
8
|
BackgroundBlurValue,
|
|
9
9
|
ThemeBackgroundPaint,
|
|
10
|
-
} from "
|
|
11
|
-
import { BackgroundBlur } from "
|
|
12
|
-
import View from "
|
|
10
|
+
} from "../Theme/Theme.types";
|
|
11
|
+
import { BackgroundBlur } from "../Theme/Theme.types";
|
|
12
|
+
import View from "../View/View";
|
|
13
13
|
|
|
14
14
|
interface BackgroundWrapperProps {
|
|
15
15
|
open: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import Dialog from "
|
|
4
|
+
import Dialog from "./Dialog";
|
|
5
5
|
import {
|
|
6
6
|
type DialogInstance,
|
|
7
7
|
DialogStore,
|
|
8
|
-
} from "
|
|
8
|
+
} from "./Dialog.store";
|
|
9
9
|
|
|
10
10
|
interface DialogBootstrapProps {
|
|
11
11
|
"data-color-mode"?: string;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { buildContext, useViewportMatch } from "@musecat/functionkit";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
|
-
import DialogFunnel from "
|
|
5
|
+
import DialogFunnel from "./contents/Dialog.funnel";
|
|
6
6
|
import type {
|
|
7
7
|
DialogContextValue,
|
|
8
8
|
DialogMode,
|
|
9
9
|
DialogProps,
|
|
10
|
-
} from "
|
|
11
|
-
import RenderModal from "
|
|
12
|
-
import RenderPopover from "
|
|
13
|
-
import RenderSheet from "
|
|
10
|
+
} from "./Dialog.types";
|
|
11
|
+
import RenderModal from "./renderers/renderModal";
|
|
12
|
+
import RenderPopover from "./renderers/renderPopover";
|
|
13
|
+
import RenderSheet from "./renderers/renderSheet";
|
|
14
14
|
|
|
15
15
|
const [DialogProvider, useRawDialogContext] =
|
|
16
16
|
buildContext<DialogContextValue | null>(null);
|
|
@@ -84,6 +84,7 @@ export default function Dialog(props: DialogProps) {
|
|
|
84
84
|
open,
|
|
85
85
|
closeDialog: close,
|
|
86
86
|
}),
|
|
87
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: close is intentionally a stable reference
|
|
87
88
|
[id, resolvedMode, open, close],
|
|
88
89
|
);
|
|
89
90
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ReactNode, RefObject } from "react";
|
|
2
|
-
import type { ButtonProps } from "
|
|
3
|
-
import type { IconProps } from "
|
|
4
|
-
import type { RadiusProps } from "
|
|
2
|
+
import type { ButtonProps } from "../../Components/Button/Button.types";
|
|
3
|
+
import type { IconProps } from "../../Components/Icon/Icon.types";
|
|
4
|
+
import type { RadiusProps } from "../Theme/Radius.types";
|
|
5
5
|
import type {
|
|
6
6
|
BackgroundBlurValue,
|
|
7
7
|
BorderProps,
|
|
8
8
|
ThemeBackgroundPaint,
|
|
9
9
|
ThemeSystemProps,
|
|
10
|
-
} from "
|
|
10
|
+
} from "../Theme/Theme.types";
|
|
11
11
|
|
|
12
12
|
export type DialogMode = "popover" | "modal" | "sheet";
|
|
13
13
|
export type DialogMobileMode = "modal" | "sheet";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
|
-
import Button from "
|
|
5
|
-
import type { DialogFooterConfig } from "
|
|
6
|
-
import Pressable from "
|
|
7
|
-
import View from "
|
|
4
|
+
import Button from "../../../Components/Button/Button";
|
|
5
|
+
import type { DialogFooterConfig } from "../Dialog.types";
|
|
6
|
+
import Pressable from "../../Pressable/Pressable";
|
|
7
|
+
import View from "../../View/View";
|
|
8
8
|
|
|
9
9
|
interface DialogFooterProps {
|
|
10
10
|
config?: DialogFooterConfig;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useMemo, useState } from "react";
|
|
4
|
-
import Button from "
|
|
5
|
-
import Icon from "
|
|
6
|
-
import Text from "
|
|
4
|
+
import Button from "../../../Components/Button/Button";
|
|
5
|
+
import Icon from "../../../Components/Icon/Icon";
|
|
6
|
+
import Text from "../../../Components/Text/Text";
|
|
7
7
|
import type {
|
|
8
8
|
FunnelConfig,
|
|
9
9
|
FunnelHistory,
|
|
10
10
|
FunnelStepConfig,
|
|
11
|
-
} from "
|
|
12
|
-
import Pressable from "
|
|
13
|
-
import View from "
|
|
11
|
+
} from "../Dialog.types";
|
|
12
|
+
import Pressable from "../../Pressable/Pressable";
|
|
13
|
+
import View from "../../View/View";
|
|
14
14
|
|
|
15
15
|
interface DialogFunnelProps {
|
|
16
16
|
config: FunnelConfig;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
|
-
import Icon from "
|
|
5
|
-
import Text from "
|
|
6
|
-
import { useDialog } from "
|
|
7
|
-
import type { DialogHeaderConfig } from "
|
|
8
|
-
import Pressable from "
|
|
9
|
-
import View from "
|
|
4
|
+
import Icon from "../../../Components/Icon/Icon";
|
|
5
|
+
import Text from "../../../Components/Text/Text";
|
|
6
|
+
import { useDialog } from "../Dialog";
|
|
7
|
+
import type { DialogHeaderConfig } from "../Dialog.types";
|
|
8
|
+
import Pressable from "../../Pressable/Pressable";
|
|
9
|
+
import View from "../../View/View";
|
|
10
10
|
|
|
11
11
|
interface DialogHeaderProps {
|
|
12
12
|
config?: DialogHeaderConfig & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useViewportHeight } from "@musecat/functionkit";
|
|
2
2
|
import { useCallback, useLayoutEffect, useState } from "react";
|
|
3
|
-
import { SizePX } from "
|
|
4
|
-
import type { OffsetConfig } from "
|
|
3
|
+
import { SizePX } from "../../_shared/sizing";
|
|
4
|
+
import type { OffsetConfig } from "../Dialog.types";
|
|
5
5
|
|
|
6
6
|
export type PopoverPlacement =
|
|
7
7
|
| "top"
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { animate, type MotionValue, useDragControls } from "motion/react";
|
|
4
4
|
import { useCallback, useRef } from "react";
|
|
5
|
-
import { toPx } from "
|
|
6
|
-
import { motionTransitions } from "
|
|
5
|
+
import { toPx } from "./useSheetGeometry";
|
|
6
|
+
import { motionTransitions } from "../../Motion/Motion.presets";
|
|
7
7
|
|
|
8
8
|
const CLOSE_VELOCITY = 900;
|
|
9
9
|
const CLOSE_DISTANCE_RATIO = 0.34;
|
|
@@ -76,6 +76,8 @@ export function useSheetDrag({
|
|
|
76
76
|
onSnapIndexChange,
|
|
77
77
|
onDragStateChange,
|
|
78
78
|
}: UseSheetDragInput): DragHandlers {
|
|
79
|
+
void maxPx;
|
|
80
|
+
void getGapHiddenY;
|
|
79
81
|
const _dragControls = useDragControls();
|
|
80
82
|
const contentDraggingRef = useRef(false);
|
|
81
83
|
const contentPointerActiveRef = useRef(false);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
|
-
import type { SheetConfig } from "
|
|
4
|
+
import type { SheetConfig } from "../Dialog.types";
|
|
5
5
|
|
|
6
6
|
function toPx(
|
|
7
7
|
value: number | string | undefined,
|
|
@@ -145,8 +145,10 @@ export function useSheetGeometry({
|
|
|
145
145
|
const _snapPointsStr = JSON.stringify(config?.snapPoints);
|
|
146
146
|
const normalizedSnapPoints = useMemo(
|
|
147
147
|
() =>
|
|
148
|
-
config?.snapPoints?.length
|
|
149
|
-
|
|
148
|
+
config?.snapPoints?.length
|
|
149
|
+
? normalizeSnapPoints(config?.snapPoints)
|
|
150
|
+
: [1],
|
|
151
|
+
[config?.snapPoints?.length, config?.snapPoints],
|
|
150
152
|
);
|
|
151
153
|
|
|
152
154
|
const maxSnap = useMemo(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type { MotionValue } from "motion/react";
|
|
4
4
|
import { useEffect, useMemo, useState } from "react";
|
|
5
|
-
import type { RadiusValue } from "
|
|
5
|
+
import type { RadiusValue } from "../../Theme/Radius.types";
|
|
6
6
|
|
|
7
7
|
const EDGE_INSET_MAX_PX = 8;
|
|
8
8
|
const BOTTOM_GAP_PX = 8;
|
|
@@ -45,7 +45,7 @@ export function useSheetProgressive({
|
|
|
45
45
|
hasExplicitSnapPoints,
|
|
46
46
|
}: UseSheetProgressiveInput): UseSheetProgressiveOutput {
|
|
47
47
|
const firstSnap = normalizedSnapPoints[0];
|
|
48
|
-
const lastSnap = normalizedSnapPoints.at(-1)
|
|
48
|
+
const lastSnap = normalizedSnapPoints.at(-1) ?? 0;
|
|
49
49
|
const hasProgression =
|
|
50
50
|
hasExplicitSnapPoints && normalizedSnapPoints.length > 1 && !isFreeDrag;
|
|
51
51
|
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
import { AnimatePresence } from "motion/react";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
5
|
import { useCallback, useEffect, useRef } from "react";
|
|
6
|
-
import { useScrollLock } from "
|
|
7
|
-
import { LAYER_Z_INDEX } from "
|
|
8
|
-
import DialogFooter from "
|
|
9
|
-
import DialogHeader from "
|
|
10
|
-
import BackgroundWrapper from "
|
|
6
|
+
import { useScrollLock } from "../../_shared/bodyScrollLock";
|
|
7
|
+
import { LAYER_Z_INDEX } from "../../_shared/layer.constants";
|
|
8
|
+
import DialogFooter from "../contents/Dialog.footer";
|
|
9
|
+
import DialogHeader from "../contents/Dialog.header";
|
|
10
|
+
import BackgroundWrapper from "../Dialog.background";
|
|
11
11
|
import type {
|
|
12
12
|
DialogOutsideOptions,
|
|
13
13
|
ModalConfig,
|
|
14
|
-
} from "
|
|
14
|
+
} from "../Dialog.types";
|
|
15
15
|
import {
|
|
16
16
|
DialogPortal,
|
|
17
17
|
useEscapeClose,
|
|
18
|
-
} from "
|
|
19
|
-
import { motionPresets } from "
|
|
20
|
-
import View from "
|
|
18
|
+
} from "../Dialog.utils";
|
|
19
|
+
import { motionPresets } from "../../Motion/Motion.presets";
|
|
20
|
+
import View from "../../View/View";
|
|
21
21
|
|
|
22
22
|
interface RenderModalProps {
|
|
23
23
|
open: boolean;
|
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
import { getFloatingTransformOrigin } from "@musecat/functionkit";
|
|
4
4
|
import { AnimatePresence } from "motion/react";
|
|
5
5
|
import { type ReactNode, useCallback, useEffect, useRef } from "react";
|
|
6
|
-
import { useScrollLock } from "
|
|
7
|
-
import { LAYER_Z_INDEX } from "
|
|
8
|
-
import { Size } from "
|
|
9
|
-
import DialogFooter from "
|
|
10
|
-
import DialogHeader from "
|
|
11
|
-
import BackgroundWrapper from "
|
|
6
|
+
import { useScrollLock } from "../../_shared/bodyScrollLock";
|
|
7
|
+
import { LAYER_Z_INDEX } from "../../_shared/layer.constants";
|
|
8
|
+
import { Size } from "../../_shared/sizing";
|
|
9
|
+
import DialogFooter from "../contents/Dialog.footer";
|
|
10
|
+
import DialogHeader from "../contents/Dialog.header";
|
|
11
|
+
import BackgroundWrapper from "../Dialog.background";
|
|
12
12
|
import type {
|
|
13
13
|
DialogOutsideOptions,
|
|
14
14
|
PopoverConfig,
|
|
15
|
-
} from "
|
|
15
|
+
} from "../Dialog.types";
|
|
16
16
|
import {
|
|
17
17
|
DialogPortal,
|
|
18
18
|
useEscapeClose,
|
|
19
|
-
} from "
|
|
20
|
-
import { useDialogPosition } from "
|
|
21
|
-
import { motionPresets } from "
|
|
22
|
-
import View from "
|
|
19
|
+
} from "../Dialog.utils";
|
|
20
|
+
import { useDialogPosition } from "../hooks/useDialogPosition";
|
|
21
|
+
import { motionPresets } from "../../Motion/Motion.presets";
|
|
22
|
+
import View from "../../View/View";
|
|
23
23
|
|
|
24
24
|
interface RenderPopoverProps {
|
|
25
25
|
open: boolean;
|
|
@@ -13,27 +13,29 @@ import {
|
|
|
13
13
|
useRef,
|
|
14
14
|
useState,
|
|
15
15
|
} from "react";
|
|
16
|
-
import { useScrollLock } from "
|
|
17
|
-
import { LAYER_Z_INDEX } from "
|
|
18
|
-
import { Size } from "
|
|
19
|
-
import DialogFooter from "
|
|
20
|
-
import DialogHeader from "
|
|
21
|
-
import BackgroundWrapper from "
|
|
16
|
+
import { useScrollLock } from "../../_shared/bodyScrollLock";
|
|
17
|
+
import { LAYER_Z_INDEX } from "../../_shared/layer.constants";
|
|
18
|
+
import { Size } from "../../_shared/sizing";
|
|
19
|
+
import DialogFooter from "../contents/Dialog.footer";
|
|
20
|
+
import DialogHeader from "../contents/Dialog.header";
|
|
21
|
+
import BackgroundWrapper from "../Dialog.background";
|
|
22
22
|
import type {
|
|
23
23
|
DialogOutsideOptions,
|
|
24
24
|
SheetConfig,
|
|
25
|
-
} from "
|
|
25
|
+
} from "../Dialog.types";
|
|
26
26
|
import {
|
|
27
27
|
DialogPortal,
|
|
28
28
|
useEscapeClose,
|
|
29
|
-
} from "
|
|
30
|
-
import { useSheetDrag } from "
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
import
|
|
36
|
-
import
|
|
29
|
+
} from "../Dialog.utils";
|
|
30
|
+
import { useSheetDrag } from "../hooks/useSheetDrag";
|
|
31
|
+
import {
|
|
32
|
+
resolveInitialSnapIndex,
|
|
33
|
+
useSheetGeometry,
|
|
34
|
+
} from "../hooks/useSheetGeometry";
|
|
35
|
+
import { useSheetProgressive } from "../hooks/useSheetProgressive";
|
|
36
|
+
import { motionTransitions } from "../../Motion/Motion.presets";
|
|
37
|
+
import Pressable from "../../Pressable/Pressable";
|
|
38
|
+
import View from "../../View/View";
|
|
37
39
|
|
|
38
40
|
interface RenderSheetProps {
|
|
39
41
|
open: boolean;
|
|
@@ -567,5 +569,3 @@ export default function RenderSheet({
|
|
|
567
569
|
if (!mounted) return null;
|
|
568
570
|
return <DialogPortal>{sheetNode}</DialogPortal>;
|
|
569
571
|
}
|
|
570
|
-
|
|
571
|
-
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { memo, useMemo } from "react";
|
|
4
|
-
import type { EdgeEffectProps } from "
|
|
5
|
-
import View from "
|
|
4
|
+
import type { EdgeEffectProps } from "./EdgeEffect.types";
|
|
5
|
+
import View from "../View/View";
|
|
6
6
|
|
|
7
7
|
const OPPOSITE_SIDE: Record<
|
|
8
8
|
"left" | "right" | "top" | "bottom",
|
|
@@ -15,21 +15,21 @@ import {
|
|
|
15
15
|
useRef,
|
|
16
16
|
useState,
|
|
17
17
|
} from "react";
|
|
18
|
-
import { resolvePadding } from "
|
|
19
|
-
import { Size } from "
|
|
20
|
-
import Dialog from "
|
|
21
|
-
import styles from "
|
|
22
|
-
import type { PressableProps } from "
|
|
23
|
-
import Squircle from "
|
|
24
|
-
import { Radius } from "
|
|
18
|
+
import { resolvePadding } from "../_shared/Padding.types";
|
|
19
|
+
import { Size } from "../_shared/sizing";
|
|
20
|
+
import Dialog from "../Dialog/Dialog";
|
|
21
|
+
import styles from "./Pressable.module.scss";
|
|
22
|
+
import type { PressableProps } from "./Pressable.types";
|
|
23
|
+
import Squircle from "../Squircle/Squircle";
|
|
24
|
+
import { Radius } from "../Theme/Radius.types";
|
|
25
25
|
import {
|
|
26
26
|
BackgroundBlur,
|
|
27
27
|
Border,
|
|
28
28
|
resolveThemeClasses,
|
|
29
29
|
resolveThemeHasBorder,
|
|
30
30
|
Shadow,
|
|
31
|
-
} from "
|
|
32
|
-
import View from "
|
|
31
|
+
} from "../Theme/Theme.types";
|
|
32
|
+
import View from "../View/View";
|
|
33
33
|
|
|
34
34
|
export const ButtonNestingContext = createContext(false);
|
|
35
35
|
export const PopoverContext = createContext<{
|
|
@@ -505,8 +505,8 @@ const Pressable = forwardRef<HTMLElement, PressableProps>((props, ref) => {
|
|
|
505
505
|
themeInteractive,
|
|
506
506
|
selected: resolvedControlSelected,
|
|
507
507
|
disabled,
|
|
508
|
-
|
|
509
|
-
|
|
508
|
+
readOnly,
|
|
509
|
+
isInteractive: true,
|
|
510
510
|
}),
|
|
511
511
|
Border(border),
|
|
512
512
|
className,
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import type { MotionProps } from "motion/react";
|
|
2
2
|
import type { LinkProps } from "next/link";
|
|
3
|
-
import type { PaddingProps } from "
|
|
4
|
-
import type { WindProps } from "
|
|
5
|
-
import type { PopoverConfig } from "
|
|
6
|
-
import type { RadiusProps } from "
|
|
3
|
+
import type { PaddingProps } from "../_shared/Padding.types";
|
|
4
|
+
import type { WindProps } from "../_shared/Wind.types";
|
|
5
|
+
import type { PopoverConfig } from "../Dialog/Dialog.types";
|
|
6
|
+
import type { RadiusProps } from "../Theme/Radius.types";
|
|
7
7
|
import type {
|
|
8
8
|
BorderProps,
|
|
9
9
|
ThemeSystemProps,
|
|
10
|
-
} from "
|
|
10
|
+
} from "../Theme/Theme.types";
|
|
11
11
|
export interface PressableProps
|
|
12
12
|
extends Omit<
|
|
13
13
|
React.HTMLAttributes<HTMLElement>,
|
|
14
|
-
|
|
14
|
+
| "title"
|
|
15
|
+
| "onClick"
|
|
16
|
+
| "onChange"
|
|
17
|
+
| "value"
|
|
18
|
+
| "checked"
|
|
19
|
+
| "type"
|
|
20
|
+
| "disabled"
|
|
21
|
+
| "tabIndex"
|
|
22
|
+
| "popover"
|
|
23
|
+
| "color"
|
|
15
24
|
>,
|
|
16
25
|
ThemeSystemProps,
|
|
17
26
|
BorderProps,
|
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
getComputedPixelValue,
|
|
16
16
|
SizePX,
|
|
17
|
-
} from "
|
|
18
|
-
import type { SquircleProps } from "
|
|
19
|
-
import { Radius as resolveRadius } from "
|
|
17
|
+
} from "../_shared/sizing";
|
|
18
|
+
import type { SquircleProps } from "./Squircle.types";
|
|
19
|
+
import { Radius as resolveRadius } from "../Theme/Radius.types";
|
|
20
20
|
|
|
21
21
|
function resolveCornerRadius(
|
|
22
22
|
radius: SquircleProps["radius"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MotionProps } from "motion/react";
|
|
2
2
|
import type { ElementType, HTMLAttributes } from "react";
|
|
3
|
-
import type { RadiusValue } from "
|
|
3
|
+
import type { RadiusValue } from "../Theme/Radius.types";
|
|
4
4
|
|
|
5
5
|
export interface SquircleProps
|
|
6
6
|
extends Omit<HTMLAttributes<HTMLElement>, "color"> {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import Icon from "@/packages/Components/Icon/Icon";
|
|
4
|
-
import type { IconProps } from "@/packages/Components/Icon/Icon.types";
|
|
5
|
-
import styles from "@/packages/Frameworks/Toaster/Toaster.module.scss";
|
|
6
|
-
import type { ToasterBootstrapProps } from "@/packages/Frameworks/Toaster/Toaster.types";
|
|
7
3
|
import clsx from "clsx";
|
|
8
4
|
import { Toaster, toast } from "sonner";
|
|
5
|
+
import Icon from "../../Components/Icon/Icon";
|
|
6
|
+
import type { IconProps } from "../../Components/Icon/Icon.types";
|
|
7
|
+
import styles from "./Toaster.module.scss";
|
|
8
|
+
import type { ToasterBootstrapProps } from "./Toaster.types";
|
|
9
9
|
|
|
10
|
-
export { toast };
|
|
11
10
|
export type { ToasterBootstrapProps };
|
|
11
|
+
export { toast };
|
|
12
12
|
|
|
13
13
|
const getToastIcon = (color: IconProps["color"]) => (
|
|
14
14
|
<Icon icon="iCircle" iconFill size={10} color={color} />
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ToasterProps } from "sonner";
|
|
2
|
-
import type { IconProps } from "
|
|
2
|
+
import type { IconProps } from "../../Components/Icon/Icon.types";
|
|
3
|
+
|
|
4
|
+
export type { ToasterProps };
|
|
3
5
|
|
|
4
6
|
export interface ToasterBootstrapProps extends ToasterProps {
|
|
5
7
|
"data-color-mode"?: string;
|
|
@@ -33,15 +33,15 @@ import {
|
|
|
33
33
|
useRef,
|
|
34
34
|
useState,
|
|
35
35
|
} from "react";
|
|
36
|
-
import Icon from "
|
|
37
|
-
import type { PressableProps } from "
|
|
38
|
-
import styles from "
|
|
36
|
+
import Icon from "../../../Components/Icon/Icon";
|
|
37
|
+
import type { PressableProps } from "../../Pressable/Pressable.types";
|
|
38
|
+
import styles from "./DNDView.module.scss";
|
|
39
39
|
import type {
|
|
40
40
|
DNDViewItemState,
|
|
41
41
|
DNDViewProps,
|
|
42
42
|
DNDViewStrategy,
|
|
43
|
-
} from "
|
|
44
|
-
import View from "
|
|
43
|
+
} from "./DNDView.types";
|
|
44
|
+
import View from "../View";
|
|
45
45
|
|
|
46
46
|
const SORTING_STRATEGY: Record<DNDViewStrategy, typeof rectSortingStrategy> = {
|
|
47
47
|
horizontal: horizontalListSortingStrategy,
|