@doist/reactist 28.2.2 → 28.3.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/reactist.cjs.development.js +7 -9
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/base-field/base-field.js +6 -8
- package/es/base-field/base-field.js.map +1 -1
- package/es/base-field/base-field.module.css.js +1 -1
- package/lib/base-field/base-field.js +1 -1
- package/lib/base-field/base-field.js.map +1 -1
- package/lib/base-field/base-field.module.css.js +1 -1
- package/package.json +1 -1
- package/styles/base-field.css +1 -1
- package/styles/base-field.module.css.css +1 -1
- package/styles/password-field.css +1 -1
- package/styles/reactist.css +1 -1
- package/styles/select-field.css +1 -1
- package/styles/switch-field.css +1 -1
- package/styles/text-area.css +1 -1
- package/styles/text-field.css +1 -1
|
@@ -96,15 +96,13 @@ function BaseField({
|
|
|
96
96
|
const [characterCount, setCharacterCount] = React.useState(inputLength.count);
|
|
97
97
|
const [characterCountTone, setCharacterCountTone] = React.useState(inputLength.tone);
|
|
98
98
|
const ariaDescribedBy = originalAriaDescribedBy != null ? originalAriaDescribedBy : message ? messageId : null;
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
* If the characterCountPosition value is 'hidden', it returns null.
|
|
102
|
-
*/
|
|
99
|
+
const renderCharacterCountBelow = characterCountPosition === 'below' && characterCount !== null;
|
|
100
|
+
const renderCharacterCountInline = characterCountPosition === 'inline' && characterCount !== null;
|
|
103
101
|
|
|
104
102
|
function renderCharacterCount() {
|
|
105
|
-
return
|
|
103
|
+
return /*#__PURE__*/React.createElement(FieldCharacterCount, {
|
|
106
104
|
tone: characterCountTone
|
|
107
|
-
}, characterCount)
|
|
105
|
+
}, characterCount);
|
|
108
106
|
}
|
|
109
107
|
|
|
110
108
|
const childrenProps = _objectSpread2(_objectSpread2({
|
|
@@ -129,7 +127,7 @@ function BaseField({
|
|
|
129
127
|
},
|
|
130
128
|
|
|
131
129
|
// If the character count is inline, we pass it as a prop to the children element so it can be rendered inline
|
|
132
|
-
characterCountElement:
|
|
130
|
+
characterCountElement: renderCharacterCountInline ? renderCharacterCount() : null
|
|
133
131
|
});
|
|
134
132
|
|
|
135
133
|
React.useEffect(function updateCharacterCountOnPropChange() {
|
|
@@ -169,7 +167,7 @@ function BaseField({
|
|
|
169
167
|
}, label) : null), auxiliaryLabel ? /*#__PURE__*/React.createElement(Box, {
|
|
170
168
|
className: modules_540a88ff.auxiliaryLabel,
|
|
171
169
|
paddingLeft: "small"
|
|
172
|
-
}, auxiliaryLabel) : null) : null, children(childrenProps)), endSlot && endSlotPosition === 'fullHeight' ? endSlot : null), message ||
|
|
170
|
+
}, auxiliaryLabel) : null) : null, children(childrenProps)), endSlot && endSlotPosition === 'fullHeight' ? endSlot : null), message || renderCharacterCountBelow ? /*#__PURE__*/React.createElement(Columns, {
|
|
173
171
|
align: "right",
|
|
174
172
|
space: "small",
|
|
175
173
|
maxWidth: maxWidth
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-field.js","sources":["../../src/base-field/base-field.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box, BoxProps } from '../box'\nimport { useId } from '../utils/common-helpers'\nimport { Text } from '../text'\nimport styles from './base-field.module.css'\nimport { Stack } from '../stack'\n\nimport type { WithEnhancedClassName } from '../utils/common-types'\nimport { Spinner } from '../spinner'\nimport { Column, Columns } from '../columns'\n\n// Define the remaining characters before the character count turns red\n// See: https://twist.com/a/1585/ch/765851/t/6664583/c/93631846 for latest spec\nconst MAX_LENGTH_THRESHOLD = 0\n\ntype FieldTone = 'neutral' | 'success' | 'error' | 'loading'\n\ntype FieldMessageProps = {\n id: string\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction fieldToneToTextTone(tone: FieldTone) {\n return tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'secondary'\n}\n\nfunction FieldMessage({ id, children, tone }: FieldMessageProps) {\n return (\n <Text as=\"p\" tone={fieldToneToTextTone(tone)} size=\"copy\" id={id}>\n {tone === 'loading' ? (\n <Box\n as=\"span\"\n marginRight=\"xsmall\"\n display=\"inlineFlex\"\n className={styles.loadingIcon}\n >\n <Spinner size={16} />\n </Box>\n ) : null}\n {children}\n </Text>\n )\n}\n\ntype FieldCharacterCountProps = {\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction FieldCharacterCount({ children, tone }: FieldCharacterCountProps) {\n return (\n <Text tone={fieldToneToTextTone(tone)} size=\"copy\">\n {children}\n </Text>\n )\n}\n\ntype ValidateInputLengthProps = {\n value?: React.InputHTMLAttributes<unknown>['value']\n maxLength?: number\n}\n\ntype ValidateInputLengthResult = {\n count: string | null\n tone: FieldTone\n}\n\nfunction validateInputLength({\n value,\n maxLength,\n}: ValidateInputLengthProps): ValidateInputLengthResult {\n if (!maxLength) {\n return {\n count: null,\n tone: 'neutral',\n }\n }\n\n const currentLength = String(value || '').length\n const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD\n\n return {\n count: `${currentLength}/${maxLength}`,\n tone: isNearMaxLength ? 'error' : 'neutral',\n }\n}\n\n//\n// BaseField\n//\n\ntype ChildrenRenderProps = {\n id: string\n value?: React.InputHTMLAttributes<unknown>['value']\n 'aria-describedby'?: string\n 'aria-invalid'?: true\n onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>\n characterCountElement?: React.ReactNode | null\n}\n\ntype HtmlInputProps<T extends HTMLElement> = React.DetailedHTMLProps<\n React.InputHTMLAttributes<T>,\n T\n>\n\ntype BaseFieldVariant = 'default' | 'bordered'\ntype BaseFieldVariantProps = {\n /**\n * Provides alternative visual layouts or modes that the field can be rendered in.\n *\n * Namely, there are two variants supported:\n *\n * - the default one\n * - a \"bordered\" variant, where the border of the field surrounds also the labels, instead\n * of just surrounding the actual field element\n *\n * In both cases, the message and description texts for the field lie outside the bordered\n * area.\n */\n variant?: BaseFieldVariant\n}\n\nexport type BaseFieldProps = WithEnhancedClassName &\n Pick<HtmlInputProps<HTMLInputElement>, 'id' | 'hidden' | 'maxLength' | 'aria-describedby'> & {\n /**\n * The main label for this field element.\n *\n * This prop is not optional. Consumers of field components must be explicit about not\n * wanting a label by passing `label=\"\"` or `label={null}`. In those situations, consumers\n * should make sure that fields are properly labelled semantically by other means (e.g using\n * `aria-labelledby`, or rendering a `<label />` element referencing the field by id).\n *\n * Avoid providing interactive elements in the label. Prefer `auxiliaryLabel` for that.\n *\n * @see BaseFieldProps['auxiliaryLabel']\n */\n label: React.ReactNode\n\n /**\n * The initial value for this field element.\n *\n * This prop is used to calculate the character count for the initial value, and is then\n * passed to the underlying child element.\n */\n value?: React.InputHTMLAttributes<unknown>['value']\n\n /**\n * An optional extra element to be placed to the right of the main label.\n *\n * This extra element is not included in the accessible name of the field element. Its only\n * purpose is either visual, or functional (if you include interactive elements in it).\n *\n * @see BaseFieldProps['label']\n *\n * @deprecated The usage of this element is discouraged given that it was removed from the\n * latest form field spec revision.\n */\n auxiliaryLabel?: React.ReactNode\n\n /**\n * A message associated with the field. It is rendered below the field, and with an\n * appearance that conveys the tone of the field (e.g. coloured red for errors, green for\n * success, etc).\n *\n * The message element is associated to the field via the `aria-describedby` attribute.\n *\n * In the future, when `aria-errormessage` gets better user agent support, we should use it\n * to associate the filed with a message when tone is `\"error\"`.\n *\n * @see BaseFieldProps['tone']\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid\n */\n message?: React.ReactNode\n\n /**\n * The tone with which the message, if any, is presented.\n *\n * If the tone is `\"error\"`, the field border turns red, and the message, if any, is also\n * red.\n *\n * When the tone is `\"loading\"`, it is recommended that you also disable the field. However,\n * this is not enforced by the component. It is only a recommendation.\n *\n * @see BaseFieldProps['message']\n * @see BaseFieldProps['hint']\n */\n tone?: FieldTone\n\n /**\n * The maximum width that the input field can expand to.\n */\n maxWidth?: BoxProps['maxWidth']\n\n /**\n * The maximum number of characters that the input field can accept.\n * When this limit is reached, the input field will not accept any more characters.\n * The counter element will turn red when the number of characters is within 10 of the maximum limit.\n */\n maxLength?: number\n\n /**\n * Used internally by components composed using `BaseField`. It is not exposed as part of\n * the public props of such components.\n */\n children: (props: ChildrenRenderProps) => React.ReactNode\n\n /**\n * The position of the character count element.\n * It can be shown below the field or inline with the field.\n *\n * @default 'below'\n */\n characterCountPosition?: 'below' | 'inline' | 'hidden'\n } & (\n | {\n supportsStartAndEndSlots?: false\n endSlot?: never\n endSlotPosition?: never\n }\n | {\n supportsStartAndEndSlots: true\n endSlot?: React.ReactElement | string | number\n /**\n * This is solely for `bordered` variants of TextField. When set to `bottom` (the default),\n * the endSlot will be placed inline with the input field. When set to `fullHeight`, the endSlot\n * will be placed to the side of both the input field and the label.\n */\n endSlotPosition?: 'bottom' | 'fullHeight'\n }\n )\n\ntype FieldComponentProps<T extends HTMLElement> = Omit<\n BaseFieldProps,\n 'children' | 'className' | 'fieldRef' | 'variant'\n> &\n Omit<HtmlInputProps<T>, 'className' | 'style'>\n\n/**\n * BaseField is a base component that provides a consistent structure for form fields.\n */\nfunction BaseField({\n variant = 'default',\n label,\n value,\n auxiliaryLabel,\n message,\n tone = 'neutral',\n className,\n children,\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': originalAriaDescribedBy,\n id: originalId,\n characterCountPosition = 'below',\n endSlot,\n endSlotPosition = 'bottom',\n}: BaseFieldProps & BaseFieldVariantProps & WithEnhancedClassName) {\n const id = useId(originalId)\n const messageId = useId()\n\n const inputLength = validateInputLength({ value, maxLength })\n\n const [characterCount, setCharacterCount] = React.useState<string | null>(inputLength.count)\n const [characterCountTone, setCharacterCountTone] = React.useState<FieldTone>(inputLength.tone)\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : null)\n\n /**\n * Renders the character count element.\n * If the characterCountPosition value is 'hidden', it returns null.\n */\n function renderCharacterCount() {\n return characterCountPosition !== 'hidden' ? (\n <FieldCharacterCount tone={characterCountTone}>{characterCount}</FieldCharacterCount>\n ) : null\n }\n\n const childrenProps: ChildrenRenderProps = {\n id,\n value,\n ...(ariaDescribedBy ? { 'aria-describedby': ariaDescribedBy } : {}),\n 'aria-invalid': tone === 'error' ? true : undefined,\n onChange(event) {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value: event.currentTarget.value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n // If the character count is inline, we pass it as a prop to the children element so it can be rendered inline\n characterCountElement: characterCountPosition === 'inline' ? renderCharacterCount() : null,\n }\n\n React.useEffect(\n function updateCharacterCountOnPropChange() {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n [maxLength, value],\n )\n\n return (\n <Stack space=\"xsmall\" hidden={hidden}>\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n className={[\n className,\n styles.container,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n maxWidth={maxWidth}\n alignItems=\"center\"\n >\n <Box flexGrow={1}>\n {label || auxiliaryLabel ? (\n <Box\n as=\"span\"\n display=\"flex\"\n justifyContent=\"spaceBetween\"\n alignItems=\"flexEnd\"\n >\n <Text\n size={variant === 'bordered' ? 'caption' : 'body'}\n as=\"label\"\n htmlFor={id}\n >\n {label ? (\n <span className={styles.primaryLabel}>{label}</span>\n ) : null}\n </Text>\n {auxiliaryLabel ? (\n <Box className={styles.auxiliaryLabel} paddingLeft=\"small\">\n {auxiliaryLabel}\n </Box>\n ) : null}\n </Box>\n ) : null}\n {children(childrenProps)}\n </Box>\n {endSlot && endSlotPosition === 'fullHeight' ? endSlot : null}\n </Box>\n\n {message || characterCount ? (\n <Columns align=\"right\" space=\"small\" maxWidth={maxWidth}>\n {message ? (\n <Column width=\"auto\">\n <FieldMessage id={messageId} tone={tone}>\n {message}\n </FieldMessage>\n </Column>\n ) : null}\n\n {/* If the character count is below the field, we render it, if it's inline,\n we pass it as a prop to the children element so it can be rendered inline */}\n {characterCountPosition === 'below' ? (\n <Column width=\"content\">{renderCharacterCount()}</Column>\n ) : null}\n </Columns>\n ) : null}\n </Stack>\n )\n}\n\nexport { BaseField, FieldMessage }\nexport type { BaseFieldVariant, BaseFieldVariantProps, FieldComponentProps }\n"],"names":["MAX_LENGTH_THRESHOLD","fieldToneToTextTone","tone","FieldMessage","id","children","React","Text","as","size","createElement","Box","marginRight","display","className","styles","loadingIcon","Spinner","FieldCharacterCount","validateInputLength","value","maxLength","count","currentLength","String","length","isNearMaxLength","BaseField","variant","label","auxiliaryLabel","message","maxWidth","hidden","originalAriaDescribedBy","originalId","characterCountPosition","endSlot","endSlotPosition","useId","messageId","inputLength","characterCount","setCharacterCount","useState","characterCountTone","setCharacterCountTone","ariaDescribedBy","renderCharacterCount","childrenProps","_objectSpread","undefined","onChange","event","currentTarget","characterCountElement","useEffect","updateCharacterCountOnPropChange","Stack","space","flexDirection","container","error","bordered","alignItems","flexGrow","justifyContent","htmlFor","primaryLabel","paddingLeft","Columns","align","Column","width"],"mappings":";;;;;;;;;;AAYA;;AACA,MAAMA,oBAAoB,GAAG,CAA7B,CAAA;;AAUA,SAASC,mBAAT,CAA6BC,IAA7B,EAA4C;AACxC,EAAA,OAAOA,IAAI,KAAK,OAAT,GAAmB,QAAnB,GAA8BA,IAAI,KAAK,SAAT,GAAqB,UAArB,GAAkC,WAAvE,CAAA;AACH,CAAA;;AAED,SAASC,YAAT,CAAsB;EAAEC,EAAF;EAAMC,QAAN;AAAgBH,EAAAA,IAAAA;AAAhB,CAAtB,EAA+D;AAC3D,EAAA,oBACII,mBAAA,CAACC,IAAD,EAAK;AAACC,IAAAA,EAAE,EAAC,GAAJ;AAAQN,IAAAA,IAAI,EAAED,mBAAmB,CAACC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AAAA,WAAW,EAAC,OAAA;AAA9C,GAAL,EACKvC,cADL,CADW,GAIX,IAnBR,CADH,GAsBG,IAvBR,EAwBKzB,QAAQ,CAAC4C,aAAD,CAxBb,CAZJ,EAsCKZ,OAAO,IAAIC,eAAe,KAAK,YAA/B,GAA8CD,OAA9C,GAAwD,IAtC7D,CADJ,EA0CKN,OAAO,IAAIW,cAAX,gBACGpC,mBAAA,CAACgE,OAAD,EAAQ;AAACC,IAAAA,KAAK,EAAC,OAAP;AAAeZ,IAAAA,KAAK,EAAC,OAArB;AAA6B3B,IAAAA,QAAQ,EAAEA,QAAAA;GAA/C,EACKD,OAAO,gBACJzB,mBAAA,CAACkE,MAAD,EAAO;AAACC,IAAAA,KAAK,EAAC,MAAA;AAAP,GAAP,eACInE,KAAA,CAAAI,aAAA,CAACP,YAAD,EAAc;AAAAC,IAAAA,EAAE,EAAEoC,SAAJ;AAAetC,IAAAA,IAAI,EAAEA,IAAAA;AAArB,GAAd,EACK6B,OADL,CADJ,CADI,GAMJ,IAPR,EAWKK,sBAAsB,KAAK,OAA3B,gBACG9B,KAAC,CAAAI,aAAD,CAAC8D,MAAD,EAAQ;AAAAC,IAAAA,KAAK,EAAC,SAAA;GAAd,EAAyBzB,oBAAoB,EAA7C,CADH,GAEG,IAbR,CADH,GAgBG,IA1DR,CADJ,CAAA;AA8DH;;;;"}
|
|
1
|
+
{"version":3,"file":"base-field.js","sources":["../../src/base-field/base-field.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box, BoxProps } from '../box'\nimport { useId } from '../utils/common-helpers'\nimport { Text } from '../text'\nimport styles from './base-field.module.css'\nimport { Stack } from '../stack'\n\nimport type { WithEnhancedClassName } from '../utils/common-types'\nimport { Spinner } from '../spinner'\nimport { Column, Columns } from '../columns'\n\n// Define the remaining characters before the character count turns red\n// See: https://twist.com/a/1585/ch/765851/t/6664583/c/93631846 for latest spec\nconst MAX_LENGTH_THRESHOLD = 0\n\ntype FieldTone = 'neutral' | 'success' | 'error' | 'loading'\n\ntype FieldMessageProps = {\n id: string\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction fieldToneToTextTone(tone: FieldTone) {\n return tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'secondary'\n}\n\nfunction FieldMessage({ id, children, tone }: FieldMessageProps) {\n return (\n <Text as=\"p\" tone={fieldToneToTextTone(tone)} size=\"copy\" id={id}>\n {tone === 'loading' ? (\n <Box\n as=\"span\"\n marginRight=\"xsmall\"\n display=\"inlineFlex\"\n className={styles.loadingIcon}\n >\n <Spinner size={16} />\n </Box>\n ) : null}\n {children}\n </Text>\n )\n}\n\ntype FieldCharacterCountProps = {\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction FieldCharacterCount({ children, tone }: FieldCharacterCountProps) {\n return (\n <Text tone={fieldToneToTextTone(tone)} size=\"copy\">\n {children}\n </Text>\n )\n}\n\ntype ValidateInputLengthProps = {\n value?: React.InputHTMLAttributes<unknown>['value']\n maxLength?: number\n}\n\ntype ValidateInputLengthResult = {\n count: string | null\n tone: FieldTone\n}\n\nfunction validateInputLength({\n value,\n maxLength,\n}: ValidateInputLengthProps): ValidateInputLengthResult {\n if (!maxLength) {\n return {\n count: null,\n tone: 'neutral',\n }\n }\n\n const currentLength = String(value || '').length\n const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD\n\n return {\n count: `${currentLength}/${maxLength}`,\n tone: isNearMaxLength ? 'error' : 'neutral',\n }\n}\n\n//\n// BaseField\n//\n\ntype ChildrenRenderProps = {\n id: string\n value?: React.InputHTMLAttributes<unknown>['value']\n 'aria-describedby'?: string\n 'aria-invalid'?: true\n onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>\n characterCountElement?: React.ReactNode | null\n}\n\ntype HtmlInputProps<T extends HTMLElement> = React.DetailedHTMLProps<\n React.InputHTMLAttributes<T>,\n T\n>\n\ntype BaseFieldVariant = 'default' | 'bordered'\ntype BaseFieldVariantProps = {\n /**\n * Provides alternative visual layouts or modes that the field can be rendered in.\n *\n * Namely, there are two variants supported:\n *\n * - the default one\n * - a \"bordered\" variant, where the border of the field surrounds also the labels, instead\n * of just surrounding the actual field element\n *\n * In both cases, the message and description texts for the field lie outside the bordered\n * area.\n */\n variant?: BaseFieldVariant\n}\n\nexport type BaseFieldProps = WithEnhancedClassName &\n Pick<HtmlInputProps<HTMLInputElement>, 'id' | 'hidden' | 'maxLength' | 'aria-describedby'> & {\n /**\n * The main label for this field element.\n *\n * This prop is not optional. Consumers of field components must be explicit about not\n * wanting a label by passing `label=\"\"` or `label={null}`. In those situations, consumers\n * should make sure that fields are properly labelled semantically by other means (e.g using\n * `aria-labelledby`, or rendering a `<label />` element referencing the field by id).\n *\n * Avoid providing interactive elements in the label. Prefer `auxiliaryLabel` for that.\n *\n * @see BaseFieldProps['auxiliaryLabel']\n */\n label: React.ReactNode\n\n /**\n * The initial value for this field element.\n *\n * This prop is used to calculate the character count for the initial value, and is then\n * passed to the underlying child element.\n */\n value?: React.InputHTMLAttributes<unknown>['value']\n\n /**\n * An optional extra element to be placed to the right of the main label.\n *\n * This extra element is not included in the accessible name of the field element. Its only\n * purpose is either visual, or functional (if you include interactive elements in it).\n *\n * @see BaseFieldProps['label']\n *\n * @deprecated The usage of this element is discouraged given that it was removed from the\n * latest form field spec revision.\n */\n auxiliaryLabel?: React.ReactNode\n\n /**\n * A message associated with the field. It is rendered below the field, and with an\n * appearance that conveys the tone of the field (e.g. coloured red for errors, green for\n * success, etc).\n *\n * The message element is associated to the field via the `aria-describedby` attribute.\n *\n * In the future, when `aria-errormessage` gets better user agent support, we should use it\n * to associate the filed with a message when tone is `\"error\"`.\n *\n * @see BaseFieldProps['tone']\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid\n */\n message?: React.ReactNode\n\n /**\n * The tone with which the message, if any, is presented.\n *\n * If the tone is `\"error\"`, the field border turns red, and the message, if any, is also\n * red.\n *\n * When the tone is `\"loading\"`, it is recommended that you also disable the field. However,\n * this is not enforced by the component. It is only a recommendation.\n *\n * @see BaseFieldProps['message']\n * @see BaseFieldProps['hint']\n */\n tone?: FieldTone\n\n /**\n * The maximum width that the input field can expand to.\n */\n maxWidth?: BoxProps['maxWidth']\n\n /**\n * The maximum number of characters that the input field can accept.\n * When this limit is reached, the input field will not accept any more characters.\n * The counter element will turn red when the number of characters is within 10 of the maximum limit.\n */\n maxLength?: number\n\n /**\n * Used internally by components composed using `BaseField`. It is not exposed as part of\n * the public props of such components.\n */\n children: (props: ChildrenRenderProps) => React.ReactNode\n\n /**\n * The position of the character count element.\n * It can be shown below the field or inline with the field.\n *\n * @default 'below'\n */\n characterCountPosition?: 'below' | 'inline' | 'hidden'\n } & (\n | {\n supportsStartAndEndSlots?: false\n endSlot?: never\n endSlotPosition?: never\n }\n | {\n supportsStartAndEndSlots: true\n endSlot?: React.ReactElement | string | number\n /**\n * This is solely for `bordered` variants of TextField. When set to `bottom` (the default),\n * the endSlot will be placed inline with the input field. When set to `fullHeight`, the endSlot\n * will be placed to the side of both the input field and the label.\n */\n endSlotPosition?: 'bottom' | 'fullHeight'\n }\n )\n\ntype FieldComponentProps<T extends HTMLElement> = Omit<\n BaseFieldProps,\n 'children' | 'className' | 'fieldRef' | 'variant'\n> &\n Omit<HtmlInputProps<T>, 'className' | 'style'>\n\n/**\n * BaseField is a base component that provides a consistent structure for form fields.\n */\nfunction BaseField({\n variant = 'default',\n label,\n value,\n auxiliaryLabel,\n message,\n tone = 'neutral',\n className,\n children,\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': originalAriaDescribedBy,\n id: originalId,\n characterCountPosition = 'below',\n endSlot,\n endSlotPosition = 'bottom',\n}: BaseFieldProps & BaseFieldVariantProps & WithEnhancedClassName) {\n const id = useId(originalId)\n const messageId = useId()\n\n const inputLength = validateInputLength({ value, maxLength })\n\n const [characterCount, setCharacterCount] = React.useState<string | null>(inputLength.count)\n const [characterCountTone, setCharacterCountTone] = React.useState<FieldTone>(inputLength.tone)\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : null)\n\n const renderCharacterCountBelow = characterCountPosition === 'below' && characterCount !== null\n const renderCharacterCountInline =\n characterCountPosition === 'inline' && characterCount !== null\n\n function renderCharacterCount() {\n return <FieldCharacterCount tone={characterCountTone}>{characterCount}</FieldCharacterCount>\n }\n\n const childrenProps: ChildrenRenderProps = {\n id,\n value,\n ...(ariaDescribedBy ? { 'aria-describedby': ariaDescribedBy } : {}),\n 'aria-invalid': tone === 'error' ? true : undefined,\n onChange(event) {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value: event.currentTarget.value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n // If the character count is inline, we pass it as a prop to the children element so it can be rendered inline\n characterCountElement: renderCharacterCountInline ? renderCharacterCount() : null,\n }\n\n React.useEffect(\n function updateCharacterCountOnPropChange() {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n [maxLength, value],\n )\n\n return (\n <Stack space=\"xsmall\" hidden={hidden}>\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n className={[\n className,\n styles.container,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n maxWidth={maxWidth}\n alignItems=\"center\"\n >\n <Box flexGrow={1}>\n {label || auxiliaryLabel ? (\n <Box\n as=\"span\"\n display=\"flex\"\n justifyContent=\"spaceBetween\"\n alignItems=\"flexEnd\"\n >\n <Text\n size={variant === 'bordered' ? 'caption' : 'body'}\n as=\"label\"\n htmlFor={id}\n >\n {label ? (\n <span className={styles.primaryLabel}>{label}</span>\n ) : null}\n </Text>\n {auxiliaryLabel ? (\n <Box className={styles.auxiliaryLabel} paddingLeft=\"small\">\n {auxiliaryLabel}\n </Box>\n ) : null}\n </Box>\n ) : null}\n {children(childrenProps)}\n </Box>\n {endSlot && endSlotPosition === 'fullHeight' ? endSlot : null}\n </Box>\n\n {message || renderCharacterCountBelow ? (\n <Columns align=\"right\" space=\"small\" maxWidth={maxWidth}>\n {message ? (\n <Column width=\"auto\">\n <FieldMessage id={messageId} tone={tone}>\n {message}\n </FieldMessage>\n </Column>\n ) : null}\n\n {/* If the character count is below the field, we render it, if it's inline,\n we pass it as a prop to the children element so it can be rendered inline */}\n {characterCountPosition === 'below' ? (\n <Column width=\"content\">{renderCharacterCount()}</Column>\n ) : null}\n </Columns>\n ) : null}\n </Stack>\n )\n}\n\nexport { BaseField, FieldMessage }\nexport type { BaseFieldVariant, BaseFieldVariantProps, FieldComponentProps }\n"],"names":["MAX_LENGTH_THRESHOLD","fieldToneToTextTone","tone","FieldMessage","id","children","React","Text","as","size","createElement","Box","marginRight","display","className","styles","loadingIcon","Spinner","FieldCharacterCount","validateInputLength","value","maxLength","count","currentLength","String","length","isNearMaxLength","BaseField","variant","label","auxiliaryLabel","message","maxWidth","hidden","originalAriaDescribedBy","originalId","characterCountPosition","endSlot","endSlotPosition","useId","messageId","inputLength","characterCount","setCharacterCount","useState","characterCountTone","setCharacterCountTone","ariaDescribedBy","renderCharacterCountBelow","renderCharacterCountInline","renderCharacterCount","childrenProps","_objectSpread","undefined","onChange","event","currentTarget","characterCountElement","useEffect","updateCharacterCountOnPropChange","Stack","space","flexDirection","container","error","bordered","alignItems","flexGrow","justifyContent","htmlFor","primaryLabel","paddingLeft","Columns","align","Column","width"],"mappings":";;;;;;;;;;AAYA;;AACA,MAAMA,oBAAoB,GAAG,CAA7B,CAAA;;AAUA,SAASC,mBAAT,CAA6BC,IAA7B,EAA4C;AACxC,EAAA,OAAOA,IAAI,KAAK,OAAT,GAAmB,QAAnB,GAA8BA,IAAI,KAAK,SAAT,GAAqB,UAArB,GAAkC,WAAvE,CAAA;AACH,CAAA;;AAED,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+
var modules_540a88ff = {"container":"_73a117b9","auxiliaryLabel":"b5fd58e9","bordered":"_5c9cc34c","error":"_51ba84e7","primaryLabel":"ade93d9a","loadingIcon":"_35882154"};
|
|
2
2
|
|
|
3
3
|
export { modules_540a88ff as default };
|
|
4
4
|
//# sourceMappingURL=base-field.module.css.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),n=require("../box/box.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../_virtual/_rollupPluginBabelHelpers.js"),t=require("react"),n=require("../box/box.js"),l=require("../utils/common-helpers.js"),r=require("../text/text.js"),a=require("./base-field.module.css.js"),u=require("../stack/stack.js"),o=require("../spinner/spinner.js"),i=require("../columns/columns.js");function s(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,t}var c=s(t);function d(e){return"error"===e?"danger":"success"===e?"positive":"secondary"}function m({id:e,children:t,tone:l}){return c.createElement(r.Text,{as:"p",tone:d(l),size:"copy",id:e},"loading"===l?c.createElement(n.Box,{as:"span",marginRight:"xsmall",display:"inlineFlex",className:a.default.loadingIcon},c.createElement(o.Spinner,{size:16})):null,t)}function f({children:e,tone:t}){return c.createElement(r.Text,{tone:d(t),size:"copy"},e)}function x({value:e,maxLength:t}){if(!t)return{count:null,tone:"neutral"};const n=String(e||"").length;return{count:n+"/"+t,tone:t-n<=0?"error":"neutral"}}exports.BaseField=function({variant:t="default",label:o,value:s,auxiliaryLabel:d,message:p,tone:b="neutral",className:g,children:h,maxWidth:E,maxLength:v,hidden:y,"aria-describedby":j,id:q,characterCountPosition:w="below",endSlot:L,endSlotPosition:S="bottom"}){const B=l.useId(q),C=l.useId(),O=x({value:s,maxLength:v}),[P,_]=c.useState(O.count),[I,N]=c.useState(O.tone),k=null!=j?j:p?C:null,z="below"===w&&null!==P,F="inline"===w&&null!==P;function T(){return c.createElement(f,{tone:I},P)}const M=e.objectSpread2(e.objectSpread2({id:B,value:s},k?{"aria-describedby":k}:{}),{},{"aria-invalid":"error"===b||void 0,onChange(e){if(!v)return;const t=x({value:e.currentTarget.value,maxLength:v});_(t.count),N(t.tone)},characterCountElement:F?T():null});return c.useEffect((function(){if(!v)return;const e=x({value:s,maxLength:v});_(e.count),N(e.tone)}),[v,s]),c.createElement(u.Stack,{space:"xsmall",hidden:y},c.createElement(n.Box,{display:"flex",flexDirection:"row",className:[g,a.default.container,"error"===b?a.default.error:null,"bordered"===t?a.default.bordered:null],maxWidth:E,alignItems:"center"},c.createElement(n.Box,{flexGrow:1},o||d?c.createElement(n.Box,{as:"span",display:"flex",justifyContent:"spaceBetween",alignItems:"flexEnd"},c.createElement(r.Text,{size:"bordered"===t?"caption":"body",as:"label",htmlFor:B},o?c.createElement("span",{className:a.default.primaryLabel},o):null),d?c.createElement(n.Box,{className:a.default.auxiliaryLabel,paddingLeft:"small"},d):null):null,h(M)),L&&"fullHeight"===S?L:null),p||z?c.createElement(i.Columns,{align:"right",space:"small",maxWidth:E},p?c.createElement(i.Column,{width:"auto"},c.createElement(m,{id:C,tone:b},p)):null,"below"===w?c.createElement(i.Column,{width:"content"},T()):null):null)},exports.FieldMessage=m;
|
|
2
2
|
//# sourceMappingURL=base-field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-field.js","sources":["../../src/base-field/base-field.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box, BoxProps } from '../box'\nimport { useId } from '../utils/common-helpers'\nimport { Text } from '../text'\nimport styles from './base-field.module.css'\nimport { Stack } from '../stack'\n\nimport type { WithEnhancedClassName } from '../utils/common-types'\nimport { Spinner } from '../spinner'\nimport { Column, Columns } from '../columns'\n\n// Define the remaining characters before the character count turns red\n// See: https://twist.com/a/1585/ch/765851/t/6664583/c/93631846 for latest spec\nconst MAX_LENGTH_THRESHOLD = 0\n\ntype FieldTone = 'neutral' | 'success' | 'error' | 'loading'\n\ntype FieldMessageProps = {\n id: string\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction fieldToneToTextTone(tone: FieldTone) {\n return tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'secondary'\n}\n\nfunction FieldMessage({ id, children, tone }: FieldMessageProps) {\n return (\n <Text as=\"p\" tone={fieldToneToTextTone(tone)} size=\"copy\" id={id}>\n {tone === 'loading' ? (\n <Box\n as=\"span\"\n marginRight=\"xsmall\"\n display=\"inlineFlex\"\n className={styles.loadingIcon}\n >\n <Spinner size={16} />\n </Box>\n ) : null}\n {children}\n </Text>\n )\n}\n\ntype FieldCharacterCountProps = {\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction FieldCharacterCount({ children, tone }: FieldCharacterCountProps) {\n return (\n <Text tone={fieldToneToTextTone(tone)} size=\"copy\">\n {children}\n </Text>\n )\n}\n\ntype ValidateInputLengthProps = {\n value?: React.InputHTMLAttributes<unknown>['value']\n maxLength?: number\n}\n\ntype ValidateInputLengthResult = {\n count: string | null\n tone: FieldTone\n}\n\nfunction validateInputLength({\n value,\n maxLength,\n}: ValidateInputLengthProps): ValidateInputLengthResult {\n if (!maxLength) {\n return {\n count: null,\n tone: 'neutral',\n }\n }\n\n const currentLength = String(value || '').length\n const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD\n\n return {\n count: `${currentLength}/${maxLength}`,\n tone: isNearMaxLength ? 'error' : 'neutral',\n }\n}\n\n//\n// BaseField\n//\n\ntype ChildrenRenderProps = {\n id: string\n value?: React.InputHTMLAttributes<unknown>['value']\n 'aria-describedby'?: string\n 'aria-invalid'?: true\n onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>\n characterCountElement?: React.ReactNode | null\n}\n\ntype HtmlInputProps<T extends HTMLElement> = React.DetailedHTMLProps<\n React.InputHTMLAttributes<T>,\n T\n>\n\ntype BaseFieldVariant = 'default' | 'bordered'\ntype BaseFieldVariantProps = {\n /**\n * Provides alternative visual layouts or modes that the field can be rendered in.\n *\n * Namely, there are two variants supported:\n *\n * - the default one\n * - a \"bordered\" variant, where the border of the field surrounds also the labels, instead\n * of just surrounding the actual field element\n *\n * In both cases, the message and description texts for the field lie outside the bordered\n * area.\n */\n variant?: BaseFieldVariant\n}\n\nexport type BaseFieldProps = WithEnhancedClassName &\n Pick<HtmlInputProps<HTMLInputElement>, 'id' | 'hidden' | 'maxLength' | 'aria-describedby'> & {\n /**\n * The main label for this field element.\n *\n * This prop is not optional. Consumers of field components must be explicit about not\n * wanting a label by passing `label=\"\"` or `label={null}`. In those situations, consumers\n * should make sure that fields are properly labelled semantically by other means (e.g using\n * `aria-labelledby`, or rendering a `<label />` element referencing the field by id).\n *\n * Avoid providing interactive elements in the label. Prefer `auxiliaryLabel` for that.\n *\n * @see BaseFieldProps['auxiliaryLabel']\n */\n label: React.ReactNode\n\n /**\n * The initial value for this field element.\n *\n * This prop is used to calculate the character count for the initial value, and is then\n * passed to the underlying child element.\n */\n value?: React.InputHTMLAttributes<unknown>['value']\n\n /**\n * An optional extra element to be placed to the right of the main label.\n *\n * This extra element is not included in the accessible name of the field element. Its only\n * purpose is either visual, or functional (if you include interactive elements in it).\n *\n * @see BaseFieldProps['label']\n *\n * @deprecated The usage of this element is discouraged given that it was removed from the\n * latest form field spec revision.\n */\n auxiliaryLabel?: React.ReactNode\n\n /**\n * A message associated with the field. It is rendered below the field, and with an\n * appearance that conveys the tone of the field (e.g. coloured red for errors, green for\n * success, etc).\n *\n * The message element is associated to the field via the `aria-describedby` attribute.\n *\n * In the future, when `aria-errormessage` gets better user agent support, we should use it\n * to associate the filed with a message when tone is `\"error\"`.\n *\n * @see BaseFieldProps['tone']\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid\n */\n message?: React.ReactNode\n\n /**\n * The tone with which the message, if any, is presented.\n *\n * If the tone is `\"error\"`, the field border turns red, and the message, if any, is also\n * red.\n *\n * When the tone is `\"loading\"`, it is recommended that you also disable the field. However,\n * this is not enforced by the component. It is only a recommendation.\n *\n * @see BaseFieldProps['message']\n * @see BaseFieldProps['hint']\n */\n tone?: FieldTone\n\n /**\n * The maximum width that the input field can expand to.\n */\n maxWidth?: BoxProps['maxWidth']\n\n /**\n * The maximum number of characters that the input field can accept.\n * When this limit is reached, the input field will not accept any more characters.\n * The counter element will turn red when the number of characters is within 10 of the maximum limit.\n */\n maxLength?: number\n\n /**\n * Used internally by components composed using `BaseField`. It is not exposed as part of\n * the public props of such components.\n */\n children: (props: ChildrenRenderProps) => React.ReactNode\n\n /**\n * The position of the character count element.\n * It can be shown below the field or inline with the field.\n *\n * @default 'below'\n */\n characterCountPosition?: 'below' | 'inline' | 'hidden'\n } & (\n | {\n supportsStartAndEndSlots?: false\n endSlot?: never\n endSlotPosition?: never\n }\n | {\n supportsStartAndEndSlots: true\n endSlot?: React.ReactElement | string | number\n /**\n * This is solely for `bordered` variants of TextField. When set to `bottom` (the default),\n * the endSlot will be placed inline with the input field. When set to `fullHeight`, the endSlot\n * will be placed to the side of both the input field and the label.\n */\n endSlotPosition?: 'bottom' | 'fullHeight'\n }\n )\n\ntype FieldComponentProps<T extends HTMLElement> = Omit<\n BaseFieldProps,\n 'children' | 'className' | 'fieldRef' | 'variant'\n> &\n Omit<HtmlInputProps<T>, 'className' | 'style'>\n\n/**\n * BaseField is a base component that provides a consistent structure for form fields.\n */\nfunction BaseField({\n variant = 'default',\n label,\n value,\n auxiliaryLabel,\n message,\n tone = 'neutral',\n className,\n children,\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': originalAriaDescribedBy,\n id: originalId,\n characterCountPosition = 'below',\n endSlot,\n endSlotPosition = 'bottom',\n}: BaseFieldProps & BaseFieldVariantProps & WithEnhancedClassName) {\n const id = useId(originalId)\n const messageId = useId()\n\n const inputLength = validateInputLength({ value, maxLength })\n\n const [characterCount, setCharacterCount] = React.useState<string | null>(inputLength.count)\n const [characterCountTone, setCharacterCountTone] = React.useState<FieldTone>(inputLength.tone)\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : null)\n\n /**\n * Renders the character count element.\n * If the characterCountPosition value is 'hidden', it returns null.\n */\n function renderCharacterCount() {\n return characterCountPosition !== 'hidden' ? (\n <FieldCharacterCount tone={characterCountTone}>{characterCount}</FieldCharacterCount>\n ) : null\n }\n\n const childrenProps: ChildrenRenderProps = {\n id,\n value,\n ...(ariaDescribedBy ? { 'aria-describedby': ariaDescribedBy } : {}),\n 'aria-invalid': tone === 'error' ? true : undefined,\n onChange(event) {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value: event.currentTarget.value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n // If the character count is inline, we pass it as a prop to the children element so it can be rendered inline\n characterCountElement: characterCountPosition === 'inline' ? renderCharacterCount() : null,\n }\n\n React.useEffect(\n function updateCharacterCountOnPropChange() {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n [maxLength, value],\n )\n\n return (\n <Stack space=\"xsmall\" hidden={hidden}>\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n className={[\n className,\n styles.container,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n maxWidth={maxWidth}\n alignItems=\"center\"\n >\n <Box flexGrow={1}>\n {label || auxiliaryLabel ? (\n <Box\n as=\"span\"\n display=\"flex\"\n justifyContent=\"spaceBetween\"\n alignItems=\"flexEnd\"\n >\n <Text\n size={variant === 'bordered' ? 'caption' : 'body'}\n as=\"label\"\n htmlFor={id}\n >\n {label ? (\n <span className={styles.primaryLabel}>{label}</span>\n ) : null}\n </Text>\n {auxiliaryLabel ? (\n <Box className={styles.auxiliaryLabel} paddingLeft=\"small\">\n {auxiliaryLabel}\n </Box>\n ) : null}\n </Box>\n ) : null}\n {children(childrenProps)}\n </Box>\n {endSlot && endSlotPosition === 'fullHeight' ? endSlot : null}\n </Box>\n\n {message || characterCount ? (\n <Columns align=\"right\" space=\"small\" maxWidth={maxWidth}>\n {message ? (\n <Column width=\"auto\">\n <FieldMessage id={messageId} tone={tone}>\n {message}\n </FieldMessage>\n </Column>\n ) : null}\n\n {/* If the character count is below the field, we render it, if it's inline,\n we pass it as a prop to the children element so it can be rendered inline */}\n {characterCountPosition === 'below' ? (\n <Column width=\"content\">{renderCharacterCount()}</Column>\n ) : null}\n </Columns>\n ) : null}\n </Stack>\n )\n}\n\nexport { BaseField, FieldMessage }\nexport type { BaseFieldVariant, BaseFieldVariantProps, FieldComponentProps }\n"],"names":["fieldToneToTextTone","tone","FieldMessage","id","children","React","Text","as","size","createElement","Box","marginRight","display","className","styles","loadingIcon","Spinner","FieldCharacterCount","validateInputLength","value","maxLength","count","currentLength","String","length","variant","label","auxiliaryLabel","message","maxWidth","hidden","aria-describedby","originalAriaDescribedBy","originalId","characterCountPosition","endSlot","endSlotPosition","useId","messageId","inputLength","characterCount","setCharacterCount","useState","characterCountTone","setCharacterCountTone","ariaDescribedBy","renderCharacterCount","childrenProps","_objectSpread","objectSpread2","aria-invalid","undefined","onChange","event","currentTarget","characterCountElement","useEffect","Stack","space","flexDirection","container","error","bordered","alignItems","flexGrow","justifyContent","htmlFor","primaryLabel","paddingLeft","Columns","align","Column","width"],"mappings":"ypBAuBA,SAASA,EAAoBC,GACzB,MAAgB,UAATA,EAAmB,SAAoB,YAATA,EAAqB,WAAa,YAG3E,SAASC,GAAaC,GAAEA,EAAFC,SAAMA,EAANH,KAAgBA,IAClC,OACII,gBAACC,OAAI,CAACC,GAAG,IAAIN,KAAMD,EAA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AAM,QAAQZ,MAAM,QAAQ7B,SAAUA,GAC1CD,EACGvB,gBAACkE,SAAM,CAACC,MAAM,QACVnE,EAAAI,cAACP,EAAa,CAAAC,GAAImC,EAAWrC,KAAMA,GAC9B2B,IAGT,KAIwB,UAA3BM,EACG7B,EAACI,cAAA8D,SAAO,CAAAC,MAAM,WAAW1B,KACzB,MAER"}
|
|
1
|
+
{"version":3,"file":"base-field.js","sources":["../../src/base-field/base-field.tsx"],"sourcesContent":["import * as React from 'react'\nimport { Box, BoxProps } from '../box'\nimport { useId } from '../utils/common-helpers'\nimport { Text } from '../text'\nimport styles from './base-field.module.css'\nimport { Stack } from '../stack'\n\nimport type { WithEnhancedClassName } from '../utils/common-types'\nimport { Spinner } from '../spinner'\nimport { Column, Columns } from '../columns'\n\n// Define the remaining characters before the character count turns red\n// See: https://twist.com/a/1585/ch/765851/t/6664583/c/93631846 for latest spec\nconst MAX_LENGTH_THRESHOLD = 0\n\ntype FieldTone = 'neutral' | 'success' | 'error' | 'loading'\n\ntype FieldMessageProps = {\n id: string\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction fieldToneToTextTone(tone: FieldTone) {\n return tone === 'error' ? 'danger' : tone === 'success' ? 'positive' : 'secondary'\n}\n\nfunction FieldMessage({ id, children, tone }: FieldMessageProps) {\n return (\n <Text as=\"p\" tone={fieldToneToTextTone(tone)} size=\"copy\" id={id}>\n {tone === 'loading' ? (\n <Box\n as=\"span\"\n marginRight=\"xsmall\"\n display=\"inlineFlex\"\n className={styles.loadingIcon}\n >\n <Spinner size={16} />\n </Box>\n ) : null}\n {children}\n </Text>\n )\n}\n\ntype FieldCharacterCountProps = {\n children: React.ReactNode\n tone: FieldTone\n}\n\nfunction FieldCharacterCount({ children, tone }: FieldCharacterCountProps) {\n return (\n <Text tone={fieldToneToTextTone(tone)} size=\"copy\">\n {children}\n </Text>\n )\n}\n\ntype ValidateInputLengthProps = {\n value?: React.InputHTMLAttributes<unknown>['value']\n maxLength?: number\n}\n\ntype ValidateInputLengthResult = {\n count: string | null\n tone: FieldTone\n}\n\nfunction validateInputLength({\n value,\n maxLength,\n}: ValidateInputLengthProps): ValidateInputLengthResult {\n if (!maxLength) {\n return {\n count: null,\n tone: 'neutral',\n }\n }\n\n const currentLength = String(value || '').length\n const isNearMaxLength = maxLength - currentLength <= MAX_LENGTH_THRESHOLD\n\n return {\n count: `${currentLength}/${maxLength}`,\n tone: isNearMaxLength ? 'error' : 'neutral',\n }\n}\n\n//\n// BaseField\n//\n\ntype ChildrenRenderProps = {\n id: string\n value?: React.InputHTMLAttributes<unknown>['value']\n 'aria-describedby'?: string\n 'aria-invalid'?: true\n onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>\n characterCountElement?: React.ReactNode | null\n}\n\ntype HtmlInputProps<T extends HTMLElement> = React.DetailedHTMLProps<\n React.InputHTMLAttributes<T>,\n T\n>\n\ntype BaseFieldVariant = 'default' | 'bordered'\ntype BaseFieldVariantProps = {\n /**\n * Provides alternative visual layouts or modes that the field can be rendered in.\n *\n * Namely, there are two variants supported:\n *\n * - the default one\n * - a \"bordered\" variant, where the border of the field surrounds also the labels, instead\n * of just surrounding the actual field element\n *\n * In both cases, the message and description texts for the field lie outside the bordered\n * area.\n */\n variant?: BaseFieldVariant\n}\n\nexport type BaseFieldProps = WithEnhancedClassName &\n Pick<HtmlInputProps<HTMLInputElement>, 'id' | 'hidden' | 'maxLength' | 'aria-describedby'> & {\n /**\n * The main label for this field element.\n *\n * This prop is not optional. Consumers of field components must be explicit about not\n * wanting a label by passing `label=\"\"` or `label={null}`. In those situations, consumers\n * should make sure that fields are properly labelled semantically by other means (e.g using\n * `aria-labelledby`, or rendering a `<label />` element referencing the field by id).\n *\n * Avoid providing interactive elements in the label. Prefer `auxiliaryLabel` for that.\n *\n * @see BaseFieldProps['auxiliaryLabel']\n */\n label: React.ReactNode\n\n /**\n * The initial value for this field element.\n *\n * This prop is used to calculate the character count for the initial value, and is then\n * passed to the underlying child element.\n */\n value?: React.InputHTMLAttributes<unknown>['value']\n\n /**\n * An optional extra element to be placed to the right of the main label.\n *\n * This extra element is not included in the accessible name of the field element. Its only\n * purpose is either visual, or functional (if you include interactive elements in it).\n *\n * @see BaseFieldProps['label']\n *\n * @deprecated The usage of this element is discouraged given that it was removed from the\n * latest form field spec revision.\n */\n auxiliaryLabel?: React.ReactNode\n\n /**\n * A message associated with the field. It is rendered below the field, and with an\n * appearance that conveys the tone of the field (e.g. coloured red for errors, green for\n * success, etc).\n *\n * The message element is associated to the field via the `aria-describedby` attribute.\n *\n * In the future, when `aria-errormessage` gets better user agent support, we should use it\n * to associate the filed with a message when tone is `\"error\"`.\n *\n * @see BaseFieldProps['tone']\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-errormessage\n * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-invalid\n */\n message?: React.ReactNode\n\n /**\n * The tone with which the message, if any, is presented.\n *\n * If the tone is `\"error\"`, the field border turns red, and the message, if any, is also\n * red.\n *\n * When the tone is `\"loading\"`, it is recommended that you also disable the field. However,\n * this is not enforced by the component. It is only a recommendation.\n *\n * @see BaseFieldProps['message']\n * @see BaseFieldProps['hint']\n */\n tone?: FieldTone\n\n /**\n * The maximum width that the input field can expand to.\n */\n maxWidth?: BoxProps['maxWidth']\n\n /**\n * The maximum number of characters that the input field can accept.\n * When this limit is reached, the input field will not accept any more characters.\n * The counter element will turn red when the number of characters is within 10 of the maximum limit.\n */\n maxLength?: number\n\n /**\n * Used internally by components composed using `BaseField`. It is not exposed as part of\n * the public props of such components.\n */\n children: (props: ChildrenRenderProps) => React.ReactNode\n\n /**\n * The position of the character count element.\n * It can be shown below the field or inline with the field.\n *\n * @default 'below'\n */\n characterCountPosition?: 'below' | 'inline' | 'hidden'\n } & (\n | {\n supportsStartAndEndSlots?: false\n endSlot?: never\n endSlotPosition?: never\n }\n | {\n supportsStartAndEndSlots: true\n endSlot?: React.ReactElement | string | number\n /**\n * This is solely for `bordered` variants of TextField. When set to `bottom` (the default),\n * the endSlot will be placed inline with the input field. When set to `fullHeight`, the endSlot\n * will be placed to the side of both the input field and the label.\n */\n endSlotPosition?: 'bottom' | 'fullHeight'\n }\n )\n\ntype FieldComponentProps<T extends HTMLElement> = Omit<\n BaseFieldProps,\n 'children' | 'className' | 'fieldRef' | 'variant'\n> &\n Omit<HtmlInputProps<T>, 'className' | 'style'>\n\n/**\n * BaseField is a base component that provides a consistent structure for form fields.\n */\nfunction BaseField({\n variant = 'default',\n label,\n value,\n auxiliaryLabel,\n message,\n tone = 'neutral',\n className,\n children,\n maxWidth,\n maxLength,\n hidden,\n 'aria-describedby': originalAriaDescribedBy,\n id: originalId,\n characterCountPosition = 'below',\n endSlot,\n endSlotPosition = 'bottom',\n}: BaseFieldProps & BaseFieldVariantProps & WithEnhancedClassName) {\n const id = useId(originalId)\n const messageId = useId()\n\n const inputLength = validateInputLength({ value, maxLength })\n\n const [characterCount, setCharacterCount] = React.useState<string | null>(inputLength.count)\n const [characterCountTone, setCharacterCountTone] = React.useState<FieldTone>(inputLength.tone)\n\n const ariaDescribedBy = originalAriaDescribedBy ?? (message ? messageId : null)\n\n const renderCharacterCountBelow = characterCountPosition === 'below' && characterCount !== null\n const renderCharacterCountInline =\n characterCountPosition === 'inline' && characterCount !== null\n\n function renderCharacterCount() {\n return <FieldCharacterCount tone={characterCountTone}>{characterCount}</FieldCharacterCount>\n }\n\n const childrenProps: ChildrenRenderProps = {\n id,\n value,\n ...(ariaDescribedBy ? { 'aria-describedby': ariaDescribedBy } : {}),\n 'aria-invalid': tone === 'error' ? true : undefined,\n onChange(event) {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value: event.currentTarget.value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n // If the character count is inline, we pass it as a prop to the children element so it can be rendered inline\n characterCountElement: renderCharacterCountInline ? renderCharacterCount() : null,\n }\n\n React.useEffect(\n function updateCharacterCountOnPropChange() {\n if (!maxLength) {\n return\n }\n\n const inputLength = validateInputLength({\n value,\n maxLength,\n })\n\n setCharacterCount(inputLength.count)\n setCharacterCountTone(inputLength.tone)\n },\n [maxLength, value],\n )\n\n return (\n <Stack space=\"xsmall\" hidden={hidden}>\n <Box\n display=\"flex\"\n flexDirection=\"row\"\n className={[\n className,\n styles.container,\n tone === 'error' ? styles.error : null,\n variant === 'bordered' ? styles.bordered : null,\n ]}\n maxWidth={maxWidth}\n alignItems=\"center\"\n >\n <Box flexGrow={1}>\n {label || auxiliaryLabel ? (\n <Box\n as=\"span\"\n display=\"flex\"\n justifyContent=\"spaceBetween\"\n alignItems=\"flexEnd\"\n >\n <Text\n size={variant === 'bordered' ? 'caption' : 'body'}\n as=\"label\"\n htmlFor={id}\n >\n {label ? (\n <span className={styles.primaryLabel}>{label}</span>\n ) : null}\n </Text>\n {auxiliaryLabel ? (\n <Box className={styles.auxiliaryLabel} paddingLeft=\"small\">\n {auxiliaryLabel}\n </Box>\n ) : null}\n </Box>\n ) : null}\n {children(childrenProps)}\n </Box>\n {endSlot && endSlotPosition === 'fullHeight' ? endSlot : null}\n </Box>\n\n {message || renderCharacterCountBelow ? (\n <Columns align=\"right\" space=\"small\" maxWidth={maxWidth}>\n {message ? (\n <Column width=\"auto\">\n <FieldMessage id={messageId} tone={tone}>\n {message}\n </FieldMessage>\n </Column>\n ) : null}\n\n {/* If the character count is below the field, we render it, if it's inline,\n we pass it as a prop to the children element so it can be rendered inline */}\n {characterCountPosition === 'below' ? (\n <Column width=\"content\">{renderCharacterCount()}</Column>\n ) : null}\n </Columns>\n ) : null}\n </Stack>\n )\n}\n\nexport { BaseField, FieldMessage }\nexport type { BaseFieldVariant, BaseFieldVariantProps, FieldComponentProps }\n"],"names":["fieldToneToTextTone","tone","FieldMessage","id","children","React","Text","as","size","createElement","Box","marginRight","display","className","styles","loadingIcon","Spinner","FieldCharacterCount","validateInputLength","value","maxLength","count","currentLength","String","length","variant","label","auxiliaryLabel","message","maxWidth","hidden","aria-describedby","originalAriaDescribedBy","originalId","characterCountPosition","endSlot","endSlotPosition","useId","messageId","inputLength","characterCount","setCharacterCount","useState","characterCountTone","setCharacterCountTone","ariaDescribedBy","renderCharacterCountBelow","renderCharacterCountInline","renderCharacterCount","childrenProps","_objectSpread","objectSpread2","aria-invalid","undefined","onChange","event","currentTarget","characterCountElement","useEffect","Stack","space","flexDirection","container","error","bordered","alignItems","flexGrow","justifyContent","htmlFor","primaryLabel","paddingLeft","Columns","align","Column","width"],"mappings":"ypBAuBA,SAASA,EAAoBC,GACzB,MAAgB,UAATA,EAAmB,SAAoB,YAATA,EAAqB,WAAa,YAG3E,SAASC,GAAaC,GAAEA,EAAFC,SAAMA,EAANH,KAAgBA,IAClC,OACII,gBAACC,OAAI,CAACC,GAAG,IAAIN,KAAMD,EAAoBC,GAAOO,KAAK,OAAOL,GAAIA,GAChD,YAATF,EACGI,EAACI,cAAAC,EAAAA,IACG,CAAAH,GAAG,OACHI,YAAY,SACZC,QAAQ,aACRC,UAAWC,EAAM,QAACC,aAElBV,EAACI,cAAAO,UAAQ,CAAAR,KAAM,MAEnB,KACHJ,GAUb,SAASa,GAAoBb,SAAEA,EAAFH,KAAYA,IACrC,OACII,EAACI,cAAAH,QAAKL,KAAMD,EAAoBC,GAAOO,KAAK,QACvCJ,GAeb,SAASc,GAAoBC,MACzBA,EADyBC,UAEzBA,IAEA,IAAKA,EACD,MAAO,CACHC,MAAO,KACPpB,KAAM,WAId,MAAMqB,EAAgBC,OAAOJ,GAAS,IAAIK,OAG1C,MAAO,CACHH,MAAUC,EAAL,IAAsBF,EAC3BnB,KAJoBmB,EAAYE,GAnEX,EAuEG,QAAU,6BA8J1C,UAAmBG,QACfA,EAAU,UADKC,MAEfA,EAFeP,MAGfA,EAHeQ,eAIfA,EAJeC,QAKfA,EALe3B,KAMfA,EAAO,UANQY,UAOfA,EAPeT,SAQfA,EAReyB,SASfA,EATeT,UAU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AAmBa,EAAAA,QAAOiD,MAAQ,KACtB,aAAZtC,EAAyBX,EAAAA,QAAOkD,SAAW,MAE/CnC,SAAUA,EACVoC,WAAW,UAEX5D,EAAAI,cAACC,MAAG,CAACwD,SAAU,GACVxC,GAASC,EACNtB,EAAAI,cAACC,EAAAA,IAAG,CACAH,GAAG,OACHK,QAAQ,OACRuD,eAAe,eACfF,WAAW,WAEX5D,EAAAI,cAACH,OACG,CAAAE,KAAkB,aAAZiB,EAAyB,UAAY,OAC3ClB,GAAG,QACH6D,QAASjE,GAERuB,EACGrB,EAAAI,cAAA,OAAA,CAAMI,UAAWC,EAAM,QAACuD,cAAe3C,GACvC,MAEPC,EACGtB,EAACI,cAAAC,MAAI,CAAAG,UAAWC,EAAM,QAACa,eAAgB2C,YAAY,SAC9C3C,GAEL,MAER,KACHvB,EAAS6C,IAEbd,GAA+B,eAApBC,EAAmCD,EAAU,MAG5DP,GAAWkB,EACRzC,gBAACkE,UAAO,CAACC,MAAM,QAAQZ,MAAM,QAAQ/B,SAAUA,GAC1CD,EACGvB,gBAACoE,SAAM,CAACC,MAAM,QACVrE,EAAAI,cAACP,EAAa,CAAAC,GAAImC,EAAWrC,KAAMA,GAC9B2B,IAGT,KAIwB,UAA3BM,EACG7B,EAACI,cAAAgE,SAAO,CAAAC,MAAM,WAAW1B,KACzB,MAER"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={container:"
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={container:"_73a117b9",auxiliaryLabel:"b5fd58e9",bordered:"_5c9cc34c",error:"_51ba84e7",primaryLabel:"ade93d9a",loadingIcon:"_35882154"};
|
|
2
2
|
//# sourceMappingURL=base-field.module.css.js.map
|
package/package.json
CHANGED
package/styles/base-field.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
._68ab48ca{min-width:0}._6fa2b565{min-width:var(--reactist-width-xsmall)}.dd50fabd{min-width:var(--reactist-width-small)}.e7e2c808{min-width:var(--reactist-width-medium)}._6abbe25e{min-width:var(--reactist-width-large)}._54f479ac{min-width:var(--reactist-width-xlarge)}._148492bc{max-width:var(--reactist-width-xsmall)}.bd023b96{max-width:var(--reactist-width-small)}.e102903f{max-width:var(--reactist-width-medium)}._0e8d76d7{max-width:var(--reactist-width-large)}._47a031d0{max-width:var(--reactist-width-xlarge)}.cd4c8183{max-width:100%}._5f5959e8{width:0}._8c75067a{width:100%}._56a651f6{width:auto}._26f87bb8{width:-moz-max-content;width:-webkit-max-content;width:max-content}._07a6ab44{width:-moz-min-content;width:-webkit-min-content;width:min-content}.a87016fa{width:-moz-fit-content;width:-webkit-fit-content;width:fit-content}._1a972e50{width:var(--reactist-width-xsmall)}.c96d8261{width:var(--reactist-width-small)}.f3829d42{width:var(--reactist-width-medium)}._2caef228{width:var(--reactist-width-large)}._069e1491{width:var(--reactist-width-xlarge)}
|
|
5
5
|
._64ed24f4{gap:0}._2580a74b{gap:var(--reactist-spacing-xsmall)}.c68f8bf6{gap:var(--reactist-spacing-small)}._43e5f8e9{gap:var(--reactist-spacing-medium)}._966b120f{gap:var(--reactist-spacing-large)}.f957894c{gap:var(--reactist-spacing-xlarge)}._8cca104b{gap:var(--reactist-spacing-xxlarge)}@media (min-width:768px){._5797cee2{gap:0}._9015672f{gap:var(--reactist-spacing-xsmall)}._7ec86eec{gap:var(--reactist-spacing-small)}._714d7179{gap:var(--reactist-spacing-medium)}.ae1deb59{gap:var(--reactist-spacing-large)}.e1cfce55{gap:var(--reactist-spacing-xlarge)}._168a8ff8{gap:var(--reactist-spacing-xxlarge)}}@media (min-width:992px){._43e2b619{gap:0}._0ea9bf88{gap:var(--reactist-spacing-xsmall)}.d451307a{gap:var(--reactist-spacing-small)}.bf93cf66{gap:var(--reactist-spacing-medium)}._1430cddf{gap:var(--reactist-spacing-large)}.fa00c93e{gap:var(--reactist-spacing-xlarge)}._6f3aee54{gap:var(--reactist-spacing-xxlarge)}}
|
|
6
6
|
.a83bd4e0{font-family:var(--reactist-font-family);font-size:var(--reactist-font-size-body);font-weight:var(--reactist-font-weight-regular);color:var(--reactist-content-primary)}._266d6623{font-size:var(--reactist-font-size-caption)}.a8d37c6e{font-size:var(--reactist-font-size-copy)}._39f4eb1f{font-size:var(--reactist-font-size-subtitle)}._7be5c531{font-weight:var(--reactist-font-weight-medium)}.e214ff2e{font-weight:var(--reactist-font-weight-strong)}._6a3e5ade{color:var(--reactist-content-secondary)}._8f5b5f2b{color:var(--reactist-content-danger)}._9ae47ae4{color:var(--reactist-content-positive)}._969f18f7{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}._2f303ac3{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d3e04245{-webkit-line-clamp:2}._33411704{-webkit-line-clamp:3}.bfc32640{-webkit-line-clamp:4}.f813c82f{-webkit-line-clamp:5}
|
|
7
|
-
.
|
|
7
|
+
:root{--reactist-field-label-padding-bottom:var(--reactist-spacing-small);--reactist-field-label-line-height:inherit}._73a117b9{font-family:var(--reactist-font-family)}._73a117b9 .b5fd58e9,._73a117b9 label{padding-bottom:var(--reactist-field-label-padding-bottom);line-height:var(--reactist-field-label-line-height)}._73a117b9._5c9cc34c{border-radius:var(--reactist-border-radius-large);border:1px solid var(--reactist-inputs-idle);padding:var(--reactist-spacing-small);padding-bottom:var(--reactist-spacing-xsmall);overflow:clip}._73a117b9._5c9cc34c label{flex-grow:1;cursor:text}._73a117b9._5c9cc34c label span{cursor:default}._73a117b9._5c9cc34c:focus-within{border-color:var(--reactist-inputs-focus)!important}._73a117b9._5c9cc34c._51ba84e7{border-color:var(--reactist-inputs-alert)!important}._73a117b9._5c9cc34c .ade93d9a{font-weight:500}._73a117b9._5c9cc34c .b5fd58e9{font-size:var(--reactist-font-size-caption)}._73a117b9:not(._5c9cc34c) .ade93d9a{font-weight:var(--reactist-font-weight-strong)}._73a117b9:not(._5c9cc34c) .b5fd58e9{font-size:var(--reactist-font-size-body)}.b5fd58e9{text-align:right}._35882154{vertical-align:bottom}
|
|
8
8
|
._3f3a401c{border-bottom:1px solid var(--reactist-divider-primary)}._03b05b70{border-bottom:1px solid var(--reactist-divider-secondary)}.b6f67ff8{border-bottom:1px solid var(--reactist-divider-tertiary)}
|
|
9
9
|
:root{--reactist-spinner-tint:var(--reactist-bg-brand);--reactist-spinner-fill:var(--reactist-framework-fill-crest)}@-webkit-keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._51539197{-webkit-animation-name:_54fbe2b3;animation-name:_54fbe2b3;-webkit-animation-duration:1.2s;animation-duration:1.2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.a0c466ed{fill:var(--reactist-spinner-tint)}._745b73d3{fill:var(--reactist-spinner-fill)}
|
|
10
10
|
.eae3d34f,.eae3d34f>:last-child{--reactist-columns-gap:0px}._9b4012c9{--reactist-columns-gap:var(--reactist-spacing-xsmall)}.e35e0320{--reactist-columns-gap:var(--reactist-spacing-small)}._0703e67f{--reactist-columns-gap:var(--reactist-spacing-medium)}._1cf15621{--reactist-columns-gap:var(--reactist-spacing-large)}._1c7dff67{--reactist-columns-gap:var(--reactist-spacing-xlarge)}._25bee9b6{--reactist-columns-gap:var(--reactist-spacing-xxlarge)}._4bb9987d{flex-basis:content}._9dd31975{flex-basis:auto}._38d11c0e{flex-basis:calc(50% - var(--reactist-columns-gap))}._7ac225c6{flex-basis:calc(33.33333% - var(--reactist-columns-gap))}._9c340680{flex-basis:calc(66.66667% - var(--reactist-columns-gap))}._81cb99d2{flex-basis:calc(25% - var(--reactist-columns-gap))}._10fd355f{flex-basis:calc(75% - var(--reactist-columns-gap))}._3ee66520{flex-basis:calc(20% - var(--reactist-columns-gap))}.df1201a5{flex-basis:calc(40% - var(--reactist-columns-gap))}.f772e0b2{flex-basis:calc(60% - var(--reactist-columns-gap))}._880cbbb1{flex-basis:calc(80% - var(--reactist-columns-gap))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
:root{--reactist-field-label-padding-bottom:var(--reactist-spacing-small);--reactist-field-label-line-height:inherit}._73a117b9{font-family:var(--reactist-font-family)}._73a117b9 .b5fd58e9,._73a117b9 label{padding-bottom:var(--reactist-field-label-padding-bottom);line-height:var(--reactist-field-label-line-height)}._73a117b9._5c9cc34c{border-radius:var(--reactist-border-radius-large);border:1px solid var(--reactist-inputs-idle);padding:var(--reactist-spacing-small);padding-bottom:var(--reactist-spacing-xsmall);overflow:clip}._73a117b9._5c9cc34c label{flex-grow:1;cursor:text}._73a117b9._5c9cc34c label span{cursor:default}._73a117b9._5c9cc34c:focus-within{border-color:var(--reactist-inputs-focus)!important}._73a117b9._5c9cc34c._51ba84e7{border-color:var(--reactist-inputs-alert)!important}._73a117b9._5c9cc34c .ade93d9a{font-weight:500}._73a117b9._5c9cc34c .b5fd58e9{font-size:var(--reactist-font-size-caption)}._73a117b9:not(._5c9cc34c) .ade93d9a{font-weight:var(--reactist-font-weight-strong)}._73a117b9:not(._5c9cc34c) .b5fd58e9{font-size:var(--reactist-font-size-body)}.b5fd58e9{text-align:right}._35882154{vertical-align:bottom}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.a83bd4e0{font-family:var(--reactist-font-family);font-size:var(--reactist-font-size-body);font-weight:var(--reactist-font-weight-regular);color:var(--reactist-content-primary)}._266d6623{font-size:var(--reactist-font-size-caption)}.a8d37c6e{font-size:var(--reactist-font-size-copy)}._39f4eb1f{font-size:var(--reactist-font-size-subtitle)}._7be5c531{font-weight:var(--reactist-font-weight-medium)}.e214ff2e{font-weight:var(--reactist-font-weight-strong)}._6a3e5ade{color:var(--reactist-content-secondary)}._8f5b5f2b{color:var(--reactist-content-danger)}._9ae47ae4{color:var(--reactist-content-positive)}._969f18f7{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}._2f303ac3{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d3e04245{-webkit-line-clamp:2}._33411704{-webkit-line-clamp:3}.bfc32640{-webkit-line-clamp:4}.f813c82f{-webkit-line-clamp:5}
|
|
2
|
-
.
|
|
2
|
+
:root{--reactist-field-label-padding-bottom:var(--reactist-spacing-small);--reactist-field-label-line-height:inherit}._73a117b9{font-family:var(--reactist-font-family)}._73a117b9 .b5fd58e9,._73a117b9 label{padding-bottom:var(--reactist-field-label-padding-bottom);line-height:var(--reactist-field-label-line-height)}._73a117b9._5c9cc34c{border-radius:var(--reactist-border-radius-large);border:1px solid var(--reactist-inputs-idle);padding:var(--reactist-spacing-small);padding-bottom:var(--reactist-spacing-xsmall);overflow:clip}._73a117b9._5c9cc34c label{flex-grow:1;cursor:text}._73a117b9._5c9cc34c label span{cursor:default}._73a117b9._5c9cc34c:focus-within{border-color:var(--reactist-inputs-focus)!important}._73a117b9._5c9cc34c._51ba84e7{border-color:var(--reactist-inputs-alert)!important}._73a117b9._5c9cc34c .ade93d9a{font-weight:500}._73a117b9._5c9cc34c .b5fd58e9{font-size:var(--reactist-font-size-caption)}._73a117b9:not(._5c9cc34c) .ade93d9a{font-weight:var(--reactist-font-weight-strong)}._73a117b9:not(._5c9cc34c) .b5fd58e9{font-size:var(--reactist-font-size-body)}.b5fd58e9{text-align:right}._35882154{vertical-align:bottom}
|
|
3
3
|
._3f3a401c{border-bottom:1px solid var(--reactist-divider-primary)}._03b05b70{border-bottom:1px solid var(--reactist-divider-secondary)}.b6f67ff8{border-bottom:1px solid var(--reactist-divider-tertiary)}
|
|
4
4
|
.eae3d34f,.eae3d34f>:last-child{--reactist-columns-gap:0px}._9b4012c9{--reactist-columns-gap:var(--reactist-spacing-xsmall)}.e35e0320{--reactist-columns-gap:var(--reactist-spacing-small)}._0703e67f{--reactist-columns-gap:var(--reactist-spacing-medium)}._1cf15621{--reactist-columns-gap:var(--reactist-spacing-large)}._1c7dff67{--reactist-columns-gap:var(--reactist-spacing-xlarge)}._25bee9b6{--reactist-columns-gap:var(--reactist-spacing-xxlarge)}._4bb9987d{flex-basis:content}._9dd31975{flex-basis:auto}._38d11c0e{flex-basis:calc(50% - var(--reactist-columns-gap))}._7ac225c6{flex-basis:calc(33.33333% - var(--reactist-columns-gap))}._9c340680{flex-basis:calc(66.66667% - var(--reactist-columns-gap))}._81cb99d2{flex-basis:calc(25% - var(--reactist-columns-gap))}._10fd355f{flex-basis:calc(75% - var(--reactist-columns-gap))}._3ee66520{flex-basis:calc(20% - var(--reactist-columns-gap))}.df1201a5{flex-basis:calc(40% - var(--reactist-columns-gap))}.f772e0b2{flex-basis:calc(60% - var(--reactist-columns-gap))}._880cbbb1{flex-basis:calc(80% - var(--reactist-columns-gap))}
|
|
5
5
|
.fb8d74bb{box-sizing:border-box;border:0;margin:0;padding:0;font-size:var(--reactist-font-size-body);font-family:inherit;vertical-align:baseline;background-color:transparent;list-style:none}pre.fb8d74bb{font-family:var(--reactist-font-family-monospace)}.fb8d74bb[hidden]{display:none!important}._18f74af9{position:absolute}.b292fef1{position:fixed}.e4e217d4{position:relative}._66895b64{position:-webkit-sticky;position:sticky}@media (min-width:768px){._00e8a0ce{position:absolute}.efaf64be{position:fixed}._76e540fd{position:relative}.bd286900{position:-webkit-sticky;position:sticky}}@media (min-width:992px){._09e9f472{position:absolute}._893383f1{position:fixed}.dea3890d{position:relative}._6a61c94d{position:-webkit-sticky;position:sticky}}._64dcc902{display:block}._14423c92{display:flex}._6a38242d{display:inline}._348efc1f{display:inline-block}._150907c8{display:inline-flex}._3da48ad6{display:none}@media (min-width:768px){._0daac9f2{display:block}.f62c43b1{display:flex}._5839a4e4{display:inline}._8068aaf2{display:inline-block}._76562ea5{display:inline-flex}._4f7a886f{display:none}}@media (min-width:992px){._4fd4b789{display:block}._4d08e78f{display:flex}._0da15585{display:inline}.d0fcc019{display:inline-block}._79f967d4{display:inline-flex}._2ffa0d03{display:none}}._2d7320f2{flex-direction:column}._5f8879d9{flex-direction:row}@media (min-width:768px){._2c919a43{flex-direction:column}._4da1f194{flex-direction:row}}@media (min-width:992px){._66fd35ea{flex-direction:column}._4b79448d{flex-direction:row}}._202b0c8c{flex-wrap:wrap}._45a8f27f{flex-wrap:nowrap}._7d9ec5b0{flex-shrink:0}._9ce442fb{flex-grow:0}.c3b69d70{flex-grow:1}._7cc6458c{align-items:flex-start}.b76144ce{align-items:center}.e42ffab4{align-items:flex-end}._3975b234{align-items:baseline}@media (min-width:768px){.b670f77e{align-items:flex-start}._976e7156{align-items:center}._385c60b1{align-items:flex-end}._52b577fc{align-items:baseline}}@media (min-width:992px){._2e1cc27f{align-items:flex-start}._3a9e51e9{align-items:center}.dfc189b2{align-items:flex-end}._5fabaec4{align-items:baseline}}.a65d9c55{justify-content:flex-start}.b4e05554{justify-content:center}.f76804e6{justify-content:flex-end}._0095203e{justify-content:space-around}._6eb365d1{justify-content:space-between}._4111e641{justify-content:space-evenly}@media (min-width:768px){._6fda855d{justify-content:flex-start}.c2d359f8{justify-content:center}.e271941d{justify-content:flex-end}._2321488d{justify-content:space-around}.e4a9b2e3{justify-content:space-between}.bdc232f2{justify-content:space-evenly}}@media (min-width:992px){._0d16bb5c{justify-content:flex-start}.eca8082a{justify-content:center}._97ea6bb7{justify-content:flex-end}._2321488d{justify-content:space-around}._58e61602{justify-content:space-between}.bdc232f2{justify-content:space-evenly}}._794c8ab8{align-self:stretch}.c510efd5{align-self:flex-start}.b3f71626{align-self:center}._13771d73{align-self:flex-end}._64318454{align-self:baseline}@media (min-width:768px){._309c6ba7{align-self:stretch}._92dfd036{align-self:flex-start}._811f9906{align-self:center}._2cd2336e{align-self:flex-end}.bd2c9dad{align-self:baseline}}@media (min-width:992px){.d8215926{align-self:stretch}.b78f5c06{align-self:flex-start}._683e0cdb{align-self:center}._489f1dc8{align-self:flex-end}._4aca1032{align-self:baseline}}._68aab614{overflow:hidden}.ac28a3b1{overflow:auto}._50b88b52{overflow:visible}.c2fdd1c1{overflow:scroll}._75ca308a{height:100%}.a9ca9830{background-color:var(--reactist-bg-default)}.b9ff0c93{background-color:var(--reactist-bg-aside)}.efc303e5{background-color:var(--reactist-bg-highlight)}.ec657626{background-color:var(--reactist-bg-selected)}._00d3482f{background-color:var(--reactist-bg-toast);color:var(--reactist-content-primary);--reactist-content-primary:var(--reactist-toast-content-primary);--reactist-content-secondary:var(--reactist-toast-content-secondary);--reactist-text-link-idle-tint:var(--reactist-content-primary);--reactist-text-link-idle-decoration:var(--reactist-text-link-hover-decoration);--reactist-actionable-tertiary-idle-tint:var(--reactist-toast-actionable-primary-tint);--reactist-actionable-tertiary-hover-tint:var(--reactist-toast-actionable-primary-tint);--reactist-actionable-tertiary-hover-fill:var(--reactist-toast-actionable-hover-fill);--reactist-actionable-quaternary-idle-tint:var(--reactist-toast-actionable-secondary-tint);--reactist-actionable-quaternary-hover-tint:var(--reactist-toast-actionable-secondary-tint);--reactist-actionable-quaternary-hover-fill:var(--reactist-toast-actionable-hover-fill)}._958da546{border-radius:var(--reactist-border-radius-small)}._79077c62{border-radius:var(--reactist-border-radius-large)}._68981e89{border:1px solid var(--reactist-divider-primary)}._2bda8f7a{border:1px solid var(--reactist-divider-secondary)}._7152c573{border:1px solid var(--reactist-divider-tertiary)}._1f362dec{text-align:start}._1c09cd18{text-align:center}.b9663f5e{text-align:end}.a0eba489{text-align:justify}@media (min-width:768px){._60b9abf8{text-align:start}._2c70943c{text-align:center}.a512d4e1{text-align:end}._5d02c334{text-align:justify}}@media (min-width:992px){.ad2496a1{text-align:start}.ee87b016{text-align:center}._6dd48127{text-align:end}._1e70d216{text-align:justify}}
|
package/styles/reactist.css
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
:root{--reactist-button-small-font-size:var(--reactist-font-size-caption);--reactist-button-small-spacing:var(--reactist-spacing-small);--reactist-button-small-height:28px;--reactist-button-normal-font-size:var(--reactist-font-size-copy);--reactist-button-normal-spacing:var(--reactist-spacing-medium);--reactist-button-normal-height:32px;--reactist-button-large-font-size:var(--reactist-font-size-body);--reactist-button-large-spacing:var(--reactist-spacing-large);--reactist-button-large-height:36px;--reactist-actionable-primary-idle-tint:#fff;--reactist-actionable-primary-idle-fill:#008aa6;--reactist-actionable-primary-hover-tint:#fff;--reactist-actionable-primary-hover-fill:#007992;--reactist-actionable-primary-disabled-tint:#fff;--reactist-actionable-primary-disabled-fill:#99d0db;--reactist-actionable-secondary-idle-tint:#282f30;--reactist-actionable-secondary-idle-fill:#f2f6f7;--reactist-actionable-secondary-hover-tint:#282f30;--reactist-actionable-secondary-hover-fill:#e3e7e8;--reactist-actionable-secondary-disabled-tint:#a9acac;--reactist-actionable-secondary-disabled-fill:#f2f6f7;--reactist-actionable-tertiary-idle-tint:#006f85;--reactist-actionable-tertiary-hover-tint:#006f85;--reactist-actionable-tertiary-hover-fill:#f2f6f7;--reactist-actionable-tertiary-disabled-tint:#99c5ce;--reactist-actionable-quaternary-idle-tint:#6c777a;--reactist-actionable-quaternary-hover-tint:#282f30;--reactist-actionable-quaternary-hover-fill:#e0e7e8;--reactist-actionable-quaternary-disabled-tint:#c4c9ca;--reactist-actionable-primary-destructive-idle-tint:#fff;--reactist-actionable-primary-destructive-idle-fill:#dc4c3e;--reactist-actionable-primary-destructive-hover-tint:#fff;--reactist-actionable-primary-destructive-hover-fill:#b03d32;--reactist-actionable-primary-destructive-disabled-tint:#fff;--reactist-actionable-primary-destructive-disabled-fill:#f1b7b2;--reactist-actionable-secondary-destructive-idle-tint:#dc4c3e;--reactist-actionable-secondary-destructive-hover-tint:#b03d32;--reactist-actionable-secondary-destructive-hover-fill:transparent;--reactist-actionable-secondary-destructive-disabled-tint:#f1b7b2}._3930afa0{max-width:100%;display:flex;flex-direction:row;justify-content:center;align-items:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:inherit;background-color:transparent;border-radius:var(--reactist-border-radius-small);white-space:nowrap;font-family:var(--reactist-font-family);font-weight:var(--reactist-font-weight-medium);text-decoration:none;border:1px solid transparent;transition-duration:.3s;transition-property:color,background-color;transition-timing-function:cubic-bezier(.4,0,.2,1)}._90654824{text-overflow:ellipsis;white-space:nowrap;font-size:inherit}._3930afa0:active:not([aria-disabled=true]){transform:scale(.97);transition:transform .2s cubic-bezier(.02,1.505,.745,1.235)}._3930afa0{padding:0 var(--reactist-btn-spacing);font-size:var(--reactist-btn-font-size);height:var(--reactist-btn-height);line-height:var(--reactist-btn-height);--reactist-spinner-tint:var(--reactist-btn-idle-tint);--reactist-spinner-fill:var(--reactist-btn-idle-fill)}._3930afa0.c05d17c2{border-radius:1000px}._3930afa0._1e29d236{--reactist-btn-height:var(--reactist-button-small-height);--reactist-btn-spacing:var(--reactist-button-small-spacing);--reactist-btn-font-size:var(--reactist-button-small-font-size)}._3930afa0._7246d092{--reactist-btn-height:var(--reactist-button-normal-height);--reactist-btn-spacing:var(--reactist-button-normal-spacing);--reactist-btn-font-size:var(--reactist-button-normal-font-size)}._3930afa0._2d084671{--reactist-btn-height:var(--reactist-button-large-height);--reactist-btn-spacing:var(--reactist-button-large-spacing);--reactist-btn-font-size:var(--reactist-button-large-font-size)}._3930afa0:not(._2b0b9d95){color:var(--reactist-btn-idle-tint);background-color:var(--reactist-btn-idle-fill)}._3930afa0:focus-visible:not([aria-disabled=true]),._3930afa0:hover:not([aria-disabled=true]),._3930afa0[aria-expanded=true]{color:var(--reactist-btn-hover-tint);background-color:var(--reactist-btn-hover-fill)}._3930afa0._2b0b9d95{cursor:not-allowed;color:var(--reactist-btn-disabled-tint);background-color:var(--reactist-btn-disabled-fill)}._3930afa0:not(.abd5766f){min-width:68px}._3930afa0.abd5766f{width:var(--reactist-btn-height);height:var(--reactist-btn-height);padding:0}._3930afa0 ._380e7c73{margin-right:calc(var(--reactist-btn-spacing) - 6px);margin-left:-6px}._3930afa0 ._20fe4105{margin-left:calc(var(--reactist-btn-spacing) - 6px);margin-right:-6px}._3930afa0>*{pointer-events:none}._7ea1378e{--reactist-btn-idle-tint:var(--reactist-actionable-primary-idle-tint);--reactist-btn-idle-fill:var(--reactist-actionable-primary-idle-fill);--reactist-btn-hover-tint:var(--reactist-actionable-primary-hover-tint);--reactist-btn-hover-fill:var(--reactist-actionable-primary-hover-fill);--reactist-btn-disabled-tint:var(--reactist-actionable-primary-disabled-tint);--reactist-btn-disabled-fill:var(--reactist-actionable-primary-disabled-fill)}._64ee8afd{--reactist-btn-idle-tint:var(--reactist-actionable-secondary-idle-tint);--reactist-btn-idle-fill:var(--reactist-actionable-secondary-idle-fill);--reactist-btn-hover-tint:var(--reactist-actionable-secondary-hover-tint);--reactist-btn-hover-fill:var(--reactist-actionable-secondary-hover-fill);--reactist-btn-disabled-tint:var(--reactist-actionable-secondary-disabled-tint);--reactist-btn-disabled-fill:var(--reactist-actionable-secondary-disabled-fill)}._650176bf{--reactist-btn-idle-tint:var(--reactist-actionable-tertiary-idle-tint);--reactist-btn-hover-tint:var(--reactist-actionable-tertiary-hover-tint);--reactist-btn-hover-fill:var(--reactist-actionable-tertiary-hover-fill);--reactist-btn-disabled-tint:var(--reactist-actionable-tertiary-disabled-tint)}.aa19cb97,._650176bf{--reactist-btn-idle-fill:transparent;--reactist-btn-disabled-fill:transparent}.aa19cb97{--reactist-btn-idle-tint:var(--reactist-actionable-quaternary-idle-tint);--reactist-btn-hover-tint:var(--reactist-actionable-quaternary-hover-tint);--reactist-btn-hover-fill:var(--reactist-actionable-quaternary-hover-fill);--reactist-btn-disabled-tint:var(--reactist-actionable-quaternary-disabled-tint)}._7ea1378e._7a2d9a8c{--reactist-btn-idle-tint:var(--reactist-actionable-primary-destructive-idle-tint);--reactist-btn-idle-fill:var(--reactist-actionable-primary-destructive-idle-fill);--reactist-btn-hover-tint:var(--reactist-actionable-primary-destructive-hover-tint);--reactist-btn-hover-fill:var(--reactist-actionable-primary-destructive-hover-fill);--reactist-btn-disabled-tint:var(--reactist-actionable-primary-destructive-disabled-tint);--reactist-btn-disabled-fill:var(--reactist-actionable-primary-destructive-disabled-fill)}._64ee8afd._7a2d9a8c{--reactist-btn-idle-tint:var(--reactist-actionable-secondary-destructive-idle-tint);--reactist-btn-idle-fill:transparent;--reactist-btn-hover-tint:var(--reactist-actionable-secondary-destructive-hover-tint);--reactist-btn-hover-fill:var(--reactist-actionable-secondary-destructive-hover-fill);--reactist-btn-disabled-tint:var(--reactist-actionable-secondary-destructive-disabled-tint);--reactist-btn-disabled-fill:transparent;border-color:var(--reactist-btn-idle-tint)}._64ee8afd._7a2d9a8c:hover{border-color:var(--reactist-btn-hover-tint)}._64ee8afd._7a2d9a8c._2b0b9d95{border-color:var(--reactist-btn-disabled-tint)}.aa19cb97._7a2d9a8c,._650176bf._7a2d9a8c{--reactist-btn-idle-tint:var(--reactist-actionable-secondary-destructive-idle-tint);--reactist-btn-hover-tint:var(--reactist-actionable-secondary-destructive-hover-tint);--reactist-btn-disabled-tint:var(--reactist-actionable-secondary-destructive-disabled-tint)}
|
|
20
20
|
:root{--reactist-text-link-idle-tint:var(--reactist-actionable-tertiary-idle-tint);--reactist-text-link-hover-tint:var(--reactist-actionable-tertiary-hover-tint);--reactist-text-link-idle-decoration:underline;--reactist-text-link-hover-decoration:underline}.d77fcdc6{font-size:inherit;font-weight:inherit;font-family:inherit;cursor:pointer}.d77fcdc6 svg{display:inline-block;width:1em;height:1em;font-size:inherit;color:inherit;vertical-align:-.125em;fill:currentColor;padding:0 6px}._468ce45c,._468ce45c *{color:var(--reactist-text-link-idle-tint)}._468ce45c:hover,._468ce45c:hover *{color:var(--reactist-text-link-hover-tint)}._54f92a1e,._54f92a1e *{color:inherit}._54f92a1e:hover,._54f92a1e:hover *{color:var(--reactist-text-link-hover-tint)}.cdc8b08c,.cdc8b08c *{-webkit-text-decoration:var(--reactist-text-link-idle-decoration);text-decoration:var(--reactist-text-link-idle-decoration)}.cdc8b08c:hover,.cdc8b08c:hover *{-webkit-text-decoration:var(--reactist-text-link-hover-decoration);text-decoration:var(--reactist-text-link-hover-decoration)}._06995bac,._06995bac *{text-decoration:none}._06995bac:hover,._06995bac:hover *{-webkit-text-decoration:var(--reactist-text-link-hover-decoration);text-decoration:var(--reactist-text-link-hover-decoration)}
|
|
21
21
|
._84dfdb83{position:relative}._84dfdb83,._84dfdb83 *{cursor:pointer;font-family:var(--reactist-font-family)}._84dfdb83._131a2ca4,._84dfdb83._131a2ca4 *{cursor:not-allowed}._84dfdb83._131a2ca4{opacity:.5}._84dfdb83 svg{color:var(--reactist-content-secondary);border-radius:5px;min-width:24px}._84dfdb83._95b1556d svg{color:var(--reactist-switch-checked)}._84dfdb83 input[type=checkbox]{display:block;height:16px;left:0;margin:4px;opacity:0;position:absolute;top:0;width:16px}._84dfdb83._49de7ebd svg{border:2px solid var(--reactist-actionable-primary-idle-fill)}._6b4b1851{margin-left:12px}._9047f3bd{margin-left:6px}
|
|
22
|
-
.
|
|
22
|
+
:root{--reactist-field-label-padding-bottom:var(--reactist-spacing-small);--reactist-field-label-line-height:inherit}._73a117b9{font-family:var(--reactist-font-family)}._73a117b9 .b5fd58e9,._73a117b9 label{padding-bottom:var(--reactist-field-label-padding-bottom);line-height:var(--reactist-field-label-line-height)}._73a117b9._5c9cc34c{border-radius:var(--reactist-border-radius-large);border:1px solid var(--reactist-inputs-idle);padding:var(--reactist-spacing-small);padding-bottom:var(--reactist-spacing-xsmall);overflow:clip}._73a117b9._5c9cc34c label{flex-grow:1;cursor:text}._73a117b9._5c9cc34c label span{cursor:default}._73a117b9._5c9cc34c:focus-within{border-color:var(--reactist-inputs-focus)!important}._73a117b9._5c9cc34c._51ba84e7{border-color:var(--reactist-inputs-alert)!important}._73a117b9._5c9cc34c .ade93d9a{font-weight:500}._73a117b9._5c9cc34c .b5fd58e9{font-size:var(--reactist-font-size-caption)}._73a117b9:not(._5c9cc34c) .ade93d9a{font-weight:var(--reactist-font-weight-strong)}._73a117b9:not(._5c9cc34c) .b5fd58e9{font-size:var(--reactist-font-size-body)}.b5fd58e9{text-align:right}._35882154{vertical-align:bottom}
|
|
23
23
|
.b930bb07{width:100%;position:relative}.b930bb07.e1f620b6 select{padding:0;height:24px;border-color:transparent;outline:none}.b930bb07 svg{position:absolute;right:10px;top:8px;bottom:8px;color:var(--reactist-content-secondary)}.b930bb07 select{position:relative;z-index:1;--tmp-desired-height:32px;--tmp-line-height-increase:4px;--tmp-vertical-padding:calc((var(--tmp-desired-height) - var(--reactist-font-size-body) - var(--tmp-line-height-increase))/2);padding:var(--tmp-vertical-padding) 10px;padding-right:30px;-webkit-appearance:none;-moz-appearance:none;appearance:none;box-sizing:border-box;width:100%;color:var(--reactist-content-primary);background:none;border-radius:var(--reactist-border-radius-small);border:1px solid var(--reactist-inputs-idle);font-size:var(--reactist-font-size-body);line-height:calc(var(--reactist-font-size-body) + 4px);margin:0}.b930bb07:not(.e1f620b6)._7e87474e select{border-color:var(--reactist-inputs-alert)!important}.b930bb07:not(.e1f620b6) option{background-color:var(--reactist-bg-aside)}.b930bb07:not(.e1f620b6) select:focus{border-color:var(--reactist-inputs-focus)}
|
|
24
24
|
:root{--reactist-switch-background:var(--reactist-framework-fill-summit);--reactist-switch-checked:var(--reactist-content-positive);--reactist-switch-toggle:var(--reactist-bg-default)}.bae487be,.bae487be *{font-family:var(--reactist-font-family);cursor:pointer}.bae487be._408d32a0,.bae487be._408d32a0 *{cursor:not-allowed}.bae487be._408d32a0._99b0ead7 ._5af09fb5,.bae487be._408d32a0 .a66e1846{opacity:.5}._5af09fb5{--tmp-switch-width:32px;--tmp-switch-height:18px;--tmp-inner-padding:3px;--tmp-handle-size:calc(var(--tmp-switch-height) - 2*var(--tmp-inner-padding));--tmp-slide-length:calc(var(--tmp-switch-width) - var(--tmp-handle-size) - var(--tmp-inner-padding));min-height:auto;border-radius:calc(var(--tmp-switch-height)/2);background-color:var(--reactist-switch-background);cursor:pointer;position:relative}._5af09fb5,._5af09fb5>div,._5af09fb5 input[type=checkbox]{width:var(--tmp-switch-width);height:var(--tmp-switch-height)}._0dcf70ec{position:absolute;display:block;padding:0;top:var(--tmp-inner-padding);left:var(--tmp-inner-padding);width:var(--tmp-handle-size);height:var(--tmp-handle-size);border-radius:50%;background:var(--reactist-switch-toggle);transition:left .28s cubic-bezier(.4,0,.2,1)}._99b0ead7 ._5af09fb5{background-color:var(--reactist-switch-checked)}._99b0ead7 ._5af09fb5 ._0dcf70ec{left:var(--tmp-slide-length)}.bae487be._1f5e7fd4 ._5af09fb5:after{border-radius:calc(var(--tmp-switch-height) + 4px);border:2px solid var(--reactist-actionable-primary-idle-fill);bottom:-4px;content:"";left:-4px;position:absolute;right:-4px;top:-4px}
|
|
25
25
|
.a95cb864{font-family:var(--reactist-font-family)}.ab9873f7:after,.a95cb864 textarea{outline:none;border:none;padding:0;box-sizing:border-box;font:inherit;width:100%;resize:vertical;overflow-wrap:anywhere}.a95cb864 textarea[readonly]{background-color:var(--reactist-field-readonly-background);color:var(--reactist-content-primary)}.a95cb864:not(.de380efd) .ab9873f7:after,.a95cb864:not(.de380efd) textarea{border-radius:var(--reactist-border-radius-small);padding:var(--reactist-spacing-small)}.a95cb864.de380efd{border-radius:var(--reactist-border-radius-large)}.a95cb864.de380efd,.a95cb864:not(.de380efd) .ab9873f7:after,.a95cb864:not(.de380efd) textarea{border:1px solid var(--reactist-inputs-idle)}.a95cb864.de380efd:focus-within,.a95cb864:not(.de380efd) textarea:focus{border-color:var(--reactist-inputs-focus)}.a95cb864.de380efd._29a9d12f,.a95cb864._29a9d12f:not(.de380efd) .ab9873f7:after,.a95cb864._29a9d12f:not(.de380efd) textarea{border-color:var(--reactist-inputs-alert)!important}.ab9873f7{display:grid}.ab9873f7:after{content:attr(data-replicated-value) " ";white-space:pre-wrap;visibility:hidden}.ab9873f7:after,.ab9873f7>textarea{grid-area:1/1/2/2}textarea._44f7147e{resize:none;overflow:hidden}
|
package/styles/select-field.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.a83bd4e0{font-family:var(--reactist-font-family);font-size:var(--reactist-font-size-body);font-weight:var(--reactist-font-weight-regular);color:var(--reactist-content-primary)}._266d6623{font-size:var(--reactist-font-size-caption)}.a8d37c6e{font-size:var(--reactist-font-size-copy)}._39f4eb1f{font-size:var(--reactist-font-size-subtitle)}._7be5c531{font-weight:var(--reactist-font-weight-medium)}.e214ff2e{font-weight:var(--reactist-font-weight-strong)}._6a3e5ade{color:var(--reactist-content-secondary)}._8f5b5f2b{color:var(--reactist-content-danger)}._9ae47ae4{color:var(--reactist-content-positive)}._969f18f7{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}._2f303ac3{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d3e04245{-webkit-line-clamp:2}._33411704{-webkit-line-clamp:3}.bfc32640{-webkit-line-clamp:4}.f813c82f{-webkit-line-clamp:5}
|
|
2
|
-
.
|
|
2
|
+
:root{--reactist-field-label-padding-bottom:var(--reactist-spacing-small);--reactist-field-label-line-height:inherit}._73a117b9{font-family:var(--reactist-font-family)}._73a117b9 .b5fd58e9,._73a117b9 label{padding-bottom:var(--reactist-field-label-padding-bottom);line-height:var(--reactist-field-label-line-height)}._73a117b9._5c9cc34c{border-radius:var(--reactist-border-radius-large);border:1px solid var(--reactist-inputs-idle);padding:var(--reactist-spacing-small);padding-bottom:var(--reactist-spacing-xsmall);overflow:clip}._73a117b9._5c9cc34c label{flex-grow:1;cursor:text}._73a117b9._5c9cc34c label span{cursor:default}._73a117b9._5c9cc34c:focus-within{border-color:var(--reactist-inputs-focus)!important}._73a117b9._5c9cc34c._51ba84e7{border-color:var(--reactist-inputs-alert)!important}._73a117b9._5c9cc34c .ade93d9a{font-weight:500}._73a117b9._5c9cc34c .b5fd58e9{font-size:var(--reactist-font-size-caption)}._73a117b9:not(._5c9cc34c) .ade93d9a{font-weight:var(--reactist-font-weight-strong)}._73a117b9:not(._5c9cc34c) .b5fd58e9{font-size:var(--reactist-font-size-body)}.b5fd58e9{text-align:right}._35882154{vertical-align:bottom}
|
|
3
3
|
._3f3a401c{border-bottom:1px solid var(--reactist-divider-primary)}._03b05b70{border-bottom:1px solid var(--reactist-divider-secondary)}.b6f67ff8{border-bottom:1px solid var(--reactist-divider-tertiary)}
|
|
4
4
|
:root{--reactist-spinner-tint:var(--reactist-bg-brand);--reactist-spinner-fill:var(--reactist-framework-fill-crest)}@-webkit-keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._51539197{-webkit-animation-name:_54fbe2b3;animation-name:_54fbe2b3;-webkit-animation-duration:1.2s;animation-duration:1.2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.a0c466ed{fill:var(--reactist-spinner-tint)}._745b73d3{fill:var(--reactist-spinner-fill)}
|
|
5
5
|
.eae3d34f,.eae3d34f>:last-child{--reactist-columns-gap:0px}._9b4012c9{--reactist-columns-gap:var(--reactist-spacing-xsmall)}.e35e0320{--reactist-columns-gap:var(--reactist-spacing-small)}._0703e67f{--reactist-columns-gap:var(--reactist-spacing-medium)}._1cf15621{--reactist-columns-gap:var(--reactist-spacing-large)}._1c7dff67{--reactist-columns-gap:var(--reactist-spacing-xlarge)}._25bee9b6{--reactist-columns-gap:var(--reactist-spacing-xxlarge)}._4bb9987d{flex-basis:content}._9dd31975{flex-basis:auto}._38d11c0e{flex-basis:calc(50% - var(--reactist-columns-gap))}._7ac225c6{flex-basis:calc(33.33333% - var(--reactist-columns-gap))}._9c340680{flex-basis:calc(66.66667% - var(--reactist-columns-gap))}._81cb99d2{flex-basis:calc(25% - var(--reactist-columns-gap))}._10fd355f{flex-basis:calc(75% - var(--reactist-columns-gap))}._3ee66520{flex-basis:calc(20% - var(--reactist-columns-gap))}.df1201a5{flex-basis:calc(40% - var(--reactist-columns-gap))}.f772e0b2{flex-basis:calc(60% - var(--reactist-columns-gap))}._880cbbb1{flex-basis:calc(80% - var(--reactist-columns-gap))}
|
package/styles/switch-field.css
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
._3f3a401c{border-bottom:1px solid var(--reactist-divider-primary)}._03b05b70{border-bottom:1px solid var(--reactist-divider-secondary)}.b6f67ff8{border-bottom:1px solid var(--reactist-divider-tertiary)}
|
|
7
7
|
.a83bd4e0{font-family:var(--reactist-font-family);font-size:var(--reactist-font-size-body);font-weight:var(--reactist-font-weight-regular);color:var(--reactist-content-primary)}._266d6623{font-size:var(--reactist-font-size-caption)}.a8d37c6e{font-size:var(--reactist-font-size-copy)}._39f4eb1f{font-size:var(--reactist-font-size-subtitle)}._7be5c531{font-weight:var(--reactist-font-weight-medium)}.e214ff2e{font-weight:var(--reactist-font-weight-strong)}._6a3e5ade{color:var(--reactist-content-secondary)}._8f5b5f2b{color:var(--reactist-content-danger)}._9ae47ae4{color:var(--reactist-content-positive)}._969f18f7{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}._2f303ac3{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d3e04245{-webkit-line-clamp:2}._33411704{-webkit-line-clamp:3}.bfc32640{-webkit-line-clamp:4}.f813c82f{-webkit-line-clamp:5}
|
|
8
8
|
._618235b7{width:1px;height:1px;clip:rect(1px,1px,1px,1px);white-space:nowrap}
|
|
9
|
-
.
|
|
9
|
+
:root{--reactist-field-label-padding-bottom:var(--reactist-spacing-small);--reactist-field-label-line-height:inherit}._73a117b9{font-family:var(--reactist-font-family)}._73a117b9 .b5fd58e9,._73a117b9 label{padding-bottom:var(--reactist-field-label-padding-bottom);line-height:var(--reactist-field-label-line-height)}._73a117b9._5c9cc34c{border-radius:var(--reactist-border-radius-large);border:1px solid var(--reactist-inputs-idle);padding:var(--reactist-spacing-small);padding-bottom:var(--reactist-spacing-xsmall);overflow:clip}._73a117b9._5c9cc34c label{flex-grow:1;cursor:text}._73a117b9._5c9cc34c label span{cursor:default}._73a117b9._5c9cc34c:focus-within{border-color:var(--reactist-inputs-focus)!important}._73a117b9._5c9cc34c._51ba84e7{border-color:var(--reactist-inputs-alert)!important}._73a117b9._5c9cc34c .ade93d9a{font-weight:500}._73a117b9._5c9cc34c .b5fd58e9{font-size:var(--reactist-font-size-caption)}._73a117b9:not(._5c9cc34c) .ade93d9a{font-weight:var(--reactist-font-weight-strong)}._73a117b9:not(._5c9cc34c) .b5fd58e9{font-size:var(--reactist-font-size-body)}.b5fd58e9{text-align:right}._35882154{vertical-align:bottom}
|
|
10
10
|
:root{--reactist-spinner-tint:var(--reactist-bg-brand);--reactist-spinner-fill:var(--reactist-framework-fill-crest)}@-webkit-keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._51539197{-webkit-animation-name:_54fbe2b3;animation-name:_54fbe2b3;-webkit-animation-duration:1.2s;animation-duration:1.2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.a0c466ed{fill:var(--reactist-spinner-tint)}._745b73d3{fill:var(--reactist-spinner-fill)}
|
|
11
11
|
.eae3d34f,.eae3d34f>:last-child{--reactist-columns-gap:0px}._9b4012c9{--reactist-columns-gap:var(--reactist-spacing-xsmall)}.e35e0320{--reactist-columns-gap:var(--reactist-spacing-small)}._0703e67f{--reactist-columns-gap:var(--reactist-spacing-medium)}._1cf15621{--reactist-columns-gap:var(--reactist-spacing-large)}._1c7dff67{--reactist-columns-gap:var(--reactist-spacing-xlarge)}._25bee9b6{--reactist-columns-gap:var(--reactist-spacing-xxlarge)}._4bb9987d{flex-basis:content}._9dd31975{flex-basis:auto}._38d11c0e{flex-basis:calc(50% - var(--reactist-columns-gap))}._7ac225c6{flex-basis:calc(33.33333% - var(--reactist-columns-gap))}._9c340680{flex-basis:calc(66.66667% - var(--reactist-columns-gap))}._81cb99d2{flex-basis:calc(25% - var(--reactist-columns-gap))}._10fd355f{flex-basis:calc(75% - var(--reactist-columns-gap))}._3ee66520{flex-basis:calc(20% - var(--reactist-columns-gap))}.df1201a5{flex-basis:calc(40% - var(--reactist-columns-gap))}.f772e0b2{flex-basis:calc(60% - var(--reactist-columns-gap))}._880cbbb1{flex-basis:calc(80% - var(--reactist-columns-gap))}
|
|
12
12
|
:root{--reactist-switch-background:var(--reactist-framework-fill-summit);--reactist-switch-checked:var(--reactist-content-positive);--reactist-switch-toggle:var(--reactist-bg-default)}.bae487be,.bae487be *{font-family:var(--reactist-font-family);cursor:pointer}.bae487be._408d32a0,.bae487be._408d32a0 *{cursor:not-allowed}.bae487be._408d32a0._99b0ead7 ._5af09fb5,.bae487be._408d32a0 .a66e1846{opacity:.5}._5af09fb5{--tmp-switch-width:32px;--tmp-switch-height:18px;--tmp-inner-padding:3px;--tmp-handle-size:calc(var(--tmp-switch-height) - 2*var(--tmp-inner-padding));--tmp-slide-length:calc(var(--tmp-switch-width) - var(--tmp-handle-size) - var(--tmp-inner-padding));min-height:auto;border-radius:calc(var(--tmp-switch-height)/2);background-color:var(--reactist-switch-background);cursor:pointer;position:relative}._5af09fb5,._5af09fb5>div,._5af09fb5 input[type=checkbox]{width:var(--tmp-switch-width);height:var(--tmp-switch-height)}._0dcf70ec{position:absolute;display:block;padding:0;top:var(--tmp-inner-padding);left:var(--tmp-inner-padding);width:var(--tmp-handle-size);height:var(--tmp-handle-size);border-radius:50%;background:var(--reactist-switch-toggle);transition:left .28s cubic-bezier(.4,0,.2,1)}._99b0ead7 ._5af09fb5{background-color:var(--reactist-switch-checked)}._99b0ead7 ._5af09fb5 ._0dcf70ec{left:var(--tmp-slide-length)}.bae487be._1f5e7fd4 ._5af09fb5:after{border-radius:calc(var(--tmp-switch-height) + 4px);border:2px solid var(--reactist-actionable-primary-idle-fill);bottom:-4px;content:"";left:-4px;position:absolute;right:-4px;top:-4px}
|
package/styles/text-area.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.a83bd4e0{font-family:var(--reactist-font-family);font-size:var(--reactist-font-size-body);font-weight:var(--reactist-font-weight-regular);color:var(--reactist-content-primary)}._266d6623{font-size:var(--reactist-font-size-caption)}.a8d37c6e{font-size:var(--reactist-font-size-copy)}._39f4eb1f{font-size:var(--reactist-font-size-subtitle)}._7be5c531{font-weight:var(--reactist-font-weight-medium)}.e214ff2e{font-weight:var(--reactist-font-weight-strong)}._6a3e5ade{color:var(--reactist-content-secondary)}._8f5b5f2b{color:var(--reactist-content-danger)}._9ae47ae4{color:var(--reactist-content-positive)}._969f18f7{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}._2f303ac3{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d3e04245{-webkit-line-clamp:2}._33411704{-webkit-line-clamp:3}.bfc32640{-webkit-line-clamp:4}.f813c82f{-webkit-line-clamp:5}
|
|
2
|
-
.
|
|
2
|
+
:root{--reactist-field-label-padding-bottom:var(--reactist-spacing-small);--reactist-field-label-line-height:inherit}._73a117b9{font-family:var(--reactist-font-family)}._73a117b9 .b5fd58e9,._73a117b9 label{padding-bottom:var(--reactist-field-label-padding-bottom);line-height:var(--reactist-field-label-line-height)}._73a117b9._5c9cc34c{border-radius:var(--reactist-border-radius-large);border:1px solid var(--reactist-inputs-idle);padding:var(--reactist-spacing-small);padding-bottom:var(--reactist-spacing-xsmall);overflow:clip}._73a117b9._5c9cc34c label{flex-grow:1;cursor:text}._73a117b9._5c9cc34c label span{cursor:default}._73a117b9._5c9cc34c:focus-within{border-color:var(--reactist-inputs-focus)!important}._73a117b9._5c9cc34c._51ba84e7{border-color:var(--reactist-inputs-alert)!important}._73a117b9._5c9cc34c .ade93d9a{font-weight:500}._73a117b9._5c9cc34c .b5fd58e9{font-size:var(--reactist-font-size-caption)}._73a117b9:not(._5c9cc34c) .ade93d9a{font-weight:var(--reactist-font-weight-strong)}._73a117b9:not(._5c9cc34c) .b5fd58e9{font-size:var(--reactist-font-size-body)}.b5fd58e9{text-align:right}._35882154{vertical-align:bottom}
|
|
3
3
|
._3f3a401c{border-bottom:1px solid var(--reactist-divider-primary)}._03b05b70{border-bottom:1px solid var(--reactist-divider-secondary)}.b6f67ff8{border-bottom:1px solid var(--reactist-divider-tertiary)}
|
|
4
4
|
:root{--reactist-spinner-tint:var(--reactist-bg-brand);--reactist-spinner-fill:var(--reactist-framework-fill-crest)}@-webkit-keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._51539197{-webkit-animation-name:_54fbe2b3;animation-name:_54fbe2b3;-webkit-animation-duration:1.2s;animation-duration:1.2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.a0c466ed{fill:var(--reactist-spinner-tint)}._745b73d3{fill:var(--reactist-spinner-fill)}
|
|
5
5
|
.eae3d34f,.eae3d34f>:last-child{--reactist-columns-gap:0px}._9b4012c9{--reactist-columns-gap:var(--reactist-spacing-xsmall)}.e35e0320{--reactist-columns-gap:var(--reactist-spacing-small)}._0703e67f{--reactist-columns-gap:var(--reactist-spacing-medium)}._1cf15621{--reactist-columns-gap:var(--reactist-spacing-large)}._1c7dff67{--reactist-columns-gap:var(--reactist-spacing-xlarge)}._25bee9b6{--reactist-columns-gap:var(--reactist-spacing-xxlarge)}._4bb9987d{flex-basis:content}._9dd31975{flex-basis:auto}._38d11c0e{flex-basis:calc(50% - var(--reactist-columns-gap))}._7ac225c6{flex-basis:calc(33.33333% - var(--reactist-columns-gap))}._9c340680{flex-basis:calc(66.66667% - var(--reactist-columns-gap))}._81cb99d2{flex-basis:calc(25% - var(--reactist-columns-gap))}._10fd355f{flex-basis:calc(75% - var(--reactist-columns-gap))}._3ee66520{flex-basis:calc(20% - var(--reactist-columns-gap))}.df1201a5{flex-basis:calc(40% - var(--reactist-columns-gap))}.f772e0b2{flex-basis:calc(60% - var(--reactist-columns-gap))}._880cbbb1{flex-basis:calc(80% - var(--reactist-columns-gap))}
|
package/styles/text-field.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.a83bd4e0{font-family:var(--reactist-font-family);font-size:var(--reactist-font-size-body);font-weight:var(--reactist-font-weight-regular);color:var(--reactist-content-primary)}._266d6623{font-size:var(--reactist-font-size-caption)}.a8d37c6e{font-size:var(--reactist-font-size-copy)}._39f4eb1f{font-size:var(--reactist-font-size-subtitle)}._7be5c531{font-weight:var(--reactist-font-weight-medium)}.e214ff2e{font-weight:var(--reactist-font-weight-strong)}._6a3e5ade{color:var(--reactist-content-secondary)}._8f5b5f2b{color:var(--reactist-content-danger)}._9ae47ae4{color:var(--reactist-content-positive)}._969f18f7{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}._2f303ac3{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.d3e04245{-webkit-line-clamp:2}._33411704{-webkit-line-clamp:3}.bfc32640{-webkit-line-clamp:4}.f813c82f{-webkit-line-clamp:5}
|
|
2
|
-
.
|
|
2
|
+
:root{--reactist-field-label-padding-bottom:var(--reactist-spacing-small);--reactist-field-label-line-height:inherit}._73a117b9{font-family:var(--reactist-font-family)}._73a117b9 .b5fd58e9,._73a117b9 label{padding-bottom:var(--reactist-field-label-padding-bottom);line-height:var(--reactist-field-label-line-height)}._73a117b9._5c9cc34c{border-radius:var(--reactist-border-radius-large);border:1px solid var(--reactist-inputs-idle);padding:var(--reactist-spacing-small);padding-bottom:var(--reactist-spacing-xsmall);overflow:clip}._73a117b9._5c9cc34c label{flex-grow:1;cursor:text}._73a117b9._5c9cc34c label span{cursor:default}._73a117b9._5c9cc34c:focus-within{border-color:var(--reactist-inputs-focus)!important}._73a117b9._5c9cc34c._51ba84e7{border-color:var(--reactist-inputs-alert)!important}._73a117b9._5c9cc34c .ade93d9a{font-weight:500}._73a117b9._5c9cc34c .b5fd58e9{font-size:var(--reactist-font-size-caption)}._73a117b9:not(._5c9cc34c) .ade93d9a{font-weight:var(--reactist-font-weight-strong)}._73a117b9:not(._5c9cc34c) .b5fd58e9{font-size:var(--reactist-font-size-body)}.b5fd58e9{text-align:right}._35882154{vertical-align:bottom}
|
|
3
3
|
._3f3a401c{border-bottom:1px solid var(--reactist-divider-primary)}._03b05b70{border-bottom:1px solid var(--reactist-divider-secondary)}.b6f67ff8{border-bottom:1px solid var(--reactist-divider-tertiary)}
|
|
4
4
|
:root{--reactist-spinner-tint:var(--reactist-bg-brand);--reactist-spinner-fill:var(--reactist-framework-fill-crest)}@-webkit-keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes _54fbe2b3{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}._51539197{-webkit-animation-name:_54fbe2b3;animation-name:_54fbe2b3;-webkit-animation-duration:1.2s;animation-duration:1.2s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear}.a0c466ed{fill:var(--reactist-spinner-tint)}._745b73d3{fill:var(--reactist-spinner-fill)}
|
|
5
5
|
.eae3d34f,.eae3d34f>:last-child{--reactist-columns-gap:0px}._9b4012c9{--reactist-columns-gap:var(--reactist-spacing-xsmall)}.e35e0320{--reactist-columns-gap:var(--reactist-spacing-small)}._0703e67f{--reactist-columns-gap:var(--reactist-spacing-medium)}._1cf15621{--reactist-columns-gap:var(--reactist-spacing-large)}._1c7dff67{--reactist-columns-gap:var(--reactist-spacing-xlarge)}._25bee9b6{--reactist-columns-gap:var(--reactist-spacing-xxlarge)}._4bb9987d{flex-basis:content}._9dd31975{flex-basis:auto}._38d11c0e{flex-basis:calc(50% - var(--reactist-columns-gap))}._7ac225c6{flex-basis:calc(33.33333% - var(--reactist-columns-gap))}._9c340680{flex-basis:calc(66.66667% - var(--reactist-columns-gap))}._81cb99d2{flex-basis:calc(25% - var(--reactist-columns-gap))}._10fd355f{flex-basis:calc(75% - var(--reactist-columns-gap))}._3ee66520{flex-basis:calc(20% - var(--reactist-columns-gap))}.df1201a5{flex-basis:calc(40% - var(--reactist-columns-gap))}.f772e0b2{flex-basis:calc(60% - var(--reactist-columns-gap))}._880cbbb1{flex-basis:calc(80% - var(--reactist-columns-gap))}
|