@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,7 +1,7 @@
|
|
|
1
1
|
import type { UniqueIdentifier } from "@dnd-kit/core";
|
|
2
2
|
import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
3
|
-
import type { UIKitSizeValue } from "
|
|
4
|
-
import type { ViewProps } from "
|
|
3
|
+
import type { UIKitSizeValue } from "../../_shared/sizing";
|
|
4
|
+
import type { ViewProps } from "../View.types";
|
|
5
5
|
|
|
6
6
|
export type DNDViewItemState<T> = {
|
|
7
7
|
item: T;
|
|
@@ -14,21 +14,21 @@ import {
|
|
|
14
14
|
useRef,
|
|
15
15
|
useState,
|
|
16
16
|
} from "react";
|
|
17
|
-
import { Size } from "
|
|
18
|
-
import EdgeEffect from "
|
|
19
|
-
import { Radius } from "
|
|
17
|
+
import { Size } from "../../_shared/sizing";
|
|
18
|
+
import EdgeEffect from "../../EdgeEffect/EdgeEffect";
|
|
19
|
+
import { Radius } from "../../Theme/Radius.types";
|
|
20
20
|
import {
|
|
21
21
|
BackgroundBlur,
|
|
22
22
|
Border,
|
|
23
23
|
resolveThemeClasses,
|
|
24
|
-
} from "
|
|
25
|
-
import styles from "
|
|
24
|
+
} from "../../Theme/Theme.types";
|
|
25
|
+
import styles from "./HScrollView.module.scss";
|
|
26
26
|
import type {
|
|
27
27
|
HScrollViewProps,
|
|
28
28
|
HScrollViewViewport,
|
|
29
|
-
} from "
|
|
30
|
-
import View from "
|
|
31
|
-
import viewStyles from "
|
|
29
|
+
} from "./HScrollView.types";
|
|
30
|
+
import View from "../View";
|
|
31
|
+
import viewStyles from "../View.module.scss";
|
|
32
32
|
|
|
33
33
|
type HScrollViewStyle = CSSProperties & {
|
|
34
34
|
"--view-default-gap"?: string | number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
|
|
2
|
-
import type { UIKitSizeValue } from "
|
|
3
|
-
import type { ViewProps } from "
|
|
2
|
+
import type { UIKitSizeValue } from "../../_shared/sizing";
|
|
3
|
+
import type { ViewProps } from "../View.types";
|
|
4
4
|
|
|
5
5
|
export type HScrollViewViewport = "w1" | "w2" | "w3" | "w4";
|
|
6
6
|
export type HScrollViewActive = boolean | HScrollViewViewport;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import Text from "
|
|
4
|
-
import View from "
|
|
3
|
+
import Text from "../../../../Components/Text/Text";
|
|
4
|
+
import View from "../../View";
|
|
5
5
|
|
|
6
6
|
export function DialogImageCounter({
|
|
7
7
|
selectedIndex,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import type { MutableRefObject } from "react";
|
|
4
|
-
import { DialogImageCounter } from "
|
|
5
|
-
import { DialogImageList } from "
|
|
4
|
+
import { DialogImageCounter } from "./ImageDialog.counter";
|
|
5
|
+
import { DialogImageList } from "./ImageDialog.list";
|
|
6
6
|
import type {
|
|
7
7
|
ImageItem,
|
|
8
8
|
ImageProps,
|
|
9
|
-
} from "
|
|
10
|
-
import View from "
|
|
9
|
+
} from "../Image.types";
|
|
10
|
+
import View from "../../View";
|
|
11
11
|
|
|
12
12
|
export interface DialogImageFooterProps {
|
|
13
13
|
dialog: NonNullable<ImageProps["dialog"]>;
|
|
@@ -32,6 +32,10 @@ export function DialogImageFooter({
|
|
|
32
32
|
canScrollPrev,
|
|
33
33
|
canScrollNext,
|
|
34
34
|
}: DialogImageFooterProps) {
|
|
35
|
+
void scrollPrev;
|
|
36
|
+
void scrollNext;
|
|
37
|
+
void canScrollPrev;
|
|
38
|
+
void canScrollNext;
|
|
35
39
|
if (!dialog.footer) return null;
|
|
36
40
|
|
|
37
41
|
const selectedItem = items[selectedIndex];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import Icon from "
|
|
4
|
-
import type { ImageProps } from "
|
|
5
|
-
import View from "
|
|
3
|
+
import Icon from "../../../../Components/Icon/Icon";
|
|
4
|
+
import type { ImageProps } from "../Image.types";
|
|
5
|
+
import View from "../../View";
|
|
6
6
|
|
|
7
7
|
export interface DialogImageHeaderProps {
|
|
8
8
|
config?: NonNullable<ImageProps["dialog"]>["header"];
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import NextImage from "next/image";
|
|
4
4
|
import type { MutableRefObject } from "react";
|
|
5
|
-
import Pressable from "
|
|
6
|
-
import styles from "
|
|
7
|
-
import type { ImageItem } from "
|
|
5
|
+
import Pressable from "../../../Pressable/Pressable";
|
|
6
|
+
import styles from "../Image.module.scss";
|
|
7
|
+
import type { ImageItem } from "../Image.types";
|
|
8
8
|
import {
|
|
9
9
|
resolveBlurDataURL,
|
|
10
10
|
resolveImageSrc,
|
|
11
|
-
} from "
|
|
12
|
-
import View from "
|
|
11
|
+
} from "../Image.utils";
|
|
12
|
+
import View from "../../View";
|
|
13
13
|
|
|
14
14
|
export interface DialogImageListProps {
|
|
15
15
|
items: ImageItem[];
|
|
@@ -4,12 +4,12 @@ import NextImage from "next/image";
|
|
|
4
4
|
import type {
|
|
5
5
|
ImageItem,
|
|
6
6
|
ImageOverlay,
|
|
7
|
-
} from "
|
|
7
|
+
} from "../Image.types";
|
|
8
8
|
import {
|
|
9
9
|
resolveImageSrc,
|
|
10
10
|
resolveOverlay,
|
|
11
|
-
} from "
|
|
12
|
-
import View from "
|
|
11
|
+
} from "../Image.utils";
|
|
12
|
+
import View from "../../View";
|
|
13
13
|
|
|
14
14
|
export interface DialogImageSlideProps {
|
|
15
15
|
item: ImageItem;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
|
-
import { DialogImageFooter } from "
|
|
5
|
-
import { DialogImageHeader } from "
|
|
6
|
-
import { DialogImageSlide } from "
|
|
4
|
+
import { DialogImageFooter } from "./ImageDialog.footer";
|
|
5
|
+
import { DialogImageHeader } from "./ImageDialog.header";
|
|
6
|
+
import { DialogImageSlide } from "./ImageDialog.slide";
|
|
7
7
|
import {
|
|
8
8
|
ImageLeftControl,
|
|
9
9
|
ImageRightControl,
|
|
10
|
-
} from "
|
|
11
|
-
import { useImageDialog } from "
|
|
10
|
+
} from "../Image.controls";
|
|
11
|
+
import { useImageDialog } from "../Image.hooks";
|
|
12
12
|
import type {
|
|
13
13
|
ImageItem,
|
|
14
14
|
ImageProps,
|
|
15
|
-
} from "
|
|
16
|
-
import View from "
|
|
15
|
+
} from "../Image.types";
|
|
16
|
+
import View from "../../View";
|
|
17
17
|
|
|
18
18
|
export type ImageDialogProps = {
|
|
19
19
|
items: ImageItem[];
|
|
@@ -2,32 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
import NextImage from "next/image";
|
|
4
4
|
import { useCallback, useMemo, useState } from "react";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import type { UIKitSizeValue } from "../../_shared/sizing";
|
|
6
|
+
import Dialog from "../../Dialog/Dialog";
|
|
7
|
+
import Pressable from "../../Pressable/Pressable";
|
|
8
|
+
import HScrollView from "../HScrollView/HScrollView";
|
|
9
|
+
import ImageDialog from "./Dialog/ImageDialog";
|
|
9
10
|
import {
|
|
10
11
|
ImageLeftControl,
|
|
11
12
|
ImageRightControl,
|
|
12
|
-
} from "
|
|
13
|
-
import type {
|
|
14
|
-
|
|
13
|
+
} from "./Image.controls";
|
|
14
|
+
import type {
|
|
15
|
+
ImageItem,
|
|
16
|
+
ImageOverlay,
|
|
17
|
+
ImageProps,
|
|
18
|
+
} from "./Image.types";
|
|
15
19
|
import {
|
|
16
20
|
resolveAtIndex,
|
|
17
21
|
resolveBlurDataURL,
|
|
18
22
|
resolveImageSrc,
|
|
19
23
|
resolveItems,
|
|
20
24
|
resolveOverlay,
|
|
21
|
-
} from "
|
|
22
|
-
import View from "
|
|
25
|
+
} from "./Image.utils";
|
|
26
|
+
import View from "../View";
|
|
23
27
|
|
|
24
28
|
const DEFAULT_GROUP_WIDTH = "auto";
|
|
25
29
|
const DEFAULT_GROUP_HEIGHT = "29rem";
|
|
26
30
|
|
|
27
|
-
const PRESSABLE_STYLE: React.CSSProperties = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
const PRESSABLE_STYLE: React.CSSProperties = {
|
|
32
|
+
position: "relative",
|
|
33
|
+
overflow: "hidden",
|
|
34
|
+
};
|
|
35
|
+
const OVERLAY_STYLE: React.CSSProperties = {
|
|
36
|
+
position: "absolute",
|
|
37
|
+
inset: 0,
|
|
38
|
+
pointerEvents: "none",
|
|
39
|
+
};
|
|
40
|
+
const IMG_STYLE: React.CSSProperties = {
|
|
41
|
+
height: "100%",
|
|
42
|
+
objectFit: "cover",
|
|
43
|
+
objectPosition: "center",
|
|
44
|
+
display: "block",
|
|
45
|
+
};
|
|
46
|
+
const NEXT_IMG_STYLE: React.CSSProperties = {
|
|
47
|
+
objectFit: "cover",
|
|
48
|
+
objectPosition: "center",
|
|
49
|
+
};
|
|
31
50
|
|
|
32
51
|
function ImageGroupItem({
|
|
33
52
|
item,
|
|
@@ -42,11 +61,17 @@ function ImageGroupItem({
|
|
|
42
61
|
priority,
|
|
43
62
|
openDialog,
|
|
44
63
|
}: {
|
|
45
|
-
item: {
|
|
64
|
+
item: {
|
|
65
|
+
id: number;
|
|
66
|
+
src: string;
|
|
67
|
+
alt: string;
|
|
68
|
+
srcDialog?: string;
|
|
69
|
+
blurDataURL?: string;
|
|
70
|
+
};
|
|
46
71
|
index: number;
|
|
47
72
|
dialog?: ImageProps["dialog"];
|
|
48
73
|
className?: string;
|
|
49
|
-
radius?:
|
|
74
|
+
radius?: import("../../Theme/Radius.types").RadiusValue;
|
|
50
75
|
width?: UIKitSizeValue | UIKitSizeValue[];
|
|
51
76
|
height?: UIKitSizeValue | UIKitSizeValue[];
|
|
52
77
|
overlay?: ImageOverlay;
|
|
@@ -89,11 +114,7 @@ function ImageGroupItem({
|
|
|
89
114
|
style={NEXT_IMG_STYLE}
|
|
90
115
|
/>
|
|
91
116
|
)}
|
|
92
|
-
{resolvedOverlay &&
|
|
93
|
-
<View style={OVERLAY_STYLE}>
|
|
94
|
-
{resolvedOverlay}
|
|
95
|
-
</View>
|
|
96
|
-
)}
|
|
117
|
+
{resolvedOverlay && <View style={OVERLAY_STYLE}>{resolvedOverlay}</View>}
|
|
97
118
|
</Pressable>
|
|
98
119
|
);
|
|
99
120
|
}
|
|
@@ -164,9 +185,7 @@ export default function Image({
|
|
|
164
185
|
className={
|
|
165
186
|
typeof control === "object" ? control.groupClassName : undefined
|
|
166
187
|
}
|
|
167
|
-
style={
|
|
168
|
-
typeof control === "object" ? control.groupStyle : undefined
|
|
169
|
-
}
|
|
188
|
+
style={typeof control === "object" ? control.groupStyle : undefined}
|
|
170
189
|
>
|
|
171
190
|
{renderLeft && (
|
|
172
191
|
<ImageLeftControl
|
|
@@ -192,7 +211,7 @@ export default function Image({
|
|
|
192
211
|
if (items.length === 0) return null;
|
|
193
212
|
|
|
194
213
|
if (items.length === 1) {
|
|
195
|
-
const item = items[0]
|
|
214
|
+
const item = items[0] as ImageItem;
|
|
196
215
|
const resolvedWidth = resolveAtIndex(width, 0);
|
|
197
216
|
const resolvedHeight = resolveAtIndex(height, 0);
|
|
198
217
|
const resolvedOverlay = resolveOverlay(overlay, 0);
|
|
@@ -309,9 +328,7 @@ export default function Image({
|
|
|
309
328
|
|
|
310
329
|
{}
|
|
311
330
|
{resolvedOverlay && (
|
|
312
|
-
<View style={OVERLAY_STYLE}>
|
|
313
|
-
{resolvedOverlay}
|
|
314
|
-
</View>
|
|
331
|
+
<View style={OVERLAY_STYLE}>{resolvedOverlay}</View>
|
|
315
332
|
)}
|
|
316
333
|
</View>
|
|
317
334
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
-
import type { UIKitSizeValue } from "
|
|
3
|
-
import type { RadiusProps } from "
|
|
2
|
+
import type { UIKitSizeValue } from "../../_shared/sizing";
|
|
3
|
+
import type { RadiusProps } from "../../Theme/Radius.types";
|
|
4
4
|
|
|
5
5
|
export type ImageItem = {
|
|
6
6
|
id: number;
|
|
@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
import type {
|
|
3
3
|
ImageItem,
|
|
4
4
|
ImageOverlay,
|
|
5
|
-
} from "
|
|
5
|
+
} from "./Image.types";
|
|
6
6
|
|
|
7
7
|
export type ImageMode = "inline" | "dialog";
|
|
8
8
|
|
|
@@ -75,5 +75,5 @@ export function resolveBlurDataURL(item: ImageItem, index: number): string {
|
|
|
75
75
|
String(item.id)
|
|
76
76
|
.split("")
|
|
77
77
|
.reduce((acc, char) => acc + char.charCodeAt(0), 0) + index;
|
|
78
|
-
return FALLBACK_BLURS[hash % FALLBACK_BLURS.length]
|
|
78
|
+
return FALLBACK_BLURS[hash % FALLBACK_BLURS.length] ?? "";
|
|
79
79
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
2
|
import { motion } from "motion/react";
|
|
3
3
|
import { type CSSProperties, forwardRef } from "react";
|
|
4
|
-
import { resolvePadding } from "
|
|
5
|
-
import { Size } from "
|
|
6
|
-
import Squircle from "
|
|
7
|
-
import { Radius } from "
|
|
4
|
+
import { resolvePadding } from "../_shared/Padding.types";
|
|
5
|
+
import { Size } from "../_shared/sizing";
|
|
6
|
+
import Squircle from "../Squircle/Squircle";
|
|
7
|
+
import { Radius } from "../Theme/Radius.types";
|
|
8
8
|
import {
|
|
9
9
|
BackgroundBlur,
|
|
10
10
|
Border,
|
|
11
11
|
resolveThemeClasses,
|
|
12
12
|
resolveThemeHasBorder,
|
|
13
13
|
Shadow,
|
|
14
|
-
} from "
|
|
15
|
-
import DNDView from "
|
|
16
|
-
import styles from "
|
|
17
|
-
import type { ViewProps } from "
|
|
14
|
+
} from "../Theme/Theme.types";
|
|
15
|
+
import DNDView from "./DNDView/DNDView";
|
|
16
|
+
import styles from "./View.module.scss";
|
|
17
|
+
import type { ViewProps } from "./View.types";
|
|
18
18
|
|
|
19
19
|
type ViewStyle = CSSProperties & {
|
|
20
20
|
"--view-default-gap"?: string | number;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { MotionProps } from "motion/react";
|
|
2
2
|
import type { CSSProperties, HTMLAttributes } from "react";
|
|
3
|
-
import type { PaddingProps } from "
|
|
4
|
-
import type { UIKitSizeValue } from "
|
|
5
|
-
import type { WindProps } from "
|
|
6
|
-
import type { RadiusProps } from "
|
|
3
|
+
import type { PaddingProps } from "../_shared/Padding.types";
|
|
4
|
+
import type { UIKitSizeValue } from "../_shared/sizing";
|
|
5
|
+
import type { WindProps } from "../_shared/Wind.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
|
|
|
12
12
|
export interface ViewProps
|
|
13
13
|
extends Omit<HTMLAttributes<HTMLDivElement>, "color">,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Size,
|
|
3
3
|
type UIKitSizeValue,
|
|
4
|
-
} from "
|
|
4
|
+
} from "./sizing";
|
|
5
5
|
|
|
6
6
|
type PaddingUnitValue = UIKitSizeValue;
|
|
7
7
|
|
|
@@ -23,9 +23,7 @@ export interface PaddingProps {
|
|
|
23
23
|
paddingVertical?: UIKitSizeValue;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function PaddingValue(
|
|
27
|
-
padding?: PaddingValue,
|
|
28
|
-
): string | number | undefined {
|
|
26
|
+
function PaddingValue(padding?: PaddingValue): string | number | undefined {
|
|
29
27
|
if (padding === undefined || padding === null) {
|
|
30
28
|
return undefined;
|
|
31
29
|
}
|