@veeqo/ui 15.6.0 → 15.7.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/dist/components/Action/styles/button.module.scss.cjs +2 -2
- package/dist/components/Action/styles/button.module.scss.cjs.map +1 -1
- package/dist/components/Action/styles/button.module.scss.js +2 -2
- package/dist/components/Action/styles/button.module.scss.js.map +1 -1
- package/dist/components/Action/styles/link.module.scss.cjs +2 -2
- package/dist/components/Action/styles/link.module.scss.cjs.map +1 -1
- package/dist/components/Action/styles/link.module.scss.js +2 -2
- package/dist/components/Action/styles/link.module.scss.js.map +1 -1
- package/dist/components/Action/styles/{base.module.scss.cjs → reset.module.scss.cjs} +3 -3
- package/dist/components/Action/styles/reset.module.scss.cjs.map +1 -0
- package/dist/components/Action/styles/{base.module.scss.js → reset.module.scss.js} +3 -3
- package/dist/components/Action/styles/reset.module.scss.js.map +1 -0
- package/dist/components/Action/utils.cjs +2 -4
- package/dist/components/Action/utils.cjs.map +1 -1
- package/dist/components/Action/utils.js +2 -4
- package/dist/components/Action/utils.js.map +1 -1
- package/dist/components/Alerts/MiniAlert/types.d.ts +4 -2
- package/dist/components/Anchor/types.d.ts +3 -0
- package/dist/components/AnimatedDropdown/types.d.ts +3 -0
- package/dist/components/Badge/types.d.ts +3 -0
- package/dist/components/Banner/Banner.cjs.map +1 -1
- package/dist/components/Banner/Banner.d.ts +3 -0
- package/dist/components/Banner/Banner.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.cjs +2 -2
- package/dist/components/Checkbox/Checkbox.module.scss.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.module.scss.js +2 -2
- package/dist/components/Checkbox/Checkbox.module.scss.js.map +1 -1
- package/dist/components/Choice/Choice.cjs +3 -1
- package/dist/components/Choice/Choice.cjs.map +1 -1
- package/dist/components/Choice/Choice.js +3 -1
- package/dist/components/Choice/Choice.js.map +1 -1
- package/dist/components/Choice/Choice.module.scss.cjs +2 -2
- package/dist/components/Choice/Choice.module.scss.cjs.map +1 -1
- package/dist/components/Choice/Choice.module.scss.js +2 -2
- package/dist/components/Choice/Choice.module.scss.js.map +1 -1
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs +1 -0
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js +1 -0
- package/dist/components/DataGrid/components/Body/BodyCell/BodyCell.js.map +1 -1
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js +1 -0
- package/dist/components/DataGrid/components/Body/LoadingBody/LoadingBodyCell.js.map +1 -1
- package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs +1 -0
- package/dist/components/DataGrid/components/GridContainer/GridContainer.cjs.map +1 -1
- package/dist/components/DataGrid/components/GridContainer/GridContainer.js +1 -0
- package/dist/components/DataGrid/components/GridContainer/GridContainer.js.map +1 -1
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs +1 -0
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.cjs.map +1 -1
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js +1 -0
- package/dist/components/DataGrid/components/Header/HeaderCell/HeaderCell.js.map +1 -1
- package/dist/components/DataTable/DataTable.cjs +3 -0
- package/dist/components/DataTable/DataTable.cjs.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +3 -0
- package/dist/components/DataTable/DataTable.js +3 -0
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/types.cjs.map +1 -1
- package/dist/components/DataTable/types.d.ts +3 -0
- package/dist/components/DataTable/types.js.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.cjs +3 -0
- package/dist/components/DescriptionList/DescriptionList.cjs.map +1 -1
- package/dist/components/DescriptionList/DescriptionList.d.ts +6 -0
- package/dist/components/DescriptionList/DescriptionList.js +3 -0
- package/dist/components/DescriptionList/DescriptionList.js.map +1 -1
- package/dist/components/DetailPage/DetailPage.cjs +3 -0
- package/dist/components/DetailPage/DetailPage.cjs.map +1 -1
- package/dist/components/DetailPage/DetailPage.d.ts +6 -0
- package/dist/components/DetailPage/DetailPage.js +3 -0
- package/dist/components/DetailPage/DetailPage.js.map +1 -1
- package/dist/components/LegacyDataTable/LegacyDataTable.cjs +1 -3
- package/dist/components/LegacyDataTable/LegacyDataTable.cjs.map +1 -1
- package/dist/components/LegacyDataTable/LegacyDataTable.d.ts +1 -3
- package/dist/components/LegacyDataTable/LegacyDataTable.js +1 -3
- package/dist/components/LegacyDataTable/LegacyDataTable.js.map +1 -1
- package/dist/components/LegacyDataTable/utils/types.d.ts +3 -0
- package/dist/components/Popup/Popup.cjs +3 -0
- package/dist/components/Popup/Popup.cjs.map +1 -1
- package/dist/components/Popup/Popup.d.ts +3 -0
- package/dist/components/Popup/Popup.js +3 -0
- package/dist/components/Popup/Popup.js.map +1 -1
- package/dist/components/Popup/types.d.ts +3 -0
- package/dist/components/Radio/Radio.cjs +2 -2
- package/dist/components/Radio/Radio.cjs.map +1 -1
- package/dist/components/Radio/Radio.d.ts +8 -0
- package/dist/components/Radio/Radio.js +2 -2
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Radio/Radio.module.scss.cjs +2 -2
- package/dist/components/Radio/Radio.module.scss.cjs.map +1 -1
- package/dist/components/Radio/Radio.module.scss.js +2 -2
- package/dist/components/Radio/Radio.module.scss.js.map +1 -1
- package/dist/components/Stack/types.d.ts +3 -0
- package/dist/components/View/types.cjs.map +1 -1
- package/dist/components/View/types.d.ts +3 -0
- package/dist/components/View/types.js.map +1 -1
- package/dist/hoc/withLabels/withLabels.cjs +2 -5
- package/dist/hoc/withLabels/withLabels.cjs.map +1 -1
- package/dist/hoc/withLabels/withLabels.js +2 -5
- package/dist/hoc/withLabels/withLabels.js.map +1 -1
- package/dist/utils/forms/form.module.scss.cjs +2 -2
- package/dist/utils/forms/form.module.scss.js +2 -2
- package/package.json +1 -1
- package/dist/components/Action/styles/base.module.scss.cjs.map +0 -1
- package/dist/components/Action/styles/base.module.scss.js.map +0 -1
|
@@ -2,13 +2,21 @@ import React, { AriaAttributes, ReactNode } from 'react';
|
|
|
2
2
|
import { ForwardedChoiceProps } from '../Choice';
|
|
3
3
|
type RadioValue = string | number;
|
|
4
4
|
export interface RadioProps extends ForwardedChoiceProps, Pick<AriaAttributes, 'aria-label'> {
|
|
5
|
+
/** Unique identifier for the radio input */
|
|
5
6
|
id?: string;
|
|
7
|
+
/** Additional CSS class name */
|
|
6
8
|
className?: string;
|
|
9
|
+
/** Whether the radio is selected */
|
|
7
10
|
checked: boolean;
|
|
11
|
+
/** The value associated with this radio option */
|
|
8
12
|
value?: RadioValue;
|
|
13
|
+
/** Whether the radio is disabled and non-interactive */
|
|
9
14
|
disabled?: boolean;
|
|
15
|
+
/** Name attribute for grouping related radio inputs */
|
|
10
16
|
name?: string;
|
|
17
|
+
/** Callback fired when the radio selection changes */
|
|
11
18
|
onChange: (checked: boolean, value?: RadioValue) => void;
|
|
19
|
+
/** Content rendered inside the radio input element */
|
|
12
20
|
children?: ReactNode;
|
|
13
21
|
}
|
|
14
22
|
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -3,13 +3,13 @@ import { Choice } from '../Choice/Choice.js';
|
|
|
3
3
|
import { generateId } from '../../utils/generateId.js';
|
|
4
4
|
import styles from './Radio.module.scss.js';
|
|
5
5
|
|
|
6
|
-
const Radio = forwardRef(({ checked, value, name, hint, disabled, onChange, id, children, 'aria-label': ariaLabel, ...otherProps }, ref) => {
|
|
6
|
+
const Radio = forwardRef(({ checked, value, name, hint, disabled, onChange, id, children, 'aria-label': ariaLabel, error, ...otherProps }, ref) => {
|
|
7
7
|
const handleChange = useCallback((e) => {
|
|
8
8
|
onChange(e.currentTarget.checked, value);
|
|
9
9
|
}, [onChange, value]);
|
|
10
10
|
const componentId = useMemo(() => id !== null && id !== void 0 ? id : generateId('radio'), [id]);
|
|
11
11
|
const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;
|
|
12
|
-
return (React__default.createElement(Choice, { htmlFor: componentId, disabled: disabled, hint: hint, ...otherProps },
|
|
12
|
+
return (React__default.createElement(Choice, { htmlFor: componentId, disabled: disabled, hint: hint, error: error, ...otherProps },
|
|
13
13
|
React__default.createElement("input", { className: styles.input, id: componentId, type: "radio", checked: checked, value: value, name: name, disabled: disabled, onChange: handleChange, ref: ref, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy }),
|
|
14
14
|
children));
|
|
15
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import React, { AriaAttributes, ReactNode, forwardRef, useCallback, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { generateId } from '../../utils/generateId';\n\nimport styles from './Radio.module.scss';\n\ntype RadioValue = string | number;\n\nexport interface RadioProps extends ForwardedChoiceProps, Pick<AriaAttributes, 'aria-label'> {\n id?: string;\n className?: string;\n checked: boolean;\n value?: RadioValue;\n disabled?: boolean;\n name?: string;\n onChange: (checked: boolean, value?: RadioValue) => void;\n children?: ReactNode;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n checked,\n value,\n name,\n hint,\n disabled,\n onChange,\n id,\n children,\n 'aria-label': ariaLabel,\n ...otherProps\n }: RadioProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n const componentId = useMemo(() => id ?? generateId('radio'), [id]);\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice htmlFor={componentId} disabled={disabled} hint={hint} {...otherProps}>\n <input\n className={styles.input}\n id={componentId}\n type=\"radio\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n onChange={handleChange}\n ref={ref}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedBy}\n />\n {children}\n </Choice>\n );\n },\n);\n"],"names":["React"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Radio.js","sources":["../../../src/components/Radio/Radio.tsx"],"sourcesContent":["import React, { AriaAttributes, ReactNode, forwardRef, useCallback, useMemo } from 'react';\nimport { Choice, ForwardedChoiceProps } from '../Choice';\nimport { generateId } from '../../utils/generateId';\n\nimport styles from './Radio.module.scss';\n\ntype RadioValue = string | number;\n\nexport interface RadioProps extends ForwardedChoiceProps, Pick<AriaAttributes, 'aria-label'> {\n /** Unique identifier for the radio input */\n id?: string;\n /** Additional CSS class name */\n className?: string;\n /** Whether the radio is selected */\n checked: boolean;\n /** The value associated with this radio option */\n value?: RadioValue;\n /** Whether the radio is disabled and non-interactive */\n disabled?: boolean;\n /** Name attribute for grouping related radio inputs */\n name?: string;\n /** Callback fired when the radio selection changes */\n onChange: (checked: boolean, value?: RadioValue) => void;\n /** Content rendered inside the radio input element */\n children?: ReactNode;\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n checked,\n value,\n name,\n hint,\n disabled,\n onChange,\n id,\n children,\n 'aria-label': ariaLabel,\n error,\n ...otherProps\n }: RadioProps,\n ref,\n ) => {\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.currentTarget.checked, value);\n },\n [onChange, value],\n );\n\n const componentId = useMemo(() => id ?? generateId('radio'), [id]);\n const ariaDescribedBy = hint ? `hint-${componentId}` : undefined;\n\n return (\n <Choice htmlFor={componentId} disabled={disabled} hint={hint} error={error} {...otherProps}>\n <input\n className={styles.input}\n id={componentId}\n type=\"radio\"\n checked={checked}\n value={value}\n name={name}\n disabled={disabled}\n onChange={handleChange}\n ref={ref}\n aria-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AAC;;;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
4
|
|
|
5
|
-
___$insertStyle(".
|
|
6
|
-
var styles = {"input":"
|
|
5
|
+
___$insertStyle("._input_17v2n_1 {\n appearance: none;\n box-sizing: border-box;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin: 3px;\n background-color: transparent;\n border: 2px solid var(--choice-error-border, var(--colors-neutral-ink-light));\n border-radius: 50%;\n outline: none;\n cursor: pointer;\n transition: box-shadow 0.1s;\n}\n._input_17v2n_1:checked {\n position: relative;\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n}\n._input_17v2n_1:checked::before {\n content: \"\";\n width: 10px;\n height: 10px;\n position: absolute;\n top: 2px;\n left: 2px;\n background-color: var(--choice-error-bg, var(--colors-secondary-blue-base));\n border-radius: 50%;\n}\n._input_17v2n_1:hover {\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n}\n._input_17v2n_1:active {\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n}\n._input_17v2n_1:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--choice-error-focus, var(--colors-secondary-blue-light));\n outline: 0;\n}\n._input_17v2n_1:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-ink-lightest);\n cursor: default;\n}\n._input_17v2n_1:disabled::before {\n background-color: var(--colors-neutral-ink-light);\n}");
|
|
6
|
+
var styles = {"input":"_input_17v2n_1"};
|
|
7
7
|
|
|
8
8
|
module.exports = styles;
|
|
9
9
|
//# sourceMappingURL=Radio.module.scss.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.module.scss.cjs","sources":["../../../src/components/Radio/Radio.module.scss"],"sourcesContent":[".input {\n appearance: none;\n box-sizing: border-box;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin: 3px;\n background-color: transparent;\n border: 2px solid var(--colors-neutral-ink-light);\n border-radius: 50%;\n outline: none;\n cursor: pointer;\n\n transition: box-shadow 0.1s;\n\n &:checked {\n position: relative;\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:checked::before {\n content: '';\n width: 10px;\n height: 10px;\n position: absolute;\n top: 2px;\n left: 2px;\n background-color: var(--colors-secondary-blue-base);\n border-radius: 50%;\n }\n\n &:hover {\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:active {\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--colors-secondary-blue-light);\n outline: 0;\n }\n\n &:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-ink-lightest);\n cursor: default;\n }\n\n &:disabled::before {\n background-color: var(--colors-neutral-ink-light);\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"Radio.module.scss.cjs","sources":["../../../src/components/Radio/Radio.module.scss"],"sourcesContent":[".input {\n appearance: none;\n box-sizing: border-box;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin: 3px;\n background-color: transparent;\n border: 2px solid var(--choice-error-border, var(--colors-neutral-ink-light));\n border-radius: 50%;\n outline: none;\n cursor: pointer;\n\n transition: box-shadow 0.1s;\n\n &:checked {\n position: relative;\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n }\n\n &:checked::before {\n content: '';\n width: 10px;\n height: 10px;\n position: absolute;\n top: 2px;\n left: 2px;\n background-color: var(--choice-error-bg, var(--colors-secondary-blue-base));\n border-radius: 50%;\n }\n\n &:hover {\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n }\n\n &:active {\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--choice-error-focus, var(--colors-secondary-blue-light));\n outline: 0;\n }\n\n &:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-ink-lightest);\n cursor: default;\n }\n\n &:disabled::before {\n background-color: var(--colors-neutral-ink-light);\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,00CAAA;AACA,aAAA,CAAA,OAAA,CAAA,gBAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
2
|
|
|
3
|
-
insertStyle(".
|
|
4
|
-
var styles = {"input":"
|
|
3
|
+
insertStyle("._input_17v2n_1 {\n appearance: none;\n box-sizing: border-box;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin: 3px;\n background-color: transparent;\n border: 2px solid var(--choice-error-border, var(--colors-neutral-ink-light));\n border-radius: 50%;\n outline: none;\n cursor: pointer;\n transition: box-shadow 0.1s;\n}\n._input_17v2n_1:checked {\n position: relative;\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n}\n._input_17v2n_1:checked::before {\n content: \"\";\n width: 10px;\n height: 10px;\n position: absolute;\n top: 2px;\n left: 2px;\n background-color: var(--choice-error-bg, var(--colors-secondary-blue-base));\n border-radius: 50%;\n}\n._input_17v2n_1:hover {\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n}\n._input_17v2n_1:active {\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n}\n._input_17v2n_1:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--choice-error-focus, var(--colors-secondary-blue-light));\n outline: 0;\n}\n._input_17v2n_1:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-ink-lightest);\n cursor: default;\n}\n._input_17v2n_1:disabled::before {\n background-color: var(--colors-neutral-ink-light);\n}");
|
|
4
|
+
var styles = {"input":"_input_17v2n_1"};
|
|
5
5
|
|
|
6
6
|
export { styles as default };
|
|
7
7
|
//# sourceMappingURL=Radio.module.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.module.scss.js","sources":["../../../src/components/Radio/Radio.module.scss"],"sourcesContent":[".input {\n appearance: none;\n box-sizing: border-box;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin: 3px;\n background-color: transparent;\n border: 2px solid var(--colors-neutral-ink-light);\n border-radius: 50%;\n outline: none;\n cursor: pointer;\n\n transition: box-shadow 0.1s;\n\n &:checked {\n position: relative;\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:checked::before {\n content: '';\n width: 10px;\n height: 10px;\n position: absolute;\n top: 2px;\n left: 2px;\n background-color: var(--colors-secondary-blue-base);\n border-radius: 50%;\n }\n\n &:hover {\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:active {\n border-color: var(--colors-secondary-blue-base);\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--colors-secondary-blue-light);\n outline: 0;\n }\n\n &:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-ink-lightest);\n cursor: default;\n }\n\n &:disabled::before {\n background-color: var(--colors-neutral-ink-light);\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"Radio.module.scss.js","sources":["../../../src/components/Radio/Radio.module.scss"],"sourcesContent":[".input {\n appearance: none;\n box-sizing: border-box;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n margin: 3px;\n background-color: transparent;\n border: 2px solid var(--choice-error-border, var(--colors-neutral-ink-light));\n border-radius: 50%;\n outline: none;\n cursor: pointer;\n\n transition: box-shadow 0.1s;\n\n &:checked {\n position: relative;\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n }\n\n &:checked::before {\n content: '';\n width: 10px;\n height: 10px;\n position: absolute;\n top: 2px;\n left: 2px;\n background-color: var(--choice-error-bg, var(--colors-secondary-blue-base));\n border-radius: 50%;\n }\n\n &:hover {\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n }\n\n &:active {\n border-color: var(--choice-error-border, var(--colors-secondary-blue-base));\n }\n\n &:focus {\n box-shadow: 0 0 0 var(--sizes-xs) var(--choice-error-focus, var(--colors-secondary-blue-light));\n outline: 0;\n }\n\n &:disabled {\n box-shadow: none;\n background-color: var(--colors-neutral-grey-base);\n border-color: var(--colors-neutral-ink-lightest);\n cursor: default;\n }\n\n &:disabled::before {\n background-color: var(--colors-neutral-ink-light);\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,00CAAA;AACA,aAAA,CAAA,OAAA,CAAA,gBAAA;;;;"}
|
|
@@ -21,6 +21,9 @@ export declare const sizeScale: SizeScale;
|
|
|
21
21
|
export declare const sizeAliases: SizeScale;
|
|
22
22
|
declare const sizes: SizeScale;
|
|
23
23
|
export type Size = keyof typeof sizes;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Stack is deprecated and will be removed in a future release. Replaced by `FlexCol` and `FlexRow`.
|
|
26
|
+
*/
|
|
24
27
|
export type StackProps = {
|
|
25
28
|
/**
|
|
26
29
|
* Direction of component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sources":["../../../src/components/View/types.ts"],"sourcesContent":["import { ReactElement } from 'react';\nimport { ColourPalette } from '../../theme/modules/colors';\n\nexport type ViewId = string;\n\nexport enum ViewTypes {\n saved = 'saved',\n fixed = 'fixed',\n draft = 'draft',\n}\n\nexport interface ViewProps {\n /** ClassName to override styles on outer root element */\n className?: string;\n\n /** Colour palette for the view */\n colourPalette?: ColourPalette;\n\n /** customTextColour - Custom Rest State colour */\n customTextColour?: string;\n\n /** Flag to toggle active state styles on the Tab */\n active?: boolean;\n\n /** View name, eg.: Jade's view */\n name: string;\n\n /** IconSlot for passing */\n iconSlot?: ReactElement;\n\n /** View's unique identifier */\n id: ViewId;\n\n /** View type */\n type?: keyof typeof ViewTypes;\n\n /** Number or string value to show near view label */\n count?: number | string;\n\n /** Event handler for when View component is clicked (should get activated) */\n onClick: (id: ViewId) => void;\n\n /** Event handler for when user clicks the delete/cross icon */\n onDelete?: (id: ViewId) => void;\n\n /** Event handler for when user clicks to edit the view */\n onEdit?: (id: ViewId) => void;\n\n /** Class name for e2e testing */\n e2eClassName?: string;\n}\n"],"names":["ViewTypes"],"mappings":";;AAKYA;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAJWA,iBAAS,KAATA,iBAAS,GAAA,EAAA,CAAA,CAAA;;"}
|
|
1
|
+
{"version":3,"file":"types.cjs","sources":["../../../src/components/View/types.ts"],"sourcesContent":["import { ReactElement } from 'react';\nimport { ColourPalette } from '../../theme/modules/colors';\n\nexport type ViewId = string;\n\nexport enum ViewTypes {\n saved = 'saved',\n fixed = 'fixed',\n draft = 'draft',\n}\n\n/**\n * @deprecated View is deprecated and will be removed in a future release. Use the `ViewTab` component instead.\n */\nexport interface ViewProps {\n /** ClassName to override styles on outer root element */\n className?: string;\n\n /** Colour palette for the view */\n colourPalette?: ColourPalette;\n\n /** customTextColour - Custom Rest State colour */\n customTextColour?: string;\n\n /** Flag to toggle active state styles on the Tab */\n active?: boolean;\n\n /** View name, eg.: Jade's view */\n name: string;\n\n /** IconSlot for passing */\n iconSlot?: ReactElement;\n\n /** View's unique identifier */\n id: ViewId;\n\n /** View type */\n type?: keyof typeof ViewTypes;\n\n /** Number or string value to show near view label */\n count?: number | string;\n\n /** Event handler for when View component is clicked (should get activated) */\n onClick: (id: ViewId) => void;\n\n /** Event handler for when user clicks the delete/cross icon */\n onDelete?: (id: ViewId) => void;\n\n /** Event handler for when user clicks to edit the view */\n onEdit?: (id: ViewId) => void;\n\n /** Class name for e2e testing */\n e2eClassName?: string;\n}\n"],"names":["ViewTypes"],"mappings":";;AAKYA;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAJWA,iBAAS,KAATA,iBAAS,GAAA,EAAA,CAAA,CAAA;;"}
|
|
@@ -6,6 +6,9 @@ export declare enum ViewTypes {
|
|
|
6
6
|
fixed = "fixed",
|
|
7
7
|
draft = "draft"
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated View is deprecated and will be removed in a future release. Use the `ViewTab` component instead.
|
|
11
|
+
*/
|
|
9
12
|
export interface ViewProps {
|
|
10
13
|
/** ClassName to override styles on outer root element */
|
|
11
14
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../../src/components/View/types.ts"],"sourcesContent":["import { ReactElement } from 'react';\nimport { ColourPalette } from '../../theme/modules/colors';\n\nexport type ViewId = string;\n\nexport enum ViewTypes {\n saved = 'saved',\n fixed = 'fixed',\n draft = 'draft',\n}\n\nexport interface ViewProps {\n /** ClassName to override styles on outer root element */\n className?: string;\n\n /** Colour palette for the view */\n colourPalette?: ColourPalette;\n\n /** customTextColour - Custom Rest State colour */\n customTextColour?: string;\n\n /** Flag to toggle active state styles on the Tab */\n active?: boolean;\n\n /** View name, eg.: Jade's view */\n name: string;\n\n /** IconSlot for passing */\n iconSlot?: ReactElement;\n\n /** View's unique identifier */\n id: ViewId;\n\n /** View type */\n type?: keyof typeof ViewTypes;\n\n /** Number or string value to show near view label */\n count?: number | string;\n\n /** Event handler for when View component is clicked (should get activated) */\n onClick: (id: ViewId) => void;\n\n /** Event handler for when user clicks the delete/cross icon */\n onDelete?: (id: ViewId) => void;\n\n /** Event handler for when user clicks to edit the view */\n onEdit?: (id: ViewId) => void;\n\n /** Class name for e2e testing */\n e2eClassName?: string;\n}\n"],"names":[],"mappings":"IAKY;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAJW,SAAS,KAAT,SAAS,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../src/components/View/types.ts"],"sourcesContent":["import { ReactElement } from 'react';\nimport { ColourPalette } from '../../theme/modules/colors';\n\nexport type ViewId = string;\n\nexport enum ViewTypes {\n saved = 'saved',\n fixed = 'fixed',\n draft = 'draft',\n}\n\n/**\n * @deprecated View is deprecated and will be removed in a future release. Use the `ViewTab` component instead.\n */\nexport interface ViewProps {\n /** ClassName to override styles on outer root element */\n className?: string;\n\n /** Colour palette for the view */\n colourPalette?: ColourPalette;\n\n /** customTextColour - Custom Rest State colour */\n customTextColour?: string;\n\n /** Flag to toggle active state styles on the Tab */\n active?: boolean;\n\n /** View name, eg.: Jade's view */\n name: string;\n\n /** IconSlot for passing */\n iconSlot?: ReactElement;\n\n /** View's unique identifier */\n id: ViewId;\n\n /** View type */\n type?: keyof typeof ViewTypes;\n\n /** Number or string value to show near view label */\n count?: number | string;\n\n /** Event handler for when View component is clicked (should get activated) */\n onClick: (id: ViewId) => void;\n\n /** Event handler for when user clicks the delete/cross icon */\n onDelete?: (id: ViewId) => void;\n\n /** Event handler for when user clicks to edit the view */\n onEdit?: (id: ViewId) => void;\n\n /** Class name for e2e testing */\n e2eClassName?: string;\n}\n"],"names":[],"mappings":"IAKY;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EAJW,SAAS,KAAT,SAAS,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -28,11 +28,8 @@ const withLabels = (Component) => {
|
|
|
28
28
|
React__default.default.createElement(HelpIcon.ReactComponent, { "data-testid": "tooltip-help", width: index.theme.sizes.base, height: index.theme.sizes.base, color: index.theme.colors.neutral.ink.light })))),
|
|
29
29
|
hint && (React__default.default.createElement(Text.Text, { variant: "hintText", as: "span", className: withLabels_module.hint, id: `${componentId}-hint` }, hint)),
|
|
30
30
|
React__default.default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, disabledMessage: disabledMessage, ...otherProps }),
|
|
31
|
-
error && (React__default.default.createElement(MiniAlert.MiniAlert, { id: `${componentId}-error`, variant: "error", isBold: false, role: "alert",
|
|
32
|
-
|
|
33
|
-
// Use both with typeof to get correct sizing for strings and support JSX errors.
|
|
34
|
-
title: typeof error === 'string' ? error : undefined, titleSlot: typeof error !== 'string' ? error : undefined })),
|
|
35
|
-
disabledMessage && (React__default.default.createElement(MiniAlert.MiniAlert, { id: `${componentId}-disabled`, isBold: false, title: typeof disabledMessage === 'string' ? disabledMessage : undefined, titleSlot: typeof disabledMessage !== 'string' ? disabledMessage : undefined }))));
|
|
31
|
+
error && (React__default.default.createElement(MiniAlert.MiniAlert, { id: `${componentId}-error`, variant: "error", isBold: false, role: "alert", title: error })),
|
|
32
|
+
disabledMessage && (React__default.default.createElement(MiniAlert.MiniAlert, { id: `${componentId}-disabled`, isBold: false, title: disabledMessage }))));
|
|
36
33
|
});
|
|
37
34
|
ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;
|
|
38
35
|
return ComponentWithLabels;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabels.cjs","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { MiniAlert } from '../../components/Alerts/MiniAlert';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { HelpIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './BlockTooltip';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <MiniAlert\n id={`${componentId}-error`}\n variant=\"error\"\n isBold={false}\n role=\"alert\"\n
|
|
1
|
+
{"version":3,"file":"withLabels.cjs","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { MiniAlert } from '../../components/Alerts/MiniAlert';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { HelpIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './BlockTooltip';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <MiniAlert\n id={`${componentId}-error`}\n variant=\"error\"\n isBold={false}\n role=\"alert\"\n title={error}\n />\n )}\n {disabledMessage && (\n <MiniAlert\n id={`${componentId}-disabled`}\n isBold={false}\n title={disabledMessage}\n />\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["forwardRef","useId","React","FlexCol","styles","FlexRow","Text","BlockTooltip","HelpIcon","theme","MiniAlert"],"mappings":";;;;;;;;;;;;;;;;;AAuBA;AACO,MAAM,UAAU,GAAG,CAAiB,SAA2B,KAAI;IACxE,MAAM,mBAAmB,GAAGA,gBAAU,CACpC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,KAAI;AAC3F,QAAA,MAAM,WAAW,GAAGC,WAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AAEzD,QAAA,IAAI,CAAC,KAAK;AACR,YAAA,QACEC,sBAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,WAAW,EACf,QAAQ,EAAE,CAAC,CAAC,KAAK,EACjB,QAAQ,EAAE,CAAC,CAAC,eAAe,EAC3B,eAAe,EAAE,eAAe,EAAA,GAC3B,UAAgB,EAAA,CACrB;QAGN,QACEA,qCAACC,eAAO,EAAA,EAAC,SAAS,EAAEC,iBAAM,CAAC,SAAS,EAAA;AAClC,YAAAF,sBAAA,CAAA,aAAA,CAACG,eAAO,EAAA,IAAA;AACN,gBAAAH,sBAAA,CAAA,aAAA,CAACI,SAAI,EAAA,EAAC,OAAO,EAAC,YAAY,EAAC,EAAE,EAAE,CAAA,EAAG,WAAW,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAA,EACxE,KAAK,CACD;AACN,gBAAA,CAAC,OAAO,IAAI,cAAc,MACzBJ,s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AED,IAAA,mBAAmB,CAAC,WAAW,GAAG,CAAA,WAAA,EAAc,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG;AAEzG,IAAA,OAAO,mBAAmB;AAC5B;;;;"}
|
|
@@ -22,11 +22,8 @@ const withLabels = (Component) => {
|
|
|
22
22
|
React__default.createElement(HelpIcon, { "data-testid": "tooltip-help", width: theme.sizes.base, height: theme.sizes.base, color: theme.colors.neutral.ink.light })))),
|
|
23
23
|
hint && (React__default.createElement(Text, { variant: "hintText", as: "span", className: labelStyles.hint, id: `${componentId}-hint` }, hint)),
|
|
24
24
|
React__default.createElement(Component, { ref: ref, id: componentId, hasError: !!error, disabled: !!disabledMessage, disabledMessage: disabledMessage, ...otherProps }),
|
|
25
|
-
error && (React__default.createElement(MiniAlert, { id: `${componentId}-error`, variant: "error", isBold: false, role: "alert",
|
|
26
|
-
|
|
27
|
-
// Use both with typeof to get correct sizing for strings and support JSX errors.
|
|
28
|
-
title: typeof error === 'string' ? error : undefined, titleSlot: typeof error !== 'string' ? error : undefined })),
|
|
29
|
-
disabledMessage && (React__default.createElement(MiniAlert, { id: `${componentId}-disabled`, isBold: false, title: typeof disabledMessage === 'string' ? disabledMessage : undefined, titleSlot: typeof disabledMessage !== 'string' ? disabledMessage : undefined }))));
|
|
25
|
+
error && (React__default.createElement(MiniAlert, { id: `${componentId}-error`, variant: "error", isBold: false, role: "alert", title: error })),
|
|
26
|
+
disabledMessage && (React__default.createElement(MiniAlert, { id: `${componentId}-disabled`, isBold: false, title: disabledMessage }))));
|
|
30
27
|
});
|
|
31
28
|
ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;
|
|
32
29
|
return ComponentWithLabels;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLabels.js","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { MiniAlert } from '../../components/Alerts/MiniAlert';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { HelpIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './BlockTooltip';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <MiniAlert\n id={`${componentId}-error`}\n variant=\"error\"\n isBold={false}\n role=\"alert\"\n
|
|
1
|
+
{"version":3,"file":"withLabels.js","sources":["../../../src/hoc/withLabels/withLabels.tsx"],"sourcesContent":["import React, { ComponentType, forwardRef, ReactNode } from 'react';\n\nimport { FlexCol } from '../../components/Flex/FlexCol';\nimport { FlexRow } from '../../components/Flex/FlexRow';\nimport { MiniAlert } from '../../components/Alerts/MiniAlert';\nimport { Text } from '../../components/Text';\nimport { useId } from '../../hooks/useId';\nimport { HelpIcon } from '../../icons';\nimport { theme } from '../../theme';\n\nimport { BlockTooltip } from './BlockTooltip';\nimport styles from './withLabels.module.scss';\n\nexport interface WithLabelsProps {\n id?: string;\n label?: ReactNode;\n hint?: ReactNode;\n error?: ReactNode;\n disabledMessage?: ReactNode;\n tooltip?: string;\n tooltipContent?: ReactNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/comma-dangle -- comma is required so TS knows this is a generic, not JSX\nexport const withLabels = <P, R = unknown>(Component: ComponentType<P>) => {\n const ComponentWithLabels = forwardRef<R, P & WithLabelsProps>(\n ({ label, hint, error, disabledMessage, tooltip, tooltipContent, id, ...otherProps }, ref) => {\n const componentId = useId({ id, prefix: Component.name });\n\n if (!label)\n return (\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n );\n\n return (\n <FlexCol className={styles.rootStack}>\n <FlexRow>\n <Text variant=\"inputLabel\" id={`${componentId}-label`} htmlFor={componentId}>\n {label}\n </Text>\n {(tooltip || tooltipContent) && (\n <BlockTooltip text={tooltip} content={tooltipContent}>\n <HelpIcon\n data-testid=\"tooltip-help\"\n width={theme.sizes.base}\n height={theme.sizes.base}\n color={theme.colors.neutral.ink.light}\n />\n </BlockTooltip>\n )}\n </FlexRow>\n {hint && (\n <Text variant=\"hintText\" as=\"span\" className={styles.hint} id={`${componentId}-hint`}>\n {hint}\n </Text>\n )}\n <Component\n ref={ref}\n id={componentId}\n hasError={!!error}\n disabled={!!disabledMessage}\n disabledMessage={disabledMessage}\n {...(otherProps as P)}\n />\n {error && (\n <MiniAlert\n id={`${componentId}-error`}\n variant=\"error\"\n isBold={false}\n role=\"alert\"\n title={error}\n />\n )}\n {disabledMessage && (\n <MiniAlert\n id={`${componentId}-disabled`}\n isBold={false}\n title={disabledMessage}\n />\n )}\n </FlexCol>\n );\n },\n );\n\n ComponentWithLabels.displayName = `withLabels(${Component.displayName || Component.name || 'Component'})`;\n\n return ComponentWithLabels;\n};\n"],"names":["React","styles"],"mappings":";;;;;;;;;;;AAuBA;AACO,MAAM,UAAU,GAAG,CAAiB,SAA2B,KAAI;IACxE,MAAM,mBAAmB,GAAG,UAAU,CACpC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE,EAAE,GAAG,UAAU,EAAE,EAAE,GAAG,KAAI;AAC3F,QAAA,MAAM,WAAW,GAAG,KAAK,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;AAEzD,QAAA,IAAI,CAAC,KAAK;AACR,YAAA,QACEA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,EACR,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,WAAW,EACf,QAAQ,EAAE,CAAC,CAAC,KAAK,EACjB,QAAQ,EAAE,CAAC,CAAC,eAAe,EAC3B,eAAe,EAAE,eAAe,EAAA,GAC3B,UAAgB,EAAA,CACrB;QAGN,QACEA,6BAAC,OAAO,EAAA,EAAC,SAAS,EAAEC,WAAM,CAAC,SAAS,EAAA;AAClC,YAAAD,cAAA,CAAA,aAAA,CAAC,OAAO,EAAA,IAAA;AACN,gBAAAA,cAAA,CAAA,aAAA,CAAC,IAAI,EAAA,EAAC,OAAO,EAAC,YAAY,EAAC,EAAE,EAAE,CAAA,EAAG,WAAW,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAA,EACxE,KAAK,CACD;AACN,gBAAA,CAAC,OAAO,IAAI,cAAc,MACzBA,cAAA,CAAA,aAAA,CAAC,YAA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A,EAAc,SAAS,CAAC,WAAW,IAAI,SAAS,CAAC,IAAI,IAAI,WAAW,GAAG;AAEzG,IAAA,OAAO,mBAAmB;AAC5B;;;;"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var ___$insertStyle = require('../../_virtual/____insertStyle.cjs');
|
|
4
4
|
|
|
5
|
-
___$insertStyle(".
|
|
6
|
-
var formStyles = {"fullStyles":"
|
|
5
|
+
___$insertStyle("._fullStyles_1x1rs_1 {\n --outline-size: var(--sizes-xs);\n --border-color: var(--colors-neutral-ink-lightest);\n --shadow-color: var(--colors-secondary-blue-light);\n}\n._fullStyles_1x1rs_1:disabled, ._fullStyles_1x1rs_1[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: var(--colors-neutral-grey-light);\n cursor: not-allowed;\n}\n._fullStyles_1x1rs_1._compact_1x1rs_12 {\n --outline-size: 2px;\n min-height: var(--sizes-8);\n}\n._fullStyles_1x1rs_1._error_1x1rs_16 {\n --border-color: var(--colors-secondary-red-base);\n --shadow-color: var(--colors-secondary-red-light);\n}\n._fullStyles_1x1rs_1:focus {\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n}\n._fullStyles_1x1rs_1::placeholder {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n}\n._fullStyles_1x1rs_1:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n border-color: var(--colors-secondary-red-base);\n}\n\n._base_1x1rs_40 {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n appearance: none;\n box-sizing: border-box;\n background-color: white;\n text-align: left;\n min-height: var(--sizes-10);\n padding-inline: var(--sizes-3);\n border-radius: var(--radius-base);\n border: 1px solid var(--border-color);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n /* When inside an InputGroup, reduce inline padding to bring content closer together */\n}\n._base_1x1rs_40._inputGroup_1x1rs_62:first-child {\n padding-right: calc(var(--sizes-3) - var(--sizes-1));\n}\n._base_1x1rs_40._inputGroup_1x1rs_62:last-child {\n padding-left: var(--sizes-2);\n}\n._base_1x1rs_40._inputGroup_1x1rs_62:not(:first-child):not(:last-child) {\n padding-inline: var(--sizes-2);\n}\n\n/** InputGroup styles from the InputGroup component */\n._inputGroup_1x1rs_62 {\n display: flex;\n /* Remove inline margins from all children */\n /* Bring in-focus and active children to the front to maintain outlines */\n /* Remove inline borders for children in the middle */\n /* Remove right border radius from first child */\n /* Remove left border radius from last child */\n}\n._inputGroup_1x1rs_62 > * {\n margin-left: 0;\n margin-right: 0;\n box-shadow: none;\n}\n._inputGroup_1x1rs_62 > *:focus, ._inputGroup_1x1rs_62 > *:active {\n z-index: 5;\n}\n._inputGroup_1x1rs_62 > *:not(:first-child):not(:last-child) {\n border-radius: 0 !important;\n border-inline: 0 !important;\n}\n._inputGroup_1x1rs_62 > *:first-child {\n border-top-right-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n border-right: 0 !important;\n}\n._inputGroup_1x1rs_62 > *:last-child {\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n border-left: 0 !important;\n}");
|
|
6
|
+
var formStyles = {"fullStyles":"_fullStyles_1x1rs_1","compact":"_compact_1x1rs_12","error":"_error_1x1rs_16","base":"_base_1x1rs_40","inputGroup":"_inputGroup_1x1rs_62"};
|
|
7
7
|
|
|
8
8
|
module.exports = formStyles;
|
|
9
9
|
//# sourceMappingURL=form.module.scss.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import insertStyle from '../../_virtual/____insertStyle.js';
|
|
2
2
|
|
|
3
|
-
insertStyle(".
|
|
4
|
-
var formStyles = {"fullStyles":"
|
|
3
|
+
insertStyle("._fullStyles_1x1rs_1 {\n --outline-size: var(--sizes-xs);\n --border-color: var(--colors-neutral-ink-lightest);\n --shadow-color: var(--colors-secondary-blue-light);\n}\n._fullStyles_1x1rs_1:disabled, ._fullStyles_1x1rs_1[data-disabled] {\n opacity: 1;\n box-shadow: none;\n background-color: var(--colors-neutral-grey-light);\n cursor: not-allowed;\n}\n._fullStyles_1x1rs_1._compact_1x1rs_12 {\n --outline-size: 2px;\n min-height: var(--sizes-8);\n}\n._fullStyles_1x1rs_1._error_1x1rs_16 {\n --border-color: var(--colors-secondary-red-base);\n --shadow-color: var(--colors-secondary-red-light);\n}\n._fullStyles_1x1rs_1:focus {\n border-color: var(--border-color);\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n outline: 0;\n}\n._fullStyles_1x1rs_1::placeholder {\n font-family: var(--text-placeholder-font-family);\n font-style: var(--text-placeholder-font-style);\n font-weight: var(--text-placeholder-font-weight);\n font-size: var(--text-placeholder-font-size);\n line-height: var(--text-placeholder-line-height);\n color: var(--text-placeholder-color);\n text-decoration: var(--text-placeholder-text-decoration);\n letter-spacing: var(--text-placeholder-letter-spacing);\n}\n._fullStyles_1x1rs_1:invalid {\n box-shadow: 0 0 0 var(--outline-size) var(--shadow-color);\n border-color: var(--colors-secondary-red-base);\n}\n\n._base_1x1rs_40 {\n font-family: var(--text-body-font-family);\n font-style: var(--text-body-font-style);\n font-weight: var(--text-body-font-weight);\n font-size: var(--text-body-font-size);\n line-height: var(--text-body-line-height);\n color: var(--text-body-color);\n text-decoration: var(--text-body-text-decoration);\n letter-spacing: var(--text-body-letter-spacing);\n appearance: none;\n box-sizing: border-box;\n background-color: white;\n text-align: left;\n min-height: var(--sizes-10);\n padding-inline: var(--sizes-3);\n border-radius: var(--radius-base);\n border: 1px solid var(--border-color);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n /* When inside an InputGroup, reduce inline padding to bring content closer together */\n}\n._base_1x1rs_40._inputGroup_1x1rs_62:first-child {\n padding-right: calc(var(--sizes-3) - var(--sizes-1));\n}\n._base_1x1rs_40._inputGroup_1x1rs_62:last-child {\n padding-left: var(--sizes-2);\n}\n._base_1x1rs_40._inputGroup_1x1rs_62:not(:first-child):not(:last-child) {\n padding-inline: var(--sizes-2);\n}\n\n/** InputGroup styles from the InputGroup component */\n._inputGroup_1x1rs_62 {\n display: flex;\n /* Remove inline margins from all children */\n /* Bring in-focus and active children to the front to maintain outlines */\n /* Remove inline borders for children in the middle */\n /* Remove right border radius from first child */\n /* Remove left border radius from last child */\n}\n._inputGroup_1x1rs_62 > * {\n margin-left: 0;\n margin-right: 0;\n box-shadow: none;\n}\n._inputGroup_1x1rs_62 > *:focus, ._inputGroup_1x1rs_62 > *:active {\n z-index: 5;\n}\n._inputGroup_1x1rs_62 > *:not(:first-child):not(:last-child) {\n border-radius: 0 !important;\n border-inline: 0 !important;\n}\n._inputGroup_1x1rs_62 > *:first-child {\n border-top-right-radius: 0 !important;\n border-bottom-right-radius: 0 !important;\n border-right: 0 !important;\n}\n._inputGroup_1x1rs_62 > *:last-child {\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n border-left: 0 !important;\n}");
|
|
4
|
+
var formStyles = {"fullStyles":"_fullStyles_1x1rs_1","compact":"_compact_1x1rs_12","error":"_error_1x1rs_16","base":"_base_1x1rs_40","inputGroup":"_inputGroup_1x1rs_62"};
|
|
5
5
|
|
|
6
6
|
export { formStyles as default };
|
|
7
7
|
//# sourceMappingURL=form.module.scss.js.map
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.module.scss.cjs","sources":["../../../../src/components/Action/styles/base.module.scss"],"sourcesContent":[".reset {\n appearance: none;\n border: 0;\n background-color: transparent;\n padding: unset;\n font: inherit;\n text-decoration: none;\n text-align: start;\n color: inherit;\n\n &:hover {\n cursor: pointer;\n }\n}\n"],"names":[],"mappings":";;;;AACE,eAAA,CAAA,mPAAA;AACA,iBAAA,CAAA,OAAA,CAAA,gBAAA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.module.scss.js","sources":["../../../../src/components/Action/styles/base.module.scss"],"sourcesContent":[".reset {\n appearance: none;\n border: 0;\n background-color: transparent;\n padding: unset;\n font: inherit;\n text-decoration: none;\n text-align: start;\n color: inherit;\n\n &:hover {\n cursor: pointer;\n }\n}\n"],"names":["___$insertStyle"],"mappings":";;AACEA,WAAA,CAAA,mPAAA;AACA,iBAAA,CAAA,OAAA,CAAA,gBAAA;;;;"}
|