smarthr-ui 29.0.2 → 30.0.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/esm/components/Dialog/ActionDialogContentInner.d.ts +5 -3
- package/esm/components/Dialog/ActionDialogContentInner.js +24 -58
- package/esm/components/Dialog/ActionDialogContentInner.js.map +1 -1
- package/esm/components/Dialog/useClassNames.d.ts +0 -1
- package/esm/components/Dialog/useClassNames.js +0 -1
- package/esm/components/Dialog/useClassNames.js.map +1 -1
- package/esm/components/Dropdown/DropdownMenuButton/DropdownMenuButton.d.ts +3 -5
- package/esm/components/Dropdown/DropdownMenuButton/DropdownMenuButton.js +4 -4
- package/esm/components/Dropdown/DropdownMenuButton/DropdownMenuButton.js.map +1 -1
- package/esm/components/FloatArea/FloatArea.d.ts +7 -6
- package/esm/components/FloatArea/FloatArea.js +8 -19
- package/esm/components/FloatArea/FloatArea.js.map +1 -1
- package/esm/components/Header/HeaderDropdownMenuButton.d.ts +174 -164
- package/esm/components/Icon/Icon.d.ts +310 -346
- package/esm/components/Icon/Icon.js +2 -67
- package/esm/components/Icon/Icon.js.map +1 -1
- package/esm/components/Icon/WarningIcon.d.ts +2 -3
- package/esm/components/Icon/WarningIcon.js +4 -3
- package/esm/components/Icon/WarningIcon.js.map +1 -1
- package/esm/components/Icon/generateIcon.d.ts +38 -0
- package/esm/components/Icon/generateIcon.js +65 -0
- package/esm/components/Icon/generateIcon.js.map +1 -0
- package/esm/components/Icon/index.d.ts +1 -0
- package/esm/components/Icon/index.js +1 -0
- package/esm/components/Icon/index.js.map +1 -1
- package/esm/components/Pagination/PaginationItem.js +1 -1
- package/esm/components/Pagination/PaginationItem.js.map +1 -1
- package/lib/components/Dialog/ActionDialogContentInner.d.ts +5 -3
- package/lib/components/Dialog/ActionDialogContentInner.js +23 -57
- package/lib/components/Dialog/ActionDialogContentInner.js.map +1 -1
- package/lib/components/Dialog/useClassNames.d.ts +0 -1
- package/lib/components/Dialog/useClassNames.js +0 -1
- package/lib/components/Dialog/useClassNames.js.map +1 -1
- package/lib/components/Dropdown/DropdownMenuButton/DropdownMenuButton.d.ts +3 -5
- package/lib/components/Dropdown/DropdownMenuButton/DropdownMenuButton.js +3 -3
- package/lib/components/Dropdown/DropdownMenuButton/DropdownMenuButton.js.map +1 -1
- package/lib/components/FloatArea/FloatArea.d.ts +7 -6
- package/lib/components/FloatArea/FloatArea.js +7 -18
- package/lib/components/FloatArea/FloatArea.js.map +1 -1
- package/lib/components/Header/HeaderDropdownMenuButton.d.ts +174 -164
- package/lib/components/Icon/Icon.d.ts +310 -346
- package/lib/components/Icon/Icon.js +312 -402
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/Icon/WarningIcon.d.ts +2 -3
- package/lib/components/Icon/WarningIcon.js +5 -3
- package/lib/components/Icon/WarningIcon.js.map +1 -1
- package/lib/components/Icon/generateIcon.d.ts +38 -0
- package/lib/components/Icon/generateIcon.js +96 -0
- package/lib/components/Icon/generateIcon.js.map +1 -0
- package/lib/components/Icon/index.d.ts +1 -0
- package/lib/components/Icon/index.js +3 -0
- package/lib/components/Icon/index.js.map +1 -1
- package/lib/components/Pagination/PaginationItem.js +1 -1
- package/lib/components/Pagination/PaginationItem.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { DecoratorsType } from '../../types/props';
|
|
3
3
|
import { HeadingTagTypes } from '../Heading';
|
|
4
4
|
export type BaseProps = {
|
|
@@ -47,13 +47,15 @@ export type BaseProps = {
|
|
|
47
47
|
decorators?: DecoratorsType<'closeButtonLabel'>;
|
|
48
48
|
};
|
|
49
49
|
type responseMessageType = {
|
|
50
|
-
status: 'success' | 'error'
|
|
50
|
+
status: 'success' | 'error';
|
|
51
51
|
text: string;
|
|
52
|
+
} | {
|
|
53
|
+
status: 'processing';
|
|
52
54
|
};
|
|
53
55
|
export type ActionDialogContentInnerProps = BaseProps & {
|
|
54
56
|
onClickClose: () => void;
|
|
55
57
|
responseMessage?: responseMessageType;
|
|
56
58
|
titleId: string;
|
|
57
59
|
};
|
|
58
|
-
export declare const ActionDialogContentInner:
|
|
60
|
+
export declare const ActionDialogContentInner: FC<ActionDialogContentInnerProps>;
|
|
59
61
|
export {};
|
|
@@ -3,8 +3,7 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
import { useTheme } from '../../hooks/useTheme';
|
|
4
4
|
import { Button } from '../Button';
|
|
5
5
|
import { FaCheckCircleIcon, FaExclamationCircleIcon } from '../Icon';
|
|
6
|
-
import { Stack } from '../Layout';
|
|
7
|
-
import { Loader } from '../Loader';
|
|
6
|
+
import { Cluster, Stack } from '../Layout';
|
|
8
7
|
import { Text } from '../Text';
|
|
9
8
|
import { useOffsetHeight } from './dialogHelper';
|
|
10
9
|
import { useClassNames } from './useClassNames';
|
|
@@ -23,69 +22,36 @@ export const ActionDialogContentInner = ({ children, title, titleId, subtitle, t
|
|
|
23
22
|
React.createElement(Text, { id: titleId, size: "L", leading: "TIGHT", className: classNames.title }, title)),
|
|
24
23
|
React.createElement(Body, { offsetHeight: offsetHeight, className: classNames.body }, children),
|
|
25
24
|
React.createElement(ActionArea, { themes: theme, ref: bottomRef, className: classNames.actionArea },
|
|
26
|
-
React.createElement(ButtonArea, {
|
|
25
|
+
React.createElement(ButtonArea, { className: classNames.buttonArea },
|
|
27
26
|
React.createElement(Button, { onClick: onClickClose, disabled: closeDisabled || isRequestProcessing, className: classNames.closeButton }, decorators?.closeButtonLabel?.(CLOSE_BUTTON_LABEL) || CLOSE_BUTTON_LABEL),
|
|
28
|
-
React.createElement(Button, { variant: actionTheme, onClick: handleClickAction, disabled: actionDisabled
|
|
29
|
-
responseMessage && (React.createElement(
|
|
30
|
-
responseMessage.status === 'success'
|
|
31
|
-
|
|
27
|
+
React.createElement(Button, { variant: actionTheme, onClick: handleClickAction, disabled: actionDisabled, loading: isRequestProcessing, className: classNames.actionButton }, actionText)),
|
|
28
|
+
responseMessage && (React.createElement(React.Fragment, null,
|
|
29
|
+
responseMessage.status === 'success' && (React.createElement(Message, null,
|
|
30
|
+
React.createElement(FaCheckCircleIcon, { color: theme.color.MAIN, text: responseMessage.text, role: "alert" }))),
|
|
31
|
+
responseMessage.status === 'error' && (React.createElement(Message, null,
|
|
32
|
+
React.createElement(FaExclamationCircleIcon, { color: theme.color.DANGER, text: responseMessage.text, role: "alert" }))))))));
|
|
32
33
|
};
|
|
33
|
-
const TitleArea = styled(Stack)
|
|
34
|
+
const TitleArea = styled(Stack) `
|
|
35
|
+
${({ themes: { border, space } }) => css `
|
|
34
36
|
margin-block: unset;
|
|
35
37
|
border-bottom: ${border.shorthand};
|
|
36
|
-
padding: ${
|
|
37
|
-
`
|
|
38
|
+
padding: ${space(1)} ${space(1.5)};
|
|
39
|
+
`}
|
|
40
|
+
`;
|
|
38
41
|
const Body = styled.div `
|
|
39
|
-
${({ offsetHeight }) =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`;
|
|
44
|
-
}}
|
|
42
|
+
${({ offsetHeight }) => css `
|
|
43
|
+
max-height: calc(100vh - ${offsetHeight}px);
|
|
44
|
+
overflow: auto;
|
|
45
|
+
`}
|
|
45
46
|
`;
|
|
46
|
-
const ActionArea = styled.
|
|
47
|
-
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
47
|
+
const ActionArea = styled(Stack).attrs({ gap: 0.5 }) `
|
|
48
|
+
${({ themes: { space, border } }) => css `
|
|
50
49
|
border-top: ${border.shorthand};
|
|
51
|
-
padding: ${
|
|
52
|
-
|
|
53
|
-
&&& > * + * {
|
|
54
|
-
margin-top: 0.5rem;
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
});
|
|
58
|
-
const ButtonArea = styled.div(({ themes: { spacing } }) => {
|
|
59
|
-
return css `
|
|
60
|
-
display: flex;
|
|
61
|
-
justify-content: flex-end;
|
|
62
|
-
|
|
63
|
-
> * + * {
|
|
64
|
-
margin-left: ${spacing.XS};
|
|
65
|
-
}
|
|
66
|
-
`;
|
|
67
|
-
});
|
|
68
|
-
const MessageWrapper = styled.div `
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
justify-content: flex-end;
|
|
72
|
-
margin-top: 0;
|
|
73
|
-
margin-bottom: 0;
|
|
74
|
-
font-size: ${({ themes }) => themes.fontSize.M};
|
|
75
|
-
`;
|
|
76
|
-
const Spinner = styled(Loader) `
|
|
77
|
-
&&& {
|
|
78
|
-
> div {
|
|
79
|
-
width: 18px;
|
|
80
|
-
height: 18px;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
> div > div {
|
|
84
|
-
border-color: ${({ themes }) => themes.color.TEXT_GREY};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
50
|
+
padding: ${space(1)} ${space(1.5)};
|
|
51
|
+
`}
|
|
87
52
|
`;
|
|
88
|
-
const
|
|
89
|
-
|
|
53
|
+
const ButtonArea = styled(Cluster).attrs({ gap: { row: 0.5, column: 1 }, justify: 'flex-end' }) ``;
|
|
54
|
+
const Message = styled.div `
|
|
55
|
+
text-align: right;
|
|
90
56
|
`;
|
|
91
57
|
//# sourceMappingURL=ActionDialogContentInner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionDialogContentInner.js","sourceRoot":"","sources":["../../../src/components/Dialog/ActionDialogContentInner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ActionDialogContentInner.js","sourceRoot":"","sources":["../../../src/components/Dialog/ActionDialogContentInner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,WAAW,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAS,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAA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K,CAAC,KAAK,CAAC,MAAM,EACzB,IAAI,EAAE,eAAe,CAAC,IAAI,EAC1B,IAAI,EAAC,OAAO,GACZ,CACM,CACX,CACA,CACJ,CACU,CACZ,CACJ,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAwC;IACnE,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;qBAErB,MAAM,CAAC,SAAS;eACtB,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;GAClC;CACF,CAAA;AACD,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAA0B;IAC7C,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;+BACE,YAAY;;GAExC;CACF,CAAA;AACD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAmB;IACnE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;kBACxB,MAAM,CAAC,SAAS;eACnB,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC;GAClC;CACF,CAAA;AACD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAA,EAAE,CAAA;AACjG,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEzB,CAAA"}
|
|
@@ -18,7 +18,6 @@ export function useClassNames() {
|
|
|
18
18
|
buttonArea: generateForDialog('buttonArea'),
|
|
19
19
|
closeButton: generateForDialog('closeButton'),
|
|
20
20
|
actionButton: generateForDialog('actionButton'),
|
|
21
|
-
alert: generateForDialog('alert'),
|
|
22
21
|
},
|
|
23
22
|
modelessDialog: {
|
|
24
23
|
wrapper: generateForModeless(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClassNames.js","sourceRoot":"","sources":["../../../src/components/Dialog/useClassNames.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,CAAA;AAE1C,MAAM,UAAU,aAAa;IAC3B,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,CAAA;IAC/E,MAAM,mBAAmB,GAAG,qBAAqB,CAAC,cAAc,CAAC,WAAW,IAAI,gBAAgB,CAAC,CAAA;IACjG,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC;QACL,MAAM,EAAE;YACN,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC;YACrC,MAAM,EAAE,iBAAiB,EAAE;YAC3B,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC;YAC3C,SAAS,EAAE,iBAAiB,CAAC,WAAW,CAAC;YACzC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC;YACjC,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC;YACvC,IAAI,EAAE,iBAAiB,CAAC,MAAM,CAAC;YAC/B,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC;YAC7C,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC;YAC3C,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC;YAC3C,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC;YAC7C,YAAY,EAAE,iBAAiB,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"useClassNames.js","sourceRoot":"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,CAAC;YAC/C,OAAO,EAAE,mBAAmB,CAAC,SAAS,CAAC;YACvC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC;SACtC;KACF,CAAC,EACF,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CACzC,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentProps,
|
|
1
|
+
import { ButtonHTMLAttributes, ComponentProps, FC, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { AnchorButton, Button, BaseProps as ButtonProps } from '../../Button';
|
|
3
3
|
type Actions = ActionItem | ActionItem[];
|
|
4
4
|
type ActionItem = ReactElement<ComponentProps<typeof Button>> | ReactElement<ComponentProps<typeof AnchorButton>> | null | boolean;
|
|
@@ -11,9 +11,7 @@ type Props = {
|
|
|
11
11
|
triggerSize?: ButtonProps['size'];
|
|
12
12
|
/** 引き金となるボタンをアイコンのみとするかどうか */
|
|
13
13
|
onlyIconTrigger?: boolean;
|
|
14
|
-
/** 引き金となるボタンの `disabled` 属性の値 */
|
|
15
|
-
disabled?: boolean;
|
|
16
14
|
};
|
|
17
|
-
type ElementProps = Omit<
|
|
18
|
-
export declare const DropdownMenuButton:
|
|
15
|
+
type ElementProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof Props>;
|
|
16
|
+
export declare const DropdownMenuButton: FC<Props & ElementProps>;
|
|
19
17
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
1
|
+
import React, { useMemo, } from 'react';
|
|
2
2
|
import innerText from 'react-innertext';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { Dropdown, DropdownContent, DropdownTrigger } from '..';
|
|
@@ -7,16 +7,16 @@ import { Button } from '../../Button';
|
|
|
7
7
|
import { FaCaretDownIcon, FaEllipsisHIcon } from '../../Icon';
|
|
8
8
|
import { Stack } from '../../Layout';
|
|
9
9
|
import { useClassNames } from './useClassNames';
|
|
10
|
-
export const DropdownMenuButton = ({ label, children, triggerSize, onlyIconTrigger = false,
|
|
10
|
+
export const DropdownMenuButton = ({ label, children, triggerSize, onlyIconTrigger = false, className = '', ...props }) => {
|
|
11
11
|
const themes = useTheme();
|
|
12
12
|
const classNames = useClassNames();
|
|
13
13
|
const triggerLabel = useMemo(() => onlyIconTrigger ? (React.createElement(FaEllipsisHIcon, { alt: typeof label === 'string' ? label : innerText(label) })) : (label), [onlyIconTrigger, label]);
|
|
14
14
|
const triggerSuffix = useMemo(
|
|
15
15
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
16
16
|
() => (onlyIconTrigger ? React.createElement(React.Fragment, null) : React.createElement(FaCaretDownIcon, { alt: "\u5019\u88DC\u3092\u958B\u304F" })), [onlyIconTrigger]);
|
|
17
|
-
return (React.createElement(Dropdown,
|
|
17
|
+
return (React.createElement(Dropdown, null,
|
|
18
18
|
React.createElement(DropdownTrigger, { className: `${classNames.wrapper}${className && ` ${className}`}` },
|
|
19
|
-
React.createElement(TriggerButton, { suffix: triggerSuffix, size: triggerSize,
|
|
19
|
+
React.createElement(TriggerButton, { ...props, suffix: triggerSuffix, size: triggerSize, square: onlyIconTrigger, className: classNames.trigger }, triggerLabel)),
|
|
20
20
|
React.createElement(DropdownContent, null,
|
|
21
21
|
React.createElement(ActionList, { themes: themes, className: classNames.panel }, React.Children.map(children, (item, i) =>
|
|
22
22
|
// MEMO: {flag && <Button/>}のような書き方に対応させるためbooleanの判定を入れています
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuButton.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/DropdownMenuButton/DropdownMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"DropdownMenuButton.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/DropdownMenuButton/DropdownMenuButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,OAAO,GACR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E,IAAI,EAAE,CAAC,CAAA"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ComponentProps, FunctionComponentElement, HTMLAttributes, ReactNode
|
|
1
|
+
import { ComponentProps, FC, FunctionComponentElement, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { AbstractSize, CharRelativeSize } from '../../themes/createSpacing';
|
|
2
3
|
import { FaExclamationCircleIcon } from '../Icon';
|
|
3
4
|
type StyleProps = {
|
|
4
|
-
/**
|
|
5
|
-
top?:
|
|
6
|
-
/**
|
|
7
|
-
bottom?:
|
|
5
|
+
/** コンポーネントの上端から、包含ブロックの上端までの間隔(基準フォントサイズの相対値または抽象値) */
|
|
6
|
+
top?: CharRelativeSize | AbstractSize;
|
|
7
|
+
/** コンポーネントの下端から、包含ブロックの下端までの間隔(基準フォントサイズの相対値または抽象値) */
|
|
8
|
+
bottom?: CharRelativeSize | AbstractSize;
|
|
8
9
|
/** コンポーネントの `z-index` 値 */
|
|
9
10
|
zIndex?: number;
|
|
10
11
|
};
|
|
@@ -29,5 +30,5 @@ type Props = StyleProps & {
|
|
|
29
30
|
className?: string;
|
|
30
31
|
};
|
|
31
32
|
type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, keyof Props>;
|
|
32
|
-
export declare const FloatArea:
|
|
33
|
+
export declare const FloatArea: FC<Props & ElementProps>;
|
|
33
34
|
export {};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
+
import { useSpacing } from '../../hooks/useSpacing';
|
|
3
4
|
import { useTheme } from '../../hooks/useTheme';
|
|
4
|
-
import {
|
|
5
|
+
import { Base as shrBase } from '../Base';
|
|
5
6
|
import { Cluster, LineUp } from '../Layout';
|
|
6
7
|
import { Text } from '../Text';
|
|
7
8
|
import { useClassNames } from './useClassNames';
|
|
8
|
-
const exist = (value) => {
|
|
9
|
-
return value !== undefined && value !== null;
|
|
10
|
-
};
|
|
11
9
|
export const FloatArea = ({ primaryButton, secondaryButton, tertiaryButton, errorText, errorIcon, fixed = false, className = '', width, ...props }) => {
|
|
12
10
|
const theme = useTheme();
|
|
13
11
|
const classNames = useClassNames();
|
|
@@ -23,23 +21,14 @@ export const FloatArea = ({ primaryButton, secondaryButton, tertiaryButton, erro
|
|
|
23
21
|
secondaryButton && secondaryButton,
|
|
24
22
|
primaryButton && primaryButton))))));
|
|
25
23
|
};
|
|
26
|
-
const Base = styled(
|
|
27
|
-
${({ themes: {
|
|
24
|
+
const Base = styled(shrBase).attrs({ layer: 3 }) `
|
|
25
|
+
${({ themes: { space }, top, bottom, $width, fixed, zIndex = 500 }) => css `
|
|
28
26
|
position: ${fixed ? 'fixed' : 'sticky'};
|
|
29
|
-
${
|
|
30
|
-
|
|
31
|
-
top: ${typeof top === 'number' ? `${top}px` : top};
|
|
32
|
-
`}
|
|
33
|
-
${exist(bottom) &&
|
|
34
|
-
css `
|
|
35
|
-
bottom: ${typeof bottom === 'number' ? `${bottom}px` : bottom};
|
|
36
|
-
`}
|
|
27
|
+
${(top || top === 0) && `top: ${useSpacing(top)};`}
|
|
28
|
+
${(bottom || bottom === 0) && `bottom: ${useSpacing(bottom)};`}
|
|
37
29
|
z-index: ${zIndex};
|
|
38
|
-
${
|
|
39
|
-
|
|
40
|
-
width: ${$width};
|
|
41
|
-
`}
|
|
42
|
-
padding: ${spacingByChar(1)};
|
|
30
|
+
padding: ${space(1)};
|
|
31
|
+
${$width && `width: ${$width};`}
|
|
43
32
|
`}
|
|
44
33
|
`;
|
|
45
34
|
const RightSide = styled.div `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatArea.js","sourceRoot":"","sources":["../../../src/components/FloatArea/FloatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAA;AACd,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAS,QAAQ,EAAE,MAAM,sB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