@strapi/design-system 2.0.0-rc.17 → 2.0.0-rc.18
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.
|
@@ -38,9 +38,7 @@ declare const Portal: {
|
|
|
38
38
|
}): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
displayName: string;
|
|
40
40
|
};
|
|
41
|
-
declare const Content:
|
|
42
|
-
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
43
|
-
}, never>> & string & Omit<React.ForwardRefExoticComponent<Select.SelectContentImplProps & React.RefAttributes<HTMLDivElement>>, keyof React.Component<any, {}, any>>;
|
|
41
|
+
declare const Content: React.ForwardRefExoticComponent<Select.SelectContentImplProps & React.RefAttributes<HTMLDivElement>>;
|
|
44
42
|
declare const Viewport: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Pick<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
45
43
|
ref?: React.RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
46
44
|
} & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectParts.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectParts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAI/C,OAAO,EAAqB,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEnE,OAAO,EAAmC,eAAe,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"SelectParts.d.ts","sourceRoot":"","sources":["../../../src/components/Select/SelectParts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,C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xB,QAAA,MAAM,aAAa,yGAAuB,CAAC;AAC3C,QAAA,MAAM,QAAQ;;;;2GAAkB,CAAC;AACjC,QAAA,MAAM,KAAK;;;;yGAAe,CAAC;AAE3B,KAAK,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACtC,KAAK,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAClD,KAAK,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAChD,KAAK,WAAW,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC5C,KAAK,YAAY,GAAG,MAAM,CAAC,kBAAkB,CAAC;AAC9C,KAAK,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAChD,KAAK,kBAAkB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAC1D,KAAK,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAChD,KAAK,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC1C,KAAK,aAAa,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACjG,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,WAAW,EACX,YAAY,EACZ,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,UAAU,GACX,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,12 +19,12 @@ const reactFocusGuards = require("@radix-ui/react-focus-guards");
|
|
|
19
19
|
const reactFocusScope = require("@radix-ui/react-focus-scope");
|
|
20
20
|
const reactDom = require("react-dom");
|
|
21
21
|
const reactRemoveScroll = require("react-remove-scroll");
|
|
22
|
+
const ScrollArea = require("@radix-ui/react-scroll-area");
|
|
22
23
|
const langJson = require("@codemirror/lang-json");
|
|
23
24
|
const reactCodemirror = require("@uiw/react-codemirror");
|
|
24
25
|
const state = require("@codemirror/state");
|
|
25
26
|
const view = require("@codemirror/view");
|
|
26
27
|
const Dialog$1 = require("@radix-ui/react-dialog");
|
|
27
|
-
const ScrollArea = require("@radix-ui/react-scroll-area");
|
|
28
28
|
const number = require("@internationalized/number");
|
|
29
29
|
const Popover$1 = require("@radix-ui/react-popover");
|
|
30
30
|
const Progress = require("@radix-ui/react-progress");
|
|
@@ -58,8 +58,8 @@ const Avatar__namespace = /* @__PURE__ */ _interopNamespace(Avatar$1);
|
|
|
58
58
|
const DropdownMenu__namespace = /* @__PURE__ */ _interopNamespace(DropdownMenu);
|
|
59
59
|
const Checkbox__namespace = /* @__PURE__ */ _interopNamespace(Checkbox);
|
|
60
60
|
const AlertDialog__namespace = /* @__PURE__ */ _interopNamespace(AlertDialog);
|
|
61
|
-
const Dialog__namespace = /* @__PURE__ */ _interopNamespace(Dialog$1);
|
|
62
61
|
const ScrollArea__namespace = /* @__PURE__ */ _interopNamespace(ScrollArea);
|
|
62
|
+
const Dialog__namespace = /* @__PURE__ */ _interopNamespace(Dialog$1);
|
|
63
63
|
const Popover__namespace = /* @__PURE__ */ _interopNamespace(Popover$1);
|
|
64
64
|
const Progress__namespace = /* @__PURE__ */ _interopNamespace(Progress);
|
|
65
65
|
const RadioGroup__namespace = /* @__PURE__ */ _interopNamespace(RadioGroup);
|
|
@@ -3581,6 +3581,60 @@ const Portal$1 = React__namespace.forwardRef(
|
|
|
3581
3581
|
}
|
|
3582
3582
|
);
|
|
3583
3583
|
Portal$1.displayName = "Portal";
|
|
3584
|
+
const ScrollAreaImpl$1 = React__namespace.forwardRef(
|
|
3585
|
+
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
3586
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
3587
|
+
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaViewport, { ref: viewportRef, children }),
|
|
3588
|
+
/* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) }),
|
|
3589
|
+
/* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) })
|
|
3590
|
+
] });
|
|
3591
|
+
}
|
|
3592
|
+
);
|
|
3593
|
+
const ScrollAreaRoot = styledComponents.styled(ScrollArea__namespace.Root)`
|
|
3594
|
+
width: 100%;
|
|
3595
|
+
height: 100%;
|
|
3596
|
+
overflow: hidden;
|
|
3597
|
+
display: flex;
|
|
3598
|
+
`;
|
|
3599
|
+
const ScrollAreaViewport = styledComponents.styled(ScrollArea__namespace.Viewport)`
|
|
3600
|
+
min-width: 100%;
|
|
3601
|
+
padding-inline: 4px;
|
|
3602
|
+
`;
|
|
3603
|
+
const Scrollbar = styledComponents.styled(ScrollArea__namespace.Scrollbar)`
|
|
3604
|
+
display: flex;
|
|
3605
|
+
/* ensures no selection */
|
|
3606
|
+
user-select: none;
|
|
3607
|
+
/* disable browser handling of all panning and zooming gestures on touch devices */
|
|
3608
|
+
touch-action: none;
|
|
3609
|
+
|
|
3610
|
+
&[data-orientation='vertical'] {
|
|
3611
|
+
width: 0.4rem;
|
|
3612
|
+
}
|
|
3613
|
+
|
|
3614
|
+
&[data-orientation='horizontal'] {
|
|
3615
|
+
flex-direction: column;
|
|
3616
|
+
height: 0.4rem;
|
|
3617
|
+
}
|
|
3618
|
+
`;
|
|
3619
|
+
const Thumb = styledComponents.styled(ScrollArea__namespace.Thumb)`
|
|
3620
|
+
position: relative;
|
|
3621
|
+
flex: 1;
|
|
3622
|
+
background-color: ${(props) => props.theme.colors.neutral150};
|
|
3623
|
+
border-radius: var(--scrollbar-size);
|
|
3624
|
+
|
|
3625
|
+
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
3626
|
+
&::before {
|
|
3627
|
+
content: '';
|
|
3628
|
+
position: absolute;
|
|
3629
|
+
top: 50%;
|
|
3630
|
+
left: 50%;
|
|
3631
|
+
transform: translate(-50%, -50%);
|
|
3632
|
+
width: 100%;
|
|
3633
|
+
height: 100%;
|
|
3634
|
+
min-width: 44px;
|
|
3635
|
+
min-height: 44px;
|
|
3636
|
+
}
|
|
3637
|
+
`;
|
|
3584
3638
|
const SelectTrigger = React__namespace.forwardRef(
|
|
3585
3639
|
({ onClear, clearLabel = "Clear", startIcon, disabled, hasError, children, id, size = "M", withTags, ...restProps }, ref) => {
|
|
3586
3640
|
const triggerRef = React__namespace.useRef(null);
|
|
@@ -3700,7 +3754,10 @@ const StyledValue = styledComponents.styled(uiPrimitives.Select.Value)`
|
|
|
3700
3754
|
gap: ${({ theme }) => theme.spaces[1]};
|
|
3701
3755
|
flex-wrap: wrap;
|
|
3702
3756
|
`;
|
|
3703
|
-
const SelectContent =
|
|
3757
|
+
const SelectContent = React__namespace.forwardRef((props, ref) => {
|
|
3758
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledContent, { ref, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaImpl$1, { children: props.children }) });
|
|
3759
|
+
});
|
|
3760
|
+
const StyledContent = styledComponents.styled(uiPrimitives.Select.Content)`
|
|
3704
3761
|
background: ${({ theme }) => theme.colors.neutral0};
|
|
3705
3762
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
|
3706
3763
|
border: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
@@ -5144,60 +5201,6 @@ const SkipToContent = ({ children }) => {
|
|
|
5144
5201
|
);
|
|
5145
5202
|
};
|
|
5146
5203
|
const setOpacity = (hex, alpha) => `${hex}${Math.floor(alpha * 255).toString(16).padStart(2, "0")}`;
|
|
5147
|
-
const ScrollAreaImpl$1 = React__namespace.forwardRef(
|
|
5148
|
-
({ children, viewportRef, ...restProps }, forwardedRef) => {
|
|
5149
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ScrollAreaRoot, { ref: forwardedRef, ...restProps, children: [
|
|
5150
|
-
/* @__PURE__ */ jsxRuntime.jsx(ScrollAreaViewport, { ref: viewportRef, children }),
|
|
5151
|
-
/* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "vertical", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) }),
|
|
5152
|
-
/* @__PURE__ */ jsxRuntime.jsx(Scrollbar, { orientation: "horizontal", children: /* @__PURE__ */ jsxRuntime.jsx(Thumb, {}) })
|
|
5153
|
-
] });
|
|
5154
|
-
}
|
|
5155
|
-
);
|
|
5156
|
-
const ScrollAreaRoot = styledComponents.styled(ScrollArea__namespace.Root)`
|
|
5157
|
-
width: 100%;
|
|
5158
|
-
height: 100%;
|
|
5159
|
-
overflow: hidden;
|
|
5160
|
-
display: flex;
|
|
5161
|
-
`;
|
|
5162
|
-
const ScrollAreaViewport = styledComponents.styled(ScrollArea__namespace.Viewport)`
|
|
5163
|
-
min-width: 100%;
|
|
5164
|
-
padding-inline: 4px;
|
|
5165
|
-
`;
|
|
5166
|
-
const Scrollbar = styledComponents.styled(ScrollArea__namespace.Scrollbar)`
|
|
5167
|
-
display: flex;
|
|
5168
|
-
/* ensures no selection */
|
|
5169
|
-
user-select: none;
|
|
5170
|
-
/* disable browser handling of all panning and zooming gestures on touch devices */
|
|
5171
|
-
touch-action: none;
|
|
5172
|
-
|
|
5173
|
-
&[data-orientation='vertical'] {
|
|
5174
|
-
width: 0.4rem;
|
|
5175
|
-
}
|
|
5176
|
-
|
|
5177
|
-
&[data-orientation='horizontal'] {
|
|
5178
|
-
flex-direction: column;
|
|
5179
|
-
height: 0.4rem;
|
|
5180
|
-
}
|
|
5181
|
-
`;
|
|
5182
|
-
const Thumb = styledComponents.styled(ScrollArea__namespace.Thumb)`
|
|
5183
|
-
position: relative;
|
|
5184
|
-
flex: 1;
|
|
5185
|
-
background-color: ${(props) => props.theme.colors.neutral150};
|
|
5186
|
-
border-radius: var(--scrollbar-size);
|
|
5187
|
-
|
|
5188
|
-
/* increase target size for touch devices https://www.w3.org/WAI/WCAG21/Understanding/target-size.html */
|
|
5189
|
-
&::before {
|
|
5190
|
-
content: '';
|
|
5191
|
-
position: absolute;
|
|
5192
|
-
top: 50%;
|
|
5193
|
-
left: 50%;
|
|
5194
|
-
transform: translate(-50%, -50%);
|
|
5195
|
-
width: 100%;
|
|
5196
|
-
height: 100%;
|
|
5197
|
-
min-width: 44px;
|
|
5198
|
-
min-height: 44px;
|
|
5199
|
-
}
|
|
5200
|
-
`;
|
|
5201
5204
|
const Root$3 = Dialog__namespace.Root;
|
|
5202
5205
|
const Trigger$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
5203
5206
|
return /* @__PURE__ */ jsxRuntime.jsx(Dialog__namespace.Trigger, { ...props, asChild: true, ref: forwardedRef });
|