@phpsoftbox/react-softbox 0.6.1 → 0.7.0
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/dist/components/Drawer/Drawer.module.css +5 -1
- package/dist/components/Input/Input.d.ts +3 -2
- package/dist/components/Input/Textarea/Textarea.d.ts +3 -4
- package/dist/components/Input/Textarea/Textarea.js +5 -3
- package/dist/components/Input/Textarea/Textarea.js.map +1 -1
- package/dist/components/MarkdownEditor/MarkdownEditor.d.ts +40 -0
- package/dist/components/MarkdownEditor/MarkdownEditor.js +1149 -0
- package/dist/components/MarkdownEditor/MarkdownEditor.js.map +1 -0
- package/dist/components/MarkdownEditor/MarkdownEditor.module.css +447 -0
- package/dist/components/Menu/Dropdown.d.ts +2 -0
- package/dist/components/Menu/Dropdown.js +1 -0
- package/dist/components/Menu/Dropdown.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +2 -0
- package/dist/components/Menu/Menu.js +9 -3
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Menu/Menu.module.css +5 -1
- package/dist/components/Tooltip/Tooltip.module.css +2 -0
- package/dist/foundations/tokens.css +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
.panel {
|
|
12
12
|
height: 100%;
|
|
13
|
+
max-height: 100vh;
|
|
13
14
|
background: var(--surface-panel);
|
|
14
15
|
border-left: 1px solid var(--color-line);
|
|
15
16
|
box-shadow: var(--shadow-soft);
|
|
@@ -18,6 +19,7 @@
|
|
|
18
19
|
padding: var(--spacing-6);
|
|
19
20
|
gap: var(--spacing-4);
|
|
20
21
|
animation: drawer-slide-in-right 0.24s ease;
|
|
22
|
+
overflow: hidden;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
.inline {
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
position: sticky;
|
|
27
29
|
top: 0;
|
|
28
30
|
height: 100vh;
|
|
29
|
-
overflow:
|
|
31
|
+
overflow: hidden;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
.left {
|
|
@@ -58,6 +60,8 @@
|
|
|
58
60
|
.body {
|
|
59
61
|
flex: 1;
|
|
60
62
|
color: var(--color-muted);
|
|
63
|
+
min-height: 0;
|
|
64
|
+
overflow-y: auto;
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
.footer {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import Textarea from './Textarea/Textarea';
|
|
2
1
|
import Select from './Select/Select';
|
|
3
2
|
import FloatLabel from './FloatLabel/FloatLabel';
|
|
4
3
|
import { InputGroup, InputAddon } from './InputGroup';
|
|
@@ -32,7 +31,9 @@ declare const Input: import("react").FC<import("react").HTMLAttributes<HTMLDivEl
|
|
|
32
31
|
Field: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
33
32
|
hasError?: boolean;
|
|
34
33
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
35
|
-
TextArea:
|
|
34
|
+
TextArea: import("react").ForwardRefExoticComponent<import("react").TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
35
|
+
hasError?: boolean;
|
|
36
|
+
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
36
37
|
Select: typeof Select;
|
|
37
38
|
FloatLabel: typeof FloatLabel;
|
|
38
39
|
Group: typeof InputGroup;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
declare const Textarea: React.ForwardRefExoticComponent<React.TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
3
3
|
hasError?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export default
|
|
6
|
-
export {};
|
|
4
|
+
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
5
|
+
export default Textarea;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styles from './Textarea.module.css';
|
|
4
4
|
import { useFormFieldContext } from '../FormField/FormField';
|
|
5
|
-
|
|
5
|
+
const Textarea = React.forwardRef(function Textarea({ hasError = false, className, ...props }, ref) {
|
|
6
6
|
const context = useFormFieldContext();
|
|
7
7
|
const generatedId = React.useId();
|
|
8
8
|
const resolvedId = props.id ?? context?.fieldId ?? (props.name ? `field-${props.name}` : generatedId);
|
|
@@ -16,6 +16,8 @@ export default function Textarea({ hasError = false, className, ...props }) {
|
|
|
16
16
|
React.useEffect(() => {
|
|
17
17
|
context?.registerField(resolvedId, props.name);
|
|
18
18
|
}, [context, resolvedId, props.name]);
|
|
19
|
-
return _jsx("textarea", { id: resolvedId, className: classes, ...props });
|
|
20
|
-
}
|
|
19
|
+
return _jsx("textarea", { ref: ref, id: resolvedId, className: classes, ...props });
|
|
20
|
+
});
|
|
21
|
+
Textarea.displayName = 'Textarea';
|
|
22
|
+
export default Textarea;
|
|
21
23
|
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/components/Input/Textarea/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAM7D,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/components/Input/Textarea/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAM7D,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAA6B,SAAS,QAAQ,CAC7E,EACE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import React from 'react';
|
|
2
|
+
import 'prismjs/components/prism-markup';
|
|
3
|
+
import 'prismjs/components/prism-markup-templating';
|
|
4
|
+
import 'prismjs/components/prism-clike';
|
|
5
|
+
import 'prismjs/components/prism-javascript';
|
|
6
|
+
import 'prismjs/components/prism-typescript';
|
|
7
|
+
import 'prismjs/components/prism-jsx';
|
|
8
|
+
import 'prismjs/components/prism-tsx';
|
|
9
|
+
import 'prismjs/components/prism-json';
|
|
10
|
+
import 'prismjs/components/prism-css';
|
|
11
|
+
import 'prismjs/components/prism-bash';
|
|
12
|
+
import 'prismjs/components/prism-markdown';
|
|
13
|
+
import 'prismjs/components/prism-php';
|
|
14
|
+
export type MarkdownEditorProps = {
|
|
15
|
+
value: string;
|
|
16
|
+
onChange: (value: string) => void;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
editorLabel?: string;
|
|
21
|
+
previewLabel?: string;
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
minHeight?: number;
|
|
24
|
+
className?: string;
|
|
25
|
+
editorClassName?: string;
|
|
26
|
+
previewClassName?: string;
|
|
27
|
+
};
|
|
28
|
+
export type MarkdownEditorSlotProps = {
|
|
29
|
+
className?: string;
|
|
30
|
+
label?: string;
|
|
31
|
+
};
|
|
32
|
+
declare const MarkdownEditorTextareaSlot: React.FC<MarkdownEditorSlotProps>;
|
|
33
|
+
declare const MarkdownEditorPreviewSlot: React.FC<MarkdownEditorSlotProps>;
|
|
34
|
+
declare function MarkdownEditorRoot({ value, onChange, children, placeholder, label, editorLabel, previewLabel, readOnly, minHeight, className, editorClassName, previewClassName, }: MarkdownEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
type MarkdownEditorComponent = typeof MarkdownEditorRoot & {
|
|
36
|
+
Textarea: typeof MarkdownEditorTextareaSlot;
|
|
37
|
+
Preview: typeof MarkdownEditorPreviewSlot;
|
|
38
|
+
};
|
|
39
|
+
declare const MarkdownEditor: MarkdownEditorComponent;
|
|
40
|
+
export default MarkdownEditor;
|