@noya-app/noya-designsystem 0.1.64 → 0.1.65
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/.turbo/turbo-build.log +13 -10
- package/CHANGELOG.md +12 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +501 -228
- package/dist/index.d.ts +501 -228
- package/dist/index.js +6738 -2571
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6697 -2499
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/ActivityIndicator.tsx +9 -4
- package/src/components/ActivityLog.tsx +197 -0
- package/src/components/AnimatePresence.tsx +37 -22
- package/src/components/Avatar.tsx +42 -25
- package/src/components/Banner.tsx +57 -11
- package/src/components/BaseToolbar.tsx +29 -7
- package/src/components/Breadcrumbs.tsx +2 -2
- package/src/components/Button.tsx +23 -24
- package/src/components/Checkbox.tsx +6 -35
- package/src/components/Chip.tsx +45 -33
- package/src/components/Collection.tsx +16 -11
- package/src/components/ColorSwatch.tsx +3 -3
- package/src/components/ColorSwatchControl.tsx +2 -2
- package/src/components/Combobox.tsx +6 -6
- package/src/components/ComboboxMenu.tsx +6 -5
- package/src/components/CommandPalette.tsx +1 -1
- package/src/components/Dialog.tsx +6 -12
- package/src/components/Divider.tsx +8 -8
- package/src/components/DraggableMenuButton.tsx +9 -5
- package/src/components/Drawer.tsx +5 -5
- package/src/components/DropdownMenu.tsx +1 -1
- package/src/components/EditableText.tsx +2 -2
- package/src/components/Fade.tsx +13 -13
- package/src/components/FileUploadIndicator.tsx +11 -11
- package/src/components/FloatingWindow.tsx +2 -2
- package/src/components/Grid.tsx +18 -11
- package/src/components/GridView.tsx +32 -25
- package/src/components/IVirtualizedList.tsx +5 -0
- package/src/components/Icons.tsx +24 -4
- package/src/components/InputField.tsx +19 -19
- package/src/components/InspectorContainer.tsx +2 -2
- package/src/components/InspectorPrimitives.tsx +15 -9
- package/src/components/Label.tsx +4 -3
- package/src/components/LabeledElementView.tsx +3 -3
- package/src/components/LabeledField.tsx +6 -6
- package/src/components/List.tsx +103 -45
- package/src/components/ListMenu.tsx +91 -0
- package/src/components/ListNavigator.tsx +106 -0
- package/src/components/ListView.tsx +20 -1158
- package/src/components/MediaThumbnail.tsx +56 -15
- package/src/components/Message.tsx +5 -5
- package/src/components/Navigator.tsx +461 -0
- package/src/components/NoyaLogo.tsx +1 -1
- package/src/components/Popover.tsx +9 -5
- package/src/components/Progress.tsx +19 -9
- package/src/components/ResizableContainer.tsx +187 -0
- package/src/components/RingProgress.tsx +128 -0
- package/src/components/ScrollArea.tsx +4 -4
- package/src/components/ScrollableSidebar.tsx +10 -0
- package/src/components/SearchCompletionMenu.tsx +3 -3
- package/src/components/Section.tsx +107 -57
- package/src/components/SegmentedControl.tsx +29 -29
- package/src/components/SelectMenu.tsx +13 -20
- package/src/components/SelectionToolbar.tsx +4 -3
- package/src/components/Slider.tsx +9 -9
- package/src/components/Spacer.tsx +2 -2
- package/src/components/StackNavigator.tsx +378 -0
- package/src/components/Stepper.tsx +88 -0
- package/src/components/Switch.tsx +4 -4
- package/src/components/Tabs.tsx +3 -3
- package/src/components/Text.tsx +23 -13
- package/src/components/TextArea.tsx +3 -3
- package/src/components/Toast.tsx +4 -4
- package/src/components/Toolbar.tsx +50 -9
- package/src/components/ToolbarDrawer.tsx +2 -2
- package/src/components/Tooltip.tsx +1 -1
- package/src/components/TreeView.tsx +11 -4
- package/src/components/UserPointer.tsx +4 -4
- package/src/components/ai-assistant/AIAssistantLayout.tsx +8 -8
- package/src/components/blocks/ImageBlockComponent.tsx +13 -7
- package/src/components/connected-users-menu/ConnectedUsersMenuLayout.tsx +4 -4
- package/src/components/file-explorer/FileExplorerLayout.tsx +20 -8
- package/src/components/internal/Checkmark.tsx +1 -1
- package/src/components/internal/Menu.tsx +22 -18
- package/src/components/internal/MenuViewport.tsx +13 -6
- package/src/components/internal/SelectItem.tsx +3 -3
- package/src/components/internal/TextInput.tsx +5 -1
- package/src/components/listView/ListViewContexts.tsx +68 -0
- package/src/components/listView/ListViewEditableRowTitle.tsx +55 -0
- package/src/components/listView/ListViewRoot.tsx +521 -0
- package/src/components/listView/ListViewRow.tsx +475 -0
- package/src/components/listView/ListViewRowTitle.tsx +21 -0
- package/src/components/listView/types.ts +11 -0
- package/src/components/pipeline/PipelineResultLayout.tsx +6 -6
- package/src/components/sorting/DragRegistration.tsx +2 -1
- package/src/components/sorting/SharedDragProvider.tsx +91 -9
- package/src/components/sorting/Sortable.tsx +71 -17
- package/src/components/workspace/DrawerWorkspaceLayout.tsx +5 -5
- package/src/components/workspace/PanelWorkspaceLayout.tsx +65 -49
- package/src/components/workspace/VerticalTabMenu.tsx +25 -15
- package/src/components/workspace/WorkspaceLayout.tsx +30 -21
- package/src/contexts/DialogContext.tsx +17 -5
- package/src/hooks/useIndent.ts +3 -8
- package/src/index.css +24 -10
- package/src/index.tsx +10 -5
- package/src/utils/classNames.ts +52 -6
- package/src/utils/editableBlockStyles.ts +2 -2
- package/src/utils/formatByteSize.ts +1 -0
- package/src/utils/inputs.ts +8 -6
- package/src/utils/sketchColor.ts +0 -34
- package/tailwind.config.ts +1 -0
- package/src/components/FillInputField.tsx +0 -37
- package/src/components/FillPreviewBackground.tsx +0 -134
- package/src/components/GradientPicker.tsx +0 -90
- package/src/utils/getGradientBackground.tsx +0 -31
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Alpha,
|
|
5
|
-
ColorModel,
|
|
6
|
-
Gradient,
|
|
7
|
-
Hue,
|
|
8
|
-
ColorPicker as NoyaColorPicker,
|
|
9
|
-
RgbaColor,
|
|
10
|
-
Saturation,
|
|
11
|
-
equalColorObjects,
|
|
12
|
-
hsvaToRgba,
|
|
13
|
-
rgbaToHsva,
|
|
14
|
-
} from "@noya-app/noya-colorpicker";
|
|
15
|
-
import type { Sketch } from "@noya-app/noya-file-format";
|
|
16
|
-
import * as React from "react";
|
|
17
|
-
import { Spacer } from "../components/Spacer";
|
|
18
|
-
import { rgbaToSketchColor, sketchColorToRgba } from "../utils/sketchColor";
|
|
19
|
-
|
|
20
|
-
interface Props {
|
|
21
|
-
value: Sketch.GradientStop[];
|
|
22
|
-
selectedStop: number;
|
|
23
|
-
onChangeColor: (color: Sketch.Color) => void;
|
|
24
|
-
onChangePosition: (position: number) => void;
|
|
25
|
-
onAdd: (color: Sketch.Color, position: number) => void;
|
|
26
|
-
onDelete: () => void;
|
|
27
|
-
onSelectStop: (index: number) => void;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export const GradientPicker = React.memo(function GradientPicker({
|
|
31
|
-
value,
|
|
32
|
-
selectedStop,
|
|
33
|
-
onChangeColor,
|
|
34
|
-
onChangePosition,
|
|
35
|
-
onAdd,
|
|
36
|
-
onDelete,
|
|
37
|
-
onSelectStop,
|
|
38
|
-
}: Props) {
|
|
39
|
-
const colorModel: ColorModel<RgbaColor> = React.useMemo(
|
|
40
|
-
() => ({
|
|
41
|
-
defaultColor: { r: 0, g: 0, b: 0, a: 1 },
|
|
42
|
-
toHsva: rgbaToHsva,
|
|
43
|
-
fromHsva: hsvaToRgba,
|
|
44
|
-
equal: equalColorObjects,
|
|
45
|
-
}),
|
|
46
|
-
[]
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
const rgbaColor = React.useMemo(
|
|
50
|
-
() => sketchColorToRgba(value[selectedStop].color),
|
|
51
|
-
[value, selectedStop]
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
const handleChangeColor = React.useCallback(
|
|
55
|
-
(value: RgbaColor) => {
|
|
56
|
-
onChangeColor(rgbaToSketchColor(value));
|
|
57
|
-
},
|
|
58
|
-
[onChangeColor]
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const handleAddGradientStop = React.useCallback(
|
|
62
|
-
(value: RgbaColor, position: number) => {
|
|
63
|
-
onAdd(rgbaToSketchColor(value), position);
|
|
64
|
-
},
|
|
65
|
-
[onAdd]
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<NoyaColorPicker
|
|
70
|
-
onChange={handleChangeColor}
|
|
71
|
-
colorModel={colorModel}
|
|
72
|
-
color={rgbaColor}
|
|
73
|
-
>
|
|
74
|
-
<Gradient
|
|
75
|
-
gradients={value}
|
|
76
|
-
selectedStop={selectedStop}
|
|
77
|
-
onSelectStop={onSelectStop}
|
|
78
|
-
onChangePosition={onChangePosition}
|
|
79
|
-
onAdd={handleAddGradientStop}
|
|
80
|
-
onDelete={onDelete}
|
|
81
|
-
/>
|
|
82
|
-
<Spacer.Vertical size={10} />
|
|
83
|
-
<Saturation />
|
|
84
|
-
<Spacer.Vertical size={12} />
|
|
85
|
-
<Hue />
|
|
86
|
-
<Spacer.Vertical size={5} />
|
|
87
|
-
<Alpha />
|
|
88
|
-
</NoyaColorPicker>
|
|
89
|
-
);
|
|
90
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Sketch } from "@noya-app/noya-file-format";
|
|
2
|
-
import { sketchColorToRgbaString } from "./sketchColor";
|
|
3
|
-
|
|
4
|
-
const getRGBAColor = (value: Sketch.GradientStop[], num: 100 | 360) =>
|
|
5
|
-
[...value]
|
|
6
|
-
.sort((a, b) => a.position - b.position)
|
|
7
|
-
.map(
|
|
8
|
-
(g) =>
|
|
9
|
-
`${sketchColorToRgbaString(g.color)} ${g.position * num}${
|
|
10
|
-
num === 100 ? "%" : "deg"
|
|
11
|
-
}`
|
|
12
|
-
)
|
|
13
|
-
.join(", \n");
|
|
14
|
-
|
|
15
|
-
export function getGradientBackground(
|
|
16
|
-
value: Sketch.GradientStop[],
|
|
17
|
-
type: Sketch.GradientType,
|
|
18
|
-
direction?: number
|
|
19
|
-
) {
|
|
20
|
-
if (type === Sketch.GradientType.Angular) {
|
|
21
|
-
return `conic-gradient(${getRGBAColor(value, 360)})`;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const color = getRGBAColor(value, 100);
|
|
25
|
-
const position =
|
|
26
|
-
type === Sketch.GradientType.Radial
|
|
27
|
-
? "radial-gradient(circle"
|
|
28
|
-
: `linear-gradient(${direction !== undefined ? direction : 180}deg`;
|
|
29
|
-
|
|
30
|
-
return `${position}, ${color})`;
|
|
31
|
-
}
|