visits-style 1.4.2 → 1.4.4
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/README.md +3 -3
- package/dist/components/Modal/index.d.ts +6 -1
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toast/types.d.ts +5 -0
- package/dist/forms/Checkbox/index.d.ts +2 -2
- package/dist/forms/HelpMessage.d.ts +3 -2
- package/dist/forms/Radio/index.d.ts +2 -2
- package/dist/forms/Select/index.d.ts +5 -5
- package/dist/forms/TextInput/index.d.ts +2 -2
- package/dist/forms/Textarea/index.d.ts +2 -2
- package/dist/index.cjs.js +51 -26
- package/dist/index.es.js +50 -25
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,8 +20,8 @@ yarn add react react-dom styled-components visits-style
|
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Dependencies
|
|
23
|
-
- React, React-dom(^18.
|
|
24
|
-
- styled-components(^
|
|
23
|
+
- React, React-dom(^18.2.0)
|
|
24
|
+
- styled-components(^6.0.2)
|
|
25
25
|
|
|
26
26
|
## Example
|
|
27
27
|
|
|
@@ -47,4 +47,4 @@ root.render(<App />);
|
|
|
47
47
|
|
|
48
48
|
## Docs
|
|
49
49
|
|
|
50
|
-
- [ドキュメント](https://visits-works.github.io/visits-style
|
|
50
|
+
- [ドキュメント](https://visits-works.github.io/visits-style)
|
|
@@ -22,6 +22,11 @@ export interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
|
22
22
|
* @default '0.85rem'
|
|
23
23
|
*/
|
|
24
24
|
padding?: string;
|
|
25
|
+
/**
|
|
26
|
+
* モーダルの縦並びを設定します。
|
|
27
|
+
* @default 'center'
|
|
28
|
+
*/
|
|
29
|
+
verticalAlign?: 'start' | 'center' | 'end';
|
|
25
30
|
}
|
|
26
|
-
export default function Modal({ show, children, timeout, padding, closeModal, closeOnOverlay, closeOnEsc, onExited, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export default function Modal({ show, children, timeout, padding, verticalAlign, closeModal, closeOnOverlay, closeOnEsc, onExited, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
27
32
|
export declare const ModalContent: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("../../elements/Box").Props>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ToastContainerProps } from './types';
|
|
2
|
-
export default function Toast({ toasts, clear, fixed, margin, position }: ToastContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Toast({ toasts, clear, fixed, margin, position, space }: ToastContainerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes } from 'react';
|
|
2
2
|
export interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
-
children?:
|
|
3
|
+
children?: React.ReactNode;
|
|
4
4
|
checked?: boolean;
|
|
5
5
|
indeterminate?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement
|
|
7
|
+
declare const Checkbox: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
8
8
|
export default Checkbox;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
interface Props {
|
|
2
|
-
help?:
|
|
3
|
-
error?:
|
|
3
|
+
help?: ReactNode;
|
|
4
|
+
error?: ReactNode;
|
|
4
5
|
noErrorMessage?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export default function HelpMessage({ help, error, noErrorMessage }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -4,5 +4,5 @@ export interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
4
4
|
children?: any;
|
|
5
5
|
checked?: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
7
|
+
declare const Radio: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
8
|
+
export default Radio;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { SelectHTMLAttributes } from 'react';
|
|
1
|
+
import React, { SelectHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { SizeType } from '../../types';
|
|
3
3
|
type ItemType = {
|
|
4
4
|
id: string | number;
|
|
@@ -11,9 +11,9 @@ export interface Props extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
|
11
11
|
options: ItemType[];
|
|
12
12
|
outline?: boolean;
|
|
13
13
|
/** エラーの発生時の表示テキスト */
|
|
14
|
-
error?:
|
|
14
|
+
error?: ReactNode;
|
|
15
15
|
/** 捕捉テキスト */
|
|
16
|
-
help?:
|
|
16
|
+
help?: ReactNode;
|
|
17
17
|
/** selectのサイズ */
|
|
18
18
|
inputSize?: SizeType;
|
|
19
19
|
/** optionのカスタムrender */
|
|
@@ -23,5 +23,5 @@ export interface Props extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
|
23
23
|
/** エラーが発生しても、エラーメッセージを出さないようにする */
|
|
24
24
|
noErrorMessage?: boolean;
|
|
25
25
|
}
|
|
26
|
-
declare const
|
|
27
|
-
export default
|
|
26
|
+
declare const Select: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLSelectElement>>;
|
|
27
|
+
export default Select;
|
|
@@ -6,9 +6,9 @@ export interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
6
6
|
*/
|
|
7
7
|
type?: 'text' | 'number' | 'password' | 'email' | 'tel' | 'search';
|
|
8
8
|
/** エラーの発生時の表示テキスト */
|
|
9
|
-
error?:
|
|
9
|
+
error?: React.ReactNode;
|
|
10
10
|
/** 捕捉テキスト */
|
|
11
|
-
help?:
|
|
11
|
+
help?: React.ReactNode;
|
|
12
12
|
/** ボックス系のデザインでする */
|
|
13
13
|
outline?: boolean;
|
|
14
14
|
/** 左側のアイコン */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { TextareaHTMLAttributes } from 'react';
|
|
2
2
|
export interface Props extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
3
3
|
/** エラーの発生時の表示テキスト */
|
|
4
|
-
error?:
|
|
4
|
+
error?: React.ReactNode;
|
|
5
5
|
/** 捕捉テキスト */
|
|
6
|
-
help?:
|
|
6
|
+
help?: React.ReactNode;
|
|
7
7
|
/** エラーが発生しても、エラーメッセージを出さないようにする */
|
|
8
8
|
noErrorMessage?: boolean;
|
|
9
9
|
}
|
package/dist/index.cjs.js
CHANGED
|
@@ -32,10 +32,10 @@ function Field({
|
|
|
32
32
|
...rest
|
|
33
33
|
}) {
|
|
34
34
|
return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$6, { ...rest, children: [
|
|
35
|
-
label
|
|
35
|
+
label ? /* @__PURE__ */ jsxRuntime.jsxs(Label, { children: [
|
|
36
36
|
label,
|
|
37
37
|
required && /* @__PURE__ */ jsxRuntime.jsx("i", { children: "*" })
|
|
38
|
-
] }),
|
|
38
|
+
] }) : null,
|
|
39
39
|
children
|
|
40
40
|
] });
|
|
41
41
|
}
|
|
@@ -151,9 +151,9 @@ const TextInput = React.forwardRef(({
|
|
|
151
151
|
maxLength = 255,
|
|
152
152
|
noErrorMessage,
|
|
153
153
|
...rest
|
|
154
|
-
}, ref) => /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$5, { className, outline, error, style, disabled: rest.disabled, children: [
|
|
154
|
+
}, ref) => /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$5, { className, outline, error: !!error, style, disabled: rest.disabled, children: [
|
|
155
155
|
leftIcon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon, { children: leftIcon2 }),
|
|
156
|
-
rightIcon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon, { right: true, children: rightIcon2 }),
|
|
156
|
+
rightIcon2 && /* @__PURE__ */ jsxRuntime.jsx(Icon, { $right: true, children: rightIcon2 }),
|
|
157
157
|
/* @__PURE__ */ jsxRuntime.jsx("input", { type, maxLength, ref, ...rest }),
|
|
158
158
|
/* @__PURE__ */ jsxRuntime.jsx(HelpMessage, { help, error, noErrorMessage })
|
|
159
159
|
] }));
|
|
@@ -167,9 +167,14 @@ const Icon = /* @__PURE__ */ styledComponents.styled.span.withConfig({
|
|
|
167
167
|
})(["position:absolute;top:0.375em;bottom:0;z-index:1;color:", ";", " svg,img{height:1em;width:1em;}"], ({
|
|
168
168
|
theme
|
|
169
169
|
}) => theme.border, ({
|
|
170
|
-
right
|
|
171
|
-
}) => right ? rightIcon : leftIcon);
|
|
170
|
+
$right
|
|
171
|
+
}) => $right ? rightIcon : leftIcon);
|
|
172
|
+
function shouldForwardProp$7(name) {
|
|
173
|
+
return name !== "outline" && name !== "error" && name !== "disabled";
|
|
174
|
+
}
|
|
172
175
|
const Wrapper$5 = /* @__PURE__ */ styledComponents.styled.span.withConfig({
|
|
176
|
+
shouldForwardProp: shouldForwardProp$7
|
|
177
|
+
}).withConfig({
|
|
173
178
|
displayName: "TextInput__Wrapper",
|
|
174
179
|
componentId: "sc-1myda3q-1"
|
|
175
180
|
})(["position:relative;display:block;input{max-width:100%;width:100%;height:100%;position:relative;display:block;outline:none;box-shadow:none;appearance:none;text-align:left;color:inherit;padding:", ";border:1px solid ", ";", " ", " transition-property:box-shadow;transition-duration:150ms;transition-timing-function:ease-in-out;&:focus{border-color:", ";box-shadow:", ";}&:disabled,[disabled]{resize:none;}&::placeholder{color:", ";}}&:hover{input:not(:disabled):not(:focus):not(:active){border-color:", ";}", "{color:", ";}}", ""], ({
|
|
@@ -276,7 +281,7 @@ const Checkbox = React.forwardRef(({
|
|
|
276
281
|
React.useImperativeHandle(ref, () => innerRef.current);
|
|
277
282
|
useIsomorphicLayoutEffect(() => {
|
|
278
283
|
if (innerRef.current) {
|
|
279
|
-
innerRef.current.indeterminate = indeterminate;
|
|
284
|
+
innerRef.current.indeterminate = indeterminate || false;
|
|
280
285
|
}
|
|
281
286
|
}, [indeterminate]);
|
|
282
287
|
return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$4, { className, children: [
|
|
@@ -320,7 +325,7 @@ function ChevronDown(props) {
|
|
|
320
325
|
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.6 0L6 4.6 1.4 0 0 1.4l6 6 6-6L10.6 0z", fill: "currentColor" }) });
|
|
321
326
|
}
|
|
322
327
|
|
|
323
|
-
|
|
328
|
+
const Select = React.forwardRef(({
|
|
324
329
|
options = [],
|
|
325
330
|
placeholder,
|
|
326
331
|
render,
|
|
@@ -331,20 +336,20 @@ function Select({
|
|
|
331
336
|
outline,
|
|
332
337
|
optional,
|
|
333
338
|
noErrorMessage,
|
|
334
|
-
innerRef,
|
|
335
339
|
...rest
|
|
336
|
-
}) {
|
|
340
|
+
}, ref) => {
|
|
337
341
|
const list = React.useMemo(() => options.map((item) => typeof item === "string" ? /* @__PURE__ */ jsxRuntime.jsx("option", { value: item, children: render ? render(item) : item }, item) : /* @__PURE__ */ jsxRuntime.jsx("option", { value: item.id, children: render ? render(item.name) : item.name }, item.id)), [options, render]);
|
|
338
342
|
return /* @__PURE__ */ jsxRuntime.jsxs(InputWrapper$1, { className, inputSize, outline, error: !!error, disabled: rest.disabled, children: [
|
|
339
|
-
/* @__PURE__ */ jsxRuntime.jsxs("select", { ...rest, ref
|
|
343
|
+
/* @__PURE__ */ jsxRuntime.jsxs("select", { ...rest, ref, children: [
|
|
340
344
|
placeholder && /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: !optional, children: placeholder }),
|
|
341
345
|
list
|
|
342
346
|
] }),
|
|
343
347
|
/* @__PURE__ */ jsxRuntime.jsx(ChevronDown, {}),
|
|
344
348
|
/* @__PURE__ */ jsxRuntime.jsx(HelpMessage, { help, error, noErrorMessage })
|
|
345
349
|
] });
|
|
346
|
-
}
|
|
347
|
-
|
|
350
|
+
});
|
|
351
|
+
Select.displayName = "Select";
|
|
352
|
+
const Select$1 = Select;
|
|
348
353
|
function shouldForwardProp$5(name) {
|
|
349
354
|
return name !== "error" && name !== "disabled" && name !== "inputSize" && name !== "outline";
|
|
350
355
|
}
|
|
@@ -383,13 +388,12 @@ const InputWrapper$1 = /* @__PURE__ */ styledComponents.styled.span.withConfig({
|
|
|
383
388
|
theme
|
|
384
389
|
}) => disabled ? styledComponents.css(["select{", " border-style:dashed;}svg{display:none;}"], disabledColor(theme)) : void 0);
|
|
385
390
|
|
|
386
|
-
|
|
391
|
+
const Radio = React.forwardRef(({
|
|
387
392
|
className,
|
|
388
393
|
style,
|
|
389
394
|
children,
|
|
390
|
-
innerRef,
|
|
391
395
|
...rest
|
|
392
|
-
}) {
|
|
396
|
+
}, ref) => {
|
|
393
397
|
const id = `radio_${rest.name}_${rest.value}`;
|
|
394
398
|
const innerClass = React.useMemo(() => {
|
|
395
399
|
const arr = [];
|
|
@@ -404,10 +408,11 @@ function Radio({
|
|
|
404
408
|
/* @__PURE__ */ jsxRuntime.jsx(Shape, { className: innerClass, children: /* @__PURE__ */ jsxRuntime.jsx("i", {}) }),
|
|
405
409
|
children
|
|
406
410
|
] }),
|
|
407
|
-
/* @__PURE__ */ jsxRuntime.jsx("input", { id, type: "radio", ...rest, ref
|
|
411
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { id, type: "radio", ...rest, ref })
|
|
408
412
|
] });
|
|
409
|
-
}
|
|
410
|
-
|
|
413
|
+
});
|
|
414
|
+
Radio.displayName = "Radio";
|
|
415
|
+
const Radio$1 = Radio;
|
|
411
416
|
const Shape = /* @__PURE__ */ styledComponents.styled.div.withConfig({
|
|
412
417
|
displayName: "Radio__Shape",
|
|
413
418
|
componentId: "sc-13m0vd4-0"
|
|
@@ -848,6 +853,7 @@ function Modal({
|
|
|
848
853
|
children,
|
|
849
854
|
timeout = 200,
|
|
850
855
|
padding = "0.85rem",
|
|
856
|
+
verticalAlign = "center",
|
|
851
857
|
closeModal,
|
|
852
858
|
closeOnOverlay,
|
|
853
859
|
closeOnEsc,
|
|
@@ -898,7 +904,7 @@ function Modal({
|
|
|
898
904
|
exitRef.current = onExited;
|
|
899
905
|
return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: isMounted ? /* @__PURE__ */ jsxRuntime.jsx(Overlay, { lockScroll: true, "data-testid": "vs-modal-overlay", onClick: handleOverlayClose, style: {
|
|
900
906
|
padding
|
|
901
|
-
}, children: /* @__PURE__ */ jsxRuntime.jsx(Wrapper$2, { ref: refs.setFloating, role: "dialog", ...getFloatingProps({
|
|
907
|
+
}, $verticalAlign: verticalAlign, children: /* @__PURE__ */ jsxRuntime.jsx(Wrapper$2, { ref: refs.setFloating, role: "dialog", ...getFloatingProps({
|
|
902
908
|
...rest,
|
|
903
909
|
style: styles,
|
|
904
910
|
onClick: stopPropagation
|
|
@@ -907,7 +913,23 @@ function Modal({
|
|
|
907
913
|
const Overlay = /* @__PURE__ */ styledComponents.styled(react.FloatingOverlay).withConfig({
|
|
908
914
|
displayName: "Modal__Overlay",
|
|
909
915
|
componentId: "sc-pb7lhx-0"
|
|
910
|
-
})([" display:flex;display:grid;place-items:
|
|
916
|
+
})([" display:flex;display:grid;place-items:", ";align-items:", ";justify-content:center;background:", ";z-index:9997;"], ({
|
|
917
|
+
$verticalAlign
|
|
918
|
+
}) => {
|
|
919
|
+
if ($verticalAlign === "start")
|
|
920
|
+
return "flex-start";
|
|
921
|
+
if ($verticalAlign === "end")
|
|
922
|
+
return "flex-end";
|
|
923
|
+
return "center";
|
|
924
|
+
}, ({
|
|
925
|
+
$verticalAlign
|
|
926
|
+
}) => {
|
|
927
|
+
if ($verticalAlign === "start")
|
|
928
|
+
return "flex-start";
|
|
929
|
+
if ($verticalAlign === "end")
|
|
930
|
+
return "flex-end";
|
|
931
|
+
return "center";
|
|
932
|
+
}, ({
|
|
911
933
|
theme
|
|
912
934
|
}) => theme.backdrop);
|
|
913
935
|
const Wrapper$2 = /* @__PURE__ */ styledComponents.styled.div.withConfig({
|
|
@@ -979,7 +1001,8 @@ function Toast({
|
|
|
979
1001
|
clear,
|
|
980
1002
|
fixed,
|
|
981
1003
|
margin = "16px",
|
|
982
|
-
position = "top-left"
|
|
1004
|
+
position = "top-left",
|
|
1005
|
+
space = "16px"
|
|
983
1006
|
}) {
|
|
984
1007
|
const style = React.useMemo(() => {
|
|
985
1008
|
const base = {
|
|
@@ -1003,12 +1026,14 @@ function Toast({
|
|
|
1003
1026
|
}
|
|
1004
1027
|
return base;
|
|
1005
1028
|
}, [fixed, margin, position]);
|
|
1006
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsx(ToastList, { style, children: toasts.map((props) => /* @__PURE__ */ React.createElement(ToastItem, { ...props, key: props.id, clear })) }) });
|
|
1029
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Portal$1, { children: /* @__PURE__ */ jsxRuntime.jsx(ToastList, { style, $space: space, children: toasts.map((props) => /* @__PURE__ */ React.createElement(ToastItem, { ...props, key: props.id, clear })) }) });
|
|
1007
1030
|
}
|
|
1008
1031
|
const ToastList = /* @__PURE__ */ styledComponents.styled.ul.withConfig({
|
|
1009
1032
|
displayName: "Toast__ToastList",
|
|
1010
1033
|
componentId: "sc-8192b2-0"
|
|
1011
|
-
})(["display:flex;flex-direction:column;z-index:9999;
|
|
1034
|
+
})(["display:flex;flex-direction:column;z-index:9999;overflow:hidden;li + li{margin-top:", ";}"], ({
|
|
1035
|
+
$space
|
|
1036
|
+
}) => $space);
|
|
1012
1037
|
|
|
1013
1038
|
function getColor$1({
|
|
1014
1039
|
theme,
|
|
@@ -1483,9 +1508,9 @@ exports.Placeholder = index$2;
|
|
|
1483
1508
|
exports.Popover = Popover$1;
|
|
1484
1509
|
exports.Portal = Portal$1;
|
|
1485
1510
|
exports.Progress = Progress;
|
|
1486
|
-
exports.Radio =
|
|
1511
|
+
exports.Radio = Radio$1;
|
|
1487
1512
|
exports.Row = Row;
|
|
1488
|
-
exports.Select =
|
|
1513
|
+
exports.Select = Select$1;
|
|
1489
1514
|
exports.Spinner = Spinner$1;
|
|
1490
1515
|
exports.Switch = Switch$1;
|
|
1491
1516
|
exports.Table = index$1;
|
package/dist/index.es.js
CHANGED
|
@@ -24,10 +24,10 @@ function Field({
|
|
|
24
24
|
...rest
|
|
25
25
|
}) {
|
|
26
26
|
return /* @__PURE__ */ jsxs(Wrapper$6, { ...rest, children: [
|
|
27
|
-
label
|
|
27
|
+
label ? /* @__PURE__ */ jsxs(Label, { children: [
|
|
28
28
|
label,
|
|
29
29
|
required && /* @__PURE__ */ jsx("i", { children: "*" })
|
|
30
|
-
] }),
|
|
30
|
+
] }) : null,
|
|
31
31
|
children
|
|
32
32
|
] });
|
|
33
33
|
}
|
|
@@ -143,9 +143,9 @@ const TextInput = forwardRef(({
|
|
|
143
143
|
maxLength = 255,
|
|
144
144
|
noErrorMessage,
|
|
145
145
|
...rest
|
|
146
|
-
}, ref) => /* @__PURE__ */ jsxs(Wrapper$5, { className, outline, error, style, disabled: rest.disabled, children: [
|
|
146
|
+
}, ref) => /* @__PURE__ */ jsxs(Wrapper$5, { className, outline, error: !!error, style, disabled: rest.disabled, children: [
|
|
147
147
|
leftIcon2 && /* @__PURE__ */ jsx(Icon, { children: leftIcon2 }),
|
|
148
|
-
rightIcon2 && /* @__PURE__ */ jsx(Icon, { right: true, children: rightIcon2 }),
|
|
148
|
+
rightIcon2 && /* @__PURE__ */ jsx(Icon, { $right: true, children: rightIcon2 }),
|
|
149
149
|
/* @__PURE__ */ jsx("input", { type, maxLength, ref, ...rest }),
|
|
150
150
|
/* @__PURE__ */ jsx(HelpMessage, { help, error, noErrorMessage })
|
|
151
151
|
] }));
|
|
@@ -159,9 +159,14 @@ const Icon = /* @__PURE__ */ styled.span.withConfig({
|
|
|
159
159
|
})(["position:absolute;top:0.375em;bottom:0;z-index:1;color:", ";", " svg,img{height:1em;width:1em;}"], ({
|
|
160
160
|
theme
|
|
161
161
|
}) => theme.border, ({
|
|
162
|
-
right
|
|
163
|
-
}) => right ? rightIcon : leftIcon);
|
|
162
|
+
$right
|
|
163
|
+
}) => $right ? rightIcon : leftIcon);
|
|
164
|
+
function shouldForwardProp$7(name) {
|
|
165
|
+
return name !== "outline" && name !== "error" && name !== "disabled";
|
|
166
|
+
}
|
|
164
167
|
const Wrapper$5 = /* @__PURE__ */ styled.span.withConfig({
|
|
168
|
+
shouldForwardProp: shouldForwardProp$7
|
|
169
|
+
}).withConfig({
|
|
165
170
|
displayName: "TextInput__Wrapper",
|
|
166
171
|
componentId: "sc-1myda3q-1"
|
|
167
172
|
})(["position:relative;display:block;input{max-width:100%;width:100%;height:100%;position:relative;display:block;outline:none;box-shadow:none;appearance:none;text-align:left;color:inherit;padding:", ";border:1px solid ", ";", " ", " transition-property:box-shadow;transition-duration:150ms;transition-timing-function:ease-in-out;&:focus{border-color:", ";box-shadow:", ";}&:disabled,[disabled]{resize:none;}&::placeholder{color:", ";}}&:hover{input:not(:disabled):not(:focus):not(:active){border-color:", ";}", "{color:", ";}}", ""], ({
|
|
@@ -268,7 +273,7 @@ const Checkbox = forwardRef(({
|
|
|
268
273
|
useImperativeHandle(ref, () => innerRef.current);
|
|
269
274
|
useIsomorphicLayoutEffect(() => {
|
|
270
275
|
if (innerRef.current) {
|
|
271
|
-
innerRef.current.indeterminate = indeterminate;
|
|
276
|
+
innerRef.current.indeterminate = indeterminate || false;
|
|
272
277
|
}
|
|
273
278
|
}, [indeterminate]);
|
|
274
279
|
return /* @__PURE__ */ jsxs(Wrapper$4, { className, children: [
|
|
@@ -312,7 +317,7 @@ function ChevronDown(props) {
|
|
|
312
317
|
return /* @__PURE__ */ jsx("svg", { width: "12", height: "8", viewBox: "0 0 12 8", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: /* @__PURE__ */ jsx("path", { d: "M10.6 0L6 4.6 1.4 0 0 1.4l6 6 6-6L10.6 0z", fill: "currentColor" }) });
|
|
313
318
|
}
|
|
314
319
|
|
|
315
|
-
|
|
320
|
+
const Select = forwardRef(({
|
|
316
321
|
options = [],
|
|
317
322
|
placeholder,
|
|
318
323
|
render,
|
|
@@ -323,20 +328,20 @@ function Select({
|
|
|
323
328
|
outline,
|
|
324
329
|
optional,
|
|
325
330
|
noErrorMessage,
|
|
326
|
-
innerRef,
|
|
327
331
|
...rest
|
|
328
|
-
}) {
|
|
332
|
+
}, ref) => {
|
|
329
333
|
const list = useMemo(() => options.map((item) => typeof item === "string" ? /* @__PURE__ */ jsx("option", { value: item, children: render ? render(item) : item }, item) : /* @__PURE__ */ jsx("option", { value: item.id, children: render ? render(item.name) : item.name }, item.id)), [options, render]);
|
|
330
334
|
return /* @__PURE__ */ jsxs(InputWrapper$1, { className, inputSize, outline, error: !!error, disabled: rest.disabled, children: [
|
|
331
|
-
/* @__PURE__ */ jsxs("select", { ...rest, ref
|
|
335
|
+
/* @__PURE__ */ jsxs("select", { ...rest, ref, children: [
|
|
332
336
|
placeholder && /* @__PURE__ */ jsx("option", { value: "", disabled: !optional, children: placeholder }),
|
|
333
337
|
list
|
|
334
338
|
] }),
|
|
335
339
|
/* @__PURE__ */ jsx(ChevronDown, {}),
|
|
336
340
|
/* @__PURE__ */ jsx(HelpMessage, { help, error, noErrorMessage })
|
|
337
341
|
] });
|
|
338
|
-
}
|
|
339
|
-
|
|
342
|
+
});
|
|
343
|
+
Select.displayName = "Select";
|
|
344
|
+
const Select$1 = Select;
|
|
340
345
|
function shouldForwardProp$5(name) {
|
|
341
346
|
return name !== "error" && name !== "disabled" && name !== "inputSize" && name !== "outline";
|
|
342
347
|
}
|
|
@@ -375,13 +380,12 @@ const InputWrapper$1 = /* @__PURE__ */ styled.span.withConfig({
|
|
|
375
380
|
theme
|
|
376
381
|
}) => disabled ? css(["select{", " border-style:dashed;}svg{display:none;}"], disabledColor(theme)) : void 0);
|
|
377
382
|
|
|
378
|
-
|
|
383
|
+
const Radio = forwardRef(({
|
|
379
384
|
className,
|
|
380
385
|
style,
|
|
381
386
|
children,
|
|
382
|
-
innerRef,
|
|
383
387
|
...rest
|
|
384
|
-
}) {
|
|
388
|
+
}, ref) => {
|
|
385
389
|
const id = `radio_${rest.name}_${rest.value}`;
|
|
386
390
|
const innerClass = useMemo(() => {
|
|
387
391
|
const arr = [];
|
|
@@ -396,10 +400,11 @@ function Radio({
|
|
|
396
400
|
/* @__PURE__ */ jsx(Shape, { className: innerClass, children: /* @__PURE__ */ jsx("i", {}) }),
|
|
397
401
|
children
|
|
398
402
|
] }),
|
|
399
|
-
/* @__PURE__ */ jsx("input", { id, type: "radio", ...rest, ref
|
|
403
|
+
/* @__PURE__ */ jsx("input", { id, type: "radio", ...rest, ref })
|
|
400
404
|
] });
|
|
401
|
-
}
|
|
402
|
-
|
|
405
|
+
});
|
|
406
|
+
Radio.displayName = "Radio";
|
|
407
|
+
const Radio$1 = Radio;
|
|
403
408
|
const Shape = /* @__PURE__ */ styled.div.withConfig({
|
|
404
409
|
displayName: "Radio__Shape",
|
|
405
410
|
componentId: "sc-13m0vd4-0"
|
|
@@ -840,6 +845,7 @@ function Modal({
|
|
|
840
845
|
children,
|
|
841
846
|
timeout = 200,
|
|
842
847
|
padding = "0.85rem",
|
|
848
|
+
verticalAlign = "center",
|
|
843
849
|
closeModal,
|
|
844
850
|
closeOnOverlay,
|
|
845
851
|
closeOnEsc,
|
|
@@ -890,7 +896,7 @@ function Modal({
|
|
|
890
896
|
exitRef.current = onExited;
|
|
891
897
|
return /* @__PURE__ */ jsx(Portal$1, { children: isMounted ? /* @__PURE__ */ jsx(Overlay, { lockScroll: true, "data-testid": "vs-modal-overlay", onClick: handleOverlayClose, style: {
|
|
892
898
|
padding
|
|
893
|
-
}, children: /* @__PURE__ */ jsx(Wrapper$2, { ref: refs.setFloating, role: "dialog", ...getFloatingProps({
|
|
899
|
+
}, $verticalAlign: verticalAlign, children: /* @__PURE__ */ jsx(Wrapper$2, { ref: refs.setFloating, role: "dialog", ...getFloatingProps({
|
|
894
900
|
...rest,
|
|
895
901
|
style: styles,
|
|
896
902
|
onClick: stopPropagation
|
|
@@ -899,7 +905,23 @@ function Modal({
|
|
|
899
905
|
const Overlay = /* @__PURE__ */ styled(FloatingOverlay).withConfig({
|
|
900
906
|
displayName: "Modal__Overlay",
|
|
901
907
|
componentId: "sc-pb7lhx-0"
|
|
902
|
-
})([" display:flex;display:grid;place-items:
|
|
908
|
+
})([" display:flex;display:grid;place-items:", ";align-items:", ";justify-content:center;background:", ";z-index:9997;"], ({
|
|
909
|
+
$verticalAlign
|
|
910
|
+
}) => {
|
|
911
|
+
if ($verticalAlign === "start")
|
|
912
|
+
return "flex-start";
|
|
913
|
+
if ($verticalAlign === "end")
|
|
914
|
+
return "flex-end";
|
|
915
|
+
return "center";
|
|
916
|
+
}, ({
|
|
917
|
+
$verticalAlign
|
|
918
|
+
}) => {
|
|
919
|
+
if ($verticalAlign === "start")
|
|
920
|
+
return "flex-start";
|
|
921
|
+
if ($verticalAlign === "end")
|
|
922
|
+
return "flex-end";
|
|
923
|
+
return "center";
|
|
924
|
+
}, ({
|
|
903
925
|
theme
|
|
904
926
|
}) => theme.backdrop);
|
|
905
927
|
const Wrapper$2 = /* @__PURE__ */ styled.div.withConfig({
|
|
@@ -971,7 +993,8 @@ function Toast({
|
|
|
971
993
|
clear,
|
|
972
994
|
fixed,
|
|
973
995
|
margin = "16px",
|
|
974
|
-
position = "top-left"
|
|
996
|
+
position = "top-left",
|
|
997
|
+
space = "16px"
|
|
975
998
|
}) {
|
|
976
999
|
const style = useMemo(() => {
|
|
977
1000
|
const base = {
|
|
@@ -995,12 +1018,14 @@ function Toast({
|
|
|
995
1018
|
}
|
|
996
1019
|
return base;
|
|
997
1020
|
}, [fixed, margin, position]);
|
|
998
|
-
return /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(ToastList, { style, children: toasts.map((props) => /* @__PURE__ */ createElement(ToastItem, { ...props, key: props.id, clear })) }) });
|
|
1021
|
+
return /* @__PURE__ */ jsx(Portal$1, { children: /* @__PURE__ */ jsx(ToastList, { style, $space: space, children: toasts.map((props) => /* @__PURE__ */ createElement(ToastItem, { ...props, key: props.id, clear })) }) });
|
|
999
1022
|
}
|
|
1000
1023
|
const ToastList = /* @__PURE__ */ styled.ul.withConfig({
|
|
1001
1024
|
displayName: "Toast__ToastList",
|
|
1002
1025
|
componentId: "sc-8192b2-0"
|
|
1003
|
-
})(["display:flex;flex-direction:column;z-index:9999;
|
|
1026
|
+
})(["display:flex;flex-direction:column;z-index:9999;overflow:hidden;li + li{margin-top:", ";}"], ({
|
|
1027
|
+
$space
|
|
1028
|
+
}) => $space);
|
|
1004
1029
|
|
|
1005
1030
|
function getColor$1({
|
|
1006
1031
|
theme,
|
|
@@ -1448,4 +1473,4 @@ const normalized = /* @__PURE__ */ css(["*,::after,::before{box-sizing:border-bo
|
|
|
1448
1473
|
}) => theme.link);
|
|
1449
1474
|
const normalized$1 = normalized;
|
|
1450
1475
|
|
|
1451
|
-
export { Accordion, AppBar, Box, Button, ButtonGroup, Checkbox$1 as Checkbox, Col$1 as Col, Container, index$3 as Content, index as Divider, Field, Approved as IconApproved, ChevronDown as IconArrowDown, ChevronLeftRound as IconChevronLeftRound, ChevronRightRound as IconChevronRightRound, Close as IconClose, FileRound as IconFileRound, Pencil as IconPencil, PencilSimple as IconPencilSimple, Plus as IconPlus, Refresh as IconRefresh, User as IconUser, Modal, index$2 as Placeholder, Popover$1 as Popover, Portal$1 as Portal, Progress,
|
|
1476
|
+
export { Accordion, AppBar, Box, Button, ButtonGroup, Checkbox$1 as Checkbox, Col$1 as Col, Container, index$3 as Content, index as Divider, Field, Approved as IconApproved, ChevronDown as IconArrowDown, ChevronLeftRound as IconChevronLeftRound, ChevronRightRound as IconChevronRightRound, Close as IconClose, FileRound as IconFileRound, Pencil as IconPencil, PencilSimple as IconPencilSimple, Plus as IconPlus, Refresh as IconRefresh, User as IconUser, Modal, index$2 as Placeholder, Popover$1 as Popover, Portal$1 as Portal, Progress, Radio$1 as Radio, Row, Select$1 as Select, Spinner$1 as Spinner, Switch$1 as Switch, index$1 as Table, Tag, TextButton, TextInput$1 as TextInput, Textarea$1 as Textarea, Toast, Tooltip$1 as Tooltip, Arrow as arrow, boxShadow, theme$1 as defaultTheme, findColorInvert, hamburger as hambuger, mediaDesktop, mediaFullHD, mediaMobile, mediaTablet, mediaUntilFullHD, normalized$1 as normalizeStyle, setSize };
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "visits-style",
|
|
3
3
|
"repository": "https://github.com/visits-works/visits-style",
|
|
4
4
|
"homepage": "https://github.com/visits-works/visits-style",
|
|
5
|
-
"version": "1.4.
|
|
5
|
+
"version": "1.4.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs.js",
|
|
8
8
|
"module": "./dist/index.es.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"styled-components": ">=6.0.2"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@floating-ui/react": "^0.24.
|
|
30
|
+
"@floating-ui/react": "^0.24.5",
|
|
31
31
|
"polished": "^4.2.2"
|
|
32
32
|
}
|
|
33
33
|
}
|