@noya-app/noya-designsystem 0.1.41 → 0.1.43
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 +10 -10
- package/CHANGELOG.md +16 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +268 -147
- package/dist/index.d.ts +268 -147
- package/dist/index.js +7618 -6908
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6161 -5487
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -5
- package/src/__tests__/combobox.test.ts +578 -0
- package/src/components/ActivityIndicator.tsx +4 -4
- package/src/components/AnimatePresence.tsx +5 -5
- package/src/components/Avatar.tsx +5 -2
- package/src/components/BaseToolbar.tsx +61 -0
- package/src/components/Button.tsx +1 -1
- package/src/components/Checkbox.tsx +6 -5
- package/src/components/Combobox.tsx +327 -337
- package/src/components/ComboboxMenu.tsx +88 -0
- package/src/components/Dialog.tsx +10 -6
- package/src/components/DimensionInput.tsx +4 -4
- package/src/components/FillPreviewBackground.tsx +51 -44
- package/src/components/FloatingWindow.tsx +5 -2
- package/src/components/GradientPicker.tsx +14 -14
- package/src/components/IconButton.tsx +6 -12
- package/src/components/Icons.tsx +3 -3
- package/src/components/InputField.tsx +145 -160
- package/src/components/Label.tsx +4 -4
- package/src/components/LabeledElementView.tsx +35 -41
- package/src/components/ListView.tsx +49 -39
- package/src/components/Message.tsx +75 -0
- package/src/components/Progress.tsx +2 -2
- package/src/components/ScrollArea.tsx +7 -5
- package/src/components/SegmentedControl.tsx +171 -0
- package/src/components/SelectMenu.tsx +61 -10
- package/src/components/Slider.tsx +5 -2
- package/src/components/Sortable.tsx +17 -27
- package/src/components/Spacer.tsx +28 -9
- package/src/components/Switch.tsx +8 -8
- package/src/components/TextArea.tsx +59 -12
- package/src/components/Toolbar.tsx +129 -0
- package/src/components/Tooltip.tsx +10 -7
- package/src/components/WorkspaceLayout.tsx +145 -152
- package/src/components/internal/Menu.tsx +5 -4
- package/src/contexts/DesignSystemConfiguration.tsx +15 -24
- package/src/contexts/DialogContext.tsx +137 -49
- package/src/contexts/ImageDataContext.tsx +6 -12
- package/src/index.css +1 -3
- package/src/index.tsx +12 -3
- package/src/utils/combobox.ts +369 -0
- package/tailwind.config.ts +1 -2
- package/src/components/RadioGroup.tsx +0 -100
- package/src/utils/completions.ts +0 -21
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { cssVars } from "../theme";
|
|
3
|
+
import { Divider, DividerVertical } from "./Divider";
|
|
4
|
+
import { Spacer } from "./Spacer";
|
|
5
|
+
|
|
6
|
+
export interface BaseToolbarProps {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
left?: React.ReactNode;
|
|
9
|
+
right?: React.ReactNode;
|
|
10
|
+
logo?: React.ReactNode;
|
|
11
|
+
showDivider?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function BaseToolbar({
|
|
15
|
+
children,
|
|
16
|
+
left,
|
|
17
|
+
right,
|
|
18
|
+
logo,
|
|
19
|
+
showDivider = true,
|
|
20
|
+
}: BaseToolbarProps) {
|
|
21
|
+
return (
|
|
22
|
+
<div className="flex flex-col">
|
|
23
|
+
<div
|
|
24
|
+
className="flex items-center pr-2.5 bg-sidebar-background flex-none relative"
|
|
25
|
+
style={{
|
|
26
|
+
flex: `0 0 ${cssVars.spacing.toolbarHeight}`,
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
{logo && (
|
|
30
|
+
<>
|
|
31
|
+
{logo}
|
|
32
|
+
<DividerVertical />
|
|
33
|
+
</>
|
|
34
|
+
)}
|
|
35
|
+
<Spacer.Horizontal size={10} />
|
|
36
|
+
{left && (
|
|
37
|
+
<>
|
|
38
|
+
<div className="flex gap-toolbar-separator">{left}</div>
|
|
39
|
+
<Spacer.Horizontal size={10} />
|
|
40
|
+
</>
|
|
41
|
+
)}
|
|
42
|
+
<div className="flex items-center justify-center text-text-muted pointer-events-none lg:absolute inset-0">
|
|
43
|
+
<div
|
|
44
|
+
style={{
|
|
45
|
+
display: "flex",
|
|
46
|
+
alignItems: "center",
|
|
47
|
+
justifyContent: "center",
|
|
48
|
+
pointerEvents: "all",
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
<Spacer.Horizontal />
|
|
55
|
+
<Spacer.Horizontal size={10} />
|
|
56
|
+
<div className="flex gap-toolbar-separator">{right}</div>
|
|
57
|
+
</div>
|
|
58
|
+
{showDivider && <Divider variant="strong" />}
|
|
59
|
+
</div>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -87,7 +87,7 @@ export const Button = forwardRef(function Button(
|
|
|
87
87
|
ref={forwardedRef}
|
|
88
88
|
id={id}
|
|
89
89
|
className={cx(
|
|
90
|
-
"no-underline leading-[1] relative border-0 outline-none select-none text-left rounded flex items-center justify-center [&>*]:pointer-events-none [-webkit-app-region:no-drag] focus:ring-2 focus:ring-primary focus:shadow-[0_0_0_1px_var(--popover-background)_inset]",
|
|
90
|
+
"no-underline leading-[1] relative border-0 outline-none select-none text-left rounded flex items-center justify-center [&>*]:pointer-events-none [-webkit-app-region:no-drag] focus:ring-2 focus:ring-primary focus:shadow-[0_0_0_1px_var(--popover-background)_inset] transition-all",
|
|
91
91
|
disabled ? "opacity-25" : "",
|
|
92
92
|
!className?.includes("flex") ? "flex-none" : "",
|
|
93
93
|
active
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { cx } from "../utils/classNames";
|
|
3
3
|
|
|
4
4
|
interface CheckboxProps
|
|
5
|
-
extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
5
|
+
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
6
6
|
colorScheme?: "primary" | "secondary";
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -12,8 +12,8 @@ const colorSchemeStyles = {
|
|
|
12
12
|
secondary: "text-secondary",
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export const Checkbox = memo(
|
|
16
|
-
forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(
|
|
15
|
+
export const Checkbox = React.memo(
|
|
16
|
+
React.forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(
|
|
17
17
|
{ className, style, colorScheme = "secondary", ...props },
|
|
18
18
|
ref
|
|
19
19
|
) {
|
|
@@ -37,7 +37,7 @@ export const Checkbox = memo(
|
|
|
37
37
|
m-0
|
|
38
38
|
rounded
|
|
39
39
|
bg-input-background
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
border
|
|
42
42
|
border-divider
|
|
43
43
|
disabled:opacity-50
|
|
@@ -46,6 +46,7 @@ export const Checkbox = memo(
|
|
|
46
46
|
focus:ring-primary
|
|
47
47
|
focus:ring-offset-1
|
|
48
48
|
focus:z-interactable
|
|
49
|
+
transition-all
|
|
49
50
|
`}
|
|
50
51
|
{...props}
|
|
51
52
|
/>
|