no-frills-ui 0.0.14-alpha.8 → 0.0.14-rc.1
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/index.js +847 -718
- package/dist/index.js.map +1 -1
- package/lib-esm/components/Accordion/Accordion.d.ts +9 -13
- package/lib-esm/components/Accordion/Accordion.js +13 -11
- package/lib-esm/components/Accordion/Accordion.js.map +1 -1
- package/lib-esm/components/Accordion/AccordionStep.d.ts +22 -22
- package/lib-esm/components/Accordion/AccordionStep.js +34 -29
- package/lib-esm/components/Accordion/AccordionStep.js.map +1 -1
- package/lib-esm/components/Badge/Badge.d.ts +13 -16
- package/lib-esm/components/Badge/Badge.js +10 -20
- package/lib-esm/components/Badge/Badge.js.map +1 -1
- package/lib-esm/components/Button/ActionButton.d.ts +9 -5
- package/lib-esm/components/Button/ActionButton.js +18 -3
- package/lib-esm/components/Button/ActionButton.js.map +1 -1
- package/lib-esm/components/Button/Button.d.ts +9 -5
- package/lib-esm/components/Button/Button.js +17 -5
- package/lib-esm/components/Button/Button.js.map +1 -1
- package/lib-esm/components/Button/IconButton.d.ts +9 -5
- package/lib-esm/components/Button/IconButton.js +18 -3
- package/lib-esm/components/Button/IconButton.js.map +1 -1
- package/lib-esm/components/Button/LinkButton.d.ts +9 -5
- package/lib-esm/components/Button/LinkButton.js +18 -3
- package/lib-esm/components/Button/LinkButton.js.map +1 -1
- package/lib-esm/components/Button/RaisedButton.d.ts +9 -5
- package/lib-esm/components/Button/RaisedButton.js +18 -3
- package/lib-esm/components/Button/RaisedButton.js.map +1 -1
- package/lib-esm/components/Card/Card.d.ts +4 -6
- package/lib-esm/components/Card/Card.js +16 -3
- package/lib-esm/components/Card/Card.js.map +1 -1
- package/lib-esm/components/Chip/Chip.d.ts +2 -2
- package/lib-esm/components/Chip/Chip.js +14 -8
- package/lib-esm/components/Chip/Chip.js.map +1 -1
- package/lib-esm/components/ChipInput/ChipInput.d.ts +28 -39
- package/lib-esm/components/ChipInput/ChipInput.js +37 -37
- package/lib-esm/components/ChipInput/ChipInput.js.map +1 -1
- package/lib-esm/components/Dialog/AlertDialog.d.ts +11 -12
- package/lib-esm/components/Dialog/AlertDialog.js +4 -11
- package/lib-esm/components/Dialog/AlertDialog.js.map +1 -1
- package/lib-esm/components/Dialog/ConfirmDialog.d.ts +13 -14
- package/lib-esm/components/Dialog/ConfirmDialog.js +4 -12
- package/lib-esm/components/Dialog/ConfirmDialog.js.map +1 -1
- package/lib-esm/components/Dialog/Dialog.d.ts +8 -14
- package/lib-esm/components/Dialog/Dialog.js +11 -9
- package/lib-esm/components/Dialog/Dialog.js.map +1 -1
- package/lib-esm/components/Dialog/PromptDialog.d.ts +18 -19
- package/lib-esm/components/Dialog/PromptDialog.js +10 -18
- package/lib-esm/components/Dialog/PromptDialog.js.map +1 -1
- package/lib-esm/components/DragAndDrop/DragAndDrop.d.ts +37 -59
- package/lib-esm/components/DragAndDrop/DragAndDrop.js +23 -26
- package/lib-esm/components/DragAndDrop/DragAndDrop.js.map +1 -1
- package/lib-esm/components/DragAndDrop/DragItem.d.ts +2 -2
- package/lib-esm/components/DragAndDrop/DragItem.js +40 -38
- package/lib-esm/components/DragAndDrop/DragItem.js.map +1 -1
- package/lib-esm/components/DragAndDrop/types.d.ts +3 -3
- package/lib-esm/components/DragAndDrop/types.js.map +1 -1
- package/lib-esm/components/Drawer/Drawer.d.ts +24 -31
- package/lib-esm/components/Drawer/Drawer.js +49 -45
- package/lib-esm/components/Drawer/Drawer.js.map +1 -1
- package/lib-esm/components/Groups/Group.d.ts +6 -8
- package/lib-esm/components/Groups/Group.js +12 -10
- package/lib-esm/components/Groups/Group.js.map +1 -1
- package/lib-esm/components/Input/Checkbox.d.ts +12 -15
- package/lib-esm/components/Input/Checkbox.js +30 -26
- package/lib-esm/components/Input/Checkbox.js.map +1 -1
- package/lib-esm/components/Input/Dropdown.d.ts +8 -18
- package/lib-esm/components/Input/Dropdown.js +42 -17
- package/lib-esm/components/Input/Dropdown.js.map +1 -1
- package/lib-esm/components/Input/Input.d.ts +8 -3
- package/lib-esm/components/Input/Input.js +20 -19
- package/lib-esm/components/Input/Input.js.map +1 -1
- package/lib-esm/components/Input/Radio.d.ts +4 -8
- package/lib-esm/components/Input/Radio.js +16 -13
- package/lib-esm/components/Input/Radio.js.map +1 -1
- package/lib-esm/components/Input/RadioButton.d.ts +4 -8
- package/lib-esm/components/Input/RadioButton.js +15 -12
- package/lib-esm/components/Input/RadioButton.js.map +1 -1
- package/lib-esm/components/Input/Select.d.ts +6 -13
- package/lib-esm/components/Input/Select.js +21 -18
- package/lib-esm/components/Input/Select.js.map +1 -1
- package/lib-esm/components/Input/TextArea.d.ts +6 -13
- package/lib-esm/components/Input/TextArea.js +29 -24
- package/lib-esm/components/Input/TextArea.js.map +1 -1
- package/lib-esm/components/Input/Toggle.d.ts +4 -9
- package/lib-esm/components/Input/Toggle.js +12 -10
- package/lib-esm/components/Input/Toggle.js.map +1 -1
- package/lib-esm/components/Menu/Menu.d.ts +4 -14
- package/lib-esm/components/Menu/Menu.js +24 -16
- package/lib-esm/components/Menu/Menu.js.map +1 -1
- package/lib-esm/components/Menu/MenuContext.d.ts +4 -4
- package/lib-esm/components/Menu/MenuContext.js +1 -0
- package/lib-esm/components/Menu/MenuContext.js.map +1 -1
- package/lib-esm/components/Menu/MenuItem.d.ts +10 -4
- package/lib-esm/components/Menu/MenuItem.js +19 -5
- package/lib-esm/components/Menu/MenuItem.js.map +1 -1
- package/lib-esm/components/Modal/Modal.d.ts +17 -23
- package/lib-esm/components/Modal/Modal.js +37 -34
- package/lib-esm/components/Modal/Modal.js.map +1 -1
- package/lib-esm/components/Notification/Notification.d.ts +39 -34
- package/lib-esm/components/Notification/Notification.js +16 -39
- package/lib-esm/components/Notification/Notification.js.map +1 -1
- package/lib-esm/components/Notification/NotificationManager.d.ts +4 -4
- package/lib-esm/components/Notification/NotificationManager.js +18 -14
- package/lib-esm/components/Notification/NotificationManager.js.map +1 -1
- package/lib-esm/components/Notification/index.d.ts +1 -0
- package/lib-esm/components/Notification/style.d.ts +2 -3
- package/lib-esm/components/Notification/style.js +11 -11
- package/lib-esm/components/Notification/style.js.map +1 -1
- package/lib-esm/components/Popover/Popover.d.ts +21 -20
- package/lib-esm/components/Popover/Popover.js +42 -44
- package/lib-esm/components/Popover/Popover.js.map +1 -1
- package/lib-esm/components/Spinner/Spinner.d.ts +14 -15
- package/lib-esm/components/Spinner/Spinner.js +12 -13
- package/lib-esm/components/Spinner/Spinner.js.map +1 -1
- package/lib-esm/components/Stepper/Step.d.ts +15 -12
- package/lib-esm/components/Stepper/Step.js +10 -8
- package/lib-esm/components/Stepper/Step.js.map +1 -1
- package/lib-esm/components/Stepper/Stepper.d.ts +11 -17
- package/lib-esm/components/Stepper/Stepper.js +25 -23
- package/lib-esm/components/Stepper/Stepper.js.map +1 -1
- package/lib-esm/components/Tabs/Tab.d.ts +10 -16
- package/lib-esm/components/Tabs/Tab.js +0 -8
- package/lib-esm/components/Tabs/Tab.js.map +1 -1
- package/lib-esm/components/Tabs/Tabs.d.ts +11 -22
- package/lib-esm/components/Tabs/Tabs.js +39 -31
- package/lib-esm/components/Tabs/Tabs.js.map +1 -1
- package/lib-esm/components/Toast/Toast.d.ts +7 -7
- package/lib-esm/components/Toast/Toast.js +13 -12
- package/lib-esm/components/Toast/Toast.js.map +1 -1
- package/lib-esm/components/Toast/ToastStory.d.ts +21 -24
- package/lib-esm/components/Tooltip/Tooltip.d.ts +11 -14
- package/lib-esm/components/Tooltip/Tooltip.js +11 -21
- package/lib-esm/components/Tooltip/Tooltip.js.map +1 -1
- package/lib-esm/icons/CheckCircle.js +2 -2
- package/lib-esm/icons/CheckCircle.js.map +1 -1
- package/lib-esm/icons/ErrorOutline.js +2 -2
- package/lib-esm/icons/ErrorOutline.js.map +1 -1
- package/lib-esm/icons/Info.js +2 -2
- package/lib-esm/icons/Info.js.map +1 -1
- package/lib-esm/icons/ReportProblem.js +2 -2
- package/lib-esm/icons/ReportProblem.js.map +1 -1
- package/lib-esm/index.js +43 -0
- package/lib-esm/shared/LayerManager.d.ts +5 -4
- package/lib-esm/shared/LayerManager.js +111 -111
- package/lib-esm/shared/LayerManager.js.map +1 -1
- package/lib-esm/shared/styles.d.ts +1 -1
- package/lib-esm/shared/styles.js +9 -9
- package/lib-esm/shared/styles.js.map +1 -1
- package/package.json +66 -31
- package/lib-esm/components/index.js +0 -43
- /package/lib-esm/{components/index.js.map → index.js.map} +0 -0
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
declare function Accordion(props: PropsWithChildren<AccordionProps>): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
type AccordionProps = PropTypes.InferProps<typeof Accordion.propTypes>;
|
|
3
|
+
type AccordionProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Currently opened step
|
|
6
|
+
* @default -1
|
|
7
|
+
*/
|
|
8
|
+
active?: number;
|
|
9
|
+
/** Handler for click event on a step */
|
|
10
|
+
onStepClick?: (index: number) => void;
|
|
11
|
+
};
|
|
16
12
|
export default Accordion;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { jsx, Fragment } from '@emotion/react/jsx-runtime';
|
|
2
|
-
import { useState, Children, isValidElement, cloneElement } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
2
|
+
import { useState, useRef, useEffect, Children, isValidElement, cloneElement } from 'react';
|
|
4
3
|
|
|
5
4
|
function Accordion(props) {
|
|
6
5
|
const [active, setActive] = useState(props.active);
|
|
6
|
+
const prevActive = useRef(props.active);
|
|
7
|
+
useEffect(()=>{
|
|
8
|
+
if (props.active !== undefined && props.active !== prevActive.current) {
|
|
9
|
+
setActive(props.active);
|
|
10
|
+
prevActive.current = props.active;
|
|
11
|
+
}
|
|
12
|
+
}, [
|
|
13
|
+
props.active
|
|
14
|
+
]);
|
|
7
15
|
const onStepClick = (index, disabled)=>()=>{
|
|
8
16
|
if (disabled) {
|
|
9
17
|
return;
|
|
@@ -20,20 +28,14 @@ function Accordion(props) {
|
|
|
20
28
|
if (!/*#__PURE__*/ isValidElement(child)) {
|
|
21
29
|
return child;
|
|
22
30
|
}
|
|
23
|
-
|
|
31
|
+
const reactElement = child;
|
|
32
|
+
return /*#__PURE__*/ cloneElement(reactElement, {
|
|
24
33
|
open: active === index,
|
|
25
|
-
onStepClick: onStepClick(index,
|
|
34
|
+
onStepClick: onStepClick(index, reactElement.props.disabled || false)
|
|
26
35
|
});
|
|
27
36
|
})
|
|
28
37
|
});
|
|
29
38
|
}
|
|
30
|
-
Accordion.propTypes = {
|
|
31
|
-
/** Currently opened step */ active: PropTypes.number,
|
|
32
|
-
/** Handler for click event on a step */ onStepClick: PropTypes.func
|
|
33
|
-
};
|
|
34
|
-
Accordion.defaultProps = {
|
|
35
|
-
active: -1
|
|
36
|
-
};
|
|
37
39
|
|
|
38
40
|
export { Accordion as default };
|
|
39
41
|
//# sourceMappingURL=Accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.js","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"Accordion.js","sources":["../../../src/components/Accordion/Accordion.tsx"],"sourcesContent":["import {\n useState,\n Children,\n cloneElement,\n PropsWithChildren,\n isValidElement,\n useEffect,\n useRef,\n} from 'react';\n\nfunction Accordion(props: PropsWithChildren<AccordionProps>) {\n const [active, setActive] = useState(props.active);\n const prevActive = useRef(props.active);\n\n useEffect(() => {\n if (props.active !== undefined && props.active !== prevActive.current) {\n setActive(props.active);\n prevActive.current = props.active;\n }\n }, [props.active]);\n\n const onStepClick = (index: number, disabled: boolean) => () => {\n if (disabled) {\n return;\n }\n\n const newIndex = index !== active ? index : -1;\n if (props.onStepClick) {\n props.onStepClick(newIndex);\n } else {\n setActive(newIndex);\n }\n };\n\n return (\n <>\n {Children.map(props.children, (child, index) => {\n if (!isValidElement(child)) {\n return child;\n }\n const reactElement = child as React.ReactElement<{\n disabled?: boolean;\n open?: boolean;\n onStepClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n }>;\n return cloneElement(reactElement, {\n open: active === index,\n onStepClick: onStepClick(index, reactElement.props.disabled || false),\n });\n })}\n </>\n );\n}\n\ntype AccordionProps = {\n /**\n * Currently opened step\n * @default -1\n */\n active?: number;\n /** Handler for click event on a step */\n onStepClick?: (index: number) => void;\n};\n\nexport default Accordion;\n"],"names":["Accordion","props","active","setActive","useState","prevActive","useRef","useEffect","undefined","current","onStepClick","index","disabled","newIndex","_jsx","_Fragment","Children","map","children","child","isValidElement","reactElement","cloneElement","open"],"mappings":";;;AAUA,SAASA,UAAUC,KAAwC,EAAA;AACvD,IAAA,MAAM,CAACC,MAAAA,EAAQC,SAAAA,CAAU,GAAGC,QAAAA,CAASH,MAAMC,MAAM,CAAA;IACjD,MAAMG,UAAAA,GAAaC,MAAAA,CAAOL,KAAAA,CAAMC,MAAM,CAAA;IAEtCK,SAAAA,CAAU,IAAA;QACN,IAAIN,KAAAA,CAAMC,MAAM,KAAKM,SAAAA,IAAaP,MAAMC,MAAM,KAAKG,UAAAA,CAAWI,OAAO,EAAE;AACnEN,YAAAA,SAAAA,CAAUF,MAAMC,MAAM,CAAA;YACtBG,UAAAA,CAAWI,OAAO,GAAGR,KAAAA,CAAMC,MAAM;AACrC,QAAA;IACJ,CAAA,EAAG;AAACD,QAAAA,KAAAA,CAAMC;AAAO,KAAA,CAAA;IAEjB,MAAMQ,WAAAA,GAAc,CAACC,KAAAA,EAAeC,QAAAA,GAAsB,IAAA;AACtD,YAAA,IAAIA,QAAAA,EAAU;AACV,gBAAA;AACJ,YAAA;AAEA,YAAA,MAAMC,QAAAA,GAAWF,KAAAA,KAAUT,MAAAA,GAASS,KAAAA,GAAQ,EAAC;YAC7C,IAAIV,KAAAA,CAAMS,WAAW,EAAE;AACnBT,gBAAAA,KAAAA,CAAMS,WAAW,CAACG,QAAAA,CAAAA;YACtB,CAAA,MAAO;gBACHV,SAAAA,CAAUU,QAAAA,CAAAA;AACd,YAAA;AACJ,QAAA,CAAA;IAEA,qBACIC,GAAA,CAAAC,QAAA,EAAA;AACKC,QAAAA,QAAAA,EAAAA,QAAAA,CAASC,GAAG,CAAChB,KAAAA,CAAMiB,QAAQ,EAAE,CAACC,KAAAA,EAAOR,KAAAA,GAAAA;YAClC,IAAI,eAACS,eAAeD,KAAAA,CAAAA,EAAQ;gBACxB,OAAOA,KAAAA;AACX,YAAA;AACA,YAAA,MAAME,YAAAA,GAAeF,KAAAA;AAKrB,YAAA,qBAAOG,aAAaD,YAAAA,EAAc;AAC9BE,gBAAAA,IAAAA,EAAMrB,MAAAA,KAAWS,KAAAA;AACjBD,gBAAAA,WAAAA,EAAaA,YAAYC,KAAAA,EAAOU,YAAAA,CAAapB,KAAK,CAACW,QAAQ,IAAI,KAAA;AACnE,aAAA,CAAA;AACJ,QAAA,CAAA;;AAGZ;;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
export declare const AccordionStepBody: import("@emotion/styled").StyledComponent<{
|
|
4
3
|
theme?: import("@emotion/react").Theme;
|
|
5
4
|
as?: React.ElementType;
|
|
@@ -8,26 +7,27 @@ export declare const AccordionStepFooter: import("@emotion/styled").StyledCompon
|
|
|
8
7
|
theme?: import("@emotion/react").Theme;
|
|
9
8
|
as?: React.ElementType;
|
|
10
9
|
}, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
/** Props for `AccordionStep` component */
|
|
11
|
+
interface AccordionStepProps {
|
|
12
|
+
/**
|
|
13
|
+
* If the step has been marked as completed
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
completed?: boolean;
|
|
17
|
+
/** If the step is disabled
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Header content for the step */
|
|
22
|
+
header: React.ReactNode;
|
|
23
|
+
/** Error text to display as a badge in the header */
|
|
24
|
+
errorText?: React.ReactNode;
|
|
25
|
+
/** If the step is expanded */
|
|
26
|
+
open?: boolean;
|
|
27
|
+
/** Click handler for the step header */
|
|
28
|
+
onStepClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
27
29
|
}
|
|
30
|
+
declare const AccordionStep: React.ForwardRefExoticComponent<AccordionStepProps & {
|
|
31
|
+
children?: React.ReactNode | undefined;
|
|
32
|
+
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
28
33
|
export default AccordionStep;
|
|
29
|
-
type AccordionStepProps = PropTypes.InferProps<typeof AccordionStep.propTypes> & {
|
|
30
|
-
open?: boolean;
|
|
31
|
-
completed: boolean;
|
|
32
|
-
onStepClick?: () => void;
|
|
33
|
-
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
-
import { useState, useId } from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { css } from '@emotion/react';
|
|
2
|
+
import React, { useState, useId, useRef, useEffect } from 'react';
|
|
5
3
|
import styled from '@emotion/styled';
|
|
6
4
|
import { getThemeValue, THEME_NAME } from '../../shared/constants.js';
|
|
7
5
|
import { Ellipsis } from '../../shared/styles.js';
|
|
@@ -10,43 +8,60 @@ import Badge, { BADGE_TYPE } from '../Badge/Badge.js';
|
|
|
10
8
|
import ExpandMore from '../../icons/ExpandMore.js';
|
|
11
9
|
import Card from '../Card/Card.js';
|
|
12
10
|
|
|
13
|
-
const Step = /*#__PURE__*/ styled(Card, {
|
|
14
|
-
target: "
|
|
11
|
+
const Step$1 = /*#__PURE__*/ styled(Card, {
|
|
12
|
+
target: "e1l2mhfb0",
|
|
15
13
|
label: "Step"
|
|
16
14
|
})("transition:all 0.6s ease;overflow:visible;", (props)=>props.open && `margin: 20px 5px;`);
|
|
17
15
|
const StepHeader = /*#__PURE__*/ styled("button", {
|
|
18
|
-
target: "
|
|
16
|
+
target: "e1l2mhfb1",
|
|
19
17
|
label: "StepHeader"
|
|
20
|
-
})("padding:20px 15px;display:flex;justify-content:space-between;background:none;border:none;border-radius:10px;width:100%;font-size:inherit;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:focus-visible{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}& input{appearance:none;margin:0;}", (props)=>props.open && `border-bottom: 1px solid ${getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR)};`, " ", (props)=>props.disabled && `color: ${getThemeValue(THEME_NAME.DISABLED)};`);
|
|
18
|
+
})("padding:20px 15px;display:flex;justify-content:space-between;background:none;border:none;border-radius:10px;width:100%;font-size:inherit;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:focus-visible{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}& input{appearance:none;margin:0;}", (props)=>props.open && `border-bottom: 1px solid ${getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR)};`, " ", (props)=>props.open && `border-radius: 10px 10px 0 0;`, " ", (props)=>props.disabled && `color: ${getThemeValue(THEME_NAME.DISABLED)};`);
|
|
21
19
|
const HeaderContainer = /*#__PURE__*/ styled("div", {
|
|
22
|
-
target: "
|
|
20
|
+
target: "e1l2mhfb2",
|
|
23
21
|
label: "HeaderContainer"
|
|
24
22
|
})("display:flex;align-items:center;min-width:40px;& svg{vertical-align:top;margin-right:10px;fill:", (props)=>props.open ? getThemeValue(THEME_NAME.PRIMARY) : props.completed ? getThemeValue(THEME_NAME.SUCCESS) : getThemeValue(THEME_NAME.LIGHT_GREY), ";transform:", (props)=>props.open ? 'scale(0.8)' : 'scale(0.6)', ";transition:all 0.3s ease;min-width:24px;}");
|
|
25
23
|
const ExpandContainer = /*#__PURE__*/ styled("div", {
|
|
26
|
-
target: "
|
|
24
|
+
target: "e1l2mhfb3",
|
|
27
25
|
label: "ExpandContainer"
|
|
28
26
|
})("display:flex;align-items:center;& svg{vertical-align:top;margin-right:10px;transition:all 0.6s ease;fill:currentColor;}", (props)=>props.open ? `& svg { transform: rotate(180deg); }` : '');
|
|
29
27
|
const StepBody = /*#__PURE__*/ styled("div", {
|
|
30
|
-
target: "
|
|
28
|
+
target: "e1l2mhfb4",
|
|
31
29
|
label: "StepBody"
|
|
32
30
|
})("transition:all 0.6s ease;overflow:hidden;height:", (props)=>props.height || 0, "px;");
|
|
31
|
+
const AccordionBadge = /*#__PURE__*/ styled(Badge, {
|
|
32
|
+
target: "e1l2mhfb5",
|
|
33
|
+
label: "AccordionBadge"
|
|
34
|
+
})("margin-right:15px;");
|
|
33
35
|
const AccordionStepBody = /*#__PURE__*/ styled("div", {
|
|
34
|
-
target: "
|
|
36
|
+
target: "e1l2mhfb6",
|
|
35
37
|
label: "AccordionStepBody"
|
|
36
38
|
})("padding:20px 15px;");
|
|
37
39
|
const AccordionStepFooter = /*#__PURE__*/ styled("div", {
|
|
38
|
-
target: "
|
|
40
|
+
target: "e1l2mhfb7",
|
|
39
41
|
label: "AccordionStepFooter"
|
|
40
42
|
})("display:flex;justify-content:flex-end;padding:10px 15px;border-top:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";");
|
|
41
|
-
|
|
43
|
+
/**
|
|
44
|
+
* AccordionStep Component
|
|
45
|
+
* @param props - Component props
|
|
46
|
+
* @param ref - Ref forwarded to the underlying HTMLDivElement
|
|
47
|
+
*/ function AccordionStepComponent(props, ref) {
|
|
42
48
|
const [height, setHeight] = useState(0);
|
|
43
|
-
const { open, disabled, header, errorText, completed, onStepClick, children, ...restProps } = props;
|
|
49
|
+
const { open, disabled = false, header, errorText, completed = false, onStepClick, children, ...restProps } = props;
|
|
44
50
|
// Generate unique IDs for ARIA relationships
|
|
45
51
|
const headerId = useId();
|
|
46
52
|
const regionId = useId();
|
|
47
|
-
const
|
|
48
|
-
|
|
53
|
+
const contentRef = useRef(null);
|
|
54
|
+
// Measure content height when `open` or children change.
|
|
55
|
+
useEffect(()=>{
|
|
56
|
+
const el = contentRef.current;
|
|
57
|
+
setHeight(el?.scrollHeight || 0);
|
|
58
|
+
}, [
|
|
59
|
+
open,
|
|
60
|
+
children
|
|
61
|
+
]);
|
|
62
|
+
return /*#__PURE__*/ jsxs(Step$1, {
|
|
49
63
|
...restProps,
|
|
64
|
+
ref: ref,
|
|
50
65
|
open: open,
|
|
51
66
|
elevated: open,
|
|
52
67
|
completed: completed,
|
|
@@ -74,8 +89,7 @@ function AccordionStep(props) {
|
|
|
74
89
|
/*#__PURE__*/ jsxs(ExpandContainer, {
|
|
75
90
|
open: open,
|
|
76
91
|
children: [
|
|
77
|
-
errorText && /*#__PURE__*/ jsx(
|
|
78
|
-
css: /*#__PURE__*/ css("margin-right:15px;", "ref"),
|
|
92
|
+
errorText && /*#__PURE__*/ jsx(AccordionBadge, {
|
|
79
93
|
inline: true,
|
|
80
94
|
type: BADGE_TYPE.DANGER,
|
|
81
95
|
children: errorText
|
|
@@ -88,7 +102,7 @@ function AccordionStep(props) {
|
|
|
88
102
|
]
|
|
89
103
|
}),
|
|
90
104
|
/*#__PURE__*/ jsx(StepBody, {
|
|
91
|
-
ref:
|
|
105
|
+
ref: contentRef,
|
|
92
106
|
height: open ? height : 0,
|
|
93
107
|
role: "region",
|
|
94
108
|
id: regionId,
|
|
@@ -99,16 +113,7 @@ function AccordionStep(props) {
|
|
|
99
113
|
]
|
|
100
114
|
});
|
|
101
115
|
}
|
|
102
|
-
AccordionStep
|
|
103
|
-
/** Header text for the step */ header: PropTypes.string.isRequired,
|
|
104
|
-
/** Error text for the step */ errorText: PropTypes.string,
|
|
105
|
-
/** If steps has been marked as completed */ completed: PropTypes.bool,
|
|
106
|
-
/** If the step is disabled */ disabled: PropTypes.bool
|
|
107
|
-
};
|
|
108
|
-
AccordionStep.defaultProps = {
|
|
109
|
-
completed: false,
|
|
110
|
-
disabled: false
|
|
111
|
-
};
|
|
116
|
+
const AccordionStep = /*#__PURE__*/ React.forwardRef(AccordionStepComponent);
|
|
112
117
|
|
|
113
118
|
export { AccordionStepBody, AccordionStepFooter, AccordionStep as default };
|
|
114
119
|
//# sourceMappingURL=AccordionStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionStep.js","sources":["../../../src/components/Accordion/AccordionStep.tsx"],"sourcesContent":["import React, { useState, useId
|
|
1
|
+
{"version":3,"file":"AccordionStep.js","sources":["../../../src/components/Accordion/AccordionStep.tsx"],"sourcesContent":["import React, { useState, useId, useRef, useEffect } from 'react';\nimport styled from '@emotion/styled';\nimport { FiberManualRecord, ExpandMore } from '../../icons';\nimport { THEME_NAME, getThemeValue } from '../../shared/constants';\nimport { Ellipsis } from '../../shared/styles';\nimport { Badge, BADGE_TYPE } from '../Badge';\nimport { Card } from '../Card';\n\nconst Step = styled(Card)<{ open?: boolean; completed?: boolean }>`\n transition: all 0.6s ease;\n overflow: visible;\n\n ${(props) => props.open && `margin: 20px 5px;`}\n`;\n\nconst StepHeader = styled.button<{ open?: boolean; disabled?: boolean }>`\n padding: 20px 15px;\n display: flex;\n justify-content: space-between;\n background: none;\n border: none;\n border-radius: 10px;\n width: 100%;\n font-size: inherit;\n color: ${getThemeValue(THEME_NAME.TEXT_COLOR_DARK)};\n\n &:focus-visible {\n box-shadow: 0 0 0 4px ${getThemeValue(THEME_NAME.PRIMARY_LIGHT)};\n }\n\n & input {\n appearance: none;\n margin: 0;\n }\n\n ${(props) =>\n props.open && `border-bottom: 1px solid ${getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR)};`}\n ${(props) => props.open && `border-radius: 10px 10px 0 0;`}\n\n ${(props) => props.disabled && `color: ${getThemeValue(THEME_NAME.DISABLED)};`}\n`;\n\nconst HeaderContainer = styled.div<{ open?: boolean; completed?: boolean }>`\n display: flex;\n align-items: center;\n min-width: 40px;\n\n & svg {\n vertical-align: top;\n margin-right: 10px;\n fill: ${(props) =>\n props.open\n ? getThemeValue(THEME_NAME.PRIMARY)\n : props.completed\n ? getThemeValue(THEME_NAME.SUCCESS)\n : getThemeValue(THEME_NAME.LIGHT_GREY)};\n transform: ${(props) => (props.open ? 'scale(0.8)' : 'scale(0.6)')};\n transition: all 0.3s ease;\n min-width: 24px;\n }\n`;\n\nconst ExpandContainer = styled.div<{ open?: boolean }>`\n display: flex;\n align-items: center;\n\n & svg {\n vertical-align: top;\n margin-right: 10px;\n transition: all 0.6s ease;\n fill: currentColor;\n }\n\n ${(props) => (props.open ? `& svg { transform: rotate(180deg); }` : '')}\n`;\n\nconst StepBody = styled.div<{ height: number }>`\n transition: all 0.6s ease;\n overflow: hidden;\n height: ${(props) => props.height || 0}px;\n`;\n\nconst AccordionBadge = styled(Badge)`\n margin-right: 15px;\n`;\n\nexport const AccordionStepBody = styled.div`\n padding: 20px 15px;\n`;\n\nexport const AccordionStepFooter = styled.div`\n display: flex;\n justify-content: flex-end;\n padding: 10px 15px;\n border-top: 1px solid ${getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR)};\n`;\n\n/** Props for `AccordionStep` component */\ninterface AccordionStepProps {\n /**\n * If the step has been marked as completed\n * @default false\n */\n completed?: boolean;\n /** If the step is disabled\n * @default false\n */\n disabled?: boolean;\n /** Header content for the step */\n header: React.ReactNode;\n /** Error text to display as a badge in the header */\n errorText?: React.ReactNode;\n /** If the step is expanded */\n open?: boolean;\n /** Click handler for the step header */\n onStepClick?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\n/**\n * AccordionStep Component\n * @param props - Component props\n * @param ref - Ref forwarded to the underlying HTMLDivElement\n */\nfunction AccordionStepComponent(\n props: React.PropsWithChildren<AccordionStepProps> & React.HTMLAttributes<HTMLDivElement>,\n ref: React.Ref<HTMLDivElement>,\n) {\n const [height, setHeight] = useState(0);\n const {\n open,\n disabled = false,\n header,\n errorText,\n completed = false,\n onStepClick,\n children,\n ...restProps\n } = props;\n\n // Generate unique IDs for ARIA relationships\n const headerId = useId();\n const regionId = useId();\n\n const contentRef = useRef<HTMLDivElement | null>(null);\n\n // Measure content height when `open` or children change.\n useEffect(() => {\n const el = contentRef.current;\n setHeight(el?.scrollHeight || 0);\n }, [open, children]);\n\n return (\n <Step {...restProps} ref={ref} open={open} elevated={open} completed={completed}>\n <StepHeader\n open={open}\n disabled={disabled}\n onClick={onStepClick}\n aria-expanded={open ? 'true' : 'false'}\n aria-controls={regionId}\n id={headerId}\n >\n <HeaderContainer open={open} completed={completed}>\n <FiberManualRecord aria-hidden=\"true\" />\n <Ellipsis>{header}</Ellipsis>\n </HeaderContainer>\n <ExpandContainer open={open}>\n {errorText && (\n <AccordionBadge inline type={BADGE_TYPE.DANGER}>\n {errorText}\n </AccordionBadge>\n )}\n <ExpandMore aria-hidden=\"true\" />\n </ExpandContainer>\n </StepHeader>\n <StepBody\n ref={contentRef}\n height={open ? height : 0}\n role=\"region\"\n id={regionId}\n aria-labelledby={headerId}\n aria-hidden={open ? 'false' : 'true'}\n >\n {open && children}\n </StepBody>\n </Step>\n );\n}\n\nconst AccordionStep = React.forwardRef<\n HTMLDivElement,\n React.PropsWithChildren<AccordionStepProps> & React.HTMLAttributes<HTMLDivElement>\n>(AccordionStepComponent);\n\nexport default AccordionStep;\n"],"names":["Step","styled","Card","props","open","StepHeader","getThemeValue","THEME_NAME","TEXT_COLOR_DARK","PRIMARY_LIGHT","BORDER_LIGHT_COLOR","disabled","DISABLED","HeaderContainer","PRIMARY","completed","SUCCESS","LIGHT_GREY","ExpandContainer","StepBody","height","AccordionBadge","Badge","AccordionStepBody","AccordionStepFooter","AccordionStepComponent","ref","setHeight","useState","header","errorText","onStepClick","children","restProps","headerId","useId","regionId","contentRef","useRef","useEffect","el","current","scrollHeight","_jsxs","elevated","onClick","aria-expanded","aria-controls","id","_jsx","FiberManualRecord","aria-hidden","Ellipsis","inline","type","BADGE_TYPE","DANGER","ExpandMore","role","aria-labelledby","AccordionStep","React","forwardRef"],"mappings":"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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
export declare enum BADGE_TYPE {
|
|
4
3
|
PRIMARY = "primary",
|
|
5
4
|
SUCCESS = "success",
|
|
@@ -7,19 +6,17 @@ export declare enum BADGE_TYPE {
|
|
|
7
6
|
DANGER = "danger",
|
|
8
7
|
DISABLED = "disabled"
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
}
|
|
9
|
+
declare const Badge: React.ForwardRefExoticComponent<{
|
|
10
|
+
/**
|
|
11
|
+
* Display badge inline or overlay on parent component
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
inline?: boolean;
|
|
15
|
+
/** Type of badge
|
|
16
|
+
* @default BADGE_TYPE.PRIMARY
|
|
17
|
+
*/
|
|
18
|
+
type?: BADGE_TYPE;
|
|
19
|
+
} & React.HTMLAttributes<HTMLSpanElement> & {
|
|
20
|
+
children?: React.ReactNode | undefined;
|
|
21
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
25
22
|
export default Badge;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
-
import 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import styled from '@emotion/styled';
|
|
5
4
|
import { getThemeValue, THEME_NAME } from '../../shared/constants.js';
|
|
6
5
|
|
|
@@ -13,7 +12,7 @@ var BADGE_TYPE = /*#__PURE__*/ function(BADGE_TYPE) {
|
|
|
13
12
|
return BADGE_TYPE;
|
|
14
13
|
}({});
|
|
15
14
|
const BadgeSpan = /*#__PURE__*/ styled("span", {
|
|
16
|
-
target: "
|
|
15
|
+
target: "e1aaenck0",
|
|
17
16
|
label: "BadgeSpan"
|
|
18
17
|
})("background-color:", (props)=>{
|
|
19
18
|
switch(props.type){
|
|
@@ -29,26 +28,17 @@ const BadgeSpan = /*#__PURE__*/ styled("span", {
|
|
|
29
28
|
return getThemeValue(THEME_NAME.PRIMARY);
|
|
30
29
|
}
|
|
31
30
|
}, ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-radius:10px;padding:", (props)=>props.children ? '3px 10px' : '4px', ";display:inline-block;min-height:4px;min-width:4px;font-size:12px;margin:", (props)=>props.inline ? '0 5px' : '0', ";", (props)=>!props.inline && 'position: absolute; top: 0; right: 0; transform: translate(50%, -50%);', ";");
|
|
32
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Badge Component
|
|
33
|
+
* @param props - Component props
|
|
34
|
+
* @param ref - Ref forwarded to the underlying HTMLSpanElement
|
|
35
|
+
*/ function BadgeComponent(props, ref) {
|
|
33
36
|
return /*#__PURE__*/ jsx(BadgeSpan, {
|
|
34
|
-
...props
|
|
37
|
+
...props,
|
|
38
|
+
ref: ref
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
|
-
Badge
|
|
38
|
-
/** Display badge inline or overlay on parent component */ inline: PropTypes.bool,
|
|
39
|
-
/** Type of badge */ type: PropTypes.oneOf([
|
|
40
|
-
"primary",
|
|
41
|
-
"success",
|
|
42
|
-
"warning",
|
|
43
|
-
"danger",
|
|
44
|
-
"disabled"
|
|
45
|
-
]),
|
|
46
|
-
css: PropTypes.any
|
|
47
|
-
};
|
|
48
|
-
Badge.defaultProps = {
|
|
49
|
-
inline: false,
|
|
50
|
-
type: "primary"
|
|
51
|
-
};
|
|
41
|
+
const Badge = /*#__PURE__*/ React.forwardRef(BadgeComponent);
|
|
52
42
|
|
|
53
43
|
export { BADGE_TYPE, Badge as default };
|
|
54
44
|
//# sourceMappingURL=Badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"Badge.js","sources":["../../../src/components/Badge/Badge.tsx"],"sourcesContent":["import React from 'react';\nimport styled from '@emotion/styled';\nimport { THEME_NAME, getThemeValue } from '../../shared/constants';\n\nexport enum BADGE_TYPE {\n PRIMARY = 'primary',\n SUCCESS = 'success',\n WARNING = 'warning',\n DANGER = 'danger',\n DISABLED = 'disabled',\n}\n\nconst BadgeSpan = styled.span<BadgeProps>`\n background-color: ${(props) => {\n switch (props.type) {\n case BADGE_TYPE.SUCCESS:\n return getThemeValue(THEME_NAME.SUCCESS);\n\n case BADGE_TYPE.WARNING:\n return getThemeValue(THEME_NAME.WARNING);\n\n case BADGE_TYPE.DANGER:\n return getThemeValue(THEME_NAME.ERROR);\n\n case BADGE_TYPE.DISABLED:\n return getThemeValue(THEME_NAME.DISABLED);\n\n default:\n return getThemeValue(THEME_NAME.PRIMARY);\n }\n }};\n color: ${getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT)};\n border-radius: 10px;\n padding: ${(props) => (props.children ? '3px 10px' : '4px')};\n display: inline-block;\n min-height: 4px;\n min-width: 4px;\n font-size: 12px;\n margin: ${(props) => (props.inline ? '0 5px' : '0')};\n\n ${(props) =>\n !props.inline && 'position: absolute; top: 0; right: 0; transform: translate(50%, -50%);'};\n`;\n\ntype BadgeProps = {\n /**\n * Display badge inline or overlay on parent component\n * @default false\n */\n inline?: boolean;\n /** Type of badge\n * @default BADGE_TYPE.PRIMARY\n */\n type?: BADGE_TYPE;\n} & React.HTMLAttributes<HTMLSpanElement>;\n\n/**\n * Badge Component\n * @param props - Component props\n * @param ref - Ref forwarded to the underlying HTMLSpanElement\n */\nfunction BadgeComponent(props: BadgeProps, ref: React.Ref<HTMLSpanElement>) {\n return <BadgeSpan {...props} ref={ref} />;\n}\n\nconst Badge = React.forwardRef<HTMLSpanElement, React.PropsWithChildren<BadgeProps>>(\n BadgeComponent,\n);\n\nexport default Badge;\n"],"names":["BADGE_TYPE","BadgeSpan","styled","props","type","getThemeValue","THEME_NAME","SUCCESS","WARNING","ERROR","DISABLED","PRIMARY","TEXT_COLOR_LIGHT","children","inline","BadgeComponent","ref","_jsx","Badge","React","forwardRef"],"mappings":";;;;;AAIO,IAAA,UAAKA,iBAAAA,SAAAA,UAAAA,EAAAA;;;;;;AAAAA,IAAAA,OAAAA,UAAAA;AAMX,CAAA,CAAA,EAAA;AAED,MAAMC,SAAAA,iBAAYC,MAAAA,CAAAA,MAAAA,EAAAA;;;wBACM,CAACC,KAAAA,GAAAA;AACjB,IAAA,OAAQA,MAAMC,IAAI;AACd,QAAA,KAAA,SAAA;YACI,OAAOC,aAAAA,CAAcC,WAAWC,OAAO,CAAA;AAE3C,QAAA,KAAA,SAAA;YACI,OAAOF,aAAAA,CAAcC,WAAWE,OAAO,CAAA;AAE3C,QAAA,KAAA,QAAA;YACI,OAAOH,aAAAA,CAAcC,WAAWG,KAAK,CAAA;AAEzC,QAAA,KAAA,UAAA;YACI,OAAOJ,aAAAA,CAAcC,WAAWI,QAAQ,CAAA;AAE5C,QAAA;YACI,OAAOL,aAAAA,CAAcC,WAAWK,OAAO,CAAA;AAC/C;AACJ,CAAA,EAAA,SAAA,EACSN,aAAAA,CAAcC,WAAWM,gBAAgB,CAAA,EAAA,8BAAA,EAEvC,CAACT,KAAAA,GAAWA,KAAAA,CAAMU,QAAQ,GAAG,UAAA,GAAa,KAAA,EAAA,2EAAA,EAK3C,CAACV,KAAAA,GAAWA,KAAAA,CAAMW,MAAM,GAAG,OAAA,GAAU,GAAA,EAAA,GAAA,EAE7C,CAACX,KAAAA,GACC,CAACA,KAAAA,CAAMW,MAAM,IAAI,wEAAA,EAAA,GAAA,CAAA;AAezB;;;;AAIC,IACD,SAASC,cAAAA,CAAeZ,KAAiB,EAAEa,GAA+B,EAAA;AACtE,IAAA,qBAAOC,GAAA,CAAChB,SAAAA,EAAAA;AAAW,QAAA,GAAGE,KAAK;QAAEa,GAAAA,EAAKA;;AACtC;AAEA,MAAME,KAAAA,iBAAQC,KAAAA,CAAMC,UAAU,CAC1BL,cAAAA;;;;"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const ActionButton: React.ForwardRefExoticComponent<{
|
|
3
|
+
/**
|
|
4
|
+
* Type of Action Button
|
|
5
|
+
* @default 'button'
|
|
6
|
+
*/
|
|
7
|
+
type?: "button" | "submit" | "reset";
|
|
8
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export default ActionButton;
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import styled from '@emotion/styled';
|
|
2
4
|
import { getThemeValue, THEME_NAME } from '../../shared/constants.js';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
target: "
|
|
6
|
-
label: ""
|
|
6
|
+
const StyledActionButton = /*#__PURE__*/ styled("button", {
|
|
7
|
+
target: "ec49rx60",
|
|
8
|
+
label: "StyledActionButton"
|
|
7
9
|
})("border:1px solid ", getThemeValue(THEME_NAME.PRIMARY), ";background-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";border-radius:5px;height:32px;min-width:100px;font-size:14px;text-align:center;padding:0 12px;cursor:pointer;margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;fill:currentColor;margin-left:-6px;}&:enabled:hover{box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";}&:focus{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{border:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}");
|
|
10
|
+
/**
|
|
11
|
+
* ActionButton Component
|
|
12
|
+
* @param props - Component props
|
|
13
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
14
|
+
*/ function ActionButtonComponent(props, ref) {
|
|
15
|
+
const { type = 'button', ...rest } = props;
|
|
16
|
+
return /*#__PURE__*/ jsx(StyledActionButton, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
type: type,
|
|
19
|
+
...rest
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const ActionButton = /*#__PURE__*/ React.forwardRef(ActionButtonComponent);
|
|
8
23
|
|
|
9
24
|
export { ActionButton as default };
|
|
10
25
|
//# sourceMappingURL=ActionButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.js","sources":["../../../src/components/Button/ActionButton.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { THEME_NAME, getThemeValue } from '../../shared/constants';\n\
|
|
1
|
+
{"version":3,"file":"ActionButton.js","sources":["../../../src/components/Button/ActionButton.tsx"],"sourcesContent":["import React from 'react';\nimport styled from '@emotion/styled';\nimport { THEME_NAME, getThemeValue } from '../../shared/constants';\n\nconst StyledActionButton = styled.button`\n border: 1px solid ${getThemeValue(THEME_NAME.PRIMARY)};\n background-color: ${getThemeValue(THEME_NAME.PRIMARY)};\n color: ${getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT)};\n border-radius: 5px;\n height: 32px;\n min-width: 100px;\n font-size: 14px;\n text-align: center;\n padding: 0 12px;\n cursor: pointer;\n margin: 5px;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n & svg {\n vertical-align: middle;\n height: 24px;\n width: 24px;\n fill: currentColor;\n margin-left: -6px;\n }\n\n &:enabled:hover {\n box-shadow: ${getThemeValue(THEME_NAME.HOVER_SHADOW)};\n }\n\n &:focus {\n box-shadow: 0 0 0 4px ${getThemeValue(THEME_NAME.PRIMARY_LIGHT)};\n }\n\n &:disabled {\n border: 1px solid ${getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR)};\n background-color: ${getThemeValue(THEME_NAME.DISABLED_BACKGROUND)};\n color: ${getThemeValue(THEME_NAME.DISABLED)};\n }\n`;\n\ntype ActionButtonProps = {\n /**\n * Type of Action Button\n * @default 'button'\n */\n type?: 'button' | 'submit' | 'reset';\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * ActionButton Component\n * @param props - Component props\n * @param ref - Ref forwarded to the underlying HTMLButtonElement\n */\nfunction ActionButtonComponent(props: ActionButtonProps, ref: React.Ref<HTMLButtonElement>) {\n const { type = 'button', ...rest } = props;\n\n return <StyledActionButton ref={ref} type={type} {...rest} />;\n}\n\nconst ActionButton = React.forwardRef<HTMLButtonElement, ActionButtonProps>(ActionButtonComponent);\n\nexport default ActionButton;\n"],"names":["StyledActionButton","styled","getThemeValue","THEME_NAME","PRIMARY","TEXT_COLOR_LIGHT","HOVER_SHADOW","PRIMARY_LIGHT","BORDER_LIGHT_COLOR","DISABLED_BACKGROUND","DISABLED","ActionButtonComponent","props","ref","type","rest","_jsx","ActionButton","React","forwardRef"],"mappings":";;;;;AAIA,MAAMA,kBAAAA,iBAAqBC,MAAAA,CAAAA,QAAAA,EAAAA;;;AACHC,CAAAA,CAAAA,CAAAA,mBAAAA,EAAAA,aAAAA,CAAcC,UAAAA,CAAWC,OAAO,CAAA,EAAA,oBAAA,EAChCF,aAAAA,CAAcC,UAAAA,CAAWC,OAAO,CAAA,EAAA,SAAA,EAC3CF,aAAAA,CAAcC,UAAAA,CAAWE,gBAAgB,CAAA,EAAA,6TAAA,EAuBhCH,aAAAA,CAAcC,UAAAA,CAAWG,YAAY,CAAA,EAAA,iCAAA,EAI3BJ,aAAAA,CAAcC,UAAAA,CAAWI,aAAa,CAAA,EAAA,gCAAA,EAI1CL,aAAAA,CAAcC,UAAAA,CAAWK,kBAAkB,CAAA,EAAA,oBAAA,EAC3CN,aAAAA,CAAcC,UAAAA,CAAWM,mBAAmB,CAAA,EAAA,SAAA,EACvDP,aAAAA,CAAcC,WAAWO,QAAQ,CAAA,EAAA,IAAA,CAAA;AAYlD;;;;AAIC,IACD,SAASC,qBAAAA,CAAsBC,KAAwB,EAAEC,GAAiC,EAAA;AACtF,IAAA,MAAM,EAAEC,IAAAA,GAAO,QAAQ,EAAE,GAAGC,MAAM,GAAGH,KAAAA;AAErC,IAAA,qBAAOI,GAAA,CAAChB,kBAAAA,EAAAA;QAAmBa,GAAAA,EAAKA,GAAAA;QAAKC,IAAAA,EAAMA,IAAAA;AAAO,QAAA,GAAGC;;AACzD;AAEA,MAAME,YAAAA,iBAAeC,KAAAA,CAAMC,UAAU,CAAuCR,qBAAAA;;;;"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const Button: React.ForwardRefExoticComponent<{
|
|
3
|
+
/**
|
|
4
|
+
* Type of Button
|
|
5
|
+
* @default 'button'
|
|
6
|
+
*/
|
|
7
|
+
type?: "button" | "submit" | "reset";
|
|
8
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export default Button;
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import styled from '@emotion/styled';
|
|
2
4
|
import { getThemeValue, THEME_NAME } from '../../shared/constants.js';
|
|
3
5
|
|
|
4
6
|
const StyledButton = /*#__PURE__*/ styled("button", {
|
|
5
|
-
target: "
|
|
7
|
+
target: "e123477w0",
|
|
6
8
|
label: "StyledButton"
|
|
7
9
|
})("border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:5px;height:32px;min-width:100px;font-size:14px;text-align:center;padding:0 12px;cursor:pointer;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;margin-left:-6px;fill:currentColor;}&:enabled:hover{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:focus{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{background-color:", getThemeValue(THEME_NAME.DISABLED_BACKGROUND), ";border-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Button Component
|
|
12
|
+
* @param props - Component props
|
|
13
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
14
|
+
*/ function ButtonComponent(props, ref) {
|
|
15
|
+
const { type = 'button', ...rest } = props;
|
|
16
|
+
return /*#__PURE__*/ jsx(StyledButton, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
type: type,
|
|
19
|
+
...rest
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const Button$2 = /*#__PURE__*/ React.forwardRef(ButtonComponent);
|
|
11
23
|
|
|
12
|
-
export {
|
|
24
|
+
export { Button$2 as default };
|
|
13
25
|
//# sourceMappingURL=Button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { getThemeValue, THEME_NAME } from '../../shared/constants';\n\nconst StyledButton = styled.button`\n border: 1px solid ${getThemeValue(THEME_NAME.BORDER_COLOR)};\n border-radius: 5px;\n height: 32px;\n min-width: 100px;\n font-size: 14px;\n text-align: center;\n padding: 0 12px;\n cursor: pointer;\n color: ${getThemeValue(THEME_NAME.TEXT_COLOR_DARK)};\n background-color: ${getThemeValue(THEME_NAME.BACKGROUND)};\n margin: 5px;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n & svg {\n vertical-align: middle;\n height: 24px;\n width: 24px;\n margin-left: -6px;\n fill: currentColor;\n }\n\n &:enabled:hover {\n border-color: ${getThemeValue(THEME_NAME.PRIMARY)};\n color: ${getThemeValue(THEME_NAME.PRIMARY)};\n }\n\n &:focus {\n border-color: ${getThemeValue(THEME_NAME.PRIMARY)};\n box-shadow: 0 0 0 4px ${getThemeValue(THEME_NAME.PRIMARY_LIGHT)};\n }\n\n &:disabled {\n background-color: ${getThemeValue(THEME_NAME.DISABLED_BACKGROUND)};\n border-color: ${getThemeValue(THEME_NAME.LIGHT_GREY)};\n color: ${getThemeValue(THEME_NAME.DISABLED)};\n }\n`;\n\
|
|
1
|
+
{"version":3,"file":"Button.js","sources":["../../../src/components/Button/Button.tsx"],"sourcesContent":["import React from 'react';\nimport styled from '@emotion/styled';\nimport { getThemeValue, THEME_NAME } from '../../shared/constants';\n\nconst StyledButton = styled.button`\n border: 1px solid ${getThemeValue(THEME_NAME.BORDER_COLOR)};\n border-radius: 5px;\n height: 32px;\n min-width: 100px;\n font-size: 14px;\n text-align: center;\n padding: 0 12px;\n cursor: pointer;\n color: ${getThemeValue(THEME_NAME.TEXT_COLOR_DARK)};\n background-color: ${getThemeValue(THEME_NAME.BACKGROUND)};\n margin: 5px;\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n\n & svg {\n vertical-align: middle;\n height: 24px;\n width: 24px;\n margin-left: -6px;\n fill: currentColor;\n }\n\n &:enabled:hover {\n border-color: ${getThemeValue(THEME_NAME.PRIMARY)};\n color: ${getThemeValue(THEME_NAME.PRIMARY)};\n }\n\n &:focus {\n border-color: ${getThemeValue(THEME_NAME.PRIMARY)};\n box-shadow: 0 0 0 4px ${getThemeValue(THEME_NAME.PRIMARY_LIGHT)};\n }\n\n &:disabled {\n background-color: ${getThemeValue(THEME_NAME.DISABLED_BACKGROUND)};\n border-color: ${getThemeValue(THEME_NAME.LIGHT_GREY)};\n color: ${getThemeValue(THEME_NAME.DISABLED)};\n }\n`;\n\ntype ButtonProps = {\n /**\n * Type of Button\n * @default 'button'\n */\n type?: 'button' | 'submit' | 'reset';\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\n/**\n * Button Component\n * @param props - Component props\n * @param ref - Ref forwarded to the underlying HTMLButtonElement\n */\nfunction ButtonComponent(props: ButtonProps, ref: React.Ref<HTMLButtonElement>) {\n const { type = 'button', ...rest } = props;\n\n return <StyledButton ref={ref} type={type} {...rest} />;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(ButtonComponent);\n\nexport default Button;\n"],"names":["StyledButton","styled","getThemeValue","THEME_NAME","BORDER_COLOR","TEXT_COLOR_DARK","BACKGROUND","PRIMARY","PRIMARY_LIGHT","DISABLED_BACKGROUND","LIGHT_GREY","DISABLED","ButtonComponent","props","ref","type","rest","_jsx","Button","React","forwardRef"],"mappings":";;;;;AAIA,MAAMA,YAAAA,iBAAeC,MAAAA,CAAAA,QAAAA,EAAAA;;;AACGC,CAAAA,CAAAA,CAAAA,mBAAAA,EAAAA,aAAAA,CAAcC,WAAWC,YAAY,CAAA,EAAA,sHAAA,EAQhDF,aAAAA,CAAcC,UAAAA,CAAWE,eAAe,CAAA,EAAA,oBAAA,EAC7BH,aAAAA,CAAcC,UAAAA,CAAWG,UAAU,uNAgBnCJ,aAAAA,CAAcC,UAAAA,CAAWI,OAAO,CAAA,EAAA,SAAA,EACvCL,cAAcC,UAAAA,CAAWI,OAAO,CAAA,EAAA,yBAAA,EAIzBL,aAAAA,CAAcC,WAAWI,OAAO,CAAA,EAAA,wBAAA,EACxBL,aAAAA,CAAcC,UAAAA,CAAWK,aAAa,CAAA,EAAA,gCAAA,EAI1CN,aAAAA,CAAcC,UAAAA,CAAWM,mBAAmB,qBAChDP,aAAAA,CAAcC,UAAAA,CAAWO,UAAU,CAAA,EAAA,SAAA,EAC1CR,aAAAA,CAAcC,WAAWQ,QAAQ,CAAA,EAAA,IAAA,CAAA;AAYlD;;;;AAIC,IACD,SAASC,eAAAA,CAAgBC,KAAkB,EAAEC,GAAiC,EAAA;AAC1E,IAAA,MAAM,EAAEC,IAAAA,GAAO,QAAQ,EAAE,GAAGC,MAAM,GAAGH,KAAAA;AAErC,IAAA,qBAAOI,GAAA,CAACjB,YAAAA,EAAAA;QAAac,GAAAA,EAAKA,GAAAA;QAAKC,IAAAA,EAAMA,IAAAA;AAAO,QAAA,GAAGC;;AACnD;AAEA,MAAME,QAAAA,iBAASC,KAAAA,CAAMC,UAAU,CAAiCR,eAAAA;;;;"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const IconButton: React.ForwardRefExoticComponent<{
|
|
3
|
+
/**
|
|
4
|
+
* Type of Icon Button
|
|
5
|
+
* @default 'button'
|
|
6
|
+
*/
|
|
7
|
+
type?: "button" | "submit" | "reset";
|
|
8
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export default IconButton;
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
+
import { jsx } from '@emotion/react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import styled from '@emotion/styled';
|
|
2
4
|
import { getThemeValue, THEME_NAME } from '../../shared/constants.js';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
target: "
|
|
6
|
-
label: ""
|
|
6
|
+
const StyledIconButton = /*#__PURE__*/ styled("button", {
|
|
7
|
+
target: "efmjh6j0",
|
|
8
|
+
label: "StyledIconButton"
|
|
7
9
|
})("border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:5px;height:32px;font-size:14px;text-align:center;padding:0 3px;cursor:pointer;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";margin:5px;position:relative;display:inline-flex;align-items:center;justify-content:center;& svg{vertical-align:middle;height:24px;width:24px;fill:currentColor;}&:enabled:hover{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";color:", getThemeValue(THEME_NAME.PRIMARY), ";}&:focus{border-color:", getThemeValue(THEME_NAME.PRIMARY), ";box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}&:disabled{background-color:", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";border-color:", getThemeValue(THEME_NAME.LIGHT_GREY), ";color:", getThemeValue(THEME_NAME.DISABLED), ";}&:disabled > svg{fill:", getThemeValue(THEME_NAME.DISABLED), ";}");
|
|
10
|
+
/**
|
|
11
|
+
* IconButton Component
|
|
12
|
+
* @param props - Component props
|
|
13
|
+
* @param ref - Ref forwarded to the underlying HTMLButtonElement
|
|
14
|
+
*/ function IconButtonComponent(props, ref) {
|
|
15
|
+
const { type = 'button', ...rest } = props;
|
|
16
|
+
return /*#__PURE__*/ jsx(StyledIconButton, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
type: type,
|
|
19
|
+
...rest
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const IconButton = /*#__PURE__*/ React.forwardRef(IconButtonComponent);
|
|
8
23
|
|
|
9
24
|
export { IconButton as default };
|
|
10
25
|
//# sourceMappingURL=IconButton.js.map
|