@strapi/design-system 2.0.0-rc.28 → 2.0.0-rc.30
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/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Select/MultiSelect.d.ts +1 -1
- package/dist/components/Select/SingleSelect.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -16
- package/dist/index.mjs.map +1 -1
- package/dist/utilities/Portal/Portal.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import styled$1, { styled, css, keyframes, useTheme, createGlobalStyle, ThemeProvider } from "styled-components";
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { useEffect, useLayoutEffect, useState, useMemo } from "react";
|
|
3
4
|
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
|
|
4
|
-
import { DateFormatter, getLocalTimeZone, today, minDate, maxDate, startOfMonth, startOfWeek, getDayOfWeek, isSameDay, endOfMonth,
|
|
5
|
+
import { DateFormatter, getLocalTimeZone, today, parseAbsolute, toCalendarDate, minDate, maxDate, startOfMonth, startOfWeek, getDayOfWeek, isSameDay, endOfMonth, parseAbsoluteToLocal, toCalendarDateTime } from "@internationalized/date";
|
|
5
6
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
6
7
|
import * as Tooltip from "@radix-ui/react-tooltip";
|
|
7
8
|
import { Provider as Provider$1 } from "@radix-ui/react-tooltip";
|
|
8
|
-
import styled$1, { styled, css, keyframes, useTheme, createGlobalStyle, ThemeProvider } from "styled-components";
|
|
9
9
|
import * as DismissibleLayerPrimitive from "@radix-ui/react-dismissable-layer";
|
|
10
10
|
import { useCallbackRef as useCallbackRef$1, Combobox as Combobox$1, Select, composeEventHandlers, usePrev } from "@strapi/ui-primitives";
|
|
11
11
|
import { composeEventHandlers as composeEventHandlers2, useCallbackRef as useCallbackRef2, useCollator, useFilter } from "@strapi/ui-primitives";
|
|
@@ -16,15 +16,15 @@ import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
|
16
16
|
import * as Checkbox from "@radix-ui/react-checkbox";
|
|
17
17
|
import * as ScrollArea from "@radix-ui/react-scroll-area";
|
|
18
18
|
import * as AlertDialog from "@radix-ui/react-alert-dialog";
|
|
19
|
-
import { useFloating, offset, shift, flip
|
|
19
|
+
import { useFloating, autoUpdate, offset, shift, flip } from "@floating-ui/react-dom";
|
|
20
20
|
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
21
21
|
import { FocusScope } from "@radix-ui/react-focus-scope";
|
|
22
22
|
import { createPortal } from "react-dom";
|
|
23
23
|
import { RemoveScroll } from "react-remove-scroll";
|
|
24
24
|
import { json, jsonParseLinter } from "@codemirror/lang-json";
|
|
25
25
|
import { useCodeMirror } from "@uiw/react-codemirror";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
26
|
+
import { StateField, StateEffect } from "@codemirror/state";
|
|
27
|
+
import { EditorView, Decoration } from "@codemirror/view";
|
|
28
28
|
import * as Dialog$1 from "@radix-ui/react-dialog";
|
|
29
29
|
import { NumberParser, NumberFormatter } from "@internationalized/number";
|
|
30
30
|
import * as Popover$1 from "@radix-ui/react-popover";
|
|
@@ -2304,15 +2304,11 @@ const KeyboardKeys = {
|
|
|
2304
2304
|
LEFT: "ArrowLeft",
|
|
2305
2305
|
ESCAPE: "Escape",
|
|
2306
2306
|
ENTER: "Enter",
|
|
2307
|
-
SPACE: " ",
|
|
2308
2307
|
TAB: "Tab",
|
|
2309
2308
|
END: "End",
|
|
2310
2309
|
HOME: "Home",
|
|
2311
|
-
DELETE: "Delete",
|
|
2312
2310
|
PAGE_UP: "PageUp",
|
|
2313
|
-
PAGE_DOWN: "PageDown"
|
|
2314
|
-
BACKSPACE: "Backspace",
|
|
2315
|
-
CLEAR: "Clear"
|
|
2311
|
+
PAGE_DOWN: "PageDown"
|
|
2316
2312
|
};
|
|
2317
2313
|
const CarouselGrid = styled(Box)`
|
|
2318
2314
|
grid-template-columns: auto 1fr auto;
|
|
@@ -3400,7 +3396,7 @@ const Overlay$1 = styled(AlertDialog.Overlay)`
|
|
|
3400
3396
|
const ContentImpl$1 = styled(AlertDialog.Content)`
|
|
3401
3397
|
max-width: 42rem;
|
|
3402
3398
|
height: min-content;
|
|
3403
|
-
width: 100
|
|
3399
|
+
width: calc(100% - ${({ theme }) => theme.spaces[8]});
|
|
3404
3400
|
overflow: hidden;
|
|
3405
3401
|
margin: 0 auto;
|
|
3406
3402
|
display: flex;
|
|
@@ -3699,7 +3695,10 @@ const DesignSystemProvider = ({
|
|
|
3699
3695
|
const DismissibleLayer = DismissibleLayerPrimitive.Root;
|
|
3700
3696
|
const Portal$1 = React.forwardRef(
|
|
3701
3697
|
({ container = globalThis?.document?.body, ...portalProps }, forwardedRef) => {
|
|
3702
|
-
|
|
3698
|
+
if (!container) {
|
|
3699
|
+
return null;
|
|
3700
|
+
}
|
|
3701
|
+
return createPortal(/* @__PURE__ */ jsx(Box, { ref: forwardedRef, ...portalProps }), container);
|
|
3703
3702
|
}
|
|
3704
3703
|
);
|
|
3705
3704
|
Portal$1.displayName = "Portal";
|
|
@@ -5271,7 +5270,7 @@ const ContentImpl = styled(Dialog$1.Content)`
|
|
|
5271
5270
|
max-width: 83rem;
|
|
5272
5271
|
max-height: 90vh;
|
|
5273
5272
|
height: auto;
|
|
5274
|
-
width:
|
|
5273
|
+
width: calc(100% - ${({ theme }) => theme.spaces[8]});
|
|
5275
5274
|
overflow: hidden;
|
|
5276
5275
|
margin: 0 auto;
|
|
5277
5276
|
display: flex;
|
|
@@ -5287,6 +5286,9 @@ const ContentImpl = styled(Dialog$1.Content)`
|
|
|
5287
5286
|
box-shadow: ${(props) => props.theme.shadows.popupShadow};
|
|
5288
5287
|
z-index: ${(props) => props.theme.zIndices.modal};
|
|
5289
5288
|
|
|
5289
|
+
${({ theme }) => theme.breakpoints.medium} {
|
|
5290
|
+
width: calc(100% - ${({ theme }) => theme.spaces[9]});
|
|
5291
|
+
}
|
|
5290
5292
|
> form {
|
|
5291
5293
|
display: flex;
|
|
5292
5294
|
flex-direction: column;
|
|
@@ -7055,7 +7057,15 @@ const TextInput = React.forwardRef((props, ref) => {
|
|
|
7055
7057
|
});
|
|
7056
7058
|
TextInput.displayName = "TextInput";
|
|
7057
7059
|
const Textarea = React.forwardRef(
|
|
7058
|
-
({
|
|
7060
|
+
({
|
|
7061
|
+
disabled,
|
|
7062
|
+
hasError: hasErrorProp,
|
|
7063
|
+
id: idProp,
|
|
7064
|
+
name: nameProp,
|
|
7065
|
+
required: requiredProp,
|
|
7066
|
+
resizable = true,
|
|
7067
|
+
...props
|
|
7068
|
+
}, ref) => {
|
|
7059
7069
|
const { error, ...field } = useField("Textarea");
|
|
7060
7070
|
const hasError = Boolean(error) || hasErrorProp;
|
|
7061
7071
|
const id = field.id ?? idProp;
|
|
@@ -7086,18 +7096,20 @@ const Textarea = React.forwardRef(
|
|
|
7086
7096
|
id,
|
|
7087
7097
|
name,
|
|
7088
7098
|
"aria-describedby": ariaDescription,
|
|
7099
|
+
$resizable: resizable,
|
|
7089
7100
|
...props
|
|
7090
7101
|
}
|
|
7091
7102
|
) });
|
|
7092
7103
|
}
|
|
7093
7104
|
);
|
|
7094
7105
|
const Wrapper$1 = styled(Box)`
|
|
7095
|
-
height: 10.5rem;
|
|
7096
7106
|
${inputFocusStyle()}
|
|
7097
7107
|
`;
|
|
7098
7108
|
const TextareaElement = styled(Box)`
|
|
7109
|
+
display: block;
|
|
7099
7110
|
border: none;
|
|
7100
|
-
resize: none;
|
|
7111
|
+
resize: ${({ $resizable }) => $resizable ? "vertical" : "none"};
|
|
7112
|
+
min-height: ${({ minHeight }) => minHeight || "10.5rem"};
|
|
7101
7113
|
|
|
7102
7114
|
&::placeholder {
|
|
7103
7115
|
color: ${({ theme }) => theme.colors.neutral600};
|