@redsift/design-system 11.8.2 → 11.8.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../src/components/text-field/types.ts","../../src/components/text-field/styles.ts","../../src/components/text-field/intl/index.ts","../../src/components/text-field/TextField.tsx"],"sourcesContent":["import { ChangeEvent, ComponentProps, MutableRefObject, ReactNode } from 'react';\nimport { ButtonsColorPalette, StylingProps, Theme, ValueOf } from '../../types';\nimport { IconProps } from '../icon';\nimport { IconButtonProps } from '../icon-button';\nimport { PillProps } from '../pill';\n\n/**\n * Component variant.\n */\nexport const TextFieldVariant = {\n default: 'default',\n underline: 'underline',\n} as const;\nexport type TextFieldVariant = ValueOf<typeof TextFieldVariant>;\n\n/**\n * Component color.\n */\nexport type TextFieldColor = ButtonsColorPalette;\n\n/**\n * Component props.\n */\nexport interface TextFieldProps extends Omit<ComponentProps<'div'>, 'onChange'>, StylingProps {\n /** Whether the component can be autofocused. */\n autoFocus?: boolean;\n /** Color variant. */\n color?: TextFieldColor;\n /** Force color even when not focused. */\n forceColor?: boolean;\n /**\n * Default value.\n * Used for uncontrolled version.\n */\n defaultValue?: string;\n /** Whether the clear button is displayed or not. */\n hasClearButton?: boolean | Omit<Partial<IconButtonProps>, 'ref'>;\n /** Place for icon buttons between the clear button and the separator. */\n internal?:\n | ReactNode\n | ((value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => ReactNode);\n /** Place for icon buttons after the separator. */\n after?: ReactNode | ((value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => ReactNode);\n /** Custom props to pass to the input element. */\n inputProps?: ComponentProps<'input'>;\n /** Custom ref object to pass to the input element. */\n inputRef?: MutableRefObject<HTMLInputElement>;\n /** @deprecated Whether the component should use the product colors or shades of grey. */\n isColored?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is invalid or not. */\n isInvalid?: boolean;\n /** Whether the component is read only or not. */\n isReadOnly?: boolean;\n /** Whether the component is required or not. */\n isRequired?: boolean;\n /** Label */\n label?: string;\n /**\n * Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />\n * Can also be a ReactElement.\n */\n leftIcon?: Omit<IconProps, 'ref'>;\n /** Name to pass to the input element. */\n name?: string;\n /** Method to handle component change. */\n onChange?(value?: string, name?: string, event?: ChangeEvent<HTMLInputElement>): void;\n /** Method to handle component clear. */\n onClear?(): void;\n /** List of Pills. */\n pills?: Omit<PillProps, 'ref'>[];\n /** Placeholder. */\n placeholder?: string;\n /** Theme. */\n theme?: Theme;\n /** Input type. */\n type?: string;\n /**\n * Input value.\n * Used for controlled version.\n */\n value?: string;\n /** TextField variant. */\n variant?: TextFieldVariant;\n}\n\nexport type StyledTextFieldProps = Omit<\n TextFieldProps,\n 'color' | 'isColored' | 'isDisabled' | 'isInvalid' | 'isRequired' | 'onChange'\n> & {\n $color: TextFieldProps['color'];\n $isGradient: boolean;\n $hasLeftIcon: boolean;\n $hasContent: boolean;\n $isDisabled: TextFieldProps['isDisabled'];\n $isInvalid: TextFieldProps['isInvalid'];\n $isFocused: boolean;\n $isFocusVisible: boolean;\n $isRequired: TextFieldProps['isRequired'];\n $theme: TextFieldProps['theme'];\n $variant: TextFieldProps['variant'];\n};\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledTextFieldProps, TextFieldVariant } from './types';\nimport { Theme } from '@redsift/design-system/types';\n\n/**\n * Component style.\n */\nexport const StyledTextField = styled.div<StyledTextFieldProps>`\n height: fit-content;\n position: relative;\n width: fit-content;\n margin: 0;\n min-width: 0;\n padding: 0;\n ${baseStyling}\n\n border: 0;\n display: inline-flex;\n flex-direction: column;\n vertical-align: top;\n\n ${({\n label,\n $hasLeftIcon,\n $hasContent,\n $isFocused,\n $isDisabled,\n $isInvalid,\n $color,\n $isGradient,\n $theme,\n $variant,\n }) => css`\n ${$isDisabled\n ? css`\n pointer-events: none;\n `\n : ''}\n\n .redsift-text-field__label {\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n left: ${$hasLeftIcon && !$hasContent ? '32px' : '0'};\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: ${$hasContent ? '-8px' : '-7px'};\n transform-origin: top left;\n transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,\n max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n white-space: nowrap;\n z-index: 1;\n\n ${!$hasContent\n ? css`\n max-width: calc(100% - 24px);\n transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 16px) scale(1);\n `\n : css`\n max-width: calc(133% - 32px);\n transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 1px) scale(0.733);\n `}\n\n ${!$isGradient\n ? css`\n color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'});\n ${$variant !== TextFieldVariant.underline\n ? css`\n padding-right: 7px;\n padding-left: 5px;\n `\n : ''}\n > span {\n background: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n background-clip: text;\n color: transparent;\n }\n `}\n }\n\n .redsift-text-field__input-wrapper {\n align-items: flex-start;\n box-sizing: border-box;\n cursor: text;\n display: inline-flex;\n min-height: 42px;\n position: relative;\n }\n\n .redsift-text-field-input-wrapper__pills-and-input {\n align-items: flex-start;\n box-sizing: border-box;\n display: flex;\n flex-direction: column-reverse;\n flex-wrap: wrap;\n flex: 1 1 auto;\n padding-bottom: 7px;\n ${$variant !== TextFieldVariant.underline && !$hasLeftIcon\n ? css`\n padding-left: 16px;\n `\n : ''}\n padding-top: ${label ? '9px' : '7px'};\n\n .redsift-pill {\n margin: 3px 6px 3px 0;\n }\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input {\n background: none;\n border: 0;\n box-sizing: content-box;\n display: flex;\n flex: 1 1 auto;\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n min-width: 0;\n min-width: 100px;\n padding: 2px 0;\n width: 100%;\n\n ${$isDisabled\n ? css`\n color: var(--redsift-color-grey-l2);\n `\n : css`\n color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input::placeholder {\n color: var(--redsift-color-neutral-mid-grey);\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input:focus {\n outline: 0;\n }\n\n .redsift-text-field-input-wrapper__fieldset {\n border-style: solid;\n bottom: 0;\n left: 1px;\n margin: 0;\n min-width: 0%;\n overflow: hidden;\n padding: 0 8px;\n pointer-events: none;\n position: absolute;\n right: 0;\n text-align: left;\n top: -5px;\n\n ${!$isGradient || $isDisabled || !$isFocused || $isInvalid\n ? css`\n ${$variant === TextFieldVariant.underline\n ? css`\n border-bottom-width: 2px;\n `\n : css`\n border-radius: 4px;\n border-width: 2px;\n `}\n border-color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n ${$variant === TextFieldVariant.underline\n ? css`\n border-bottom: 2px solid transparent;\n `\n : css`\n border: 2px solid transparent;\n border-radius: 4px;\n `}\n background: transparent;\n background-clip: padding-box, border-box;\n background-origin: border-box;\n background-image: linear-gradient(\n 90deg,\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'}),\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'})\n ),\n var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-default);\n `}\n }\n\n .redsift-text-field-input-wrapper-fieldset__legend {\n display: block;\n float: unset;\n font-size: 11px;\n height: 11px;\n overflow: hidden;\n padding: 0;\n visibility: hidden;\n white-space: nowrap;\n width: auto;\n\n ${!$hasContent\n ? css`\n max-width: 0.01px;\n transition: max-width 50ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n `\n : css`\n max-width: 100%;\n transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;\n `}\n }\n\n .redsift-text-field-input-wrapper-fieldset__legend > span {\n display: inline-block;\n opacity: 0;\n padding-left: 5px;\n padding-right: 5px;\n visibility: visible;\n }\n\n .redsift-text-field-input-wrapper__toolbar {\n position: relative;\n top: 9px;\n }\n\n .redsift-icon-button:not(.redsift-pill > .redsift-icon-button) {\n padding: 2px;\n position: relative;\n top: -2px;\n height: 28px;\n width: 28px;\n }\n\n ${$variant !== TextFieldVariant.underline\n ? css`\n .redsift-icon.left {\n padding-left: 12px;\n padding-right: 8px;\n line-height: 28px;\n }\n\n .redsift-text-field-input-wrapper__toolbar {\n padding-right: 8px;\n }\n `\n : css`\n .redsift-icon.left {\n padding-right: 8px;\n }\n `}\n\n .redsift-icon.left,\n .redsift-icon.right {\n top: 9px;\n }\n `}\n`;\n","import enUS from './en-US.json';\nimport frFR from './fr-FR.json';\n\nexport default {\n 'en-US': enUS,\n 'fr-FR': frFR,\n};\n","import React, { MouseEvent, ComponentProps, forwardRef, MutableRefObject, useCallback, useState } from 'react';\nimport classNames from 'classnames';\nimport { useFocusRing } from '../../react-aria/react-aria/focus';\nimport { useFocusWithin } from '../../react-aria/react-aria/interactions';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { TextFieldProps, TextFieldVariant } from './types';\nimport { StyledTextField } from './styles';\nimport { Icon } from '../../components/icon';\nimport { mdiClose } from '@redsift/icons';\nimport { Flexbox } from '../flexbox';\nimport { IconButton } from '../icon-button';\nimport { Pill } from '../pill';\nimport { useTheme } from '../theme';\nimport { useMessageFormatter } from '@redsift/design-system/react-aria/react-aria/i18n';\nimport { useId } from '../../utils';\n\nimport intlMessages from './intl';\n\nconst COMPONENT_NAME = 'TextField';\nconst CLASSNAME = 'redsift-text-field';\n\n/**\n * The TextField component.\n * Can be used as controlled or uncontrolled.\n */\nexport const TextField: Comp<TextFieldProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n after,\n autoFocus,\n className,\n color: propsColor,\n defaultValue = '',\n forceColor,\n hasClearButton,\n inputProps,\n inputRef,\n internal,\n isColored = true,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n label,\n leftIcon,\n name,\n onBlur: onBlurProps,\n onChange,\n onClear,\n onFocus: onFocusProps,\n pills,\n placeholder,\n theme: propsTheme,\n type,\n value: propsValue,\n variant = TextFieldVariant.default,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : isColored ? 'primary' : 'grey';\n const isGradient = color === ButtonsColorPalette.radar;\n\n const format = useMessageFormatter(intlMessages);\n\n const {\n isFocusVisible,\n isFocused,\n focusProps: { onFocus, onBlur },\n } = useFocusRing({\n autoFocus,\n });\n const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: (isFocusWithin) => setFocusWithin(isFocusWithin),\n });\n\n const [value, setValue] = useState(defaultValue);\n const isControlled = propsValue !== null && propsValue !== undefined;\n\n const [labelId] = useId();\n\n warnIfNoAccessibleLabelFound(props as ComponentProps<'label'>, [label], 'TextField');\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange(event.target.value, name, event);\n } else {\n setValue(event.target.value);\n }\n },\n [onChange]\n );\n\n const handleClear = useCallback(() => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange('');\n }\n if (onClear) {\n onClear();\n }\n if (hasClearButton && hasClearButton !== true && hasClearButton.onClick) {\n hasClearButton.onClick({} as MouseEvent<HTMLButtonElement>);\n }\n setValue('');\n }, [onChange]);\n\n return (\n <StyledTextField\n {...focusWithinProps}\n {...forwardedProps}\n $hasContent={\n isFocusWithin ||\n Boolean(isControlled ? propsValue : value) ||\n Boolean(placeholder) ||\n Boolean(pills && pills.length > 0)\n }\n $hasLeftIcon={Boolean(leftIcon)}\n $color={color}\n $isGradient={isGradient}\n $isDisabled={isDisabled}\n $isFocusVisible={isFocusVisible}\n $isInvalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n $isRequired={isRequired}\n $isFocused={Boolean(isFocused || forceColor)}\n $theme={theme}\n $variant={variant}\n className={classNames(TextField.className, className)}\n ref={ref as MutableRefObject<HTMLDivElement>}\n >\n <fieldset aria-hidden=\"true\" className={`${TextField.className}-input-wrapper__fieldset`}>\n <legend id={labelId} className={`${TextField.className}-input-wrapper-fieldset__legend`}>\n {label ? <span>{label}</span> : null}\n </legend>\n </fieldset>\n {label ? (\n <label className={`${TextField.className}__label`}>\n <span>{label}</span>\n </label>\n ) : null}\n <div className={`${TextField.className}__input-wrapper`}>\n {leftIcon ? (\n <Icon color={isDisabled ? 'question' : 'black'} {...leftIcon} aria-hidden=\"true\" className=\"left\" />\n ) : null}\n <div className={`${TextField.className}-input-wrapper__pills-and-input`}>\n <input\n {...inputProps}\n onBlur={(event) => {\n onBlur?.(event);\n onBlurProps?.(event);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n onFocusProps?.(event);\n }}\n aria-disabled={isDisabled}\n aria-invalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby || (label ? labelId : undefined)}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n autoFocus={autoFocus}\n className={`${TextField.className}-input-wrapper-pills-and-input__input`}\n disabled={isDisabled}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n ref={inputRef as MutableRefObject<HTMLInputElement>}\n type={type}\n value={isControlled ? propsValue : value}\n />\n <div>\n {pills?.map((pill, index) => (\n <Pill theme={theme} key={`${labelId}-pill-${index}`} color=\"blue\" size=\"small\" {...pill} />\n ))}\n </div>\n </div>\n {hasClearButton || internal || after ? (\n <Flexbox className={`${TextField.className}-input-wrapper__toolbar`} gap=\"8px\">\n {hasClearButton ? (\n <IconButton\n theme={theme}\n aria-label={label ? format('clear-field', { label }) : format('clear')}\n color=\"grey\"\n isDisabled={isDisabled}\n icon={mdiClose}\n {...(hasClearButton !== true && hasClearButton)}\n onClick={handleClear}\n className=\"right clear\"\n />\n ) : null}\n {typeof internal === 'function'\n ? internal(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : internal}\n {(hasClearButton || internal) && after ? (\n <span\n style={{\n borderLeft: '1px solid var(--redsift-color-neutral-mid-grey)',\n position: 'relative',\n top: '-2px',\n }}\n />\n ) : null}\n {typeof after === 'function'\n ? after(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : after}\n </Flexbox>\n ) : null}\n </div>\n </StyledTextField>\n );\n});\nTextField.className = CLASSNAME;\nTextField.displayName = COMPONENT_NAME;\n"],"names":["TextFieldVariant","default","underline","StyledTextField","styled","div","baseStyling","_ref","label","$hasLeftIcon","$hasContent","$isFocused","$isDisabled","$isInvalid","$color","$isGradient","$theme","$variant","css","Theme","dark","enUS","frFR","COMPONENT_NAME","CLASSNAME","TextField","forwardRef","props","ref","ariaLabel","ariaLabelledby","after","autoFocus","className","color","propsColor","defaultValue","forceColor","hasClearButton","inputProps","inputRef","internal","isColored","isDisabled","isInvalid","isReadOnly","isRequired","leftIcon","name","onBlur","onBlurProps","onChange","onClear","onFocus","onFocusProps","pills","placeholder","theme","propsTheme","type","value","propsValue","variant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","format","useMessageFormatter","intlMessages","isFocusVisible","isFocused","focusProps","useFocusRing","isFocusWithin","setFocusWithin","useState","Boolean","focusWithinProps","useFocusWithin","onFocusWithinChange","setValue","isControlled","undefined","labelId","useId","warnIfNoAccessibleLabelFound","handleChange","useCallback","event","target","handleClear","onClick","React","createElement","_extends","length","$isFocusVisible","$isRequired","classNames","id","Icon","disabled","map","pill","index","Pill","key","size","Flexbox","gap","IconButton","icon","mdiClose","style","borderLeft","position","top","displayName"],"mappings":";;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG;AAC9BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,SAAS,EAAE,WAAA;AACb,EAAU;;AAGV;AACA;AACA;;AAGA;AACA;AACA;;ACjBA;AACA;AACA;AACaC,MAAAA,eAAe,GAAGC,MAAM,CAACC,GAA0B,CAAA;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,WAAY,CAAA;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,EAAA,EAAIC,IAAA,IAAA;EAAA,IAAC;IACDC,KAAK;IACLC,YAAY;IACZC,WAAW;IACXC,UAAU;IACVC,WAAW;IACXC,UAAU;IACVC,MAAM;IACNC,WAAW;IACXC,MAAM;AACNC,IAAAA,QAAAA;AACF,GAAC,GAAAV,IAAA,CAAA;AAAA,EAAA,OAAKW,GAAI,CAAA;AACZ,IAAMN,EAAAA,WAAW,GACTM,GAAI,CAAA;AACZ;AACA,QAAA,CAAS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UAAU,GAAGD,KAAK,CAAE,EACjEd,UACF,CAAC,GACDL,QAAQ,EACX,CAACH,cAAc,IAAIG,QAAQ,KAAKV,KAAK,gBACpCoE,cAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACEoB,IAAAA,KAAK,EAAE;AACLC,MAAAA,UAAU,EAAE,iDAAiD;AAC7DC,MAAAA,QAAQ,EAAE,UAAU;AACpBC,MAAAA,GAAG,EAAE,MAAA;AACP,KAAA;AAAE,GACH,CAAC,GACA,IAAI,EACP,OAAO5F,KAAK,KAAK,UAAU,GACxBA,KAAK,CACHyD,YAAY,GAAG3B,UAAU,GAAGD,KAAK,EACjCjB,UAAU,EACVC,SAAS,IAAKE,UAAU,IAAI,EAAE0C,YAAY,GAAG3B,UAAU,GAAGD,KAAK,CAAE,EACjEd,UACF,CAAC,GACDf,KACG,CAAC,GACR,IACD,CACU,CAAC,CAAA;AAEtB,CAAC,EAAC;AACFN,SAAS,CAACQ,SAAS,GAAGT,SAAS,CAAA;AAC/BC,SAAS,CAACmG,WAAW,GAAGrG,cAAc;;;;"}
1
+ {"version":3,"file":"TextField.js","sources":["../../src/components/text-field/types.ts","../../src/components/text-field/styles.ts","../../src/components/text-field/intl/index.ts","../../src/components/text-field/TextField.tsx"],"sourcesContent":["import { ChangeEvent, ComponentProps, MutableRefObject, ReactNode } from 'react';\nimport { ButtonsColorPalette, StylingProps, Theme, ValueOf } from '../../types';\nimport { IconProps } from '../icon';\nimport { IconButtonProps } from '../icon-button';\nimport { PillProps } from '../pill';\n\n/**\n * Component variant.\n */\nexport const TextFieldVariant = {\n default: 'default',\n underline: 'underline',\n} as const;\nexport type TextFieldVariant = ValueOf<typeof TextFieldVariant>;\n\n/**\n * Component color.\n */\nexport type TextFieldColor = ButtonsColorPalette;\n\n/**\n * Component props.\n */\nexport interface TextFieldProps extends Omit<ComponentProps<'div'>, 'onChange'>, StylingProps {\n /** Whether the component can be autofocused. */\n autoFocus?: boolean;\n /** Color variant. */\n color?: TextFieldColor;\n /** Force color even when not focused. */\n forceColor?: boolean;\n /**\n * Default value.\n * Used for uncontrolled version.\n */\n defaultValue?: string;\n /** Whether the clear button is displayed or not. */\n hasClearButton?: boolean | Omit<Partial<IconButtonProps>, 'ref'>;\n /** Place for icon buttons between the clear button and the separator. */\n internal?:\n | ReactNode\n | ((value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => ReactNode);\n /** Place for icon buttons after the separator. */\n after?: ReactNode | ((value?: string, isDisabled?: boolean, isInvalid?: boolean, isRequired?: boolean) => ReactNode);\n /** Custom props to pass to the input element. */\n inputProps?: ComponentProps<'input'>;\n /** Custom ref object to pass to the input element. */\n inputRef?: MutableRefObject<HTMLInputElement>;\n /** @deprecated Whether the component should use the product colors or shades of grey. */\n isColored?: boolean;\n /** Whether the component is disabled or not. */\n isDisabled?: boolean;\n /** Whether the component is invalid or not. */\n isInvalid?: boolean;\n /** Whether the component is read only or not. */\n isReadOnly?: boolean;\n /** Whether the component is required or not. */\n isRequired?: boolean;\n /** Label */\n label?: string;\n /**\n * Can be a string or an array of strings containing `d` property of the `path` SVG element.<br />\n * Can also be a ReactElement.\n */\n leftIcon?: Omit<IconProps, 'ref'>;\n /** Name to pass to the input element. */\n name?: string;\n /** Method to handle component change. */\n onChange?(value?: string, name?: string, event?: ChangeEvent<HTMLInputElement>): void;\n /** Method to handle component clear. */\n onClear?(): void;\n /** List of Pills. */\n pills?: Omit<PillProps, 'ref'>[];\n /** Placeholder. */\n placeholder?: string;\n /** Theme. */\n theme?: Theme;\n /** Input type. */\n type?: string;\n /**\n * Input value.\n * Used for controlled version.\n */\n value?: string;\n /** TextField variant. */\n variant?: TextFieldVariant;\n}\n\nexport type StyledTextFieldProps = Omit<\n TextFieldProps,\n 'color' | 'isColored' | 'isDisabled' | 'isInvalid' | 'isRequired' | 'onChange'\n> & {\n $color: TextFieldProps['color'];\n $isGradient: boolean;\n $hasLeftIcon: boolean;\n $hasContent: boolean;\n $isDisabled: TextFieldProps['isDisabled'];\n $isInvalid: TextFieldProps['isInvalid'];\n $isFocused: boolean;\n $isFocusVisible: boolean;\n $isRequired: TextFieldProps['isRequired'];\n $theme: TextFieldProps['theme'];\n $variant: TextFieldProps['variant'];\n};\n","import styled, { css } from 'styled-components';\nimport { baseStyling } from '../shared';\nimport { StyledTextFieldProps, TextFieldVariant } from './types';\nimport { Theme } from '../../types';\n\n/**\n * Component style.\n */\nexport const StyledTextField = styled.div<StyledTextFieldProps>`\n height: fit-content;\n position: relative;\n width: fit-content;\n margin: 0;\n min-width: 0;\n padding: 0;\n ${baseStyling}\n\n border: 0;\n display: inline-flex;\n flex-direction: column;\n vertical-align: top;\n\n ${({\n label,\n $hasLeftIcon,\n $hasContent,\n $isFocused,\n $isDisabled,\n $isInvalid,\n $color,\n $isGradient,\n $theme,\n $variant,\n }) => css`\n ${$isDisabled\n ? css`\n pointer-events: none;\n `\n : ''}\n\n .redsift-text-field__label {\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n left: ${$hasLeftIcon && !$hasContent ? '32px' : '0'};\n overflow: hidden;\n pointer-events: none;\n position: absolute;\n text-overflow: ellipsis;\n top: ${$hasContent ? '-8px' : '-7px'};\n transform-origin: top left;\n transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,\n max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n white-space: nowrap;\n z-index: 1;\n\n ${!$hasContent\n ? css`\n max-width: calc(100% - 24px);\n transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 16px) scale(1);\n `\n : css`\n max-width: calc(133% - 32px);\n transform: translate(${$variant === TextFieldVariant.underline ? '0px' : '14px'}, 1px) scale(0.733);\n `}\n\n ${!$isGradient\n ? css`\n color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n background-color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'});\n ${$variant !== TextFieldVariant.underline\n ? css`\n padding-right: 7px;\n padding-left: 5px;\n `\n : ''}\n > span {\n background: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n background-clip: text;\n color: transparent;\n }\n `}\n }\n\n .redsift-text-field__input-wrapper {\n align-items: flex-start;\n box-sizing: border-box;\n cursor: text;\n display: inline-flex;\n min-height: 42px;\n position: relative;\n }\n\n .redsift-text-field-input-wrapper__pills-and-input {\n align-items: flex-start;\n box-sizing: border-box;\n display: flex;\n flex-direction: column-reverse;\n flex-wrap: wrap;\n flex: 1 1 auto;\n padding-bottom: 7px;\n ${$variant !== TextFieldVariant.underline && !$hasLeftIcon\n ? css`\n padding-left: 16px;\n `\n : ''}\n padding-top: ${label ? '9px' : '7px'};\n\n .redsift-pill {\n margin: 3px 6px 3px 0;\n }\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input {\n background: none;\n border: 0;\n box-sizing: content-box;\n display: flex;\n flex: 1 1 auto;\n font-family: var(--redsift-typography-input-text-font-family);\n font-size: var(--redsift-typography-input-text-font-size);\n font-weight: var(--redsift-typography-input-text-font-weight);\n line-height: var(--redsift-typography-input-text-line-height);\n min-width: 0;\n min-width: 100px;\n padding: 2px 0;\n width: 100%;\n\n ${$isDisabled\n ? css`\n color: var(--redsift-color-grey-l2);\n `\n : css`\n color: var(--redsift-color-neutral-${$theme === Theme.dark ? 'white' : 'x-dark-grey'});\n `}\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input::placeholder {\n color: var(--redsift-color-neutral-mid-grey);\n }\n\n .redsift-text-field-input-wrapper-pills-and-input__input:focus {\n outline: 0;\n }\n\n .redsift-text-field-input-wrapper__fieldset {\n border-style: solid;\n bottom: 0;\n left: 1px;\n margin: 0;\n min-width: 0%;\n overflow: hidden;\n padding: 0 8px;\n pointer-events: none;\n position: absolute;\n right: 0;\n text-align: left;\n top: -5px;\n\n ${!$isGradient || $isDisabled || !$isFocused || $isInvalid\n ? css`\n ${$variant === TextFieldVariant.underline\n ? css`\n border-bottom-width: 2px;\n `\n : css`\n border-radius: 4px;\n border-width: 2px;\n `}\n border-color: var(\n --redsift-color-${$theme}-components-buttons-secondary-button-${$isInvalid\n ? 'error'\n : $isFocused\n ? $color\n : 'grey'}-text-${$isDisabled ? 'disabled' : 'default'}\n );\n `\n : css`\n ${$variant === TextFieldVariant.underline\n ? css`\n border-bottom: 2px solid transparent;\n `\n : css`\n border: 2px solid transparent;\n border-radius: 4px;\n `}\n background: transparent;\n background-clip: padding-box, border-box;\n background-origin: border-box;\n background-image: linear-gradient(\n 90deg,\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'}),\n var(--redsift-color-neutral-${$theme === Theme.dark ? 'x-dark-grey' : 'white'})\n ),\n var(--redsift-color-${$theme}-components-buttons-secondary-button-${$color}-text-default);\n `}\n }\n\n .redsift-text-field-input-wrapper-fieldset__legend {\n display: block;\n float: unset;\n font-size: 11px;\n height: 11px;\n overflow: hidden;\n padding: 0;\n visibility: hidden;\n white-space: nowrap;\n width: auto;\n\n ${!$hasContent\n ? css`\n max-width: 0.01px;\n transition: max-width 50ms cubic-bezier(0, 0, 0.2, 1) 0ms;\n `\n : css`\n max-width: 100%;\n transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;\n `}\n }\n\n .redsift-text-field-input-wrapper-fieldset__legend > span {\n display: inline-block;\n opacity: 0;\n padding-left: 5px;\n padding-right: 5px;\n visibility: visible;\n }\n\n .redsift-text-field-input-wrapper__toolbar {\n position: relative;\n top: 9px;\n }\n\n .redsift-icon-button:not(.redsift-pill > .redsift-icon-button) {\n padding: 2px;\n position: relative;\n top: -2px;\n height: 28px;\n width: 28px;\n }\n\n ${$variant !== TextFieldVariant.underline\n ? css`\n .redsift-icon.left {\n padding-left: 12px;\n padding-right: 8px;\n line-height: 28px;\n }\n\n .redsift-text-field-input-wrapper__toolbar {\n padding-right: 8px;\n }\n `\n : css`\n .redsift-icon.left {\n padding-right: 8px;\n }\n `}\n\n .redsift-icon.left,\n .redsift-icon.right {\n top: 9px;\n }\n `}\n`;\n","import enUS from './en-US.json';\nimport frFR from './fr-FR.json';\n\nexport default {\n 'en-US': enUS,\n 'fr-FR': frFR,\n};\n","import React, { MouseEvent, ComponentProps, forwardRef, MutableRefObject, useCallback, useState } from 'react';\nimport classNames from 'classnames';\nimport { useFocusRing } from '../../react-aria/react-aria/focus';\nimport { useFocusWithin } from '../../react-aria/react-aria/interactions';\nimport { ButtonsColorPalette, Comp } from '../../types';\nimport { warnIfNoAccessibleLabelFound } from '../../utils/warnIfNoAccessibleLabelFound';\nimport { TextFieldProps, TextFieldVariant } from './types';\nimport { StyledTextField } from './styles';\nimport { Icon } from '../../components/icon';\nimport { mdiClose } from '@redsift/icons';\nimport { Flexbox } from '../flexbox';\nimport { IconButton } from '../icon-button';\nimport { Pill } from '../pill';\nimport { useTheme } from '../theme';\nimport { useMessageFormatter } from '../../react-aria/react-aria/i18n';\nimport { useId } from '../../utils';\n\nimport intlMessages from './intl';\n\nconst COMPONENT_NAME = 'TextField';\nconst CLASSNAME = 'redsift-text-field';\n\n/**\n * The TextField component.\n * Can be used as controlled or uncontrolled.\n */\nexport const TextField: Comp<TextFieldProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n after,\n autoFocus,\n className,\n color: propsColor,\n defaultValue = '',\n forceColor,\n hasClearButton,\n inputProps,\n inputRef,\n internal,\n isColored = true,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n label,\n leftIcon,\n name,\n onBlur: onBlurProps,\n onChange,\n onClear,\n onFocus: onFocusProps,\n pills,\n placeholder,\n theme: propsTheme,\n type,\n value: propsValue,\n variant = TextFieldVariant.default,\n ...forwardedProps\n } = props;\n\n const theme = useTheme(propsTheme);\n const color = Object.values(ButtonsColorPalette).includes(propsColor!) ? propsColor : isColored ? 'primary' : 'grey';\n const isGradient = color === ButtonsColorPalette.radar;\n\n const format = useMessageFormatter(intlMessages);\n\n const {\n isFocusVisible,\n isFocused,\n focusProps: { onFocus, onBlur },\n } = useFocusRing({\n autoFocus,\n });\n const [isFocusWithin, setFocusWithin] = useState(Boolean(autoFocus));\n const { focusWithinProps } = useFocusWithin({\n onFocusWithinChange: (isFocusWithin) => setFocusWithin(isFocusWithin),\n });\n\n const [value, setValue] = useState(defaultValue);\n const isControlled = propsValue !== null && propsValue !== undefined;\n\n const [labelId] = useId();\n\n warnIfNoAccessibleLabelFound(props as ComponentProps<'label'>, [label], 'TextField');\n\n const handleChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange(event.target.value, name, event);\n } else {\n setValue(event.target.value);\n }\n },\n [onChange]\n );\n\n const handleClear = useCallback(() => {\n if (isDisabled || isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange('');\n }\n if (onClear) {\n onClear();\n }\n if (hasClearButton && hasClearButton !== true && hasClearButton.onClick) {\n hasClearButton.onClick({} as MouseEvent<HTMLButtonElement>);\n }\n setValue('');\n }, [onChange]);\n\n return (\n <StyledTextField\n {...focusWithinProps}\n {...forwardedProps}\n $hasContent={\n isFocusWithin ||\n Boolean(isControlled ? propsValue : value) ||\n Boolean(placeholder) ||\n Boolean(pills && pills.length > 0)\n }\n $hasLeftIcon={Boolean(leftIcon)}\n $color={color}\n $isGradient={isGradient}\n $isDisabled={isDisabled}\n $isFocusVisible={isFocusVisible}\n $isInvalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n $isRequired={isRequired}\n $isFocused={Boolean(isFocused || forceColor)}\n $theme={theme}\n $variant={variant}\n className={classNames(TextField.className, className)}\n ref={ref as MutableRefObject<HTMLDivElement>}\n >\n <fieldset aria-hidden=\"true\" className={`${TextField.className}-input-wrapper__fieldset`}>\n <legend id={labelId} className={`${TextField.className}-input-wrapper-fieldset__legend`}>\n {label ? <span>{label}</span> : null}\n </legend>\n </fieldset>\n {label ? (\n <label className={`${TextField.className}__label`}>\n <span>{label}</span>\n </label>\n ) : null}\n <div className={`${TextField.className}__input-wrapper`}>\n {leftIcon ? (\n <Icon color={isDisabled ? 'question' : 'black'} {...leftIcon} aria-hidden=\"true\" className=\"left\" />\n ) : null}\n <div className={`${TextField.className}-input-wrapper__pills-and-input`}>\n <input\n {...inputProps}\n onBlur={(event) => {\n onBlur?.(event);\n onBlurProps?.(event);\n }}\n onFocus={(event) => {\n onFocus?.(event);\n onFocusProps?.(event);\n }}\n aria-disabled={isDisabled}\n aria-invalid={isInvalid || (isRequired && !(isControlled ? propsValue : value))}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby || (label ? labelId : undefined)}\n aria-readonly={isReadOnly}\n aria-required={isRequired}\n autoFocus={autoFocus}\n className={`${TextField.className}-input-wrapper-pills-and-input__input`}\n disabled={isDisabled}\n name={name}\n onChange={handleChange}\n placeholder={placeholder}\n ref={inputRef as MutableRefObject<HTMLInputElement>}\n type={type}\n value={isControlled ? propsValue : value}\n />\n <div>\n {pills?.map((pill, index) => (\n <Pill theme={theme} key={`${labelId}-pill-${index}`} color=\"blue\" size=\"small\" {...pill} />\n ))}\n </div>\n </div>\n {hasClearButton || internal || after ? (\n <Flexbox className={`${TextField.className}-input-wrapper__toolbar`} gap=\"8px\">\n {hasClearButton ? (\n <IconButton\n theme={theme}\n aria-label={label ? format('clear-field', { label }) : format('clear')}\n color=\"grey\"\n isDisabled={isDisabled}\n icon={mdiClose}\n {...(hasClearButton !== true && hasClearButton)}\n onClick={handleClear}\n className=\"right clear\"\n />\n ) : null}\n {typeof internal === 'function'\n ? internal(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : internal}\n {(hasClearButton || internal) && after ? (\n <span\n style={{\n borderLeft: '1px solid var(--redsift-color-neutral-mid-grey)',\n position: 'relative',\n top: '-2px',\n }}\n />\n ) : null}\n {typeof after === 'function'\n ? after(\n isControlled ? propsValue : value,\n isDisabled,\n isInvalid || (isRequired && !(isControlled ? propsValue : value)),\n isRequired\n )\n : after}\n </Flexbox>\n ) : null}\n </div>\n </StyledTextField>\n );\n});\nTextField.className = CLASSNAME;\nTextField.displayName = COMPONENT_NAME;\n"],"names":["TextFieldVariant","default","underline","StyledTextField","styled","div","baseStyling","_ref","label","$hasLeftIcon","$hasContent","$isFocused","$isDisabled","$isInvalid","$color","$isGradient","$theme","$variant","css","Theme","dark","enUS","frFR","COMPONENT_NAME","CLASSNAME","TextField","forwardRef","props","ref","ariaLabel","ariaLabelledby","after","autoFocus","className","color","propsColor","defaultValue","forceColor","hasClearButton","inputProps","inputRef","internal","isColored","isDisabled","isInvalid","isReadOnly","isRequired","leftIcon","name","onBlur","onBlurProps","onChange","onClear","onFocus","onFocusProps","pills","placeholder","theme","propsTheme","type","value","propsValue","variant","forwardedProps","_objectWithoutProperties","_excluded","useTheme","Object","values","ButtonsColorPalette","includes","isGradient","radar","format","useMessageFormatter","intlMessages","isFocusVisible","isFocused","focusProps","useFocusRing","isFocusWithin","setFocusWithin","useState","Boolean","focusWithinProps","useFocusWithin","onFocusWithinChange","setValue","isControlled","undefined","labelId","useId","warnIfNoAccessibleLabelFound","handleChange","useCallback","event","target","handleClear","onClick","React","createElement","_extends","length","$isFocusVisible","$isRequired","classNames","id","Icon","disabled","map","pill","index","Pill","key","size","Flexbox","gap","IconButton","icon","mdiClose","style","borderLeft","position","top","displayName"],"mappings":";;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAG;AAC9BC,EAAAA,OAAO,EAAE,SAAS;AAClBC,E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from './context.js';
1
+ export { A as AppContainerContext } from './context2.js';
2
2
  export { A as AppContainer, R as RadarSvgLinearGradient } from './AppContainer.js';
3
3
  //# sourceMappingURL=app-container.js.map
@@ -1,6 +1,300 @@
1
- import React__default from 'react';
1
+ import React__default, { useContext, useState, useMemo, useLayoutEffect, useRef, useEffect } from 'react';
2
2
 
3
- const AppContainerContext = /*#__PURE__*/React__default.createContext(null);
3
+ /* eslint-disable prefer-const */
4
+ // @ts-nocheck
5
+ /*
6
+ * Copyright 2020 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */
4
16
 
5
- export { AppContainerContext as A };
17
+ // https://en.wikipedia.org/wiki/Right-to-left
18
+ const RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);
19
+ const RTL_LANGS = new Set(['ae', 'ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', 'ku', 'mzn', 'nqo', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi']);
20
+
21
+ /**
22
+ * Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.
23
+ */
24
+ function isRTL(localeString) {
25
+ // If the Intl.Locale API is available, use it to get the locale's text direction.
26
+ // @ts-ignore
27
+ if (Intl.Locale) {
28
+ let locale = new Intl.Locale(localeString).maximize();
29
+
30
+ // Use the text info object to get the direction if possible.
31
+ // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.
32
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
33
+ let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;
34
+ if (textInfo) {
35
+ return textInfo.direction === 'rtl';
36
+ }
37
+
38
+ // Fallback: guess using the script.
39
+ // This is more accurate than guessing by language, since languages can be written in multiple scripts.
40
+ if (locale.script) {
41
+ return RTL_SCRIPTS.has(locale.script);
42
+ }
43
+ }
44
+
45
+ // If not, just guess by the language (first part of the locale)
46
+ let lang = localeString.split('-')[0];
47
+ return RTL_LANGS.has(lang);
48
+ }
49
+
50
+ /* eslint-disable prefer-const */
51
+
52
+ // To support SSR, the auto incrementing id counter is stored in a context. This allows
53
+ // it to be reset on every request to ensure the client and server are consistent.
54
+ // There is also a prefix string that is used to support async loading components
55
+ // Each async boundary must be wrapped in an SSR provider, which appends to the prefix
56
+ // and resets the current id counter. This ensures that async loaded components have
57
+ // consistent ids regardless of the loading order.
58
+ // Default context value to use in case there is no SSRProvider. This is fine for
59
+ // client-only apps. In order to support multiple copies of React Aria potentially
60
+ // being on the page at once, the prefix is set to a random number. SSRProvider
61
+ // will reset this to zero for consistency between server and client, so in the
62
+ // SSR case multiple copies of React Aria is not supported.
63
+ const defaultContext = {
64
+ prefix: String(Math.round(Math.random() * 10000000000)),
65
+ current: 0
66
+ };
67
+ const SSRContext = /*#__PURE__*/React__default.createContext(defaultContext);
68
+ const IsSSRContext = /*#__PURE__*/React__default.createContext(false);
69
+ // This is only used in React < 18.
70
+ function LegacySSRProvider(props) {
71
+ let cur = useContext(SSRContext);
72
+ let counter = useCounter(cur === defaultContext);
73
+ let [isSSR, setIsSSR] = useState(true);
74
+ let value = useMemo(() => ({
75
+ // If this is the first SSRProvider, start with an empty string prefix, otherwise
76
+ // append and increment the counter.
77
+ prefix: cur === defaultContext ? '' : `${cur.prefix}-${counter}`,
78
+ current: 0
79
+ }), [cur, counter]);
80
+
81
+ // If on the client, and the component was initially server rendered,
82
+ // then schedule a layout effect to update the component after hydration.
83
+ if (typeof document !== 'undefined') {
84
+ // This if statement technically breaks the rules of hooks, but is safe
85
+ // because the condition never changes after mounting.
86
+ // eslint-disable-next-line react-hooks/rules-of-hooks
87
+ useLayoutEffect(() => {
88
+ setIsSSR(false);
89
+ }, []);
90
+ }
91
+ return /*#__PURE__*/React__default.createElement(SSRContext.Provider, {
92
+ value: value
93
+ }, /*#__PURE__*/React__default.createElement(IsSSRContext.Provider, {
94
+ value: isSSR
95
+ }, props.children));
96
+ }
97
+ let warnedAboutSSRProvider = false;
98
+
99
+ /**
100
+ * When using SSR with React Aria in React 16 or 17, applications must be wrapped in an SSRProvider.
101
+ * This ensures that auto generated ids are consistent between the client and server.
102
+ */
103
+ function SSRProvider(props) {
104
+ if (typeof React__default['useId'] === 'function') {
105
+ if (process.env.NODE_ENV !== 'test' && !warnedAboutSSRProvider) {
106
+ console.warn('In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.');
107
+ warnedAboutSSRProvider = true;
108
+ }
109
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, props.children);
110
+ }
111
+ return /*#__PURE__*/React__default.createElement(LegacySSRProvider, props);
112
+ }
113
+ let canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);
114
+ let componentIds = new WeakMap();
115
+ function useCounter() {
116
+ let isDisabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
117
+ let ctx = useContext(SSRContext);
118
+ let ref = useRef(null);
119
+ if (ref.current === null && !isDisabled) {
120
+ var _React$__SECRET_INTER, _React$__SECRET_INTER2;
121
+ // In strict mode, React renders components twice, and the ref will be reset to null on the second render.
122
+ // This means our id counter will be incremented twice instead of once. This is a problem because on the
123
+ // server, components are only rendered once and so ids generated on the server won't match the client.
124
+ // In React 18, useId was introduced to solve this, but it is not available in older versions. So to solve this
125
+ // we need to use some React internals to access the underlying Fiber instance, which is stable between renders.
126
+ // This is exposed as ReactCurrentOwner in development, which is all we need since StrictMode only runs in development.
127
+ // To ensure that we only increment the global counter once, we store the starting id for this component in
128
+ // a weak map associated with the Fiber. On the second render, we reset the global counter to this value.
129
+ // Since React runs the second render immediately after the first, this is safe.
130
+ // @ts-ignore
131
+ let currentOwner = (_React$__SECRET_INTER = React__default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React$__SECRET_INTER === void 0 ? void 0 : (_React$__SECRET_INTER2 = _React$__SECRET_INTER.ReactCurrentOwner) === null || _React$__SECRET_INTER2 === void 0 ? void 0 : _React$__SECRET_INTER2.current;
132
+ if (currentOwner) {
133
+ let prevComponentValue = componentIds.get(currentOwner);
134
+ if (prevComponentValue == null) {
135
+ // On the first render, and first call to useId, store the id and state in our weak map.
136
+ componentIds.set(currentOwner, {
137
+ id: ctx.current,
138
+ state: currentOwner.memoizedState
139
+ });
140
+ } else if (currentOwner.memoizedState !== prevComponentValue.state) {
141
+ // On the second render, the memoizedState gets reset by React.
142
+ // Reset the counter, and remove from the weak map so we don't
143
+ // do this for subsequent useId calls.
144
+ ctx.current = prevComponentValue.id;
145
+ componentIds.delete(currentOwner);
146
+ }
147
+ }
148
+ ref.current = ++ctx.current;
149
+ }
150
+ return ref.current;
151
+ }
152
+ function useLegacySSRSafeId(defaultId) {
153
+ let ctx = useContext(SSRContext);
154
+
155
+ // If we are rendering in a non-DOM environment, and there's no SSRProvider,
156
+ // provide a warning to hint to the developer to add one.
157
+ if (ctx === defaultContext && !canUseDOM) {
158
+ console.warn('When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.');
159
+ }
160
+ let counter = useCounter(!!defaultId);
161
+ let prefix = ctx === defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`;
162
+ return defaultId || `${prefix}-${counter}`;
163
+ }
164
+ function useModernSSRSafeId(defaultId) {
165
+ // @ts-ignore
166
+ let id = React__default.useId();
167
+ let [didSSR] = useState(useIsSSR());
168
+ let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${defaultContext.prefix}`;
169
+ return defaultId || `${prefix}-${id}`;
170
+ }
171
+
172
+ // Use React.useId in React 18 if available, otherwise fall back to our old implementation.
173
+ /** @private */
174
+ const useSSRSafeId = typeof React__default['useId'] === 'function' ? useModernSSRSafeId : useLegacySSRSafeId;
175
+ function getSnapshot() {
176
+ return false;
177
+ }
178
+ function getServerSnapshot() {
179
+ return true;
180
+ }
181
+
182
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
183
+ function subscribe(onStoreChange) {
184
+ // noop
185
+ return () => {};
186
+ }
187
+
188
+ /**
189
+ * Returns whether the component is currently being server side rendered or
190
+ * hydrated on the client. Can be used to delay browser-specific rendering
191
+ * until after hydration.
192
+ */
193
+ function useIsSSR() {
194
+ // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.
195
+ if (typeof React__default['useSyncExternalStore'] === 'function') {
196
+ return React__default['useSyncExternalStore'](subscribe, getSnapshot, getServerSnapshot);
197
+ }
198
+
199
+ // eslint-disable-next-line react-hooks/rules-of-hooks
200
+ return useContext(IsSSRContext);
201
+ }
202
+
203
+ /* eslint-disable prefer-const */
204
+ // Locale passed from server by PackageLocalizationProvider.
205
+ const localeSymbol = Symbol.for('react-aria.i18n.locale');
206
+
207
+ /**
208
+ * Gets the locale setting of the browser.
209
+ */
210
+ function getDefaultLocale() {
211
+ let locale = typeof window !== 'undefined' && window[localeSymbol] ||
212
+ // @ts-ignore
213
+ typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage) || 'en-US';
214
+ try {
215
+ // @ts-ignore
216
+ Intl.DateTimeFormat.supportedLocalesOf([locale]);
217
+ } catch (_err) {
218
+ locale = 'en-US';
219
+ }
220
+ return {
221
+ locale,
222
+ direction: isRTL(locale) ? 'rtl' : 'ltr'
223
+ };
224
+ }
225
+ let currentLocale = getDefaultLocale();
226
+ let listeners = new Set();
227
+ function updateLocale() {
228
+ currentLocale = getDefaultLocale();
229
+ for (let listener of listeners) {
230
+ listener(currentLocale);
231
+ }
232
+ }
233
+
234
+ /**
235
+ * Returns the current browser/system language, and updates when it changes.
236
+ */
237
+ function useDefaultLocale() {
238
+ let isSSR = useIsSSR();
239
+ let [defaultLocale, setDefaultLocale] = useState(currentLocale);
240
+ useEffect(() => {
241
+ if (listeners.size === 0) {
242
+ window.addEventListener('languagechange', updateLocale);
243
+ }
244
+ listeners.add(setDefaultLocale);
245
+ return () => {
246
+ listeners.delete(setDefaultLocale);
247
+ if (listeners.size === 0) {
248
+ window.removeEventListener('languagechange', updateLocale);
249
+ }
250
+ };
251
+ }, []);
252
+
253
+ // We cannot determine the browser's language on the server, so default to
254
+ // en-US. This will be updated after hydration on the client to the correct value.
255
+ if (isSSR) {
256
+ return {
257
+ locale: 'en-US',
258
+ direction: 'ltr'
259
+ };
260
+ }
261
+ return defaultLocale;
262
+ }
263
+
264
+ /* eslint-disable prefer-const */
265
+ const I18nContext = /*#__PURE__*/React__default.createContext(null);
266
+
267
+ /**
268
+ * Provides the locale for the application to all child components.
269
+ */
270
+ function I18nProvider(props) {
271
+ let {
272
+ locale,
273
+ children
274
+ } = props;
275
+ let defaultLocale = useDefaultLocale();
276
+ let value = React__default.useMemo(() => {
277
+ if (!locale) {
278
+ return defaultLocale;
279
+ }
280
+ return {
281
+ locale,
282
+ direction: isRTL(locale) ? 'rtl' : 'ltr'
283
+ };
284
+ }, [defaultLocale, locale]);
285
+ return /*#__PURE__*/React__default.createElement(I18nContext.Provider, {
286
+ value: value
287
+ }, children);
288
+ }
289
+
290
+ /**
291
+ * Returns the current locale and layout direction.
292
+ */
293
+ function useLocale() {
294
+ let defaultLocale = useDefaultLocale();
295
+ let context = useContext(I18nContext);
296
+ return context || defaultLocale;
297
+ }
298
+
299
+ export { I18nProvider as I, SSRProvider as S, useSSRSafeId as a, useIsSSR as b, useLocale as u };
6
300
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["../../src/components/app-container/context.ts"],"sourcesContent":["import React from 'react';\nimport { AppContainerState } from './types';\n\nexport const AppContainerContext =\n React.createContext<AppContainerState | null>(null);\n"],"names":["AppContainerContext","React","createContext"],"mappings":";;AAGO,MAAMA,mBAAmB,gBAC9BC,cAAK,CAACC,aAAa,CAA2B,IAAI;;;;"}
1
+ {"version":3,"file":"context.js","sources":["../../src/react-aria/react-aria/i18n/utils.ts","../../src/react-aria/react-aria/ssr/SSRProvider.tsx","../../src/react-aria/react-aria/i18n/useDefaultLocale.ts","../../src/react-aria/react-aria/i18n/context.tsx"],"sourcesContent":["/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// https://en.wikipedia.org/wiki/Right-to-left\nconst RTL_SCRIPTS = new Set(['Arab', 'Syrc', 'Samr', 'Mand', 'Thaa', 'Mend', 'Nkoo', 'Adlm', 'Rohg', 'Hebr']);\nconst RTL_LANGS = new Set([\n 'ae',\n 'ar',\n 'arc',\n 'bcc',\n 'bqi',\n 'ckb',\n 'dv',\n 'fa',\n 'glk',\n 'he',\n 'ku',\n 'mzn',\n 'nqo',\n 'pnb',\n 'ps',\n 'sd',\n 'ug',\n 'ur',\n 'yi',\n]);\n\n/**\n * Determines if a locale is read right to left using [Intl.Locale]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale}.\n */\nexport function isRTL(localeString: string) {\n // If the Intl.Locale API is available, use it to get the locale's text direction.\n // @ts-ignore\n if (Intl.Locale) {\n let locale = new Intl.Locale(localeString).maximize();\n\n // Use the text info object to get the direction if possible.\n // @ts-ignore - this was implemented as a property by some browsers before it was standardized as a function.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo\n let textInfo = typeof locale.getTextInfo === 'function' ? locale.getTextInfo() : locale.textInfo;\n if (textInfo) {\n return textInfo.direction === 'rtl';\n }\n\n // Fallback: guess using the script.\n // This is more accurate than guessing by language, since languages can be written in multiple scripts.\n if (locale.script) {\n return RTL_SCRIPTS.has(locale.script);\n }\n }\n\n // If not, just guess by the language (first part of the locale)\n let lang = localeString.split('-')[0];\n return RTL_LANGS.has(lang);\n}\n","/* eslint-disable prefer-const */\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// We must avoid a circular dependency with @react-aria/utils, and this useLayoutEffect is\n// guarded by a check that it only runs on the client side.\nimport React, { ReactNode, useContext, useLayoutEffect, useMemo, useRef, useState } from 'react';\n\n// To support SSR, the auto incrementing id counter is stored in a context. This allows\n// it to be reset on every request to ensure the client and server are consistent.\n// There is also a prefix string that is used to support async loading components\n// Each async boundary must be wrapped in an SSR provider, which appends to the prefix\n// and resets the current id counter. This ensures that async loaded components have\n// consistent ids regardless of the loading order.\ninterface SSRContextValue {\n prefix: string;\n current: number;\n}\n\n// Default context value to use in case there is no SSRProvider. This is fine for\n// client-only apps. In order to support multiple copies of React Aria potentially\n// being on the page at once, the prefix is set to a random number. SSRProvider\n// will reset this to zero for consistency between server and client, so in the\n// SSR case multiple copies of React Aria is not supported.\nconst defaultContext: SSRContextValue = {\n prefix: String(Math.round(Math.random() * 10000000000)),\n current: 0,\n};\n\nconst SSRContext = React.createContext<SSRContextValue>(defaultContext);\nconst IsSSRContext = React.createContext(false);\n\nexport interface SSRProviderProps {\n /** Your application here. */\n children: ReactNode;\n}\n\n// This is only used in React < 18.\nfunction LegacySSRProvider(props: SSRProviderProps): JSX.Element {\n let cur = useContext(SSRContext);\n let counter = useCounter(cur === defaultContext);\n let [isSSR, setIsSSR] = useState(true);\n let value: SSRContextValue = useMemo(\n () => ({\n // If this is the first SSRProvider, start with an empty string prefix, otherwise\n // append and increment the counter.\n prefix: cur === defaultContext ? '' : `${cur.prefix}-${counter}`,\n current: 0,\n }),\n [cur, counter]\n );\n\n // If on the client, and the component was initially server rendered,\n // then schedule a layout effect to update the component after hydration.\n if (typeof document !== 'undefined') {\n // This if statement technically breaks the rules of hooks, but is safe\n // because the condition never changes after mounting.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return (\n <SSRContext.Provider value={value}>\n <IsSSRContext.Provider value={isSSR}>{props.children}</IsSSRContext.Provider>\n </SSRContext.Provider>\n );\n}\n\nlet warnedAboutSSRProvider = false;\n\n/**\n * When using SSR with React Aria in React 16 or 17, applications must be wrapped in an SSRProvider.\n * This ensures that auto generated ids are consistent between the client and server.\n */\nexport function SSRProvider(props: SSRProviderProps): JSX.Element {\n if (typeof React['useId'] === 'function') {\n if (process.env.NODE_ENV !== 'test' && !warnedAboutSSRProvider) {\n console.warn('In React 18, SSRProvider is not necessary and is a noop. You can remove it from your app.');\n warnedAboutSSRProvider = true;\n }\n return <>{props.children}</>;\n }\n return <LegacySSRProvider {...props} />;\n}\n\nlet canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement);\n\nlet componentIds = new WeakMap();\n\nfunction useCounter(isDisabled = false) {\n let ctx = useContext(SSRContext);\n let ref = useRef<number | null>(null);\n if (ref.current === null && !isDisabled) {\n // In strict mode, React renders components twice, and the ref will be reset to null on the second render.\n // This means our id counter will be incremented twice instead of once. This is a problem because on the\n // server, components are only rendered once and so ids generated on the server won't match the client.\n // In React 18, useId was introduced to solve this, but it is not available in older versions. So to solve this\n // we need to use some React internals to access the underlying Fiber instance, which is stable between renders.\n // This is exposed as ReactCurrentOwner in development, which is all we need since StrictMode only runs in development.\n // To ensure that we only increment the global counter once, we store the starting id for this component in\n // a weak map associated with the Fiber. On the second render, we reset the global counter to this value.\n // Since React runs the second render immediately after the first, this is safe.\n // @ts-ignore\n let currentOwner = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;\n if (currentOwner) {\n let prevComponentValue = componentIds.get(currentOwner);\n if (prevComponentValue == null) {\n // On the first render, and first call to useId, store the id and state in our weak map.\n componentIds.set(currentOwner, {\n id: ctx.current,\n state: currentOwner.memoizedState,\n });\n } else if (currentOwner.memoizedState !== prevComponentValue.state) {\n // On the second render, the memoizedState gets reset by React.\n // Reset the counter, and remove from the weak map so we don't\n // do this for subsequent useId calls.\n ctx.current = prevComponentValue.id;\n componentIds.delete(currentOwner);\n }\n }\n\n ref.current = ++ctx.current;\n }\n\n return ref.current;\n}\n\nfunction useLegacySSRSafeId(defaultId?: string): string {\n let ctx = useContext(SSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider,\n // provide a warning to hint to the developer to add one.\n if (ctx === defaultContext && !canUseDOM) {\n console.warn(\n 'When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.'\n );\n }\n\n let counter = useCounter(!!defaultId);\n let prefix = ctx === defaultContext && process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${ctx.prefix}`;\n return defaultId || `${prefix}-${counter}`;\n}\n\nfunction useModernSSRSafeId(defaultId?: string): string {\n // @ts-ignore\n let id = React.useId();\n let [didSSR] = useState(useIsSSR());\n let prefix = didSSR || process.env.NODE_ENV === 'test' ? 'react-aria' : `react-aria${defaultContext.prefix}`;\n return defaultId || `${prefix}-${id}`;\n}\n\n// Use React.useId in React 18 if available, otherwise fall back to our old implementation.\n/** @private */\nexport const useSSRSafeId = typeof React['useId'] === 'function' ? useModernSSRSafeId : useLegacySSRSafeId;\n\nfunction getSnapshot() {\n return false;\n}\n\nfunction getServerSnapshot() {\n return true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction subscribe(onStoreChange: () => void): () => void {\n // noop\n return () => {};\n}\n\n/**\n * Returns whether the component is currently being server side rendered or\n * hydrated on the client. Can be used to delay browser-specific rendering\n * until after hydration.\n */\nexport function useIsSSR(): boolean {\n // In React 18, we can use useSyncExternalStore to detect if we're server rendering or hydrating.\n if (typeof React['useSyncExternalStore'] === 'function') {\n return React['useSyncExternalStore'](subscribe, getSnapshot, getServerSnapshot);\n }\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useContext(IsSSRContext);\n}\n","/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { Direction } from '../../react-types/shared';\nimport { isRTL } from './utils';\nimport { useEffect, useState } from 'react';\nimport { useIsSSR } from '../ssr';\n\nexport interface Locale {\n /** The [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt) language code for the locale. */\n locale: string;\n /** The writing direction for the locale. */\n direction: Direction;\n}\n\n// Locale passed from server by PackageLocalizationProvider.\nconst localeSymbol = Symbol.for('react-aria.i18n.locale');\n\n/**\n * Gets the locale setting of the browser.\n */\nexport function getDefaultLocale(): Locale {\n let locale =\n (typeof window !== 'undefined' && window[localeSymbol]) ||\n // @ts-ignore\n (typeof navigator !== 'undefined' && (navigator.language || navigator.userLanguage)) ||\n 'en-US';\n\n try {\n // @ts-ignore\n Intl.DateTimeFormat.supportedLocalesOf([locale]);\n } catch (_err) {\n locale = 'en-US';\n }\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr',\n };\n}\n\nlet currentLocale = getDefaultLocale();\nlet listeners = new Set<(locale: Locale) => void>();\n\nfunction updateLocale() {\n currentLocale = getDefaultLocale();\n for (let listener of listeners) {\n listener(currentLocale);\n }\n}\n\n/**\n * Returns the current browser/system language, and updates when it changes.\n */\nexport function useDefaultLocale(): Locale {\n let isSSR = useIsSSR();\n let [defaultLocale, setDefaultLocale] = useState(currentLocale);\n\n useEffect(() => {\n if (listeners.size === 0) {\n window.addEventListener('languagechange', updateLocale);\n }\n\n listeners.add(setDefaultLocale);\n\n return () => {\n listeners.delete(setDefaultLocale);\n if (listeners.size === 0) {\n window.removeEventListener('languagechange', updateLocale);\n }\n };\n }, []);\n\n // We cannot determine the browser's language on the server, so default to\n // en-US. This will be updated after hydration on the client to the correct value.\n if (isSSR) {\n return {\n locale: 'en-US',\n direction: 'ltr',\n };\n }\n\n return defaultLocale;\n}\n","/* eslint-disable prefer-const */\n// @ts-nocheck\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { isRTL } from './utils';\nimport { Locale, useDefaultLocale } from './useDefaultLocale';\nimport React, { ReactNode, useContext } from 'react';\n\nexport interface I18nProviderProps {\n /** Contents that should have the locale applied. */\n children: ReactNode;\n /** The locale to apply to the children. */\n locale?: string;\n}\n\nconst I18nContext = React.createContext<Locale | null>(null);\n\n/**\n * Provides the locale for the application to all child components.\n */\nexport function I18nProvider(props: I18nProviderProps) {\n let { locale, children } = props;\n let defaultLocale = useDefaultLocale();\n\n let value: Locale = React.useMemo(() => {\n if (!locale) {\n return defaultLocale;\n }\n\n return {\n locale,\n direction: isRTL(locale) ? 'rtl' : 'ltr',\n };\n }, [defaultLocale, locale]);\n\n return <I18nContext.Provider value={value}>{children}</I18nContext.Provider>;\n}\n\n/**\n * Returns the current locale and layout direction.\n */\nexport function useLocale(): Locale {\n let defaultLocale = useDefaultLocale();\n let context = useContext(I18nContext);\n return context || defaultLocale;\n}\n"],"names":["RTL_SCRIPTS","Set","RTL_LANGS","isRTL","localeString","Intl","Locale","locale","maximize","textInfo","getTextInfo","direction","script","has","lang","split","defaultContext","prefix","String","Math","round","random","current","SSRContext","React","createContext","IsSSRContext","LegacySSRProvider","props","cur","useContext","counter","useCounter","isSSR","setIsSSR","useState","value","useMemo","document","useLayoutEffect","createElement","Provider","children","warnedAboutSSRProvider","SSRProvider","process","env","NODE_ENV","console","warn","Fragment","canUseDOM","Boolean","window","componentIds","WeakMap","isDisabled","arguments","length","undefined","ctx","ref","useRef","_React$__SECRET_INTER","_React$__SECRET_INTER2","currentOwner","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","prevComponentValue","get","set","id","state","memoizedState","delete","useLegacySSRSafeId","defaultId","useModernSSRSafeId","useId","didSSR","useIsSSR","useSSRSafeId","getSnapshot","getServerSnapshot","subscribe","onStoreChange","localeSymbol","Symbol","for","getDefaultLocale","navigator","language","userLanguage","DateTimeFormat","supportedLocalesOf","_err","currentLocale","listeners","updateLocale","listener","useDefaultLocale","defaultLocale","setDefaultLocale","useEffect","size","addEventListener","add","removeEventListener","I18nContext","I18nProvider","useLocale","context"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMA,WAAW,GAAG,IAAIC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